react-native-timer-picker 2.1.0 → 2.2.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.
Files changed (101) hide show
  1. package/README.md +227 -152
  2. package/dist/commonjs/components/DurationScroll/DurationScroll.js +417 -0
  3. package/dist/commonjs/components/DurationScroll/DurationScroll.js.map +1 -0
  4. package/dist/commonjs/components/DurationScroll/index.js +20 -392
  5. package/dist/commonjs/components/DurationScroll/index.js.map +1 -1
  6. package/dist/commonjs/components/DurationScroll/types.js.map +1 -1
  7. package/dist/commonjs/components/Modal/Modal.js +107 -0
  8. package/dist/commonjs/components/Modal/Modal.js.map +1 -0
  9. package/dist/commonjs/components/Modal/index.js +20 -101
  10. package/dist/commonjs/components/Modal/index.js.map +1 -1
  11. package/dist/commonjs/components/TimerPicker/TimerPicker.js +225 -0
  12. package/dist/commonjs/components/TimerPicker/TimerPicker.js.map +1 -0
  13. package/dist/commonjs/components/TimerPicker/index.js +29 -166
  14. package/dist/commonjs/components/TimerPicker/index.js.map +1 -1
  15. package/dist/commonjs/components/TimerPicker/styles.js +1 -1
  16. package/dist/commonjs/components/TimerPicker/styles.js.map +1 -1
  17. package/dist/commonjs/components/TimerPicker/types.js.map +1 -1
  18. package/dist/commonjs/components/TimerPickerModal/TimerPickerModal.js +143 -0
  19. package/dist/commonjs/components/TimerPickerModal/TimerPickerModal.js.map +1 -0
  20. package/dist/commonjs/components/TimerPickerModal/index.js +30 -131
  21. package/dist/commonjs/components/TimerPickerModal/index.js.map +1 -1
  22. package/dist/commonjs/components/TimerPickerModal/types.js.map +1 -1
  23. package/dist/commonjs/index.js +9 -13
  24. package/dist/commonjs/index.js.map +1 -1
  25. package/dist/commonjs/tests/TimerPicker.test.js +4 -1
  26. package/dist/commonjs/tests/TimerPicker.test.js.map +1 -1
  27. package/dist/commonjs/utils/colorToRgba.js +35 -4
  28. package/dist/commonjs/utils/colorToRgba.js.map +1 -1
  29. package/dist/commonjs/utils/generateNumbers.js +67 -0
  30. package/dist/commonjs/utils/generateNumbers.js.map +1 -1
  31. package/dist/commonjs/utils/getAdjustedLimit.js +25 -0
  32. package/dist/commonjs/utils/getAdjustedLimit.js.map +1 -1
  33. package/dist/commonjs/utils/getDurationAndIndexFromScrollOffset.js +38 -0
  34. package/dist/commonjs/utils/getDurationAndIndexFromScrollOffset.js.map +1 -1
  35. package/dist/commonjs/utils/getInitialScrollIndex.js +38 -0
  36. package/dist/commonjs/utils/getInitialScrollIndex.js.map +1 -1
  37. package/dist/commonjs/utils/getSafeInitialValue.js +28 -0
  38. package/dist/commonjs/utils/getSafeInitialValue.js.map +1 -1
  39. package/dist/commonjs/utils/padNumber.js +25 -0
  40. package/dist/commonjs/utils/padNumber.js.map +1 -1
  41. package/dist/module/components/DurationScroll/DurationScroll.js +410 -0
  42. package/dist/module/components/DurationScroll/DurationScroll.js.map +1 -0
  43. package/dist/module/components/DurationScroll/index.js +2 -390
  44. package/dist/module/components/DurationScroll/index.js.map +1 -1
  45. package/dist/module/components/DurationScroll/types.js.map +1 -1
  46. package/dist/module/components/Modal/Modal.js +99 -0
  47. package/dist/module/components/Modal/Modal.js.map +1 -0
  48. package/dist/module/components/Modal/index.js +2 -98
  49. package/dist/module/components/Modal/index.js.map +1 -1
  50. package/dist/module/components/TimerPicker/TimerPicker.js +217 -0
  51. package/dist/module/components/TimerPicker/TimerPicker.js.map +1 -0
  52. package/dist/module/components/TimerPicker/index.js +3 -166
  53. package/dist/module/components/TimerPicker/index.js.map +1 -1
  54. package/dist/module/components/TimerPicker/styles.js +1 -1
  55. package/dist/module/components/TimerPicker/styles.js.map +1 -1
  56. package/dist/module/components/TimerPicker/types.js.map +1 -1
  57. package/dist/module/components/TimerPickerModal/TimerPickerModal.js +135 -0
  58. package/dist/module/components/TimerPickerModal/TimerPickerModal.js.map +1 -0
  59. package/dist/module/components/TimerPickerModal/index.js +3 -130
  60. package/dist/module/components/TimerPickerModal/index.js.map +1 -1
  61. package/dist/module/components/TimerPickerModal/types.js.map +1 -1
  62. package/dist/module/index.js +2 -6
  63. package/dist/module/index.js.map +1 -1
  64. package/dist/module/tests/TimerPicker.test.js +4 -1
  65. package/dist/module/tests/TimerPicker.test.js.map +1 -1
  66. package/dist/module/utils/colorToRgba.js +35 -4
  67. package/dist/module/utils/colorToRgba.js.map +1 -1
  68. package/dist/module/utils/generateNumbers.js +68 -0
  69. package/dist/module/utils/generateNumbers.js.map +1 -1
  70. package/dist/module/utils/getAdjustedLimit.js +25 -0
  71. package/dist/module/utils/getAdjustedLimit.js.map +1 -1
  72. package/dist/module/utils/getDurationAndIndexFromScrollOffset.js +38 -0
  73. package/dist/module/utils/getDurationAndIndexFromScrollOffset.js.map +1 -1
  74. package/dist/module/utils/getInitialScrollIndex.js +38 -0
  75. package/dist/module/utils/getInitialScrollIndex.js.map +1 -1
  76. package/dist/module/utils/getSafeInitialValue.js +28 -0
  77. package/dist/module/utils/getSafeInitialValue.js.map +1 -1
  78. package/dist/module/utils/padNumber.js +25 -0
  79. package/dist/module/utils/padNumber.js.map +1 -1
  80. package/dist/typescript/components/DurationScroll/DurationScroll.d.ts +4 -0
  81. package/dist/typescript/components/DurationScroll/index.d.ts +2 -4
  82. package/dist/typescript/components/DurationScroll/types.d.ts +13 -9
  83. package/dist/typescript/components/Modal/Modal.d.ts +5 -0
  84. package/dist/typescript/components/Modal/index.d.ts +2 -5
  85. package/dist/typescript/components/TimerPicker/TimerPicker.d.ts +4 -0
  86. package/dist/typescript/components/TimerPicker/index.d.ts +3 -4
  87. package/dist/typescript/components/TimerPicker/styles.d.ts +1169 -771
  88. package/dist/typescript/components/TimerPicker/types.d.ts +26 -10
  89. package/dist/typescript/components/TimerPickerModal/TimerPickerModal.d.ts +4 -0
  90. package/dist/typescript/components/TimerPickerModal/index.d.ts +3 -4
  91. package/dist/typescript/components/TimerPickerModal/styles.d.ts +722 -474
  92. package/dist/typescript/components/TimerPickerModal/types.d.ts +8 -5
  93. package/dist/typescript/index.d.ts +2 -6
  94. package/dist/typescript/utils/colorToRgba.d.ts +34 -0
  95. package/dist/typescript/utils/generateNumbers.d.ts +66 -0
  96. package/dist/typescript/utils/getAdjustedLimit.d.ts +27 -2
  97. package/dist/typescript/utils/getDurationAndIndexFromScrollOffset.d.ts +38 -0
  98. package/dist/typescript/utils/getInitialScrollIndex.d.ts +38 -0
  99. package/dist/typescript/utils/getSafeInitialValue.d.ts +29 -0
  100. package/dist/typescript/utils/padNumber.d.ts +25 -0
  101. package/package.json +10 -27
