react-native-timer-picker 2.4.0 → 2.6.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 (171) hide show
  1. package/README.md +35 -25
  2. package/package.json +143 -126
  3. package/dist/commonjs/components/DurationScroll/DurationScroll.js +0 -403
  4. package/dist/commonjs/components/DurationScroll/DurationScroll.js.map +0 -1
  5. package/dist/commonjs/components/DurationScroll/index.js +0 -27
  6. package/dist/commonjs/components/DurationScroll/index.js.map +0 -1
  7. package/dist/commonjs/components/DurationScroll/types.js +0 -6
  8. package/dist/commonjs/components/DurationScroll/types.js.map +0 -1
  9. package/dist/commonjs/components/Modal/Modal.js +0 -107
  10. package/dist/commonjs/components/Modal/Modal.js.map +0 -1
  11. package/dist/commonjs/components/Modal/index.js +0 -27
  12. package/dist/commonjs/components/Modal/index.js.map +0 -1
  13. package/dist/commonjs/components/Modal/styles.js +0 -25
  14. package/dist/commonjs/components/Modal/styles.js.map +0 -1
  15. package/dist/commonjs/components/Modal/types.js +0 -6
  16. package/dist/commonjs/components/Modal/types.js.map +0 -1
  17. package/dist/commonjs/components/PickerItem/PickerItem.js +0 -45
  18. package/dist/commonjs/components/PickerItem/PickerItem.js.map +0 -1
  19. package/dist/commonjs/components/PickerItem/index.js +0 -14
  20. package/dist/commonjs/components/PickerItem/index.js.map +0 -1
  21. package/dist/commonjs/components/TimerPicker/TimerPicker.js +0 -236
  22. package/dist/commonjs/components/TimerPicker/TimerPicker.js.map +0 -1
  23. package/dist/commonjs/components/TimerPicker/index.js +0 -39
  24. package/dist/commonjs/components/TimerPicker/index.js.map +0 -1
  25. package/dist/commonjs/components/TimerPicker/styles.js +0 -121
  26. package/dist/commonjs/components/TimerPicker/styles.js.map +0 -1
  27. package/dist/commonjs/components/TimerPicker/types.js +0 -6
  28. package/dist/commonjs/components/TimerPicker/types.js.map +0 -1
  29. package/dist/commonjs/components/TimerPickerModal/TimerPickerModal.js +0 -153
  30. package/dist/commonjs/components/TimerPickerModal/TimerPickerModal.js.map +0 -1
  31. package/dist/commonjs/components/TimerPickerModal/index.js +0 -39
  32. package/dist/commonjs/components/TimerPickerModal/index.js.map +0 -1
  33. package/dist/commonjs/components/TimerPickerModal/styles.js +0 -89
  34. package/dist/commonjs/components/TimerPickerModal/styles.js.map +0 -1
  35. package/dist/commonjs/components/TimerPickerModal/types.js +0 -6
  36. package/dist/commonjs/components/TimerPickerModal/types.js.map +0 -1
  37. package/dist/commonjs/index.js +0 -57
  38. package/dist/commonjs/index.js.map +0 -1
  39. package/dist/commonjs/tests/DurationScroll.test.js +0 -163
  40. package/dist/commonjs/tests/DurationScroll.test.js.map +0 -1
  41. package/dist/commonjs/tests/Modal.test.js +0 -119
  42. package/dist/commonjs/tests/Modal.test.js.map +0 -1
  43. package/dist/commonjs/tests/TimerPicker.test.js +0 -169
  44. package/dist/commonjs/tests/TimerPicker.test.js.map +0 -1
  45. package/dist/commonjs/tests/TimerPickerModal.test.js +0 -276
  46. package/dist/commonjs/tests/TimerPickerModal.test.js.map +0 -1
  47. package/dist/commonjs/tests/colorToRgba.test.js +0 -176
  48. package/dist/commonjs/tests/colorToRgba.test.js.map +0 -1
  49. package/dist/commonjs/tests/generateNumbers.test.js +0 -350
  50. package/dist/commonjs/tests/generateNumbers.test.js.map +0 -1
  51. package/dist/commonjs/tests/getAdjustedLimit.test.js +0 -324
  52. package/dist/commonjs/tests/getAdjustedLimit.test.js.map +0 -1
  53. package/dist/commonjs/tests/getDurationAndIndexFromScrollOffset.test.js +0 -424
  54. package/dist/commonjs/tests/getDurationAndIndexFromScrollOffset.test.js.map +0 -1
  55. package/dist/commonjs/tests/getInitialScrollIndex.test.js +0 -396
  56. package/dist/commonjs/tests/getInitialScrollIndex.test.js.map +0 -1
  57. package/dist/commonjs/tests/getSafeInitialValue.test.js +0 -497
  58. package/dist/commonjs/tests/getSafeInitialValue.test.js.map +0 -1
  59. package/dist/commonjs/tests/padNumber.test.js +0 -301
  60. package/dist/commonjs/tests/padNumber.test.js.map +0 -1
  61. package/dist/commonjs/utils/colorToRgba.js +0 -87
  62. package/dist/commonjs/utils/colorToRgba.js.map +0 -1
  63. package/dist/commonjs/utils/generateNumbers.js +0 -124
  64. package/dist/commonjs/utils/generateNumbers.js.map +0 -1
  65. package/dist/commonjs/utils/getAdjustedLimit.js +0 -58
  66. package/dist/commonjs/utils/getAdjustedLimit.js.map +0 -1
  67. package/dist/commonjs/utils/getDurationAndIndexFromScrollOffset.js +0 -62
  68. package/dist/commonjs/utils/getDurationAndIndexFromScrollOffset.js.map +0 -1
  69. package/dist/commonjs/utils/getInitialScrollIndex.js +0 -57
  70. package/dist/commonjs/utils/getInitialScrollIndex.js.map +0 -1
  71. package/dist/commonjs/utils/getSafeInitialValue.js +0 -41
  72. package/dist/commonjs/utils/getSafeInitialValue.js.map +0 -1
  73. package/dist/commonjs/utils/padNumber.js +0 -40
  74. package/dist/commonjs/utils/padNumber.js.map +0 -1
  75. package/dist/module/components/DurationScroll/DurationScroll.js +0 -395
  76. package/dist/module/components/DurationScroll/DurationScroll.js.map +0 -1
  77. package/dist/module/components/DurationScroll/index.js +0 -3
  78. package/dist/module/components/DurationScroll/index.js.map +0 -1
  79. package/dist/module/components/DurationScroll/types.js +0 -2
  80. package/dist/module/components/DurationScroll/types.js.map +0 -1
  81. package/dist/module/components/Modal/Modal.js +0 -99
  82. package/dist/module/components/Modal/Modal.js.map +0 -1
  83. package/dist/module/components/Modal/index.js +0 -3
  84. package/dist/module/components/Modal/index.js.map +0 -1
  85. package/dist/module/components/Modal/styles.js +0 -19
  86. package/dist/module/components/Modal/styles.js.map +0 -1
  87. package/dist/module/components/Modal/types.js +0 -2
  88. package/dist/module/components/Modal/types.js.map +0 -1
  89. package/dist/module/components/PickerItem/PickerItem.js +0 -38
  90. package/dist/module/components/PickerItem/PickerItem.js.map +0 -1
  91. package/dist/module/components/PickerItem/index.js +0 -2
  92. package/dist/module/components/PickerItem/index.js.map +0 -1
  93. package/dist/module/components/TimerPicker/TimerPicker.js +0 -228
  94. package/dist/module/components/TimerPicker/TimerPicker.js.map +0 -1
  95. package/dist/module/components/TimerPicker/index.js +0 -4
  96. package/dist/module/components/TimerPicker/index.js.map +0 -1
  97. package/dist/module/components/TimerPicker/styles.js +0 -114
  98. package/dist/module/components/TimerPicker/styles.js.map +0 -1
  99. package/dist/module/components/TimerPicker/types.js +0 -2
  100. package/dist/module/components/TimerPicker/types.js.map +0 -1
  101. package/dist/module/components/TimerPickerModal/TimerPickerModal.js +0 -145
  102. package/dist/module/components/TimerPickerModal/TimerPickerModal.js.map +0 -1
  103. package/dist/module/components/TimerPickerModal/index.js +0 -4
  104. package/dist/module/components/TimerPickerModal/index.js.map +0 -1
  105. package/dist/module/components/TimerPickerModal/styles.js +0 -82
  106. package/dist/module/components/TimerPickerModal/styles.js.map +0 -1
  107. package/dist/module/components/TimerPickerModal/types.js +0 -2
  108. package/dist/module/components/TimerPickerModal/types.js.map +0 -1
  109. package/dist/module/index.js +0 -3
  110. package/dist/module/index.js.map +0 -1
  111. package/dist/module/tests/DurationScroll.test.js +0 -160
  112. package/dist/module/tests/DurationScroll.test.js.map +0 -1
  113. package/dist/module/tests/Modal.test.js +0 -116
  114. package/dist/module/tests/Modal.test.js.map +0 -1
  115. package/dist/module/tests/TimerPicker.test.js +0 -166
  116. package/dist/module/tests/TimerPicker.test.js.map +0 -1
  117. package/dist/module/tests/TimerPickerModal.test.js +0 -273
  118. package/dist/module/tests/TimerPickerModal.test.js.map +0 -1
  119. package/dist/module/tests/colorToRgba.test.js +0 -174
  120. package/dist/module/tests/colorToRgba.test.js.map +0 -1
  121. package/dist/module/tests/generateNumbers.test.js +0 -348
  122. package/dist/module/tests/generateNumbers.test.js.map +0 -1
  123. package/dist/module/tests/getAdjustedLimit.test.js +0 -322
  124. package/dist/module/tests/getAdjustedLimit.test.js.map +0 -1
  125. package/dist/module/tests/getDurationAndIndexFromScrollOffset.test.js +0 -422
  126. package/dist/module/tests/getDurationAndIndexFromScrollOffset.test.js.map +0 -1
  127. package/dist/module/tests/getInitialScrollIndex.test.js +0 -394
  128. package/dist/module/tests/getInitialScrollIndex.test.js.map +0 -1
  129. package/dist/module/tests/getSafeInitialValue.test.js +0 -495
  130. package/dist/module/tests/getSafeInitialValue.test.js.map +0 -1
  131. package/dist/module/tests/padNumber.test.js +0 -299
  132. package/dist/module/tests/padNumber.test.js.map +0 -1
  133. package/dist/module/utils/colorToRgba.js +0 -80
  134. package/dist/module/utils/colorToRgba.js.map +0 -1
  135. package/dist/module/utils/generateNumbers.js +0 -117
  136. package/dist/module/utils/generateNumbers.js.map +0 -1
  137. package/dist/module/utils/getAdjustedLimit.js +0 -51
  138. package/dist/module/utils/getAdjustedLimit.js.map +0 -1
  139. package/dist/module/utils/getDurationAndIndexFromScrollOffset.js +0 -55
  140. package/dist/module/utils/getDurationAndIndexFromScrollOffset.js.map +0 -1
  141. package/dist/module/utils/getInitialScrollIndex.js +0 -50
  142. package/dist/module/utils/getInitialScrollIndex.js.map +0 -1
  143. package/dist/module/utils/getSafeInitialValue.js +0 -34
  144. package/dist/module/utils/getSafeInitialValue.js.map +0 -1
  145. package/dist/module/utils/padNumber.js +0 -33
  146. package/dist/module/utils/padNumber.js.map +0 -1
  147. package/dist/typescript/components/DurationScroll/DurationScroll.d.ts +0 -4
  148. package/dist/typescript/components/DurationScroll/index.d.ts +0 -2
  149. package/dist/typescript/components/DurationScroll/types.d.ts +0 -66
  150. package/dist/typescript/components/Modal/Modal.d.ts +0 -5
  151. package/dist/typescript/components/Modal/index.d.ts +0 -2
  152. package/dist/typescript/components/Modal/styles.d.ts +0 -17
  153. package/dist/typescript/components/Modal/types.d.ts +0 -15
  154. package/dist/typescript/components/PickerItem/PickerItem.d.ts +0 -14
  155. package/dist/typescript/components/PickerItem/index.d.ts +0 -1
  156. package/dist/typescript/components/TimerPicker/TimerPicker.d.ts +0 -4
  157. package/dist/typescript/components/TimerPicker/index.d.ts +0 -3
  158. package/dist/typescript/components/TimerPicker/styles.d.ts +0 -1451
  159. package/dist/typescript/components/TimerPicker/types.d.ts +0 -90
  160. package/dist/typescript/components/TimerPickerModal/TimerPickerModal.d.ts +0 -4
  161. package/dist/typescript/components/TimerPickerModal/index.d.ts +0 -3
  162. package/dist/typescript/components/TimerPickerModal/styles.d.ts +0 -947
  163. package/dist/typescript/components/TimerPickerModal/types.d.ts +0 -55
  164. package/dist/typescript/index.d.ts +0 -2
  165. package/dist/typescript/utils/colorToRgba.d.ts +0 -38
  166. package/dist/typescript/utils/generateNumbers.d.ts +0 -80
  167. package/dist/typescript/utils/getAdjustedLimit.d.ts +0 -30
  168. package/dist/typescript/utils/getDurationAndIndexFromScrollOffset.d.ts +0 -49
  169. package/dist/typescript/utils/getInitialScrollIndex.d.ts +0 -46
  170. package/dist/typescript/utils/getSafeInitialValue.d.ts +0 -38
  171. package/dist/typescript/utils/padNumber.d.ts +0 -28
