react-native-timer-picker 1.7.0 → 1.8.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 (121) hide show
  1. package/README.md +65 -23
  2. package/dist/commonjs/assets/select_click.mp3 +0 -0
  3. package/dist/commonjs/components/{TimerPicker/DurationScroll.js → DurationScroll/index.js} +113 -63
  4. package/dist/commonjs/components/DurationScroll/index.js.map +1 -0
  5. package/dist/commonjs/components/DurationScroll/types.js +6 -0
  6. package/dist/commonjs/components/DurationScroll/types.js.map +1 -0
  7. package/dist/commonjs/components/Modal/index.js +21 -20
  8. package/dist/commonjs/components/Modal/index.js.map +1 -1
  9. package/dist/commonjs/components/Modal/{Modal.styles.js → styles.js} +1 -1
  10. package/dist/commonjs/components/Modal/styles.js.map +1 -0
  11. package/dist/commonjs/components/Modal/types.js +6 -0
  12. package/dist/commonjs/components/Modal/types.js.map +1 -0
  13. package/dist/commonjs/components/TimerPicker/index.js +57 -71
  14. package/dist/commonjs/components/TimerPicker/index.js.map +1 -1
  15. package/dist/commonjs/components/TimerPicker/{TimerPicker.styles.js → styles.js} +1 -3
  16. package/dist/commonjs/components/TimerPicker/styles.js.map +1 -0
  17. package/dist/commonjs/components/TimerPicker/types.js +6 -0
  18. package/dist/commonjs/components/TimerPicker/types.js.map +1 -0
  19. package/dist/commonjs/components/{index.js → TimerPickerModal/index.js} +31 -76
  20. package/dist/commonjs/components/TimerPickerModal/index.js.map +1 -0
  21. package/dist/commonjs/components/{TimerPickerModal.styles.js → TimerPickerModal/styles.js} +1 -3
  22. package/dist/commonjs/components/TimerPickerModal/styles.js.map +1 -0
  23. package/dist/commonjs/components/TimerPickerModal/types.js +6 -0
  24. package/dist/commonjs/components/TimerPickerModal/types.js.map +1 -0
  25. package/dist/commonjs/index.js +14 -13
  26. package/dist/commonjs/index.js.map +1 -1
  27. package/dist/commonjs/tests/DurationScroll.test.js +1 -1
  28. package/dist/commonjs/tests/DurationScroll.test.js.map +1 -1
  29. package/dist/commonjs/tests/Modal.test.js +7 -7
  30. package/dist/commonjs/tests/Modal.test.js.map +1 -1
  31. package/dist/commonjs/tests/TimerPicker.test.js.map +1 -1
  32. package/dist/commonjs/tests/TimerPickerModal.test.js +2 -2
  33. package/dist/commonjs/tests/TimerPickerModal.test.js.map +1 -1
  34. package/dist/commonjs/utils/generateNumbers.js.map +1 -1
  35. package/dist/commonjs/utils/getAdjustedLimit.js.map +1 -1
  36. package/dist/commonjs/utils/getScrollIndex.js +2 -2
  37. package/dist/commonjs/utils/getScrollIndex.js.map +1 -1
  38. package/dist/module/assets/select_click.mp3 +0 -0
  39. package/dist/module/components/{TimerPicker/DurationScroll.js → DurationScroll/index.js} +114 -64
  40. package/dist/module/components/DurationScroll/index.js.map +1 -0
  41. package/dist/module/components/DurationScroll/types.js +2 -0
  42. package/dist/module/components/DurationScroll/types.js.map +1 -0
  43. package/dist/module/components/Modal/index.js +19 -19
  44. package/dist/module/components/Modal/index.js.map +1 -1
  45. package/dist/module/components/Modal/{Modal.styles.js → styles.js} +1 -1
  46. package/dist/module/components/Modal/styles.js.map +1 -0
  47. package/dist/module/components/Modal/types.js +2 -0
  48. package/dist/module/components/Modal/types.js.map +1 -0
  49. package/dist/module/components/TimerPicker/index.js +56 -70
  50. package/dist/module/components/TimerPicker/index.js.map +1 -1
  51. package/dist/module/components/TimerPicker/{TimerPicker.styles.js → styles.js} +1 -2
  52. package/dist/module/components/TimerPicker/styles.js.map +1 -0
  53. package/dist/module/components/TimerPicker/types.js +2 -0
  54. package/dist/module/components/TimerPicker/types.js.map +1 -0
  55. package/dist/module/components/{index.js → TimerPickerModal/index.js} +30 -75
  56. package/dist/module/components/TimerPickerModal/index.js.map +1 -0
  57. package/dist/module/components/{TimerPickerModal.styles.js → TimerPickerModal/styles.js} +1 -2
  58. package/dist/module/components/TimerPickerModal/styles.js.map +1 -0
  59. package/dist/module/components/TimerPickerModal/types.js +2 -0
  60. package/dist/module/components/TimerPickerModal/types.js.map +1 -0
  61. package/dist/module/index.js +6 -4
  62. package/dist/module/index.js.map +1 -1
  63. package/dist/module/tests/DurationScroll.test.js +1 -1
  64. package/dist/module/tests/DurationScroll.test.js.map +1 -1
  65. package/dist/module/tests/Modal.test.js +1 -1
  66. package/dist/module/tests/Modal.test.js.map +1 -1
  67. package/dist/module/tests/TimerPicker.test.js.map +1 -1
  68. package/dist/module/tests/TimerPickerModal.test.js +2 -2
  69. package/dist/module/tests/TimerPickerModal.test.js.map +1 -1
  70. package/dist/module/utils/generateNumbers.js.map +1 -1
  71. package/dist/module/utils/getAdjustedLimit.js.map +1 -1
  72. package/dist/module/utils/getScrollIndex.js +2 -2
  73. package/dist/module/utils/getScrollIndex.js.map +1 -1
  74. package/dist/typescript/components/DurationScroll/index.d.ts +4 -0
  75. package/dist/typescript/components/{TimerPicker/DurationScroll.d.ts → DurationScroll/types.d.ts} +36 -29
  76. package/dist/typescript/components/Modal/index.d.ts +3 -14
  77. package/dist/typescript/components/Modal/types.d.ts +15 -0
  78. package/dist/typescript/components/TimerPicker/index.d.ts +2 -59
  79. package/dist/typescript/components/TimerPicker/styles.d.ts +1022 -0
  80. package/dist/typescript/components/TimerPicker/types.d.ts +61 -0
  81. package/dist/typescript/components/TimerPickerModal/index.d.ts +4 -0
  82. package/dist/typescript/components/TimerPickerModal/styles.d.ts +738 -0
  83. package/dist/typescript/components/{index.d.ts → TimerPickerModal/types.d.ts} +24 -26
  84. package/dist/typescript/index.d.ts +6 -4
  85. package/dist/typescript/utils/generateNumbers.d.ts +4 -4
  86. package/dist/typescript/utils/getAdjustedLimit.d.ts +1 -1
  87. package/dist/typescript/utils/getScrollIndex.d.ts +2 -2
  88. package/package.json +14 -11
  89. package/src/assets/select_click.mp3 +0 -0
  90. package/src/components/{TimerPicker/DurationScroll.tsx → DurationScroll/index.tsx} +126 -110
  91. package/src/components/DurationScroll/types.ts +63 -0
  92. package/src/components/Modal/index.tsx +20 -30
  93. package/src/components/Modal/types.ts +17 -0
  94. package/src/components/TimerPicker/index.tsx +52 -132
  95. package/src/components/TimerPicker/{TimerPicker.styles.ts → styles.ts} +11 -11
  96. package/src/components/TimerPicker/types.ts +72 -0
  97. package/src/components/{index.tsx → TimerPickerModal/index.tsx} +26 -124
  98. package/src/components/{TimerPickerModal.styles.ts → TimerPickerModal/styles.ts} +6 -6
  99. package/src/components/TimerPickerModal/types.ts +52 -0
  100. package/src/index.ts +6 -7
  101. package/src/tests/DurationScroll.test.tsx +3 -1
  102. package/src/tests/Modal.test.tsx +3 -1
  103. package/src/tests/TimerPicker.test.tsx +2 -0
  104. package/src/tests/TimerPickerModal.test.tsx +3 -1
  105. package/src/utils/generateNumbers.ts +4 -4
  106. package/src/utils/getAdjustedLimit.ts +1 -1
  107. package/src/utils/getScrollIndex.ts +3 -3
  108. package/dist/commonjs/components/Modal/Modal.styles.js.map +0 -1
  109. package/dist/commonjs/components/TimerPicker/DurationScroll.js.map +0 -1
  110. package/dist/commonjs/components/TimerPicker/TimerPicker.styles.js.map +0 -1
  111. package/dist/commonjs/components/TimerPickerModal.styles.js.map +0 -1
  112. package/dist/commonjs/components/index.js.map +0 -1
  113. package/dist/module/components/Modal/Modal.styles.js.map +0 -1
  114. package/dist/module/components/TimerPicker/DurationScroll.js.map +0 -1
  115. package/dist/module/components/TimerPicker/TimerPicker.styles.js.map +0 -1
  116. package/dist/module/components/TimerPickerModal.styles.js.map +0 -1
  117. package/dist/module/components/index.js.map +0 -1
  118. package/dist/typescript/components/TimerPicker/TimerPicker.styles.d.ts +0 -3100
  119. package/dist/typescript/components/TimerPickerModal.styles.d.ts +0 -2195
  120. /package/dist/typescript/components/Modal/{Modal.styles.d.ts → styles.d.ts} +0 -0
  121. /package/src/components/Modal/{Modal.styles.ts → styles.ts} +0 -0
