@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/DatePicker/DatePicker.js
CHANGED
|
@@ -65,9 +65,9 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
|
|
|
65
65
|
closeOnSelect: PropTypes.bool,
|
|
66
66
|
/**
|
|
67
67
|
* Formats the day of week displayed in the calendar header.
|
|
68
|
-
* @param {
|
|
68
|
+
* @param {PickerValidDate} date The date of the day of week provided by the adapter.
|
|
69
69
|
* @returns {string} The name to display.
|
|
70
|
-
* @default (date:
|
|
70
|
+
* @default (date: PickerValidDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
|
|
71
71
|
*/
|
|
72
72
|
dayOfWeekFormatter: PropTypes.func,
|
|
73
73
|
/**
|
|
@@ -82,7 +82,8 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
|
|
|
82
82
|
*/
|
|
83
83
|
desktopModeMediaQuery: PropTypes.string,
|
|
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.bool,
|
|
@@ -111,7 +112,7 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
|
|
|
111
112
|
*/
|
|
112
113
|
displayWeekNumber: PropTypes.bool,
|
|
113
114
|
/**
|
|
114
|
-
* @default
|
|
115
|
+
* @default true
|
|
115
116
|
*/
|
|
116
117
|
enableAccessibleFieldDOMStructure: PropTypes.any,
|
|
117
118
|
/**
|
|
@@ -201,8 +202,7 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
|
|
|
201
202
|
onError: PropTypes.func,
|
|
202
203
|
/**
|
|
203
204
|
* Callback fired on month change.
|
|
204
|
-
* @
|
|
205
|
-
* @param {TDate} month The new month.
|
|
205
|
+
* @param {PickerValidDate} month The new month.
|
|
206
206
|
*/
|
|
207
207
|
onMonthChange: PropTypes.func,
|
|
208
208
|
/**
|
|
@@ -223,8 +223,7 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
|
|
|
223
223
|
onViewChange: PropTypes.func,
|
|
224
224
|
/**
|
|
225
225
|
* Callback fired on year change.
|
|
226
|
-
* @
|
|
227
|
-
* @param {TDate} year The new year.
|
|
226
|
+
* @param {PickerValidDate} year The new year.
|
|
228
227
|
*/
|
|
229
228
|
onYearChange: PropTypes.func,
|
|
230
229
|
/**
|
|
@@ -242,6 +241,11 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
|
|
|
242
241
|
* Force rendering in particular orientation.
|
|
243
242
|
*/
|
|
244
243
|
orientation: PropTypes.oneOf(['landscape', 'portrait']),
|
|
244
|
+
/**
|
|
245
|
+
* If `true`, the component is read-only.
|
|
246
|
+
* When read-only, the value cannot be changed but the user can interact with the interface.
|
|
247
|
+
* @default false
|
|
248
|
+
*/
|
|
245
249
|
readOnly: PropTypes.bool,
|
|
246
250
|
/**
|
|
247
251
|
* If `true`, disable heavy animations.
|
|
@@ -274,22 +278,19 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
|
|
|
274
278
|
*
|
|
275
279
|
* 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.
|
|
276
280
|
*
|
|
277
|
-
* @
|
|
278
|
-
* @param {TDate} day The date to test.
|
|
281
|
+
* @param {PickerValidDate} day The date to test.
|
|
279
282
|
* @returns {boolean} If `true` the date will be disabled.
|
|
280
283
|
*/
|
|
281
284
|
shouldDisableDate: PropTypes.func,
|
|
282
285
|
/**
|
|
283
286
|
* Disable specific month.
|
|
284
|
-
* @
|
|
285
|
-
* @param {TDate} month The month to test.
|
|
287
|
+
* @param {PickerValidDate} month The month to test.
|
|
286
288
|
* @returns {boolean} If `true`, the month will be disabled.
|
|
287
289
|
*/
|
|
288
290
|
shouldDisableMonth: PropTypes.func,
|
|
289
291
|
/**
|
|
290
292
|
* Disable specific year.
|
|
291
|
-
* @
|
|
292
|
-
* @param {TDate} year The year to test.
|
|
293
|
+
* @param {PickerValidDate} year The year to test.
|
|
293
294
|
* @returns {boolean} If `true`, the year will be disabled.
|
|
294
295
|
*/
|
|
295
296
|
shouldDisableYear: PropTypes.func,
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { UseDateFieldProps } from '../DateField';
|
|
2
1
|
import { DesktopDatePickerProps, DesktopDatePickerSlots, DesktopDatePickerSlotProps } from '../DesktopDatePicker';
|
|
3
|
-
import {
|
|
4
|
-
import { BaseDateValidationProps } from '../internals/models/validation';
|
|
2
|
+
import { BaseSingleInputFieldProps } from '../internals/models';
|
|
5
3
|
import { MobileDatePickerProps, MobileDatePickerSlots, MobileDatePickerSlotProps } from '../MobileDatePicker';
|
|
6
|
-
import {
|
|
7
|
-
|
|
4
|
+
import { DateValidationError, FieldSection, PickerValidDate } from '../models';
|
|
5
|
+
import { ValidateDateProps } from '../validation/validateDate';
|
|
6
|
+
export interface DatePickerSlots extends DesktopDatePickerSlots, MobileDatePickerSlots {
|
|
8
7
|
}
|
|
9
|
-
export interface DatePickerSlotProps<
|
|
8
|
+
export interface DatePickerSlotProps<TEnableAccessibleFieldDOMStructure extends boolean> extends DesktopDatePickerSlotProps<TEnableAccessibleFieldDOMStructure>, MobileDatePickerSlotProps<TEnableAccessibleFieldDOMStructure> {
|
|
10
9
|
}
|
|
11
|
-
export interface DatePickerProps<
|
|
10
|
+
export interface DatePickerProps<TEnableAccessibleFieldDOMStructure extends boolean = true> extends DesktopDatePickerProps<TEnableAccessibleFieldDOMStructure>, MobileDatePickerProps<TEnableAccessibleFieldDOMStructure> {
|
|
12
11
|
/**
|
|
13
12
|
* CSS media query when `Mobile` mode will be changed to `Desktop`.
|
|
14
13
|
* @default '@media (pointer: fine)'
|
|
@@ -19,12 +18,12 @@ export interface DatePickerProps<TDate extends PickerValidDate, TEnableAccessibl
|
|
|
19
18
|
* Overridable component slots.
|
|
20
19
|
* @default {}
|
|
21
20
|
*/
|
|
22
|
-
slots?: DatePickerSlots
|
|
21
|
+
slots?: DatePickerSlots;
|
|
23
22
|
/**
|
|
24
23
|
* The props used for each component slot.
|
|
25
24
|
* @default {}
|
|
26
25
|
*/
|
|
27
|
-
slotProps?: DatePickerSlotProps<
|
|
26
|
+
slotProps?: DatePickerSlotProps<TEnableAccessibleFieldDOMStructure>;
|
|
28
27
|
/**
|
|
29
28
|
* Years rendered per row.
|
|
30
29
|
* @default 4 on desktop, 3 on mobile
|
|
@@ -32,6 +31,6 @@ export interface DatePickerProps<TDate extends PickerValidDate, TEnableAccessibl
|
|
|
32
31
|
yearsPerRow?: 3 | 4;
|
|
33
32
|
}
|
|
34
33
|
/**
|
|
35
|
-
* Props the field can receive when used inside a
|
|
34
|
+
* Props the field can receive when used inside a date picker (<DatePicker />, <DesktopDatePicker /> or <MobileDatePicker /> component).
|
|
36
35
|
*/
|
|
37
|
-
export type DatePickerFieldProps<
|
|
36
|
+
export type DatePickerFieldProps<TEnableAccessibleFieldDOMStructure extends boolean = true> = ValidateDateProps & BaseSingleInputFieldProps<PickerValidDate | null, FieldSection, TEnableAccessibleFieldDOMStructure, DateValidationError>;
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { BaseToolbarProps, ExportedBaseToolbarProps } from '../internals/models/props/toolbar';
|
|
3
3
|
import { DateView, PickerValidDate } from '../models';
|
|
4
4
|
import { DatePickerToolbarClasses } from './datePickerToolbarClasses';
|
|
5
|
-
export interface DatePickerToolbarProps
|
|
5
|
+
export interface DatePickerToolbarProps extends BaseToolbarProps<PickerValidDate | null, DateView>, ExportedDatePickerToolbarProps {
|
|
6
6
|
}
|
|
7
7
|
export interface ExportedDatePickerToolbarProps extends ExportedBaseToolbarProps {
|
|
8
8
|
/**
|
|
@@ -10,7 +10,7 @@ export interface ExportedDatePickerToolbarProps extends ExportedBaseToolbarProps
|
|
|
10
10
|
*/
|
|
11
11
|
classes?: Partial<DatePickerToolbarClasses>;
|
|
12
12
|
}
|
|
13
|
-
type DatePickerToolbarComponent = (
|
|
13
|
+
type DatePickerToolbarComponent = ((props: DatePickerToolbarProps & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
|
|
14
14
|
propTypes?: any;
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
@@ -10,7 +10,7 @@ import Typography from '@mui/material/Typography';
|
|
|
10
10
|
import { styled, useThemeProps } from '@mui/material/styles';
|
|
11
11
|
import composeClasses from '@mui/utils/composeClasses';
|
|
12
12
|
import { PickersToolbar } from "../internals/components/PickersToolbar.js";
|
|
13
|
-
import {
|
|
13
|
+
import { usePickerTranslations } from "../hooks/usePickerTranslations.js";
|
|
14
14
|
import { useUtils } from "../internals/hooks/useUtils.js";
|
|
15
15
|
import { getDatePickerToolbarUtilityClass } from "./datePickerToolbarClasses.js";
|
|
16
16
|
import { resolveDateFormat } from "../internals/utils/date-utils.js";
|
|
@@ -69,7 +69,7 @@ export const DatePickerToolbar = /*#__PURE__*/React.forwardRef(function DatePick
|
|
|
69
69
|
} = props,
|
|
70
70
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
71
71
|
const utils = useUtils();
|
|
72
|
-
const translations =
|
|
72
|
+
const translations = usePickerTranslations();
|
|
73
73
|
const classes = useUtilityClasses(props);
|
|
74
74
|
const dateText = React.useMemo(() => {
|
|
75
75
|
if (!value) {
|
|
@@ -107,6 +107,11 @@ process.env.NODE_ENV !== "production" ? DatePickerToolbar.propTypes = {
|
|
|
107
107
|
*/
|
|
108
108
|
classes: PropTypes.object,
|
|
109
109
|
className: PropTypes.string,
|
|
110
|
+
/**
|
|
111
|
+
* If `true`, the component is disabled.
|
|
112
|
+
* When disabled, the value cannot be changed and no interaction is possible.
|
|
113
|
+
* @default false
|
|
114
|
+
*/
|
|
110
115
|
disabled: PropTypes.bool,
|
|
111
116
|
/**
|
|
112
117
|
* If `true`, show the toolbar even in desktop mode.
|
|
@@ -121,6 +126,11 @@ process.env.NODE_ENV !== "production" ? DatePickerToolbar.propTypes = {
|
|
|
121
126
|
* @param {TView} view The view to open
|
|
122
127
|
*/
|
|
123
128
|
onViewChange: PropTypes.func.isRequired,
|
|
129
|
+
/**
|
|
130
|
+
* If `true`, the component is read-only.
|
|
131
|
+
* When read-only, the value cannot be changed but the user can interact with the interface.
|
|
132
|
+
* @default false
|
|
133
|
+
*/
|
|
124
134
|
readOnly: PropTypes.bool,
|
|
125
135
|
/**
|
|
126
136
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
package/DatePicker/shared.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { DefaultizedProps } from '
|
|
2
|
+
import { DefaultizedProps } from '@mui/x-internals/types';
|
|
3
3
|
import { DateCalendarSlots, DateCalendarSlotProps, ExportedDateCalendarProps } from '../DateCalendar/DateCalendar.types';
|
|
4
4
|
import { DateValidationError, DateView, PickerValidDate } from '../models';
|
|
5
5
|
import { BasePickerInputProps } from '../internals/models/props/basePickerProps';
|
|
@@ -8,35 +8,35 @@ import { LocalizedComponent } from '../locales/utils/pickersLocaleTextApi';
|
|
|
8
8
|
import { DatePickerToolbarProps, ExportedDatePickerToolbarProps } from './DatePickerToolbar';
|
|
9
9
|
import { PickerViewRendererLookup } from '../internals/hooks/usePicker/usePickerViews';
|
|
10
10
|
import { DateViewRendererProps } from '../dateViewRenderers';
|
|
11
|
-
export interface BaseDatePickerSlots
|
|
11
|
+
export interface BaseDatePickerSlots extends DateCalendarSlots {
|
|
12
12
|
/**
|
|
13
13
|
* Custom component for the toolbar rendered above the views.
|
|
14
14
|
* @default DatePickerToolbar
|
|
15
15
|
*/
|
|
16
|
-
toolbar?: React.JSXElementConstructor<DatePickerToolbarProps
|
|
16
|
+
toolbar?: React.JSXElementConstructor<DatePickerToolbarProps>;
|
|
17
17
|
}
|
|
18
|
-
export interface BaseDatePickerSlotProps
|
|
18
|
+
export interface BaseDatePickerSlotProps extends DateCalendarSlotProps {
|
|
19
19
|
toolbar?: ExportedDatePickerToolbarProps;
|
|
20
20
|
}
|
|
21
|
-
export type DatePickerViewRenderers<
|
|
22
|
-
export interface BaseDatePickerProps
|
|
21
|
+
export type DatePickerViewRenderers<TView extends DateView, TAdditionalProps extends {} = {}> = PickerViewRendererLookup<PickerValidDate | null, TView, DateViewRendererProps<TView>, TAdditionalProps>;
|
|
22
|
+
export interface BaseDatePickerProps extends BasePickerInputProps<PickerValidDate | null, DateView, DateValidationError>, ExportedDateCalendarProps {
|
|
23
23
|
/**
|
|
24
24
|
* Overridable component slots.
|
|
25
25
|
* @default {}
|
|
26
26
|
*/
|
|
27
|
-
slots?: BaseDatePickerSlots
|
|
27
|
+
slots?: BaseDatePickerSlots;
|
|
28
28
|
/**
|
|
29
29
|
* The props used for each component slot.
|
|
30
30
|
* @default {}
|
|
31
31
|
*/
|
|
32
|
-
slotProps?: BaseDatePickerSlotProps
|
|
32
|
+
slotProps?: BaseDatePickerSlotProps;
|
|
33
33
|
/**
|
|
34
34
|
* Define custom view renderers for each section.
|
|
35
35
|
* If `null`, the section will only have field editing.
|
|
36
36
|
* If `undefined`, internally defined view will be used.
|
|
37
37
|
*/
|
|
38
|
-
viewRenderers?: Partial<DatePickerViewRenderers<
|
|
38
|
+
viewRenderers?: Partial<DatePickerViewRenderers<DateView>>;
|
|
39
39
|
}
|
|
40
|
-
type UseDatePickerDefaultizedProps<
|
|
41
|
-
export declare function useDatePickerDefaultizedProps<
|
|
40
|
+
type UseDatePickerDefaultizedProps<Props extends BaseDatePickerProps> = LocalizedComponent<DefaultizedProps<Props, 'views' | 'openTo' | keyof BaseDateValidationProps>>;
|
|
41
|
+
export declare function useDatePickerDefaultizedProps<Props extends BaseDatePickerProps>(props: Props, name: string): UseDatePickerDefaultizedProps<Props>;
|
|
42
42
|
export {};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { DateTimeFieldProps } from './DateTimeField.types';
|
|
3
|
-
|
|
4
|
-
type DateTimeFieldComponent = (<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean = false>(props: DateTimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure> & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
|
|
3
|
+
type DateTimeFieldComponent = (<TEnableAccessibleFieldDOMStructure extends boolean = true>(props: DateTimeFieldProps<TEnableAccessibleFieldDOMStructure> & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
|
|
5
4
|
propTypes?: any;
|
|
6
5
|
};
|
|
7
6
|
/**
|
|
@@ -37,7 +37,7 @@ const DateTimeField = /*#__PURE__*/React.forwardRef(function DateTimeField(inPro
|
|
|
37
37
|
} = themeProps,
|
|
38
38
|
other = _objectWithoutPropertiesLoose(themeProps, _excluded);
|
|
39
39
|
const ownerState = themeProps;
|
|
40
|
-
const TextField = slots?.textField ?? (inProps.enableAccessibleFieldDOMStructure ?
|
|
40
|
+
const TextField = slots?.textField ?? (inProps.enableAccessibleFieldDOMStructure === false ? MuiTextField : PickersTextField);
|
|
41
41
|
const textFieldProps = useSlotProps({
|
|
42
42
|
elementType: TextField,
|
|
43
43
|
externalSlotProps: slotProps?.textField,
|
|
@@ -94,6 +94,7 @@ process.env.NODE_ENV !== "production" ? DateTimeField.propTypes = {
|
|
|
94
94
|
defaultValue: PropTypes.object,
|
|
95
95
|
/**
|
|
96
96
|
* If `true`, the component is disabled.
|
|
97
|
+
* When disabled, the value cannot be changed and no interaction is possible.
|
|
97
98
|
* @default false
|
|
98
99
|
*/
|
|
99
100
|
disabled: PropTypes.bool,
|
|
@@ -113,7 +114,7 @@ process.env.NODE_ENV !== "production" ? DateTimeField.propTypes = {
|
|
|
113
114
|
*/
|
|
114
115
|
disablePast: PropTypes.bool,
|
|
115
116
|
/**
|
|
116
|
-
* @default
|
|
117
|
+
* @default true
|
|
117
118
|
*/
|
|
118
119
|
enableAccessibleFieldDOMStructure: PropTypes.bool,
|
|
119
120
|
/**
|
|
@@ -251,8 +252,8 @@ process.env.NODE_ENV !== "production" ? DateTimeField.propTypes = {
|
|
|
251
252
|
*/
|
|
252
253
|
onSelectedSectionsChange: PropTypes.func,
|
|
253
254
|
/**
|
|
254
|
-
*
|
|
255
|
-
*
|
|
255
|
+
* If `true`, the component is read-only.
|
|
256
|
+
* When read-only, the value cannot be changed but the user can interact with the interface.
|
|
256
257
|
* @default false
|
|
257
258
|
*/
|
|
258
259
|
readOnly: PropTypes.bool,
|
|
@@ -282,30 +283,26 @@ process.env.NODE_ENV !== "production" ? DateTimeField.propTypes = {
|
|
|
282
283
|
*
|
|
283
284
|
* 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.
|
|
284
285
|
*
|
|
285
|
-
* @
|
|
286
|
-
* @param {TDate} day The date to test.
|
|
286
|
+
* @param {PickerValidDate} day The date to test.
|
|
287
287
|
* @returns {boolean} If `true` the date will be disabled.
|
|
288
288
|
*/
|
|
289
289
|
shouldDisableDate: PropTypes.func,
|
|
290
290
|
/**
|
|
291
291
|
* Disable specific month.
|
|
292
|
-
* @
|
|
293
|
-
* @param {TDate} month The month to test.
|
|
292
|
+
* @param {PickerValidDate} month The month to test.
|
|
294
293
|
* @returns {boolean} If `true`, the month will be disabled.
|
|
295
294
|
*/
|
|
296
295
|
shouldDisableMonth: PropTypes.func,
|
|
297
296
|
/**
|
|
298
297
|
* Disable specific time.
|
|
299
|
-
* @
|
|
300
|
-
* @param {TDate} value The value to check.
|
|
298
|
+
* @param {PickerValidDate} value The value to check.
|
|
301
299
|
* @param {TimeView} view The clock type of the timeValue.
|
|
302
300
|
* @returns {boolean} If `true` the time will be disabled.
|
|
303
301
|
*/
|
|
304
302
|
shouldDisableTime: PropTypes.func,
|
|
305
303
|
/**
|
|
306
304
|
* Disable specific year.
|
|
307
|
-
* @
|
|
308
|
-
* @param {TDate} year The year to test.
|
|
305
|
+
* @param {PickerValidDate} year The year to test.
|
|
309
306
|
* @returns {boolean} If `true`, the year will be disabled.
|
|
310
307
|
*/
|
|
311
308
|
shouldDisableYear: PropTypes.func,
|
|
@@ -1,20 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { SlotComponentProps } from '@mui/utils';
|
|
3
|
+
import { MakeOptional } from '@mui/x-internals/types';
|
|
3
4
|
import TextField from '@mui/material/TextField';
|
|
4
5
|
import { DateTimeValidationError, FieldSection, PickerValidDate, BuiltInFieldTextFieldProps } from '../models';
|
|
5
6
|
import { UseFieldInternalProps } from '../internals/hooks/useField';
|
|
6
|
-
import { MakeOptional } from '../internals/models/helpers';
|
|
7
|
-
import { BaseDateValidationProps, BaseTimeValidationProps, DateTimeValidationProps, DayValidationProps, MonthValidationProps, TimeValidationProps, YearValidationProps } from '../internals/models/validation';
|
|
8
7
|
import { ExportedUseClearableFieldProps, UseClearableFieldSlots, UseClearableFieldSlotProps } from '../hooks/useClearableField';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
* @default utils.is12HourCycleInCurrentLocale()
|
|
13
|
-
*/
|
|
14
|
-
ampm?: boolean;
|
|
8
|
+
import { ExportedValidateDateTimeProps } from '../validation/validateDateTime';
|
|
9
|
+
import { AmPmProps } from '../internals/models/props/time';
|
|
10
|
+
export interface UseDateTimeFieldProps<TEnableAccessibleFieldDOMStructure extends boolean> extends MakeOptional<UseFieldInternalProps<PickerValidDate | null, FieldSection, TEnableAccessibleFieldDOMStructure, DateTimeValidationError>, 'format'>, ExportedValidateDateTimeProps, ExportedUseClearableFieldProps, AmPmProps {
|
|
15
11
|
}
|
|
16
|
-
export type
|
|
17
|
-
export type DateTimeFieldProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean = false> = UseDateTimeFieldComponentProps<TDate, TEnableAccessibleFieldDOMStructure, BuiltInFieldTextFieldProps<TEnableAccessibleFieldDOMStructure>> & {
|
|
12
|
+
export type DateTimeFieldProps<TEnableAccessibleFieldDOMStructure extends boolean = true> = UseDateTimeFieldProps<TEnableAccessibleFieldDOMStructure> & Omit<BuiltInFieldTextFieldProps<TEnableAccessibleFieldDOMStructure>, keyof UseDateTimeFieldProps<TEnableAccessibleFieldDOMStructure>> & {
|
|
18
13
|
/**
|
|
19
14
|
* Overridable component slots.
|
|
20
15
|
* @default {}
|
|
@@ -24,9 +19,9 @@ export type DateTimeFieldProps<TDate extends PickerValidDate, TEnableAccessibleF
|
|
|
24
19
|
* The props used for each component slot.
|
|
25
20
|
* @default {}
|
|
26
21
|
*/
|
|
27
|
-
slotProps?: DateTimeFieldSlotProps<
|
|
22
|
+
slotProps?: DateTimeFieldSlotProps<TEnableAccessibleFieldDOMStructure>;
|
|
28
23
|
};
|
|
29
|
-
export type DateTimeFieldOwnerState<
|
|
24
|
+
export type DateTimeFieldOwnerState<TEnableAccessibleFieldDOMStructure extends boolean> = DateTimeFieldProps<TEnableAccessibleFieldDOMStructure>;
|
|
30
25
|
export interface DateTimeFieldSlots extends UseClearableFieldSlots {
|
|
31
26
|
/**
|
|
32
27
|
* Form control with an input to render the value.
|
|
@@ -34,6 +29,6 @@ export interface DateTimeFieldSlots extends UseClearableFieldSlots {
|
|
|
34
29
|
*/
|
|
35
30
|
textField?: React.ElementType;
|
|
36
31
|
}
|
|
37
|
-
export interface DateTimeFieldSlotProps<
|
|
38
|
-
textField?: SlotComponentProps<typeof TextField, {}, DateTimeFieldOwnerState<
|
|
32
|
+
export interface DateTimeFieldSlotProps<TEnableAccessibleFieldDOMStructure extends boolean> extends UseClearableFieldSlotProps {
|
|
33
|
+
textField?: SlotComponentProps<typeof TextField, {}, DateTimeFieldOwnerState<TEnableAccessibleFieldDOMStructure>>;
|
|
39
34
|
}
|
package/DateTimeField/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { DateTimeField } from './DateTimeField';
|
|
2
2
|
export { useDateTimeField as unstable_useDateTimeField } from './useDateTimeField';
|
|
3
|
-
export type { UseDateTimeFieldProps,
|
|
3
|
+
export type { UseDateTimeFieldProps, DateTimeFieldProps } from './DateTimeField.types';
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import { UseDateTimeFieldProps } from './DateTimeField.types';
|
|
2
|
-
import
|
|
3
|
-
export declare const useDateTimeField: <TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean, TAllProps extends UseDateTimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>>(inProps: TAllProps) => import("../internals").UseFieldResponse<TEnableAccessibleFieldDOMStructure, Omit<TAllProps & Omit<UseDateTimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, keyof import("../internals/hooks/defaultizedFieldProps").UseDefaultizedDateTimeFieldBaseProps<any>> & Required<Pick<UseDateTimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, keyof import("../internals/hooks/defaultizedFieldProps").UseDefaultizedDateTimeFieldBaseProps<any>>>, "disabled" | "format" | "onChange" | "onError" | "defaultValue" | "value" | "readOnly" | "minDate" | "maxDate" | "ampm" | "disableFuture" | "disablePast" | "timezone" | "referenceDate" | "formatDensity" | "shouldRespectLeadingZeros" | "selectedSections" | "onSelectedSectionsChange" | "unstableFieldRef" | "enableAccessibleFieldDOMStructure" | "minutesStep" | "shouldDisableDate" | "shouldDisableMonth" | "shouldDisableYear" | "minTime" | "maxTime" | "shouldDisableTime" | "disableIgnoringDatePartForTimeValidation" | "minDateTime" | "maxDateTime" | "dateSeparator">>;
|
|
2
|
+
export declare const useDateTimeField: <TEnableAccessibleFieldDOMStructure extends boolean, TAllProps extends UseDateTimeFieldProps<TEnableAccessibleFieldDOMStructure>>(inProps: TAllProps) => import("../internals").UseFieldResponse<TEnableAccessibleFieldDOMStructure, Omit<TAllProps & Omit<UseDateTimeFieldProps<TEnableAccessibleFieldDOMStructure>, keyof import("../internals/hooks/defaultizedFieldProps").UseDefaultizedDateTimeFieldBaseProps> & Required<Pick<UseDateTimeFieldProps<TEnableAccessibleFieldDOMStructure>, keyof import("../internals/hooks/defaultizedFieldProps").UseDefaultizedDateTimeFieldBaseProps>>, "disabled" | "format" | "onChange" | "onError" | "defaultValue" | "value" | "readOnly" | "formatDensity" | "enableAccessibleFieldDOMStructure" | "selectedSections" | "onSelectedSectionsChange" | "timezone" | "unstableFieldRef" | "referenceDate" | "shouldRespectLeadingZeros" | "ampm" | "disableFuture" | "disablePast" | "maxDate" | "minDate" | "minutesStep" | "shouldDisableDate" | "shouldDisableMonth" | "shouldDisableYear" | "minTime" | "maxTime" | "shouldDisableTime" | "disableIgnoringDatePartForTimeValidation" | "minDateTime" | "maxDateTime" | "dateSeparator">>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { DateTimePickerProps } from './DateTimePicker.types';
|
|
3
|
-
|
|
4
|
-
type DateTimePickerComponent = (<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean = false>(props: DateTimePickerProps<TDate, TEnableAccessibleFieldDOMStructure> & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
|
|
3
|
+
type DateTimePickerComponent = (<TEnableAccessibleFieldDOMStructure extends boolean = true>(props: DateTimePickerProps<TEnableAccessibleFieldDOMStructure> & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
|
|
5
4
|
propTypes?: any;
|
|
6
5
|
};
|
|
7
6
|
/**
|
|
@@ -75,9 +75,9 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
|
|
|
75
75
|
closeOnSelect: PropTypes.bool,
|
|
76
76
|
/**
|
|
77
77
|
* Formats the day of week displayed in the calendar header.
|
|
78
|
-
* @param {
|
|
78
|
+
* @param {PickerValidDate} date The date of the day of week provided by the adapter.
|
|
79
79
|
* @returns {string} The name to display.
|
|
80
|
-
* @default (date:
|
|
80
|
+
* @default (date: PickerValidDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
|
|
81
81
|
*/
|
|
82
82
|
dayOfWeekFormatter: PropTypes.func,
|
|
83
83
|
/**
|
|
@@ -92,7 +92,8 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
|
|
|
92
92
|
*/
|
|
93
93
|
desktopModeMediaQuery: PropTypes.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.bool,
|
|
@@ -126,7 +127,7 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
|
|
|
126
127
|
*/
|
|
127
128
|
displayWeekNumber: PropTypes.bool,
|
|
128
129
|
/**
|
|
129
|
-
* @default
|
|
130
|
+
* @default true
|
|
130
131
|
*/
|
|
131
132
|
enableAccessibleFieldDOMStructure: PropTypes.any,
|
|
132
133
|
/**
|
|
@@ -239,8 +240,7 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
|
|
|
239
240
|
onError: PropTypes.func,
|
|
240
241
|
/**
|
|
241
242
|
* Callback fired on month change.
|
|
242
|
-
* @
|
|
243
|
-
* @param {TDate} month The new month.
|
|
243
|
+
* @param {PickerValidDate} month The new month.
|
|
244
244
|
*/
|
|
245
245
|
onMonthChange: PropTypes.func,
|
|
246
246
|
/**
|
|
@@ -261,8 +261,7 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
|
|
|
261
261
|
onViewChange: PropTypes.func,
|
|
262
262
|
/**
|
|
263
263
|
* Callback fired on year change.
|
|
264
|
-
* @
|
|
265
|
-
* @param {TDate} year The new year.
|
|
264
|
+
* @param {PickerValidDate} year The new year.
|
|
266
265
|
*/
|
|
267
266
|
onYearChange: PropTypes.func,
|
|
268
267
|
/**
|
|
@@ -280,6 +279,11 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
|
|
|
280
279
|
* Force rendering in particular orientation.
|
|
281
280
|
*/
|
|
282
281
|
orientation: PropTypes.oneOf(['landscape', 'portrait']),
|
|
282
|
+
/**
|
|
283
|
+
* If `true`, the component is read-only.
|
|
284
|
+
* When read-only, the value cannot be changed but the user can interact with the interface.
|
|
285
|
+
* @default false
|
|
286
|
+
*/
|
|
283
287
|
readOnly: PropTypes.bool,
|
|
284
288
|
/**
|
|
285
289
|
* If `true`, disable heavy animations.
|
|
@@ -312,30 +316,26 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
|
|
|
312
316
|
*
|
|
313
317
|
* 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.
|
|
314
318
|
*
|
|
315
|
-
* @
|
|
316
|
-
* @param {TDate} day The date to test.
|
|
319
|
+
* @param {PickerValidDate} day The date to test.
|
|
317
320
|
* @returns {boolean} If `true` the date will be disabled.
|
|
318
321
|
*/
|
|
319
322
|
shouldDisableDate: PropTypes.func,
|
|
320
323
|
/**
|
|
321
324
|
* Disable specific month.
|
|
322
|
-
* @
|
|
323
|
-
* @param {TDate} month The month to test.
|
|
325
|
+
* @param {PickerValidDate} month The month to test.
|
|
324
326
|
* @returns {boolean} If `true`, the month will be disabled.
|
|
325
327
|
*/
|
|
326
328
|
shouldDisableMonth: PropTypes.func,
|
|
327
329
|
/**
|
|
328
330
|
* Disable specific time.
|
|
329
|
-
* @
|
|
330
|
-
* @param {TDate} value The value to check.
|
|
331
|
+
* @param {PickerValidDate} value The value to check.
|
|
331
332
|
* @param {TimeView} view The clock type of the timeValue.
|
|
332
333
|
* @returns {boolean} If `true` the time will be disabled.
|
|
333
334
|
*/
|
|
334
335
|
shouldDisableTime: PropTypes.func,
|
|
335
336
|
/**
|
|
336
337
|
* Disable specific year.
|
|
337
|
-
* @
|
|
338
|
-
* @param {TDate} year The year to test.
|
|
338
|
+
* @param {PickerValidDate} year The year to test.
|
|
339
339
|
* @returns {boolean} If `true`, the year will be disabled.
|
|
340
340
|
*/
|
|
341
341
|
shouldDisableYear: PropTypes.func,
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import { UseDateTimeFieldProps } from '../DateTimeField';
|
|
2
1
|
import { DesktopDateTimePickerProps, DesktopDateTimePickerSlots, DesktopDateTimePickerSlotProps } from '../DesktopDateTimePicker';
|
|
3
|
-
import { DateOrTimeViewWithMeridiem } from '../internals/models';
|
|
4
|
-
import { DefaultizedProps } from '../internals/models/helpers';
|
|
5
|
-
import { BaseDateValidationProps, BaseTimeValidationProps } from '../internals/models/validation';
|
|
2
|
+
import { BaseSingleInputFieldProps, DateOrTimeViewWithMeridiem } from '../internals/models';
|
|
6
3
|
import { MobileDateTimePickerProps, MobileDateTimePickerSlots, MobileDateTimePickerSlotProps } from '../MobileDateTimePicker';
|
|
7
|
-
import {
|
|
4
|
+
import { DateTimeValidationError, FieldSection, PickerValidDate } from '../models';
|
|
5
|
+
import { ValidateDateTimeProps } from '../validation';
|
|
8
6
|
import { ExportedYearCalendarProps } from '../YearCalendar/YearCalendar.types';
|
|
9
|
-
export interface DateTimePickerSlots
|
|
7
|
+
export interface DateTimePickerSlots extends DesktopDateTimePickerSlots, MobileDateTimePickerSlots<DateOrTimeViewWithMeridiem> {
|
|
10
8
|
}
|
|
11
|
-
export interface DateTimePickerSlotProps<
|
|
9
|
+
export interface DateTimePickerSlotProps<TEnableAccessibleFieldDOMStructure extends boolean> extends DesktopDateTimePickerSlotProps<TEnableAccessibleFieldDOMStructure>, MobileDateTimePickerSlotProps<DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure> {
|
|
12
10
|
}
|
|
13
|
-
export interface DateTimePickerProps<
|
|
11
|
+
export interface DateTimePickerProps<TEnableAccessibleFieldDOMStructure extends boolean = true> extends DesktopDateTimePickerProps<TEnableAccessibleFieldDOMStructure>, ExportedYearCalendarProps, Omit<MobileDateTimePickerProps<DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure>, 'views'> {
|
|
14
12
|
/**
|
|
15
13
|
* CSS media query when `Mobile` mode will be changed to `Desktop`.
|
|
16
14
|
* @default '@media (pointer: fine)'
|
|
@@ -21,12 +19,12 @@ export interface DateTimePickerProps<TDate extends PickerValidDate, TEnableAcces
|
|
|
21
19
|
* Overridable component slots.
|
|
22
20
|
* @default {}
|
|
23
21
|
*/
|
|
24
|
-
slots?: DateTimePickerSlots
|
|
22
|
+
slots?: DateTimePickerSlots;
|
|
25
23
|
/**
|
|
26
24
|
* The props used for each component slot.
|
|
27
25
|
* @default {}
|
|
28
26
|
*/
|
|
29
|
-
slotProps?: DateTimePickerSlotProps<
|
|
27
|
+
slotProps?: DateTimePickerSlotProps<TEnableAccessibleFieldDOMStructure>;
|
|
30
28
|
/**
|
|
31
29
|
* Years rendered per row.
|
|
32
30
|
* @default 4 on desktop, 3 on mobile
|
|
@@ -34,7 +32,6 @@ export interface DateTimePickerProps<TDate extends PickerValidDate, TEnableAcces
|
|
|
34
32
|
yearsPerRow?: 3 | 4;
|
|
35
33
|
}
|
|
36
34
|
/**
|
|
37
|
-
* Props the field can receive when used inside a date time picker.
|
|
38
|
-
* (`DateTimePicker`, `DesktopDateTimePicker` or `MobileDateTimePicker` component).
|
|
35
|
+
* Props the field can receive when used inside a date time picker (<DateTimePicker />, <DesktopDateTimePicker /> or <MobileDateTimePicker /> component).
|
|
39
36
|
*/
|
|
40
|
-
export type DateTimePickerFieldProps
|
|
37
|
+
export type DateTimePickerFieldProps = ValidateDateTimeProps & BaseSingleInputFieldProps<PickerValidDate | null, FieldSection, false, DateTimeValidationError>;
|
|
@@ -2,7 +2,6 @@ import * as React from 'react';
|
|
|
2
2
|
import { DateOrTimeViewWithMeridiem } from '../internals/models';
|
|
3
3
|
import { DateTimePickerTabsClasses } from './dateTimePickerTabsClasses';
|
|
4
4
|
import { BaseTabsProps, ExportedBaseTabsProps } from '../internals/models/props/tabs';
|
|
5
|
-
import { PickerValidDate } from '../models';
|
|
6
5
|
export interface ExportedDateTimePickerTabsProps extends ExportedBaseTabsProps {
|
|
7
6
|
/**
|
|
8
7
|
* Toggles visibility of the tabs allowing view switching.
|
|
@@ -37,7 +36,7 @@ export interface DateTimePickerTabsProps extends ExportedDateTimePickerTabsProps
|
|
|
37
36
|
* - [DateTimePickerTabs API](https://mui.com/x/api/date-pickers/date-time-picker-tabs/)
|
|
38
37
|
*/
|
|
39
38
|
declare const DateTimePickerTabs: {
|
|
40
|
-
|
|
39
|
+
(inProps: DateTimePickerTabsProps): React.JSX.Element | null;
|
|
41
40
|
propTypes: any;
|
|
42
41
|
};
|
|
43
42
|
export { DateTimePickerTabs };
|
|
@@ -8,7 +8,7 @@ import Tabs, { tabsClasses } from '@mui/material/Tabs';
|
|
|
8
8
|
import { styled, useThemeProps } from '@mui/material/styles';
|
|
9
9
|
import composeClasses from '@mui/utils/composeClasses';
|
|
10
10
|
import { TimeIcon, DateRangeIcon } from "../icons/index.js";
|
|
11
|
-
import {
|
|
11
|
+
import { usePickerTranslations } from "../hooks/usePickerTranslations.js";
|
|
12
12
|
import { getDateTimePickerTabsUtilityClass } from "./dateTimePickerTabsClasses.js";
|
|
13
13
|
import { isDatePickerView } from "../internals/utils/date-utils.js";
|
|
14
14
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -74,7 +74,7 @@ const DateTimePickerTabs = function DateTimePickerTabs(inProps) {
|
|
|
74
74
|
className,
|
|
75
75
|
sx
|
|
76
76
|
} = props;
|
|
77
|
-
const translations =
|
|
77
|
+
const translations = usePickerTranslations();
|
|
78
78
|
const classes = useUtilityClasses(props);
|
|
79
79
|
const handleChange = (event, value) => {
|
|
80
80
|
onViewChange(tabToView(value));
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { MakeOptional } from '@mui/x-internals/types';
|
|
2
3
|
import { BaseToolbarProps, ExportedBaseToolbarProps } from '../internals/models/props/toolbar';
|
|
3
4
|
import { DateTimePickerToolbarClasses } from './dateTimePickerToolbarClasses';
|
|
4
5
|
import { DateOrTimeViewWithMeridiem, WrapperVariant } from '../internals/models';
|
|
5
|
-
import { MakeOptional } from '../internals/models/helpers';
|
|
6
6
|
import { PickerValidDate } from '../models';
|
|
7
7
|
export interface ExportedDateTimePickerToolbarProps extends ExportedBaseToolbarProps {
|
|
8
8
|
/**
|
|
@@ -10,7 +10,7 @@ export interface ExportedDateTimePickerToolbarProps extends ExportedBaseToolbarP
|
|
|
10
10
|
*/
|
|
11
11
|
classes?: Partial<DateTimePickerToolbarClasses>;
|
|
12
12
|
}
|
|
13
|
-
export interface DateTimePickerToolbarProps
|
|
13
|
+
export interface DateTimePickerToolbarProps extends ExportedDateTimePickerToolbarProps, MakeOptional<BaseToolbarProps<PickerValidDate | null, DateOrTimeViewWithMeridiem>, 'view'> {
|
|
14
14
|
toolbarVariant?: WrapperVariant;
|
|
15
15
|
/**
|
|
16
16
|
* If provided, it will be used instead of `dateTimePickerToolbarTitle` from localization.
|
|
@@ -29,7 +29,7 @@ export interface DateTimePickerToolbarProps<TDate extends PickerValidDate> exten
|
|
|
29
29
|
*
|
|
30
30
|
* - [DateTimePickerToolbar API](https://mui.com/x/api/date-pickers/date-time-picker-toolbar/)
|
|
31
31
|
*/
|
|
32
|
-
declare function DateTimePickerToolbar
|
|
32
|
+
declare function DateTimePickerToolbar(inProps: DateTimePickerToolbarProps): React.JSX.Element;
|
|
33
33
|
declare namespace DateTimePickerToolbar {
|
|
34
34
|
var propTypes: any;
|
|
35
35
|
}
|