react-native-timer-picker 2.0.3 → 2.1.0
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/README.md +30 -16
- package/dist/commonjs/components/DurationScroll/index.js +65 -70
- package/dist/commonjs/components/DurationScroll/index.js.map +1 -1
- package/dist/commonjs/components/DurationScroll/types.js.map +1 -1
- package/dist/commonjs/components/TimerPicker/index.js +1 -3
- package/dist/commonjs/components/TimerPicker/index.js.map +1 -1
- package/dist/commonjs/components/TimerPicker/styles.js +8 -6
- package/dist/commonjs/components/TimerPicker/styles.js.map +1 -1
- package/dist/commonjs/components/TimerPicker/types.js.map +1 -1
- package/dist/module/components/DurationScroll/index.js +65 -70
- package/dist/module/components/DurationScroll/index.js.map +1 -1
- package/dist/module/components/DurationScroll/types.js.map +1 -1
- package/dist/module/components/TimerPicker/index.js +1 -3
- package/dist/module/components/TimerPicker/index.js.map +1 -1
- package/dist/module/components/TimerPicker/styles.js +8 -6
- package/dist/module/components/TimerPicker/styles.js.map +1 -1
- package/dist/module/components/TimerPicker/types.js.map +1 -1
- package/dist/typescript/components/DurationScroll/types.d.ts +1 -2
- package/dist/typescript/components/TimerPicker/styles.d.ts +7 -6
- package/dist/typescript/components/TimerPicker/types.d.ts +1 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ Includes iOS-style haptic and audio feedback 🍏
|
|
|
22
22
|
- [Examples 😎](#examples-)
|
|
23
23
|
- [Timer Picker Modal (Dark Mode) 🌚](#timer-picker-modal-dark-mode-)
|
|
24
24
|
- [Timer Picker Modal (Light Mode) 🌞](#timer-picker-modal-light-mode-)
|
|
25
|
-
- [Timer Picker with
|
|
25
|
+
- [Timer Picker with Transparent Fade-Out (Dark Mode) 🌒](#timer-picker-with-transparent-fade-out-dark-mode-)
|
|
26
26
|
- [Timer Picker with Customisation (Light Mode) 🌔](#timer-picker-with-customisation-light-mode-)
|
|
27
27
|
- [Props 💅](#props-)
|
|
28
28
|
- [TimerPicker ⏲️](#timerpicker-️)
|
|
@@ -60,7 +60,7 @@ Includes iOS-style haptic and audio feedback 🍏
|
|
|
60
60
|
|
|
61
61
|
## Peer Dependencies 👶
|
|
62
62
|
|
|
63
|
-
This component will work in your React Native Project **_without any peer dependencies_**.
|
|
63
|
+
This component will work in your React Native Project **_without any peer dependencies_**. However, to enable certain additional features (e.g. fade-out, feedback) you will need to supply various libraries as props. These are detailed below.
|
|
64
64
|
|
|
65
65
|
### Linear Gradient
|
|
66
66
|
|
|
@@ -71,6 +71,15 @@ If you want the numbers to fade in/out at the top and bottom of the picker, you
|
|
|
71
71
|
|
|
72
72
|
**To enable the linear gradient, you need to supply the component as a prop to either TimerPickerModal or TimerPicker.**
|
|
73
73
|
|
|
74
|
+
### Masked View
|
|
75
|
+
|
|
76
|
+
To make the numbers fade in/out on a transparent background (e.g. if the picker is rendered on top of a gradient or image), you will need to install the [@react-native-masked-view/masked-view
|
|
77
|
+
](https://www.npmjs.com/package/@react-native-masked-view/masked-view) component. This is as the standard LinearGradient implementation relies on there being a solid background colour. You then just need to set `backgroundColor: "transparent` on the `TimerPicker` styles prop.
|
|
78
|
+
|
|
79
|
+
`import MaskedView from "@react-native-masked-view/masked-view";`
|
|
80
|
+
|
|
81
|
+
**To enable the fade-out on a transparent background, you need to supply the imported `MaskedView` component AND one of the LinearGradient components as props to either TimerPickerModal or TimerPicker. (see [this example](#timer-picker-with-transparent-fade-out-dark-mode-))**
|
|
82
|
+
|
|
74
83
|
### Haptic Feedback
|
|
75
84
|
|
|
76
85
|
Enable haptic feedback with the [expo-haptics](https://www.npmjs.com/package/expo-haptics) module:
|
|
@@ -185,7 +194,7 @@ return (
|
|
|
185
194
|
borderColor: "#C2C2C2",
|
|
186
195
|
color: "#C2C2C2"
|
|
187
196
|
}}>
|
|
188
|
-
Set Alarm 🔔
|
|
197
|
+
{"Set Alarm 🔔"}
|
|
189
198
|
</Text>
|
|
190
199
|
</View>
|
|
191
200
|
</TouchableOpacity>
|
|
@@ -319,10 +328,11 @@ return (
|
|
|
319
328
|
|
|
320
329
|
<img src="demos/example2.gif" width="250" height="550"/>
|
|
321
330
|
|
|
322
|
-
### Timer Picker with
|
|
331
|
+
### Timer Picker with Transparent Fade-Out (Dark Mode) 🌒
|
|
323
332
|
|
|
324
333
|
```jsx
|
|
325
334
|
import { TimerPicker } from "react-native-timer-picker";
|
|
335
|
+
import MaskedView from "@react-native-masked-view/masked-view"; // for transparent fade-out
|
|
326
336
|
import { LinearGradient } from "expo-linear-gradient"; // or `import LinearGradient from "react-native-linear-gradient"`
|
|
327
337
|
import { Audio } from "expo-av"; // for audio feedback (click sound as you scroll)
|
|
328
338
|
import * as Haptics from "expo-haptics"; // for haptic feedback
|
|
@@ -334,7 +344,11 @@ const [alarmString, setAlarmString] = useState<
|
|
|
334
344
|
>(null);
|
|
335
345
|
|
|
336
346
|
return (
|
|
337
|
-
<
|
|
347
|
+
<LinearGradient
|
|
348
|
+
colors={["#202020", "#220578"]}
|
|
349
|
+
start={{ x: 0, y: 0 }}
|
|
350
|
+
end={{ x: 1, y: 1 }}
|
|
351
|
+
style={{alignItems: "center", justifyContent: "center"}}>
|
|
338
352
|
<TimerPicker
|
|
339
353
|
padWithNItems={2}
|
|
340
354
|
hourLabel=":"
|
|
@@ -343,9 +357,10 @@ return (
|
|
|
343
357
|
Audio={Audio}
|
|
344
358
|
LinearGradient={LinearGradient}
|
|
345
359
|
Haptics={Haptics}
|
|
360
|
+
MaskedView={MaskedView}
|
|
346
361
|
styles={{
|
|
347
362
|
theme: "dark",
|
|
348
|
-
backgroundColor: "
|
|
363
|
+
backgroundColor: "transparent", // transparent fade-out
|
|
349
364
|
pickerItem: {
|
|
350
365
|
fontSize: 34,
|
|
351
366
|
},
|
|
@@ -368,7 +383,7 @@ return (
|
|
|
368
383
|
},
|
|
369
384
|
}}
|
|
370
385
|
/>
|
|
371
|
-
</
|
|
386
|
+
</LinearGradient>
|
|
372
387
|
)
|
|
373
388
|
|
|
374
389
|
```
|
|
@@ -464,16 +479,15 @@ return (
|
|
|
464
479
|
| repeatMinuteNumbersNTimes | Set the number of times the list of minutes is repeated in the picker | Number | 3 | false |
|
|
465
480
|
| repeatSecondNumbersNTimes | Set the number of times the list of seconds is repeated in the picker | Number | 3 | false |
|
|
466
481
|
| disableInfiniteScroll | Disable the infinite scroll feature | Boolean | false | false |
|
|
467
|
-
| LinearGradient | Linear Gradient Component | [expo-linear-gradient](https://www.npmjs.com/package/expo-linear-gradient).LinearGradient or [react-native-linear-gradient](https://www.npmjs.com/package/react-native-linear-gradient).default | - | false |
|
|
468
|
-
|
|
|
469
|
-
|
|
|
470
|
-
|
|
|
482
|
+
| LinearGradient | [Linear Gradient Component (required for picker fade-out)](#linear-gradient) | [expo-linear-gradient](https://www.npmjs.com/package/expo-linear-gradient).LinearGradient or [react-native-linear-gradient](https://www.npmjs.com/package/react-native-linear-gradient).default | - | false |
|
|
483
|
+
| MaskedView | [Masked View Component (required for picker fade-out on transparent background)](#masked-view) | [@react-native-masked-view/masked-view](https://www.npmjs.com/package/@react-native-masked-view/masked-view).default | - | false |
|
|
484
|
+
| Haptics | [Haptics Namespace (required for Haptic feedback)](#haptic-feedback) | [expo-haptics](https://www.npmjs.com/package/expo-haptics) | - | false |
|
|
485
|
+
| Audio | [Audio Class (required for audio feedback i.e. click sound)](#audio-feedback-click-sound) | [expo-av](https://www.npmjs.com/package/expo-av).Audio | - | false |
|
|
486
|
+
| pickerFeedback | [Generic picker feedback as alternative to the above Expo feedback support](#generic-feedback) | `() => void \| Promise<void> ` | - | false |
|
|
471
487
|
| FlatList | FlatList component used internally to implement each picker (hour, minutes and seconds). More info [below](#custom-flatlist) | [react-native](https://reactnative.dev/docs/flatlist).FlatList | `FlatList` from `react-native` | false |
|
|
472
488
|
| clickSoundAsset | Custom sound asset for click sound (required for offline click sound - download default [here](https://drive.google.com/uc?export=download&id=10e1YkbNsRh-vGx1jmS1Nntz8xzkBp4_I)) | require(.../somefolderpath) or {uri: www.someurl} | - | false |
|
|
473
489
|
| pickerContainerProps | Props for the picker container | `React.ComponentProps<typeof View>` | - | false |
|
|
474
|
-
| pickerGradientOverlayProps | Props for
|
|
475
|
-
| topPickerGradientOverlayProps | Props for the top gradient overlay | `Partial<LinearGradientProps>` | - | false |
|
|
476
|
-
| bottomPickerGradientOverlayProps | Props for the bottom gradient overlay | `Partial<LinearGradientProps>` | - | false |
|
|
490
|
+
| pickerGradientOverlayProps | Props for the gradient overlay (supply a different `locations` array to adjust its position) overlays | `Partial<LinearGradientProps>` | - | false |
|
|
477
491
|
| styles | Custom styles for the timer picker | [CustomTimerPickerStyles](#custom-styles-) | - | false |
|
|
478
492
|
|
|
479
493
|
#### Custom Styles 👗
|
|
@@ -505,7 +519,7 @@ Note the minor limitations to the allowed styles for `pickerContainer` and `pick
|
|
|
505
519
|
|
|
506
520
|
When the `disableInfiniteScroll` prop is not set, the picker gives the appearance of an infinitely scrolling picker by auto-scrolling forward/back when you near the start/end of the list. When the picker auto-scrolls, a momentary flicker is visible if you are scrolling very slowly.
|
|
507
521
|
|
|
508
|
-
To mitigate for this,
|
|
522
|
+
To mitigate for this, the list of numbers in each picker is repeated a given number of times based on the length of the list (8 times for the hours picker, and 3 times for the minutes and seconds picker). These have a performance trade-off: higher values mean the picker has to auto-scroll less to maintain the infinite scroll, but has to render a longer list of numbers. The number of repetitions automatically adjusts if the number of items in the picker changes (e.g. if an interval is included, or the maximum value is modified), balancing the trade-off. You can also manually adjust the number of repetitions in each picker with the `repeatHourNumbersNTimes`, `repeatMinuteNumbersNTimes` and `repeatSecondNumbersNTimes` props.
|
|
509
523
|
|
|
510
524
|
Note that you can avoid the auto-scroll flickering entirely by disabling infinite scroll. You could then set the above props to high values, so that a user has to scroll far down/up the list to reach the end of the list.
|
|
511
525
|
|
|
@@ -535,7 +549,7 @@ The custom component needs to have the same interface as React Native's `<FlatLi
|
|
|
535
549
|
|
|
536
550
|
#### Generic feedback
|
|
537
551
|
|
|
538
|
-
To enable haptic feedback from the non-Expo module [react-native-haptic-feedback](https://github.com/mkuczera/react-native-haptic-feedback) or provide feedback in any other form you can use the generic feedback callback prop `pickerFeedback`. This function is called whenever any of the pickers tick onto a new number.
|
|
552
|
+
To enable haptic feedback from the non-Expo module [react-native-haptic-feedback](https://github.com/mkuczera/react-native-haptic-feedback) (or provide feedback in any other form) you can use the generic feedback callback prop `pickerFeedback`. This function is called whenever any of the pickers tick onto a new number.
|
|
539
553
|
|
|
540
554
|
```Jsx
|
|
541
555
|
import { trigger } from 'react-native-haptic-feedback';
|
|
@@ -20,7 +20,6 @@ const DurationScroll = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
20
20
|
allowFontScaling = false,
|
|
21
21
|
amLabel,
|
|
22
22
|
Audio,
|
|
23
|
-
bottomPickerGradientOverlayProps,
|
|
24
23
|
clickSoundAsset,
|
|
25
24
|
disableInfiniteScroll = false,
|
|
26
25
|
FlatList = _reactNative.FlatList,
|
|
@@ -32,6 +31,7 @@ const DurationScroll = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
32
31
|
label,
|
|
33
32
|
limit,
|
|
34
33
|
LinearGradient,
|
|
34
|
+
MaskedView,
|
|
35
35
|
maximumValue,
|
|
36
36
|
onDurationChange,
|
|
37
37
|
padNumbersWithZero = false,
|
|
@@ -42,8 +42,7 @@ const DurationScroll = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
42
42
|
repeatNumbersNTimes = 3,
|
|
43
43
|
repeatNumbersNTimesNotExplicitlySet,
|
|
44
44
|
styles,
|
|
45
|
-
testID
|
|
46
|
-
topPickerGradientOverlayProps
|
|
45
|
+
testID
|
|
47
46
|
} = props;
|
|
48
47
|
const numberOfItems = (0, _react.useMemo)(() => {
|
|
49
48
|
// guard against negative maximum values
|
|
@@ -326,79 +325,75 @@ const DurationScroll = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
326
325
|
},
|
|
327
326
|
latestDuration: latestDuration
|
|
328
327
|
}));
|
|
328
|
+
const renderContent = (0, _react.useMemo)(() => {
|
|
329
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(FlatList, {
|
|
330
|
+
key: flatListRenderKey,
|
|
331
|
+
ref: flatListRef,
|
|
332
|
+
contentContainerStyle: styles.durationScrollFlatListContentContainer,
|
|
333
|
+
data: numbersForFlatList,
|
|
334
|
+
decelerationRate: 0.88,
|
|
335
|
+
getItemLayout: getItemLayout,
|
|
336
|
+
initialScrollIndex: initialScrollIndex,
|
|
337
|
+
keyExtractor: (_, index) => index.toString(),
|
|
338
|
+
nestedScrollEnabled: true,
|
|
339
|
+
onMomentumScrollEnd: onMomentumScrollEnd,
|
|
340
|
+
onScroll: onScroll,
|
|
341
|
+
renderItem: renderItem,
|
|
342
|
+
scrollEnabled: !isDisabled,
|
|
343
|
+
scrollEventThrottle: 16,
|
|
344
|
+
showsVerticalScrollIndicator: false,
|
|
345
|
+
snapToAlignment: "start"
|
|
346
|
+
// used in place of snapToInterval due to bug on Android
|
|
347
|
+
,
|
|
348
|
+
snapToOffsets: [...Array(numbersForFlatList.length)].map((_, i) => i * styles.pickerItemContainer.height),
|
|
349
|
+
style: styles.durationScrollFlatList,
|
|
350
|
+
testID: "duration-scroll-flatlist",
|
|
351
|
+
viewabilityConfigCallbackPairs: viewabilityConfigCallbackPairs,
|
|
352
|
+
windowSize: numberOfItemsToShow
|
|
353
|
+
}), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
354
|
+
pointerEvents: "none",
|
|
355
|
+
style: styles.pickerLabelContainer
|
|
356
|
+
}, typeof label === "string" ? /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
357
|
+
allowFontScaling: allowFontScaling,
|
|
358
|
+
style: styles.pickerLabel
|
|
359
|
+
}, label) : label ?? null));
|
|
360
|
+
}, [FlatList, allowFontScaling, flatListRenderKey, getItemLayout, initialScrollIndex, isDisabled, label, numberOfItemsToShow, numbersForFlatList, onMomentumScrollEnd, onScroll, renderItem, styles.durationScrollFlatList, styles.durationScrollFlatListContentContainer, styles.pickerItemContainer.height, styles.pickerLabel, styles.pickerLabelContainer, viewabilityConfigCallbackPairs]);
|
|
361
|
+
const renderLinearGradient = (0, _react.useMemo)(() => {
|
|
362
|
+
if (!LinearGradient) {
|
|
363
|
+
return null;
|
|
364
|
+
}
|
|
365
|
+
let colors;
|
|
366
|
+
if (MaskedView) {
|
|
367
|
+
// if using masked view, we only care about the opacity
|
|
368
|
+
colors = ["rgba(0,0,0,0)", "rgba(0,0,0,1)", "rgba(0,0,0,1)", "rgba(0,0,0,0)"];
|
|
369
|
+
} else {
|
|
370
|
+
const backgroundColor = styles.pickerContainer.backgroundColor ?? "white";
|
|
371
|
+
const transparentBackgroundColor = (0, _colorToRgba.colorToRgba)({
|
|
372
|
+
color: backgroundColor,
|
|
373
|
+
opacity: 0
|
|
374
|
+
});
|
|
375
|
+
colors = [backgroundColor, transparentBackgroundColor, transparentBackgroundColor, backgroundColor];
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
// calculate the gradient height to cover the top item and bottom item
|
|
379
|
+
const gradientHeight = padWithNItems > 0 ? 1 / (padWithNItems * 2 + 1) : 0.3;
|
|
380
|
+
return /*#__PURE__*/_react.default.createElement(LinearGradient, _extends({
|
|
381
|
+
colors: colors,
|
|
382
|
+
locations: [0, gradientHeight, 1 - gradientHeight, 1],
|
|
383
|
+
pointerEvents: "none",
|
|
384
|
+
style: styles.pickerGradientOverlay
|
|
385
|
+
}, pickerGradientOverlayProps));
|
|
386
|
+
}, [LinearGradient, MaskedView, padWithNItems, pickerGradientOverlayProps, styles.pickerContainer.backgroundColor, styles.pickerGradientOverlay]);
|
|
329
387
|
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
330
388
|
pointerEvents: isDisabled ? "none" : undefined,
|
|
331
389
|
style: [styles.durationScrollFlatListContainer, {
|
|
332
390
|
height: styles.pickerItemContainer.height * numberOfItemsToShow
|
|
333
391
|
}, isDisabled && styles.disabledPickerContainer],
|
|
334
392
|
testID: testID
|
|
335
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
data: numbersForFlatList,
|
|
340
|
-
decelerationRate: 0.88,
|
|
341
|
-
getItemLayout: getItemLayout,
|
|
342
|
-
initialScrollIndex: initialScrollIndex,
|
|
343
|
-
keyExtractor: (_, index) => index.toString(),
|
|
344
|
-
nestedScrollEnabled: true,
|
|
345
|
-
onMomentumScrollEnd: onMomentumScrollEnd,
|
|
346
|
-
onScroll: onScroll,
|
|
347
|
-
renderItem: renderItem,
|
|
348
|
-
scrollEnabled: !isDisabled,
|
|
349
|
-
scrollEventThrottle: 16,
|
|
350
|
-
showsVerticalScrollIndicator: false,
|
|
351
|
-
snapToAlignment: "start"
|
|
352
|
-
// used in place of snapToInterval due to bug on Android
|
|
353
|
-
,
|
|
354
|
-
snapToOffsets: [...Array(numbersForFlatList.length)].map((_, i) => i * styles.pickerItemContainer.height),
|
|
355
|
-
style: styles.durationScrollFlatList,
|
|
356
|
-
testID: "duration-scroll-flatlist",
|
|
357
|
-
viewabilityConfigCallbackPairs: viewabilityConfigCallbackPairs,
|
|
358
|
-
windowSize: numberOfItemsToShow
|
|
359
|
-
}), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
360
|
-
pointerEvents: "none",
|
|
361
|
-
style: styles.pickerLabelContainer
|
|
362
|
-
}, typeof label === "string" ? /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
363
|
-
allowFontScaling: allowFontScaling,
|
|
364
|
-
style: styles.pickerLabel
|
|
365
|
-
}, label) : label ?? null), LinearGradient ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(LinearGradient, _extends({
|
|
366
|
-
colors: [styles.pickerContainer.backgroundColor ?? "white", (0, _colorToRgba.colorToRgba)({
|
|
367
|
-
color: styles.pickerContainer.backgroundColor ?? "white",
|
|
368
|
-
opacity: 0
|
|
369
|
-
})],
|
|
370
|
-
end: {
|
|
371
|
-
x: 1,
|
|
372
|
-
y: 1
|
|
373
|
-
},
|
|
374
|
-
pointerEvents: "none",
|
|
375
|
-
start: {
|
|
376
|
-
x: 1,
|
|
377
|
-
y: 0.3
|
|
378
|
-
}
|
|
379
|
-
}, pickerGradientOverlayProps, topPickerGradientOverlayProps, {
|
|
380
|
-
style: [styles.pickerGradientOverlay, {
|
|
381
|
-
top: 0
|
|
382
|
-
}]
|
|
383
|
-
})), /*#__PURE__*/_react.default.createElement(LinearGradient, _extends({
|
|
384
|
-
colors: [(0, _colorToRgba.colorToRgba)({
|
|
385
|
-
color: styles.pickerContainer.backgroundColor ?? "white",
|
|
386
|
-
opacity: 0
|
|
387
|
-
}), styles.pickerContainer.backgroundColor ?? "white"],
|
|
388
|
-
end: {
|
|
389
|
-
x: 1,
|
|
390
|
-
y: 0.7
|
|
391
|
-
},
|
|
392
|
-
pointerEvents: "none",
|
|
393
|
-
start: {
|
|
394
|
-
x: 1,
|
|
395
|
-
y: 0
|
|
396
|
-
}
|
|
397
|
-
}, pickerGradientOverlayProps, bottomPickerGradientOverlayProps, {
|
|
398
|
-
style: [styles.pickerGradientOverlay, {
|
|
399
|
-
bottom: -1
|
|
400
|
-
}]
|
|
401
|
-
}))) : null);
|
|
393
|
+
}, MaskedView ? /*#__PURE__*/_react.default.createElement(MaskedView, {
|
|
394
|
+
maskElement: renderLinearGradient,
|
|
395
|
+
style: [styles.maskedView]
|
|
396
|
+
}, renderContent) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, renderContent, renderLinearGradient));
|
|
402
397
|
});
|
|
403
398
|
var _default = exports.default = /*#__PURE__*/_react.default.memo(DurationScroll);
|
|
404
399
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_colorToRgba","_generateNumbers","_getAdjustedLimit","_getDurationAndIndexFromScrollOffset","_getInitialScrollIndex","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","DurationScroll","forwardRef","props","ref","aggressivelyGetLatestDuration","allowFontScaling","amLabel","Audio","bottomPickerGradientOverlayProps","clickSoundAsset","disableInfiniteScroll","FlatList","RNFlatList","Haptics","initialValue","interval","is12HourPicker","isDisabled","label","limit","LinearGradient","maximumValue","onDurationChange","padNumbersWithZero","padWithNItems","pickerFeedback","pickerGradientOverlayProps","pmLabel","repeatNumbersNTimes","repeatNumbersNTimesNotExplicitlySet","styles","testID","topPickerGradientOverlayProps","numberOfItems","useMemo","Math","floor","safeRepeatNumbersNTimes","isNaN","max","round","numbersForFlatList","generate12HourNumbers","repeatNTimes","generateNumbers","initialScrollIndex","getInitialScrollIndex","value","adjustedLimited","getAdjustedLimit","numberOfItemsToShow","latestDuration","useRef","lastFeedbackIndex","flatListRef","clickSound","setClickSound","useState","useEffect","loadSound","sound","Sound","createAsync","uri","shouldPlay","unloadAsync","renderItem","useCallback","item","stringItem","intItem","isAm","parseInt","includes","replace","createElement","View","key","style","pickerItemContainer","Text","pickerItem","min","disabledPickerItem","pointerEvents","pickerAmPmContainer","pickerAmPmLabel","onScroll","newValues","getDurationAndIndexFromScrollOffset","itemHeight","height","yContentOffset","nativeEvent","contentOffset","y","duration","current","feedbackIndex","selectionAsync","replayAsync","onMomentumScrollEnd","_flatListRef$current","targetScrollIndex","index","scrollToIndex","animated","_flatListRef$current2","onViewableItemsChanged","viewableItems","_viewableItems$","_viewableItems$2","_flatListRef$current3","_flatListRef$current4","viewabilityConfigCallbackPairs","setViewabilityConfigCallbackPairs","viewabilityConfig","viewAreaCoveragePercentThreshold","undefined","flatListRenderKey","setFlatListRenderKey","initialRender","prev","getItemLayout","_","offset","useImperativeHandle","reset","options","_flatListRef$current5","setValue","_flatListRef$current6","durationScrollFlatListContainer","disabledPickerContainer","contentContainerStyle","durationScrollFlatListContentContainer","data","decelerationRate","keyExtractor","toString","nestedScrollEnabled","scrollEnabled","scrollEventThrottle","showsVerticalScrollIndicator","snapToAlignment","snapToOffsets","Array","map","durationScrollFlatList","windowSize","pickerLabelContainer","pickerLabel","Fragment","colors","pickerContainer","backgroundColor","colorToRgba","color","opacity","end","x","start","pickerGradientOverlay","top","bottom","_default","exports","React","memo"],"sources":["index.tsx"],"sourcesContent":["import React, {\n useRef,\n useCallback,\n forwardRef,\n useImperativeHandle,\n useState,\n useEffect,\n useMemo,\n} from \"react\";\n\nimport { View, Text, FlatList as RNFlatList } from \"react-native\";\nimport type {\n ViewabilityConfigCallbackPairs,\n ViewToken,\n NativeSyntheticEvent,\n NativeScrollEvent,\n} from \"react-native\";\n\nimport { colorToRgba } from \"../../utils/colorToRgba\";\nimport {\n generate12HourNumbers,\n generateNumbers,\n} from \"../../utils/generateNumbers\";\nimport { getAdjustedLimit } from \"../../utils/getAdjustedLimit\";\nimport { getDurationAndIndexFromScrollOffset } from \"../../utils/getDurationAndIndexFromScrollOffset\";\nimport { getInitialScrollIndex } from \"../../utils/getInitialScrollIndex\";\n\nimport type { DurationScrollProps, DurationScrollRef } from \"./types\";\n\nconst DurationScroll = forwardRef<DurationScrollRef, DurationScrollProps>(\n (props, ref) => {\n const {\n aggressivelyGetLatestDuration,\n allowFontScaling = false,\n amLabel,\n Audio,\n bottomPickerGradientOverlayProps,\n clickSoundAsset,\n disableInfiniteScroll = false,\n FlatList = RNFlatList,\n Haptics,\n initialValue = 0,\n interval,\n is12HourPicker,\n isDisabled,\n label,\n limit,\n LinearGradient,\n maximumValue,\n onDurationChange,\n padNumbersWithZero = false,\n padWithNItems,\n pickerFeedback,\n pickerGradientOverlayProps,\n pmLabel,\n repeatNumbersNTimes = 3,\n repeatNumbersNTimesNotExplicitlySet,\n styles,\n testID,\n topPickerGradientOverlayProps,\n } = props;\n\n const numberOfItems = useMemo(() => {\n // guard against negative maximum values\n if (maximumValue < 0) {\n return 1;\n }\n\n return Math.floor(maximumValue / interval) + 1;\n }, [interval, maximumValue]);\n\n const safeRepeatNumbersNTimes = useMemo(() => {\n // do not repeat numbers if there is only one option\n if (numberOfItems === 1) {\n return 1;\n }\n\n if (!disableInfiniteScroll && repeatNumbersNTimes < 2) {\n return 2;\n } else if (repeatNumbersNTimes < 1 || isNaN(repeatNumbersNTimes)) {\n return 1;\n }\n\n // if this variable is not explicitly set, we calculate a reasonable value based on\n // the number of items in the picker, avoiding regular jumps up/down the list\n // whilst avoiding rendering too many items in the picker\n if (repeatNumbersNTimesNotExplicitlySet) {\n return Math.max(Math.round(180 / numberOfItems), 1);\n }\n\n return Math.round(repeatNumbersNTimes);\n }, [\n disableInfiniteScroll,\n numberOfItems,\n repeatNumbersNTimes,\n repeatNumbersNTimesNotExplicitlySet,\n ]);\n\n const numbersForFlatList = useMemo(() => {\n if (is12HourPicker) {\n return generate12HourNumbers({\n padNumbersWithZero,\n repeatNTimes: safeRepeatNumbersNTimes,\n disableInfiniteScroll,\n padWithNItems,\n interval,\n });\n }\n\n return generateNumbers(numberOfItems, {\n padNumbersWithZero,\n repeatNTimes: safeRepeatNumbersNTimes,\n disableInfiniteScroll,\n padWithNItems,\n interval,\n });\n }, [\n disableInfiniteScroll,\n is12HourPicker,\n interval,\n numberOfItems,\n padNumbersWithZero,\n padWithNItems,\n safeRepeatNumbersNTimes,\n ]);\n\n const initialScrollIndex = useMemo(\n () =>\n getInitialScrollIndex({\n disableInfiniteScroll,\n interval,\n numberOfItems,\n padWithNItems,\n repeatNumbersNTimes: safeRepeatNumbersNTimes,\n value: initialValue,\n }),\n [\n disableInfiniteScroll,\n initialValue,\n interval,\n numberOfItems,\n padWithNItems,\n safeRepeatNumbersNTimes,\n ]\n );\n\n const adjustedLimited = useMemo(\n () => getAdjustedLimit(limit, numberOfItems, interval),\n [interval, limit, numberOfItems]\n );\n\n const numberOfItemsToShow = 1 + padWithNItems * 2;\n\n // keep track of the latest duration as it scrolls\n const latestDuration = useRef(0);\n // keep track of the last index scrolled past for haptic/audio feedback\n const lastFeedbackIndex = useRef(0);\n\n const flatListRef = useRef<RNFlatList | null>(null);\n\n const [clickSound, setClickSound] = useState<\n | {\n replayAsync: () => Promise<void>;\n unloadAsync: () => Promise<void>;\n }\n | undefined\n >();\n\n // Preload the sound when the component mounts\n useEffect(() => {\n const loadSound = async () => {\n if (Audio) {\n const { sound } = await Audio.Sound.createAsync(\n clickSoundAsset ?? {\n // use a hosted sound as a fallback (do not use local asset due to loader issues\n // in some environments when including mp3 in library)\n uri: \"https://drive.google.com/uc?export=download&id=10e1YkbNsRh-vGx1jmS1Nntz8xzkBp4_I\",\n },\n { shouldPlay: false }\n );\n setClickSound(sound);\n }\n };\n\n loadSound();\n\n // Unload sound when component unmounts\n return () => {\n clickSound?.unloadAsync();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [Audio]);\n\n const renderItem = useCallback(\n ({ item }: { item: string }) => {\n let stringItem = item;\n let intItem: number;\n let isAm: boolean | undefined;\n\n if (!is12HourPicker) {\n intItem = parseInt(item);\n } else {\n isAm = item.includes(\"AM\");\n stringItem = item.replace(/\\s[AP]M/g, \"\");\n intItem = parseInt(stringItem);\n }\n\n return (\n <View\n key={item}\n style={styles.pickerItemContainer}\n testID=\"picker-item\">\n <Text\n allowFontScaling={allowFontScaling}\n style={[\n styles.pickerItem,\n intItem > adjustedLimited.max ||\n intItem < adjustedLimited.min\n ? styles.disabledPickerItem\n : {},\n ]}>\n {stringItem}\n </Text>\n {is12HourPicker ? (\n <View\n pointerEvents=\"none\"\n style={styles.pickerAmPmContainer}>\n <Text\n allowFontScaling={allowFontScaling}\n style={[styles.pickerAmPmLabel]}>\n {isAm ? amLabel : pmLabel}\n </Text>\n </View>\n ) : null}\n </View>\n );\n },\n [\n adjustedLimited.max,\n adjustedLimited.min,\n allowFontScaling,\n amLabel,\n is12HourPicker,\n pmLabel,\n styles.disabledPickerItem,\n styles.pickerAmPmContainer,\n styles.pickerAmPmLabel,\n styles.pickerItem,\n styles.pickerItemContainer,\n ]\n );\n\n const onScroll = useCallback(\n (e: NativeSyntheticEvent<NativeScrollEvent>) => {\n // this function is only used when the picker is in a modal and/or has Haptic/Audio feedback\n // it is used to ensure that the modal gets the latest duration on clicking\n // the confirm button, even if the scrollview is still scrolling\n if (\n !aggressivelyGetLatestDuration &&\n !Haptics &&\n !Audio &&\n !pickerFeedback\n ) {\n return;\n }\n\n if (aggressivelyGetLatestDuration) {\n const newValues = getDurationAndIndexFromScrollOffset({\n disableInfiniteScroll,\n interval,\n itemHeight: styles.pickerItemContainer.height,\n numberOfItems,\n padWithNItems,\n yContentOffset: e.nativeEvent.contentOffset.y,\n });\n\n if (newValues.duration !== latestDuration.current) {\n // check limits\n if (newValues.duration > adjustedLimited.max) {\n newValues.duration = adjustedLimited.max;\n } else if (newValues.duration < adjustedLimited.min) {\n newValues.duration = adjustedLimited.min;\n }\n\n latestDuration.current = newValues.duration;\n }\n }\n\n if (Haptics || Audio || pickerFeedback) {\n const feedbackIndex = Math.round(\n (e.nativeEvent.contentOffset.y +\n styles.pickerItemContainer.height / 2) /\n styles.pickerItemContainer.height\n );\n\n if (feedbackIndex !== lastFeedbackIndex.current) {\n // this check stops the feedback firing when the component mounts\n if (lastFeedbackIndex.current) {\n // fire haptic feedback if available\n try {\n Haptics?.selectionAsync();\n } catch {\n // do nothing\n }\n\n // play click sound if available\n try {\n clickSound?.replayAsync();\n } catch {\n // do nothing\n }\n\n // fire custom feedback if available\n try {\n pickerFeedback?.();\n } catch {\n // do nothing\n }\n }\n\n lastFeedbackIndex.current = feedbackIndex;\n }\n }\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n adjustedLimited.max,\n adjustedLimited.min,\n aggressivelyGetLatestDuration,\n clickSound,\n disableInfiniteScroll,\n interval,\n numberOfItems,\n padWithNItems,\n styles.pickerItemContainer.height,\n ]\n );\n\n const onMomentumScrollEnd = useCallback(\n (e: NativeSyntheticEvent<NativeScrollEvent>) => {\n const newValues = getDurationAndIndexFromScrollOffset({\n disableInfiniteScroll,\n interval,\n itemHeight: styles.pickerItemContainer.height,\n numberOfItems,\n padWithNItems,\n yContentOffset: e.nativeEvent.contentOffset.y,\n });\n\n // check limits\n if (newValues.duration > adjustedLimited.max) {\n const targetScrollIndex =\n newValues.index -\n (newValues.duration - adjustedLimited.max);\n flatListRef.current?.scrollToIndex({\n animated: true,\n index:\n // guard against scrolling beyond end of list\n targetScrollIndex >= 0\n ? targetScrollIndex\n : adjustedLimited.max - 1,\n }); // scroll down to max\n newValues.duration = adjustedLimited.max;\n } else if (newValues.duration < adjustedLimited.min) {\n const targetScrollIndex =\n newValues.index +\n (adjustedLimited.min - newValues.duration);\n flatListRef.current?.scrollToIndex({\n animated: true,\n index:\n // guard against scrolling beyond end of list\n targetScrollIndex <= numbersForFlatList.length - 1\n ? targetScrollIndex\n : adjustedLimited.min,\n }); // scroll up to min\n newValues.duration = adjustedLimited.min;\n }\n\n onDurationChange(newValues.duration);\n },\n [\n disableInfiniteScroll,\n interval,\n styles.pickerItemContainer.height,\n numberOfItems,\n padWithNItems,\n adjustedLimited.max,\n adjustedLimited.min,\n onDurationChange,\n numbersForFlatList.length,\n ]\n );\n\n const onViewableItemsChanged = useCallback(\n ({ viewableItems }: { viewableItems: ViewToken[] }) => {\n if (numberOfItems === 1) {\n return;\n }\n\n if (\n viewableItems[0]?.index &&\n viewableItems[0].index < numberOfItems * 0.5\n ) {\n flatListRef.current?.scrollToIndex({\n animated: false,\n index: viewableItems[0].index + numberOfItems,\n });\n } else if (\n viewableItems[0]?.index &&\n viewableItems[0].index >=\n numberOfItems * (safeRepeatNumbersNTimes - 0.5)\n ) {\n flatListRef.current?.scrollToIndex({\n animated: false,\n index: viewableItems[0].index - numberOfItems,\n });\n }\n },\n [numberOfItems, safeRepeatNumbersNTimes]\n );\n\n const [\n viewabilityConfigCallbackPairs,\n setViewabilityConfigCallbackPairs,\n ] = useState<ViewabilityConfigCallbackPairs | undefined>(\n !disableInfiniteScroll\n ? [\n {\n viewabilityConfig: {\n viewAreaCoveragePercentThreshold: 0,\n },\n onViewableItemsChanged: onViewableItemsChanged,\n },\n ]\n : undefined\n );\n\n const [flatListRenderKey, setFlatListRenderKey] = useState(0);\n\n const initialRender = useRef(true);\n\n useEffect(() => {\n // don't run on first render\n if (initialRender.current) {\n initialRender.current = false;\n return;\n }\n\n // if the onViewableItemsChanged callback changes, we need to update viewabilityConfigCallbackPairs\n // which requires the FlatList to be remounted, hence the increase of the FlatList key\n setFlatListRenderKey((prev) => prev + 1);\n setViewabilityConfigCallbackPairs(\n !disableInfiniteScroll\n ? [\n {\n viewabilityConfig: {\n viewAreaCoveragePercentThreshold: 0,\n },\n onViewableItemsChanged: onViewableItemsChanged,\n },\n ]\n : undefined\n );\n }, [disableInfiniteScroll, onViewableItemsChanged]);\n\n const getItemLayout = useCallback(\n (_: ArrayLike<string> | null | undefined, index: number) => ({\n length: styles.pickerItemContainer.height,\n offset: styles.pickerItemContainer.height * index,\n index,\n }),\n [styles.pickerItemContainer.height]\n );\n\n useImperativeHandle(ref, () => ({\n reset: (options) => {\n flatListRef.current?.scrollToIndex({\n animated: options?.animated ?? false,\n index: initialScrollIndex,\n });\n },\n setValue: (value, options) => {\n flatListRef.current?.scrollToIndex({\n animated: options?.animated ?? false,\n index: getInitialScrollIndex({\n disableInfiniteScroll,\n interval,\n numberOfItems,\n padWithNItems,\n repeatNumbersNTimes: safeRepeatNumbersNTimes,\n value: value,\n }),\n });\n },\n latestDuration: latestDuration,\n }));\n\n return (\n <View\n pointerEvents={isDisabled ? \"none\" : undefined}\n style={[\n styles.durationScrollFlatListContainer,\n {\n height:\n styles.pickerItemContainer.height *\n numberOfItemsToShow,\n },\n isDisabled && styles.disabledPickerContainer,\n ]}\n testID={testID}>\n <FlatList\n key={flatListRenderKey}\n ref={flatListRef}\n contentContainerStyle={\n styles.durationScrollFlatListContentContainer\n }\n data={numbersForFlatList}\n decelerationRate={0.88}\n getItemLayout={getItemLayout}\n initialScrollIndex={initialScrollIndex}\n keyExtractor={(_, index) => index.toString()}\n nestedScrollEnabled\n onMomentumScrollEnd={onMomentumScrollEnd}\n onScroll={onScroll}\n renderItem={renderItem}\n scrollEnabled={!isDisabled}\n scrollEventThrottle={16}\n showsVerticalScrollIndicator={false}\n snapToAlignment=\"start\"\n // used in place of snapToInterval due to bug on Android\n snapToOffsets={[...Array(numbersForFlatList.length)].map(\n (_, i) => i * styles.pickerItemContainer.height\n )}\n style={styles.durationScrollFlatList}\n testID=\"duration-scroll-flatlist\"\n viewabilityConfigCallbackPairs={\n viewabilityConfigCallbackPairs\n }\n windowSize={numberOfItemsToShow}\n />\n <View pointerEvents=\"none\" style={styles.pickerLabelContainer}>\n {typeof label === \"string\" ? (\n <Text\n allowFontScaling={allowFontScaling}\n style={styles.pickerLabel}>\n {label}\n </Text>\n ) : (\n label ?? null\n )}\n </View>\n {LinearGradient ? (\n <>\n <LinearGradient\n colors={[\n styles.pickerContainer.backgroundColor ??\n \"white\",\n colorToRgba({\n color:\n styles.pickerContainer\n .backgroundColor ?? \"white\",\n opacity: 0,\n }),\n ]}\n end={{ x: 1, y: 1 }}\n pointerEvents=\"none\"\n start={{ x: 1, y: 0.3 }}\n {...pickerGradientOverlayProps}\n {...topPickerGradientOverlayProps}\n style={[styles.pickerGradientOverlay, { top: 0 }]}\n />\n <LinearGradient\n colors={[\n colorToRgba({\n color:\n styles.pickerContainer\n .backgroundColor ?? \"white\",\n opacity: 0,\n }),\n styles.pickerContainer.backgroundColor ??\n \"white\",\n ]}\n end={{ x: 1, y: 0.7 }}\n pointerEvents=\"none\"\n start={{ x: 1, y: 0 }}\n {...pickerGradientOverlayProps}\n {...bottomPickerGradientOverlayProps}\n style={[\n styles.pickerGradientOverlay,\n { bottom: -1 },\n ]}\n />\n </>\n ) : null}\n </View>\n );\n }\n);\n\nexport default React.memo(DurationScroll);\n"],"mappings":";;;;;;AAAA,IAA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C,IAAI,CAACxK,cAAc,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_colorToRgba","_generateNumbers","_getAdjustedLimit","_getDurationAndIndexFromScrollOffset","_getInitialScrollIndex","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","DurationScroll","forwardRef","props","ref","aggressivelyGetLatestDuration","allowFontScaling","amLabel","Audio","clickSoundAsset","disableInfiniteScroll","FlatList","RNFlatList","Haptics","initialValue","interval","is12HourPicker","isDisabled","label","limit","LinearGradient","MaskedView","maximumValue","onDurationChange","padNumbersWithZero","padWithNItems","pickerFeedback","pickerGradientOverlayProps","pmLabel","repeatNumbersNTimes","repeatNumbersNTimesNotExplicitlySet","styles","testID","numberOfItems","useMemo","Math","floor","safeRepeatNumbersNTimes","isNaN","max","round","numbersForFlatList","generate12HourNumbers","repeatNTimes","generateNumbers","initialScrollIndex","getInitialScrollIndex","value","adjustedLimited","getAdjustedLimit","numberOfItemsToShow","latestDuration","useRef","lastFeedbackIndex","flatListRef","clickSound","setClickSound","useState","useEffect","loadSound","sound","Sound","createAsync","uri","shouldPlay","unloadAsync","renderItem","useCallback","item","stringItem","intItem","isAm","parseInt","includes","replace","createElement","View","key","style","pickerItemContainer","Text","pickerItem","min","disabledPickerItem","pointerEvents","pickerAmPmContainer","pickerAmPmLabel","onScroll","newValues","getDurationAndIndexFromScrollOffset","itemHeight","height","yContentOffset","nativeEvent","contentOffset","y","duration","current","feedbackIndex","selectionAsync","replayAsync","onMomentumScrollEnd","_flatListRef$current","targetScrollIndex","index","scrollToIndex","animated","_flatListRef$current2","onViewableItemsChanged","viewableItems","_viewableItems$","_viewableItems$2","_flatListRef$current3","_flatListRef$current4","viewabilityConfigCallbackPairs","setViewabilityConfigCallbackPairs","viewabilityConfig","viewAreaCoveragePercentThreshold","undefined","flatListRenderKey","setFlatListRenderKey","initialRender","prev","getItemLayout","_","offset","useImperativeHandle","reset","options","_flatListRef$current5","setValue","_flatListRef$current6","renderContent","Fragment","contentContainerStyle","durationScrollFlatListContentContainer","data","decelerationRate","keyExtractor","toString","nestedScrollEnabled","scrollEnabled","scrollEventThrottle","showsVerticalScrollIndicator","snapToAlignment","snapToOffsets","Array","map","durationScrollFlatList","windowSize","pickerLabelContainer","pickerLabel","renderLinearGradient","colors","backgroundColor","pickerContainer","transparentBackgroundColor","colorToRgba","color","opacity","gradientHeight","locations","pickerGradientOverlay","durationScrollFlatListContainer","disabledPickerContainer","maskElement","maskedView","_default","exports","React","memo"],"sources":["index.tsx"],"sourcesContent":["import React, {\n useRef,\n useCallback,\n forwardRef,\n useImperativeHandle,\n useState,\n useEffect,\n useMemo,\n} from \"react\";\n\nimport { View, Text, FlatList as RNFlatList } from \"react-native\";\nimport type {\n ViewabilityConfigCallbackPairs,\n ViewToken,\n NativeSyntheticEvent,\n NativeScrollEvent,\n} from \"react-native\";\n\nimport { colorToRgba } from \"../../utils/colorToRgba\";\nimport {\n generate12HourNumbers,\n generateNumbers,\n} from \"../../utils/generateNumbers\";\nimport { getAdjustedLimit } from \"../../utils/getAdjustedLimit\";\nimport { getDurationAndIndexFromScrollOffset } from \"../../utils/getDurationAndIndexFromScrollOffset\";\nimport { getInitialScrollIndex } from \"../../utils/getInitialScrollIndex\";\n\nimport type { DurationScrollProps, DurationScrollRef } from \"./types\";\n\nconst DurationScroll = forwardRef<DurationScrollRef, DurationScrollProps>(\n (props, ref) => {\n const {\n aggressivelyGetLatestDuration,\n allowFontScaling = false,\n amLabel,\n Audio,\n clickSoundAsset,\n disableInfiniteScroll = false,\n FlatList = RNFlatList,\n Haptics,\n initialValue = 0,\n interval,\n is12HourPicker,\n isDisabled,\n label,\n limit,\n LinearGradient,\n MaskedView,\n maximumValue,\n onDurationChange,\n padNumbersWithZero = false,\n padWithNItems,\n pickerFeedback,\n pickerGradientOverlayProps,\n pmLabel,\n repeatNumbersNTimes = 3,\n repeatNumbersNTimesNotExplicitlySet,\n styles,\n testID,\n } = props;\n\n const numberOfItems = useMemo(() => {\n // guard against negative maximum values\n if (maximumValue < 0) {\n return 1;\n }\n\n return Math.floor(maximumValue / interval) + 1;\n }, [interval, maximumValue]);\n\n const safeRepeatNumbersNTimes = useMemo(() => {\n // do not repeat numbers if there is only one option\n if (numberOfItems === 1) {\n return 1;\n }\n\n if (!disableInfiniteScroll && repeatNumbersNTimes < 2) {\n return 2;\n } else if (repeatNumbersNTimes < 1 || isNaN(repeatNumbersNTimes)) {\n return 1;\n }\n\n // if this variable is not explicitly set, we calculate a reasonable value based on\n // the number of items in the picker, avoiding regular jumps up/down the list\n // whilst avoiding rendering too many items in the picker\n if (repeatNumbersNTimesNotExplicitlySet) {\n return Math.max(Math.round(180 / numberOfItems), 1);\n }\n\n return Math.round(repeatNumbersNTimes);\n }, [\n disableInfiniteScroll,\n numberOfItems,\n repeatNumbersNTimes,\n repeatNumbersNTimesNotExplicitlySet,\n ]);\n\n const numbersForFlatList = useMemo(() => {\n if (is12HourPicker) {\n return generate12HourNumbers({\n padNumbersWithZero,\n repeatNTimes: safeRepeatNumbersNTimes,\n disableInfiniteScroll,\n padWithNItems,\n interval,\n });\n }\n\n return generateNumbers(numberOfItems, {\n padNumbersWithZero,\n repeatNTimes: safeRepeatNumbersNTimes,\n disableInfiniteScroll,\n padWithNItems,\n interval,\n });\n }, [\n disableInfiniteScroll,\n is12HourPicker,\n interval,\n numberOfItems,\n padNumbersWithZero,\n padWithNItems,\n safeRepeatNumbersNTimes,\n ]);\n\n const initialScrollIndex = useMemo(\n () =>\n getInitialScrollIndex({\n disableInfiniteScroll,\n interval,\n numberOfItems,\n padWithNItems,\n repeatNumbersNTimes: safeRepeatNumbersNTimes,\n value: initialValue,\n }),\n [\n disableInfiniteScroll,\n initialValue,\n interval,\n numberOfItems,\n padWithNItems,\n safeRepeatNumbersNTimes,\n ]\n );\n\n const adjustedLimited = useMemo(\n () => getAdjustedLimit(limit, numberOfItems, interval),\n [interval, limit, numberOfItems]\n );\n\n const numberOfItemsToShow = 1 + padWithNItems * 2;\n\n // keep track of the latest duration as it scrolls\n const latestDuration = useRef(0);\n // keep track of the last index scrolled past for haptic/audio feedback\n const lastFeedbackIndex = useRef(0);\n\n const flatListRef = useRef<RNFlatList | null>(null);\n\n const [clickSound, setClickSound] = useState<\n | {\n replayAsync: () => Promise<void>;\n unloadAsync: () => Promise<void>;\n }\n | undefined\n >();\n\n // Preload the sound when the component mounts\n useEffect(() => {\n const loadSound = async () => {\n if (Audio) {\n const { sound } = await Audio.Sound.createAsync(\n clickSoundAsset ?? {\n // use a hosted sound as a fallback (do not use local asset due to loader issues\n // in some environments when including mp3 in library)\n uri: \"https://drive.google.com/uc?export=download&id=10e1YkbNsRh-vGx1jmS1Nntz8xzkBp4_I\",\n },\n { shouldPlay: false }\n );\n setClickSound(sound);\n }\n };\n\n loadSound();\n\n // Unload sound when component unmounts\n return () => {\n clickSound?.unloadAsync();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [Audio]);\n\n const renderItem = useCallback(\n ({ item }: { item: string }) => {\n let stringItem = item;\n let intItem: number;\n let isAm: boolean | undefined;\n\n if (!is12HourPicker) {\n intItem = parseInt(item);\n } else {\n isAm = item.includes(\"AM\");\n stringItem = item.replace(/\\s[AP]M/g, \"\");\n intItem = parseInt(stringItem);\n }\n\n return (\n <View\n key={item}\n style={styles.pickerItemContainer}\n testID=\"picker-item\">\n <Text\n allowFontScaling={allowFontScaling}\n style={[\n styles.pickerItem,\n intItem > adjustedLimited.max ||\n intItem < adjustedLimited.min\n ? styles.disabledPickerItem\n : {},\n ]}>\n {stringItem}\n </Text>\n {is12HourPicker ? (\n <View\n pointerEvents=\"none\"\n style={styles.pickerAmPmContainer}>\n <Text\n allowFontScaling={allowFontScaling}\n style={[styles.pickerAmPmLabel]}>\n {isAm ? amLabel : pmLabel}\n </Text>\n </View>\n ) : null}\n </View>\n );\n },\n [\n adjustedLimited.max,\n adjustedLimited.min,\n allowFontScaling,\n amLabel,\n is12HourPicker,\n pmLabel,\n styles.disabledPickerItem,\n styles.pickerAmPmContainer,\n styles.pickerAmPmLabel,\n styles.pickerItem,\n styles.pickerItemContainer,\n ]\n );\n\n const onScroll = useCallback(\n (e: NativeSyntheticEvent<NativeScrollEvent>) => {\n // this function is only used when the picker is in a modal and/or has Haptic/Audio feedback\n // it is used to ensure that the modal gets the latest duration on clicking\n // the confirm button, even if the scrollview is still scrolling\n if (\n !aggressivelyGetLatestDuration &&\n !Haptics &&\n !Audio &&\n !pickerFeedback\n ) {\n return;\n }\n\n if (aggressivelyGetLatestDuration) {\n const newValues = getDurationAndIndexFromScrollOffset({\n disableInfiniteScroll,\n interval,\n itemHeight: styles.pickerItemContainer.height,\n numberOfItems,\n padWithNItems,\n yContentOffset: e.nativeEvent.contentOffset.y,\n });\n\n if (newValues.duration !== latestDuration.current) {\n // check limits\n if (newValues.duration > adjustedLimited.max) {\n newValues.duration = adjustedLimited.max;\n } else if (newValues.duration < adjustedLimited.min) {\n newValues.duration = adjustedLimited.min;\n }\n\n latestDuration.current = newValues.duration;\n }\n }\n\n if (Haptics || Audio || pickerFeedback) {\n const feedbackIndex = Math.round(\n (e.nativeEvent.contentOffset.y +\n styles.pickerItemContainer.height / 2) /\n styles.pickerItemContainer.height\n );\n\n if (feedbackIndex !== lastFeedbackIndex.current) {\n // this check stops the feedback firing when the component mounts\n if (lastFeedbackIndex.current) {\n // fire haptic feedback if available\n try {\n Haptics?.selectionAsync();\n } catch {\n // do nothing\n }\n\n // play click sound if available\n try {\n clickSound?.replayAsync();\n } catch {\n // do nothing\n }\n\n // fire custom feedback if available\n try {\n pickerFeedback?.();\n } catch {\n // do nothing\n }\n }\n\n lastFeedbackIndex.current = feedbackIndex;\n }\n }\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n adjustedLimited.max,\n adjustedLimited.min,\n aggressivelyGetLatestDuration,\n clickSound,\n disableInfiniteScroll,\n interval,\n numberOfItems,\n padWithNItems,\n styles.pickerItemContainer.height,\n ]\n );\n\n const onMomentumScrollEnd = useCallback(\n (e: NativeSyntheticEvent<NativeScrollEvent>) => {\n const newValues = getDurationAndIndexFromScrollOffset({\n disableInfiniteScroll,\n interval,\n itemHeight: styles.pickerItemContainer.height,\n numberOfItems,\n padWithNItems,\n yContentOffset: e.nativeEvent.contentOffset.y,\n });\n\n // check limits\n if (newValues.duration > adjustedLimited.max) {\n const targetScrollIndex =\n newValues.index -\n (newValues.duration - adjustedLimited.max);\n flatListRef.current?.scrollToIndex({\n animated: true,\n index:\n // guard against scrolling beyond end of list\n targetScrollIndex >= 0\n ? targetScrollIndex\n : adjustedLimited.max - 1,\n }); // scroll down to max\n newValues.duration = adjustedLimited.max;\n } else if (newValues.duration < adjustedLimited.min) {\n const targetScrollIndex =\n newValues.index +\n (adjustedLimited.min - newValues.duration);\n flatListRef.current?.scrollToIndex({\n animated: true,\n index:\n // guard against scrolling beyond end of list\n targetScrollIndex <= numbersForFlatList.length - 1\n ? targetScrollIndex\n : adjustedLimited.min,\n }); // scroll up to min\n newValues.duration = adjustedLimited.min;\n }\n\n onDurationChange(newValues.duration);\n },\n [\n disableInfiniteScroll,\n interval,\n styles.pickerItemContainer.height,\n numberOfItems,\n padWithNItems,\n adjustedLimited.max,\n adjustedLimited.min,\n onDurationChange,\n numbersForFlatList.length,\n ]\n );\n\n const onViewableItemsChanged = useCallback(\n ({ viewableItems }: { viewableItems: ViewToken[] }) => {\n if (numberOfItems === 1) {\n return;\n }\n\n if (\n viewableItems[0]?.index &&\n viewableItems[0].index < numberOfItems * 0.5\n ) {\n flatListRef.current?.scrollToIndex({\n animated: false,\n index: viewableItems[0].index + numberOfItems,\n });\n } else if (\n viewableItems[0]?.index &&\n viewableItems[0].index >=\n numberOfItems * (safeRepeatNumbersNTimes - 0.5)\n ) {\n flatListRef.current?.scrollToIndex({\n animated: false,\n index: viewableItems[0].index - numberOfItems,\n });\n }\n },\n [numberOfItems, safeRepeatNumbersNTimes]\n );\n\n const [\n viewabilityConfigCallbackPairs,\n setViewabilityConfigCallbackPairs,\n ] = useState<ViewabilityConfigCallbackPairs | undefined>(\n !disableInfiniteScroll\n ? [\n {\n viewabilityConfig: {\n viewAreaCoveragePercentThreshold: 0,\n },\n onViewableItemsChanged: onViewableItemsChanged,\n },\n ]\n : undefined\n );\n\n const [flatListRenderKey, setFlatListRenderKey] = useState(0);\n\n const initialRender = useRef(true);\n\n useEffect(() => {\n // don't run on first render\n if (initialRender.current) {\n initialRender.current = false;\n return;\n }\n\n // if the onViewableItemsChanged callback changes, we need to update viewabilityConfigCallbackPairs\n // which requires the FlatList to be remounted, hence the increase of the FlatList key\n setFlatListRenderKey((prev) => prev + 1);\n setViewabilityConfigCallbackPairs(\n !disableInfiniteScroll\n ? [\n {\n viewabilityConfig: {\n viewAreaCoveragePercentThreshold: 0,\n },\n onViewableItemsChanged: onViewableItemsChanged,\n },\n ]\n : undefined\n );\n }, [disableInfiniteScroll, onViewableItemsChanged]);\n\n const getItemLayout = useCallback(\n (_: ArrayLike<string> | null | undefined, index: number) => ({\n length: styles.pickerItemContainer.height,\n offset: styles.pickerItemContainer.height * index,\n index,\n }),\n [styles.pickerItemContainer.height]\n );\n\n useImperativeHandle(ref, () => ({\n reset: (options) => {\n flatListRef.current?.scrollToIndex({\n animated: options?.animated ?? false,\n index: initialScrollIndex,\n });\n },\n setValue: (value, options) => {\n flatListRef.current?.scrollToIndex({\n animated: options?.animated ?? false,\n index: getInitialScrollIndex({\n disableInfiniteScroll,\n interval,\n numberOfItems,\n padWithNItems,\n repeatNumbersNTimes: safeRepeatNumbersNTimes,\n value: value,\n }),\n });\n },\n latestDuration: latestDuration,\n }));\n\n const renderContent = useMemo(() => {\n return (\n <>\n <FlatList\n key={flatListRenderKey}\n ref={flatListRef}\n contentContainerStyle={\n styles.durationScrollFlatListContentContainer\n }\n data={numbersForFlatList}\n decelerationRate={0.88}\n getItemLayout={getItemLayout}\n initialScrollIndex={initialScrollIndex}\n keyExtractor={(_, index) => index.toString()}\n nestedScrollEnabled\n onMomentumScrollEnd={onMomentumScrollEnd}\n onScroll={onScroll}\n renderItem={renderItem}\n scrollEnabled={!isDisabled}\n scrollEventThrottle={16}\n showsVerticalScrollIndicator={false}\n snapToAlignment=\"start\"\n // used in place of snapToInterval due to bug on Android\n snapToOffsets={[\n ...Array(numbersForFlatList.length),\n ].map((_, i) => i * styles.pickerItemContainer.height)}\n style={styles.durationScrollFlatList}\n testID=\"duration-scroll-flatlist\"\n viewabilityConfigCallbackPairs={\n viewabilityConfigCallbackPairs\n }\n windowSize={numberOfItemsToShow}\n />\n <View\n pointerEvents=\"none\"\n style={styles.pickerLabelContainer}>\n {typeof label === \"string\" ? (\n <Text\n allowFontScaling={allowFontScaling}\n style={styles.pickerLabel}>\n {label}\n </Text>\n ) : (\n label ?? null\n )}\n </View>\n </>\n );\n }, [\n FlatList,\n allowFontScaling,\n flatListRenderKey,\n getItemLayout,\n initialScrollIndex,\n isDisabled,\n label,\n numberOfItemsToShow,\n numbersForFlatList,\n onMomentumScrollEnd,\n onScroll,\n renderItem,\n styles.durationScrollFlatList,\n styles.durationScrollFlatListContentContainer,\n styles.pickerItemContainer.height,\n styles.pickerLabel,\n styles.pickerLabelContainer,\n viewabilityConfigCallbackPairs,\n ]);\n\n const renderLinearGradient = useMemo(() => {\n if (!LinearGradient) {\n return null;\n }\n\n let colors: string[];\n\n if (MaskedView) {\n // if using masked view, we only care about the opacity\n colors = [\n \"rgba(0,0,0,0)\",\n \"rgba(0,0,0,1)\",\n \"rgba(0,0,0,1)\",\n \"rgba(0,0,0,0)\",\n ];\n } else {\n const backgroundColor =\n styles.pickerContainer.backgroundColor ?? \"white\";\n const transparentBackgroundColor = colorToRgba({\n color: backgroundColor,\n opacity: 0,\n });\n colors = [\n backgroundColor,\n transparentBackgroundColor,\n transparentBackgroundColor,\n backgroundColor,\n ];\n }\n\n // calculate the gradient height to cover the top item and bottom item\n const gradientHeight =\n padWithNItems > 0 ? 1 / (padWithNItems * 2 + 1) : 0.3;\n\n return (\n <LinearGradient\n colors={colors}\n locations={[0, gradientHeight, 1 - gradientHeight, 1]}\n pointerEvents=\"none\"\n style={styles.pickerGradientOverlay}\n {...pickerGradientOverlayProps}\n />\n );\n }, [\n LinearGradient,\n MaskedView,\n padWithNItems,\n pickerGradientOverlayProps,\n styles.pickerContainer.backgroundColor,\n styles.pickerGradientOverlay,\n ]);\n\n return (\n <View\n pointerEvents={isDisabled ? \"none\" : undefined}\n style={[\n styles.durationScrollFlatListContainer,\n {\n height:\n styles.pickerItemContainer.height *\n numberOfItemsToShow,\n },\n isDisabled && styles.disabledPickerContainer,\n ]}\n testID={testID}>\n {MaskedView ? (\n <MaskedView\n maskElement={renderLinearGradient}\n style={[styles.maskedView]}>\n {renderContent}\n </MaskedView>\n ) : (\n <>\n {renderContent}\n {renderLinearGradient}\n </>\n )}\n </View>\n );\n }\n);\n\nexport default React.memo(DurationScroll);\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAUA,IAAAC,YAAA,GAAAD,OAAA;AAQA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAH,OAAA;AAIA,IAAAI,iBAAA,GAAAJ,OAAA;AACA,IAAAK,oCAAA,GAAAL,OAAA;AACA,IAAAM,sBAAA,GAAAN,OAAA;AAA0E,SAAAO,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAT,wBAAAS,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA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AA,gBAEa4L,cAAK,CAACC,IAAI,CAACzK,cAAc,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { MutableRefObject } from \"react\";\n\nimport type {\n View,\n FlatList as RNFlatList,\n FlatListProps as RNFlatListProps,\n} from \"react-native\";\n\nimport type { generateStyles } from \"../TimerPicker/styles\";\n\nexport type CustomFlatList = <ItemT = any>(\n props: React.PropsWithChildren<\n RNFlatListProps<ItemT> & React.RefAttributes<RNFlatList<ItemT>>\n >,\n ref: React.ForwardedRef<RNFlatList<ItemT>>\n) => React.ReactElement | null;\n\nexport interface DurationScrollProps {\n Audio?: any;\n FlatList?: CustomFlatList;\n Haptics?: any;\n LinearGradient?: any;\n aggressivelyGetLatestDuration: boolean;\n allowFontScaling?: boolean;\n amLabel?: string;\n
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { MutableRefObject } from \"react\";\n\nimport type {\n View,\n FlatList as RNFlatList,\n FlatListProps as RNFlatListProps,\n} from \"react-native\";\n\nimport type { generateStyles } from \"../TimerPicker/styles\";\n\nexport type CustomFlatList = <ItemT = any>(\n props: React.PropsWithChildren<\n RNFlatListProps<ItemT> & React.RefAttributes<RNFlatList<ItemT>>\n >,\n ref: React.ForwardedRef<RNFlatList<ItemT>>\n) => React.ReactElement | null;\n\nexport interface DurationScrollProps {\n Audio?: any;\n FlatList?: CustomFlatList;\n Haptics?: any;\n LinearGradient?: any;\n MaskedView?: any;\n aggressivelyGetLatestDuration: boolean;\n allowFontScaling?: boolean;\n amLabel?: string;\n clickSoundAsset?: SoundAssetType;\n disableInfiniteScroll?: boolean;\n initialValue?: number;\n interval: number;\n is12HourPicker?: boolean;\n isDisabled?: boolean;\n label?: string | React.ReactElement;\n limit?: LimitType;\n maximumValue: number;\n onDurationChange: (duration: number) => void;\n padNumbersWithZero?: boolean;\n padWithNItems: number;\n pickerFeedback?: () => void | Promise<void>;\n pickerGradientOverlayProps?: Partial<LinearGradientProps>;\n pmLabel?: string;\n repeatNumbersNTimes?: number;\n repeatNumbersNTimesNotExplicitlySet: boolean;\n styles: ReturnType<typeof generateStyles>;\n testID?: string;\n}\n\nexport interface DurationScrollRef {\n latestDuration: MutableRefObject<number>;\n reset: (options?: { animated?: boolean }) => void;\n setValue: (value: number, options?: { animated?: boolean }) => void;\n}\n\ntype LinearGradientPoint = {\n x: number;\n y: number;\n};\n\nexport type LinearGradientProps = React.ComponentProps<typeof View> & {\n colors: string[];\n end?: LinearGradientPoint | null;\n locations?: number[] | null;\n start?: LinearGradientPoint | null;\n};\n\nexport type LimitType = {\n max?: number;\n min?: number;\n};\n\nexport type SoundAssetType =\n | number\n | {\n headers?: Record<string, string>;\n overrideFileExtensionAndroid?: string;\n uri: string;\n };\n"],"mappings":"","ignoreList":[]}
|
|
@@ -67,9 +67,7 @@ const TimerPicker = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
67
67
|
minutes: initialValue === null || initialValue === void 0 ? void 0 : initialValue.minutes,
|
|
68
68
|
seconds: initialValue === null || initialValue === void 0 ? void 0 : initialValue.seconds
|
|
69
69
|
}), [initialValue === null || initialValue === void 0 ? void 0 : initialValue.hours, initialValue === null || initialValue === void 0 ? void 0 : initialValue.minutes, initialValue === null || initialValue === void 0 ? void 0 : initialValue.seconds]);
|
|
70
|
-
const styles = (0, _react.useMemo)(() => (0, _styles.generateStyles)(customStyles,
|
|
71
|
-
padWithNItems: safePadWithNItems
|
|
72
|
-
}), [safePadWithNItems, customStyles]);
|
|
70
|
+
const styles = (0, _react.useMemo)(() => (0, _styles.generateStyles)(customStyles), [customStyles]);
|
|
73
71
|
const [selectedHours, setSelectedHours] = (0, _react.useState)(safeInitialValue.hours);
|
|
74
72
|
const [selectedMinutes, setSelectedMinutes] = (0, _react.useState)(safeInitialValue.minutes);
|
|
75
73
|
const [selectedSeconds, setSelectedSeconds] = (0, _react.useState)(safeInitialValue.seconds);
|