@@ -34,30 +34,109 @@ const RCTSlider = requireNativeComponent('RCTSlider');
34
34
type Event = Object ;
35
35
36
36
type IOSProps = $ReadOnly < { |
37
+ /**
38
+ * Assigns a single image for the track. Only static images are supported.
39
+ * The center pixel of the image will be stretched to fill the track.
40
+ */
37
41
trackImage ?: ?ImageSource ,
42
+
43
+ /**
44
+ * Assigns a minimum track image. Only static images are supported. The
45
+ * rightmost pixel of the image will be stretched to fill the track.
46
+ */
38
47
minimumTrackImage ?: ?ImageSource ,
48
+
49
+ /**
50
+ * Assigns a maximum track image. Only static images are supported. The
51
+ * leftmost pixel of the image will be stretched to fill the track.
52
+ */
39
53
maximumTrackImage ?: ?ImageSource ,
54
+
55
+ /**
56
+ * Sets an image for the thumb. Only static images are supported.
57
+ */
40
58
thumbImage ?: ?ImageSource ,
41
59
| } > ;
42
60
43
61
type AndroidProps = $ReadOnly < { |
62
+ /**
63
+ * Color of the foreground switch grip.
64
+ * @platform android
65
+ */
44
66
thumbTintColor ?: ?ColorValue ,
45
67
| } > ;
46
68
47
69
type Props = $ReadOnly < { |
48
70
...ViewProps ,
49
71
...IOSProps ,
50
72
...AndroidProps ,
73
+
74
+ /**
75
+ * Used to style and layout the `Slider`. See `StyleSheet.js` and
76
+ * `ViewStylePropTypes.js` for more info.
77
+ */
51
78
style ?: ?ViewStyleProp ,
79
+
80
+ /**
81
+ * Initial value of the slider. The value should be between minimumValue
82
+ * and maximumValue, which default to 0 and 1 respectively.
83
+ * Default value is 0.
84
+ *
85
+ * *This is not a controlled component*, you don't need to update the
86
+ * value during dragging.
87
+ */
52
88
value ?: ?number ,
89
+
90
+ /**
91
+ * Step value of the slider. The value should be
92
+ * between 0 and (maximumValue - minimumValue).
93
+ * Default value is 0.
94
+ */
53
95
step ?: ?number ,
96
+
97
+ /**
98
+ * Initial minimum value of the slider. Default value is 0.
99
+ */
54
100
minimumValue ?: ?number ,
101
+
102
+ /**
103
+ * Initial maximum value of the slider. Default value is 1.
104
+ */
55
105
maximumValue ?: ?number ,
106
+
107
+ /**
108
+ * The color used for the track to the left of the button.
109
+ * Overrides the default blue gradient image on iOS.
110
+ */
56
111
minimumTrackTintColor ?: ?ColorValue ,
112
+
113
+ /**
114
+ * The color used for the track to the right of the button.
115
+ * Overrides the default blue gradient image on iOS.
116
+ */
57
117
maximumTrackTintColor ?: ?ColorValue ,
118
+
119
+ /**
120
+ * If true the user won't be able to move the slider.
121
+ * Default value is false.
122
+ */
58
123
disabled ?: ?boolean ,
124
+
125
+ /**
126
+ * Callback continuously called while the user is dragging the slider.
127
+ */
59
128
onValueChange ?: ?Function ,
129
+
130
+ /**
131
+ * Callback that is called when the user releases the slider,
132
+ * regardless if the value has changed. The current value is passed
133
+ * as an argument to the callback handler.
134
+ */
60
135
onSlidingComplete ?: ?Function ,
136
+
137
+ /**
138
+ * Used to locate this view in UI automation tests.
139
+ */
61
140
testID ?: ?string ,
62
141
| } > ;
63
142
@@ -127,106 +206,21 @@ const Slider = createReactClass({
127
206
128
207
propTypes : {
129
208
...ViewPropTypes ,
130
-
131
- /**
132
- * Used to style and layout the `Slider`. See `StyleSheet.js` and
133
- * `ViewStylePropTypes.js` for more info.
134
- */
135
209
style : ViewPropTypes . style ,
136
-
137
- /**
138
- * Initial value of the slider. The value should be between minimumValue
139
- * and maximumValue, which default to 0 and 1 respectively.
140
- * Default value is 0.
141
- *
142
- * *This is not a controlled component*, you don't need to update the
143
- * value during dragging.
144
- */
145
210
value : PropTypes . number ,
146
-
147
- /**
148
- * Step value of the slider. The value should be
149
- * between 0 and (maximumValue - minimumValue).
150
- * Default value is 0.
151
- */
152
211
step : PropTypes . number ,
153
-
154
- /**
155
- * Initial minimum value of the slider. Default value is 0.
156
- */
157
212
minimumValue : PropTypes . number ,
158
-
159
- /**
160
- * Initial maximum value of the slider. Default value is 1.
161
- */
162
213
maximumValue : PropTypes . number ,
163
-
164
- /**
165
- * The color used for the track to the left of the button.
166
- * Overrides the default blue gradient image on iOS.
167
- */
168
214
minimumTrackTintColor : ColorPropType ,
169
-
170
- /**
171
- * The color used for the track to the right of the button.
172
- * Overrides the default blue gradient image on iOS.
173
- */
174
215
maximumTrackTintColor : ColorPropType ,
175
-
176
- /**
177
- * If true the user won't be able to move the slider.
178
- * Default value is false.
179
- */
180
216
disabled : PropTypes . bool ,
181
-
182
- /**
183
- * Assigns a single image for the track. Only static images are supported.
184
- * The center pixel of the image will be stretched to fill the track.
185
- * @platform ios
186
- */
187
217
trackImage : Image . propTypes . source ,
188
-
189
- /**
190
- * Assigns a minimum track image. Only static images are supported. The
191
- * rightmost pixel of the image will be stretched to fill the track.
192
- * @platform ios
193
- */
194
218
minimumTrackImage : Image . propTypes . source ,
195
-
196
- /**
197
- * Assigns a maximum track image. Only static images are supported. The
198
- * leftmost pixel of the image will be stretched to fill the track.
199
- * @platform ios
200
- */
201
219
maximumTrackImage : Image . propTypes . source ,
202
-
203
- /**
204
- * Sets an image for the thumb. Only static images are supported.
205
- * @platform ios
206
- */
207
220
thumbImage : Image . propTypes . source ,
208
-
209
- /**
210
- * Color of the foreground switch grip.
211
- * @platform android
212
- */
213
221
thumbTintColor : ColorPropType ,
214
-
215
- /**
216
- * Callback continuously called while the user is dragging the slider.
217
- */
218
222
onValueChange : PropTypes . func ,
219
-
220
- /**
221
- * Callback that is called when the user releases the slider,
222
- * regardless if the value has changed. The current value is passed
223
- * as an argument to the callback handler.
224
- */
225
223
onSlidingComplete : PropTypes . func ,
226
-
227
- /**
228
- * Used to locate this view in UI automation tests.
229
- */
230
224
testID : PropTypes . string ,
231
225
} ,
232
226
0 commit comments