@mui/x-date-pickers 7.16.0 → 7.18.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.js +1 -1
- package/AdapterDateFnsV3/AdapterDateFnsV3.js +1 -1
- package/AdapterDayjs/AdapterDayjs.js +1 -1
- package/CHANGELOG.md +184 -4
- package/DateCalendar/DateCalendar.js +11 -1
- package/DateCalendar/useCalendarState.js +2 -0
- package/DateCalendar/useIsDateDisabled.d.ts +4 -3
- package/DateCalendar/useIsDateDisabled.js +5 -3
- package/DateField/DateField.js +2 -0
- package/DateField/DateField.types.d.ts +7 -2
- package/DateField/index.d.ts +1 -1
- package/DateField/useDateField.d.ts +1 -1
- package/DateField/useDateField.js +5 -3
- package/DatePicker/DatePicker.js +8 -0
- package/DatePicker/DatePicker.types.d.ts +5 -5
- package/DatePicker/DatePickerToolbar.js +2 -0
- package/DateTimeField/DateTimeField.js +2 -0
- package/DateTimeField/DateTimeField.types.d.ts +7 -2
- package/DateTimeField/index.d.ts +1 -1
- package/DateTimeField/useDateTimeField.d.ts +1 -1
- package/DateTimeField/useDateTimeField.js +5 -3
- package/DateTimePicker/DateTimePicker.js +8 -0
- package/DateTimePicker/DateTimePicker.types.d.ts +7 -6
- package/DateTimePicker/DateTimePickerTabs.js +2 -0
- package/DateTimePicker/DateTimePickerToolbar.js +2 -0
- package/DayCalendarSkeleton/DayCalendarSkeleton.js +2 -0
- package/DesktopDatePicker/DesktopDatePicker.js +16 -3
- package/DesktopDatePicker/DesktopDatePicker.types.d.ts +7 -6
- package/DesktopDateTimePicker/DesktopDateTimePicker.js +16 -3
- package/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +11 -10
- package/DesktopTimePicker/DesktopTimePicker.js +10 -3
- package/DigitalClock/DigitalClock.js +2 -0
- package/LocalizationProvider/LocalizationProvider.js +2 -0
- package/MobileDatePicker/MobileDatePicker.js +16 -3
- package/MobileDatePicker/MobileDatePicker.types.d.ts +5 -0
- package/MobileDateTimePicker/MobileDateTimePicker.js +16 -3
- package/MobileTimePicker/MobileTimePicker.js +10 -3
- package/MonthCalendar/MonthCalendar.js +2 -0
- package/MonthCalendar/MonthCalendar.types.d.ts +1 -1
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +2 -0
- package/PickersActionBar/PickersActionBar.js +2 -0
- package/PickersCalendarHeader/PickersCalendarHeader.js +2 -0
- package/PickersCalendarHeader/PickersCalendarHeader.types.d.ts +1 -1
- package/PickersDay/PickersDay.js +2 -0
- package/PickersLayout/PickersLayout.js +2 -0
- package/PickersLayout/usePickerLayout.js +2 -0
- package/PickersSectionList/PickersSectionList.js +2 -0
- package/PickersShortcuts/PickersShortcuts.js +2 -0
- package/PickersTextField/PickersTextField.js +2 -0
- package/StaticDatePicker/StaticDatePicker.js +10 -2
- package/StaticDatePicker/StaticDatePicker.types.d.ts +5 -0
- package/StaticDateTimePicker/StaticDateTimePicker.js +10 -2
- package/StaticDateTimePicker/StaticDateTimePicker.types.d.ts +5 -0
- package/StaticTimePicker/StaticTimePicker.js +3 -1
- package/TimeClock/Clock.js +1 -1
- package/TimeClock/TimeClock.js +2 -0
- package/TimeField/TimeField.js +2 -0
- package/TimeField/TimeField.types.d.ts +7 -2
- package/TimeField/index.d.ts +1 -1
- package/TimeField/useTimeField.d.ts +1 -1
- package/TimeField/useTimeField.js +5 -3
- package/TimePicker/TimePicker.js +2 -0
- package/TimePicker/TimePickerToolbar.js +2 -0
- package/YearCalendar/YearCalendar.js +21 -6
- package/YearCalendar/YearCalendar.types.d.ts +7 -1
- package/dateViewRenderers/dateViewRenderers.d.ts +1 -1
- package/dateViewRenderers/dateViewRenderers.js +2 -0
- package/hooks/index.d.ts +1 -0
- package/hooks/index.js +2 -1
- package/hooks/useClearableField.js +2 -0
- package/hooks/usePickersTranslations.js +2 -0
- package/hooks/useSplitFieldProps.d.ts +19 -0
- package/hooks/useSplitFieldProps.js +43 -0
- package/index.d.ts +1 -0
- package/index.js +3 -2
- package/internals/hooks/useDesktopPicker/useDesktopPicker.js +1 -3
- package/internals/hooks/useDesktopPicker/useDesktopPicker.types.d.ts +2 -2
- package/internals/hooks/useField/useField.js +11 -6
- package/internals/hooks/useField/useField.types.d.ts +4 -22
- package/internals/hooks/useField/useFieldState.js +2 -4
- package/internals/hooks/useMobilePicker/useMobilePicker.js +1 -3
- package/internals/hooks/useMobilePicker/useMobilePicker.types.d.ts +2 -2
- package/internals/hooks/usePicker/usePicker.d.ts +1 -2
- package/internals/hooks/usePicker/usePicker.js +1 -1
- package/internals/hooks/usePicker/usePickerValue.d.ts +1 -2
- package/internals/hooks/usePicker/usePickerValue.js +12 -16
- package/internals/hooks/usePicker/usePickerValue.types.d.ts +4 -15
- package/internals/index.d.ts +0 -8
- package/internals/index.js +0 -7
- package/locales/beBY.d.ts +3 -3
- package/locales/beBY.js +4 -4
- package/locales/caES.d.ts +3 -3
- package/locales/caES.js +3 -3
- package/locales/csCZ.d.ts +3 -3
- package/locales/csCZ.js +4 -4
- 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 +4 -4
- package/locales/enUS.d.ts +3 -3
- package/locales/enUS.js +4 -4
- 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/huHU.d.ts +3 -3
- package/locales/huHU.js +3 -3
- package/locales/isIS.d.ts +3 -3
- package/locales/isIS.js +4 -4
- 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 +4 -4
- package/locales/mk.d.ts +3 -3
- package/locales/mk.js +3 -3
- package/locales/nbNO.d.ts +3 -3
- package/locales/nbNO.js +4 -4
- 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 +4 -4
- package/locales/ptBR.d.ts +3 -3
- package/locales/ptBR.js +4 -4
- 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 +4 -4
- package/locales/svSE.d.ts +3 -3
- package/locales/svSE.js +3 -3
- package/locales/trTR.d.ts +3 -3
- package/locales/trTR.js +4 -4
- package/locales/ukUA.d.ts +3 -3
- package/locales/ukUA.js +3 -3
- package/locales/urPK.d.ts +3 -3
- package/locales/urPK.js +4 -4
- package/locales/utils/getPickersLocalization.d.ts +10 -3
- package/locales/utils/getPickersLocalization.js +13 -0
- package/locales/utils/pickersLocaleTextApi.d.ts +27 -3
- 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/validation.d.ts +13 -0
- package/modern/AdapterDateFns/AdapterDateFns.js +1 -1
- package/modern/AdapterDateFnsV3/AdapterDateFnsV3.js +1 -1
- package/modern/AdapterDayjs/AdapterDayjs.js +1 -1
- package/modern/DateCalendar/DateCalendar.js +11 -1
- package/modern/DateCalendar/useCalendarState.js +2 -0
- package/modern/DateCalendar/useIsDateDisabled.js +5 -3
- package/modern/DateField/DateField.js +2 -0
- package/modern/DateField/useDateField.js +5 -3
- package/modern/DatePicker/DatePicker.js +8 -0
- package/modern/DatePicker/DatePickerToolbar.js +2 -0
- package/modern/DateTimeField/DateTimeField.js +2 -0
- package/modern/DateTimeField/useDateTimeField.js +5 -3
- package/modern/DateTimePicker/DateTimePicker.js +8 -0
- package/modern/DateTimePicker/DateTimePickerTabs.js +2 -0
- package/modern/DateTimePicker/DateTimePickerToolbar.js +2 -0
- package/modern/DayCalendarSkeleton/DayCalendarSkeleton.js +2 -0
- package/modern/DesktopDatePicker/DesktopDatePicker.js +16 -3
- package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +16 -3
- package/modern/DesktopTimePicker/DesktopTimePicker.js +10 -3
- package/modern/DigitalClock/DigitalClock.js +2 -0
- package/modern/LocalizationProvider/LocalizationProvider.js +2 -0
- package/modern/MobileDatePicker/MobileDatePicker.js +16 -3
- package/modern/MobileDateTimePicker/MobileDateTimePicker.js +16 -3
- package/modern/MobileTimePicker/MobileTimePicker.js +10 -3
- package/modern/MonthCalendar/MonthCalendar.js +2 -0
- package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.js +2 -0
- package/modern/PickersActionBar/PickersActionBar.js +2 -0
- package/modern/PickersCalendarHeader/PickersCalendarHeader.js +2 -0
- package/modern/PickersDay/PickersDay.js +2 -0
- package/modern/PickersLayout/PickersLayout.js +2 -0
- package/modern/PickersLayout/usePickerLayout.js +2 -0
- package/modern/PickersSectionList/PickersSectionList.js +2 -0
- package/modern/PickersShortcuts/PickersShortcuts.js +2 -0
- package/modern/PickersTextField/PickersTextField.js +2 -0
- package/modern/StaticDatePicker/StaticDatePicker.js +10 -2
- package/modern/StaticDateTimePicker/StaticDateTimePicker.js +10 -2
- package/modern/StaticTimePicker/StaticTimePicker.js +3 -1
- package/modern/TimeClock/Clock.js +1 -1
- package/modern/TimeClock/TimeClock.js +2 -0
- package/modern/TimeField/TimeField.js +2 -0
- package/modern/TimeField/useTimeField.js +5 -3
- package/modern/TimePicker/TimePicker.js +2 -0
- package/modern/TimePicker/TimePickerToolbar.js +2 -0
- package/modern/YearCalendar/YearCalendar.js +21 -6
- package/modern/dateViewRenderers/dateViewRenderers.js +2 -0
- package/modern/hooks/index.js +2 -1
- package/modern/hooks/useClearableField.js +2 -0
- package/modern/hooks/usePickersTranslations.js +2 -0
- package/modern/hooks/useSplitFieldProps.js +43 -0
- package/modern/index.js +3 -2
- package/modern/internals/hooks/useDesktopPicker/useDesktopPicker.js +1 -3
- package/modern/internals/hooks/useField/useField.js +11 -6
- package/modern/internals/hooks/useField/useFieldState.js +2 -4
- package/modern/internals/hooks/useMobilePicker/useMobilePicker.js +1 -3
- package/modern/internals/hooks/usePicker/usePicker.js +1 -1
- package/modern/internals/hooks/usePicker/usePickerValue.js +12 -16
- package/modern/internals/index.js +0 -7
- package/modern/locales/beBY.js +4 -4
- package/modern/locales/caES.js +3 -3
- package/modern/locales/csCZ.js +4 -4
- package/modern/locales/daDK.js +3 -3
- package/modern/locales/deDE.js +3 -3
- package/modern/locales/elGR.js +4 -4
- package/modern/locales/enUS.js +4 -4
- 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/huHU.js +3 -3
- package/modern/locales/isIS.js +4 -4
- 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 +4 -4
- package/modern/locales/mk.js +3 -3
- package/modern/locales/nbNO.js +4 -4
- package/modern/locales/nlNL.js +3 -3
- package/modern/locales/nnNO.js +3 -3
- package/modern/locales/plPL.js +4 -4
- package/modern/locales/ptBR.js +4 -4
- package/modern/locales/roRO.js +3 -3
- package/modern/locales/ruRU.js +3 -3
- package/modern/locales/skSK.js +4 -4
- package/modern/locales/svSE.js +3 -3
- package/modern/locales/trTR.js +4 -4
- package/modern/locales/ukUA.js +3 -3
- package/modern/locales/urPK.js +4 -4
- package/modern/locales/utils/getPickersLocalization.js +13 -0
- package/modern/locales/viVN.js +3 -3
- package/modern/locales/zhCN.js +3 -3
- package/modern/locales/zhHK.js +3 -3
- package/modern/validation/index.js +5 -0
- package/modern/validation/useValidation.js +54 -0
- package/{internals/utils → modern}/validation/validateDate.js +6 -4
- package/modern/{internals/utils/validation → validation}/validateDateTime.js +8 -3
- package/{internals/utils → modern}/validation/validateTime.js +6 -4
- package/node/AdapterDateFns/AdapterDateFns.js +1 -1
- package/node/AdapterDateFnsV3/AdapterDateFnsV3.js +1 -1
- package/node/AdapterDayjs/AdapterDayjs.js +1 -1
- package/node/DateCalendar/DateCalendar.js +10 -1
- package/node/DateCalendar/useCalendarState.js +1 -0
- package/node/DateCalendar/useIsDateDisabled.js +5 -4
- package/node/DateField/DateField.js +1 -0
- package/node/DateField/useDateField.js +5 -4
- package/node/DatePicker/DatePicker.js +7 -0
- package/node/DatePicker/DatePickerToolbar.js +1 -0
- package/node/DateTimeField/DateTimeField.js +1 -0
- package/node/DateTimeField/useDateTimeField.js +5 -4
- package/node/DateTimePicker/DateTimePicker.js +7 -0
- package/node/DateTimePicker/DateTimePickerTabs.js +1 -0
- package/node/DateTimePicker/DateTimePickerToolbar.js +1 -0
- package/node/DayCalendarSkeleton/DayCalendarSkeleton.js +1 -0
- package/node/DesktopDatePicker/DesktopDatePicker.js +17 -5
- package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +17 -5
- package/node/DesktopTimePicker/DesktopTimePicker.js +11 -5
- package/node/DigitalClock/DigitalClock.js +1 -0
- package/node/LocalizationProvider/LocalizationProvider.js +1 -0
- package/node/MobileDatePicker/MobileDatePicker.js +17 -5
- package/node/MobileDateTimePicker/MobileDateTimePicker.js +17 -5
- package/node/MobileTimePicker/MobileTimePicker.js +11 -5
- package/node/MonthCalendar/MonthCalendar.js +1 -0
- package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.js +1 -0
- package/node/PickersActionBar/PickersActionBar.js +1 -0
- package/node/PickersCalendarHeader/PickersCalendarHeader.js +1 -0
- package/node/PickersDay/PickersDay.js +1 -0
- package/node/PickersLayout/PickersLayout.js +1 -0
- package/node/PickersLayout/usePickerLayout.js +1 -0
- package/node/PickersSectionList/PickersSectionList.js +1 -0
- package/node/PickersShortcuts/PickersShortcuts.js +1 -0
- package/node/PickersTextField/PickersTextField.js +1 -0
- package/node/StaticDatePicker/StaticDatePicker.js +10 -3
- package/node/StaticDateTimePicker/StaticDateTimePicker.js +10 -3
- package/node/StaticTimePicker/StaticTimePicker.js +3 -2
- package/node/TimeClock/Clock.js +1 -1
- package/node/TimeClock/TimeClock.js +1 -0
- package/node/TimeField/TimeField.js +1 -0
- package/node/TimeField/useTimeField.js +5 -4
- package/node/TimePicker/TimePicker.js +1 -0
- package/node/TimePicker/TimePickerToolbar.js +1 -0
- package/node/YearCalendar/YearCalendar.js +20 -6
- package/node/dateViewRenderers/dateViewRenderers.js +2 -0
- package/node/hooks/index.js +8 -1
- package/node/hooks/useClearableField.js +1 -0
- package/node/hooks/usePickersTranslations.js +1 -0
- package/node/hooks/useSplitFieldProps.js +51 -0
- package/node/index.js +13 -1
- package/node/internals/hooks/useDesktopPicker/useDesktopPicker.js +1 -3
- package/node/internals/hooks/useField/useField.js +11 -6
- package/node/internals/hooks/useField/useFieldState.js +2 -4
- package/node/internals/hooks/useMobilePicker/useMobilePicker.js +1 -3
- package/node/internals/hooks/usePicker/usePicker.js +1 -1
- package/node/internals/hooks/usePicker/usePickerValue.js +12 -16
- package/node/internals/index.js +0 -49
- package/node/locales/beBY.js +4 -4
- package/node/locales/caES.js +3 -3
- package/node/locales/csCZ.js +4 -4
- package/node/locales/daDK.js +3 -3
- package/node/locales/deDE.js +3 -3
- package/node/locales/elGR.js +4 -4
- package/node/locales/enUS.js +4 -4
- 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/huHU.js +3 -3
- package/node/locales/isIS.js +4 -4
- 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 +4 -4
- package/node/locales/mk.js +3 -3
- package/node/locales/nbNO.js +4 -4
- package/node/locales/nlNL.js +3 -3
- package/node/locales/nnNO.js +3 -3
- package/node/locales/plPL.js +4 -4
- package/node/locales/ptBR.js +4 -4
- package/node/locales/roRO.js +3 -3
- package/node/locales/ruRU.js +3 -3
- package/node/locales/skSK.js +4 -4
- package/node/locales/svSE.js +3 -3
- package/node/locales/trTR.js +4 -4
- package/node/locales/ukUA.js +3 -3
- package/node/locales/urPK.js +4 -4
- package/node/locales/utils/getPickersLocalization.js +16 -2
- package/node/locales/viVN.js +3 -3
- package/node/locales/zhCN.js +3 -3
- package/node/locales/zhHK.js +3 -3
- package/node/validation/index.js +40 -0
- package/node/validation/useValidation.js +61 -0
- package/node/{internals/utils/validation → validation}/validateDate.js +6 -4
- package/node/{internals/utils/validation → validation}/validateDateTime.js +8 -3
- package/node/{internals/utils/validation → validation}/validateTime.js +6 -4
- package/package.json +4 -4
- package/{internals/utils/validation → validation}/extractValidationProps.d.ts +1 -1
- package/validation/index.d.ts +9 -0
- package/validation/index.js +5 -0
- package/validation/package.json +6 -0
- package/validation/useValidation.d.ts +68 -0
- package/validation/useValidation.js +54 -0
- package/validation/validateDate.d.ts +6 -0
- package/{modern/internals/utils/validation → validation}/validateDate.js +6 -4
- package/validation/validateDateTime.d.ts +7 -0
- package/{internals/utils/validation → validation}/validateDateTime.js +8 -3
- package/validation/validateTime.d.ts +6 -0
- package/{modern/internals/utils/validation → validation}/validateTime.js +6 -4
- package/internals/hooks/useValidation.d.ts +0 -24
- package/internals/hooks/useValidation.js +0 -22
- package/internals/utils/fields.d.ts +0 -5
- package/internals/utils/fields.js +0 -28
- package/internals/utils/validation/validateDate.d.ts +0 -7
- package/internals/utils/validation/validateDateTime.d.ts +0 -7
- package/internals/utils/validation/validateTime.d.ts +0 -7
- package/internals/utils/warning.d.ts +0 -2
- package/internals/utils/warning.js +0 -21
- package/modern/internals/hooks/useValidation.js +0 -22
- package/modern/internals/utils/fields.js +0 -28
- package/modern/internals/utils/warning.js +0 -21
- package/node/internals/hooks/useValidation.js +0 -29
- package/node/internals/utils/fields.js +0 -36
- package/node/internals/utils/warning.js +0 -28
- /package/{internals/utils → modern}/validation/extractValidationProps.js +0 -0
- /package/node/{internals/utils/validation → validation}/extractValidationProps.js +0 -0
- /package/{modern/internals/utils/validation → validation}/extractValidationProps.js +0 -0
|
@@ -78,7 +78,7 @@ export class AdapterDateFns extends AdapterDateFnsBase {
|
|
|
78
78
|
/* istanbul ignore next */
|
|
79
79
|
if (process.env.NODE_ENV !== 'production') {
|
|
80
80
|
if (typeof addDays !== 'function') {
|
|
81
|
-
throw new Error(['MUI:
|
|
81
|
+
throw new Error(['MUI: This adapter is only compatible with `date-fns` v2.x package versions.', 'Please, install v2.x of the package or use the `AdapterDateFnsV3` instead.'].join('\n'));
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
super({
|
|
@@ -82,7 +82,7 @@ export class AdapterDateFns extends AdapterDateFnsBase {
|
|
|
82
82
|
/* istanbul ignore next */
|
|
83
83
|
if (process.env.NODE_ENV !== 'production') {
|
|
84
84
|
if (typeof addDays !== 'function') {
|
|
85
|
-
throw new Error([`MUI: The \`date-fns\` package v2.x is not compatible with this adapter.`, 'Please, install v3.x of the package or use the `AdapterDateFns` instead.'].join('\n'));
|
|
85
|
+
throw new Error([`MUI: The \`date-fns\` package v2.x is not compatible with this adapter.`, 'Please, install v3.x or v4.x of the package or use the `AdapterDateFns` instead.'].join('\n'));
|
|
86
86
|
}
|
|
87
87
|
if (!longFormatters) {
|
|
88
88
|
throw new Error('MUI: The minimum supported `date-fns` package version compatible with this adapter is `3.2.x`.');
|
|
@@ -6,7 +6,7 @@ import customParseFormatPlugin from 'dayjs/plugin/customParseFormat';
|
|
|
6
6
|
import localizedFormatPlugin from 'dayjs/plugin/localizedFormat';
|
|
7
7
|
import isBetweenPlugin from 'dayjs/plugin/isBetween';
|
|
8
8
|
import advancedFormatPlugin from 'dayjs/plugin/advancedFormat';
|
|
9
|
-
import { warnOnce } from
|
|
9
|
+
import { warnOnce } from '@mui/x-internals/warning';
|
|
10
10
|
defaultDayjs.extend(localizedFormatPlugin);
|
|
11
11
|
defaultDayjs.extend(weekOfYearPlugin);
|
|
12
12
|
defaultDayjs.extend(isBetweenPlugin);
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,186 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 7.18.0
|
|
7
|
+
|
|
8
|
+
_Sep 20, 2024_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 14 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 💫 Support [Row spanning](https://mui.com/x/react-data-grid/row-spanning/) on the Data Grid that automatically merges the consecutive cells in a column based on the cell value
|
|
13
|
+
|
|
14
|
+
<img width="600" src="https://github.com/user-attachments/assets/d32ec936-d238-4c92-9e1a-af6788d74cdf" alt="data grid row spanning" />
|
|
15
|
+
|
|
16
|
+
- ⏰ Support `date-fns` v4 (#14673) @LukasTy
|
|
17
|
+
- 🎉 Add option for Pickers to change the order of displayed years (#11780) @thomasmoon
|
|
18
|
+
- 🐞 Bugfixes
|
|
19
|
+
- 📚 Documentation improvements
|
|
20
|
+
|
|
21
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
22
|
+
|
|
23
|
+
### Data Grid
|
|
24
|
+
|
|
25
|
+
#### `@mui/x-data-grid@7.18.0`
|
|
26
|
+
|
|
27
|
+
- [DataGrid] Add default reset value in row edit mode (#14050) @michelengelen
|
|
28
|
+
- [DataGrid] Add `columnGroupHeaderHeight` prop for sizing column group headers (#14637) @KenanYusuf
|
|
29
|
+
- [DataGrid] Fix `document` reference when the grid is rendered in a popup window (#14649) @arminmeh
|
|
30
|
+
- [DataGrid] Remove `minFirstColumn` from `GetHeadersParams` interface (#14450) @k-rajat19
|
|
31
|
+
- [DataGrid] Row spanning (#14124) @MBilalShafi
|
|
32
|
+
|
|
33
|
+
#### `@mui/x-data-grid-pro@7.18.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
34
|
+
|
|
35
|
+
Same changes as in `@mui/x-data-grid@7.18.0`, plus:
|
|
36
|
+
|
|
37
|
+
- [DataGridPro] Fix `onRowsScrollEnd` being triggered instantly when bottom pinned row is present (#14602) @arminmeh
|
|
38
|
+
- [DataGridPro] Fix header filters rendering issue for `isEmpty` and `isNotEmpty` filter operators (#14493) @k-rajat19
|
|
39
|
+
- [DataGridPro] Fix pinned columns in RTL mode (#14586) @KenanYusuf
|
|
40
|
+
|
|
41
|
+
#### `@mui/x-data-grid-premium@7.18.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
42
|
+
|
|
43
|
+
Same changes as in `@mui/x-data-grid-pro@7.18.0`.
|
|
44
|
+
|
|
45
|
+
### Date and Time Pickers
|
|
46
|
+
|
|
47
|
+
#### `@mui/x-date-pickers@7.18.0`
|
|
48
|
+
|
|
49
|
+
- [pickers] Add option to change the order of displayed years (#11780) @thomasmoon
|
|
50
|
+
- [pickers] Support `date-fns` v4 (#14673) @LukasTy
|
|
51
|
+
|
|
52
|
+
#### `@mui/x-date-pickers-pro@7.18.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
53
|
+
|
|
54
|
+
Same changes as in `@mui/x-date-pickers@7.18.0`.
|
|
55
|
+
|
|
56
|
+
### Charts
|
|
57
|
+
|
|
58
|
+
#### `@mui/x-charts@7.18.0`
|
|
59
|
+
|
|
60
|
+
- [charts] Add a `PolarProvider` to manage polar axes (#14642) @alexfauquette
|
|
61
|
+
- [charts] Fix `LineChart` animation being stuck with initial drawing area value (#14553) @JCQuintas
|
|
62
|
+
- [charts] Fix legend slot typing (#14657) @alexfauquette
|
|
63
|
+
- [charts] Pass the axis index to extremum getter (#14641) @alexfauquette
|
|
64
|
+
- [charts] Provide hooks to create custom tooltip (#14377) @alexfauquette
|
|
65
|
+
|
|
66
|
+
#### `@mui/x-charts-pro@7.0.0-beta.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
67
|
+
|
|
68
|
+
Same changes as in `@mui/x-charts@7.18.0`.
|
|
69
|
+
|
|
70
|
+
### Tree View
|
|
71
|
+
|
|
72
|
+
#### `@mui/x-tree-view@7.18.0`
|
|
73
|
+
|
|
74
|
+
- [TreeView] Add `"use client"` directive to every public component and hook (#14579) @flaviendelangle
|
|
75
|
+
|
|
76
|
+
### Docs
|
|
77
|
+
|
|
78
|
+
- [docs] Add `groupingValueGetter` callout in column definition docs (#14599) @michelengelen
|
|
79
|
+
- [docs] Clean v6 => v7 migration guide (#14652) @flaviendelangle
|
|
80
|
+
- [docs] Copy `vale-action.yml` from main repo @oliviertassinari
|
|
81
|
+
- [docs] Edit the Pickers Getting started doc (#14555) @samuelsycamore
|
|
82
|
+
- [docs] Fix TypeScript capitalization @oliviertassinari
|
|
83
|
+
- [docs] Fix Vale error @oliviertassinari
|
|
84
|
+
- [docs] Make the migration guide diff a bit easier to read @oliviertassinari
|
|
85
|
+
- [docs] Report Vale at warning level (#14660) @oliviertassinari
|
|
86
|
+
- [docs] Warn about the `valueGetter` and `valueFormatter` signature change (#14613) @cherniavskii
|
|
87
|
+
- [docs] Polish code formatting (#14603) @oliviertassinari
|
|
88
|
+
- [test] Spy on `observe` method to avoid flaky wait for a callback (#14640) @arminmeh
|
|
89
|
+
|
|
90
|
+
### Core
|
|
91
|
+
|
|
92
|
+
- [core] Fix 301 link to Next.js and git diff @oliviertassinari
|
|
93
|
+
- [core] Fix failing CI on `master` (#14644) @cherniavskii
|
|
94
|
+
- [core] Fix `package.json` repository rule @oliviertassinari
|
|
95
|
+
- [core] MUI X repository moved to a new location @oliviertassinari
|
|
96
|
+
- [docs-infra] Strengthen CSP (#14581) @oliviertassinari
|
|
97
|
+
- [license] Finish renaming of LicensingModel (#14615) @oliviertassinari
|
|
98
|
+
|
|
99
|
+
## 7.17.0
|
|
100
|
+
|
|
101
|
+
_Sep 13, 2024_
|
|
102
|
+
|
|
103
|
+
We'd like to offer a big thanks to the 12 contributors who made this release possible. Here are some highlights ✨:
|
|
104
|
+
|
|
105
|
+
- 📊 Charts performance improvement
|
|
106
|
+
- 🧑💻 New Data Grid [custom columns demo](https://mui.com/x/react-data-grid/custom-columns/#full-example)
|
|
107
|
+
- 🐞 Bugfixes
|
|
108
|
+
- 📚 Documentation improvements
|
|
109
|
+
- 🌍 Improve Hungarian (hu-HU) locale on the Data Grid
|
|
110
|
+
|
|
111
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
112
|
+
|
|
113
|
+
### Data Grid
|
|
114
|
+
|
|
115
|
+
#### `@mui/x-data-grid@7.17.0`
|
|
116
|
+
|
|
117
|
+
- [DataGrid] Add "does not equal" and "does not contain" filter operators (#14489) @KenanYusuf
|
|
118
|
+
- [DataGrid] Add demo to the "Custom columns" page that does not use generator (#13695) @arminmeh
|
|
119
|
+
- [DataGrid] Fix Voice Over reading the column name twice (#14482) @arminmeh
|
|
120
|
+
- [DataGrid] Fix bug in CRUD example (#14513) @michelengelen
|
|
121
|
+
- [DataGrid] Fix failing jsdom tests caused by `:has()` selectors (#14559) @KenanYusuf
|
|
122
|
+
- [DataGrid] Refactor string operator filter functions (#14564) @KenanYusuf
|
|
123
|
+
- [l10n] Improve Hungarian (hu-HU) locale (#14506) @ntamas
|
|
124
|
+
|
|
125
|
+
#### `@mui/x-data-grid-pro@7.17.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
126
|
+
|
|
127
|
+
Same changes as in `@mui/x-data-grid@7.17.0`.
|
|
128
|
+
|
|
129
|
+
#### `@mui/x-data-grid-premium@7.17.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
130
|
+
|
|
131
|
+
Same changes as in `@mui/x-data-grid-pro@7.17.0`.
|
|
132
|
+
|
|
133
|
+
### Date and Time Pickers
|
|
134
|
+
|
|
135
|
+
#### `@mui/x-date-pickers@7.17.0`
|
|
136
|
+
|
|
137
|
+
- [fields] Improve `useSplitFieldProps` and make it public (#14514) @flaviendelangle
|
|
138
|
+
- [pickers] Improve clear action label (#14243) @oliviertassinari
|
|
139
|
+
- [pickers] Add `"use client"` directive to every public component and hook (#14562) @flaviendelangle
|
|
140
|
+
- [pickers] Allow custom fields to validate the value (#14486) @flaviendelangle
|
|
141
|
+
- [pickers] Stop using utils in locales (#14505) @flaviendelangle
|
|
142
|
+
|
|
143
|
+
#### `@mui/x-date-pickers-pro@7.17.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
144
|
+
|
|
145
|
+
Same changes as in `@mui/x-date-pickers@7.17.0`, plus:
|
|
146
|
+
|
|
147
|
+
- [DateRangePicker] Fix `currentMonthCalendarPosition` not scrolling to future sibling (#14442) @GMchris
|
|
148
|
+
|
|
149
|
+
### Charts
|
|
150
|
+
|
|
151
|
+
#### `@mui/x-charts@7.17.0`
|
|
152
|
+
|
|
153
|
+
- [charts] Add `"use client"` directive to every public component and hook (#14578) @flaviendelangle
|
|
154
|
+
- [charts] Allow `onItemClick` on the `Legend` component (#14231) @JCQuintas
|
|
155
|
+
- [charts] Fix `onAxisClick` with `layout='horizontal'` (#14547) @alexfauquette
|
|
156
|
+
- [charts] Replace `path` with `circle` for performance improvement (#14518) @alexfauquette
|
|
157
|
+
|
|
158
|
+
#### `@mui/x-charts-pro@7.0.0-beta.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
159
|
+
|
|
160
|
+
Same changes as in `@mui/x-charts@7.17.0`.
|
|
161
|
+
|
|
162
|
+
### Tree View
|
|
163
|
+
|
|
164
|
+
#### `@mui/x-tree-view@7.17.0`
|
|
165
|
+
|
|
166
|
+
- [TreeView] Make `useTreeItem2` stable (#14498) @flaviendelangle
|
|
167
|
+
|
|
168
|
+
### Docs
|
|
169
|
+
|
|
170
|
+
- [docs] Add missing callout on "Imperative API" tree view sections (#14503) @flaviendelangle
|
|
171
|
+
- [docs] Fix broken redirection to MUI X v5 @oliviertassinari
|
|
172
|
+
- [docs] Fix multiple `console.error` messages on `charts` docs (#14554) @JCQuintas
|
|
173
|
+
- [docs] Fixed typo in Row Grouping recipes (#14549) @Miodini
|
|
174
|
+
- [docs] Match title with blog posts @oliviertassinari
|
|
175
|
+
|
|
176
|
+
### Core
|
|
177
|
+
|
|
178
|
+
- [core] Move warning methods to `@mui/x-internals` (#14528) @k-rajat19
|
|
179
|
+
- [core] Sync with core release flow @oliviertassinari
|
|
180
|
+
- [code-infra] Fix charts benchmark workflow (#14573) @JCQuintas
|
|
181
|
+
- [docs-infra] Type interface API pages (#14138) @alexfauquette
|
|
182
|
+
- [infra] Create `ESLint plugins` renovate group (#14574) @LukasTy
|
|
183
|
+
- [license] Clean-up terminology to match codebase (#14531) @oliviertassinari
|
|
184
|
+
- [test] Remove dead `act()` logic (#14529) @oliviertassinari
|
|
185
|
+
|
|
6
186
|
## 7.16.0
|
|
7
187
|
|
|
8
188
|
_Sep 5, 2024_
|
|
@@ -108,7 +288,7 @@ We'd like to offer a big thanks to the 8 contributors who made this release poss
|
|
|
108
288
|
|
|
109
289
|
- 💫 Support Material UI v6 (`@mui/material@6`) peer dependency (#14142) @cherniavskii
|
|
110
290
|
|
|
111
|
-
You can now use MUI
|
|
291
|
+
You can now use MUI X components with either v5 or v6 of `@mui/material` package 🎉
|
|
112
292
|
|
|
113
293
|
- 🐞 Bugfixes
|
|
114
294
|
|
|
@@ -153,7 +333,7 @@ Same changes as in `@mui/x-charts@7.15.0`, plus:
|
|
|
153
333
|
|
|
154
334
|
- [docs] Fix sentence case `h2` @oliviertassinari
|
|
155
335
|
- [docs] Clarify contribution guide references @oliviertassinari
|
|
156
|
-
- [docs] Fix Stack
|
|
336
|
+
- [docs] Fix Stack Overflow issue canned response @oliviertassinari
|
|
157
337
|
- [docs] Fix outdated link to support page @oliviertassinari
|
|
158
338
|
- [docs] Fix use of Material UI @oliviertassinari
|
|
159
339
|
- [docs] Update deprecated props in docs (#14295) @JCQuintas
|
|
@@ -411,7 +591,7 @@ The [Pro plan](https://mui.com/x/introduction/licensing/#pro-plan) is receiving
|
|
|
411
591
|
|
|
412
592
|
As always, every feature released as part of the MIT plan will remain free and MIT licensed forever.
|
|
413
593
|
|
|
414
|
-
This expansion of the Pro plan comes with some adjustments to our pricing strategy. Learn more about those in the [Upcoming changes to MUI
|
|
594
|
+
This expansion of the Pro plan comes with some adjustments to our pricing strategy. Learn more about those in the [Upcoming changes to MUI X pricing in 2024](https://mui.com/blog/mui-x-sep-2024-price-update/) blog post.
|
|
415
595
|
|
|
416
596
|
### Highlights
|
|
417
597
|
|
|
@@ -476,7 +656,7 @@ Same changes as in `@mui/x-date-pickers@7.12.0`.
|
|
|
476
656
|
#### `@mui/x-charts@7.12.0`
|
|
477
657
|
|
|
478
658
|
- [charts] Fix incorrect `axisId` prop being allowed in xAxis/yAxis config. Use `id` instead. (#13986) @JCQuintas
|
|
479
|
-
- [charts] Use vendor to have
|
|
659
|
+
- [charts] Use vendor to have CommonJS bundle working out of the box (#13608) @alexfauquette
|
|
480
660
|
- [charts] Divide the `SeriesProvider` to use in filtering (#14026) @JCQuintas
|
|
481
661
|
|
|
482
662
|
### Tree View
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
4
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
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", "yearsPerRow", "monthsPerRow", "timezone"];
|
|
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"];
|
|
4
6
|
import * as React from 'react';
|
|
5
7
|
import PropTypes from 'prop-types';
|
|
6
8
|
import clsx from 'clsx';
|
|
@@ -118,6 +120,7 @@ export const DateCalendar = /*#__PURE__*/React.forwardRef(function DateCalendar(
|
|
|
118
120
|
loading,
|
|
119
121
|
renderLoading,
|
|
120
122
|
displayWeekNumber,
|
|
123
|
+
yearsOrder,
|
|
121
124
|
yearsPerRow,
|
|
122
125
|
monthsPerRow,
|
|
123
126
|
timezone: timezoneProp
|
|
@@ -309,6 +312,7 @@ export const DateCalendar = /*#__PURE__*/React.forwardRef(function DateCalendar(
|
|
|
309
312
|
shouldDisableYear: shouldDisableYear,
|
|
310
313
|
hasFocus: hasFocus,
|
|
311
314
|
onFocusedViewChange: isViewFocused => setFocusedView('year', isViewFocused),
|
|
315
|
+
yearsOrder: yearsOrder,
|
|
312
316
|
yearsPerRow: yearsPerRow,
|
|
313
317
|
referenceDate: referenceDate
|
|
314
318
|
})), view === 'month' && /*#__PURE__*/_jsx(MonthCalendar, _extends({}, baseDateValidationProps, commonViewProps, {
|
|
@@ -558,6 +562,12 @@ process.env.NODE_ENV !== "production" ? DateCalendar.propTypes = {
|
|
|
558
562
|
* Available views.
|
|
559
563
|
*/
|
|
560
564
|
views: PropTypes.arrayOf(PropTypes.oneOf(['day', 'month', 'year']).isRequired),
|
|
565
|
+
/**
|
|
566
|
+
* Years are displayed in ascending (chronological) order by default.
|
|
567
|
+
* If `desc`, years are displayed in descending order.
|
|
568
|
+
* @default 'asc'
|
|
569
|
+
*/
|
|
570
|
+
yearsOrder: PropTypes.oneOf(['asc', 'desc']),
|
|
561
571
|
/**
|
|
562
572
|
* Years rendered per row.
|
|
563
573
|
* @default 3
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { PickerValidDate } from '../models';
|
|
3
|
-
|
|
1
|
+
import { ValidateDateProps } from '../validation';
|
|
2
|
+
import { PickerValidDate, TimezoneProps } from '../models';
|
|
3
|
+
import { DefaultizedProps } from '../internals/models/helpers';
|
|
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;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import * as React from 'react';
|
|
2
|
-
import { validateDate } from "../
|
|
4
|
+
import { validateDate } from "../validation/index.js";
|
|
3
5
|
import { useLocalizationContext } from "../internals/hooks/useUtils.js";
|
|
4
6
|
export const useIsDateDisabled = ({
|
|
5
7
|
shouldDisableDate,
|
|
@@ -15,6 +17,7 @@ export const useIsDateDisabled = ({
|
|
|
15
17
|
return React.useCallback(day => validateDate({
|
|
16
18
|
adapter,
|
|
17
19
|
value: day,
|
|
20
|
+
timezone,
|
|
18
21
|
props: {
|
|
19
22
|
shouldDisableDate,
|
|
20
23
|
shouldDisableMonth,
|
|
@@ -22,8 +25,7 @@ export const useIsDateDisabled = ({
|
|
|
22
25
|
minDate,
|
|
23
26
|
maxDate,
|
|
24
27
|
disableFuture,
|
|
25
|
-
disablePast
|
|
26
|
-
timezone
|
|
28
|
+
disablePast
|
|
27
29
|
}
|
|
28
30
|
}) !== null, [adapter, shouldDisableDate, shouldDisableMonth, shouldDisableYear, minDate, maxDate, disableFuture, disablePast, timezone]);
|
|
29
31
|
};
|
package/DateField/DateField.js
CHANGED
|
@@ -2,12 +2,17 @@ import * as React from 'react';
|
|
|
2
2
|
import { SlotComponentProps } from '@mui/utils';
|
|
3
3
|
import TextField from '@mui/material/TextField';
|
|
4
4
|
import { ExportedUseClearableFieldProps, UseClearableFieldSlots, UseClearableFieldSlotProps } from '../hooks/useClearableField';
|
|
5
|
-
import { DateValidationError, FieldSection, PickerValidDate, BuiltInFieldTextFieldProps } from '../models';
|
|
5
|
+
import { DateValidationError, FieldSection, PickerValidDate, BuiltInFieldTextFieldProps, BaseSingleInputFieldProps } from '../models';
|
|
6
6
|
import { UseFieldInternalProps } from '../internals/hooks/useField';
|
|
7
|
-
import { MakeOptional } from '../internals/models/helpers';
|
|
7
|
+
import { MakeOptional, DefaultizedProps } from '../internals/models/helpers';
|
|
8
8
|
import { BaseDateValidationProps, DayValidationProps, MonthValidationProps, YearValidationProps } from '../internals/models/validation';
|
|
9
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 {
|
|
10
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* Props the field can receive when used inside a date picker.
|
|
13
|
+
* (`DatePicker`, `DesktopDatePicker` or `MobileDatePicker` component).
|
|
14
|
+
*/
|
|
15
|
+
export type DateFieldInPickerProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean> = DefaultizedProps<UseDateFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, 'format' | 'timezone' | keyof BaseDateValidationProps<TDate>> & BaseSingleInputFieldProps<TDate | null, TDate, FieldSection, false, DateValidationError>;
|
|
11
16
|
export type UseDateFieldComponentProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean, TChildProps extends {}> = Omit<TChildProps, keyof UseDateFieldProps<TDate, TEnableAccessibleFieldDOMStructure>> & UseDateFieldProps<TDate, TEnableAccessibleFieldDOMStructure>;
|
|
12
17
|
export type DateFieldProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean = false> = UseDateFieldComponentProps<TDate, TEnableAccessibleFieldDOMStructure, BuiltInFieldTextFieldProps<TEnableAccessibleFieldDOMStructure>> & {
|
|
13
18
|
/**
|
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, UseDateFieldComponentProps, DateFieldProps, } from './DateField.types';
|
|
3
|
+
export type { UseDateFieldProps, UseDateFieldComponentProps, DateFieldProps, DateFieldInPickerProps, } from './DateField.types';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { UseDateFieldProps } from './DateField.types';
|
|
2
2
|
import { PickerValidDate } from '../models';
|
|
3
|
-
export declare const useDateField: <TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean, TAllProps extends UseDateFieldProps<TDate, TEnableAccessibleFieldDOMStructure>>(inProps: TAllProps) => import("../internals/hooks/useField").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>>>, keyof
|
|
3
|
+
export declare const useDateField: <TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean, TAllProps extends UseDateFieldProps<TDate, TEnableAccessibleFieldDOMStructure>>(inProps: TAllProps) => import("../internals/hooks/useField").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">>;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import { singleItemFieldValueManager, singleItemValueManager } from "../internals/utils/valueManagers.js";
|
|
2
4
|
import { useField } from "../internals/hooks/useField/index.js";
|
|
3
|
-
import { validateDate } from "../
|
|
4
|
-
import {
|
|
5
|
+
import { validateDate } from "../validation/index.js";
|
|
6
|
+
import { useSplitFieldProps } from "../hooks/index.js";
|
|
5
7
|
import { useDefaultizedDateField } from "../internals/hooks/defaultizedFieldProps.js";
|
|
6
8
|
export const useDateField = inProps => {
|
|
7
9
|
const props = useDefaultizedDateField(inProps);
|
|
8
10
|
const {
|
|
9
11
|
forwardedProps,
|
|
10
12
|
internalProps
|
|
11
|
-
} =
|
|
13
|
+
} = useSplitFieldProps(props, 'date');
|
|
12
14
|
return useField({
|
|
13
15
|
forwardedProps,
|
|
14
16
|
internalProps,
|
package/DatePicker/DatePicker.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
4
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
5
|
const _excluded = ["desktopModeMediaQuery"];
|
|
@@ -349,6 +351,12 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
|
|
|
349
351
|
* Available views.
|
|
350
352
|
*/
|
|
351
353
|
views: PropTypes.arrayOf(PropTypes.oneOf(['day', 'month', 'year']).isRequired),
|
|
354
|
+
/**
|
|
355
|
+
* Years are displayed in ascending (chronological) order by default.
|
|
356
|
+
* If `desc`, years are displayed in descending order.
|
|
357
|
+
* @default 'asc'
|
|
358
|
+
*/
|
|
359
|
+
yearsOrder: PropTypes.oneOf(['asc', 'desc']),
|
|
352
360
|
/**
|
|
353
361
|
* Years rendered per row.
|
|
354
362
|
* @default 4 on desktop, 3 on mobile
|
|
@@ -12,11 +12,6 @@ export interface DatePickerProps<TDate extends PickerValidDate, TEnableAccessibl
|
|
|
12
12
|
* @example '@media (min-width: 720px)' or theme.breakpoints.up("sm")
|
|
13
13
|
*/
|
|
14
14
|
desktopModeMediaQuery?: string;
|
|
15
|
-
/**
|
|
16
|
-
* Years rendered per row.
|
|
17
|
-
* @default 4 on desktop, 3 on mobile
|
|
18
|
-
*/
|
|
19
|
-
yearsPerRow?: 3 | 4;
|
|
20
15
|
/**
|
|
21
16
|
* Overridable component slots.
|
|
22
17
|
* @default {}
|
|
@@ -27,4 +22,9 @@ export interface DatePickerProps<TDate extends PickerValidDate, TEnableAccessibl
|
|
|
27
22
|
* @default {}
|
|
28
23
|
*/
|
|
29
24
|
slotProps?: DatePickerSlotProps<TDate, TEnableAccessibleFieldDOMStructure>;
|
|
25
|
+
/**
|
|
26
|
+
* Years rendered per row.
|
|
27
|
+
* @default 4 on desktop, 3 on mobile
|
|
28
|
+
*/
|
|
29
|
+
yearsPerRow?: 3 | 4;
|
|
30
30
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
4
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
5
|
const _excluded = ["value", "isLandscape", "onChange", "toolbarFormat", "toolbarPlaceholder", "views", "className", "onViewChange", "view"];
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { SlotComponentProps } from '@mui/utils';
|
|
3
3
|
import TextField from '@mui/material/TextField';
|
|
4
|
-
import { DateTimeValidationError, FieldSection, PickerValidDate, BuiltInFieldTextFieldProps } from '../models';
|
|
4
|
+
import { DateTimeValidationError, FieldSection, PickerValidDate, BuiltInFieldTextFieldProps, BaseSingleInputFieldProps } from '../models';
|
|
5
5
|
import { UseFieldInternalProps } from '../internals/hooks/useField';
|
|
6
|
-
import { MakeOptional } from '../internals/models/helpers';
|
|
6
|
+
import { DefaultizedProps, MakeOptional } from '../internals/models/helpers';
|
|
7
7
|
import { BaseDateValidationProps, BaseTimeValidationProps, DateTimeValidationProps, DayValidationProps, MonthValidationProps, TimeValidationProps, YearValidationProps } from '../internals/models/validation';
|
|
8
8
|
import { ExportedUseClearableFieldProps, UseClearableFieldSlots, UseClearableFieldSlotProps } from '../hooks/useClearableField';
|
|
9
9
|
export interface UseDateTimeFieldProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean> extends MakeOptional<UseFieldInternalProps<TDate | null, TDate, FieldSection, TEnableAccessibleFieldDOMStructure, DateTimeValidationError>, 'format'>, DayValidationProps<TDate>, MonthValidationProps<TDate>, YearValidationProps<TDate>, BaseDateValidationProps<TDate>, TimeValidationProps<TDate>, BaseTimeValidationProps, DateTimeValidationProps<TDate>, ExportedUseClearableFieldProps {
|
|
@@ -13,6 +13,11 @@ export interface UseDateTimeFieldProps<TDate extends PickerValidDate, TEnableAcc
|
|
|
13
13
|
*/
|
|
14
14
|
ampm?: boolean;
|
|
15
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Props the field can receive when used inside a date time picker.
|
|
18
|
+
* (`DateTimePicker`, `DesktopDateTimePicker` or `MobileDateTimePicker` component).
|
|
19
|
+
*/
|
|
20
|
+
export type DateTimeFieldInPickerProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean> = DefaultizedProps<UseDateTimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, 'format' | 'timezone' | 'ampm' | keyof BaseDateValidationProps<TDate> | keyof BaseTimeValidationProps> & BaseSingleInputFieldProps<TDate | null, TDate, FieldSection, false, DateTimeValidationError>;
|
|
16
21
|
export type UseDateTimeFieldComponentProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean, TChildProps extends {}> = Omit<TChildProps, keyof UseDateTimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>> & UseDateTimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>;
|
|
17
22
|
export type DateTimeFieldProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean = false> = UseDateTimeFieldComponentProps<TDate, TEnableAccessibleFieldDOMStructure, BuiltInFieldTextFieldProps<TEnableAccessibleFieldDOMStructure>> & {
|
|
18
23
|
/**
|
package/DateTimeField/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { DateTimeField } from './DateTimeField';
|
|
2
2
|
export { useDateTimeField as unstable_useDateTimeField } from './useDateTimeField';
|
|
3
|
-
export type { UseDateTimeFieldProps, UseDateTimeFieldComponentProps, DateTimeFieldProps, } from './DateTimeField.types';
|
|
3
|
+
export type { UseDateTimeFieldProps, UseDateTimeFieldComponentProps, DateTimeFieldProps, DateTimeFieldInPickerProps, } from './DateTimeField.types';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { UseDateTimeFieldProps } from './DateTimeField.types';
|
|
2
2
|
import { PickerValidDate } from '../models';
|
|
3
|
-
export declare const useDateTimeField: <TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean, TAllProps extends UseDateTimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>>(inProps: TAllProps) => import("../internals/hooks/useField").UseFieldResponse<TEnableAccessibleFieldDOMStructure, Omit<TAllProps & Omit<UseDateTimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, keyof import("../internals/hooks/defaultizedFieldProps").UseDefaultizedDateTimeFieldBaseProps<any>> & Required<Pick<UseDateTimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, keyof import("../internals/hooks/defaultizedFieldProps").UseDefaultizedDateTimeFieldBaseProps<any>>>,
|
|
3
|
+
export declare const useDateTimeField: <TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean, TAllProps extends UseDateTimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>>(inProps: TAllProps) => import("../internals/hooks/useField").UseFieldResponse<TEnableAccessibleFieldDOMStructure, Omit<TAllProps & Omit<UseDateTimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, keyof import("../internals/hooks/defaultizedFieldProps").UseDefaultizedDateTimeFieldBaseProps<any>> & Required<Pick<UseDateTimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, keyof import("../internals/hooks/defaultizedFieldProps").UseDefaultizedDateTimeFieldBaseProps<any>>>, "disabled" | "format" | "onChange" | "onError" | "defaultValue" | "value" | "readOnly" | "minDate" | "maxDate" | "ampm" | "disableFuture" | "disablePast" | "timezone" | "referenceDate" | "formatDensity" | "shouldRespectLeadingZeros" | "selectedSections" | "onSelectedSectionsChange" | "unstableFieldRef" | "enableAccessibleFieldDOMStructure" | "minutesStep" | "shouldDisableDate" | "shouldDisableMonth" | "shouldDisableYear" | "minTime" | "maxTime" | "shouldDisableTime" | "disableIgnoringDatePartForTimeValidation" | "minDateTime" | "maxDateTime" | "dateSeparator">>;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import { singleItemFieldValueManager, singleItemValueManager } from "../internals/utils/valueManagers.js";
|
|
2
4
|
import { useField } from "../internals/hooks/useField/index.js";
|
|
3
|
-
import { validateDateTime } from "../
|
|
4
|
-
import {
|
|
5
|
+
import { validateDateTime } from "../validation/index.js";
|
|
6
|
+
import { useSplitFieldProps } from "../hooks/index.js";
|
|
5
7
|
import { useDefaultizedDateTimeField } from "../internals/hooks/defaultizedFieldProps.js";
|
|
6
8
|
export const useDateTimeField = inProps => {
|
|
7
9
|
const props = useDefaultizedDateTimeField(inProps);
|
|
8
10
|
const {
|
|
9
11
|
forwardedProps,
|
|
10
12
|
internalProps
|
|
11
|
-
} =
|
|
13
|
+
} = useSplitFieldProps(props, 'date-time');
|
|
12
14
|
return useField({
|
|
13
15
|
forwardedProps,
|
|
14
16
|
internalProps,
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
4
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
5
|
const _excluded = ["desktopModeMediaQuery"];
|
|
@@ -420,6 +422,12 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
|
|
|
420
422
|
* Available views.
|
|
421
423
|
*/
|
|
422
424
|
views: PropTypes.arrayOf(PropTypes.oneOf(['day', 'hours', 'minutes', 'month', 'seconds', 'year']).isRequired),
|
|
425
|
+
/**
|
|
426
|
+
* Years are displayed in ascending (chronological) order by default.
|
|
427
|
+
* If `desc`, years are displayed in descending order.
|
|
428
|
+
* @default 'asc'
|
|
429
|
+
*/
|
|
430
|
+
yearsOrder: PropTypes.oneOf(['asc', 'desc']),
|
|
423
431
|
/**
|
|
424
432
|
* Years rendered per row.
|
|
425
433
|
* @default 4 on desktop, 3 on mobile
|
|
@@ -2,22 +2,18 @@ import { DesktopDateTimePickerProps, DesktopDateTimePickerSlots, DesktopDateTime
|
|
|
2
2
|
import { DateOrTimeViewWithMeridiem } from '../internals/models';
|
|
3
3
|
import { MobileDateTimePickerProps, MobileDateTimePickerSlots, MobileDateTimePickerSlotProps } from '../MobileDateTimePicker';
|
|
4
4
|
import { PickerValidDate } from '../models';
|
|
5
|
+
import { ExportedYearCalendarProps } from '../YearCalendar/YearCalendar.types';
|
|
5
6
|
export interface DateTimePickerSlots<TDate extends PickerValidDate> extends DesktopDateTimePickerSlots<TDate>, MobileDateTimePickerSlots<TDate, DateOrTimeViewWithMeridiem> {
|
|
6
7
|
}
|
|
7
8
|
export interface DateTimePickerSlotProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean> extends DesktopDateTimePickerSlotProps<TDate, TEnableAccessibleFieldDOMStructure>, MobileDateTimePickerSlotProps<TDate, DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure> {
|
|
8
9
|
}
|
|
9
|
-
export interface DateTimePickerProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean = false> extends DesktopDateTimePickerProps<TDate, TEnableAccessibleFieldDOMStructure>, Omit<MobileDateTimePickerProps<TDate, DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure>, 'views'> {
|
|
10
|
+
export interface DateTimePickerProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean = false> extends DesktopDateTimePickerProps<TDate, TEnableAccessibleFieldDOMStructure>, ExportedYearCalendarProps, Omit<MobileDateTimePickerProps<TDate, DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure>, 'views'> {
|
|
10
11
|
/**
|
|
11
12
|
* CSS media query when `Mobile` mode will be changed to `Desktop`.
|
|
12
13
|
* @default '@media (pointer: fine)'
|
|
13
14
|
* @example '@media (min-width: 720px)' or theme.breakpoints.up("sm")
|
|
14
15
|
*/
|
|
15
16
|
desktopModeMediaQuery?: string;
|
|
16
|
-
/**
|
|
17
|
-
* Years rendered per row.
|
|
18
|
-
* @default 4 on desktop, 3 on mobile
|
|
19
|
-
*/
|
|
20
|
-
yearsPerRow?: 3 | 4;
|
|
21
17
|
/**
|
|
22
18
|
* Overridable component slots.
|
|
23
19
|
* @default {}
|
|
@@ -28,4 +24,9 @@ export interface DateTimePickerProps<TDate extends PickerValidDate, TEnableAcces
|
|
|
28
24
|
* @default {}
|
|
29
25
|
*/
|
|
30
26
|
slotProps?: DateTimePickerSlotProps<TDate, TEnableAccessibleFieldDOMStructure>;
|
|
27
|
+
/**
|
|
28
|
+
* Years rendered per row.
|
|
29
|
+
* @default 4 on desktop, 3 on mobile
|
|
30
|
+
*/
|
|
31
|
+
yearsPerRow?: 3 | 4;
|
|
31
32
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
4
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
5
|
const _excluded = ["ampm", "ampmInClock", "value", "onChange", "view", "isLandscape", "onViewChange", "toolbarFormat", "toolbarPlaceholder", "views", "disabled", "readOnly", "toolbarVariant", "toolbarTitle", "className"];
|