package/README.md CHANGED
@@ -9,10 +9,15 @@ A simple, flexible, performant duration picker component for React Native apps
9
9
 
10
10
  Great for timers, alarms and duration inputs.
11
11
 
12
- Works with Expo and bare React Native apps.
12
+ Works with Expo and bare React Native apps
13
+
14
+ Includes iOS-style haptic and audio feedback 🍏
13
15
 
14
16
  - [Demos 📱](#demos-)
15
17
  - [Peer Dependencies 👶](#peer-dependencies-)
18
+ - [Linear Gradient](#linear-gradient)
19
+ - [Haptic Feedback](#haptic-feedback)
20
+ - [Audio Feedback (Click Sound)](#audio-feedback-click-sound)
16
21
  - [Installation 🚀](#installation-)
17
22
  - [Examples 😎](#examples-)
18
23
  - [Timer Picker Modal (Dark Mode) 🌚](#timer-picker-modal-dark-mode-)
@@ -54,6 +59,8 @@ Works with Expo and bare React Native apps.
54
59
 
55
60
  This component will work in your React Native Project **without any peer dependencies**.
56
61
 
62
+ ### Linear Gradient
63
+
57
64
  If you want the numbers to fade in/out at the top and bottom of the picker, you will need to install either:
58
65
 
59
66
  - [expo-linear-gradient](https://www.npmjs.com/package/expo-linear-gradient) (if using Expo)
@@ -61,6 +68,22 @@ If you want the numbers to fade in/out at the top and bottom of the picker, you
61
68
 
62
69
  **To enable the linear gradient, you need to supply the component as a prop to either TimerPickerModal or TimerPicker.**
63
70
 
71
+ ### Haptic Feedback
72
+
73
+ This is currently only supported on Expo with the [expo-haptics](https://www.npmjs.com/package/expo-haptics) module:
74
+
75
+ `import * as Haptics from "expo-haptics";`
76
+
77
+ **To enable the haptic feedback, you need to supply the imported `Haptics` as a prop to either TimerPickerModal or TimerPicker.**
78
+
79
+ ### Audio Feedback (Click Sound)
80
+
81
+ This is currently only supported on Expo with the [expo-av](https://www.npmjs.com/package/expo-av) module:
82
+
83
+ `import { Audio } from "expo-av";`
84
+
85
+ **To enable the audio feedback, you need to supply the imported `Audio` as a prop to either TimerPickerModal or TimerPicker.**
86
+
64
87
  <br>
65
88
 
66
89
  ## Installation 🚀
@@ -88,6 +111,8 @@ yarn add react-native-timer-picker
88
111
  ```jsx
89
112
  import { TimerPickerModal } from "react-native-timer-picker";
90
113
  import { LinearGradient } from "expo-linear-gradient"; // or `import LinearGradient from "react-native-linear-gradient"`
114
+ import { Audio } from "expo-av"; // for audio feedback (click sound as you scroll)
115
+ import * as Haptics from "expo-haptics"; // for haptic feedback
91
116
 
92
117
  ....
93
118
  const [showPicker, setShowPicker] = useState(false);
@@ -142,7 +167,9 @@ return (
142
167
  modalTitle="Set Alarm"
143
168
  onCancel={() => setShowPicker(false)}
144
169
  closeOnOverlayPress
170
+ Audio={Audio}
145
171
  LinearGradient={LinearGradient}
172
+ Haptics={Haptics}
146
173
  styles={{
147
174
  theme: "dark",
148
175
  }}
@@ -162,6 +189,8 @@ return (
162
189
  ```jsx
163
190
  import { TimerPickerModal } from "react-native-timer-picker";
164
191
  import { LinearGradient } from "expo-linear-gradient"; // or `import LinearGradient from "react-native-linear-gradient"`
192
+ import { Audio } from "expo-av"; // for audio feedback (click sound as you scroll)
193
+ import * as Haptics from "expo-haptics"; // for haptic feedback
165
194
 
166
195
  ....
167
196
  const [showPicker, setShowPicker] = useState(false);
@@ -216,7 +245,10 @@ return (
216
245
  onCancel={() => setShowPicker(false)}
217
246
  closeOnOverlayPress
218
247
  use12HourPicker
248
+ Audio={Audio}
249
+ clickSoundAsset={require("./assets/custom_click.mp3")}
219
250
  LinearGradient={LinearGradient}
251
+ Haptics={Haptics}
220
252
  styles={{
221
253
  theme: "light",
222
254
  }}
@@ -233,6 +265,8 @@ return (
233
265
  ```jsx
234
266
  import { TimerPicker } from "react-native-timer-picker";
235
267
  import { LinearGradient } from "expo-linear-gradient"; // or `import LinearGradient from "react-native-linear-gradient"`
268
+ import { Audio } from "expo-av"; // for audio feedback (click sound as you scroll)
269
+ import * as Haptics from "expo-haptics"; // for haptic feedback
236
270
 
237
271
  ....
238
272
  const [showPicker, setShowPicker] = useState(false);
@@ -247,7 +281,9 @@ return (
247
281
  hourLabel=":"
248
282
  minuteLabel=":"
249
283
  secondLabel=""
284
+ Audio={Audio}
250
285
  LinearGradient={LinearGradient}
286
+ Haptics={Haptics}
251
287
  styles={{
252
288
  theme: "dark",
253
289
  backgroundColor: "#202020",
@@ -285,6 +321,8 @@ return (
285
321
  ```jsx
286
322
  import { TimerPicker } from "react-native-timer-picker";
287
323
  import { LinearGradient } from "expo-linear-gradient"; // or `import LinearGradient from "react-native-linear-gradient"`
324
+ import { Audio } from "expo-av"; // for audio feedback (click sound as you scroll)
325
+ import * as Haptics from "expo-haptics"; // for haptic feedback
288
326
 
289
327
  ....
290
328
  const [showPicker, setShowPicker] = useState(false);
@@ -299,7 +337,9 @@ return (
299
337
  hideHours
300
338
  minuteLabel="min"
301
339
  secondLabel="sec"
340
+ Audio={Audio}
302
341
  LinearGradient={LinearGradient}
342
+ Haptics={Haptics}
303
343
  styles={{
304
344
  theme: "light",
305
345
  pickerItem: {
@@ -333,16 +373,16 @@ return (
333
373
  | Prop | Description | Type | Default | Required |
334
374
  | :------------------------------: | :------------------------------------------------------------------------------ | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----: | :------: |
335
375
  | onDurationChange | Callback when the duration changes | `(duration: { hours: number, minutes: number, seconds: number }) => void` | - | false |
336
- | initialValue | Initial value for the picker | `{ hours?: number, minutes?: number, seconds?: number }` | - | false |
376
+ | initialValue | Initial value for the picker | `{ hours?: number, minutes?: number, seconds?: number }` | - | false |
337
377
  | hideHours | Hide the hours picker | Boolean | false | false |
338
378
  | hideMinutes | Hide the minutes picker | Boolean | false | false |
339
379
  | hideSeconds | Hide the seconds picker | Boolean | false | false |
340
380
  | hoursPickerIsDisabled | Disable the hours picker picker | Boolean | false | false |
341
381
  | minutesPickerIsDisabled | Disable the minutes picker picker | Boolean | false | false |
342
382
  | secondsPickerIsDisabled | Disable the seconds picker picker | Boolean | false | false |
343
- | hourLimit | Limit on the hours it is possible to select | `{ max?: Number, min?: Number }` | - | false |
344
- | minuteLimit | Limit on the minutes it is possible to select | `{ max?: Number, min?: Number }` | - | false |
345
- | secondLimit | Limit on the seconds it is possible to select | `{ max?: Number, min?: Number }` | - | false |
383
+ | hourLimit | Limit on the hours it is possible to select | `{ max?: Number, min?: Number }` | - | false |
384
+ | minuteLimit | Limit on the minutes it is possible to select | `{ max?: Number, min?: Number }` | - | false |
385
+ | secondLimit | Limit on the seconds it is possible to select | `{ max?: Number, min?: Number }` | - | false |
346
386
  | hourLabel | Label for the hours picker | String \| React.ReactElement | h | false |
347
387
  | minuteLabel | Label for the minutes picker | String \| React.ReactElement | m | false |
348
388
  | secondLabel | Label for the seconds picker | String \| React.ReactElement | s | false |
@@ -354,6 +394,8 @@ return (
354
394
  | pmLabel | Set the PM label if using the 12-hour picker | String | pm | false |
355
395
  | disableInfiniteScroll | Disable the infinite scroll feature | Boolean | false | false |
356
396
  | 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 |
397
+ | Audio | Audio Class | [expo-av](https://www.npmjs.com/package/expo-av).Audio | - | false |
398
+ | Haptics | Haptics Namespace | [expo-haptics](https://www.npmjs.com/package/expo-haptics) | - | false |
357
399
  | pickerContainerProps | Props for the picker container | `React.ComponentProps<typeof View>` | - | false |
358
400
  | pickerGradientOverlayProps | Props for both gradient overlays | `Partial<LinearGradientProps>` | - | false |
359
401
  | topPickerGradientOverlayProps | Props for the top gradient overlay | `Partial<LinearGradientProps>` | - | false |
@@ -362,23 +404,23 @@ return (
362
404
 
363
405
  #### Custom Styles 👗
364
406
 
365
- The following custom styles can be supplied to re-style the component in any way. Various styles are applied by default - you can take a look at these [here](src/components/TimerPicker/TimerPicker.styles.ts).
366
-
367
- | Style Prop | Description | Type |
368
- | :---------------------: | :------------------------------------------- | :---------------: |
369
- | theme | Theme of the component | "light" \| "dark" |
370
- | backgroundColor | Main background color | string |
371
- | text | Base text style | TextStyle |
372
- | pickerContainer | Main container for the picker | ViewStyle & { backgroundColor?: string } |
373
- | pickerLabelContainer | Container for the picker's labels | ViewStyle |
374
- | pickerLabel | Style for the picker's labels | TextStyle |
375
- | pickerAmPmContainer | Style for the picker's labels | ViewStyle |
376
- | pickerAmPmLabel | Style for the picker's labels | TextStyle |
377
- | pickerItemContainer | Container for each number in the picker | ViewStyle & { height?: number } |
378
- | pickerItem | Style for each individual picker number | TextStyle |
379
- | disabledPickerItem | Style for any numbers outside any set limits | TextStyle |
380
- | disabledPickerContainer | Style for disabled pickers | ViewStyle |
381
- | pickerGradientOverlay | Style for the gradient overlay (fade out) | ViewStyle |
407
+ The following custom styles can be supplied to re-style the component in any way. Various styles are applied by default - you can take a look at these [here](src/components/TimerPicker/styles.ts).
408
+
409
+ | Style Prop | Description | Type |
410
+ | :---------------------: | :------------------------------------------- | :--------------------------------------: |
411
+ | theme | Theme of the component | "light" \| "dark" |
412
+ | backgroundColor | Main background color | string |
413
+ | text | Base text style | TextStyle |
414
+ | pickerContainer | Main container for the picker | ViewStyle & { backgroundColor?: string } |
415
+ | pickerLabelContainer | Container for the picker's labels | ViewStyle |
416
+ | pickerLabel | Style for the picker's labels | TextStyle |
417
+ | pickerAmPmContainer | Style for the picker's labels | ViewStyle |
418
+ | pickerAmPmLabel | Style for the picker's labels | TextStyle |
419
+ | pickerItemContainer | Container for each number in the picker | ViewStyle & { height?: number } |
420
+ | pickerItem | Style for each individual picker number | TextStyle |
421
+ | disabledPickerItem | Style for any numbers outside any set limits | TextStyle |
422
+ | disabledPickerContainer | Style for disabled pickers | ViewStyle |
423
+ | pickerGradientOverlay | Style for the gradient overlay (fade out) | ViewStyle |
382
424
 
383
425
  Note the minor limitations to the allowed styles for `pickerContainer` and `pickerItemContainer`. These are made because these styles are used for internal calculations and all possible `backgroundColor`/`height` types are not supported.
384
426
 
@@ -407,7 +449,7 @@ The TimerPickerModal component accepts all [TimerPicker props](#timerpicker-️)
407
449
 
408
450
  #### Custom Styles 👕
409
451
 
410
- The following custom styles can be supplied to re-style the component in any way. You can also supply all of the styles specified in [CustomTimerPickerStyles](#custom-styles-). Various styles are applied by default - you can take a look at these [here](src/components/TimerPickerModal.styles.ts).
452
+ The following custom styles can be supplied to re-style the component in any way. You can also supply all of the styles specified in [CustomTimerPickerStyles](#custom-styles-). Various styles are applied by default - you can take a look at these [here](src/components/TimerPickerModal/styles.ts).
411
453
 
412
454
  | Style Prop | Description | Type |
413
455
  | :--------------: | :----------------------------------------- | :-------: |
@@ -6,37 +6,39 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = void 0;
7
7
  var _react = _interopRequireWildcard(require("react"));
8
8
  var _reactNative = require("react-native");
9
- var _generateNumbers = require("../../utils/generateNumbers");
10
9
  var _colorToRgba = require("../../utils/colorToRgba");
10
+ var _generateNumbers = require("../../utils/generateNumbers");
11
11
  var _getAdjustedLimit = require("../../utils/getAdjustedLimit");
12
12
  var _getScrollIndex = require("../../utils/getScrollIndex");
13
13
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
14
14
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
15
15
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
16
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
17
- const KEY_EXTRACTOR = (_, index) => index.toString();
18
- const DurationScroll = /*#__PURE__*/(0, _react.forwardRef)(({
19
- numberOfItems,
20
- label,
21
- initialValue = 0,
22
- onDurationChange,
23
- padNumbersWithZero = false,
24
- disableInfiniteScroll = false,
25
- limit,
26
- isDisabled,
27
- aggressivelyGetLatestDuration,
28
- allowFontScaling = false,
29
- is12HourPicker,
30
- amLabel,
31
- pmLabel,
32
- padWithNItems,
33
- pickerGradientOverlayProps,
34
- topPickerGradientOverlayProps,
35
- bottomPickerGradientOverlayProps,
36
- LinearGradient,
37
- testID,
38
- styles
39
- }, ref) => {
16
+ const DurationScroll = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
17
+ const {
18
+ aggressivelyGetLatestDuration,
19
+ allowFontScaling = false,
20
+ amLabel,
21
+ Audio,
22
+ bottomPickerGradientOverlayProps,
23
+ clickSoundAsset,
24
+ disableInfiniteScroll = false,
25
+ Haptics,
26
+ initialValue = 0,
27
+ is12HourPicker,
28
+ isDisabled,
29
+ label,
30
+ limit,
31
+ LinearGradient,
32
+ numberOfItems,
33
+ onDurationChange,
34
+ padNumbersWithZero = false,
35
+ padWithNItems,
36
+ pickerGradientOverlayProps,
37
+ pmLabel,
38
+ styles,
39
+ testID,
40
+ topPickerGradientOverlayProps
41
+ } = props;
40
42
  const data = !is12HourPicker ? (0, _generateNumbers.generateNumbers)(numberOfItems, {
41
43
  padNumbersWithZero,
42
44
  repeatNTimes: 3,
@@ -56,8 +58,34 @@ const DurationScroll = /*#__PURE__*/(0, _react.forwardRef)(({
56
58
  padWithNItems,
57
59
  disableInfiniteScroll
58
60
  });
61
+
62
+ // keep track of the latest duration as it scrolls
59
63
  const latestDuration = (0, _react.useRef)(0);
64
+ // keep track of the last index scrolled past for haptic/audio feedback
65
+ const lastFeedbackIndex = (0, _react.useRef)(0);
60
66
  const flatListRef = (0, _react.useRef)(null);
67
+ const [clickSound, setClickSound] = (0, _react.useState)();
68
+
69
+ // Preload the sound when the component mounts
70
+ (0, _react.useEffect)(() => {
71
+ const loadSound = async () => {
72
+ if (Audio) {
73
+ const {
74
+ sound
75
+ } = await Audio.Sound.createAsync(clickSoundAsset ?? require("../../assets/select_click.mp3"), {
76
+ shouldPlay: false
77
+ });
78
+ setClickSound(sound);
79
+ }
80
+ };
81
+ loadSound();
82
+
83
+ // Unload sound when component unmounts
84
+ return () => {
85
+ clickSound === null || clickSound === void 0 || clickSound.unloadAsync();
86
+ };
87
+ // eslint-disable-next-line react-hooks/exhaustive-deps
88
+ }, [Audio]);
61
89
  (0, _react.useImperativeHandle)(ref, () => ({
62
90
  reset: options => {
63
91
  var _flatListRef$current;
@@ -101,28 +129,50 @@ const DurationScroll = /*#__PURE__*/(0, _react.forwardRef)(({
101
129
  allowFontScaling: allowFontScaling,
102
130
  style: [styles.pickerItem, intItem > adjustedLimited.max || intItem < adjustedLimited.min ? styles.disabledPickerItem : {}]
103
131
  }, stringItem), is12HourPicker ? /*#__PURE__*/_react.default.createElement(_reactNative.View, {
104
- style: styles.pickerAmPmContainer,
105
- pointerEvents: "none"
132
+ pointerEvents: "none",
133
+ style: styles.pickerAmPmContainer
106
134
  }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
107
- style: [styles.pickerAmPmLabel],
108
- allowFontScaling: allowFontScaling
135
+ allowFontScaling: allowFontScaling,
136
+ style: [styles.pickerAmPmLabel]
109
137
  }, isAm ? amLabel : pmLabel)) : null);
110
138
  }, [adjustedLimited.max, adjustedLimited.min, allowFontScaling, amLabel, is12HourPicker, pmLabel, styles.disabledPickerItem, styles.pickerAmPmContainer, styles.pickerAmPmLabel, styles.pickerItem, styles.pickerItemContainer]);
111
139
  const onScroll = (0, _react.useCallback)(e => {
112
- // this function is only used when the picker is in a modal
140
+ // this function is only used when the picker is in a modal and/or has Haptic/Audio feedback
113
141
  // it is used to ensure that the modal gets the latest duration on clicking
114
142
  // the confirm button, even if the scrollview is still scrolling
115
- const newIndex = Math.round(e.nativeEvent.contentOffset.y / styles.pickerItemContainer.height);
116
- let newDuration = (disableInfiniteScroll ? newIndex : newIndex + padWithNItems) % (numberOfItems + 1);
143
+ if (!aggressivelyGetLatestDuration && !Haptics && !Audio) {
144
+ return;
145
+ }
146
+ if (aggressivelyGetLatestDuration) {
147
+ const newIndex = Math.round(e.nativeEvent.contentOffset.y / styles.pickerItemContainer.height);
148
+ let newDuration = (disableInfiniteScroll ? newIndex : newIndex + padWithNItems) % (numberOfItems + 1);
149
+ if (newDuration !== latestDuration.current) {
150
+ // check limits
151
+ if (newDuration > adjustedLimited.max) {
152
+ newDuration = adjustedLimited.max;
153
+ } else if (newDuration < adjustedLimited.min) {
154
+ newDuration = adjustedLimited.min;
155
+ }
156
+ latestDuration.current = newDuration;
157
+ }
158
+ }
159
+ if (Haptics || Audio) {
160
+ const feedbackIndex = Math.round((e.nativeEvent.contentOffset.y + styles.pickerItemContainer.height / 2) / styles.pickerItemContainer.height);
161
+ if (feedbackIndex !== lastFeedbackIndex.current) {
162
+ // this check stops the feedback firing when the component mounts
163
+ if (lastFeedbackIndex.current) {
164
+ // fire haptic feedback if available
165
+ Haptics === null || Haptics === void 0 || Haptics.selectionAsync();
117
166
 
118
- // check limits
119
- if (newDuration > adjustedLimited.max) {
120
- newDuration = adjustedLimited.max;
121
- } else if (newDuration < adjustedLimited.min) {
122
- newDuration = adjustedLimited.min;
167
+ // play click sound if available
168
+ clickSound === null || clickSound === void 0 || clickSound.replayAsync();
169
+ }
170
+ lastFeedbackIndex.current = feedbackIndex;
171
+ }
123
172
  }
124
- latestDuration.current = newDuration;
125
- }, [adjustedLimited.max, adjustedLimited.min, disableInfiniteScroll, numberOfItems, padWithNItems, styles.pickerItemContainer.height]);
173
+ },
174
+ // eslint-disable-next-line react-hooks/exhaustive-deps
175
+ [adjustedLimited.max, adjustedLimited.min, aggressivelyGetLatestDuration, clickSound, disableInfiniteScroll, numberOfItems, padWithNItems, styles.pickerItemContainer.height]);
126
176
  const onMomentumScrollEnd = (0, _react.useCallback)(e => {
127
177
  const newIndex = Math.round(e.nativeEvent.contentOffset.y / styles.pickerItemContainer.height);
128
178
  let newDuration = (disableInfiniteScroll ? newIndex : newIndex + padWithNItems) % (numberOfItems + 1);
@@ -181,35 +231,35 @@ const DurationScroll = /*#__PURE__*/(0, _react.forwardRef)(({
181
231
  onViewableItemsChanged: onViewableItemsChanged
182
232
  }]);
183
233
  return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
184
- testID: testID,
185
234
  pointerEvents: isDisabled ? "none" : undefined,
186
235
  style: [{
187
236
  height: styles.pickerItemContainer.height * numberOfItemsToShow,
188
237
  overflow: "visible"
189
- }, isDisabled && styles.disabledPickerContainer]
238
+ }, isDisabled && styles.disabledPickerContainer],
239
+ testID: testID
190
240
  }, /*#__PURE__*/_react.default.createElement(_reactNative.FlatList, {
191
241
  ref: flatListRef,
192
242
  data: data,
243
+ decelerationRate: 0.88,
193
244
  getItemLayout: getItemLayout,
194
245
  initialScrollIndex: initialScrollIndex,
195
- windowSize: numberOfItemsToShow,
246
+ keyExtractor: (_, index) => index.toString(),
247
+ onMomentumScrollEnd: onMomentumScrollEnd,
248
+ onScroll: onScroll,
196
249
  renderItem: renderItem,
197
- keyExtractor: KEY_EXTRACTOR,
198
- showsVerticalScrollIndicator: false,
199
- decelerationRate: 0.88,
250
+ scrollEnabled: !isDisabled,
200
251
  scrollEventThrottle: 16,
201
- snapToAlignment: "start",
202
- scrollEnabled: !isDisabled
252
+ showsVerticalScrollIndicator: false,
253
+ snapToAlignment: "start"
203
254
  // used in place of snapToOffset due to bug on Android
204
255
  ,
205
256
  snapToOffsets: [...Array(data.length)].map((_, i) => i * styles.pickerItemContainer.height),
257
+ testID: "duration-scroll-flatlist",
206
258
  viewabilityConfigCallbackPairs: !disableInfiniteScroll ? viewabilityConfigCallbackPairs === null || viewabilityConfigCallbackPairs === void 0 ? void 0 : viewabilityConfigCallbackPairs.current : undefined,
207
- onMomentumScrollEnd: onMomentumScrollEnd,
208
- onScroll: aggressivelyGetLatestDuration ? onScroll : undefined,
209
- testID: "duration-scroll-flatlist"
259
+ windowSize: numberOfItemsToShow
210
260
  }), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
211
- style: styles.pickerLabelContainer,
212
- pointerEvents: "none"
261
+ pointerEvents: "none",
262
+ style: styles.pickerLabelContainer
213
263
  }, typeof label === "string" ? /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
214
264
  allowFontScaling: allowFontScaling,
215
265
  style: styles.pickerLabel
@@ -218,15 +268,15 @@ const DurationScroll = /*#__PURE__*/(0, _react.forwardRef)(({
218
268
  color: styles.pickerContainer.backgroundColor ?? "white",
219
269
  opacity: 0
220
270
  })],
221
- start: {
222
- x: 1,
223
- y: 0.3
224
- },
225
271
  end: {
226
272
  x: 1,
227
273
  y: 1
228
274
  },
229
- pointerEvents: "none"
275
+ pointerEvents: "none",
276
+ start: {
277
+ x: 1,
278
+ y: 0.3
279
+ }
230
280
  }, pickerGradientOverlayProps, topPickerGradientOverlayProps, {
231
281
  style: [styles.pickerGradientOverlay, {
232
282
  top: 0
@@ -236,15 +286,15 @@ const DurationScroll = /*#__PURE__*/(0, _react.forwardRef)(({
236
286
  color: styles.pickerContainer.backgroundColor ?? "white",
237
287
  opacity: 0
238
288
  }), styles.pickerContainer.backgroundColor ?? "white"],
239
- start: {
240
- x: 1,
241
- y: 0
242
- },
243
289
  end: {
244
290
  x: 1,
245
291
  y: 0.7
246
292
  },
247
- pointerEvents: "none"
293
+ pointerEvents: "none",
294
+ start: {
295
+ x: 1,
296
+ y: 0
297
+ }
248
298
  }, pickerGradientOverlayProps, bottomPickerGradientOverlayProps, {
249
299
  style: [styles.pickerGradientOverlay, {
250
300
  bottom: -1
@@ -252,4 +302,4 @@ const DurationScroll = /*#__PURE__*/(0, _react.forwardRef)(({
252
302
  }))) : null);
253
303
  });
254
304
  var _default = exports.default = /*#__PURE__*/_react.default.memo(DurationScroll);
255
- //# sourceMappingURL=DurationScroll.js.map
305
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_colorToRgba","_generateNumbers","_getAdjustedLimit","_getScrollIndex","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","_extends","assign","bind","target","arguments","length","source","key","apply","DurationScroll","forwardRef","props","ref","aggressivelyGetLatestDuration","allowFontScaling","amLabel","Audio","bottomPickerGradientOverlayProps","clickSoundAsset","disableInfiniteScroll","Haptics","initialValue","is12HourPicker","isDisabled","label","limit","LinearGradient","numberOfItems","onDurationChange","padNumbersWithZero","padWithNItems","pickerGradientOverlayProps","pmLabel","styles","testID","topPickerGradientOverlayProps","data","generateNumbers","repeatNTimes","generate12HourNumbers","numberOfItemsToShow","adjustedLimited","getAdjustedLimit","initialScrollIndex","getScrollIndex","value","latestDuration","useRef","lastFeedbackIndex","flatListRef","clickSound","setClickSound","useState","useEffect","loadSound","sound","Sound","createAsync","shouldPlay","unloadAsync","useImperativeHandle","reset","options","_flatListRef$current","current","scrollToIndex","animated","index","setValue","_flatListRef$current2","renderItem","useCallback","item","stringItem","intItem","isAm","parseInt","includes","replace","createElement","View","style","pickerItemContainer","Text","pickerItem","max","min","disabledPickerItem","pointerEvents","pickerAmPmContainer","pickerAmPmLabel","onScroll","newIndex","Math","round","nativeEvent","contentOffset","y","height","newDuration","feedbackIndex","selectionAsync","replayAsync","onMomentumScrollEnd","_flatListRef$current3","targetScrollIndex","_flatListRef$current4","onViewableItemsChanged","viewableItems","_viewableItems$","_viewableItems$2","_flatListRef$current5","_flatListRef$current6","getItemLayout","_","offset","viewabilityConfigCallbackPairs","viewabilityConfig","viewAreaCoveragePercentThreshold","undefined","overflow","disabledPickerContainer","FlatList","decelerationRate","keyExtractor","toString","scrollEnabled","scrollEventThrottle","showsVerticalScrollIndicator","snapToAlignment","snapToOffsets","Array","map","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} from \"react\";\n\nimport { View, Text, FlatList } 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 { getScrollIndex } from \"../../utils/getScrollIndex\";\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 Haptics,\n initialValue = 0,\n is12HourPicker,\n isDisabled,\n label,\n limit,\n LinearGradient,\n numberOfItems,\n onDurationChange,\n padNumbersWithZero = false,\n padWithNItems,\n pickerGradientOverlayProps,\n pmLabel,\n styles,\n testID,\n topPickerGradientOverlayProps,\n } = props;\n\n const data = !is12HourPicker\n ? generateNumbers(numberOfItems, {\n padNumbersWithZero,\n repeatNTimes: 3,\n disableInfiniteScroll,\n padWithNItems,\n })\n : generate12HourNumbers({\n padNumbersWithZero,\n repeatNTimes: 3,\n disableInfiniteScroll,\n padWithNItems,\n });\n\n const numberOfItemsToShow = 1 + padWithNItems * 2;\n\n const adjustedLimited = getAdjustedLimit(limit, numberOfItems);\n\n const initialScrollIndex = getScrollIndex({\n value: initialValue,\n numberOfItems,\n padWithNItems,\n disableInfiniteScroll,\n });\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<FlatList | 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 require(\"../../assets/select_click.mp3\"),\n { shouldPlay: false }\n );\n setClickSound(sound);\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 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: getScrollIndex({\n value: value,\n numberOfItems,\n padWithNItems,\n disableInfiniteScroll,\n }),\n });\n },\n latestDuration: latestDuration,\n }));\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 (!aggressivelyGetLatestDuration && !Haptics && !Audio) {\n return;\n }\n\n if (aggressivelyGetLatestDuration) {\n const newIndex = Math.round(\n e.nativeEvent.contentOffset.y /\n styles.pickerItemContainer.height\n );\n let newDuration =\n (disableInfiniteScroll\n ? newIndex\n : newIndex + padWithNItems) %\n (numberOfItems + 1);\n\n if (newDuration !== latestDuration.current) {\n // check limits\n if (newDuration > adjustedLimited.max) {\n newDuration = adjustedLimited.max;\n } else if (newDuration < adjustedLimited.min) {\n newDuration = adjustedLimited.min;\n }\n\n latestDuration.current = newDuration;\n }\n }\n\n if (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 Haptics?.selectionAsync();\n\n // play click sound if available\n clickSound?.replayAsync();\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 numberOfItems,\n padWithNItems,\n styles.pickerItemContainer.height,\n ]\n );\n\n const onMomentumScrollEnd = useCallback(\n (e: NativeSyntheticEvent<NativeScrollEvent>) => {\n const newIndex = Math.round(\n e.nativeEvent.contentOffset.y /\n styles.pickerItemContainer.height\n );\n let newDuration =\n (disableInfiniteScroll\n ? newIndex\n : newIndex + padWithNItems) %\n (numberOfItems + 1);\n\n // check limits\n if (newDuration > adjustedLimited.max) {\n const targetScrollIndex =\n newIndex - (newDuration - 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 newDuration = adjustedLimited.max;\n } else if (newDuration < adjustedLimited.min) {\n const targetScrollIndex =\n newIndex + (adjustedLimited.min - newDuration);\n flatListRef.current?.scrollToIndex({\n animated: true,\n index:\n // guard against scrolling beyond end of list\n targetScrollIndex <= data.length - 1\n ? targetScrollIndex\n : adjustedLimited.min,\n }); // scroll up to min\n newDuration = adjustedLimited.min;\n }\n\n onDurationChange(newDuration);\n },\n [\n adjustedLimited.max,\n adjustedLimited.min,\n data.length,\n disableInfiniteScroll,\n numberOfItems,\n onDurationChange,\n padWithNItems,\n styles.pickerItemContainer.height,\n ]\n );\n\n const onViewableItemsChanged = useCallback(\n ({ viewableItems }: { viewableItems: ViewToken[] }) => {\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 >= numberOfItems * 2.5\n ) {\n flatListRef.current?.scrollToIndex({\n animated: false,\n index: viewableItems[0].index - numberOfItems,\n });\n }\n },\n [numberOfItems]\n );\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 const viewabilityConfigCallbackPairs =\n useRef<ViewabilityConfigCallbackPairs>([\n {\n viewabilityConfig: { viewAreaCoveragePercentThreshold: 25 },\n onViewableItemsChanged: onViewableItemsChanged,\n },\n ]);\n\n return (\n <View\n pointerEvents={isDisabled ? \"none\" : undefined}\n style={[\n {\n height:\n styles.pickerItemContainer.height *\n numberOfItemsToShow,\n overflow: \"visible\",\n },\n isDisabled && styles.disabledPickerContainer,\n ]}\n testID={testID}>\n <FlatList\n ref={flatListRef}\n data={data}\n decelerationRate={0.88}\n getItemLayout={getItemLayout}\n initialScrollIndex={initialScrollIndex}\n keyExtractor={(_, index) => index.toString()}\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 snapToOffset due to bug on Android\n snapToOffsets={[...Array(data.length)].map(\n (_, i) => i * styles.pickerItemContainer.height\n )}\n testID=\"duration-scroll-flatlist\"\n viewabilityConfigCallbackPairs={\n !disableInfiniteScroll\n ? viewabilityConfigCallbackPairs?.current\n : undefined\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"],"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I,OAAO;MACnCG,OAAO,EAAE;IACb,CAAC,CAAC,CACJ;IACFC,GAAG,EAAE;MAAEC,CAAC,EAAE,CAAC;MAAE/C,CAAC,EAAE;IAAE,CAAE;IACpBT,aAAa,EAAC,MAAM;IACpByD,KAAK,EAAE;MAAED,CAAC,EAAE,CAAC;MAAE/C,CAAC,EAAE;IAAI;EAAE,GACpBlE,0BAA0B,EAC1BI,6BAA6B;IACjC8C,KAAK,EAAE,CAAChD,MAAM,CAACiH,qBAAqB,EAAE;MAAEC,GAAG,EAAE;IAAE,CAAC;EAAE,EACrD,CAAC,eACFhL,MAAA,CAAAc,OAAA,CAAA8F,aAAA,CAACrD,cAAc,EAAA1B,QAAA;IACXyI,MAAM,EAAE,CACJ,IAAAG,wBAAW,EAAC;MACRC,KAAK,EACD5G,MAAM,CAACyG,eAAe,CACjBC,eAAe,IAAI,OAAO;MACnCG,OAAO,EAAE;IACb,CAAC,CAAC,EACF7G,MAAM,CAACyG,eAAe,CAACC,eAAe,IAClC,OAAO,CACb;IACFI,GAAG,EAAE;MAAEC,CAAC,EAAE,CAAC;MAAE/C,CAAC,EAAE;IAAI,CAAE;IACtBT,aAAa,EAAC,MAAM;IACpByD,KAAK,EAAE;MAAED,CAAC,EAAE,CAAC;MAAE/C,CAAC,EAAE;IAAE;EAAE,GAClBlE,0BAA0B,EAC1Bd,gCAAgC;IACpCgE,KAAK,EAAE,CACHhD,MAAM,CAACiH,qBAAqB,EAC5B;MAAEE,MAAM,EAAE,CAAC;IAAE,CAAC;EAChB,EACL,CACH,CAAC,GACH,IACF,CAAC;AAEf,CACJ,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAArK,OAAA,gBAEasK,cAAK,CAACC,IAAI,CAAC/I,cAAc,CAAC"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { MutableRefObject } from \"react\";\n\nimport type { View } from \"react-native\";\n\nimport type { generateStyles } from \"../TimerPicker/styles\";\n\nexport interface DurationScrollProps {\n Audio?: any;\n Haptics?: any;\n LinearGradient?: any;\n aggressivelyGetLatestDuration: boolean;\n allowFontScaling?: boolean;\n amLabel?: string;\n bottomPickerGradientOverlayProps?: Partial<LinearGradientProps>;\n clickSoundAsset?: SoundAssetType;\n disableInfiniteScroll?: boolean;\n initialValue?: number;\n is12HourPicker?: boolean;\n isDisabled?: boolean;\n label?: string | React.ReactElement;\n limit?: LimitType;\n numberOfItems: number;\n onDurationChange: (duration: number) => void;\n padNumbersWithZero?: boolean;\n padWithNItems: number;\n pickerGradientOverlayProps?: Partial<LinearGradientProps>;\n pmLabel?: string;\n styles: ReturnType<typeof generateStyles>;\n testID?: string;\n topPickerGradientOverlayProps?: Partial<LinearGradientProps>;\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":""}