rn-grid-date-time-picker 1.0.0 → 1.2.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/CHANGELOG.md +86 -0
- package/README.md +100 -638
- package/lib/commonjs/adapters/utcMidnight.js +15 -6
- package/lib/commonjs/adapters/utcMidnight.js.map +1 -1
- package/lib/commonjs/components/DateTimePicker.js +484 -85
- package/lib/commonjs/components/DateTimePicker.js.map +1 -1
- package/lib/commonjs/components/calendar/Calendar.js +21 -7
- package/lib/commonjs/components/calendar/Calendar.js.map +1 -1
- package/lib/commonjs/components/calendar/CalendarHeader.js +46 -6
- package/lib/commonjs/components/calendar/CalendarHeader.js.map +1 -1
- package/lib/commonjs/components/calendar/CalendarSwitch.js +150 -0
- package/lib/commonjs/components/calendar/CalendarSwitch.js.map +1 -0
- package/lib/commonjs/components/calendar/DayCell.js +8 -3
- package/lib/commonjs/components/calendar/DayCell.js.map +1 -1
- package/lib/commonjs/components/calendar/DayGrid.js +13 -2
- package/lib/commonjs/components/calendar/DayGrid.js.map +1 -1
- package/lib/commonjs/components/calendar/PeriodGrid.js +3 -1
- package/lib/commonjs/components/calendar/PeriodGrid.js.map +1 -1
- package/lib/commonjs/components/calendar/calendarStyles.js +3 -2
- package/lib/commonjs/components/calendar/calendarStyles.js.map +1 -1
- package/lib/commonjs/components/calendar/localeNames.js +46 -24
- package/lib/commonjs/components/calendar/localeNames.js.map +1 -1
- package/lib/commonjs/components/calendar/selection.js +9 -1
- package/lib/commonjs/components/calendar/selection.js.map +1 -1
- package/lib/commonjs/components/container/DefaultSheet.js +42 -11
- package/lib/commonjs/components/container/DefaultSheet.js.map +1 -1
- package/lib/commonjs/components/container/PickerContainer.js +4 -0
- package/lib/commonjs/components/container/PickerContainer.js.map +1 -1
- package/lib/commonjs/components/container/PickerLayout.js +1 -1
- package/lib/commonjs/components/container/PickerLayout.js.map +1 -1
- package/lib/commonjs/components/container/containerStyles.js +12 -4
- package/lib/commonjs/components/container/containerStyles.js.map +1 -1
- package/lib/commonjs/components/field/RangeFields.js +5 -1
- package/lib/commonjs/components/field/RangeFields.js.map +1 -1
- package/lib/commonjs/components/field/SegmentedInput.js +8 -3
- package/lib/commonjs/components/field/SegmentedInput.js.map +1 -1
- package/lib/commonjs/components/field/ValueField.js +64 -8
- package/lib/commonjs/components/field/ValueField.js.map +1 -1
- package/lib/commonjs/components/field/fieldStyles.js +17 -0
- package/lib/commonjs/components/field/fieldStyles.js.map +1 -1
- package/lib/commonjs/components/field/fieldText.js +29 -13
- package/lib/commonjs/components/field/fieldText.js.map +1 -1
- package/lib/commonjs/components/hooks/useBottomInset.js +32 -0
- package/lib/commonjs/components/hooks/useBottomInset.js.map +1 -0
- package/lib/commonjs/components/hooks/useKeyboardFold.js +36 -13
- package/lib/commonjs/components/hooks/useKeyboardFold.js.map +1 -1
- package/lib/commonjs/components/hooks/useOpenPicker.js +39 -17
- package/lib/commonjs/components/hooks/useOpenPicker.js.map +1 -1
- package/lib/commonjs/components/hooks/useTypedSegments.js +6 -2
- package/lib/commonjs/components/hooks/useTypedSegments.js.map +1 -1
- package/lib/commonjs/components/theme/defaultStrings.js +13 -3
- package/lib/commonjs/components/theme/defaultStrings.js.map +1 -1
- package/lib/commonjs/components/theme/direction.js +17 -0
- package/lib/commonjs/components/theme/direction.js.map +1 -0
- package/lib/commonjs/components/theme/numerals.js +16 -0
- package/lib/commonjs/components/theme/numerals.js.map +1 -0
- package/lib/commonjs/components/theme/styleKeys.js +10 -2
- package/lib/commonjs/components/theme/styleKeys.js.map +1 -1
- package/lib/commonjs/components/theme/tokens.js +4 -0
- package/lib/commonjs/components/theme/tokens.js.map +1 -1
- package/lib/commonjs/components/time/TimeRow.js +10 -2
- package/lib/commonjs/components/time/TimeRow.js.map +1 -1
- package/lib/commonjs/components/time/TypedTime.js +3 -1
- package/lib/commonjs/components/time/TypedTime.js.map +1 -1
- package/lib/commonjs/components/time/Wheel.js +20 -3
- package/lib/commonjs/components/time/Wheel.js.map +1 -1
- package/lib/commonjs/components/time/timeStyles.js +4 -5
- package/lib/commonjs/components/time/timeStyles.js.map +1 -1
- package/lib/commonjs/components/types.js +10 -0
- package/lib/commonjs/components/types.js.map +1 -1
- package/lib/commonjs/core/calendarSystem.js +123 -22
- package/lib/commonjs/core/calendarSystem.js.map +1 -1
- package/lib/commonjs/core/digits.js +25 -0
- package/lib/commonjs/core/digits.js.map +1 -0
- package/lib/commonjs/core/draft.js +31 -10
- package/lib/commonjs/core/draft.js.map +1 -1
- package/lib/commonjs/core/locale.js +20 -4
- package/lib/commonjs/core/locale.js.map +1 -1
- package/lib/commonjs/core/numerals.js +46 -0
- package/lib/commonjs/core/numerals.js.map +1 -0
- package/lib/commonjs/core/segmentEditor.js +9 -0
- package/lib/commonjs/core/segmentEditor.js.map +1 -1
- package/lib/commonjs/core/segments.js +2 -11
- package/lib/commonjs/core/segments.js.map +1 -1
- package/lib/commonjs/core/selectionRules.js +2 -1
- package/lib/commonjs/core/selectionRules.js.map +1 -1
- package/lib/commonjs/core/timeEntry.js +7 -91
- package/lib/commonjs/core/timeEntry.js.map +1 -1
- package/lib/commonjs/icons/index.js +5 -1
- package/lib/commonjs/icons/index.js.map +1 -1
- package/lib/commonjs/index.js +20 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/adapters/utcMidnight.js +14 -5
- package/lib/module/adapters/utcMidnight.js.map +1 -1
- package/lib/module/components/DateTimePicker.js +490 -91
- package/lib/module/components/DateTimePicker.js.map +1 -1
- package/lib/module/components/calendar/Calendar.js +25 -11
- package/lib/module/components/calendar/Calendar.js.map +1 -1
- package/lib/module/components/calendar/CalendarHeader.js +47 -7
- package/lib/module/components/calendar/CalendarHeader.js.map +1 -1
- package/lib/module/components/calendar/CalendarSwitch.js +145 -0
- package/lib/module/components/calendar/CalendarSwitch.js.map +1 -0
- package/lib/module/components/calendar/DayCell.js +8 -3
- package/lib/module/components/calendar/DayCell.js.map +1 -1
- package/lib/module/components/calendar/DayGrid.js +14 -3
- package/lib/module/components/calendar/DayGrid.js.map +1 -1
- package/lib/module/components/calendar/PeriodGrid.js +3 -1
- package/lib/module/components/calendar/PeriodGrid.js.map +1 -1
- package/lib/module/components/calendar/calendarStyles.js +3 -2
- package/lib/module/components/calendar/calendarStyles.js.map +1 -1
- package/lib/module/components/calendar/localeNames.js +46 -24
- package/lib/module/components/calendar/localeNames.js.map +1 -1
- package/lib/module/components/calendar/selection.js +7 -0
- package/lib/module/components/calendar/selection.js.map +1 -1
- package/lib/module/components/container/DefaultSheet.js +42 -12
- package/lib/module/components/container/DefaultSheet.js.map +1 -1
- package/lib/module/components/container/PickerContainer.js +4 -0
- package/lib/module/components/container/PickerContainer.js.map +1 -1
- package/lib/module/components/container/PickerLayout.js +1 -1
- package/lib/module/components/container/PickerLayout.js.map +1 -1
- package/lib/module/components/container/containerStyles.js +11 -3
- package/lib/module/components/container/containerStyles.js.map +1 -1
- package/lib/module/components/field/RangeFields.js +5 -1
- package/lib/module/components/field/RangeFields.js.map +1 -1
- package/lib/module/components/field/SegmentedInput.js +8 -3
- package/lib/module/components/field/SegmentedInput.js.map +1 -1
- package/lib/module/components/field/ValueField.js +66 -10
- package/lib/module/components/field/ValueField.js.map +1 -1
- package/lib/module/components/field/fieldStyles.js +17 -0
- package/lib/module/components/field/fieldStyles.js.map +1 -1
- package/lib/module/components/field/fieldText.js +28 -11
- package/lib/module/components/field/fieldText.js.map +1 -1
- package/lib/module/components/hooks/useBottomInset.js +27 -0
- package/lib/module/components/hooks/useBottomInset.js.map +1 -0
- package/lib/module/components/hooks/useKeyboardFold.js +33 -12
- package/lib/module/components/hooks/useKeyboardFold.js.map +1 -1
- package/lib/module/components/hooks/useOpenPicker.js +39 -17
- package/lib/module/components/hooks/useOpenPicker.js.map +1 -1
- package/lib/module/components/hooks/useTypedSegments.js +6 -2
- package/lib/module/components/hooks/useTypedSegments.js.map +1 -1
- package/lib/module/components/theme/defaultStrings.js +11 -2
- package/lib/module/components/theme/defaultStrings.js.map +1 -1
- package/lib/module/components/theme/direction.js +13 -0
- package/lib/module/components/theme/direction.js.map +1 -0
- package/lib/module/components/theme/numerals.js +12 -0
- package/lib/module/components/theme/numerals.js.map +1 -0
- package/lib/module/components/theme/styleKeys.js +10 -2
- package/lib/module/components/theme/styleKeys.js.map +1 -1
- package/lib/module/components/theme/tokens.js +4 -0
- package/lib/module/components/theme/tokens.js.map +1 -1
- package/lib/module/components/time/TimeRow.js +11 -3
- package/lib/module/components/time/TimeRow.js.map +1 -1
- package/lib/module/components/time/TypedTime.js +3 -1
- package/lib/module/components/time/TypedTime.js.map +1 -1
- package/lib/module/components/time/Wheel.js +18 -2
- package/lib/module/components/time/Wheel.js.map +1 -1
- package/lib/module/components/time/timeStyles.js +4 -5
- package/lib/module/components/time/timeStyles.js.map +1 -1
- package/lib/module/components/types.js +10 -0
- package/lib/module/components/types.js.map +1 -1
- package/lib/module/core/calendarSystem.js +118 -19
- package/lib/module/core/calendarSystem.js.map +1 -1
- package/lib/module/core/digits.js +20 -0
- package/lib/module/core/digits.js.map +1 -0
- package/lib/module/core/draft.js +29 -9
- package/lib/module/core/draft.js.map +1 -1
- package/lib/module/core/locale.js +18 -3
- package/lib/module/core/locale.js.map +1 -1
- package/lib/module/core/numerals.js +39 -0
- package/lib/module/core/numerals.js.map +1 -0
- package/lib/module/core/segmentEditor.js +9 -0
- package/lib/module/core/segmentEditor.js.map +1 -1
- package/lib/module/core/segments.js +0 -8
- package/lib/module/core/segments.js.map +1 -1
- package/lib/module/core/selectionRules.js +2 -1
- package/lib/module/core/selectionRules.js.map +1 -1
- package/lib/module/core/timeEntry.js +7 -89
- package/lib/module/core/timeEntry.js.map +1 -1
- package/lib/module/icons/index.js +5 -1
- package/lib/module/icons/index.js.map +1 -1
- package/lib/module/index.js +2 -0
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/commonjs/src/adapters/utcMidnight.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/DateTimePicker.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/calendar/Calendar.d.ts +8 -4
- package/lib/typescript/commonjs/src/components/calendar/Calendar.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/calendar/CalendarHeader.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/calendar/CalendarSwitch.d.ts +26 -0
- package/lib/typescript/commonjs/src/components/calendar/CalendarSwitch.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/calendar/DayCell.d.ts +1 -1
- package/lib/typescript/commonjs/src/components/calendar/DayCell.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/calendar/DayGrid.d.ts +2 -0
- package/lib/typescript/commonjs/src/components/calendar/DayGrid.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/calendar/PeriodGrid.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/calendar/calendarStyles.d.ts +1 -1
- package/lib/typescript/commonjs/src/components/calendar/calendarStyles.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/calendar/localeNames.d.ts +8 -3
- package/lib/typescript/commonjs/src/components/calendar/localeNames.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/calendar/selection.d.ts +2 -0
- package/lib/typescript/commonjs/src/components/calendar/selection.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/container/DefaultSheet.d.ts +10 -2
- package/lib/typescript/commonjs/src/components/container/DefaultSheet.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/container/PickerContainer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/container/containerStyles.d.ts +6 -0
- package/lib/typescript/commonjs/src/components/container/containerStyles.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/field/RangeFields.d.ts +5 -0
- package/lib/typescript/commonjs/src/components/field/RangeFields.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/field/SegmentedInput.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/field/ValueField.d.ts +7 -0
- package/lib/typescript/commonjs/src/components/field/ValueField.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/field/fieldStyles.d.ts +15 -0
- package/lib/typescript/commonjs/src/components/field/fieldStyles.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/field/fieldText.d.ts +14 -5
- package/lib/typescript/commonjs/src/components/field/fieldText.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/hooks/useBottomInset.d.ts +8 -0
- package/lib/typescript/commonjs/src/components/hooks/useBottomInset.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/hooks/useKeyboardFold.d.ts +10 -2
- package/lib/typescript/commonjs/src/components/hooks/useKeyboardFold.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/hooks/useOpenPicker.d.ts +2 -1
- package/lib/typescript/commonjs/src/components/hooks/useOpenPicker.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/hooks/useTypedSegments.d.ts +3 -2
- package/lib/typescript/commonjs/src/components/hooks/useTypedSegments.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/theme/defaultStrings.d.ts +13 -2
- package/lib/typescript/commonjs/src/components/theme/defaultStrings.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/theme/direction.d.ts +8 -0
- package/lib/typescript/commonjs/src/components/theme/direction.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/theme/numerals.d.ts +7 -0
- package/lib/typescript/commonjs/src/components/theme/numerals.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/theme/styleKeys.d.ts +1 -1
- package/lib/typescript/commonjs/src/components/theme/styleKeys.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/theme/tokens.d.ts +3 -1
- package/lib/typescript/commonjs/src/components/theme/tokens.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/time/TimeRow.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/time/TypedTime.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/time/Wheel.d.ts +5 -0
- package/lib/typescript/commonjs/src/components/time/Wheel.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/time/timeStyles.d.ts +0 -2
- package/lib/typescript/commonjs/src/components/time/timeStyles.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/types.d.ts +84 -4
- package/lib/typescript/commonjs/src/components/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/core/calendarSystem.d.ts +20 -5
- package/lib/typescript/commonjs/src/core/calendarSystem.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/core/digits.d.ts +3 -0
- package/lib/typescript/commonjs/src/core/digits.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/core/draft.d.ts +12 -1
- package/lib/typescript/commonjs/src/core/draft.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/core/locale.d.ts +6 -0
- package/lib/typescript/commonjs/src/core/locale.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/core/numerals.d.ts +15 -0
- package/lib/typescript/commonjs/src/core/numerals.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/core/segmentEditor.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/core/segments.d.ts +0 -2
- package/lib/typescript/commonjs/src/core/segments.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/core/selectionRules.d.ts +3 -2
- package/lib/typescript/commonjs/src/core/selectionRules.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/core/timeEntry.d.ts +4 -24
- package/lib/typescript/commonjs/src/core/timeEntry.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/icons/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts +7 -3
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/adapters/utcMidnight.d.ts.map +1 -1
- package/lib/typescript/module/src/components/DateTimePicker.d.ts.map +1 -1
- package/lib/typescript/module/src/components/calendar/Calendar.d.ts +8 -4
- package/lib/typescript/module/src/components/calendar/Calendar.d.ts.map +1 -1
- package/lib/typescript/module/src/components/calendar/CalendarHeader.d.ts.map +1 -1
- package/lib/typescript/module/src/components/calendar/CalendarSwitch.d.ts +26 -0
- package/lib/typescript/module/src/components/calendar/CalendarSwitch.d.ts.map +1 -0
- package/lib/typescript/module/src/components/calendar/DayCell.d.ts +1 -1
- package/lib/typescript/module/src/components/calendar/DayCell.d.ts.map +1 -1
- package/lib/typescript/module/src/components/calendar/DayGrid.d.ts +2 -0
- package/lib/typescript/module/src/components/calendar/DayGrid.d.ts.map +1 -1
- package/lib/typescript/module/src/components/calendar/PeriodGrid.d.ts.map +1 -1
- package/lib/typescript/module/src/components/calendar/calendarStyles.d.ts +1 -1
- package/lib/typescript/module/src/components/calendar/calendarStyles.d.ts.map +1 -1
- package/lib/typescript/module/src/components/calendar/localeNames.d.ts +8 -3
- package/lib/typescript/module/src/components/calendar/localeNames.d.ts.map +1 -1
- package/lib/typescript/module/src/components/calendar/selection.d.ts +2 -0
- package/lib/typescript/module/src/components/calendar/selection.d.ts.map +1 -1
- package/lib/typescript/module/src/components/container/DefaultSheet.d.ts +10 -2
- package/lib/typescript/module/src/components/container/DefaultSheet.d.ts.map +1 -1
- package/lib/typescript/module/src/components/container/PickerContainer.d.ts.map +1 -1
- package/lib/typescript/module/src/components/container/containerStyles.d.ts +6 -0
- package/lib/typescript/module/src/components/container/containerStyles.d.ts.map +1 -1
- package/lib/typescript/module/src/components/field/RangeFields.d.ts +5 -0
- package/lib/typescript/module/src/components/field/RangeFields.d.ts.map +1 -1
- package/lib/typescript/module/src/components/field/SegmentedInput.d.ts.map +1 -1
- package/lib/typescript/module/src/components/field/ValueField.d.ts +7 -0
- package/lib/typescript/module/src/components/field/ValueField.d.ts.map +1 -1
- package/lib/typescript/module/src/components/field/fieldStyles.d.ts +15 -0
- package/lib/typescript/module/src/components/field/fieldStyles.d.ts.map +1 -1
- package/lib/typescript/module/src/components/field/fieldText.d.ts +14 -5
- package/lib/typescript/module/src/components/field/fieldText.d.ts.map +1 -1
- package/lib/typescript/module/src/components/hooks/useBottomInset.d.ts +8 -0
- package/lib/typescript/module/src/components/hooks/useBottomInset.d.ts.map +1 -0
- package/lib/typescript/module/src/components/hooks/useKeyboardFold.d.ts +10 -2
- package/lib/typescript/module/src/components/hooks/useKeyboardFold.d.ts.map +1 -1
- package/lib/typescript/module/src/components/hooks/useOpenPicker.d.ts +2 -1
- package/lib/typescript/module/src/components/hooks/useOpenPicker.d.ts.map +1 -1
- package/lib/typescript/module/src/components/hooks/useTypedSegments.d.ts +3 -2
- package/lib/typescript/module/src/components/hooks/useTypedSegments.d.ts.map +1 -1
- package/lib/typescript/module/src/components/theme/defaultStrings.d.ts +13 -2
- package/lib/typescript/module/src/components/theme/defaultStrings.d.ts.map +1 -1
- package/lib/typescript/module/src/components/theme/direction.d.ts +8 -0
- package/lib/typescript/module/src/components/theme/direction.d.ts.map +1 -0
- package/lib/typescript/module/src/components/theme/numerals.d.ts +7 -0
- package/lib/typescript/module/src/components/theme/numerals.d.ts.map +1 -0
- package/lib/typescript/module/src/components/theme/styleKeys.d.ts +1 -1
- package/lib/typescript/module/src/components/theme/styleKeys.d.ts.map +1 -1
- package/lib/typescript/module/src/components/theme/tokens.d.ts +3 -1
- package/lib/typescript/module/src/components/theme/tokens.d.ts.map +1 -1
- package/lib/typescript/module/src/components/time/TimeRow.d.ts.map +1 -1
- package/lib/typescript/module/src/components/time/TypedTime.d.ts.map +1 -1
- package/lib/typescript/module/src/components/time/Wheel.d.ts +5 -0
- package/lib/typescript/module/src/components/time/Wheel.d.ts.map +1 -1
- package/lib/typescript/module/src/components/time/timeStyles.d.ts +0 -2
- package/lib/typescript/module/src/components/time/timeStyles.d.ts.map +1 -1
- package/lib/typescript/module/src/components/types.d.ts +84 -4
- package/lib/typescript/module/src/components/types.d.ts.map +1 -1
- package/lib/typescript/module/src/core/calendarSystem.d.ts +20 -5
- package/lib/typescript/module/src/core/calendarSystem.d.ts.map +1 -1
- package/lib/typescript/module/src/core/digits.d.ts +3 -0
- package/lib/typescript/module/src/core/digits.d.ts.map +1 -0
- package/lib/typescript/module/src/core/draft.d.ts +12 -1
- package/lib/typescript/module/src/core/draft.d.ts.map +1 -1
- package/lib/typescript/module/src/core/locale.d.ts +6 -0
- package/lib/typescript/module/src/core/locale.d.ts.map +1 -1
- package/lib/typescript/module/src/core/numerals.d.ts +15 -0
- package/lib/typescript/module/src/core/numerals.d.ts.map +1 -0
- package/lib/typescript/module/src/core/segmentEditor.d.ts.map +1 -1
- package/lib/typescript/module/src/core/segments.d.ts +0 -2
- package/lib/typescript/module/src/core/segments.d.ts.map +1 -1
- package/lib/typescript/module/src/core/selectionRules.d.ts +3 -2
- package/lib/typescript/module/src/core/selectionRules.d.ts.map +1 -1
- package/lib/typescript/module/src/core/timeEntry.d.ts +4 -24
- package/lib/typescript/module/src/core/timeEntry.d.ts.map +1 -1
- package/lib/typescript/module/src/icons/index.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +7 -3
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/package.json +22 -7
- package/src/adapters/utcMidnight.ts +14 -5
- package/src/components/DateTimePicker.tsx +607 -108
- package/src/components/calendar/Calendar.tsx +54 -16
- package/src/components/calendar/CalendarHeader.tsx +41 -9
- package/src/components/calendar/CalendarSwitch.tsx +170 -0
- package/src/components/calendar/DayCell.tsx +16 -4
- package/src/components/calendar/DayGrid.tsx +18 -3
- package/src/components/calendar/PeriodGrid.tsx +3 -1
- package/src/components/calendar/calendarStyles.ts +3 -2
- package/src/components/calendar/localeNames.ts +52 -22
- package/src/components/calendar/selection.ts +8 -0
- package/src/components/container/DefaultSheet.tsx +60 -14
- package/src/components/container/PickerContainer.tsx +4 -0
- package/src/components/container/PickerLayout.tsx +1 -1
- package/src/components/container/containerStyles.ts +12 -3
- package/src/components/field/RangeFields.tsx +12 -2
- package/src/components/field/SegmentedInput.tsx +8 -3
- package/src/components/field/ValueField.tsx +94 -18
- package/src/components/field/fieldStyles.ts +6 -0
- package/src/components/field/fieldText.ts +68 -15
- package/src/components/hooks/useBottomInset.ts +33 -0
- package/src/components/hooks/useKeyboardFold.ts +41 -13
- package/src/components/hooks/useOpenPicker.ts +41 -18
- package/src/components/hooks/useTypedSegments.ts +7 -3
- package/src/components/theme/defaultStrings.ts +29 -4
- package/src/components/theme/direction.ts +12 -0
- package/src/components/theme/numerals.ts +11 -0
- package/src/components/theme/styleKeys.ts +18 -1
- package/src/components/theme/tokens.ts +5 -1
- package/src/components/time/TimeRow.tsx +23 -3
- package/src/components/time/TypedTime.tsx +3 -1
- package/src/components/time/Wheel.tsx +19 -5
- package/src/components/time/timeStyles.ts +2 -3
- package/src/components/types.ts +86 -4
- package/src/core/calendarSystem.ts +145 -21
- package/src/core/digits.ts +21 -0
- package/src/core/draft.ts +41 -13
- package/src/core/locale.ts +20 -3
- package/src/core/numerals.ts +35 -0
- package/src/core/segmentEditor.ts +13 -0
- package/src/core/segments.ts +0 -8
- package/src/core/selectionRules.ts +3 -2
- package/src/core/timeEntry.ts +6 -96
- package/src/icons/index.tsx +3 -1
- package/src/index.tsx +12 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segments.d.ts","sourceRoot":"","sources":["../../../../../src/core/segments.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EACb,UAAU,EAEV,UAAU,EACX,MAAM,YAAS,CAAC;AAEjB;;;;GAIG;AAEH,MAAM,MAAM,UAAU,GACpB,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAC1D,MAAM,MAAM,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;AAEjC,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,UAAU,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,sFAAsF;IACtF,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,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,QAAQ,MAAM,KAAG,MAChB,CAAC;AAK7C,8CAA8C;AAC9C,eAAO,MAAM,cAAc,GACzB,OAAO,aAAa,GAAG,IAAI,EAC3B,MAAM,UAAU,EAChB,YAAY,UAAU,KACrB,aAkBF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,UAAU,GACrB,SAAS,MAAM,EACf,OAAO,MAAM,EACb,MAAM,WAAW,KAChB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAQlC,CAAC;AAEF,8FAA8F;AAC9F,eAAO,MAAM,UAAU,GAAI,MAAM,MAAM,EAAE,MAAM,WAAW,KAAG,MAS5D,CAAC;AAKF;;;;GAIG;AACH,eAAO,MAAM,aAAa,GACxB,QAAQ,aAAa,EACrB,SAAS;IACP,IAAI,EAAE,UAAU,CAAC;IACjB,UAAU,EAAE,UAAU,CAAC;IACvB,SAAS,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CAC7C,KACA,cAsEF,CAAC"}
|
|
@@ -5,7 +5,8 @@ import type { CalendarDate } from './types.js';
|
|
|
5
5
|
* - range: once a start is picked and the end is being chosen, days closer than
|
|
6
6
|
* `minDays` or further than `maxDays` are greyed (lengths count calendar
|
|
7
7
|
* days with both ends included, so a same-day range is 1 day); in the From/To layout, days
|
|
8
|
-
* before the start are greyed too
|
|
8
|
+
* before the start are greyed too once the To field is tapped (otherwise a tap
|
|
9
|
+
* there moves the start);
|
|
9
10
|
* - multiple: once `maxSelections` is reached, only selected days can be tapped.
|
|
10
11
|
* Validation on Confirm (validateDraft) still checks the same rules.
|
|
11
12
|
*/
|
|
@@ -14,7 +15,7 @@ export interface SelectionRules {
|
|
|
14
15
|
rangeStart?: CalendarDate | null;
|
|
15
16
|
minDays?: number;
|
|
16
17
|
maxDays?: number;
|
|
17
|
-
/** From/To layout
|
|
18
|
+
/** From/To layout, the To field tapped: days before the start can't be the end. */
|
|
18
19
|
blockBeforeStart?: boolean;
|
|
19
20
|
/** Multiple mode with the cap reached. */
|
|
20
21
|
maxReached?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectionRules.d.ts","sourceRoot":"","sources":["../../../../../src/core/selectionRules.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAa,MAAM,kBAAe,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAS,CAAC;AAE5C
|
|
1
|
+
{"version":3,"file":"selectionRules.d.ts","sourceRoot":"","sources":["../../../../../src/core/selectionRules.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAa,MAAM,kBAAe,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAS,CAAC;AAE5C;;;;;;;;;GASG;AACH,MAAM,WAAW,cAAc;IAC7B,gDAAgD;IAChD,UAAU,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mFAAmF;IACnF,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,0CAA0C;IAC1C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,YAAY,KAAK,OAAO,CAAC;CAC7C;AAED,eAAO,MAAM,iBAAiB,GAC5B,OAAO,YAAY,EACnB,KAAK,YAAY,EACjB,OAAO,IAAI,CAAC,cAAc,EAAE,SAAS,GAAG,SAAS,GAAG,kBAAkB,CAAC,KACtE,OAOF,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAC7B,MAAM,WAAW,EACjB,OAAO,cAAc,KACpB,WA8BF,CAAC"}
|
|
@@ -12,27 +12,6 @@ export interface TimeEntryValues {
|
|
|
12
12
|
minute?: string;
|
|
13
13
|
period?: Period;
|
|
14
14
|
}
|
|
15
|
-
export interface TimeEntryState {
|
|
16
|
-
values: TimeEntryValues;
|
|
17
|
-
focused: TimeKey | null;
|
|
18
|
-
}
|
|
19
|
-
export type TimeEntryAction = {
|
|
20
|
-
type: 'focus';
|
|
21
|
-
key: TimeKey;
|
|
22
|
-
} | {
|
|
23
|
-
type: 'digit';
|
|
24
|
-
digit: string;
|
|
25
|
-
} | {
|
|
26
|
-
type: 'backspace';
|
|
27
|
-
} | {
|
|
28
|
-
type: 'period';
|
|
29
|
-
period: Period;
|
|
30
|
-
} | {
|
|
31
|
-
type: 'blur';
|
|
32
|
-
} | {
|
|
33
|
-
type: 'reset';
|
|
34
|
-
time: Time | null;
|
|
35
|
-
};
|
|
36
15
|
export type TimeEntryIssue = 'INCOMPLETE' | 'INVALID' | 'OFF_STEP' | 'BEFORE_MIN' | 'AFTER_MAX';
|
|
37
16
|
export interface ParsedTime {
|
|
38
17
|
time: Time | null;
|
|
@@ -44,8 +23,6 @@ export interface ParsedTime {
|
|
|
44
23
|
export declare const timeSpecs: (timeFormat: TimeFormat) => Record<TimeKey, SegmentSpec>;
|
|
45
24
|
/** Time → what the boxes show. An empty 12-hour row starts on AM (12:00 AM is the fallback time). */
|
|
46
25
|
export declare const formatTimeEntry: (time: Time | null, timeFormat: TimeFormat) => TimeEntryValues;
|
|
47
|
-
export declare const createTimeEntry: (time: Time | null, timeFormat: TimeFormat) => TimeEntryState;
|
|
48
|
-
export declare const timeEntryReducer: (state: TimeEntryState, action: TimeEntryAction, timeFormat: TimeFormat) => TimeEntryState;
|
|
49
26
|
export declare const parseTimeEntry: (values: TimeEntryValues, timeFormat: TimeFormat) => ParsedTime;
|
|
50
27
|
/**
|
|
51
28
|
* Why a complete time can't be confirmed: off the minute step (never rounded
|
|
@@ -57,7 +34,10 @@ export declare const checkTime: (time: Time, options: {
|
|
|
57
34
|
}) => TimeEntryIssue | null;
|
|
58
35
|
/** Whether any time in that half of the day (AM 00:00–11:59, PM 12:00–23:59) fits the limits. */
|
|
59
36
|
export declare const isPeriodAllowed: (period: Period, bounds?: TimeBounds | null) => boolean;
|
|
60
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* Digits only, at most two (what a time box accepts while typing). Digits
|
|
39
|
+
* typed in another script count too ('٠٩' → '09').
|
|
40
|
+
*/
|
|
61
41
|
export declare const cleanBoxText: (raw: string) => string;
|
|
62
42
|
/**
|
|
63
43
|
* The boxes as they are saved when focus leaves them: a one-digit entry gets a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeEntry.d.ts","sourceRoot":"","sources":["../../../../../src/core/timeEntry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"timeEntry.d.ts","sourceRoot":"","sources":["../../../../../src/core/timeEntry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAe,CAAC;AAChD,OAAO,EAGL,KAAK,MAAM,EACX,KAAK,WAAW,EACjB,MAAM,eAAY,CAAC;AACpB,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,YAAS,CAAC;AAEhD;;;;GAIG;AAEH,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;AAExC,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,cAAc,GACxB,YAAY,GAAG,SAAS,GAAG,UAAU,GAAG,YAAY,GAAG,WAAW,CAAC;AAErE,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,sCAAsC;IACtC,OAAO,EAAE,OAAO,CAAC;IACjB,6DAA6D;IAC7D,KAAK,EAAE,YAAY,GAAG,SAAS,GAAG,IAAI,CAAC;CACxC;AAED,eAAO,MAAM,SAAS,GACpB,YAAY,UAAU,KACrB,MAAM,CAAC,OAAO,EAAE,WAAW,CAQ7B,CAA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AM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAEtD,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAErD,CAAC;AAEF,0DAA0D;AAC1D,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAyBlD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAmB/C,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,OAM3B,CAAC;AAEF,gEAAgE;AAChE,eAAO,MAAM,YAAY,GAAI,QAAQ,OAAO,CAAC,OAAO,CAAC,KAAG,OAEvD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,UAAU,GACrB,MAAM,aAAa,GAAG,IAAI,EAC1B,MAAM;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,EACzD,UAAU,WAAW,KACpB,KAAK,CAAC,SAcR,CAAC"}
|
|
@@ -8,13 +8,17 @@ export { DEFAULT_TOKENS, INTER_FONTS, SYSTEM_FONTS, } from './components/theme/t
|
|
|
8
8
|
export { DEFAULT_YEAR_RANGE } from './components/types.js';
|
|
9
9
|
export { CalendarIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ClearIcon, } from './icons/index.js';
|
|
10
10
|
export { addDays, compareCalendarDates, daysBetween, daysInMonth, fromDateKey, isSameDay, toDateKey, todayIn, weekdayOf, } from './core/calendarDate.js';
|
|
11
|
+
export { hijriDateText, hijriPeriods } from './core/calendarSystem.js';
|
|
12
|
+
export { arabicDigits } from './core/numerals.js';
|
|
11
13
|
export type { AdapterContext, CalendarDate, DateTimeValue, PickerType, PickerValue, RangeValue, SelectionMode, Time, TimeFormat, ValueAdapter, ValueFormat, Weekday, } from './core/types.js';
|
|
12
14
|
export type { Constraints, CreateConstraintsOptions, DayStatus, DisabledReason, RangeBound, TimeBounds, } from './core/constraints.js';
|
|
13
|
-
export type { ConstraintContext, DateTimePickerProps, InstructionRenderProps, LabelRenderProps, PickerErrorCode, PickerState, SheetOptions, SheetRenderProps, SheetSize, Slot, } from './components/types.js';
|
|
15
|
+
export type { CalendarSwitchRenderProps, ChangeInfo, ConstraintContext, DateTimePickerProps, InstructionRenderProps, LabelRenderProps, PickerErrorCode, PickerState, SheetOptions, SheetRenderProps, SheetSize, Slot, } from './components/types.js';
|
|
16
|
+
export type { CalendarSystem, Periods } from './core/calendarSystem.js';
|
|
17
|
+
export type { Numerals } from './core/numerals.js';
|
|
14
18
|
export type { PickerStrings } from './components/theme/defaultStrings.js';
|
|
15
|
-
export type { PickerStyles } from './components/theme/styleKeys.js';
|
|
19
|
+
export type { PickerStyles, PickerStyleValue, StyleKey, } from './components/theme/styleKeys.js';
|
|
16
20
|
export type { ThemeTokens } from './components/theme/tokens.js';
|
|
17
|
-
export type { DayCellState } from './components/calendar/DayCell.js';
|
|
21
|
+
export type { DayCellState, RangeRole } from './components/calendar/DayCell.js';
|
|
18
22
|
export type { PeriodItem } from './components/calendar/PeriodGrid.js';
|
|
19
23
|
export type { IconComponent, IconName, IconOptions, IconRenderProps, IconSet, } from './icons/index.js';
|
|
20
24
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,gCAA6B,CAAC;AAEzD,eAAe,cAAc,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,CAAC;AAG1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAoB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,qBAAY,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAmC,CAAC;AACpE,OAAO,EACL,cAAc,EACd,WAAW,EACX,YAAY,GACb,MAAM,8BAA2B,CAAC;AACnC,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAoB,CAAC;AACxD,OAAO,EACL,YAAY,EACZ,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,SAAS,GACV,MAAM,kBAAS,CAAC;AACjB,OAAO,EACL,OAAO,EACP,oBAAoB,EACpB,WAAW,EACX,WAAW,EACX,WAAW,EACX,SAAS,EACT,SAAS,EACT,OAAO,EACP,SAAS,GACV,MAAM,wBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,gCAA6B,CAAC;AAEzD,eAAe,cAAc,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,CAAC;AAG1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAoB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,qBAAY,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAmC,CAAC;AACpE,OAAO,EACL,cAAc,EACd,WAAW,EACX,YAAY,GACb,MAAM,8BAA2B,CAAC;AACnC,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAoB,CAAC;AACxD,OAAO,EACL,YAAY,EACZ,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,SAAS,GACV,MAAM,kBAAS,CAAC;AACjB,OAAO,EACL,OAAO,EACP,oBAAoB,EACpB,WAAW,EACX,WAAW,EACX,WAAW,EACX,SAAS,EACT,SAAS,EACT,OAAO,EACP,SAAS,GACV,MAAM,wBAAqB,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,0BAAuB,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAiB,CAAC;AAG/C,YAAY,EACV,cAAc,EACd,YAAY,EACZ,aAAa,EACb,UAAU,EACV,WAAW,EACX,UAAU,EACV,aAAa,EACb,IAAI,EACJ,UAAU,EACV,YAAY,EACZ,WAAW,EACX,OAAO,GACR,MAAM,iBAAc,CAAC;AACtB,YAAY,EACV,WAAW,EACX,wBAAwB,EACxB,SAAS,EACT,cAAc,EACd,UAAU,EACV,UAAU,GACX,MAAM,uBAAoB,CAAC;AAC5B,YAAY,EACV,yBAAyB,EACzB,UAAU,EACV,iBAAiB,EACjB,mBAAmB,EACnB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,SAAS,EACT,IAAI,GACL,MAAM,uBAAoB,CAAC;AAC5B,YAAY,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,0BAAuB,CAAC;AACrE,YAAY,EAAE,QAAQ,EAAE,MAAM,oBAAiB,CAAC;AAChD,YAAY,EAAE,aAAa,EAAE,MAAM,sCAAmC,CAAC;AACvE,YAAY,EACV,YAAY,EACZ,gBAAgB,EAChB,QAAQ,GACT,MAAM,iCAA8B,CAAC;AACtC,YAAY,EAAE,WAAW,EAAE,MAAM,8BAA2B,CAAC;AAC7D,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,kCAA+B,CAAC;AAC7E,YAAY,EAAE,UAAU,EAAE,MAAM,qCAAkC,CAAC;AACnE,YAAY,EACV,aAAa,EACb,QAAQ,EACR,WAAW,EACX,eAAe,EACf,OAAO,GACR,MAAM,kBAAS,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rn-grid-date-time-picker",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.2.0",
|
|
4
|
+
"description": "React Native date, time and date range picker with a Hijri (Islamic, Umm al-Qura) calendar, Arabic digits and RTL. Bottom sheet or inline, fully themeable, TypeScript. Runs on iOS, Android and Expo Go.",
|
|
5
5
|
"main": "./lib/commonjs/index.js",
|
|
6
6
|
"module": "./lib/module/index.js",
|
|
7
7
|
"types": "./lib/typescript/commonjs/src/index.d.ts",
|
|
@@ -40,19 +40,27 @@
|
|
|
40
40
|
"keywords": [
|
|
41
41
|
"react-native",
|
|
42
42
|
"expo",
|
|
43
|
+
"react-native-date-picker",
|
|
44
|
+
"react-native-datepicker",
|
|
45
|
+
"react-native-calendar",
|
|
46
|
+
"react-native-time-picker",
|
|
47
|
+
"react-native-datetime-picker",
|
|
48
|
+
"react-native-date-range-picker",
|
|
43
49
|
"date-picker",
|
|
44
50
|
"datepicker",
|
|
45
51
|
"time-picker",
|
|
46
|
-
"timepicker",
|
|
47
52
|
"datetime-picker",
|
|
48
53
|
"date-range-picker",
|
|
49
|
-
"
|
|
54
|
+
"daterange",
|
|
50
55
|
"calendar",
|
|
51
|
-
"calendar-picker",
|
|
52
56
|
"multiple-dates",
|
|
57
|
+
"bottom-sheet",
|
|
53
58
|
"hijri",
|
|
59
|
+
"hijri-calendar",
|
|
60
|
+
"islamic-calendar",
|
|
61
|
+
"umm-al-qura",
|
|
62
|
+
"arabic",
|
|
54
63
|
"rtl",
|
|
55
|
-
"accessibility",
|
|
56
64
|
"typescript",
|
|
57
65
|
"ios",
|
|
58
66
|
"android"
|
|
@@ -91,6 +99,7 @@
|
|
|
91
99
|
"react": "19.3.0",
|
|
92
100
|
"react-native": "0.88.0",
|
|
93
101
|
"react-native-builder-bob": "^0.44.1",
|
|
102
|
+
"react-native-safe-area-context": "~5.10.1",
|
|
94
103
|
"react-test-renderer": "19.3.0",
|
|
95
104
|
"turbo": "^2.11.10",
|
|
96
105
|
"typescript": "^6.0.3"
|
|
@@ -100,7 +109,13 @@
|
|
|
100
109
|
},
|
|
101
110
|
"peerDependencies": {
|
|
102
111
|
"react": ">=18",
|
|
103
|
-
"react-native": ">=0.71"
|
|
112
|
+
"react-native": ">=0.71",
|
|
113
|
+
"react-native-safe-area-context": ">=3"
|
|
114
|
+
},
|
|
115
|
+
"peerDependenciesMeta": {
|
|
116
|
+
"react-native-safe-area-context": {
|
|
117
|
+
"optional": true
|
|
118
|
+
}
|
|
104
119
|
},
|
|
105
120
|
"workspaces": [
|
|
106
121
|
"example"
|
|
@@ -29,6 +29,12 @@ const isValidTime = (t: Time | null | undefined): t is Time =>
|
|
|
29
29
|
export const isWritableYear = (year: number): boolean =>
|
|
30
30
|
year >= 1 && year <= 9999;
|
|
31
31
|
|
|
32
|
+
/**
|
|
33
|
+
* A stored value must start with a full day: Luxon also reads '10:30' (today),
|
|
34
|
+
* '2026' or week and ordinal dates, which aren't dates the picker saved.
|
|
35
|
+
*/
|
|
36
|
+
const STARTS_WITH_DAY = /^\d{4}-\d{2}-\d{2}(?:T|$)/;
|
|
37
|
+
|
|
32
38
|
/**
|
|
33
39
|
* A stored instant → its day and wall-clock time in `zone`, or null when it
|
|
34
40
|
* can't be parsed. Shared by every built-in format for date-time values.
|
|
@@ -37,11 +43,11 @@ export const parseInstant = (
|
|
|
37
43
|
value: string | null | undefined,
|
|
38
44
|
zone: string
|
|
39
45
|
): DateTimeValue | null => {
|
|
40
|
-
if (!value) return null;
|
|
46
|
+
if (!value || !STARTS_WITH_DAY.test(value)) return null;
|
|
41
47
|
const utc = DateTime.fromISO(value, { zone: 'utc' });
|
|
42
48
|
if (!utc.isValid) return null;
|
|
43
49
|
const local = utc.setZone(zone);
|
|
44
|
-
if (!local.isValid) return null;
|
|
50
|
+
if (!local.isValid || !isWritableYear(local.year)) return null;
|
|
45
51
|
return {
|
|
46
52
|
date: calendarDateOf(local),
|
|
47
53
|
time: { hour: local.hour, minute: local.minute },
|
|
@@ -58,8 +64,9 @@ export const formatInstant = (
|
|
|
58
64
|
): string => {
|
|
59
65
|
if (!value || !isValidCalendarDate(value.date)) return '';
|
|
60
66
|
if (!isValidTime(value.time)) return '';
|
|
61
|
-
const
|
|
62
|
-
|
|
67
|
+
const utc = toZonedDateTime(value, zone).toUTC();
|
|
68
|
+
// A day near year 1 or 9999 can fall in year 0 or 10000 in UTC.
|
|
69
|
+
return utc.isValid && isWritableYear(utc.year) ? (utc.toISO() ?? '') : '';
|
|
63
70
|
};
|
|
64
71
|
|
|
65
72
|
/** Saved string → picker value. Returns null for '' or an unparsable string. */
|
|
@@ -70,10 +77,11 @@ const fromWire = (
|
|
|
70
77
|
): DateTimeValue | null => {
|
|
71
78
|
if (!value) return null;
|
|
72
79
|
if (type !== 'date') return parseInstant(value, zone);
|
|
80
|
+
if (!STARTS_WITH_DAY.test(value)) return null;
|
|
73
81
|
// The calendar day as written: an offset in the string ('+05:30') is kept,
|
|
74
82
|
// not converted to UTC, so the day never moves.
|
|
75
83
|
const written = DateTime.fromISO(value, { setZone: true });
|
|
76
|
-
if (!written.isValid) return null;
|
|
84
|
+
if (!written.isValid || !isWritableYear(written.year)) return null;
|
|
77
85
|
return { date: calendarDateOf(written), time: null };
|
|
78
86
|
};
|
|
79
87
|
|
|
@@ -109,6 +117,7 @@ const unchangedWire = (
|
|
|
109
117
|
): string => {
|
|
110
118
|
if (!value) return '';
|
|
111
119
|
if (type === 'datetime') {
|
|
120
|
+
if (!STARTS_WITH_DAY.test(value)) return '';
|
|
112
121
|
const dt = DateTime.fromISO(value, { zone: 'utc' });
|
|
113
122
|
return dt.isValid ? (dt.toUTC().toISO() ?? '') : '';
|
|
114
123
|
}
|