@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
package/modern/locales/trTR.js
CHANGED
|
@@ -32,7 +32,7 @@ const trTRPickers = {
|
|
|
32
32
|
timePickerToolbarTitle: 'Saat seç',
|
|
33
33
|
dateRangePickerToolbarTitle: 'Tarih aralığı seçin',
|
|
34
34
|
// Clock labels
|
|
35
|
-
clockLabelText: (view,
|
|
35
|
+
clockLabelText: (view, formattedTime) => `${timeViews[view]} seç. ${!formattedTime ? 'Zaman seçilmedi' : `Seçilen zaman: ${formattedTime}`}`,
|
|
36
36
|
hoursClockNumberText: hours => `${hours} saat`,
|
|
37
37
|
minutesClockNumberText: minutes => `${minutes} dakika`,
|
|
38
38
|
secondsClockNumberText: seconds => `${seconds} saniye`,
|
|
@@ -44,8 +44,8 @@ const trTRPickers = {
|
|
|
44
44
|
calendarWeekNumberAriaLabelText: weekNumber => `Hafta ${weekNumber}`,
|
|
45
45
|
calendarWeekNumberText: weekNumber => `${weekNumber}`,
|
|
46
46
|
// Open picker labels
|
|
47
|
-
openDatePickerDialogue:
|
|
48
|
-
openTimePickerDialogue:
|
|
47
|
+
openDatePickerDialogue: formattedDate => formattedDate ? `Tarih seçin, seçilen tarih: ${formattedDate}` : 'Tarih seç',
|
|
48
|
+
openTimePickerDialogue: formattedTime => formattedTime ? `Saat seçin, seçilen saat: ${formattedTime}` : 'Saat seç',
|
|
49
49
|
// fieldClearLabel: 'Clear',
|
|
50
50
|
|
|
51
51
|
// Table labels
|
package/modern/locales/ukUA.js
CHANGED
|
@@ -31,7 +31,7 @@ const ukUAPickers = {
|
|
|
31
31
|
timePickerToolbarTitle: 'Вибрати час',
|
|
32
32
|
dateRangePickerToolbarTitle: 'Вибрати календарний період',
|
|
33
33
|
// Clock labels
|
|
34
|
-
clockLabelText: (view,
|
|
34
|
+
clockLabelText: (view, formattedTime) => `Вибрати ${timeViews[view]}. ${!formattedTime ? 'Час не вибраний' : `Вибрано час ${formattedTime}`}`,
|
|
35
35
|
hoursClockNumberText: hours => `${hours} годин`,
|
|
36
36
|
minutesClockNumberText: minutes => `${minutes} хвилин`,
|
|
37
37
|
secondsClockNumberText: seconds => `${seconds} секунд`,
|
|
@@ -43,8 +43,8 @@ const ukUAPickers = {
|
|
|
43
43
|
calendarWeekNumberAriaLabelText: weekNumber => `Тиждень ${weekNumber}`,
|
|
44
44
|
calendarWeekNumberText: weekNumber => `${weekNumber}`,
|
|
45
45
|
// Open picker labels
|
|
46
|
-
openDatePickerDialogue:
|
|
47
|
-
openTimePickerDialogue:
|
|
46
|
+
openDatePickerDialogue: formattedDate => formattedDate ? `Оберіть дату, обрана дата ${formattedDate}` : 'Оберіть дату',
|
|
47
|
+
openTimePickerDialogue: formattedTime => formattedTime ? `Оберіть час, обраний час ${formattedTime}` : 'Оберіть час',
|
|
48
48
|
fieldClearLabel: 'Очистити дані',
|
|
49
49
|
// Table labels
|
|
50
50
|
timeTableLabel: 'оберіть час',
|
package/modern/locales/urPK.js
CHANGED
|
@@ -32,7 +32,7 @@ const urPKPickers = {
|
|
|
32
32
|
timePickerToolbarTitle: 'وقت منتخب کریں',
|
|
33
33
|
dateRangePickerToolbarTitle: 'تاریخوں کی رینج منتخب کریں',
|
|
34
34
|
// Clock labels
|
|
35
|
-
clockLabelText: (view,
|
|
35
|
+
clockLabelText: (view, formattedTime) => `${timeViews[view]} منتخب کریں ${!formattedTime ? 'کوئی وقت منتخب نہیں' : `منتخب وقت ہے ${formattedTime}`}`,
|
|
36
36
|
hoursClockNumberText: hours => `${hours} گھنٹے`,
|
|
37
37
|
minutesClockNumberText: minutes => `${minutes} منٹ`,
|
|
38
38
|
secondsClockNumberText: seconds => `${seconds} سیکنڈ`,
|
|
@@ -44,8 +44,8 @@ const urPKPickers = {
|
|
|
44
44
|
calendarWeekNumberAriaLabelText: weekNumber => `ہفتہ ${weekNumber}`,
|
|
45
45
|
calendarWeekNumberText: weekNumber => `${weekNumber}`,
|
|
46
46
|
// Open picker labels
|
|
47
|
-
openDatePickerDialogue:
|
|
48
|
-
openTimePickerDialogue:
|
|
47
|
+
openDatePickerDialogue: formattedDate => formattedDate ? `تاریخ منتخب کریں، منتخب شدہ تاریخ ہے ${formattedDate}` : 'تاریخ منتخب کریں',
|
|
48
|
+
openTimePickerDialogue: formattedTime => formattedTime ? `وقت منتخب کریں، منتخب شدہ وقت ہے ${formattedTime}` : 'وقت منتخب کریں',
|
|
49
49
|
// fieldClearLabel: 'Clear',
|
|
50
50
|
|
|
51
51
|
// Table labels
|
|
@@ -20,6 +20,6 @@ export const buildGetOpenDialogAriaText = params => {
|
|
|
20
20
|
return value => {
|
|
21
21
|
const formattedValue = value !== null && utils.isValid(value) ? utils.format(value, formatKey) : null;
|
|
22
22
|
const translation = propsTranslation ?? contextTranslation;
|
|
23
|
-
return translation(
|
|
23
|
+
return translation(formattedValue);
|
|
24
24
|
};
|
|
25
25
|
};
|
package/modern/locales/viVN.js
CHANGED
|
@@ -31,7 +31,7 @@ const viVNPickers = {
|
|
|
31
31
|
timePickerToolbarTitle: 'Chọn giờ',
|
|
32
32
|
dateRangePickerToolbarTitle: 'Chọn khoảng ngày',
|
|
33
33
|
// Clock labels
|
|
34
|
-
clockLabelText: (view,
|
|
34
|
+
clockLabelText: (view, formattedTime) => `Chọn ${views[view]}. ${!formattedTime ? 'Không có giờ được chọn' : `Giờ được chọn là ${formattedTime}`}`,
|
|
35
35
|
hoursClockNumberText: hours => `${hours} giờ`,
|
|
36
36
|
minutesClockNumberText: minutes => `${minutes} phút`,
|
|
37
37
|
secondsClockNumberText: seconds => `${seconds} giây`,
|
|
@@ -43,8 +43,8 @@ const viVNPickers = {
|
|
|
43
43
|
calendarWeekNumberAriaLabelText: weekNumber => `Tuần ${weekNumber}`,
|
|
44
44
|
calendarWeekNumberText: weekNumber => `${weekNumber}`,
|
|
45
45
|
// Open picker labels
|
|
46
|
-
openDatePickerDialogue:
|
|
47
|
-
openTimePickerDialogue:
|
|
46
|
+
openDatePickerDialogue: formattedDate => formattedDate ? `Chọn ngày, ngày đã chọn là ${formattedDate}` : 'Chọn ngày',
|
|
47
|
+
openTimePickerDialogue: formattedTime => formattedTime ? `Chọn giờ, giờ đã chọn là ${formattedTime}` : 'Chọn giờ',
|
|
48
48
|
fieldClearLabel: 'Xóa giá trị',
|
|
49
49
|
// Table labels
|
|
50
50
|
timeTableLabel: 'chọn giờ',
|
package/modern/locales/zhCN.js
CHANGED
|
@@ -31,7 +31,7 @@ const zhCNPickers = {
|
|
|
31
31
|
timePickerToolbarTitle: '选择时间',
|
|
32
32
|
dateRangePickerToolbarTitle: '选择时间范围',
|
|
33
33
|
// Clock labels
|
|
34
|
-
clockLabelText: (view,
|
|
34
|
+
clockLabelText: (view, formattedTime) => `选择 ${views[view]}. ${!formattedTime ? '未选择时间' : `已选择${formattedTime}`}`,
|
|
35
35
|
hoursClockNumberText: hours => `${hours}小时`,
|
|
36
36
|
minutesClockNumberText: minutes => `${minutes}分钟`,
|
|
37
37
|
secondsClockNumberText: seconds => `${seconds}秒`,
|
|
@@ -43,8 +43,8 @@ const zhCNPickers = {
|
|
|
43
43
|
calendarWeekNumberAriaLabelText: weekNumber => `第${weekNumber}周`,
|
|
44
44
|
calendarWeekNumberText: weekNumber => `${weekNumber}`,
|
|
45
45
|
// Open picker labels
|
|
46
|
-
openDatePickerDialogue:
|
|
47
|
-
openTimePickerDialogue:
|
|
46
|
+
openDatePickerDialogue: formattedDate => formattedDate ? `选择日期,已选择${formattedDate}` : '选择日期',
|
|
47
|
+
openTimePickerDialogue: formattedTime => formattedTime ? `选择时间,已选择${formattedTime}` : '选择时间',
|
|
48
48
|
fieldClearLabel: '清除',
|
|
49
49
|
// Table labels
|
|
50
50
|
timeTableLabel: '选择时间',
|
package/modern/locales/zhHK.js
CHANGED
|
@@ -31,7 +31,7 @@ const zhHKPickers = {
|
|
|
31
31
|
timePickerToolbarTitle: '選擇時間',
|
|
32
32
|
dateRangePickerToolbarTitle: '選擇時間範圍',
|
|
33
33
|
// Clock labels
|
|
34
|
-
clockLabelText: (view,
|
|
34
|
+
clockLabelText: (view, formattedTime) => `選擇 ${views[view]}. ${!formattedTime ? '未選擇時間' : `已選擇${formattedTime}`}`,
|
|
35
35
|
hoursClockNumberText: hours => `${hours}小時`,
|
|
36
36
|
minutesClockNumberText: minutes => `${minutes}分鐘`,
|
|
37
37
|
secondsClockNumberText: seconds => `${seconds}秒`,
|
|
@@ -43,8 +43,8 @@ const zhHKPickers = {
|
|
|
43
43
|
calendarWeekNumberAriaLabelText: weekNumber => `第${weekNumber}週`,
|
|
44
44
|
calendarWeekNumberText: weekNumber => `${weekNumber}`,
|
|
45
45
|
// Open picker labels
|
|
46
|
-
openDatePickerDialogue:
|
|
47
|
-
openTimePickerDialogue:
|
|
46
|
+
openDatePickerDialogue: formattedDate => formattedDate ? `選擇日期,已選擇${formattedDate}` : '選擇日期',
|
|
47
|
+
openTimePickerDialogue: formattedTime => formattedTime ? `選擇時間,已選擇${formattedTime}` : '選擇時間',
|
|
48
48
|
fieldClearLabel: '清除',
|
|
49
49
|
// Table labels
|
|
50
50
|
timeTableLabel: '選擇時間',
|
|
@@ -5,13 +5,12 @@ import useEventCallback from '@mui/utils/useEventCallback';
|
|
|
5
5
|
import { useLocalizationContext } from "../internals/hooks/useUtils.js";
|
|
6
6
|
/**
|
|
7
7
|
* Utility hook to check if a given value is valid based on the provided validation props.
|
|
8
|
-
* @template TDate
|
|
9
8
|
* @template TValue The value type. It will be either the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
|
|
10
9
|
* @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
|
|
11
|
-
* @param {UseValidationOptions<TValue,
|
|
10
|
+
* @param {UseValidationOptions<TValue, TError, TValidationProps>} options The options to configure the hook.
|
|
12
11
|
* @param {TValue} options.value The value to validate.
|
|
13
12
|
* @param {PickersTimezone} options.timezone The timezone to use for the validation.
|
|
14
|
-
* @param {Validator<TValue,
|
|
13
|
+
* @param {Validator<TValue, TError, TValidationProps>} options.validator The validator function to use.
|
|
15
14
|
* @param {TValidationProps} options.props The validation props, they differ depending on the component.
|
|
16
15
|
* @param {(error: TError, value: TValue) => void} options.onError Callback fired when the error associated with the current value changes.
|
|
17
16
|
*/
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { applyDefaultDate } from "../internals/utils/date-utils.js";
|
|
2
2
|
import { singleItemValueManager } from "../internals/utils/valueManagers.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Validation props used by the Date Picker, Date Field and Date Calendar components.
|
|
6
|
+
*/
|
|
7
|
+
|
|
3
8
|
export const validateDate = ({
|
|
4
9
|
props,
|
|
5
10
|
value,
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { validateDate } from "./validateDate.js";
|
|
2
2
|
import { validateTime } from "./validateTime.js";
|
|
3
3
|
import { singleItemValueManager } from "../internals/utils/valueManagers.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Validation props used by the Date Time Picker and Date Time Field components.
|
|
7
|
+
*/
|
|
8
|
+
|
|
4
9
|
export const validateDateTime = ({
|
|
5
10
|
adapter,
|
|
6
11
|
value,
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { createIsAfterIgnoreDatePart } from "../internals/utils/time-utils.js";
|
|
2
2
|
import { singleItemValueManager } from "../internals/utils/valueManagers.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Validation props used by the Time Picker, Time Field and Clock components.
|
|
6
|
+
*/
|
|
7
|
+
|
|
3
8
|
export const validateTime = ({
|
|
4
9
|
adapter,
|
|
5
10
|
value,
|
|
@@ -30,12 +30,10 @@ var _dateCalendarClasses = require("./dateCalendarClasses");
|
|
|
30
30
|
var _useValueWithTimezone = require("../internals/hooks/useValueWithTimezone");
|
|
31
31
|
var _valueManagers = require("../internals/utils/valueManagers");
|
|
32
32
|
var _dimensions = require("../internals/constants/dimensions");
|
|
33
|
+
var _usePickerPrivateContext = require("../internals/hooks/usePickerPrivateContext");
|
|
33
34
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
34
|
-
const _excluded = ["autoFocus", "onViewChange", "value", "defaultValue", "referenceDate", "disableFuture", "disablePast", "onChange", "onYearChange", "onMonthChange", "reduceAnimations", "shouldDisableDate", "shouldDisableMonth", "shouldDisableYear", "view", "views", "openTo", "className", "disabled", "readOnly", "minDate", "maxDate", "disableHighlightToday", "focusedView", "onFocusedViewChange", "showDaysOutsideCurrentMonth", "fixedWeekNumber", "dayOfWeekFormatter", "slots", "slotProps", "loading", "renderLoading", "displayWeekNumber", "yearsOrder", "yearsPerRow", "monthsPerRow", "timezone"];
|
|
35
|
-
const useUtilityClasses =
|
|
36
|
-
const {
|
|
37
|
-
classes
|
|
38
|
-
} = ownerState;
|
|
35
|
+
const _excluded = ["autoFocus", "onViewChange", "value", "defaultValue", "referenceDate", "disableFuture", "disablePast", "onChange", "onYearChange", "onMonthChange", "reduceAnimations", "shouldDisableDate", "shouldDisableMonth", "shouldDisableYear", "view", "views", "openTo", "className", "classes", "disabled", "readOnly", "minDate", "maxDate", "disableHighlightToday", "focusedView", "onFocusedViewChange", "showDaysOutsideCurrentMonth", "fixedWeekNumber", "dayOfWeekFormatter", "slots", "slotProps", "loading", "renderLoading", "displayWeekNumber", "yearsOrder", "yearsPerRow", "monthsPerRow", "timezone"];
|
|
36
|
+
const useUtilityClasses = classes => {
|
|
39
37
|
const slots = {
|
|
40
38
|
root: ['root'],
|
|
41
39
|
viewTransitionContainer: ['viewTransitionContainer']
|
|
@@ -91,6 +89,9 @@ const DateCalendarViewTransitionContainer = (0, _styles.styled)(_PickersFadeTran
|
|
|
91
89
|
*/
|
|
92
90
|
const DateCalendar = exports.DateCalendar = /*#__PURE__*/React.forwardRef(function DateCalendar(inProps, ref) {
|
|
93
91
|
const utils = (0, _useUtils.useUtils)();
|
|
92
|
+
const {
|
|
93
|
+
ownerState
|
|
94
|
+
} = (0, _usePickerPrivateContext.usePickerPrivateContext)();
|
|
94
95
|
const id = (0, _utils.unstable_useId)();
|
|
95
96
|
const props = useDateCalendarDefaultizedProps(inProps, 'MuiDateCalendar');
|
|
96
97
|
const {
|
|
@@ -112,6 +113,7 @@ const DateCalendar = exports.DateCalendar = /*#__PURE__*/React.forwardRef(functi
|
|
|
112
113
|
views,
|
|
113
114
|
openTo,
|
|
114
115
|
className,
|
|
116
|
+
classes: classesProp,
|
|
115
117
|
disabled,
|
|
116
118
|
readOnly,
|
|
117
119
|
minDate,
|
|
@@ -210,7 +212,7 @@ const DateCalendar = exports.DateCalendar = /*#__PURE__*/React.forwardRef(functi
|
|
|
210
212
|
timezone,
|
|
211
213
|
labelId: gridLabelId
|
|
212
214
|
},
|
|
213
|
-
ownerState
|
|
215
|
+
ownerState
|
|
214
216
|
});
|
|
215
217
|
const handleDateMonthChange = (0, _utils.unstable_useEventCallback)(newDate => {
|
|
216
218
|
const startOfMonth = utils.startOfMonth(newDate);
|
|
@@ -269,8 +271,7 @@ const DateCalendar = exports.DateCalendar = /*#__PURE__*/React.forwardRef(functi
|
|
|
269
271
|
}
|
|
270
272
|
}, [value]); // eslint-disable-line
|
|
271
273
|
|
|
272
|
-
const
|
|
273
|
-
const classes = useUtilityClasses(ownerState);
|
|
274
|
+
const classes = useUtilityClasses(classesProp);
|
|
274
275
|
const baseDateValidationProps = {
|
|
275
276
|
disablePast,
|
|
276
277
|
disableFuture,
|
|
@@ -372,9 +373,9 @@ process.env.NODE_ENV !== "production" ? DateCalendar.propTypes = {
|
|
|
372
373
|
className: _propTypes.default.string,
|
|
373
374
|
/**
|
|
374
375
|
* Formats the day of week displayed in the calendar header.
|
|
375
|
-
* @param {
|
|
376
|
+
* @param {PickerValidDate} date The date of the day of week provided by the adapter.
|
|
376
377
|
* @returns {string} The name to display.
|
|
377
|
-
* @default (date:
|
|
378
|
+
* @default (date: PickerValidDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
|
|
378
379
|
*/
|
|
379
380
|
dayOfWeekFormatter: _propTypes.default.func,
|
|
380
381
|
/**
|
|
@@ -383,7 +384,8 @@ process.env.NODE_ENV !== "production" ? DateCalendar.propTypes = {
|
|
|
383
384
|
*/
|
|
384
385
|
defaultValue: _propTypes.default.object,
|
|
385
386
|
/**
|
|
386
|
-
* If `true`, the
|
|
387
|
+
* If `true`, the component is disabled.
|
|
388
|
+
* When disabled, the value cannot be changed and no interaction is possible.
|
|
387
389
|
* @default false
|
|
388
390
|
*/
|
|
389
391
|
disabled: _propTypes.default.bool,
|
|
@@ -454,8 +456,7 @@ process.env.NODE_ENV !== "production" ? DateCalendar.propTypes = {
|
|
|
454
456
|
onFocusedViewChange: _propTypes.default.func,
|
|
455
457
|
/**
|
|
456
458
|
* Callback fired on month change.
|
|
457
|
-
* @
|
|
458
|
-
* @param {TDate} month The new month.
|
|
459
|
+
* @param {PickerValidDate} month The new month.
|
|
459
460
|
*/
|
|
460
461
|
onMonthChange: _propTypes.default.func,
|
|
461
462
|
/**
|
|
@@ -466,8 +467,7 @@ process.env.NODE_ENV !== "production" ? DateCalendar.propTypes = {
|
|
|
466
467
|
onViewChange: _propTypes.default.func,
|
|
467
468
|
/**
|
|
468
469
|
* Callback fired on year change.
|
|
469
|
-
* @
|
|
470
|
-
* @param {TDate} year The new year.
|
|
470
|
+
* @param {PickerValidDate} year The new year.
|
|
471
471
|
*/
|
|
472
472
|
onYearChange: _propTypes.default.func,
|
|
473
473
|
/**
|
|
@@ -477,7 +477,8 @@ process.env.NODE_ENV !== "production" ? DateCalendar.propTypes = {
|
|
|
477
477
|
*/
|
|
478
478
|
openTo: _propTypes.default.oneOf(['day', 'month', 'year']),
|
|
479
479
|
/**
|
|
480
|
-
*
|
|
480
|
+
* If `true`, the component is read-only.
|
|
481
|
+
* When read-only, the value cannot be changed but the user can interact with the interface.
|
|
481
482
|
* @default false
|
|
482
483
|
*/
|
|
483
484
|
readOnly: _propTypes.default.bool,
|
|
@@ -502,22 +503,19 @@ process.env.NODE_ENV !== "production" ? DateCalendar.propTypes = {
|
|
|
502
503
|
*
|
|
503
504
|
* 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.
|
|
504
505
|
*
|
|
505
|
-
* @
|
|
506
|
-
* @param {TDate} day The date to test.
|
|
506
|
+
* @param {PickerValidDate} day The date to test.
|
|
507
507
|
* @returns {boolean} If `true` the date will be disabled.
|
|
508
508
|
*/
|
|
509
509
|
shouldDisableDate: _propTypes.default.func,
|
|
510
510
|
/**
|
|
511
511
|
* Disable specific month.
|
|
512
|
-
* @
|
|
513
|
-
* @param {TDate} month The month to test.
|
|
512
|
+
* @param {PickerValidDate} month The month to test.
|
|
514
513
|
* @returns {boolean} If `true`, the month will be disabled.
|
|
515
514
|
*/
|
|
516
515
|
shouldDisableMonth: _propTypes.default.func,
|
|
517
516
|
/**
|
|
518
517
|
* Disable specific year.
|
|
519
|
-
* @
|
|
520
|
-
* @param {TDate} year The year to test.
|
|
518
|
+
* @param {PickerValidDate} year The year to test.
|
|
521
519
|
* @returns {boolean} If `true`, the year will be disabled.
|
|
522
520
|
*/
|
|
523
521
|
shouldDisableYear: _propTypes.default.func,
|
|
@@ -17,20 +17,18 @@ var _styles = require("@mui/material/styles");
|
|
|
17
17
|
var _utils = require("@mui/utils");
|
|
18
18
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
19
19
|
var _PickersDay = require("../PickersDay/PickersDay");
|
|
20
|
-
var
|
|
20
|
+
var _usePickerTranslations = require("../hooks/usePickerTranslations");
|
|
21
21
|
var _useUtils = require("../internals/hooks/useUtils");
|
|
22
22
|
var _dimensions = require("../internals/constants/dimensions");
|
|
23
23
|
var _PickersSlideTransition = require("./PickersSlideTransition");
|
|
24
24
|
var _useIsDateDisabled = require("./useIsDateDisabled");
|
|
25
25
|
var _dateUtils = require("../internals/utils/date-utils");
|
|
26
26
|
var _dayCalendarClasses = require("./dayCalendarClasses");
|
|
27
|
+
var _usePickerPrivateContext = require("../internals/hooks/usePickerPrivateContext");
|
|
27
28
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
28
29
|
const _excluded = ["parentProps", "day", "focusableDay", "selectedDays", "isDateDisabled", "currentMonthNumber", "isViewFocused"],
|
|
29
30
|
_excluded2 = ["ownerState"];
|
|
30
|
-
const useUtilityClasses =
|
|
31
|
-
const {
|
|
32
|
-
classes
|
|
33
|
-
} = ownerState;
|
|
31
|
+
const useUtilityClasses = classes => {
|
|
34
32
|
const slots = {
|
|
35
33
|
root: ['root'],
|
|
36
34
|
header: ['header'],
|
|
@@ -163,9 +161,13 @@ function WrappedDay(_ref) {
|
|
|
163
161
|
} = parentProps;
|
|
164
162
|
const utils = (0, _useUtils.useUtils)();
|
|
165
163
|
const now = (0, _useUtils.useNow)(timezone);
|
|
164
|
+
const {
|
|
165
|
+
ownerState
|
|
166
|
+
} = (0, _usePickerPrivateContext.usePickerPrivateContext)();
|
|
166
167
|
const isFocusableDay = focusableDay !== null && utils.isSameDay(day, focusableDay);
|
|
167
168
|
const isSelected = selectedDays.some(selectedDay => utils.isSameDay(selectedDay, day));
|
|
168
169
|
const isToday = utils.isSameDay(day, now);
|
|
170
|
+
const isDisabled = React.useMemo(() => disabled || isDateDisabled(day), [disabled, isDateDisabled, day]);
|
|
169
171
|
const Day = slots?.day ?? _PickersDay.PickersDay;
|
|
170
172
|
// We don't want to pass to ownerState down, to avoid re-rendering all the day whenever a prop changes.
|
|
171
173
|
const _useSlotProps = (0, _useSlotProps2.default)({
|
|
@@ -179,13 +181,13 @@ function WrappedDay(_ref) {
|
|
|
179
181
|
// it is used in date range dragging logic by accessing `dataset.timestamp`
|
|
180
182
|
'data-timestamp': utils.toJsDate(day).valueOf()
|
|
181
183
|
}, other),
|
|
182
|
-
ownerState: (0, _extends2.default)({},
|
|
184
|
+
ownerState: (0, _extends2.default)({}, ownerState, {
|
|
183
185
|
day,
|
|
184
|
-
|
|
186
|
+
isDayDisabled: isDisabled,
|
|
187
|
+
isDaySelected: isSelected
|
|
185
188
|
})
|
|
186
189
|
}),
|
|
187
190
|
dayProps = (0, _objectWithoutPropertiesLoose2.default)(_useSlotProps, _excluded2);
|
|
188
|
-
const isDisabled = React.useMemo(() => disabled || isDateDisabled(day), [disabled, isDateDisabled, day]);
|
|
189
191
|
const outsideCurrentMonth = React.useMemo(() => utils.getMonth(day) !== currentMonthNumber, [utils, day, currentMonthNumber]);
|
|
190
192
|
const isFirstVisibleCell = React.useMemo(() => {
|
|
191
193
|
const startOfMonth = utils.startOfMonth(utils.setMonth(day, currentMonthNumber));
|
|
@@ -228,6 +230,7 @@ function DayCalendar(inProps) {
|
|
|
228
230
|
const {
|
|
229
231
|
onFocusedDayChange,
|
|
230
232
|
className,
|
|
233
|
+
classes: classesProp,
|
|
231
234
|
currentMonth,
|
|
232
235
|
selectedDays,
|
|
233
236
|
focusedDay,
|
|
@@ -258,7 +261,7 @@ function DayCalendar(inProps) {
|
|
|
258
261
|
timezone
|
|
259
262
|
} = props;
|
|
260
263
|
const now = (0, _useUtils.useNow)(timezone);
|
|
261
|
-
const classes = useUtilityClasses(
|
|
264
|
+
const classes = useUtilityClasses(classesProp);
|
|
262
265
|
const isRtl = (0, _RtlProvider.useRtl)();
|
|
263
266
|
const isDateDisabled = (0, _useIsDateDisabled.useIsDateDisabled)({
|
|
264
267
|
shouldDisableDate,
|
|
@@ -270,7 +273,7 @@ function DayCalendar(inProps) {
|
|
|
270
273
|
disableFuture,
|
|
271
274
|
timezone
|
|
272
275
|
});
|
|
273
|
-
const translations = (0,
|
|
276
|
+
const translations = (0, _usePickerTranslations.usePickerTranslations)();
|
|
274
277
|
const [internalHasFocus, setInternalHasFocus] = (0, _utils.unstable_useControlled)({
|
|
275
278
|
name: 'DayCalendar',
|
|
276
279
|
state: 'hasFocus',
|
|
@@ -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,6 +114,11 @@ process.env.NODE_ENV !== "production" ? DatePickerToolbar.propTypes = {
|
|
|
114
114
|
*/
|
|
115
115
|
classes: _propTypes.default.object,
|
|
116
116
|
className: _propTypes.default.string,
|
|
117
|
+
/**
|
|
118
|
+
* If `true`, the component is disabled.
|
|
119
|
+
* When disabled, the value cannot be changed and no interaction is possible.
|
|
120
|
+
* @default false
|
|
121
|
+
*/
|
|
117
122
|
disabled: _propTypes.default.bool,
|
|
118
123
|
/**
|
|
119
124
|
* If `true`, show the toolbar even in desktop mode.
|
|
@@ -128,6 +133,11 @@ process.env.NODE_ENV !== "production" ? DatePickerToolbar.propTypes = {
|
|
|
128
133
|
* @param {TView} view The view to open
|
|
129
134
|
*/
|
|
130
135
|
onViewChange: _propTypes.default.func.isRequired,
|
|
136
|
+
/**
|
|
137
|
+
* If `true`, the component is read-only.
|
|
138
|
+
* When read-only, the value cannot be changed but the user can interact with the interface.
|
|
139
|
+
* @default false
|
|
140
|
+
*/
|
|
131
141
|
readOnly: _propTypes.default.bool,
|
|
132
142
|
/**
|
|
133
143
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|