@@ -0,0 +1,417 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _colorToRgba = require("../../utils/colorToRgba");
10
+ var _generateNumbers = require("../../utils/generateNumbers");
11
+ var _getAdjustedLimit = require("../../utils/getAdjustedLimit");
12
+ var _getDurationAndIndexFromScrollOffset = require("../../utils/getDurationAndIndexFromScrollOffset");
13
+ var _getInitialScrollIndex = require("../../utils/getInitialScrollIndex");
14
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
15
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
16
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
17
+ const keyExtractor = (item, index) => index.toString();
18
+ const DurationScroll = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
19
+ const {
20
+ aggressivelyGetLatestDuration,
21
+ allowFontScaling = false,
22
+ amLabel,
23
+ Audio,
24
+ clickSoundAsset,
25
+ decelerationRate = 0.88,
26
+ disableInfiniteScroll = false,
27
+ FlatList = _reactNative.FlatList,
28
+ Haptics,
29
+ initialValue = 0,
30
+ interval,
31
+ is12HourPicker,
32
+ isDisabled,
33
+ label,
34
+ limit,
35
+ LinearGradient,
36
+ MaskedView,
37
+ maximumValue,
38
+ onDurationChange,
39
+ padNumbersWithZero = false,
40
+ padWithNItems,
41
+ pickerFeedback,
42
+ pickerGradientOverlayProps,
43
+ pmLabel,
44
+ repeatNumbersNTimes = 3,
45
+ repeatNumbersNTimesNotExplicitlySet,
46
+ styles,
47
+ testID
48
+ } = props;
49
+ const numberOfItems = (0, _react.useMemo)(() => {
50
+ // guard against negative maximum values
51
+ if (maximumValue < 0) {
52
+ return 1;
53
+ }
54
+ return Math.floor(maximumValue / interval) + 1;
55
+ }, [interval, maximumValue]);
56
+ const safeRepeatNumbersNTimes = (0, _react.useMemo)(() => {
57
+ // do not repeat numbers if there is only one option
58
+ if (numberOfItems === 1) {
59
+ return 1;
60
+ }
61
+ if (!disableInfiniteScroll && repeatNumbersNTimes < 2) {
62
+ return 2;
63
+ } else if (repeatNumbersNTimes < 1 || isNaN(repeatNumbersNTimes)) {
64
+ return 1;
65
+ }
66
+
67
+ // if this variable is not explicitly set, we calculate a reasonable value based on
68
+ // the number of items in the picker, avoiding regular jumps up/down the list
69
+ // whilst avoiding rendering too many items in the picker
70
+ if (repeatNumbersNTimesNotExplicitlySet) {
71
+ return Math.max(Math.round(180 / numberOfItems), 1);
72
+ }
73
+ return Math.round(repeatNumbersNTimes);
74
+ }, [disableInfiniteScroll, numberOfItems, repeatNumbersNTimes, repeatNumbersNTimesNotExplicitlySet]);
75
+ const numbersForFlatList = (0, _react.useMemo)(() => {
76
+ if (is12HourPicker) {
77
+ return (0, _generateNumbers.generate12HourNumbers)({
78
+ padNumbersWithZero,
79
+ repeatNTimes: safeRepeatNumbersNTimes,
80
+ disableInfiniteScroll,
81
+ padWithNItems,
82
+ interval
83
+ });
84
+ }
85
+ return (0, _generateNumbers.generateNumbers)(numberOfItems, {
86
+ padNumbersWithZero,
87
+ repeatNTimes: safeRepeatNumbersNTimes,
88
+ disableInfiniteScroll,
89
+ padWithNItems,
90
+ interval
91
+ });
92
+ }, [disableInfiniteScroll, is12HourPicker, interval, numberOfItems, padNumbersWithZero, padWithNItems, safeRepeatNumbersNTimes]);
93
+ const initialScrollIndex = (0, _react.useMemo)(() => (0, _getInitialScrollIndex.getInitialScrollIndex)({
94
+ disableInfiniteScroll,
95
+ interval,
96
+ numberOfItems,
97
+ padWithNItems,
98
+ repeatNumbersNTimes: safeRepeatNumbersNTimes,
99
+ value: initialValue
100
+ }), [disableInfiniteScroll, initialValue, interval, numberOfItems, padWithNItems, safeRepeatNumbersNTimes]);
101
+ const adjustedLimited = (0, _react.useMemo)(() => (0, _getAdjustedLimit.getAdjustedLimit)(limit, numberOfItems, interval), [interval, limit, numberOfItems]);
102
+ const numberOfItemsToShow = 1 + padWithNItems * 2;
103
+
104
+ // keep track of the latest duration as it scrolls
105
+ const latestDuration = (0, _react.useRef)(0);
106
+ // keep track of the last index scrolled past for haptic/audio feedback
107
+ const lastFeedbackIndex = (0, _react.useRef)(0);
108
+ const flatListRef = (0, _react.useRef)(null);
109
+ const [clickSound, setClickSound] = (0, _react.useState)(null);
110
+ (0, _react.useEffect)(() => {
111
+ // Audio prop deprecated in v2.2.0 (use pickerFeedback instead) - will be removed in a future version
112
+
113
+ // preload the sound when the component mounts
114
+ let soundInstance = null;
115
+ const loadSound = async () => {
116
+ if (!Audio) {
117
+ return;
118
+ }
119
+ try {
120
+ const {
121
+ sound: newSound
122
+ } = await Audio.Sound.createAsync(clickSoundAsset ?? {
123
+ // use a hosted sound as a fallback (do not use local asset due to loader issues
124
+ // in some environments when including mp3 in library)
125
+ uri: "https://drive.google.com/uc?export=download&id=10e1YkbNsRh-vGx1jmS1Nntz8xzkBp4_I"
126
+ }, {
127
+ shouldPlay: false
128
+ });
129
+ soundInstance = newSound;
130
+ setClickSound(newSound);
131
+ } catch (error) {
132
+ console.warn("Failed to load click sound:", error);
133
+ }
134
+ };
135
+ loadSound();
136
+ return () => {
137
+ var _soundInstance;
138
+ // unload sound when component unmounts
139
+ (_soundInstance = soundInstance) === null || _soundInstance === void 0 || _soundInstance.unloadAsync();
140
+ };
141
+ // eslint-disable-next-line react-hooks/exhaustive-deps
142
+ }, [Audio]);
143
+ const playClickSound = (0, _react.useCallback)(async () => {
144
+ if (!clickSound) return;
145
+ try {
146
+ await clickSound.replayAsync();
147
+ } catch (error) {
148
+ console.warn("Failed to play click sound:", error);
149
+ }
150
+ }, [clickSound]);
151
+ const renderItem = (0, _react.useCallback)(({
152
+ item
153
+ }) => {
154
+ let stringItem = item;
155
+ let intItem;
156
+ let isAm;
157
+ if (!is12HourPicker) {
158
+ intItem = parseInt(item);
159
+ } else {
160
+ isAm = item.includes("AM");
161
+ stringItem = item.replace(/\s[AP]M/g, "");
162
+ intItem = parseInt(stringItem);
163
+ }
164
+ return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
165
+ key: item,
166
+ style: styles.pickerItemContainer,
167
+ testID: "picker-item"
168
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
169
+ allowFontScaling: allowFontScaling,
170
+ style: [styles.pickerItem, intItem > adjustedLimited.max || intItem < adjustedLimited.min ? styles.disabledPickerItem : {}]
171
+ }, stringItem), is12HourPicker ? /*#__PURE__*/_react.default.createElement(_reactNative.View, {
172
+ pointerEvents: "none",
173
+ style: styles.pickerAmPmContainer
174
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
175
+ allowFontScaling: allowFontScaling,
176
+ style: [styles.pickerAmPmLabel]
177
+ }, isAm ? amLabel : pmLabel)) : null);
178
+ }, [adjustedLimited.max, adjustedLimited.min, allowFontScaling, amLabel, is12HourPicker, pmLabel, styles.disabledPickerItem, styles.pickerAmPmContainer, styles.pickerAmPmLabel, styles.pickerItem, styles.pickerItemContainer]);
179
+ const onScroll = (0, _react.useCallback)(e => {
180
+ // this function is only used when the picker is in a modal and/or has Haptic/Audio feedback
181
+ // it is used to ensure that the modal gets the latest duration on clicking
182
+ // the confirm button, even if the scrollview is still scrolling
183
+ if (!aggressivelyGetLatestDuration && !Haptics && !Audio && !pickerFeedback) {
184
+ return;
185
+ }
186
+ if (aggressivelyGetLatestDuration) {
187
+ const newValues = (0, _getDurationAndIndexFromScrollOffset.getDurationAndIndexFromScrollOffset)({
188
+ disableInfiniteScroll,
189
+ interval,
190
+ itemHeight: styles.pickerItemContainer.height,
191
+ numberOfItems,
192
+ padWithNItems,
193
+ yContentOffset: e.nativeEvent.contentOffset.y
194
+ });
195
+ if (newValues.duration !== latestDuration.current) {
196
+ // check limits
197
+ if (newValues.duration > adjustedLimited.max) {
198
+ newValues.duration = adjustedLimited.max;
199
+ } else if (newValues.duration < adjustedLimited.min) {
200
+ newValues.duration = adjustedLimited.min;
201
+ }
202
+ latestDuration.current = newValues.duration;
203
+ }
204
+ }
205
+ if (pickerFeedback || Haptics || Audio) {
206
+ const feedbackIndex = Math.round((e.nativeEvent.contentOffset.y + styles.pickerItemContainer.height / 2) / styles.pickerItemContainer.height);
207
+ if (feedbackIndex !== lastFeedbackIndex.current) {
208
+ // this check stops the feedback firing when the component mounts
209
+ if (lastFeedbackIndex.current) {
210
+ // fire haptic feedback if available
211
+ try {
212
+ Haptics === null || Haptics === void 0 || Haptics.selectionAsync();
213
+ } catch {
214
+ // do nothing
215
+ }
216
+
217
+ // play click sound if available
218
+ try {
219
+ playClickSound();
220
+ } catch {
221
+ // do nothing
222
+ }
223
+
224
+ // fire custom feedback if available
225
+ try {
226
+ pickerFeedback === null || pickerFeedback === void 0 || pickerFeedback();
227
+ } catch {
228
+ // do nothing
229
+ }
230
+ }
231
+ lastFeedbackIndex.current = feedbackIndex;
232
+ }
233
+ }
234
+ },
235
+ // eslint-disable-next-line react-hooks/exhaustive-deps
236
+ [adjustedLimited.max, adjustedLimited.min, aggressivelyGetLatestDuration, playClickSound, disableInfiniteScroll, interval, numberOfItems, padWithNItems, styles.pickerItemContainer.height]);
237
+ const onMomentumScrollEnd = (0, _react.useCallback)(e => {
238
+ const newValues = (0, _getDurationAndIndexFromScrollOffset.getDurationAndIndexFromScrollOffset)({
239
+ disableInfiniteScroll,
240
+ interval,
241
+ itemHeight: styles.pickerItemContainer.height,
242
+ numberOfItems,
243
+ padWithNItems,
244
+ yContentOffset: e.nativeEvent.contentOffset.y
245
+ });
246
+
247
+ // check limits
248
+ if (newValues.duration > adjustedLimited.max) {
249
+ var _flatListRef$current;
250
+ const targetScrollIndex = newValues.index - (newValues.duration - adjustedLimited.max);
251
+ (_flatListRef$current = flatListRef.current) === null || _flatListRef$current === void 0 || _flatListRef$current.scrollToIndex({
252
+ animated: true,
253
+ index:
254
+ // guard against scrolling beyond end of list
255
+ targetScrollIndex >= 0 ? targetScrollIndex : adjustedLimited.max - 1
256
+ }); // scroll down to max
257
+ newValues.duration = adjustedLimited.max;
258
+ } else if (newValues.duration < adjustedLimited.min) {
259
+ var _flatListRef$current2;
260
+ const targetScrollIndex = newValues.index + (adjustedLimited.min - newValues.duration);
261
+ (_flatListRef$current2 = flatListRef.current) === null || _flatListRef$current2 === void 0 || _flatListRef$current2.scrollToIndex({
262
+ animated: true,
263
+ index:
264
+ // guard against scrolling beyond end of list
265
+ targetScrollIndex <= numbersForFlatList.length - 1 ? targetScrollIndex : adjustedLimited.min
266
+ }); // scroll up to min
267
+ newValues.duration = adjustedLimited.min;
268
+ }
269
+ onDurationChange(newValues.duration);
270
+ }, [disableInfiniteScroll, interval, styles.pickerItemContainer.height, numberOfItems, padWithNItems, adjustedLimited.max, adjustedLimited.min, onDurationChange, numbersForFlatList.length]);
271
+ const onViewableItemsChanged = (0, _react.useCallback)(({
272
+ viewableItems
273
+ }) => {
274
+ var _viewableItems$, _viewableItems$2;
275
+ if (numberOfItems === 1) {
276
+ return;
277
+ }
278
+ if ((_viewableItems$ = viewableItems[0]) !== null && _viewableItems$ !== void 0 && _viewableItems$.index && viewableItems[0].index < numberOfItems * 0.5) {
279
+ var _flatListRef$current3;
280
+ (_flatListRef$current3 = flatListRef.current) === null || _flatListRef$current3 === void 0 || _flatListRef$current3.scrollToIndex({
281
+ animated: false,
282
+ index: viewableItems[0].index + numberOfItems
283
+ });
284
+ } else if ((_viewableItems$2 = viewableItems[0]) !== null && _viewableItems$2 !== void 0 && _viewableItems$2.index && viewableItems[0].index >= numberOfItems * (safeRepeatNumbersNTimes - 0.5)) {
285
+ var _flatListRef$current4;
286
+ (_flatListRef$current4 = flatListRef.current) === null || _flatListRef$current4 === void 0 || _flatListRef$current4.scrollToIndex({
287
+ animated: false,
288
+ index: viewableItems[0].index - numberOfItems
289
+ });
290
+ }
291
+ }, [numberOfItems, safeRepeatNumbersNTimes]);
292
+ const [viewabilityConfigCallbackPairs, setViewabilityConfigCallbackPairs] = (0, _react.useState)(!disableInfiniteScroll ? [{
293
+ viewabilityConfig: {
294
+ viewAreaCoveragePercentThreshold: 0
295
+ },
296
+ onViewableItemsChanged: onViewableItemsChanged
297
+ }] : undefined);
298
+ const [flatListRenderKey, setFlatListRenderKey] = (0, _react.useState)(0);
299
+ const initialRender = (0, _react.useRef)(true);
300
+ (0, _react.useEffect)(() => {
301
+ // don't run on first render
302
+ if (initialRender.current) {
303
+ initialRender.current = false;
304
+ return;
305
+ }
306
+
307
+ // if the onViewableItemsChanged callback changes, we need to update viewabilityConfigCallbackPairs
308
+ // which requires the FlatList to be remounted, hence the increase of the FlatList key
309
+ setFlatListRenderKey(prev => prev + 1);
310
+ setViewabilityConfigCallbackPairs(!disableInfiniteScroll ? [{
311
+ viewabilityConfig: {
312
+ viewAreaCoveragePercentThreshold: 0
313
+ },
314
+ onViewableItemsChanged: onViewableItemsChanged
315
+ }] : undefined);
316
+ }, [disableInfiniteScroll, onViewableItemsChanged]);
317
+ const getItemLayout = (0, _react.useCallback)((_, index) => ({
318
+ length: styles.pickerItemContainer.height,
319
+ offset: styles.pickerItemContainer.height * index,
320
+ index
321
+ }), [styles.pickerItemContainer.height]);
322
+ (0, _react.useImperativeHandle)(ref, () => ({
323
+ reset: options => {
324
+ var _flatListRef$current5;
325
+ (_flatListRef$current5 = flatListRef.current) === null || _flatListRef$current5 === void 0 || _flatListRef$current5.scrollToIndex({
326
+ animated: (options === null || options === void 0 ? void 0 : options.animated) ?? false,
327
+ index: initialScrollIndex
328
+ });
329
+ },
330
+ setValue: (value, options) => {
331
+ var _flatListRef$current6;
332
+ (_flatListRef$current6 = flatListRef.current) === null || _flatListRef$current6 === void 0 || _flatListRef$current6.scrollToIndex({
333
+ animated: (options === null || options === void 0 ? void 0 : options.animated) ?? false,
334
+ index: (0, _getInitialScrollIndex.getInitialScrollIndex)({
335
+ disableInfiniteScroll,
336
+ interval,
337
+ numberOfItems,
338
+ padWithNItems,
339
+ repeatNumbersNTimes: safeRepeatNumbersNTimes,
340
+ value: value
341
+ })
342
+ });
343
+ },
344
+ latestDuration: latestDuration
345
+ }));
346
+ const renderContent = (0, _react.useMemo)(() => {
347
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(FlatList, {
348
+ key: flatListRenderKey,
349
+ ref: flatListRef,
350
+ contentContainerStyle: styles.durationScrollFlatListContentContainer,
351
+ data: numbersForFlatList,
352
+ decelerationRate: decelerationRate,
353
+ getItemLayout: getItemLayout,
354
+ initialScrollIndex: initialScrollIndex,
355
+ keyExtractor: keyExtractor,
356
+ nestedScrollEnabled: true,
357
+ onMomentumScrollEnd: onMomentumScrollEnd,
358
+ onScroll: onScroll,
359
+ renderItem: renderItem,
360
+ scrollEnabled: !isDisabled,
361
+ scrollEventThrottle: 16,
362
+ showsVerticalScrollIndicator: false,
363
+ snapToAlignment: "start"
364
+ // used in place of snapToInterval due to bug on Android
365
+ ,
366
+ snapToOffsets: [...Array(numbersForFlatList.length)].map((_, i) => i * styles.pickerItemContainer.height),
367
+ style: styles.durationScrollFlatList,
368
+ testID: "duration-scroll-flatlist",
369
+ viewabilityConfigCallbackPairs: viewabilityConfigCallbackPairs,
370
+ windowSize: numberOfItemsToShow
371
+ }), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
372
+ pointerEvents: "none",
373
+ style: styles.pickerLabelContainer
374
+ }, typeof label === "string" ? /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
375
+ allowFontScaling: allowFontScaling,
376
+ style: styles.pickerLabel
377
+ }, label) : label ?? null));
378
+ }, [FlatList, allowFontScaling, flatListRenderKey, getItemLayout, initialScrollIndex, isDisabled, label, numberOfItemsToShow, numbersForFlatList, onMomentumScrollEnd, onScroll, renderItem, styles.durationScrollFlatList, styles.durationScrollFlatListContentContainer, styles.pickerItemContainer.height, styles.pickerLabel, styles.pickerLabelContainer, viewabilityConfigCallbackPairs, decelerationRate]);
379
+ const renderLinearGradient = (0, _react.useMemo)(() => {
380
+ if (!LinearGradient) {
381
+ return null;
382
+ }
383
+ let colors;
384
+ if (MaskedView) {
385
+ // if using masked view, we only care about the opacity
386
+ colors = ["rgba(0,0,0,0)", "rgba(0,0,0,1)", "rgba(0,0,0,1)", "rgba(0,0,0,0)"];
387
+ } else {
388
+ const backgroundColor = styles.pickerContainer.backgroundColor ?? "white";
389
+ const transparentBackgroundColor = (0, _colorToRgba.colorToRgba)({
390
+ color: backgroundColor,
391
+ opacity: 0
392
+ });
393
+ colors = [backgroundColor, transparentBackgroundColor, transparentBackgroundColor, backgroundColor];
394
+ }
395
+
396
+ // calculate the gradient height to cover the top item and bottom item
397
+ const gradientHeight = padWithNItems > 0 ? 1 / (padWithNItems * 2 + 1) : 0.3;
398
+ return /*#__PURE__*/_react.default.createElement(LinearGradient, _extends({
399
+ colors: colors,
400
+ locations: [0, gradientHeight, 1 - gradientHeight, 1],
401
+ pointerEvents: "none",
402
+ style: styles.pickerGradientOverlay
403
+ }, pickerGradientOverlayProps));
404
+ }, [LinearGradient, MaskedView, padWithNItems, pickerGradientOverlayProps, styles.pickerContainer.backgroundColor, styles.pickerGradientOverlay]);
405
+ return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
406
+ pointerEvents: isDisabled ? "none" : undefined,
407
+ style: [styles.durationScrollFlatListContainer, {
408
+ height: styles.pickerItemContainer.height * numberOfItemsToShow
409
+ }, isDisabled && styles.disabledPickerContainer],
410
+ testID: testID
411
+ }, MaskedView ? /*#__PURE__*/_react.default.createElement(MaskedView, {
412
+ maskElement: renderLinearGradient,
413
+ style: [styles.maskedView]
414
+ }, renderContent) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, renderContent, renderLinearGradient));
415
+ });
416
+ var _default = exports.default = /*#__PURE__*/_react.default.memo(DurationScroll);
417
+ //# sourceMappingURL=DurationScroll.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_colorToRgba","_generateNumbers","_getAdjustedLimit","_getDurationAndIndexFromScrollOffset","_getInitialScrollIndex","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_extends","assign","bind","arguments","length","apply","keyExtractor","item","index","toString","DurationScroll","forwardRef","props","ref","aggressivelyGetLatestDuration","allowFontScaling","amLabel","Audio","clickSoundAsset","decelerationRate","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","soundInstance","loadSound","sound","newSound","Sound","createAsync","uri","shouldPlay","error","console","warn","_soundInstance","unloadAsync","playClickSound","useCallback","replayAsync","renderItem","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","onMomentumScrollEnd","_flatListRef$current","targetScrollIndex","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","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":["DurationScroll.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 FlatListProps,\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 {\n DurationScrollProps,\n DurationScrollRef,\n ExpoAvAudioInstance,\n} from \"./types\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst keyExtractor = (item: any, index: number) => index.toString();\n\nconst DurationScroll = forwardRef<DurationScrollRef, DurationScrollProps>(\n (props, ref) => {\n const {\n aggressivelyGetLatestDuration,\n allowFontScaling = false,\n amLabel,\n Audio,\n clickSoundAsset,\n decelerationRate = 0.88,\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] =\n useState<ExpoAvAudioInstance | null>(null);\n\n useEffect(() => {\n // Audio prop deprecated in v2.2.0 (use pickerFeedback instead) - will be removed in a future version\n\n // preload the sound when the component mounts\n let soundInstance: ExpoAvAudioInstance | null = null;\n\n const loadSound = async () => {\n if (!Audio) {\n return;\n }\n\n try {\n const { sound: newSound } = 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 soundInstance = newSound;\n setClickSound(newSound);\n } catch (error) {\n console.warn(\"Failed to load click sound:\", error);\n }\n };\n\n loadSound();\n\n return () => {\n // unload sound when component unmounts\n soundInstance?.unloadAsync();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [Audio]);\n\n const playClickSound = useCallback(async () => {\n if (!clickSound) return;\n\n try {\n await clickSound.replayAsync();\n } catch (error) {\n console.warn(\"Failed to play click sound:\", error);\n }\n }, [clickSound]);\n\n const renderItem = useCallback<\n NonNullable<FlatListProps<string>[\"renderItem\"]>\n >(\n ({ item }) => {\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 NonNullable<FlatListProps<string>[\"onScroll\"]>\n >(\n (e) => {\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 (pickerFeedback || Haptics || Audio) {\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 playClickSound();\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 playClickSound,\n disableInfiniteScroll,\n interval,\n numberOfItems,\n padWithNItems,\n styles.pickerItemContainer.height,\n ]\n );\n\n const onMomentumScrollEnd = useCallback<\n NonNullable<FlatListProps<string>[\"onMomentumScrollEnd\"]>\n >(\n (e) => {\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 NonNullable<FlatListProps<string>[\"onViewableItemsChanged\"]>\n >(\n ({ viewableItems }) => {\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 NonNullable<FlatListProps<string>[\"getItemLayout\"]>\n >(\n (_, index) => ({\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={decelerationRate}\n getItemLayout={getItemLayout}\n initialScrollIndex={initialScrollIndex}\n keyExtractor={keyExtractor}\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 decelerationRate,\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;AAMA,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,SAAAD,wBAAAQ,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAV,uBAAA,YAAAA,CAAAQ,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,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