@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
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { FieldSectionType, FieldSection, FieldSelectedSections, MuiPickersAdapter, TimezoneProps, FieldSectionContentType,
|
|
2
|
+
import { FieldSectionType, FieldSection, FieldSelectedSections, MuiPickersAdapter, TimezoneProps, FieldSectionContentType, PickerValidDate, FieldRef, OnErrorProps, InferError, PickerValueType } from '../../../models';
|
|
3
3
|
import type { PickerValueManager } from '../usePicker';
|
|
4
4
|
import type { Validator } from '../../../validation';
|
|
5
5
|
import type { UseFieldStateResponse } from './useFieldState';
|
|
6
6
|
import type { UseFieldCharacterEditingResponse } from './useFieldCharacterEditing';
|
|
7
7
|
import { PickersSectionElement, PickersSectionListRef } from '../../../PickersSectionList';
|
|
8
8
|
import { ExportedUseClearableFieldProps } from '../../../hooks/useClearableField';
|
|
9
|
-
|
|
9
|
+
import { FormProps } from '../../models';
|
|
10
|
+
export interface UseFieldParams<TValue, TSection extends FieldSection, TEnableAccessibleFieldDOMStructure extends boolean, TForwardedProps extends UseFieldCommonForwardedProps & UseFieldForwardedProps<TEnableAccessibleFieldDOMStructure>, TInternalProps extends UseFieldInternalProps<any, any, TEnableAccessibleFieldDOMStructure, any>> {
|
|
10
11
|
forwardedProps: TForwardedProps;
|
|
11
12
|
internalProps: TInternalProps;
|
|
12
|
-
valueManager: PickerValueManager<TValue,
|
|
13
|
-
fieldValueManager: FieldValueManager<TValue,
|
|
14
|
-
validator: Validator<TValue,
|
|
15
|
-
valueType:
|
|
13
|
+
valueManager: PickerValueManager<TValue, InferError<TInternalProps>>;
|
|
14
|
+
fieldValueManager: FieldValueManager<TValue, TSection>;
|
|
15
|
+
validator: Validator<TValue, InferError<TInternalProps>, TInternalProps>;
|
|
16
|
+
valueType: PickerValueType;
|
|
16
17
|
}
|
|
17
|
-
export interface UseFieldInternalProps<TValue,
|
|
18
|
+
export interface UseFieldInternalProps<TValue, TSection extends FieldSection, TEnableAccessibleFieldDOMStructure extends boolean, TError> extends TimezoneProps, FormProps, OnErrorProps<TValue, TError> {
|
|
18
19
|
/**
|
|
19
20
|
* The selected value.
|
|
20
21
|
* Used when the component is controlled.
|
|
@@ -29,7 +30,7 @@ export interface UseFieldInternalProps<TValue, TDate extends PickerValidDate, TS
|
|
|
29
30
|
* For example, on time fields it will be used to determine the date to set.
|
|
30
31
|
* @default The closest valid date using the validation props, except callbacks such as `shouldDisableDate`. Value is rounded to the most granular section used.
|
|
31
32
|
*/
|
|
32
|
-
referenceDate?:
|
|
33
|
+
referenceDate?: PickerValidDate;
|
|
33
34
|
/**
|
|
34
35
|
* Callback fired when the value changes.
|
|
35
36
|
* @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
|
|
@@ -63,12 +64,6 @@ export interface UseFieldInternalProps<TValue, TDate extends PickerValidDate, TS
|
|
|
63
64
|
* @default false
|
|
64
65
|
*/
|
|
65
66
|
shouldRespectLeadingZeros?: boolean;
|
|
66
|
-
/**
|
|
67
|
-
* It prevents the user from changing the value of the field
|
|
68
|
-
* (not from interacting with the field).
|
|
69
|
-
* @default false
|
|
70
|
-
*/
|
|
71
|
-
readOnly?: boolean;
|
|
72
67
|
/**
|
|
73
68
|
* The currently selected sections.
|
|
74
69
|
* This prop accepts four formats:
|
|
@@ -89,7 +84,7 @@ export interface UseFieldInternalProps<TValue, TDate extends PickerValidDate, TS
|
|
|
89
84
|
*/
|
|
90
85
|
unstableFieldRef?: React.Ref<FieldRef<TSection>>;
|
|
91
86
|
/**
|
|
92
|
-
* @default
|
|
87
|
+
* @default true
|
|
93
88
|
*/
|
|
94
89
|
enableAccessibleFieldDOMStructure?: TEnableAccessibleFieldDOMStructure;
|
|
95
90
|
/**
|
|
@@ -97,13 +92,8 @@ export interface UseFieldInternalProps<TValue, TDate extends PickerValidDate, TS
|
|
|
97
92
|
* @default false
|
|
98
93
|
*/
|
|
99
94
|
autoFocus?: boolean;
|
|
100
|
-
/**
|
|
101
|
-
* If `true`, the component is disabled.
|
|
102
|
-
* @default false
|
|
103
|
-
*/
|
|
104
|
-
disabled?: boolean;
|
|
105
95
|
}
|
|
106
|
-
export interface UseFieldCommonAdditionalProps extends Required<Pick<UseFieldInternalProps<any, any, any, any
|
|
96
|
+
export interface UseFieldCommonAdditionalProps extends Required<Pick<UseFieldInternalProps<any, any, any, any>, 'disabled' | 'readOnly'>> {
|
|
107
97
|
}
|
|
108
98
|
export interface UseFieldCommonForwardedProps extends ExportedUseClearableFieldProps {
|
|
109
99
|
onKeyDown?: React.KeyboardEventHandler;
|
|
@@ -143,18 +133,18 @@ interface UseFieldV7AdditionalProps {
|
|
|
143
133
|
export type UseFieldResponse<TEnableAccessibleFieldDOMStructure extends boolean, TForwardedProps extends UseFieldCommonForwardedProps & {
|
|
144
134
|
[key: string]: any;
|
|
145
135
|
}> = Omit<TForwardedProps, keyof UseFieldCommonForwardedProps> & Required<UseFieldCommonForwardedProps> & UseFieldCommonAdditionalProps & (TEnableAccessibleFieldDOMStructure extends false ? UseFieldV6AdditionalProps & Required<UseFieldV6ForwardedProps> : UseFieldV7AdditionalProps & Required<UseFieldV7ForwardedProps>);
|
|
146
|
-
export type FieldSectionValueBoundaries<
|
|
136
|
+
export type FieldSectionValueBoundaries<SectionType extends FieldSectionType> = {
|
|
147
137
|
minimum: number;
|
|
148
138
|
maximum: number;
|
|
149
139
|
} & (SectionType extends 'day' ? {
|
|
150
|
-
longestMonth:
|
|
140
|
+
longestMonth: PickerValidDate;
|
|
151
141
|
} : {});
|
|
152
|
-
export type FieldSectionsValueBoundaries
|
|
142
|
+
export type FieldSectionsValueBoundaries = {
|
|
153
143
|
[SectionType in FieldSectionType]: (params: {
|
|
154
|
-
currentDate:
|
|
144
|
+
currentDate: PickerValidDate | null;
|
|
155
145
|
format: string;
|
|
156
146
|
contentType: FieldSectionContentType;
|
|
157
|
-
}) => FieldSectionValueBoundaries<
|
|
147
|
+
}) => FieldSectionValueBoundaries<SectionType>;
|
|
158
148
|
};
|
|
159
149
|
export type FieldSectionsBoundaries = {
|
|
160
150
|
[SectionType in FieldSectionType]: {
|
|
@@ -170,15 +160,15 @@ export interface FieldChangeHandlerContext<TError> {
|
|
|
170
160
|
* Object used to access and update the active date (i.e: the date containing the active section).
|
|
171
161
|
* Mainly useful in the range fields where we need to update the date containing the active section without impacting the other one.
|
|
172
162
|
*/
|
|
173
|
-
interface FieldActiveDateManager<TValue,
|
|
163
|
+
interface FieldActiveDateManager<TValue, TSection extends FieldSection> {
|
|
174
164
|
/**
|
|
175
165
|
* Active date from `state.value`.
|
|
176
166
|
*/
|
|
177
|
-
date:
|
|
167
|
+
date: PickerValidDate | null;
|
|
178
168
|
/**
|
|
179
169
|
* Active date from the `state.referenceValue`.
|
|
180
170
|
*/
|
|
181
|
-
referenceDate:
|
|
171
|
+
referenceDate: PickerValidDate;
|
|
182
172
|
/**
|
|
183
173
|
* @template TSection
|
|
184
174
|
* @param {TSection[]} sections The sections of the full value.
|
|
@@ -188,25 +178,25 @@ interface FieldActiveDateManager<TValue, TDate extends PickerValidDate, TSection
|
|
|
188
178
|
getSections: (sections: TSection[]) => TSection[];
|
|
189
179
|
/**
|
|
190
180
|
* Creates the new value and reference value based on the new active date and the current state.
|
|
191
|
-
* @template TValue
|
|
192
|
-
* @param {
|
|
181
|
+
* @template TValue
|
|
182
|
+
* @param {PickerValidDate | null} newActiveDate The new value of the date containing the active section.
|
|
193
183
|
* @returns {Pick<UseFieldState<TValue, any>, 'value' | 'referenceValue'>} The new value and reference value to publish and store in the state.
|
|
194
184
|
*/
|
|
195
|
-
getNewValuesFromNewActiveDate: (newActiveDate:
|
|
185
|
+
getNewValuesFromNewActiveDate: (newActiveDate: PickerValidDate | null) => Pick<UseFieldState<TValue, any>, 'value' | 'referenceValue'>;
|
|
196
186
|
}
|
|
197
187
|
export type FieldParsedSelectedSections = number | 'all' | null;
|
|
198
|
-
export interface FieldValueManager<TValue,
|
|
188
|
+
export interface FieldValueManager<TValue, TSection extends FieldSection> {
|
|
199
189
|
/**
|
|
200
190
|
* Creates the section list from the current value.
|
|
201
191
|
* The `prevSections` are used on the range fields to avoid losing the sections of a partially filled date when editing the other date.
|
|
202
|
-
* @template TValue,
|
|
203
|
-
* @param {MuiPickersAdapter
|
|
192
|
+
* @template TValue, TSection
|
|
193
|
+
* @param {MuiPickersAdapter} utils The utils to manipulate the date.
|
|
204
194
|
* @param {TValue} value The current value to generate sections from.
|
|
205
195
|
* @param {TSection[] | null} fallbackSections The sections to use as a fallback if a date is null or invalid.
|
|
206
|
-
* @param {(date:
|
|
196
|
+
* @param {(date: PickerValidDate) => FieldSection[]} getSectionsFromDate Returns the sections of the given date.
|
|
207
197
|
* @returns {TSection[]} The new section list.
|
|
208
198
|
*/
|
|
209
|
-
getSectionsFromValue: (utils: MuiPickersAdapter
|
|
199
|
+
getSectionsFromValue: (utils: MuiPickersAdapter, value: TValue, fallbackSections: TSection[] | null, getSectionsFromDate: (date: PickerValidDate) => FieldSection[]) => TSection[];
|
|
210
200
|
/**
|
|
211
201
|
* Creates the string value to render in the input based on the current section list.
|
|
212
202
|
* @template TSection
|
|
@@ -225,33 +215,33 @@ export interface FieldValueManager<TValue, TDate extends PickerValidDate, TSecti
|
|
|
225
215
|
getV7HiddenInputValueFromSections: (sections: TSection[]) => string;
|
|
226
216
|
/**
|
|
227
217
|
* Returns the manager of the active date.
|
|
228
|
-
* @template TValue,
|
|
229
|
-
* @param {MuiPickersAdapter
|
|
218
|
+
* @template TValue, TSection
|
|
219
|
+
* @param {MuiPickersAdapter} utils The utils to manipulate the date.
|
|
230
220
|
* @param {UseFieldState<TValue, TSection>} state The current state of the field.
|
|
231
221
|
* @param {TSection} activeSection The active section.
|
|
232
|
-
* @returns {FieldActiveDateManager<TValue,
|
|
222
|
+
* @returns {FieldActiveDateManager<TValue, TSection>} The manager of the active date.
|
|
233
223
|
*/
|
|
234
|
-
getActiveDateManager: (utils: MuiPickersAdapter
|
|
224
|
+
getActiveDateManager: (utils: MuiPickersAdapter, state: UseFieldState<TValue, TSection>, activeSection: TSection) => FieldActiveDateManager<TValue, TSection>;
|
|
235
225
|
/**
|
|
236
226
|
* Parses a string version (most of the time coming from the input).
|
|
237
227
|
* This method should only be used when the change does not come from a single section.
|
|
238
|
-
* @template TValue
|
|
228
|
+
* @template TValue
|
|
239
229
|
* @param {string} valueStr The string value to parse.
|
|
240
230
|
* @param {TValue} referenceValue The reference value currently stored in state.
|
|
241
|
-
* @param {(dateStr: string, referenceDate:
|
|
231
|
+
* @param {(dateStr: string, referenceDate: PickerValidDate) => PickerValidDate | null} parseDate A method to convert a string date into a parsed one.
|
|
242
232
|
* @returns {TValue} The new parsed value.
|
|
243
233
|
*/
|
|
244
|
-
parseValueStr: (valueStr: string, referenceValue: TValue, parseDate: (dateStr: string, referenceDate:
|
|
234
|
+
parseValueStr: (valueStr: string, referenceValue: TValue, parseDate: (dateStr: string, referenceDate: PickerValidDate) => PickerValidDate | null) => TValue;
|
|
245
235
|
/**
|
|
246
236
|
* Update the reference value with the new value.
|
|
247
237
|
* This method must make sure that no date inside the returned `referenceValue` is invalid.
|
|
248
|
-
* @template TValue
|
|
249
|
-
* @param {MuiPickersAdapter
|
|
238
|
+
* @template TValue
|
|
239
|
+
* @param {MuiPickersAdapter} utils The utils to manipulate the date.
|
|
250
240
|
* @param {TValue} value The new value from which we want to take all valid dates in the `referenceValue` state.
|
|
251
241
|
* @param {TValue} prevReferenceValue The previous reference value. It is used as a fallback for invalid dates in the new value.
|
|
252
242
|
* @returns {TValue} The new reference value with no invalid date.
|
|
253
243
|
*/
|
|
254
|
-
updateReferenceValue: (utils: MuiPickersAdapter
|
|
244
|
+
updateReferenceValue: (utils: MuiPickersAdapter, value: TValue, prevReferenceValue: TValue) => TValue;
|
|
255
245
|
}
|
|
256
246
|
export interface UseFieldState<TValue, TSection extends FieldSection> {
|
|
257
247
|
value: TValue;
|
|
@@ -327,13 +317,13 @@ export interface UseFieldTextFieldInteractions {
|
|
|
327
317
|
setSelectedSections: (newSelectedSections: FieldSelectedSections) => void;
|
|
328
318
|
isFieldFocused: () => boolean;
|
|
329
319
|
}
|
|
330
|
-
export type UseFieldTextField<TEnableAccessibleFieldDOMStructure extends boolean> = <TValue,
|
|
320
|
+
export type UseFieldTextField<TEnableAccessibleFieldDOMStructure extends boolean> = <TValue, TSection extends FieldSection, TForwardedProps extends TEnableAccessibleFieldDOMStructure extends false ? UseFieldV6ForwardedProps : UseFieldV7ForwardedProps, TInternalProps extends UseFieldInternalProps<any, any, TEnableAccessibleFieldDOMStructure, any> & {
|
|
331
321
|
minutesStep?: number;
|
|
332
|
-
}>(params: UseFieldTextFieldParams<TValue,
|
|
322
|
+
}>(params: UseFieldTextFieldParams<TValue, TSection, TEnableAccessibleFieldDOMStructure, TForwardedProps, TInternalProps>) => {
|
|
333
323
|
interactions: UseFieldTextFieldInteractions;
|
|
334
324
|
returnedValue: TEnableAccessibleFieldDOMStructure extends false ? UseFieldV6AdditionalProps & Required<UseFieldV6ForwardedProps> : UseFieldV7AdditionalProps & Required<UseFieldV7ForwardedProps>;
|
|
335
325
|
};
|
|
336
|
-
interface UseFieldTextFieldParams<TValue,
|
|
326
|
+
interface UseFieldTextFieldParams<TValue, TSection extends FieldSection, TEnableAccessibleFieldDOMStructure extends boolean, TForwardedProps extends TEnableAccessibleFieldDOMStructure extends false ? UseFieldV6ForwardedProps : UseFieldV7ForwardedProps, TInternalProps extends UseFieldInternalProps<any, any, TEnableAccessibleFieldDOMStructure, any>> extends UseFieldParams<TValue, TSection, TEnableAccessibleFieldDOMStructure, TForwardedProps, TInternalProps>, UseFieldStateResponse<TValue, TSection>, UseFieldCharacterEditingResponse {
|
|
337
327
|
areAllSectionsEmpty: boolean;
|
|
338
328
|
sectionOrder: SectionOrdering;
|
|
339
329
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { AvailableAdjustKeyCode, FieldSectionsValueBoundaries, SectionOrdering, FieldSectionValueBoundaries, FieldParsedSelectedSections } from './useField.types';
|
|
2
|
-
import { FieldSectionType,
|
|
3
|
-
export declare const getDateSectionConfigFromFormatToken:
|
|
2
|
+
import { FieldSectionType, FieldSection, MuiPickersAdapter, FieldSectionContentType, PickersTimezone, PickerValidDate, FieldSelectedSections, PickerValueType } from '../../../models';
|
|
3
|
+
export declare const getDateSectionConfigFromFormatToken: (utils: MuiPickersAdapter, formatToken: string) => Pick<FieldSection, "type" | "contentType"> & {
|
|
4
4
|
maxLength: number | undefined;
|
|
5
5
|
};
|
|
6
|
-
export declare const getDaysInWeekStr:
|
|
7
|
-
export declare const getLetterEditingOptions:
|
|
6
|
+
export declare const getDaysInWeekStr: (utils: MuiPickersAdapter, format: string) => string[];
|
|
7
|
+
export declare const getLetterEditingOptions: (utils: MuiPickersAdapter, timezone: PickersTimezone, sectionType: FieldSectionType, format: string) => string[];
|
|
8
8
|
export declare const FORMAT_SECONDS_NO_LEADING_ZEROS = "s";
|
|
9
|
-
export declare const getLocalizedDigits:
|
|
9
|
+
export declare const getLocalizedDigits: (utils: MuiPickersAdapter) => string[];
|
|
10
10
|
export declare const removeLocalizedDigits: (valueStr: string, localizedDigits: string[]) => string;
|
|
11
11
|
export declare const applyLocalizedDigits: (valueStr: string, localizedDigits: string[]) => string;
|
|
12
12
|
export declare const isStringNumber: (valueStr: string, localizedDigits: string[]) => boolean;
|
|
@@ -16,25 +16,25 @@ export declare const isStringNumber: (valueStr: string, localizedDigits: string[
|
|
|
16
16
|
* Warning: Should only be called with non-localized digits. Call `removeLocalizedDigits` with your value if needed.
|
|
17
17
|
*/
|
|
18
18
|
export declare const cleanLeadingZeros: (valueStr: string, size: number) => string;
|
|
19
|
-
export declare const cleanDigitSectionValue:
|
|
20
|
-
export declare const adjustSectionValue: <
|
|
19
|
+
export declare const cleanDigitSectionValue: (utils: MuiPickersAdapter, value: number, sectionBoundaries: FieldSectionValueBoundaries<any>, localizedDigits: string[], section: Pick<FieldSection, "format" | "type" | "contentType" | "hasLeadingZerosInFormat" | "hasLeadingZerosInInput" | "maxLength">) => string;
|
|
20
|
+
export declare const adjustSectionValue: <TSection extends FieldSection>(utils: MuiPickersAdapter, timezone: PickersTimezone, section: TSection, keyCode: AvailableAdjustKeyCode, sectionsValueBoundaries: FieldSectionsValueBoundaries, localizedDigits: string[], activeDate: PickerValidDate | null, stepsAttributes?: {
|
|
21
21
|
minutesStep?: number;
|
|
22
22
|
}) => string;
|
|
23
23
|
export declare const getSectionVisibleValue: (section: FieldSection, target: "input-rtl" | "input-ltr" | "non-input", localizedDigits: string[]) => string;
|
|
24
|
-
export declare const changeSectionValueFormat:
|
|
25
|
-
export declare const doesSectionFormatHaveLeadingZeros:
|
|
24
|
+
export declare const changeSectionValueFormat: (utils: MuiPickersAdapter, valueStr: string, currentFormat: string, newFormat: string) => string;
|
|
25
|
+
export declare const doesSectionFormatHaveLeadingZeros: (utils: MuiPickersAdapter, contentType: FieldSectionContentType, sectionType: FieldSectionType, format: string) => boolean;
|
|
26
26
|
/**
|
|
27
27
|
* Some date libraries like `dayjs` don't support parsing from date with escaped characters.
|
|
28
28
|
* To make sure that the parsing works, we are building a format and a date without any separator.
|
|
29
29
|
*/
|
|
30
|
-
export declare const getDateFromDateSections:
|
|
30
|
+
export declare const getDateFromDateSections: (utils: MuiPickersAdapter, sections: FieldSection[], localizedDigits: string[]) => PickerValidDate;
|
|
31
31
|
export declare const createDateStrForV7HiddenInputFromSections: (sections: FieldSection[]) => string;
|
|
32
32
|
export declare const createDateStrForV6InputFromSections: (sections: FieldSection[], localizedDigits: string[], isRtl: boolean) => string;
|
|
33
|
-
export declare const getSectionsBoundaries:
|
|
34
|
-
export declare const validateSections: <TSection extends FieldSection>(sections: TSection[], valueType:
|
|
35
|
-
export declare const mergeDateIntoReferenceDate:
|
|
33
|
+
export declare const getSectionsBoundaries: (utils: MuiPickersAdapter, localizedDigits: string[], timezone: PickersTimezone) => FieldSectionsValueBoundaries;
|
|
34
|
+
export declare const validateSections: <TSection extends FieldSection>(sections: TSection[], valueType: PickerValueType) => void;
|
|
35
|
+
export declare const mergeDateIntoReferenceDate: (utils: MuiPickersAdapter, dateToTransferFrom: PickerValidDate, sections: FieldSection[], referenceDate: PickerValidDate, shouldLimitToEditedSections: boolean) => PickerValidDate;
|
|
36
36
|
export declare const isAndroid: () => boolean;
|
|
37
37
|
export declare const getSectionOrder: (sections: FieldSection[], shouldApplyRTL: boolean) => SectionOrdering;
|
|
38
38
|
export declare const parseSelectedSections: (selectedSections: FieldSelectedSections, sections: FieldSection[]) => FieldParsedSelectedSections;
|
|
39
|
-
export declare const getSectionValueText:
|
|
40
|
-
export declare const getSectionValueNow:
|
|
39
|
+
export declare const getSectionValueText: (section: FieldSection, utils: MuiPickersAdapter) => string | undefined;
|
|
40
|
+
export declare const getSectionValueNow: (section: FieldSection, utils: MuiPickersAdapter) => number | undefined;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { FieldSection, PickersTimezone
|
|
1
|
+
import { FieldSection, PickersTimezone } from '../../../models';
|
|
2
2
|
import { FieldSectionsValueBoundaries } from './useField.types';
|
|
3
3
|
import { UpdateSectionValueParams } from './useFieldState';
|
|
4
4
|
export interface ApplyCharacterEditingParams {
|
|
5
5
|
keyPressed: string;
|
|
6
6
|
sectionIndex: number;
|
|
7
7
|
}
|
|
8
|
-
interface UseFieldCharacterEditingParams<
|
|
8
|
+
interface UseFieldCharacterEditingParams<TSection extends FieldSection> {
|
|
9
9
|
sections: TSection[];
|
|
10
10
|
updateSectionValue: (params: UpdateSectionValueParams<TSection>) => void;
|
|
11
|
-
sectionsValueBoundaries: FieldSectionsValueBoundaries
|
|
11
|
+
sectionsValueBoundaries: FieldSectionsValueBoundaries;
|
|
12
12
|
localizedDigits: string[];
|
|
13
13
|
setTempAndroidValueStr: (newValue: string | null) => void;
|
|
14
14
|
timezone: PickersTimezone;
|
|
@@ -24,5 +24,5 @@ export interface UseFieldCharacterEditingResponse {
|
|
|
24
24
|
* 1. The numeric editing when the user presses a digit
|
|
25
25
|
* 2. The letter editing when the user presses another key
|
|
26
26
|
*/
|
|
27
|
-
export declare const useFieldCharacterEditing: <
|
|
27
|
+
export declare const useFieldCharacterEditing: <TSection extends FieldSection>({ sections, updateSectionValue, sectionsValueBoundaries, localizedDigits, setTempAndroidValueStr, timezone, }: UseFieldCharacterEditingParams<TSection>) => UseFieldCharacterEditingResponse;
|
|
28
28
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UseFieldInternalProps, UseFieldParams, UseFieldState, FieldParsedSelectedSections, FieldSectionsValueBoundaries, UseFieldForwardedProps } from './useField.types';
|
|
2
|
-
import { FieldSection, FieldSelectedSections, PickersTimezone
|
|
2
|
+
import { FieldSection, FieldSelectedSections, PickersTimezone } from '../../../models';
|
|
3
3
|
export interface UpdateSectionValueParams<TSection extends FieldSection> {
|
|
4
4
|
/**
|
|
5
5
|
* The section on which we want to apply the new value.
|
|
@@ -14,7 +14,7 @@ export interface UpdateSectionValueParams<TSection extends FieldSection> {
|
|
|
14
14
|
*/
|
|
15
15
|
shouldGoToNextSection: boolean;
|
|
16
16
|
}
|
|
17
|
-
export interface UseFieldStateResponse<TValue,
|
|
17
|
+
export interface UseFieldStateResponse<TValue, TSection extends FieldSection> {
|
|
18
18
|
state: UseFieldState<TValue, TSection>;
|
|
19
19
|
activeSectionIndex: number | null;
|
|
20
20
|
parsedSelectedSections: FieldParsedSelectedSections;
|
|
@@ -24,9 +24,9 @@ export interface UseFieldStateResponse<TValue, TDate extends PickerValidDate, TS
|
|
|
24
24
|
updateSectionValue: (params: UpdateSectionValueParams<TSection>) => void;
|
|
25
25
|
updateValueFromValueStr: (valueStr: string) => void;
|
|
26
26
|
setTempAndroidValueStr: (tempAndroidValueStr: string | null) => void;
|
|
27
|
-
sectionsValueBoundaries: FieldSectionsValueBoundaries
|
|
27
|
+
sectionsValueBoundaries: FieldSectionsValueBoundaries;
|
|
28
28
|
getSectionsFromValue: (value: TValue, fallbackSections?: TSection[] | null) => TSection[];
|
|
29
29
|
localizedDigits: string[];
|
|
30
30
|
timezone: PickersTimezone;
|
|
31
31
|
}
|
|
32
|
-
export declare const useFieldState: <TValue,
|
|
32
|
+
export declare const useFieldState: <TValue, TSection extends FieldSection, TEnableAccessibleFieldDOMStructure extends boolean, TForwardedProps extends UseFieldForwardedProps<TEnableAccessibleFieldDOMStructure>, TInternalProps extends UseFieldInternalProps<any, any, any, any>>(params: UseFieldParams<TValue, TSection, TEnableAccessibleFieldDOMStructure, TForwardedProps, TInternalProps>) => UseFieldStateResponse<TValue, TSection>;
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import useControlled from '@mui/utils/useControlled';
|
|
4
4
|
import { useRtl } from '@mui/system/RtlProvider';
|
|
5
|
-
import {
|
|
5
|
+
import { usePickerTranslations } from "../../../hooks/usePickerTranslations.js";
|
|
6
6
|
import { useUtils, useLocalizationContext } from "../useUtils.js";
|
|
7
7
|
import { mergeDateIntoReferenceDate, getSectionsBoundaries, validateSections, getDateFromDateSections, parseSelectedSections, getLocalizedDigits } from "./useField.utils.js";
|
|
8
8
|
import { buildSectionsFromFormat } from "./buildSectionsFromFormat.js";
|
|
@@ -10,7 +10,7 @@ import { useValueWithTimezone } from "../useValueWithTimezone.js";
|
|
|
10
10
|
import { getSectionTypeGranularity } from "../../utils/getDefaultReferenceDate.js";
|
|
11
11
|
export const useFieldState = params => {
|
|
12
12
|
const utils = useUtils();
|
|
13
|
-
const translations =
|
|
13
|
+
const translations = usePickerTranslations();
|
|
14
14
|
const adapter = useLocalizationContext();
|
|
15
15
|
const isRtl = useRtl();
|
|
16
16
|
const {
|
|
@@ -30,7 +30,7 @@ export const useFieldState = params => {
|
|
|
30
30
|
onSelectedSectionsChange,
|
|
31
31
|
shouldRespectLeadingZeros = false,
|
|
32
32
|
timezone: timezoneProp,
|
|
33
|
-
enableAccessibleFieldDOMStructure =
|
|
33
|
+
enableAccessibleFieldDOMStructure = true
|
|
34
34
|
}
|
|
35
35
|
} = params;
|
|
36
36
|
const {
|
|
@@ -41,6 +41,7 @@ export const useFieldState = params => {
|
|
|
41
41
|
timezone: timezoneProp,
|
|
42
42
|
value: valueProp,
|
|
43
43
|
defaultValue,
|
|
44
|
+
referenceDate: referenceDateProp,
|
|
44
45
|
onChange,
|
|
45
46
|
valueManager
|
|
46
47
|
});
|
|
@@ -5,7 +5,7 @@ import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
|
|
|
5
5
|
import useId from '@mui/utils/useId';
|
|
6
6
|
import { getSectionValueNow, getSectionValueText, parseSelectedSections } from "./useField.utils.js";
|
|
7
7
|
import { getActiveElement } from "../../utils/utils.js";
|
|
8
|
-
import {
|
|
8
|
+
import { usePickerTranslations } from "../../../hooks/usePickerTranslations.js";
|
|
9
9
|
import { useUtils } from "../useUtils.js";
|
|
10
10
|
export const useFieldV7TextField = params => {
|
|
11
11
|
const {
|
|
@@ -39,7 +39,7 @@ export const useFieldV7TextField = params => {
|
|
|
39
39
|
} = params;
|
|
40
40
|
const sectionListRef = React.useRef(null);
|
|
41
41
|
const handleSectionListRef = useForkRef(inSectionListRef, sectionListRef);
|
|
42
|
-
const translations =
|
|
42
|
+
const translations = usePickerTranslations();
|
|
43
43
|
const utils = useUtils();
|
|
44
44
|
const id = useId();
|
|
45
45
|
const [focused, setFocused] = React.useState(false);
|
|
@@ -198,8 +198,9 @@ export const useFieldV7TextField = params => {
|
|
|
198
198
|
if (focused || !sectionListRef.current) {
|
|
199
199
|
return;
|
|
200
200
|
}
|
|
201
|
+
const activeElement = getActiveElement(document);
|
|
201
202
|
setFocused(true);
|
|
202
|
-
const isFocusInsideASection = sectionListRef.current.getSectionIndexFromDOMElement(
|
|
203
|
+
const isFocusInsideASection = sectionListRef.current.getSectionIndexFromDOMElement(activeElement) != null;
|
|
203
204
|
if (!isFocusInsideASection) {
|
|
204
205
|
setSelectedSections(sectionOrder.startIndex);
|
|
205
206
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { UseMobilePickerParams, UseMobilePickerProps } from './useMobilePicker.types';
|
|
3
|
-
import { PickerValidDate } from '../../../models';
|
|
4
3
|
import { DateOrTimeViewWithMeridiem } from '../../models';
|
|
5
4
|
/**
|
|
6
5
|
* Hook managing all the single-date mobile pickers:
|
|
@@ -8,6 +7,6 @@ import { DateOrTimeViewWithMeridiem } from '../../models';
|
|
|
8
7
|
* - MobileDateTimePicker
|
|
9
8
|
* - MobileTimePicker
|
|
10
9
|
*/
|
|
11
|
-
export declare const useMobilePicker: <
|
|
10
|
+
export declare const useMobilePicker: <TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean, TExternalProps extends UseMobilePickerProps<TView, TEnableAccessibleFieldDOMStructure, any, TExternalProps>>({ props, getOpenDialogAriaText, ...pickerParams }: UseMobilePickerParams<TView, TEnableAccessibleFieldDOMStructure, TExternalProps>) => {
|
|
12
11
|
renderPicker: () => React.JSX.Element;
|
|
13
12
|
};
|
|
@@ -9,7 +9,7 @@ import { PickersModalDialog } from "../../components/PickersModalDialog.js";
|
|
|
9
9
|
import { usePicker } from "../usePicker/index.js";
|
|
10
10
|
import { onSpaceOrEnter } from "../../utils/utils.js";
|
|
11
11
|
import { PickersLayout } from "../../../PickersLayout/index.js";
|
|
12
|
-
import {
|
|
12
|
+
import { PickerProvider } from "../../components/PickerProvider.js";
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Hook managing all the single-date mobile pickers:
|
|
@@ -49,42 +49,49 @@ export const useMobilePicker = _ref => {
|
|
|
49
49
|
open,
|
|
50
50
|
actions,
|
|
51
51
|
layoutProps,
|
|
52
|
+
providerProps,
|
|
52
53
|
renderCurrentView,
|
|
53
54
|
fieldProps: pickerFieldProps,
|
|
54
|
-
|
|
55
|
+
ownerState
|
|
55
56
|
} = usePicker(_extends({}, pickerParams, {
|
|
56
57
|
props,
|
|
57
58
|
fieldRef,
|
|
59
|
+
localeText,
|
|
58
60
|
autoFocusView: true,
|
|
59
61
|
additionalViewProps: {},
|
|
60
|
-
|
|
62
|
+
variant: 'mobile'
|
|
61
63
|
}));
|
|
62
64
|
const Field = slots.field;
|
|
63
65
|
const fieldProps = useSlotProps({
|
|
64
66
|
elementType: Field,
|
|
65
67
|
externalSlotProps: innerSlotProps?.field,
|
|
66
|
-
additionalProps: _extends({
|
|
67
|
-
|
|
68
|
-
}, !(disabled || readOnly) && {
|
|
69
|
-
onClick: actions.onOpen,
|
|
70
|
-
onKeyDown: onSpaceOrEnter(actions.onOpen)
|
|
71
|
-
}, {
|
|
68
|
+
additionalProps: _extends({
|
|
69
|
+
// Internal props
|
|
72
70
|
readOnly: readOnly ?? true,
|
|
73
71
|
disabled,
|
|
74
|
-
className,
|
|
75
|
-
sx,
|
|
76
72
|
format,
|
|
77
73
|
formatDensity,
|
|
78
74
|
enableAccessibleFieldDOMStructure,
|
|
79
75
|
selectedSections,
|
|
80
76
|
onSelectedSectionsChange,
|
|
81
|
-
timezone
|
|
77
|
+
timezone
|
|
78
|
+
}, pickerFieldProps, {
|
|
79
|
+
// onChange and value
|
|
80
|
+
|
|
81
|
+
// Forwarded props
|
|
82
|
+
className,
|
|
83
|
+
sx,
|
|
82
84
|
label,
|
|
83
85
|
name
|
|
84
|
-
},
|
|
86
|
+
}, isToolbarHidden && {
|
|
87
|
+
id: labelId
|
|
88
|
+
}, !(disabled || readOnly) && {
|
|
89
|
+
onClick: actions.onOpen,
|
|
90
|
+
onKeyDown: onSpaceOrEnter(actions.onOpen)
|
|
91
|
+
}, !!inputRef && {
|
|
85
92
|
inputRef
|
|
86
|
-
}
|
|
87
|
-
ownerState
|
|
93
|
+
}),
|
|
94
|
+
ownerState
|
|
88
95
|
});
|
|
89
96
|
|
|
90
97
|
// TODO: Move to `useSlotProps` when https://github.com/mui/material-ui/pull/35088 will be merged
|
|
@@ -112,9 +119,7 @@ export const useMobilePicker = _ref => {
|
|
|
112
119
|
}, innerSlotProps?.mobilePaper)
|
|
113
120
|
});
|
|
114
121
|
const handleFieldRef = useForkRef(fieldRef, fieldProps.unstableFieldRef);
|
|
115
|
-
const renderPicker = () => /*#__PURE__*/_jsxs(
|
|
116
|
-
contextValue: contextValue,
|
|
117
|
-
localeText: localeText,
|
|
122
|
+
const renderPicker = () => /*#__PURE__*/_jsxs(PickerProvider, _extends({}, providerProps, {
|
|
118
123
|
children: [/*#__PURE__*/_jsx(Field, _extends({}, fieldProps, {
|
|
119
124
|
slots: slotsForField,
|
|
120
125
|
slotProps: slotProps,
|
|
@@ -129,7 +134,7 @@ export const useMobilePicker = _ref => {
|
|
|
129
134
|
children: renderCurrentView()
|
|
130
135
|
}))
|
|
131
136
|
}))]
|
|
132
|
-
});
|
|
137
|
+
}));
|
|
133
138
|
return {
|
|
134
139
|
renderPicker
|
|
135
140
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import TextField from '@mui/material/TextField';
|
|
3
3
|
import { SlotComponentProps } from '@mui/utils';
|
|
4
|
+
import { MakeRequired, SlotComponentPropsFromProps } from '@mui/x-internals/types';
|
|
4
5
|
import { BaseNonStaticPickerProps, BasePickerProps, BaseNonRangeNonStaticPickerProps } from '../../models/props/basePickerProps';
|
|
5
6
|
import { PickersModalDialogSlots, PickersModalDialogSlotProps } from '../../components/PickersModalDialog';
|
|
6
|
-
import { UsePickerParams
|
|
7
|
-
import {
|
|
7
|
+
import { UsePickerParams } from '../usePicker';
|
|
8
|
+
import { FieldSection, PickerFieldSlotProps, PickerOwnerState, PickerValidDate } from '../../../models';
|
|
8
9
|
import { ExportedPickersLayoutSlots, ExportedPickersLayoutSlotProps, PickersLayoutSlotProps } from '../../../PickersLayout/PickersLayout.types';
|
|
9
10
|
import { UsePickerValueNonStaticProps } from '../usePicker/usePickerValue.types';
|
|
10
11
|
import { UsePickerViewsNonStaticProps, UsePickerViewsProps } from '../usePicker/usePickerViews';
|
|
11
12
|
import { DateOrTimeViewWithMeridiem } from '../../models';
|
|
12
|
-
|
|
13
|
-
export interface UseMobilePickerSlots<TDate extends PickerValidDate, TView extends DateOrTimeViewWithMeridiem> extends PickersModalDialogSlots, ExportedPickersLayoutSlots<TDate | null, TDate, TView> {
|
|
13
|
+
export interface UseMobilePickerSlots<TView extends DateOrTimeViewWithMeridiem> extends PickersModalDialogSlots, ExportedPickersLayoutSlots<PickerValidDate | null, TView> {
|
|
14
14
|
/**
|
|
15
15
|
* Component used to enter the date with the keyboard.
|
|
16
16
|
*/
|
|
@@ -21,27 +21,27 @@ export interface UseMobilePickerSlots<TDate extends PickerValidDate, TView exten
|
|
|
21
21
|
*/
|
|
22
22
|
textField?: React.ElementType;
|
|
23
23
|
}
|
|
24
|
-
export interface ExportedUseMobilePickerSlotProps<
|
|
25
|
-
field?: SlotComponentPropsFromProps<
|
|
24
|
+
export interface ExportedUseMobilePickerSlotProps<TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean> extends PickersModalDialogSlotProps, ExportedPickersLayoutSlotProps<PickerValidDate | null, TView> {
|
|
25
|
+
field?: SlotComponentPropsFromProps<PickerFieldSlotProps<PickerValidDate | null, FieldSection, TEnableAccessibleFieldDOMStructure>, {}, PickerOwnerState>;
|
|
26
26
|
textField?: SlotComponentProps<typeof TextField, {}, Record<string, any>>;
|
|
27
27
|
}
|
|
28
|
-
export interface UseMobilePickerSlotProps<
|
|
28
|
+
export interface UseMobilePickerSlotProps<TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean> extends ExportedUseMobilePickerSlotProps<TView, TEnableAccessibleFieldDOMStructure>, Pick<PickersLayoutSlotProps<PickerValidDate | null, TView>, 'toolbar'> {
|
|
29
29
|
}
|
|
30
30
|
export interface MobileOnlyPickerProps extends BaseNonStaticPickerProps, BaseNonRangeNonStaticPickerProps, UsePickerValueNonStaticProps, UsePickerViewsNonStaticProps {
|
|
31
31
|
}
|
|
32
|
-
export interface UseMobilePickerProps<
|
|
32
|
+
export interface UseMobilePickerProps<TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean, TError, TExternalProps extends UsePickerViewsProps<any, TView, any, any>> extends BasePickerProps<PickerValidDate | null, TView, TError, TExternalProps, {}>, MakeRequired<MobileOnlyPickerProps, 'format'> {
|
|
33
33
|
/**
|
|
34
34
|
* Overridable component slots.
|
|
35
35
|
* @default {}
|
|
36
36
|
*/
|
|
37
|
-
slots: UseMobilePickerSlots<
|
|
37
|
+
slots: UseMobilePickerSlots<TView>;
|
|
38
38
|
/**
|
|
39
39
|
* The props used for each component slot.
|
|
40
40
|
* @default {}
|
|
41
41
|
*/
|
|
42
|
-
slotProps?: UseMobilePickerSlotProps<
|
|
42
|
+
slotProps?: UseMobilePickerSlotProps<TView, TEnableAccessibleFieldDOMStructure>;
|
|
43
43
|
}
|
|
44
|
-
export interface UseMobilePickerParams<
|
|
44
|
+
export interface UseMobilePickerParams<TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean, TExternalProps extends UseMobilePickerProps<TView, TEnableAccessibleFieldDOMStructure, any, TExternalProps>> extends Pick<UsePickerParams<PickerValidDate | null, TView, FieldSection, TExternalProps, {}>, 'valueManager' | 'valueType' | 'validator'> {
|
|
45
45
|
props: TExternalProps;
|
|
46
|
-
getOpenDialogAriaText: (date:
|
|
46
|
+
getOpenDialogAriaText: (date: PickerValidDate | null) => string;
|
|
47
47
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { UsePickerParams, UsePickerProps, UsePickerResponse } from './usePicker.types';
|
|
2
|
-
import { FieldSection,
|
|
2
|
+
import { FieldSection, InferError } from '../../../models';
|
|
3
3
|
import { DateOrTimeViewWithMeridiem } from '../../models';
|
|
4
|
-
export declare const usePicker: <TValue,
|
|
4
|
+
export declare const usePicker: <TValue, TView extends DateOrTimeViewWithMeridiem, TSection extends FieldSection, TExternalProps extends UsePickerProps<TValue, TView, any, any, any>, TAdditionalProps extends {}>({ props, valueManager, valueType, variant, additionalViewProps, validator, autoFocusView, rendererInterceptor, fieldRef, localeText, }: UsePickerParams<TValue, TView, TSection, TExternalProps, TAdditionalProps>) => UsePickerResponse<TValue, TView, TSection, InferError<TExternalProps>>;
|