@amabeth/repeating-wheel-picker 1.1.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +20 -20
- package/README.md +57 -57
- package/example/index.ts +8 -0
- package/example/package.json +29 -0
- package/example/src/constants/styles.ts +43 -0
- package/example/src/hooks/useComponentHeight.ts +13 -0
- package/example/src/scenes/app.tsx +33 -0
- package/example/src/scenes/booleanPicker.tsx +60 -0
- package/example/src/scenes/customTypePicker.tsx +83 -0
- package/example/src/scenes/numberPicker.tsx +75 -0
- package/example/src/scenes/stringPicker.tsx +64 -0
- package/lib/module/index.js +6 -6
- package/lib/module/index.js.map +1 -1
- package/package.json +169 -183
- package/src/index.tsx +0 -507
package/src/index.tsx
DELETED
|
@@ -1,507 +0,0 @@
|
|
|
1
|
-
import { type RefObject, useEffect, useMemo, useRef, useState } from "react";
|
|
2
|
-
import {
|
|
3
|
-
type AnimatableNumericValue,
|
|
4
|
-
type ColorValue,
|
|
5
|
-
type LayoutChangeEvent,
|
|
6
|
-
Text,
|
|
7
|
-
type TextStyle,
|
|
8
|
-
View,
|
|
9
|
-
type ViewStyle,
|
|
10
|
-
VirtualizedList,
|
|
11
|
-
} from "react-native";
|
|
12
|
-
import { LinearGradient } from "expo-linear-gradient";
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Provides a wheel picker with repeating data that can be infinitely scrolled.
|
|
16
|
-
*
|
|
17
|
-
* @param properties configuration of the wheel picker
|
|
18
|
-
*/
|
|
19
|
-
export function RepeatingWheelPicker<T>(
|
|
20
|
-
properties: RepeatingWheelPickerProps<T>
|
|
21
|
-
) {
|
|
22
|
-
// set defaults for all unprovided optional properties
|
|
23
|
-
const props = useMemo(() => withDefaults(properties), [properties]);
|
|
24
|
-
// to always have enough data to scroll through, define how often the input data should be multiplied
|
|
25
|
-
const dataMultiplier = useMemo(
|
|
26
|
-
() => Math.max(Math.round(90 / props.data.length), 3),
|
|
27
|
-
[props.data.length]
|
|
28
|
-
);
|
|
29
|
-
// difference between centered index and top most visible index
|
|
30
|
-
const indexDiffTopToCentered = useMemo(
|
|
31
|
-
() => Math.floor(props.itemDisplayCount / 2),
|
|
32
|
-
[props.itemDisplayCount]
|
|
33
|
-
);
|
|
34
|
-
// offsets for all list elements
|
|
35
|
-
const offsets = useMemo((): number[] =>
|
|
36
|
-
getOffsets(
|
|
37
|
-
props.data.length,
|
|
38
|
-
props.itemDisplayCount,
|
|
39
|
-
props.itemHeight,
|
|
40
|
-
dataMultiplier),
|
|
41
|
-
[props.data.length, props.itemDisplayCount, props.itemHeight, dataMultiplier, props.containerVerticalPadding]
|
|
42
|
-
)
|
|
43
|
-
|
|
44
|
-
// current selected item (centered one)
|
|
45
|
-
const [current, setCurrent] = useState(() =>
|
|
46
|
-
props.initialIndex + props.data.length * Math.floor(dataMultiplier / 2)
|
|
47
|
-
);
|
|
48
|
-
const listRef = useRef<VirtualizedList<T>>(null);
|
|
49
|
-
|
|
50
|
-
// call "setSelected" when the current top item or the data changed
|
|
51
|
-
useEffect(() => {
|
|
52
|
-
const selectedElement =
|
|
53
|
-
props.data[current % props.data.length]; // centered element
|
|
54
|
-
|
|
55
|
-
if (selectedElement !== undefined) {
|
|
56
|
-
props.setSelected(selectedElement);
|
|
57
|
-
}
|
|
58
|
-
}, [current, props.data]);
|
|
59
|
-
|
|
60
|
-
return (
|
|
61
|
-
<View
|
|
62
|
-
onLayout={props.containerOnLayout}
|
|
63
|
-
style={{
|
|
64
|
-
...props.containerStyle,
|
|
65
|
-
height:
|
|
66
|
-
props.itemHeight * props.itemDisplayCount + props.containerVerticalPadding * 2
|
|
67
|
-
}}
|
|
68
|
-
>
|
|
69
|
-
<VirtualizedList<T>
|
|
70
|
-
ref={listRef}
|
|
71
|
-
scrollEnabled={props.enabled}
|
|
72
|
-
getItemCount={() => props.data.length * dataMultiplier}
|
|
73
|
-
|
|
74
|
-
initialScrollIndex={current - indexDiffTopToCentered}
|
|
75
|
-
initialNumToRender={props.data.length * dataMultiplier}
|
|
76
|
-
windowSize={props.data.length * dataMultiplier}
|
|
77
|
-
|
|
78
|
-
renderItem={({ item, index }) => (
|
|
79
|
-
<Item item={item} props={props} key={index} />
|
|
80
|
-
)}
|
|
81
|
-
getItem={(_, index) =>
|
|
82
|
-
props.data[index % props.data.length]!
|
|
83
|
-
}
|
|
84
|
-
getItemLayout={(_, index) => ({
|
|
85
|
-
length: props.itemHeight,
|
|
86
|
-
offset: offsets[index]!,
|
|
87
|
-
index: index,
|
|
88
|
-
})}
|
|
89
|
-
keyExtractor={(_, index) => `${index}`}
|
|
90
|
-
|
|
91
|
-
// disableIntervalMomentum={true}
|
|
92
|
-
decelerationRate="fast"
|
|
93
|
-
snapToOffsets={offsets}
|
|
94
|
-
|
|
95
|
-
onMomentumScrollEnd={(event) =>
|
|
96
|
-
onMomentumScrollEnd(
|
|
97
|
-
event.nativeEvent.contentOffset.y,
|
|
98
|
-
setCurrent,
|
|
99
|
-
props.data.length,
|
|
100
|
-
props.itemHeight,
|
|
101
|
-
dataMultiplier,
|
|
102
|
-
indexDiffTopToCentered,
|
|
103
|
-
props.containerVerticalPadding,
|
|
104
|
-
listRef
|
|
105
|
-
)
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
showsVerticalScrollIndicator={false}
|
|
109
|
-
style={{
|
|
110
|
-
flex: 1,
|
|
111
|
-
width: "100%",
|
|
112
|
-
borderRadius: props.containerStyle.borderRadius,
|
|
113
|
-
paddingVertical: props.containerVerticalPadding,
|
|
114
|
-
paddingHorizontal: props.containerHorizontalPadding
|
|
115
|
-
}}
|
|
116
|
-
/>
|
|
117
|
-
|
|
118
|
-
{ props.enableGradient &&
|
|
119
|
-
<View
|
|
120
|
-
style={{
|
|
121
|
-
backgroundColor: "transparent",
|
|
122
|
-
position: "absolute",
|
|
123
|
-
height: "100%",
|
|
124
|
-
width: "100%"
|
|
125
|
-
}}
|
|
126
|
-
>
|
|
127
|
-
<FrontGradient gradientFadeColor={props.gradientFadeColor} borderRadius={props.containerStyle.borderRadius} />
|
|
128
|
-
</View>
|
|
129
|
-
}
|
|
130
|
-
</View>
|
|
131
|
-
);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
function Item<T>({
|
|
135
|
-
item,
|
|
136
|
-
props,
|
|
137
|
-
}: {
|
|
138
|
-
item: T;
|
|
139
|
-
props: RepeatingWheelPickerPropsWithDefaults<T>;
|
|
140
|
-
}) {
|
|
141
|
-
|
|
142
|
-
return (
|
|
143
|
-
<View
|
|
144
|
-
style={{
|
|
145
|
-
justifyContent: "center",
|
|
146
|
-
alignContent: "center",
|
|
147
|
-
backgroundColor: "transparent",
|
|
148
|
-
...props.itemContainerStyle,
|
|
149
|
-
paddingVertical: 0,
|
|
150
|
-
height: props.itemHeight,
|
|
151
|
-
}}
|
|
152
|
-
>
|
|
153
|
-
<Text style={{ textAlign: "center", ...props.itemTextStyle }}>
|
|
154
|
-
{props.getLabel(item)}
|
|
155
|
-
</Text>
|
|
156
|
-
</View>
|
|
157
|
-
);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
function FrontGradient({ gradientFadeColor, borderRadius }: { gradientFadeColor: ColorValue, borderRadius: string | AnimatableNumericValue | undefined }) {
|
|
161
|
-
|
|
162
|
-
return (
|
|
163
|
-
<LinearGradient
|
|
164
|
-
colors={[gradientFadeColor, "transparent", gradientFadeColor]}
|
|
165
|
-
style={{
|
|
166
|
-
height: "100%",
|
|
167
|
-
width: "100%",
|
|
168
|
-
backgroundColor: "transparent",
|
|
169
|
-
borderRadius: borderRadius
|
|
170
|
-
}}
|
|
171
|
-
/>
|
|
172
|
-
);
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
function getOffsets(
|
|
176
|
-
dataLength: number,
|
|
177
|
-
itemDisplayCount: number,
|
|
178
|
-
itemHeight: number,
|
|
179
|
-
dataMultiplier: number
|
|
180
|
-
) {
|
|
181
|
-
let offsets = [];
|
|
182
|
-
|
|
183
|
-
// calculate offset for all items
|
|
184
|
-
for (let i = 0; i < dataLength * dataMultiplier; i++) {
|
|
185
|
-
offsets[i] = itemOffset(
|
|
186
|
-
i,
|
|
187
|
-
itemDisplayCount,
|
|
188
|
-
itemHeight
|
|
189
|
-
);
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
return offsets;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
function itemOffset(
|
|
196
|
-
index: number,
|
|
197
|
-
itemDisplayCount: number,
|
|
198
|
-
itemHeight: number
|
|
199
|
-
) {
|
|
200
|
-
|
|
201
|
-
return (index + (itemDisplayCount % 2 === 0 ? 0.5 : 0)) * itemHeight;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
function onMomentumScrollEnd<T>(
|
|
205
|
-
offset: number,
|
|
206
|
-
setCurrent: (n: number) => void,
|
|
207
|
-
dataLength: number,
|
|
208
|
-
itemHeight: number,
|
|
209
|
-
dataMultiplier: number,
|
|
210
|
-
indexDiffTopToCentered: number,
|
|
211
|
-
verticalPadding: number,
|
|
212
|
-
ref: RefObject<VirtualizedList<T> | null>
|
|
213
|
-
) {
|
|
214
|
-
// offset excluding padding
|
|
215
|
-
const innerOffset = offset - verticalPadding;
|
|
216
|
-
// get index of top most completely visible item
|
|
217
|
-
const currentTopIndex = Math.round(innerOffset / itemHeight);
|
|
218
|
-
|
|
219
|
-
// get current section within whole extended data (data * dataMultiplier)
|
|
220
|
-
// section 0 = [0, data.length)
|
|
221
|
-
// section 1 = [data.length, data.length * 2)
|
|
222
|
-
// ...
|
|
223
|
-
const currentSection = Math.floor(innerOffset / (dataLength * itemHeight));
|
|
224
|
-
// target section is always the middle one, so user can scroll seemingly infinitely
|
|
225
|
-
const targetSection = Math.floor(dataMultiplier / 2);
|
|
226
|
-
|
|
227
|
-
// get corresponding index of current top index in target section
|
|
228
|
-
const targetTopIndex =
|
|
229
|
-
currentTopIndex + (targetSection - currentSection) * dataLength;
|
|
230
|
-
// set current index to centered one, if `targetTopIndex`was at the top
|
|
231
|
-
setCurrent(targetTopIndex + indexDiffTopToCentered);
|
|
232
|
-
|
|
233
|
-
if (currentSection === targetSection) {
|
|
234
|
-
// if target section is current section, stay in this section
|
|
235
|
-
return;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
// if target section is different from current section, scroll to target
|
|
239
|
-
const targetOffset = offset + (targetTopIndex - currentTopIndex) * itemHeight;
|
|
240
|
-
ref.current?.scrollToOffset({ animated: false, offset: targetOffset });
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
// props
|
|
244
|
-
|
|
245
|
-
function withDefaults<T>(
|
|
246
|
-
props: RepeatingWheelPickerProps<T>
|
|
247
|
-
): RepeatingWheelPickerPropsWithDefaults<T> {
|
|
248
|
-
const defaultBackgroundColor = "black";
|
|
249
|
-
const defaultTextColor = "white";
|
|
250
|
-
const defaultTextSize = 18;
|
|
251
|
-
|
|
252
|
-
validateProps(props);
|
|
253
|
-
|
|
254
|
-
return {
|
|
255
|
-
...props,
|
|
256
|
-
|
|
257
|
-
// optional
|
|
258
|
-
containerOnLayout: props.containerOnLayout ?? (() => {}),
|
|
259
|
-
enabled: props.enabled ?? true,
|
|
260
|
-
|
|
261
|
-
getLabel: props.getLabel ?? ((t: T) => `${t}`),
|
|
262
|
-
|
|
263
|
-
itemHeight: props.itemHeight ?? (props.itemTextStyle?.fontSize ?? defaultTextSize) + 15,
|
|
264
|
-
itemDisplayCount: props.itemDisplayCount ?? 3,
|
|
265
|
-
|
|
266
|
-
containerVerticalPadding: props.containerVerticalPadding ?? 0,
|
|
267
|
-
containerHorizontalPadding: props.containerHorizontalPadding ?? 10,
|
|
268
|
-
containerStyle: {
|
|
269
|
-
...props.containerStyle,
|
|
270
|
-
backgroundColor:
|
|
271
|
-
props.containerStyle?.backgroundColor ?? defaultBackgroundColor,
|
|
272
|
-
padding: 0,
|
|
273
|
-
paddingHorizontal: 0,
|
|
274
|
-
paddingVertical: 0,
|
|
275
|
-
paddingTop: 0,
|
|
276
|
-
paddingBottom: 0,
|
|
277
|
-
paddingLeft: 0,
|
|
278
|
-
paddingRight: 0
|
|
279
|
-
},
|
|
280
|
-
itemContainerStyle: {
|
|
281
|
-
...props.itemContainerStyle,
|
|
282
|
-
backgroundColor:
|
|
283
|
-
props.itemContainerStyle?.backgroundColor ?? "transparent",
|
|
284
|
-
justifyContent: props.itemContainerStyle?.justifyContent ?? "center"
|
|
285
|
-
},
|
|
286
|
-
itemTextStyle: {
|
|
287
|
-
...props.itemTextStyle,
|
|
288
|
-
fontSize: props.itemTextStyle?.fontSize ?? defaultTextSize,
|
|
289
|
-
color: props.itemTextStyle?.color ?? defaultTextColor,
|
|
290
|
-
},
|
|
291
|
-
|
|
292
|
-
enableGradient: props.enableGradient ?? true,
|
|
293
|
-
gradientFadeColor: props.gradientFadeColor ?? (props.containerStyle?.backgroundColor ?? defaultBackgroundColor)
|
|
294
|
-
};
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
function validateProps<T>(props: RepeatingWheelPickerProps<T>) {
|
|
298
|
-
if (props.initialIndex < 0 || props.initialIndex >= props.data.length) {
|
|
299
|
-
throw InvalidPropertiesError(
|
|
300
|
-
"initialIndex",
|
|
301
|
-
String(props.initialIndex),
|
|
302
|
-
"has to be in range [0, data.length)"
|
|
303
|
-
);
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
if (props.data.length < 2) {
|
|
307
|
-
throw InvalidPropertiesError(
|
|
308
|
-
"data.length",
|
|
309
|
-
String(props.data.length),
|
|
310
|
-
"has to be larger than 1"
|
|
311
|
-
);
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
if (props.itemDisplayCount !== undefined && props.itemDisplayCount < 1) {
|
|
315
|
-
throw InvalidPropertiesError(
|
|
316
|
-
"itemDisplayCount",
|
|
317
|
-
String(props.itemDisplayCount),
|
|
318
|
-
"has to be larger than 0"
|
|
319
|
-
);
|
|
320
|
-
}
|
|
321
|
-
if (props.itemDisplayCount !== undefined && !Number.isInteger(props.itemDisplayCount)) {
|
|
322
|
-
throw InvalidPropertiesError(
|
|
323
|
-
"itemDisplayCount",
|
|
324
|
-
String(props.itemDisplayCount),
|
|
325
|
-
"has to be an integer"
|
|
326
|
-
);
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
if (props.itemHeight !== undefined && props.itemHeight < 1) {
|
|
330
|
-
throw InvalidPropertiesError(
|
|
331
|
-
"itemHeight",
|
|
332
|
-
String(props.itemHeight),
|
|
333
|
-
"has to be larger than 0"
|
|
334
|
-
);
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
function InvalidPropertiesError(
|
|
339
|
-
propertyName: string,
|
|
340
|
-
propertyValue: string,
|
|
341
|
-
violatedConstraint: string
|
|
342
|
-
) {
|
|
343
|
-
return Error(
|
|
344
|
-
`Value "${propertyValue}" is invalid for property "${propertyName}": ${violatedConstraint}`
|
|
345
|
-
) as InvalidPropertiesError;
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
interface InvalidPropertiesError extends Error {
|
|
349
|
-
name: "InvalidPropertiesError";
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
type RepeatingWheelPickerPropsWithDefaults<T> = RepeatingWheelPickerProps<T> &
|
|
353
|
-
Required<Omit<RepeatingWheelPickerProps<T>, "containerRef">>;
|
|
354
|
-
|
|
355
|
-
/**
|
|
356
|
-
*
|
|
357
|
-
*/
|
|
358
|
-
export type RepeatingWheelPickerProps<T> = {
|
|
359
|
-
/**
|
|
360
|
-
* Function to set currently selected element and use it in your application.
|
|
361
|
-
*
|
|
362
|
-
* @example
|
|
363
|
-
* ```ts
|
|
364
|
-
* const [selected, setSelected] = useState(0);
|
|
365
|
-
*
|
|
366
|
-
* return (
|
|
367
|
-
* <RepeatingWheelPicker
|
|
368
|
-
* setSelected={setSelected}
|
|
369
|
-
* //...
|
|
370
|
-
* />
|
|
371
|
-
* );
|
|
372
|
-
* ```
|
|
373
|
-
*
|
|
374
|
-
* @param t currently selected element
|
|
375
|
-
*/
|
|
376
|
-
setSelected: (t: T) => void;
|
|
377
|
-
/**
|
|
378
|
-
* Index to initially center.
|
|
379
|
-
*/
|
|
380
|
-
initialIndex: number;
|
|
381
|
-
/**
|
|
382
|
-
* Data to display.
|
|
383
|
-
*/
|
|
384
|
-
data: T[];
|
|
385
|
-
|
|
386
|
-
/**
|
|
387
|
-
* Function to retrieve the text to display for an element as a label.
|
|
388
|
-
*
|
|
389
|
-
* @defaultValue
|
|
390
|
-
* ```ts
|
|
391
|
-
* (t: T) => `${t}`
|
|
392
|
-
* ```
|
|
393
|
-
*
|
|
394
|
-
* @param t element to retrieve label for
|
|
395
|
-
*/
|
|
396
|
-
getLabel?: (t: T) => string;
|
|
397
|
-
/**
|
|
398
|
-
* Function called when the layout of the container changes.
|
|
399
|
-
*
|
|
400
|
-
* _Example usage for monitoring the container's height:_
|
|
401
|
-
* ```ts
|
|
402
|
-
* const [pickerHeight, setPickerHeight] = useState<number>(0);
|
|
403
|
-
*
|
|
404
|
-
* const onLayout = useCallback((event: LayoutChangeEvent) => {
|
|
405
|
-
* const { height } = event.nativeEvent.layout;
|
|
406
|
-
* setPickerHeight(height);
|
|
407
|
-
* }, []);
|
|
408
|
-
*
|
|
409
|
-
* return (
|
|
410
|
-
* <View style={{flexDirection: "row"}}>
|
|
411
|
-
* <View style={{height: height}}>
|
|
412
|
-
* <Text>Picker label</Text>
|
|
413
|
-
* </View>
|
|
414
|
-
* <RepeatingWheelPicker
|
|
415
|
-
* //...
|
|
416
|
-
* containerOnLayout={onLayout}
|
|
417
|
-
* />
|
|
418
|
-
* </View>
|
|
419
|
-
* );
|
|
420
|
-
* ```
|
|
421
|
-
*
|
|
422
|
-
* @defaultValue () => {}
|
|
423
|
-
*
|
|
424
|
-
* @param event layout change event that triggered `onLayout`
|
|
425
|
-
*/
|
|
426
|
-
containerOnLayout?: (event: LayoutChangeEvent) => void;
|
|
427
|
-
/**
|
|
428
|
-
* Enables / disables scrolling of the wheel picker.
|
|
429
|
-
*
|
|
430
|
-
* @defaultValue true
|
|
431
|
-
*/
|
|
432
|
-
enabled?: boolean;
|
|
433
|
-
|
|
434
|
-
/**
|
|
435
|
-
* Height per displayed item.
|
|
436
|
-
*
|
|
437
|
-
* @defaultValue itemTextStyle.fontSize + 15
|
|
438
|
-
*/
|
|
439
|
-
itemHeight?: number;
|
|
440
|
-
/**
|
|
441
|
-
* Number of items to display.
|
|
442
|
-
*
|
|
443
|
-
* @defaultValue 3
|
|
444
|
-
*/
|
|
445
|
-
itemDisplayCount?: number;
|
|
446
|
-
|
|
447
|
-
/**
|
|
448
|
-
* Vertical padding for the container of the wheel picker.
|
|
449
|
-
*
|
|
450
|
-
* @defaultValue 0
|
|
451
|
-
*/
|
|
452
|
-
containerVerticalPadding?: number;
|
|
453
|
-
/**
|
|
454
|
-
* Horizontal padding for the container of the wheel picker.
|
|
455
|
-
*
|
|
456
|
-
* @defaultValue 10
|
|
457
|
-
*/
|
|
458
|
-
containerHorizontalPadding?: number;
|
|
459
|
-
/**
|
|
460
|
-
* Styling for the container of the wheel picker.
|
|
461
|
-
*
|
|
462
|
-
* @defaultValue
|
|
463
|
-
* ```ts
|
|
464
|
-
* {
|
|
465
|
-
* backgroundColor: "black"
|
|
466
|
-
* }
|
|
467
|
-
* ```
|
|
468
|
-
*/
|
|
469
|
-
containerStyle?: ViewStyle;
|
|
470
|
-
/**
|
|
471
|
-
* Styling for the container of each element.
|
|
472
|
-
*
|
|
473
|
-
* @defaultValue
|
|
474
|
-
* ```ts
|
|
475
|
-
* {
|
|
476
|
-
* backgroundColor: "transparent",
|
|
477
|
-
* justifyContent: "center"
|
|
478
|
-
* }
|
|
479
|
-
* ```
|
|
480
|
-
*/
|
|
481
|
-
itemContainerStyle?: ViewStyle;
|
|
482
|
-
/**
|
|
483
|
-
* Styling for the text of the elements.
|
|
484
|
-
*
|
|
485
|
-
* @defaultValue
|
|
486
|
-
* ```ts
|
|
487
|
-
* {
|
|
488
|
-
* fontSize: "18",
|
|
489
|
-
* color: "white"
|
|
490
|
-
* }
|
|
491
|
-
* ```
|
|
492
|
-
*/
|
|
493
|
-
itemTextStyle?: TextStyle;
|
|
494
|
-
|
|
495
|
-
/**
|
|
496
|
-
* If enabled, will show a gradient fade towards the top and bottom of the wheel picker.
|
|
497
|
-
*
|
|
498
|
-
* @defaultValue true
|
|
499
|
-
*/
|
|
500
|
-
enableGradient?: boolean;
|
|
501
|
-
/**
|
|
502
|
-
* Color the gradient should fade to at the top and bottom.
|
|
503
|
-
*
|
|
504
|
-
* @defaultValue containerStyle.backgroundColor
|
|
505
|
-
*/
|
|
506
|
-
gradientFadeColor?: ColorValue;
|
|
507
|
-
};
|