@mui/x-date-pickers 9.5.0 → 9.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AdapterDateFns/AdapterDateFns.d.mts +2 -2
- package/AdapterDateFns/AdapterDateFns.d.ts +2 -2
- package/AdapterDateFnsBase/AdapterDateFnsBase.d.mts +2 -2
- package/AdapterDateFnsBase/AdapterDateFnsBase.d.ts +2 -2
- package/AdapterDateFnsJalali/AdapterDateFnsJalali.d.mts +2 -2
- package/AdapterDateFnsJalali/AdapterDateFnsJalali.d.ts +2 -2
- package/AdapterDateFnsJalaliV2/AdapterDateFnsJalaliV2.d.mts +1 -1
- package/AdapterDateFnsJalaliV2/AdapterDateFnsJalaliV2.d.ts +1 -1
- package/AdapterDateFnsV2/AdapterDateFnsV2.d.mts +1 -1
- package/AdapterDateFnsV2/AdapterDateFnsV2.d.ts +1 -1
- package/AdapterDayjs/AdapterDayjs.d.mts +29 -29
- package/AdapterDayjs/AdapterDayjs.d.ts +29 -29
- package/AdapterDayjs/AdapterDayjs.mjs +1 -0
- package/AdapterDayjsBuddhist/AdapterDayjsBuddhist.d.mts +4 -4
- package/AdapterDayjsBuddhist/AdapterDayjsBuddhist.d.ts +4 -4
- package/AdapterDayjsBuddhist/AdapterDayjsBuddhist.mjs +1 -0
- package/AdapterLuxon/AdapterLuxon.d.mts +1 -1
- package/AdapterLuxon/AdapterLuxon.d.ts +1 -1
- package/AdapterMoment/AdapterMoment.d.mts +29 -28
- package/AdapterMoment/AdapterMoment.d.ts +29 -28
- package/AdapterMomentHijri/AdapterMomentHijri.d.mts +15 -13
- package/AdapterMomentHijri/AdapterMomentHijri.d.ts +15 -13
- package/AdapterMomentHijri/AdapterMomentHijri.js +3 -0
- package/AdapterMomentHijri/AdapterMomentHijri.mjs +4 -0
- package/AdapterMomentJalaali/AdapterMomentJalaali.d.mts +13 -12
- package/AdapterMomentJalaali/AdapterMomentJalaali.d.ts +13 -12
- package/AdapterMomentJalaali/AdapterMomentJalaali.mjs +1 -0
- package/CHANGELOG.md +261 -0
- package/DateCalendar/DateCalendar.d.mts +1 -1
- package/DateCalendar/DateCalendar.d.ts +1 -1
- package/DateCalendar/DateCalendar.js +1 -1
- package/DateCalendar/DateCalendar.mjs +1 -1
- package/DateCalendar/DateCalendar.types.d.mts +16 -16
- package/DateCalendar/DateCalendar.types.d.ts +16 -16
- package/DateCalendar/DayCalendar.d.mts +9 -9
- package/DateCalendar/DayCalendar.d.ts +9 -9
- package/DateCalendar/PickersFadeTransitionGroup.d.mts +1 -1
- package/DateCalendar/PickersFadeTransitionGroup.d.ts +1 -1
- package/DateCalendar/PickersSlideTransition.d.mts +3 -3
- package/DateCalendar/PickersSlideTransition.d.ts +3 -3
- package/DateCalendar/useCalendarState.d.mts +3 -3
- package/DateCalendar/useCalendarState.d.ts +3 -3
- package/DateCalendar/useIsDateDisabled.d.mts +3 -3
- package/DateCalendar/useIsDateDisabled.d.ts +3 -3
- package/DateField/DateField.d.mts +1 -1
- package/DateField/DateField.d.ts +1 -1
- package/DateField/DateField.js +2 -1
- package/DateField/DateField.mjs +2 -1
- package/DateField/DateField.types.d.mts +6 -6
- package/DateField/DateField.types.d.ts +6 -6
- package/DateField/useDateField.d.mts +1 -1
- package/DateField/useDateField.d.ts +1 -1
- package/DatePicker/DatePicker.d.mts +1 -1
- package/DatePicker/DatePicker.d.ts +1 -1
- package/DatePicker/DatePicker.js +1 -1
- package/DatePicker/DatePicker.mjs +1 -1
- package/DatePicker/DatePicker.types.d.mts +4 -4
- package/DatePicker/DatePicker.types.d.ts +4 -4
- package/DatePicker/DatePickerToolbar.d.mts +2 -2
- package/DatePicker/DatePickerToolbar.d.ts +2 -2
- package/DatePicker/DatePickerToolbar.js +1 -1
- package/DatePicker/DatePickerToolbar.mjs +1 -1
- package/DatePicker/shared.d.mts +10 -10
- package/DatePicker/shared.d.ts +10 -10
- package/DateTimeField/DateTimeField.d.mts +1 -1
- package/DateTimeField/DateTimeField.d.ts +1 -1
- package/DateTimeField/DateTimeField.js +2 -1
- package/DateTimeField/DateTimeField.mjs +2 -1
- package/DateTimeField/DateTimeField.types.d.mts +7 -7
- package/DateTimeField/DateTimeField.types.d.ts +7 -7
- package/DateTimeField/useDateTimeField.d.mts +1 -1
- package/DateTimeField/useDateTimeField.d.ts +1 -1
- package/DateTimePicker/DateTimePicker.d.mts +1 -1
- package/DateTimePicker/DateTimePicker.d.ts +1 -1
- package/DateTimePicker/DateTimePicker.js +1 -1
- package/DateTimePicker/DateTimePicker.mjs +1 -1
- package/DateTimePicker/DateTimePicker.types.d.mts +5 -5
- package/DateTimePicker/DateTimePicker.types.d.ts +5 -5
- package/DateTimePicker/DateTimePickerTabs.d.mts +2 -2
- package/DateTimePicker/DateTimePickerTabs.d.ts +2 -2
- package/DateTimePicker/DateTimePickerTabs.js +1 -1
- package/DateTimePicker/DateTimePickerTabs.mjs +1 -1
- package/DateTimePicker/DateTimePickerToolbar.d.mts +5 -5
- package/DateTimePicker/DateTimePickerToolbar.d.ts +5 -5
- package/DateTimePicker/DateTimePickerToolbar.js +1 -1
- package/DateTimePicker/DateTimePickerToolbar.mjs +1 -1
- package/DateTimePicker/shared.d.mts +15 -15
- package/DateTimePicker/shared.d.ts +15 -15
- package/DayCalendarSkeleton/DayCalendarSkeleton.d.mts +3 -3
- package/DayCalendarSkeleton/DayCalendarSkeleton.d.ts +3 -3
- package/DayCalendarSkeleton/DayCalendarSkeleton.js +1 -1
- package/DayCalendarSkeleton/DayCalendarSkeleton.mjs +1 -1
- package/DesktopDatePicker/DesktopDatePicker.d.mts +1 -1
- package/DesktopDatePicker/DesktopDatePicker.d.ts +1 -1
- package/DesktopDatePicker/DesktopDatePicker.js +2 -2
- package/DesktopDatePicker/DesktopDatePicker.mjs +2 -2
- package/DesktopDatePicker/DesktopDatePicker.types.d.mts +4 -4
- package/DesktopDatePicker/DesktopDatePicker.types.d.ts +4 -4
- package/DesktopDateTimePicker/DesktopDateTimePicker.d.mts +1 -1
- package/DesktopDateTimePicker/DesktopDateTimePicker.d.ts +1 -1
- package/DesktopDateTimePicker/DesktopDateTimePicker.js +2 -2
- package/DesktopDateTimePicker/DesktopDateTimePicker.mjs +2 -2
- package/DesktopDateTimePicker/DesktopDateTimePicker.types.d.mts +6 -6
- package/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +6 -6
- package/DesktopDateTimePicker/DesktopDateTimePickerLayout.d.mts +2 -2
- package/DesktopDateTimePicker/DesktopDateTimePickerLayout.d.ts +2 -2
- package/DesktopDateTimePicker/DesktopDateTimePickerLayout.js +1 -1
- package/DesktopDateTimePicker/DesktopDateTimePickerLayout.mjs +1 -1
- package/DesktopTimePicker/DesktopTimePicker.d.mts +1 -1
- package/DesktopTimePicker/DesktopTimePicker.d.ts +1 -1
- package/DesktopTimePicker/DesktopTimePicker.js +2 -2
- package/DesktopTimePicker/DesktopTimePicker.mjs +2 -2
- package/DesktopTimePicker/DesktopTimePicker.types.d.mts +8 -8
- package/DesktopTimePicker/DesktopTimePicker.types.d.ts +8 -8
- package/DigitalClock/DigitalClock.d.mts +1 -1
- package/DigitalClock/DigitalClock.d.ts +1 -1
- package/DigitalClock/DigitalClock.js +1 -1
- package/DigitalClock/DigitalClock.mjs +1 -1
- package/DigitalClock/DigitalClock.types.d.mts +6 -6
- package/DigitalClock/DigitalClock.types.d.ts +6 -6
- package/LocalizationProvider/LocalizationProvider.d.mts +2 -2
- package/LocalizationProvider/LocalizationProvider.d.ts +2 -2
- package/LocalizationProvider/LocalizationProvider.js +1 -1
- package/LocalizationProvider/LocalizationProvider.mjs +1 -1
- package/MobileDatePicker/MobileDatePicker.d.mts +1 -1
- package/MobileDatePicker/MobileDatePicker.d.ts +1 -1
- package/MobileDatePicker/MobileDatePicker.js +2 -2
- package/MobileDatePicker/MobileDatePicker.mjs +2 -2
- package/MobileDatePicker/MobileDatePicker.types.d.mts +3 -3
- package/MobileDatePicker/MobileDatePicker.types.d.ts +3 -3
- package/MobileDateTimePicker/MobileDateTimePicker.d.mts +1 -1
- package/MobileDateTimePicker/MobileDateTimePicker.d.ts +1 -1
- package/MobileDateTimePicker/MobileDateTimePicker.js +2 -2
- package/MobileDateTimePicker/MobileDateTimePicker.mjs +2 -2
- package/MobileDateTimePicker/MobileDateTimePicker.types.d.mts +3 -3
- package/MobileDateTimePicker/MobileDateTimePicker.types.d.ts +3 -3
- package/MobileTimePicker/MobileTimePicker.d.mts +2 -2
- package/MobileTimePicker/MobileTimePicker.d.ts +2 -2
- package/MobileTimePicker/MobileTimePicker.js +2 -2
- package/MobileTimePicker/MobileTimePicker.mjs +2 -2
- package/MobileTimePicker/MobileTimePicker.types.d.mts +5 -5
- package/MobileTimePicker/MobileTimePicker.types.d.ts +5 -5
- package/MonthCalendar/MonthCalendar.d.mts +2 -2
- package/MonthCalendar/MonthCalendar.d.ts +2 -2
- package/MonthCalendar/MonthCalendar.js +1 -1
- package/MonthCalendar/MonthCalendar.mjs +1 -1
- package/MonthCalendar/MonthCalendar.types.d.mts +8 -8
- package/MonthCalendar/MonthCalendar.types.d.ts +8 -8
- package/MonthCalendar/MonthCalendarButton.d.mts +3 -3
- package/MonthCalendar/MonthCalendarButton.d.ts +3 -3
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.d.mts +1 -1
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.d.ts +1 -1
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +1 -1
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.mjs +1 -1
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.types.d.mts +7 -7
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.types.d.ts +7 -7
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.d.mts +2 -2
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.d.ts +2 -2
- package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.d.mts +3 -3
- package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.d.ts +3 -3
- package/PickerDay/PickerDay.d.mts +1 -1
- package/PickerDay/PickerDay.d.ts +1 -1
- package/PickerDay/PickerDay.js +1 -1
- package/PickerDay/PickerDay.mjs +1 -1
- package/PickerDay/PickerDay.types.d.mts +5 -5
- package/PickerDay/PickerDay.types.d.ts +5 -5
- package/PickersActionBar/PickersActionBar.d.mts +1 -1
- package/PickersActionBar/PickersActionBar.d.ts +1 -1
- package/PickersActionBar/PickersActionBar.js +1 -1
- package/PickersActionBar/PickersActionBar.mjs +1 -1
- package/PickersCalendarHeader/PickersCalendarHeader.d.mts +1 -1
- package/PickersCalendarHeader/PickersCalendarHeader.d.ts +1 -1
- package/PickersCalendarHeader/PickersCalendarHeader.js +1 -1
- package/PickersCalendarHeader/PickersCalendarHeader.mjs +1 -1
- package/PickersCalendarHeader/PickersCalendarHeader.types.d.mts +9 -9
- package/PickersCalendarHeader/PickersCalendarHeader.types.d.ts +9 -9
- package/PickersLayout/PickersLayout.d.mts +2 -2
- package/PickersLayout/PickersLayout.d.ts +2 -2
- package/PickersLayout/PickersLayout.js +1 -1
- package/PickersLayout/PickersLayout.mjs +1 -1
- package/PickersLayout/PickersLayout.types.d.mts +11 -11
- package/PickersLayout/PickersLayout.types.d.ts +11 -11
- package/PickersLayout/usePickerLayout.d.mts +2 -2
- package/PickersLayout/usePickerLayout.d.ts +2 -2
- package/PickersSectionList/PickersSectionList.js +2 -2
- package/PickersSectionList/PickersSectionList.mjs +2 -2
- package/PickersSectionList/PickersSectionList.types.d.mts +4 -4
- package/PickersSectionList/PickersSectionList.types.d.ts +4 -4
- package/PickersShortcuts/PickersShortcuts.d.mts +3 -3
- package/PickersShortcuts/PickersShortcuts.d.ts +3 -3
- package/PickersShortcuts/PickersShortcuts.js +1 -1
- package/PickersShortcuts/PickersShortcuts.mjs +1 -1
- package/PickersTextField/PickersFilledInput/PickersFilledInput.d.mts +2 -2
- package/PickersTextField/PickersFilledInput/PickersFilledInput.d.ts +2 -2
- package/PickersTextField/PickersFilledInput/PickersFilledInput.js +2 -1
- package/PickersTextField/PickersFilledInput/PickersFilledInput.mjs +2 -1
- package/PickersTextField/PickersFilledInput/pickersFilledInputClasses.d.mts +1 -1
- package/PickersTextField/PickersFilledInput/pickersFilledInputClasses.d.ts +1 -1
- package/PickersTextField/PickersInput/PickersInput.d.mts +2 -2
- package/PickersTextField/PickersInput/PickersInput.d.ts +2 -2
- package/PickersTextField/PickersInput/PickersInput.js +2 -1
- package/PickersTextField/PickersInput/PickersInput.mjs +2 -1
- package/PickersTextField/PickersInput/pickersInputClasses.d.mts +1 -1
- package/PickersTextField/PickersInput/pickersInputClasses.d.ts +1 -1
- package/PickersTextField/PickersInputBase/PickersInputBase.d.mts +2 -2
- package/PickersTextField/PickersInputBase/PickersInputBase.d.ts +2 -2
- package/PickersTextField/PickersInputBase/PickersInputBase.js +17 -2
- package/PickersTextField/PickersInputBase/PickersInputBase.mjs +17 -2
- package/PickersTextField/PickersInputBase/PickersInputBase.types.d.mts +6 -5
- package/PickersTextField/PickersInputBase/PickersInputBase.types.d.ts +6 -5
- package/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.d.mts +1 -1
- package/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.d.ts +1 -1
- package/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.js +13 -9
- package/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.mjs +13 -9
- package/PickersTextField/PickersOutlinedInput/pickersOutlinedInputClasses.d.mts +1 -1
- package/PickersTextField/PickersOutlinedInput/pickersOutlinedInputClasses.d.ts +1 -1
- package/PickersTextField/PickersTextField.js +5 -2
- package/PickersTextField/PickersTextField.mjs +5 -2
- package/PickersTextField/PickersTextField.types.d.mts +6 -6
- package/PickersTextField/PickersTextField.types.d.ts +6 -6
- package/PickersTextField/usePickerTextFieldOwnerState.d.mts +1 -1
- package/PickersTextField/usePickerTextFieldOwnerState.d.ts +1 -1
- package/StaticDatePicker/StaticDatePicker.d.mts +1 -1
- package/StaticDatePicker/StaticDatePicker.d.ts +1 -1
- package/StaticDatePicker/StaticDatePicker.js +2 -2
- package/StaticDatePicker/StaticDatePicker.mjs +2 -2
- package/StaticDatePicker/StaticDatePicker.types.d.mts +3 -3
- package/StaticDatePicker/StaticDatePicker.types.d.ts +3 -3
- package/StaticDateTimePicker/StaticDateTimePicker.d.mts +1 -1
- package/StaticDateTimePicker/StaticDateTimePicker.d.ts +1 -1
- package/StaticDateTimePicker/StaticDateTimePicker.js +2 -2
- package/StaticDateTimePicker/StaticDateTimePicker.mjs +2 -2
- package/StaticDateTimePicker/StaticDateTimePicker.types.d.mts +3 -3
- package/StaticDateTimePicker/StaticDateTimePicker.types.d.ts +3 -3
- package/StaticTimePicker/StaticTimePicker.d.mts +1 -1
- package/StaticTimePicker/StaticTimePicker.d.ts +1 -1
- package/StaticTimePicker/StaticTimePicker.js +2 -2
- package/StaticTimePicker/StaticTimePicker.mjs +2 -2
- package/StaticTimePicker/StaticTimePicker.types.d.mts +4 -4
- package/StaticTimePicker/StaticTimePicker.types.d.ts +4 -4
- package/TimeClock/Clock.d.mts +5 -5
- package/TimeClock/Clock.d.ts +5 -5
- package/TimeClock/Clock.js +76 -30
- package/TimeClock/Clock.mjs +76 -30
- package/TimeClock/ClockNumber.d.mts +2 -2
- package/TimeClock/ClockNumber.d.ts +2 -2
- package/TimeClock/ClockNumbers.d.mts +1 -1
- package/TimeClock/ClockNumbers.d.ts +1 -1
- package/TimeClock/ClockPointer.d.mts +2 -2
- package/TimeClock/ClockPointer.d.ts +2 -2
- package/TimeClock/TimeClock.d.mts +1 -1
- package/TimeClock/TimeClock.d.ts +1 -1
- package/TimeClock/TimeClock.js +1 -1
- package/TimeClock/TimeClock.mjs +1 -1
- package/TimeClock/TimeClock.types.d.mts +5 -5
- package/TimeClock/TimeClock.types.d.ts +5 -5
- package/TimeField/TimeField.d.mts +1 -1
- package/TimeField/TimeField.d.ts +1 -1
- package/TimeField/TimeField.js +2 -1
- package/TimeField/TimeField.mjs +2 -1
- package/TimeField/TimeField.types.d.mts +7 -7
- package/TimeField/TimeField.types.d.ts +7 -7
- package/TimeField/useTimeField.d.mts +1 -1
- package/TimeField/useTimeField.d.ts +1 -1
- package/TimePicker/TimePicker.d.mts +1 -1
- package/TimePicker/TimePicker.d.ts +1 -1
- package/TimePicker/TimePicker.js +1 -1
- package/TimePicker/TimePicker.mjs +1 -1
- package/TimePicker/TimePicker.types.d.mts +4 -4
- package/TimePicker/TimePicker.types.d.ts +4 -4
- package/TimePicker/TimePickerToolbar.d.mts +2 -2
- package/TimePicker/TimePickerToolbar.d.ts +2 -2
- package/TimePicker/TimePickerToolbar.js +1 -1
- package/TimePicker/TimePickerToolbar.mjs +1 -1
- package/TimePicker/shared.d.mts +11 -11
- package/TimePicker/shared.d.ts +11 -11
- package/YearCalendar/YearCalendar.d.mts +1 -1
- package/YearCalendar/YearCalendar.d.ts +1 -1
- package/YearCalendar/YearCalendar.js +1 -1
- package/YearCalendar/YearCalendar.mjs +1 -1
- package/YearCalendar/YearCalendar.types.d.mts +8 -8
- package/YearCalendar/YearCalendar.types.d.ts +8 -8
- package/YearCalendar/YearCalendarButton.d.mts +3 -3
- package/YearCalendar/YearCalendarButton.d.ts +3 -3
- package/dateViewRenderers/dateViewRenderers.d.mts +3 -3
- package/dateViewRenderers/dateViewRenderers.d.ts +3 -3
- package/hooks/useIsValidValue.d.mts +1 -1
- package/hooks/useIsValidValue.d.ts +1 -1
- package/hooks/usePickerActionsContext.d.mts +2 -2
- package/hooks/usePickerActionsContext.d.ts +2 -2
- package/hooks/usePickerAdapter.d.mts +2 -2
- package/hooks/usePickerAdapter.d.ts +2 -2
- package/hooks/usePickerContext.d.mts +1 -1
- package/hooks/usePickerContext.d.ts +1 -1
- package/hooks/useSplitFieldProps.d.mts +1 -1
- package/hooks/useSplitFieldProps.d.ts +1 -1
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/internals/components/PickerFieldUI.d.mts +7 -7
- package/internals/components/PickerFieldUI.d.ts +7 -7
- package/internals/components/PickerPopper/PickerPopper.d.mts +7 -7
- package/internals/components/PickerPopper/PickerPopper.d.ts +7 -7
- package/internals/components/PickerProvider.d.mts +6 -6
- package/internals/components/PickerProvider.d.ts +6 -6
- package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.d.mts +1 -1
- package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.d.ts +1 -1
- package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.types.d.mts +6 -6
- package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.types.d.ts +6 -6
- package/internals/components/PickersModalDialog.d.mts +3 -3
- package/internals/components/PickersModalDialog.d.ts +3 -3
- package/internals/components/PickersToolbar.d.mts +2 -2
- package/internals/components/PickersToolbar.d.ts +2 -2
- package/internals/components/PickersToolbarButton.d.mts +4 -4
- package/internals/components/PickersToolbarButton.d.ts +4 -4
- package/internals/components/PickersToolbarText.d.mts +2 -2
- package/internals/components/PickersToolbarText.d.ts +2 -2
- package/internals/demo/DemoContainer.d.mts +2 -2
- package/internals/demo/DemoContainer.d.ts +2 -2
- package/internals/hooks/PickerDay.types.d.mts +1 -1
- package/internals/hooks/PickerDay.types.d.ts +1 -1
- package/internals/hooks/date-helpers-hooks.d.mts +3 -3
- package/internals/hooks/date-helpers-hooks.d.ts +3 -3
- package/internals/hooks/useClockReferenceDate.d.mts +2 -2
- package/internals/hooks/useClockReferenceDate.d.ts +2 -2
- package/internals/hooks/useControlledValue.d.mts +2 -3
- package/internals/hooks/useControlledValue.d.ts +2 -3
- package/internals/hooks/useDesktopPicker/useDesktopPicker.d.mts +2 -2
- package/internals/hooks/useDesktopPicker/useDesktopPicker.d.ts +2 -2
- package/internals/hooks/useDesktopPicker/useDesktopPicker.types.d.mts +10 -10
- package/internals/hooks/useDesktopPicker/useDesktopPicker.types.d.ts +10 -10
- package/internals/hooks/useField/buildSectionsFromFormat.d.mts +2 -2
- package/internals/hooks/useField/buildSectionsFromFormat.d.ts +2 -2
- package/internals/hooks/useField/syncSelectionToDOM.d.mts +3 -3
- package/internals/hooks/useField/syncSelectionToDOM.d.ts +3 -3
- package/internals/hooks/useField/useField.d.mts +2 -2
- package/internals/hooks/useField/useField.d.ts +2 -2
- package/internals/hooks/useField/useField.js +18 -0
- package/internals/hooks/useField/useField.mjs +18 -0
- package/internals/hooks/useField/useField.types.d.mts +5 -4
- package/internals/hooks/useField/useField.types.d.ts +5 -4
- package/internals/hooks/useField/useField.utils.d.mts +3 -4
- package/internals/hooks/useField/useField.utils.d.ts +3 -4
- package/internals/hooks/useField/useField.utils.js +1 -3
- package/internals/hooks/useField/useField.utils.mjs +0 -1
- package/internals/hooks/useField/useFieldCharacterEditing.d.mts +2 -2
- package/internals/hooks/useField/useFieldCharacterEditing.d.ts +2 -2
- package/internals/hooks/useField/useFieldHiddenInputProps.d.mts +2 -2
- package/internals/hooks/useField/useFieldHiddenInputProps.d.ts +2 -2
- package/internals/hooks/useField/useFieldInternalPropsWithDefaults.d.mts +1 -1
- package/internals/hooks/useField/useFieldInternalPropsWithDefaults.d.ts +1 -1
- package/internals/hooks/useField/useFieldRootProps.d.mts +5 -4
- package/internals/hooks/useField/useFieldRootProps.d.ts +5 -4
- package/internals/hooks/useField/useFieldRootProps.js +95 -8
- package/internals/hooks/useField/useFieldRootProps.mjs +95 -8
- package/internals/hooks/useField/useFieldSectionContainerProps.d.mts +2 -2
- package/internals/hooks/useField/useFieldSectionContainerProps.d.ts +2 -2
- package/internals/hooks/useField/useFieldSectionContainerProps.js +35 -4
- package/internals/hooks/useField/useFieldSectionContainerProps.mjs +34 -4
- package/internals/hooks/useField/useFieldSectionContentProps.d.mts +6 -6
- package/internals/hooks/useField/useFieldSectionContentProps.d.ts +6 -6
- package/internals/hooks/useField/useFieldSectionContentProps.js +3 -1
- package/internals/hooks/useField/useFieldSectionContentProps.mjs +3 -1
- package/internals/hooks/useField/useFieldState.d.mts +3 -3
- package/internals/hooks/useField/useFieldState.d.ts +3 -3
- package/internals/hooks/useFieldOwnerState.d.mts +2 -2
- package/internals/hooks/useFieldOwnerState.d.ts +2 -2
- package/internals/hooks/useMobilePicker/useMobilePicker.d.mts +2 -2
- package/internals/hooks/useMobilePicker/useMobilePicker.d.ts +2 -2
- package/internals/hooks/useMobilePicker/useMobilePicker.types.d.mts +10 -10
- package/internals/hooks/useMobilePicker/useMobilePicker.types.d.ts +10 -10
- package/internals/hooks/useNullableFieldPrivateContext.d.mts +2 -2
- package/internals/hooks/useNullableFieldPrivateContext.d.ts +2 -2
- package/internals/hooks/usePicker/hooks/useOrientation.d.mts +1 -1
- package/internals/hooks/usePicker/hooks/useOrientation.d.ts +1 -1
- package/internals/hooks/usePicker/hooks/useValueAndOpenStates.d.mts +5 -5
- package/internals/hooks/usePicker/hooks/useValueAndOpenStates.d.ts +5 -5
- package/internals/hooks/usePicker/usePicker.d.mts +2 -2
- package/internals/hooks/usePicker/usePicker.d.ts +2 -2
- package/internals/hooks/usePicker/usePicker.types.d.mts +10 -10
- package/internals/hooks/usePicker/usePicker.types.d.ts +10 -10
- package/internals/hooks/usePickerDayOwnerState.d.mts +2 -2
- package/internals/hooks/usePickerDayOwnerState.d.ts +2 -2
- package/internals/hooks/useReduceAnimations.js +4 -1
- package/internals/hooks/useReduceAnimations.mjs +4 -1
- package/internals/hooks/useStaticPicker/useStaticPicker.d.mts +2 -2
- package/internals/hooks/useStaticPicker/useStaticPicker.d.ts +2 -2
- package/internals/hooks/useStaticPicker/useStaticPicker.types.d.mts +5 -5
- package/internals/hooks/useStaticPicker/useStaticPicker.types.d.ts +5 -5
- package/internals/hooks/useToolbarOwnerState.d.mts +1 -1
- package/internals/hooks/useToolbarOwnerState.d.ts +1 -1
- package/internals/hooks/useUtils.d.mts +1 -1
- package/internals/hooks/useUtils.d.ts +1 -1
- package/internals/hooks/useViews.d.mts +4 -4
- package/internals/hooks/useViews.d.ts +4 -4
- package/internals/models/common.d.mts +1 -1
- package/internals/models/common.d.ts +1 -1
- package/internals/models/fields.d.mts +1 -1
- package/internals/models/fields.d.ts +1 -1
- package/internals/models/helpers.d.mts +2 -2
- package/internals/models/helpers.d.ts +2 -2
- package/internals/models/manager.d.mts +1 -1
- package/internals/models/manager.d.ts +1 -1
- package/internals/models/props/basePickerProps.d.mts +7 -8
- package/internals/models/props/basePickerProps.d.ts +7 -8
- package/internals/models/props/tabs.d.mts +2 -2
- package/internals/models/props/tabs.d.ts +2 -2
- package/internals/models/props/time.d.mts +6 -6
- package/internals/models/props/time.d.ts +6 -6
- package/internals/models/props/toolbar.d.mts +3 -3
- package/internals/models/props/toolbar.d.ts +3 -3
- package/internals/models/value.d.mts +1 -1
- package/internals/models/value.d.ts +1 -1
- package/internals/utils/createNonRangePickerStepNavigation.d.mts +1 -1
- package/internals/utils/createNonRangePickerStepNavigation.d.ts +1 -1
- package/internals/utils/createStepNavigation.d.mts +1 -1
- package/internals/utils/createStepNavigation.d.ts +1 -1
- package/internals/utils/date-time-utils.d.mts +4 -4
- package/internals/utils/date-time-utils.d.ts +4 -4
- package/internals/utils/date-utils.d.mts +2 -2
- package/internals/utils/date-utils.d.ts +2 -2
- package/internals/utils/getDefaultReferenceDate.d.mts +1 -1
- package/internals/utils/getDefaultReferenceDate.d.ts +1 -1
- package/internals/utils/time-utils.d.mts +2 -2
- package/internals/utils/time-utils.d.ts +2 -2
- package/internals/utils/utils.d.mts +3 -3
- package/internals/utils/utils.d.ts +3 -3
- package/internals/utils/valueManagers.d.mts +2 -3
- package/internals/utils/valueManagers.d.ts +2 -3
- package/internals/utils/views.d.mts +1 -1
- package/internals/utils/views.d.ts +1 -1
- package/locales/beBY.d.mts +1 -1
- package/locales/beBY.d.ts +1 -1
- package/locales/bgBG.d.mts +1 -1
- package/locales/bgBG.d.ts +1 -1
- package/locales/bnBD.d.mts +1 -1
- package/locales/bnBD.d.ts +1 -1
- package/locales/caES.d.mts +1 -1
- package/locales/caES.d.ts +1 -1
- package/locales/csCZ.d.mts +1 -1
- package/locales/csCZ.d.ts +1 -1
- package/locales/daDK.d.mts +1 -1
- package/locales/daDK.d.ts +1 -1
- package/locales/deDE.d.mts +1 -1
- package/locales/deDE.d.ts +1 -1
- package/locales/elGR.d.mts +1 -1
- package/locales/elGR.d.ts +1 -1
- package/locales/enUS.d.mts +1 -1
- package/locales/enUS.d.ts +1 -1
- package/locales/esES.d.mts +1 -1
- package/locales/esES.d.ts +1 -1
- package/locales/eu.d.mts +1 -1
- package/locales/eu.d.ts +1 -1
- package/locales/faIR.d.mts +1 -1
- package/locales/faIR.d.ts +1 -1
- package/locales/faIR.js +21 -22
- package/locales/faIR.mjs +21 -22
- package/locales/fiFI.d.mts +1 -1
- package/locales/fiFI.d.ts +1 -1
- package/locales/frFR.d.mts +1 -1
- package/locales/frFR.d.ts +1 -1
- package/locales/heIL.d.mts +1 -1
- package/locales/heIL.d.ts +1 -1
- package/locales/hrHR.d.mts +1 -1
- package/locales/hrHR.d.ts +1 -1
- package/locales/huHU.d.mts +1 -1
- package/locales/huHU.d.ts +1 -1
- package/locales/isIS.d.mts +1 -1
- package/locales/isIS.d.ts +1 -1
- package/locales/itIT.d.mts +1 -1
- package/locales/itIT.d.ts +1 -1
- package/locales/jaJP.d.mts +1 -1
- package/locales/jaJP.d.ts +1 -1
- package/locales/koKR.d.mts +1 -1
- package/locales/koKR.d.ts +1 -1
- package/locales/kzKZ.d.mts +1 -1
- package/locales/kzKZ.d.ts +1 -1
- package/locales/nbNO.d.mts +1 -1
- package/locales/nbNO.d.ts +1 -1
- package/locales/nlNL.d.mts +1 -1
- package/locales/nlNL.d.ts +1 -1
- package/locales/nnNO.d.mts +1 -1
- package/locales/nnNO.d.ts +1 -1
- package/locales/plPL.d.mts +1 -1
- package/locales/plPL.d.ts +1 -1
- package/locales/ptBR.d.mts +1 -1
- package/locales/ptBR.d.ts +1 -1
- package/locales/ptPT.d.mts +1 -1
- package/locales/ptPT.d.ts +1 -1
- package/locales/roRO.d.mts +1 -1
- package/locales/roRO.d.ts +1 -1
- package/locales/ruRU.d.mts +1 -1
- package/locales/ruRU.d.ts +1 -1
- package/locales/skSK.d.mts +1 -1
- package/locales/skSK.d.ts +1 -1
- package/locales/svSE.d.mts +1 -1
- package/locales/svSE.d.ts +1 -1
- package/locales/thTH.d.mts +1 -1
- package/locales/thTH.d.ts +1 -1
- package/locales/trTR.d.mts +1 -1
- package/locales/trTR.d.ts +1 -1
- package/locales/ukUA.d.mts +1 -1
- package/locales/ukUA.d.ts +1 -1
- package/locales/urPK.d.mts +1 -1
- package/locales/urPK.d.ts +1 -1
- package/locales/utils/getPickersLocalization.d.mts +1 -1
- package/locales/utils/getPickersLocalization.d.ts +1 -1
- package/locales/utils/pickersLocaleTextApi.d.mts +2 -2
- package/locales/utils/pickersLocaleTextApi.d.ts +2 -2
- package/locales/viVN.d.mts +1 -1
- package/locales/viVN.d.ts +1 -1
- package/locales/zhCN.d.mts +1 -1
- package/locales/zhCN.d.ts +1 -1
- package/locales/zhHK.d.mts +1 -1
- package/locales/zhHK.d.ts +1 -1
- package/locales/zhTW.d.mts +1 -1
- package/locales/zhTW.d.ts +1 -1
- package/managers/useDateManager.d.mts +4 -4
- package/managers/useDateManager.d.ts +4 -4
- package/managers/useDateTimeManager.d.mts +5 -5
- package/managers/useDateTimeManager.d.ts +5 -5
- package/managers/useTimeManager.d.mts +5 -5
- package/managers/useTimeManager.d.ts +5 -5
- package/models/adapters.d.mts +3 -3
- package/models/adapters.d.ts +3 -3
- package/models/fields.d.mts +4 -4
- package/models/fields.d.ts +4 -4
- package/models/pickers.d.mts +1 -1
- package/models/pickers.d.ts +1 -1
- package/package.json +6 -3
- package/themeAugmentation/components.d.mts +16 -16
- package/themeAugmentation/components.d.ts +16 -16
- package/themeAugmentation/overrides.d.mts +20 -20
- package/themeAugmentation/overrides.d.ts +20 -20
- package/themeAugmentation/props.d.mts +38 -38
- package/themeAugmentation/props.d.ts +38 -38
- package/timeViewRenderers/timeViewRenderers.d.mts +6 -6
- package/timeViewRenderers/timeViewRenderers.d.ts +6 -6
- package/validation/extractValidationProps.d.mts +1 -1
- package/validation/extractValidationProps.d.ts +1 -1
- package/validation/useValidation.d.mts +2 -3
- package/validation/useValidation.d.ts +2 -3
- package/validation/validateDate.d.mts +4 -4
- package/validation/validateDate.d.ts +4 -4
- package/validation/validateDateTime.d.mts +6 -6
- package/validation/validateDateTime.d.ts +6 -6
- package/validation/validateTime.d.mts +4 -4
- package/validation/validateTime.d.ts +4 -4
|
@@ -28,7 +28,7 @@ var _PickersInput = require("./PickersInput");
|
|
|
28
28
|
var _useFieldOwnerState = require("../internals/hooks/useFieldOwnerState");
|
|
29
29
|
var _usePickerTextFieldOwnerState = require("./usePickerTextFieldOwnerState");
|
|
30
30
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
31
|
-
const _excluded = ["onFocus", "onBlur", "className", "classes", "color", "disabled", "error", "variant", "required", "hiddenLabel", "inputRef", "sectionListRef", "elements", "areAllSectionsEmpty", "onClick", "onKeyDown", "onKeyUp", "onPaste", "onInput", "endAdornment", "startAdornment", "tabIndex", "contentEditable", "focused", "value", "onChange", "fullWidth", "id", "name", "helperText", "label", "slots", "slotProps", "data-active-range-position"];
|
|
31
|
+
const _excluded = ["onFocus", "onBlur", "className", "classes", "color", "disabled", "error", "variant", "required", "hiddenLabel", "inputRef", "sectionListRef", "elements", "areAllSectionsEmpty", "onClick", "onMouseDown", "onKeyDown", "onKeyUp", "onPaste", "onInput", "endAdornment", "startAdornment", "tabIndex", "contentEditable", "focused", "value", "onChange", "fullWidth", "id", "name", "helperText", "label", "slots", "slotProps", "data-active-range-position"];
|
|
32
32
|
const VARIANT_COMPONENT = {
|
|
33
33
|
standard: _PickersInput.PickersInput,
|
|
34
34
|
filled: _PickersFilledInput.PickersFilledInput,
|
|
@@ -82,6 +82,7 @@ const PickersTextField = exports.PickersTextField = /*#__PURE__*/React.forwardRe
|
|
|
82
82
|
elements,
|
|
83
83
|
areAllSectionsEmpty,
|
|
84
84
|
onClick,
|
|
85
|
+
onMouseDown,
|
|
85
86
|
onKeyDown,
|
|
86
87
|
onKeyUp,
|
|
87
88
|
onPaste,
|
|
@@ -176,6 +177,7 @@ const PickersTextField = exports.PickersTextField = /*#__PURE__*/React.forwardRe
|
|
|
176
177
|
elements: elements,
|
|
177
178
|
areAllSectionsEmpty: areAllSectionsEmpty,
|
|
178
179
|
onClick: onClick,
|
|
180
|
+
onMouseDown: onMouseDown,
|
|
179
181
|
onKeyDown: onKeyDown,
|
|
180
182
|
onKeyUp: onKeyUp,
|
|
181
183
|
onInput: onInput,
|
|
@@ -215,7 +217,7 @@ const PickersTextField = exports.PickersTextField = /*#__PURE__*/React.forwardRe
|
|
|
215
217
|
});
|
|
216
218
|
});
|
|
217
219
|
if (process.env.NODE_ENV !== "production") PickersTextField.displayName = "PickersTextField";
|
|
218
|
-
process.env.NODE_ENV !== "production" ? PickersTextField.propTypes = {
|
|
220
|
+
process.env.NODE_ENV !== "production" ? PickersTextField.propTypes /* remove-proptypes */ = {
|
|
219
221
|
// ----------------------------- Warning --------------------------------
|
|
220
222
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
221
223
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
@@ -307,6 +309,7 @@ process.env.NODE_ENV !== "production" ? PickersTextField.propTypes = {
|
|
|
307
309
|
onFocus: _propTypes.default.func.isRequired,
|
|
308
310
|
onInput: _propTypes.default.func.isRequired,
|
|
309
311
|
onKeyDown: _propTypes.default.func.isRequired,
|
|
312
|
+
onMouseDown: _propTypes.default.func.isRequired,
|
|
310
313
|
onPaste: _propTypes.default.func.isRequired,
|
|
311
314
|
readOnly: _propTypes.default.bool,
|
|
312
315
|
/**
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
|
-
const _excluded = ["onFocus", "onBlur", "className", "classes", "color", "disabled", "error", "variant", "required", "hiddenLabel", "inputRef", "sectionListRef", "elements", "areAllSectionsEmpty", "onClick", "onKeyDown", "onKeyUp", "onPaste", "onInput", "endAdornment", "startAdornment", "tabIndex", "contentEditable", "focused", "value", "onChange", "fullWidth", "id", "name", "helperText", "label", "slots", "slotProps", "data-active-range-position"];
|
|
5
|
+
const _excluded = ["onFocus", "onBlur", "className", "classes", "color", "disabled", "error", "variant", "required", "hiddenLabel", "inputRef", "sectionListRef", "elements", "areAllSectionsEmpty", "onClick", "onMouseDown", "onKeyDown", "onKeyUp", "onPaste", "onInput", "endAdornment", "startAdornment", "tabIndex", "contentEditable", "focused", "value", "onChange", "fullWidth", "id", "name", "helperText", "label", "slots", "slotProps", "data-active-range-position"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import { warnOnce } from '@mui/x-internals/warning';
|
|
@@ -75,6 +75,7 @@ const PickersTextField = /*#__PURE__*/React.forwardRef(function PickersTextField
|
|
|
75
75
|
elements,
|
|
76
76
|
areAllSectionsEmpty,
|
|
77
77
|
onClick,
|
|
78
|
+
onMouseDown,
|
|
78
79
|
onKeyDown,
|
|
79
80
|
onKeyUp,
|
|
80
81
|
onPaste,
|
|
@@ -169,6 +170,7 @@ const PickersTextField = /*#__PURE__*/React.forwardRef(function PickersTextField
|
|
|
169
170
|
elements: elements,
|
|
170
171
|
areAllSectionsEmpty: areAllSectionsEmpty,
|
|
171
172
|
onClick: onClick,
|
|
173
|
+
onMouseDown: onMouseDown,
|
|
172
174
|
onKeyDown: onKeyDown,
|
|
173
175
|
onKeyUp: onKeyUp,
|
|
174
176
|
onInput: onInput,
|
|
@@ -208,7 +210,7 @@ const PickersTextField = /*#__PURE__*/React.forwardRef(function PickersTextField
|
|
|
208
210
|
});
|
|
209
211
|
});
|
|
210
212
|
if (process.env.NODE_ENV !== "production") PickersTextField.displayName = "PickersTextField";
|
|
211
|
-
process.env.NODE_ENV !== "production" ? PickersTextField.propTypes = {
|
|
213
|
+
process.env.NODE_ENV !== "production" ? PickersTextField.propTypes /* remove-proptypes */ = {
|
|
212
214
|
// ----------------------------- Warning --------------------------------
|
|
213
215
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
214
216
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
@@ -300,6 +302,7 @@ process.env.NODE_ENV !== "production" ? PickersTextField.propTypes = {
|
|
|
300
302
|
onFocus: PropTypes.func.isRequired,
|
|
301
303
|
onInput: PropTypes.func.isRequired,
|
|
302
304
|
onKeyDown: PropTypes.func.isRequired,
|
|
305
|
+
onMouseDown: PropTypes.func.isRequired,
|
|
303
306
|
onPaste: PropTypes.func.isRequired,
|
|
304
307
|
readOnly: PropTypes.bool,
|
|
305
308
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { FormControlProps } from '@mui/material/FormControl';
|
|
3
|
-
import { FormHelperTextProps } from '@mui/material/FormHelperText';
|
|
4
|
-
import { InputLabelProps } from '@mui/material/InputLabel';
|
|
5
|
-
import { TextFieldVariants } from '@mui/material/TextField';
|
|
6
|
-
import { PickersInputBaseProps, PickersInputPropsUsedByField } from "./PickersInputBase/PickersInputBase.types.mjs";
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import type { FormControlProps } from '@mui/material/FormControl';
|
|
3
|
+
import type { FormHelperTextProps } from '@mui/material/FormHelperText';
|
|
4
|
+
import type { InputLabelProps } from '@mui/material/InputLabel';
|
|
5
|
+
import type { TextFieldVariants } from '@mui/material/TextField';
|
|
6
|
+
import type { PickersInputBaseProps, PickersInputPropsUsedByField } from "./PickersInputBase/PickersInputBase.types.mjs";
|
|
7
7
|
import type { PickersInputProps } from "./PickersInput/index.mjs";
|
|
8
8
|
import type { PickersOutlinedInputProps } from "./PickersOutlinedInput/index.mjs";
|
|
9
9
|
import type { PickersFilledInputProps } from "./PickersFilledInput/index.mjs";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { FormControlProps } from '@mui/material/FormControl';
|
|
3
|
-
import { FormHelperTextProps } from '@mui/material/FormHelperText';
|
|
4
|
-
import { InputLabelProps } from '@mui/material/InputLabel';
|
|
5
|
-
import { TextFieldVariants } from '@mui/material/TextField';
|
|
6
|
-
import { PickersInputBaseProps, PickersInputPropsUsedByField } from "./PickersInputBase/PickersInputBase.types.js";
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import type { FormControlProps } from '@mui/material/FormControl';
|
|
3
|
+
import type { FormHelperTextProps } from '@mui/material/FormHelperText';
|
|
4
|
+
import type { InputLabelProps } from '@mui/material/InputLabel';
|
|
5
|
+
import type { TextFieldVariants } from '@mui/material/TextField';
|
|
6
|
+
import type { PickersInputBaseProps, PickersInputPropsUsedByField } from "./PickersInputBase/PickersInputBase.types.js";
|
|
7
7
|
import type { PickersInputProps } from "./PickersInput/index.js";
|
|
8
8
|
import type { PickersOutlinedInputProps } from "./PickersOutlinedInput/index.js";
|
|
9
9
|
import type { PickersFilledInputProps } from "./PickersFilledInput/index.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { PickerTextFieldOwnerState } from "../models/fields.mjs";
|
|
2
|
+
import type { PickerTextFieldOwnerState } from "../models/fields.mjs";
|
|
3
3
|
export declare const PickerTextFieldOwnerStateContext: React.Context<PickerTextFieldOwnerState | null>;
|
|
4
4
|
export declare const usePickerTextFieldOwnerState: () => PickerTextFieldOwnerState;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { PickerTextFieldOwnerState } from "../models/fields.js";
|
|
2
|
+
import type { PickerTextFieldOwnerState } from "../models/fields.js";
|
|
3
3
|
export declare const PickerTextFieldOwnerStateContext: React.Context<PickerTextFieldOwnerState | null>;
|
|
4
4
|
export declare const usePickerTextFieldOwnerState: () => PickerTextFieldOwnerState;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { StaticDatePickerProps } from "./StaticDatePicker.types.mjs";
|
|
2
|
+
import type { StaticDatePickerProps } from "./StaticDatePicker.types.mjs";
|
|
3
3
|
type StaticDatePickerComponent = ((props: StaticDatePickerProps & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
|
|
4
4
|
propTypes?: any;
|
|
5
5
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { StaticDatePickerProps } from "./StaticDatePicker.types.js";
|
|
2
|
+
import type { StaticDatePickerProps } from "./StaticDatePicker.types.js";
|
|
3
3
|
type StaticDatePickerComponent = ((props: StaticDatePickerProps & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
|
|
4
4
|
propTypes?: any;
|
|
5
5
|
};
|
|
@@ -58,7 +58,7 @@ const StaticDatePicker = exports.StaticDatePicker = /*#__PURE__*/React.forwardRe
|
|
|
58
58
|
return renderPicker();
|
|
59
59
|
});
|
|
60
60
|
if (process.env.NODE_ENV !== "production") StaticDatePicker.displayName = "StaticDatePicker";
|
|
61
|
-
StaticDatePicker.propTypes = {
|
|
61
|
+
process.env.NODE_ENV !== "production" ? StaticDatePicker.propTypes /* remove-proptypes */ = {
|
|
62
62
|
// ----------------------------- Warning --------------------------------
|
|
63
63
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
64
64
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
@@ -320,4 +320,4 @@ StaticDatePicker.propTypes = {
|
|
|
320
320
|
* @default `4` when `displayStaticWrapperAs === 'desktop'`, `3` otherwise.
|
|
321
321
|
*/
|
|
322
322
|
yearsPerRow: _propTypes.default.oneOf([3, 4])
|
|
323
|
-
};
|
|
323
|
+
} : void 0;
|
|
@@ -51,7 +51,7 @@ const StaticDatePicker = /*#__PURE__*/React.forwardRef(function StaticDatePicker
|
|
|
51
51
|
return renderPicker();
|
|
52
52
|
});
|
|
53
53
|
if (process.env.NODE_ENV !== "production") StaticDatePicker.displayName = "StaticDatePicker";
|
|
54
|
-
StaticDatePicker.propTypes = {
|
|
54
|
+
process.env.NODE_ENV !== "production" ? StaticDatePicker.propTypes /* remove-proptypes */ = {
|
|
55
55
|
// ----------------------------- Warning --------------------------------
|
|
56
56
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
57
57
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
@@ -313,5 +313,5 @@ StaticDatePicker.propTypes = {
|
|
|
313
313
|
* @default `4` when `displayStaticWrapperAs === 'desktop'`, `3` otherwise.
|
|
314
314
|
*/
|
|
315
315
|
yearsPerRow: PropTypes.oneOf([3, 4])
|
|
316
|
-
};
|
|
316
|
+
} : void 0;
|
|
317
317
|
export { StaticDatePicker };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { MakeOptional } from '@mui/x-internals/types';
|
|
2
|
-
import { BaseDatePickerProps, BaseDatePickerSlots, BaseDatePickerSlotProps } from "../DatePicker/shared.mjs";
|
|
3
|
-
import { StaticOnlyPickerProps, UseStaticPickerSlots, UseStaticPickerSlotProps } from "../internals/hooks/useStaticPicker/index.mjs";
|
|
1
|
+
import type { MakeOptional } from '@mui/x-internals/types';
|
|
2
|
+
import type { BaseDatePickerProps, BaseDatePickerSlots, BaseDatePickerSlotProps } from "../DatePicker/shared.mjs";
|
|
3
|
+
import type { StaticOnlyPickerProps, UseStaticPickerSlots, UseStaticPickerSlotProps } from "../internals/hooks/useStaticPicker/index.mjs";
|
|
4
4
|
export interface StaticDatePickerSlots extends BaseDatePickerSlots, UseStaticPickerSlots {}
|
|
5
5
|
export interface StaticDatePickerSlotProps extends BaseDatePickerSlotProps, UseStaticPickerSlotProps {}
|
|
6
6
|
export interface StaticDatePickerProps extends BaseDatePickerProps, MakeOptional<StaticOnlyPickerProps, 'displayStaticWrapperAs'> {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { MakeOptional } from '@mui/x-internals/types';
|
|
2
|
-
import { BaseDatePickerProps, BaseDatePickerSlots, BaseDatePickerSlotProps } from "../DatePicker/shared.js";
|
|
3
|
-
import { StaticOnlyPickerProps, UseStaticPickerSlots, UseStaticPickerSlotProps } from "../internals/hooks/useStaticPicker/index.js";
|
|
1
|
+
import type { MakeOptional } from '@mui/x-internals/types';
|
|
2
|
+
import type { BaseDatePickerProps, BaseDatePickerSlots, BaseDatePickerSlotProps } from "../DatePicker/shared.js";
|
|
3
|
+
import type { StaticOnlyPickerProps, UseStaticPickerSlots, UseStaticPickerSlotProps } from "../internals/hooks/useStaticPicker/index.js";
|
|
4
4
|
export interface StaticDatePickerSlots extends BaseDatePickerSlots, UseStaticPickerSlots {}
|
|
5
5
|
export interface StaticDatePickerSlotProps extends BaseDatePickerSlotProps, UseStaticPickerSlotProps {}
|
|
6
6
|
export interface StaticDatePickerProps extends BaseDatePickerProps, MakeOptional<StaticOnlyPickerProps, 'displayStaticWrapperAs'> {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { StaticDateTimePickerProps } from "./StaticDateTimePicker.types.mjs";
|
|
2
|
+
import type { StaticDateTimePickerProps } from "./StaticDateTimePicker.types.mjs";
|
|
3
3
|
type StaticDateTimePickerComponent = ((props: StaticDateTimePickerProps & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
|
|
4
4
|
propTypes?: any;
|
|
5
5
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { StaticDateTimePickerProps } from "./StaticDateTimePicker.types.js";
|
|
2
|
+
import type { StaticDateTimePickerProps } from "./StaticDateTimePicker.types.js";
|
|
3
3
|
type StaticDateTimePickerComponent = ((props: StaticDateTimePickerProps & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
|
|
4
4
|
propTypes?: any;
|
|
5
5
|
};
|
|
@@ -107,7 +107,7 @@ const StaticDateTimePicker = exports.StaticDateTimePicker = /*#__PURE__*/React.f
|
|
|
107
107
|
return renderPicker();
|
|
108
108
|
});
|
|
109
109
|
if (process.env.NODE_ENV !== "production") StaticDateTimePicker.displayName = "StaticDateTimePicker";
|
|
110
|
-
StaticDateTimePicker.propTypes = {
|
|
110
|
+
process.env.NODE_ENV !== "production" ? StaticDateTimePicker.propTypes /* remove-proptypes */ = {
|
|
111
111
|
// ----------------------------- Warning --------------------------------
|
|
112
112
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
113
113
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
@@ -439,4 +439,4 @@ StaticDateTimePicker.propTypes = {
|
|
|
439
439
|
* @default `4` when `displayStaticWrapperAs === 'desktop'`, `3` otherwise.
|
|
440
440
|
*/
|
|
441
441
|
yearsPerRow: _propTypes.default.oneOf([3, 4])
|
|
442
|
-
};
|
|
442
|
+
} : void 0;
|
|
@@ -100,7 +100,7 @@ const StaticDateTimePicker = /*#__PURE__*/React.forwardRef(function StaticDateTi
|
|
|
100
100
|
return renderPicker();
|
|
101
101
|
});
|
|
102
102
|
if (process.env.NODE_ENV !== "production") StaticDateTimePicker.displayName = "StaticDateTimePicker";
|
|
103
|
-
StaticDateTimePicker.propTypes = {
|
|
103
|
+
process.env.NODE_ENV !== "production" ? StaticDateTimePicker.propTypes /* remove-proptypes */ = {
|
|
104
104
|
// ----------------------------- Warning --------------------------------
|
|
105
105
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
106
106
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
@@ -432,5 +432,5 @@ StaticDateTimePicker.propTypes = {
|
|
|
432
432
|
* @default `4` when `displayStaticWrapperAs === 'desktop'`, `3` otherwise.
|
|
433
433
|
*/
|
|
434
434
|
yearsPerRow: PropTypes.oneOf([3, 4])
|
|
435
|
-
};
|
|
435
|
+
} : void 0;
|
|
436
436
|
export { StaticDateTimePicker };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { MakeOptional } from '@mui/x-internals/types';
|
|
2
|
-
import { BaseDateTimePickerProps, BaseDateTimePickerSlots, BaseDateTimePickerSlotProps } from "../DateTimePicker/shared.mjs";
|
|
3
|
-
import { StaticOnlyPickerProps, UseStaticPickerSlots, UseStaticPickerSlotProps } from "../internals/hooks/useStaticPicker/index.mjs";
|
|
1
|
+
import type { MakeOptional } from '@mui/x-internals/types';
|
|
2
|
+
import type { BaseDateTimePickerProps, BaseDateTimePickerSlots, BaseDateTimePickerSlotProps } from "../DateTimePicker/shared.mjs";
|
|
3
|
+
import type { StaticOnlyPickerProps, UseStaticPickerSlots, UseStaticPickerSlotProps } from "../internals/hooks/useStaticPicker/index.mjs";
|
|
4
4
|
export interface StaticDateTimePickerSlots extends BaseDateTimePickerSlots, UseStaticPickerSlots {}
|
|
5
5
|
export interface StaticDateTimePickerSlotProps extends BaseDateTimePickerSlotProps, UseStaticPickerSlotProps {}
|
|
6
6
|
export interface StaticDateTimePickerProps extends BaseDateTimePickerProps, MakeOptional<StaticOnlyPickerProps, 'displayStaticWrapperAs'> {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { MakeOptional } from '@mui/x-internals/types';
|
|
2
|
-
import { BaseDateTimePickerProps, BaseDateTimePickerSlots, BaseDateTimePickerSlotProps } from "../DateTimePicker/shared.js";
|
|
3
|
-
import { StaticOnlyPickerProps, UseStaticPickerSlots, UseStaticPickerSlotProps } from "../internals/hooks/useStaticPicker/index.js";
|
|
1
|
+
import type { MakeOptional } from '@mui/x-internals/types';
|
|
2
|
+
import type { BaseDateTimePickerProps, BaseDateTimePickerSlots, BaseDateTimePickerSlotProps } from "../DateTimePicker/shared.js";
|
|
3
|
+
import type { StaticOnlyPickerProps, UseStaticPickerSlots, UseStaticPickerSlotProps } from "../internals/hooks/useStaticPicker/index.js";
|
|
4
4
|
export interface StaticDateTimePickerSlots extends BaseDateTimePickerSlots, UseStaticPickerSlots {}
|
|
5
5
|
export interface StaticDateTimePickerSlotProps extends BaseDateTimePickerSlotProps, UseStaticPickerSlotProps {}
|
|
6
6
|
export interface StaticDateTimePickerProps extends BaseDateTimePickerProps, MakeOptional<StaticOnlyPickerProps, 'displayStaticWrapperAs'> {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { StaticTimePickerProps } from "./StaticTimePicker.types.mjs";
|
|
2
|
+
import type { StaticTimePickerProps } from "./StaticTimePicker.types.mjs";
|
|
3
3
|
type StaticTimePickerComponent = ((props: StaticTimePickerProps & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
|
|
4
4
|
propTypes?: any;
|
|
5
5
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { StaticTimePickerProps } from "./StaticTimePicker.types.js";
|
|
2
|
+
import type { StaticTimePickerProps } from "./StaticTimePicker.types.js";
|
|
3
3
|
type StaticTimePickerComponent = ((props: StaticTimePickerProps & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
|
|
4
4
|
propTypes?: any;
|
|
5
5
|
};
|
|
@@ -60,7 +60,7 @@ const StaticTimePicker = exports.StaticTimePicker = /*#__PURE__*/React.forwardRe
|
|
|
60
60
|
return renderPicker();
|
|
61
61
|
});
|
|
62
62
|
if (process.env.NODE_ENV !== "production") StaticTimePicker.displayName = "StaticTimePicker";
|
|
63
|
-
StaticTimePicker.propTypes = {
|
|
63
|
+
process.env.NODE_ENV !== "production" ? StaticTimePicker.propTypes /* remove-proptypes */ = {
|
|
64
64
|
// ----------------------------- Warning --------------------------------
|
|
65
65
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
66
66
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
@@ -258,4 +258,4 @@ StaticTimePicker.propTypes = {
|
|
|
258
258
|
* Available views.
|
|
259
259
|
*/
|
|
260
260
|
views: _propTypes.default.arrayOf(_propTypes.default.oneOf(['hours', 'minutes', 'seconds']).isRequired)
|
|
261
|
-
};
|
|
261
|
+
} : void 0;
|
|
@@ -53,7 +53,7 @@ const StaticTimePicker = /*#__PURE__*/React.forwardRef(function StaticTimePicker
|
|
|
53
53
|
return renderPicker();
|
|
54
54
|
});
|
|
55
55
|
if (process.env.NODE_ENV !== "production") StaticTimePicker.displayName = "StaticTimePicker";
|
|
56
|
-
StaticTimePicker.propTypes = {
|
|
56
|
+
process.env.NODE_ENV !== "production" ? StaticTimePicker.propTypes /* remove-proptypes */ = {
|
|
57
57
|
// ----------------------------- Warning --------------------------------
|
|
58
58
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
59
59
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
@@ -251,5 +251,5 @@ StaticTimePicker.propTypes = {
|
|
|
251
251
|
* Available views.
|
|
252
252
|
*/
|
|
253
253
|
views: PropTypes.arrayOf(PropTypes.oneOf(['hours', 'minutes', 'seconds']).isRequired)
|
|
254
|
-
};
|
|
254
|
+
} : void 0;
|
|
255
255
|
export { StaticTimePicker };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { MakeOptional } from '@mui/x-internals/types';
|
|
2
|
-
import { BaseTimePickerProps, BaseTimePickerSlots, BaseTimePickerSlotProps } from "../TimePicker/shared.mjs";
|
|
3
|
-
import { StaticOnlyPickerProps, UseStaticPickerSlots, UseStaticPickerSlotProps } from "../internals/hooks/useStaticPicker/index.mjs";
|
|
4
|
-
import { TimeView } from "../models/index.mjs";
|
|
1
|
+
import type { MakeOptional } from '@mui/x-internals/types';
|
|
2
|
+
import type { BaseTimePickerProps, BaseTimePickerSlots, BaseTimePickerSlotProps } from "../TimePicker/shared.mjs";
|
|
3
|
+
import type { StaticOnlyPickerProps, UseStaticPickerSlots, UseStaticPickerSlotProps } from "../internals/hooks/useStaticPicker/index.mjs";
|
|
4
|
+
import type { TimeView } from "../models/index.mjs";
|
|
5
5
|
export interface StaticTimePickerSlots extends BaseTimePickerSlots, UseStaticPickerSlots {}
|
|
6
6
|
export interface StaticTimePickerSlotProps extends BaseTimePickerSlotProps, UseStaticPickerSlotProps {}
|
|
7
7
|
export interface StaticTimePickerProps extends BaseTimePickerProps<TimeView>, MakeOptional<StaticOnlyPickerProps, 'displayStaticWrapperAs'> {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { MakeOptional } from '@mui/x-internals/types';
|
|
2
|
-
import { BaseTimePickerProps, BaseTimePickerSlots, BaseTimePickerSlotProps } from "../TimePicker/shared.js";
|
|
3
|
-
import { StaticOnlyPickerProps, UseStaticPickerSlots, UseStaticPickerSlotProps } from "../internals/hooks/useStaticPicker/index.js";
|
|
4
|
-
import { TimeView } from "../models/index.js";
|
|
1
|
+
import type { MakeOptional } from '@mui/x-internals/types';
|
|
2
|
+
import type { BaseTimePickerProps, BaseTimePickerSlots, BaseTimePickerSlotProps } from "../TimePicker/shared.js";
|
|
3
|
+
import type { StaticOnlyPickerProps, UseStaticPickerSlots, UseStaticPickerSlotProps } from "../internals/hooks/useStaticPicker/index.js";
|
|
4
|
+
import type { TimeView } from "../models/index.js";
|
|
5
5
|
export interface StaticTimePickerSlots extends BaseTimePickerSlots, UseStaticPickerSlots {}
|
|
6
6
|
export interface StaticTimePickerSlotProps extends BaseTimePickerSlotProps, UseStaticPickerSlotProps {}
|
|
7
7
|
export interface StaticTimePickerProps extends BaseTimePickerProps<TimeView>, MakeOptional<StaticOnlyPickerProps, 'displayStaticWrapperAs'> {
|
package/TimeClock/Clock.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { PickerSelectionState } from "../internals/hooks/usePicker/index.mjs";
|
|
3
|
-
import { useMeridiemMode } from "../internals/hooks/date-helpers-hooks.mjs";
|
|
4
|
-
import { PickerOwnerState, PickerValidDate, TimeView } from "../models/index.mjs";
|
|
5
|
-
import { ClockClasses } from "./clockClasses.mjs";
|
|
6
|
-
import { Meridiem } from "../internals/utils/time-utils.mjs";
|
|
7
|
-
import { FormProps } from "../internals/models/formProps.mjs";
|
|
3
|
+
import type { useMeridiemMode } from "../internals/hooks/date-helpers-hooks.mjs";
|
|
4
|
+
import type { PickerOwnerState, PickerValidDate, TimeView } from "../models/index.mjs";
|
|
5
|
+
import type { ClockClasses } from "./clockClasses.mjs";
|
|
6
|
+
import type { Meridiem } from "../internals/utils/time-utils.mjs";
|
|
7
|
+
import type { FormProps } from "../internals/models/formProps.mjs";
|
|
8
8
|
export interface ClockProps extends ReturnType<typeof useMeridiemMode>, FormProps {
|
|
9
9
|
ampm: boolean;
|
|
10
10
|
ampmInClock: boolean;
|
package/TimeClock/Clock.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { PickerSelectionState } from "../internals/hooks/usePicker/index.js";
|
|
3
|
-
import { useMeridiemMode } from "../internals/hooks/date-helpers-hooks.js";
|
|
4
|
-
import { PickerOwnerState, PickerValidDate, TimeView } from "../models/index.js";
|
|
5
|
-
import { ClockClasses } from "./clockClasses.js";
|
|
6
|
-
import { Meridiem } from "../internals/utils/time-utils.js";
|
|
7
|
-
import { FormProps } from "../internals/models/formProps.js";
|
|
3
|
+
import type { useMeridiemMode } from "../internals/hooks/date-helpers-hooks.js";
|
|
4
|
+
import type { PickerOwnerState, PickerValidDate, TimeView } from "../models/index.js";
|
|
5
|
+
import type { ClockClasses } from "./clockClasses.js";
|
|
6
|
+
import type { Meridiem } from "../internals/utils/time-utils.js";
|
|
7
|
+
import type { FormProps } from "../internals/models/formProps.js";
|
|
8
8
|
export interface ClockProps extends ReturnType<typeof useMeridiemMode>, FormProps {
|
|
9
9
|
ampm: boolean;
|
|
10
10
|
ampmInClock: boolean;
|
package/TimeClock/Clock.js
CHANGED
|
@@ -14,6 +14,8 @@ var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
|
|
|
14
14
|
var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
|
|
15
15
|
var _styles = require("@mui/material/styles");
|
|
16
16
|
var _useEnhancedEffect = _interopRequireDefault(require("@mui/utils/useEnhancedEffect"));
|
|
17
|
+
var _useEventCallback = _interopRequireDefault(require("@mui/utils/useEventCallback"));
|
|
18
|
+
var _ownerDocument = _interopRequireDefault(require("@mui/utils/ownerDocument"));
|
|
17
19
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
18
20
|
var _ClockPointer = require("./ClockPointer");
|
|
19
21
|
var _hooks = require("../hooks");
|
|
@@ -194,6 +196,9 @@ function Clock(inProps) {
|
|
|
194
196
|
clockMeridiemMode: meridiemMode
|
|
195
197
|
});
|
|
196
198
|
const isMoving = React.useRef(false);
|
|
199
|
+
const activePointerIdRef = React.useRef(null);
|
|
200
|
+
const squareMaskRef = React.useRef(null);
|
|
201
|
+
const removeDragListenersRef = React.useRef(undefined);
|
|
197
202
|
const classes = useUtilityClasses(classesProp, ownerState);
|
|
198
203
|
const isSelectedTimeDisabled = isTimeDisabled(viewValue, type);
|
|
199
204
|
const isPointerInner = !ampm && type === 'hours' && (viewValue < 1 || viewValue > 12);
|
|
@@ -207,40 +212,81 @@ function Clock(inProps) {
|
|
|
207
212
|
onChange(newValue, isFinish);
|
|
208
213
|
};
|
|
209
214
|
const setTime = (event, isFinish) => {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
if (
|
|
215
|
-
|
|
216
|
-
offsetX = event.changedTouches[0].clientX - rect.left;
|
|
217
|
-
offsetY = event.changedTouches[0].clientY - rect.top;
|
|
215
|
+
const mask = squareMaskRef.current;
|
|
216
|
+
// The document-level listeners can briefly outlive the mask during unmount:
|
|
217
|
+
// React detaches refs before the cleanup effect removes the listeners, so a
|
|
218
|
+
// pointer event firing in that window would otherwise dereference a null ref.
|
|
219
|
+
if (!mask) {
|
|
220
|
+
return;
|
|
218
221
|
}
|
|
222
|
+
|
|
223
|
+
// Resolve the pointer coordinates relative to the clock mask rather than from
|
|
224
|
+
// `offsetX`/`offsetY`: the `pointermove`/`pointerup` listeners live on the
|
|
225
|
+
// document (see `handlePointerDown`), so the event target can be any element
|
|
226
|
+
// once the pointer leaves the clock.
|
|
227
|
+
const rect = mask.getBoundingClientRect();
|
|
228
|
+
const offsetX = event.clientX - rect.left;
|
|
229
|
+
const offsetY = event.clientY - rect.top;
|
|
219
230
|
const newSelectedValue = type === 'seconds' || type === 'minutes' ? (0, _shared.getMinutes)(offsetX, offsetY, minutesStep) : (0, _shared.getHours)(offsetX, offsetY, Boolean(ampm));
|
|
220
231
|
handleValueChange(newSelectedValue, isFinish);
|
|
221
232
|
};
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
233
|
+
|
|
234
|
+
// Pointer events are the single source of truth for mouse, touch and pen. The
|
|
235
|
+
// move/up/cancel listeners are attached to the document so a drag keeps
|
|
236
|
+
// tracking and commits even when the pointer is released outside the clock.
|
|
237
|
+
const stopTracking = () => {
|
|
238
|
+
isMoving.current = false;
|
|
239
|
+
activePointerIdRef.current = null;
|
|
240
|
+
// Idempotent: the cleanup clears its own ref, so calling `stopTracking` twice
|
|
241
|
+
// (e.g. a `pointercancel` racing a `pointerup`) is a safe no-op.
|
|
242
|
+
removeDragListenersRef.current?.();
|
|
225
243
|
};
|
|
226
|
-
const
|
|
227
|
-
if (
|
|
228
|
-
|
|
229
|
-
isMoving.current = false;
|
|
244
|
+
const handleDocumentPointerMove = (0, _useEventCallback.default)(event => {
|
|
245
|
+
if (event.pointerId !== activePointerIdRef.current) {
|
|
246
|
+
return;
|
|
230
247
|
}
|
|
231
248
|
event.preventDefault();
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
if (event.
|
|
236
|
-
|
|
249
|
+
setTime(event, 'shallow');
|
|
250
|
+
});
|
|
251
|
+
const handleDocumentPointerUp = (0, _useEventCallback.default)(event => {
|
|
252
|
+
if (event.pointerId !== activePointerIdRef.current) {
|
|
253
|
+
return;
|
|
237
254
|
}
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
255
|
+
stopTracking();
|
|
256
|
+
setTime(event, 'finish');
|
|
257
|
+
});
|
|
258
|
+
const handleDocumentPointerCancel = (0, _useEventCallback.default)(event => {
|
|
259
|
+
if (event.pointerId !== activePointerIdRef.current) {
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
// The gesture was interrupted by the user agent: drop it without committing.
|
|
263
|
+
stopTracking();
|
|
264
|
+
});
|
|
265
|
+
const handlePointerDown = event => {
|
|
266
|
+
// Ignore secondary buttons (middle = 1, right = 2), secondary multi-touch
|
|
267
|
+
// pointers and interactions that can't change the value. `> 0` rather than
|
|
268
|
+
// `!== 0` keeps the gesture permissive when `event.button` is left unset by a
|
|
269
|
+
// synthetic event (some test environments), matching `useDragRange`.
|
|
270
|
+
if (event.button > 0 || event.isPrimary === false || disabled || readOnly) {
|
|
271
|
+
return;
|
|
242
272
|
}
|
|
243
|
-
|
|
273
|
+
|
|
274
|
+
// A fresh primary pointerdown ends any previous gesture whose pointerup was
|
|
275
|
+
// lost, fully resetting its state before starting the new one.
|
|
276
|
+
stopTracking();
|
|
277
|
+
isMoving.current = true;
|
|
278
|
+
activePointerIdRef.current = event.pointerId;
|
|
279
|
+
const doc = (0, _ownerDocument.default)(squareMaskRef.current);
|
|
280
|
+
doc.addEventListener('pointermove', handleDocumentPointerMove);
|
|
281
|
+
doc.addEventListener('pointerup', handleDocumentPointerUp);
|
|
282
|
+
doc.addEventListener('pointercancel', handleDocumentPointerCancel);
|
|
283
|
+
removeDragListenersRef.current = () => {
|
|
284
|
+
doc.removeEventListener('pointermove', handleDocumentPointerMove);
|
|
285
|
+
doc.removeEventListener('pointerup', handleDocumentPointerUp);
|
|
286
|
+
doc.removeEventListener('pointercancel', handleDocumentPointerCancel);
|
|
287
|
+
removeDragListenersRef.current = undefined;
|
|
288
|
+
};
|
|
289
|
+
setTime(event.nativeEvent, 'shallow');
|
|
244
290
|
};
|
|
245
291
|
const isPointerBetweenTwoClockValues = type === 'hours' ? false : viewValue % 5 !== 0;
|
|
246
292
|
const keyboardControlStep = type === 'minutes' ? minutesStep : 1;
|
|
@@ -253,6 +299,9 @@ function Clock(inProps) {
|
|
|
253
299
|
listboxRef.current.focus();
|
|
254
300
|
}
|
|
255
301
|
}, [autoFocus]);
|
|
302
|
+
|
|
303
|
+
// Clean up the document-level pointer listeners if the clock unmounts mid-drag.
|
|
304
|
+
React.useEffect(() => () => removeDragListenersRef.current?.(), []);
|
|
256
305
|
const clampValue = newValue => Math.max(minViewValue, Math.min(maxViewValue, newValue));
|
|
257
306
|
const circleValue = newValue => (newValue + (maxViewValue + 1)) % (maxViewValue + 1);
|
|
258
307
|
const handleKeyDown = event => {
|
|
@@ -300,11 +349,8 @@ function Clock(inProps) {
|
|
|
300
349
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(ClockClock, {
|
|
301
350
|
className: classes.clock,
|
|
302
351
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(ClockSquareMask, {
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
onTouchEnd: handleTouchEnd,
|
|
306
|
-
onMouseUp: handleMouseUp,
|
|
307
|
-
onMouseMove: handleMouseMove,
|
|
352
|
+
ref: squareMaskRef,
|
|
353
|
+
onPointerDown: handlePointerDown,
|
|
308
354
|
ownerState: ownerState,
|
|
309
355
|
className: classes.squareMask
|
|
310
356
|
}), !isSelectedTimeDisabled && /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
|