@mui/x-date-pickers 7.22.2 → 8.0.0-alpha.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 +1 -1
- package/AdapterDateFnsBase/AdapterDateFnsBase.d.ts +3 -3
- package/AdapterDateFnsJalali/AdapterDateFnsJalali.d.ts +1 -1
- package/AdapterDateFnsJalaliV3/AdapterDateFnsJalaliV3.d.ts +1 -1
- package/AdapterDateFnsV3/AdapterDateFnsV3.d.ts +1 -1
- package/AdapterDayjs/AdapterDayjs.d.ts +2 -2
- package/AdapterLuxon/AdapterLuxon.d.ts +2 -2
- package/AdapterMoment/AdapterMoment.d.ts +2 -2
- package/AdapterMomentHijri/AdapterMomentHijri.d.ts +2 -2
- package/AdapterMomentJalaali/AdapterMomentJalaali.d.ts +2 -2
- package/CHANGELOG.md +142 -155
- package/DateCalendar/DateCalendar.d.ts +1 -2
- package/DateCalendar/DateCalendar.js +20 -22
- package/DateCalendar/DateCalendar.types.d.ts +21 -31
- package/DateCalendar/DayCalendar.d.ts +25 -24
- package/DateCalendar/DayCalendar.js +13 -10
- package/DateCalendar/index.d.ts +1 -0
- package/DateCalendar/useCalendarState.d.ts +16 -16
- package/DateCalendar/useIsDateDisabled.d.ts +2 -2
- package/DateField/DateField.d.ts +1 -2
- package/DateField/DateField.js +8 -10
- package/DateField/DateField.types.d.ts +8 -9
- package/DateField/index.d.ts +1 -1
- package/DateField/useDateField.d.ts +1 -2
- package/DatePicker/DatePicker.d.ts +1 -2
- package/DatePicker/DatePicker.js +15 -14
- package/DatePicker/DatePicker.types.d.ts +10 -11
- package/DatePicker/DatePickerToolbar.d.ts +2 -2
- package/DatePicker/DatePickerToolbar.js +12 -2
- package/DatePicker/shared.d.ts +11 -11
- package/DateTimeField/DateTimeField.d.ts +1 -2
- package/DateTimeField/DateTimeField.js +9 -12
- package/DateTimeField/DateTimeField.types.d.ts +9 -14
- package/DateTimeField/index.d.ts +1 -1
- package/DateTimeField/useDateTimeField.d.ts +1 -2
- package/DateTimePicker/DateTimePicker.d.ts +1 -2
- package/DateTimePicker/DateTimePicker.js +16 -16
- package/DateTimePicker/DateTimePicker.types.d.ts +10 -13
- package/DateTimePicker/DateTimePickerTabs.d.ts +1 -2
- package/DateTimePicker/DateTimePickerTabs.js +2 -2
- package/DateTimePicker/DateTimePickerToolbar.d.ts +3 -3
- package/DateTimePicker/DateTimePickerToolbar.js +12 -2
- package/DateTimePicker/shared.d.ts +12 -12
- package/DesktopDatePicker/DesktopDatePicker.d.ts +1 -2
- package/DesktopDatePicker/DesktopDatePicker.js +17 -16
- package/DesktopDatePicker/DesktopDatePicker.types.d.ts +7 -7
- package/DesktopDateTimePicker/DesktopDateTimePicker.d.ts +1 -2
- package/DesktopDateTimePicker/DesktopDateTimePicker.js +18 -18
- package/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +8 -8
- package/DesktopDateTimePicker/DesktopDateTimePickerLayout.d.ts +1 -2
- package/DesktopDateTimePicker/DesktopDateTimePickerLayout.js +10 -0
- package/DesktopTimePicker/DesktopTimePicker.d.ts +1 -2
- package/DesktopTimePicker/DesktopTimePicker.js +11 -6
- package/DesktopTimePicker/DesktopTimePicker.types.d.ts +8 -8
- package/DigitalClock/DigitalClock.d.ts +1 -2
- package/DigitalClock/DigitalClock.js +7 -6
- package/DigitalClock/DigitalClock.types.d.ts +4 -4
- package/LocalizationProvider/LocalizationProvider.d.ts +12 -12
- package/MobileDatePicker/MobileDatePicker.d.ts +1 -2
- package/MobileDatePicker/MobileDatePicker.js +17 -16
- package/MobileDatePicker/MobileDatePicker.types.d.ts +7 -7
- package/MobileDateTimePicker/MobileDateTimePicker.d.ts +2 -2
- package/MobileDateTimePicker/MobileDateTimePicker.js +18 -18
- package/MobileDateTimePicker/MobileDateTimePicker.types.d.ts +7 -7
- package/MobileTimePicker/MobileTimePicker.d.ts +2 -2
- package/MobileTimePicker/MobileTimePicker.js +11 -6
- package/MobileTimePicker/MobileTimePicker.types.d.ts +7 -7
- package/MonthCalendar/MonthCalendar.d.ts +3 -4
- package/MonthCalendar/MonthCalendar.js +17 -14
- package/MonthCalendar/MonthCalendar.types.d.ts +14 -15
- package/MonthCalendar/PickersMonth.js +17 -13
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.d.ts +1 -2
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +7 -6
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.types.d.ts +3 -4
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.d.ts +9 -9
- package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.d.ts +2 -3
- package/PickersActionBar/PickersActionBar.js +2 -2
- package/PickersCalendarHeader/PickersCalendarHeader.d.ts +1 -2
- package/PickersCalendarHeader/PickersCalendarHeader.js +2 -2
- package/PickersCalendarHeader/PickersCalendarHeader.types.d.ts +9 -9
- package/PickersDay/PickersDay.d.ts +8 -8
- package/PickersLayout/PickersLayout.d.ts +2 -3
- package/PickersLayout/PickersLayout.js +10 -0
- package/PickersLayout/PickersLayout.types.d.ts +14 -17
- package/PickersLayout/index.d.ts +1 -1
- package/PickersLayout/usePickerLayout.d.ts +1 -2
- package/PickersLayout/usePickerLayout.js +17 -18
- package/README.md +2 -2
- package/StaticDatePicker/StaticDatePicker.d.ts +1 -2
- package/StaticDatePicker/StaticDatePicker.js +14 -13
- package/StaticDatePicker/StaticDatePicker.types.d.ts +7 -7
- package/StaticDateTimePicker/StaticDateTimePicker.d.ts +1 -2
- package/StaticDateTimePicker/StaticDateTimePicker.js +15 -15
- package/StaticDateTimePicker/StaticDateTimePicker.types.d.ts +7 -7
- package/StaticTimePicker/StaticTimePicker.d.ts +1 -2
- package/StaticTimePicker/StaticTimePicker.js +8 -3
- package/StaticTimePicker/StaticTimePicker.types.d.ts +7 -7
- package/TimeClock/Clock.d.ts +4 -5
- package/TimeClock/Clock.js +3 -3
- package/TimeClock/ClockNumbers.d.ts +5 -5
- package/TimeClock/TimeClock.d.ts +1 -2
- package/TimeClock/TimeClock.js +7 -6
- package/TimeClock/TimeClock.types.d.ts +4 -4
- package/TimeField/TimeField.d.ts +1 -2
- package/TimeField/TimeField.js +6 -6
- package/TimeField/TimeField.types.d.ts +9 -14
- package/TimeField/index.d.ts +1 -1
- package/TimeField/useTimeField.d.ts +1 -2
- package/TimePicker/TimePicker.d.ts +1 -2
- package/TimePicker/TimePicker.js +9 -4
- package/TimePicker/TimePicker.types.d.ts +10 -13
- package/TimePicker/TimePickerToolbar.d.ts +2 -2
- package/TimePicker/TimePickerToolbar.js +12 -2
- package/TimePicker/shared.d.ts +10 -10
- package/YearCalendar/PickersYear.js +17 -13
- package/YearCalendar/YearCalendar.d.ts +1 -2
- package/YearCalendar/YearCalendar.js +17 -14
- package/YearCalendar/YearCalendar.types.d.ts +14 -15
- package/dateViewRenderers/dateViewRenderers.d.ts +3 -3
- package/hooks/index.d.ts +2 -2
- package/hooks/index.js +2 -2
- package/hooks/useClearableField.js +4 -3
- package/hooks/useParsedFormat.d.ts +2 -3
- package/hooks/useParsedFormat.js +2 -2
- package/hooks/usePickerContext.d.ts +4 -0
- package/hooks/usePickerContext.js +15 -0
- package/hooks/usePickerTranslations.d.ts +1 -0
- package/{modern/hooks/usePickersTranslations.js → hooks/usePickerTranslations.js} +1 -1
- package/index.js +1 -1
- package/internals/components/{PickersProvider.d.ts → PickerProvider.d.ts} +15 -8
- package/internals/components/PickerProvider.js +38 -0
- package/internals/hooks/date-helpers-hooks.d.ts +6 -6
- package/internals/hooks/defaultizedFieldProps.d.ts +7 -8
- package/internals/hooks/useClockReferenceDate.d.ts +5 -5
- package/internals/hooks/useDesktopPicker/useDesktopPicker.d.ts +1 -2
- package/internals/hooks/useDesktopPicker/useDesktopPicker.js +21 -17
- package/internals/hooks/useDesktopPicker/useDesktopPicker.types.d.ts +15 -15
- package/internals/hooks/useField/buildSectionsFromFormat.d.ts +5 -5
- package/internals/hooks/useField/useField.d.ts +3 -3
- package/internals/hooks/useField/useField.js +1 -1
- package/internals/hooks/useField/useField.types.d.ts +38 -48
- package/internals/hooks/useField/useField.utils.d.ts +13 -13
- package/internals/hooks/useField/useField.utils.js +2 -1
- package/internals/hooks/useField/useFieldCharacterEditing.d.ts +4 -4
- package/internals/hooks/useField/useFieldState.d.ts +4 -4
- package/internals/hooks/useField/useFieldState.js +3 -3
- package/internals/hooks/useField/useFieldV7TextField.js +2 -2
- package/internals/hooks/useMobilePicker/useMobilePicker.d.ts +1 -2
- package/internals/hooks/useMobilePicker/useMobilePicker.js +23 -18
- package/internals/hooks/useMobilePicker/useMobilePicker.types.d.ts +12 -12
- package/internals/hooks/usePicker/usePicker.d.ts +2 -2
- package/internals/hooks/usePicker/usePicker.js +12 -4
- package/internals/hooks/usePicker/usePicker.types.d.ts +7 -5
- package/internals/hooks/usePicker/usePickerLayoutProps.d.ts +2 -3
- package/internals/hooks/usePicker/usePickerOwnerState.d.ts +4 -3
- package/internals/hooks/usePicker/usePickerOwnerState.js +9 -6
- package/internals/hooks/usePicker/usePickerProvider.d.ts +10 -0
- package/internals/hooks/usePicker/usePickerProvider.js +21 -0
- package/internals/hooks/usePicker/usePickerValue.d.ts +2 -2
- package/internals/hooks/usePicker/usePickerValue.js +2 -7
- package/internals/hooks/usePicker/usePickerValue.types.d.ts +32 -34
- package/internals/hooks/usePicker/usePickerViews.d.ts +6 -11
- package/internals/hooks/usePickerPrivateContext.d.ts +4 -0
- package/internals/hooks/usePickerPrivateContext.js +9 -0
- package/internals/hooks/useStaticPicker/useStaticPicker.d.ts +1 -2
- package/internals/hooks/useStaticPicker/useStaticPicker.js +5 -4
- package/internals/hooks/useStaticPicker/useStaticPicker.types.d.ts +6 -6
- package/internals/hooks/useUtils.d.ts +7 -7
- package/internals/hooks/useValueWithTimezone.d.ts +5 -5
- package/internals/hooks/useViews.d.ts +3 -3
- package/internals/hooks/useViews.js +1 -1
- package/internals/index.d.ts +6 -4
- package/internals/index.js +2 -1
- package/internals/models/fields.d.ts +32 -7
- package/internals/models/formProps.d.ts +14 -0
- package/internals/models/helpers.d.ts +0 -4
- package/internals/models/index.d.ts +2 -0
- package/internals/models/index.js +3 -1
- package/internals/models/props/basePickerProps.d.ts +5 -6
- package/internals/models/props/{clock.d.ts → time.d.ts} +10 -17
- package/internals/models/props/toolbar.d.ts +2 -3
- package/internals/models/validation.d.ts +21 -25
- package/internals/models/value.d.ts +3 -0
- package/internals/models/value.js +1 -0
- package/internals/utils/date-time-utils.d.ts +7 -7
- package/internals/utils/date-utils.d.ts +16 -16
- package/internals/utils/getDefaultReferenceDate.d.ts +10 -10
- package/internals/utils/time-utils.d.ts +5 -5
- package/internals/utils/valueManagers.d.ts +3 -3
- package/locales/beBY.d.ts +3 -3
- package/locales/beBY.js +3 -3
- package/locales/bgBG.d.ts +3 -3
- package/locales/bgBG.js +3 -3
- package/locales/caES.d.ts +3 -3
- package/locales/caES.js +3 -3
- package/locales/csCZ.d.ts +3 -3
- package/locales/csCZ.js +3 -3
- package/locales/daDK.d.ts +3 -3
- package/locales/daDK.js +3 -3
- package/locales/deDE.d.ts +3 -3
- package/locales/deDE.js +3 -3
- package/locales/elGR.d.ts +3 -3
- package/locales/elGR.js +12 -13
- package/locales/enUS.d.ts +4 -4
- package/locales/enUS.js +3 -3
- package/locales/esES.d.ts +3 -3
- package/locales/esES.js +3 -3
- package/locales/eu.d.ts +3 -3
- package/locales/eu.js +3 -3
- package/locales/faIR.d.ts +3 -3
- package/locales/faIR.js +3 -3
- package/locales/fiFI.d.ts +3 -3
- package/locales/fiFI.js +3 -3
- package/locales/frFR.d.ts +3 -3
- package/locales/frFR.js +3 -3
- package/locales/heIL.d.ts +3 -3
- package/locales/heIL.js +3 -3
- package/locales/hrHR.d.ts +3 -3
- package/locales/hrHR.js +3 -3
- package/locales/huHU.d.ts +3 -3
- package/locales/huHU.js +3 -3
- package/locales/isIS.d.ts +3 -3
- package/locales/isIS.js +3 -3
- package/locales/itIT.d.ts +3 -3
- package/locales/itIT.js +3 -3
- package/locales/jaJP.d.ts +3 -3
- package/locales/jaJP.js +3 -3
- package/locales/koKR.d.ts +3 -3
- package/locales/koKR.js +3 -3
- package/locales/kzKZ.d.ts +3 -3
- package/locales/kzKZ.js +3 -3
- package/locales/mk.d.ts +3 -3
- package/locales/mk.js +3 -3
- package/locales/nbNO.d.ts +3 -3
- package/locales/nbNO.js +3 -3
- package/locales/nlNL.d.ts +3 -3
- package/locales/nlNL.js +3 -3
- package/locales/nnNO.d.ts +3 -3
- package/locales/nnNO.js +3 -3
- package/locales/plPL.d.ts +3 -3
- package/locales/plPL.js +3 -3
- package/locales/ptBR.d.ts +3 -3
- package/locales/ptBR.js +5 -3
- package/locales/ptPT.d.ts +3 -3
- package/locales/ptPT.js +3 -3
- package/locales/roRO.d.ts +3 -3
- package/locales/roRO.js +3 -3
- package/locales/ruRU.d.ts +3 -3
- package/locales/ruRU.js +3 -3
- package/locales/skSK.d.ts +3 -3
- package/locales/skSK.js +3 -3
- package/locales/svSE.d.ts +3 -3
- package/locales/svSE.js +3 -3
- package/locales/trTR.d.ts +3 -3
- package/locales/trTR.js +3 -3
- package/locales/ukUA.d.ts +3 -3
- package/locales/ukUA.js +3 -3
- package/locales/urPK.d.ts +3 -3
- package/locales/urPK.js +3 -3
- package/locales/utils/getPickersLocalization.d.ts +9 -9
- package/locales/utils/getPickersLocalization.js +1 -1
- package/locales/utils/pickersLocaleTextApi.d.ts +12 -36
- package/locales/viVN.d.ts +3 -3
- package/locales/viVN.js +3 -3
- package/locales/zhCN.d.ts +3 -3
- package/locales/zhCN.js +3 -3
- package/locales/zhHK.d.ts +3 -3
- package/locales/zhHK.js +3 -3
- package/models/adapters.d.ts +151 -202
- package/models/fields.d.ts +9 -41
- package/models/pickers.d.ts +10 -6
- package/modern/DateCalendar/DateCalendar.js +20 -22
- package/modern/DateCalendar/DayCalendar.js +13 -10
- package/modern/DateField/DateField.js +8 -10
- package/modern/DatePicker/DatePicker.js +15 -14
- package/modern/DatePicker/DatePickerToolbar.js +12 -2
- package/modern/DateTimeField/DateTimeField.js +9 -12
- package/modern/DateTimePicker/DateTimePicker.js +16 -16
- package/modern/DateTimePicker/DateTimePickerTabs.js +2 -2
- package/modern/DateTimePicker/DateTimePickerToolbar.js +12 -2
- package/modern/DesktopDatePicker/DesktopDatePicker.js +17 -16
- package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +18 -18
- package/modern/DesktopDateTimePicker/DesktopDateTimePickerLayout.js +10 -0
- package/modern/DesktopTimePicker/DesktopTimePicker.js +11 -6
- package/modern/DigitalClock/DigitalClock.js +7 -6
- package/modern/MobileDatePicker/MobileDatePicker.js +17 -16
- package/modern/MobileDateTimePicker/MobileDateTimePicker.js +18 -18
- package/modern/MobileTimePicker/MobileTimePicker.js +11 -6
- package/modern/MonthCalendar/MonthCalendar.js +17 -14
- package/modern/MonthCalendar/PickersMonth.js +17 -13
- package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.js +7 -6
- package/modern/PickersActionBar/PickersActionBar.js +2 -2
- package/modern/PickersCalendarHeader/PickersCalendarHeader.js +2 -2
- package/modern/PickersLayout/PickersLayout.js +10 -0
- package/modern/PickersLayout/usePickerLayout.js +17 -18
- package/modern/StaticDatePicker/StaticDatePicker.js +14 -13
- package/modern/StaticDateTimePicker/StaticDateTimePicker.js +15 -15
- package/modern/StaticTimePicker/StaticTimePicker.js +8 -3
- package/modern/TimeClock/Clock.js +3 -3
- package/modern/TimeClock/TimeClock.js +7 -6
- package/modern/TimeField/TimeField.js +6 -6
- package/modern/TimePicker/TimePicker.js +9 -4
- package/modern/TimePicker/TimePickerToolbar.js +12 -2
- package/modern/YearCalendar/PickersYear.js +17 -13
- package/modern/YearCalendar/YearCalendar.js +17 -14
- package/modern/hooks/index.js +2 -2
- package/modern/hooks/useClearableField.js +4 -3
- package/modern/hooks/useParsedFormat.js +2 -2
- package/modern/hooks/usePickerContext.js +15 -0
- package/{hooks/usePickersTranslations.js → modern/hooks/usePickerTranslations.js} +1 -1
- package/modern/index.js +1 -1
- package/modern/internals/components/PickerProvider.js +38 -0
- package/modern/internals/hooks/useDesktopPicker/useDesktopPicker.js +21 -17
- package/modern/internals/hooks/useField/useField.js +1 -1
- package/modern/internals/hooks/useField/useField.utils.js +2 -1
- package/modern/internals/hooks/useField/useFieldState.js +3 -3
- package/modern/internals/hooks/useField/useFieldV7TextField.js +2 -2
- package/modern/internals/hooks/useMobilePicker/useMobilePicker.js +23 -18
- package/modern/internals/hooks/usePicker/usePicker.js +12 -4
- package/modern/internals/hooks/usePicker/usePickerOwnerState.js +9 -6
- package/modern/internals/hooks/usePicker/usePickerProvider.js +21 -0
- package/modern/internals/hooks/usePicker/usePickerValue.js +2 -7
- package/modern/internals/hooks/usePickerPrivateContext.js +9 -0
- package/modern/internals/hooks/useStaticPicker/useStaticPicker.js +5 -4
- package/modern/internals/hooks/useViews.js +1 -1
- package/modern/internals/index.js +2 -1
- package/modern/internals/models/formProps.js +1 -0
- package/modern/internals/models/index.js +3 -1
- package/modern/internals/models/props/time.js +1 -0
- package/modern/internals/models/value.js +1 -0
- package/modern/locales/beBY.js +3 -3
- package/modern/locales/bgBG.js +3 -3
- package/modern/locales/caES.js +3 -3
- package/modern/locales/csCZ.js +3 -3
- package/modern/locales/daDK.js +3 -3
- package/modern/locales/deDE.js +3 -3
- package/modern/locales/elGR.js +12 -13
- package/modern/locales/enUS.js +3 -3
- package/modern/locales/esES.js +3 -3
- package/modern/locales/eu.js +3 -3
- package/modern/locales/faIR.js +3 -3
- package/modern/locales/fiFI.js +3 -3
- package/modern/locales/frFR.js +3 -3
- package/modern/locales/heIL.js +3 -3
- package/modern/locales/hrHR.js +3 -3
- package/modern/locales/huHU.js +3 -3
- package/modern/locales/isIS.js +3 -3
- package/modern/locales/itIT.js +3 -3
- package/modern/locales/jaJP.js +3 -3
- package/modern/locales/koKR.js +3 -3
- package/modern/locales/kzKZ.js +3 -3
- package/modern/locales/mk.js +3 -3
- package/modern/locales/nbNO.js +3 -3
- package/modern/locales/nlNL.js +3 -3
- package/modern/locales/nnNO.js +3 -3
- package/modern/locales/plPL.js +3 -3
- package/modern/locales/ptBR.js +5 -3
- package/modern/locales/ptPT.js +3 -3
- package/modern/locales/roRO.js +3 -3
- package/modern/locales/ruRU.js +3 -3
- package/modern/locales/skSK.js +3 -3
- package/modern/locales/svSE.js +3 -3
- package/modern/locales/trTR.js +3 -3
- package/modern/locales/ukUA.js +3 -3
- package/modern/locales/urPK.js +3 -3
- package/modern/locales/utils/getPickersLocalization.js +1 -1
- package/modern/locales/viVN.js +3 -3
- package/modern/locales/zhCN.js +3 -3
- package/modern/locales/zhHK.js +3 -3
- package/modern/validation/useValidation.js +2 -3
- package/modern/validation/validateDate.js +5 -0
- package/modern/validation/validateDateTime.js +5 -0
- package/modern/validation/validateTime.js +5 -0
- package/node/DateCalendar/DateCalendar.js +20 -22
- package/node/DateCalendar/DayCalendar.js +13 -10
- package/node/DateField/DateField.js +8 -10
- package/node/DatePicker/DatePicker.js +15 -14
- package/node/DatePicker/DatePickerToolbar.js +12 -2
- package/node/DateTimeField/DateTimeField.js +9 -12
- package/node/DateTimePicker/DateTimePicker.js +16 -16
- package/node/DateTimePicker/DateTimePickerTabs.js +2 -2
- package/node/DateTimePicker/DateTimePickerToolbar.js +12 -2
- package/node/DesktopDatePicker/DesktopDatePicker.js +17 -16
- package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +18 -18
- package/node/DesktopDateTimePicker/DesktopDateTimePickerLayout.js +10 -0
- package/node/DesktopTimePicker/DesktopTimePicker.js +11 -6
- package/node/DigitalClock/DigitalClock.js +7 -6
- package/node/MobileDatePicker/MobileDatePicker.js +17 -16
- package/node/MobileDateTimePicker/MobileDateTimePicker.js +18 -18
- package/node/MobileTimePicker/MobileTimePicker.js +11 -6
- package/node/MonthCalendar/MonthCalendar.js +17 -14
- package/node/MonthCalendar/PickersMonth.js +17 -13
- package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.js +7 -6
- package/node/PickersActionBar/PickersActionBar.js +2 -2
- package/node/PickersCalendarHeader/PickersCalendarHeader.js +2 -2
- package/node/PickersLayout/PickersLayout.js +10 -0
- package/node/PickersLayout/usePickerLayout.js +17 -18
- package/node/StaticDatePicker/StaticDatePicker.js +14 -13
- package/node/StaticDateTimePicker/StaticDateTimePicker.js +15 -15
- package/node/StaticTimePicker/StaticTimePicker.js +8 -3
- package/node/TimeClock/Clock.js +3 -3
- package/node/TimeClock/TimeClock.js +7 -6
- package/node/TimeField/TimeField.js +6 -6
- package/node/TimePicker/TimePicker.js +9 -4
- package/node/TimePicker/TimePickerToolbar.js +12 -2
- package/node/YearCalendar/PickersYear.js +17 -13
- package/node/YearCalendar/YearCalendar.js +17 -14
- package/node/hooks/index.js +6 -6
- package/node/hooks/useClearableField.js +4 -3
- package/node/hooks/useParsedFormat.js +2 -2
- package/node/hooks/usePickerContext.js +21 -0
- package/node/hooks/usePickerTranslations.js +10 -0
- package/node/index.js +1 -1
- package/node/internals/components/PickerProvider.js +46 -0
- package/node/internals/hooks/useDesktopPicker/useDesktopPicker.js +21 -17
- package/node/internals/hooks/useField/useField.js +1 -1
- package/node/internals/hooks/useField/useField.utils.js +2 -1
- package/node/internals/hooks/useField/useFieldState.js +3 -3
- package/node/internals/hooks/useField/useFieldV7TextField.js +2 -2
- package/node/internals/hooks/useMobilePicker/useMobilePicker.js +23 -18
- package/node/internals/hooks/usePicker/usePicker.js +12 -4
- package/node/internals/hooks/usePicker/usePickerOwnerState.js +9 -6
- package/node/internals/hooks/usePicker/usePickerProvider.js +28 -0
- package/node/internals/hooks/usePicker/usePickerValue.js +1 -7
- package/node/internals/hooks/usePickerPrivateContext.js +15 -0
- package/node/internals/hooks/useStaticPicker/useStaticPicker.js +5 -4
- package/node/internals/hooks/useViews.js +3 -3
- package/node/internals/index.js +14 -7
- package/node/internals/models/index.js +22 -0
- package/node/internals/models/props/time.js +5 -0
- package/node/internals/models/value.js +5 -0
- package/node/locales/beBY.js +3 -3
- package/node/locales/bgBG.js +3 -3
- package/node/locales/caES.js +3 -3
- package/node/locales/csCZ.js +3 -3
- package/node/locales/daDK.js +3 -3
- package/node/locales/deDE.js +3 -3
- package/node/locales/elGR.js +12 -13
- package/node/locales/enUS.js +3 -3
- package/node/locales/esES.js +3 -3
- package/node/locales/eu.js +3 -3
- package/node/locales/faIR.js +3 -3
- package/node/locales/fiFI.js +3 -3
- package/node/locales/frFR.js +3 -3
- package/node/locales/heIL.js +3 -3
- package/node/locales/hrHR.js +3 -3
- package/node/locales/huHU.js +3 -3
- package/node/locales/isIS.js +3 -3
- package/node/locales/itIT.js +3 -3
- package/node/locales/jaJP.js +3 -3
- package/node/locales/koKR.js +3 -3
- package/node/locales/kzKZ.js +3 -3
- package/node/locales/mk.js +3 -3
- package/node/locales/nbNO.js +3 -3
- package/node/locales/nlNL.js +3 -3
- package/node/locales/nnNO.js +3 -3
- package/node/locales/plPL.js +3 -3
- package/node/locales/ptBR.js +5 -3
- package/node/locales/ptPT.js +3 -3
- package/node/locales/roRO.js +3 -3
- package/node/locales/ruRU.js +3 -3
- package/node/locales/skSK.js +3 -3
- package/node/locales/svSE.js +3 -3
- package/node/locales/trTR.js +3 -3
- package/node/locales/ukUA.js +3 -3
- package/node/locales/urPK.js +3 -3
- package/node/locales/utils/getPickersLocalization.js +1 -1
- package/node/locales/viVN.js +3 -3
- package/node/locales/zhCN.js +3 -3
- package/node/locales/zhHK.js +3 -3
- package/node/validation/useValidation.js +2 -3
- package/node/validation/validateDate.js +4 -0
- package/node/validation/validateDateTime.js +4 -0
- package/node/validation/validateTime.js +4 -0
- package/package.json +3 -3
- package/themeAugmentation/props.d.ts +28 -28
- package/timeViewRenderers/timeViewRenderers.d.ts +6 -6
- package/validation/extractValidationProps.d.ts +4 -4
- package/validation/useValidation.d.ts +9 -10
- package/validation/useValidation.js +2 -3
- package/validation/validateDate.d.ts +7 -2
- package/validation/validateDate.js +5 -0
- package/validation/validateDateTime.d.ts +10 -4
- package/validation/validateDateTime.js +5 -0
- package/validation/validateTime.d.ts +7 -2
- package/validation/validateTime.js +5 -0
- package/hooks/usePickersContext.d.ts +0 -4
- package/hooks/usePickersContext.js +0 -15
- package/hooks/usePickersTranslations.d.ts +0 -2
- package/internals/components/PickersProvider.js +0 -26
- package/modern/hooks/usePickersContext.js +0 -15
- package/modern/internals/components/PickersProvider.js +0 -26
- package/node/hooks/usePickersContext.js +0 -21
- package/node/hooks/usePickersTranslations.js +0 -10
- package/node/internals/components/PickersProvider.js +0 -34
- /package/internals/models/{props/clock.js → formProps.js} +0 -0
- /package/{modern/internals/models/props/clock.js → internals/models/props/time.js} +0 -0
- /package/node/internals/models/{props/clock.js → formProps.js} +0 -0
|
@@ -14,7 +14,7 @@ var _resolveComponentProps = _interopRequireDefault(require("@mui/utils/resolveC
|
|
|
14
14
|
var _utils = require("@mui/utils");
|
|
15
15
|
var _useMobilePicker = require("../internals/hooks/useMobilePicker");
|
|
16
16
|
var _shared = require("../DatePicker/shared");
|
|
17
|
-
var
|
|
17
|
+
var _usePickerTranslations = require("../hooks/usePickerTranslations");
|
|
18
18
|
var _useUtils = require("../internals/hooks/useUtils");
|
|
19
19
|
var _validation = require("../validation");
|
|
20
20
|
var _DateField = require("../DateField");
|
|
@@ -33,7 +33,7 @@ var _getPickersLocalization = require("../locales/utils/getPickersLocalization")
|
|
|
33
33
|
* - [MobileDatePicker API](https://mui.com/x/api/date-pickers/mobile-date-picker/)
|
|
34
34
|
*/
|
|
35
35
|
const MobileDatePicker = exports.MobileDatePicker = /*#__PURE__*/React.forwardRef(function MobileDatePicker(inProps, ref) {
|
|
36
|
-
const translations = (0,
|
|
36
|
+
const translations = (0, _usePickerTranslations.usePickerTranslations)();
|
|
37
37
|
const utils = (0, _useUtils.useUtils)();
|
|
38
38
|
|
|
39
39
|
// Props with the default values common to all date pickers
|
|
@@ -96,9 +96,9 @@ MobileDatePicker.propTypes = {
|
|
|
96
96
|
closeOnSelect: _propTypes.default.bool,
|
|
97
97
|
/**
|
|
98
98
|
* Formats the day of week displayed in the calendar header.
|
|
99
|
-
* @param {
|
|
99
|
+
* @param {PickerValidDate} date The date of the day of week provided by the adapter.
|
|
100
100
|
* @returns {string} The name to display.
|
|
101
|
-
* @default (date:
|
|
101
|
+
* @default (date: PickerValidDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
|
|
102
102
|
*/
|
|
103
103
|
dayOfWeekFormatter: _propTypes.default.func,
|
|
104
104
|
/**
|
|
@@ -107,7 +107,8 @@ MobileDatePicker.propTypes = {
|
|
|
107
107
|
*/
|
|
108
108
|
defaultValue: _propTypes.default.object,
|
|
109
109
|
/**
|
|
110
|
-
* If `true`, the
|
|
110
|
+
* If `true`, the component is disabled.
|
|
111
|
+
* When disabled, the value cannot be changed and no interaction is possible.
|
|
111
112
|
* @default false
|
|
112
113
|
*/
|
|
113
114
|
disabled: _propTypes.default.bool,
|
|
@@ -136,7 +137,7 @@ MobileDatePicker.propTypes = {
|
|
|
136
137
|
*/
|
|
137
138
|
displayWeekNumber: _propTypes.default.bool,
|
|
138
139
|
/**
|
|
139
|
-
* @default
|
|
140
|
+
* @default true
|
|
140
141
|
*/
|
|
141
142
|
enableAccessibleFieldDOMStructure: _propTypes.default.any,
|
|
142
143
|
/**
|
|
@@ -226,8 +227,7 @@ MobileDatePicker.propTypes = {
|
|
|
226
227
|
onError: _propTypes.default.func,
|
|
227
228
|
/**
|
|
228
229
|
* Callback fired on month change.
|
|
229
|
-
* @
|
|
230
|
-
* @param {TDate} month The new month.
|
|
230
|
+
* @param {PickerValidDate} month The new month.
|
|
231
231
|
*/
|
|
232
232
|
onMonthChange: _propTypes.default.func,
|
|
233
233
|
/**
|
|
@@ -248,8 +248,7 @@ MobileDatePicker.propTypes = {
|
|
|
248
248
|
onViewChange: _propTypes.default.func,
|
|
249
249
|
/**
|
|
250
250
|
* Callback fired on year change.
|
|
251
|
-
* @
|
|
252
|
-
* @param {TDate} year The new year.
|
|
251
|
+
* @param {PickerValidDate} year The new year.
|
|
253
252
|
*/
|
|
254
253
|
onYearChange: _propTypes.default.func,
|
|
255
254
|
/**
|
|
@@ -267,6 +266,11 @@ MobileDatePicker.propTypes = {
|
|
|
267
266
|
* Force rendering in particular orientation.
|
|
268
267
|
*/
|
|
269
268
|
orientation: _propTypes.default.oneOf(['landscape', 'portrait']),
|
|
269
|
+
/**
|
|
270
|
+
* If `true`, the component is read-only.
|
|
271
|
+
* When read-only, the value cannot be changed but the user can interact with the interface.
|
|
272
|
+
* @default false
|
|
273
|
+
*/
|
|
270
274
|
readOnly: _propTypes.default.bool,
|
|
271
275
|
/**
|
|
272
276
|
* If `true`, disable heavy animations.
|
|
@@ -299,22 +303,19 @@ MobileDatePicker.propTypes = {
|
|
|
299
303
|
*
|
|
300
304
|
* Warning: This function can be called multiple times (for example when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.
|
|
301
305
|
*
|
|
302
|
-
* @
|
|
303
|
-
* @param {TDate} day The date to test.
|
|
306
|
+
* @param {PickerValidDate} day The date to test.
|
|
304
307
|
* @returns {boolean} If `true` the date will be disabled.
|
|
305
308
|
*/
|
|
306
309
|
shouldDisableDate: _propTypes.default.func,
|
|
307
310
|
/**
|
|
308
311
|
* Disable specific month.
|
|
309
|
-
* @
|
|
310
|
-
* @param {TDate} month The month to test.
|
|
312
|
+
* @param {PickerValidDate} month The month to test.
|
|
311
313
|
* @returns {boolean} If `true`, the month will be disabled.
|
|
312
314
|
*/
|
|
313
315
|
shouldDisableMonth: _propTypes.default.func,
|
|
314
316
|
/**
|
|
315
317
|
* Disable specific year.
|
|
316
|
-
* @
|
|
317
|
-
* @param {TDate} year The year to test.
|
|
318
|
+
* @param {PickerValidDate} year The year to test.
|
|
318
319
|
* @returns {boolean} If `true`, the year will be disabled.
|
|
319
320
|
*/
|
|
320
321
|
shouldDisableYear: _propTypes.default.func,
|
|
@@ -15,7 +15,7 @@ var _utils = require("@mui/utils");
|
|
|
15
15
|
var _valueManagers = require("../internals/utils/valueManagers");
|
|
16
16
|
var _DateTimeField = require("../DateTimeField");
|
|
17
17
|
var _shared = require("../DateTimePicker/shared");
|
|
18
|
-
var
|
|
18
|
+
var _usePickerTranslations = require("../hooks/usePickerTranslations");
|
|
19
19
|
var _useUtils = require("../internals/hooks/useUtils");
|
|
20
20
|
var _validation = require("../validation");
|
|
21
21
|
var _useMobilePicker = require("../internals/hooks/useMobilePicker");
|
|
@@ -34,7 +34,7 @@ var _getPickersLocalization = require("../locales/utils/getPickersLocalization")
|
|
|
34
34
|
* - [MobileDateTimePicker API](https://mui.com/x/api/date-pickers/mobile-date-time-picker/)
|
|
35
35
|
*/
|
|
36
36
|
const MobileDateTimePicker = exports.MobileDateTimePicker = /*#__PURE__*/React.forwardRef(function MobileDateTimePicker(inProps, ref) {
|
|
37
|
-
const translations = (0,
|
|
37
|
+
const translations = (0, _usePickerTranslations.usePickerTranslations)();
|
|
38
38
|
const utils = (0, _useUtils.useUtils)();
|
|
39
39
|
|
|
40
40
|
// Props with the default values common to all date time pickers
|
|
@@ -116,9 +116,9 @@ MobileDateTimePicker.propTypes = {
|
|
|
116
116
|
closeOnSelect: _propTypes.default.bool,
|
|
117
117
|
/**
|
|
118
118
|
* Formats the day of week displayed in the calendar header.
|
|
119
|
-
* @param {
|
|
119
|
+
* @param {PickerValidDate} date The date of the day of week provided by the adapter.
|
|
120
120
|
* @returns {string} The name to display.
|
|
121
|
-
* @default (date:
|
|
121
|
+
* @default (date: PickerValidDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
|
|
122
122
|
*/
|
|
123
123
|
dayOfWeekFormatter: _propTypes.default.func,
|
|
124
124
|
/**
|
|
@@ -127,7 +127,8 @@ MobileDateTimePicker.propTypes = {
|
|
|
127
127
|
*/
|
|
128
128
|
defaultValue: _propTypes.default.object,
|
|
129
129
|
/**
|
|
130
|
-
* If `true`, the
|
|
130
|
+
* If `true`, the component is disabled.
|
|
131
|
+
* When disabled, the value cannot be changed and no interaction is possible.
|
|
131
132
|
* @default false
|
|
132
133
|
*/
|
|
133
134
|
disabled: _propTypes.default.bool,
|
|
@@ -161,7 +162,7 @@ MobileDateTimePicker.propTypes = {
|
|
|
161
162
|
*/
|
|
162
163
|
displayWeekNumber: _propTypes.default.bool,
|
|
163
164
|
/**
|
|
164
|
-
* @default
|
|
165
|
+
* @default true
|
|
165
166
|
*/
|
|
166
167
|
enableAccessibleFieldDOMStructure: _propTypes.default.any,
|
|
167
168
|
/**
|
|
@@ -274,8 +275,7 @@ MobileDateTimePicker.propTypes = {
|
|
|
274
275
|
onError: _propTypes.default.func,
|
|
275
276
|
/**
|
|
276
277
|
* Callback fired on month change.
|
|
277
|
-
* @
|
|
278
|
-
* @param {TDate} month The new month.
|
|
278
|
+
* @param {PickerValidDate} month The new month.
|
|
279
279
|
*/
|
|
280
280
|
onMonthChange: _propTypes.default.func,
|
|
281
281
|
/**
|
|
@@ -296,8 +296,7 @@ MobileDateTimePicker.propTypes = {
|
|
|
296
296
|
onViewChange: _propTypes.default.func,
|
|
297
297
|
/**
|
|
298
298
|
* Callback fired on year change.
|
|
299
|
-
* @
|
|
300
|
-
* @param {TDate} year The new year.
|
|
299
|
+
* @param {PickerValidDate} year The new year.
|
|
301
300
|
*/
|
|
302
301
|
onYearChange: _propTypes.default.func,
|
|
303
302
|
/**
|
|
@@ -315,6 +314,11 @@ MobileDateTimePicker.propTypes = {
|
|
|
315
314
|
* Force rendering in particular orientation.
|
|
316
315
|
*/
|
|
317
316
|
orientation: _propTypes.default.oneOf(['landscape', 'portrait']),
|
|
317
|
+
/**
|
|
318
|
+
* If `true`, the component is read-only.
|
|
319
|
+
* When read-only, the value cannot be changed but the user can interact with the interface.
|
|
320
|
+
* @default false
|
|
321
|
+
*/
|
|
318
322
|
readOnly: _propTypes.default.bool,
|
|
319
323
|
/**
|
|
320
324
|
* If `true`, disable heavy animations.
|
|
@@ -347,30 +351,26 @@ MobileDateTimePicker.propTypes = {
|
|
|
347
351
|
*
|
|
348
352
|
* Warning: This function can be called multiple times (for example when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.
|
|
349
353
|
*
|
|
350
|
-
* @
|
|
351
|
-
* @param {TDate} day The date to test.
|
|
354
|
+
* @param {PickerValidDate} day The date to test.
|
|
352
355
|
* @returns {boolean} If `true` the date will be disabled.
|
|
353
356
|
*/
|
|
354
357
|
shouldDisableDate: _propTypes.default.func,
|
|
355
358
|
/**
|
|
356
359
|
* Disable specific month.
|
|
357
|
-
* @
|
|
358
|
-
* @param {TDate} month The month to test.
|
|
360
|
+
* @param {PickerValidDate} month The month to test.
|
|
359
361
|
* @returns {boolean} If `true`, the month will be disabled.
|
|
360
362
|
*/
|
|
361
363
|
shouldDisableMonth: _propTypes.default.func,
|
|
362
364
|
/**
|
|
363
365
|
* Disable specific time.
|
|
364
|
-
* @
|
|
365
|
-
* @param {TDate} value The value to check.
|
|
366
|
+
* @param {PickerValidDate} value The value to check.
|
|
366
367
|
* @param {TimeView} view The clock type of the timeValue.
|
|
367
368
|
* @returns {boolean} If `true` the time will be disabled.
|
|
368
369
|
*/
|
|
369
370
|
shouldDisableTime: _propTypes.default.func,
|
|
370
371
|
/**
|
|
371
372
|
* Disable specific year.
|
|
372
|
-
* @
|
|
373
|
-
* @param {TDate} year The year to test.
|
|
373
|
+
* @param {PickerValidDate} year The year to test.
|
|
374
374
|
* @returns {boolean} If `true`, the year will be disabled.
|
|
375
375
|
*/
|
|
376
376
|
shouldDisableYear: _propTypes.default.func,
|
|
@@ -15,7 +15,7 @@ var _utils = require("@mui/utils");
|
|
|
15
15
|
var _valueManagers = require("../internals/utils/valueManagers");
|
|
16
16
|
var _TimeField = require("../TimeField");
|
|
17
17
|
var _shared = require("../TimePicker/shared");
|
|
18
|
-
var
|
|
18
|
+
var _usePickerTranslations = require("../hooks/usePickerTranslations");
|
|
19
19
|
var _useUtils = require("../internals/hooks/useUtils");
|
|
20
20
|
var _validation = require("../validation");
|
|
21
21
|
var _useMobilePicker = require("../internals/hooks/useMobilePicker");
|
|
@@ -33,7 +33,7 @@ var _getPickersLocalization = require("../locales/utils/getPickersLocalization")
|
|
|
33
33
|
* - [MobileTimePicker API](https://mui.com/x/api/date-pickers/mobile-time-picker/)
|
|
34
34
|
*/
|
|
35
35
|
const MobileTimePicker = exports.MobileTimePicker = /*#__PURE__*/React.forwardRef(function MobileTimePicker(inProps, ref) {
|
|
36
|
-
const translations = (0,
|
|
36
|
+
const translations = (0, _usePickerTranslations.usePickerTranslations)();
|
|
37
37
|
const utils = (0, _useUtils.useUtils)();
|
|
38
38
|
|
|
39
39
|
// Props with the default values common to all time pickers
|
|
@@ -113,7 +113,8 @@ MobileTimePicker.propTypes = {
|
|
|
113
113
|
*/
|
|
114
114
|
defaultValue: _propTypes.default.object,
|
|
115
115
|
/**
|
|
116
|
-
* If `true`, the
|
|
116
|
+
* If `true`, the component is disabled.
|
|
117
|
+
* When disabled, the value cannot be changed and no interaction is possible.
|
|
117
118
|
* @default false
|
|
118
119
|
*/
|
|
119
120
|
disabled: _propTypes.default.bool,
|
|
@@ -138,7 +139,7 @@ MobileTimePicker.propTypes = {
|
|
|
138
139
|
*/
|
|
139
140
|
disablePast: _propTypes.default.bool,
|
|
140
141
|
/**
|
|
141
|
-
* @default
|
|
142
|
+
* @default true
|
|
142
143
|
*/
|
|
143
144
|
enableAccessibleFieldDOMStructure: _propTypes.default.any,
|
|
144
145
|
/**
|
|
@@ -246,6 +247,11 @@ MobileTimePicker.propTypes = {
|
|
|
246
247
|
* Force rendering in particular orientation.
|
|
247
248
|
*/
|
|
248
249
|
orientation: _propTypes.default.oneOf(['landscape', 'portrait']),
|
|
250
|
+
/**
|
|
251
|
+
* If `true`, the component is read-only.
|
|
252
|
+
* When read-only, the value cannot be changed but the user can interact with the interface.
|
|
253
|
+
* @default false
|
|
254
|
+
*/
|
|
249
255
|
readOnly: _propTypes.default.bool,
|
|
250
256
|
/**
|
|
251
257
|
* If `true`, disable heavy animations.
|
|
@@ -269,8 +275,7 @@ MobileTimePicker.propTypes = {
|
|
|
269
275
|
selectedSections: _propTypes.default.oneOfType([_propTypes.default.oneOf(['all', 'day', 'empty', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'weekDay', 'year']), _propTypes.default.number]),
|
|
270
276
|
/**
|
|
271
277
|
* Disable specific time.
|
|
272
|
-
* @
|
|
273
|
-
* @param {TDate} value The value to check.
|
|
278
|
+
* @param {PickerValidDate} value The value to check.
|
|
274
279
|
* @param {TimeView} view The clock type of the timeValue.
|
|
275
280
|
* @returns {boolean} If `true` the time will be disabled.
|
|
276
281
|
*/
|
|
@@ -24,12 +24,10 @@ var _valueManagers = require("../internals/utils/valueManagers");
|
|
|
24
24
|
var _getDefaultReferenceDate = require("../internals/utils/getDefaultReferenceDate");
|
|
25
25
|
var _useValueWithTimezone = require("../internals/hooks/useValueWithTimezone");
|
|
26
26
|
var _dimensions = require("../internals/constants/dimensions");
|
|
27
|
+
var _usePickerPrivateContext = require("../internals/hooks/usePickerPrivateContext");
|
|
27
28
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
28
|
-
const _excluded = ["className", "value", "defaultValue", "referenceDate", "disabled", "disableFuture", "disablePast", "maxDate", "minDate", "onChange", "shouldDisableMonth", "readOnly", "disableHighlightToday", "autoFocus", "onMonthFocus", "hasFocus", "onFocusedViewChange", "monthsPerRow", "timezone", "gridLabelId", "slots", "slotProps"];
|
|
29
|
-
const useUtilityClasses =
|
|
30
|
-
const {
|
|
31
|
-
classes
|
|
32
|
-
} = ownerState;
|
|
29
|
+
const _excluded = ["className", "classes", "value", "defaultValue", "referenceDate", "disabled", "disableFuture", "disablePast", "maxDate", "minDate", "onChange", "shouldDisableMonth", "readOnly", "disableHighlightToday", "autoFocus", "onMonthFocus", "hasFocus", "onFocusedViewChange", "monthsPerRow", "timezone", "gridLabelId", "slots", "slotProps"];
|
|
30
|
+
const useUtilityClasses = classes => {
|
|
33
31
|
const slots = {
|
|
34
32
|
root: ['root']
|
|
35
33
|
};
|
|
@@ -76,6 +74,7 @@ const MonthCalendar = exports.MonthCalendar = /*#__PURE__*/React.forwardRef(func
|
|
|
76
74
|
const props = useMonthCalendarDefaultizedProps(inProps, 'MuiMonthCalendar');
|
|
77
75
|
const {
|
|
78
76
|
className,
|
|
77
|
+
classes: classesProp,
|
|
79
78
|
value: valueProp,
|
|
80
79
|
defaultValue,
|
|
81
80
|
referenceDate: referenceDateProp,
|
|
@@ -107,12 +106,15 @@ const MonthCalendar = exports.MonthCalendar = /*#__PURE__*/React.forwardRef(func
|
|
|
107
106
|
timezone: timezoneProp,
|
|
108
107
|
value: valueProp,
|
|
109
108
|
defaultValue,
|
|
110
|
-
onChange
|
|
109
|
+
onChange,
|
|
111
110
|
valueManager: _valueManagers.singleItemValueManager
|
|
112
111
|
});
|
|
113
112
|
const now = (0, _useUtils.useNow)(timezone);
|
|
114
113
|
const isRtl = (0, _RtlProvider.useRtl)();
|
|
115
114
|
const utils = (0, _useUtils.useUtils)();
|
|
115
|
+
const {
|
|
116
|
+
ownerState
|
|
117
|
+
} = (0, _usePickerPrivateContext.usePickerPrivateContext)();
|
|
116
118
|
const referenceDate = React.useMemo(() => _valueManagers.singleItemValueManager.getInitialReferenceValue({
|
|
117
119
|
value,
|
|
118
120
|
utils,
|
|
@@ -122,8 +124,7 @@ const MonthCalendar = exports.MonthCalendar = /*#__PURE__*/React.forwardRef(func
|
|
|
122
124
|
granularity: _getDefaultReferenceDate.SECTION_TYPE_GRANULARITY.month
|
|
123
125
|
}), [] // eslint-disable-line react-hooks/exhaustive-deps
|
|
124
126
|
);
|
|
125
|
-
const
|
|
126
|
-
const classes = useUtilityClasses(ownerState);
|
|
127
|
+
const classes = useUtilityClasses(classesProp);
|
|
127
128
|
const todayMonth = React.useMemo(() => utils.getMonth(now), [utils, now]);
|
|
128
129
|
const selectedMonth = React.useMemo(() => {
|
|
129
130
|
if (value != null) {
|
|
@@ -260,7 +261,9 @@ process.env.NODE_ENV !== "production" ? MonthCalendar.propTypes = {
|
|
|
260
261
|
*/
|
|
261
262
|
defaultValue: _propTypes.default.object,
|
|
262
263
|
/**
|
|
263
|
-
* If `true
|
|
264
|
+
* If `true`, the component is disabled.
|
|
265
|
+
* When disabled, the value cannot be changed and no interaction is possible.
|
|
266
|
+
* @default false
|
|
264
267
|
*/
|
|
265
268
|
disabled: _propTypes.default.bool,
|
|
266
269
|
/**
|
|
@@ -297,14 +300,15 @@ process.env.NODE_ENV !== "production" ? MonthCalendar.propTypes = {
|
|
|
297
300
|
monthsPerRow: _propTypes.default.oneOf([3, 4]),
|
|
298
301
|
/**
|
|
299
302
|
* Callback fired when the value changes.
|
|
300
|
-
* @
|
|
301
|
-
* @param {TDate} value The new value.
|
|
303
|
+
* @param {PickerValidDate} value The new value.
|
|
302
304
|
*/
|
|
303
305
|
onChange: _propTypes.default.func,
|
|
304
306
|
onFocusedViewChange: _propTypes.default.func,
|
|
305
307
|
onMonthFocus: _propTypes.default.func,
|
|
306
308
|
/**
|
|
307
|
-
* If `true
|
|
309
|
+
* If `true`, the component is read-only.
|
|
310
|
+
* When read-only, the value cannot be changed but the user can interact with the interface.
|
|
311
|
+
* @default false
|
|
308
312
|
*/
|
|
309
313
|
readOnly: _propTypes.default.bool,
|
|
310
314
|
/**
|
|
@@ -314,8 +318,7 @@ process.env.NODE_ENV !== "production" ? MonthCalendar.propTypes = {
|
|
|
314
318
|
referenceDate: _propTypes.default.object,
|
|
315
319
|
/**
|
|
316
320
|
* Disable specific month.
|
|
317
|
-
* @
|
|
318
|
-
* @param {TDate} month The month to test.
|
|
321
|
+
* @param {PickerValidDate} month The month to test.
|
|
319
322
|
* @returns {boolean} If `true`, the month will be disabled.
|
|
320
323
|
*/
|
|
321
324
|
shouldDisableMonth: _propTypes.default.func,
|
|
@@ -15,17 +15,13 @@ var _useSlotProps = _interopRequireDefault(require("@mui/utils/useSlotProps"));
|
|
|
15
15
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
16
16
|
var _useEnhancedEffect = _interopRequireDefault(require("@mui/utils/useEnhancedEffect"));
|
|
17
17
|
var _pickersMonthClasses = require("./pickersMonthClasses");
|
|
18
|
+
var _usePickerPrivateContext = require("../internals/hooks/usePickerPrivateContext");
|
|
18
19
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
-
const _excluded = ["autoFocus", "className", "children", "disabled", "selected", "value", "tabIndex", "onClick", "onKeyDown", "onFocus", "onBlur", "aria-current", "aria-label", "monthsPerRow", "slots", "slotProps"];
|
|
20
|
-
const useUtilityClasses = ownerState => {
|
|
21
|
-
const {
|
|
22
|
-
disabled,
|
|
23
|
-
selected,
|
|
24
|
-
classes
|
|
25
|
-
} = ownerState;
|
|
20
|
+
const _excluded = ["autoFocus", "className", "classes", "children", "disabled", "selected", "value", "tabIndex", "onClick", "onKeyDown", "onFocus", "onBlur", "aria-current", "aria-label", "monthsPerRow", "slots", "slotProps"];
|
|
21
|
+
const useUtilityClasses = (classes, ownerState) => {
|
|
26
22
|
const slots = {
|
|
27
23
|
root: ['root'],
|
|
28
|
-
monthButton: ['monthButton',
|
|
24
|
+
monthButton: ['monthButton', ownerState.isMonthDisabled && 'disabled', ownerState.isMonthSelected && 'selected']
|
|
29
25
|
};
|
|
30
26
|
return (0, _composeClasses.default)(slots, _pickersMonthClasses.getPickersMonthUtilityClass, classes);
|
|
31
27
|
};
|
|
@@ -101,9 +97,10 @@ const PickersMonth = exports.PickersMonth = /*#__PURE__*/React.memo(function Pic
|
|
|
101
97
|
const {
|
|
102
98
|
autoFocus,
|
|
103
99
|
className,
|
|
100
|
+
classes: classesProp,
|
|
104
101
|
children,
|
|
105
|
-
disabled,
|
|
106
|
-
selected,
|
|
102
|
+
disabled = false,
|
|
103
|
+
selected = false,
|
|
107
104
|
value,
|
|
108
105
|
tabIndex,
|
|
109
106
|
onClick,
|
|
@@ -120,7 +117,14 @@ const PickersMonth = exports.PickersMonth = /*#__PURE__*/React.memo(function Pic
|
|
|
120
117
|
} = props,
|
|
121
118
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
122
119
|
const ref = React.useRef(null);
|
|
123
|
-
const
|
|
120
|
+
const {
|
|
121
|
+
ownerState: pickerOwnerState
|
|
122
|
+
} = (0, _usePickerPrivateContext.usePickerPrivateContext)();
|
|
123
|
+
const ownerState = (0, _extends2.default)({}, pickerOwnerState, {
|
|
124
|
+
isMonthDisabled: disabled,
|
|
125
|
+
isMonthSelected: selected
|
|
126
|
+
});
|
|
127
|
+
const classes = useUtilityClasses(classesProp, ownerState);
|
|
124
128
|
|
|
125
129
|
// We can't forward the `autoFocus` to the button because it is a native button, not a MUI Button
|
|
126
130
|
(0, _useEnhancedEffect.default)(() => {
|
|
@@ -148,12 +152,12 @@ const PickersMonth = exports.PickersMonth = /*#__PURE__*/React.memo(function Pic
|
|
|
148
152
|
onFocus: event => onFocus(event, value),
|
|
149
153
|
onBlur: event => onBlur(event, value)
|
|
150
154
|
},
|
|
151
|
-
ownerState
|
|
155
|
+
ownerState,
|
|
152
156
|
className: classes.monthButton
|
|
153
157
|
});
|
|
154
158
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(PickersMonthRoot, (0, _extends2.default)({
|
|
155
159
|
className: (0, _clsx.default)(classes.root, className),
|
|
156
|
-
ownerState:
|
|
160
|
+
ownerState: ownerState
|
|
157
161
|
}, other, {
|
|
158
162
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(MonthButton, (0, _extends2.default)({}, monthButtonProps))
|
|
159
163
|
}));
|
|
@@ -16,7 +16,7 @@ var _RtlProvider = require("@mui/system/RtlProvider");
|
|
|
16
16
|
var _styles = require("@mui/material/styles");
|
|
17
17
|
var _useEventCallback = _interopRequireDefault(require("@mui/utils/useEventCallback"));
|
|
18
18
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
19
|
-
var
|
|
19
|
+
var _usePickerTranslations = require("../hooks/usePickerTranslations");
|
|
20
20
|
var _useUtils = require("../internals/hooks/useUtils");
|
|
21
21
|
var _timeUtils = require("../internals/utils/time-utils");
|
|
22
22
|
var _useViews = require("../internals/hooks/useViews");
|
|
@@ -111,7 +111,7 @@ const MultiSectionDigitalClock = exports.MultiSectionDigitalClock = /*#__PURE__*
|
|
|
111
111
|
onChange,
|
|
112
112
|
valueManager: _valueManagers.singleItemValueManager
|
|
113
113
|
});
|
|
114
|
-
const translations = (0,
|
|
114
|
+
const translations = (0, _usePickerTranslations.usePickerTranslations)();
|
|
115
115
|
const now = (0, _useUtils.useNow)(timezone);
|
|
116
116
|
const timeSteps = React.useMemo(() => (0, _extends2.default)({
|
|
117
117
|
hours: 1,
|
|
@@ -375,7 +375,8 @@ process.env.NODE_ENV !== "production" ? MultiSectionDigitalClock.propTypes = {
|
|
|
375
375
|
*/
|
|
376
376
|
defaultValue: _propTypes.default.object,
|
|
377
377
|
/**
|
|
378
|
-
* If `true`, the
|
|
378
|
+
* If `true`, the component is disabled.
|
|
379
|
+
* When disabled, the value cannot be changed and no interaction is possible.
|
|
379
380
|
* @default false
|
|
380
381
|
*/
|
|
381
382
|
disabled: _propTypes.default.bool,
|
|
@@ -442,7 +443,8 @@ process.env.NODE_ENV !== "production" ? MultiSectionDigitalClock.propTypes = {
|
|
|
442
443
|
*/
|
|
443
444
|
openTo: _propTypes.default.oneOf(['hours', 'meridiem', 'minutes', 'seconds']),
|
|
444
445
|
/**
|
|
445
|
-
* If `true`, the
|
|
446
|
+
* If `true`, the component is read-only.
|
|
447
|
+
* When read-only, the value cannot be changed but the user can interact with the interface.
|
|
446
448
|
* @default false
|
|
447
449
|
*/
|
|
448
450
|
readOnly: _propTypes.default.bool,
|
|
@@ -453,8 +455,7 @@ process.env.NODE_ENV !== "production" ? MultiSectionDigitalClock.propTypes = {
|
|
|
453
455
|
referenceDate: _propTypes.default.object,
|
|
454
456
|
/**
|
|
455
457
|
* Disable specific time.
|
|
456
|
-
* @
|
|
457
|
-
* @param {TDate} value The value to check.
|
|
458
|
+
* @param {PickerValidDate} value The value to check.
|
|
458
459
|
* @param {TimeView} view The clock type of the timeValue.
|
|
459
460
|
* @returns {boolean} If `true` the time will be disabled.
|
|
460
461
|
*/
|
|
@@ -13,7 +13,7 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
13
13
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
14
14
|
var _Button = _interopRequireDefault(require("@mui/material/Button"));
|
|
15
15
|
var _DialogActions = _interopRequireDefault(require("@mui/material/DialogActions"));
|
|
16
|
-
var
|
|
16
|
+
var _usePickerTranslations = require("../hooks/usePickerTranslations");
|
|
17
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
18
|
const _excluded = ["onAccept", "onClear", "onCancel", "onSetToday", "actions"];
|
|
19
19
|
/**
|
|
@@ -35,7 +35,7 @@ function PickersActionBar(props) {
|
|
|
35
35
|
actions
|
|
36
36
|
} = props,
|
|
37
37
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
38
|
-
const translations = (0,
|
|
38
|
+
const translations = (0, _usePickerTranslations.usePickerTranslations)();
|
|
39
39
|
if (actions == null || actions.length === 0) {
|
|
40
40
|
return null;
|
|
41
41
|
}
|
|
@@ -17,7 +17,7 @@ var _styles = require("@mui/material/styles");
|
|
|
17
17
|
var _useSlotProps2 = _interopRequireDefault(require("@mui/utils/useSlotProps"));
|
|
18
18
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
19
19
|
var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
|
|
20
|
-
var
|
|
20
|
+
var _usePickerTranslations = require("../hooks/usePickerTranslations");
|
|
21
21
|
var _useUtils = require("../internals/hooks/useUtils");
|
|
22
22
|
var _PickersFadeTransitionGroup = require("../DateCalendar/PickersFadeTransitionGroup");
|
|
23
23
|
var _icons = require("../icons");
|
|
@@ -117,7 +117,7 @@ const PickersCalendarHeaderSwitchViewIcon = (0, _styles.styled)(_icons.ArrowDrop
|
|
|
117
117
|
* - [PickersCalendarHeader API](https://mui.com/x/api/date-pickers/pickers-calendar-header/)
|
|
118
118
|
*/
|
|
119
119
|
const PickersCalendarHeader = exports.PickersCalendarHeader = /*#__PURE__*/React.forwardRef(function PickersCalendarHeader(inProps, ref) {
|
|
120
|
-
const translations = (0,
|
|
120
|
+
const translations = (0, _usePickerTranslations.usePickerTranslations)();
|
|
121
121
|
const utils = (0, _useUtils.useUtils)();
|
|
122
122
|
const props = (0, _styles.useThemeProps)({
|
|
123
123
|
props: inProps,
|
|
@@ -152,6 +152,11 @@ process.env.NODE_ENV !== "production" ? PickersLayout.propTypes = {
|
|
|
152
152
|
*/
|
|
153
153
|
classes: _propTypes.default.object,
|
|
154
154
|
className: _propTypes.default.string,
|
|
155
|
+
/**
|
|
156
|
+
* If `true`, the component is disabled.
|
|
157
|
+
* When disabled, the value cannot be changed and no interaction is possible.
|
|
158
|
+
* @default false
|
|
159
|
+
*/
|
|
155
160
|
disabled: _propTypes.default.bool,
|
|
156
161
|
isLandscape: _propTypes.default.bool.isRequired,
|
|
157
162
|
/**
|
|
@@ -173,6 +178,11 @@ process.env.NODE_ENV !== "production" ? PickersLayout.propTypes = {
|
|
|
173
178
|
* Force rendering in particular orientation.
|
|
174
179
|
*/
|
|
175
180
|
orientation: _propTypes.default.oneOf(['landscape', 'portrait']),
|
|
181
|
+
/**
|
|
182
|
+
* If `true`, the component is read-only.
|
|
183
|
+
* When read-only, the value cannot be changed but the user can interact with the interface.
|
|
184
|
+
* @default false
|
|
185
|
+
*/
|
|
176
186
|
readOnly: _propTypes.default.bool,
|
|
177
187
|
/**
|
|
178
188
|
* The props used for each component slot.
|
|
@@ -14,13 +14,13 @@ var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"
|
|
|
14
14
|
var _PickersActionBar = require("../PickersActionBar");
|
|
15
15
|
var _pickersLayoutClasses = require("./pickersLayoutClasses");
|
|
16
16
|
var _PickersShortcuts = require("../PickersShortcuts");
|
|
17
|
+
var _usePickerPrivateContext = require("../internals/hooks/usePickerPrivateContext");
|
|
17
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
19
|
function toolbarHasView(toolbarProps) {
|
|
19
20
|
return toolbarProps.view !== null;
|
|
20
21
|
}
|
|
21
|
-
const useUtilityClasses = ownerState => {
|
|
22
|
+
const useUtilityClasses = (classes, ownerState) => {
|
|
22
23
|
const {
|
|
23
|
-
classes,
|
|
24
24
|
isLandscape
|
|
25
25
|
} = ownerState;
|
|
26
26
|
const slots = {
|
|
@@ -35,6 +35,9 @@ const useUtilityClasses = ownerState => {
|
|
|
35
35
|
return (0, _composeClasses.default)(slots, _pickersLayoutClasses.getPickersLayoutUtilityClass, classes);
|
|
36
36
|
};
|
|
37
37
|
const usePickerLayout = props => {
|
|
38
|
+
const {
|
|
39
|
+
ownerState: pickersOwnerState
|
|
40
|
+
} = (0, _usePickerPrivateContext.usePickerPrivateContext)();
|
|
38
41
|
const {
|
|
39
42
|
wrapperVariant,
|
|
40
43
|
onAccept,
|
|
@@ -53,13 +56,18 @@ const usePickerLayout = props => {
|
|
|
53
56
|
readOnly,
|
|
54
57
|
children,
|
|
55
58
|
slots,
|
|
56
|
-
slotProps
|
|
59
|
+
slotProps,
|
|
60
|
+
classes: classesProp
|
|
57
61
|
// TODO: Remove this "as" hack. It get introduced to mark `value` prop in PickersLayoutProps as not required.
|
|
58
62
|
// The true type should be
|
|
59
|
-
// - For pickers value:
|
|
60
|
-
// - For range pickers value: [
|
|
63
|
+
// - For pickers value: PickerValidDate | null
|
|
64
|
+
// - For range pickers value: [PickerValidDate | null, PickerValidDate | null]
|
|
61
65
|
} = props;
|
|
62
|
-
const
|
|
66
|
+
const ownerState = (0, _extends2.default)({}, pickersOwnerState, {
|
|
67
|
+
wrapperVariant,
|
|
68
|
+
isLandscape
|
|
69
|
+
});
|
|
70
|
+
const classes = useUtilityClasses(classesProp, ownerState);
|
|
63
71
|
|
|
64
72
|
// Action bar
|
|
65
73
|
const ActionBar = slots?.actionBar ?? _PickersActionBar.PickersActionBar;
|
|
@@ -74,9 +82,7 @@ const usePickerLayout = props => {
|
|
|
74
82
|
actions: wrapperVariant === 'desktop' ? [] : ['cancel', 'accept']
|
|
75
83
|
},
|
|
76
84
|
className: classes.actionBar,
|
|
77
|
-
ownerState
|
|
78
|
-
wrapperVariant
|
|
79
|
-
})
|
|
85
|
+
ownerState
|
|
80
86
|
});
|
|
81
87
|
const actionBar = /*#__PURE__*/(0, _jsxRuntime.jsx)(ActionBar, (0, _extends2.default)({}, actionBarProps));
|
|
82
88
|
|
|
@@ -96,9 +102,7 @@ const usePickerLayout = props => {
|
|
|
96
102
|
readOnly
|
|
97
103
|
},
|
|
98
104
|
className: classes.toolbar,
|
|
99
|
-
ownerState
|
|
100
|
-
wrapperVariant
|
|
101
|
-
})
|
|
105
|
+
ownerState
|
|
102
106
|
});
|
|
103
107
|
const toolbar = toolbarHasView(toolbarProps) && !!Toolbar ? /*#__PURE__*/(0, _jsxRuntime.jsx)(Toolbar, (0, _extends2.default)({}, toolbarProps)) : null;
|
|
104
108
|
|
|
@@ -124,12 +128,7 @@ const usePickerLayout = props => {
|
|
|
124
128
|
onChange: onSelectShortcut
|
|
125
129
|
},
|
|
126
130
|
className: classes.shortcuts,
|
|
127
|
-
ownerState
|
|
128
|
-
isValid,
|
|
129
|
-
isLandscape,
|
|
130
|
-
onChange: onSelectShortcut,
|
|
131
|
-
wrapperVariant
|
|
132
|
-
}
|
|
131
|
+
ownerState
|
|
133
132
|
});
|
|
134
133
|
const shortcuts = view && !!Shortcuts ? /*#__PURE__*/(0, _jsxRuntime.jsx)(Shortcuts, (0, _extends2.default)({}, shortcutsProps)) : null;
|
|
135
134
|
return {
|