react-native-paper-dates 0.10.0 → 0.11.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 CHANGED
@@ -57,13 +57,12 @@ npm install react-native-paper-dates --save
57
57
 
58
58
  ## Import some localized strings
59
59
  Ideally you do this somewhere in your `index.js` before `react-native-paper-dates` is used.
60
- Currently we have en/nl/de/pl/pt/ar/ko/fr translations but it's really easy to add one extra since it are only some labels and error messages.
60
+ Currently we have en/nl/de/pl/pt/ar/ko/fr/it translations but it's really easy to add one extra since it are only some labels and error messages.
61
61
 
62
62
  ```tsx
63
63
  // e.g in your index.js
64
64
  import {
65
65
  // en,
66
- // fr,
67
66
  // nl,
68
67
  // de,
69
68
  // pl,
@@ -71,18 +70,20 @@ import {
71
70
  // ar,
72
71
  // ko
73
72
  // fr
73
+ // it,
74
74
  enGB,
75
75
  registerTranslation,
76
76
  } from 'react-native-paper-dates'
77
77
  // registerTranslation('en', en)
78
- // registerTranslation('fr', fr)
79
78
  // registerTranslation('nl', nl)
79
+ // registerTranslation('fr', fr)
80
80
  // registerTranslation('pl', pl)
81
81
  // registerTranslation('pt', pt)
82
82
  // registerTranslation('de', de)
83
83
  // registerTranslation('ar', ar)
84
84
  // registerTranslation('ko', ko)
85
85
  // registerTranslation('fr', fr)
86
+ // registerTranslation('it', it)
86
87
  registerTranslation('en-GB', enGB)
87
88
  ```
88
89
 
