@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
|
@@ -71,9 +71,9 @@ StaticDatePicker.propTypes = {
|
|
|
71
71
|
className: _propTypes.default.string,
|
|
72
72
|
/**
|
|
73
73
|
* Formats the day of week displayed in the calendar header.
|
|
74
|
-
* @param {
|
|
74
|
+
* @param {PickerValidDate} date The date of the day of week provided by the adapter.
|
|
75
75
|
* @returns {string} The name to display.
|
|
76
|
-
* @default (date:
|
|
76
|
+
* @default (date: PickerValidDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
|
|
77
77
|
*/
|
|
78
78
|
dayOfWeekFormatter: _propTypes.default.func,
|
|
79
79
|
/**
|
|
@@ -82,7 +82,8 @@ StaticDatePicker.propTypes = {
|
|
|
82
82
|
*/
|
|
83
83
|
defaultValue: _propTypes.default.object,
|
|
84
84
|
/**
|
|
85
|
-
* If `true`, the
|
|
85
|
+
* If `true`, the component is disabled.
|
|
86
|
+
* When disabled, the value cannot be changed and no interaction is possible.
|
|
86
87
|
* @default false
|
|
87
88
|
*/
|
|
88
89
|
disabled: _propTypes.default.bool,
|
|
@@ -175,8 +176,7 @@ StaticDatePicker.propTypes = {
|
|
|
175
176
|
onError: _propTypes.default.func,
|
|
176
177
|
/**
|
|
177
178
|
* Callback fired on month change.
|
|
178
|
-
* @
|
|
179
|
-
* @param {TDate} month The new month.
|
|
179
|
+
* @param {PickerValidDate} month The new month.
|
|
180
180
|
*/
|
|
181
181
|
onMonthChange: _propTypes.default.func,
|
|
182
182
|
/**
|
|
@@ -187,8 +187,7 @@ StaticDatePicker.propTypes = {
|
|
|
187
187
|
onViewChange: _propTypes.default.func,
|
|
188
188
|
/**
|
|
189
189
|
* Callback fired on year change.
|
|
190
|
-
* @
|
|
191
|
-
* @param {TDate} year The new year.
|
|
190
|
+
* @param {PickerValidDate} year The new year.
|
|
192
191
|
*/
|
|
193
192
|
onYearChange: _propTypes.default.func,
|
|
194
193
|
/**
|
|
@@ -201,6 +200,11 @@ StaticDatePicker.propTypes = {
|
|
|
201
200
|
* Force rendering in particular orientation.
|
|
202
201
|
*/
|
|
203
202
|
orientation: _propTypes.default.oneOf(['landscape', 'portrait']),
|
|
203
|
+
/**
|
|
204
|
+
* If `true`, the component is read-only.
|
|
205
|
+
* When read-only, the value cannot be changed but the user can interact with the interface.
|
|
206
|
+
* @default false
|
|
207
|
+
*/
|
|
204
208
|
readOnly: _propTypes.default.bool,
|
|
205
209
|
/**
|
|
206
210
|
* If `true`, disable heavy animations.
|
|
@@ -223,22 +227,19 @@ StaticDatePicker.propTypes = {
|
|
|
223
227
|
*
|
|
224
228
|
* 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.
|
|
225
229
|
*
|
|
226
|
-
* @
|
|
227
|
-
* @param {TDate} day The date to test.
|
|
230
|
+
* @param {PickerValidDate} day The date to test.
|
|
228
231
|
* @returns {boolean} If `true` the date will be disabled.
|
|
229
232
|
*/
|
|
230
233
|
shouldDisableDate: _propTypes.default.func,
|
|
231
234
|
/**
|
|
232
235
|
* Disable specific month.
|
|
233
|
-
* @
|
|
234
|
-
* @param {TDate} month The month to test.
|
|
236
|
+
* @param {PickerValidDate} month The month to test.
|
|
235
237
|
* @returns {boolean} If `true`, the month will be disabled.
|
|
236
238
|
*/
|
|
237
239
|
shouldDisableMonth: _propTypes.default.func,
|
|
238
240
|
/**
|
|
239
241
|
* Disable specific year.
|
|
240
|
-
* @
|
|
241
|
-
* @param {TDate} year The year to test.
|
|
242
|
+
* @param {PickerValidDate} year The year to test.
|
|
242
243
|
* @returns {boolean} If `true`, the year will be disabled.
|
|
243
244
|
*/
|
|
244
245
|
shouldDisableYear: _propTypes.default.func,
|
|
@@ -91,9 +91,9 @@ StaticDateTimePicker.propTypes = {
|
|
|
91
91
|
className: _propTypes.default.string,
|
|
92
92
|
/**
|
|
93
93
|
* Formats the day of week displayed in the calendar header.
|
|
94
|
-
* @param {
|
|
94
|
+
* @param {PickerValidDate} date The date of the day of week provided by the adapter.
|
|
95
95
|
* @returns {string} The name to display.
|
|
96
|
-
* @default (date:
|
|
96
|
+
* @default (date: PickerValidDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
|
|
97
97
|
*/
|
|
98
98
|
dayOfWeekFormatter: _propTypes.default.func,
|
|
99
99
|
/**
|
|
@@ -102,7 +102,8 @@ StaticDateTimePicker.propTypes = {
|
|
|
102
102
|
*/
|
|
103
103
|
defaultValue: _propTypes.default.object,
|
|
104
104
|
/**
|
|
105
|
-
* If `true`, the
|
|
105
|
+
* If `true`, the component is disabled.
|
|
106
|
+
* When disabled, the value cannot be changed and no interaction is possible.
|
|
106
107
|
* @default false
|
|
107
108
|
*/
|
|
108
109
|
disabled: _propTypes.default.bool,
|
|
@@ -223,8 +224,7 @@ StaticDateTimePicker.propTypes = {
|
|
|
223
224
|
onError: _propTypes.default.func,
|
|
224
225
|
/**
|
|
225
226
|
* Callback fired on month change.
|
|
226
|
-
* @
|
|
227
|
-
* @param {TDate} month The new month.
|
|
227
|
+
* @param {PickerValidDate} month The new month.
|
|
228
228
|
*/
|
|
229
229
|
onMonthChange: _propTypes.default.func,
|
|
230
230
|
/**
|
|
@@ -235,8 +235,7 @@ StaticDateTimePicker.propTypes = {
|
|
|
235
235
|
onViewChange: _propTypes.default.func,
|
|
236
236
|
/**
|
|
237
237
|
* Callback fired on year change.
|
|
238
|
-
* @
|
|
239
|
-
* @param {TDate} year The new year.
|
|
238
|
+
* @param {PickerValidDate} year The new year.
|
|
240
239
|
*/
|
|
241
240
|
onYearChange: _propTypes.default.func,
|
|
242
241
|
/**
|
|
@@ -249,6 +248,11 @@ StaticDateTimePicker.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.
|
|
@@ -271,30 +275,26 @@ StaticDateTimePicker.propTypes = {
|
|
|
271
275
|
*
|
|
272
276
|
* 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.
|
|
273
277
|
*
|
|
274
|
-
* @
|
|
275
|
-
* @param {TDate} day The date to test.
|
|
278
|
+
* @param {PickerValidDate} day The date to test.
|
|
276
279
|
* @returns {boolean} If `true` the date will be disabled.
|
|
277
280
|
*/
|
|
278
281
|
shouldDisableDate: _propTypes.default.func,
|
|
279
282
|
/**
|
|
280
283
|
* Disable specific month.
|
|
281
|
-
* @
|
|
282
|
-
* @param {TDate} month The month to test.
|
|
284
|
+
* @param {PickerValidDate} month The month to test.
|
|
283
285
|
* @returns {boolean} If `true`, the month will be disabled.
|
|
284
286
|
*/
|
|
285
287
|
shouldDisableMonth: _propTypes.default.func,
|
|
286
288
|
/**
|
|
287
289
|
* Disable specific time.
|
|
288
|
-
* @
|
|
289
|
-
* @param {TDate} value The value to check.
|
|
290
|
+
* @param {PickerValidDate} value The value to check.
|
|
290
291
|
* @param {TimeView} view The clock type of the timeValue.
|
|
291
292
|
* @returns {boolean} If `true` the time will be disabled.
|
|
292
293
|
*/
|
|
293
294
|
shouldDisableTime: _propTypes.default.func,
|
|
294
295
|
/**
|
|
295
296
|
* Disable specific year.
|
|
296
|
-
* @
|
|
297
|
-
* @param {TDate} year The year to test.
|
|
297
|
+
* @param {PickerValidDate} year The year to test.
|
|
298
298
|
* @returns {boolean} If `true`, the year will be disabled.
|
|
299
299
|
*/
|
|
300
300
|
shouldDisableYear: _propTypes.default.func,
|
|
@@ -87,7 +87,8 @@ StaticTimePicker.propTypes = {
|
|
|
87
87
|
*/
|
|
88
88
|
defaultValue: _propTypes.default.object,
|
|
89
89
|
/**
|
|
90
|
-
* If `true`, the
|
|
90
|
+
* If `true`, the component is disabled.
|
|
91
|
+
* When disabled, the value cannot be changed and no interaction is possible.
|
|
91
92
|
* @default false
|
|
92
93
|
*/
|
|
93
94
|
disabled: _propTypes.default.bool,
|
|
@@ -179,6 +180,11 @@ StaticTimePicker.propTypes = {
|
|
|
179
180
|
* Force rendering in particular orientation.
|
|
180
181
|
*/
|
|
181
182
|
orientation: _propTypes.default.oneOf(['landscape', 'portrait']),
|
|
183
|
+
/**
|
|
184
|
+
* If `true`, the component is read-only.
|
|
185
|
+
* When read-only, the value cannot be changed but the user can interact with the interface.
|
|
186
|
+
* @default false
|
|
187
|
+
*/
|
|
182
188
|
readOnly: _propTypes.default.bool,
|
|
183
189
|
/**
|
|
184
190
|
* If `true`, disable heavy animations.
|
|
@@ -192,8 +198,7 @@ StaticTimePicker.propTypes = {
|
|
|
192
198
|
referenceDate: _propTypes.default.object,
|
|
193
199
|
/**
|
|
194
200
|
* Disable specific time.
|
|
195
|
-
* @
|
|
196
|
-
* @param {TDate} value The value to check.
|
|
201
|
+
* @param {PickerValidDate} value The value to check.
|
|
197
202
|
* @param {TimeView} view The clock type of the timeValue.
|
|
198
203
|
* @returns {boolean} If `true` the time will be disabled.
|
|
199
204
|
*/
|
package/node/TimeClock/Clock.js
CHANGED
|
@@ -14,7 +14,7 @@ var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
|
|
|
14
14
|
var _styles = require("@mui/material/styles");
|
|
15
15
|
var _utils = require("@mui/utils");
|
|
16
16
|
var _ClockPointer = require("./ClockPointer");
|
|
17
|
-
var
|
|
17
|
+
var _usePickerTranslations = require("../hooks/usePickerTranslations");
|
|
18
18
|
var _useUtils = require("../internals/hooks/useUtils");
|
|
19
19
|
var _shared = require("./shared");
|
|
20
20
|
var _clockClasses = require("./clockClasses");
|
|
@@ -194,7 +194,7 @@ function Clock(inProps) {
|
|
|
194
194
|
} = props;
|
|
195
195
|
const ownerState = props;
|
|
196
196
|
const utils = (0, _useUtils.useUtils)();
|
|
197
|
-
const translations = (0,
|
|
197
|
+
const translations = (0, _usePickerTranslations.usePickerTranslations)();
|
|
198
198
|
const isMoving = React.useRef(false);
|
|
199
199
|
const classes = useUtilityClasses(ownerState);
|
|
200
200
|
const isSelectedTimeDisabled = isTimeDisabled(viewValue, type);
|
|
@@ -324,7 +324,7 @@ function Clock(inProps) {
|
|
|
324
324
|
})]
|
|
325
325
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(ClockWrapper, {
|
|
326
326
|
"aria-activedescendant": selectedId,
|
|
327
|
-
"aria-label": translations.clockLabelText(type, value
|
|
327
|
+
"aria-label": translations.clockLabelText(type, value == null ? null : utils.format(value, 'fullTime')),
|
|
328
328
|
ref: listboxRef,
|
|
329
329
|
role: "listbox",
|
|
330
330
|
onKeyDown: handleKeyDown,
|
|
@@ -14,7 +14,7 @@ var _clsx = _interopRequireDefault(require("clsx"));
|
|
|
14
14
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
15
|
var _styles = require("@mui/material/styles");
|
|
16
16
|
var _utils = require("@mui/utils");
|
|
17
|
-
var
|
|
17
|
+
var _usePickerTranslations = require("../hooks/usePickerTranslations");
|
|
18
18
|
var _useUtils = require("../internals/hooks/useUtils");
|
|
19
19
|
var _PickersArrowSwitcher = require("../internals/components/PickersArrowSwitcher");
|
|
20
20
|
var _timeUtils = require("../internals/utils/time-utils");
|
|
@@ -124,7 +124,7 @@ const TimeClock = exports.TimeClock = /*#__PURE__*/React.forwardRef(function Tim
|
|
|
124
124
|
props,
|
|
125
125
|
timezone
|
|
126
126
|
});
|
|
127
|
-
const translations = (0,
|
|
127
|
+
const translations = (0, _usePickerTranslations.usePickerTranslations)();
|
|
128
128
|
const now = (0, _useUtils.useNow)(timezone);
|
|
129
129
|
const {
|
|
130
130
|
view,
|
|
@@ -352,7 +352,8 @@ process.env.NODE_ENV !== "production" ? TimeClock.propTypes = {
|
|
|
352
352
|
*/
|
|
353
353
|
defaultValue: _propTypes.default.object,
|
|
354
354
|
/**
|
|
355
|
-
* If `true`, the
|
|
355
|
+
* If `true`, the component is disabled.
|
|
356
|
+
* When disabled, the value cannot be changed and no interaction is possible.
|
|
356
357
|
* @default false
|
|
357
358
|
*/
|
|
358
359
|
disabled: _propTypes.default.bool,
|
|
@@ -419,7 +420,8 @@ process.env.NODE_ENV !== "production" ? TimeClock.propTypes = {
|
|
|
419
420
|
*/
|
|
420
421
|
openTo: _propTypes.default.oneOf(['hours', 'minutes', 'seconds']),
|
|
421
422
|
/**
|
|
422
|
-
* If `true`, the
|
|
423
|
+
* If `true`, the component is read-only.
|
|
424
|
+
* When read-only, the value cannot be changed but the user can interact with the interface.
|
|
423
425
|
* @default false
|
|
424
426
|
*/
|
|
425
427
|
readOnly: _propTypes.default.bool,
|
|
@@ -430,8 +432,7 @@ process.env.NODE_ENV !== "production" ? TimeClock.propTypes = {
|
|
|
430
432
|
referenceDate: _propTypes.default.object,
|
|
431
433
|
/**
|
|
432
434
|
* Disable specific time.
|
|
433
|
-
* @
|
|
434
|
-
* @param {TDate} value The value to check.
|
|
435
|
+
* @param {PickerValidDate} value The value to check.
|
|
435
436
|
* @param {TimeView} view The clock type of the timeValue.
|
|
436
437
|
* @returns {boolean} If `true` the time will be disabled.
|
|
437
438
|
*/
|
|
@@ -44,7 +44,7 @@ const TimeField = exports.TimeField = /*#__PURE__*/React.forwardRef(function Tim
|
|
|
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" ? TimeField.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" ? TimeField.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
|
/**
|
|
@@ -240,8 +241,8 @@ process.env.NODE_ENV !== "production" ? TimeField.propTypes = {
|
|
|
240
241
|
*/
|
|
241
242
|
onSelectedSectionsChange: _propTypes.default.func,
|
|
242
243
|
/**
|
|
243
|
-
*
|
|
244
|
-
*
|
|
244
|
+
* If `true`, the component is read-only.
|
|
245
|
+
* When read-only, the value cannot be changed but the user can interact with the interface.
|
|
245
246
|
* @default false
|
|
246
247
|
*/
|
|
247
248
|
readOnly: _propTypes.default.bool,
|
|
@@ -268,8 +269,7 @@ process.env.NODE_ENV !== "production" ? TimeField.propTypes = {
|
|
|
268
269
|
selectedSections: _propTypes.default.oneOfType([_propTypes.default.oneOf(['all', 'day', 'empty', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'weekDay', 'year']), _propTypes.default.number]),
|
|
269
270
|
/**
|
|
270
271
|
* Disable specific time.
|
|
271
|
-
* @
|
|
272
|
-
* @param {TDate} value The value to check.
|
|
272
|
+
* @param {PickerValidDate} value The value to check.
|
|
273
273
|
* @param {TimeView} view The clock type of the timeValue.
|
|
274
274
|
* @returns {boolean} If `true` the time will be disabled.
|
|
275
275
|
*/
|
|
@@ -92,7 +92,8 @@ process.env.NODE_ENV !== "production" ? TimePicker.propTypes = {
|
|
|
92
92
|
*/
|
|
93
93
|
desktopModeMediaQuery: _propTypes.default.string,
|
|
94
94
|
/**
|
|
95
|
-
* If `true`, the
|
|
95
|
+
* If `true`, the component is disabled.
|
|
96
|
+
* When disabled, the value cannot be changed and no interaction is possible.
|
|
96
97
|
* @default false
|
|
97
98
|
*/
|
|
98
99
|
disabled: _propTypes.default.bool,
|
|
@@ -117,7 +118,7 @@ process.env.NODE_ENV !== "production" ? TimePicker.propTypes = {
|
|
|
117
118
|
*/
|
|
118
119
|
disablePast: _propTypes.default.bool,
|
|
119
120
|
/**
|
|
120
|
-
* @default
|
|
121
|
+
* @default true
|
|
121
122
|
*/
|
|
122
123
|
enableAccessibleFieldDOMStructure: _propTypes.default.any,
|
|
123
124
|
/**
|
|
@@ -225,6 +226,11 @@ process.env.NODE_ENV !== "production" ? TimePicker.propTypes = {
|
|
|
225
226
|
* Force rendering in particular orientation.
|
|
226
227
|
*/
|
|
227
228
|
orientation: _propTypes.default.oneOf(['landscape', 'portrait']),
|
|
229
|
+
/**
|
|
230
|
+
* If `true`, the component is read-only.
|
|
231
|
+
* When read-only, the value cannot be changed but the user can interact with the interface.
|
|
232
|
+
* @default false
|
|
233
|
+
*/
|
|
228
234
|
readOnly: _propTypes.default.bool,
|
|
229
235
|
/**
|
|
230
236
|
* If `true`, disable heavy animations.
|
|
@@ -248,8 +254,7 @@ process.env.NODE_ENV !== "production" ? TimePicker.propTypes = {
|
|
|
248
254
|
selectedSections: _propTypes.default.oneOfType([_propTypes.default.oneOf(['all', 'day', 'empty', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'weekDay', 'year']), _propTypes.default.number]),
|
|
249
255
|
/**
|
|
250
256
|
* Disable specific time.
|
|
251
|
-
* @
|
|
252
|
-
* @param {TDate} value The value to check.
|
|
257
|
+
* @param {PickerValidDate} value The value to check.
|
|
253
258
|
* @param {TimeView} view The clock type of the timeValue.
|
|
254
259
|
* @returns {boolean} If `true` the time will be disabled.
|
|
255
260
|
*/
|
|
@@ -19,7 +19,7 @@ var _PickersToolbarText = require("../internals/components/PickersToolbarText");
|
|
|
19
19
|
var _PickersToolbarButton = require("../internals/components/PickersToolbarButton");
|
|
20
20
|
var _PickersToolbar = require("../internals/components/PickersToolbar");
|
|
21
21
|
var _utils = require("../internals/utils/utils");
|
|
22
|
-
var
|
|
22
|
+
var _usePickerTranslations = require("../hooks/usePickerTranslations");
|
|
23
23
|
var _useUtils = require("../internals/hooks/useUtils");
|
|
24
24
|
var _dateHelpersHooks = require("../internals/hooks/date-helpers-hooks");
|
|
25
25
|
var _timePickerToolbarClasses = require("./timePickerToolbarClasses");
|
|
@@ -141,7 +141,7 @@ function TimePickerToolbar(inProps) {
|
|
|
141
141
|
} = props,
|
|
142
142
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
143
143
|
const utils = (0, _useUtils.useUtils)();
|
|
144
|
-
const translations = (0,
|
|
144
|
+
const translations = (0, _usePickerTranslations.usePickerTranslations)();
|
|
145
145
|
const isRtl = (0, _RtlProvider.useRtl)();
|
|
146
146
|
const showAmPmControl = Boolean(ampm && !ampmInClock && views.includes('hours'));
|
|
147
147
|
const {
|
|
@@ -223,6 +223,11 @@ process.env.NODE_ENV !== "production" ? TimePickerToolbar.propTypes = {
|
|
|
223
223
|
*/
|
|
224
224
|
classes: _propTypes.default.object,
|
|
225
225
|
className: _propTypes.default.string,
|
|
226
|
+
/**
|
|
227
|
+
* If `true`, the component is disabled.
|
|
228
|
+
* When disabled, the value cannot be changed and no interaction is possible.
|
|
229
|
+
* @default false
|
|
230
|
+
*/
|
|
226
231
|
disabled: _propTypes.default.bool,
|
|
227
232
|
/**
|
|
228
233
|
* If `true`, show the toolbar even in desktop mode.
|
|
@@ -237,6 +242,11 @@ process.env.NODE_ENV !== "production" ? TimePickerToolbar.propTypes = {
|
|
|
237
242
|
* @param {TView} view The view to open
|
|
238
243
|
*/
|
|
239
244
|
onViewChange: _propTypes.default.func.isRequired,
|
|
245
|
+
/**
|
|
246
|
+
* If `true`, the component is read-only.
|
|
247
|
+
* When read-only, the value cannot be changed but the user can interact with the interface.
|
|
248
|
+
* @default false
|
|
249
|
+
*/
|
|
240
250
|
readOnly: _propTypes.default.bool,
|
|
241
251
|
/**
|
|
242
252
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
@@ -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 _pickersYearClasses = require("./pickersYearClasses");
|
|
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", "yearsPerRow", "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", "yearsPerRow", "slots", "slotProps"];
|
|
21
|
+
const useUtilityClasses = (classes, ownerState) => {
|
|
26
22
|
const slots = {
|
|
27
23
|
root: ['root'],
|
|
28
|
-
yearButton: ['yearButton',
|
|
24
|
+
yearButton: ['yearButton', ownerState.isYearDisabled && 'disabled', ownerState.isYearSelected && 'selected']
|
|
29
25
|
};
|
|
30
26
|
return (0, _composeClasses.default)(slots, _pickersYearClasses.getPickersYearUtilityClass, classes);
|
|
31
27
|
};
|
|
@@ -101,9 +97,10 @@ const PickersYear = exports.PickersYear = /*#__PURE__*/React.memo(function Picke
|
|
|
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,
|
|
@@ -119,7 +116,14 @@ const PickersYear = exports.PickersYear = /*#__PURE__*/React.memo(function Picke
|
|
|
119
116
|
} = props,
|
|
120
117
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
121
118
|
const ref = React.useRef(null);
|
|
122
|
-
const
|
|
119
|
+
const {
|
|
120
|
+
ownerState: pickerOwnerState
|
|
121
|
+
} = (0, _usePickerPrivateContext.usePickerPrivateContext)();
|
|
122
|
+
const ownerState = (0, _extends2.default)({}, pickerOwnerState, {
|
|
123
|
+
isYearDisabled: disabled,
|
|
124
|
+
isYearSelected: selected
|
|
125
|
+
});
|
|
126
|
+
const classes = useUtilityClasses(classesProp, ownerState);
|
|
123
127
|
|
|
124
128
|
// We can't forward the `autoFocus` to the button because it is a native button, not a MUI Button
|
|
125
129
|
(0, _useEnhancedEffect.default)(() => {
|
|
@@ -146,12 +150,12 @@ const PickersYear = exports.PickersYear = /*#__PURE__*/React.memo(function Picke
|
|
|
146
150
|
onFocus: event => onFocus(event, value),
|
|
147
151
|
onBlur: event => onBlur(event, value)
|
|
148
152
|
},
|
|
149
|
-
ownerState
|
|
153
|
+
ownerState,
|
|
150
154
|
className: classes.yearButton
|
|
151
155
|
});
|
|
152
156
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(PickersYearRoot, (0, _extends2.default)({
|
|
153
157
|
className: (0, _clsx.default)(classes.root, className),
|
|
154
|
-
ownerState:
|
|
158
|
+
ownerState: ownerState
|
|
155
159
|
}, other, {
|
|
156
160
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(YearButton, (0, _extends2.default)({}, yearButtonProps))
|
|
157
161
|
}));
|
|
@@ -23,12 +23,10 @@ var _valueManagers = require("../internals/utils/valueManagers");
|
|
|
23
23
|
var _getDefaultReferenceDate = require("../internals/utils/getDefaultReferenceDate");
|
|
24
24
|
var _useValueWithTimezone = require("../internals/hooks/useValueWithTimezone");
|
|
25
25
|
var _dimensions = require("../internals/constants/dimensions");
|
|
26
|
+
var _usePickerPrivateContext = require("../internals/hooks/usePickerPrivateContext");
|
|
26
27
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
27
|
-
const _excluded = ["autoFocus", "className", "value", "defaultValue", "referenceDate", "disabled", "disableFuture", "disablePast", "maxDate", "minDate", "onChange", "readOnly", "shouldDisableYear", "disableHighlightToday", "onYearFocus", "hasFocus", "onFocusedViewChange", "yearsOrder", "yearsPerRow", "timezone", "gridLabelId", "slots", "slotProps"];
|
|
28
|
-
const useUtilityClasses =
|
|
29
|
-
const {
|
|
30
|
-
classes
|
|
31
|
-
} = ownerState;
|
|
28
|
+
const _excluded = ["autoFocus", "className", "classes", "value", "defaultValue", "referenceDate", "disabled", "disableFuture", "disablePast", "maxDate", "minDate", "onChange", "readOnly", "shouldDisableYear", "disableHighlightToday", "onYearFocus", "hasFocus", "onFocusedViewChange", "yearsOrder", "yearsPerRow", "timezone", "gridLabelId", "slots", "slotProps"];
|
|
29
|
+
const useUtilityClasses = classes => {
|
|
32
30
|
const slots = {
|
|
33
31
|
root: ['root']
|
|
34
32
|
};
|
|
@@ -81,6 +79,7 @@ const YearCalendar = exports.YearCalendar = /*#__PURE__*/React.forwardRef(functi
|
|
|
81
79
|
const {
|
|
82
80
|
autoFocus,
|
|
83
81
|
className,
|
|
82
|
+
classes: classesProp,
|
|
84
83
|
value: valueProp,
|
|
85
84
|
defaultValue,
|
|
86
85
|
referenceDate: referenceDateProp,
|
|
@@ -112,12 +111,15 @@ const YearCalendar = exports.YearCalendar = /*#__PURE__*/React.forwardRef(functi
|
|
|
112
111
|
timezone: timezoneProp,
|
|
113
112
|
value: valueProp,
|
|
114
113
|
defaultValue,
|
|
115
|
-
onChange
|
|
114
|
+
onChange,
|
|
116
115
|
valueManager: _valueManagers.singleItemValueManager
|
|
117
116
|
});
|
|
118
117
|
const now = (0, _useUtils.useNow)(timezone);
|
|
119
118
|
const isRtl = (0, _RtlProvider.useRtl)();
|
|
120
119
|
const utils = (0, _useUtils.useUtils)();
|
|
120
|
+
const {
|
|
121
|
+
ownerState
|
|
122
|
+
} = (0, _usePickerPrivateContext.usePickerPrivateContext)();
|
|
121
123
|
const referenceDate = React.useMemo(() => _valueManagers.singleItemValueManager.getInitialReferenceValue({
|
|
122
124
|
value,
|
|
123
125
|
utils,
|
|
@@ -127,8 +129,7 @@ const YearCalendar = exports.YearCalendar = /*#__PURE__*/React.forwardRef(functi
|
|
|
127
129
|
granularity: _getDefaultReferenceDate.SECTION_TYPE_GRANULARITY.year
|
|
128
130
|
}), [] // eslint-disable-line react-hooks/exhaustive-deps
|
|
129
131
|
);
|
|
130
|
-
const
|
|
131
|
-
const classes = useUtilityClasses(ownerState);
|
|
132
|
+
const classes = useUtilityClasses(classesProp);
|
|
132
133
|
const todayYear = React.useMemo(() => utils.getYear(now), [utils, now]);
|
|
133
134
|
const selectedYear = React.useMemo(() => {
|
|
134
135
|
if (value != null) {
|
|
@@ -291,7 +292,9 @@ process.env.NODE_ENV !== "production" ? YearCalendar.propTypes = {
|
|
|
291
292
|
*/
|
|
292
293
|
defaultValue: _propTypes.default.object,
|
|
293
294
|
/**
|
|
294
|
-
* If `true
|
|
295
|
+
* If `true`, the component is disabled.
|
|
296
|
+
* When disabled, the value cannot be changed and no interaction is possible.
|
|
297
|
+
* @default false
|
|
295
298
|
*/
|
|
296
299
|
disabled: _propTypes.default.bool,
|
|
297
300
|
/**
|
|
@@ -323,14 +326,15 @@ process.env.NODE_ENV !== "production" ? YearCalendar.propTypes = {
|
|
|
323
326
|
minDate: _propTypes.default.object,
|
|
324
327
|
/**
|
|
325
328
|
* Callback fired when the value changes.
|
|
326
|
-
* @
|
|
327
|
-
* @param {TDate} value The new value.
|
|
329
|
+
* @param {PickerValidDate} value The new value.
|
|
328
330
|
*/
|
|
329
331
|
onChange: _propTypes.default.func,
|
|
330
332
|
onFocusedViewChange: _propTypes.default.func,
|
|
331
333
|
onYearFocus: _propTypes.default.func,
|
|
332
334
|
/**
|
|
333
|
-
* If `true
|
|
335
|
+
* If `true`, the component is read-only.
|
|
336
|
+
* When read-only, the value cannot be changed but the user can interact with the interface.
|
|
337
|
+
* @default false
|
|
334
338
|
*/
|
|
335
339
|
readOnly: _propTypes.default.bool,
|
|
336
340
|
/**
|
|
@@ -340,8 +344,7 @@ process.env.NODE_ENV !== "production" ? YearCalendar.propTypes = {
|
|
|
340
344
|
referenceDate: _propTypes.default.object,
|
|
341
345
|
/**
|
|
342
346
|
* Disable specific year.
|
|
343
|
-
* @
|
|
344
|
-
* @param {TDate} year The year to test.
|
|
347
|
+
* @param {PickerValidDate} year The year to test.
|
|
345
348
|
* @returns {boolean} If `true`, the year will be disabled.
|
|
346
349
|
*/
|
|
347
350
|
shouldDisableYear: _propTypes.default.func,
|
package/node/hooks/index.js
CHANGED
|
@@ -15,16 +15,16 @@ Object.defineProperty(exports, "useParsedFormat", {
|
|
|
15
15
|
return _useParsedFormat.useParsedFormat;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
-
Object.defineProperty(exports, "
|
|
18
|
+
Object.defineProperty(exports, "usePickerContext", {
|
|
19
19
|
enumerable: true,
|
|
20
20
|
get: function () {
|
|
21
|
-
return
|
|
21
|
+
return _usePickerContext.usePickerContext;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
Object.defineProperty(exports, "
|
|
24
|
+
Object.defineProperty(exports, "usePickerTranslations", {
|
|
25
25
|
enumerable: true,
|
|
26
26
|
get: function () {
|
|
27
|
-
return
|
|
27
|
+
return _usePickerTranslations.usePickerTranslations;
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
30
|
Object.defineProperty(exports, "useSplitFieldProps", {
|
|
@@ -34,7 +34,7 @@ Object.defineProperty(exports, "useSplitFieldProps", {
|
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
36
|
var _useClearableField = require("./useClearableField");
|
|
37
|
-
var
|
|
37
|
+
var _usePickerTranslations = require("./usePickerTranslations");
|
|
38
38
|
var _useSplitFieldProps = require("./useSplitFieldProps");
|
|
39
39
|
var _useParsedFormat = require("./useParsedFormat");
|
|
40
|
-
var
|
|
40
|
+
var _usePickerContext = require("./usePickerContext");
|
|
@@ -14,12 +14,12 @@ var _useSlotProps2 = _interopRequireDefault(require("@mui/utils/useSlotProps"));
|
|
|
14
14
|
var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
|
|
15
15
|
var _InputAdornment = _interopRequireDefault(require("@mui/material/InputAdornment"));
|
|
16
16
|
var _icons = require("../icons");
|
|
17
|
-
var
|
|
17
|
+
var _usePickerTranslations = require("./usePickerTranslations");
|
|
18
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
19
|
const _excluded = ["clearable", "onClear", "InputProps", "sx", "slots", "slotProps"],
|
|
20
20
|
_excluded2 = ["ownerState"];
|
|
21
21
|
const useClearableField = props => {
|
|
22
|
-
const translations = (0,
|
|
22
|
+
const translations = (0, _usePickerTranslations.usePickerTranslations)();
|
|
23
23
|
const {
|
|
24
24
|
clearable,
|
|
25
25
|
onClear,
|
|
@@ -37,7 +37,8 @@ const useClearableField = props => {
|
|
|
37
37
|
ownerState: {},
|
|
38
38
|
className: 'clearButton',
|
|
39
39
|
additionalProps: {
|
|
40
|
-
title: translations.fieldClearLabel
|
|
40
|
+
title: translations.fieldClearLabel,
|
|
41
|
+
tabIndex: -1
|
|
41
42
|
}
|
|
42
43
|
}),
|
|
43
44
|
iconButtonProps = (0, _objectWithoutPropertiesLoose2.default)(_useSlotProps, _excluded2);
|
|
@@ -11,7 +11,7 @@ var _RtlProvider = require("@mui/system/RtlProvider");
|
|
|
11
11
|
var _useUtils = require("../internals/hooks/useUtils");
|
|
12
12
|
var _buildSectionsFromFormat = require("../internals/hooks/useField/buildSectionsFromFormat");
|
|
13
13
|
var _useField = require("../internals/hooks/useField/useField.utils");
|
|
14
|
-
var
|
|
14
|
+
var _usePickerTranslations = require("./usePickerTranslations");
|
|
15
15
|
/**
|
|
16
16
|
* Returns the parsed format to be rendered in the field when there is no value or in other parts of the Picker.
|
|
17
17
|
* This format is localized (e.g: `AAAA` for the year with the French locale) and cannot be parsed by your date library.
|
|
@@ -29,7 +29,7 @@ const useParsedFormat = parameters => {
|
|
|
29
29
|
} = parameters;
|
|
30
30
|
const utils = (0, _useUtils.useUtils)();
|
|
31
31
|
const isRtl = (0, _RtlProvider.useRtl)();
|
|
32
|
-
const translations = (0,
|
|
32
|
+
const translations = (0, _usePickerTranslations.usePickerTranslations)();
|
|
33
33
|
const localizedDigits = React.useMemo(() => (0, _useField.getLocalizedDigits)(utils), [utils]);
|
|
34
34
|
return React.useMemo(() => {
|
|
35
35
|
const sections = (0, _buildSectionsFromFormat.buildSectionsFromFormat)({
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.usePickerContext = void 0;
|
|
9
|
+
var React = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _PickerProvider = require("../internals/components/PickerProvider");
|
|
11
|
+
/**
|
|
12
|
+
* Returns the context passed by the picker that wraps the current component.
|
|
13
|
+
*/
|
|
14
|
+
const usePickerContext = () => {
|
|
15
|
+
const value = React.useContext(_PickerProvider.PickerContext);
|
|
16
|
+
if (value == null) {
|
|
17
|
+
throw new Error(['MUI X: The `usePickerContext` can only be called in fields that are used as a slot of a picker component'].join('\n'));
|
|
18
|
+
}
|
|
19
|
+
return value;
|
|
20
|
+
};
|
|
21
|
+
exports.usePickerContext = usePickerContext;
|