@mui/x-date-pickers 6.2.0 → 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 +118 -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 +2 -1
- package/DesktopDateTimePicker/DesktopDateTimePicker.js +3 -1
- package/DesktopTimePicker/DesktopTimePicker.js +51 -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/LocalizationProvider/LocalizationProvider.d.ts +1 -1
- package/LocalizationProvider/LocalizationProvider.js +1 -1
- package/MobileDatePicker/MobileDatePicker.js +2 -1
- package/MobileDateTimePicker/MobileDateTimePicker.js +3 -1
- package/MobileTimePicker/MobileTimePicker.js +3 -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/StaticDatePicker/StaticDatePicker.js +1 -0
- package/StaticDateTimePicker/StaticDateTimePicker.js +5 -3
- package/StaticTimePicker/StaticTimePicker.js +5 -3
- 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 +15 -15
- 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 -5
- package/internals/hooks/useField/useField.utils.d.ts +9 -6
- package/internals/hooks/useField/useField.utils.js +60 -34
- package/internals/hooks/useField/useFieldCharacterEditing.js +18 -10
- package/internals/hooks/useField/useFieldState.js +5 -4
- package/internals/hooks/useIsLandscape.d.ts +2 -2
- package/internals/hooks/useMobilePicker/useMobilePicker.d.ts +2 -2
- package/internals/hooks/useMobilePicker/useMobilePicker.js +10 -10
- package/internals/hooks/useMobilePicker/useMobilePicker.types.d.ts +7 -6
- package/internals/hooks/usePicker/usePicker.d.ts +4 -3
- package/internals/hooks/usePicker/usePicker.js +2 -0
- 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 +2 -2
- package/internals/hooks/usePicker/usePickerValue.js +10 -12
- package/internals/hooks/usePicker/usePickerValue.types.d.ts +5 -3
- package/internals/hooks/usePicker/usePickerViews.d.ts +11 -11
- package/internals/hooks/useStaticPicker/useStaticPicker.d.ts +2 -2
- package/internals/hooks/useStaticPicker/useStaticPicker.js +10 -10
- 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/valueManagers.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 +2 -1
- package/legacy/DesktopDateTimePicker/DesktopDateTimePicker.js +3 -1
- package/legacy/DesktopTimePicker/DesktopTimePicker.js +52 -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/LocalizationProvider/LocalizationProvider.js +1 -1
- package/legacy/MobileDatePicker/MobileDatePicker.js +2 -1
- package/legacy/MobileDateTimePicker/MobileDateTimePicker.js +3 -1
- package/legacy/MobileTimePicker/MobileTimePicker.js +3 -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/StaticDatePicker/StaticDatePicker.js +1 -0
- package/legacy/StaticDateTimePicker/StaticDateTimePicker.js +5 -3
- package/legacy/StaticTimePicker/StaticTimePicker.js +5 -3
- 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 +10 -11
- 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 +7 -5
- package/legacy/internals/hooks/useMobilePicker/useMobilePicker.js +5 -6
- package/legacy/internals/hooks/usePicker/usePicker.js +2 -0
- package/legacy/internals/hooks/usePicker/usePickerValue.js +10 -14
- package/legacy/internals/hooks/useStaticPicker/useStaticPicker.js +7 -8
- 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/internals/utils/valueManagers.js +2 -2
- 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 +20 -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 +2 -1
- package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +3 -1
- package/modern/DesktopTimePicker/DesktopTimePicker.js +50 -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/LocalizationProvider/LocalizationProvider.js +1 -1
- package/modern/MobileDatePicker/MobileDatePicker.js +2 -1
- package/modern/MobileDateTimePicker/MobileDateTimePicker.js +3 -1
- package/modern/MobileTimePicker/MobileTimePicker.js +3 -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/StaticDatePicker/StaticDatePicker.js +1 -0
- package/modern/StaticDateTimePicker/StaticDateTimePicker.js +5 -3
- package/modern/StaticTimePicker/StaticTimePicker.js +5 -3
- 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 +15 -15
- 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 +5 -4
- package/modern/internals/hooks/useMobilePicker/useMobilePicker.js +10 -10
- package/modern/internals/hooks/usePicker/usePicker.js +2 -0
- package/modern/internals/hooks/usePicker/usePickerValue.js +10 -12
- package/modern/internals/hooks/useStaticPicker/useStaticPicker.js +10 -10
- 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/internals/utils/valueManagers.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 +3 -2
- package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +4 -2
- package/node/DesktopTimePicker/DesktopTimePicker.js +51 -8
- package/node/DigitalClock/DigitalClock.js +406 -0
- package/node/DigitalClock/digitalClockClasses.js +15 -0
- package/node/DigitalClock/index.js +25 -0
- package/node/LocalizationProvider/LocalizationProvider.js +1 -1
- package/node/MobileDatePicker/MobileDatePicker.js +3 -2
- package/node/MobileDateTimePicker/MobileDateTimePicker.js +4 -2
- package/node/MobileTimePicker/MobileTimePicker.js +4 -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/StaticDatePicker/StaticDatePicker.js +1 -0
- package/node/StaticDateTimePicker/StaticDateTimePicker.js +5 -3
- package/node/StaticTimePicker/StaticTimePicker.js +5 -3
- 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 +15 -15
- 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 +5 -4
- package/node/internals/hooks/useMobilePicker/useMobilePicker.js +10 -10
- package/node/internals/hooks/usePicker/usePicker.js +2 -0
- package/node/internals/hooks/usePicker/usePickerValue.js +10 -12
- package/node/internals/hooks/useStaticPicker/useStaticPicker.js +10 -10
- 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/internals/utils/valueManagers.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
|
@@ -1,157 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
|
-
exports
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var _longFormatters = _interopRequireDefault(require("date-fns-jalali/_lib/format/longFormatters"));
|
|
12
|
-
// @ts-ignore
|
|
13
|
-
|
|
14
|
-
const formatTokenMap = {
|
|
15
|
-
// Year
|
|
16
|
-
y: 'year',
|
|
17
|
-
yy: 'year',
|
|
18
|
-
yyy: 'year',
|
|
19
|
-
yyyy: 'year',
|
|
20
|
-
// Month
|
|
21
|
-
M: 'month',
|
|
22
|
-
MM: 'month',
|
|
23
|
-
MMMM: {
|
|
24
|
-
sectionType: 'month',
|
|
25
|
-
contentType: 'letter'
|
|
26
|
-
},
|
|
27
|
-
MMM: {
|
|
28
|
-
sectionType: 'month',
|
|
29
|
-
contentType: 'letter'
|
|
30
|
-
},
|
|
31
|
-
LLL: {
|
|
32
|
-
sectionType: 'month',
|
|
33
|
-
contentType: 'letter'
|
|
34
|
-
},
|
|
35
|
-
LLLL: {
|
|
36
|
-
sectionType: 'month',
|
|
37
|
-
contentType: 'letter'
|
|
38
|
-
},
|
|
39
|
-
// Day of the month
|
|
40
|
-
d: 'day',
|
|
41
|
-
dd: 'day',
|
|
42
|
-
do: 'day',
|
|
43
|
-
// Day of the week
|
|
44
|
-
E: {
|
|
45
|
-
sectionType: 'weekDay',
|
|
46
|
-
contentType: 'letter'
|
|
47
|
-
},
|
|
48
|
-
EE: {
|
|
49
|
-
sectionType: 'weekDay',
|
|
50
|
-
contentType: 'letter'
|
|
51
|
-
},
|
|
52
|
-
EEE: {
|
|
53
|
-
sectionType: 'weekDay',
|
|
54
|
-
contentType: 'letter'
|
|
55
|
-
},
|
|
56
|
-
EEEE: {
|
|
57
|
-
sectionType: 'weekDay',
|
|
58
|
-
contentType: 'letter'
|
|
59
|
-
},
|
|
60
|
-
EEEEE: {
|
|
61
|
-
sectionType: 'weekDay',
|
|
62
|
-
contentType: 'letter'
|
|
63
|
-
},
|
|
64
|
-
i: 'weekDay',
|
|
65
|
-
ii: 'weekDay',
|
|
66
|
-
iii: {
|
|
67
|
-
sectionType: 'weekDay',
|
|
68
|
-
contentType: 'letter'
|
|
69
|
-
},
|
|
70
|
-
iiii: {
|
|
71
|
-
sectionType: 'weekDay',
|
|
72
|
-
contentType: 'letter'
|
|
73
|
-
},
|
|
74
|
-
e: 'weekDay',
|
|
75
|
-
ee: 'weekDay',
|
|
76
|
-
eee: {
|
|
77
|
-
sectionType: 'weekDay',
|
|
78
|
-
contentType: 'letter'
|
|
79
|
-
},
|
|
80
|
-
eeee: {
|
|
81
|
-
sectionType: 'weekDay',
|
|
82
|
-
contentType: 'letter'
|
|
83
|
-
},
|
|
84
|
-
eeeee: {
|
|
85
|
-
sectionType: 'weekDay',
|
|
86
|
-
contentType: 'letter'
|
|
87
|
-
},
|
|
88
|
-
eeeeee: {
|
|
89
|
-
sectionType: 'weekDay',
|
|
90
|
-
contentType: 'letter'
|
|
91
|
-
},
|
|
92
|
-
c: 'weekDay',
|
|
93
|
-
cc: 'weekDay',
|
|
94
|
-
ccc: {
|
|
95
|
-
sectionType: 'weekDay',
|
|
96
|
-
contentType: 'letter'
|
|
97
|
-
},
|
|
98
|
-
cccc: {
|
|
99
|
-
sectionType: 'weekDay',
|
|
100
|
-
contentType: 'letter'
|
|
101
|
-
},
|
|
102
|
-
ccccc: {
|
|
103
|
-
sectionType: 'weekDay',
|
|
104
|
-
contentType: 'letter'
|
|
105
|
-
},
|
|
106
|
-
cccccc: {
|
|
107
|
-
sectionType: 'weekDay',
|
|
108
|
-
contentType: 'letter'
|
|
109
|
-
},
|
|
110
|
-
// Meridiem
|
|
111
|
-
a: 'meridiem',
|
|
112
|
-
aa: 'meridiem',
|
|
113
|
-
aaa: 'meridiem',
|
|
114
|
-
// Hours
|
|
115
|
-
H: 'hours',
|
|
116
|
-
HH: 'hours',
|
|
117
|
-
h: 'hours',
|
|
118
|
-
hh: 'hours',
|
|
119
|
-
// Minutes
|
|
120
|
-
mm: 'minutes',
|
|
121
|
-
// Seconds
|
|
122
|
-
ss: 'seconds'
|
|
123
|
-
};
|
|
124
|
-
class AdapterDateFnsJalali extends _dateFnsJalali.default {
|
|
125
|
-
constructor(...args) {
|
|
126
|
-
super(...args);
|
|
127
|
-
this.isMUIAdapter = true;
|
|
128
|
-
this.formatTokenMap = formatTokenMap;
|
|
129
|
-
this.escapedCharacters = {
|
|
130
|
-
start: "'",
|
|
131
|
-
end: "'"
|
|
132
|
-
};
|
|
133
|
-
this.expandFormat = format => {
|
|
134
|
-
// @see https://github.com/date-fns/date-fns/blob/master/src/format/index.js#L31
|
|
135
|
-
const longFormatRegexp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
|
|
136
|
-
const locale = this.locale ?? _faIR.default;
|
|
137
|
-
return format.match(longFormatRegexp).map(token => {
|
|
138
|
-
const firstCharacter = token[0];
|
|
139
|
-
if (firstCharacter === 'p' || firstCharacter === 'P') {
|
|
140
|
-
const longFormatter = _longFormatters.default[firstCharacter];
|
|
141
|
-
return longFormatter(token, locale.formatLong, {});
|
|
142
|
-
}
|
|
143
|
-
return token;
|
|
144
|
-
}).join('');
|
|
145
|
-
};
|
|
146
|
-
// Redefined here just to show how it can be written using expandFormat
|
|
147
|
-
this.getFormatHelperText = format => {
|
|
148
|
-
return this.expandFormat(format).replace(/(aaa|aa|a)/g, '(a|p)m').toLocaleLowerCase();
|
|
149
|
-
};
|
|
150
|
-
this.getWeekNumber = date => {
|
|
151
|
-
return (0, _getWeek.default)(date, {
|
|
152
|
-
locale: this.locale
|
|
153
|
-
});
|
|
154
|
-
};
|
|
6
|
+
Object.defineProperty(exports, "AdapterDateFnsJalali", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _AdapterDateFnsJalali.AdapterDateFnsJalali;
|
|
155
10
|
}
|
|
156
|
-
}
|
|
157
|
-
|
|
11
|
+
});
|
|
12
|
+
var _AdapterDateFnsJalali = require("./AdapterDateFnsJalali");
|
|
@@ -21,9 +21,17 @@ const localeNotFoundWarning = (0, _warning.buildWarning)(['Your locale has not b
|
|
|
21
21
|
const formatTokenMap = {
|
|
22
22
|
// Year
|
|
23
23
|
YY: 'year',
|
|
24
|
-
YYYY:
|
|
24
|
+
YYYY: {
|
|
25
|
+
sectionType: 'year',
|
|
26
|
+
contentType: 'digit',
|
|
27
|
+
maxLength: 4
|
|
28
|
+
},
|
|
25
29
|
// Month
|
|
26
|
-
M:
|
|
30
|
+
M: {
|
|
31
|
+
sectionType: 'month',
|
|
32
|
+
contentType: 'digit',
|
|
33
|
+
maxLength: 2
|
|
34
|
+
},
|
|
27
35
|
MM: 'month',
|
|
28
36
|
MMM: {
|
|
29
37
|
sectionType: 'month',
|
|
@@ -34,11 +42,22 @@ const formatTokenMap = {
|
|
|
34
42
|
contentType: 'letter'
|
|
35
43
|
},
|
|
36
44
|
// Day of the month
|
|
37
|
-
D:
|
|
45
|
+
D: {
|
|
46
|
+
sectionType: 'day',
|
|
47
|
+
contentType: 'digit',
|
|
48
|
+
maxLength: 2
|
|
49
|
+
},
|
|
38
50
|
DD: 'day',
|
|
39
|
-
Do:
|
|
51
|
+
Do: {
|
|
52
|
+
sectionType: 'day',
|
|
53
|
+
contentType: 'digit-with-letter'
|
|
54
|
+
},
|
|
40
55
|
// Day of the week
|
|
41
|
-
d:
|
|
56
|
+
d: {
|
|
57
|
+
sectionType: 'weekDay',
|
|
58
|
+
contentType: 'digit',
|
|
59
|
+
maxLength: 2
|
|
60
|
+
},
|
|
42
61
|
dd: {
|
|
43
62
|
sectionType: 'weekDay',
|
|
44
63
|
contentType: 'letter'
|
|
@@ -55,15 +74,31 @@ const formatTokenMap = {
|
|
|
55
74
|
A: 'meridiem',
|
|
56
75
|
a: 'meridiem',
|
|
57
76
|
// Hours
|
|
58
|
-
H:
|
|
77
|
+
H: {
|
|
78
|
+
sectionType: 'hours',
|
|
79
|
+
contentType: 'digit',
|
|
80
|
+
maxLength: 2
|
|
81
|
+
},
|
|
59
82
|
HH: 'hours',
|
|
60
|
-
h:
|
|
83
|
+
h: {
|
|
84
|
+
sectionType: 'hours',
|
|
85
|
+
contentType: 'digit',
|
|
86
|
+
maxLength: 2
|
|
87
|
+
},
|
|
61
88
|
hh: 'hours',
|
|
62
89
|
// Minutes
|
|
63
|
-
m:
|
|
90
|
+
m: {
|
|
91
|
+
sectionType: 'minutes',
|
|
92
|
+
contentType: 'digit',
|
|
93
|
+
maxLength: 2
|
|
94
|
+
},
|
|
64
95
|
mm: 'minutes',
|
|
65
96
|
// Seconds
|
|
66
|
-
s:
|
|
97
|
+
s: {
|
|
98
|
+
sectionType: 'seconds',
|
|
99
|
+
contentType: 'digit',
|
|
100
|
+
maxLength: 2
|
|
101
|
+
},
|
|
67
102
|
ss: 'seconds'
|
|
68
103
|
};
|
|
69
104
|
const defaultFormats = {
|
|
@@ -129,8 +164,8 @@ class AdapterDayjs {
|
|
|
129
164
|
instance
|
|
130
165
|
} = {}) {
|
|
131
166
|
this.isMUIAdapter = true;
|
|
132
|
-
this.rawDayJsInstance = void 0;
|
|
133
167
|
this.lib = 'dayjs';
|
|
168
|
+
this.rawDayJsInstance = void 0;
|
|
134
169
|
this.dayjs = void 0;
|
|
135
170
|
this.locale = void 0;
|
|
136
171
|
this.formats = void 0;
|
|
@@ -190,23 +225,23 @@ class AdapterDayjs {
|
|
|
190
225
|
this.getFormatHelperText = format => {
|
|
191
226
|
return this.expandFormat(format).replace(/a/gi, '(a|p)m').toLocaleLowerCase();
|
|
192
227
|
};
|
|
193
|
-
this.isNull =
|
|
194
|
-
return
|
|
228
|
+
this.isNull = value => {
|
|
229
|
+
return value === null;
|
|
195
230
|
};
|
|
196
231
|
this.isValid = value => {
|
|
197
232
|
return this.dayjs(value).isValid();
|
|
198
233
|
};
|
|
199
|
-
this.format = (
|
|
200
|
-
return this.formatByString(
|
|
234
|
+
this.format = (value, formatKey) => {
|
|
235
|
+
return this.formatByString(value, this.formats[formatKey]);
|
|
201
236
|
};
|
|
202
|
-
this.formatByString = (
|
|
203
|
-
return this.dayjs(
|
|
237
|
+
this.formatByString = (value, formatString) => {
|
|
238
|
+
return this.dayjs(value).format(formatString);
|
|
204
239
|
};
|
|
205
240
|
this.formatNumber = numberToFormat => {
|
|
206
241
|
return numberToFormat;
|
|
207
242
|
};
|
|
208
|
-
this.getDiff = (
|
|
209
|
-
return
|
|
243
|
+
this.getDiff = (value, comparing, unit) => {
|
|
244
|
+
return value.diff(comparing, unit);
|
|
210
245
|
};
|
|
211
246
|
this.isEqual = (value, comparing) => {
|
|
212
247
|
if (value === null && comparing === null) {
|
|
@@ -214,131 +249,131 @@ class AdapterDayjs {
|
|
|
214
249
|
}
|
|
215
250
|
return this.dayjs(value).isSame(comparing);
|
|
216
251
|
};
|
|
217
|
-
this.isSameYear = (
|
|
218
|
-
return
|
|
252
|
+
this.isSameYear = (value, comparing) => {
|
|
253
|
+
return value.isSame(comparing, 'year');
|
|
219
254
|
};
|
|
220
|
-
this.isSameMonth = (
|
|
221
|
-
return
|
|
255
|
+
this.isSameMonth = (value, comparing) => {
|
|
256
|
+
return value.isSame(comparing, 'month');
|
|
222
257
|
};
|
|
223
|
-
this.isSameDay = (
|
|
224
|
-
return
|
|
258
|
+
this.isSameDay = (value, comparing) => {
|
|
259
|
+
return value.isSame(comparing, 'day');
|
|
225
260
|
};
|
|
226
|
-
this.isSameHour = (
|
|
227
|
-
return
|
|
261
|
+
this.isSameHour = (value, comparing) => {
|
|
262
|
+
return value.isSame(comparing, 'hour');
|
|
228
263
|
};
|
|
229
|
-
this.isAfter = (
|
|
230
|
-
return
|
|
264
|
+
this.isAfter = (value, comparing) => {
|
|
265
|
+
return value.isAfter(comparing);
|
|
231
266
|
};
|
|
232
|
-
this.isAfterYear = (
|
|
233
|
-
return
|
|
267
|
+
this.isAfterYear = (value, comparing) => {
|
|
268
|
+
return value.isAfter(comparing, 'year');
|
|
234
269
|
};
|
|
235
|
-
this.isAfterDay = (
|
|
236
|
-
return
|
|
270
|
+
this.isAfterDay = (value, comparing) => {
|
|
271
|
+
return value.isAfter(comparing, 'day');
|
|
237
272
|
};
|
|
238
|
-
this.isBefore = (
|
|
239
|
-
return
|
|
273
|
+
this.isBefore = (value, comparing) => {
|
|
274
|
+
return value.isBefore(comparing);
|
|
240
275
|
};
|
|
241
|
-
this.isBeforeYear = (
|
|
242
|
-
return
|
|
276
|
+
this.isBeforeYear = (value, comparing) => {
|
|
277
|
+
return value.isBefore(comparing, 'year');
|
|
243
278
|
};
|
|
244
|
-
this.isBeforeDay = (
|
|
245
|
-
return
|
|
279
|
+
this.isBeforeDay = (value, comparing) => {
|
|
280
|
+
return value.isBefore(comparing, 'day');
|
|
246
281
|
};
|
|
247
|
-
this.isWithinRange = (
|
|
248
|
-
return
|
|
282
|
+
this.isWithinRange = (value, [start, end]) => {
|
|
283
|
+
return value.isBetween(start, end, null, '[]');
|
|
249
284
|
};
|
|
250
|
-
this.startOfYear =
|
|
251
|
-
return
|
|
285
|
+
this.startOfYear = value => {
|
|
286
|
+
return value.startOf('year');
|
|
252
287
|
};
|
|
253
|
-
this.startOfMonth =
|
|
254
|
-
return
|
|
288
|
+
this.startOfMonth = value => {
|
|
289
|
+
return value.startOf('month');
|
|
255
290
|
};
|
|
256
|
-
this.
|
|
257
|
-
return
|
|
291
|
+
this.startOfWeek = value => {
|
|
292
|
+
return value.startOf('week');
|
|
258
293
|
};
|
|
259
|
-
this.
|
|
260
|
-
return
|
|
294
|
+
this.startOfDay = value => {
|
|
295
|
+
return value.startOf('day');
|
|
261
296
|
};
|
|
262
|
-
this.
|
|
263
|
-
return
|
|
297
|
+
this.endOfYear = value => {
|
|
298
|
+
return value.endOf('year');
|
|
264
299
|
};
|
|
265
|
-
this.endOfMonth =
|
|
266
|
-
return
|
|
300
|
+
this.endOfMonth = value => {
|
|
301
|
+
return value.endOf('month');
|
|
267
302
|
};
|
|
268
|
-
this.endOfWeek =
|
|
269
|
-
return
|
|
303
|
+
this.endOfWeek = value => {
|
|
304
|
+
return value.endOf('week');
|
|
270
305
|
};
|
|
271
|
-
this.endOfDay =
|
|
272
|
-
return
|
|
306
|
+
this.endOfDay = value => {
|
|
307
|
+
return value.endOf('day');
|
|
273
308
|
};
|
|
274
|
-
this.addYears = (
|
|
275
|
-
return
|
|
309
|
+
this.addYears = (value, amount) => {
|
|
310
|
+
return amount < 0 ? value.subtract(Math.abs(amount), 'year') : value.add(amount, 'year');
|
|
276
311
|
};
|
|
277
|
-
this.addMonths = (
|
|
278
|
-
return
|
|
312
|
+
this.addMonths = (value, amount) => {
|
|
313
|
+
return amount < 0 ? value.subtract(Math.abs(amount), 'month') : value.add(amount, 'month');
|
|
279
314
|
};
|
|
280
|
-
this.addWeeks = (
|
|
281
|
-
return
|
|
315
|
+
this.addWeeks = (value, amount) => {
|
|
316
|
+
return amount < 0 ? value.subtract(Math.abs(amount), 'week') : value.add(amount, 'week');
|
|
282
317
|
};
|
|
283
|
-
this.addDays = (
|
|
284
|
-
return
|
|
318
|
+
this.addDays = (value, amount) => {
|
|
319
|
+
return amount < 0 ? value.subtract(Math.abs(amount), 'day') : value.add(amount, 'day');
|
|
285
320
|
};
|
|
286
|
-
this.addHours = (
|
|
287
|
-
return
|
|
321
|
+
this.addHours = (value, amount) => {
|
|
322
|
+
return amount < 0 ? value.subtract(Math.abs(amount), 'hour') : value.add(amount, 'hour');
|
|
288
323
|
};
|
|
289
|
-
this.addMinutes = (
|
|
290
|
-
return
|
|
324
|
+
this.addMinutes = (value, amount) => {
|
|
325
|
+
return amount < 0 ? value.subtract(Math.abs(amount), 'minute') : value.add(amount, 'minute');
|
|
291
326
|
};
|
|
292
|
-
this.addSeconds = (
|
|
293
|
-
return
|
|
327
|
+
this.addSeconds = (value, amount) => {
|
|
328
|
+
return amount < 0 ? value.subtract(Math.abs(amount), 'second') : value.add(amount, 'second');
|
|
294
329
|
};
|
|
295
|
-
this.getYear =
|
|
296
|
-
return
|
|
330
|
+
this.getYear = value => {
|
|
331
|
+
return value.year();
|
|
297
332
|
};
|
|
298
|
-
this.getMonth =
|
|
299
|
-
return
|
|
333
|
+
this.getMonth = value => {
|
|
334
|
+
return value.month();
|
|
300
335
|
};
|
|
301
|
-
this.getDate =
|
|
302
|
-
return
|
|
336
|
+
this.getDate = value => {
|
|
337
|
+
return value.date();
|
|
303
338
|
};
|
|
304
|
-
this.getHours =
|
|
305
|
-
return
|
|
339
|
+
this.getHours = value => {
|
|
340
|
+
return value.hour();
|
|
306
341
|
};
|
|
307
|
-
this.getMinutes =
|
|
308
|
-
return
|
|
342
|
+
this.getMinutes = value => {
|
|
343
|
+
return value.minute();
|
|
309
344
|
};
|
|
310
|
-
this.getSeconds =
|
|
311
|
-
return
|
|
345
|
+
this.getSeconds = value => {
|
|
346
|
+
return value.second();
|
|
312
347
|
};
|
|
313
|
-
this.setYear = (
|
|
314
|
-
return
|
|
348
|
+
this.setYear = (value, year) => {
|
|
349
|
+
return value.set('year', year);
|
|
315
350
|
};
|
|
316
|
-
this.setMonth = (
|
|
317
|
-
return
|
|
351
|
+
this.setMonth = (value, month) => {
|
|
352
|
+
return value.set('month', month);
|
|
318
353
|
};
|
|
319
|
-
this.setDate = (
|
|
320
|
-
return
|
|
354
|
+
this.setDate = (value, date) => {
|
|
355
|
+
return value.set('date', date);
|
|
321
356
|
};
|
|
322
|
-
this.setHours = (
|
|
323
|
-
return
|
|
357
|
+
this.setHours = (value, hours) => {
|
|
358
|
+
return value.set('hour', hours);
|
|
324
359
|
};
|
|
325
|
-
this.setMinutes = (
|
|
326
|
-
return
|
|
360
|
+
this.setMinutes = (value, minutes) => {
|
|
361
|
+
return value.set('minute', minutes);
|
|
327
362
|
};
|
|
328
|
-
this.setSeconds = (
|
|
329
|
-
return
|
|
363
|
+
this.setSeconds = (value, seconds) => {
|
|
364
|
+
return value.set('second', seconds);
|
|
330
365
|
};
|
|
331
|
-
this.getDaysInMonth =
|
|
332
|
-
return
|
|
366
|
+
this.getDaysInMonth = value => {
|
|
367
|
+
return value.daysInMonth();
|
|
333
368
|
};
|
|
334
|
-
this.getNextMonth =
|
|
335
|
-
return
|
|
369
|
+
this.getNextMonth = value => {
|
|
370
|
+
return value.add(1, 'month');
|
|
336
371
|
};
|
|
337
|
-
this.getPreviousMonth =
|
|
338
|
-
return
|
|
372
|
+
this.getPreviousMonth = value => {
|
|
373
|
+
return value.subtract(1, 'month');
|
|
339
374
|
};
|
|
340
|
-
this.getMonthArray =
|
|
341
|
-
const firstMonth =
|
|
375
|
+
this.getMonthArray = value => {
|
|
376
|
+
const firstMonth = value.startOf('year');
|
|
342
377
|
const monthArray = [firstMonth];
|
|
343
378
|
while (monthArray.length < 12) {
|
|
344
379
|
const prevMonth = monthArray[monthArray.length - 1];
|
|
@@ -346,16 +381,16 @@ class AdapterDayjs {
|
|
|
346
381
|
}
|
|
347
382
|
return monthArray;
|
|
348
383
|
};
|
|
349
|
-
this.mergeDateAndTime = (
|
|
350
|
-
return
|
|
384
|
+
this.mergeDateAndTime = (dateParam, timeParam) => {
|
|
385
|
+
return dateParam.hour(timeParam.hour()).minute(timeParam.minute()).second(timeParam.second());
|
|
351
386
|
};
|
|
352
387
|
this.getWeekdays = () => {
|
|
353
388
|
const start = this.dayjs().startOf('week');
|
|
354
389
|
return [0, 1, 2, 3, 4, 5, 6].map(diff => this.formatByString(start.add(diff, 'day'), 'dd'));
|
|
355
390
|
};
|
|
356
|
-
this.getWeekArray =
|
|
357
|
-
const start =
|
|
358
|
-
const end =
|
|
391
|
+
this.getWeekArray = value => {
|
|
392
|
+
const start = value.startOf('month').startOf('week');
|
|
393
|
+
const end = value.endOf('month').endOf('week');
|
|
359
394
|
let count = 0;
|
|
360
395
|
let current = start;
|
|
361
396
|
const nestedWeeks = [];
|
|
@@ -368,12 +403,12 @@ class AdapterDayjs {
|
|
|
368
403
|
}
|
|
369
404
|
return nestedWeeks;
|
|
370
405
|
};
|
|
371
|
-
this.getWeekNumber =
|
|
372
|
-
return
|
|
406
|
+
this.getWeekNumber = value => {
|
|
407
|
+
return value.week();
|
|
373
408
|
};
|
|
374
409
|
this.getYearRange = (start, end) => {
|
|
375
|
-
const startDate =
|
|
376
|
-
const endDate =
|
|
410
|
+
const startDate = start.startOf('year');
|
|
411
|
+
const endDate = end.endOf('year');
|
|
377
412
|
const years = [];
|
|
378
413
|
let current = startDate;
|
|
379
414
|
while (current.isBefore(endDate)) {
|