@mui/x-date-pickers 7.22.1 → 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 +143 -92
- 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 +4 -4
- 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
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
4
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
5
|
-
const _excluded = ["autoFocus", "onViewChange", "value", "defaultValue", "referenceDate", "disableFuture", "disablePast", "onChange", "onYearChange", "onMonthChange", "reduceAnimations", "shouldDisableDate", "shouldDisableMonth", "shouldDisableYear", "view", "views", "openTo", "className", "disabled", "readOnly", "minDate", "maxDate", "disableHighlightToday", "focusedView", "onFocusedViewChange", "showDaysOutsideCurrentMonth", "fixedWeekNumber", "dayOfWeekFormatter", "slots", "slotProps", "loading", "renderLoading", "displayWeekNumber", "yearsOrder", "yearsPerRow", "monthsPerRow", "timezone"];
|
|
5
|
+
const _excluded = ["autoFocus", "onViewChange", "value", "defaultValue", "referenceDate", "disableFuture", "disablePast", "onChange", "onYearChange", "onMonthChange", "reduceAnimations", "shouldDisableDate", "shouldDisableMonth", "shouldDisableYear", "view", "views", "openTo", "className", "classes", "disabled", "readOnly", "minDate", "maxDate", "disableHighlightToday", "focusedView", "onFocusedViewChange", "showDaysOutsideCurrentMonth", "fixedWeekNumber", "dayOfWeekFormatter", "slots", "slotProps", "loading", "renderLoading", "displayWeekNumber", "yearsOrder", "yearsPerRow", "monthsPerRow", "timezone"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import clsx from 'clsx';
|
|
@@ -24,11 +24,9 @@ import { getDateCalendarUtilityClass } from "./dateCalendarClasses.js";
|
|
|
24
24
|
import { useControlledValueWithTimezone } from "../internals/hooks/useValueWithTimezone.js";
|
|
25
25
|
import { singleItemValueManager } from "../internals/utils/valueManagers.js";
|
|
26
26
|
import { VIEW_HEIGHT } from "../internals/constants/dimensions.js";
|
|
27
|
+
import { usePickerPrivateContext } from "../internals/hooks/usePickerPrivateContext.js";
|
|
27
28
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
28
|
-
const useUtilityClasses =
|
|
29
|
-
const {
|
|
30
|
-
classes
|
|
31
|
-
} = ownerState;
|
|
29
|
+
const useUtilityClasses = classes => {
|
|
32
30
|
const slots = {
|
|
33
31
|
root: ['root'],
|
|
34
32
|
viewTransitionContainer: ['viewTransitionContainer']
|
|
@@ -84,6 +82,9 @@ const DateCalendarViewTransitionContainer = styled(PickersFadeTransitionGroup, {
|
|
|
84
82
|
*/
|
|
85
83
|
export const DateCalendar = /*#__PURE__*/React.forwardRef(function DateCalendar(inProps, ref) {
|
|
86
84
|
const utils = useUtils();
|
|
85
|
+
const {
|
|
86
|
+
ownerState
|
|
87
|
+
} = usePickerPrivateContext();
|
|
87
88
|
const id = useId();
|
|
88
89
|
const props = useDateCalendarDefaultizedProps(inProps, 'MuiDateCalendar');
|
|
89
90
|
const {
|
|
@@ -105,6 +106,7 @@ export const DateCalendar = /*#__PURE__*/React.forwardRef(function DateCalendar(
|
|
|
105
106
|
views,
|
|
106
107
|
openTo,
|
|
107
108
|
className,
|
|
109
|
+
classes: classesProp,
|
|
108
110
|
disabled,
|
|
109
111
|
readOnly,
|
|
110
112
|
minDate,
|
|
@@ -203,7 +205,7 @@ export const DateCalendar = /*#__PURE__*/React.forwardRef(function DateCalendar(
|
|
|
203
205
|
timezone,
|
|
204
206
|
labelId: gridLabelId
|
|
205
207
|
},
|
|
206
|
-
ownerState
|
|
208
|
+
ownerState
|
|
207
209
|
});
|
|
208
210
|
const handleDateMonthChange = useEventCallback(newDate => {
|
|
209
211
|
const startOfMonth = utils.startOfMonth(newDate);
|
|
@@ -262,8 +264,7 @@ export const DateCalendar = /*#__PURE__*/React.forwardRef(function DateCalendar(
|
|
|
262
264
|
}
|
|
263
265
|
}, [value]); // eslint-disable-line
|
|
264
266
|
|
|
265
|
-
const
|
|
266
|
-
const classes = useUtilityClasses(ownerState);
|
|
267
|
+
const classes = useUtilityClasses(classesProp);
|
|
267
268
|
const baseDateValidationProps = {
|
|
268
269
|
disablePast,
|
|
269
270
|
disableFuture,
|
|
@@ -365,9 +366,9 @@ process.env.NODE_ENV !== "production" ? DateCalendar.propTypes = {
|
|
|
365
366
|
className: PropTypes.string,
|
|
366
367
|
/**
|
|
367
368
|
* Formats the day of week displayed in the calendar header.
|
|
368
|
-
* @param {
|
|
369
|
+
* @param {PickerValidDate} date The date of the day of week provided by the adapter.
|
|
369
370
|
* @returns {string} The name to display.
|
|
370
|
-
* @default (date:
|
|
371
|
+
* @default (date: PickerValidDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
|
|
371
372
|
*/
|
|
372
373
|
dayOfWeekFormatter: PropTypes.func,
|
|
373
374
|
/**
|
|
@@ -376,7 +377,8 @@ process.env.NODE_ENV !== "production" ? DateCalendar.propTypes = {
|
|
|
376
377
|
*/
|
|
377
378
|
defaultValue: PropTypes.object,
|
|
378
379
|
/**
|
|
379
|
-
* If `true`, the
|
|
380
|
+
* If `true`, the component is disabled.
|
|
381
|
+
* When disabled, the value cannot be changed and no interaction is possible.
|
|
380
382
|
* @default false
|
|
381
383
|
*/
|
|
382
384
|
disabled: PropTypes.bool,
|
|
@@ -447,8 +449,7 @@ process.env.NODE_ENV !== "production" ? DateCalendar.propTypes = {
|
|
|
447
449
|
onFocusedViewChange: PropTypes.func,
|
|
448
450
|
/**
|
|
449
451
|
* Callback fired on month change.
|
|
450
|
-
* @
|
|
451
|
-
* @param {TDate} month The new month.
|
|
452
|
+
* @param {PickerValidDate} month The new month.
|
|
452
453
|
*/
|
|
453
454
|
onMonthChange: PropTypes.func,
|
|
454
455
|
/**
|
|
@@ -459,8 +460,7 @@ process.env.NODE_ENV !== "production" ? DateCalendar.propTypes = {
|
|
|
459
460
|
onViewChange: PropTypes.func,
|
|
460
461
|
/**
|
|
461
462
|
* Callback fired on year change.
|
|
462
|
-
* @
|
|
463
|
-
* @param {TDate} year The new year.
|
|
463
|
+
* @param {PickerValidDate} year The new year.
|
|
464
464
|
*/
|
|
465
465
|
onYearChange: PropTypes.func,
|
|
466
466
|
/**
|
|
@@ -470,7 +470,8 @@ process.env.NODE_ENV !== "production" ? DateCalendar.propTypes = {
|
|
|
470
470
|
*/
|
|
471
471
|
openTo: PropTypes.oneOf(['day', 'month', 'year']),
|
|
472
472
|
/**
|
|
473
|
-
*
|
|
473
|
+
* If `true`, the component is read-only.
|
|
474
|
+
* When read-only, the value cannot be changed but the user can interact with the interface.
|
|
474
475
|
* @default false
|
|
475
476
|
*/
|
|
476
477
|
readOnly: PropTypes.bool,
|
|
@@ -495,22 +496,19 @@ process.env.NODE_ENV !== "production" ? DateCalendar.propTypes = {
|
|
|
495
496
|
*
|
|
496
497
|
* 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.
|
|
497
498
|
*
|
|
498
|
-
* @
|
|
499
|
-
* @param {TDate} day The date to test.
|
|
499
|
+
* @param {PickerValidDate} day The date to test.
|
|
500
500
|
* @returns {boolean} If `true` the date will be disabled.
|
|
501
501
|
*/
|
|
502
502
|
shouldDisableDate: PropTypes.func,
|
|
503
503
|
/**
|
|
504
504
|
* Disable specific month.
|
|
505
|
-
* @
|
|
506
|
-
* @param {TDate} month The month to test.
|
|
505
|
+
* @param {PickerValidDate} month The month to test.
|
|
507
506
|
* @returns {boolean} If `true`, the month will be disabled.
|
|
508
507
|
*/
|
|
509
508
|
shouldDisableMonth: PropTypes.func,
|
|
510
509
|
/**
|
|
511
510
|
* Disable specific year.
|
|
512
|
-
* @
|
|
513
|
-
* @param {TDate} year The year to test.
|
|
511
|
+
* @param {PickerValidDate} year The year to test.
|
|
514
512
|
* @returns {boolean} If `true`, the year will be disabled.
|
|
515
513
|
*/
|
|
516
514
|
shouldDisableYear: PropTypes.func,
|
|
@@ -2,37 +2,29 @@ import * as React from 'react';
|
|
|
2
2
|
import { SxProps } from '@mui/system';
|
|
3
3
|
import { Theme } from '@mui/material/styles';
|
|
4
4
|
import { SlotComponentProps } from '@mui/utils';
|
|
5
|
+
import { DefaultizedProps } from '@mui/x-internals/types';
|
|
5
6
|
import { PickersCalendarHeader, PickersCalendarHeaderProps, PickersCalendarHeaderSlots, PickersCalendarHeaderSlotProps } from '../PickersCalendarHeader';
|
|
6
7
|
import { DayCalendarSlots, DayCalendarSlotProps, ExportedDayCalendarProps } from './DayCalendar';
|
|
7
8
|
import { DateCalendarClasses } from './dateCalendarClasses';
|
|
8
|
-
import { BaseDateValidationProps
|
|
9
|
+
import { BaseDateValidationProps } from '../internals/models/validation';
|
|
9
10
|
import { ExportedUseViewsOptions } from '../internals/hooks/useViews';
|
|
10
|
-
import { DateView, PickerValidDate, TimezoneProps } from '../models';
|
|
11
|
-
import { DefaultizedProps } from '../internals/models/helpers';
|
|
11
|
+
import { DateView, PickerOwnerState, PickerValidDate, TimezoneProps } from '../models';
|
|
12
12
|
import { ExportedYearCalendarProps, YearCalendarSlots, YearCalendarSlotProps } from '../YearCalendar/YearCalendar.types';
|
|
13
13
|
import { ExportedMonthCalendarProps, MonthCalendarSlots, MonthCalendarSlotProps } from '../MonthCalendar/MonthCalendar.types';
|
|
14
|
-
|
|
14
|
+
import { ExportedValidateDateProps } from '../validation/validateDate';
|
|
15
|
+
import { FormProps } from '../internals/models/formProps';
|
|
16
|
+
export interface DateCalendarSlots extends PickersCalendarHeaderSlots, DayCalendarSlots, MonthCalendarSlots, YearCalendarSlots {
|
|
15
17
|
/**
|
|
16
18
|
* Custom component for calendar header.
|
|
17
19
|
* Check the [PickersCalendarHeader](https://mui.com/x/api/date-pickers/pickers-calendar-header/) component.
|
|
18
20
|
* @default PickersCalendarHeader
|
|
19
21
|
*/
|
|
20
|
-
calendarHeader?: React.ElementType<PickersCalendarHeaderProps
|
|
22
|
+
calendarHeader?: React.ElementType<PickersCalendarHeaderProps>;
|
|
21
23
|
}
|
|
22
|
-
export interface DateCalendarSlotProps
|
|
23
|
-
calendarHeader?: SlotComponentProps<typeof PickersCalendarHeader, {},
|
|
24
|
+
export interface DateCalendarSlotProps extends PickersCalendarHeaderSlotProps, DayCalendarSlotProps, MonthCalendarSlotProps, YearCalendarSlotProps {
|
|
25
|
+
calendarHeader?: SlotComponentProps<typeof PickersCalendarHeader, {}, PickerOwnerState>;
|
|
24
26
|
}
|
|
25
|
-
export interface ExportedDateCalendarProps
|
|
26
|
-
/**
|
|
27
|
-
* If `true`, the picker and text field are disabled.
|
|
28
|
-
* @default false
|
|
29
|
-
*/
|
|
30
|
-
disabled?: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* Make picker read only.
|
|
33
|
-
* @default false
|
|
34
|
-
*/
|
|
35
|
-
readOnly?: boolean;
|
|
27
|
+
export interface ExportedDateCalendarProps extends ExportedDayCalendarProps, ExportedMonthCalendarProps, ExportedYearCalendarProps, ExportedValidateDateProps, TimezoneProps, FormProps {
|
|
36
28
|
/**
|
|
37
29
|
* If `true`, disable heavy animations.
|
|
38
30
|
* @default `@media(prefers-reduced-motion: reduce)` || `navigator.userAgent` matches Android <10 or iOS <13
|
|
@@ -46,33 +38,31 @@ export interface ExportedDateCalendarProps<TDate extends PickerValidDate> extend
|
|
|
46
38
|
renderLoading?: () => React.ReactNode;
|
|
47
39
|
/**
|
|
48
40
|
* Callback fired on year change.
|
|
49
|
-
* @
|
|
50
|
-
* @param {TDate} year The new year.
|
|
41
|
+
* @param {PickerValidDate} year The new year.
|
|
51
42
|
*/
|
|
52
|
-
onYearChange?: (year:
|
|
43
|
+
onYearChange?: (year: PickerValidDate) => void;
|
|
53
44
|
/**
|
|
54
45
|
* Callback fired on month change.
|
|
55
|
-
* @
|
|
56
|
-
* @param {TDate} month The new month.
|
|
46
|
+
* @param {PickerValidDate} month The new month.
|
|
57
47
|
*/
|
|
58
|
-
onMonthChange?: (month:
|
|
48
|
+
onMonthChange?: (month: PickerValidDate) => void;
|
|
59
49
|
}
|
|
60
|
-
export interface DateCalendarProps
|
|
50
|
+
export interface DateCalendarProps extends ExportedDateCalendarProps, ExportedUseViewsOptions<PickerValidDate | null, DateView> {
|
|
61
51
|
/**
|
|
62
52
|
* The selected value.
|
|
63
53
|
* Used when the component is controlled.
|
|
64
54
|
*/
|
|
65
|
-
value?:
|
|
55
|
+
value?: PickerValidDate | null;
|
|
66
56
|
/**
|
|
67
57
|
* The default selected value.
|
|
68
58
|
* Used when the component is not controlled.
|
|
69
59
|
*/
|
|
70
|
-
defaultValue?:
|
|
60
|
+
defaultValue?: PickerValidDate | null;
|
|
71
61
|
/**
|
|
72
62
|
* The date used to generate the new value when both `value` and `defaultValue` are empty.
|
|
73
63
|
* @default The closest valid date using the validation props, except callbacks such as `shouldDisableDate`.
|
|
74
64
|
*/
|
|
75
|
-
referenceDate?:
|
|
65
|
+
referenceDate?: PickerValidDate;
|
|
76
66
|
className?: string;
|
|
77
67
|
/**
|
|
78
68
|
* Override or extend the styles applied to the component.
|
|
@@ -86,11 +76,11 @@ export interface DateCalendarProps<TDate extends PickerValidDate> extends Export
|
|
|
86
76
|
* Overridable component slots.
|
|
87
77
|
* @default {}
|
|
88
78
|
*/
|
|
89
|
-
slots?: DateCalendarSlots
|
|
79
|
+
slots?: DateCalendarSlots;
|
|
90
80
|
/**
|
|
91
81
|
* The props used for each component slot.
|
|
92
82
|
* @default {}
|
|
93
83
|
*/
|
|
94
|
-
slotProps?: DateCalendarSlotProps
|
|
84
|
+
slotProps?: DateCalendarSlotProps;
|
|
95
85
|
}
|
|
96
|
-
export type DateCalendarDefaultizedProps
|
|
86
|
+
export type DateCalendarDefaultizedProps = DefaultizedProps<DateCalendarProps, 'views' | 'openTo' | 'loading' | 'reduceAnimations' | 'renderLoading' | keyof BaseDateValidationProps>;
|
|
@@ -1,26 +1,29 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { DefaultizedProps, SlotComponentPropsFromProps } from '@mui/x-internals/types';
|
|
2
3
|
import { PickersDayProps, ExportedPickersDayProps } from '../PickersDay/PickersDay';
|
|
3
4
|
import { PickerOnChangeFn } from '../internals/hooks/useViews';
|
|
4
5
|
import { SlideDirection, SlideTransitionProps } from './PickersSlideTransition';
|
|
5
6
|
import { BaseDateValidationProps, DayValidationProps, MonthValidationProps, YearValidationProps } from '../internals/models/validation';
|
|
6
7
|
import { DayCalendarClasses } from './dayCalendarClasses';
|
|
7
|
-
import { PickerValidDate, TimezoneProps } from '../models';
|
|
8
|
-
import {
|
|
9
|
-
export interface DayCalendarSlots
|
|
8
|
+
import { PickerOwnerState, PickerValidDate, TimezoneProps } from '../models';
|
|
9
|
+
import { FormProps } from '../internals/models/formProps';
|
|
10
|
+
export interface DayCalendarSlots {
|
|
10
11
|
/**
|
|
11
12
|
* Custom component for day.
|
|
12
13
|
* Check the [PickersDay](https://mui.com/x/api/date-pickers/pickers-day/) component.
|
|
13
14
|
* @default PickersDay
|
|
14
15
|
*/
|
|
15
|
-
day?: React.ElementType<PickersDayProps
|
|
16
|
+
day?: React.ElementType<PickersDayProps>;
|
|
16
17
|
}
|
|
17
|
-
export interface DayCalendarSlotProps
|
|
18
|
-
day?: SlotComponentPropsFromProps<PickersDayProps
|
|
19
|
-
day: TDate;
|
|
20
|
-
selected: boolean;
|
|
21
|
-
}>;
|
|
18
|
+
export interface DayCalendarSlotProps {
|
|
19
|
+
day?: SlotComponentPropsFromProps<PickersDayProps, {}, PickerDayOwnerState>;
|
|
22
20
|
}
|
|
23
|
-
export interface
|
|
21
|
+
export interface PickerDayOwnerState extends PickerOwnerState {
|
|
22
|
+
isDaySelected: boolean;
|
|
23
|
+
isDayDisabled: boolean;
|
|
24
|
+
day: PickerValidDate;
|
|
25
|
+
}
|
|
26
|
+
export interface ExportedDayCalendarProps extends ExportedPickersDayProps {
|
|
24
27
|
/**
|
|
25
28
|
* If `true`, calls `renderLoading` instead of rendering the day calendar.
|
|
26
29
|
* Can be used to preload information and show it in calendar.
|
|
@@ -35,11 +38,11 @@ export interface ExportedDayCalendarProps<TDate extends PickerValidDate> extends
|
|
|
35
38
|
renderLoading?: () => React.ReactNode;
|
|
36
39
|
/**
|
|
37
40
|
* Formats the day of week displayed in the calendar header.
|
|
38
|
-
* @param {
|
|
41
|
+
* @param {PickerValidDate} date The date of the day of week provided by the adapter.
|
|
39
42
|
* @returns {string} The name to display.
|
|
40
|
-
* @default (date:
|
|
43
|
+
* @default (date: PickerValidDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
|
|
41
44
|
*/
|
|
42
|
-
dayOfWeekFormatter?: (date:
|
|
45
|
+
dayOfWeekFormatter?: (date: PickerValidDate) => string;
|
|
43
46
|
/**
|
|
44
47
|
* If `true`, the week number will be display in the calendar.
|
|
45
48
|
*/
|
|
@@ -50,18 +53,16 @@ export interface ExportedDayCalendarProps<TDate extends PickerValidDate> extends
|
|
|
50
53
|
*/
|
|
51
54
|
fixedWeekNumber?: number;
|
|
52
55
|
}
|
|
53
|
-
export interface DayCalendarProps
|
|
56
|
+
export interface DayCalendarProps extends ExportedDayCalendarProps, DayValidationProps, MonthValidationProps, YearValidationProps, Required<BaseDateValidationProps>, DefaultizedProps<TimezoneProps, 'timezone'>, FormProps {
|
|
54
57
|
autoFocus?: boolean;
|
|
55
58
|
className?: string;
|
|
56
|
-
currentMonth:
|
|
57
|
-
selectedDays: (
|
|
58
|
-
onSelectedDaysChange: PickerOnChangeFn
|
|
59
|
-
|
|
60
|
-
focusedDay: TDate | null;
|
|
59
|
+
currentMonth: PickerValidDate;
|
|
60
|
+
selectedDays: (PickerValidDate | null)[];
|
|
61
|
+
onSelectedDaysChange: PickerOnChangeFn;
|
|
62
|
+
focusedDay: PickerValidDate | null;
|
|
61
63
|
isMonthSwitchingAnimating: boolean;
|
|
62
|
-
onFocusedDayChange: (newFocusedDay:
|
|
64
|
+
onFocusedDayChange: (newFocusedDay: PickerValidDate) => void;
|
|
63
65
|
onMonthSwitchingAnimationEnd: () => void;
|
|
64
|
-
readOnly?: boolean;
|
|
65
66
|
reduceAnimations: boolean;
|
|
66
67
|
slideDirection: SlideDirection;
|
|
67
68
|
TransitionProps?: Partial<SlideTransitionProps>;
|
|
@@ -76,14 +77,14 @@ export interface DayCalendarProps<TDate extends PickerValidDate> extends Exporte
|
|
|
76
77
|
* Overridable component slots.
|
|
77
78
|
* @default {}
|
|
78
79
|
*/
|
|
79
|
-
slots?: DayCalendarSlots
|
|
80
|
+
slots?: DayCalendarSlots;
|
|
80
81
|
/**
|
|
81
82
|
* The props used for each component slot.
|
|
82
83
|
* @default {}
|
|
83
84
|
*/
|
|
84
|
-
slotProps?: DayCalendarSlotProps
|
|
85
|
+
slotProps?: DayCalendarSlotProps;
|
|
85
86
|
}
|
|
86
87
|
/**
|
|
87
88
|
* @ignore - do not document.
|
|
88
89
|
*/
|
|
89
|
-
export declare function DayCalendar
|
|
90
|
+
export declare function DayCalendar(inProps: DayCalendarProps): React.JSX.Element;
|
|
@@ -11,18 +11,16 @@ import { styled, useThemeProps } from '@mui/material/styles';
|
|
|
11
11
|
import { unstable_composeClasses as composeClasses, unstable_useControlled as useControlled } from '@mui/utils';
|
|
12
12
|
import clsx from 'clsx';
|
|
13
13
|
import { PickersDay } from "../PickersDay/PickersDay.js";
|
|
14
|
-
import {
|
|
14
|
+
import { usePickerTranslations } from "../hooks/usePickerTranslations.js";
|
|
15
15
|
import { useUtils, useNow } from "../internals/hooks/useUtils.js";
|
|
16
16
|
import { DAY_SIZE, DAY_MARGIN } from "../internals/constants/dimensions.js";
|
|
17
17
|
import { PickersSlideTransition } from "./PickersSlideTransition.js";
|
|
18
18
|
import { useIsDateDisabled } from "./useIsDateDisabled.js";
|
|
19
19
|
import { findClosestEnabledDate, getWeekdays } from "../internals/utils/date-utils.js";
|
|
20
20
|
import { getDayCalendarUtilityClass } from "./dayCalendarClasses.js";
|
|
21
|
+
import { usePickerPrivateContext } from "../internals/hooks/usePickerPrivateContext.js";
|
|
21
22
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
|
-
const useUtilityClasses =
|
|
23
|
-
const {
|
|
24
|
-
classes
|
|
25
|
-
} = ownerState;
|
|
23
|
+
const useUtilityClasses = classes => {
|
|
26
24
|
const slots = {
|
|
27
25
|
root: ['root'],
|
|
28
26
|
header: ['header'],
|
|
@@ -155,9 +153,13 @@ function WrappedDay(_ref) {
|
|
|
155
153
|
} = parentProps;
|
|
156
154
|
const utils = useUtils();
|
|
157
155
|
const now = useNow(timezone);
|
|
156
|
+
const {
|
|
157
|
+
ownerState
|
|
158
|
+
} = usePickerPrivateContext();
|
|
158
159
|
const isFocusableDay = focusableDay !== null && utils.isSameDay(day, focusableDay);
|
|
159
160
|
const isSelected = selectedDays.some(selectedDay => utils.isSameDay(selectedDay, day));
|
|
160
161
|
const isToday = utils.isSameDay(day, now);
|
|
162
|
+
const isDisabled = React.useMemo(() => disabled || isDateDisabled(day), [disabled, isDateDisabled, day]);
|
|
161
163
|
const Day = slots?.day ?? PickersDay;
|
|
162
164
|
// We don't want to pass to ownerState down, to avoid re-rendering all the day whenever a prop changes.
|
|
163
165
|
const _useSlotProps = useSlotProps({
|
|
@@ -171,13 +173,13 @@ function WrappedDay(_ref) {
|
|
|
171
173
|
// it is used in date range dragging logic by accessing `dataset.timestamp`
|
|
172
174
|
'data-timestamp': utils.toJsDate(day).valueOf()
|
|
173
175
|
}, other),
|
|
174
|
-
ownerState: _extends({},
|
|
176
|
+
ownerState: _extends({}, ownerState, {
|
|
175
177
|
day,
|
|
176
|
-
|
|
178
|
+
isDayDisabled: isDisabled,
|
|
179
|
+
isDaySelected: isSelected
|
|
177
180
|
})
|
|
178
181
|
}),
|
|
179
182
|
dayProps = _objectWithoutPropertiesLoose(_useSlotProps, _excluded2);
|
|
180
|
-
const isDisabled = React.useMemo(() => disabled || isDateDisabled(day), [disabled, isDateDisabled, day]);
|
|
181
183
|
const outsideCurrentMonth = React.useMemo(() => utils.getMonth(day) !== currentMonthNumber, [utils, day, currentMonthNumber]);
|
|
182
184
|
const isFirstVisibleCell = React.useMemo(() => {
|
|
183
185
|
const startOfMonth = utils.startOfMonth(utils.setMonth(day, currentMonthNumber));
|
|
@@ -220,6 +222,7 @@ export function DayCalendar(inProps) {
|
|
|
220
222
|
const {
|
|
221
223
|
onFocusedDayChange,
|
|
222
224
|
className,
|
|
225
|
+
classes: classesProp,
|
|
223
226
|
currentMonth,
|
|
224
227
|
selectedDays,
|
|
225
228
|
focusedDay,
|
|
@@ -250,7 +253,7 @@ export function DayCalendar(inProps) {
|
|
|
250
253
|
timezone
|
|
251
254
|
} = props;
|
|
252
255
|
const now = useNow(timezone);
|
|
253
|
-
const classes = useUtilityClasses(
|
|
256
|
+
const classes = useUtilityClasses(classesProp);
|
|
254
257
|
const isRtl = useRtl();
|
|
255
258
|
const isDateDisabled = useIsDateDisabled({
|
|
256
259
|
shouldDisableDate,
|
|
@@ -262,7 +265,7 @@ export function DayCalendar(inProps) {
|
|
|
262
265
|
disableFuture,
|
|
263
266
|
timezone
|
|
264
267
|
});
|
|
265
|
-
const translations =
|
|
268
|
+
const translations = usePickerTranslations();
|
|
266
269
|
const [internalHasFocus, setInternalHasFocus] = useControlled({
|
|
267
270
|
name: 'DayCalendar',
|
|
268
271
|
state: 'hasFocus',
|
package/DateCalendar/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { DateCalendar } from './DateCalendar';
|
|
2
2
|
export type { DateCalendarProps, DateCalendarSlots, DateCalendarSlotProps, } from './DateCalendar.types';
|
|
3
|
+
export type { PickerDayOwnerState } from './DayCalendar';
|
|
3
4
|
export { getDateCalendarUtilityClass, dateCalendarClasses } from './dateCalendarClasses';
|
|
4
5
|
export type { DateCalendarClassKey, DateCalendarClasses } from './dateCalendarClasses';
|
|
5
6
|
export { dayCalendarClasses } from './dayCalendarClasses';
|
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
import { SlideDirection } from './PickersSlideTransition';
|
|
2
2
|
import { MuiPickersAdapter, PickersTimezone, PickerValidDate } from '../models';
|
|
3
3
|
import { DateCalendarDefaultizedProps } from './DateCalendar.types';
|
|
4
|
-
interface CalendarState
|
|
5
|
-
currentMonth:
|
|
6
|
-
focusedDay:
|
|
4
|
+
interface CalendarState {
|
|
5
|
+
currentMonth: PickerValidDate;
|
|
6
|
+
focusedDay: PickerValidDate | null;
|
|
7
7
|
isMonthSwitchingAnimating: boolean;
|
|
8
8
|
slideDirection: SlideDirection;
|
|
9
9
|
}
|
|
10
10
|
type ReducerAction<TType, TAdditional = {}> = {
|
|
11
11
|
type: TType;
|
|
12
12
|
} & TAdditional;
|
|
13
|
-
interface ChangeMonthPayload
|
|
13
|
+
interface ChangeMonthPayload {
|
|
14
14
|
direction: SlideDirection;
|
|
15
|
-
newMonth:
|
|
15
|
+
newMonth: PickerValidDate;
|
|
16
16
|
}
|
|
17
|
-
interface ChangeFocusedDayPayload
|
|
18
|
-
focusedDay:
|
|
17
|
+
interface ChangeFocusedDayPayload {
|
|
18
|
+
focusedDay: PickerValidDate | null;
|
|
19
19
|
/**
|
|
20
20
|
* The update does not trigger month switching animation.
|
|
21
21
|
* For example: when selecting month from the month view.
|
|
22
22
|
*/
|
|
23
23
|
withoutMonthSwitchingAnimation?: boolean;
|
|
24
24
|
}
|
|
25
|
-
export declare const createCalendarStateReducer:
|
|
25
|
+
export declare const createCalendarStateReducer: (reduceAnimations: boolean, disableSwitchToMonthOnDayFocus: boolean, utils: MuiPickersAdapter) => (state: CalendarState, action: ReducerAction<"finishMonthSwitchingAnimation"> | ReducerAction<"changeMonth", ChangeMonthPayload> | ReducerAction<"changeMonthTimezone", {
|
|
26
26
|
newTimezone: string;
|
|
27
|
-
}> | ReducerAction<"changeFocusedDay", ChangeFocusedDayPayload
|
|
28
|
-
interface UseCalendarStateParams
|
|
27
|
+
}> | ReducerAction<"changeFocusedDay", ChangeFocusedDayPayload>) => CalendarState;
|
|
28
|
+
interface UseCalendarStateParams extends Pick<DateCalendarDefaultizedProps, 'value' | 'referenceDate' | 'disableFuture' | 'disablePast' | 'minDate' | 'maxDate' | 'onMonthChange' | 'reduceAnimations' | 'shouldDisableDate'> {
|
|
29
29
|
disableSwitchToMonthOnDayFocus?: boolean;
|
|
30
30
|
timezone: PickersTimezone;
|
|
31
31
|
}
|
|
32
|
-
export declare const useCalendarState:
|
|
32
|
+
export declare const useCalendarState: (params: UseCalendarStateParams) => {
|
|
33
33
|
referenceDate: any;
|
|
34
|
-
calendarState: CalendarState
|
|
35
|
-
changeMonth: (newDate:
|
|
36
|
-
changeFocusedDay: (newFocusedDate:
|
|
37
|
-
isDateDisabled: (day:
|
|
34
|
+
calendarState: CalendarState;
|
|
35
|
+
changeMonth: (newDate: PickerValidDate) => void;
|
|
36
|
+
changeFocusedDay: (newFocusedDate: PickerValidDate | null, withoutMonthSwitchingAnimation?: boolean) => void;
|
|
37
|
+
isDateDisabled: (day: PickerValidDate | null) => boolean;
|
|
38
38
|
onMonthSwitchingAnimationEnd: () => void;
|
|
39
|
-
handleChangeMonth: (payload: ChangeMonthPayload
|
|
39
|
+
handleChangeMonth: (payload: ChangeMonthPayload) => void;
|
|
40
40
|
};
|
|
41
41
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
+
import { DefaultizedProps } from '@mui/x-internals/types';
|
|
1
2
|
import { ValidateDateProps } from '../validation';
|
|
2
3
|
import { PickerValidDate, TimezoneProps } from '../models';
|
|
3
|
-
|
|
4
|
-
export declare const useIsDateDisabled: <TDate extends PickerValidDate>({ shouldDisableDate, shouldDisableMonth, shouldDisableYear, minDate, maxDate, disableFuture, disablePast, timezone, }: ValidateDateProps<TDate> & DefaultizedProps<TimezoneProps, "timezone">) => (day: TDate | null) => boolean;
|
|
4
|
+
export declare const useIsDateDisabled: ({ shouldDisableDate, shouldDisableMonth, shouldDisableYear, minDate, maxDate, disableFuture, disablePast, timezone, }: ValidateDateProps & DefaultizedProps<TimezoneProps, "timezone">) => (day: PickerValidDate | null) => boolean;
|
package/DateField/DateField.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { DateFieldProps } from './DateField.types';
|
|
3
|
-
|
|
4
|
-
type DateFieldComponent = (<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean = false>(props: DateFieldProps<TDate, TEnableAccessibleFieldDOMStructure> & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
|
|
3
|
+
type DateFieldComponent = (<TEnableAccessibleFieldDOMStructure extends boolean = true>(props: DateFieldProps<TEnableAccessibleFieldDOMStructure> & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
|
|
5
4
|
propTypes?: any;
|
|
6
5
|
};
|
|
7
6
|
/**
|
package/DateField/DateField.js
CHANGED
|
@@ -37,7 +37,7 @@ const DateField = /*#__PURE__*/React.forwardRef(function DateField(inProps, inRe
|
|
|
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,
|
|
@@ -89,6 +89,7 @@ process.env.NODE_ENV !== "production" ? DateField.propTypes = {
|
|
|
89
89
|
defaultValue: PropTypes.object,
|
|
90
90
|
/**
|
|
91
91
|
* If `true`, the component is disabled.
|
|
92
|
+
* When disabled, the value cannot be changed and no interaction is possible.
|
|
92
93
|
* @default false
|
|
93
94
|
*/
|
|
94
95
|
disabled: PropTypes.bool,
|
|
@@ -103,7 +104,7 @@ process.env.NODE_ENV !== "production" ? DateField.propTypes = {
|
|
|
103
104
|
*/
|
|
104
105
|
disablePast: PropTypes.bool,
|
|
105
106
|
/**
|
|
106
|
-
* @default
|
|
107
|
+
* @default true
|
|
107
108
|
*/
|
|
108
109
|
enableAccessibleFieldDOMStructure: PropTypes.bool,
|
|
109
110
|
/**
|
|
@@ -218,8 +219,8 @@ process.env.NODE_ENV !== "production" ? DateField.propTypes = {
|
|
|
218
219
|
*/
|
|
219
220
|
onSelectedSectionsChange: PropTypes.func,
|
|
220
221
|
/**
|
|
221
|
-
*
|
|
222
|
-
*
|
|
222
|
+
* If `true`, the component is read-only.
|
|
223
|
+
* When read-only, the value cannot be changed but the user can interact with the interface.
|
|
223
224
|
* @default false
|
|
224
225
|
*/
|
|
225
226
|
readOnly: PropTypes.bool,
|
|
@@ -249,22 +250,19 @@ process.env.NODE_ENV !== "production" ? DateField.propTypes = {
|
|
|
249
250
|
*
|
|
250
251
|
* 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.
|
|
251
252
|
*
|
|
252
|
-
* @
|
|
253
|
-
* @param {TDate} day The date to test.
|
|
253
|
+
* @param {PickerValidDate} day The date to test.
|
|
254
254
|
* @returns {boolean} If `true` the date will be disabled.
|
|
255
255
|
*/
|
|
256
256
|
shouldDisableDate: PropTypes.func,
|
|
257
257
|
/**
|
|
258
258
|
* Disable specific month.
|
|
259
|
-
* @
|
|
260
|
-
* @param {TDate} month The month to test.
|
|
259
|
+
* @param {PickerValidDate} month The month to test.
|
|
261
260
|
* @returns {boolean} If `true`, the month will be disabled.
|
|
262
261
|
*/
|
|
263
262
|
shouldDisableMonth: PropTypes.func,
|
|
264
263
|
/**
|
|
265
264
|
* Disable specific year.
|
|
266
|
-
* @
|
|
267
|
-
* @param {TDate} year The year to test.
|
|
265
|
+
* @param {PickerValidDate} year The year to test.
|
|
268
266
|
* @returns {boolean} If `true`, the year will be disabled.
|
|
269
267
|
*/
|
|
270
268
|
shouldDisableYear: PropTypes.func,
|
|
@@ -1,15 +1,14 @@
|
|
|
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 { ExportedUseClearableFieldProps, UseClearableFieldSlots, UseClearableFieldSlotProps } from '../hooks/useClearableField';
|
|
5
6
|
import { DateValidationError, FieldSection, PickerValidDate, BuiltInFieldTextFieldProps } from '../models';
|
|
6
7
|
import { UseFieldInternalProps } from '../internals/hooks/useField';
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
export interface UseDateFieldProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean> extends MakeOptional<UseFieldInternalProps<TDate | null, TDate, FieldSection, TEnableAccessibleFieldDOMStructure, DateValidationError>, 'format'>, DayValidationProps<TDate>, MonthValidationProps<TDate>, YearValidationProps<TDate>, BaseDateValidationProps<TDate>, ExportedUseClearableFieldProps {
|
|
8
|
+
import { ExportedValidateDateProps } from '../validation/validateDate';
|
|
9
|
+
export interface UseDateFieldProps<TEnableAccessibleFieldDOMStructure extends boolean> extends MakeOptional<UseFieldInternalProps<PickerValidDate | null, FieldSection, TEnableAccessibleFieldDOMStructure, DateValidationError>, 'format'>, ExportedValidateDateProps, ExportedUseClearableFieldProps {
|
|
10
10
|
}
|
|
11
|
-
export type
|
|
12
|
-
export type DateFieldProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean = false> = UseDateFieldComponentProps<TDate, TEnableAccessibleFieldDOMStructure, BuiltInFieldTextFieldProps<TEnableAccessibleFieldDOMStructure>> & {
|
|
11
|
+
export type DateFieldProps<TEnableAccessibleFieldDOMStructure extends boolean = true> = UseDateFieldProps<TEnableAccessibleFieldDOMStructure> & Omit<BuiltInFieldTextFieldProps<TEnableAccessibleFieldDOMStructure>, keyof UseDateFieldProps<TEnableAccessibleFieldDOMStructure>> & {
|
|
13
12
|
/**
|
|
14
13
|
* Overridable component slots.
|
|
15
14
|
* @default {}
|
|
@@ -19,9 +18,9 @@ export type DateFieldProps<TDate extends PickerValidDate, TEnableAccessibleField
|
|
|
19
18
|
* The props used for each component slot.
|
|
20
19
|
* @default {}
|
|
21
20
|
*/
|
|
22
|
-
slotProps?: DateFieldSlotProps<
|
|
21
|
+
slotProps?: DateFieldSlotProps<TEnableAccessibleFieldDOMStructure>;
|
|
23
22
|
};
|
|
24
|
-
export type DateFieldOwnerState<
|
|
23
|
+
export type DateFieldOwnerState<TEnableAccessibleFieldDOMStructure extends boolean> = DateFieldProps<TEnableAccessibleFieldDOMStructure>;
|
|
25
24
|
export interface DateFieldSlots extends UseClearableFieldSlots {
|
|
26
25
|
/**
|
|
27
26
|
* Form control with an input to render the value.
|
|
@@ -29,6 +28,6 @@ export interface DateFieldSlots extends UseClearableFieldSlots {
|
|
|
29
28
|
*/
|
|
30
29
|
textField?: React.ElementType;
|
|
31
30
|
}
|
|
32
|
-
export interface DateFieldSlotProps<
|
|
33
|
-
textField?: SlotComponentProps<typeof TextField, {}, DateFieldOwnerState<
|
|
31
|
+
export interface DateFieldSlotProps<TEnableAccessibleFieldDOMStructure extends boolean> extends UseClearableFieldSlotProps {
|
|
32
|
+
textField?: SlotComponentProps<typeof TextField, {}, DateFieldOwnerState<TEnableAccessibleFieldDOMStructure>>;
|
|
34
33
|
}
|
package/DateField/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { DateField } from './DateField';
|
|
2
2
|
export { useDateField as unstable_useDateField } from './useDateField';
|
|
3
|
-
export type { UseDateFieldProps,
|
|
3
|
+
export type { UseDateFieldProps, DateFieldProps } from './DateField.types';
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import { UseDateFieldProps } from './DateField.types';
|
|
2
|
-
import
|
|
3
|
-
export declare const useDateField: <TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean, TAllProps extends UseDateFieldProps<TDate, TEnableAccessibleFieldDOMStructure>>(inProps: TAllProps) => import("../internals").UseFieldResponse<TEnableAccessibleFieldDOMStructure, Omit<TAllProps & Omit<UseDateFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, keyof import("../internals/hooks/defaultizedFieldProps").UseDefaultizedDateFieldBaseProps<any>> & Required<Pick<UseDateFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, keyof import("../internals/hooks/defaultizedFieldProps").UseDefaultizedDateFieldBaseProps<any>>>, "disabled" | "format" | "onChange" | "onError" | "defaultValue" | "value" | "readOnly" | "timezone" | "referenceDate" | "formatDensity" | "shouldRespectLeadingZeros" | "selectedSections" | "onSelectedSectionsChange" | "unstableFieldRef" | "enableAccessibleFieldDOMStructure" | "shouldDisableDate" | "shouldDisableMonth" | "shouldDisableYear" | keyof import("../internals").BaseDateValidationProps<any> | "dateSeparator">>;
|
|
2
|
+
export declare const useDateField: <TEnableAccessibleFieldDOMStructure extends boolean, TAllProps extends UseDateFieldProps<TEnableAccessibleFieldDOMStructure>>(inProps: TAllProps) => import("../internals").UseFieldResponse<TEnableAccessibleFieldDOMStructure, Omit<TAllProps & Omit<UseDateFieldProps<TEnableAccessibleFieldDOMStructure>, keyof import("../internals/hooks/defaultizedFieldProps").UseDefaultizedDateFieldBaseProps> & Required<Pick<UseDateFieldProps<TEnableAccessibleFieldDOMStructure>, keyof import("../internals/hooks/defaultizedFieldProps").UseDefaultizedDateFieldBaseProps>>, "disabled" | "format" | "onChange" | "onError" | "defaultValue" | "value" | "readOnly" | "formatDensity" | "enableAccessibleFieldDOMStructure" | "selectedSections" | "onSelectedSectionsChange" | "timezone" | "unstableFieldRef" | "referenceDate" | "shouldRespectLeadingZeros" | "shouldDisableDate" | "shouldDisableMonth" | "shouldDisableYear" | keyof import("../internals").BaseDateValidationProps | "dateSeparator">>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { DatePickerProps } from './DatePicker.types';
|
|
3
|
-
|
|
4
|
-
type DatePickerComponent = (<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean = false>(props: DatePickerProps<TDate, TEnableAccessibleFieldDOMStructure> & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
|
|
3
|
+
type DatePickerComponent = (<TEnableAccessibleFieldDOMStructure extends boolean = true>(props: DatePickerProps<TEnableAccessibleFieldDOMStructure> & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
|
|
5
4
|
propTypes?: any;
|
|
6
5
|
};
|
|
7
6
|
/**
|