@mui/x-date-pickers 7.22.3 → 8.0.0-alpha.1
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 +348 -12
- package/DateCalendar/DateCalendar.d.ts +1 -2
- package/DateCalendar/DateCalendar.js +21 -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 +2 -4
- 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 +5 -5
- package/DateTimePicker/DateTimePickerToolbar.js +8 -7
- 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 +0 -2
- 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 +8 -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 +18 -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 +8 -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 +0 -2
- package/PickersLayout/PickersLayout.types.d.ts +16 -19
- package/PickersLayout/index.d.ts +1 -1
- package/PickersLayout/usePickerLayout.d.ts +1 -2
- package/PickersLayout/usePickerLayout.js +18 -23
- package/PickersTextField/PickersInputBase/PickersInputBase.js +10 -9
- package/PickersTextField/PickersTextField.js +2 -2
- package/README.md +4 -4
- 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 +4 -3
- package/TimeClock/ClockNumbers.d.ts +5 -5
- package/TimeClock/TimeClock.d.ts +1 -2
- package/TimeClock/TimeClock.js +8 -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 +8 -7
- package/TimePicker/shared.d.ts +10 -10
- package/YearCalendar/PickersYear.js +17 -13
- package/YearCalendar/YearCalendar.d.ts +1 -2
- package/YearCalendar/YearCalendar.js +18 -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/hooks/useSplitFieldProps.d.ts +3 -3
- package/index.js +1 -1
- package/internals/components/PickerProvider.d.ts +67 -0
- package/internals/components/PickerProvider.js +40 -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 +22 -18
- 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 +40 -50
- package/internals/hooks/useField/useField.utils.d.ts +15 -15
- package/internals/hooks/useField/useFieldCharacterEditing.d.ts +4 -4
- package/internals/hooks/useField/useFieldState.d.ts +4 -4
- package/internals/hooks/useField/useFieldState.js +4 -3
- package/internals/hooks/useField/useFieldV7TextField.js +4 -3
- package/internals/hooks/useMobilePicker/useMobilePicker.d.ts +1 -2
- package/internals/hooks/useMobilePicker/useMobilePicker.js +24 -19
- 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 +15 -10
- package/internals/hooks/usePicker/usePicker.types.d.ts +9 -7
- package/internals/hooks/usePicker/usePickerLayoutProps.d.ts +6 -8
- package/internals/hooks/usePicker/usePickerLayoutProps.js +2 -5
- package/internals/hooks/usePicker/usePickerProvider.d.ts +26 -0
- package/internals/hooks/usePicker/usePickerProvider.js +77 -0
- package/internals/hooks/usePicker/usePickerValue.d.ts +2 -2
- package/internals/hooks/usePicker/usePickerValue.js +7 -10
- package/internals/hooks/usePicker/usePickerValue.types.d.ts +38 -39
- package/internals/hooks/usePicker/usePickerViews.d.ts +7 -11
- package/internals/hooks/usePicker/usePickerViews.js +1 -0
- 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 +6 -5
- package/internals/hooks/useStaticPicker/useStaticPicker.types.d.ts +6 -6
- package/internals/hooks/useUtils.d.ts +7 -7
- package/internals/hooks/useValueWithTimezone.d.ts +19 -15
- package/internals/hooks/useValueWithTimezone.js +13 -1
- package/internals/hooks/useViews.d.ts +3 -3
- package/internals/hooks/useViews.js +1 -1
- package/internals/index.d.ts +7 -5
- package/internals/index.js +2 -1
- package/internals/models/common.d.ts +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 +0 -2
- 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 +17 -17
- 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/common.d.ts +1 -0
- package/models/fields.d.ts +9 -42
- package/models/pickers.d.ts +28 -6
- package/modern/DateCalendar/DateCalendar.js +21 -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 +2 -4
- 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 +8 -7
- package/modern/DesktopDatePicker/DesktopDatePicker.js +17 -16
- package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +18 -18
- package/modern/DesktopDateTimePicker/DesktopDateTimePickerLayout.js +0 -2
- package/modern/DesktopTimePicker/DesktopTimePicker.js +11 -6
- package/modern/DigitalClock/DigitalClock.js +8 -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 +18 -14
- package/modern/MonthCalendar/PickersMonth.js +17 -13
- package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.js +8 -6
- package/modern/PickersActionBar/PickersActionBar.js +2 -2
- package/modern/PickersCalendarHeader/PickersCalendarHeader.js +2 -2
- package/modern/PickersLayout/PickersLayout.js +0 -2
- package/modern/PickersLayout/usePickerLayout.js +18 -23
- package/modern/PickersTextField/PickersInputBase/PickersInputBase.js +10 -9
- package/modern/PickersTextField/PickersTextField.js +2 -2
- 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 +4 -3
- package/modern/TimeClock/TimeClock.js +8 -6
- package/modern/TimeField/TimeField.js +6 -6
- package/modern/TimePicker/TimePicker.js +9 -4
- package/modern/TimePicker/TimePickerToolbar.js +8 -7
- package/modern/YearCalendar/PickersYear.js +17 -13
- package/modern/YearCalendar/YearCalendar.js +18 -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 +40 -0
- package/modern/internals/hooks/useDesktopPicker/useDesktopPicker.js +22 -18
- package/modern/internals/hooks/useField/useField.js +1 -1
- package/modern/internals/hooks/useField/useFieldState.js +4 -3
- package/modern/internals/hooks/useField/useFieldV7TextField.js +4 -3
- package/modern/internals/hooks/useMobilePicker/useMobilePicker.js +24 -19
- package/modern/internals/hooks/usePicker/usePicker.js +15 -10
- package/modern/internals/hooks/usePicker/usePickerLayoutProps.js +2 -5
- package/modern/internals/hooks/usePicker/usePickerProvider.js +77 -0
- package/modern/internals/hooks/usePicker/usePickerValue.js +7 -10
- package/modern/internals/hooks/usePicker/usePickerViews.js +1 -0
- package/modern/internals/hooks/usePickerPrivateContext.js +9 -0
- package/modern/internals/hooks/useStaticPicker/useStaticPicker.js +6 -5
- package/modern/internals/hooks/useValueWithTimezone.js +13 -1
- 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 +21 -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 +2 -4
- 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 +8 -7
- package/node/DesktopDatePicker/DesktopDatePicker.js +17 -16
- package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +18 -18
- package/node/DesktopDateTimePicker/DesktopDateTimePickerLayout.js +0 -2
- package/node/DesktopTimePicker/DesktopTimePicker.js +11 -6
- package/node/DigitalClock/DigitalClock.js +8 -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 +18 -14
- package/node/MonthCalendar/PickersMonth.js +17 -13
- package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.js +8 -6
- package/node/PickersActionBar/PickersActionBar.js +2 -2
- package/node/PickersCalendarHeader/PickersCalendarHeader.js +2 -2
- package/node/PickersLayout/PickersLayout.js +0 -2
- package/node/PickersLayout/usePickerLayout.js +18 -23
- package/node/PickersTextField/PickersInputBase/PickersInputBase.js +10 -9
- package/node/PickersTextField/PickersTextField.js +2 -2
- 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 +4 -3
- package/node/TimeClock/TimeClock.js +8 -6
- package/node/TimeField/TimeField.js +6 -6
- package/node/TimePicker/TimePicker.js +9 -4
- package/node/TimePicker/TimePickerToolbar.js +8 -7
- package/node/YearCalendar/PickersYear.js +17 -13
- package/node/YearCalendar/YearCalendar.js +18 -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 +48 -0
- package/node/internals/hooks/useDesktopPicker/useDesktopPicker.js +22 -18
- package/node/internals/hooks/useField/useField.js +1 -1
- package/node/internals/hooks/useField/useFieldState.js +4 -3
- package/node/internals/hooks/useField/useFieldV7TextField.js +4 -3
- package/node/internals/hooks/useMobilePicker/useMobilePicker.js +24 -19
- package/node/internals/hooks/usePicker/usePicker.js +15 -10
- package/node/internals/hooks/usePicker/usePickerLayoutProps.js +2 -5
- package/node/internals/hooks/usePicker/usePickerProvider.js +87 -0
- package/node/internals/hooks/usePicker/usePickerValue.js +6 -10
- package/node/internals/hooks/usePicker/usePickerViews.js +1 -0
- package/node/internals/hooks/usePickerPrivateContext.js +15 -0
- package/node/internals/hooks/useStaticPicker/useStaticPicker.js +6 -5
- package/node/internals/hooks/useValueWithTimezone.js +13 -1
- 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 +5 -5
- 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.d.ts +0 -34
- package/internals/components/PickersProvider.js +0 -26
- package/internals/hooks/usePicker/usePickerOwnerState.d.ts +0 -9
- package/internals/hooks/usePicker/usePickerOwnerState.js +0 -13
- package/modern/hooks/usePickersContext.js +0 -15
- package/modern/internals/components/PickersProvider.js +0 -26
- package/modern/internals/hooks/usePicker/usePickerOwnerState.js +0 -13
- package/node/hooks/usePickersContext.js +0 -21
- package/node/hooks/usePickersTranslations.js +0 -10
- package/node/internals/components/PickersProvider.js +0 -34
- package/node/internals/hooks/usePicker/usePickerOwnerState.js +0 -20
- /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
|
@@ -44,7 +44,7 @@ const DateField = exports.DateField = /*#__PURE__*/React.forwardRef(function Dat
|
|
|
44
44
|
} = themeProps,
|
|
45
45
|
other = (0, _objectWithoutPropertiesLoose2.default)(themeProps, _excluded);
|
|
46
46
|
const ownerState = themeProps;
|
|
47
|
-
const TextField = slots?.textField ?? (inProps.enableAccessibleFieldDOMStructure ?
|
|
47
|
+
const TextField = slots?.textField ?? (inProps.enableAccessibleFieldDOMStructure === false ? _TextField.default : _PickersTextField.PickersTextField);
|
|
48
48
|
const textFieldProps = (0, _useSlotProps.default)({
|
|
49
49
|
elementType: TextField,
|
|
50
50
|
externalSlotProps: slotProps?.textField,
|
|
@@ -96,6 +96,7 @@ process.env.NODE_ENV !== "production" ? DateField.propTypes = {
|
|
|
96
96
|
defaultValue: _propTypes.default.object,
|
|
97
97
|
/**
|
|
98
98
|
* If `true`, the component is disabled.
|
|
99
|
+
* When disabled, the value cannot be changed and no interaction is possible.
|
|
99
100
|
* @default false
|
|
100
101
|
*/
|
|
101
102
|
disabled: _propTypes.default.bool,
|
|
@@ -110,7 +111,7 @@ process.env.NODE_ENV !== "production" ? DateField.propTypes = {
|
|
|
110
111
|
*/
|
|
111
112
|
disablePast: _propTypes.default.bool,
|
|
112
113
|
/**
|
|
113
|
-
* @default
|
|
114
|
+
* @default true
|
|
114
115
|
*/
|
|
115
116
|
enableAccessibleFieldDOMStructure: _propTypes.default.bool,
|
|
116
117
|
/**
|
|
@@ -225,8 +226,8 @@ process.env.NODE_ENV !== "production" ? DateField.propTypes = {
|
|
|
225
226
|
*/
|
|
226
227
|
onSelectedSectionsChange: _propTypes.default.func,
|
|
227
228
|
/**
|
|
228
|
-
*
|
|
229
|
-
*
|
|
229
|
+
* If `true`, the component is read-only.
|
|
230
|
+
* When read-only, the value cannot be changed but the user can interact with the interface.
|
|
230
231
|
* @default false
|
|
231
232
|
*/
|
|
232
233
|
readOnly: _propTypes.default.bool,
|
|
@@ -256,22 +257,19 @@ process.env.NODE_ENV !== "production" ? DateField.propTypes = {
|
|
|
256
257
|
*
|
|
257
258
|
* 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.
|
|
258
259
|
*
|
|
259
|
-
* @
|
|
260
|
-
* @param {TDate} day The date to test.
|
|
260
|
+
* @param {PickerValidDate} day The date to test.
|
|
261
261
|
* @returns {boolean} If `true` the date will be disabled.
|
|
262
262
|
*/
|
|
263
263
|
shouldDisableDate: _propTypes.default.func,
|
|
264
264
|
/**
|
|
265
265
|
* Disable specific month.
|
|
266
|
-
* @
|
|
267
|
-
* @param {TDate} month The month to test.
|
|
266
|
+
* @param {PickerValidDate} month The month to test.
|
|
268
267
|
* @returns {boolean} If `true`, the month will be disabled.
|
|
269
268
|
*/
|
|
270
269
|
shouldDisableMonth: _propTypes.default.func,
|
|
271
270
|
/**
|
|
272
271
|
* Disable specific year.
|
|
273
|
-
* @
|
|
274
|
-
* @param {TDate} year The year to test.
|
|
272
|
+
* @param {PickerValidDate} year The year to test.
|
|
275
273
|
* @returns {boolean} If `true`, the year will be disabled.
|
|
276
274
|
*/
|
|
277
275
|
shouldDisableYear: _propTypes.default.func,
|
|
@@ -72,9 +72,9 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
|
|
|
72
72
|
closeOnSelect: _propTypes.default.bool,
|
|
73
73
|
/**
|
|
74
74
|
* Formats the day of week displayed in the calendar header.
|
|
75
|
-
* @param {
|
|
75
|
+
* @param {PickerValidDate} date The date of the day of week provided by the adapter.
|
|
76
76
|
* @returns {string} The name to display.
|
|
77
|
-
* @default (date:
|
|
77
|
+
* @default (date: PickerValidDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
|
|
78
78
|
*/
|
|
79
79
|
dayOfWeekFormatter: _propTypes.default.func,
|
|
80
80
|
/**
|
|
@@ -89,7 +89,8 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
|
|
|
89
89
|
*/
|
|
90
90
|
desktopModeMediaQuery: _propTypes.default.string,
|
|
91
91
|
/**
|
|
92
|
-
* If `true`, the
|
|
92
|
+
* If `true`, the component is disabled.
|
|
93
|
+
* When disabled, the value cannot be changed and no interaction is possible.
|
|
93
94
|
* @default false
|
|
94
95
|
*/
|
|
95
96
|
disabled: _propTypes.default.bool,
|
|
@@ -118,7 +119,7 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
|
|
|
118
119
|
*/
|
|
119
120
|
displayWeekNumber: _propTypes.default.bool,
|
|
120
121
|
/**
|
|
121
|
-
* @default
|
|
122
|
+
* @default true
|
|
122
123
|
*/
|
|
123
124
|
enableAccessibleFieldDOMStructure: _propTypes.default.any,
|
|
124
125
|
/**
|
|
@@ -208,8 +209,7 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
|
|
|
208
209
|
onError: _propTypes.default.func,
|
|
209
210
|
/**
|
|
210
211
|
* Callback fired on month change.
|
|
211
|
-
* @
|
|
212
|
-
* @param {TDate} month The new month.
|
|
212
|
+
* @param {PickerValidDate} month The new month.
|
|
213
213
|
*/
|
|
214
214
|
onMonthChange: _propTypes.default.func,
|
|
215
215
|
/**
|
|
@@ -230,8 +230,7 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
|
|
|
230
230
|
onViewChange: _propTypes.default.func,
|
|
231
231
|
/**
|
|
232
232
|
* Callback fired on year change.
|
|
233
|
-
* @
|
|
234
|
-
* @param {TDate} year The new year.
|
|
233
|
+
* @param {PickerValidDate} year The new year.
|
|
235
234
|
*/
|
|
236
235
|
onYearChange: _propTypes.default.func,
|
|
237
236
|
/**
|
|
@@ -249,6 +248,11 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
|
|
|
249
248
|
* Force rendering in particular orientation.
|
|
250
249
|
*/
|
|
251
250
|
orientation: _propTypes.default.oneOf(['landscape', 'portrait']),
|
|
251
|
+
/**
|
|
252
|
+
* If `true`, the component is read-only.
|
|
253
|
+
* When read-only, the value cannot be changed but the user can interact with the interface.
|
|
254
|
+
* @default false
|
|
255
|
+
*/
|
|
252
256
|
readOnly: _propTypes.default.bool,
|
|
253
257
|
/**
|
|
254
258
|
* If `true`, disable heavy animations.
|
|
@@ -281,22 +285,19 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
|
|
|
281
285
|
*
|
|
282
286
|
* 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.
|
|
283
287
|
*
|
|
284
|
-
* @
|
|
285
|
-
* @param {TDate} day The date to test.
|
|
288
|
+
* @param {PickerValidDate} day The date to test.
|
|
286
289
|
* @returns {boolean} If `true` the date will be disabled.
|
|
287
290
|
*/
|
|
288
291
|
shouldDisableDate: _propTypes.default.func,
|
|
289
292
|
/**
|
|
290
293
|
* Disable specific month.
|
|
291
|
-
* @
|
|
292
|
-
* @param {TDate} month The month to test.
|
|
294
|
+
* @param {PickerValidDate} month The month to test.
|
|
293
295
|
* @returns {boolean} If `true`, the month will be disabled.
|
|
294
296
|
*/
|
|
295
297
|
shouldDisableMonth: _propTypes.default.func,
|
|
296
298
|
/**
|
|
297
299
|
* Disable specific year.
|
|
298
|
-
* @
|
|
299
|
-
* @param {TDate} year The year to test.
|
|
300
|
+
* @param {PickerValidDate} year The year to test.
|
|
300
301
|
* @returns {boolean} If `true`, the year will be disabled.
|
|
301
302
|
*/
|
|
302
303
|
shouldDisableYear: _propTypes.default.func,
|
|
@@ -16,7 +16,7 @@ var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
|
|
|
16
16
|
var _styles = require("@mui/material/styles");
|
|
17
17
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
18
18
|
var _PickersToolbar = require("../internals/components/PickersToolbar");
|
|
19
|
-
var
|
|
19
|
+
var _usePickerTranslations = require("../hooks/usePickerTranslations");
|
|
20
20
|
var _useUtils = require("../internals/hooks/useUtils");
|
|
21
21
|
var _datePickerToolbarClasses = require("./datePickerToolbarClasses");
|
|
22
22
|
var _dateUtils = require("../internals/utils/date-utils");
|
|
@@ -76,7 +76,7 @@ const DatePickerToolbar = exports.DatePickerToolbar = /*#__PURE__*/React.forward
|
|
|
76
76
|
} = props,
|
|
77
77
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
78
78
|
const utils = (0, _useUtils.useUtils)();
|
|
79
|
-
const translations = (0,
|
|
79
|
+
const translations = (0, _usePickerTranslations.usePickerTranslations)();
|
|
80
80
|
const classes = useUtilityClasses(props);
|
|
81
81
|
const dateText = React.useMemo(() => {
|
|
82
82
|
if (!value) {
|
|
@@ -114,7 +114,6 @@ process.env.NODE_ENV !== "production" ? DatePickerToolbar.propTypes = {
|
|
|
114
114
|
*/
|
|
115
115
|
classes: _propTypes.default.object,
|
|
116
116
|
className: _propTypes.default.string,
|
|
117
|
-
disabled: _propTypes.default.bool,
|
|
118
117
|
/**
|
|
119
118
|
* If `true`, show the toolbar even in desktop mode.
|
|
120
119
|
* @default `true` for Desktop, `false` for Mobile.
|
|
@@ -128,7 +127,6 @@ process.env.NODE_ENV !== "production" ? DatePickerToolbar.propTypes = {
|
|
|
128
127
|
* @param {TView} view The view to open
|
|
129
128
|
*/
|
|
130
129
|
onViewChange: _propTypes.default.func.isRequired,
|
|
131
|
-
readOnly: _propTypes.default.bool,
|
|
132
130
|
/**
|
|
133
131
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
134
132
|
*/
|
|
@@ -44,7 +44,7 @@ const DateTimeField = exports.DateTimeField = /*#__PURE__*/React.forwardRef(func
|
|
|
44
44
|
} = themeProps,
|
|
45
45
|
other = (0, _objectWithoutPropertiesLoose2.default)(themeProps, _excluded);
|
|
46
46
|
const ownerState = themeProps;
|
|
47
|
-
const TextField = slots?.textField ?? (inProps.enableAccessibleFieldDOMStructure ?
|
|
47
|
+
const TextField = slots?.textField ?? (inProps.enableAccessibleFieldDOMStructure === false ? _TextField.default : _PickersTextField.PickersTextField);
|
|
48
48
|
const textFieldProps = (0, _useSlotProps.default)({
|
|
49
49
|
elementType: TextField,
|
|
50
50
|
externalSlotProps: slotProps?.textField,
|
|
@@ -101,6 +101,7 @@ process.env.NODE_ENV !== "production" ? DateTimeField.propTypes = {
|
|
|
101
101
|
defaultValue: _propTypes.default.object,
|
|
102
102
|
/**
|
|
103
103
|
* If `true`, the component is disabled.
|
|
104
|
+
* When disabled, the value cannot be changed and no interaction is possible.
|
|
104
105
|
* @default false
|
|
105
106
|
*/
|
|
106
107
|
disabled: _propTypes.default.bool,
|
|
@@ -120,7 +121,7 @@ process.env.NODE_ENV !== "production" ? DateTimeField.propTypes = {
|
|
|
120
121
|
*/
|
|
121
122
|
disablePast: _propTypes.default.bool,
|
|
122
123
|
/**
|
|
123
|
-
* @default
|
|
124
|
+
* @default true
|
|
124
125
|
*/
|
|
125
126
|
enableAccessibleFieldDOMStructure: _propTypes.default.bool,
|
|
126
127
|
/**
|
|
@@ -258,8 +259,8 @@ process.env.NODE_ENV !== "production" ? DateTimeField.propTypes = {
|
|
|
258
259
|
*/
|
|
259
260
|
onSelectedSectionsChange: _propTypes.default.func,
|
|
260
261
|
/**
|
|
261
|
-
*
|
|
262
|
-
*
|
|
262
|
+
* If `true`, the component is read-only.
|
|
263
|
+
* When read-only, the value cannot be changed but the user can interact with the interface.
|
|
263
264
|
* @default false
|
|
264
265
|
*/
|
|
265
266
|
readOnly: _propTypes.default.bool,
|
|
@@ -289,30 +290,26 @@ process.env.NODE_ENV !== "production" ? DateTimeField.propTypes = {
|
|
|
289
290
|
*
|
|
290
291
|
* 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.
|
|
291
292
|
*
|
|
292
|
-
* @
|
|
293
|
-
* @param {TDate} day The date to test.
|
|
293
|
+
* @param {PickerValidDate} day The date to test.
|
|
294
294
|
* @returns {boolean} If `true` the date will be disabled.
|
|
295
295
|
*/
|
|
296
296
|
shouldDisableDate: _propTypes.default.func,
|
|
297
297
|
/**
|
|
298
298
|
* Disable specific month.
|
|
299
|
-
* @
|
|
300
|
-
* @param {TDate} month The month to test.
|
|
299
|
+
* @param {PickerValidDate} month The month to test.
|
|
301
300
|
* @returns {boolean} If `true`, the month will be disabled.
|
|
302
301
|
*/
|
|
303
302
|
shouldDisableMonth: _propTypes.default.func,
|
|
304
303
|
/**
|
|
305
304
|
* Disable specific time.
|
|
306
|
-
* @
|
|
307
|
-
* @param {TDate} value The value to check.
|
|
305
|
+
* @param {PickerValidDate} value The value to check.
|
|
308
306
|
* @param {TimeView} view The clock type of the timeValue.
|
|
309
307
|
* @returns {boolean} If `true` the time will be disabled.
|
|
310
308
|
*/
|
|
311
309
|
shouldDisableTime: _propTypes.default.func,
|
|
312
310
|
/**
|
|
313
311
|
* Disable specific year.
|
|
314
|
-
* @
|
|
315
|
-
* @param {TDate} year The year to test.
|
|
312
|
+
* @param {PickerValidDate} year The year to test.
|
|
316
313
|
* @returns {boolean} If `true`, the year will be disabled.
|
|
317
314
|
*/
|
|
318
315
|
shouldDisableYear: _propTypes.default.func,
|
|
@@ -82,9 +82,9 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
|
|
|
82
82
|
closeOnSelect: _propTypes.default.bool,
|
|
83
83
|
/**
|
|
84
84
|
* Formats the day of week displayed in the calendar header.
|
|
85
|
-
* @param {
|
|
85
|
+
* @param {PickerValidDate} date The date of the day of week provided by the adapter.
|
|
86
86
|
* @returns {string} The name to display.
|
|
87
|
-
* @default (date:
|
|
87
|
+
* @default (date: PickerValidDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
|
|
88
88
|
*/
|
|
89
89
|
dayOfWeekFormatter: _propTypes.default.func,
|
|
90
90
|
/**
|
|
@@ -99,7 +99,8 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
|
|
|
99
99
|
*/
|
|
100
100
|
desktopModeMediaQuery: _propTypes.default.string,
|
|
101
101
|
/**
|
|
102
|
-
* If `true`, the
|
|
102
|
+
* If `true`, the component is disabled.
|
|
103
|
+
* When disabled, the value cannot be changed and no interaction is possible.
|
|
103
104
|
* @default false
|
|
104
105
|
*/
|
|
105
106
|
disabled: _propTypes.default.bool,
|
|
@@ -133,7 +134,7 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
|
|
|
133
134
|
*/
|
|
134
135
|
displayWeekNumber: _propTypes.default.bool,
|
|
135
136
|
/**
|
|
136
|
-
* @default
|
|
137
|
+
* @default true
|
|
137
138
|
*/
|
|
138
139
|
enableAccessibleFieldDOMStructure: _propTypes.default.any,
|
|
139
140
|
/**
|
|
@@ -246,8 +247,7 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
|
|
|
246
247
|
onError: _propTypes.default.func,
|
|
247
248
|
/**
|
|
248
249
|
* Callback fired on month change.
|
|
249
|
-
* @
|
|
250
|
-
* @param {TDate} month The new month.
|
|
250
|
+
* @param {PickerValidDate} month The new month.
|
|
251
251
|
*/
|
|
252
252
|
onMonthChange: _propTypes.default.func,
|
|
253
253
|
/**
|
|
@@ -268,8 +268,7 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
|
|
|
268
268
|
onViewChange: _propTypes.default.func,
|
|
269
269
|
/**
|
|
270
270
|
* Callback fired on year change.
|
|
271
|
-
* @
|
|
272
|
-
* @param {TDate} year The new year.
|
|
271
|
+
* @param {PickerValidDate} year The new year.
|
|
273
272
|
*/
|
|
274
273
|
onYearChange: _propTypes.default.func,
|
|
275
274
|
/**
|
|
@@ -287,6 +286,11 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
|
|
|
287
286
|
* Force rendering in particular orientation.
|
|
288
287
|
*/
|
|
289
288
|
orientation: _propTypes.default.oneOf(['landscape', 'portrait']),
|
|
289
|
+
/**
|
|
290
|
+
* If `true`, the component is read-only.
|
|
291
|
+
* When read-only, the value cannot be changed but the user can interact with the interface.
|
|
292
|
+
* @default false
|
|
293
|
+
*/
|
|
290
294
|
readOnly: _propTypes.default.bool,
|
|
291
295
|
/**
|
|
292
296
|
* If `true`, disable heavy animations.
|
|
@@ -319,30 +323,26 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
|
|
|
319
323
|
*
|
|
320
324
|
* 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.
|
|
321
325
|
*
|
|
322
|
-
* @
|
|
323
|
-
* @param {TDate} day The date to test.
|
|
326
|
+
* @param {PickerValidDate} day The date to test.
|
|
324
327
|
* @returns {boolean} If `true` the date will be disabled.
|
|
325
328
|
*/
|
|
326
329
|
shouldDisableDate: _propTypes.default.func,
|
|
327
330
|
/**
|
|
328
331
|
* Disable specific month.
|
|
329
|
-
* @
|
|
330
|
-
* @param {TDate} month The month to test.
|
|
332
|
+
* @param {PickerValidDate} month The month to test.
|
|
331
333
|
* @returns {boolean} If `true`, the month will be disabled.
|
|
332
334
|
*/
|
|
333
335
|
shouldDisableMonth: _propTypes.default.func,
|
|
334
336
|
/**
|
|
335
337
|
* Disable specific time.
|
|
336
|
-
* @
|
|
337
|
-
* @param {TDate} value The value to check.
|
|
338
|
+
* @param {PickerValidDate} value The value to check.
|
|
338
339
|
* @param {TimeView} view The clock type of the timeValue.
|
|
339
340
|
* @returns {boolean} If `true` the time will be disabled.
|
|
340
341
|
*/
|
|
341
342
|
shouldDisableTime: _propTypes.default.func,
|
|
342
343
|
/**
|
|
343
344
|
* Disable specific year.
|
|
344
|
-
* @
|
|
345
|
-
* @param {TDate} year The year to test.
|
|
345
|
+
* @param {PickerValidDate} year The year to test.
|
|
346
346
|
* @returns {boolean} If `true`, the year will be disabled.
|
|
347
347
|
*/
|
|
348
348
|
shouldDisableYear: _propTypes.default.func,
|
|
@@ -15,7 +15,7 @@ var _Tabs = _interopRequireWildcard(require("@mui/material/Tabs"));
|
|
|
15
15
|
var _styles = require("@mui/material/styles");
|
|
16
16
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
17
17
|
var _icons = require("../icons");
|
|
18
|
-
var
|
|
18
|
+
var _usePickerTranslations = require("../hooks/usePickerTranslations");
|
|
19
19
|
var _dateTimePickerTabsClasses = require("./dateTimePickerTabsClasses");
|
|
20
20
|
var _dateUtils = require("../internals/utils/date-utils");
|
|
21
21
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -81,7 +81,7 @@ const DateTimePickerTabs = exports.DateTimePickerTabs = function DateTimePickerT
|
|
|
81
81
|
className,
|
|
82
82
|
sx
|
|
83
83
|
} = props;
|
|
84
|
-
const translations = (0,
|
|
84
|
+
const translations = (0, _usePickerTranslations.usePickerTranslations)();
|
|
85
85
|
const classes = useUtilityClasses(props);
|
|
86
86
|
const handleChange = (event, value) => {
|
|
87
87
|
onViewChange(tabToView(value));
|
|
@@ -18,7 +18,7 @@ var _clsx = _interopRequireDefault(require("clsx"));
|
|
|
18
18
|
var _PickersToolbarText = require("../internals/components/PickersToolbarText");
|
|
19
19
|
var _PickersToolbar = require("../internals/components/PickersToolbar");
|
|
20
20
|
var _PickersToolbarButton = require("../internals/components/PickersToolbarButton");
|
|
21
|
-
var
|
|
21
|
+
var _usePickerTranslations = require("../hooks/usePickerTranslations");
|
|
22
22
|
var _useUtils = require("../internals/hooks/useUtils");
|
|
23
23
|
var _dateTimePickerToolbarClasses = require("./dateTimePickerToolbarClasses");
|
|
24
24
|
var _dateHelpersHooks = require("../internals/hooks/date-helpers-hooks");
|
|
@@ -26,8 +26,9 @@ var _dimensions = require("../internals/constants/dimensions");
|
|
|
26
26
|
var _dateUtils = require("../internals/utils/date-utils");
|
|
27
27
|
var _pickersToolbarTextClasses = require("../internals/components/pickersToolbarTextClasses");
|
|
28
28
|
var _pickersToolbarClasses = require("../internals/components/pickersToolbarClasses");
|
|
29
|
+
var _usePickerContext = require("../hooks/usePickerContext");
|
|
29
30
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
30
|
-
const _excluded = ["ampm", "ampmInClock", "value", "onChange", "view", "isLandscape", "onViewChange", "toolbarFormat", "toolbarPlaceholder", "views", "
|
|
31
|
+
const _excluded = ["ampm", "ampmInClock", "value", "onChange", "view", "isLandscape", "onViewChange", "toolbarFormat", "toolbarPlaceholder", "views", "toolbarVariant", "toolbarTitle", "className"];
|
|
31
32
|
const useUtilityClasses = ownerState => {
|
|
32
33
|
const {
|
|
33
34
|
classes,
|
|
@@ -233,14 +234,16 @@ function DateTimePickerToolbar(inProps) {
|
|
|
233
234
|
toolbarFormat,
|
|
234
235
|
toolbarPlaceholder = '––',
|
|
235
236
|
views,
|
|
236
|
-
disabled,
|
|
237
|
-
readOnly,
|
|
238
237
|
toolbarVariant = 'mobile',
|
|
239
238
|
toolbarTitle: inToolbarTitle,
|
|
240
239
|
className
|
|
241
240
|
} = props,
|
|
242
241
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
243
242
|
const isRtl = (0, _RtlProvider.useRtl)();
|
|
243
|
+
const {
|
|
244
|
+
disabled,
|
|
245
|
+
readOnly
|
|
246
|
+
} = (0, _usePickerContext.usePickerContext)();
|
|
244
247
|
const ownerState = (0, _extends2.default)({}, props, {
|
|
245
248
|
isRtl
|
|
246
249
|
});
|
|
@@ -251,7 +254,7 @@ function DateTimePickerToolbar(inProps) {
|
|
|
251
254
|
} = (0, _dateHelpersHooks.useMeridiemMode)(value, ampm, onChange);
|
|
252
255
|
const showAmPmControl = Boolean(ampm && !ampmInClock);
|
|
253
256
|
const isDesktop = toolbarVariant === 'desktop';
|
|
254
|
-
const translations = (0,
|
|
257
|
+
const translations = (0, _usePickerTranslations.usePickerTranslations)();
|
|
255
258
|
const classes = useUtilityClasses(ownerState);
|
|
256
259
|
const toolbarTitle = inToolbarTitle ?? translations.dateTimePickerToolbarTitle;
|
|
257
260
|
const formatHours = time => ampm ? utils.format(time, 'hours12h') : utils.format(time, 'hours24h');
|
|
@@ -366,7 +369,6 @@ process.env.NODE_ENV !== "production" ? DateTimePickerToolbar.propTypes = {
|
|
|
366
369
|
*/
|
|
367
370
|
classes: _propTypes.default.object,
|
|
368
371
|
className: _propTypes.default.string,
|
|
369
|
-
disabled: _propTypes.default.bool,
|
|
370
372
|
/**
|
|
371
373
|
* If `true`, show the toolbar even in desktop mode.
|
|
372
374
|
* @default `true` for Desktop, `false` for Mobile.
|
|
@@ -380,7 +382,6 @@ process.env.NODE_ENV !== "production" ? DateTimePickerToolbar.propTypes = {
|
|
|
380
382
|
* @param {TView} view The view to open
|
|
381
383
|
*/
|
|
382
384
|
onViewChange: _propTypes.default.func.isRequired,
|
|
383
|
-
readOnly: _propTypes.default.bool,
|
|
384
385
|
/**
|
|
385
386
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
386
387
|
*/
|
|
@@ -14,7 +14,7 @@ var _resolveComponentProps = _interopRequireDefault(require("@mui/utils/resolveC
|
|
|
14
14
|
var _utils = require("@mui/utils");
|
|
15
15
|
var _valueManagers = require("../internals/utils/valueManagers");
|
|
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 _useDesktopPicker = require("../internals/hooks/useDesktopPicker");
|
|
@@ -34,7 +34,7 @@ var _getPickersLocalization = require("../locales/utils/getPickersLocalization")
|
|
|
34
34
|
* - [DesktopDatePicker API](https://mui.com/x/api/date-pickers/desktop-date-picker/)
|
|
35
35
|
*/
|
|
36
36
|
const DesktopDatePicker = exports.DesktopDatePicker = /*#__PURE__*/React.forwardRef(function DesktopDatePicker(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 pickers
|
|
@@ -99,9 +99,9 @@ DesktopDatePicker.propTypes = {
|
|
|
99
99
|
closeOnSelect: _propTypes.default.bool,
|
|
100
100
|
/**
|
|
101
101
|
* Formats the day of week displayed in the calendar header.
|
|
102
|
-
* @param {
|
|
102
|
+
* @param {PickerValidDate} date The date of the day of week provided by the adapter.
|
|
103
103
|
* @returns {string} The name to display.
|
|
104
|
-
* @default (date:
|
|
104
|
+
* @default (date: PickerValidDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
|
|
105
105
|
*/
|
|
106
106
|
dayOfWeekFormatter: _propTypes.default.func,
|
|
107
107
|
/**
|
|
@@ -110,7 +110,8 @@ DesktopDatePicker.propTypes = {
|
|
|
110
110
|
*/
|
|
111
111
|
defaultValue: _propTypes.default.object,
|
|
112
112
|
/**
|
|
113
|
-
* If `true`, the
|
|
113
|
+
* If `true`, the component is disabled.
|
|
114
|
+
* When disabled, the value cannot be changed and no interaction is possible.
|
|
114
115
|
* @default false
|
|
115
116
|
*/
|
|
116
117
|
disabled: _propTypes.default.bool,
|
|
@@ -139,7 +140,7 @@ DesktopDatePicker.propTypes = {
|
|
|
139
140
|
*/
|
|
140
141
|
displayWeekNumber: _propTypes.default.bool,
|
|
141
142
|
/**
|
|
142
|
-
* @default
|
|
143
|
+
* @default true
|
|
143
144
|
*/
|
|
144
145
|
enableAccessibleFieldDOMStructure: _propTypes.default.any,
|
|
145
146
|
/**
|
|
@@ -229,8 +230,7 @@ DesktopDatePicker.propTypes = {
|
|
|
229
230
|
onError: _propTypes.default.func,
|
|
230
231
|
/**
|
|
231
232
|
* Callback fired on month change.
|
|
232
|
-
* @
|
|
233
|
-
* @param {TDate} month The new month.
|
|
233
|
+
* @param {PickerValidDate} month The new month.
|
|
234
234
|
*/
|
|
235
235
|
onMonthChange: _propTypes.default.func,
|
|
236
236
|
/**
|
|
@@ -251,8 +251,7 @@ DesktopDatePicker.propTypes = {
|
|
|
251
251
|
onViewChange: _propTypes.default.func,
|
|
252
252
|
/**
|
|
253
253
|
* Callback fired on year change.
|
|
254
|
-
* @
|
|
255
|
-
* @param {TDate} year The new year.
|
|
254
|
+
* @param {PickerValidDate} year The new year.
|
|
256
255
|
*/
|
|
257
256
|
onYearChange: _propTypes.default.func,
|
|
258
257
|
/**
|
|
@@ -270,6 +269,11 @@ DesktopDatePicker.propTypes = {
|
|
|
270
269
|
* Force rendering in particular orientation.
|
|
271
270
|
*/
|
|
272
271
|
orientation: _propTypes.default.oneOf(['landscape', 'portrait']),
|
|
272
|
+
/**
|
|
273
|
+
* If `true`, the component is read-only.
|
|
274
|
+
* When read-only, the value cannot be changed but the user can interact with the interface.
|
|
275
|
+
* @default false
|
|
276
|
+
*/
|
|
273
277
|
readOnly: _propTypes.default.bool,
|
|
274
278
|
/**
|
|
275
279
|
* If `true`, disable heavy animations.
|
|
@@ -302,22 +306,19 @@ DesktopDatePicker.propTypes = {
|
|
|
302
306
|
*
|
|
303
307
|
* 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.
|
|
304
308
|
*
|
|
305
|
-
* @
|
|
306
|
-
* @param {TDate} day The date to test.
|
|
309
|
+
* @param {PickerValidDate} day The date to test.
|
|
307
310
|
* @returns {boolean} If `true` the date will be disabled.
|
|
308
311
|
*/
|
|
309
312
|
shouldDisableDate: _propTypes.default.func,
|
|
310
313
|
/**
|
|
311
314
|
* Disable specific month.
|
|
312
|
-
* @
|
|
313
|
-
* @param {TDate} month The month to test.
|
|
315
|
+
* @param {PickerValidDate} month The month to test.
|
|
314
316
|
* @returns {boolean} If `true`, the month will be disabled.
|
|
315
317
|
*/
|
|
316
318
|
shouldDisableMonth: _propTypes.default.func,
|
|
317
319
|
/**
|
|
318
320
|
* Disable specific year.
|
|
319
|
-
* @
|
|
320
|
-
* @param {TDate} year The year to test.
|
|
321
|
+
* @param {PickerValidDate} year The year to test.
|
|
321
322
|
* @returns {boolean} If `true`, the year will be disabled.
|
|
322
323
|
*/
|
|
323
324
|
shouldDisableYear: _propTypes.default.func,
|
|
@@ -18,7 +18,7 @@ var _valueManagers = require("../internals/utils/valueManagers");
|
|
|
18
18
|
var _DateTimeField = require("../DateTimeField");
|
|
19
19
|
var _shared = require("../DateTimePicker/shared");
|
|
20
20
|
var _dateViewRenderers = require("../dateViewRenderers/dateViewRenderers");
|
|
21
|
-
var
|
|
21
|
+
var _usePickerTranslations = require("../hooks/usePickerTranslations");
|
|
22
22
|
var _useUtils = require("../internals/hooks/useUtils");
|
|
23
23
|
var _validation = require("../validation");
|
|
24
24
|
var _icons = require("../icons");
|
|
@@ -90,7 +90,7 @@ const rendererInterceptor = function rendererInterceptor(inViewRenderers, popper
|
|
|
90
90
|
* - [DesktopDateTimePicker API](https://mui.com/x/api/date-pickers/desktop-date-time-picker/)
|
|
91
91
|
*/
|
|
92
92
|
const DesktopDateTimePicker = exports.DesktopDateTimePicker = /*#__PURE__*/React.forwardRef(function DesktopDateTimePicker(inProps, ref) {
|
|
93
|
-
const translations = (0,
|
|
93
|
+
const translations = (0, _usePickerTranslations.usePickerTranslations)();
|
|
94
94
|
const utils = (0, _useUtils.useUtils)();
|
|
95
95
|
|
|
96
96
|
// Props with the default values common to all date time pickers
|
|
@@ -196,9 +196,9 @@ DesktopDateTimePicker.propTypes = {
|
|
|
196
196
|
closeOnSelect: _propTypes.default.bool,
|
|
197
197
|
/**
|
|
198
198
|
* Formats the day of week displayed in the calendar header.
|
|
199
|
-
* @param {
|
|
199
|
+
* @param {PickerValidDate} date The date of the day of week provided by the adapter.
|
|
200
200
|
* @returns {string} The name to display.
|
|
201
|
-
* @default (date:
|
|
201
|
+
* @default (date: PickerValidDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
|
|
202
202
|
*/
|
|
203
203
|
dayOfWeekFormatter: _propTypes.default.func,
|
|
204
204
|
/**
|
|
@@ -207,7 +207,8 @@ DesktopDateTimePicker.propTypes = {
|
|
|
207
207
|
*/
|
|
208
208
|
defaultValue: _propTypes.default.object,
|
|
209
209
|
/**
|
|
210
|
-
* If `true`, the
|
|
210
|
+
* If `true`, the component is disabled.
|
|
211
|
+
* When disabled, the value cannot be changed and no interaction is possible.
|
|
211
212
|
* @default false
|
|
212
213
|
*/
|
|
213
214
|
disabled: _propTypes.default.bool,
|
|
@@ -241,7 +242,7 @@ DesktopDateTimePicker.propTypes = {
|
|
|
241
242
|
*/
|
|
242
243
|
displayWeekNumber: _propTypes.default.bool,
|
|
243
244
|
/**
|
|
244
|
-
* @default
|
|
245
|
+
* @default true
|
|
245
246
|
*/
|
|
246
247
|
enableAccessibleFieldDOMStructure: _propTypes.default.any,
|
|
247
248
|
/**
|
|
@@ -354,8 +355,7 @@ DesktopDateTimePicker.propTypes = {
|
|
|
354
355
|
onError: _propTypes.default.func,
|
|
355
356
|
/**
|
|
356
357
|
* Callback fired on month change.
|
|
357
|
-
* @
|
|
358
|
-
* @param {TDate} month The new month.
|
|
358
|
+
* @param {PickerValidDate} month The new month.
|
|
359
359
|
*/
|
|
360
360
|
onMonthChange: _propTypes.default.func,
|
|
361
361
|
/**
|
|
@@ -376,8 +376,7 @@ DesktopDateTimePicker.propTypes = {
|
|
|
376
376
|
onViewChange: _propTypes.default.func,
|
|
377
377
|
/**
|
|
378
378
|
* Callback fired on year change.
|
|
379
|
-
* @
|
|
380
|
-
* @param {TDate} year The new year.
|
|
379
|
+
* @param {PickerValidDate} year The new year.
|
|
381
380
|
*/
|
|
382
381
|
onYearChange: _propTypes.default.func,
|
|
383
382
|
/**
|
|
@@ -395,6 +394,11 @@ DesktopDateTimePicker.propTypes = {
|
|
|
395
394
|
* Force rendering in particular orientation.
|
|
396
395
|
*/
|
|
397
396
|
orientation: _propTypes.default.oneOf(['landscape', 'portrait']),
|
|
397
|
+
/**
|
|
398
|
+
* If `true`, the component is read-only.
|
|
399
|
+
* When read-only, the value cannot be changed but the user can interact with the interface.
|
|
400
|
+
* @default false
|
|
401
|
+
*/
|
|
398
402
|
readOnly: _propTypes.default.bool,
|
|
399
403
|
/**
|
|
400
404
|
* If `true`, disable heavy animations.
|
|
@@ -427,30 +431,26 @@ DesktopDateTimePicker.propTypes = {
|
|
|
427
431
|
*
|
|
428
432
|
* 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.
|
|
429
433
|
*
|
|
430
|
-
* @
|
|
431
|
-
* @param {TDate} day The date to test.
|
|
434
|
+
* @param {PickerValidDate} day The date to test.
|
|
432
435
|
* @returns {boolean} If `true` the date will be disabled.
|
|
433
436
|
*/
|
|
434
437
|
shouldDisableDate: _propTypes.default.func,
|
|
435
438
|
/**
|
|
436
439
|
* Disable specific month.
|
|
437
|
-
* @
|
|
438
|
-
* @param {TDate} month The month to test.
|
|
440
|
+
* @param {PickerValidDate} month The month to test.
|
|
439
441
|
* @returns {boolean} If `true`, the month will be disabled.
|
|
440
442
|
*/
|
|
441
443
|
shouldDisableMonth: _propTypes.default.func,
|
|
442
444
|
/**
|
|
443
445
|
* Disable specific time.
|
|
444
|
-
* @
|
|
445
|
-
* @param {TDate} value The value to check.
|
|
446
|
+
* @param {PickerValidDate} value The value to check.
|
|
446
447
|
* @param {TimeView} view The clock type of the timeValue.
|
|
447
448
|
* @returns {boolean} If `true` the time will be disabled.
|
|
448
449
|
*/
|
|
449
450
|
shouldDisableTime: _propTypes.default.func,
|
|
450
451
|
/**
|
|
451
452
|
* Disable specific year.
|
|
452
|
-
* @
|
|
453
|
-
* @param {TDate} year The year to test.
|
|
453
|
+
* @param {PickerValidDate} year The year to test.
|
|
454
454
|
* @returns {boolean} If `true`, the year will be disabled.
|
|
455
455
|
*/
|
|
456
456
|
shouldDisableYear: _propTypes.default.func,
|