react-native-paper-dates 0.22.14 → 0.22.16
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/AnimatedCrossView.js +41 -42
- package/lib/commonjs/Date/AnimatedCrossView.js.map +1 -1
- package/lib/commonjs/Date/AutoSizer.js +10 -14
- package/lib/commonjs/Date/AutoSizer.js.map +1 -1
- package/lib/commonjs/Date/Calendar.js +69 -76
- package/lib/commonjs/Date/Calendar.js.map +1 -1
- package/lib/commonjs/Date/CalendarEdit.js +67 -72
- package/lib/commonjs/Date/CalendarEdit.js.map +1 -1
- package/lib/commonjs/Date/CalendarHeader.js +38 -36
- package/lib/commonjs/Date/CalendarHeader.js.map +1 -1
- package/lib/commonjs/Date/DatePickerInput.js +15 -15
- package/lib/commonjs/Date/DatePickerInput.js.map +1 -1
- package/lib/commonjs/Date/DatePickerInputWithoutModal.js +49 -43
- package/lib/commonjs/Date/DatePickerInputWithoutModal.js.map +1 -1
- package/lib/commonjs/Date/DatePickerModal.js +49 -45
- package/lib/commonjs/Date/DatePickerModal.js.map +1 -1
- package/lib/commonjs/Date/DatePickerModalContent.js +73 -68
- package/lib/commonjs/Date/DatePickerModalContent.js.map +1 -1
- package/lib/commonjs/Date/DatePickerModalContentHeader.js +86 -101
- package/lib/commonjs/Date/DatePickerModalContentHeader.js.map +1 -1
- package/lib/commonjs/Date/DatePickerModalHeader.js +32 -63
- package/lib/commonjs/Date/DatePickerModalHeader.js.map +1 -1
- package/lib/commonjs/Date/DatePickerModalHeaderBackground.js +8 -7
- package/lib/commonjs/Date/DatePickerModalHeaderBackground.js.map +1 -1
- package/lib/commonjs/Date/DatePickerModalStatusBar.js +16 -13
- package/lib/commonjs/Date/DatePickerModalStatusBar.js.map +1 -1
- package/lib/commonjs/Date/Day.js +57 -57
- package/lib/commonjs/Date/Day.js.map +1 -1
- package/lib/commonjs/Date/DayName.js +17 -14
- package/lib/commonjs/Date/DayName.js.map +1 -1
- package/lib/commonjs/Date/DayNames.js +14 -13
- package/lib/commonjs/Date/DayNames.js.map +1 -1
- package/lib/commonjs/Date/DayRange.js +25 -26
- package/lib/commonjs/Date/DayRange.js.map +1 -1
- package/lib/commonjs/Date/Month.js +74 -76
- package/lib/commonjs/Date/Month.js.map +1 -1
- package/lib/commonjs/Date/Swiper.js +67 -64
- package/lib/commonjs/Date/Swiper.js.map +1 -1
- package/lib/commonjs/Date/Swiper.native.js +67 -63
- package/lib/commonjs/Date/Swiper.native.js.map +1 -1
- package/lib/commonjs/Date/SwiperUtils.js +3 -5
- package/lib/commonjs/Date/SwiperUtils.js.map +1 -1
- package/lib/commonjs/Date/YearPicker.js +58 -58
- package/lib/commonjs/Date/YearPicker.js.map +1 -1
- package/lib/commonjs/Date/dateUtils.js +13 -11
- package/lib/commonjs/Date/dateUtils.js.map +1 -1
- package/lib/commonjs/Date/inputUtils.js +8 -10
- package/lib/commonjs/Date/inputUtils.js.map +1 -1
- package/lib/commonjs/TextInputMask.js +11 -11
- package/lib/commonjs/TextInputMask.js.map +1 -1
- package/lib/commonjs/Time/AmPmSwitcher.js +51 -49
- package/lib/commonjs/Time/AmPmSwitcher.js.map +1 -1
- package/lib/commonjs/Time/AnalogClock.js +69 -64
- package/lib/commonjs/Time/AnalogClock.js.map +1 -1
- package/lib/commonjs/Time/AnalogClockHours.js +46 -53
- package/lib/commonjs/Time/AnalogClockHours.js.map +1 -1
- package/lib/commonjs/Time/AnalogClockMinutes.js +45 -60
- package/lib/commonjs/Time/AnalogClockMinutes.js.map +1 -1
- package/lib/commonjs/Time/AnimatedClockSwitcher.js +34 -30
- package/lib/commonjs/Time/AnimatedClockSwitcher.js.map +1 -1
- package/lib/commonjs/Time/TimeInput.js +55 -54
- package/lib/commonjs/Time/TimeInput.js.map +1 -1
- package/lib/commonjs/Time/TimeInputs.js +118 -114
- package/lib/commonjs/Time/TimeInputs.js.map +1 -1
- package/lib/commonjs/Time/TimePicker.js +40 -36
- package/lib/commonjs/Time/TimePicker.js.map +1 -1
- package/lib/commonjs/Time/TimePickerModal.js +118 -114
- package/lib/commonjs/Time/TimePickerModal.js.map +1 -1
- package/lib/commonjs/Time/timeUtils.js +5 -8
- package/lib/commonjs/Time/timeUtils.js.map +1 -1
- package/lib/commonjs/contexts/DisplayModeContext.js +2 -4
- package/lib/commonjs/contexts/DisplayModeContext.js.map +1 -1
- package/lib/commonjs/shared/styles.js +25 -0
- package/lib/commonjs/shared/styles.js.map +1 -0
- package/lib/commonjs/{utils.js → shared/utils.js} +4 -4
- package/lib/commonjs/shared/utils.js.map +1 -0
- package/lib/module/Date/AnimatedCrossView.js +43 -42
- package/lib/module/Date/AnimatedCrossView.js.map +1 -1
- package/lib/module/Date/AutoSizer.js +12 -15
- package/lib/module/Date/AutoSizer.js.map +1 -1
- package/lib/module/Date/Calendar.js +71 -76
- package/lib/module/Date/Calendar.js.map +1 -1
- package/lib/module/Date/CalendarEdit.js +68 -71
- package/lib/module/Date/CalendarEdit.js.map +1 -1
- package/lib/module/Date/CalendarHeader.js +39 -36
- package/lib/module/Date/CalendarHeader.js.map +1 -1
- package/lib/module/Date/DatePickerInput.js +15 -14
- package/lib/module/Date/DatePickerInput.js.map +1 -1
- package/lib/module/Date/DatePickerInputWithoutModal.js +50 -42
- package/lib/module/Date/DatePickerInputWithoutModal.js.map +1 -1
- package/lib/module/Date/DatePickerModal.js +49 -44
- package/lib/module/Date/DatePickerModal.js.map +1 -1
- package/lib/module/Date/DatePickerModalContent.js +74 -67
- package/lib/module/Date/DatePickerModalContent.js.map +1 -1
- package/lib/module/Date/DatePickerModalContentHeader.js +87 -100
- package/lib/module/Date/DatePickerModalContentHeader.js.map +1 -1
- package/lib/module/Date/DatePickerModalHeader.js +33 -61
- package/lib/module/Date/DatePickerModalHeader.js.map +1 -1
- package/lib/module/Date/DatePickerModalHeaderBackground.js +7 -5
- package/lib/module/Date/DatePickerModalHeaderBackground.js.map +1 -1
- package/lib/module/Date/DatePickerModalStatusBar.js +18 -13
- package/lib/module/Date/DatePickerModalStatusBar.js.map +1 -1
- package/lib/module/Date/Day.js +58 -56
- package/lib/module/Date/Day.js.map +1 -1
- package/lib/module/Date/DayName.js +17 -14
- package/lib/module/Date/DayName.js.map +1 -1
- package/lib/module/Date/DayNames.js +13 -12
- package/lib/module/Date/DayNames.js.map +1 -1
- package/lib/module/Date/DayRange.js +27 -26
- package/lib/module/Date/DayRange.js.map +1 -1
- package/lib/module/Date/Month.js +76 -76
- package/lib/module/Date/Month.js.map +1 -1
- package/lib/module/Date/Swiper.js +69 -64
- package/lib/module/Date/Swiper.js.map +1 -1
- package/lib/module/Date/Swiper.native.js +69 -62
- package/lib/module/Date/Swiper.native.js.map +1 -1
- package/lib/module/Date/SwiperUtils.js +3 -3
- package/lib/module/Date/SwiperUtils.js.map +1 -1
- package/lib/module/Date/YearPicker.js +59 -58
- package/lib/module/Date/YearPicker.js.map +1 -1
- package/lib/module/Date/dateUtils.js +13 -9
- package/lib/module/Date/dateUtils.js.map +1 -1
- package/lib/module/Date/inputUtils.js +8 -8
- package/lib/module/Date/inputUtils.js.map +1 -1
- package/lib/module/TextInputMask.js +12 -11
- package/lib/module/TextInputMask.js.map +1 -1
- package/lib/module/Time/AmPmSwitcher.js +53 -49
- package/lib/module/Time/AmPmSwitcher.js.map +1 -1
- package/lib/module/Time/AnalogClock.js +71 -64
- package/lib/module/Time/AnalogClock.js.map +1 -1
- package/lib/module/Time/AnalogClockHours.js +48 -53
- package/lib/module/Time/AnalogClockHours.js.map +1 -1
- package/lib/module/Time/AnalogClockMinutes.js +46 -60
- package/lib/module/Time/AnalogClockMinutes.js.map +1 -1
- package/lib/module/Time/AnimatedClockSwitcher.js +35 -30
- package/lib/module/Time/AnimatedClockSwitcher.js.map +1 -1
- package/lib/module/Time/TimeInput.js +56 -53
- package/lib/module/Time/TimeInput.js.map +1 -1
- package/lib/module/Time/TimeInputs.js +120 -113
- package/lib/module/Time/TimeInputs.js.map +1 -1
- package/lib/module/Time/TimePicker.js +42 -36
- package/lib/module/Time/TimePicker.js.map +1 -1
- package/lib/module/Time/TimePickerModal.js +118 -112
- package/lib/module/Time/TimePickerModal.js.map +1 -1
- package/lib/module/Time/timeUtils.js +5 -6
- package/lib/module/Time/timeUtils.js.map +1 -1
- package/lib/module/contexts/DisplayModeContext.js +2 -2
- package/lib/module/contexts/DisplayModeContext.js.map +1 -1
- package/lib/module/shared/styles.js +19 -0
- package/lib/module/shared/styles.js.map +1 -0
- package/lib/module/{utils.js → shared/utils.js} +3 -2
- package/lib/module/shared/utils.js.map +1 -0
- package/lib/typescript/Date/AnimatedCrossView.d.ts +1 -1
- package/lib/typescript/Date/AnimatedCrossView.d.ts.map +1 -1
- package/lib/typescript/Date/AutoSizer.d.ts +1 -1
- package/lib/typescript/Date/AutoSizer.d.ts.map +1 -1
- package/lib/typescript/Date/Calendar.d.ts +1 -1
- package/lib/typescript/Date/Calendar.d.ts.map +1 -1
- package/lib/typescript/Date/CalendarEdit.d.ts +1 -1
- package/lib/typescript/Date/CalendarEdit.d.ts.map +1 -1
- package/lib/typescript/Date/CalendarHeader.d.ts +1 -1
- package/lib/typescript/Date/CalendarHeader.d.ts.map +1 -1
- package/lib/typescript/Date/DatePickerInput.d.ts +1 -1
- package/lib/typescript/Date/DatePickerInput.d.ts.map +1 -1
- package/lib/typescript/Date/DatePickerInput.shared.d.ts +3 -3
- package/lib/typescript/Date/DatePickerInput.shared.d.ts.map +1 -1
- package/lib/typescript/Date/DatePickerInputWithoutModal.d.ts +59 -58
- package/lib/typescript/Date/DatePickerInputWithoutModal.d.ts.map +1 -1
- package/lib/typescript/Date/DatePickerModal.d.ts +1 -1
- package/lib/typescript/Date/DatePickerModal.d.ts.map +1 -1
- package/lib/typescript/Date/DatePickerModalContent.d.ts +1 -1
- package/lib/typescript/Date/DatePickerModalContent.d.ts.map +1 -1
- package/lib/typescript/Date/DatePickerModalContentHeader.d.ts +1 -1
- package/lib/typescript/Date/DatePickerModalContentHeader.d.ts.map +1 -1
- package/lib/typescript/Date/DatePickerModalHeader.d.ts +1 -1
- package/lib/typescript/Date/DatePickerModalHeader.d.ts.map +1 -1
- package/lib/typescript/Date/DatePickerModalHeaderBackground.d.ts +1 -1
- package/lib/typescript/Date/DatePickerModalHeaderBackground.d.ts.map +1 -1
- package/lib/typescript/Date/DatePickerModalStatusBar.d.ts +1 -1
- package/lib/typescript/Date/DatePickerModalStatusBar.d.ts.map +1 -1
- package/lib/typescript/Date/Day.d.ts +2 -2
- package/lib/typescript/Date/Day.d.ts.map +1 -1
- package/lib/typescript/Date/DayName.d.ts +1 -1
- package/lib/typescript/Date/DayName.d.ts.map +1 -1
- package/lib/typescript/Date/DayNames.d.ts +1 -1
- package/lib/typescript/Date/DayNames.d.ts.map +1 -1
- package/lib/typescript/Date/DayRange.d.ts +1 -1
- package/lib/typescript/Date/DayRange.d.ts.map +1 -1
- package/lib/typescript/Date/Month.d.ts +1 -1
- package/lib/typescript/Date/Month.d.ts.map +1 -1
- package/lib/typescript/Date/Swiper.d.ts +1 -1
- package/lib/typescript/Date/Swiper.d.ts.map +1 -1
- package/lib/typescript/Date/Swiper.native.d.ts +1 -1
- package/lib/typescript/Date/Swiper.native.d.ts.map +1 -1
- package/lib/typescript/Date/SwiperUtils.d.ts +1 -1
- package/lib/typescript/Date/SwiperUtils.d.ts.map +1 -1
- package/lib/typescript/Date/YearPicker.d.ts +1 -1
- package/lib/typescript/Date/YearPicker.d.ts.map +1 -1
- package/lib/typescript/Date/dateUtils.d.ts.map +1 -1
- package/lib/typescript/Date/inputUtils.d.ts.map +1 -1
- package/lib/typescript/TextInputMask.d.ts +24 -24
- package/lib/typescript/TextInputMask.d.ts.map +1 -1
- package/lib/typescript/Time/AmPmSwitcher.d.ts +1 -1
- package/lib/typescript/Time/AmPmSwitcher.d.ts.map +1 -1
- package/lib/typescript/Time/AnalogClock.d.ts +1 -1
- package/lib/typescript/Time/AnalogClock.d.ts.map +1 -1
- package/lib/typescript/Time/AnalogClockHours.d.ts +1 -1
- package/lib/typescript/Time/AnalogClockHours.d.ts.map +1 -1
- package/lib/typescript/Time/AnalogClockMinutes.d.ts +1 -1
- package/lib/typescript/Time/AnalogClockMinutes.d.ts.map +1 -1
- package/lib/typescript/Time/AnimatedClockSwitcher.d.ts +5 -3
- package/lib/typescript/Time/AnimatedClockSwitcher.d.ts.map +1 -1
- package/lib/typescript/Time/TimeInput.d.ts +1 -1
- package/lib/typescript/Time/TimeInput.d.ts.map +1 -1
- package/lib/typescript/Time/TimeInputs.d.ts +1 -1
- package/lib/typescript/Time/TimeInputs.d.ts.map +1 -1
- package/lib/typescript/Time/TimePicker.d.ts +1 -1
- package/lib/typescript/Time/TimePicker.d.ts.map +1 -1
- package/lib/typescript/Time/TimePickerModal.d.ts +1 -1
- package/lib/typescript/Time/TimePickerModal.d.ts.map +1 -1
- package/lib/typescript/Time/timeUtils.d.ts.map +1 -1
- package/lib/typescript/contexts/DisplayModeContext.d.ts +4 -4
- package/lib/typescript/contexts/DisplayModeContext.d.ts.map +1 -1
- package/lib/typescript/shared/styles.d.ts +18 -0
- package/lib/typescript/shared/styles.d.ts.map +1 -0
- package/lib/typescript/{utils.d.ts → shared/utils.d.ts} +2 -2
- package/lib/typescript/shared/utils.d.ts.map +1 -0
- package/package.json +17 -17
- package/src/Date/AnimatedCrossView.tsx +9 -10
- package/src/Date/AutoSizer.tsx +12 -13
- package/src/Date/Calendar.tsx +29 -35
- package/src/Date/CalendarEdit.tsx +18 -15
- package/src/Date/CalendarHeader.tsx +9 -18
- package/src/Date/DatePickerInput.shared.tsx +3 -3
- package/src/Date/DatePickerInput.tsx +11 -8
- package/src/Date/DatePickerInputWithoutModal.tsx +3 -4
- package/src/Date/DatePickerModal.tsx +14 -23
- package/src/Date/DatePickerModalContent.tsx +10 -13
- package/src/Date/DatePickerModalContentHeader.tsx +31 -43
- package/src/Date/DatePickerModalHeader.tsx +4 -23
- package/src/Date/DatePickerModalHeaderBackground.tsx +3 -2
- package/src/Date/DatePickerModalStatusBar.tsx +4 -4
- package/src/Date/Day.tsx +22 -24
- package/src/Date/DayName.tsx +12 -4
- package/src/Date/DayNames.tsx +7 -6
- package/src/Date/DayRange.tsx +6 -11
- package/src/Date/Month.tsx +24 -21
- package/src/Date/Swiper.native.tsx +19 -20
- package/src/Date/Swiper.tsx +32 -29
- package/src/Date/SwiperUtils.ts +3 -4
- package/src/Date/YearPicker.tsx +11 -16
- package/src/Date/dateUtils.tsx +18 -11
- package/src/Date/inputUtils.ts +7 -5
- package/src/TextInputMask.tsx +10 -11
- package/src/Time/AmPmSwitcher.tsx +9 -7
- package/src/Time/AnalogClock.tsx +38 -24
- package/src/Time/AnalogClockHours.tsx +10 -20
- package/src/Time/AnalogClockMinutes.tsx +19 -32
- package/src/Time/AnimatedClockSwitcher.tsx +9 -5
- package/src/Time/TimeInput.tsx +22 -19
- package/src/Time/TimeInputs.tsx +28 -34
- package/src/Time/TimePicker.tsx +15 -10
- package/src/Time/TimePickerModal.tsx +48 -72
- package/src/Time/timeUtils.ts +5 -6
- package/src/contexts/DisplayModeContext.tsx +3 -3
- package/src/shared/styles.tsx +19 -0
- package/src/{utils.ts → shared/utils.ts} +16 -2
- package/lib/commonjs/Date/Week.js +0 -10
- package/lib/commonjs/Date/Week.js.map +0 -1
- package/lib/commonjs/utils.js.map +0 -1
- package/lib/module/Date/Week.js +0 -4
- package/lib/module/Date/Week.js.map +0 -1
- package/lib/module/utils.js.map +0 -1
- package/lib/typescript/Date/Week.d.ts +0 -2
- package/lib/typescript/Date/Week.d.ts.map +0 -1
- package/lib/typescript/utils.d.ts.map +0 -1
- package/src/Date/Week.tsx +0 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import { PossibleClockTypes, PossibleInputTypes } from './timeUtils';
|
|
2
|
+
import React from 'react';
|
|
3
3
|
declare function TimeInputs({ hours, minutes, onFocusInput, focused, inputType, onChange, is24Hour, inputFontSize, locale, }: {
|
|
4
4
|
inputType: PossibleInputTypes;
|
|
5
5
|
focused: PossibleClockTypes;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeInputs.d.ts","sourceRoot":"","sources":["../../../src/Time/TimeInputs.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TimeInputs.d.ts","sourceRoot":"","sources":["../../../src/Time/TimeInputs.tsx"],"names":[],"mappings":"AAQA,OAAO,EAEL,kBAAkB,EAClB,kBAAkB,EAGnB,MAAM,aAAa,CAAA;AAOpB,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,iBAAS,UAAU,CAAC,EAClB,KAAK,EACL,OAAO,EACP,YAAY,EACZ,OAAO,EACP,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,aAAa,EACb,MAAM,GACP,EAAE;IACD,SAAS,EAAE,kBAAkB,CAAA;IAC7B,OAAO,EAAE,kBAAkB,CAAA;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,GAAG,CAAA;IAC/C,QAAQ,EAAE,CAAC,sBAAsB,EAAE;QACjC,KAAK,EAAE,MAAM,CAAA;QACb,OAAO,EAAE,MAAM,CAAA;QACf,OAAO,CAAC,EAAE,SAAS,GAAG,kBAAkB,CAAA;KACzC,KAAK,GAAG,CAAA;IACT,QAAQ,EAAE,OAAO,CAAA;IACjB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,qBAqJA;;AA4BD,wBAA+B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimePicker.d.ts","sourceRoot":"","sources":["../../../src/Time/TimePicker.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TimePicker.d.ts","sourceRoot":"","sources":["../../../src/Time/TimePicker.tsx"],"names":[],"mappings":"AACA,OAAO,KAAe,MAAM,OAAO,CAAA;AACnC,OAAO,EAEL,kBAAkB,EAClB,kBAAkB,EAGnB,MAAM,aAAa,CAAA;AAQpB,KAAK,YAAY,GAAG,CAAC,EACnB,KAAK,EACL,OAAO,EACP,OAAO,GACR,EAAE;IACD,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,SAAS,GAAG,kBAAkB,CAAA;CACzC,KAAK,GAAG,CAAA;AAET,iBAAS,UAAU,CAAC,EAClB,KAAK,EACL,OAAO,EACP,YAAY,EACZ,OAAO,EACP,SAAS,EACT,QAAQ,EACR,MAAM,EACN,cAAc,EACd,aAAa,GACd,EAAE;IACD,MAAM,CAAC,EAAE,SAAS,GAAG,MAAM,CAAA;IAC3B,SAAS,EAAE,kBAAkB,CAAA;IAC7B,OAAO,EAAE,kBAAkB,CAAA;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,GAAG,CAAA;IAC/C,QAAQ,EAAE,YAAY,CAAA;IACtB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB,qBAuFA;;AAmBD,wBAA+B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import { PossibleInputTypes } from './timeUtils';
|
|
2
|
+
import React from 'react';
|
|
3
3
|
export declare function TimePickerModal({ visible, onDismiss, onConfirm, hours, minutes, label, uppercase: _uppercase, cancelLabel, confirmLabel, animationType, locale, keyboardIcon, clockIcon, use24HourClock, inputFontSize, defaultInputType, }: {
|
|
4
4
|
locale?: undefined | string;
|
|
5
5
|
label?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimePickerModal.d.ts","sourceRoot":"","sources":["../../../src/Time/TimePickerModal.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TimePickerModal.d.ts","sourceRoot":"","sources":["../../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gB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,MAAM,CAc1E;AAED,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,OAAO,GAChB,MAAM,CAWR"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare const DisplayModeContext:
|
|
3
|
-
mode:
|
|
4
|
-
setMode:
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
export declare const DisplayModeContext: import("react").Context<{
|
|
3
|
+
mode: "AM" | "PM" | undefined;
|
|
4
|
+
setMode: Dispatch<SetStateAction<"AM" | "PM" | undefined>>;
|
|
5
5
|
}>;
|
|
6
6
|
//# sourceMappingURL=DisplayModeContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DisplayModeContext.d.ts","sourceRoot":"","sources":["../../../src/contexts/DisplayModeContext.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"DisplayModeContext.d.ts","sourceRoot":"","sources":["../../../src/contexts/DisplayModeContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAE/D,eAAO,MAAM,kBAAkB;UACvB,IAAI,GAAG,IAAI,GAAG,SAAS;aACpB,QAAQ,CAAC,cAAc,CAAC,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;EACvB,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const sharedStyles: {
|
|
2
|
+
flexDirectionRow: {
|
|
3
|
+
flexDirection: "row";
|
|
4
|
+
};
|
|
5
|
+
opacity0: {
|
|
6
|
+
opacity: number;
|
|
7
|
+
};
|
|
8
|
+
opacity1: {
|
|
9
|
+
opacity: number;
|
|
10
|
+
};
|
|
11
|
+
overflowHidden: {
|
|
12
|
+
overflow: "hidden";
|
|
13
|
+
};
|
|
14
|
+
root: {
|
|
15
|
+
flex: number;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/shared/styles.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;CAgBvB,CAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import { DefaultTheme, MD3DarkTheme } from 'react-native-paper';
|
|
3
2
|
import Color from 'color';
|
|
3
|
+
export declare const supportedOrientations: ('portrait' | 'portrait-upside-down' | 'landscape' | 'landscape-left' | 'landscape-right')[];
|
|
4
4
|
export type PaperTheme = typeof MD3DarkTheme | typeof DefaultTheme;
|
|
5
|
-
export declare function useLatest<T>(value: T):
|
|
5
|
+
export declare function useLatest<T>(value: T): import("react").MutableRefObject<T>;
|
|
6
6
|
export declare function useHeaderBackgroundColor(): string;
|
|
7
7
|
export declare function useHeaderColorIsLight(): boolean;
|
|
8
8
|
export declare function useHeaderTextColor(): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/shared/utils.ts"],"names":[],"mappings":"AACA,OAAO,EACL,YAAY,EACZ,YAAY,EAGb,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,eAAO,MAAM,qBAAqB,EAAE,CAChC,UAAU,GACV,sBAAsB,GACtB,WAAW,GACX,gBAAgB,GAChB,iBAAiB,CACpB,EAMA,CAAA;AAED,MAAM,MAAM,UAAU,GAAG,OAAO,YAAY,GAAG,OAAO,YAAY,CAAA;AAElE,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,uCAIpC;AAED,wBAAgB,wBAAwB,WAQvC;AAED,wBAAgB,qBAAqB,YAOpC;AAED,wBAAgB,kBAAkB,WAOjC;AAED,wBAAgB,qBAAqB,WAapC;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,YAI/C;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;GAGpD;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;GAGnD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-paper-dates",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.16",
|
|
4
4
|
"description": "Performant Date Picker for React Native Paper",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -50,36 +50,36 @@
|
|
|
50
50
|
"registry": "https://registry.npmjs.org/"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@commitlint/config-conventional": "^18.6.
|
|
53
|
+
"@commitlint/config-conventional": "^18.6.3",
|
|
54
54
|
"@react-native-community/eslint-config": "^3.2.0",
|
|
55
55
|
"@release-it/conventional-changelog": "^8.0.1",
|
|
56
56
|
"@testing-library/jest-native": "^5.4.3",
|
|
57
|
-
"@testing-library/react-native": "^12.
|
|
57
|
+
"@testing-library/react-native": "^12.5.1",
|
|
58
58
|
"@types/color": "^3.0.6",
|
|
59
59
|
"@types/jest": "^29.5.12",
|
|
60
|
-
"@types/react": "^18.
|
|
60
|
+
"@types/react": "^18.3.3",
|
|
61
61
|
"@types/react-native-vector-icons": "^6.4.18",
|
|
62
|
-
"@types/react-test-renderer": "^18.0
|
|
62
|
+
"@types/react-test-renderer": "^18.3.0",
|
|
63
63
|
"babel-loader": "^9.1.3",
|
|
64
|
-
"caniuse-lite": "^1.0.
|
|
64
|
+
"caniuse-lite": "^1.0.30001641",
|
|
65
65
|
"commitlint": "^18.6.1",
|
|
66
66
|
"eslint": "^8.57.0",
|
|
67
67
|
"eslint-config-prettier": "^9.1.0",
|
|
68
68
|
"eslint-plugin-prettier": "^5.1.3",
|
|
69
|
-
"husky": "^9.0.
|
|
69
|
+
"husky": "^9.0.11",
|
|
70
70
|
"jest": "^29.7.0",
|
|
71
71
|
"metro-react-native-babel-preset": "^0.77.0",
|
|
72
|
-
"pod-install": "^0.2.
|
|
73
|
-
"prettier": "^3.2
|
|
74
|
-
"react": "^18.
|
|
75
|
-
"react-native": "^0.73.
|
|
76
|
-
"react-native-builder-bob": "^0.
|
|
72
|
+
"pod-install": "^0.2.2",
|
|
73
|
+
"prettier": "^3.3.2",
|
|
74
|
+
"react": "^18.3.1",
|
|
75
|
+
"react-native": "^0.73.9",
|
|
76
|
+
"react-native-builder-bob": "^0.26.0",
|
|
77
77
|
"react-native-paper": "^5.12.3",
|
|
78
|
-
"react-native-safe-area-context": "^4.
|
|
79
|
-
"react-native-vector-icons": "^10.0
|
|
80
|
-
"react-test-renderer": "^18.
|
|
81
|
-
"release-it": "^17.
|
|
82
|
-
"typescript": "^5.
|
|
78
|
+
"react-native-safe-area-context": "^4.10.8",
|
|
79
|
+
"react-native-vector-icons": "^10.1.0",
|
|
80
|
+
"react-test-renderer": "^18.3.1",
|
|
81
|
+
"release-it": "^17.5.0",
|
|
82
|
+
"typescript": "^5.5.3"
|
|
83
83
|
},
|
|
84
84
|
"peerDependencies": {
|
|
85
85
|
"react": "*",
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { useEffect, useRef } from 'react'
|
|
2
3
|
import { Animated, StyleSheet, View } from 'react-native'
|
|
3
4
|
import { useTheme } from 'react-native-paper'
|
|
5
|
+
import { sharedStyles } from '../shared/styles'
|
|
4
6
|
|
|
5
7
|
export default function AnimatedCrossView({
|
|
6
8
|
collapsed,
|
|
@@ -12,10 +14,12 @@ export default function AnimatedCrossView({
|
|
|
12
14
|
collapsed: boolean
|
|
13
15
|
}) {
|
|
14
16
|
const theme = useTheme()
|
|
15
|
-
|
|
17
|
+
|
|
18
|
+
const calendarOpacity = useRef<Animated.Value>(
|
|
16
19
|
new Animated.Value(collapsed ? 1 : 0)
|
|
17
20
|
)
|
|
18
|
-
|
|
21
|
+
|
|
22
|
+
useEffect(() => {
|
|
19
23
|
Animated.timing(calendarOpacity.current, {
|
|
20
24
|
toValue: collapsed ? 1 : 0,
|
|
21
25
|
duration: 250,
|
|
@@ -24,11 +28,11 @@ export default function AnimatedCrossView({
|
|
|
24
28
|
}, [collapsed])
|
|
25
29
|
|
|
26
30
|
return (
|
|
27
|
-
<View style={
|
|
31
|
+
<View style={sharedStyles.root}>
|
|
28
32
|
<Animated.View
|
|
29
33
|
pointerEvents={collapsed ? 'auto' : 'none'}
|
|
30
34
|
style={[
|
|
31
|
-
|
|
35
|
+
sharedStyles.root,
|
|
32
36
|
{
|
|
33
37
|
opacity: calendarOpacity.current,
|
|
34
38
|
transform: [
|
|
@@ -78,14 +82,9 @@ export default function AnimatedCrossView({
|
|
|
78
82
|
}
|
|
79
83
|
|
|
80
84
|
const styles = StyleSheet.create({
|
|
81
|
-
root: { flex: 1 },
|
|
82
85
|
calendarEdit: {
|
|
83
86
|
position: 'absolute',
|
|
84
|
-
|
|
85
87
|
left: 0,
|
|
86
88
|
right: 0,
|
|
87
89
|
},
|
|
88
|
-
calendar: {
|
|
89
|
-
flex: 1,
|
|
90
|
-
},
|
|
91
90
|
})
|
package/src/Date/AutoSizer.tsx
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { useCallback, useState } from 'react'
|
|
3
|
+
import { LayoutChangeEvent, View } from 'react-native'
|
|
4
|
+
import { sharedStyles } from '../shared/styles'
|
|
3
5
|
|
|
4
6
|
type WidthAndHeight = {
|
|
5
7
|
width: number
|
|
@@ -11,11 +13,11 @@ export default function AutoSizer({
|
|
|
11
13
|
}: {
|
|
12
14
|
children: ({ width, height }: WidthAndHeight) => any
|
|
13
15
|
}) {
|
|
14
|
-
const [layout, setLayout] =
|
|
15
|
-
|
|
16
|
+
const [layout, setLayout] = useState<WidthAndHeight | null>(null)
|
|
17
|
+
|
|
18
|
+
const onLayout = useCallback(
|
|
16
19
|
(event: LayoutChangeEvent) => {
|
|
17
20
|
const nl = event.nativeEvent.layout
|
|
18
|
-
|
|
19
21
|
// https://github.com/necolas/react-native-web/issues/1704
|
|
20
22
|
if (!layout || layout.width !== nl.width || layout.height !== nl.height) {
|
|
21
23
|
setLayout({ width: nl.width, height: nl.height })
|
|
@@ -23,16 +25,13 @@ export default function AutoSizer({
|
|
|
23
25
|
},
|
|
24
26
|
[layout, setLayout]
|
|
25
27
|
)
|
|
28
|
+
|
|
26
29
|
return (
|
|
27
|
-
<View
|
|
30
|
+
<View
|
|
31
|
+
onLayout={onLayout}
|
|
32
|
+
style={[sharedStyles.overflowHidden, sharedStyles.root, layout && layout]}
|
|
33
|
+
>
|
|
28
34
|
{layout ? children(layout) : null}
|
|
29
35
|
</View>
|
|
30
36
|
)
|
|
31
37
|
}
|
|
32
|
-
|
|
33
|
-
const styles = StyleSheet.create({
|
|
34
|
-
autoSizer: {
|
|
35
|
-
flex: 1,
|
|
36
|
-
overflow: 'hidden',
|
|
37
|
-
},
|
|
38
|
-
})
|
package/src/Date/Calendar.tsx
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { StyleSheet, View } from 'react-native'
|
|
1
|
+
import { View } from 'react-native'
|
|
3
2
|
import Swiper from './Swiper'
|
|
4
3
|
import Month from './Month'
|
|
5
4
|
import {
|
|
@@ -11,11 +10,13 @@ import {
|
|
|
11
10
|
} from './dateUtils'
|
|
12
11
|
|
|
13
12
|
import CalendarHeader from './CalendarHeader'
|
|
14
|
-
import { useCallback, useMemo } from 'react'
|
|
13
|
+
import { memo, useCallback, useMemo, useState } from 'react'
|
|
15
14
|
import YearPicker from './YearPicker'
|
|
16
15
|
import Color from 'color'
|
|
17
16
|
import { useTheme } from 'react-native-paper'
|
|
18
|
-
import { useLatest, lightenBy, darkenBy } from '../utils'
|
|
17
|
+
import { useLatest, lightenBy, darkenBy } from '../shared/utils'
|
|
18
|
+
import React from 'react'
|
|
19
|
+
import { sharedStyles } from '../shared/styles'
|
|
19
20
|
|
|
20
21
|
export type ModeType = 'single' | 'range' | 'multiple'
|
|
21
22
|
|
|
@@ -34,7 +35,6 @@ export type BaseCalendarProps = {
|
|
|
34
35
|
startYear?: number
|
|
35
36
|
endYear?: number
|
|
36
37
|
startWeekOnMonday?: boolean
|
|
37
|
-
|
|
38
38
|
// here they are optional but in final implementation they are required
|
|
39
39
|
date?: CalendarDate
|
|
40
40
|
dates?: CalendarDates
|
|
@@ -98,33 +98,16 @@ function Calendar(
|
|
|
98
98
|
dateMode,
|
|
99
99
|
startWeekOnMonday,
|
|
100
100
|
} = props
|
|
101
|
-
|
|
102
|
-
const theme = useTheme()
|
|
103
|
-
|
|
104
|
-
const selectColor = useMemo<string>(() => {
|
|
105
|
-
if (theme.isV3) {
|
|
106
|
-
return theme.colors.primaryContainer
|
|
107
|
-
}
|
|
108
|
-
if (theme.dark) {
|
|
109
|
-
return darkenBy(Color(theme.colors.primary), 0.1).hex()
|
|
110
|
-
}
|
|
111
|
-
return lightenBy(Color(theme.colors.primary), 0.9).hex()
|
|
112
|
-
}, [theme])
|
|
113
|
-
|
|
114
101
|
const scrollMode =
|
|
115
102
|
mode === 'range' || mode === 'multiple' ? 'vertical' : 'horizontal'
|
|
103
|
+
const firstDate = startDate || date || dates?.[0]
|
|
104
|
+
|
|
105
|
+
const theme = useTheme()
|
|
116
106
|
|
|
117
|
-
const [selectedYear, setSelectedYear] =
|
|
107
|
+
const [selectedYear, setSelectedYear] = useState<number | undefined>(
|
|
118
108
|
undefined
|
|
119
109
|
)
|
|
120
|
-
const [selectingYear, setSelectingYear] =
|
|
121
|
-
const onPressYear = useCallback(
|
|
122
|
-
(year: number) => {
|
|
123
|
-
setSelectedYear(year)
|
|
124
|
-
setSelectingYear((prev) => !prev)
|
|
125
|
-
},
|
|
126
|
-
[setSelectingYear]
|
|
127
|
-
)
|
|
110
|
+
const [selectingYear, setSelectingYear] = useState(false)
|
|
128
111
|
|
|
129
112
|
// prevent re-rendering all months when something changed we only need the
|
|
130
113
|
// latest version of the props and we don't want the useCallback to change
|
|
@@ -135,6 +118,14 @@ function Calendar(
|
|
|
135
118
|
)
|
|
136
119
|
const datesRef = useLatest<CalendarDates>(dates)
|
|
137
120
|
|
|
121
|
+
const onPressYear = useCallback(
|
|
122
|
+
(year: number) => {
|
|
123
|
+
setSelectedYear(year)
|
|
124
|
+
setSelectingYear((prev) => !prev)
|
|
125
|
+
},
|
|
126
|
+
[setSelectingYear]
|
|
127
|
+
)
|
|
128
|
+
|
|
138
129
|
const onPressDate = useCallback(
|
|
139
130
|
(d: Date) => {
|
|
140
131
|
if (mode === 'single') {
|
|
@@ -171,10 +162,18 @@ function Calendar(
|
|
|
171
162
|
[mode, dateMode, onChangeRef, startDateRef, endDateRef, datesRef]
|
|
172
163
|
)
|
|
173
164
|
|
|
174
|
-
const
|
|
165
|
+
const selectColor = useMemo<string>(() => {
|
|
166
|
+
if (theme.isV3) {
|
|
167
|
+
return theme.colors.primaryContainer
|
|
168
|
+
}
|
|
169
|
+
if (theme.dark) {
|
|
170
|
+
return darkenBy(Color(theme.colors.primary), 0.1).hex()
|
|
171
|
+
}
|
|
172
|
+
return lightenBy(Color(theme.colors.primary), 0.9).hex()
|
|
173
|
+
}, [theme])
|
|
175
174
|
|
|
176
175
|
return (
|
|
177
|
-
<View style={
|
|
176
|
+
<View style={sharedStyles.root}>
|
|
178
177
|
<Swiper
|
|
179
178
|
initialIndex={getInitialIndex(firstDate)}
|
|
180
179
|
selectedYear={selectedYear}
|
|
@@ -226,9 +225,4 @@ function Calendar(
|
|
|
226
225
|
)
|
|
227
226
|
}
|
|
228
227
|
|
|
229
|
-
|
|
230
|
-
root: { flex: 1 },
|
|
231
|
-
viewPager: { flex: 1 },
|
|
232
|
-
})
|
|
233
|
-
|
|
234
|
-
export default React.memo(Calendar)
|
|
228
|
+
export default memo(Calendar)
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as React from 'react'
|
|
2
1
|
import {
|
|
3
2
|
View,
|
|
4
3
|
StyleSheet,
|
|
@@ -10,6 +9,9 @@ import type { ModeType, ValidRangeType } from './Calendar'
|
|
|
10
9
|
import type { LocalState } from './DatePickerModalContent'
|
|
11
10
|
|
|
12
11
|
import DatePickerInputWithoutModal from './DatePickerInputWithoutModal'
|
|
12
|
+
import { memo, useCallback, useEffect, useRef } from 'react'
|
|
13
|
+
import React from 'react'
|
|
14
|
+
import { sharedStyles } from '../shared/styles'
|
|
13
15
|
|
|
14
16
|
function CalendarEdit({
|
|
15
17
|
mode,
|
|
@@ -34,12 +36,12 @@ function CalendarEdit({
|
|
|
34
36
|
locale: string
|
|
35
37
|
inputEnabled?: boolean
|
|
36
38
|
}) {
|
|
37
|
-
const dateInput =
|
|
38
|
-
const startInput =
|
|
39
|
-
const endInput =
|
|
39
|
+
const dateInput = useRef<TextInputNative | null>(null)
|
|
40
|
+
const startInput = useRef<TextInputNative | null>(null)
|
|
41
|
+
const endInput = useRef<TextInputNative | null>(null)
|
|
40
42
|
|
|
41
43
|
// when switching views focus, or un-focus text input
|
|
42
|
-
|
|
44
|
+
useEffect(() => {
|
|
43
45
|
// hide open keyboard
|
|
44
46
|
if (collapsed) {
|
|
45
47
|
Keyboard.dismiss()
|
|
@@ -62,17 +64,17 @@ function CalendarEdit({
|
|
|
62
64
|
}
|
|
63
65
|
}, [mode, startInput, endInput, dateInput, collapsed])
|
|
64
66
|
|
|
65
|
-
const onSubmitStartInput =
|
|
67
|
+
const onSubmitStartInput = useCallback(() => {
|
|
66
68
|
if (endInput.current) {
|
|
67
69
|
endInput.current.focus()
|
|
68
70
|
}
|
|
69
71
|
}, [endInput])
|
|
70
72
|
|
|
71
|
-
const onSubmitEndInput =
|
|
73
|
+
const onSubmitEndInput = useCallback(() => {
|
|
72
74
|
// TODO: close modal and persist range
|
|
73
75
|
}, [])
|
|
74
76
|
|
|
75
|
-
const onSubmitInput =
|
|
77
|
+
const onSubmitInput = useCallback(() => {
|
|
76
78
|
// TODO: close modal and persist range
|
|
77
79
|
}, [])
|
|
78
80
|
|
|
@@ -94,7 +96,7 @@ function CalendarEdit({
|
|
|
94
96
|
/>
|
|
95
97
|
) : null}
|
|
96
98
|
{mode === 'range' ? (
|
|
97
|
-
<View style={
|
|
99
|
+
<View style={sharedStyles.flexDirectionRow}>
|
|
98
100
|
<DatePickerInputWithoutModal
|
|
99
101
|
inputMode="start"
|
|
100
102
|
ref={startInput}
|
|
@@ -130,11 +132,12 @@ function CalendarEdit({
|
|
|
130
132
|
}
|
|
131
133
|
|
|
132
134
|
const styles = StyleSheet.create({
|
|
133
|
-
root: {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
135
|
+
root: {
|
|
136
|
+
padding: 12,
|
|
137
|
+
},
|
|
138
|
+
separator: {
|
|
139
|
+
width: 12,
|
|
140
|
+
},
|
|
138
141
|
})
|
|
139
142
|
|
|
140
|
-
export default
|
|
143
|
+
export default memo(CalendarEdit)
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import * as React from 'react'
|
|
2
1
|
import { StyleSheet, View } from 'react-native'
|
|
3
2
|
import { IconButton, useTheme } from 'react-native-paper'
|
|
4
3
|
import DayNames, { dayNamesHeight } from './DayNames'
|
|
5
4
|
import type { DisableWeekDaysType } from './dateUtils'
|
|
6
5
|
import { getTranslation } from '../translations/utils'
|
|
6
|
+
import { sharedStyles } from '../shared/styles'
|
|
7
|
+
import React, { memo } from 'react'
|
|
7
8
|
|
|
8
9
|
const buttonContainerHeight = 56
|
|
9
10
|
const buttonContainerMarginTop = 4
|
|
@@ -36,31 +37,23 @@ function CalendarHeader({
|
|
|
36
37
|
disableWeekDays?: DisableWeekDaysType
|
|
37
38
|
startWeekOnMonday: boolean
|
|
38
39
|
}) {
|
|
39
|
-
const theme = useTheme()
|
|
40
40
|
const isHorizontal = scrollMode === 'horizontal'
|
|
41
|
+
|
|
42
|
+
const theme = useTheme()
|
|
43
|
+
|
|
41
44
|
return (
|
|
42
45
|
<View style={styles.datePickerHeader} pointerEvents={'box-none'}>
|
|
43
46
|
{isHorizontal ? (
|
|
44
47
|
<View style={styles.buttonContainer} pointerEvents={'box-none'}>
|
|
45
|
-
<View style={
|
|
46
|
-
<View
|
|
47
|
-
style={[
|
|
48
|
-
styles.buttonWrapper,
|
|
49
|
-
{ backgroundColor: theme.colors.surface },
|
|
50
|
-
]}
|
|
51
|
-
>
|
|
48
|
+
<View style={sharedStyles.root} pointerEvents={'box-none'} />
|
|
49
|
+
<View style={{ backgroundColor: theme.colors.surface }}>
|
|
52
50
|
<IconButton
|
|
53
51
|
icon="chevron-left"
|
|
54
52
|
accessibilityLabel={getTranslation(locale, 'previous')}
|
|
55
53
|
onPress={onPrev}
|
|
56
54
|
/>
|
|
57
55
|
</View>
|
|
58
|
-
<View
|
|
59
|
-
style={[
|
|
60
|
-
styles.buttonWrapper,
|
|
61
|
-
{ backgroundColor: theme.colors.surface },
|
|
62
|
-
]}
|
|
63
|
-
>
|
|
56
|
+
<View style={{ backgroundColor: theme.colors.surface }}>
|
|
64
57
|
<IconButton
|
|
65
58
|
icon="chevron-right"
|
|
66
59
|
accessibilityLabel={getTranslation(locale, 'next')}
|
|
@@ -93,8 +86,6 @@ const styles = StyleSheet.create({
|
|
|
93
86
|
flexDirection: 'row',
|
|
94
87
|
alignItems: 'center',
|
|
95
88
|
},
|
|
96
|
-
buttonWrapper: {},
|
|
97
|
-
spacer: { flex: 1 },
|
|
98
89
|
})
|
|
99
90
|
|
|
100
|
-
export default
|
|
91
|
+
export default memo(CalendarHeader)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { ComponentProps, CSSProperties } from 'react'
|
|
1
2
|
import type { ValidRangeType } from './Calendar'
|
|
2
|
-
import type * as React from 'react'
|
|
3
3
|
import type { TextInput } from 'react-native-paper'
|
|
4
4
|
|
|
5
5
|
export type DatePickerInputProps = {
|
|
@@ -15,7 +15,7 @@ export type DatePickerInputProps = {
|
|
|
15
15
|
onValidationError?: ((error: string | null) => void) | undefined
|
|
16
16
|
calendarIcon?: string
|
|
17
17
|
iconSize?: number
|
|
18
|
-
iconStyle?:
|
|
18
|
+
iconStyle?: CSSProperties
|
|
19
19
|
iconColor?: string
|
|
20
20
|
saveLabel?: string
|
|
21
21
|
saveLabelDisabled?: boolean
|
|
@@ -29,6 +29,6 @@ export type DatePickerInputProps = {
|
|
|
29
29
|
presentationStyle?: 'pageSheet' | 'overFullScreen'
|
|
30
30
|
startWeekOnMonday?: boolean
|
|
31
31
|
} & Omit<
|
|
32
|
-
|
|
32
|
+
ComponentProps<typeof TextInput>,
|
|
33
33
|
'value' | 'onChange' | 'onChangeText' | 'inputMode'
|
|
34
34
|
>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as React from 'react'
|
|
2
|
-
|
|
3
1
|
import { TextInput } from 'react-native-paper'
|
|
4
2
|
import DatePickerModal from './DatePickerModal'
|
|
5
|
-
import { useLatest } from '../utils'
|
|
3
|
+
import { useLatest } from '../shared/utils'
|
|
6
4
|
import type { DatePickerInputProps } from './DatePickerInput.shared'
|
|
7
5
|
import DatePickerInputWithoutModal from './DatePickerInputWithoutModal'
|
|
8
6
|
import { Platform, StyleProp, ViewStyle } from 'react-native'
|
|
7
|
+
import { forwardRef, useCallback, useState } from 'react'
|
|
8
|
+
import React from 'react'
|
|
9
9
|
|
|
10
10
|
function DatePickerInput(
|
|
11
11
|
{
|
|
@@ -17,12 +17,15 @@ function DatePickerInput(
|
|
|
17
17
|
}: DatePickerInputProps,
|
|
18
18
|
ref: any
|
|
19
19
|
) {
|
|
20
|
-
const [visible, setVisible] =
|
|
21
|
-
|
|
20
|
+
const [visible, setVisible] = useState(false)
|
|
21
|
+
|
|
22
|
+
const onChangeRef = useLatest(rest.onChange)
|
|
23
|
+
|
|
24
|
+
const onDismiss = useCallback(() => {
|
|
22
25
|
setVisible(false)
|
|
23
26
|
}, [setVisible])
|
|
24
|
-
|
|
25
|
-
const onInnerConfirm =
|
|
27
|
+
|
|
28
|
+
const onInnerConfirm = useCallback(
|
|
26
29
|
({ date }: any) => {
|
|
27
30
|
setVisible(false)
|
|
28
31
|
onChangeRef.current(date)
|
|
@@ -91,4 +94,4 @@ function DatePickerInput(
|
|
|
91
94
|
)
|
|
92
95
|
}
|
|
93
96
|
|
|
94
|
-
export default
|
|
97
|
+
export default forwardRef(DatePickerInput)
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import * as React from 'react'
|
|
2
|
-
|
|
3
1
|
import TextInputWithMask from '../TextInputMask'
|
|
4
2
|
import { HelperText, useTheme } from 'react-native-paper'
|
|
5
3
|
import { View, StyleSheet } from 'react-native'
|
|
6
4
|
import useDateInput from './inputUtils'
|
|
7
5
|
import type { DatePickerInputProps } from './DatePickerInput.shared'
|
|
6
|
+
import React, { forwardRef, ReactNode } from 'react'
|
|
8
7
|
|
|
9
8
|
function DatePickerInputWithoutModal(
|
|
10
9
|
{
|
|
@@ -46,7 +45,7 @@ function DatePickerInputWithoutModal(
|
|
|
46
45
|
disableStatusBarPadding: DatePickerInputProps['disableStatusBarPadding']
|
|
47
46
|
startWeekOnMonday?: DatePickerInputProps['startWeekOnMonday']
|
|
48
47
|
}) => any
|
|
49
|
-
inputButton?:
|
|
48
|
+
inputButton?: ReactNode
|
|
50
49
|
},
|
|
51
50
|
ref: any
|
|
52
51
|
) {
|
|
@@ -161,4 +160,4 @@ const styles = StyleSheet.create({
|
|
|
161
160
|
width: '100%',
|
|
162
161
|
},
|
|
163
162
|
})
|
|
164
|
-
export default
|
|
163
|
+
export default forwardRef(DatePickerInputWithoutModal)
|