@@ -1,55 +0,0 @@
1
- /**
2
- * Calculates the duration value and index from a scroll offset in a number picker.
3
- * Handles both infinite and non-infinite scroll modes, taking into account padding and item height.
4
- *
5
- * @param {Object} variables - Configuration object for scroll offset calculation
6
- * @param {boolean} variables.disableInfiniteScroll - Whether infinite scroll is disabled
7
- * @param {number} variables.interval - The interval between consecutive numbers
8
- * @param {number} variables.itemHeight - Height of each item in the picker
9
- * @param {number} variables.numberOfItems - Total number of items in the picker
10
- * @param {number} variables.padWithNItems - Number of empty items to pad with
11
- * @param {number} variables.yContentOffset - The vertical scroll offset
12
- *
13
- * @returns {{ duration: number; index: number }} Object containing the calculated duration and index
14
- *
15
- * @example
16
- * // With infinite scroll enabled
17
- * getDurationAndIndexFromScrollOffset({
18
- * disableInfiniteScroll: false,
19
- * interval: 1,
20
- * itemHeight: 50,
21
- * numberOfItems: 24,
22
- * padWithNItems: 2,
23
- * yContentOffset: 100
24
- * })
25
- * // Returns: { duration: 2, index: 2 }
26
- *
27
- * @example
28
- * // With infinite scroll disabled
29
- * getDurationAndIndexFromScrollOffset({
30
- * disableInfiniteScroll: true,
31
- * interval: 1,
32
- * itemHeight: 50,
33
- * numberOfItems: 24,
34
- * padWithNItems: 2,
35
- * yContentOffset: 100
36
- * })
37
- * // Returns: { duration: 2, index: 2 }
38
- */
39
- export const getDurationAndIndexFromScrollOffset = variables => {
40
- const {
41
- disableInfiniteScroll,
42
- interval,
43
- itemHeight,
44
- numberOfItems,
45
- padWithNItems,
46
- yContentOffset
47
- } = variables;
48
- const index = Math.round(yContentOffset / itemHeight);
49
- const duration = (disableInfiniteScroll ? index : index + padWithNItems) % numberOfItems * interval;
50
- return {
51
- duration,
52
- index
53
- };
54
- };
55
- //# sourceMappingURL=getDurationAndIndexFromScrollOffset.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["getDurationAndIndexFromScrollOffset","variables","disableInfiniteScroll","interval","itemHeight","numberOfItems","padWithNItems","yContentOffset","index","Math","round","duration"],"sources":["getDurationAndIndexFromScrollOffset.ts"],"sourcesContent":["/**\n * Calculates the duration value and index from a scroll offset in a number picker.\n * Handles both infinite and non-infinite scroll modes, taking into account padding and item height.\n *\n * @param {Object} variables - Configuration object for scroll offset calculation\n * @param {boolean} variables.disableInfiniteScroll - Whether infinite scroll is disabled\n * @param {number} variables.interval - The interval between consecutive numbers\n * @param {number} variables.itemHeight - Height of each item in the picker\n * @param {number} variables.numberOfItems - Total number of items in the picker\n * @param {number} variables.padWithNItems - Number of empty items to pad with\n * @param {number} variables.yContentOffset - The vertical scroll offset\n *\n * @returns {{ duration: number; index: number }} Object containing the calculated duration and index\n *\n * @example\n * // With infinite scroll enabled\n * getDurationAndIndexFromScrollOffset({\n * disableInfiniteScroll: false,\n * interval: 1,\n * itemHeight: 50,\n * numberOfItems: 24,\n * padWithNItems: 2,\n * yContentOffset: 100\n * })\n * // Returns: { duration: 2, index: 2 }\n *\n * @example\n * // With infinite scroll disabled\n * getDurationAndIndexFromScrollOffset({\n * disableInfiniteScroll: true,\n * interval: 1,\n * itemHeight: 50,\n * numberOfItems: 24,\n * padWithNItems: 2,\n * yContentOffset: 100\n * })\n * // Returns: { duration: 2, index: 2 }\n */\nexport const getDurationAndIndexFromScrollOffset = (variables: {\n disableInfiniteScroll: boolean;\n interval: number;\n itemHeight: number;\n numberOfItems: number;\n padWithNItems: number;\n yContentOffset: number;\n}) => {\n const {\n disableInfiniteScroll,\n interval,\n itemHeight,\n numberOfItems,\n padWithNItems,\n yContentOffset,\n } = variables;\n\n const index = Math.round(yContentOffset / itemHeight);\n\n const duration =\n ((disableInfiniteScroll ? index : index + padWithNItems) %\n numberOfItems) *\n interval;\n\n return {\n duration,\n index,\n };\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,mCAAmC,GAAIC,SAOnD,IAAK;EACF,MAAM;IACFC,qBAAqB;IACrBC,QAAQ;IACRC,UAAU;IACVC,aAAa;IACbC,aAAa;IACbC;EACJ,CAAC,GAAGN,SAAS;EAEb,MAAMO,KAAK,GAAGC,IAAI,CAACC,KAAK,CAACH,cAAc,GAAGH,UAAU,CAAC;EAErD,MAAMO,QAAQ,GACT,CAACT,qBAAqB,GAAGM,KAAK,GAAGA,KAAK,GAAGF,aAAa,IACnDD,aAAa,GACjBF,QAAQ;EAEZ,OAAO;IACHQ,QAAQ;IACRH;EACJ,CAAC;AACL,CAAC","ignoreList":[]}
@@ -1,50 +0,0 @@
1
- /**
2
- * Calculates the initial scroll index for a number picker based on the desired value and configuration.
3
- * Handles both infinite and non-infinite scroll modes, taking into account padding and repetition.
4
- *
5
- * @param {Object} variables - Configuration object for scroll index calculation
6
- * @param {boolean} variables.disableInfiniteScroll - Whether infinite scroll is disabled
7
- * @param {number} variables.interval - The interval between consecutive numbers
8
- * @param {number} variables.numberOfItems - Total number of items in the picker
9
- * @param {number} variables.padWithNItems - Number of empty items to pad with
10
- * @param {number} variables.repeatNumbersNTimes - How many times to repeat the number sequence
11
- * @param {number} variables.value - The desired initial value
12
- *
13
- * @returns {number} The calculated initial scroll index
14
- *
15
- * @example
16
- * // With infinite scroll enabled
17
- * getInitialScrollIndex({
18
- * disableInfiniteScroll: false,
19
- * interval: 1,
20
- * numberOfItems: 24,
21
- * padWithNItems: 2,
22
- * repeatNumbersNTimes: 3,
23
- * value: 12
24
- * })
25
- * // Returns: 38
26
- *
27
- * @example
28
- * // With infinite scroll disabled
29
- * getInitialScrollIndex({
30
- * disableInfiniteScroll: true,
31
- * interval: 1,
32
- * numberOfItems: 24,
33
- * padWithNItems: 2,
34
- * repeatNumbersNTimes: 1,
35
- * value: 12
36
- * })
37
- * // Returns: 12
38
- */
39
- export const getInitialScrollIndex = variables => {
40
- const {
41
- disableInfiniteScroll,
42
- interval,
43
- numberOfItems,
44
- padWithNItems,
45
- repeatNumbersNTimes,
46
- value
47
- } = variables;
48
- return Math.max(numberOfItems * Math.floor(repeatNumbersNTimes / 2) + (value / interval + numberOfItems) % numberOfItems - (!disableInfiniteScroll ? padWithNItems : 0), 0);
49
- };
50
- //# sourceMappingURL=getInitialScrollIndex.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["getInitialScrollIndex","variables","disableInfiniteScroll","interval","numberOfItems","padWithNItems","repeatNumbersNTimes","value","Math","max","floor"],"sources":["getInitialScrollIndex.ts"],"sourcesContent":["/**\n * Calculates the initial scroll index for a number picker based on the desired value and configuration.\n * Handles both infinite and non-infinite scroll modes, taking into account padding and repetition.\n * \n * @param {Object} variables - Configuration object for scroll index calculation\n * @param {boolean} variables.disableInfiniteScroll - Whether infinite scroll is disabled\n * @param {number} variables.interval - The interval between consecutive numbers\n * @param {number} variables.numberOfItems - Total number of items in the picker\n * @param {number} variables.padWithNItems - Number of empty items to pad with\n * @param {number} variables.repeatNumbersNTimes - How many times to repeat the number sequence\n * @param {number} variables.value - The desired initial value\n * \n * @returns {number} The calculated initial scroll index\n * \n * @example\n * // With infinite scroll enabled\n * getInitialScrollIndex({\n * disableInfiniteScroll: false,\n * interval: 1,\n * numberOfItems: 24,\n * padWithNItems: 2,\n * repeatNumbersNTimes: 3,\n * value: 12\n * })\n * // Returns: 38\n * \n * @example\n * // With infinite scroll disabled\n * getInitialScrollIndex({\n * disableInfiniteScroll: true,\n * interval: 1,\n * numberOfItems: 24,\n * padWithNItems: 2,\n * repeatNumbersNTimes: 1,\n * value: 12\n * })\n * // Returns: 12\n */\nexport const getInitialScrollIndex = (variables: {\n disableInfiniteScroll: boolean;\n interval: number;\n numberOfItems: number;\n padWithNItems: number;\n repeatNumbersNTimes: number;\n value: number;\n}) => {\n const {\n disableInfiniteScroll,\n interval,\n numberOfItems,\n padWithNItems,\n repeatNumbersNTimes,\n value,\n } = variables;\n\n return Math.max(\n numberOfItems * Math.floor(repeatNumbersNTimes / 2) +\n ((value / interval + numberOfItems) % numberOfItems) -\n (!disableInfiniteScroll ? padWithNItems : 0),\n 0\n );\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,qBAAqB,GAAIC,SAOrC,IAAK;EACF,MAAM;IACFC,qBAAqB;IACrBC,QAAQ;IACRC,aAAa;IACbC,aAAa;IACbC,mBAAmB;IACnBC;EACJ,CAAC,GAAGN,SAAS;EAEb,OAAOO,IAAI,CAACC,GAAG,CACXL,aAAa,GAAGI,IAAI,CAACE,KAAK,CAACJ,mBAAmB,GAAG,CAAC,CAAC,GAC9C,CAACC,KAAK,GAAGJ,QAAQ,GAAGC,aAAa,IAAIA,aAAc,IACnD,CAACF,qBAAqB,GAAGG,aAAa,GAAG,CAAC,CAAC,EAChD,CACJ,CAAC;AACL,CAAC","ignoreList":[]}
@@ -1,34 +0,0 @@
1
- /**
2
- * Safely extracts and validates initial duration values, ensuring all values are valid numbers.
3
- * Returns a duration object with safe default values (0) for any invalid or missing inputs.
4
- *
5
- * @param {Object} [initialValue] - Optional initial duration values
6
- * @param {number} [initialValue.days] - Initial days value
7
- * @param {number} [initialValue.hours] - Initial hours value
8
- * @param {number} [initialValue.minutes] - Initial minutes value
9
- * @param {number} [initialValue.seconds] - Initial seconds value
10
- *
11
- * @returns {{ days: number; hours: number; minutes: number; seconds: number }} An object containing safe duration values
12
- *
13
- * @example
14
- * // With valid values
15
- * getSafeInitialValue({ days: 1, hours: 2, minutes: 30, seconds: 45 })
16
- * // Returns: { days: 1, hours: 2, minutes: 30, seconds: 45 }
17
- *
18
- * @example
19
- * // With invalid values
20
- * getSafeInitialValue({ days: NaN, hours: 'invalid', minutes: undefined })
21
- * // Returns: { days: 0, hours: 0, minutes: 0, seconds: 0 }
22
- *
23
- * @example
24
- * // With undefined input
25
- * getSafeInitialValue(undefined)
26
- * // Returns: { days: 0, hours: 0, minutes: 0, seconds: 0 }
27
- */
28
- export const getSafeInitialValue = initialValue => ({
29
- days: typeof (initialValue === null || initialValue === void 0 ? void 0 : initialValue.days) === "number" && !isNaN(initialValue === null || initialValue === void 0 ? void 0 : initialValue.days) ? initialValue.days : 0,
30
- hours: typeof (initialValue === null || initialValue === void 0 ? void 0 : initialValue.hours) === "number" && !isNaN(initialValue === null || initialValue === void 0 ? void 0 : initialValue.hours) ? initialValue.hours : 0,
31
- minutes: typeof (initialValue === null || initialValue === void 0 ? void 0 : initialValue.minutes) === "number" && !isNaN(initialValue === null || initialValue === void 0 ? void 0 : initialValue.minutes) ? initialValue.minutes : 0,
32
- seconds: typeof (initialValue === null || initialValue === void 0 ? void 0 : initialValue.seconds) === "number" && !isNaN(initialValue === null || initialValue === void 0 ? void 0 : initialValue.seconds) ? initialValue.seconds : 0
33
- });
34
- //# sourceMappingURL=getSafeInitialValue.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["getSafeInitialValue","initialValue","days","isNaN","hours","minutes","seconds"],"sources":["getSafeInitialValue.ts"],"sourcesContent":["/**\n * Safely extracts and validates initial duration values, ensuring all values are valid numbers.\n * Returns a duration object with safe default values (0) for any invalid or missing inputs.\n * \n * @param {Object} [initialValue] - Optional initial duration values\n * @param {number} [initialValue.days] - Initial days value\n * @param {number} [initialValue.hours] - Initial hours value\n * @param {number} [initialValue.minutes] - Initial minutes value\n * @param {number} [initialValue.seconds] - Initial seconds value\n * \n * @returns {{ days: number; hours: number; minutes: number; seconds: number }} An object containing safe duration values\n * \n * @example\n * // With valid values\n * getSafeInitialValue({ days: 1, hours: 2, minutes: 30, seconds: 45 })\n * // Returns: { days: 1, hours: 2, minutes: 30, seconds: 45 }\n * \n * @example\n * // With invalid values\n * getSafeInitialValue({ days: NaN, hours: 'invalid', minutes: undefined })\n * // Returns: { days: 0, hours: 0, minutes: 0, seconds: 0 }\n * \n * @example\n * // With undefined input\n * getSafeInitialValue(undefined)\n * // Returns: { days: 0, hours: 0, minutes: 0, seconds: 0 }\n */\nexport const getSafeInitialValue = (\n initialValue:\n | {\n days?: number;\n hours?: number;\n minutes?: number;\n seconds?: number;\n }\n | undefined\n) => ({\n days:\n typeof initialValue?.days === \"number\" && !isNaN(initialValue?.days)\n ? initialValue.days\n : 0,\n hours:\n typeof initialValue?.hours === \"number\" && !isNaN(initialValue?.hours)\n ? initialValue.hours\n : 0,\n minutes:\n typeof initialValue?.minutes === \"number\" &&\n !isNaN(initialValue?.minutes)\n ? initialValue.minutes\n : 0,\n seconds:\n typeof initialValue?.seconds === \"number\" &&\n !isNaN(initialValue?.seconds)\n ? initialValue.seconds\n : 0,\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,mBAAmB,GAC5BC,YAOe,KACb;EACFC,IAAI,EACA,QAAOD,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAEC,IAAI,MAAK,QAAQ,IAAI,CAACC,KAAK,CAACF,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAEC,IAAI,CAAC,GAC9DD,YAAY,CAACC,IAAI,GACjB,CAAC;EACXE,KAAK,EACD,QAAOH,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAEG,KAAK,MAAK,QAAQ,IAAI,CAACD,KAAK,CAACF,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAEG,KAAK,CAAC,GAChEH,YAAY,CAACG,KAAK,GAClB,CAAC;EACXC,OAAO,EACH,QAAOJ,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAEI,OAAO,MAAK,QAAQ,IACzC,CAACF,KAAK,CAACF,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAEI,OAAO,CAAC,GACvBJ,YAAY,CAACI,OAAO,GACpB,CAAC;EACXC,OAAO,EACH,QAAOL,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAEK,OAAO,MAAK,QAAQ,IACzC,CAACH,KAAK,CAACF,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAEK,OAAO,CAAC,GACvBL,YAAY,CAACK,OAAO,GACpB;AACd,CAAC,CAAC","ignoreList":[]}
@@ -1,33 +0,0 @@
1
- /**
2
- * Formats a number by optionally padding it with a leading zero or space.
3
- * Numbers less than 10 are padded based on the options provided.
4
- *
5
- * @param {number} value - The number to format
6
- * @param {Object} [options] - Optional formatting options
7
- * @param {boolean} [options.padWithZero] - Whether to pad with zero (true) or space (false)
8
- *
9
- * @returns {string} The formatted number string
10
- *
11
- * @example
12
- * // Pad with zero
13
- * padNumber(5, { padWithZero: true })
14
- * // Returns: '05'
15
- *
16
- * @example
17
- * // Pad with figure space (same width as zero)
18
- * padNumber(5, { padWithZero: false })
19
- * // Returns: ' 5'
20
- *
21
- * @example
22
- * // No padding needed
23
- * padNumber(15)
24
- * // Returns: '15'
25
- */
26
- export const padNumber = (value, options) => {
27
- if (value < 10) {
28
- return (options !== null && options !== void 0 && options.padWithZero ? "0" : "\u2007") + value;
29
- } else {
30
- return String(value);
31
- }
32
- };
33
- //# sourceMappingURL=padNumber.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["padNumber","value","options","padWithZero","String"],"sources":["padNumber.ts"],"sourcesContent":["/**\n * Formats a number by optionally padding it with a leading zero or space.\n * Numbers less than 10 are padded based on the options provided.\n *\n * @param {number} value - The number to format\n * @param {Object} [options] - Optional formatting options\n * @param {boolean} [options.padWithZero] - Whether to pad with zero (true) or space (false)\n *\n * @returns {string} The formatted number string\n *\n * @example\n * // Pad with zero\n * padNumber(5, { padWithZero: true })\n * // Returns: '05'\n *\n * @example\n * // Pad with figure space (same width as zero)\n * padNumber(5, { padWithZero: false })\n * // Returns: ' 5'\n *\n * @example\n * // No padding needed\n * padNumber(15)\n * // Returns: '15'\n */\nexport const padNumber = (\n value: number,\n options?: { padWithZero?: boolean }\n): string => {\n if (value < 10) {\n return (options?.padWithZero ? \"0\" : \"\\u2007\") + value;\n } else {\n return String(value);\n }\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,SAAS,GAAGA,CACrBC,KAAa,EACbC,OAAmC,KAC1B;EACT,IAAID,KAAK,GAAG,EAAE,EAAE;IACZ,OAAO,CAACC,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAEC,WAAW,GAAG,GAAG,GAAG,QAAQ,IAAIF,KAAK;EAC1D,CAAC,MAAM;IACH,OAAOG,MAAM,CAACH,KAAK,CAAC;EACxB;AACJ,CAAC","ignoreList":[]}
@@ -1,4 +0,0 @@
1
- import React from "react";
2
- import type { DurationScrollProps, DurationScrollRef } from "./types";
3
- declare const _default: React.NamedExoticComponent<DurationScrollProps & React.RefAttributes<DurationScrollRef>>;
4
- export default _default;
@@ -1,2 +0,0 @@
1
- export { default } from "./DurationScroll";
2
- export * from "./types";
@@ -1,66 +0,0 @@
1
- import type { RefObject } from "react";
2
- import type { View } from "react-native";
3
- import type { generateStyles } from "../TimerPicker/styles";
4
- export interface DurationScrollProps {
5
- Audio?: any;
6
- FlatList?: any;
7
- Haptics?: any;
8
- LinearGradient?: any;
9
- MaskedView?: any;
10
- aggressivelyGetLatestDuration: boolean;
11
- allowFontScaling?: boolean;
12
- amLabel?: string;
13
- clickSoundAsset?: SoundAsset;
14
- decelerationRate?: number | "normal" | "fast";
15
- disableInfiniteScroll?: boolean;
16
- initialValue?: number;
17
- interval: number;
18
- is12HourPicker?: boolean;
19
- isDisabled?: boolean;
20
- label?: string | React.ReactElement;
21
- limit?: Limit;
22
- maximumValue: number;
23
- onDurationChange: (duration: number) => void;
24
- padNumbersWithZero?: boolean;
25
- padWithNItems: number;
26
- pickerFeedback?: () => void | Promise<void>;
27
- pickerGradientOverlayProps?: Partial<LinearGradientProps>;
28
- pmLabel?: string;
29
- repeatNumbersNTimes?: number;
30
- repeatNumbersNTimesNotExplicitlySet: boolean;
31
- styles: ReturnType<typeof generateStyles>;
32
- testID?: string;
33
- }
34
- export interface DurationScrollRef {
35
- latestDuration: RefObject<number>;
36
- reset: (options?: {
37
- animated?: boolean;
38
- }) => void;
39
- setValue: (value: number, options?: {
40
- animated?: boolean;
41
- }) => void;
42
- }
43
- type LinearGradientPoint = {
44
- x: number;
45
- y: number;
46
- };
47
- export type LinearGradientProps = React.ComponentProps<typeof View> & {
48
- colors: string[];
49
- end?: LinearGradientPoint | null;
50
- locations?: number[] | null;
51
- start?: LinearGradientPoint | null;
52
- };
53
- export type Limit = {
54
- max?: number;
55
- min?: number;
56
- };
57
- export type SoundAsset = number | {
58
- headers?: Record<string, string>;
59
- overrideFileExtensionAndroid?: string;
60
- uri: string;
61
- };
62
- export type ExpoAvAudioInstance = {
63
- replayAsync: () => Promise<void>;
64
- unloadAsync: () => Promise<void>;
65
- };
66
- export {};
@@ -1,5 +0,0 @@
1
- import React from "react";
2
- import type { ModalProps } from "./types";
3
- export declare const Modal: (props: ModalProps) => React.JSX.Element;
4
- declare const _default: React.MemoExoticComponent<(props: ModalProps) => React.JSX.Element>;
5
- export default _default;
@@ -1,2 +0,0 @@
1
- export { default } from "./Modal";
2
- export * from "./types";
@@ -1,17 +0,0 @@
1
- export declare const styles: {
2
- backdrop: {
3
- position: "absolute";
4
- top: number;
5
- bottom: number;
6
- left: number;
7
- right: number;
8
- backgroundColor: string;
9
- opacity: number;
10
- };
11
- content: {
12
- flex: number;
13
- justifyContent: "center";
14
- alignItems: "center";
15
- zIndex: number;
16
- };
17
- };
@@ -1,15 +0,0 @@
1
- import type { ComponentProps } from "react";
2
- import type { ViewStyle } from "react-native";
3
- import type { Modal as ReactNativeModal } from "react-native";
4
- export interface ModalProps {
5
- animationDuration?: number;
6
- children?: React.ReactElement;
7
- contentStyle?: ViewStyle;
8
- isVisible?: boolean;
9
- modalProps?: ComponentProps<typeof ReactNativeModal>;
10
- onHide?: () => void;
11
- onOverlayPress?: () => void;
12
- overlayOpacity?: number;
13
- overlayStyle?: ViewStyle;
14
- testID?: string;
15
- }
@@ -1,14 +0,0 @@
1
- import React from "react";
2
- import type { generateStyles } from "../TimerPicker/styles";
3
- interface PickerItemProps {
4
- adjustedLimitedMax: number;
5
- adjustedLimitedMin: number;
6
- allowFontScaling: boolean;
7
- amLabel?: string;
8
- is12HourPicker?: boolean;
9
- item: string;
10
- pmLabel?: string;
11
- styles: ReturnType<typeof generateStyles>;
12
- }
13
- declare const PickerItem: React.NamedExoticComponent<PickerItemProps>;
14
- export default PickerItem;
@@ -1 +0,0 @@
1
- export { default } from "./PickerItem";
@@ -1,4 +0,0 @@
1
- import React from "react";
2
- import type { TimerPickerProps, TimerPickerRef } from "./types";
3
- declare const _default: React.NamedExoticComponent<TimerPickerProps & React.RefAttributes<TimerPickerRef>>;
4
- export default _default;
@@ -1,3 +0,0 @@
1
- export { default } from "./TimerPicker";
2
- export * from "./types";
3
- export * from "./styles";