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
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which digits the picker shows: 0–9, Arabic-Indic (١٢٣) in any language, or
|
|
3
|
+
* the locale's own (١٢٣ for 'ar-SA', ۱۲۳ for 'fa-IR', 123 for 'en-US').
|
|
4
|
+
*/
|
|
5
|
+
export type Numerals = 'latin' | 'arabic' | 'locale';
|
|
6
|
+
|
|
7
|
+
export const latinDigits = (text: string): string => text;
|
|
8
|
+
|
|
9
|
+
/** Swaps 0–9 in a text for Arabic-Indic digits (٠–٩). */
|
|
10
|
+
export const arabicDigits = (text: string): string =>
|
|
11
|
+
text.replace(/[0-9]/g, (d) => String.fromCharCode(0x0660 + Number(d)));
|
|
12
|
+
|
|
13
|
+
const cache = new Map<string, (text: string) => string>();
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Swaps 0–9 in a text for the locale's own digits, as `Intl` writes them
|
|
17
|
+
* ('ar-SA' → ٠–٩, 'fa' → ۰–۹). Latin when the locale uses 0–9 or `Intl` can't
|
|
18
|
+
* tell.
|
|
19
|
+
*/
|
|
20
|
+
export const localeDigits = (locale: string): ((text: string) => string) => {
|
|
21
|
+
const hit = cache.get(locale);
|
|
22
|
+
if (hit) return hit;
|
|
23
|
+
let swap = latinDigits;
|
|
24
|
+
try {
|
|
25
|
+
const f = new Intl.NumberFormat(locale, { useGrouping: false });
|
|
26
|
+
const digits = Array.from({ length: 10 }, (_, i) => f.format(i));
|
|
27
|
+
if (digits[0] !== '0' && digits.every((d) => [...d].length === 1)) {
|
|
28
|
+
swap = (text) => text.replace(/[0-9]/g, (d) => digits[Number(d)]!);
|
|
29
|
+
}
|
|
30
|
+
} catch {
|
|
31
|
+
// An engine without this locale keeps 0–9.
|
|
32
|
+
}
|
|
33
|
+
cache.set(locale, swap);
|
|
34
|
+
return swap;
|
|
35
|
+
};
|
|
@@ -87,6 +87,9 @@ const nextKey = (
|
|
|
87
87
|
};
|
|
88
88
|
|
|
89
89
|
/** Pads the segment being left, then focuses `to`. */
|
|
90
|
+
/** Characters that end a segment when typed or pasted between numbers. */
|
|
91
|
+
const SEPARATOR = /^[/\-.:\s]$/;
|
|
92
|
+
|
|
90
93
|
const moveFocus = (
|
|
91
94
|
state: SegmentEditorState,
|
|
92
95
|
to: SegmentKey | null
|
|
@@ -136,6 +139,16 @@ export const segmentEditorReducer = (
|
|
|
136
139
|
const key = state.focused;
|
|
137
140
|
const spec = key ? specOf(state, key) : undefined;
|
|
138
141
|
if (!key || !spec || spec.key === 'period') return state;
|
|
142
|
+
// A separator typed or pasted after some digits ('1/12/2025') ends the
|
|
143
|
+
// segment, as moving on would: 1 becomes 01 and the next segment starts.
|
|
144
|
+
if (SEPARATOR.test(action.digit)) {
|
|
145
|
+
if (!state.values[key]) return state;
|
|
146
|
+
const following = nextKey(state, key, 1);
|
|
147
|
+
return withParsed(
|
|
148
|
+
moveFocus(state, following === 'period' ? null : following),
|
|
149
|
+
opts
|
|
150
|
+
);
|
|
151
|
+
}
|
|
139
152
|
const { next, advance } = inputDigit(
|
|
140
153
|
state.values[key] ?? '',
|
|
141
154
|
action.digit,
|
package/src/core/segments.ts
CHANGED
|
@@ -153,14 +153,6 @@ export const inputDigit = (
|
|
|
153
153
|
return { next, advance: cannotGrow };
|
|
154
154
|
};
|
|
155
155
|
|
|
156
|
-
/** 'a' / 'A' → AM, 'p' / 'P' → PM, anything else → null. */
|
|
157
|
-
export const inputPeriod = (char: string): Period | null => {
|
|
158
|
-
const c = char.toLowerCase();
|
|
159
|
-
if (c === 'a') return 'AM';
|
|
160
|
-
if (c === 'p') return 'PM';
|
|
161
|
-
return null;
|
|
162
|
-
};
|
|
163
|
-
|
|
164
156
|
/** Pads a one-digit entry when leaving the segment ("7" → "07"); the year is never padded. */
|
|
165
157
|
export const padSegment = (text: string, spec: SegmentSpec): string => {
|
|
166
158
|
if (
|
|
@@ -7,7 +7,8 @@ import type { CalendarDate } from './types';
|
|
|
7
7
|
* - range: once a start is picked and the end is being chosen, days closer than
|
|
8
8
|
* `minDays` or further than `maxDays` are greyed (lengths count calendar
|
|
9
9
|
* days with both ends included, so a same-day range is 1 day); in the From/To layout, days
|
|
10
|
-
* before the start are greyed too
|
|
10
|
+
* before the start are greyed too once the To field is tapped (otherwise a tap
|
|
11
|
+
* there moves the start);
|
|
11
12
|
* - multiple: once `maxSelections` is reached, only selected days can be tapped.
|
|
12
13
|
* Validation on Confirm (validateDraft) still checks the same rules.
|
|
13
14
|
*/
|
|
@@ -16,7 +17,7 @@ export interface SelectionRules {
|
|
|
16
17
|
rangeStart?: CalendarDate | null;
|
|
17
18
|
minDays?: number;
|
|
18
19
|
maxDays?: number;
|
|
19
|
-
/** From/To layout
|
|
20
|
+
/** From/To layout, the To field tapped: days before the start can't be the end. */
|
|
20
21
|
blockBeforeStart?: boolean;
|
|
21
22
|
/** Multiple mode with the cap reached. */
|
|
22
23
|
maxReached?: boolean;
|
package/src/core/timeEntry.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
import { toLatinDigits } from './digits';
|
|
1
2
|
import type { TimeBounds } from './constraints';
|
|
2
3
|
import {
|
|
3
4
|
from12Hour,
|
|
4
|
-
inputDigit,
|
|
5
|
-
padSegment,
|
|
6
5
|
to12Hour,
|
|
7
6
|
type Period,
|
|
8
7
|
type SegmentSpec,
|
|
@@ -23,19 +22,6 @@ export interface TimeEntryValues {
|
|
|
23
22
|
period?: Period;
|
|
24
23
|
}
|
|
25
24
|
|
|
26
|
-
export interface TimeEntryState {
|
|
27
|
-
values: TimeEntryValues;
|
|
28
|
-
focused: TimeKey | null;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export type TimeEntryAction =
|
|
32
|
-
| { type: 'focus'; key: TimeKey }
|
|
33
|
-
| { type: 'digit'; digit: string }
|
|
34
|
-
| { type: 'backspace' }
|
|
35
|
-
| { type: 'period'; period: Period }
|
|
36
|
-
| { type: 'blur' }
|
|
37
|
-
| { type: 'reset'; time: Time | null };
|
|
38
|
-
|
|
39
25
|
export type TimeEntryIssue =
|
|
40
26
|
'INCOMPLETE' | 'INVALID' | 'OFF_STEP' | 'BEFORE_MIN' | 'AFTER_MAX';
|
|
41
27
|
|
|
@@ -73,85 +59,6 @@ export const formatTimeEntry = (
|
|
|
73
59
|
return { hour: pad2(hour12), minute: pad2(time.minute), period };
|
|
74
60
|
};
|
|
75
61
|
|
|
76
|
-
export const createTimeEntry = (
|
|
77
|
-
time: Time | null,
|
|
78
|
-
timeFormat: TimeFormat
|
|
79
|
-
): TimeEntryState => {
|
|
80
|
-
return { values: formatTimeEntry(time, timeFormat), focused: null };
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
const leave = (
|
|
84
|
-
state: TimeEntryState,
|
|
85
|
-
to: TimeKey | null,
|
|
86
|
-
timeFormat: TimeFormat
|
|
87
|
-
): TimeEntryState => {
|
|
88
|
-
const from = state.focused;
|
|
89
|
-
if (!from) return { ...state, focused: to };
|
|
90
|
-
const text = state.values[from] ?? '';
|
|
91
|
-
return {
|
|
92
|
-
values: {
|
|
93
|
-
...state.values,
|
|
94
|
-
[from]: padSegment(text, timeSpecs(timeFormat)[from]),
|
|
95
|
-
},
|
|
96
|
-
focused: to,
|
|
97
|
-
};
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
export const timeEntryReducer = (
|
|
101
|
-
state: TimeEntryState,
|
|
102
|
-
action: TimeEntryAction,
|
|
103
|
-
timeFormat: TimeFormat
|
|
104
|
-
): TimeEntryState => {
|
|
105
|
-
switch (action.type) {
|
|
106
|
-
case 'focus':
|
|
107
|
-
return leave(state, action.key, timeFormat);
|
|
108
|
-
case 'blur':
|
|
109
|
-
return leave(state, null, timeFormat);
|
|
110
|
-
case 'digit': {
|
|
111
|
-
const key = state.focused;
|
|
112
|
-
if (!key) return state;
|
|
113
|
-
const { next, advance } = inputDigit(
|
|
114
|
-
state.values[key] ?? '',
|
|
115
|
-
action.digit,
|
|
116
|
-
timeSpecs(timeFormat)[key]
|
|
117
|
-
);
|
|
118
|
-
const typed = { ...state, values: { ...state.values, [key]: next } };
|
|
119
|
-
// Two hour digits jump to the minutes; a full minute box stays put.
|
|
120
|
-
if (!advance) return typed;
|
|
121
|
-
return leave(typed, key === 'hour' ? 'minute' : null, timeFormat);
|
|
122
|
-
}
|
|
123
|
-
case 'backspace': {
|
|
124
|
-
const key = state.focused;
|
|
125
|
-
if (!key) return state;
|
|
126
|
-
const current = state.values[key] ?? '';
|
|
127
|
-
if (current)
|
|
128
|
-
return {
|
|
129
|
-
...state,
|
|
130
|
-
values: { ...state.values, [key]: current.slice(0, -1) },
|
|
131
|
-
};
|
|
132
|
-
if (key === 'minute') {
|
|
133
|
-
return {
|
|
134
|
-
values: {
|
|
135
|
-
...state.values,
|
|
136
|
-
hour: (state.values.hour ?? '').slice(0, -1),
|
|
137
|
-
},
|
|
138
|
-
focused: 'hour',
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
return state;
|
|
142
|
-
}
|
|
143
|
-
case 'period':
|
|
144
|
-
return { ...state, values: { ...state.values, period: action.period } };
|
|
145
|
-
case 'reset':
|
|
146
|
-
return {
|
|
147
|
-
values: formatTimeEntry(action.time, timeFormat),
|
|
148
|
-
focused: state.focused,
|
|
149
|
-
};
|
|
150
|
-
default:
|
|
151
|
-
return state;
|
|
152
|
-
}
|
|
153
|
-
};
|
|
154
|
-
|
|
155
62
|
const readNumber = (text?: string): number | null =>
|
|
156
63
|
text && /^\d+$/.test(text) ? Number(text) : null;
|
|
157
64
|
|
|
@@ -213,9 +120,12 @@ export const isPeriodAllowed = (
|
|
|
213
120
|
return true;
|
|
214
121
|
};
|
|
215
122
|
|
|
216
|
-
/**
|
|
123
|
+
/**
|
|
124
|
+
* Digits only, at most two (what a time box accepts while typing). Digits
|
|
125
|
+
* typed in another script count too ('٠٩' → '09').
|
|
126
|
+
*/
|
|
217
127
|
export const cleanBoxText = (raw: string): string =>
|
|
218
|
-
raw.replace(/\D/g, '').slice(0, 2);
|
|
128
|
+
toLatinDigits(raw).replace(/\D/g, '').slice(0, 2);
|
|
219
129
|
|
|
220
130
|
/**
|
|
221
131
|
* The boxes as they are saved when focus leaves them: a one-digit entry gets a
|
package/src/icons/index.tsx
CHANGED
|
@@ -37,6 +37,8 @@ export type IconSet = Record<IconName, IconComponent | null>;
|
|
|
37
37
|
|
|
38
38
|
const s = StyleSheet.create({
|
|
39
39
|
box: { alignItems: 'center', justifyContent: 'center' },
|
|
40
|
+
// RTL swaps left and right borders, which would move a chevron's corner.
|
|
41
|
+
ltr: { direction: 'ltr' },
|
|
40
42
|
bar: { position: 'absolute' },
|
|
41
43
|
frame: { overflow: 'hidden' },
|
|
42
44
|
});
|
|
@@ -53,7 +55,7 @@ const Chevron: React.FC<IconRenderProps & { rotate: string }> = ({
|
|
|
53
55
|
}) => {
|
|
54
56
|
const side = size * 0.4;
|
|
55
57
|
return (
|
|
56
|
-
<View style={[s.box, { width, height }]}>
|
|
58
|
+
<View style={[s.box, s.ltr, { width, height }]}>
|
|
57
59
|
<View
|
|
58
60
|
style={{
|
|
59
61
|
width: side,
|
package/src/index.tsx
CHANGED
|
@@ -31,6 +31,8 @@ export {
|
|
|
31
31
|
todayIn,
|
|
32
32
|
weekdayOf,
|
|
33
33
|
} from './core/calendarDate';
|
|
34
|
+
export { hijriDateText, hijriPeriods } from './core/calendarSystem';
|
|
35
|
+
export { arabicDigits } from './core/numerals';
|
|
34
36
|
|
|
35
37
|
// Types
|
|
36
38
|
export type {
|
|
@@ -56,6 +58,8 @@ export type {
|
|
|
56
58
|
TimeBounds,
|
|
57
59
|
} from './core/constraints';
|
|
58
60
|
export type {
|
|
61
|
+
CalendarSwitchRenderProps,
|
|
62
|
+
ChangeInfo,
|
|
59
63
|
ConstraintContext,
|
|
60
64
|
DateTimePickerProps,
|
|
61
65
|
InstructionRenderProps,
|
|
@@ -67,10 +71,16 @@ export type {
|
|
|
67
71
|
SheetSize,
|
|
68
72
|
Slot,
|
|
69
73
|
} from './components/types';
|
|
74
|
+
export type { CalendarSystem, Periods } from './core/calendarSystem';
|
|
75
|
+
export type { Numerals } from './core/numerals';
|
|
70
76
|
export type { PickerStrings } from './components/theme/defaultStrings';
|
|
71
|
-
export type {
|
|
77
|
+
export type {
|
|
78
|
+
PickerStyles,
|
|
79
|
+
PickerStyleValue,
|
|
80
|
+
StyleKey,
|
|
81
|
+
} from './components/theme/styleKeys';
|
|
72
82
|
export type { ThemeTokens } from './components/theme/tokens';
|
|
73
|
-
export type { DayCellState } from './components/calendar/DayCell';
|
|
83
|
+
export type { DayCellState, RangeRole } from './components/calendar/DayCell';
|
|
74
84
|
export type { PeriodItem } from './components/calendar/PeriodGrid';
|
|
75
85
|
export type {
|
|
76
86
|
IconComponent,
|