File tree Expand file tree Collapse file tree 6 files changed +85
-6
lines changed Expand file tree Collapse file tree 6 files changed +85
-6
lines changed Original file line number Diff line number Diff line change
1
+ import { App } from 'ionic-angular' ;
2
+
3
+ @App ( {
4
+ templateUrl : 'main.html'
5
+ } )
6
+ class ApiDemoApp {
7
+ brightness : number = 20 ;
8
+ saturation : number = 0 ;
9
+ warmth : number = 1300 ;
10
+ structure : any = { lower : 33 , upper : 60 } ;
11
+
12
+ onChange ( ev ) {
13
+ console . log ( "Changed" , ev ) ;
14
+ }
15
+ }
Original file line number Diff line number Diff line change
1
+ < ion-toolbar >
2
+ < ion-title > Range</ ion-title >
3
+ </ ion-toolbar >
4
+
5
+ < ion-content class ="outer-content ">
6
+ < ion-list >
7
+ < ion-list-header >
8
+ Brightness
9
+ < ion-badge item-right > {{brightness}}</ ion-badge >
10
+ </ ion-list-header >
11
+ < ion-item >
12
+ < ion-icon item-left small name ="sunny "> </ ion-icon >
13
+ < ion-range [(ngModel)] ="brightness "> </ ion-range >
14
+ < ion-icon item-right name ="sunny "> </ ion-icon >
15
+ </ ion-item >
16
+ </ ion-list >
17
+
18
+ < ion-list >
19
+ < ion-list-header >
20
+ Saturation
21
+ < ion-badge item-right secondary > {{saturation}}</ ion-badge >
22
+ </ ion-list-header >
23
+ < ion-item >
24
+ < ion-note item-left > -200</ ion-note >
25
+ < ion-range min ="-200 " max ="200 " pin ="true " [(ngModel)] ="saturation " secondary > </ ion-range >
26
+ < ion-note item-right > 200</ ion-note >
27
+ </ ion-item >
28
+ </ ion-list >
29
+
30
+ < ion-list >
31
+ < ion-list-header >
32
+ Warmth
33
+ < ion-badge item-right danger > {{warmth}}</ ion-badge >
34
+ </ ion-list-header >
35
+ < ion-item >
36
+ < ion-icon item-left small danger name ="thermometer "> </ ion-icon >
37
+ < ion-range min ="1000 " max ="2000 " step ="100 " snaps ="true " [(ngModel)] ="warmth " danger > </ ion-range >
38
+ < ion-icon item-right danger name ="thermometer "> </ ion-icon >
39
+ </ ion-item >
40
+ </ ion-list >
41
+
42
+ < ion-list >
43
+ < ion-list-header >
44
+ Structure
45
+ < ion-badge item-right dark > {{structure.lower}}</ ion-badge >
46
+ < ion-badge item-right dark > {{structure.upper}}</ ion-badge >
47
+ </ ion-list-header >
48
+ < ion-item >
49
+ < ion-note item-left > 0</ ion-note >
50
+ < ion-range dualKnobs ="true " pin ="true " [(ngModel)] ="structure " (ionChange) ="onChange($event) " dark > </ ion-range >
51
+ < ion-note item-right > 100</ ion-note >
52
+ </ ion-item >
53
+ </ ion-list >
54
+ </ ion-content >
Original file line number Diff line number Diff line change @@ -48,7 +48,6 @@ ion-range {
48
48
position : relative ;
49
49
display : block ;
50
50
51
- margin-top : -8px ;
52
51
padding : $range-ios-padding ;
53
52
}
54
53
@@ -173,7 +172,8 @@ ion-range {
173
172
@each $color-name , $color-base , $color-contrast in get-colors ($colors-ios ) {
174
173
175
174
ion-range [#{$color-name } ] {
176
- .range-bar-active {
175
+ .range-bar-active ,
176
+ .range-tick-active {
177
177
background : $color-base ;
178
178
}
179
179
}
Original file line number Diff line number Diff line change @@ -46,7 +46,6 @@ ion-range {
46
46
position : relative ;
47
47
display : block ;
48
48
49
- margin-top : -16px ;
50
49
padding : $range-md-padding ;
51
50
}
52
51
Original file line number Diff line number Diff line change @@ -10,7 +10,19 @@ import {pointerCoord} from '../../util/dom';
10
10
const RANGE_VALUE_ACCESSOR = new Provider (
11
11
NG_VALUE_ACCESSOR , { useExisting : forwardRef ( ( ) => Range ) , multi : true } ) ;
12
12
13
-
13
+ /**
14
+ * @name Range
15
+ * @description
16
+ * The Range slider lets users select from a range of values by moving
17
+ * the slider knob.
18
+ *
19
+ *
20
+ *
21
+ *
22
+ *
23
+ *
24
+ * @demo /docs/v2/demos/range/
25
+ */
14
26
@Component ( {
15
27
selector : '.range-knob-handle' ,
16
28
template :
@@ -231,7 +243,7 @@ export class Range {
231
243
/**
232
244
* @output {Range} Expression to evaluate when the range value changes.
233
245
*/
234
- @Output ( ) rangeChange : EventEmitter < Range > = new EventEmitter ( ) ;
246
+ @Output ( ) ionChange : EventEmitter < Range > = new EventEmitter ( ) ;
235
247
236
248
237
249
constructor (
Original file line number Diff line number Diff line change @@ -47,7 +47,6 @@ ion-range {
47
47
position : relative ;
48
48
display : block ;
49
49
50
- margin-top : -16px ;
51
50
padding : $range-wp-padding ;
52
51
}
53
52
You can’t perform that action at this time.
0 commit comments