react-native-paper-dates 0.10.0 → 0.10.1
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/lib/commonjs/Date/DatePickerInputWithoutModal.js +1 -2
- package/lib/commonjs/Date/DatePickerInputWithoutModal.js.map +1 -1
- package/lib/module/Date/DatePickerInputWithoutModal.js +1 -2
- package/lib/module/Date/DatePickerInputWithoutModal.js.map +1 -1
- package/package.json +1 -1
- package/src/Date/DatePickerInputWithoutModal.tsx +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["DatePickerInputWithoutModal","ref","label","value","onChange","style","locale","validRange","inputMode","withDateFormatInLabel","modal","inputButtons","saveLabel","rest","theme","useTheme","formattedValue","inputFormat","onChangeText","error","useDateInput","styles","root","inputContainer","getLabel","dark","input","helperText","StyleSheet","create","flexGrow","
|
|
1
|
+
{"version":3,"names":["DatePickerInputWithoutModal","ref","label","value","onChange","style","locale","validRange","inputMode","withDateFormatInLabel","modal","inputButtons","saveLabel","rest","theme","useTheme","formattedValue","inputFormat","onChangeText","error","useDateInput","styles","root","inputContainer","getLabel","dark","input","helperText","StyleSheet","create","flexGrow","flexDirection","alignItems","justifyContent","React","forwardRef"],"sources":["DatePickerInputWithoutModal.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport TextInputWithMask from '../TextInputMask'\nimport { HelperText, useTheme } from 'react-native-paper'\nimport { View, StyleSheet } from 'react-native'\nimport useDateInput from './inputUtils'\nimport type { DatePickerInputProps } from './DatePickerInput.shared'\n\nfunction DatePickerInputWithoutModal(\n {\n label,\n value,\n onChange,\n style,\n locale,\n validRange,\n inputMode,\n withDateFormatInLabel = true,\n modal,\n inputButtons,\n saveLabel,\n ...rest\n }: DatePickerInputProps & {\n modal?: (params: {\n value: DatePickerInputProps['value']\n locale: DatePickerInputProps['locale']\n inputMode: DatePickerInputProps['inputMode']\n validRange: DatePickerInputProps['validRange']\n saveLabel: DatePickerInputProps['saveLabel']\n }) => any\n inputButtons?: any\n },\n ref: any\n) {\n const theme = useTheme()\n const { formattedValue, inputFormat, onChangeText, error } = useDateInput({\n locale,\n value,\n validRange,\n inputMode,\n onChange,\n })\n\n return (\n <>\n <View style={styles.root}>\n <View style={styles.inputContainer}>\n <TextInputWithMask\n {...rest}\n ref={ref}\n label={getLabel({\n // TODO: support label components?\n label: label as any,\n inputFormat,\n withDateFormatInLabel,\n })}\n value={formattedValue}\n keyboardType={'number-pad'}\n placeholder={inputFormat}\n mask={inputFormat}\n onChangeText={onChangeText}\n keyboardAppearance={theme.dark ? 'dark' : 'default'}\n error={!!error}\n style={[styles.input, style]}\n />\n {inputButtons}\n </View>\n {error ? (\n <HelperText style={styles.helperText} type=\"error\" visible={!!error}>\n {error}\n </HelperText>\n ) : null}\n </View>\n {modal?.({ value, locale, inputMode, validRange, saveLabel })}\n </>\n )\n}\n\nfunction getLabel({\n withDateFormatInLabel,\n inputFormat,\n label,\n}: {\n withDateFormatInLabel: boolean\n inputFormat: string\n label: string | undefined\n}) {\n if (withDateFormatInLabel) {\n return label ? `${label} (${inputFormat})` : inputFormat\n }\n return label || ''\n}\n\nconst styles = StyleSheet.create({\n root: {\n flexGrow: 1,\n },\n inputContainer: {\n flexGrow: 1,\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'flex-start',\n },\n input: {\n flexGrow: 1,\n },\n helperText: {\n // flex: 1,\n },\n})\nexport default React.forwardRef(DatePickerInputWithoutModal)\n"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;;;;;;;;;AAGA,SAASA,2BAAT,OAwBEC,GAxBF,EAyBE;EAAA,IAxBA;IACEC,KADF;IAEEC,KAFF;IAGEC,QAHF;IAIEC,KAJF;IAKEC,MALF;IAMEC,UANF;IAOEC,SAPF;IAQEC,qBAAqB,GAAG,IAR1B;IASEC,KATF;IAUEC,YAVF;IAWEC,SAXF;IAYE,GAAGC;EAZL,CAwBA;EACA,MAAMC,KAAK,GAAG,IA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AIO,qBAAJ,EAA2B;IACzB,OAAOP,KAAK,GAAI,GAAEA,KAAM,KAAIe,WAAY,GAA5B,GAAiCA,WAA7C;EACD;;EACD,OAAOf,KAAK,IAAI,EAAhB;AACD;;AAED,MAAMmB,MAAM,GAAGO,uBAAA,CAAWC,MAAX,CAAkB;EAC/BP,IAAI,EAAE;IACJQ,QAAQ,EAAE;EADN,CADyB;EAI/BP,cAAc,EAAE;IACdO,QAAQ,EAAE,CADI;IAEdC,aAAa,EAAE,KAFD;IAGdC,UAAU,EAAE,QAHE;IAIdC,cAAc,EAAE;EAJF,CAJe;EAU/BP,KAAK,EAAE;IACLI,QAAQ,EAAE;EADL,CAVwB;EAa/BH,UAAU,EAAE,CACV;EADU;AAbmB,CAAlB,CAAf;;4BAiBeO,KAAK,CAACC,UAAN,CAAiBnC,2BAAjB,C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","TextInputWithMask","HelperText","useTheme","View","StyleSheet","useDateInput","DatePickerInputWithoutModal","ref","label","value","onChange","style","locale","validRange","inputMode","withDateFormatInLabel","modal","inputButtons","saveLabel","rest","theme","formattedValue","inputFormat","onChangeText","error","styles","root","inputContainer","getLabel","dark","input","helperText","create","flexGrow","
|
|
1
|
+
{"version":3,"names":["React","TextInputWithMask","HelperText","useTheme","View","StyleSheet","useDateInput","DatePickerInputWithoutModal","ref","label","value","onChange","style","locale","validRange","inputMode","withDateFormatInLabel","modal","inputButtons","saveLabel","rest","theme","formattedValue","inputFormat","onChangeText","error","styles","root","inputContainer","getLabel","dark","input","helperText","create","flexGrow","flexDirection","alignItems","justifyContent","forwardRef"],"sources":["DatePickerInputWithoutModal.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport TextInputWithMask from '../TextInputMask'\nimport { HelperText, useTheme } from 'react-native-paper'\nimport { View, StyleSheet } from 'react-native'\nimport useDateInput from './inputUtils'\nimport type { DatePickerInputProps } from './DatePickerInput.shared'\n\nfunction DatePickerInputWithoutModal(\n {\n label,\n value,\n onChange,\n style,\n locale,\n validRange,\n inputMode,\n withDateFormatInLabel = true,\n modal,\n inputButtons,\n saveLabel,\n ...rest\n }: DatePickerInputProps & {\n modal?: (params: {\n value: DatePickerInputProps['value']\n locale: DatePickerInputProps['locale']\n inputMode: DatePickerInputProps['inputMode']\n validRange: DatePickerInputProps['validRange']\n saveLabel: DatePickerInputProps['saveLabel']\n }) => any\n inputButtons?: any\n },\n ref: any\n) {\n const theme = useTheme()\n const { formattedValue, inputFormat, onChangeText, error } = useDateInput({\n locale,\n value,\n validRange,\n inputMode,\n onChange,\n })\n\n return (\n <>\n <View style={styles.root}>\n <View style={styles.inputContainer}>\n <TextInputWithMask\n {...rest}\n ref={ref}\n label={getLabel({\n // TODO: support label components?\n label: label as any,\n inputFormat,\n withDateFormatInLabel,\n })}\n value={formattedValue}\n keyboardType={'number-pad'}\n placeholder={inputFormat}\n mask={inputFormat}\n onChangeText={onChangeText}\n keyboardAppearance={theme.dark ? 'dark' : 'default'}\n error={!!error}\n style={[styles.input, style]}\n />\n {inputButtons}\n </View>\n {error ? (\n <HelperText style={styles.helperText} type=\"error\" visible={!!error}>\n {error}\n </HelperText>\n ) : null}\n </View>\n {modal?.({ value, locale, inputMode, validRange, saveLabel })}\n </>\n )\n}\n\nfunction getLabel({\n withDateFormatInLabel,\n inputFormat,\n label,\n}: {\n withDateFormatInLabel: boolean\n inputFormat: string\n label: string | undefined\n}) {\n if (withDateFormatInLabel) {\n return label ? `${label} (${inputFormat})` : inputFormat\n }\n return label || ''\n}\n\nconst styles = StyleSheet.create({\n root: {\n flexGrow: 1,\n },\n inputContainer: {\n flexGrow: 1,\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'flex-start',\n },\n input: {\n flexGrow: 1,\n },\n helperText: {\n // flex: 1,\n },\n})\nexport default React.forwardRef(DatePickerInputWithoutModal)\n"],"mappings":";;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AAEA,OAAOC,iBAAP,MAA8B,kBA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