@mui/x-date-pickers 6.2.1 → 6.3.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/AdapterDateFns/AdapterDateFns.d.ts +109 -0
- package/AdapterDateFns/AdapterDateFns.js +598 -0
- package/AdapterDateFns/index.d.ts +1 -13
- package/AdapterDateFns/index.js +1 -149
- package/AdapterDateFnsJalali/AdapterDateFnsJalali.d.ts +109 -0
- package/AdapterDateFnsJalali/AdapterDateFnsJalali.js +610 -0
- package/AdapterDateFnsJalali/index.d.ts +1 -13
- package/AdapterDateFnsJalali/index.js +1 -149
- package/AdapterDayjs/AdapterDayjs.d.ts +53 -53
- package/AdapterDayjs/AdapterDayjs.js +146 -111
- package/AdapterLuxon/AdapterLuxon.d.ts +108 -0
- package/AdapterLuxon/AdapterLuxon.js +513 -0
- package/AdapterLuxon/index.d.ts +1 -14
- package/AdapterLuxon/index.js +1 -111
- package/AdapterMoment/AdapterMoment.d.ts +110 -0
- package/AdapterMoment/AdapterMoment.js +416 -0
- package/AdapterMoment/index.d.ts +1 -21
- package/AdapterMoment/index.js +1 -99
- package/AdapterMomentHijri/AdapterMomentHijri.d.ts +67 -0
- package/AdapterMomentHijri/AdapterMomentHijri.js +269 -0
- package/AdapterMomentHijri/index.d.ts +1 -18
- package/AdapterMomentHijri/index.js +1 -74
- package/AdapterMomentJalaali/AdapterMomentJalaali.d.ts +74 -0
- package/AdapterMomentJalaali/AdapterMomentJalaali.js +276 -0
- package/AdapterMomentJalaali/index.d.ts +1 -22
- package/AdapterMomentJalaali/index.js +1 -87
- package/CHANGELOG.md +70 -1
- package/DateCalendar/DateCalendar.types.d.ts +1 -1
- package/DateCalendar/DayCalendar.d.ts +1 -1
- package/DateCalendar/DayCalendar.js +1 -1
- package/DateCalendar/PickersCalendarHeader.d.ts +1 -1
- package/DateCalendar/useCalendarState.js +1 -1
- package/DateCalendar/useIsDateDisabled.d.ts +2 -0
- package/DateCalendar/useIsDateDisabled.js +27 -0
- package/DateField/DateField.js +20 -3
- package/DateField/DateField.types.d.ts +2 -2
- package/DateField/useDateField.js +4 -2
- package/DatePicker/DatePickerToolbar.js +1 -1
- package/DateTimeField/DateTimeField.js +21 -3
- package/DateTimeField/DateTimeField.types.d.ts +3 -2
- package/DateTimeField/useDateTimeField.js +4 -2
- package/DateTimePicker/DateTimePicker.js +1 -0
- package/DateTimePicker/shared.d.ts +6 -5
- package/DesktopDatePicker/DesktopDatePicker.js +1 -1
- package/DesktopDateTimePicker/DesktopDateTimePicker.js +2 -1
- package/DesktopTimePicker/DesktopTimePicker.js +50 -8
- package/DesktopTimePicker/DesktopTimePicker.types.d.ts +12 -4
- package/DigitalClock/DigitalClock.d.ts +7 -0
- package/DigitalClock/DigitalClock.js +397 -0
- package/DigitalClock/DigitalClock.types.d.ts +47 -0
- package/DigitalClock/digitalClockClasses.d.ts +11 -0
- package/DigitalClock/digitalClockClasses.js +6 -0
- package/DigitalClock/index.d.ts +4 -0
- package/DigitalClock/index.js +2 -0
- package/DigitalClock/package.json +6 -0
- package/MobileDatePicker/MobileDatePicker.js +1 -1
- package/MobileDateTimePicker/MobileDateTimePicker.js +2 -1
- package/MobileTimePicker/MobileTimePicker.js +2 -1
- package/MobileTimePicker/MobileTimePicker.types.d.ts +8 -7
- package/MonthCalendar/MonthCalendar.types.d.ts +1 -1
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.d.ts +7 -0
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +479 -0
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.types.d.ts +57 -0
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.d.ts +22 -0
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +65 -0
- package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.d.ts +28 -0
- package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +151 -0
- package/MultiSectionDigitalClock/index.d.ts +7 -0
- package/MultiSectionDigitalClock/index.js +3 -0
- package/MultiSectionDigitalClock/multiSectionDigitalClockClasses.d.ts +7 -0
- package/MultiSectionDigitalClock/multiSectionDigitalClockClasses.js +6 -0
- package/MultiSectionDigitalClock/multiSectionDigitalClockSectionClasses.d.ts +9 -0
- package/MultiSectionDigitalClock/multiSectionDigitalClockSectionClasses.js +6 -0
- package/MultiSectionDigitalClock/package.json +6 -0
- package/PickersDay/PickersDay.js +4 -1
- package/PickersLayout/PickersLayout.d.ts +2 -2
- package/PickersLayout/PickersLayout.js +2 -2
- package/PickersLayout/PickersLayout.types.d.ts +7 -8
- package/PickersLayout/usePickerLayout.d.ts +2 -2
- package/README.md +0 -9
- package/StaticDateTimePicker/StaticDateTimePicker.js +2 -1
- package/StaticTimePicker/StaticTimePicker.js +2 -1
- package/StaticTimePicker/StaticTimePicker.types.d.ts +1 -1
- package/TimeClock/TimeClock.js +35 -12
- package/TimeClock/TimeClock.types.d.ts +4 -67
- package/TimeField/TimeField.js +21 -3
- package/TimeField/TimeField.types.d.ts +3 -2
- package/TimeField/useTimeField.js +4 -2
- package/TimePicker/TimePicker.js +25 -2
- package/TimePicker/TimePicker.types.d.ts +4 -3
- package/TimePicker/TimePickerToolbar.d.ts +2 -2
- package/TimePicker/TimePickerToolbar.js +2 -2
- package/TimePicker/shared.d.ts +9 -7
- package/YearCalendar/YearCalendar.types.d.ts +1 -1
- package/dateViewRenderers/dateViewRenderers.d.ts +2 -2
- package/index.d.ts +2 -0
- package/index.js +4 -1
- package/internals/components/PickersToolbar.d.ts +3 -3
- package/internals/constants/dimensions.d.ts +1 -0
- package/internals/constants/dimensions.js +2 -1
- package/internals/demo/DemoContainer.js +4 -1
- package/internals/hooks/date-helpers-hooks.d.ts +3 -2
- package/internals/hooks/date-helpers-hooks.js +3 -3
- package/internals/hooks/useDesktopPicker/useDesktopPicker.d.ts +2 -2
- package/internals/hooks/useDesktopPicker/useDesktopPicker.js +2 -1
- package/internals/hooks/useDesktopPicker/useDesktopPicker.types.d.ts +7 -6
- package/internals/hooks/useField/useField.js +12 -11
- package/internals/hooks/useField/useField.types.d.ts +19 -4
- package/internals/hooks/useField/useField.utils.d.ts +8 -5
- package/internals/hooks/useField/useField.utils.js +60 -34
- package/internals/hooks/useField/useFieldCharacterEditing.js +18 -10
- package/internals/hooks/useField/useFieldState.js +4 -3
- package/internals/hooks/useIsLandscape.d.ts +2 -2
- package/internals/hooks/useMobilePicker/useMobilePicker.d.ts +2 -2
- package/internals/hooks/useMobilePicker/useMobilePicker.types.d.ts +7 -6
- package/internals/hooks/usePicker/usePicker.d.ts +4 -3
- package/internals/hooks/usePicker/usePicker.types.d.ts +6 -5
- package/internals/hooks/usePicker/usePickerLayoutProps.d.ts +5 -6
- package/internals/hooks/usePicker/usePickerValue.d.ts +1 -1
- package/internals/hooks/usePicker/usePickerValue.js +1 -1
- package/internals/hooks/usePicker/usePickerValue.types.d.ts +1 -1
- package/internals/hooks/usePicker/usePickerViews.d.ts +11 -11
- package/internals/hooks/useStaticPicker/useStaticPicker.d.ts +2 -2
- package/internals/hooks/useStaticPicker/useStaticPicker.types.d.ts +6 -5
- package/internals/hooks/{validation/useValidation.d.ts → useValidation.d.ts} +1 -1
- package/internals/hooks/{validation/useValidation.js → useValidation.js} +1 -1
- package/internals/hooks/useViews.d.ts +8 -6
- package/internals/hooks/useViews.js +29 -13
- package/internals/index.d.ts +7 -7
- package/internals/index.js +5 -5
- package/internals/models/common.d.ts +3 -0
- package/internals/models/index.d.ts +1 -0
- package/internals/models/index.js +2 -1
- package/internals/models/props/basePickerProps.d.ts +3 -3
- package/internals/models/props/clock.d.ts +88 -0
- package/internals/models/props/tabs.d.ts +2 -2
- package/internals/models/props/toolbar.d.ts +3 -3
- package/internals/{hooks/validation/models.d.ts → models/validation.d.ts} +2 -5
- package/internals/models/validation.js +1 -0
- package/internals/utils/time-utils.d.ts +7 -7
- package/internals/utils/time-utils.js +2 -1
- package/internals/{hooks/validation/useDateValidation.d.ts → utils/validation/validateDate.d.ts} +2 -3
- package/internals/{hooks/validation/useDateValidation.js → utils/validation/validateDate.js} +1 -27
- package/internals/{hooks/validation/useDateTimeValidation.d.ts → utils/validation/validateDateTime.d.ts} +3 -3
- package/{modern/internals/hooks/validation/useDateTimeValidation.js → internals/utils/validation/validateDateTime.js} +2 -2
- package/internals/{hooks/validation/useTimeValidation.d.ts → utils/validation/validateTime.d.ts} +2 -2
- package/{modern/internals/hooks/validation/useTimeValidation.js → internals/utils/validation/validateTime.js} +1 -1
- package/internals/utils/views.d.ts +3 -2
- package/legacy/AdapterDateFns/AdapterDateFns.js +606 -0
- package/legacy/AdapterDateFns/index.js +1 -165
- package/legacy/AdapterDateFnsJalali/AdapterDateFnsJalali.js +620 -0
- package/legacy/AdapterDateFnsJalali/index.js +1 -165
- package/legacy/AdapterDayjs/AdapterDayjs.js +146 -111
- package/legacy/AdapterLuxon/AdapterLuxon.js +524 -0
- package/legacy/AdapterLuxon/index.js +1 -127
- package/legacy/AdapterMoment/AdapterMoment.js +422 -0
- package/legacy/AdapterMoment/index.js +1 -115
- package/legacy/AdapterMomentHijri/AdapterMomentHijri.js +284 -0
- package/legacy/AdapterMomentHijri/index.js +1 -90
- package/legacy/AdapterMomentJalaali/AdapterMomentJalaali.js +291 -0
- package/legacy/AdapterMomentJalaali/index.js +1 -103
- package/legacy/DateCalendar/DayCalendar.js +1 -1
- package/legacy/DateCalendar/useCalendarState.js +1 -1
- package/legacy/DateCalendar/useIsDateDisabled.js +28 -0
- package/legacy/DateField/DateField.js +20 -3
- package/legacy/DateField/useDateField.js +4 -2
- package/legacy/DatePicker/DatePickerToolbar.js +1 -1
- package/legacy/DateTimeField/DateTimeField.js +21 -3
- package/legacy/DateTimeField/useDateTimeField.js +4 -2
- package/legacy/DateTimePicker/DateTimePicker.js +1 -0
- package/legacy/DesktopDatePicker/DesktopDatePicker.js +1 -1
- package/legacy/DesktopDateTimePicker/DesktopDateTimePicker.js +2 -1
- package/legacy/DesktopTimePicker/DesktopTimePicker.js +51 -8
- package/legacy/DigitalClock/DigitalClock.js +419 -0
- package/legacy/DigitalClock/DigitalClock.types.js +1 -0
- package/legacy/DigitalClock/digitalClockClasses.js +6 -0
- package/legacy/DigitalClock/index.js +2 -0
- package/legacy/MobileDatePicker/MobileDatePicker.js +1 -1
- package/legacy/MobileDateTimePicker/MobileDateTimePicker.js +2 -1
- package/legacy/MobileTimePicker/MobileTimePicker.js +2 -1
- package/legacy/MultiSectionDigitalClock/MultiSectionDigitalClock.js +508 -0
- package/legacy/MultiSectionDigitalClock/MultiSectionDigitalClock.types.js +1 -0
- package/legacy/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +65 -0
- package/legacy/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +157 -0
- package/legacy/MultiSectionDigitalClock/index.js +3 -0
- package/legacy/MultiSectionDigitalClock/multiSectionDigitalClockClasses.js +6 -0
- package/legacy/MultiSectionDigitalClock/multiSectionDigitalClockSectionClasses.js +6 -0
- package/legacy/PickersDay/PickersDay.js +3 -1
- package/legacy/PickersLayout/PickersLayout.js +2 -2
- package/legacy/StaticDateTimePicker/StaticDateTimePicker.js +2 -1
- package/legacy/StaticTimePicker/StaticTimePicker.js +2 -1
- package/legacy/TimeClock/TimeClock.js +35 -12
- package/legacy/TimeField/TimeField.js +21 -3
- package/legacy/TimeField/useTimeField.js +4 -2
- package/legacy/TimePicker/TimePicker.js +25 -2
- package/legacy/TimePicker/TimePickerToolbar.js +2 -2
- package/legacy/index.js +4 -1
- package/legacy/internals/constants/dimensions.js +2 -1
- package/legacy/internals/demo/DemoContainer.js +4 -1
- package/legacy/internals/hooks/date-helpers-hooks.js +3 -3
- package/legacy/internals/hooks/useDesktopPicker/useDesktopPicker.js +2 -1
- package/legacy/internals/hooks/useField/useField.js +11 -10
- package/legacy/internals/hooks/useField/useField.utils.js +58 -34
- package/legacy/internals/hooks/useField/useFieldCharacterEditing.js +18 -10
- package/legacy/internals/hooks/useField/useFieldState.js +6 -4
- package/legacy/internals/hooks/usePicker/usePickerValue.js +1 -1
- package/legacy/internals/hooks/{validation/useValidation.js → useValidation.js} +1 -1
- package/legacy/internals/hooks/useViews.js +30 -14
- package/legacy/internals/index.js +5 -5
- package/legacy/internals/models/index.js +2 -1
- package/legacy/internals/models/props/clock.js +1 -0
- package/legacy/internals/models/validation.js +1 -0
- package/legacy/internals/utils/time-utils.js +2 -1
- package/legacy/internals/{hooks/validation/useDateValidation.js → utils/validation/validateDate.js} +1 -28
- package/legacy/internals/{hooks/validation/useDateTimeValidation.js → utils/validation/validateDateTime.js} +2 -2
- package/legacy/internals/{hooks/validation/useTimeValidation.js → utils/validation/validateTime.js} +1 -1
- package/legacy/locales/beBY.js +5 -3
- package/legacy/locales/caES.js +6 -1
- package/legacy/locales/csCZ.js +6 -4
- package/legacy/locales/daDK.js +6 -2
- package/legacy/locales/deDE.js +6 -2
- package/legacy/locales/enUS.js +4 -0
- package/legacy/locales/esES.js +6 -1
- package/legacy/locales/faIR.js +11 -1
- package/legacy/locales/fiFI.js +6 -1
- package/legacy/locales/frFR.js +6 -1
- package/legacy/locales/heIL.js +6 -1
- package/legacy/locales/huHU.js +6 -2
- package/legacy/locales/index.js +1 -0
- package/legacy/locales/isIS.js +11 -1
- package/legacy/locales/itIT.js +6 -1
- package/legacy/locales/jaJP.js +6 -2
- package/legacy/locales/koKR.js +6 -1
- package/legacy/locales/kzKZ.js +6 -2
- package/legacy/locales/nbNO.js +11 -1
- package/legacy/locales/nlNL.js +11 -1
- package/legacy/locales/plPL.js +11 -1
- package/legacy/locales/ptBR.js +11 -1
- package/legacy/locales/ruRU.js +6 -2
- package/legacy/locales/svSE.js +11 -1
- package/legacy/locales/trTR.js +22 -7
- package/legacy/locales/ukUA.js +11 -1
- package/legacy/locales/urPK.js +11 -1
- package/legacy/locales/zhCN.js +44 -23
- package/legacy/models/common.js +1 -0
- package/legacy/models/index.js +2 -1
- package/legacy/tests/describeAdapters/describeAdapters.js +1 -3
- package/legacy/tests/describeGregorianAdapter/describeGregorianAdapter.js +3 -1
- package/legacy/tests/describeGregorianAdapter/testCalculations.js +29 -26
- package/legacy/tests/describeGregorianAdapter/testLocalization.js +2 -2
- package/legacy/tests/describeHijriAdapter/describeHijriAdapter.js +23 -0
- package/legacy/tests/describeHijriAdapter/describeHijriAdapter.types.js +1 -0
- package/legacy/tests/describeHijriAdapter/index.js +1 -0
- package/legacy/tests/describeHijriAdapter/testCalculations.js +94 -0
- package/legacy/tests/describeHijriAdapter/testLocalization.js +12 -0
- package/legacy/tests/describeJalaliAdapter/describeJalaliAdapter.js +25 -0
- package/legacy/tests/describeJalaliAdapter/describeJalaliAdapter.types.js +1 -0
- package/legacy/tests/describeJalaliAdapter/index.js +1 -0
- package/legacy/tests/describeJalaliAdapter/testCalculations.js +82 -0
- package/legacy/tests/describeJalaliAdapter/testLocalization.js +12 -0
- package/legacy/tests/describePicker/describePicker.js +159 -0
- package/legacy/tests/describePicker/describePicker.types.js +1 -0
- package/legacy/tests/describePicker/index.js +1 -0
- package/legacy/tests/describeValue/describeValue.js +1 -1
- package/legacy/tests/describeValue/testControlledUnControlled.js +8 -9
- package/legacy/tests/describeValue/testPickerActionBar.js +46 -13
- package/legacy/tests/describeValue/testPickerOpenCloseLifeCycle.js +0 -5
- package/legacy/timeViewRenderers/index.js +1 -1
- package/legacy/timeViewRenderers/timeViewRenderers.js +132 -4
- package/locales/beBY.d.ts +4 -2
- package/locales/beBY.js +3 -3
- package/locales/caES.d.ts +4 -2
- package/locales/caES.js +4 -1
- package/locales/csCZ.d.ts +4 -2
- package/locales/csCZ.js +4 -4
- package/locales/daDK.d.ts +4 -2
- package/locales/daDK.js +4 -2
- package/locales/deDE.d.ts +4 -2
- package/locales/deDE.js +4 -2
- package/locales/enUS.d.ts +3 -2
- package/locales/enUS.js +2 -0
- package/locales/esES.d.ts +4 -2
- package/locales/esES.js +4 -1
- package/locales/faIR.d.ts +4 -2
- package/locales/faIR.js +9 -1
- package/locales/fiFI.d.ts +4 -2
- package/locales/fiFI.js +4 -1
- package/locales/frFR.d.ts +4 -2
- package/locales/frFR.js +4 -1
- package/locales/heIL.d.ts +4 -2
- package/locales/heIL.js +4 -1
- package/locales/huHU.d.ts +4 -2
- package/locales/huHU.js +4 -2
- package/locales/index.d.ts +1 -0
- package/locales/index.js +1 -0
- package/locales/isIS.d.ts +4 -2
- package/locales/isIS.js +9 -1
- package/locales/itIT.d.ts +4 -2
- package/locales/itIT.js +4 -1
- package/locales/jaJP.d.ts +4 -2
- package/locales/jaJP.js +4 -2
- package/locales/koKR.d.ts +4 -2
- package/locales/koKR.js +4 -1
- package/locales/kzKZ.d.ts +4 -2
- package/locales/kzKZ.js +4 -2
- package/locales/nbNO.d.ts +4 -2
- package/locales/nbNO.js +9 -1
- package/locales/nlNL.d.ts +8 -7
- package/locales/nlNL.js +9 -1
- package/locales/plPL.d.ts +4 -2
- package/locales/plPL.js +9 -1
- package/locales/ptBR.d.ts +4 -2
- package/locales/ptBR.js +9 -1
- package/locales/ruRU.d.ts +4 -2
- package/locales/ruRU.js +4 -2
- package/locales/svSE.d.ts +4 -2
- package/locales/svSE.js +9 -1
- package/locales/trTR.d.ts +4 -2
- package/locales/trTR.js +14 -7
- package/locales/ukUA.d.ts +4 -2
- package/locales/ukUA.js +9 -1
- package/locales/urPK.d.ts +4 -2
- package/locales/urPK.js +9 -1
- package/locales/utils/getPickersLocalization.d.ts +3 -2
- package/locales/utils/pickersLocaleTextApi.d.ts +5 -3
- package/locales/zhCN.d.ts +4 -2
- package/locales/zhCN.js +22 -23
- package/models/adapters.d.ts +7 -6
- package/models/common.d.ts +5 -0
- package/models/common.js +1 -0
- package/models/fields.d.ts +19 -2
- package/models/index.d.ts +1 -0
- package/models/index.js +2 -1
- package/modern/AdapterDateFns/AdapterDateFns.js +597 -0
- package/modern/AdapterDateFns/index.js +1 -149
- package/modern/AdapterDateFnsJalali/AdapterDateFnsJalali.js +608 -0
- package/modern/AdapterDateFnsJalali/index.js +1 -148
- package/modern/AdapterDayjs/AdapterDayjs.js +146 -111
- package/modern/AdapterLuxon/AdapterLuxon.js +512 -0
- package/modern/AdapterLuxon/index.js +1 -111
- package/modern/AdapterMoment/AdapterMoment.js +416 -0
- package/modern/AdapterMoment/index.js +1 -99
- package/modern/AdapterMomentHijri/AdapterMomentHijri.js +269 -0
- package/modern/AdapterMomentHijri/index.js +1 -74
- package/modern/AdapterMomentJalaali/AdapterMomentJalaali.js +276 -0
- package/modern/AdapterMomentJalaali/index.js +1 -87
- package/modern/DateCalendar/DayCalendar.js +1 -1
- package/modern/DateCalendar/useCalendarState.js +1 -1
- package/modern/DateCalendar/useIsDateDisabled.js +27 -0
- package/modern/DateField/DateField.js +20 -3
- package/modern/DateField/useDateField.js +4 -2
- package/modern/DatePicker/DatePickerToolbar.js +1 -1
- package/modern/DateTimeField/DateTimeField.js +21 -3
- package/modern/DateTimeField/useDateTimeField.js +4 -2
- package/modern/DateTimePicker/DateTimePicker.js +1 -0
- package/modern/DesktopDatePicker/DesktopDatePicker.js +1 -1
- package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +2 -1
- package/modern/DesktopTimePicker/DesktopTimePicker.js +49 -7
- package/modern/DigitalClock/DigitalClock.js +396 -0
- package/modern/DigitalClock/DigitalClock.types.js +1 -0
- package/modern/DigitalClock/digitalClockClasses.js +6 -0
- package/modern/DigitalClock/index.js +2 -0
- package/modern/MobileDatePicker/MobileDatePicker.js +1 -1
- package/modern/MobileDateTimePicker/MobileDateTimePicker.js +2 -1
- package/modern/MobileTimePicker/MobileTimePicker.js +2 -1
- package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.js +479 -0
- package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.types.js +1 -0
- package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +65 -0
- package/modern/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +149 -0
- package/modern/MultiSectionDigitalClock/index.js +3 -0
- package/modern/MultiSectionDigitalClock/multiSectionDigitalClockClasses.js +6 -0
- package/modern/MultiSectionDigitalClock/multiSectionDigitalClockSectionClasses.js +6 -0
- package/modern/PickersDay/PickersDay.js +4 -1
- package/modern/PickersLayout/PickersLayout.js +2 -2
- package/modern/StaticDateTimePicker/StaticDateTimePicker.js +2 -1
- package/modern/StaticTimePicker/StaticTimePicker.js +2 -1
- package/modern/TimeClock/TimeClock.js +35 -12
- package/modern/TimeField/TimeField.js +21 -3
- package/modern/TimeField/useTimeField.js +4 -2
- package/modern/TimePicker/TimePicker.js +25 -2
- package/modern/TimePicker/TimePickerToolbar.js +2 -2
- package/modern/index.js +4 -1
- package/modern/internals/constants/dimensions.js +2 -1
- package/modern/internals/demo/DemoContainer.js +4 -1
- package/modern/internals/hooks/date-helpers-hooks.js +3 -3
- package/modern/internals/hooks/useDesktopPicker/useDesktopPicker.js +2 -1
- package/modern/internals/hooks/useField/useField.js +12 -11
- package/modern/internals/hooks/useField/useField.utils.js +60 -34
- package/modern/internals/hooks/useField/useFieldCharacterEditing.js +18 -10
- package/modern/internals/hooks/useField/useFieldState.js +4 -3
- package/modern/internals/hooks/usePicker/usePickerValue.js +1 -1
- package/modern/internals/hooks/{validation/useValidation.js → useValidation.js} +1 -1
- package/modern/internals/hooks/useViews.js +29 -13
- package/modern/internals/index.js +5 -5
- package/modern/internals/models/index.js +2 -1
- package/modern/internals/models/props/clock.js +1 -0
- package/modern/internals/models/validation.js +1 -0
- package/modern/internals/utils/time-utils.js +2 -1
- package/modern/internals/{hooks/validation/useDateValidation.js → utils/validation/validateDate.js} +1 -27
- package/{internals/hooks/validation/useDateTimeValidation.js → modern/internals/utils/validation/validateDateTime.js} +2 -2
- package/{internals/hooks/validation/useTimeValidation.js → modern/internals/utils/validation/validateTime.js} +1 -1
- package/modern/locales/beBY.js +3 -3
- package/modern/locales/caES.js +4 -1
- package/modern/locales/csCZ.js +4 -4
- package/modern/locales/daDK.js +4 -2
- package/modern/locales/deDE.js +4 -2
- package/modern/locales/enUS.js +2 -0
- package/modern/locales/esES.js +4 -1
- package/modern/locales/faIR.js +9 -1
- package/modern/locales/fiFI.js +4 -1
- package/modern/locales/frFR.js +4 -1
- package/modern/locales/heIL.js +4 -1
- package/modern/locales/huHU.js +4 -2
- package/modern/locales/index.js +1 -0
- package/modern/locales/isIS.js +9 -1
- package/modern/locales/itIT.js +4 -1
- package/modern/locales/jaJP.js +4 -2
- package/modern/locales/koKR.js +4 -1
- package/modern/locales/kzKZ.js +4 -2
- package/modern/locales/nbNO.js +9 -1
- package/modern/locales/nlNL.js +9 -1
- package/modern/locales/plPL.js +9 -1
- package/modern/locales/ptBR.js +9 -1
- package/modern/locales/ruRU.js +4 -2
- package/modern/locales/svSE.js +9 -1
- package/modern/locales/trTR.js +14 -7
- package/modern/locales/ukUA.js +9 -1
- package/modern/locales/urPK.js +9 -1
- package/modern/locales/zhCN.js +22 -23
- package/modern/models/common.js +1 -0
- package/modern/models/index.js +2 -1
- package/modern/tests/describeAdapters/describeAdapters.js +1 -3
- package/modern/tests/describeGregorianAdapter/describeGregorianAdapter.js +3 -1
- package/modern/tests/describeGregorianAdapter/testCalculations.js +29 -26
- package/modern/tests/describeGregorianAdapter/testLocalization.js +2 -2
- package/modern/tests/describeHijriAdapter/describeHijriAdapter.js +23 -0
- package/modern/tests/describeHijriAdapter/describeHijriAdapter.types.js +1 -0
- package/modern/tests/describeHijriAdapter/index.js +1 -0
- package/modern/tests/describeHijriAdapter/testCalculations.js +91 -0
- package/modern/tests/describeHijriAdapter/testLocalization.js +13 -0
- package/modern/tests/describeJalaliAdapter/describeJalaliAdapter.js +25 -0
- package/modern/tests/describeJalaliAdapter/describeJalaliAdapter.types.js +1 -0
- package/modern/tests/describeJalaliAdapter/index.js +1 -0
- package/modern/tests/describeJalaliAdapter/testCalculations.js +83 -0
- package/modern/tests/describeJalaliAdapter/testLocalization.js +13 -0
- package/modern/tests/describePicker/describePicker.js +162 -0
- package/modern/tests/describePicker/describePicker.types.js +1 -0
- package/modern/tests/describePicker/index.js +1 -0
- package/modern/tests/describeValue/describeValue.js +1 -1
- package/modern/tests/describeValue/testControlledUnControlled.js +8 -9
- package/modern/tests/describeValue/testPickerActionBar.js +46 -13
- package/modern/tests/describeValue/testPickerOpenCloseLifeCycle.js +0 -5
- package/modern/timeViewRenderers/index.js +1 -1
- package/modern/timeViewRenderers/timeViewRenderers.js +130 -2
- package/node/AdapterDateFns/AdapterDateFns.js +607 -0
- package/node/AdapterDateFns/index.js +6 -152
- package/node/AdapterDateFnsJalali/AdapterDateFnsJalali.js +618 -0
- package/node/AdapterDateFnsJalali/index.js +6 -151
- package/node/AdapterDayjs/AdapterDayjs.js +146 -111
- package/node/AdapterLuxon/AdapterLuxon.js +521 -0
- package/node/AdapterLuxon/index.js +6 -114
- package/node/AdapterMoment/AdapterMoment.js +425 -0
- package/node/AdapterMoment/index.js +6 -102
- package/node/AdapterMomentHijri/AdapterMomentHijri.js +278 -0
- package/node/AdapterMomentHijri/index.js +6 -77
- package/node/AdapterMomentJalaali/AdapterMomentJalaali.js +285 -0
- package/node/AdapterMomentJalaali/index.js +6 -90
- package/node/DateCalendar/DayCalendar.js +2 -2
- package/node/DateCalendar/useCalendarState.js +2 -2
- package/node/{internals/hooks/validation/useDateValidation.js → DateCalendar/useIsDateDisabled.js} +4 -37
- package/node/DateField/DateField.js +20 -3
- package/node/DateField/useDateField.js +5 -3
- package/node/DatePicker/DatePickerToolbar.js +1 -1
- package/node/DateTimeField/DateTimeField.js +21 -3
- package/node/DateTimeField/useDateTimeField.js +5 -3
- package/node/DateTimePicker/DateTimePicker.js +1 -0
- package/node/DesktopDatePicker/DesktopDatePicker.js +2 -2
- package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +3 -2
- package/node/DesktopTimePicker/DesktopTimePicker.js +50 -8
- package/node/DigitalClock/DigitalClock.js +406 -0
- package/node/DigitalClock/digitalClockClasses.js +15 -0
- package/node/DigitalClock/index.js +25 -0
- package/node/MobileDatePicker/MobileDatePicker.js +2 -2
- package/node/MobileDateTimePicker/MobileDateTimePicker.js +3 -2
- package/node/MobileTimePicker/MobileTimePicker.js +3 -2
- package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.js +489 -0
- package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.types.js +5 -0
- package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +73 -0
- package/node/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +159 -0
- package/node/MultiSectionDigitalClock/index.js +32 -0
- package/node/MultiSectionDigitalClock/multiSectionDigitalClockClasses.js +15 -0
- package/node/MultiSectionDigitalClock/multiSectionDigitalClockSectionClasses.js +15 -0
- package/node/PickersDay/PickersDay.js +4 -1
- package/node/PickersLayout/PickersLayout.js +2 -2
- package/node/StaticDateTimePicker/StaticDateTimePicker.js +3 -2
- package/node/StaticTimePicker/StaticTimePicker.js +3 -2
- package/node/TimeClock/TimeClock.js +35 -12
- package/node/TimeField/TimeField.js +21 -3
- package/node/TimeField/useTimeField.js +5 -3
- package/node/TimePicker/TimePicker.js +25 -2
- package/node/TimePicker/TimePickerToolbar.js +2 -2
- package/node/index.js +25 -1
- package/node/internals/constants/dimensions.js +4 -2
- package/node/internals/demo/DemoContainer.js +4 -1
- package/node/internals/hooks/date-helpers-hooks.js +3 -3
- package/node/internals/hooks/useDesktopPicker/useDesktopPicker.js +2 -1
- package/node/internals/hooks/useField/useField.js +12 -11
- package/node/internals/hooks/useField/useField.utils.js +63 -36
- package/node/internals/hooks/useField/useFieldCharacterEditing.js +17 -9
- package/node/internals/hooks/useField/useFieldState.js +4 -3
- package/node/internals/hooks/usePicker/usePickerValue.js +1 -1
- package/node/internals/hooks/{validation/useValidation.js → useValidation.js} +1 -1
- package/node/internals/hooks/useViews.js +29 -13
- package/node/internals/index.js +9 -9
- package/node/internals/models/index.js +11 -0
- package/node/internals/models/props/clock.js +5 -0
- package/node/internals/models/validation.js +5 -0
- package/node/internals/utils/time-utils.js +2 -1
- package/node/internals/utils/validation/validateDate.js +40 -0
- package/node/internals/{hooks/validation/useDateTimeValidation.js → utils/validation/validateDateTime.js} +4 -4
- package/node/internals/{hooks/validation/useTimeValidation.js → utils/validation/validateTime.js} +1 -1
- package/node/locales/beBY.js +3 -3
- package/node/locales/caES.js +4 -1
- package/node/locales/csCZ.js +4 -2
- package/node/locales/daDK.js +4 -1
- package/node/locales/deDE.js +4 -1
- package/node/locales/enUS.js +2 -0
- package/node/locales/esES.js +4 -1
- package/node/locales/faIR.js +9 -1
- package/node/locales/fiFI.js +4 -1
- package/node/locales/frFR.js +4 -1
- package/node/locales/heIL.js +4 -1
- package/node/locales/huHU.js +4 -1
- package/node/locales/index.js +11 -0
- package/node/locales/isIS.js +9 -1
- package/node/locales/itIT.js +4 -1
- package/node/locales/jaJP.js +4 -1
- package/node/locales/koKR.js +4 -1
- package/node/locales/kzKZ.js +4 -1
- package/node/locales/nbNO.js +9 -1
- package/node/locales/nlNL.js +9 -1
- package/node/locales/plPL.js +9 -1
- package/node/locales/ptBR.js +9 -1
- package/node/locales/ruRU.js +4 -1
- package/node/locales/svSE.js +9 -1
- package/node/locales/trTR.js +14 -7
- package/node/locales/ukUA.js +9 -1
- package/node/locales/urPK.js +9 -1
- package/node/locales/zhCN.js +22 -23
- package/node/models/common.js +5 -0
- package/node/models/index.js +11 -0
- package/node/tests/describeAdapters/describeAdapters.js +1 -3
- package/node/tests/describeGregorianAdapter/describeGregorianAdapter.js +3 -1
- package/node/tests/describeGregorianAdapter/testCalculations.js +29 -26
- package/node/tests/describeGregorianAdapter/testLocalization.js +2 -2
- package/node/tests/describeHijriAdapter/describeHijriAdapter.js +31 -0
- package/node/tests/describeHijriAdapter/describeHijriAdapter.types.js +5 -0
- package/node/tests/describeHijriAdapter/index.js +12 -0
- package/node/tests/describeHijriAdapter/testCalculations.js +98 -0
- package/node/tests/describeHijriAdapter/testLocalization.js +20 -0
- package/node/tests/describeJalaliAdapter/describeJalaliAdapter.js +33 -0
- package/node/tests/describeJalaliAdapter/describeJalaliAdapter.types.js +5 -0
- package/node/tests/describeJalaliAdapter/index.js +12 -0
- package/node/tests/describeJalaliAdapter/testCalculations.js +90 -0
- package/node/tests/describeJalaliAdapter/testLocalization.js +20 -0
- package/node/tests/describePicker/describePicker.js +173 -0
- package/node/tests/describePicker/describePicker.types.js +5 -0
- package/node/tests/describePicker/index.js +12 -0
- package/node/tests/describeValue/describeValue.js +1 -1
- package/node/tests/describeValue/testControlledUnControlled.js +8 -9
- package/node/tests/describeValue/testPickerActionBar.js +46 -13
- package/node/tests/describeValue/testPickerOpenCloseLifeCycle.js +0 -5
- package/node/timeViewRenderers/index.js +12 -0
- package/node/timeViewRenderers/timeViewRenderers.js +134 -4
- package/package.json +3 -10
- package/tests/describeAdapters/describeAdapters.js +1 -3
- package/tests/describeGregorianAdapter/describeGregorianAdapter.js +3 -1
- package/tests/describeGregorianAdapter/testCalculations.js +29 -26
- package/tests/describeGregorianAdapter/testLocalization.js +2 -2
- package/tests/describeHijriAdapter/describeHijriAdapter.js +23 -0
- package/tests/describeHijriAdapter/describeHijriAdapter.types.js +1 -0
- package/tests/describeHijriAdapter/index.js +1 -0
- package/tests/describeHijriAdapter/testCalculations.js +91 -0
- package/tests/describeHijriAdapter/testLocalization.js +13 -0
- package/tests/describeJalaliAdapter/describeJalaliAdapter.js +25 -0
- package/tests/describeJalaliAdapter/describeJalaliAdapter.types.js +1 -0
- package/tests/describeJalaliAdapter/index.js +1 -0
- package/tests/describeJalaliAdapter/testCalculations.js +83 -0
- package/tests/describeJalaliAdapter/testLocalization.js +13 -0
- package/tests/describePicker/describePicker.js +162 -0
- package/tests/describePicker/describePicker.types.js +1 -0
- package/tests/describePicker/index.js +1 -0
- package/tests/describeValue/describeValue.js +1 -1
- package/tests/describeValue/testControlledUnControlled.js +8 -9
- package/tests/describeValue/testPickerActionBar.js +46 -13
- package/tests/describeValue/testPickerOpenCloseLifeCycle.js +0 -5
- package/themeAugmentation/components.d.ts +12 -0
- package/themeAugmentation/overrides.d.ts +8 -0
- package/themeAugmentation/props.d.ts +8 -0
- package/timeViewRenderers/index.d.ts +1 -1
- package/timeViewRenderers/index.js +1 -1
- package/timeViewRenderers/timeViewRenderers.d.ts +11 -4
- package/timeViewRenderers/timeViewRenderers.js +130 -2
- /package/{internals/hooks/validation/models.js → DigitalClock/DigitalClock.types.js} +0 -0
- /package/{legacy/internals/hooks/validation/models.js → MultiSectionDigitalClock/MultiSectionDigitalClock.types.js} +0 -0
- /package/{modern/internals/hooks/validation/models.js → internals/models/props/clock.js} +0 -0
- /package/internals/utils/{validation.d.ts → validation/extractValidationProps.d.ts} +0 -0
- /package/internals/utils/{validation.js → validation/extractValidationProps.js} +0 -0
- /package/legacy/internals/utils/{validation.js → validation/extractValidationProps.js} +0 -0
- /package/modern/internals/utils/{validation.js → validation/extractValidationProps.js} +0 -0
- /package/node/{internals/hooks/validation/models.js → DigitalClock/DigitalClock.types.js} +0 -0
- /package/node/internals/utils/{validation.js → validation/extractValidationProps.js} +0 -0
|
@@ -8,12 +8,14 @@ export var getDateSectionConfigFromFormatToken = function getDateSectionConfigFr
|
|
|
8
8
|
if (typeof config === 'string') {
|
|
9
9
|
return {
|
|
10
10
|
type: config,
|
|
11
|
-
contentType: config === 'meridiem' ? 'letter' : 'digit'
|
|
11
|
+
contentType: config === 'meridiem' ? 'letter' : 'digit',
|
|
12
|
+
maxLength: undefined
|
|
12
13
|
};
|
|
13
14
|
}
|
|
14
15
|
return {
|
|
15
16
|
type: config.sectionType,
|
|
16
|
-
contentType: config.contentType
|
|
17
|
+
contentType: config.contentType,
|
|
18
|
+
maxLength: config.maxLength
|
|
17
19
|
};
|
|
18
20
|
};
|
|
19
21
|
var getDeltaFromKeyCode = function getDeltaFromKeyCode(keyCode) {
|
|
@@ -69,36 +71,33 @@ export var getLetterEditingOptions = function getLetterEditingOptions(utils, sec
|
|
|
69
71
|
}
|
|
70
72
|
}
|
|
71
73
|
};
|
|
72
|
-
export var
|
|
73
|
-
var
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
export var cleanLeadingZeros = function cleanLeadingZeros(utils, valueStr, size) {
|
|
75
|
+
var cleanValueStr = valueStr;
|
|
76
|
+
|
|
77
|
+
// Remove the leading zeros
|
|
78
|
+
cleanValueStr = Number(cleanValueStr).toString();
|
|
79
|
+
|
|
80
|
+
// Add enough leading zeros to fill the section
|
|
81
|
+
while (cleanValueStr.length < size) {
|
|
82
|
+
cleanValueStr = "0".concat(cleanValueStr);
|
|
83
|
+
}
|
|
84
|
+
return cleanValueStr;
|
|
85
|
+
};
|
|
86
|
+
export var cleanDigitSectionValue = function cleanDigitSectionValue(utils, value, sectionBoundaries, section) {
|
|
78
87
|
if (process.env.NODE_ENV !== 'production') {
|
|
79
|
-
if (
|
|
80
|
-
throw new Error(["MUI: The token \"".concat(format, "\" is a digit format with letter in it.'\n This type of format is only supported for 'day' sections")].join('\n'));
|
|
88
|
+
if (section.type !== 'day' && section.contentType === 'digit-with-letter') {
|
|
89
|
+
throw new Error(["MUI: The token \"".concat(section.format, "\" is a digit format with letter in it.'\n This type of format is only supported for 'day' sections")].join('\n'));
|
|
81
90
|
}
|
|
82
91
|
}
|
|
83
|
-
if (
|
|
92
|
+
if (section.type === 'day' && section.contentType === 'digit-with-letter') {
|
|
84
93
|
var date = utils.setDate(sectionBoundaries.longestMonth, value);
|
|
85
|
-
return utils.formatByString(date, format);
|
|
94
|
+
return utils.formatByString(date, section.format);
|
|
86
95
|
}
|
|
87
96
|
|
|
88
97
|
// queryValue without leading `0` (`01` => `1`)
|
|
89
98
|
var valueStr = value.toString();
|
|
90
|
-
if (
|
|
91
|
-
|
|
92
|
-
var cleanValueStr = valueStr;
|
|
93
|
-
|
|
94
|
-
// Remove the leading zeros
|
|
95
|
-
cleanValueStr = Number(cleanValueStr).toString();
|
|
96
|
-
|
|
97
|
-
// Add enough leading zeros to fill the section
|
|
98
|
-
while (cleanValueStr.length < size) {
|
|
99
|
-
cleanValueStr = "0".concat(cleanValueStr);
|
|
100
|
-
}
|
|
101
|
-
return cleanValueStr;
|
|
99
|
+
if (section.hasLeadingZerosInInput) {
|
|
100
|
+
return cleanLeadingZeros(utils, valueStr, section.maxLength);
|
|
102
101
|
}
|
|
103
102
|
return valueStr;
|
|
104
103
|
};
|
|
@@ -114,7 +113,7 @@ export var adjustSectionValue = function adjustSectionValue(utils, section, keyC
|
|
|
114
113
|
contentType: section.contentType
|
|
115
114
|
});
|
|
116
115
|
var getCleanValue = function getCleanValue(value) {
|
|
117
|
-
return cleanDigitSectionValue(utils, value,
|
|
116
|
+
return cleanDigitSectionValue(utils, value, sectionBoundaries, section);
|
|
118
117
|
};
|
|
119
118
|
if (shouldSetAbsolute) {
|
|
120
119
|
if (section.type === 'year' && !isEnd && !isStart) {
|
|
@@ -150,20 +149,24 @@ export var adjustSectionValue = function adjustSectionValue(utils, section, keyC
|
|
|
150
149
|
var newOptionIndex = (currentOptionIndex + options.length + delta) % options.length;
|
|
151
150
|
return options[newOptionIndex];
|
|
152
151
|
};
|
|
153
|
-
if (section.contentType === 'digit') {
|
|
152
|
+
if (section.contentType === 'digit' || section.contentType === 'digit-with-letter') {
|
|
154
153
|
return adjustDigitSection();
|
|
155
154
|
}
|
|
156
155
|
return adjustLetterSection();
|
|
157
156
|
};
|
|
158
157
|
export var getSectionVisibleValue = function getSectionVisibleValue(section, target) {
|
|
159
158
|
var value = section.value || section.placeholder;
|
|
159
|
+
var hasLeadingZeros = target === 'non-input' ? section.hasLeadingZerosInFormat : section.hasLeadingZerosInInput;
|
|
160
|
+
if (target === 'non-input' && section.hasLeadingZerosInInput && !section.hasLeadingZerosInFormat) {
|
|
161
|
+
value = Number(value).toString();
|
|
162
|
+
}
|
|
160
163
|
|
|
161
164
|
// In the input, we add an empty character at the end of each section without leading zeros.
|
|
162
165
|
// This makes sure that `onChange` will always be fired.
|
|
163
166
|
// Otherwise, when your input value equals `1/dd/yyyy` (format `M/DD/YYYY` on DayJs),
|
|
164
167
|
// If you press `1`, on the first section, the new value is also `1/dd/yyyy`,
|
|
165
168
|
// So the browser will not fire the input `onChange`.
|
|
166
|
-
var shouldAddInvisibleSpace = ['input-rtl', 'input-ltr'].includes(target) && section.contentType === 'digit' && !
|
|
169
|
+
var shouldAddInvisibleSpace = ['input-rtl', 'input-ltr'].includes(target) && section.contentType === 'digit' && !hasLeadingZeros && value.length === 1;
|
|
167
170
|
if (shouldAddInvisibleSpace) {
|
|
168
171
|
value = "".concat(value, "\u200E");
|
|
169
172
|
}
|
|
@@ -259,7 +262,7 @@ export var changeSectionValueFormat = function changeSectionValueFormat(utils, v
|
|
|
259
262
|
var isFourDigitYearFormat = function isFourDigitYearFormat(utils, format) {
|
|
260
263
|
return utils.formatByString(utils.date(), format).length === 4;
|
|
261
264
|
};
|
|
262
|
-
export var
|
|
265
|
+
export var doesSectionFormatHaveLeadingZeros = function doesSectionFormatHaveLeadingZeros(utils, contentType, sectionType, format) {
|
|
263
266
|
if (contentType !== 'digit') {
|
|
264
267
|
return false;
|
|
265
268
|
}
|
|
@@ -320,21 +323,41 @@ var getEscapedPartsFromFormat = function getEscapedPartsFromFormat(utils, format
|
|
|
320
323
|
}
|
|
321
324
|
return escapedParts;
|
|
322
325
|
};
|
|
323
|
-
export var splitFormatIntoSections = function splitFormatIntoSections(utils, localeText, format, date, formatDensity) {
|
|
326
|
+
export var splitFormatIntoSections = function splitFormatIntoSections(utils, localeText, format, date, formatDensity, shouldRespectLeadingZeros) {
|
|
324
327
|
var startSeparator = '';
|
|
325
328
|
var sections = [];
|
|
329
|
+
var now = utils.date();
|
|
326
330
|
var commitToken = function commitToken(token) {
|
|
327
331
|
if (token === '') {
|
|
328
332
|
return null;
|
|
329
333
|
}
|
|
330
334
|
var sectionConfig = getDateSectionConfigFromFormatToken(utils, token);
|
|
331
|
-
var
|
|
332
|
-
var
|
|
335
|
+
var hasLeadingZerosInFormat = doesSectionFormatHaveLeadingZeros(utils, sectionConfig.contentType, sectionConfig.type, token);
|
|
336
|
+
var hasLeadingZerosInInput = shouldRespectLeadingZeros ? hasLeadingZerosInFormat : sectionConfig.contentType === 'digit';
|
|
337
|
+
var isValidDate = date != null && utils.isValid(date);
|
|
338
|
+
var sectionValue = isValidDate ? utils.formatByString(date, token) : '';
|
|
339
|
+
var maxLength = null;
|
|
340
|
+
if (hasLeadingZerosInInput) {
|
|
341
|
+
if (hasLeadingZerosInFormat) {
|
|
342
|
+
maxLength = sectionValue === '' ? utils.formatByString(now, token).length : sectionValue.length;
|
|
343
|
+
} else {
|
|
344
|
+
if (sectionConfig.maxLength == null) {
|
|
345
|
+
throw new Error("MUI: The token ".concat(token, " should have a 'maxDigitNumber' property on it's adapter"));
|
|
346
|
+
}
|
|
347
|
+
maxLength = sectionConfig.maxLength;
|
|
348
|
+
if (isValidDate) {
|
|
349
|
+
sectionValue = cleanLeadingZeros(utils, sectionValue, maxLength);
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
}
|
|
333
353
|
sections.push(_extends({}, sectionConfig, {
|
|
334
354
|
format: token,
|
|
355
|
+
maxLength: maxLength,
|
|
335
356
|
value: sectionValue,
|
|
336
357
|
placeholder: getSectionPlaceholder(utils, localeText, sectionConfig, token),
|
|
337
|
-
hasLeadingZeros:
|
|
358
|
+
hasLeadingZeros: hasLeadingZerosInFormat,
|
|
359
|
+
hasLeadingZerosInFormat: hasLeadingZerosInFormat,
|
|
360
|
+
hasLeadingZerosInInput: hasLeadingZerosInInput,
|
|
338
361
|
startSeparator: sections.length === 0 ? startSeparator : '',
|
|
339
362
|
endSeparator: '',
|
|
340
363
|
modified: false
|
|
@@ -434,7 +457,8 @@ export var getDateFromDateSections = function getDateFromDateSections(utils, sec
|
|
|
434
457
|
};
|
|
435
458
|
export var createDateStrForInputFromSections = function createDateStrForInputFromSections(sections, isRTL) {
|
|
436
459
|
var formattedSections = sections.map(function (section) {
|
|
437
|
-
|
|
460
|
+
var dateValue = getSectionVisibleValue(section, isRTL ? 'input-rtl' : 'input-ltr');
|
|
461
|
+
return "".concat(section.startSeparator).concat(dateValue).concat(section.endSeparator);
|
|
438
462
|
});
|
|
439
463
|
var dateStr = formattedSections.join('');
|
|
440
464
|
if (!isRTL) {
|
|
@@ -665,7 +689,7 @@ export var clampDaySectionIfPossible = function clampDaySectionIfPossible(utils,
|
|
|
665
689
|
contentType: section.contentType
|
|
666
690
|
});
|
|
667
691
|
return _extends({}, section, {
|
|
668
|
-
value: cleanDigitSectionValue(utils, dayBoundaries.minimum,
|
|
692
|
+
value: cleanDigitSectionValue(utils, dayBoundaries.minimum, dayBoundaries, section)
|
|
669
693
|
});
|
|
670
694
|
});
|
|
671
695
|
var startOfMonth = getDateFromDateSections(utils, sectionsForStartOfMonth);
|
|
@@ -3,7 +3,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import useEventCallback from '@mui/utils/useEventCallback';
|
|
5
5
|
import { useUtils } from '../useUtils';
|
|
6
|
-
import { changeSectionValueFormat, cleanDigitSectionValue,
|
|
6
|
+
import { changeSectionValueFormat, cleanDigitSectionValue, doesSectionFormatHaveLeadingZeros, getDateSectionConfigFromFormatToken, getDaysInWeekStr, getLetterEditingOptions } from './useField.utils';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* The letter editing and the numeric editing each define a `CharacterEditingApplier`.
|
|
@@ -177,12 +177,12 @@ export var useFieldCharacterEditing = function useFieldCharacterEditing(_ref) {
|
|
|
177
177
|
return applyQuery(params, getFirstSectionValueMatchingWithQuery);
|
|
178
178
|
};
|
|
179
179
|
var applyNumericEditing = function applyNumericEditing(params) {
|
|
180
|
-
var getNewSectionValue = function getNewSectionValue(queryValue,
|
|
180
|
+
var getNewSectionValue = function getNewSectionValue(queryValue, section) {
|
|
181
181
|
var queryValueNumber = Number("".concat(queryValue));
|
|
182
|
-
var sectionBoundaries = sectionsValueBoundaries[
|
|
182
|
+
var sectionBoundaries = sectionsValueBoundaries[section.type]({
|
|
183
183
|
currentDate: null,
|
|
184
|
-
format: format,
|
|
185
|
-
contentType: contentType
|
|
184
|
+
format: section.format,
|
|
185
|
+
contentType: section.contentType
|
|
186
186
|
});
|
|
187
187
|
if (queryValueNumber > sectionBoundaries.maximum) {
|
|
188
188
|
return {
|
|
@@ -199,21 +199,29 @@ export var useFieldCharacterEditing = function useFieldCharacterEditing(_ref) {
|
|
|
199
199
|
};
|
|
200
200
|
}
|
|
201
201
|
var shouldGoToNextSection = Number("".concat(queryValue, "0")) > sectionBoundaries.maximum || queryValue.length === sectionBoundaries.maximum.toString().length;
|
|
202
|
-
var newSectionValue = cleanDigitSectionValue(utils, queryValueNumber,
|
|
202
|
+
var newSectionValue = cleanDigitSectionValue(utils, queryValueNumber, sectionBoundaries, section);
|
|
203
203
|
return {
|
|
204
204
|
sectionValue: newSectionValue,
|
|
205
205
|
shouldGoToNextSection: shouldGoToNextSection
|
|
206
206
|
};
|
|
207
207
|
};
|
|
208
208
|
var getFirstSectionValueMatchingWithQuery = function getFirstSectionValueMatchingWithQuery(queryValue, activeSection) {
|
|
209
|
-
if (activeSection.contentType === 'digit') {
|
|
210
|
-
return getNewSectionValue(queryValue, activeSection
|
|
209
|
+
if (activeSection.contentType === 'digit' || activeSection.contentType === 'digit-with-letter') {
|
|
210
|
+
return getNewSectionValue(queryValue, activeSection);
|
|
211
211
|
}
|
|
212
212
|
|
|
213
213
|
// When editing a letter-format month and the user presses a digit,
|
|
214
214
|
// We can support the numeric editing by using the digit-format month and re-formatting the result.
|
|
215
215
|
if (activeSection.type === 'month') {
|
|
216
|
-
var
|
|
216
|
+
var hasLeadingZerosInFormat = doesSectionFormatHaveLeadingZeros(utils, 'digit', 'month', 'MM');
|
|
217
|
+
var response = getNewSectionValue(queryValue, {
|
|
218
|
+
type: activeSection.type,
|
|
219
|
+
format: 'MM',
|
|
220
|
+
hasLeadingZerosInFormat: hasLeadingZerosInFormat,
|
|
221
|
+
hasLeadingZerosInInput: true,
|
|
222
|
+
contentType: 'digit',
|
|
223
|
+
maxLength: 2
|
|
224
|
+
});
|
|
217
225
|
if (isQueryResponseWithoutValue(response)) {
|
|
218
226
|
return response;
|
|
219
227
|
}
|
|
@@ -226,7 +234,7 @@ export var useFieldCharacterEditing = function useFieldCharacterEditing(_ref) {
|
|
|
226
234
|
// When editing a letter-format weekDay and the user presses a digit,
|
|
227
235
|
// We can support the numeric editing by returning the nth day in the week day array.
|
|
228
236
|
if (activeSection.type === 'weekDay') {
|
|
229
|
-
var _response = getNewSectionValue(queryValue, activeSection
|
|
237
|
+
var _response = getNewSectionValue(queryValue, activeSection);
|
|
230
238
|
if (isQueryResponseWithoutValue(_response)) {
|
|
231
239
|
return _response;
|
|
232
240
|
}
|
|
@@ -26,7 +26,9 @@ export var useFieldState = function useFieldState(params) {
|
|
|
26
26
|
_params$internalProps2 = _params$internalProps.formatDensity,
|
|
27
27
|
formatDensity = _params$internalProps2 === void 0 ? 'dense' : _params$internalProps2,
|
|
28
28
|
selectedSectionsProp = _params$internalProps.selectedSections,
|
|
29
|
-
onSelectedSectionsChange = _params$internalProps.onSelectedSectionsChange
|
|
29
|
+
onSelectedSectionsChange = _params$internalProps.onSelectedSectionsChange,
|
|
30
|
+
_params$internalProps3 = _params$internalProps.shouldRespectLeadingZeros,
|
|
31
|
+
shouldRespectLeadingZeros = _params$internalProps3 === void 0 ? false : _params$internalProps3;
|
|
30
32
|
var firstDefaultValue = React.useRef(defaultValue);
|
|
31
33
|
var valueFromTheOutside = (_ref = valueProp != null ? valueProp : firstDefaultValue.current) != null ? _ref : valueManager.emptyValue;
|
|
32
34
|
var sectionsValueBoundaries = React.useMemo(function () {
|
|
@@ -35,9 +37,9 @@ export var useFieldState = function useFieldState(params) {
|
|
|
35
37
|
var getSectionsFromValue = React.useCallback(function (value) {
|
|
36
38
|
var fallbackSections = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
37
39
|
return fieldValueManager.getSectionsFromValue(utils, value, fallbackSections, isRTL, function (date) {
|
|
38
|
-
return splitFormatIntoSections(utils, localeText, format, date, formatDensity);
|
|
40
|
+
return splitFormatIntoSections(utils, localeText, format, date, formatDensity, shouldRespectLeadingZeros);
|
|
39
41
|
});
|
|
40
|
-
}, [fieldValueManager, format, localeText, isRTL, utils, formatDensity]);
|
|
42
|
+
}, [fieldValueManager, format, localeText, isRTL, shouldRespectLeadingZeros, utils, formatDensity]);
|
|
41
43
|
var placeholder = React.useMemo(function () {
|
|
42
44
|
return fieldValueManager.getValueStrFromSections(getSectionsFromValue(valueManager.emptyValue), isRTL);
|
|
43
45
|
}, [fieldValueManager, getSectionsFromValue, valueManager.emptyValue, isRTL]);
|
|
@@ -178,7 +180,7 @@ export var useFieldState = function useFieldState(params) {
|
|
|
178
180
|
if (date == null || !utils.isValid(date)) {
|
|
179
181
|
return null;
|
|
180
182
|
}
|
|
181
|
-
var sections = splitFormatIntoSections(utils, localeText, format, date, formatDensity);
|
|
183
|
+
var sections = splitFormatIntoSections(utils, localeText, format, date, formatDensity, shouldRespectLeadingZeros);
|
|
182
184
|
return mergeDateIntoReferenceDate(utils, date, sections, referenceDate, false);
|
|
183
185
|
};
|
|
184
186
|
var newValue = fieldValueManager.parseValueStr(valueStr, state.referenceValue, parseDateStr);
|
|
@@ -5,7 +5,7 @@ import { unstable_useControlled as useControlled } from '@mui/utils';
|
|
|
5
5
|
import useEventCallback from '@mui/utils/useEventCallback';
|
|
6
6
|
import { useOpenState } from '../useOpenState';
|
|
7
7
|
import { useLocalizationContext, useUtils } from '../useUtils';
|
|
8
|
-
import { useValidation } from '../
|
|
8
|
+
import { useValidation } from '../useValidation';
|
|
9
9
|
/**
|
|
10
10
|
* Decide if the new value should be published
|
|
11
11
|
* The published value will be passed to `onChange` if defined.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { useLocalizationContext } from '
|
|
2
|
+
import { useLocalizationContext } from './useUtils';
|
|
3
3
|
export function useValidation(props, validate, isSameError, defaultErrorState) {
|
|
4
4
|
var value = props.value,
|
|
5
5
|
onError = props.onError;
|
|
@@ -59,24 +59,14 @@ export function useViews(_ref) {
|
|
|
59
59
|
var previousView = (_views = views[viewIndex - 1]) != null ? _views : null;
|
|
60
60
|
var nextView = (_views2 = views[viewIndex + 1]) != null ? _views2 : null;
|
|
61
61
|
var handleChangeView = useEventCallback(function (newView) {
|
|
62
|
+
if (newView === view) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
62
65
|
setView(newView);
|
|
63
66
|
if (onViewChange) {
|
|
64
67
|
onViewChange(newView);
|
|
65
68
|
}
|
|
66
69
|
});
|
|
67
|
-
var goToNextView = useEventCallback(function () {
|
|
68
|
-
if (nextView) {
|
|
69
|
-
handleChangeView(nextView);
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
var setValueAndGoToNextView = useEventCallback(function (value, currentViewSelectionState) {
|
|
73
|
-
var isSelectionFinishedOnCurrentView = currentViewSelectionState === 'finish';
|
|
74
|
-
var globalSelectionState = isSelectionFinishedOnCurrentView && Boolean(nextView) ? 'partial' : currentViewSelectionState;
|
|
75
|
-
onChange(value, globalSelectionState);
|
|
76
|
-
if (isSelectionFinishedOnCurrentView) {
|
|
77
|
-
goToNextView();
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
70
|
var handleFocusedViewChange = useEventCallback(function (viewToFocus, hasFocus) {
|
|
81
71
|
if (hasFocus) {
|
|
82
72
|
// Focus event
|
|
@@ -91,6 +81,31 @@ export function useViews(_ref) {
|
|
|
91
81
|
|
|
92
82
|
onFocusedViewChange == null ? void 0 : onFocusedViewChange(viewToFocus, hasFocus);
|
|
93
83
|
});
|
|
84
|
+
var goToNextView = useEventCallback(function () {
|
|
85
|
+
if (nextView) {
|
|
86
|
+
handleChangeView(nextView);
|
|
87
|
+
}
|
|
88
|
+
handleFocusedViewChange(nextView, true);
|
|
89
|
+
});
|
|
90
|
+
var setValueAndGoToNextView = useEventCallback(function (value, currentViewSelectionState, selectedView) {
|
|
91
|
+
var isSelectionFinishedOnCurrentView = currentViewSelectionState === 'finish';
|
|
92
|
+
var hasMoreViews = selectedView ?
|
|
93
|
+
// handles case like `DateTimePicker`, where a view might return a `finish` selection state
|
|
94
|
+
// but we it's not the final view given all `views` -> overall selection state should be `partial`.
|
|
95
|
+
views.indexOf(selectedView) < views.length - 1 : Boolean(nextView);
|
|
96
|
+
var globalSelectionState = isSelectionFinishedOnCurrentView && hasMoreViews ? 'partial' : currentViewSelectionState;
|
|
97
|
+
onChange(value, globalSelectionState);
|
|
98
|
+
if (isSelectionFinishedOnCurrentView) {
|
|
99
|
+
goToNextView();
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
var setValueAndGoToView = useEventCallback(function (value, newView, selectedView) {
|
|
103
|
+
onChange(value, newView ? 'partial' : 'finish', selectedView);
|
|
104
|
+
if (newView) {
|
|
105
|
+
handleChangeView(newView);
|
|
106
|
+
handleFocusedViewChange(newView, true);
|
|
107
|
+
}
|
|
108
|
+
});
|
|
94
109
|
return {
|
|
95
110
|
view: view,
|
|
96
111
|
setView: handleChangeView,
|
|
@@ -100,6 +115,7 @@ export function useViews(_ref) {
|
|
|
100
115
|
previousView: previousView,
|
|
101
116
|
defaultView: defaultView.current,
|
|
102
117
|
goToNextView: goToNextView,
|
|
103
|
-
setValueAndGoToNextView: setValueAndGoToNextView
|
|
118
|
+
setValueAndGoToNextView: setValueAndGoToNextView,
|
|
119
|
+
setValueAndGoToView: setValueAndGoToView
|
|
104
120
|
};
|
|
105
121
|
}
|
|
@@ -13,15 +13,15 @@ export { useField, createDateStrForInputFromSections, addPositionPropertiesToSec
|
|
|
13
13
|
export { usePicker } from './hooks/usePicker';
|
|
14
14
|
export { useStaticPicker } from './hooks/useStaticPicker';
|
|
15
15
|
export { useLocalizationContext, useDefaultDates, useUtils, useLocaleText, useNow } from './hooks/useUtils';
|
|
16
|
-
export { useValidation } from './hooks/
|
|
17
|
-
export { validateDate } from './hooks/validation/useDateValidation';
|
|
18
|
-
export { validateTime } from './hooks/validation/useTimeValidation';
|
|
19
|
-
export { validateDateTime } from './hooks/validation/useDateTimeValidation';
|
|
16
|
+
export { useValidation } from './hooks/useValidation';
|
|
20
17
|
export { usePreviousMonthDisabled, useNextMonthDisabled } from './hooks/date-helpers-hooks';
|
|
21
18
|
export { applyDefaultDate, replaceInvalidDateByNull, areDatesEqual } from './utils/date-utils';
|
|
22
19
|
export { executeInTheNextEventLoopTick, getActiveElement, onSpaceOrEnter, DEFAULT_DESKTOP_MODE_MEDIA_QUERY } from './utils/utils';
|
|
23
20
|
export { defaultReduceAnimations } from './utils/defaultReduceAnimations';
|
|
24
|
-
export { extractValidationProps } from './utils/validation';
|
|
21
|
+
export { extractValidationProps } from './utils/validation/extractValidationProps';
|
|
22
|
+
export { validateDate } from './utils/validation/validateDate';
|
|
23
|
+
export { validateDateTime } from './utils/validation/validateDateTime';
|
|
24
|
+
export { validateTime } from './utils/validation/validateTime';
|
|
25
25
|
export { buildDeprecatedPropsWarning } from './utils/warning';
|
|
26
26
|
export { uncapitalizeObjectKeys } from './utils/slots-migration';
|
|
27
27
|
export { PickersCalendarHeader } from '../DateCalendar/PickersCalendarHeader';
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from './fields';
|
|
1
|
+
export * from './fields';
|
|
2
|
+
export * from './common';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
var timeViews = ['hours', 'minutes', 'seconds'];
|
|
1
2
|
export var isTimeView = function isTimeView(view) {
|
|
2
|
-
return
|
|
3
|
+
return timeViews.includes(view);
|
|
3
4
|
};
|
|
4
5
|
export var getMeridiem = function getMeridiem(date, utils) {
|
|
5
6
|
if (!date) {
|
package/legacy/internals/{hooks/validation/useDateValidation.js → utils/validation/validateDate.js}
RENAMED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useLocalizationContext } from '../useUtils';
|
|
3
|
-
import { applyDefaultDate } from '../../utils/date-utils';
|
|
1
|
+
import { applyDefaultDate } from '../date-utils';
|
|
4
2
|
export var validateDate = function validateDate(_ref) {
|
|
5
3
|
var props = _ref.props,
|
|
6
4
|
value = _ref.value,
|
|
@@ -31,29 +29,4 @@ export var validateDate = function validateDate(_ref) {
|
|
|
31
29
|
default:
|
|
32
30
|
return null;
|
|
33
31
|
}
|
|
34
|
-
};
|
|
35
|
-
export var useIsDateDisabled = function useIsDateDisabled(_ref2) {
|
|
36
|
-
var shouldDisableDate = _ref2.shouldDisableDate,
|
|
37
|
-
shouldDisableMonth = _ref2.shouldDisableMonth,
|
|
38
|
-
shouldDisableYear = _ref2.shouldDisableYear,
|
|
39
|
-
minDate = _ref2.minDate,
|
|
40
|
-
maxDate = _ref2.maxDate,
|
|
41
|
-
disableFuture = _ref2.disableFuture,
|
|
42
|
-
disablePast = _ref2.disablePast;
|
|
43
|
-
var adapter = useLocalizationContext();
|
|
44
|
-
return React.useCallback(function (day) {
|
|
45
|
-
return validateDate({
|
|
46
|
-
adapter: adapter,
|
|
47
|
-
value: day,
|
|
48
|
-
props: {
|
|
49
|
-
shouldDisableDate: shouldDisableDate,
|
|
50
|
-
shouldDisableMonth: shouldDisableMonth,
|
|
51
|
-
shouldDisableYear: shouldDisableYear,
|
|
52
|
-
minDate: minDate,
|
|
53
|
-
maxDate: maxDate,
|
|
54
|
-
disableFuture: disableFuture,
|
|
55
|
-
disablePast: disablePast
|
|
56
|
-
}
|
|
57
|
-
}) !== null;
|
|
58
|
-
}, [adapter, shouldDisableDate, shouldDisableMonth, shouldDisableYear, minDate, maxDate, disableFuture, disablePast]);
|
|
59
32
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { validateDate } from './
|
|
2
|
-
import { validateTime } from './
|
|
1
|
+
import { validateDate } from './validateDate';
|
|
2
|
+
import { validateTime } from './validateTime';
|
|
3
3
|
export var validateDateTime = function validateDateTime(_ref) {
|
|
4
4
|
var props = _ref.props,
|
|
5
5
|
value = _ref.value,
|
package/legacy/locales/beBY.js
CHANGED
|
@@ -4,9 +4,7 @@ var views = {
|
|
|
4
4
|
hours: 'гадзіны',
|
|
5
5
|
minutes: 'хвіліны',
|
|
6
6
|
seconds: 'секунды',
|
|
7
|
-
|
|
8
|
-
date: 'календара',
|
|
9
|
-
time: 'часу'
|
|
7
|
+
meridiem: 'мерыдыем'
|
|
10
8
|
};
|
|
11
9
|
var beBYPickers = {
|
|
12
10
|
// Calendar navigation
|
|
@@ -44,6 +42,10 @@ var beBYPickers = {
|
|
|
44
42
|
secondsClockNumberText: function secondsClockNumberText(seconds) {
|
|
45
43
|
return "".concat(seconds, " \u0441\u0435\u043A\u0443\u043D\u0434");
|
|
46
44
|
},
|
|
45
|
+
// Digital clock labels
|
|
46
|
+
selectViewText: function selectViewText(view) {
|
|
47
|
+
return "\u0410\u0431\u044F\u0440\u044B\u0446\u0435 ".concat(views[view]);
|
|
48
|
+
},
|
|
47
49
|
// Calendar labels
|
|
48
50
|
calendarWeekNumberHeaderLabel: 'Нумар тыдня',
|
|
49
51
|
calendarWeekNumberHeaderText: '#',
|
package/legacy/locales/caES.js
CHANGED
|
@@ -2,7 +2,8 @@ import { getPickersLocalization } from './utils/getPickersLocalization';
|
|
|
2
2
|
var views = {
|
|
3
3
|
hours: 'les hores',
|
|
4
4
|
minutes: 'els minuts',
|
|
5
|
-
seconds: 'els segons'
|
|
5
|
+
seconds: 'els segons',
|
|
6
|
+
meridiem: 'meridiem'
|
|
6
7
|
};
|
|
7
8
|
var caESPickers = {
|
|
8
9
|
// Calendar navigation
|
|
@@ -40,6 +41,10 @@ var caESPickers = {
|
|
|
40
41
|
secondsClockNumberText: function secondsClockNumberText(seconds) {
|
|
41
42
|
return "".concat(seconds, " segons");
|
|
42
43
|
},
|
|
44
|
+
// Digital clock labels
|
|
45
|
+
selectViewText: function selectViewText(view) {
|
|
46
|
+
return "Seleccionar ".concat(views[view]);
|
|
47
|
+
},
|
|
43
48
|
// Calendar labels
|
|
44
49
|
calendarWeekNumberHeaderLabel: 'Número de setmana',
|
|
45
50
|
calendarWeekNumberHeaderText: '#',
|
package/legacy/locales/csCZ.js
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { getPickersLocalization } from './utils/getPickersLocalization';
|
|
2
|
-
|
|
3
|
-
// This object is not Partial<PickersLocaleText> because it is the default values
|
|
4
|
-
|
|
5
2
|
// maps TimeView to its translation
|
|
6
3
|
var timeViews = {
|
|
7
4
|
hours: 'Hodiny',
|
|
8
5
|
minutes: 'Minuty',
|
|
9
|
-
seconds: 'Sekundy'
|
|
6
|
+
seconds: 'Sekundy',
|
|
7
|
+
meridiem: 'Odpoledne'
|
|
10
8
|
};
|
|
11
9
|
var csCZPickers = {
|
|
12
10
|
// Calendar navigation
|
|
@@ -45,6 +43,10 @@ var csCZPickers = {
|
|
|
45
43
|
secondsClockNumberText: function secondsClockNumberText(seconds) {
|
|
46
44
|
return "".concat(seconds, " sekund");
|
|
47
45
|
},
|
|
46
|
+
// Digital clock labels
|
|
47
|
+
selectViewText: function selectViewText(view) {
|
|
48
|
+
return "Vyberte ".concat(timeViews[view]);
|
|
49
|
+
},
|
|
48
50
|
// Calendar labels
|
|
49
51
|
calendarWeekNumberHeaderLabel: 'Týden v roce',
|
|
50
52
|
calendarWeekNumberHeaderText: '#',
|
package/legacy/locales/daDK.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { getPickersLocalization } from './utils/getPickersLocalization';
|
|
2
|
-
|
|
3
2
|
// maps TimeView to its translation
|
|
4
3
|
var timeViews = {
|
|
5
4
|
hours: 'Timer',
|
|
6
5
|
minutes: 'Minutter',
|
|
7
|
-
seconds: 'Sekunder'
|
|
6
|
+
seconds: 'Sekunder',
|
|
7
|
+
meridiem: 'Meridiem'
|
|
8
8
|
};
|
|
9
9
|
var daDKPickers = {
|
|
10
10
|
// Calendar navigation
|
|
@@ -43,6 +43,10 @@ var daDKPickers = {
|
|
|
43
43
|
secondsClockNumberText: function secondsClockNumberText(seconds) {
|
|
44
44
|
return "".concat(seconds, " sekunder");
|
|
45
45
|
},
|
|
46
|
+
// Digital clock labels
|
|
47
|
+
selectViewText: function selectViewText(view) {
|
|
48
|
+
return "V\xE6lg ".concat(timeViews[view]);
|
|
49
|
+
},
|
|
46
50
|
// Calendar labels
|
|
47
51
|
calendarWeekNumberHeaderLabel: 'Ugenummer',
|
|
48
52
|
calendarWeekNumberHeaderText: '#',
|
package/legacy/locales/deDE.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { getPickersLocalization } from './utils/getPickersLocalization';
|
|
2
|
-
|
|
3
2
|
// maps TimeView to its translation
|
|
4
3
|
var timeViews = {
|
|
5
4
|
hours: 'Stunden',
|
|
6
5
|
minutes: 'Minuten',
|
|
7
|
-
seconds: 'Sekunden'
|
|
6
|
+
seconds: 'Sekunden',
|
|
7
|
+
meridiem: 'Meridiem'
|
|
8
8
|
};
|
|
9
9
|
var deDEPickers = {
|
|
10
10
|
// Calendar navigation
|
|
@@ -43,6 +43,10 @@ var deDEPickers = {
|
|
|
43
43
|
secondsClockNumberText: function secondsClockNumberText(seconds) {
|
|
44
44
|
return "".concat(seconds, " ").concat(timeViews.seconds);
|
|
45
45
|
},
|
|
46
|
+
// Digital clock labels
|
|
47
|
+
selectViewText: function selectViewText(view) {
|
|
48
|
+
return "Ausw\xE4hlen ".concat(timeViews[view]);
|
|
49
|
+
},
|
|
46
50
|
// Calendar labels
|
|
47
51
|
calendarWeekNumberHeaderLabel: 'Kalenderwoche',
|
|
48
52
|
calendarWeekNumberHeaderText: '#',
|
package/legacy/locales/enUS.js
CHANGED
|
@@ -38,6 +38,10 @@ var enUSPickers = {
|
|
|
38
38
|
secondsClockNumberText: function secondsClockNumberText(seconds) {
|
|
39
39
|
return "".concat(seconds, " seconds");
|
|
40
40
|
},
|
|
41
|
+
// Digital clock labels
|
|
42
|
+
selectViewText: function selectViewText(view) {
|
|
43
|
+
return "Select ".concat(view);
|
|
44
|
+
},
|
|
41
45
|
// Calendar labels
|
|
42
46
|
calendarWeekNumberHeaderLabel: 'Week number',
|
|
43
47
|
calendarWeekNumberHeaderText: '#',
|
package/legacy/locales/esES.js
CHANGED
|
@@ -2,7 +2,8 @@ import { getPickersLocalization } from './utils/getPickersLocalization';
|
|
|
2
2
|
var views = {
|
|
3
3
|
hours: 'las horas',
|
|
4
4
|
minutes: 'los minutos',
|
|
5
|
-
seconds: 'los segundos'
|
|
5
|
+
seconds: 'los segundos',
|
|
6
|
+
meridiem: 'meridiano'
|
|
6
7
|
};
|
|
7
8
|
var esESPickers = {
|
|
8
9
|
// Calendar navigation
|
|
@@ -40,6 +41,10 @@ var esESPickers = {
|
|
|
40
41
|
secondsClockNumberText: function secondsClockNumberText(seconds) {
|
|
41
42
|
return "".concat(seconds, " segundos");
|
|
42
43
|
},
|
|
44
|
+
// Digital clock labels
|
|
45
|
+
selectViewText: function selectViewText(view) {
|
|
46
|
+
return "Seleccionar ".concat(views[view]);
|
|
47
|
+
},
|
|
43
48
|
// Calendar labels
|
|
44
49
|
calendarWeekNumberHeaderLabel: 'Número de semana',
|
|
45
50
|
calendarWeekNumberHeaderText: '#',
|