react-native-timer-picker 2.0.0 → 2.0.2
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 +3 -0
- package/dist/commonjs/components/DurationScroll/index.js +5 -4
- package/dist/commonjs/components/DurationScroll/index.js.map +1 -1
- package/dist/commonjs/components/TimerPicker/index.js +7 -6
- package/dist/commonjs/components/TimerPicker/index.js.map +1 -1
- package/dist/commonjs/components/TimerPicker/styles.js +11 -0
- package/dist/commonjs/components/TimerPicker/styles.js.map +1 -1
- package/dist/commonjs/components/TimerPickerModal/index.js +10 -7
- package/dist/commonjs/components/TimerPickerModal/index.js.map +1 -1
- package/dist/commonjs/components/TimerPickerModal/styles.js +87 -54
- package/dist/commonjs/components/TimerPickerModal/styles.js.map +1 -1
- package/dist/commonjs/utils/getSafeInitialValue.js +13 -0
- package/dist/commonjs/utils/getSafeInitialValue.js.map +1 -0
- package/dist/module/components/DurationScroll/index.js +5 -4
- package/dist/module/components/DurationScroll/index.js.map +1 -1
- package/dist/module/components/TimerPicker/index.js +7 -6
- package/dist/module/components/TimerPicker/index.js.map +1 -1
- package/dist/module/components/TimerPicker/styles.js +11 -0
- package/dist/module/components/TimerPicker/styles.js.map +1 -1
- package/dist/module/components/TimerPickerModal/index.js +10 -7
- package/dist/module/components/TimerPickerModal/index.js.map +1 -1
- package/dist/module/components/TimerPickerModal/styles.js +87 -54
- package/dist/module/components/TimerPickerModal/styles.js.map +1 -1
- package/dist/module/utils/getSafeInitialValue.js +6 -0
- package/dist/module/utils/getSafeInitialValue.js.map +1 -0
- package/dist/typescript/components/TimerPicker/styles.d.ts +276 -0
- package/dist/typescript/components/TimerPickerModal/styles.d.ts +120 -8
- package/dist/typescript/utils/getSafeInitialValue.d.ts +9 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["StyleSheet","DARK_MODE_BACKGROUND_COLOR","DARK_MODE_TEXT_COLOR","LIGHT_MODE_BACKGROUND_COLOR","LIGHT_MODE_TEXT_COLOR","generateStyles","customStyles","options","_customStyles$pickerL","_customStyles$text","_customStyles$pickerI","_customStyles$text2","_customStyles$pickerI2","_customStyles$pickerI3","_customStyles$pickerI4","create","pickerContainer","flexDirection","marginRight","backgroundColor","theme","pickerLabelContainer","position","right","top","bottom","justifyContent","minWidth","pickerLabel","fontSize","text","fontWeight","marginTop","pickerItem","color","pickerItemContainer","height","alignItems","width","textAlignVertical","pickerAmPmContainer","pickerAmPmLabel","disabledPickerContainer","opacity","disabledPickerItem","pickerGradientOverlay","left","padWithNItems"],"sources":["styles.ts"],"sourcesContent":["import { StyleSheet } from \"react-native\";\nimport type { TextStyle, ViewStyle } from \"react-native\";\n\nexport interface CustomTimerPickerStyles {\n backgroundColor?: string;\n disabledPickerContainer?: ViewStyle;\n disabledPickerItem?: TextStyle;\n pickerAmPmContainer?: ViewStyle;\n pickerAmPmLabel?: TextStyle;\n pickerContainer?: ViewStyle & { backgroundColor?: string };\n pickerGradientOverlay?: ViewStyle;\n pickerItem?: TextStyle;\n pickerItemContainer?: ViewStyle & { height?: number };\n pickerLabel?: TextStyle;\n pickerLabelContainer?: ViewStyle;\n text?: TextStyle;\n theme?: \"light\" | \"dark\";\n}\n\nconst DARK_MODE_BACKGROUND_COLOR = \"#232323\";\nconst DARK_MODE_TEXT_COLOR = \"#E9E9E9\";\nconst LIGHT_MODE_BACKGROUND_COLOR = \"#F1F1F1\";\nconst LIGHT_MODE_TEXT_COLOR = \"#1B1B1B\";\n\nexport const generateStyles = (\n customStyles: CustomTimerPickerStyles | undefined,\n options: { padWithNItems: number }\n) =>\n StyleSheet.create({\n pickerContainer: {\n flexDirection: \"row\",\n marginRight: \"8%\",\n backgroundColor:\n customStyles?.backgroundColor ??\n (customStyles?.theme === \"dark\"\n ? DARK_MODE_BACKGROUND_COLOR\n : LIGHT_MODE_BACKGROUND_COLOR),\n ...customStyles?.pickerContainer,\n },\n pickerLabelContainer: {\n position: \"absolute\",\n right: 4,\n top: 0,\n bottom: 0,\n justifyContent: \"center\",\n minWidth:\n (customStyles?.pickerLabel?.fontSize ??\n customStyles?.text?.fontSize ??\n 25) * 0.65,\n ...customStyles?.pickerLabelContainer,\n },\n pickerLabel: {\n fontSize: 18,\n fontWeight: \"bold\",\n marginTop:\n (customStyles?.pickerItem?.fontSize ??\n customStyles?.text?.fontSize ??\n 25) / 6,\n color:\n customStyles?.theme === \"dark\"\n ? DARK_MODE_TEXT_COLOR\n : LIGHT_MODE_TEXT_COLOR,\n ...customStyles?.text,\n ...customStyles?.pickerLabel,\n },\n pickerItemContainer: {\n flexDirection: \"row\",\n height: 50,\n justifyContent: \"center\",\n alignItems: \"center\",\n width: (customStyles?.pickerItem?.fontSize ?? 25) * 3.6,\n ...customStyles?.pickerItemContainer,\n },\n pickerItem: {\n textAlignVertical: \"center\",\n fontSize: 25,\n color:\n customStyles?.theme === \"dark\"\n ? DARK_MODE_TEXT_COLOR\n : LIGHT_MODE_TEXT_COLOR,\n ...customStyles?.text,\n ...customStyles?.pickerItem,\n },\n pickerAmPmContainer: {\n position: \"absolute\",\n right: 0,\n top: 0,\n bottom: 0,\n justifyContent: \"center\",\n ...customStyles?.pickerLabelContainer,\n ...customStyles?.pickerAmPmContainer,\n },\n pickerAmPmLabel: {\n fontSize: 18,\n fontWeight: \"bold\",\n marginTop: (customStyles?.pickerItem?.fontSize ?? 25) / 6,\n color:\n customStyles?.theme === \"dark\"\n ? DARK_MODE_TEXT_COLOR\n : LIGHT_MODE_TEXT_COLOR,\n ...customStyles?.text,\n ...customStyles?.pickerLabel,\n ...customStyles?.pickerAmPmLabel,\n },\n disabledPickerContainer: {\n opacity: 0.4,\n ...customStyles?.disabledPickerContainer,\n },\n disabledPickerItem: {\n opacity: 0.2,\n ...customStyles?.disabledPickerItem,\n },\n pickerGradientOverlay: {\n position: \"absolute\",\n left: 0,\n right: 0,\n height:\n options.padWithNItems === 0\n ? \"30%\"\n : (customStyles?.pickerItemContainer?.height ?? 50) * 0.8,\n ...customStyles?.pickerGradientOverlay,\n },\n });\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,cAAc;
|
|
1
|
+
{"version":3,"names":["StyleSheet","DARK_MODE_BACKGROUND_COLOR","DARK_MODE_TEXT_COLOR","LIGHT_MODE_BACKGROUND_COLOR","LIGHT_MODE_TEXT_COLOR","generateStyles","customStyles","options","_customStyles$pickerL","_customStyles$text","_customStyles$pickerI","_customStyles$text2","_customStyles$pickerI2","_customStyles$pickerI3","_customStyles$pickerI4","create","pickerContainer","flexDirection","marginRight","backgroundColor","theme","pickerLabelContainer","position","right","top","bottom","justifyContent","minWidth","pickerLabel","fontSize","text","fontWeight","marginTop","pickerItem","color","pickerItemContainer","height","alignItems","width","textAlignVertical","pickerAmPmContainer","pickerAmPmLabel","disabledPickerContainer","opacity","disabledPickerItem","pickerGradientOverlay","left","padWithNItems","durationScrollFlatList","durationScrollFlatListContainer","overflow","durationScrollFlatListContentContainer"],"sources":["styles.ts"],"sourcesContent":["import { StyleSheet } from \"react-native\";\nimport type { TextStyle, ViewStyle } from \"react-native\";\n\nexport interface CustomTimerPickerStyles {\n backgroundColor?: string;\n disabledPickerContainer?: ViewStyle;\n disabledPickerItem?: TextStyle;\n durationScrollFlatList?: ViewStyle;\n durationScrollFlatListContainer?: ViewStyle;\n durationScrollFlatListContentContainer?: ViewStyle;\n pickerAmPmContainer?: ViewStyle;\n pickerAmPmLabel?: TextStyle;\n pickerContainer?: ViewStyle & { backgroundColor?: string };\n pickerGradientOverlay?: ViewStyle;\n pickerItem?: TextStyle;\n pickerItemContainer?: ViewStyle & { height?: number };\n pickerLabel?: TextStyle;\n pickerLabelContainer?: ViewStyle;\n text?: TextStyle;\n theme?: \"light\" | \"dark\";\n}\n\nconst DARK_MODE_BACKGROUND_COLOR = \"#232323\";\nconst DARK_MODE_TEXT_COLOR = \"#E9E9E9\";\nconst LIGHT_MODE_BACKGROUND_COLOR = \"#F1F1F1\";\nconst LIGHT_MODE_TEXT_COLOR = \"#1B1B1B\";\n\nexport const generateStyles = (\n customStyles: CustomTimerPickerStyles | undefined,\n options: { padWithNItems: number }\n) =>\n StyleSheet.create({\n pickerContainer: {\n flexDirection: \"row\",\n marginRight: \"8%\",\n backgroundColor:\n customStyles?.backgroundColor ??\n (customStyles?.theme === \"dark\"\n ? DARK_MODE_BACKGROUND_COLOR\n : LIGHT_MODE_BACKGROUND_COLOR),\n ...customStyles?.pickerContainer,\n },\n pickerLabelContainer: {\n position: \"absolute\",\n right: 4,\n top: 0,\n bottom: 0,\n justifyContent: \"center\",\n minWidth:\n (customStyles?.pickerLabel?.fontSize ??\n customStyles?.text?.fontSize ??\n 25) * 0.65,\n ...customStyles?.pickerLabelContainer,\n },\n pickerLabel: {\n fontSize: 18,\n fontWeight: \"bold\",\n marginTop:\n (customStyles?.pickerItem?.fontSize ??\n customStyles?.text?.fontSize ??\n 25) / 6,\n color:\n customStyles?.theme === \"dark\"\n ? DARK_MODE_TEXT_COLOR\n : LIGHT_MODE_TEXT_COLOR,\n ...customStyles?.text,\n ...customStyles?.pickerLabel,\n },\n pickerItemContainer: {\n flexDirection: \"row\",\n height: 50,\n justifyContent: \"center\",\n alignItems: \"center\",\n width: (customStyles?.pickerItem?.fontSize ?? 25) * 3.6,\n ...customStyles?.pickerItemContainer,\n },\n pickerItem: {\n textAlignVertical: \"center\",\n fontSize: 25,\n color:\n customStyles?.theme === \"dark\"\n ? DARK_MODE_TEXT_COLOR\n : LIGHT_MODE_TEXT_COLOR,\n ...customStyles?.text,\n ...customStyles?.pickerItem,\n },\n pickerAmPmContainer: {\n position: \"absolute\",\n right: 0,\n top: 0,\n bottom: 0,\n justifyContent: \"center\",\n ...customStyles?.pickerLabelContainer,\n ...customStyles?.pickerAmPmContainer,\n },\n pickerAmPmLabel: {\n fontSize: 18,\n fontWeight: \"bold\",\n marginTop: (customStyles?.pickerItem?.fontSize ?? 25) / 6,\n color:\n customStyles?.theme === \"dark\"\n ? DARK_MODE_TEXT_COLOR\n : LIGHT_MODE_TEXT_COLOR,\n ...customStyles?.text,\n ...customStyles?.pickerLabel,\n ...customStyles?.pickerAmPmLabel,\n },\n disabledPickerContainer: {\n opacity: 0.4,\n ...customStyles?.disabledPickerContainer,\n },\n disabledPickerItem: {\n opacity: 0.2,\n ...customStyles?.disabledPickerItem,\n },\n pickerGradientOverlay: {\n position: \"absolute\",\n left: 0,\n right: 0,\n height:\n options.padWithNItems === 0\n ? \"30%\"\n : (customStyles?.pickerItemContainer?.height ?? 50) * 0.8,\n ...customStyles?.pickerGradientOverlay,\n },\n durationScrollFlatList: {\n minWidth: 1,\n ...customStyles?.durationScrollFlatList,\n },\n durationScrollFlatListContainer: {\n overflow: \"visible\",\n ...customStyles?.durationScrollFlatListContainer,\n },\n durationScrollFlatListContentContainer: {\n ...customStyles?.durationScrollFlatListContentContainer,\n },\n });\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,cAAc;AAsBzC,MAAMC,0BAA0B,GAAG,SAAS;AAC5C,MAAMC,oBAAoB,GAAG,SAAS;AACtC,MAAMC,2BAA2B,GAAG,SAAS;AAC7C,MAAMC,qBAAqB,GAAG,SAAS;AAEvC,OAAO,MAAMC,cAAc,GAAGA,CAC1BC,YAAiD,EACjDC,OAAkC;EAAA,IAAAC,qBAAA,EAAAC,kBAAA,EAAAC,qBAAA,EAAAC,mBAAA,EAAAC,sBAAA,EAAAC,sBAAA,EAAAC,sBAAA;EAAA,OAElCd,UAAU,CAACe,MAAM,CAAC;IACdC,eAAe,EAAE;MACbC,aAAa,EAAE,KAAK;MACpBC,WAAW,EAAE,IAAI;MACjBC,eAAe,EACX,CAAAb,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAEa,eAAe,MAC5B,CAAAb,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAEc,KAAK,MAAK,MAAM,GACzBnB,0BAA0B,GAC1BE,2BAA2B,CAAC;MACtC,IAAGG,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAEU,eAAe;IAC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
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
2
|
import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useRef, useState } from "react";
|
|
3
3
|
import { View, Text, TouchableOpacity } from "react-native";
|
|
4
|
+
import { getSafeInitialValue } from "../../utils/getSafeInitialValue";
|
|
4
5
|
import Modal from "../Modal";
|
|
5
6
|
import TimerPicker from "../TimerPicker";
|
|
6
7
|
import { generateStyles } from "./styles";
|
|
@@ -26,13 +27,15 @@ const TimerPickerModal = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
26
27
|
visible,
|
|
27
28
|
...otherProps
|
|
28
29
|
} = props;
|
|
29
|
-
const styles = generateStyles(customStyles
|
|
30
|
+
const styles = generateStyles(customStyles, {
|
|
31
|
+
hasModalTitle: Boolean(modalTitle)
|
|
32
|
+
});
|
|
30
33
|
const timerPickerRef = useRef(null);
|
|
31
|
-
const safeInitialValue = {
|
|
32
|
-
hours:
|
|
33
|
-
minutes:
|
|
34
|
-
seconds:
|
|
35
|
-
};
|
|
34
|
+
const safeInitialValue = getSafeInitialValue({
|
|
35
|
+
hours: initialValue === null || initialValue === void 0 ? void 0 : initialValue.hours,
|
|
36
|
+
minutes: initialValue === null || initialValue === void 0 ? void 0 : initialValue.minutes,
|
|
37
|
+
seconds: initialValue === null || initialValue === void 0 ? void 0 : initialValue.seconds
|
|
38
|
+
});
|
|
36
39
|
const [selectedDuration, setSelectedDuration] = useState(safeInitialValue);
|
|
37
40
|
const [confirmedDuration, setConfirmedDuration] = useState(safeInitialValue);
|
|
38
41
|
const reset = options => {
|
|
@@ -111,7 +114,7 @@ const TimerPickerModal = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
111
114
|
}, otherProps, {
|
|
112
115
|
aggressivelyGetLatestDuration: true,
|
|
113
116
|
onDurationChange: durationChangeHandler,
|
|
114
|
-
styles:
|
|
117
|
+
styles: styles.timerPickerStyles
|
|
115
118
|
})), /*#__PURE__*/React.createElement(View, _extends({}, buttonContainerProps, {
|
|
116
119
|
style: styles.buttonContainer
|
|
117
120
|
}), !hideCancelButton ? /*#__PURE__*/React.createElement(TouchableOpacity, _extends({}, buttonTouchableOpacityProps, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","forwardRef","useCallback","useEffect","useImperativeHandle","useRef","useState","View","Text","TouchableOpacity","Modal","TimerPicker","generateStyles","TimerPickerModal","props","ref","buttonContainerProps","buttonTouchableOpacityProps","cancelButtonText","closeOnOverlayPress","confirmButtonText","containerProps","contentContainerProps","hideCancelButton","initialValue","modalProps","modalTitle","modalTitleProps","onCancel","onConfirm","onDurationChange","setIsVisible","styles","customStyles","visible","otherProps","timerPickerRef","safeInitialValue","hours","minutes","seconds","selectedDuration","setSelectedDuration","confirmedDuration","setConfirmedDuration","reset","options","_timerPickerRef$curre","current","hideModalHandler","confirmHandler","_timerPickerRef$curre2","_latestDuration$hours","_latestDuration$minut","_latestDuration$secon","latestDuration","newDuration","cancelHandler","durationChangeHandler","duration","_timerPickerRef$curre4","_timerPickerRef$curre5","_timerPickerRef$curre6","setValue","value","_timerPickerRef$curre3","createElement","_extends","isVisible","onOverlayPress","undefined","testID","style","container","contentContainer","aggressivelyGetLatestDuration","buttonContainer","onPress","button","cancelButton","confirmButton","memo"],"sources":["index.tsx"],"sourcesContent":["import React, {\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useRef,\n useState,\n} from \"react\";\n\nimport { View, Text, TouchableOpacity } from \"react-native\";\n\nimport Modal from \"../Modal\";\nimport TimerPicker from \"../TimerPicker\";\nimport type { TimerPickerRef } from \"../TimerPicker/types\";\n\nimport { generateStyles } from \"./styles\";\nimport type { TimerPickerModalRef, TimerPickerModalProps } from \"./types\";\n\nconst TimerPickerModal = forwardRef<TimerPickerModalRef, TimerPickerModalProps>(\n (props, ref) => {\n const {\n buttonContainerProps,\n buttonTouchableOpacityProps,\n cancelButtonText = \"Cancel\",\n closeOnOverlayPress,\n confirmButtonText = \"Confirm\",\n containerProps,\n contentContainerProps,\n hideCancelButton = false,\n initialValue,\n modalProps,\n modalTitle,\n modalTitleProps,\n onCancel,\n onConfirm,\n onDurationChange,\n setIsVisible,\n styles: customStyles,\n visible,\n ...otherProps\n } = props;\n\n const styles = generateStyles(customStyles);\n\n const timerPickerRef = useRef<TimerPickerRef>(null);\n\n const safeInitialValue = {\n hours: initialValue?.hours ?? 0,\n minutes: initialValue?.minutes ?? 0,\n seconds: initialValue?.seconds ?? 0,\n };\n\n const [selectedDuration, setSelectedDuration] =\n useState(safeInitialValue);\n const [confirmedDuration, setConfirmedDuration] =\n useState(safeInitialValue);\n\n const reset = (options?: { animated?: boolean }) => {\n setSelectedDuration(safeInitialValue);\n setConfirmedDuration(safeInitialValue);\n timerPickerRef.current?.reset(options);\n };\n\n // reset state if the initial value changes\n useEffect(() => {\n reset();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n safeInitialValue.hours,\n safeInitialValue.minutes,\n safeInitialValue.seconds,\n ]);\n\n const hideModalHandler = () => {\n setSelectedDuration({\n hours: confirmedDuration.hours,\n minutes: confirmedDuration.minutes,\n seconds: confirmedDuration.seconds,\n });\n setIsVisible(false);\n };\n\n const confirmHandler = () => {\n const latestDuration = timerPickerRef.current?.latestDuration;\n\n const newDuration = {\n hours: latestDuration?.hours?.current ?? selectedDuration.hours,\n minutes:\n latestDuration?.minutes?.current ??\n selectedDuration.minutes,\n seconds:\n latestDuration?.seconds?.current ??\n selectedDuration.seconds,\n };\n setConfirmedDuration(newDuration);\n onConfirm(newDuration);\n };\n\n const cancelHandler = () => {\n setIsVisible(false);\n setSelectedDuration(confirmedDuration);\n onCancel?.();\n };\n\n // wrapped in useCallback to avoid unnecessary re-renders of TimerPicker\n const durationChangeHandler = useCallback(\n (duration: { hours: number; minutes: number; seconds: number }) => {\n setSelectedDuration(duration);\n onDurationChange?.(duration);\n },\n [onDurationChange]\n );\n\n useImperativeHandle(ref, () => ({\n reset,\n setValue: (value, options) => {\n setSelectedDuration(value);\n setConfirmedDuration(value);\n timerPickerRef.current?.setValue(value, options);\n },\n latestDuration: {\n hours: timerPickerRef.current?.latestDuration?.hours,\n minutes: timerPickerRef.current?.latestDuration?.minutes,\n seconds: timerPickerRef.current?.latestDuration?.seconds,\n },\n }));\n\n return (\n <Modal\n isVisible={visible}\n onOverlayPress={\n closeOnOverlayPress ? hideModalHandler : undefined\n }\n {...modalProps}\n testID=\"timer-picker-modal\">\n <View {...containerProps} style={styles.container}>\n <View\n {...contentContainerProps}\n style={styles.contentContainer}>\n {modalTitle ? (\n <Text\n {...modalTitleProps}\n style={styles.modalTitle}>\n {modalTitle}\n </Text>\n ) : null}\n <TimerPicker\n ref={timerPickerRef}\n initialValue={confirmedDuration}\n {...otherProps}\n aggressivelyGetLatestDuration\n onDurationChange={durationChangeHandler}\n styles={customStyles}\n />\n <View\n {...buttonContainerProps}\n style={styles.buttonContainer}>\n {!hideCancelButton ? (\n <TouchableOpacity\n {...buttonTouchableOpacityProps}\n onPress={cancelHandler}>\n <Text\n style={[\n styles.button,\n styles.cancelButton,\n ]}>\n {cancelButtonText}\n </Text>\n </TouchableOpacity>\n ) : null}\n <TouchableOpacity\n {...buttonTouchableOpacityProps}\n onPress={confirmHandler}>\n <Text\n style={[\n styles.button,\n styles.confirmButton,\n ]}>\n {confirmButtonText}\n </Text>\n </TouchableOpacity>\n </View>\n </View>\n </View>\n </Modal>\n );\n }\n);\n\nexport default React.memo(TimerPickerModal);\n"],"mappings":";AAAA,OAAOA,KAAK,IACRC,UAAU,EACVC,WAAW,EACXC,SAAS,EACTC,mBAAmB,EACnBC,MAAM,EACNC,QAAQ,QACL,OAAO;AAEd,SAASC,IAAI,EAAEC,IAAI,EAAEC,gBAAgB,QAAQ,cAAc;AAE3D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C/B4D,OAAO,EAAEpB;EAAc,iBACvBzD,KAAA,CAAAkE,aAAA,CAAC1D,IAAI;IACDgE,KAAK,EAAE,CACHxC,MAAM,CAAC8C,MAAM,EACb9C,MAAM,CAAC+C,YAAY;EACrB,GACD7D,gBACC,CACQ,CAAC,GACnB,IAAI,eACRlB,KAAA,CAAAkE,aAAA,CAACzD,gBAAgB,EAAA0D,QAAA,KACTlD,2BAA2B;IAC/B4D,OAAO,EAAE3B;EAAe,iBACxBlD,KAAA,CAAAkE,aAAA,CAAC1D,IAAI;IACDgE,KAAK,EAAE,CACHxC,MAAM,CAAC8C,MAAM,EACb9C,MAAM,CAACgD,aAAa;EACtB,GACD5D,iBACC,CACQ,CAChB,CACJ,CACJ,CACH,CAAC;AAEhB,CACJ,CAAC;AAED,4BAAepB,KAAK,CAACiF,IAAI,CAACpE,gBAAgB,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","forwardRef","useCallback","useEffect","useImperativeHandle","useRef","useState","View","Text","TouchableOpacity","getSafeInitialValue","Modal","TimerPicker","generateStyles","TimerPickerModal","props","ref","buttonContainerProps","buttonTouchableOpacityProps","cancelButtonText","closeOnOverlayPress","confirmButtonText","containerProps","contentContainerProps","hideCancelButton","initialValue","modalProps","modalTitle","modalTitleProps","onCancel","onConfirm","onDurationChange","setIsVisible","styles","customStyles","visible","otherProps","hasModalTitle","Boolean","timerPickerRef","safeInitialValue","hours","minutes","seconds","selectedDuration","setSelectedDuration","confirmedDuration","setConfirmedDuration","reset","options","_timerPickerRef$curre","current","hideModalHandler","confirmHandler","_timerPickerRef$curre2","_latestDuration$hours","_latestDuration$minut","_latestDuration$secon","latestDuration","newDuration","cancelHandler","durationChangeHandler","duration","_timerPickerRef$curre4","_timerPickerRef$curre5","_timerPickerRef$curre6","setValue","value","_timerPickerRef$curre3","createElement","_extends","isVisible","onOverlayPress","undefined","testID","style","container","contentContainer","aggressivelyGetLatestDuration","timerPickerStyles","buttonContainer","onPress","button","cancelButton","confirmButton","memo"],"sources":["index.tsx"],"sourcesContent":["import React, {\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useRef,\n useState,\n} from \"react\";\n\nimport { View, Text, TouchableOpacity } from \"react-native\";\n\nimport { getSafeInitialValue } from \"../../utils/getSafeInitialValue\";\nimport Modal from \"../Modal\";\nimport TimerPicker from \"../TimerPicker\";\nimport type { TimerPickerRef } from \"../TimerPicker/types\";\n\nimport { generateStyles } from \"./styles\";\nimport type { TimerPickerModalRef, TimerPickerModalProps } from \"./types\";\n\nconst TimerPickerModal = forwardRef<TimerPickerModalRef, TimerPickerModalProps>(\n (props, ref) => {\n const {\n buttonContainerProps,\n buttonTouchableOpacityProps,\n cancelButtonText = \"Cancel\",\n closeOnOverlayPress,\n confirmButtonText = \"Confirm\",\n containerProps,\n contentContainerProps,\n hideCancelButton = false,\n initialValue,\n modalProps,\n modalTitle,\n modalTitleProps,\n onCancel,\n onConfirm,\n onDurationChange,\n setIsVisible,\n styles: customStyles,\n visible,\n ...otherProps\n } = props;\n\n const styles = generateStyles(customStyles, {\n hasModalTitle: Boolean(modalTitle),\n });\n\n const timerPickerRef = useRef<TimerPickerRef>(null);\n\n const safeInitialValue = getSafeInitialValue({\n hours: initialValue?.hours,\n minutes: initialValue?.minutes,\n seconds: initialValue?.seconds,\n });\n\n const [selectedDuration, setSelectedDuration] =\n useState(safeInitialValue);\n const [confirmedDuration, setConfirmedDuration] =\n useState(safeInitialValue);\n\n const reset = (options?: { animated?: boolean }) => {\n setSelectedDuration(safeInitialValue);\n setConfirmedDuration(safeInitialValue);\n timerPickerRef.current?.reset(options);\n };\n\n // reset state if the initial value changes\n useEffect(() => {\n reset();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n safeInitialValue.hours,\n safeInitialValue.minutes,\n safeInitialValue.seconds,\n ]);\n\n const hideModalHandler = () => {\n setSelectedDuration({\n hours: confirmedDuration.hours,\n minutes: confirmedDuration.minutes,\n seconds: confirmedDuration.seconds,\n });\n setIsVisible(false);\n };\n\n const confirmHandler = () => {\n const latestDuration = timerPickerRef.current?.latestDuration;\n\n const newDuration = {\n hours: latestDuration?.hours?.current ?? selectedDuration.hours,\n minutes:\n latestDuration?.minutes?.current ??\n selectedDuration.minutes,\n seconds:\n latestDuration?.seconds?.current ??\n selectedDuration.seconds,\n };\n setConfirmedDuration(newDuration);\n onConfirm(newDuration);\n };\n\n const cancelHandler = () => {\n setIsVisible(false);\n setSelectedDuration(confirmedDuration);\n onCancel?.();\n };\n\n // wrapped in useCallback to avoid unnecessary re-renders of TimerPicker\n const durationChangeHandler = useCallback(\n (duration: { hours: number; minutes: number; seconds: number }) => {\n setSelectedDuration(duration);\n onDurationChange?.(duration);\n },\n [onDurationChange]\n );\n\n useImperativeHandle(ref, () => ({\n reset,\n setValue: (value, options) => {\n setSelectedDuration(value);\n setConfirmedDuration(value);\n timerPickerRef.current?.setValue(value, options);\n },\n latestDuration: {\n hours: timerPickerRef.current?.latestDuration?.hours,\n minutes: timerPickerRef.current?.latestDuration?.minutes,\n seconds: timerPickerRef.current?.latestDuration?.seconds,\n },\n }));\n\n return (\n <Modal\n isVisible={visible}\n onOverlayPress={\n closeOnOverlayPress ? hideModalHandler : undefined\n }\n {...modalProps}\n testID=\"timer-picker-modal\">\n <View {...containerProps} style={styles.container}>\n <View\n {...contentContainerProps}\n style={styles.contentContainer}>\n {modalTitle ? (\n <Text\n {...modalTitleProps}\n style={styles.modalTitle}>\n {modalTitle}\n </Text>\n ) : null}\n <TimerPicker\n ref={timerPickerRef}\n initialValue={confirmedDuration}\n {...otherProps}\n aggressivelyGetLatestDuration\n onDurationChange={durationChangeHandler}\n styles={styles.timerPickerStyles}\n />\n <View\n {...buttonContainerProps}\n style={styles.buttonContainer}>\n {!hideCancelButton ? (\n <TouchableOpacity\n {...buttonTouchableOpacityProps}\n onPress={cancelHandler}>\n <Text\n style={[\n styles.button,\n styles.cancelButton,\n ]}>\n {cancelButtonText}\n </Text>\n </TouchableOpacity>\n ) : null}\n <TouchableOpacity\n {...buttonTouchableOpacityProps}\n onPress={confirmHandler}>\n <Text\n style={[\n styles.button,\n styles.confirmButton,\n ]}>\n {confirmButtonText}\n </Text>\n </TouchableOpacity>\n </View>\n </View>\n </View>\n </Modal>\n );\n }\n);\n\nexport default React.memo(TimerPickerModal);\n"],"mappings":";AAAA,OAAOA,KAAK,IACRC,UAAU,EACVC,WAAW,EACXC,SAAS,EACTC,mBAAmB,EACnBC,MAAM,EACNC,QAAQ,QACL,OAAO;AAEd,SAASC,IAAI,EAAEC,IAAI,EAAEC,gBAAgB,QAAQ,cAAc;AAE3D,SAASC,mBAAmB,QAAQ,iCAAiC;AACrE,OAAOC,KAAK,MAAM,UAAU;AAC5B,OAAOC,WAAW,MAAM,gBAAgB;AAGxC,SAASC,cAAc,QAAQ,UAAU;AAGzC,MAAMC,gBAAgB,gBAAGb,UAAU,CAC/B,CAACc,KAAK,EAAEC,GAAG,KAAK;EACZ,MAAM;IACFC,oBAAoB;IACpBC,2BAA2B;IAC3BC,gBAAgB,GAAG,QAAQ;IAC3BC,mBAAmB;IACnBC,iBAAiB,GAAG,SAAS;IAC7BC,cAAc;IACdC,qBAAqB;IACrBC,gBAAgB,GAAG,KAAK;IACxBC,YAAY;IACZC,UAAU;IACVC,UAAU;IACVC,eAAe;IACfC,QAAQ;IACRC,SAAS;IACTC,gBAAgB;IAChBC,YAAY;IACZC,MAAM,EAAEC,YAAY;IACpBC,OAAO;IACP,GAAGC;EACP,CAAC,GAAGrB,KAAK;EAET,MAAMkB,MAAM,GAAGpB,cAAc,CAACqB,YAAY,EAAE;IACxCG,aAAa,EAAEC,OAAO,CAACX,UAAU;EACrC,CAAC,CAAC;EAEF,MAAMY,cAAc,GAAGlC,MAAM,CAAiB,IAAI,CAAC;EAEnD,MAAMmC,gBAAgB,GAAG9B,mBAAmB,CAAC;IACzC+B,KAAK,EAAEhB,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAEgB,KAAK;IAC1BC,OAAO,E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C,CAAC,GACP,IAAI,eACR3B,KAAA,CAAAqE,aAAA,CAACzD,WAAW,EAAA0D,QAAA;IACRtD,GAAG,EAAEuB,cAAe;IACpBd,YAAY,EAAEqB;EAAkB,GAC5BV,UAAU;IACd0C,6BAA6B;IAC7B/C,gBAAgB,EAAE8B,qBAAsB;IACxC5B,MAAM,EAAEA,MAAM,CAAC8C;EAAkB,EACpC,CAAC,eACF/E,KAAA,CAAAqE,aAAA,CAAC9D,IAAI,EAAA+D,QAAA,KACGrD,oBAAoB;IACxB0D,KAAK,EAAE1C,MAAM,CAAC+C;EAAgB,IAC7B,CAACxD,gBAAgB,gBACdxB,KAAA,CAAAqE,aAAA,CAAC5D,gBAAgB,EAAA6D,QAAA,KACTpD,2BAA2B;IAC/B+D,OAAO,EAAErB;EAAc,iBACvB5D,KAAA,CAAAqE,aAAA,CAAC7D,IAAI;IACDmE,KAAK,EAAE,CACH1C,MAAM,CAACiD,MAAM,EACbjD,MAAM,CAACkD,YAAY;EACrB,GACDhE,gBACC,CACQ,CAAC,GACnB,IAAI,eACRnB,KAAA,CAAAqE,aAAA,CAAC5D,gBAAgB,EAAA6D,QAAA,KACTpD,2BAA2B;IAC/B+D,OAAO,EAAE5B;EAAe,iBACxBrD,KAAA,CAAAqE,aAAA,CAAC7D,IAAI;IACDmE,KAAK,EAAE,CACH1C,MAAM,CAACiD,MAAM,EACbjD,MAAM,CAACmD,aAAa;EACtB,GACD/D,iBACC,CACQ,CAChB,CACJ,CACJ,CACH,CAAC;AAEhB,CACJ,CAAC;AAED,4BAAerB,KAAK,CAACqF,IAAI,CAACvE,gBAAgB,CAAC","ignoreList":[]}
|
|
@@ -3,58 +3,91 @@ const DARK_MODE_BACKGROUND_COLOR = "#232323";
|
|
|
3
3
|
const DARK_MODE_TEXT_COLOR = "#E9E9E9";
|
|
4
4
|
const LIGHT_MODE_BACKGROUND_COLOR = "#F1F1F1";
|
|
5
5
|
const LIGHT_MODE_TEXT_COLOR = "#1B1B1B";
|
|
6
|
-
export const generateStyles = customStyles =>
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
6
|
+
export const generateStyles = (customStyles, variables) => {
|
|
7
|
+
const {
|
|
8
|
+
button: customButtonStyle,
|
|
9
|
+
buttonContainer: customButtonContainerStyle,
|
|
10
|
+
cancelButton: customCancelButtonStyle,
|
|
11
|
+
confirmButton: customConfirmButtonStyle,
|
|
12
|
+
container: customContainerStyle,
|
|
13
|
+
contentContainer: customContentContainerStyle,
|
|
14
|
+
modalTitle: customModalTitleStyle,
|
|
15
|
+
...customTimerPickerStyles
|
|
16
|
+
} = customStyles ?? {};
|
|
17
|
+
return StyleSheet.create({
|
|
18
|
+
container: {
|
|
19
|
+
justifyContent: "center",
|
|
20
|
+
overflow: "hidden",
|
|
21
|
+
...customContainerStyle,
|
|
22
|
+
// disable setting alignItems here because it can affect
|
|
23
|
+
// the FlatList's ability to calculate its layout, which can
|
|
24
|
+
// stop snapToOffsets working properly
|
|
25
|
+
alignItems: undefined
|
|
26
|
+
},
|
|
27
|
+
contentContainer: {
|
|
28
|
+
backgroundColor: (customTimerPickerStyles === null || customTimerPickerStyles === void 0 ? void 0 : customTimerPickerStyles.backgroundColor) ?? ((customTimerPickerStyles === null || customTimerPickerStyles === void 0 ? void 0 : customTimerPickerStyles.theme) === "dark" ? DARK_MODE_BACKGROUND_COLOR : LIGHT_MODE_BACKGROUND_COLOR),
|
|
29
|
+
justifyContent: "center",
|
|
30
|
+
alignItems: "center",
|
|
31
|
+
borderRadius: 20,
|
|
32
|
+
overflow: "hidden",
|
|
33
|
+
...customContentContainerStyle,
|
|
34
|
+
// disable setting padding here because it can affect
|
|
35
|
+
// the FlatList's ability to calculate its layout, which can
|
|
36
|
+
// stop snapToOffsets working properly
|
|
37
|
+
paddingHorizontal: 0,
|
|
38
|
+
paddingVertical: 0
|
|
39
|
+
},
|
|
40
|
+
buttonContainer: {
|
|
41
|
+
flexDirection: "row",
|
|
42
|
+
marginTop: 25,
|
|
43
|
+
marginBottom: 20,
|
|
44
|
+
...customButtonContainerStyle
|
|
45
|
+
},
|
|
46
|
+
button: {
|
|
47
|
+
marginHorizontal: 12,
|
|
48
|
+
paddingVertical: 10,
|
|
49
|
+
paddingHorizontal: 20,
|
|
50
|
+
borderWidth: 1,
|
|
51
|
+
borderRadius: 10,
|
|
52
|
+
fontSize: 16,
|
|
53
|
+
overflow: "hidden",
|
|
54
|
+
...(customTimerPickerStyles === null || customTimerPickerStyles === void 0 ? void 0 : customTimerPickerStyles.text),
|
|
55
|
+
...customButtonStyle
|
|
56
|
+
},
|
|
57
|
+
cancelButton: {
|
|
58
|
+
borderColor: "gray",
|
|
59
|
+
color: (customTimerPickerStyles === null || customTimerPickerStyles === void 0 ? void 0 : customTimerPickerStyles.theme) === "dark" ? DARK_MODE_TEXT_COLOR : "gray",
|
|
60
|
+
backgroundColor: (customTimerPickerStyles === null || customTimerPickerStyles === void 0 ? void 0 : customTimerPickerStyles.theme) === "dark" ? "gray" : undefined,
|
|
61
|
+
...(customTimerPickerStyles === null || customTimerPickerStyles === void 0 ? void 0 : customTimerPickerStyles.text),
|
|
62
|
+
...customCancelButtonStyle
|
|
63
|
+
},
|
|
64
|
+
confirmButton: {
|
|
65
|
+
borderColor: "green",
|
|
66
|
+
color: (customTimerPickerStyles === null || customTimerPickerStyles === void 0 ? void 0 : customTimerPickerStyles.theme) === "dark" ? DARK_MODE_TEXT_COLOR : "green",
|
|
67
|
+
backgroundColor: (customTimerPickerStyles === null || customTimerPickerStyles === void 0 ? void 0 : customTimerPickerStyles.theme) === "dark" ? "green" : undefined,
|
|
68
|
+
...(customTimerPickerStyles === null || customTimerPickerStyles === void 0 ? void 0 : customTimerPickerStyles.text),
|
|
69
|
+
...customConfirmButtonStyle
|
|
70
|
+
},
|
|
71
|
+
modalTitle: {
|
|
72
|
+
fontSize: 24,
|
|
73
|
+
fontWeight: "600",
|
|
74
|
+
marginTop: 20,
|
|
75
|
+
marginBottom: 15,
|
|
76
|
+
color: (customTimerPickerStyles === null || customTimerPickerStyles === void 0 ? void 0 : customTimerPickerStyles.theme) === "dark" ? DARK_MODE_TEXT_COLOR : LIGHT_MODE_TEXT_COLOR,
|
|
77
|
+
...(customTimerPickerStyles === null || customTimerPickerStyles === void 0 ? void 0 : customTimerPickerStyles.text),
|
|
78
|
+
...customModalTitleStyle
|
|
79
|
+
},
|
|
80
|
+
timerPickerStyles: {
|
|
81
|
+
...customTimerPickerStyles,
|
|
82
|
+
pickerContainer: {
|
|
83
|
+
// set padding here instead of on modal content container because it can affect
|
|
84
|
+
// the FlatList's ability to calculate its layout, which can
|
|
85
|
+
// stop snapToOffsets working properly
|
|
86
|
+
paddingHorizontal: 20,
|
|
87
|
+
paddingTop: !(variables !== null && variables !== void 0 && variables.hasModalTitle) ? 20 : 0,
|
|
88
|
+
...((customTimerPickerStyles === null || customTimerPickerStyles === void 0 ? void 0 : customTimerPickerStyles.pickerContainer) ?? {})
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
};
|
|
60
93
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["StyleSheet","DARK_MODE_BACKGROUND_COLOR","DARK_MODE_TEXT_COLOR","LIGHT_MODE_BACKGROUND_COLOR","LIGHT_MODE_TEXT_COLOR","generateStyles","customStyles","
|
|
1
|
+
{"version":3,"names":["StyleSheet","DARK_MODE_BACKGROUND_COLOR","DARK_MODE_TEXT_COLOR","LIGHT_MODE_BACKGROUND_COLOR","LIGHT_MODE_TEXT_COLOR","generateStyles","customStyles","variables","button","customButtonStyle","buttonContainer","customButtonContainerStyle","cancelButton","customCancelButtonStyle","confirmButton","customConfirmButtonStyle","container","customContainerStyle","contentContainer","customContentContainerStyle","modalTitle","customModalTitleStyle","customTimerPickerStyles","create","justifyContent","overflow","alignItems","undefined","backgroundColor","theme","borderRadius","paddingHorizontal","paddingVertical","flexDirection","marginTop","marginBottom","marginHorizontal","borderWidth","fontSize","text","borderColor","color","fontWeight","timerPickerStyles","pickerContainer","paddingTop","hasModalTitle"],"sources":["styles.ts"],"sourcesContent":["import { StyleSheet } from \"react-native\";\nimport type { TextStyle, ViewStyle } from \"react-native\";\n\nimport type { CustomTimerPickerStyles } from \"../TimerPicker/styles\";\n\nexport interface CustomTimerPickerModalStyles extends CustomTimerPickerStyles {\n button?: TextStyle;\n buttonContainer?: ViewStyle;\n cancelButton?: TextStyle;\n confirmButton?: TextStyle;\n container?: ViewStyle;\n contentContainer?: ViewStyle;\n modalTitle?: TextStyle;\n}\n\nconst DARK_MODE_BACKGROUND_COLOR = \"#232323\";\nconst DARK_MODE_TEXT_COLOR = \"#E9E9E9\";\nconst LIGHT_MODE_BACKGROUND_COLOR = \"#F1F1F1\";\nconst LIGHT_MODE_TEXT_COLOR = \"#1B1B1B\";\n\nexport const generateStyles = (\n customStyles: CustomTimerPickerModalStyles | undefined,\n variables?: {\n hasModalTitle: boolean;\n }\n) => {\n const {\n button: customButtonStyle,\n buttonContainer: customButtonContainerStyle,\n cancelButton: customCancelButtonStyle,\n confirmButton: customConfirmButtonStyle,\n container: customContainerStyle,\n contentContainer: customContentContainerStyle,\n modalTitle: customModalTitleStyle,\n ...customTimerPickerStyles\n } = customStyles ?? {};\n\n return StyleSheet.create({\n container: {\n justifyContent: \"center\",\n overflow: \"hidden\",\n ...customContainerStyle,\n // disable setting alignItems here because it can affect\n // the FlatList's ability to calculate its layout, which can\n // stop snapToOffsets working properly\n alignItems: undefined,\n },\n contentContainer: {\n backgroundColor:\n customTimerPickerStyles?.backgroundColor ??\n (customTimerPickerStyles?.theme === \"dark\"\n ? DARK_MODE_BACKGROUND_COLOR\n : LIGHT_MODE_BACKGROUND_COLOR),\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: 20,\n overflow: \"hidden\",\n ...customContentContainerStyle,\n // disable setting padding here because it can affect\n // the FlatList's ability to calculate its layout, which can\n // stop snapToOffsets working properly\n paddingHorizontal: 0,\n paddingVertical: 0,\n },\n buttonContainer: {\n flexDirection: \"row\",\n marginTop: 25,\n marginBottom: 20,\n ...customButtonContainerStyle,\n },\n button: {\n marginHorizontal: 12,\n paddingVertical: 10,\n paddingHorizontal: 20,\n borderWidth: 1,\n borderRadius: 10,\n fontSize: 16,\n overflow: \"hidden\",\n ...customTimerPickerStyles?.text,\n ...customButtonStyle,\n },\n cancelButton: {\n borderColor: \"gray\",\n color:\n customTimerPickerStyles?.theme === \"dark\"\n ? DARK_MODE_TEXT_COLOR\n : \"gray\",\n backgroundColor:\n customTimerPickerStyles?.theme === \"dark\" ? \"gray\" : undefined,\n ...customTimerPickerStyles?.text,\n ...customCancelButtonStyle,\n },\n confirmButton: {\n borderColor: \"green\",\n color:\n customTimerPickerStyles?.theme === \"dark\"\n ? DARK_MODE_TEXT_COLOR\n : \"green\",\n backgroundColor:\n customTimerPickerStyles?.theme === \"dark\" ? \"green\" : undefined,\n ...customTimerPickerStyles?.text,\n ...customConfirmButtonStyle,\n },\n modalTitle: {\n fontSize: 24,\n fontWeight: \"600\",\n marginTop: 20,\n marginBottom: 15,\n color:\n customTimerPickerStyles?.theme === \"dark\"\n ? DARK_MODE_TEXT_COLOR\n : LIGHT_MODE_TEXT_COLOR,\n ...customTimerPickerStyles?.text,\n ...customModalTitleStyle,\n },\n timerPickerStyles: {\n ...customTimerPickerStyles,\n pickerContainer: {\n // set padding here instead of on modal content container because it can affect\n // the FlatList's ability to calculate its layout, which can\n // stop snapToOffsets working properly\n paddingHorizontal: 20,\n paddingTop: !variables?.hasModalTitle ? 20 : 0,\n ...(customTimerPickerStyles?.pickerContainer ?? {}),\n },\n },\n });\n};\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,cAAc;AAezC,MAAMC,0BAA0B,GAAG,SAAS;AAC5C,MAAMC,oBAAoB,GAAG,SAAS;AACtC,MAAMC,2BAA2B,GAAG,SAAS;AAC7C,MAAMC,qBAAqB,GAAG,SAAS;AAEvC,OAAO,MAAMC,cAAc,GAAGA,CAC1BC,YAAsD,EACtDC,SAEC,KACA;EACD,MAAM;IACFC,MAAM,EAAEC,iBAAiB;IACzBC,eAAe,EAAEC,0BAA0B;IAC3CC,YAAY,EAAEC,uBAAuB;IACrCC,aAAa,EAAEC,wBAAwB;IACvCC,SAAS,EAAEC,oBAAoB;IAC/BC,gBAAgB,EAAEC,2BAA2B;IAC7CC,UAAU,EAAEC,qBAAqB;IACjC,GAAGC;EACP,CAAC,GAAGhB,YAAY,IAAI,CAAC,CAAC;EAEtB,OAAON,UAAU,CAACuB,MAAM,CAAC;IACrBP,SAAS,EAAE;MACPQ,cAAc,EAAE,QAAQ;MACxBC,QAAQ,EAAE,QAAQ;MAClB,GAAGR,oBAAoB;MACvB;MACA;MACA;MACAS,UAAU,EAAEC;IAChB,CAAC;IACDT,gBAAgB,EAAE;MACdU,eAAe,EACX,CAAAN,uBAAuB,aAAvBA,uBAAuB,uBAAvBA,uBAAuB,CAAEM,eAAe,MACvC,CAAAN,uBAAuB,aAAvBA,uBAAuB,uBAAvBA,uB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,GACpB,OAAO;MACjB0B,eAAe,EACX,CAAAN,uBAAuB,aAAvBA,uBAAuB,uBAAvBA,uBAAuB,CAAEO,KAAK,MAAK,MAAM,GAAG,OAAO,GAAGF,SAAS;MACnE,IAAGL,uBAAuB,aAAvBA,uBAAuB,uBAAvBA,uBAAuB,CAAEiB,IAAI;MAChC,GAAGxB;IACP,CAAC;IACDK,UAAU,EAAE;MACRkB,QAAQ,EAAE,EAAE;MACZI,UAAU,EAAE,KAAK;MACjBR,SAAS,EAAE,EAAE;MACbC,YAAY,EAAE,EAAE;MAChBM,KAAK,EACD,CAAAnB,uBAAuB,aAAvBA,uBAAuB,uBAAvBA,uBAAuB,CAAEO,KAAK,MAAK,MAAM,GACnC3B,oBAAoB,GACpBE,qBAAqB;MAC/B,IAAGkB,uBAAuB,aAAvBA,uBAAuB,uBAAvBA,uBAAuB,CAAEiB,IAAI;MAChC,GAAGlB;IACP,CAAC;IACDsB,iBAAiB,EAAE;MACf,GAAGrB,uBAAuB;MAC1BsB,eAAe,EAAE;QACb;QACA;QACA;QACAb,iBAAiB,EAAE,EAAE;QACrBc,UAAU,EAAE,EAACtC,SAAS,aAATA,SAAS,eAATA,SAAS,CAAEuC,aAAa,IAAG,EAAE,GAAG,CAAC;QAC9C,IAAI,CAAAxB,uBAAuB,aAAvBA,uBAAuB,uBAAvBA,uBAAuB,CAAEsB,eAAe,KAAI,CAAC,CAAC;MACtD;IACJ;EACJ,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export const getSafeInitialValue = initialValue => ({
|
|
2
|
+
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,
|
|
3
|
+
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,
|
|
4
|
+
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
|
|
5
|
+
});
|
|
6
|
+
//# sourceMappingURL=getSafeInitialValue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getSafeInitialValue","initialValue","hours","isNaN","minutes","seconds"],"sources":["getSafeInitialValue.ts"],"sourcesContent":["export const getSafeInitialValue = (\n initialValue:\n | {\n hours?: number;\n minutes?: number;\n seconds?: number;\n }\n | undefined\n) => ({\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,OAAO,MAAMA,mBAAmB,GAC5BC,YAMe,KACb;EACFC,KAAK,EACD,QAAOD,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAEC,KAAK,MAAK,QAAQ,IAAI,CAACC,KAAK,CAACF,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAEC,KAAK,CAAC,GAChED,YAAY,CAACC,KAAK,GAClB,CAAC;EACXE,OAAO,EACH,QAAOH,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAEG,OAAO,MAAK,QAAQ,IACzC,CAACD,KAAK,CAACF,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAEG,OAAO,CAAC,GACvBH,YAAY,CAACG,OAAO,GACpB,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;AACd,CAAC,CAAC","ignoreList":[]}
|