react-native-timer-picker 2.5.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.
- package/README.md +22 -13
- package/package.json +143 -126
- package/dist/commonjs/components/DurationScroll/DurationScroll.js +0 -405
- package/dist/commonjs/components/DurationScroll/DurationScroll.js.map +0 -1
- package/dist/commonjs/components/DurationScroll/index.js +0 -27
- package/dist/commonjs/components/DurationScroll/index.js.map +0 -1
- package/dist/commonjs/components/DurationScroll/types.js +0 -6
- package/dist/commonjs/components/DurationScroll/types.js.map +0 -1
- package/dist/commonjs/components/Modal/Modal.js +0 -107
- package/dist/commonjs/components/Modal/Modal.js.map +0 -1
- package/dist/commonjs/components/Modal/index.js +0 -27
- package/dist/commonjs/components/Modal/index.js.map +0 -1
- package/dist/commonjs/components/Modal/styles.js +0 -25
- package/dist/commonjs/components/Modal/styles.js.map +0 -1
- package/dist/commonjs/components/Modal/types.js +0 -6
- package/dist/commonjs/components/Modal/types.js.map +0 -1
- package/dist/commonjs/components/PickerItem/PickerItem.js +0 -47
- package/dist/commonjs/components/PickerItem/PickerItem.js.map +0 -1
- package/dist/commonjs/components/PickerItem/index.js +0 -14
- package/dist/commonjs/components/PickerItem/index.js.map +0 -1
- package/dist/commonjs/components/TimerPicker/TimerPicker.js +0 -240
- package/dist/commonjs/components/TimerPicker/TimerPicker.js.map +0 -1
- package/dist/commonjs/components/TimerPicker/index.js +0 -39
- package/dist/commonjs/components/TimerPicker/index.js.map +0 -1
- package/dist/commonjs/components/TimerPicker/styles.js +0 -130
- package/dist/commonjs/components/TimerPicker/styles.js.map +0 -1
- package/dist/commonjs/components/TimerPicker/types.js +0 -6
- package/dist/commonjs/components/TimerPicker/types.js.map +0 -1
- package/dist/commonjs/components/TimerPickerModal/TimerPickerModal.js +0 -153
- package/dist/commonjs/components/TimerPickerModal/TimerPickerModal.js.map +0 -1
- package/dist/commonjs/components/TimerPickerModal/index.js +0 -39
- package/dist/commonjs/components/TimerPickerModal/index.js.map +0 -1
- package/dist/commonjs/components/TimerPickerModal/styles.js +0 -89
- package/dist/commonjs/components/TimerPickerModal/styles.js.map +0 -1
- package/dist/commonjs/components/TimerPickerModal/types.js +0 -6
- package/dist/commonjs/components/TimerPickerModal/types.js.map +0 -1
- package/dist/commonjs/index.js +0 -57
- package/dist/commonjs/index.js.map +0 -1
- package/dist/commonjs/tests/DurationScroll.test.js +0 -163
- package/dist/commonjs/tests/DurationScroll.test.js.map +0 -1
- package/dist/commonjs/tests/Modal.test.js +0 -99
- package/dist/commonjs/tests/Modal.test.js.map +0 -1
- package/dist/commonjs/tests/TimerPicker.test.js +0 -169
- package/dist/commonjs/tests/TimerPicker.test.js.map +0 -1
- package/dist/commonjs/tests/TimerPickerModal.test.js +0 -276
- package/dist/commonjs/tests/TimerPickerModal.test.js.map +0 -1
- package/dist/commonjs/tests/colorToRgba.test.js +0 -176
- package/dist/commonjs/tests/colorToRgba.test.js.map +0 -1
- package/dist/commonjs/tests/generateNumbers.test.js +0 -350
- package/dist/commonjs/tests/generateNumbers.test.js.map +0 -1
- package/dist/commonjs/tests/getAdjustedLimit.test.js +0 -324
- package/dist/commonjs/tests/getAdjustedLimit.test.js.map +0 -1
- package/dist/commonjs/tests/getDurationAndIndexFromScrollOffset.test.js +0 -424
- package/dist/commonjs/tests/getDurationAndIndexFromScrollOffset.test.js.map +0 -1
- package/dist/commonjs/tests/getInitialScrollIndex.test.js +0 -396
- package/dist/commonjs/tests/getInitialScrollIndex.test.js.map +0 -1
- package/dist/commonjs/tests/getSafeInitialValue.test.js +0 -497
- package/dist/commonjs/tests/getSafeInitialValue.test.js.map +0 -1
- package/dist/commonjs/tests/padNumber.test.js +0 -301
- package/dist/commonjs/tests/padNumber.test.js.map +0 -1
- package/dist/commonjs/utils/colorToRgba.js +0 -87
- package/dist/commonjs/utils/colorToRgba.js.map +0 -1
- package/dist/commonjs/utils/generateNumbers.js +0 -124
- package/dist/commonjs/utils/generateNumbers.js.map +0 -1
- package/dist/commonjs/utils/getAdjustedLimit.js +0 -58
- package/dist/commonjs/utils/getAdjustedLimit.js.map +0 -1
- package/dist/commonjs/utils/getDurationAndIndexFromScrollOffset.js +0 -62
- package/dist/commonjs/utils/getDurationAndIndexFromScrollOffset.js.map +0 -1
- package/dist/commonjs/utils/getInitialScrollIndex.js +0 -57
- package/dist/commonjs/utils/getInitialScrollIndex.js.map +0 -1
- package/dist/commonjs/utils/getSafeInitialValue.js +0 -41
- package/dist/commonjs/utils/getSafeInitialValue.js.map +0 -1
- package/dist/commonjs/utils/padNumber.js +0 -40
- package/dist/commonjs/utils/padNumber.js.map +0 -1
- package/dist/module/components/DurationScroll/DurationScroll.js +0 -397
- package/dist/module/components/DurationScroll/DurationScroll.js.map +0 -1
- package/dist/module/components/DurationScroll/index.js +0 -3
- package/dist/module/components/DurationScroll/index.js.map +0 -1
- package/dist/module/components/DurationScroll/types.js +0 -2
- package/dist/module/components/DurationScroll/types.js.map +0 -1
- package/dist/module/components/Modal/Modal.js +0 -99
- package/dist/module/components/Modal/Modal.js.map +0 -1
- package/dist/module/components/Modal/index.js +0 -3
- package/dist/module/components/Modal/index.js.map +0 -1
- package/dist/module/components/Modal/styles.js +0 -19
- package/dist/module/components/Modal/styles.js.map +0 -1
- package/dist/module/components/Modal/types.js +0 -2
- package/dist/module/components/Modal/types.js.map +0 -1
- package/dist/module/components/PickerItem/PickerItem.js +0 -40
- package/dist/module/components/PickerItem/PickerItem.js.map +0 -1
- package/dist/module/components/PickerItem/index.js +0 -2
- package/dist/module/components/PickerItem/index.js.map +0 -1
- package/dist/module/components/TimerPicker/TimerPicker.js +0 -232
- package/dist/module/components/TimerPicker/TimerPicker.js.map +0 -1
- package/dist/module/components/TimerPicker/index.js +0 -4
- package/dist/module/components/TimerPicker/index.js.map +0 -1
- package/dist/module/components/TimerPicker/styles.js +0 -123
- package/dist/module/components/TimerPicker/styles.js.map +0 -1
- package/dist/module/components/TimerPicker/types.js +0 -2
- package/dist/module/components/TimerPicker/types.js.map +0 -1
- package/dist/module/components/TimerPickerModal/TimerPickerModal.js +0 -145
- package/dist/module/components/TimerPickerModal/TimerPickerModal.js.map +0 -1
- package/dist/module/components/TimerPickerModal/index.js +0 -4
- package/dist/module/components/TimerPickerModal/index.js.map +0 -1
- package/dist/module/components/TimerPickerModal/styles.js +0 -82
- package/dist/module/components/TimerPickerModal/styles.js.map +0 -1
- package/dist/module/components/TimerPickerModal/types.js +0 -2
- package/dist/module/components/TimerPickerModal/types.js.map +0 -1
- package/dist/module/index.js +0 -3
- package/dist/module/index.js.map +0 -1
- package/dist/module/tests/DurationScroll.test.js +0 -160
- package/dist/module/tests/DurationScroll.test.js.map +0 -1
- package/dist/module/tests/Modal.test.js +0 -96
- package/dist/module/tests/Modal.test.js.map +0 -1
- package/dist/module/tests/TimerPicker.test.js +0 -166
- package/dist/module/tests/TimerPicker.test.js.map +0 -1
- package/dist/module/tests/TimerPickerModal.test.js +0 -273
- package/dist/module/tests/TimerPickerModal.test.js.map +0 -1
- package/dist/module/tests/colorToRgba.test.js +0 -174
- package/dist/module/tests/colorToRgba.test.js.map +0 -1
- package/dist/module/tests/generateNumbers.test.js +0 -348
- package/dist/module/tests/generateNumbers.test.js.map +0 -1
- package/dist/module/tests/getAdjustedLimit.test.js +0 -322
- package/dist/module/tests/getAdjustedLimit.test.js.map +0 -1
- package/dist/module/tests/getDurationAndIndexFromScrollOffset.test.js +0 -422
- package/dist/module/tests/getDurationAndIndexFromScrollOffset.test.js.map +0 -1
- package/dist/module/tests/getInitialScrollIndex.test.js +0 -394
- package/dist/module/tests/getInitialScrollIndex.test.js.map +0 -1
- package/dist/module/tests/getSafeInitialValue.test.js +0 -495
- package/dist/module/tests/getSafeInitialValue.test.js.map +0 -1
- package/dist/module/tests/padNumber.test.js +0 -299
- package/dist/module/tests/padNumber.test.js.map +0 -1
- package/dist/module/utils/colorToRgba.js +0 -80
- package/dist/module/utils/colorToRgba.js.map +0 -1
- package/dist/module/utils/generateNumbers.js +0 -117
- package/dist/module/utils/generateNumbers.js.map +0 -1
- package/dist/module/utils/getAdjustedLimit.js +0 -51
- package/dist/module/utils/getAdjustedLimit.js.map +0 -1
- package/dist/module/utils/getDurationAndIndexFromScrollOffset.js +0 -55
- package/dist/module/utils/getDurationAndIndexFromScrollOffset.js.map +0 -1
- package/dist/module/utils/getInitialScrollIndex.js +0 -50
- package/dist/module/utils/getInitialScrollIndex.js.map +0 -1
- package/dist/module/utils/getSafeInitialValue.js +0 -34
- package/dist/module/utils/getSafeInitialValue.js.map +0 -1
- package/dist/module/utils/padNumber.js +0 -33
- package/dist/module/utils/padNumber.js.map +0 -1
- package/dist/typescript/components/DurationScroll/DurationScroll.d.ts +0 -4
- package/dist/typescript/components/DurationScroll/index.d.ts +0 -2
- package/dist/typescript/components/DurationScroll/types.d.ts +0 -67
- package/dist/typescript/components/Modal/Modal.d.ts +0 -5
- package/dist/typescript/components/Modal/index.d.ts +0 -2
- package/dist/typescript/components/Modal/styles.d.ts +0 -17
- package/dist/typescript/components/Modal/types.d.ts +0 -15
- package/dist/typescript/components/PickerItem/PickerItem.d.ts +0 -15
- package/dist/typescript/components/PickerItem/index.d.ts +0 -1
- package/dist/typescript/components/TimerPicker/TimerPicker.d.ts +0 -4
- package/dist/typescript/components/TimerPicker/index.d.ts +0 -3
- package/dist/typescript/components/TimerPicker/styles.d.ts +0 -1578
- package/dist/typescript/components/TimerPicker/types.d.ts +0 -90
- package/dist/typescript/components/TimerPickerModal/TimerPickerModal.d.ts +0 -4
- package/dist/typescript/components/TimerPickerModal/index.d.ts +0 -3
- package/dist/typescript/components/TimerPickerModal/styles.d.ts +0 -948
- package/dist/typescript/components/TimerPickerModal/types.d.ts +0 -55
- package/dist/typescript/index.d.ts +0 -2
- package/dist/typescript/utils/colorToRgba.d.ts +0 -38
- package/dist/typescript/utils/generateNumbers.d.ts +0 -80
- package/dist/typescript/utils/getAdjustedLimit.d.ts +0 -30
- package/dist/typescript/utils/getDurationAndIndexFromScrollOffset.d.ts +0 -49
- package/dist/typescript/utils/getInitialScrollIndex.d.ts +0 -46
- package/dist/typescript/utils/getSafeInitialValue.d.ts +0 -38
- 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,67 +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
|
-
selectedValue?: number;
|
|
32
|
-
styles: ReturnType<typeof generateStyles>;
|
|
33
|
-
testID?: string;
|
|
34
|
-
}
|
|
35
|
-
export interface DurationScrollRef {
|
|
36
|
-
latestDuration: RefObject<number>;
|
|
37
|
-
reset: (options?: {
|
|
38
|
-
animated?: boolean;
|
|
39
|
-
}) => void;
|
|
40
|
-
setValue: (value: number, options?: {
|
|
41
|
-
animated?: boolean;
|
|
42
|
-
}) => void;
|
|
43
|
-
}
|
|
44
|
-
type LinearGradientPoint = {
|
|
45
|
-
x: number;
|
|
46
|
-
y: number;
|
|
47
|
-
};
|
|
48
|
-
export type LinearGradientProps = React.ComponentProps<typeof View> & {
|
|
49
|
-
colors: string[];
|
|
50
|
-
end?: LinearGradientPoint | null;
|
|
51
|
-
locations?: number[] | null;
|
|
52
|
-
start?: LinearGradientPoint | null;
|
|
53
|
-
};
|
|
54
|
-
export type Limit = {
|
|
55
|
-
max?: number;
|
|
56
|
-
min?: number;
|
|
57
|
-
};
|
|
58
|
-
export type SoundAsset = number | {
|
|
59
|
-
headers?: Record<string, string>;
|
|
60
|
-
overrideFileExtensionAndroid?: string;
|
|
61
|
-
uri: string;
|
|
62
|
-
};
|
|
63
|
-
export type ExpoAvAudioInstance = {
|
|
64
|
-
replayAsync: () => Promise<void>;
|
|
65
|
-
unloadAsync: () => Promise<void>;
|
|
66
|
-
};
|
|
67
|
-
export {};
|
|
@@ -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,15 +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
|
-
selectedValue?: number;
|
|
12
|
-
styles: ReturnType<typeof generateStyles>;
|
|
13
|
-
}
|
|
14
|
-
declare const PickerItem: React.NamedExoticComponent<PickerItemProps>;
|
|
15
|
-
export default PickerItem;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./PickerItem";
|