@mui/x-date-pickers 7.22.3 → 8.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AdapterDateFns/AdapterDateFns.d.ts +1 -1
- package/AdapterDateFnsBase/AdapterDateFnsBase.d.ts +3 -3
- package/AdapterDateFnsJalali/AdapterDateFnsJalali.d.ts +1 -1
- package/AdapterDateFnsJalaliV3/AdapterDateFnsJalaliV3.d.ts +1 -1
- package/AdapterDateFnsV3/AdapterDateFnsV3.d.ts +1 -1
- package/AdapterDayjs/AdapterDayjs.d.ts +2 -2
- package/AdapterLuxon/AdapterLuxon.d.ts +2 -2
- package/AdapterMoment/AdapterMoment.d.ts +2 -2
- package/AdapterMomentHijri/AdapterMomentHijri.d.ts +2 -2
- package/AdapterMomentJalaali/AdapterMomentJalaali.d.ts +2 -2
- package/CHANGELOG.md +348 -12
- package/DateCalendar/DateCalendar.d.ts +1 -2
- package/DateCalendar/DateCalendar.js +21 -22
- package/DateCalendar/DateCalendar.types.d.ts +21 -31
- package/DateCalendar/DayCalendar.d.ts +25 -24
- package/DateCalendar/DayCalendar.js +13 -10
- package/DateCalendar/index.d.ts +1 -0
- package/DateCalendar/useCalendarState.d.ts +16 -16
- package/DateCalendar/useIsDateDisabled.d.ts +2 -2
- package/DateField/DateField.d.ts +1 -2
- package/DateField/DateField.js +8 -10
- package/DateField/DateField.types.d.ts +8 -9
- package/DateField/index.d.ts +1 -1
- package/DateField/useDateField.d.ts +1 -2
- package/DatePicker/DatePicker.d.ts +1 -2
- package/DatePicker/DatePicker.js +15 -14
- package/DatePicker/DatePicker.types.d.ts +10 -11
- package/DatePicker/DatePickerToolbar.d.ts +2 -2
- package/DatePicker/DatePickerToolbar.js +2 -4
- package/DatePicker/shared.d.ts +11 -11
- package/DateTimeField/DateTimeField.d.ts +1 -2
- package/DateTimeField/DateTimeField.js +9 -12
- package/DateTimeField/DateTimeField.types.d.ts +9 -14
- package/DateTimeField/index.d.ts +1 -1
- package/DateTimeField/useDateTimeField.d.ts +1 -2
- package/DateTimePicker/DateTimePicker.d.ts +1 -2
- package/DateTimePicker/DateTimePicker.js +16 -16
- package/DateTimePicker/DateTimePicker.types.d.ts +10 -13
- package/DateTimePicker/DateTimePickerTabs.d.ts +1 -2
- package/DateTimePicker/DateTimePickerTabs.js +2 -2
- package/DateTimePicker/DateTimePickerToolbar.d.ts +5 -5
- package/DateTimePicker/DateTimePickerToolbar.js +8 -7
- package/DateTimePicker/shared.d.ts +12 -12
- package/DesktopDatePicker/DesktopDatePicker.d.ts +1 -2
- package/DesktopDatePicker/DesktopDatePicker.js +17 -16
- package/DesktopDatePicker/DesktopDatePicker.types.d.ts +7 -7
- package/DesktopDateTimePicker/DesktopDateTimePicker.d.ts +1 -2
- package/DesktopDateTimePicker/DesktopDateTimePicker.js +18 -18
- package/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +8 -8
- package/DesktopDateTimePicker/DesktopDateTimePickerLayout.d.ts +1 -2
- package/DesktopDateTimePicker/DesktopDateTimePickerLayout.js +0 -2
- package/DesktopTimePicker/DesktopTimePicker.d.ts +1 -2
- package/DesktopTimePicker/DesktopTimePicker.js +11 -6
- package/DesktopTimePicker/DesktopTimePicker.types.d.ts +8 -8
- package/DigitalClock/DigitalClock.d.ts +1 -2
- package/DigitalClock/DigitalClock.js +8 -6
- package/DigitalClock/DigitalClock.types.d.ts +4 -4
- package/LocalizationProvider/LocalizationProvider.d.ts +12 -12
- package/MobileDatePicker/MobileDatePicker.d.ts +1 -2
- package/MobileDatePicker/MobileDatePicker.js +17 -16
- package/MobileDatePicker/MobileDatePicker.types.d.ts +7 -7
- package/MobileDateTimePicker/MobileDateTimePicker.d.ts +2 -2
- package/MobileDateTimePicker/MobileDateTimePicker.js +18 -18
- package/MobileDateTimePicker/MobileDateTimePicker.types.d.ts +7 -7
- package/MobileTimePicker/MobileTimePicker.d.ts +2 -2
- package/MobileTimePicker/MobileTimePicker.js +11 -6
- package/MobileTimePicker/MobileTimePicker.types.d.ts +7 -7
- package/MonthCalendar/MonthCalendar.d.ts +3 -4
- package/MonthCalendar/MonthCalendar.js +18 -14
- package/MonthCalendar/MonthCalendar.types.d.ts +14 -15
- package/MonthCalendar/PickersMonth.js +17 -13
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.d.ts +1 -2
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +8 -6
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.types.d.ts +3 -4
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.d.ts +9 -9
- package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.d.ts +2 -3
- package/PickersActionBar/PickersActionBar.js +2 -2
- package/PickersCalendarHeader/PickersCalendarHeader.d.ts +1 -2
- package/PickersCalendarHeader/PickersCalendarHeader.js +2 -2
- package/PickersCalendarHeader/PickersCalendarHeader.types.d.ts +9 -9
- package/PickersDay/PickersDay.d.ts +8 -8
- package/PickersLayout/PickersLayout.d.ts +2 -3
- package/PickersLayout/PickersLayout.js +0 -2
- package/PickersLayout/PickersLayout.types.d.ts +16 -19
- package/PickersLayout/index.d.ts +1 -1
- package/PickersLayout/usePickerLayout.d.ts +1 -2
- package/PickersLayout/usePickerLayout.js +18 -23
- package/PickersTextField/PickersInputBase/PickersInputBase.js +10 -9
- package/PickersTextField/PickersTextField.js +2 -2
- package/README.md +4 -4
- package/StaticDatePicker/StaticDatePicker.d.ts +1 -2
- package/StaticDatePicker/StaticDatePicker.js +14 -13
- package/StaticDatePicker/StaticDatePicker.types.d.ts +7 -7
- package/StaticDateTimePicker/StaticDateTimePicker.d.ts +1 -2
- package/StaticDateTimePicker/StaticDateTimePicker.js +15 -15
- package/StaticDateTimePicker/StaticDateTimePicker.types.d.ts +7 -7
- package/StaticTimePicker/StaticTimePicker.d.ts +1 -2
- package/StaticTimePicker/StaticTimePicker.js +8 -3
- package/StaticTimePicker/StaticTimePicker.types.d.ts +7 -7
- package/TimeClock/Clock.d.ts +4 -5
- package/TimeClock/Clock.js +4 -3
- package/TimeClock/ClockNumbers.d.ts +5 -5
- package/TimeClock/TimeClock.d.ts +1 -2
- package/TimeClock/TimeClock.js +8 -6
- package/TimeClock/TimeClock.types.d.ts +4 -4
- package/TimeField/TimeField.d.ts +1 -2
- package/TimeField/TimeField.js +6 -6
- package/TimeField/TimeField.types.d.ts +9 -14
- package/TimeField/index.d.ts +1 -1
- package/TimeField/useTimeField.d.ts +1 -2
- package/TimePicker/TimePicker.d.ts +1 -2
- package/TimePicker/TimePicker.js +9 -4
- package/TimePicker/TimePicker.types.d.ts +10 -13
- package/TimePicker/TimePickerToolbar.d.ts +2 -2
- package/TimePicker/TimePickerToolbar.js +8 -7
- package/TimePicker/shared.d.ts +10 -10
- package/YearCalendar/PickersYear.js +17 -13
- package/YearCalendar/YearCalendar.d.ts +1 -2
- package/YearCalendar/YearCalendar.js +18 -14
- package/YearCalendar/YearCalendar.types.d.ts +14 -15
- package/dateViewRenderers/dateViewRenderers.d.ts +3 -3
- package/hooks/index.d.ts +2 -2
- package/hooks/index.js +2 -2
- package/hooks/useClearableField.js +4 -3
- package/hooks/useParsedFormat.d.ts +2 -3
- package/hooks/useParsedFormat.js +2 -2
- package/hooks/usePickerContext.d.ts +4 -0
- package/hooks/usePickerContext.js +15 -0
- package/hooks/usePickerTranslations.d.ts +1 -0
- package/{modern/hooks/usePickersTranslations.js → hooks/usePickerTranslations.js} +1 -1
- package/hooks/useSplitFieldProps.d.ts +3 -3
- package/index.js +1 -1
- package/internals/components/PickerProvider.d.ts +67 -0
- package/internals/components/PickerProvider.js +40 -0
- package/internals/hooks/date-helpers-hooks.d.ts +6 -6
- package/internals/hooks/defaultizedFieldProps.d.ts +7 -8
- package/internals/hooks/useClockReferenceDate.d.ts +5 -5
- package/internals/hooks/useDesktopPicker/useDesktopPicker.d.ts +1 -2
- package/internals/hooks/useDesktopPicker/useDesktopPicker.js +22 -18
- package/internals/hooks/useDesktopPicker/useDesktopPicker.types.d.ts +15 -15
- package/internals/hooks/useField/buildSectionsFromFormat.d.ts +5 -5
- package/internals/hooks/useField/useField.d.ts +3 -3
- package/internals/hooks/useField/useField.js +1 -1
- package/internals/hooks/useField/useField.types.d.ts +40 -50
- package/internals/hooks/useField/useField.utils.d.ts +15 -15
- package/internals/hooks/useField/useFieldCharacterEditing.d.ts +4 -4
- package/internals/hooks/useField/useFieldState.d.ts +4 -4
- package/internals/hooks/useField/useFieldState.js +4 -3
- package/internals/hooks/useField/useFieldV7TextField.js +4 -3
- package/internals/hooks/useMobilePicker/useMobilePicker.d.ts +1 -2
- package/internals/hooks/useMobilePicker/useMobilePicker.js +24 -19
- package/internals/hooks/useMobilePicker/useMobilePicker.types.d.ts +12 -12
- package/internals/hooks/usePicker/usePicker.d.ts +2 -2
- package/internals/hooks/usePicker/usePicker.js +15 -10
- package/internals/hooks/usePicker/usePicker.types.d.ts +9 -7
- package/internals/hooks/usePicker/usePickerLayoutProps.d.ts +6 -8
- package/internals/hooks/usePicker/usePickerLayoutProps.js +2 -5
- package/internals/hooks/usePicker/usePickerProvider.d.ts +26 -0
- package/internals/hooks/usePicker/usePickerProvider.js +77 -0
- package/internals/hooks/usePicker/usePickerValue.d.ts +2 -2
- package/internals/hooks/usePicker/usePickerValue.js +7 -10
- package/internals/hooks/usePicker/usePickerValue.types.d.ts +38 -39
- package/internals/hooks/usePicker/usePickerViews.d.ts +7 -11
- package/internals/hooks/usePicker/usePickerViews.js +1 -0
- package/internals/hooks/usePickerPrivateContext.d.ts +4 -0
- package/internals/hooks/usePickerPrivateContext.js +9 -0
- package/internals/hooks/useStaticPicker/useStaticPicker.d.ts +1 -2
- package/internals/hooks/useStaticPicker/useStaticPicker.js +6 -5
- package/internals/hooks/useStaticPicker/useStaticPicker.types.d.ts +6 -6
- package/internals/hooks/useUtils.d.ts +7 -7
- package/internals/hooks/useValueWithTimezone.d.ts +19 -15
- package/internals/hooks/useValueWithTimezone.js +13 -1
- package/internals/hooks/useViews.d.ts +3 -3
- package/internals/hooks/useViews.js +1 -1
- package/internals/index.d.ts +7 -5
- package/internals/index.js +2 -1
- package/internals/models/common.d.ts +2 -1
- package/internals/models/fields.d.ts +32 -7
- package/internals/models/formProps.d.ts +14 -0
- package/internals/models/helpers.d.ts +0 -4
- package/internals/models/index.d.ts +2 -0
- package/internals/models/index.js +3 -1
- package/internals/models/props/basePickerProps.d.ts +5 -6
- package/internals/models/props/{clock.d.ts → time.d.ts} +10 -17
- package/internals/models/props/toolbar.d.ts +0 -2
- package/internals/models/validation.d.ts +21 -25
- package/internals/models/value.d.ts +3 -0
- package/internals/models/value.js +1 -0
- package/internals/utils/date-time-utils.d.ts +7 -7
- package/internals/utils/date-utils.d.ts +17 -17
- package/internals/utils/getDefaultReferenceDate.d.ts +10 -10
- package/internals/utils/time-utils.d.ts +5 -5
- package/internals/utils/valueManagers.d.ts +3 -3
- package/locales/beBY.d.ts +3 -3
- package/locales/beBY.js +3 -3
- package/locales/bgBG.d.ts +3 -3
- package/locales/bgBG.js +3 -3
- package/locales/caES.d.ts +3 -3
- package/locales/caES.js +3 -3
- package/locales/csCZ.d.ts +3 -3
- package/locales/csCZ.js +3 -3
- package/locales/daDK.d.ts +3 -3
- package/locales/daDK.js +3 -3
- package/locales/deDE.d.ts +3 -3
- package/locales/deDE.js +3 -3
- package/locales/elGR.d.ts +3 -3
- package/locales/elGR.js +12 -13
- package/locales/enUS.d.ts +4 -4
- package/locales/enUS.js +3 -3
- package/locales/esES.d.ts +3 -3
- package/locales/esES.js +3 -3
- package/locales/eu.d.ts +3 -3
- package/locales/eu.js +3 -3
- package/locales/faIR.d.ts +3 -3
- package/locales/faIR.js +3 -3
- package/locales/fiFI.d.ts +3 -3
- package/locales/fiFI.js +3 -3
- package/locales/frFR.d.ts +3 -3
- package/locales/frFR.js +3 -3
- package/locales/heIL.d.ts +3 -3
- package/locales/heIL.js +3 -3
- package/locales/hrHR.d.ts +3 -3
- package/locales/hrHR.js +3 -3
- package/locales/huHU.d.ts +3 -3
- package/locales/huHU.js +3 -3
- package/locales/isIS.d.ts +3 -3
- package/locales/isIS.js +3 -3
- package/locales/itIT.d.ts +3 -3
- package/locales/itIT.js +3 -3
- package/locales/jaJP.d.ts +3 -3
- package/locales/jaJP.js +3 -3
- package/locales/koKR.d.ts +3 -3
- package/locales/koKR.js +3 -3
- package/locales/kzKZ.d.ts +3 -3
- package/locales/kzKZ.js +3 -3
- package/locales/mk.d.ts +3 -3
- package/locales/mk.js +3 -3
- package/locales/nbNO.d.ts +3 -3
- package/locales/nbNO.js +3 -3
- package/locales/nlNL.d.ts +3 -3
- package/locales/nlNL.js +3 -3
- package/locales/nnNO.d.ts +3 -3
- package/locales/nnNO.js +3 -3
- package/locales/plPL.d.ts +3 -3
- package/locales/plPL.js +3 -3
- package/locales/ptBR.d.ts +3 -3
- package/locales/ptBR.js +5 -3
- package/locales/ptPT.d.ts +3 -3
- package/locales/ptPT.js +3 -3
- package/locales/roRO.d.ts +3 -3
- package/locales/roRO.js +3 -3
- package/locales/ruRU.d.ts +3 -3
- package/locales/ruRU.js +3 -3
- package/locales/skSK.d.ts +3 -3
- package/locales/skSK.js +3 -3
- package/locales/svSE.d.ts +3 -3
- package/locales/svSE.js +3 -3
- package/locales/trTR.d.ts +3 -3
- package/locales/trTR.js +3 -3
- package/locales/ukUA.d.ts +3 -3
- package/locales/ukUA.js +3 -3
- package/locales/urPK.d.ts +3 -3
- package/locales/urPK.js +3 -3
- package/locales/utils/getPickersLocalization.d.ts +9 -9
- package/locales/utils/getPickersLocalization.js +1 -1
- package/locales/utils/pickersLocaleTextApi.d.ts +12 -36
- package/locales/viVN.d.ts +3 -3
- package/locales/viVN.js +3 -3
- package/locales/zhCN.d.ts +3 -3
- package/locales/zhCN.js +3 -3
- package/locales/zhHK.d.ts +3 -3
- package/locales/zhHK.js +3 -3
- package/models/adapters.d.ts +151 -202
- package/models/common.d.ts +1 -0
- package/models/fields.d.ts +9 -42
- package/models/pickers.d.ts +28 -6
- package/modern/DateCalendar/DateCalendar.js +21 -22
- package/modern/DateCalendar/DayCalendar.js +13 -10
- package/modern/DateField/DateField.js +8 -10
- package/modern/DatePicker/DatePicker.js +15 -14
- package/modern/DatePicker/DatePickerToolbar.js +2 -4
- package/modern/DateTimeField/DateTimeField.js +9 -12
- package/modern/DateTimePicker/DateTimePicker.js +16 -16
- package/modern/DateTimePicker/DateTimePickerTabs.js +2 -2
- package/modern/DateTimePicker/DateTimePickerToolbar.js +8 -7
- package/modern/DesktopDatePicker/DesktopDatePicker.js +17 -16
- package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +18 -18
- package/modern/DesktopDateTimePicker/DesktopDateTimePickerLayout.js +0 -2
- package/modern/DesktopTimePicker/DesktopTimePicker.js +11 -6
- package/modern/DigitalClock/DigitalClock.js +8 -6
- package/modern/MobileDatePicker/MobileDatePicker.js +17 -16
- package/modern/MobileDateTimePicker/MobileDateTimePicker.js +18 -18
- package/modern/MobileTimePicker/MobileTimePicker.js +11 -6
- package/modern/MonthCalendar/MonthCalendar.js +18 -14
- package/modern/MonthCalendar/PickersMonth.js +17 -13
- package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.js +8 -6
- package/modern/PickersActionBar/PickersActionBar.js +2 -2
- package/modern/PickersCalendarHeader/PickersCalendarHeader.js +2 -2
- package/modern/PickersLayout/PickersLayout.js +0 -2
- package/modern/PickersLayout/usePickerLayout.js +18 -23
- package/modern/PickersTextField/PickersInputBase/PickersInputBase.js +10 -9
- package/modern/PickersTextField/PickersTextField.js +2 -2
- package/modern/StaticDatePicker/StaticDatePicker.js +14 -13
- package/modern/StaticDateTimePicker/StaticDateTimePicker.js +15 -15
- package/modern/StaticTimePicker/StaticTimePicker.js +8 -3
- package/modern/TimeClock/Clock.js +4 -3
- package/modern/TimeClock/TimeClock.js +8 -6
- package/modern/TimeField/TimeField.js +6 -6
- package/modern/TimePicker/TimePicker.js +9 -4
- package/modern/TimePicker/TimePickerToolbar.js +8 -7
- package/modern/YearCalendar/PickersYear.js +17 -13
- package/modern/YearCalendar/YearCalendar.js +18 -14
- package/modern/hooks/index.js +2 -2
- package/modern/hooks/useClearableField.js +4 -3
- package/modern/hooks/useParsedFormat.js +2 -2
- package/modern/hooks/usePickerContext.js +15 -0
- package/{hooks/usePickersTranslations.js → modern/hooks/usePickerTranslations.js} +1 -1
- package/modern/index.js +1 -1
- package/modern/internals/components/PickerProvider.js +40 -0
- package/modern/internals/hooks/useDesktopPicker/useDesktopPicker.js +22 -18
- package/modern/internals/hooks/useField/useField.js +1 -1
- package/modern/internals/hooks/useField/useFieldState.js +4 -3
- package/modern/internals/hooks/useField/useFieldV7TextField.js +4 -3
- package/modern/internals/hooks/useMobilePicker/useMobilePicker.js +24 -19
- package/modern/internals/hooks/usePicker/usePicker.js +15 -10
- package/modern/internals/hooks/usePicker/usePickerLayoutProps.js +2 -5
- package/modern/internals/hooks/usePicker/usePickerProvider.js +77 -0
- package/modern/internals/hooks/usePicker/usePickerValue.js +7 -10
- package/modern/internals/hooks/usePicker/usePickerViews.js +1 -0
- package/modern/internals/hooks/usePickerPrivateContext.js +9 -0
- package/modern/internals/hooks/useStaticPicker/useStaticPicker.js +6 -5
- package/modern/internals/hooks/useValueWithTimezone.js +13 -1
- package/modern/internals/hooks/useViews.js +1 -1
- package/modern/internals/index.js +2 -1
- package/modern/internals/models/formProps.js +1 -0
- package/modern/internals/models/index.js +3 -1
- package/modern/internals/models/props/time.js +1 -0
- package/modern/internals/models/value.js +1 -0
- package/modern/locales/beBY.js +3 -3
- package/modern/locales/bgBG.js +3 -3
- package/modern/locales/caES.js +3 -3
- package/modern/locales/csCZ.js +3 -3
- package/modern/locales/daDK.js +3 -3
- package/modern/locales/deDE.js +3 -3
- package/modern/locales/elGR.js +12 -13
- package/modern/locales/enUS.js +3 -3
- package/modern/locales/esES.js +3 -3
- package/modern/locales/eu.js +3 -3
- package/modern/locales/faIR.js +3 -3
- package/modern/locales/fiFI.js +3 -3
- package/modern/locales/frFR.js +3 -3
- package/modern/locales/heIL.js +3 -3
- package/modern/locales/hrHR.js +3 -3
- package/modern/locales/huHU.js +3 -3
- package/modern/locales/isIS.js +3 -3
- package/modern/locales/itIT.js +3 -3
- package/modern/locales/jaJP.js +3 -3
- package/modern/locales/koKR.js +3 -3
- package/modern/locales/kzKZ.js +3 -3
- package/modern/locales/mk.js +3 -3
- package/modern/locales/nbNO.js +3 -3
- package/modern/locales/nlNL.js +3 -3
- package/modern/locales/nnNO.js +3 -3
- package/modern/locales/plPL.js +3 -3
- package/modern/locales/ptBR.js +5 -3
- package/modern/locales/ptPT.js +3 -3
- package/modern/locales/roRO.js +3 -3
- package/modern/locales/ruRU.js +3 -3
- package/modern/locales/skSK.js +3 -3
- package/modern/locales/svSE.js +3 -3
- package/modern/locales/trTR.js +3 -3
- package/modern/locales/ukUA.js +3 -3
- package/modern/locales/urPK.js +3 -3
- package/modern/locales/utils/getPickersLocalization.js +1 -1
- package/modern/locales/viVN.js +3 -3
- package/modern/locales/zhCN.js +3 -3
- package/modern/locales/zhHK.js +3 -3
- package/modern/validation/useValidation.js +2 -3
- package/modern/validation/validateDate.js +5 -0
- package/modern/validation/validateDateTime.js +5 -0
- package/modern/validation/validateTime.js +5 -0
- package/node/DateCalendar/DateCalendar.js +21 -22
- package/node/DateCalendar/DayCalendar.js +13 -10
- package/node/DateField/DateField.js +8 -10
- package/node/DatePicker/DatePicker.js +15 -14
- package/node/DatePicker/DatePickerToolbar.js +2 -4
- package/node/DateTimeField/DateTimeField.js +9 -12
- package/node/DateTimePicker/DateTimePicker.js +16 -16
- package/node/DateTimePicker/DateTimePickerTabs.js +2 -2
- package/node/DateTimePicker/DateTimePickerToolbar.js +8 -7
- package/node/DesktopDatePicker/DesktopDatePicker.js +17 -16
- package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +18 -18
- package/node/DesktopDateTimePicker/DesktopDateTimePickerLayout.js +0 -2
- package/node/DesktopTimePicker/DesktopTimePicker.js +11 -6
- package/node/DigitalClock/DigitalClock.js +8 -6
- package/node/MobileDatePicker/MobileDatePicker.js +17 -16
- package/node/MobileDateTimePicker/MobileDateTimePicker.js +18 -18
- package/node/MobileTimePicker/MobileTimePicker.js +11 -6
- package/node/MonthCalendar/MonthCalendar.js +18 -14
- package/node/MonthCalendar/PickersMonth.js +17 -13
- package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.js +8 -6
- package/node/PickersActionBar/PickersActionBar.js +2 -2
- package/node/PickersCalendarHeader/PickersCalendarHeader.js +2 -2
- package/node/PickersLayout/PickersLayout.js +0 -2
- package/node/PickersLayout/usePickerLayout.js +18 -23
- package/node/PickersTextField/PickersInputBase/PickersInputBase.js +10 -9
- package/node/PickersTextField/PickersTextField.js +2 -2
- package/node/StaticDatePicker/StaticDatePicker.js +14 -13
- package/node/StaticDateTimePicker/StaticDateTimePicker.js +15 -15
- package/node/StaticTimePicker/StaticTimePicker.js +8 -3
- package/node/TimeClock/Clock.js +4 -3
- package/node/TimeClock/TimeClock.js +8 -6
- package/node/TimeField/TimeField.js +6 -6
- package/node/TimePicker/TimePicker.js +9 -4
- package/node/TimePicker/TimePickerToolbar.js +8 -7
- package/node/YearCalendar/PickersYear.js +17 -13
- package/node/YearCalendar/YearCalendar.js +18 -14
- package/node/hooks/index.js +6 -6
- package/node/hooks/useClearableField.js +4 -3
- package/node/hooks/useParsedFormat.js +2 -2
- package/node/hooks/usePickerContext.js +21 -0
- package/node/hooks/usePickerTranslations.js +10 -0
- package/node/index.js +1 -1
- package/node/internals/components/PickerProvider.js +48 -0
- package/node/internals/hooks/useDesktopPicker/useDesktopPicker.js +22 -18
- package/node/internals/hooks/useField/useField.js +1 -1
- package/node/internals/hooks/useField/useFieldState.js +4 -3
- package/node/internals/hooks/useField/useFieldV7TextField.js +4 -3
- package/node/internals/hooks/useMobilePicker/useMobilePicker.js +24 -19
- package/node/internals/hooks/usePicker/usePicker.js +15 -10
- package/node/internals/hooks/usePicker/usePickerLayoutProps.js +2 -5
- package/node/internals/hooks/usePicker/usePickerProvider.js +87 -0
- package/node/internals/hooks/usePicker/usePickerValue.js +6 -10
- package/node/internals/hooks/usePicker/usePickerViews.js +1 -0
- package/node/internals/hooks/usePickerPrivateContext.js +15 -0
- package/node/internals/hooks/useStaticPicker/useStaticPicker.js +6 -5
- package/node/internals/hooks/useValueWithTimezone.js +13 -1
- package/node/internals/hooks/useViews.js +3 -3
- package/node/internals/index.js +14 -7
- package/node/internals/models/index.js +22 -0
- package/node/internals/models/props/time.js +5 -0
- package/node/internals/models/value.js +5 -0
- package/node/locales/beBY.js +3 -3
- package/node/locales/bgBG.js +3 -3
- package/node/locales/caES.js +3 -3
- package/node/locales/csCZ.js +3 -3
- package/node/locales/daDK.js +3 -3
- package/node/locales/deDE.js +3 -3
- package/node/locales/elGR.js +12 -13
- package/node/locales/enUS.js +3 -3
- package/node/locales/esES.js +3 -3
- package/node/locales/eu.js +3 -3
- package/node/locales/faIR.js +3 -3
- package/node/locales/fiFI.js +3 -3
- package/node/locales/frFR.js +3 -3
- package/node/locales/heIL.js +3 -3
- package/node/locales/hrHR.js +3 -3
- package/node/locales/huHU.js +3 -3
- package/node/locales/isIS.js +3 -3
- package/node/locales/itIT.js +3 -3
- package/node/locales/jaJP.js +3 -3
- package/node/locales/koKR.js +3 -3
- package/node/locales/kzKZ.js +3 -3
- package/node/locales/mk.js +3 -3
- package/node/locales/nbNO.js +3 -3
- package/node/locales/nlNL.js +3 -3
- package/node/locales/nnNO.js +3 -3
- package/node/locales/plPL.js +3 -3
- package/node/locales/ptBR.js +5 -3
- package/node/locales/ptPT.js +3 -3
- package/node/locales/roRO.js +3 -3
- package/node/locales/ruRU.js +3 -3
- package/node/locales/skSK.js +3 -3
- package/node/locales/svSE.js +3 -3
- package/node/locales/trTR.js +3 -3
- package/node/locales/ukUA.js +3 -3
- package/node/locales/urPK.js +3 -3
- package/node/locales/utils/getPickersLocalization.js +1 -1
- package/node/locales/viVN.js +3 -3
- package/node/locales/zhCN.js +3 -3
- package/node/locales/zhHK.js +3 -3
- package/node/validation/useValidation.js +2 -3
- package/node/validation/validateDate.js +4 -0
- package/node/validation/validateDateTime.js +4 -0
- package/node/validation/validateTime.js +4 -0
- package/package.json +5 -5
- package/themeAugmentation/props.d.ts +28 -28
- package/timeViewRenderers/timeViewRenderers.d.ts +6 -6
- package/validation/extractValidationProps.d.ts +4 -4
- package/validation/useValidation.d.ts +9 -10
- package/validation/useValidation.js +2 -3
- package/validation/validateDate.d.ts +7 -2
- package/validation/validateDate.js +5 -0
- package/validation/validateDateTime.d.ts +10 -4
- package/validation/validateDateTime.js +5 -0
- package/validation/validateTime.d.ts +7 -2
- package/validation/validateTime.js +5 -0
- package/hooks/usePickersContext.d.ts +0 -4
- package/hooks/usePickersContext.js +0 -15
- package/hooks/usePickersTranslations.d.ts +0 -2
- package/internals/components/PickersProvider.d.ts +0 -34
- package/internals/components/PickersProvider.js +0 -26
- package/internals/hooks/usePicker/usePickerOwnerState.d.ts +0 -9
- package/internals/hooks/usePicker/usePickerOwnerState.js +0 -13
- package/modern/hooks/usePickersContext.js +0 -15
- package/modern/internals/components/PickersProvider.js +0 -26
- package/modern/internals/hooks/usePicker/usePickerOwnerState.js +0 -13
- package/node/hooks/usePickersContext.js +0 -21
- package/node/hooks/usePickersTranslations.js +0 -10
- package/node/internals/components/PickersProvider.js +0 -34
- package/node/internals/hooks/usePicker/usePickerOwnerState.js +0 -20
- /package/internals/models/{props/clock.js → formProps.js} +0 -0
- /package/{modern/internals/models/props/clock.js → internals/models/props/time.js} +0 -0
- /package/node/internals/models/{props/clock.js → formProps.js} +0 -0
package/node/locales/zhCN.js
CHANGED
|
@@ -37,7 +37,7 @@ const zhCNPickers = {
|
|
|
37
37
|
timePickerToolbarTitle: '选择时间',
|
|
38
38
|
dateRangePickerToolbarTitle: '选择时间范围',
|
|
39
39
|
// Clock labels
|
|
40
|
-
clockLabelText: (view,
|
|
40
|
+
clockLabelText: (view, formattedTime) => `选择 ${views[view]}. ${!formattedTime ? '未选择时间' : `已选择${formattedTime}`}`,
|
|
41
41
|
hoursClockNumberText: hours => `${hours}小时`,
|
|
42
42
|
minutesClockNumberText: minutes => `${minutes}分钟`,
|
|
43
43
|
secondsClockNumberText: seconds => `${seconds}秒`,
|
|
@@ -49,8 +49,8 @@ const zhCNPickers = {
|
|
|
49
49
|
calendarWeekNumberAriaLabelText: weekNumber => `第${weekNumber}周`,
|
|
50
50
|
calendarWeekNumberText: weekNumber => `${weekNumber}`,
|
|
51
51
|
// Open picker labels
|
|
52
|
-
openDatePickerDialogue:
|
|
53
|
-
openTimePickerDialogue:
|
|
52
|
+
openDatePickerDialogue: formattedDate => formattedDate ? `选择日期,已选择${formattedDate}` : '选择日期',
|
|
53
|
+
openTimePickerDialogue: formattedTime => formattedTime ? `选择时间,已选择${formattedTime}` : '选择时间',
|
|
54
54
|
fieldClearLabel: '清除',
|
|
55
55
|
// Table labels
|
|
56
56
|
timeTableLabel: '选择时间',
|
package/node/locales/zhHK.js
CHANGED
|
@@ -37,7 +37,7 @@ const zhHKPickers = {
|
|
|
37
37
|
timePickerToolbarTitle: '選擇時間',
|
|
38
38
|
dateRangePickerToolbarTitle: '選擇時間範圍',
|
|
39
39
|
// Clock labels
|
|
40
|
-
clockLabelText: (view,
|
|
40
|
+
clockLabelText: (view, formattedTime) => `選擇 ${views[view]}. ${!formattedTime ? '未選擇時間' : `已選擇${formattedTime}`}`,
|
|
41
41
|
hoursClockNumberText: hours => `${hours}小時`,
|
|
42
42
|
minutesClockNumberText: minutes => `${minutes}分鐘`,
|
|
43
43
|
secondsClockNumberText: seconds => `${seconds}秒`,
|
|
@@ -49,8 +49,8 @@ const zhHKPickers = {
|
|
|
49
49
|
calendarWeekNumberAriaLabelText: weekNumber => `第${weekNumber}週`,
|
|
50
50
|
calendarWeekNumberText: weekNumber => `${weekNumber}`,
|
|
51
51
|
// Open picker labels
|
|
52
|
-
openDatePickerDialogue:
|
|
53
|
-
openTimePickerDialogue:
|
|
52
|
+
openDatePickerDialogue: formattedDate => formattedDate ? `選擇日期,已選擇${formattedDate}` : '選擇日期',
|
|
53
|
+
openTimePickerDialogue: formattedTime => formattedTime ? `選擇時間,已選擇${formattedTime}` : '選擇時間',
|
|
54
54
|
fieldClearLabel: '清除',
|
|
55
55
|
// Table labels
|
|
56
56
|
timeTableLabel: '選擇時間',
|
|
@@ -12,13 +12,12 @@ var _useEventCallback = _interopRequireDefault(require("@mui/utils/useEventCallb
|
|
|
12
12
|
var _useUtils = require("../internals/hooks/useUtils");
|
|
13
13
|
/**
|
|
14
14
|
* Utility hook to check if a given value is valid based on the provided validation props.
|
|
15
|
-
* @template TDate
|
|
16
15
|
* @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.
|
|
17
16
|
* @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.
|
|
18
|
-
* @param {UseValidationOptions<TValue,
|
|
17
|
+
* @param {UseValidationOptions<TValue, TError, TValidationProps>} options The options to configure the hook.
|
|
19
18
|
* @param {TValue} options.value The value to validate.
|
|
20
19
|
* @param {PickersTimezone} options.timezone The timezone to use for the validation.
|
|
21
|
-
* @param {Validator<TValue,
|
|
20
|
+
* @param {Validator<TValue, TError, TValidationProps>} options.validator The validator function to use.
|
|
22
21
|
* @param {TValidationProps} options.props The validation props, they differ depending on the component.
|
|
23
22
|
* @param {(error: TError, value: TValue) => void} options.onError Callback fired when the error associated with the current value changes.
|
|
24
23
|
*/
|
|
@@ -6,6 +6,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.validateDate = void 0;
|
|
7
7
|
var _dateUtils = require("../internals/utils/date-utils");
|
|
8
8
|
var _valueManagers = require("../internals/utils/valueManagers");
|
|
9
|
+
/**
|
|
10
|
+
* Validation props used by the Date Picker, Date Field and Date Calendar components.
|
|
11
|
+
*/
|
|
12
|
+
|
|
9
13
|
const validateDate = ({
|
|
10
14
|
props,
|
|
11
15
|
value,
|
|
@@ -7,6 +7,10 @@ exports.validateDateTime = void 0;
|
|
|
7
7
|
var _validateDate = require("./validateDate");
|
|
8
8
|
var _validateTime = require("./validateTime");
|
|
9
9
|
var _valueManagers = require("../internals/utils/valueManagers");
|
|
10
|
+
/**
|
|
11
|
+
* Validation props used by the Date Time Picker and Date Time Field components.
|
|
12
|
+
*/
|
|
13
|
+
|
|
10
14
|
const validateDateTime = ({
|
|
11
15
|
adapter,
|
|
12
16
|
value,
|
|
@@ -6,6 +6,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.validateTime = void 0;
|
|
7
7
|
var _timeUtils = require("../internals/utils/time-utils");
|
|
8
8
|
var _valueManagers = require("../internals/utils/valueManagers");
|
|
9
|
+
/**
|
|
10
|
+
* Validation props used by the Time Picker, Time Field and Clock components.
|
|
11
|
+
*/
|
|
12
|
+
|
|
9
13
|
const validateTime = ({
|
|
10
14
|
adapter,
|
|
11
15
|
value,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-date-pickers",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0-alpha.1",
|
|
4
4
|
"description": "The community edition of the Date and Time Picker components (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./node/index.js",
|
|
@@ -35,13 +35,13 @@
|
|
|
35
35
|
"directory": "packages/x-date-pickers"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@babel/runtime": "^7.
|
|
38
|
+
"@babel/runtime": "^7.26.0",
|
|
39
39
|
"@mui/utils": "^5.16.6 || ^6.0.0",
|
|
40
40
|
"@types/react-transition-group": "^4.4.11",
|
|
41
41
|
"clsx": "^2.1.1",
|
|
42
42
|
"prop-types": "^15.8.1",
|
|
43
43
|
"react-transition-group": "^4.4.5",
|
|
44
|
-
"@mui/x-internals": "
|
|
44
|
+
"@mui/x-internals": "8.0.0-alpha.1"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"@emotion/react": "^11.9.0",
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
"moment": "^2.29.4",
|
|
56
56
|
"moment-hijri": "^2.1.2 || ^3.0.0",
|
|
57
57
|
"moment-jalaali": "^0.7.4 || ^0.8.0 || ^0.9.0 || ^0.10.0",
|
|
58
|
-
"react": "^17.0.0 || ^18.0.0",
|
|
59
|
-
"react-dom": "^17.0.0 || ^18.0.0"
|
|
58
|
+
"react": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
59
|
+
"react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0"
|
|
60
60
|
},
|
|
61
61
|
"peerDependenciesMeta": {
|
|
62
62
|
"@emotion/react": {
|
|
@@ -17,7 +17,7 @@ import { PickerPopperProps } from '../internals/components/PickersPopper';
|
|
|
17
17
|
import { PickersToolbarProps } from '../internals/components/PickersToolbar';
|
|
18
18
|
import { PickersToolbarButtonProps } from '../internals/components/PickersToolbarButton';
|
|
19
19
|
import { ExportedPickersToolbarTextProps } from '../internals/components/PickersToolbarText';
|
|
20
|
-
import { DateOrTimeView
|
|
20
|
+
import { DateOrTimeView } from '../models';
|
|
21
21
|
|
|
22
22
|
import { DatePickerProps } from '../DatePicker';
|
|
23
23
|
import { ExportedDatePickerToolbarProps } from '../DatePicker/DatePickerToolbar';
|
|
@@ -54,25 +54,25 @@ import {
|
|
|
54
54
|
import { PickersSectionListProps } from '../PickersSectionList';
|
|
55
55
|
|
|
56
56
|
export interface PickersComponentsPropsList {
|
|
57
|
-
MuiClock: ClockProps
|
|
57
|
+
MuiClock: ClockProps;
|
|
58
58
|
MuiClockNumber: ClockNumberProps;
|
|
59
59
|
MuiClockPointer: ClockPointerProps;
|
|
60
|
-
MuiDateCalendar: DateCalendarProps
|
|
61
|
-
MuiDateField: DateFieldProps<
|
|
60
|
+
MuiDateCalendar: DateCalendarProps;
|
|
61
|
+
MuiDateField: DateFieldProps<any>;
|
|
62
62
|
MuiDatePickerToolbar: ExportedDatePickerToolbarProps;
|
|
63
|
-
MuiDateTimeField: DateTimeFieldProps<
|
|
63
|
+
MuiDateTimeField: DateTimeFieldProps<any>;
|
|
64
64
|
MuiDateTimePickerTabs: DateTimePickerTabsProps;
|
|
65
65
|
MuiDateTimePickerToolbar: ExportedDateTimePickerToolbarProps;
|
|
66
|
-
MuiDayCalendar: DayCalendarProps
|
|
66
|
+
MuiDayCalendar: DayCalendarProps;
|
|
67
67
|
MuiDayCalendarSkeleton: DayCalendarSkeletonProps;
|
|
68
|
-
MuiDigitalClock: ExportedDigitalClockProps
|
|
69
|
-
MuiLocalizationProvider: LocalizationProviderProps<
|
|
70
|
-
MuiMonthCalendar: MonthCalendarProps
|
|
71
|
-
MuiMultiSectionDigitalClock: MultiSectionDigitalClockProps
|
|
68
|
+
MuiDigitalClock: ExportedDigitalClockProps;
|
|
69
|
+
MuiLocalizationProvider: LocalizationProviderProps<unknown>;
|
|
70
|
+
MuiMonthCalendar: MonthCalendarProps;
|
|
71
|
+
MuiMultiSectionDigitalClock: MultiSectionDigitalClockProps;
|
|
72
72
|
MuiMultiSectionDigitalClockSection: ExportedMultiSectionDigitalClockSectionProps;
|
|
73
73
|
MuiPickersArrowSwitcher: ExportedPickersArrowSwitcherProps;
|
|
74
|
-
MuiPickersCalendarHeader: ExportedPickersCalendarHeaderProps
|
|
75
|
-
MuiPickersDay: PickersDayProps
|
|
74
|
+
MuiPickersCalendarHeader: ExportedPickersCalendarHeaderProps;
|
|
75
|
+
MuiPickersDay: PickersDayProps;
|
|
76
76
|
MuiPickersFadeTransitionGroup: PickersFadeTransitionGroupProps;
|
|
77
77
|
MuiPickersMonth: ExportedPickersMonthProps;
|
|
78
78
|
MuiPickersPopper: PickerPopperProps;
|
|
@@ -80,30 +80,30 @@ export interface PickersComponentsPropsList {
|
|
|
80
80
|
MuiPickersToolbar: PickersToolbarProps<unknown, DateOrTimeView>;
|
|
81
81
|
MuiPickersToolbarButton: PickersToolbarButtonProps;
|
|
82
82
|
MuiPickersToolbarText: ExportedPickersToolbarTextProps;
|
|
83
|
-
MuiPickersLayout: PickersLayoutProps<unknown,
|
|
83
|
+
MuiPickersLayout: PickersLayoutProps<unknown, DateOrTimeView>;
|
|
84
84
|
MuiPickersYear: ExportedPickersYearProps;
|
|
85
|
-
MuiTimeClock: TimeClockProps
|
|
86
|
-
MuiTimeField: TimeFieldProps<
|
|
85
|
+
MuiTimeClock: TimeClockProps;
|
|
86
|
+
MuiTimeField: TimeFieldProps<any>;
|
|
87
87
|
MuiTimePickerToolbar: ExportedTimePickerToolbarProps;
|
|
88
|
-
MuiYearCalendar: YearCalendarProps
|
|
88
|
+
MuiYearCalendar: YearCalendarProps;
|
|
89
89
|
|
|
90
90
|
// Date Pickers
|
|
91
|
-
MuiDatePicker: DatePickerProps
|
|
92
|
-
MuiDesktopDatePicker: DesktopDatePickerProps
|
|
93
|
-
MuiMobileDatePicker: MobileDatePickerProps
|
|
94
|
-
MuiStaticDatePicker: StaticDatePickerProps
|
|
91
|
+
MuiDatePicker: DatePickerProps;
|
|
92
|
+
MuiDesktopDatePicker: DesktopDatePickerProps;
|
|
93
|
+
MuiMobileDatePicker: MobileDatePickerProps;
|
|
94
|
+
MuiStaticDatePicker: StaticDatePickerProps;
|
|
95
95
|
|
|
96
96
|
// Time Pickers
|
|
97
|
-
MuiTimePicker: TimePickerProps
|
|
98
|
-
MuiDesktopTimePicker: DesktopTimePickerProps
|
|
99
|
-
MuiMobileTimePicker: MobileTimePickerProps
|
|
100
|
-
MuiStaticTimePicker: StaticTimePickerProps
|
|
97
|
+
MuiTimePicker: TimePickerProps;
|
|
98
|
+
MuiDesktopTimePicker: DesktopTimePickerProps;
|
|
99
|
+
MuiMobileTimePicker: MobileTimePickerProps;
|
|
100
|
+
MuiStaticTimePicker: StaticTimePickerProps;
|
|
101
101
|
|
|
102
102
|
// Date Time Pickers
|
|
103
|
-
MuiDateTimePicker: DateTimePickerProps
|
|
104
|
-
MuiDesktopDateTimePicker: DesktopDateTimePickerProps
|
|
105
|
-
MuiMobileDateTimePicker: MobileDateTimePickerProps
|
|
106
|
-
MuiStaticDateTimePicker: StaticDateTimePickerProps
|
|
103
|
+
MuiDateTimePicker: DateTimePickerProps;
|
|
104
|
+
MuiDesktopDateTimePicker: DesktopDateTimePickerProps;
|
|
105
|
+
MuiMobileDateTimePicker: MobileDateTimePickerProps;
|
|
106
|
+
MuiStaticDateTimePicker: StaticDateTimePickerProps;
|
|
107
107
|
|
|
108
108
|
// V7 Picker's TextField
|
|
109
109
|
MuiPickersTextField: PickersTextFieldProps;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { TimeClockProps } from '../TimeClock';
|
|
3
|
-
import {
|
|
3
|
+
import { TimeView } from '../models';
|
|
4
4
|
import { DigitalClockProps } from '../DigitalClock';
|
|
5
|
-
import { BaseClockProps } from '../internals/models/props/
|
|
5
|
+
import { BaseClockProps } from '../internals/models/props/time';
|
|
6
6
|
import { MultiSectionDigitalClockProps } from '../MultiSectionDigitalClock';
|
|
7
7
|
import { TimeViewWithMeridiem } from '../internals/models';
|
|
8
8
|
import type { TimePickerProps } from '../TimePicker/TimePicker.types';
|
|
9
|
-
export type TimeViewRendererProps<TView extends TimeViewWithMeridiem, TComponentProps extends BaseClockProps<
|
|
9
|
+
export type TimeViewRendererProps<TView extends TimeViewWithMeridiem, TComponentProps extends BaseClockProps<TView>> = Omit<TComponentProps, 'views' | 'openTo' | 'view' | 'onViewChange'> & {
|
|
10
10
|
view: TView;
|
|
11
11
|
onViewChange?: (view: TView) => void;
|
|
12
12
|
views: readonly TView[];
|
|
13
13
|
};
|
|
14
|
-
export declare const renderTimeViewClock:
|
|
15
|
-
export declare const renderDigitalClockTimeView:
|
|
16
|
-
export declare const renderMultiSectionDigitalClockTimeView:
|
|
14
|
+
export declare const renderTimeViewClock: ({ view, onViewChange, focusedView, onFocusedViewChange, views, value, defaultValue, referenceDate, onChange, className, classes, disableFuture, disablePast, minTime, maxTime, shouldDisableTime, minutesStep, ampm, ampmInClock, slots, slotProps, readOnly, disabled, sx, autoFocus, showViewSwitcher, disableIgnoringDatePartForTimeValidation, timezone, }: TimeViewRendererProps<TimeView, TimeClockProps<TimeView>>) => React.JSX.Element;
|
|
15
|
+
export declare const renderDigitalClockTimeView: ({ view, onViewChange, focusedView, onFocusedViewChange, views, value, defaultValue, referenceDate, onChange, className, classes, disableFuture, disablePast, minTime, maxTime, shouldDisableTime, minutesStep, ampm, slots, slotProps, readOnly, disabled, sx, autoFocus, disableIgnoringDatePartForTimeValidation, timeSteps, skipDisabled, timezone, }: TimeViewRendererProps<Extract<TimeView, "hours">, Omit<DigitalClockProps, "timeStep"> & Pick<TimePickerProps, "timeSteps">>) => React.JSX.Element;
|
|
16
|
+
export declare const renderMultiSectionDigitalClockTimeView: ({ view, onViewChange, focusedView, onFocusedViewChange, views, value, defaultValue, referenceDate, onChange, className, classes, disableFuture, disablePast, minTime, maxTime, shouldDisableTime, minutesStep, ampm, slots, slotProps, readOnly, disabled, sx, autoFocus, disableIgnoringDatePartForTimeValidation, timeSteps, skipDisabled, timezone, }: TimeViewRendererProps<TimeViewWithMeridiem, MultiSectionDigitalClockProps>) => React.JSX.Element;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { BaseDateValidationProps, BaseTimeValidationProps, DateTimeValidationProps, DayValidationProps, MonthValidationProps, TimeValidationProps, YearValidationProps } from '../internals/models/validation';
|
|
2
|
-
export declare const DATE_VALIDATION_PROP_NAMES: (keyof BaseDateValidationProps
|
|
3
|
-
export declare const TIME_VALIDATION_PROP_NAMES: (keyof BaseTimeValidationProps | keyof TimeValidationProps
|
|
4
|
-
export declare const DATE_TIME_VALIDATION_PROP_NAMES: (keyof DateTimeValidationProps
|
|
2
|
+
export declare const DATE_VALIDATION_PROP_NAMES: (keyof BaseDateValidationProps | keyof YearValidationProps | keyof MonthValidationProps | keyof DayValidationProps)[];
|
|
3
|
+
export declare const TIME_VALIDATION_PROP_NAMES: (keyof BaseTimeValidationProps | keyof TimeValidationProps | 'ampm')[];
|
|
4
|
+
export declare const DATE_TIME_VALIDATION_PROP_NAMES: (keyof DateTimeValidationProps)[];
|
|
5
5
|
/**
|
|
6
6
|
* Extract the validation props for the props received by a component.
|
|
7
7
|
* Limit the risk of forgetting some of them and reduce the bundle size.
|
|
8
8
|
*/
|
|
9
9
|
export declare const extractValidationProps: <Props extends {
|
|
10
10
|
[key: string]: any;
|
|
11
|
-
}>(props: Props) => Pick<Props, "
|
|
11
|
+
}>(props: Props) => Pick<Props, "ampm" | "disableFuture" | "disablePast" | "maxDate" | "minDate" | "minutesStep" | "shouldDisableDate" | "shouldDisableMonth" | "shouldDisableYear" | "minTime" | "maxTime" | "shouldDisableTime" | "disableIgnoringDatePartForTimeValidation" | "minDateTime" | "maxDateTime">;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { MuiPickersAdapterContextValue } from '../LocalizationProvider/LocalizationProvider';
|
|
2
|
-
import { OnErrorProps, PickersTimezone
|
|
2
|
+
import { OnErrorProps, PickersTimezone } from '../models';
|
|
3
3
|
import type { PickerValueManager } from '../internals/hooks/usePicker';
|
|
4
|
-
export type Validator<TValue,
|
|
4
|
+
export type Validator<TValue, TError, TValidationProps> = {
|
|
5
5
|
(params: {
|
|
6
|
-
adapter: MuiPickersAdapterContextValue
|
|
6
|
+
adapter: MuiPickersAdapterContextValue;
|
|
7
7
|
value: TValue;
|
|
8
8
|
timezone: PickersTimezone;
|
|
9
9
|
props: TValidationProps;
|
|
10
10
|
}): TError;
|
|
11
|
-
valueManager: PickerValueManager<TValue,
|
|
11
|
+
valueManager: PickerValueManager<TValue, any>;
|
|
12
12
|
};
|
|
13
|
-
interface UseValidationOptions<TValue,
|
|
13
|
+
interface UseValidationOptions<TValue, TError, TValidationProps extends {}> extends OnErrorProps<TValue, TError> {
|
|
14
14
|
/**
|
|
15
15
|
* The value to validate.
|
|
16
16
|
*/
|
|
@@ -25,7 +25,7 @@ interface UseValidationOptions<TValue, TDate extends PickerValidDate, TError, TV
|
|
|
25
25
|
* It is recommended to only use the validator exported by the MUI X packages,
|
|
26
26
|
* otherwise you may have inconsistent behaviors between the field and the views.
|
|
27
27
|
*/
|
|
28
|
-
validator: Validator<TValue,
|
|
28
|
+
validator: Validator<TValue, TError, TValidationProps>;
|
|
29
29
|
/**
|
|
30
30
|
* The validation props, they differ depending on the component.
|
|
31
31
|
* For example, the `validateTime` function supports `minTime`, `maxTime`, etc.
|
|
@@ -54,15 +54,14 @@ interface UseValidationReturnValue<TValue, TError> {
|
|
|
54
54
|
}
|
|
55
55
|
/**
|
|
56
56
|
* Utility hook to check if a given value is valid based on the provided validation props.
|
|
57
|
-
* @template TDate
|
|
58
57
|
* @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.
|
|
59
58
|
* @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.
|
|
60
|
-
* @param {UseValidationOptions<TValue,
|
|
59
|
+
* @param {UseValidationOptions<TValue, TError, TValidationProps>} options The options to configure the hook.
|
|
61
60
|
* @param {TValue} options.value The value to validate.
|
|
62
61
|
* @param {PickersTimezone} options.timezone The timezone to use for the validation.
|
|
63
|
-
* @param {Validator<TValue,
|
|
62
|
+
* @param {Validator<TValue, TError, TValidationProps>} options.validator The validator function to use.
|
|
64
63
|
* @param {TValidationProps} options.props The validation props, they differ depending on the component.
|
|
65
64
|
* @param {(error: TError, value: TValue) => void} options.onError Callback fired when the error associated with the current value changes.
|
|
66
65
|
*/
|
|
67
|
-
export declare function useValidation<TValue,
|
|
66
|
+
export declare function useValidation<TValue, TError, TValidationProps extends {}>(options: UseValidationOptions<TValue, TError, TValidationProps>): UseValidationReturnValue<TValue, TError>;
|
|
68
67
|
export {};
|
|
@@ -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,6 +1,11 @@
|
|
|
1
1
|
import { Validator } from './useValidation';
|
|
2
2
|
import { BaseDateValidationProps, DayValidationProps, MonthValidationProps, YearValidationProps } from '../internals/models/validation';
|
|
3
3
|
import { DateValidationError, PickerValidDate } from '../models';
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Validation props used by the Date Picker, Date Field and Date Calendar components.
|
|
6
|
+
*/
|
|
7
|
+
export interface ExportedValidateDateProps extends DayValidationProps, MonthValidationProps, YearValidationProps, BaseDateValidationProps {
|
|
5
8
|
}
|
|
6
|
-
export
|
|
9
|
+
export interface ValidateDateProps extends DayValidationProps, MonthValidationProps, YearValidationProps, Required<BaseDateValidationProps> {
|
|
10
|
+
}
|
|
11
|
+
export declare const validateDate: Validator<PickerValidDate | null, DateValidationError, ValidateDateProps>;
|
|
@@ -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,7 +1,13 @@
|
|
|
1
1
|
import { Validator } from './useValidation';
|
|
2
|
-
import { ValidateDateProps } from './validateDate';
|
|
3
|
-
import { ValidateTimeProps } from './validateTime';
|
|
2
|
+
import { ExportedValidateDateProps, ValidateDateProps } from './validateDate';
|
|
3
|
+
import { ExportedValidateTimeProps, ValidateTimeProps } from './validateTime';
|
|
4
4
|
import { DateTimeValidationError, PickerValidDate } from '../models';
|
|
5
|
-
|
|
5
|
+
import { DateTimeValidationProps } from '../internals/models/validation';
|
|
6
|
+
/**
|
|
7
|
+
* Validation props used by the Date Time Picker and Date Time Field components.
|
|
8
|
+
*/
|
|
9
|
+
export interface ExportedValidateDateTimeProps extends ExportedValidateDateProps, ExportedValidateTimeProps, DateTimeValidationProps {
|
|
6
10
|
}
|
|
7
|
-
export
|
|
11
|
+
export interface ValidateDateTimeProps extends ValidateDateProps, ValidateTimeProps {
|
|
12
|
+
}
|
|
13
|
+
export declare const validateDateTime: Validator<PickerValidDate | null, DateTimeValidationError, ValidateDateTimeProps>;
|
|
@@ -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,6 +1,11 @@
|
|
|
1
1
|
import { Validator } from './useValidation';
|
|
2
2
|
import { BaseTimeValidationProps, TimeValidationProps } from '../internals/models/validation';
|
|
3
3
|
import { PickerValidDate, TimeValidationError } from '../models';
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Validation props used by the Time Picker, Time Field and Clock components.
|
|
6
|
+
*/
|
|
7
|
+
export interface ExportedValidateTimeProps extends BaseTimeValidationProps, TimeValidationProps {
|
|
5
8
|
}
|
|
6
|
-
export
|
|
9
|
+
export interface ValidateTimeProps extends Required<BaseTimeValidationProps>, TimeValidationProps {
|
|
10
|
+
}
|
|
11
|
+
export declare const validateTime: Validator<PickerValidDate | null, TimeValidationError, ValidateTimeProps>;
|
|
@@ -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,
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { PickersContext } from "../internals/components/PickersProvider.js";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Returns the context passed by the picker that wraps the current component.
|
|
8
|
-
*/
|
|
9
|
-
export const usePickersContext = () => {
|
|
10
|
-
const value = React.useContext(PickersContext);
|
|
11
|
-
if (value == null) {
|
|
12
|
-
throw new Error(['MUI X: The `usePickersContext` can only be called in fields that are used as a slot of a picker component'].join('\n'));
|
|
13
|
-
}
|
|
14
|
-
return value;
|
|
15
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { PickerValidDate } from '../../models';
|
|
3
|
-
import { PickersInputLocaleText } from '../../locales';
|
|
4
|
-
export declare const PickersContext: React.Context<PickersContextValue | null>;
|
|
5
|
-
/**
|
|
6
|
-
* Provides the context for the various parts of a picker component:
|
|
7
|
-
* - contextValue: the context for the picker sub-components.
|
|
8
|
-
* - localizationProvider: the translations passed through the props and through a parent LocalizationProvider.
|
|
9
|
-
*
|
|
10
|
-
* @ignore - do not document.
|
|
11
|
-
*/
|
|
12
|
-
export declare function PickersProvider<TDate extends PickerValidDate>(props: PickersFieldProviderProps<TDate>): React.JSX.Element;
|
|
13
|
-
interface PickersFieldProviderProps<TDate extends PickerValidDate> {
|
|
14
|
-
contextValue: PickersContextValue;
|
|
15
|
-
localeText: PickersInputLocaleText<TDate> | undefined;
|
|
16
|
-
children: React.ReactNode;
|
|
17
|
-
}
|
|
18
|
-
export interface PickersContextValue {
|
|
19
|
-
/**
|
|
20
|
-
* Open the picker.
|
|
21
|
-
* @param {React.UIEvent} event The DOM event that triggered the change.
|
|
22
|
-
*/
|
|
23
|
-
onOpen: (event: React.UIEvent) => void;
|
|
24
|
-
/**
|
|
25
|
-
* Close the picker.
|
|
26
|
-
* @param {React.UIEvent} event The DOM event that triggered the change.
|
|
27
|
-
*/
|
|
28
|
-
onClose: (event: React.UIEvent) => void;
|
|
29
|
-
/**
|
|
30
|
-
* `true` if the picker is open, `false` otherwise.
|
|
31
|
-
*/
|
|
32
|
-
open: boolean;
|
|
33
|
-
}
|
|
34
|
-
export {};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { LocalizationProvider } from "../../LocalizationProvider/index.js";
|
|
3
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
-
export const PickersContext = /*#__PURE__*/React.createContext(null);
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Provides the context for the various parts of a picker component:
|
|
8
|
-
* - contextValue: the context for the picker sub-components.
|
|
9
|
-
* - localizationProvider: the translations passed through the props and through a parent LocalizationProvider.
|
|
10
|
-
*
|
|
11
|
-
* @ignore - do not document.
|
|
12
|
-
*/
|
|
13
|
-
export function PickersProvider(props) {
|
|
14
|
-
const {
|
|
15
|
-
contextValue,
|
|
16
|
-
localeText,
|
|
17
|
-
children
|
|
18
|
-
} = props;
|
|
19
|
-
return /*#__PURE__*/_jsx(PickersContext.Provider, {
|
|
20
|
-
value: contextValue,
|
|
21
|
-
children: /*#__PURE__*/_jsx(LocalizationProvider, {
|
|
22
|
-
localeText: localeText,
|
|
23
|
-
children: children
|
|
24
|
-
})
|
|
25
|
-
});
|
|
26
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { FieldSection, PickerOwnerState } from '../../../models';
|
|
2
|
-
import type { UsePickerProps } from './usePicker.types';
|
|
3
|
-
import { UsePickerValueResponse } from './usePickerValue.types';
|
|
4
|
-
interface UsePickerOwnerStateParameters<TValue> {
|
|
5
|
-
props: UsePickerProps<TValue, any, any, any, any, any>;
|
|
6
|
-
pickerValueResponse: UsePickerValueResponse<TValue, FieldSection, any>;
|
|
7
|
-
}
|
|
8
|
-
export declare function usePickerOwnerState<TValue>(parameters: UsePickerOwnerStateParameters<TValue>): PickerOwnerState<TValue>;
|
|
9
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
export function usePickerOwnerState(parameters) {
|
|
3
|
-
const {
|
|
4
|
-
props,
|
|
5
|
-
pickerValueResponse
|
|
6
|
-
} = parameters;
|
|
7
|
-
return React.useMemo(() => ({
|
|
8
|
-
value: pickerValueResponse.viewProps.value,
|
|
9
|
-
open: pickerValueResponse.open,
|
|
10
|
-
disabled: props.disabled ?? false,
|
|
11
|
-
readOnly: props.readOnly ?? false
|
|
12
|
-
}), [pickerValueResponse.viewProps.value, pickerValueResponse.open, props.disabled, props.readOnly]);
|
|
13
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { PickersContext } from "../internals/components/PickersProvider.js";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Returns the context passed by the picker that wraps the current component.
|
|
8
|
-
*/
|
|
9
|
-
export const usePickersContext = () => {
|
|
10
|
-
const value = React.useContext(PickersContext);
|
|
11
|
-
if (value == null) {
|
|
12
|
-
throw new Error(['MUI X: The `usePickersContext` can only be called in fields that are used as a slot of a picker component'].join('\n'));
|
|
13
|
-
}
|
|
14
|
-
return value;
|
|
15
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { LocalizationProvider } from "../../LocalizationProvider/index.js";
|
|
3
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
-
export const PickersContext = /*#__PURE__*/React.createContext(null);
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Provides the context for the various parts of a picker component:
|
|
8
|
-
* - contextValue: the context for the picker sub-components.
|
|
9
|
-
* - localizationProvider: the translations passed through the props and through a parent LocalizationProvider.
|
|
10
|
-
*
|
|
11
|
-
* @ignore - do not document.
|
|
12
|
-
*/
|
|
13
|
-
export function PickersProvider(props) {
|
|
14
|
-
const {
|
|
15
|
-
contextValue,
|
|
16
|
-
localeText,
|
|
17
|
-
children
|
|
18
|
-
} = props;
|
|
19
|
-
return /*#__PURE__*/_jsx(PickersContext.Provider, {
|
|
20
|
-
value: contextValue,
|
|
21
|
-
children: /*#__PURE__*/_jsx(LocalizationProvider, {
|
|
22
|
-
localeText: localeText,
|
|
23
|
-
children: children
|
|
24
|
-
})
|
|
25
|
-
});
|
|
26
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
export function usePickerOwnerState(parameters) {
|
|
3
|
-
const {
|
|
4
|
-
props,
|
|
5
|
-
pickerValueResponse
|
|
6
|
-
} = parameters;
|
|
7
|
-
return React.useMemo(() => ({
|
|
8
|
-
value: pickerValueResponse.viewProps.value,
|
|
9
|
-
open: pickerValueResponse.open,
|
|
10
|
-
disabled: props.disabled ?? false,
|
|
11
|
-
readOnly: props.readOnly ?? false
|
|
12
|
-
}), [pickerValueResponse.viewProps.value, pickerValueResponse.open, props.disabled, props.readOnly]);
|
|
13
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
'use client';
|
|
3
|
-
|
|
4
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.usePickersContext = void 0;
|
|
9
|
-
var React = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _PickersProvider = require("../internals/components/PickersProvider");
|
|
11
|
-
/**
|
|
12
|
-
* Returns the context passed by the picker that wraps the current component.
|
|
13
|
-
*/
|
|
14
|
-
const usePickersContext = () => {
|
|
15
|
-
const value = React.useContext(_PickersProvider.PickersContext);
|
|
16
|
-
if (value == null) {
|
|
17
|
-
throw new Error(['MUI X: The `usePickersContext` can only be called in fields that are used as a slot of a picker component'].join('\n'));
|
|
18
|
-
}
|
|
19
|
-
return value;
|
|
20
|
-
};
|
|
21
|
-
exports.usePickersContext = usePickersContext;
|