@mui/x-date-pickers 8.0.0-alpha.1 → 8.0.0-alpha.11
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 +2 -4
- package/AdapterDateFns/AdapterDateFns.js +49 -47
- package/AdapterDateFnsBase/AdapterDateFnsBase.d.ts +1 -1
- package/AdapterDateFnsJalali/AdapterDateFnsJalali.d.ts +2 -4
- package/AdapterDateFnsJalali/AdapterDateFnsJalali.js +48 -46
- package/{AdapterDateFnsJalaliV3/AdapterDateFnsJalaliV3.d.ts → AdapterDateFnsJalaliV2/AdapterDateFnsJalaliV2.d.ts} +2 -2
- package/{AdapterDateFnsJalaliV3/AdapterDateFnsJalaliV3.js → AdapterDateFnsJalaliV2/AdapterDateFnsJalaliV2.js} +45 -52
- package/AdapterDateFnsJalaliV2/index.d.ts +1 -0
- package/AdapterDateFnsJalaliV2/index.js +1 -0
- package/{AdapterDateFnsJalaliV3 → AdapterDateFnsJalaliV2}/package.json +1 -1
- package/{AdapterDateFnsV3/AdapterDateFnsV3.d.ts → AdapterDateFnsV2/AdapterDateFnsV2.d.ts} +2 -2
- package/{AdapterDateFnsV3/AdapterDateFnsV3.js → AdapterDateFnsV2/AdapterDateFnsV2.js} +46 -54
- package/AdapterDateFnsV2/index.d.ts +1 -0
- package/AdapterDateFnsV2/index.js +1 -0
- package/{AdapterDateFnsV3 → AdapterDateFnsV2}/package.json +1 -1
- package/AdapterDayjs/AdapterDayjs.d.ts +1 -1
- package/AdapterLuxon/AdapterLuxon.d.ts +1 -1
- package/AdapterMoment/AdapterMoment.d.ts +1 -1
- package/AdapterMoment/AdapterMoment.js +10 -0
- package/CHANGELOG.md +2007 -230
- package/DateCalendar/DateCalendar.js +41 -22
- package/DateCalendar/DateCalendar.types.d.ts +2 -1
- package/DateCalendar/DayCalendar.d.ts +1 -2
- package/DateCalendar/DayCalendar.js +12 -36
- package/DateCalendar/PickersFadeTransitionGroup.d.ts +1 -1
- package/DateCalendar/PickersFadeTransitionGroup.js +4 -6
- package/DateCalendar/PickersSlideTransition.d.ts +1 -1
- package/DateCalendar/PickersSlideTransition.js +12 -5
- package/DateCalendar/useCalendarState.d.ts +13 -27
- package/DateCalendar/useCalendarState.js +65 -55
- package/DateField/DateField.js +29 -33
- package/DateField/DateField.types.d.ts +7 -15
- package/DateField/useDateField.d.ts +1 -1
- package/DateField/useDateField.js +14 -11
- package/DatePicker/DatePicker.js +1 -1
- package/DatePicker/DatePicker.types.d.ts +7 -3
- package/DatePicker/DatePickerToolbar.d.ts +1 -2
- package/DatePicker/DatePickerToolbar.js +17 -33
- package/DatePicker/shared.d.ts +6 -5
- package/DateTimeField/DateTimeField.js +29 -33
- package/DateTimeField/DateTimeField.types.d.ts +7 -16
- package/DateTimeField/useDateTimeField.d.ts +1 -1
- package/DateTimeField/useDateTimeField.js +14 -11
- package/DateTimePicker/DateTimePicker.js +2 -2
- package/DateTimePicker/DateTimePicker.types.d.ts +4 -5
- package/DateTimePicker/DateTimePickerTabs.d.ts +2 -5
- package/DateTimePicker/DateTimePickerTabs.js +15 -20
- package/DateTimePicker/DateTimePickerToolbar.d.ts +16 -5
- package/DateTimePicker/DateTimePickerToolbar.js +88 -80
- package/DateTimePicker/shared.d.ts +8 -8
- package/DayCalendarSkeleton/DayCalendarSkeleton.js +10 -19
- package/DesktopDatePicker/DesktopDatePicker.js +11 -17
- package/DesktopDatePicker/DesktopDatePicker.types.d.ts +7 -3
- package/DesktopDateTimePicker/DesktopDateTimePicker.js +17 -27
- package/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +2 -2
- package/DesktopDateTimePicker/DesktopDateTimePickerLayout.d.ts +2 -2
- package/DesktopDateTimePicker/DesktopDateTimePickerLayout.js +9 -34
- package/DesktopTimePicker/DesktopTimePicker.js +6 -22
- package/DesktopTimePicker/DesktopTimePicker.types.d.ts +2 -2
- package/DigitalClock/DigitalClock.js +13 -11
- package/DigitalClock/DigitalClock.types.d.ts +8 -2
- package/MobileDatePicker/MobileDatePicker.js +4 -14
- package/MobileDatePicker/MobileDatePicker.types.d.ts +2 -3
- package/MobileDateTimePicker/MobileDateTimePicker.js +4 -14
- package/MobileDateTimePicker/MobileDateTimePicker.types.d.ts +4 -4
- package/MobileTimePicker/MobileTimePicker.js +4 -14
- package/MobileTimePicker/MobileTimePicker.types.d.ts +4 -4
- package/MonthCalendar/MonthCalendar.d.ts +1 -1
- package/MonthCalendar/MonthCalendar.js +31 -11
- package/MonthCalendar/MonthCalendar.types.d.ts +2 -2
- package/MonthCalendar/MonthCalendarButton.d.ts +24 -0
- package/{modern/MonthCalendar/PickersMonth.js → MonthCalendar/MonthCalendarButton.js} +20 -61
- package/MonthCalendar/index.d.ts +0 -3
- package/MonthCalendar/index.js +1 -2
- package/MonthCalendar/monthCalendarClasses.d.ts +7 -1
- package/MonthCalendar/monthCalendarClasses.js +1 -1
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +11 -7
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.types.d.ts +6 -6
- package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.d.ts +4 -4
- package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +14 -10
- package/PickersActionBar/PickersActionBar.d.ts +6 -7
- package/PickersActionBar/PickersActionBar.js +26 -17
- package/PickersCalendarHeader/PickersCalendarHeader.js +12 -9
- package/PickersCalendarHeader/PickersCalendarHeader.types.d.ts +4 -6
- package/PickersLayout/PickersLayout.d.ts +7 -5
- package/PickersLayout/PickersLayout.js +23 -42
- package/PickersLayout/PickersLayout.types.d.ts +20 -22
- package/PickersLayout/usePickerLayout.d.ts +5 -4
- package/PickersLayout/usePickerLayout.js +26 -53
- package/PickersSectionList/PickersSectionList.js +21 -16
- package/PickersSectionList/PickersSectionList.types.d.ts +13 -6
- package/PickersShortcuts/PickersShortcuts.d.ts +9 -11
- package/PickersShortcuts/PickersShortcuts.js +21 -11
- package/PickersShortcuts/index.d.ts +1 -1
- package/PickersTextField/PickersFilledInput/PickersFilledInput.d.ts +7 -0
- package/PickersTextField/PickersFilledInput/PickersFilledInput.js +34 -28
- package/PickersTextField/PickersFilledInput/pickersFilledInputClasses.d.ts +1 -1
- package/PickersTextField/PickersInput/PickersInput.js +20 -14
- package/PickersTextField/PickersInput/pickersInputClasses.d.ts +3 -2
- package/PickersTextField/PickersInput/pickersInputClasses.js +1 -1
- package/PickersTextField/PickersInputBase/PickersInputBase.d.ts +3 -6
- package/PickersTextField/PickersInputBase/PickersInputBase.js +45 -38
- package/PickersTextField/PickersInputBase/PickersInputBase.types.d.ts +1 -0
- package/PickersTextField/PickersOutlinedInput/Outline.d.ts +0 -1
- package/PickersTextField/PickersOutlinedInput/Outline.js +13 -10
- package/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.js +8 -14
- package/PickersTextField/PickersTextField.js +75 -62
- package/PickersTextField/PickersTextField.types.d.ts +43 -4
- package/PickersTextField/usePickerTextFieldOwnerState.d.ts +4 -0
- package/PickersTextField/usePickerTextFieldOwnerState.js +11 -0
- package/README.md +8 -5
- package/StaticDatePicker/StaticDatePicker.js +2 -2
- package/StaticDatePicker/StaticDatePicker.types.d.ts +2 -3
- package/StaticDateTimePicker/StaticDateTimePicker.js +2 -2
- package/StaticDateTimePicker/StaticDateTimePicker.types.d.ts +2 -2
- package/StaticTimePicker/StaticTimePicker.js +2 -2
- package/StaticTimePicker/StaticTimePicker.types.d.ts +2 -2
- package/TimeClock/Clock.d.ts +4 -0
- package/TimeClock/Clock.js +27 -27
- package/TimeClock/ClockNumber.js +15 -11
- package/TimeClock/ClockPointer.d.ts +6 -1
- package/TimeClock/ClockPointer.js +16 -10
- package/TimeClock/TimeClock.js +30 -12
- package/TimeField/TimeField.js +28 -32
- package/TimeField/TimeField.types.d.ts +7 -16
- package/TimeField/useTimeField.d.ts +1 -1
- package/TimeField/useTimeField.js +14 -11
- package/TimePicker/TimePicker.js +2 -2
- package/TimePicker/TimePicker.types.d.ts +4 -5
- package/TimePicker/TimePickerToolbar.d.ts +1 -3
- package/TimePicker/TimePickerToolbar.js +36 -51
- package/TimePicker/shared.d.ts +6 -6
- package/YearCalendar/YearCalendar.js +46 -13
- package/YearCalendar/YearCalendar.types.d.ts +2 -2
- package/YearCalendar/YearCalendarButton.d.ts +23 -0
- package/{modern/YearCalendar/PickersYear.js → YearCalendar/YearCalendarButton.js} +20 -59
- package/YearCalendar/index.d.ts +0 -3
- package/YearCalendar/index.js +1 -2
- package/YearCalendar/yearCalendarClasses.d.ts +7 -1
- package/YearCalendar/yearCalendarClasses.js +1 -1
- package/hooks/index.d.ts +2 -0
- package/hooks/index.js +3 -1
- package/hooks/useClearableField.d.ts +5 -3
- package/hooks/useClearableField.js +4 -2
- package/hooks/useIsValidValue.d.ts +7 -0
- package/hooks/useIsValidValue.js +11 -0
- package/hooks/useParsedFormat.d.ts +9 -7
- package/hooks/useParsedFormat.js +11 -13
- package/hooks/usePickerActionsContext.d.ts +7 -0
- package/hooks/usePickerActionsContext.js +15 -0
- package/hooks/usePickerContext.d.ts +5 -1
- package/hooks/usePickerContext.js +2 -2
- package/hooks/useSplitFieldProps.d.ts +12 -3
- package/hooks/useSplitFieldProps.js +8 -3
- package/index.d.ts +1 -0
- package/index.js +3 -2
- package/internals/components/PickerFieldUI.d.ts +133 -0
- package/internals/components/PickerFieldUI.js +317 -0
- package/internals/components/{PickersPopper.d.ts → PickerPopper/PickerPopper.d.ts} +26 -25
- package/{modern/internals/components/PickersPopper.js → internals/components/PickerPopper/PickerPopper.js} +47 -47
- package/internals/components/PickerPopper/index.d.ts +4 -0
- package/internals/components/PickerPopper/index.js +2 -0
- package/internals/components/PickerPopper/pickerPopperClasses.d.ts +9 -0
- package/internals/components/PickerPopper/pickerPopperClasses.js +6 -0
- package/internals/components/PickerProvider.d.ts +86 -32
- package/internals/components/PickerProvider.js +25 -7
- package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +12 -11
- package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.types.d.ts +11 -8
- package/internals/components/PickersModalDialog.d.ts +1 -3
- package/internals/components/PickersModalDialog.js +9 -3
- package/internals/components/PickersToolbar.d.ts +2 -3
- package/internals/components/PickersToolbar.js +15 -12
- package/internals/components/PickersToolbarButton.js +4 -6
- package/internals/components/PickersToolbarText.js +11 -13
- package/internals/hooks/date-helpers-hooks.js +4 -3
- package/internals/hooks/useClockReferenceDate.d.ts +2 -1
- package/internals/hooks/useDesktopPicker/useDesktopPicker.d.ts +1 -1
- package/internals/hooks/useDesktopPicker/useDesktopPicker.js +35 -120
- package/internals/hooks/useDesktopPicker/useDesktopPicker.types.d.ts +16 -38
- package/internals/hooks/useField/buildSectionsFromFormat.js +1 -1
- package/internals/hooks/useField/index.d.ts +2 -0
- package/internals/hooks/useField/index.js +2 -1
- package/internals/hooks/useField/useField.d.ts +3 -3
- package/internals/hooks/useField/useField.js +17 -4
- package/internals/hooks/useField/useField.types.d.ts +55 -48
- package/internals/hooks/useField/useField.utils.d.ts +4 -3
- package/internals/hooks/useField/useField.utils.js +2 -2
- package/internals/hooks/useField/useFieldCharacterEditing.d.ts +6 -5
- package/internals/hooks/useField/useFieldInternalPropsWithDefaults.d.ts +15 -0
- package/internals/hooks/useField/useFieldInternalPropsWithDefaults.js +47 -0
- package/internals/hooks/useField/useFieldState.d.ts +9 -8
- package/internals/hooks/useField/useFieldState.js +2 -3
- package/internals/hooks/useField/useFieldV6TextField.d.ts +4 -3
- package/internals/hooks/useField/useFieldV6TextField.js +5 -2
- package/internals/hooks/useField/useFieldV7TextField.js +6 -3
- package/internals/hooks/useFieldOwnerState.d.ts +6 -0
- package/internals/hooks/useFieldOwnerState.js +16 -0
- package/internals/hooks/useMobilePicker/useMobilePicker.d.ts +1 -1
- package/internals/hooks/useMobilePicker/useMobilePicker.js +34 -68
- package/internals/hooks/useMobilePicker/useMobilePicker.types.d.ts +15 -22
- package/internals/hooks/useNullablePickerContext.d.ts +5 -0
- package/internals/hooks/useNullablePickerContext.js +10 -0
- package/internals/hooks/useOpenState.d.ts +3 -2
- package/internals/hooks/useOpenState.js +11 -9
- package/internals/hooks/usePicker/index.d.ts +1 -1
- package/internals/hooks/usePicker/usePicker.d.ts +3 -4
- package/internals/hooks/usePicker/usePicker.js +4 -20
- package/internals/hooks/usePicker/usePicker.types.d.ts +10 -10
- package/internals/hooks/usePicker/usePickerProvider.d.ts +45 -10
- package/internals/hooks/usePicker/usePickerProvider.js +50 -16
- package/internals/hooks/usePicker/usePickerValue.d.ts +3 -2
- package/internals/hooks/usePicker/usePickerValue.js +84 -214
- package/internals/hooks/usePicker/usePickerValue.types.d.ts +130 -75
- package/internals/hooks/usePicker/usePickerViews.d.ts +59 -41
- package/internals/hooks/usePicker/usePickerViews.js +31 -20
- package/internals/hooks/useReduceAnimations.d.ts +2 -0
- package/internals/hooks/{useDefaultReduceAnimations.js → useReduceAnimations.js} +5 -2
- package/internals/hooks/useStaticPicker/useStaticPicker.d.ts +1 -1
- package/internals/hooks/useStaticPicker/useStaticPicker.js +7 -12
- package/internals/hooks/useStaticPicker/useStaticPicker.types.d.ts +7 -13
- package/internals/hooks/useToolbarOwnerState.d.ts +10 -0
- package/internals/hooks/useToolbarOwnerState.js +13 -0
- package/internals/hooks/useUtils.d.ts +4 -3
- package/internals/hooks/useUtils.js +1 -1
- package/internals/hooks/useValueWithTimezone.d.ts +5 -4
- package/internals/hooks/useViews.d.ts +5 -5
- package/internals/index.d.ts +27 -18
- package/internals/index.js +13 -8
- package/internals/models/common.d.ts +1 -1
- package/internals/models/fields.d.ts +8 -24
- package/internals/models/index.d.ts +1 -0
- package/internals/models/index.js +2 -1
- package/internals/models/manager.d.ts +15 -0
- package/internals/models/manager.js +1 -0
- package/internals/models/pickers.d.ts +1 -0
- package/internals/models/pickers.js +1 -0
- package/internals/models/props/basePickerProps.d.ts +3 -33
- package/internals/models/props/tabs.d.ts +0 -13
- package/internals/models/props/time.d.ts +2 -1
- package/internals/models/props/toolbar.d.ts +1 -19
- package/internals/models/value.d.ts +9 -0
- package/internals/utils/date-utils.d.ts +1 -1
- package/internals/utils/date-utils.js +1 -1
- package/internals/utils/utils.d.ts +3 -0
- package/internals/utils/utils.js +11 -1
- package/internals/utils/valueManagers.d.ts +4 -3
- package/internals/utils/valueManagers.js +4 -4
- package/locales/index.d.ts +1 -0
- package/locales/index.js +1 -0
- package/locales/nbNO.js +15 -19
- package/locales/nlNL.js +7 -7
- package/locales/roRO.js +15 -18
- package/locales/utils/getPickersLocalization.d.ts +0 -7
- package/locales/utils/getPickersLocalization.js +0 -13
- package/locales/zhTW.d.ts +80 -0
- package/locales/zhTW.js +73 -0
- package/managers/index.d.ts +6 -0
- package/managers/index.js +3 -0
- package/managers/package.json +6 -0
- package/managers/useDateManager.d.ts +27 -0
- package/managers/useDateManager.js +55 -0
- package/managers/useDateTimeManager.d.ts +28 -0
- package/managers/useDateTimeManager.js +60 -0
- package/managers/useTimeManager.d.ts +28 -0
- package/managers/useTimeManager.js +51 -0
- package/models/adapters.d.ts +5 -5
- package/models/fields.d.ts +33 -9
- package/models/index.d.ts +1 -0
- package/models/index.js +1 -0
- package/models/manager.d.ts +87 -0
- package/models/manager.js +1 -0
- package/models/pickers.d.ts +7 -0
- package/models/validation.d.ts +2 -1
- package/modern/AdapterDateFns/AdapterDateFns.js +49 -47
- package/modern/AdapterDateFnsJalali/AdapterDateFnsJalali.js +48 -46
- package/modern/{AdapterDateFnsJalaliV3/AdapterDateFnsJalaliV3.js → AdapterDateFnsJalaliV2/AdapterDateFnsJalaliV2.js} +45 -52
- package/modern/AdapterDateFnsJalaliV2/index.js +1 -0
- package/modern/{AdapterDateFnsV3/AdapterDateFnsV3.js → AdapterDateFnsV2/AdapterDateFnsV2.js} +46 -54
- package/modern/AdapterDateFnsV2/index.js +1 -0
- package/modern/AdapterMoment/AdapterMoment.js +10 -0
- package/modern/DateCalendar/DateCalendar.js +41 -22
- package/modern/DateCalendar/DayCalendar.js +12 -36
- package/modern/DateCalendar/PickersFadeTransitionGroup.js +4 -6
- package/modern/DateCalendar/PickersSlideTransition.js +12 -5
- package/modern/DateCalendar/useCalendarState.js +65 -55
- package/modern/DateField/DateField.js +29 -33
- package/modern/DateField/useDateField.js +14 -11
- package/modern/DatePicker/DatePicker.js +1 -1
- package/modern/DatePicker/DatePickerToolbar.js +17 -33
- package/modern/DateTimeField/DateTimeField.js +29 -33
- package/modern/DateTimeField/useDateTimeField.js +14 -11
- package/modern/DateTimePicker/DateTimePicker.js +2 -2
- package/modern/DateTimePicker/DateTimePickerTabs.js +15 -20
- package/modern/DateTimePicker/DateTimePickerToolbar.js +88 -80
- package/modern/DayCalendarSkeleton/DayCalendarSkeleton.js +10 -19
- package/modern/DesktopDatePicker/DesktopDatePicker.js +11 -17
- package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +17 -27
- package/modern/DesktopDateTimePicker/DesktopDateTimePickerLayout.js +9 -34
- package/modern/DesktopTimePicker/DesktopTimePicker.js +6 -22
- package/modern/DigitalClock/DigitalClock.js +13 -11
- package/modern/MobileDatePicker/MobileDatePicker.js +4 -14
- package/modern/MobileDateTimePicker/MobileDateTimePicker.js +4 -14
- package/modern/MobileTimePicker/MobileTimePicker.js +4 -14
- package/modern/MonthCalendar/MonthCalendar.js +31 -11
- package/{MonthCalendar/PickersMonth.js → modern/MonthCalendar/MonthCalendarButton.js} +20 -61
- package/modern/MonthCalendar/index.js +1 -2
- package/modern/MonthCalendar/monthCalendarClasses.js +1 -1
- package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.js +11 -7
- package/modern/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +14 -10
- package/modern/PickersActionBar/PickersActionBar.js +26 -17
- package/modern/PickersCalendarHeader/PickersCalendarHeader.js +12 -9
- package/modern/PickersLayout/PickersLayout.js +23 -42
- package/modern/PickersLayout/usePickerLayout.js +26 -53
- package/modern/PickersSectionList/PickersSectionList.js +21 -16
- package/modern/PickersShortcuts/PickersShortcuts.js +21 -11
- package/modern/PickersTextField/PickersFilledInput/PickersFilledInput.js +34 -28
- package/modern/PickersTextField/PickersInput/PickersInput.js +20 -14
- package/modern/PickersTextField/PickersInput/pickersInputClasses.js +1 -1
- package/modern/PickersTextField/PickersInputBase/PickersInputBase.js +45 -38
- package/modern/PickersTextField/PickersOutlinedInput/Outline.js +13 -10
- package/modern/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.js +8 -14
- package/modern/PickersTextField/PickersTextField.js +75 -62
- package/modern/PickersTextField/usePickerTextFieldOwnerState.js +11 -0
- package/modern/StaticDatePicker/StaticDatePicker.js +2 -2
- package/modern/StaticDateTimePicker/StaticDateTimePicker.js +2 -2
- package/modern/StaticTimePicker/StaticTimePicker.js +2 -2
- package/modern/TimeClock/Clock.js +27 -27
- package/modern/TimeClock/ClockNumber.js +15 -11
- package/modern/TimeClock/ClockPointer.js +16 -10
- package/modern/TimeClock/TimeClock.js +30 -12
- package/modern/TimeField/TimeField.js +28 -32
- package/modern/TimeField/useTimeField.js +14 -11
- package/modern/TimePicker/TimePicker.js +2 -2
- package/modern/TimePicker/TimePickerToolbar.js +36 -51
- package/modern/YearCalendar/YearCalendar.js +46 -13
- package/{YearCalendar/PickersYear.js → modern/YearCalendar/YearCalendarButton.js} +20 -59
- package/modern/YearCalendar/index.js +1 -2
- package/modern/YearCalendar/yearCalendarClasses.js +1 -1
- package/modern/hooks/index.js +3 -1
- package/modern/hooks/useClearableField.js +4 -2
- package/modern/hooks/useIsValidValue.js +11 -0
- package/modern/hooks/useParsedFormat.js +11 -13
- package/modern/hooks/usePickerActionsContext.js +15 -0
- package/modern/hooks/usePickerContext.js +2 -2
- package/modern/hooks/useSplitFieldProps.js +8 -3
- package/modern/index.js +3 -2
- package/modern/internals/components/PickerFieldUI.js +317 -0
- package/{internals/components/PickersPopper.js → modern/internals/components/PickerPopper/PickerPopper.js} +47 -47
- package/modern/internals/components/PickerPopper/index.js +2 -0
- package/modern/internals/components/PickerPopper/pickerPopperClasses.js +6 -0
- package/modern/internals/components/PickerProvider.js +25 -7
- package/modern/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +12 -11
- package/modern/internals/components/PickersModalDialog.js +9 -3
- package/modern/internals/components/PickersToolbar.js +15 -12
- package/modern/internals/components/PickersToolbarButton.js +4 -6
- package/modern/internals/components/PickersToolbarText.js +11 -13
- package/modern/internals/hooks/date-helpers-hooks.js +4 -3
- package/modern/internals/hooks/useDesktopPicker/useDesktopPicker.js +35 -120
- package/modern/internals/hooks/useField/buildSectionsFromFormat.js +1 -1
- package/modern/internals/hooks/useField/index.js +2 -1
- package/modern/internals/hooks/useField/useField.js +17 -4
- package/modern/internals/hooks/useField/useField.utils.js +2 -2
- package/modern/internals/hooks/useField/useFieldInternalPropsWithDefaults.js +47 -0
- package/modern/internals/hooks/useField/useFieldState.js +2 -3
- package/modern/internals/hooks/useField/useFieldV6TextField.js +5 -2
- package/modern/internals/hooks/useField/useFieldV7TextField.js +6 -3
- package/modern/internals/hooks/useFieldOwnerState.js +16 -0
- package/modern/internals/hooks/useMobilePicker/useMobilePicker.js +34 -68
- package/modern/internals/hooks/useNullablePickerContext.js +10 -0
- package/modern/internals/hooks/useOpenState.js +11 -9
- package/modern/internals/hooks/usePicker/usePicker.js +4 -20
- package/modern/internals/hooks/usePicker/usePickerProvider.js +50 -16
- package/modern/internals/hooks/usePicker/usePickerValue.js +84 -214
- package/modern/internals/hooks/usePicker/usePickerViews.js +31 -20
- package/modern/internals/hooks/{useDefaultReduceAnimations.js → useReduceAnimations.js} +5 -2
- package/modern/internals/hooks/useStaticPicker/useStaticPicker.js +7 -12
- package/modern/internals/hooks/useToolbarOwnerState.js +13 -0
- package/modern/internals/hooks/useUtils.js +1 -1
- package/modern/internals/index.js +13 -8
- package/modern/internals/models/index.js +2 -1
- package/modern/internals/models/manager.js +1 -0
- package/modern/internals/models/pickers.js +1 -0
- package/modern/internals/utils/date-utils.js +1 -1
- package/modern/internals/utils/utils.js +11 -1
- package/modern/internals/utils/valueManagers.js +4 -4
- package/modern/locales/index.js +1 -0
- package/modern/locales/nbNO.js +15 -19
- package/modern/locales/nlNL.js +7 -7
- package/modern/locales/roRO.js +15 -18
- package/modern/locales/utils/getPickersLocalization.js +0 -13
- package/modern/locales/zhTW.js +73 -0
- package/modern/managers/index.js +3 -0
- package/modern/managers/useDateManager.js +55 -0
- package/modern/managers/useDateTimeManager.js +60 -0
- package/modern/managers/useTimeManager.js +51 -0
- package/modern/models/index.js +1 -0
- package/modern/models/manager.js +1 -0
- package/modern/validation/useValidation.js +1 -1
- package/modern/validation/validateDate.js +8 -0
- package/modern/validation/validateDateTime.js +8 -0
- package/modern/validation/validateTime.js +8 -0
- package/node/AdapterDateFns/AdapterDateFns.js +97 -97
- package/node/AdapterDateFnsJalali/AdapterDateFnsJalali.js +97 -96
- package/node/{AdapterDateFnsJalaliV3/AdapterDateFnsJalaliV3.js → AdapterDateFnsJalaliV2/AdapterDateFnsJalaliV2.js} +94 -101
- package/node/{AdapterDateFnsJalaliV3 → AdapterDateFnsJalaliV2}/index.js +1 -1
- package/node/AdapterDateFnsV2/AdapterDateFnsV2.js +291 -0
- package/node/{AdapterDateFnsV3 → AdapterDateFnsV2}/index.js +1 -1
- package/node/AdapterMoment/AdapterMoment.js +10 -0
- package/node/DateCalendar/DateCalendar.js +41 -22
- package/node/DateCalendar/DayCalendar.js +12 -37
- package/node/DateCalendar/PickersFadeTransitionGroup.js +4 -6
- package/node/DateCalendar/PickersSlideTransition.js +12 -5
- package/node/DateCalendar/useCalendarState.js +66 -57
- package/node/DateField/DateField.js +29 -33
- package/node/DateField/useDateField.js +13 -10
- package/node/DatePicker/DatePicker.js +1 -1
- package/node/DatePicker/DatePickerToolbar.js +17 -33
- package/node/DateTimeField/DateTimeField.js +29 -33
- package/node/DateTimeField/useDateTimeField.js +13 -10
- package/node/DateTimePicker/DateTimePicker.js +2 -2
- package/node/DateTimePicker/DateTimePickerTabs.js +15 -20
- package/node/DateTimePicker/DateTimePickerToolbar.js +89 -80
- package/node/DayCalendarSkeleton/DayCalendarSkeleton.js +10 -19
- package/node/DesktopDatePicker/DesktopDatePicker.js +11 -17
- package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +17 -27
- package/node/DesktopDateTimePicker/DesktopDateTimePickerLayout.js +10 -35
- package/node/DesktopTimePicker/DesktopTimePicker.js +6 -22
- package/node/DigitalClock/DigitalClock.js +13 -11
- package/node/MobileDatePicker/MobileDatePicker.js +4 -14
- package/node/MobileDateTimePicker/MobileDateTimePicker.js +4 -14
- package/node/MobileTimePicker/MobileTimePicker.js +4 -14
- package/node/MonthCalendar/MonthCalendar.js +31 -11
- package/node/MonthCalendar/{PickersMonth.js → MonthCalendarButton.js} +20 -61
- package/node/MonthCalendar/index.js +1 -8
- package/node/MonthCalendar/monthCalendarClasses.js +1 -1
- package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.js +11 -7
- package/node/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +13 -10
- package/node/PickersActionBar/PickersActionBar.js +28 -19
- package/node/PickersCalendarHeader/PickersCalendarHeader.js +12 -9
- package/node/PickersLayout/PickersLayout.js +23 -42
- package/node/PickersLayout/usePickerLayout.js +30 -57
- package/node/PickersSectionList/PickersSectionList.js +21 -16
- package/node/PickersShortcuts/PickersShortcuts.js +21 -11
- package/node/PickersTextField/PickersFilledInput/PickersFilledInput.js +34 -28
- package/node/PickersTextField/PickersInput/PickersInput.js +20 -14
- package/node/PickersTextField/PickersInput/pickersInputClasses.js +1 -1
- package/node/PickersTextField/PickersInputBase/PickersInputBase.js +45 -38
- package/node/PickersTextField/PickersOutlinedInput/Outline.js +13 -10
- package/node/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.js +8 -14
- package/node/PickersTextField/PickersTextField.js +75 -62
- package/node/PickersTextField/usePickerTextFieldOwnerState.js +18 -0
- package/node/StaticDatePicker/StaticDatePicker.js +2 -2
- package/node/StaticDateTimePicker/StaticDateTimePicker.js +2 -2
- package/node/StaticTimePicker/StaticTimePicker.js +2 -2
- package/node/TimeClock/Clock.js +27 -27
- package/node/TimeClock/ClockNumber.js +15 -11
- package/node/TimeClock/ClockPointer.js +15 -10
- package/node/TimeClock/TimeClock.js +30 -12
- package/node/TimeField/TimeField.js +28 -32
- package/node/TimeField/useTimeField.js +13 -10
- package/node/TimePicker/TimePicker.js +2 -2
- package/node/TimePicker/TimePickerToolbar.js +36 -51
- package/node/YearCalendar/YearCalendar.js +45 -12
- package/node/YearCalendar/{PickersYear.js → YearCalendarButton.js} +20 -59
- package/node/YearCalendar/index.js +1 -8
- package/node/YearCalendar/yearCalendarClasses.js +1 -1
- package/node/hooks/index.js +15 -1
- package/node/hooks/useClearableField.js +4 -2
- package/node/hooks/useIsValidValue.js +18 -0
- package/node/hooks/useParsedFormat.js +11 -13
- package/node/hooks/usePickerActionsContext.js +22 -0
- package/node/hooks/usePickerContext.js +5 -4
- package/node/hooks/useSplitFieldProps.js +7 -2
- package/node/index.js +13 -1
- package/node/internals/components/PickerFieldUI.js +329 -0
- package/node/internals/components/{PickersPopper.js → PickerPopper/PickerPopper.js} +48 -48
- package/node/internals/components/PickerPopper/index.js +25 -0
- package/node/internals/components/PickerPopper/pickerPopperClasses.js +14 -0
- package/node/internals/components/PickerProvider.js +27 -9
- package/node/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +12 -11
- package/node/internals/components/PickersModalDialog.js +9 -3
- package/node/internals/components/PickersToolbar.js +15 -12
- package/node/internals/components/PickersToolbarButton.js +4 -6
- package/node/internals/components/PickersToolbarText.js +10 -12
- package/node/internals/hooks/date-helpers-hooks.js +4 -3
- package/node/internals/hooks/useDesktopPicker/useDesktopPicker.js +37 -122
- package/node/internals/hooks/useField/buildSectionsFromFormat.js +1 -1
- package/node/internals/hooks/useField/index.js +8 -1
- package/node/internals/hooks/useField/useField.js +16 -3
- package/node/internals/hooks/useField/useField.utils.js +2 -2
- package/node/internals/hooks/useField/useFieldInternalPropsWithDefaults.js +56 -0
- package/node/internals/hooks/useField/useFieldState.js +2 -3
- package/node/internals/hooks/useField/useFieldV6TextField.js +5 -2
- package/node/internals/hooks/useField/useFieldV7TextField.js +6 -3
- package/node/internals/hooks/useFieldOwnerState.js +24 -0
- package/node/internals/hooks/useMobilePicker/useMobilePicker.js +35 -69
- package/node/internals/hooks/useNullablePickerContext.js +16 -0
- package/node/internals/hooks/useOpenState.js +12 -9
- package/node/internals/hooks/usePicker/usePicker.js +4 -20
- package/node/internals/hooks/usePicker/usePickerProvider.js +51 -17
- package/node/internals/hooks/usePicker/usePickerValue.js +84 -213
- package/node/internals/hooks/usePicker/usePickerViews.js +31 -21
- package/node/internals/hooks/{useDefaultReduceAnimations.js → useReduceAnimations.js} +7 -4
- package/node/internals/hooks/useStaticPicker/useStaticPicker.js +7 -12
- package/node/internals/hooks/useToolbarOwnerState.js +21 -0
- package/node/internals/hooks/useUtils.js +1 -1
- package/node/internals/index.js +87 -34
- package/node/internals/models/index.js +11 -0
- package/node/internals/models/manager.js +5 -0
- package/node/internals/models/pickers.js +5 -0
- package/node/internals/utils/date-utils.js +1 -1
- package/node/internals/utils/utils.js +14 -2
- package/node/internals/utils/valueManagers.js +4 -4
- package/node/locales/index.js +11 -0
- package/node/locales/nbNO.js +15 -19
- package/node/locales/nlNL.js +7 -7
- package/node/locales/roRO.js +15 -18
- package/node/locales/utils/getPickersLocalization.js +2 -16
- package/node/locales/zhTW.js +79 -0
- package/node/managers/index.js +26 -0
- package/node/managers/useDateManager.js +63 -0
- package/node/managers/useDateTimeManager.js +68 -0
- package/node/managers/useTimeManager.js +59 -0
- package/node/models/index.js +11 -0
- package/node/models/manager.js +5 -0
- package/node/validation/useValidation.js +1 -1
- package/node/validation/validateDate.js +8 -0
- package/node/validation/validateDateTime.js +8 -0
- package/node/validation/validateTime.js +8 -0
- package/package.json +5 -5
- package/themeAugmentation/components.d.ts +3 -11
- package/themeAugmentation/overrides.d.ts +5 -7
- package/themeAugmentation/props.d.ts +7 -9
- package/validation/extractValidationProps.d.ts +1 -1
- package/validation/useValidation.d.ts +7 -6
- package/validation/useValidation.js +1 -1
- package/validation/validateDate.d.ts +12 -3
- package/validation/validateDate.js +8 -0
- package/validation/validateDateTime.d.ts +12 -4
- package/validation/validateDateTime.js +8 -0
- package/validation/validateTime.d.ts +12 -3
- package/validation/validateTime.js +8 -0
- package/AdapterDateFnsJalaliV3/index.d.ts +0 -1
- package/AdapterDateFnsJalaliV3/index.js +0 -1
- package/AdapterDateFnsV3/index.d.ts +0 -1
- package/AdapterDateFnsV3/index.js +0 -1
- package/MonthCalendar/PickersMonth.d.ts +0 -28
- package/MonthCalendar/pickersMonthClasses.d.ts +0 -13
- package/MonthCalendar/pickersMonthClasses.js +0 -5
- package/YearCalendar/PickersYear.d.ts +0 -27
- package/YearCalendar/pickersYearClasses.d.ts +0 -13
- package/YearCalendar/pickersYearClasses.js +0 -5
- package/internals/components/pickersPopperClasses.d.ts +0 -9
- package/internals/components/pickersPopperClasses.js +0 -5
- package/internals/hooks/defaultizedFieldProps.d.ts +0 -18
- package/internals/hooks/defaultizedFieldProps.js +0 -40
- package/internals/hooks/useDefaultReduceAnimations.d.ts +0 -2
- package/internals/hooks/useIsLandscape.d.ts +0 -4
- package/internals/hooks/useIsLandscape.js +0 -35
- package/internals/hooks/usePicker/usePickerLayoutProps.d.ts +0 -32
- package/internals/hooks/usePicker/usePickerLayoutProps.js +0 -31
- package/internals/utils/convertFieldResponseIntoMuiTextFieldProps.d.ts +0 -3
- package/internals/utils/convertFieldResponseIntoMuiTextFieldProps.js +0 -44
- package/modern/AdapterDateFnsJalaliV3/index.js +0 -1
- package/modern/AdapterDateFnsV3/index.js +0 -1
- package/modern/MonthCalendar/pickersMonthClasses.js +0 -5
- package/modern/YearCalendar/pickersYearClasses.js +0 -5
- package/modern/internals/components/pickersPopperClasses.js +0 -5
- package/modern/internals/hooks/defaultizedFieldProps.js +0 -40
- package/modern/internals/hooks/useIsLandscape.js +0 -35
- package/modern/internals/hooks/usePicker/usePickerLayoutProps.js +0 -31
- package/modern/internals/utils/convertFieldResponseIntoMuiTextFieldProps.js +0 -44
- package/node/AdapterDateFnsV3/AdapterDateFnsV3.js +0 -299
- package/node/MonthCalendar/pickersMonthClasses.js +0 -12
- package/node/YearCalendar/pickersYearClasses.js +0 -12
- package/node/internals/components/pickersPopperClasses.js +0 -12
- package/node/internals/hooks/defaultizedFieldProps.js +0 -50
- package/node/internals/hooks/useIsLandscape.js +0 -43
- package/node/internals/hooks/usePicker/usePickerLayoutProps.js +0 -38
- package/node/internals/utils/convertFieldResponseIntoMuiTextFieldProps.js +0 -52
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["label", "autoFocus", "disableUnderline", "ownerState"];
|
|
3
|
+
const _excluded = ["label", "autoFocus", "disableUnderline", "ownerState", "classes"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
-
import { useFormControl } from '@mui/material/FormControl';
|
|
7
6
|
import { styled, useThemeProps } from '@mui/material/styles';
|
|
7
|
+
import { shouldForwardProp } from '@mui/system/createStyled';
|
|
8
8
|
import { refType } from '@mui/utils';
|
|
9
9
|
import composeClasses from '@mui/utils/composeClasses';
|
|
10
10
|
import { pickersInputClasses, getPickersInputUtilityClass } from "./pickersInputClasses.js";
|
|
11
11
|
import { PickersInputBase } from "../PickersInputBase/index.js";
|
|
12
12
|
import { PickersInputBaseRoot } from "../PickersInputBase/PickersInputBase.js";
|
|
13
|
+
import { usePickerTextFieldOwnerState } from "../usePickerTextFieldOwnerState.js";
|
|
13
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
15
|
const PickersInputRoot = styled(PickersInputBaseRoot, {
|
|
15
16
|
name: 'MuiPickersInput',
|
|
16
17
|
slot: 'Root',
|
|
17
|
-
overridesResolver: (props, styles) => styles.root
|
|
18
|
+
overridesResolver: (props, styles) => styles.root,
|
|
19
|
+
shouldForwardProp: prop => shouldForwardProp(prop) && prop !== 'disableUnderline'
|
|
18
20
|
})(({
|
|
19
21
|
theme
|
|
20
22
|
}) => {
|
|
@@ -31,7 +33,7 @@ const PickersInputRoot = styled(PickersInputBaseRoot, {
|
|
|
31
33
|
// @ts-ignore
|
|
32
34
|
.filter(key => (theme.vars ?? theme).palette[key].main).map(color => ({
|
|
33
35
|
props: {
|
|
34
|
-
color
|
|
36
|
+
inputColor: color
|
|
35
37
|
},
|
|
36
38
|
style: {
|
|
37
39
|
'&::after': {
|
|
@@ -96,18 +98,18 @@ const PickersInputRoot = styled(PickersInputBaseRoot, {
|
|
|
96
98
|
}]
|
|
97
99
|
};
|
|
98
100
|
});
|
|
99
|
-
const useUtilityClasses = ownerState => {
|
|
101
|
+
const useUtilityClasses = (classes, ownerState) => {
|
|
100
102
|
const {
|
|
101
|
-
|
|
102
|
-
disableUnderline
|
|
103
|
+
inputHasUnderline
|
|
103
104
|
} = ownerState;
|
|
104
105
|
const slots = {
|
|
105
|
-
root: ['root', !
|
|
106
|
+
root: ['root', !inputHasUnderline && 'underline'],
|
|
106
107
|
input: ['input']
|
|
107
108
|
};
|
|
108
109
|
const composedClasses = composeClasses(slots, getPickersInputUtilityClass, classes);
|
|
109
110
|
return _extends({}, classes, composedClasses);
|
|
110
111
|
};
|
|
112
|
+
|
|
111
113
|
/**
|
|
112
114
|
* @ignore - internal component.
|
|
113
115
|
*/
|
|
@@ -119,18 +121,22 @@ const PickersInput = /*#__PURE__*/React.forwardRef(function PickersInput(inProps
|
|
|
119
121
|
const {
|
|
120
122
|
label,
|
|
121
123
|
disableUnderline = false,
|
|
122
|
-
|
|
124
|
+
classes: classesProp
|
|
123
125
|
} = props,
|
|
124
126
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
125
|
-
const
|
|
126
|
-
const ownerState = _extends({},
|
|
127
|
-
disableUnderline
|
|
128
|
-
color: muiFormControl?.color || 'primary'
|
|
127
|
+
const pickerTextFieldOwnerState = usePickerTextFieldOwnerState();
|
|
128
|
+
const ownerState = _extends({}, pickerTextFieldOwnerState, {
|
|
129
|
+
inputHasUnderline: !disableUnderline
|
|
129
130
|
});
|
|
130
|
-
const classes = useUtilityClasses(ownerState);
|
|
131
|
+
const classes = useUtilityClasses(classesProp, ownerState);
|
|
131
132
|
return /*#__PURE__*/_jsx(PickersInputBase, _extends({
|
|
132
133
|
slots: {
|
|
133
134
|
root: PickersInputRoot
|
|
135
|
+
},
|
|
136
|
+
slotProps: {
|
|
137
|
+
root: {
|
|
138
|
+
disableUnderline
|
|
139
|
+
}
|
|
134
140
|
}
|
|
135
141
|
}, other, {
|
|
136
142
|
label: label,
|
|
@@ -6,11 +6,12 @@ export interface PickersInputClasses extends PickersInputBaseClasses {
|
|
|
6
6
|
export type PickersInputClassKey = keyof PickersInputClasses;
|
|
7
7
|
export declare function getPickersInputUtilityClass(slot: string): string;
|
|
8
8
|
export declare const pickersInputClasses: {
|
|
9
|
-
|
|
9
|
+
underline: string;
|
|
10
10
|
input: string;
|
|
11
|
+
root: string;
|
|
12
|
+
disabled: string;
|
|
11
13
|
readOnly: string;
|
|
12
14
|
error: string;
|
|
13
|
-
root: string;
|
|
14
15
|
focused: string;
|
|
15
16
|
adornedStart: string;
|
|
16
17
|
adornedEnd: string;
|
|
@@ -5,4 +5,4 @@ import { pickersInputBaseClasses } from "../PickersInputBase/index.js";
|
|
|
5
5
|
export function getPickersInputUtilityClass(slot) {
|
|
6
6
|
return generateUtilityClass('MuiPickersFilledInput', slot);
|
|
7
7
|
}
|
|
8
|
-
export const pickersInputClasses = _extends({}, pickersInputBaseClasses, generateUtilityClasses('MuiPickersInput', ['root', 'input']));
|
|
8
|
+
export const pickersInputClasses = _extends({}, pickersInputBaseClasses, generateUtilityClasses('MuiPickersInput', ['root', 'underline', 'input']));
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { FormControlState } from '@mui/material/FormControl';
|
|
3
2
|
import { PickersInputBaseProps } from './PickersInputBase.types';
|
|
3
|
+
import { PickerTextFieldOwnerState } from '../PickersTextField.types';
|
|
4
4
|
export declare const PickersInputBaseRoot: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
5
|
-
ownerState:
|
|
5
|
+
ownerState: PickerTextFieldOwnerState;
|
|
6
6
|
}, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.ClassAttributes<HTMLDivElement> | keyof React.HTMLAttributes<HTMLDivElement>>, {}>;
|
|
7
7
|
export declare const PickersInputBaseSectionsContainer: import("@emotion/styled").StyledComponent<Pick<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.ClassAttributes<HTMLDivElement> | keyof React.HTMLAttributes<HTMLDivElement>>, keyof React.ClassAttributes<HTMLDivElement> | keyof React.HTMLAttributes<HTMLDivElement> | keyof import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
8
|
-
ownerState:
|
|
8
|
+
ownerState: PickerTextFieldOwnerState;
|
|
9
9
|
}, {}, {}>;
|
|
10
|
-
interface OwnerStateType extends FormControlState, Omit<PickersInputBaseProps, keyof FormControlState> {
|
|
11
|
-
isRtl: boolean;
|
|
12
|
-
}
|
|
13
10
|
/**
|
|
14
11
|
* @ignore - internal component.
|
|
15
12
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["elements", "areAllSectionsEmpty", "defaultValue", "label", "value", "onChange", "id", "autoFocus", "endAdornment", "startAdornment", "renderSuffix", "slots", "slotProps", "contentEditable", "tabIndex", "onInput", "onPaste", "onKeyDown", "fullWidth", "name", "readOnly", "inputProps", "inputRef", "sectionListRef", "onFocus", "onBlur"];
|
|
3
|
+
const _excluded = ["elements", "areAllSectionsEmpty", "defaultValue", "label", "value", "onChange", "id", "autoFocus", "endAdornment", "startAdornment", "renderSuffix", "slots", "slotProps", "contentEditable", "tabIndex", "onInput", "onPaste", "onKeyDown", "fullWidth", "name", "readOnly", "inputProps", "inputRef", "sectionListRef", "onFocus", "onBlur", "classes", "ownerState"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { useFormControl } from '@mui/material/FormControl';
|
|
@@ -11,9 +11,9 @@ import composeClasses from '@mui/utils/composeClasses';
|
|
|
11
11
|
import capitalize from '@mui/utils/capitalize';
|
|
12
12
|
import useSlotProps from '@mui/utils/useSlotProps';
|
|
13
13
|
import visuallyHidden from '@mui/utils/visuallyHidden';
|
|
14
|
-
import { useRtl } from '@mui/system/RtlProvider';
|
|
15
14
|
import { pickersInputBaseClasses, getPickersInputBaseUtilityClass } from "./pickersInputBaseClasses.js";
|
|
16
15
|
import { Unstable_PickersSectionList as PickersSectionList, Unstable_PickersSectionListRoot as PickersSectionListRoot, Unstable_PickersSectionListSection as PickersSectionListSection, Unstable_PickersSectionListSectionSeparator as PickersSectionListSectionSeparator, Unstable_PickersSectionListSectionContent as PickersSectionListSectionContent } from "../../PickersSectionList/index.js";
|
|
16
|
+
import { usePickerTextFieldOwnerState } from "../usePickerTextFieldOwnerState.js";
|
|
17
17
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
18
|
const round = value => Math.round(value * 1e5) / 1e5;
|
|
19
19
|
export const PickersInputBaseRoot = styled('div', {
|
|
@@ -35,7 +35,7 @@ export const PickersInputBaseRoot = styled('div', {
|
|
|
35
35
|
letterSpacing: `${round(0.15 / 16)}em`,
|
|
36
36
|
variants: [{
|
|
37
37
|
props: {
|
|
38
|
-
|
|
38
|
+
isInputInFullWidth: true
|
|
39
39
|
},
|
|
40
40
|
style: {
|
|
41
41
|
width: '100%'
|
|
@@ -64,36 +64,35 @@ export const PickersInputBaseSectionsContainer = styled(PickersSectionListRoot,
|
|
|
64
64
|
width: '182px',
|
|
65
65
|
variants: [{
|
|
66
66
|
props: {
|
|
67
|
-
|
|
67
|
+
fieldDirection: 'rtl'
|
|
68
68
|
},
|
|
69
69
|
style: {
|
|
70
70
|
textAlign: 'right /*! @noflip */'
|
|
71
71
|
}
|
|
72
72
|
}, {
|
|
73
73
|
props: {
|
|
74
|
-
|
|
74
|
+
inputSize: 'small'
|
|
75
75
|
},
|
|
76
76
|
style: {
|
|
77
77
|
paddingTop: 1
|
|
78
78
|
}
|
|
79
79
|
}, {
|
|
80
80
|
props: {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
81
|
+
hasStartAdornment: false,
|
|
82
|
+
isFieldFocused: false,
|
|
83
|
+
isFieldValueEmpty: true
|
|
84
84
|
},
|
|
85
85
|
style: {
|
|
86
86
|
color: 'currentColor',
|
|
87
87
|
opacity: 0
|
|
88
88
|
}
|
|
89
89
|
}, {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}) => !adornedStart && !focused && !filled && label == null,
|
|
90
|
+
props: {
|
|
91
|
+
hasStartAdornment: false,
|
|
92
|
+
isFieldFocused: false,
|
|
93
|
+
isFieldValueEmpty: true,
|
|
94
|
+
inputHasLabel: false
|
|
95
|
+
},
|
|
97
96
|
style: theme.vars ? {
|
|
98
97
|
opacity: theme.vars.opacity.inputPlaceholder
|
|
99
98
|
} : {
|
|
@@ -113,7 +112,8 @@ const PickersInputBaseSection = styled(PickersSectionListSection, {
|
|
|
113
112
|
letterSpacing: 'inherit',
|
|
114
113
|
lineHeight: '1.4375em',
|
|
115
114
|
// 23px
|
|
116
|
-
display: '
|
|
115
|
+
display: 'inline-block',
|
|
116
|
+
whiteSpace: 'nowrap'
|
|
117
117
|
}));
|
|
118
118
|
const PickersInputBaseSectionContent = styled(PickersSectionListSectionContent, {
|
|
119
119
|
name: 'MuiPickersInputBase',
|
|
@@ -142,21 +142,20 @@ const PickersInputBaseInput = styled('input', {
|
|
|
142
142
|
slot: 'Input',
|
|
143
143
|
overridesResolver: (props, styles) => styles.hiddenInput
|
|
144
144
|
})(_extends({}, visuallyHidden));
|
|
145
|
-
const useUtilityClasses = ownerState => {
|
|
145
|
+
const useUtilityClasses = (classes, ownerState) => {
|
|
146
146
|
const {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
startAdornment
|
|
147
|
+
isFieldFocused,
|
|
148
|
+
isFieldDisabled,
|
|
149
|
+
isFieldReadOnly,
|
|
150
|
+
hasFieldError,
|
|
151
|
+
inputSize,
|
|
152
|
+
isInputInFullWidth,
|
|
153
|
+
inputColor,
|
|
154
|
+
hasStartAdornment,
|
|
155
|
+
hasEndAdornment
|
|
157
156
|
} = ownerState;
|
|
158
157
|
const slots = {
|
|
159
|
-
root: ['root',
|
|
158
|
+
root: ['root', isFieldFocused && !isFieldDisabled && 'focused', isFieldDisabled && 'disabled', isFieldReadOnly && 'readOnly', hasFieldError && 'error', isInputInFullWidth && 'fullWidth', `color${capitalize(inputColor)}`, inputSize === 'small' && 'inputSizeSmall', hasStartAdornment && 'adornedStart', hasEndAdornment && 'adornedEnd'],
|
|
160
159
|
notchedOutline: ['notchedOutline'],
|
|
161
160
|
input: ['input'],
|
|
162
161
|
sectionsContainer: ['sectionsContainer'],
|
|
@@ -166,6 +165,7 @@ const useUtilityClasses = ownerState => {
|
|
|
166
165
|
};
|
|
167
166
|
return composeClasses(slots, getPickersInputBaseUtilityClass, classes);
|
|
168
167
|
};
|
|
168
|
+
|
|
169
169
|
/**
|
|
170
170
|
* @ignore - internal component.
|
|
171
171
|
*/
|
|
@@ -196,21 +196,27 @@ const PickersInputBase = /*#__PURE__*/React.forwardRef(function PickersInputBase
|
|
|
196
196
|
inputRef,
|
|
197
197
|
sectionListRef,
|
|
198
198
|
onFocus,
|
|
199
|
-
onBlur
|
|
199
|
+
onBlur,
|
|
200
|
+
classes: classesProp,
|
|
201
|
+
ownerState: ownerStateProp
|
|
200
202
|
} = props,
|
|
201
203
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
204
|
+
const ownerStateContext = usePickerTextFieldOwnerState();
|
|
202
205
|
const rootRef = React.useRef(null);
|
|
203
206
|
const handleRootRef = useForkRef(ref, rootRef);
|
|
204
207
|
const handleInputRef = useForkRef(inputProps?.ref, inputRef);
|
|
205
|
-
const isRtl = useRtl();
|
|
206
208
|
const muiFormControl = useFormControl();
|
|
207
209
|
if (!muiFormControl) {
|
|
208
210
|
throw new Error('MUI X: PickersInputBase should always be used inside a PickersTextField component');
|
|
209
211
|
}
|
|
212
|
+
const ownerState = ownerStateProp ?? ownerStateContext;
|
|
210
213
|
const handleInputFocus = event => {
|
|
211
214
|
muiFormControl.onFocus?.(event);
|
|
212
215
|
onFocus?.(event);
|
|
213
216
|
};
|
|
217
|
+
const handleHiddenInputFocus = event => {
|
|
218
|
+
handleInputFocus(event);
|
|
219
|
+
};
|
|
214
220
|
const handleInputBlur = event => {
|
|
215
221
|
muiFormControl.onBlur?.(event);
|
|
216
222
|
onBlur?.(event);
|
|
@@ -230,10 +236,7 @@ const PickersInputBase = /*#__PURE__*/React.forwardRef(function PickersInputBase
|
|
|
230
236
|
muiFormControl.onFilled();
|
|
231
237
|
}
|
|
232
238
|
}, [muiFormControl, areAllSectionsEmpty]);
|
|
233
|
-
const
|
|
234
|
-
isRtl
|
|
235
|
-
});
|
|
236
|
-
const classes = useUtilityClasses(ownerState);
|
|
239
|
+
const classes = useUtilityClasses(classesProp, ownerState);
|
|
237
240
|
const InputRoot = slots?.root || PickersInputBaseRoot;
|
|
238
241
|
const inputRootProps = useSlotProps({
|
|
239
242
|
elementType: InputRoot,
|
|
@@ -266,16 +269,16 @@ const PickersInputBase = /*#__PURE__*/React.forwardRef(function PickersInputBase
|
|
|
266
269
|
sectionSeparator: PickersInputBaseSectionSeparator
|
|
267
270
|
},
|
|
268
271
|
slotProps: {
|
|
269
|
-
root: {
|
|
272
|
+
root: _extends({}, slotProps?.input, {
|
|
270
273
|
ownerState
|
|
271
|
-
},
|
|
274
|
+
}),
|
|
272
275
|
sectionContent: {
|
|
273
276
|
className: pickersInputBaseClasses.sectionContent
|
|
274
277
|
},
|
|
275
278
|
sectionSeparator: ({
|
|
276
|
-
|
|
279
|
+
separatorPosition
|
|
277
280
|
}) => ({
|
|
278
|
-
className:
|
|
281
|
+
className: separatorPosition === 'before' ? pickersInputBaseClasses.sectionBefore : pickersInputBaseClasses.sectionAfter
|
|
279
282
|
})
|
|
280
283
|
}
|
|
281
284
|
}), endAdornment, renderSuffix ? renderSuffix(_extends({}, muiFormControl)) : null, /*#__PURE__*/_jsx(PickersInputBaseInput, _extends({
|
|
@@ -289,6 +292,10 @@ const PickersInputBase = /*#__PURE__*/React.forwardRef(function PickersInputBase
|
|
|
289
292
|
readOnly: readOnly,
|
|
290
293
|
required: muiFormControl.required,
|
|
291
294
|
disabled: muiFormControl.disabled
|
|
295
|
+
// Hidden input element cannot be focused, trigger the root focus instead
|
|
296
|
+
// This allows to maintain the ability to do `inputRef.current.focus()` to focus the field
|
|
297
|
+
,
|
|
298
|
+
onFocus: handleHiddenInputFocus
|
|
292
299
|
}, inputProps, {
|
|
293
300
|
ref: handleInputRef
|
|
294
301
|
}))]
|
|
@@ -3,6 +3,8 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
3
3
|
const _excluded = ["children", "className", "label", "notched", "shrink"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { styled } from '@mui/material/styles';
|
|
6
|
+
import { shouldForwardProp } from '@mui/system/createStyled';
|
|
7
|
+
import { usePickerTextFieldOwnerState } from "../usePickerTextFieldOwnerState.js";
|
|
6
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
9
|
const OutlineRoot = styled('fieldset', {
|
|
8
10
|
name: 'MuiPickersOutlinedInput',
|
|
@@ -36,7 +38,9 @@ const OutlineLabel = styled('span')(({
|
|
|
36
38
|
fontFamily: theme.typography.fontFamily,
|
|
37
39
|
fontSize: 'inherit'
|
|
38
40
|
}));
|
|
39
|
-
const OutlineLegend = styled('legend'
|
|
41
|
+
const OutlineLegend = styled('legend', {
|
|
42
|
+
shouldForwardProp: prop => shouldForwardProp(prop) && prop !== 'notched'
|
|
43
|
+
})(({
|
|
40
44
|
theme
|
|
41
45
|
}) => ({
|
|
42
46
|
float: 'unset',
|
|
@@ -47,7 +51,7 @@ const OutlineLegend = styled('legend')(({
|
|
|
47
51
|
// Fix Horizontal scroll when label too long
|
|
48
52
|
variants: [{
|
|
49
53
|
props: {
|
|
50
|
-
|
|
54
|
+
inputHasLabel: false
|
|
51
55
|
},
|
|
52
56
|
style: {
|
|
53
57
|
padding: 0,
|
|
@@ -60,7 +64,7 @@ const OutlineLegend = styled('legend')(({
|
|
|
60
64
|
}
|
|
61
65
|
}, {
|
|
62
66
|
props: {
|
|
63
|
-
|
|
67
|
+
inputHasLabel: true
|
|
64
68
|
},
|
|
65
69
|
style: {
|
|
66
70
|
display: 'block',
|
|
@@ -86,7 +90,7 @@ const OutlineLegend = styled('legend')(({
|
|
|
86
90
|
}
|
|
87
91
|
}, {
|
|
88
92
|
props: {
|
|
89
|
-
|
|
93
|
+
inputHasLabel: true,
|
|
90
94
|
notched: true
|
|
91
95
|
},
|
|
92
96
|
style: {
|
|
@@ -106,13 +110,11 @@ const OutlineLegend = styled('legend')(({
|
|
|
106
110
|
export default function Outline(props) {
|
|
107
111
|
const {
|
|
108
112
|
className,
|
|
109
|
-
label
|
|
113
|
+
label,
|
|
114
|
+
notched
|
|
110
115
|
} = props,
|
|
111
116
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
112
|
-
const
|
|
113
|
-
const ownerState = _extends({}, props, {
|
|
114
|
-
withLabel
|
|
115
|
-
});
|
|
117
|
+
const ownerState = usePickerTextFieldOwnerState();
|
|
116
118
|
return /*#__PURE__*/_jsx(OutlineRoot, _extends({
|
|
117
119
|
"aria-hidden": true,
|
|
118
120
|
className: className
|
|
@@ -120,7 +122,8 @@ export default function Outline(props) {
|
|
|
120
122
|
ownerState: ownerState,
|
|
121
123
|
children: /*#__PURE__*/_jsx(OutlineLegend, {
|
|
122
124
|
ownerState: ownerState,
|
|
123
|
-
|
|
125
|
+
notched: notched,
|
|
126
|
+
children: label ? /*#__PURE__*/_jsx(OutlineLabel, {
|
|
124
127
|
children: label
|
|
125
128
|
}) :
|
|
126
129
|
/*#__PURE__*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["label", "autoFocus", "ownerState", "notched"];
|
|
3
|
+
const _excluded = ["label", "autoFocus", "ownerState", "classes", "notched"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { useFormControl } from '@mui/material/FormControl';
|
|
@@ -51,7 +51,7 @@ const PickersOutlinedInputRoot = styled(PickersInputBaseRoot, {
|
|
|
51
51
|
// @ts-ignore
|
|
52
52
|
.filter(key => (theme.vars ?? theme).palette[key]?.main ?? false).map(color => ({
|
|
53
53
|
props: {
|
|
54
|
-
color
|
|
54
|
+
inputColor: color
|
|
55
55
|
},
|
|
56
56
|
style: {
|
|
57
57
|
[`&.${pickersOutlinedInputClasses.focused}:not(.${pickersOutlinedInputClasses.error}) .${pickersOutlinedInputClasses.notchedOutline}`]: {
|
|
@@ -70,17 +70,14 @@ const PickersOutlinedInputSectionsContainer = styled(PickersInputBaseSectionsCon
|
|
|
70
70
|
padding: '16.5px 0',
|
|
71
71
|
variants: [{
|
|
72
72
|
props: {
|
|
73
|
-
|
|
73
|
+
inputSize: 'small'
|
|
74
74
|
},
|
|
75
75
|
style: {
|
|
76
76
|
padding: '8.5px 0'
|
|
77
77
|
}
|
|
78
78
|
}]
|
|
79
79
|
});
|
|
80
|
-
const useUtilityClasses =
|
|
81
|
-
const {
|
|
82
|
-
classes
|
|
83
|
-
} = ownerState;
|
|
80
|
+
const useUtilityClasses = classes => {
|
|
84
81
|
const slots = {
|
|
85
82
|
root: ['root'],
|
|
86
83
|
notchedOutline: ['notchedOutline'],
|
|
@@ -89,6 +86,7 @@ const useUtilityClasses = ownerState => {
|
|
|
89
86
|
const composedClasses = composeClasses(slots, getPickersOutlinedInputUtilityClass, classes);
|
|
90
87
|
return _extends({}, classes, composedClasses);
|
|
91
88
|
};
|
|
89
|
+
|
|
92
90
|
/**
|
|
93
91
|
* @ignore - internal component.
|
|
94
92
|
*/
|
|
@@ -99,15 +97,12 @@ const PickersOutlinedInput = /*#__PURE__*/React.forwardRef(function PickersOutli
|
|
|
99
97
|
});
|
|
100
98
|
const {
|
|
101
99
|
label,
|
|
102
|
-
|
|
100
|
+
classes: classesProp,
|
|
103
101
|
notched
|
|
104
102
|
} = props,
|
|
105
103
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
106
104
|
const muiFormControl = useFormControl();
|
|
107
|
-
const
|
|
108
|
-
color: muiFormControl?.color || 'primary'
|
|
109
|
-
});
|
|
110
|
-
const classes = useUtilityClasses(ownerState);
|
|
105
|
+
const classes = useUtilityClasses(classesProp);
|
|
111
106
|
return /*#__PURE__*/_jsx(PickersInputBase, _extends({
|
|
112
107
|
slots: {
|
|
113
108
|
root: PickersOutlinedInputRoot,
|
|
@@ -119,8 +114,7 @@ const PickersOutlinedInput = /*#__PURE__*/React.forwardRef(function PickersOutli
|
|
|
119
114
|
className: classes.notchedOutline,
|
|
120
115
|
label: label != null && label !== '' && muiFormControl?.required ? /*#__PURE__*/_jsxs(React.Fragment, {
|
|
121
116
|
children: [label, "\u2009", '*']
|
|
122
|
-
}) : label
|
|
123
|
-
ownerState: ownerState
|
|
117
|
+
}) : label
|
|
124
118
|
})
|
|
125
119
|
}, other, {
|
|
126
120
|
label: label,
|