@@ -100,8 +100,7 @@ function getLabel(_ref2) {
100
100
 
101
101
  const styles = _reactNative.StyleSheet.create({
102
102
  root: {
103
- flexGrow: 1,
104
- backgroundColor: 'pink'
103
+ flexGrow: 1
105
104
  },
106
105
  inputContainer: {
107
106
  flexGrow: 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","backgroundColor","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 backgroundColor: 'pink',\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,IAAAC,0BAAA,GAAd;EACA,MAAM;IAAEC,cAAF;IAAkBC,WAAlB;IAA+BC,YAA/B;IAA6CC;EAA7C,IAAuD,IAAAC,mBAAA,EAAa;IACxEd,MADwE;IAExEH,KAFwE;IAGxEI,UAHwE;IAIxEC,SAJwE;IAKxEJ;EALwE,CAAb,CAA7D;EAQA,oBACE,uDACE,oBAAC,iBAAD;IAAM,KAAK,EAAEiB,MAAM,CAACC;EAApB,gBACE,oBAAC,iBAAD;IAAM,KAAK,EAAED,MAAM,CAACE;EAApB,gBACE,oBAAC,sBAAD,eACMV,IADN;IAEE,GAAG,EAAEZ,GAFP;IAGE,KAAK,EAAEuB,QAAQ,CAAC;MACd;MACAtB,KAAK,EAAEA,KAFO;MAGde,WAHc;MAIdR;IAJc,CAAD,CAHjB;IASE,KAAK,EAAEO,cATT;IAUE,YAAY,EAAE,YAVhB;IAWE,WAAW,EAAEC,WAXf;IAYE,IAAI,EAAEA,WAZR;IAaE,YAAY,EAAEC,YAbhB;IAcE,kBAAkB,EAAEJ,KAAK,CAACW,IAAN,GAAa,MAAb,GAAsB,SAd5C;IAeE,KAAK,EAAE,CAAC,CAACN,KAfX;IAgBE,KAAK,EAAE,CAACE,MAAM,CAACK,KAAR,EAAerB,KAAf;EAhBT,GADF,EAmBGM,YAnBH,CADF,EAsBGQ,KAAK,gBACJ,oBAAC,4BAAD;IAAY,KAAK,EAAEE,MAAM,CAACM,UAA1B;IAAsC,IAAI,EAAC,OAA3C;IAAmD,OAAO,EAAE,CAAC,CAACR;EAA9D,GACGA,KADH,CADI,GAIF,IA1BN,CADF,EA6BGT,KA7BH,aA6BGA,KA7BH,uBA6BGA,KAAK,CAAG;IAAEP,KAAF;IAASG,MAAT;IAAiBE,SAAjB;IAA4BD,UAA5B;IAAwCK;EAAxC,CAAH,CA7BR,CADF;AAiCD;;AAED,SAASY,QAAT,QAQG;EAAA,IARe;IAChBf,qBADgB;IAEhBQ,WAFgB;IAGhBf;EAHgB,CAQf;;EACD,IAAIO,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,CADN;IAEJC,eAAe,EAAE;EAFb,CADyB;EAK/BR,cAAc,EAAE;IACdO,QAAQ,EAAE,CADI;IAEdE,aAAa,EAAE,KAFD;IAGdC,UAAU,EAAE,QAHE;IAIdC,cAAc,EAAE;EAJF,CALe;EAW/BR,KAAK,EAAE;IACLI,QAAQ,EAAE;EADL,CAXwB;EAc/BH,UAAU,EAAE,CACV;EADU;AAdmB,CAAlB,CAAf;;4BAkBeQ,KAAK,CAACC,UAAN,CAAiBpC,2BAAjB,C"}
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,IAAAC,0BAAA,GAAd;EACA,MAAM;IAAEC,cAAF;IAAkBC,WAAlB;IAA+BC,YAA/B;IAA6CC;EAA7C,IAAuD,IAAAC,mBAAA,EAAa;IACxEd,MADwE;IAExEH,KAFwE;IAGxEI,UAHwE;IAIxEC,SAJwE;IAKxEJ;EALwE,CAAb,CAA7D;EAQA,oBACE,uDACE,oBAAC,iBAAD;IAAM,KAAK,EAAEiB,MAAM,CAACC;EAApB,gBACE,oBAAC,iBAAD;IAAM,KAAK,EAAED,MAAM,CAACE;EAApB,gBACE,oBAAC,sBAAD,eACMV,IADN;IAEE,GAAG,EAAEZ,GAFP;IAGE,KAAK,EAAEuB,QAAQ,CAAC;MACd;MACAtB,KAAK,EAAEA,KAFO;MAGde,WAHc;MAIdR;IAJc,CAAD,CAHjB;IASE,KAAK,EAAEO,cATT;IAUE,YAAY,EAAE,YAVhB;IAWE,WAAW,EAAEC,WAXf;IAYE,IAAI,EAAEA,WAZR;IAaE,YAAY,EAAEC,YAbhB;IAcE,kBAAkB,EAAEJ,KAAK,CAACW,IAAN,GAAa,MAAb,GAAsB,SAd5C;IAeE,KAAK,EAAE,CAAC,CAACN,KAfX;IAgBE,KAAK,EAAE,CAACE,MAAM,CAACK,KAAR,EAAerB,KAAf;EAhBT,GADF,EAmBGM,YAnBH,CADF,EAsBGQ,KAAK,gBACJ,oBAAC,4BAAD;IAAY,KAAK,EAAEE,MAAM,CAACM,UAA1B;IAAsC,IAAI,EAAC,OAA3C;IAAmD,OAAO,EAAE,CAAC,CAACR;EAA9D,GACGA,KADH,CADI,GAIF,IA1BN,CADF,EA6BGT,KA7BH,aA6BGA,KA7BH,uBA6BGA,KAAK,CAAG;IAAEP,KAAF;IAASG,MAAT;IAAiBE,SAAjB;IAA4BD,UAA5B;IAAwCK;EAAxC,CAAH,CA7BR,CADF;AAiCD;;AAED,SAASY,QAAT,QAQG;EAAA,IARe;IAChBf,qBADgB;IAEhBQ,WAFgB;IAGhBf;EAHgB,CAQf;;EACD,IAAIO,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"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ const it = {
8
+ save: 'Salva',
9
+ selectSingle: 'Seleziona la data',
10
+ selectMultiple: 'Seleziona le date',
11
+ selectRange: 'Seleziona il periodo',
12
+ notAccordingToDateFormat: inputFormat => `Il formato della data deve essere ${inputFormat}`,
13
+ mustBeHigherThan: date => `Deve essere successivo a ${date}`,
14
+ mustBeLowerThan: date => `Deve essere precedente a ${date}`,
15
+ mustBeBetween: (startDate, endDate) => `Deve essere compreso tra ${startDate} - ${endDate}`,
16
+ dateIsDisabled: 'Il giorno non è consentito',
17
+ previous: 'Precedente',
18
+ next: 'Successivo',
19
+ typeInDate: 'Digita la data',
20
+ pickDateFromCalendar: 'Scegli data dal calendario',
21
+ close: 'Chiudi'
22
+ };
23
+ var _default = it;
24
+ exports.default = _default;
25
+ //# sourceMappingURL=it.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["it","save","selectSingle","selectMultiple","selectRange","notAccordingToDateFormat","inputFormat","mustBeHigherThan","date","mustBeLowerThan","mustBeBetween","startDate","endDate","dateIsDisabled","previous","next","typeInDate","pickDateFromCalendar","close"],"sources":["it.ts"],"sourcesContent":["import type { TranslationsType } from './utils'\n\nconst it: TranslationsType = {\n save: 'Salva',\n selectSingle: 'Seleziona la data',\n selectMultiple: 'Seleziona le date',\n selectRange: 'Seleziona il periodo',\n notAccordingToDateFormat: (inputFormat) =>\n `Il formato della data deve essere ${inputFormat}`,\n mustBeHigherThan: (date) => `Deve essere successivo a ${date}`,\n mustBeLowerThan: (date) => `Deve essere precedente a ${date}`,\n mustBeBetween: (startDate, endDate) =>\n `Deve essere compreso tra ${startDate} - ${endDate}`,\n dateIsDisabled: 'Il giorno non è consentito',\n previous: 'Precedente',\n next: 'Successivo',\n typeInDate: 'Digita la data',\n pickDateFromCalendar: 'Scegli data dal calendario',\n close: 'Chiudi',\n}\nexport default it\n"],"mappings":";;;;;;AAEA,MAAMA,EAAoB,GAAG;EAC3BC,IAAI,EAAE,OADqB;EAE3BC,YAAY,EAAE,mBAFa;EAG3BC,cAAc,EAAE,mBAHW;EAI3BC,WAAW,EAAE,sBAJc;EAK3BC,wBAAwB,EAAGC,WAAD,IACvB,qCAAoCA,WAAY,EANxB;EAO3BC,gBAAgB,EAAGC,IAAD,IAAW,4BAA2BA,IAAK,EAPlC;EAQ3BC,eAAe,EAAGD,IAAD,IAAW,4BAA2BA,IAAK,EARjC;EAS3BE,aAAa,EAAE,CAACC,SAAD,EAAYC,OAAZ,KACZ,4BAA2BD,SAAU,MAAKC,OAAQ,EAV1B;EAW3BC,cAAc,EAAE,4BAXW;EAY3BC,QAAQ,EAAE,YAZiB;EAa3BC,IAAI,EAAE,YAbqB;EAc3BC,UAAU,EAAE,gBAde;EAe3BC,oBAAoB,EAAE,4BAfK;EAgB3BC,KAAK,EAAE;AAhBoB,CAA7B;eAkBelB,E"}
@@ -83,8 +83,7 @@ function getLabel(_ref2) {
83
83
 
84
84
  const styles = StyleSheet.create({
85
85
  root: {
86
- flexGrow: 1,
87
- backgroundColor: 'pink'
86
+ flexGrow: 1
88
87
  },
89
88
  inputContainer: {
90
89
  flexGrow: 1,
@@ -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","backgroundColor","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 backgroundColor: 'pink',\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,kBAA9B;AACA,SAASC,UAAT,EAAqBC,QAArB,QAAqC,oBAArC;AACA,SAASC,IAAT,EAAeC,UAAf,QAAiC,cAAjC;AACA,OAAOC,YAAP,MA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,IA1BN,CADF,EA6BGR,KA7BH,aA6BGA,KA7BH,uBA6BGA,KAAK,CAAG;IAAEP,KAAF;IAASG,MAAT;IAAiBE,SAAjB;IAA4BD,UAA5B;IAAwCK;EAAxC,CAAH,CA7BR,CADF;AAiCD;;AAED,SAASU,QAAT,QAQG;EAAA,IARe;IAChBb,qBADgB;IAEhBO,WAFgB;IAGhBd;EAHgB,CAQf;;EACD,IAAIO,qBAAJ,EAA2B;IACzB,OAAOP,KAAK,GAAI,GAAEA,KAAM,KAAIc,WAAY,GAA5B,GAAiCA,WAA7C;EACD;;EACD,OAAOd,KAAK,IAAI,EAAhB;AACD;;AAED,MAAMiB,MAAM,GAAGrB,UAAU,CAAC4B,MAAX,CAAkB;EAC/BN,IAAI,EAAE;IACJO,QAAQ,EAAE,CADN;IAEJC,eAAe,EAAE;EAFb,CADyB;EAK/BP,cAAc,EAAE;IACdM,QAAQ,EAAE,CADI;IAEdE,aAAa,EAAE,KAFD;IAGdC,UAAU,EAAE,QAHE;IAIdC,cAAc,EAAE;EAJF,CALe;EAW/BP,KAAK,EAAE;IACLG,QAAQ,EAAE;EADL,CAXwB;EAc/BF,UAAU,EAAE,CACV;EADU;AAdmB,CAAlB,CAAf;AAkBA,4BAAehC,KAAK,CAACuC,UAAN,CAAiBhC,2BAAjB,CAAf"}
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,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F,EAsBGO,KAAK,gBACJ,oBAAC,UAAD;IAAY,KAAK,EAAEC,MAAM,CAACM,UAA1B;IAAsC,IAAI,EAAC,OAA3C;IAAmD,OAAO,EAAE,CAAC,CAACP;EAA9D,GACGA,KADH,CADI,GAIF,IA1BN,CADF,EA6BGR,KA7BH,aA6BGA,KA7BH,uBA6BGA,KAAK,CAAG;IAAEP,KAAF;IAASG,MAAT;IAAiBE,SAAjB;IAA4BD,UAA5B;IAAwCK;EAAxC,CAAH,CA7BR,CADF;AAiCD;;AAED,SAASU,QAAT,QAQG;EAAA,IARe;IAChBb,qBADgB;IAEhBO,WAFgB;IAGhBd;EAHgB,CAQf;;EACD,IAAIO,qBAAJ,EAA2B;IACzB,OAAOP,KAAK,GAAI,GAAEA,KAAM,KAAIc,WAAY,GAA5B,GAAiCA,WAA7C;EACD;;EACD,OAAOd,KAAK,IAAI,EAAhB;AACD;;AAED,MAAMiB,MAAM,GAAGrB,UAAU,CAAC4B,MAAX,CAAkB;EAC/BN,IAAI,EAAE;IACJO,QAAQ,EAAE;EADN,CADyB;EAI/BN,cAAc,EAAE;IACdM,QAAQ,EAAE,CADI;IAEdC,aAAa,EAAE,KAFD;IAGdC,UAAU,EAAE,QAHE;IAIdC,cAAc,EAAE;EAJF,CAJe;EAU/BN,KAAK,EAAE;IACLG,QAAQ,EAAE;EADL,CAVwB;EAa/BF,UAAU,EAAE,CACV;EADU;AAbmB,CAAlB,CAAf;AAiBA,4BAAehC,KAAK,CAACsC,UAAN,CAAiB/B,2BAAjB,CAAf"}
@@ -0,0 +1,18 @@
1
+ const it = {
2
+ save: 'Salva',
3
+ selectSingle: 'Seleziona la data',
4
+ selectMultiple: 'Seleziona le date',
5
+ selectRange: 'Seleziona il periodo',
6
+ notAccordingToDateFormat: inputFormat => `Il formato della data deve essere ${inputFormat}`,
7
+ mustBeHigherThan: date => `Deve essere successivo a ${date}`,
8
+ mustBeLowerThan: date => `Deve essere precedente a ${date}`,
9
+ mustBeBetween: (startDate, endDate) => `Deve essere compreso tra ${startDate} - ${endDate}`,
10
+ dateIsDisabled: 'Il giorno non è consentito',
11
+ previous: 'Precedente',
12
+ next: 'Successivo',
13
+ typeInDate: 'Digita la data',
14
+ pickDateFromCalendar: 'Scegli data dal calendario',
15
+ close: 'Chiudi'
16
+ };
17
+ export default it;
18
+ //# sourceMappingURL=it.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["it","save","selectSingle","selectMultiple","selectRange","notAccordingToDateFormat","inputFormat","mustBeHigherThan","date","mustBeLowerThan","mustBeBetween","startDate","endDate","dateIsDisabled","previous","next","typeInDate","pickDateFromCalendar","close"],"sources":["it.ts"],"sourcesContent":["import type { TranslationsType } from './utils'\n\nconst it: TranslationsType = {\n save: 'Salva',\n selectSingle: 'Seleziona la data',\n selectMultiple: 'Seleziona le date',\n selectRange: 'Seleziona il periodo',\n notAccordingToDateFormat: (inputFormat) =>\n `Il formato della data deve essere ${inputFormat}`,\n mustBeHigherThan: (date) => `Deve essere successivo a ${date}`,\n mustBeLowerThan: (date) => `Deve essere precedente a ${date}`,\n mustBeBetween: (startDate, endDate) =>\n `Deve essere compreso tra ${startDate} - ${endDate}`,\n dateIsDisabled: 'Il giorno non è consentito',\n previous: 'Precedente',\n next: 'Successivo',\n typeInDate: 'Digita la data',\n pickDateFromCalendar: 'Scegli data dal calendario',\n close: 'Chiudi',\n}\nexport default it\n"],"mappings":"AAEA,MAAMA,EAAoB,GAAG;EAC3BC,IAAI,EAAE,OADqB;EAE3BC,YAAY,EAAE,mBAFa;EAG3BC,cAAc,EAAE,mBAHW;EAI3BC,WAAW,EAAE,sBAJc;EAK3BC,wBAAwB,EAAGC,WAAD,IACvB,qCAAoCA,WAAY,EANxB;EAO3BC,gBAAgB,EAAGC,IAAD,IAAW,4BAA2BA,IAAK,EAPlC;EAQ3BC,eAAe,EAAGD,IAAD,IAAW,4BAA2BA,IAAK,EARjC;EAS3BE,aAAa,EAAE,CAACC,SAAD,EAAYC,OAAZ,KACZ,4BAA2BD,SAAU,MAAKC,OAAQ,EAV1B;EAW3BC,cAAc,EAAE,4BAXW;EAY3BC,QAAQ,EAAE,YAZiB;EAa3BC,IAAI,EAAE,YAbqB;EAc3BC,UAAU,EAAE,gBAde;EAe3BC,oBAAoB,EAAE,4BAfK;EAgB3BC,KAAK,EAAE;AAhBoB,CAA7B;AAkBA,eAAelB,EAAf"}
@@ -0,0 +1,3 @@
1
+ import type { TranslationsType } from './utils';
2
+ declare const it: TranslationsType;
3
+ export default it;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-paper-dates",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "description": "Performant Date Picker for React Native Paper",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -94,7 +94,6 @@ function getLabel({
94
94
  const styles = StyleSheet.create({
95
95
  root: {
96
96
  flexGrow: 1,
97
- backgroundColor: 'pink',
98
97
  },
99
98
  inputContainer: {
100
99
  flexGrow: 1,
@@ -0,0 +1,21 @@
1
+ import type { TranslationsType } from './utils'
2
+
3
+ const it: TranslationsType = {
4
+ save: 'Salva',
5
+ selectSingle: 'Seleziona la data',
6
+ selectMultiple: 'Seleziona le date',
7
+ selectRange: 'Seleziona il periodo',
8
+ notAccordingToDateFormat: (inputFormat) =>
9
+ `Il formato della data deve essere ${inputFormat}`,
10
+ mustBeHigherThan: (date) => `Deve essere successivo a ${date}`,
11
+ mustBeLowerThan: (date) => `Deve essere precedente a ${date}`,
12
+ mustBeBetween: (startDate, endDate) =>
13
+ `Deve essere compreso tra ${startDate} - ${endDate}`,
14
+ dateIsDisabled: 'Il giorno non è consentito',
15
+ previous: 'Precedente',
16
+ next: 'Successivo',
17
+ typeInDate: 'Digita la data',
18
+ pickDateFromCalendar: 'Scegli data dal calendario',
19
+ close: 'Chiudi',
20
+ }
21
+ export default it