@mui/x-date-pickers 5.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AdapterDateFns/index.d.ts +1 -0
- package/AdapterDateFns/index.js +1 -0
- package/AdapterDateFns/package.json +6 -0
- package/AdapterDayjs/index.d.ts +1 -0
- package/AdapterDayjs/index.js +1 -0
- package/AdapterDayjs/package.json +6 -0
- package/AdapterLuxon/index.d.ts +1 -0
- package/AdapterLuxon/index.js +1 -0
- package/AdapterLuxon/package.json +6 -0
- package/AdapterMoment/index.d.ts +1 -0
- package/AdapterMoment/index.js +1 -0
- package/AdapterMoment/package.json +6 -0
- package/CHANGELOG.md +3785 -0
- package/CalendarPicker/CalendarPicker.d.ts +103 -0
- package/CalendarPicker/CalendarPicker.js +390 -0
- package/CalendarPicker/DayPicker.d.ts +51 -0
- package/CalendarPicker/DayPicker.js +140 -0
- package/CalendarPicker/PickersCalendarHeader.d.ts +44 -0
- package/CalendarPicker/PickersCalendarHeader.js +162 -0
- package/CalendarPicker/PickersFadeTransitionGroup.d.ts +12 -0
- package/CalendarPicker/PickersFadeTransitionGroup.js +42 -0
- package/CalendarPicker/PickersSlideTransition.d.ts +15 -0
- package/CalendarPicker/PickersSlideTransition.js +101 -0
- package/CalendarPicker/calendarPickerClasses.d.ts +9 -0
- package/CalendarPicker/calendarPickerClasses.js +3 -0
- package/CalendarPicker/index.d.ts +5 -0
- package/CalendarPicker/index.js +2 -0
- package/CalendarPicker/package.json +6 -0
- package/CalendarPicker/useCalendarState.d.ts +33 -0
- package/CalendarPicker/useCalendarState.js +110 -0
- package/CalendarPickerSkeleton/CalendarPickerSkeleton.d.ts +31 -0
- package/CalendarPickerSkeleton/CalendarPickerSkeleton.js +119 -0
- package/CalendarPickerSkeleton/calendarPickerSkeletonClasses.d.ts +11 -0
- package/CalendarPickerSkeleton/calendarPickerSkeletonClasses.js +3 -0
- package/CalendarPickerSkeleton/index.d.ts +4 -0
- package/CalendarPickerSkeleton/index.js +2 -0
- package/CalendarPickerSkeleton/package.json +6 -0
- package/ClockPicker/Clock.d.ts +26 -0
- package/ClockPicker/Clock.js +262 -0
- package/ClockPicker/ClockNumber.d.ts +18 -0
- package/ClockPicker/ClockNumber.js +70 -0
- package/ClockPicker/ClockNumbers.d.ts +24 -0
- package/ClockPicker/ClockNumbers.js +80 -0
- package/ClockPicker/ClockPicker.d.ts +138 -0
- package/ClockPicker/ClockPicker.js +407 -0
- package/ClockPicker/ClockPointer.d.ts +23 -0
- package/ClockPicker/ClockPointer.js +102 -0
- package/ClockPicker/clockPickerClasses.d.ts +9 -0
- package/ClockPicker/clockPickerClasses.js +5 -0
- package/ClockPicker/index.d.ts +5 -0
- package/ClockPicker/index.js +2 -0
- package/ClockPicker/package.json +6 -0
- package/ClockPicker/shared.d.ts +4 -0
- package/ClockPicker/shared.js +57 -0
- package/DatePicker/DatePicker.d.ts +27 -0
- package/DatePicker/DatePicker.js +456 -0
- package/DatePicker/DatePickerToolbar.d.ts +10 -0
- package/DatePicker/DatePickerToolbar.js +81 -0
- package/DatePicker/index.d.ts +2 -0
- package/DatePicker/index.js +1 -0
- package/DatePicker/package.json +6 -0
- package/DatePicker/shared.d.ts +47 -0
- package/DatePicker/shared.js +54 -0
- package/DateTimePicker/DateTimePicker.d.ts +27 -0
- package/DateTimePicker/DateTimePicker.js +542 -0
- package/DateTimePicker/DateTimePickerTabs.d.ts +12 -0
- package/DateTimePicker/DateTimePickerTabs.js +80 -0
- package/DateTimePicker/DateTimePickerToolbar.d.ts +6 -0
- package/DateTimePicker/DateTimePickerToolbar.js +134 -0
- package/DateTimePicker/index.d.ts +2 -0
- package/DateTimePicker/index.js +1 -0
- package/DateTimePicker/package.json +6 -0
- package/DateTimePicker/shared.d.ts +70 -0
- package/DateTimePicker/shared.js +58 -0
- package/DesktopDatePicker/DesktopDatePicker.d.ts +20 -0
- package/DesktopDatePicker/DesktopDatePicker.js +431 -0
- package/DesktopDatePicker/index.d.ts +2 -0
- package/DesktopDatePicker/index.js +1 -0
- package/DesktopDatePicker/package.json +6 -0
- package/DesktopDateTimePicker/DesktopDateTimePicker.d.ts +20 -0
- package/DesktopDateTimePicker/DesktopDateTimePicker.js +512 -0
- package/DesktopDateTimePicker/index.d.ts +2 -0
- package/DesktopDateTimePicker/index.js +1 -0
- package/DesktopDateTimePicker/package.json +6 -0
- package/DesktopTimePicker/DesktopTimePicker.d.ts +20 -0
- package/DesktopTimePicker/DesktopTimePicker.js +361 -0
- package/DesktopTimePicker/index.d.ts +2 -0
- package/DesktopTimePicker/index.js +1 -0
- package/DesktopTimePicker/package.json +6 -0
- package/LocalizationProvider/LocalizationProvider.d.ts +34 -0
- package/LocalizationProvider/LocalizationProvider.js +100 -0
- package/LocalizationProvider/index.d.ts +2 -0
- package/LocalizationProvider/index.js +1 -0
- package/LocalizationProvider/package.json +6 -0
- package/MobileDatePicker/MobileDatePicker.d.ts +20 -0
- package/MobileDatePicker/MobileDatePicker.js +436 -0
- package/MobileDatePicker/index.d.ts +2 -0
- package/MobileDatePicker/index.js +1 -0
- package/MobileDatePicker/package.json +6 -0
- package/MobileDateTimePicker/MobileDateTimePicker.d.ts +20 -0
- package/MobileDateTimePicker/MobileDateTimePicker.js +523 -0
- package/MobileDateTimePicker/index.d.ts +2 -0
- package/MobileDateTimePicker/index.js +1 -0
- package/MobileDateTimePicker/package.json +6 -0
- package/MobileTimePicker/MobileTimePicker.d.ts +20 -0
- package/MobileTimePicker/MobileTimePicker.js +372 -0
- package/MobileTimePicker/index.d.ts +2 -0
- package/MobileTimePicker/index.js +1 -0
- package/MobileTimePicker/package.json +6 -0
- package/MonthPicker/MonthPicker.d.ts +41 -0
- package/MonthPicker/MonthPicker.js +161 -0
- package/MonthPicker/PickersMonth.d.ts +15 -0
- package/MonthPicker/PickersMonth.js +70 -0
- package/MonthPicker/index.d.ts +4 -0
- package/MonthPicker/index.js +2 -0
- package/MonthPicker/monthPickerClasses.d.ts +7 -0
- package/MonthPicker/monthPickerClasses.js +5 -0
- package/MonthPicker/package.json +6 -0
- package/PickersDay/PickersDay.d.ts +79 -0
- package/PickersDay/PickersDay.js +344 -0
- package/PickersDay/index.d.ts +4 -0
- package/PickersDay/index.js +2 -0
- package/PickersDay/package.json +6 -0
- package/PickersDay/pickersDayClasses.d.ts +19 -0
- package/PickersDay/pickersDayClasses.js +5 -0
- package/README.md +29 -0
- package/StaticDatePicker/StaticDatePicker.d.ts +25 -0
- package/StaticDatePicker/StaticDatePicker.js +397 -0
- package/StaticDatePicker/index.d.ts +2 -0
- package/StaticDatePicker/index.js +1 -0
- package/StaticDatePicker/package.json +6 -0
- package/StaticDateTimePicker/StaticDateTimePicker.d.ts +25 -0
- package/StaticDateTimePicker/StaticDateTimePicker.js +484 -0
- package/StaticDateTimePicker/index.d.ts +2 -0
- package/StaticDateTimePicker/index.js +1 -0
- package/StaticDateTimePicker/package.json +6 -0
- package/StaticTimePicker/StaticTimePicker.d.ts +25 -0
- package/StaticTimePicker/StaticTimePicker.js +332 -0
- package/StaticTimePicker/index.d.ts +2 -0
- package/StaticTimePicker/index.js +1 -0
- package/StaticTimePicker/package.json +6 -0
- package/TimePicker/TimePicker.d.ts +27 -0
- package/TimePicker/TimePicker.js +395 -0
- package/TimePicker/TimePickerToolbar.d.ts +10 -0
- package/TimePicker/TimePickerToolbar.js +167 -0
- package/TimePicker/index.d.ts +2 -0
- package/TimePicker/index.js +1 -0
- package/TimePicker/package.json +6 -0
- package/TimePicker/shared.d.ts +39 -0
- package/TimePicker/shared.js +45 -0
- package/TimePicker/timePickerToolbarClasses.d.ts +13 -0
- package/TimePicker/timePickerToolbarClasses.js +5 -0
- package/YearPicker/PickersYear.d.ts +26 -0
- package/YearPicker/PickersYear.js +111 -0
- package/YearPicker/YearPicker.d.ts +37 -0
- package/YearPicker/YearPicker.js +188 -0
- package/YearPicker/index.d.ts +4 -0
- package/YearPicker/index.js +2 -0
- package/YearPicker/package.json +6 -0
- package/YearPicker/yearPickerClasses.d.ts +7 -0
- package/YearPicker/yearPickerClasses.js +5 -0
- package/index.d.ts +19 -0
- package/index.js +24 -0
- package/internals/components/CalendarOrClockPicker/CalendarOrClockPicker.d.ts +35 -0
- package/internals/components/CalendarOrClockPicker/CalendarOrClockPicker.js +125 -0
- package/internals/components/CalendarOrClockPicker/index.d.ts +1 -0
- package/internals/components/CalendarOrClockPicker/index.js +1 -0
- package/internals/components/KeyboardDateInput.d.ts +3 -0
- package/internals/components/KeyboardDateInput.js +58 -0
- package/internals/components/PickerStaticWrapper/PickerStaticWrapper.d.ts +14 -0
- package/internals/components/PickerStaticWrapper/PickerStaticWrapper.js +57 -0
- package/internals/components/PickerStaticWrapper/index.d.ts +4 -0
- package/internals/components/PickerStaticWrapper/index.js +2 -0
- package/internals/components/PickerStaticWrapper/pickerStaticWrapperClasses.d.ts +7 -0
- package/internals/components/PickerStaticWrapper/pickerStaticWrapperClasses.js +5 -0
- package/internals/components/PickerViewRoot/PickerViewRoot.d.ts +2 -0
- package/internals/components/PickerViewRoot/PickerViewRoot.js +10 -0
- package/internals/components/PickerViewRoot/index.d.ts +1 -0
- package/internals/components/PickerViewRoot/index.js +1 -0
- package/internals/components/PickersArrowSwitcher.d.ts +41 -0
- package/internals/components/PickersArrowSwitcher.js +89 -0
- package/internals/components/PickersModalDialog.d.ts +46 -0
- package/internals/components/PickersModalDialog.js +75 -0
- package/internals/components/PickersPopper.d.ts +43 -0
- package/internals/components/PickersPopper.js +262 -0
- package/internals/components/PickersToolbar.d.ts +15 -0
- package/internals/components/PickersToolbar.js +82 -0
- package/internals/components/PickersToolbarButton.d.ts +12 -0
- package/internals/components/PickersToolbarButton.js +38 -0
- package/internals/components/PickersToolbarText.d.ts +7 -0
- package/internals/components/PickersToolbarText.js +35 -0
- package/internals/components/PureDateInput.d.ts +87 -0
- package/internals/components/PureDateInput.js +50 -0
- package/internals/components/icons/index.d.ts +48 -0
- package/internals/components/icons/index.js +68 -0
- package/internals/components/wrappers/DesktopTooltipWrapper.d.ts +3 -0
- package/internals/components/wrappers/DesktopTooltipWrapper.js +52 -0
- package/internals/components/wrappers/DesktopWrapper.d.ts +15 -0
- package/internals/components/wrappers/DesktopWrapper.js +42 -0
- package/internals/components/wrappers/MobileWrapper.d.ts +13 -0
- package/internals/components/wrappers/MobileWrapper.js +47 -0
- package/internals/components/wrappers/ResponsiveWrapper.d.ts +23 -0
- package/internals/components/wrappers/ResponsiveWrapper.js +44 -0
- package/internals/components/wrappers/WrapperProps.d.ts +13 -0
- package/internals/components/wrappers/WrapperProps.js +1 -0
- package/internals/components/wrappers/WrapperVariantContext.d.ts +11 -0
- package/internals/components/wrappers/WrapperVariantContext.js +12 -0
- package/internals/constants/dimensions.d.ts +4 -0
- package/internals/constants/dimensions.js +4 -0
- package/internals/hooks/date-helpers-hooks.d.ts +16 -0
- package/internals/hooks/date-helpers-hooks.js +37 -0
- package/internals/hooks/useIsLandscape.d.ts +4 -0
- package/internals/hooks/useIsLandscape.js +42 -0
- package/internals/hooks/useMaskedInput.d.ts +7 -0
- package/internals/hooks/useMaskedInput.js +92 -0
- package/internals/hooks/useOpenState.d.ts +9 -0
- package/internals/hooks/useOpenState.js +37 -0
- package/internals/hooks/usePickerState.d.ts +39 -0
- package/internals/hooks/usePickerState.js +117 -0
- package/internals/hooks/useUtils.d.ts +6 -0
- package/internals/hooks/useUtils.js +20 -0
- package/internals/hooks/useViews.d.ts +19 -0
- package/internals/hooks/useViews.js +50 -0
- package/internals/hooks/validation/useDateTimeValidation.d.ts +8 -0
- package/internals/hooks/validation/useDateTimeValidation.js +35 -0
- package/internals/hooks/validation/useDateValidation.d.ts +34 -0
- package/internals/hooks/validation/useDateValidation.js +42 -0
- package/internals/hooks/validation/useTimeValidation.d.ts +32 -0
- package/internals/hooks/validation/useTimeValidation.js +42 -0
- package/internals/hooks/validation/useValidation.d.ts +21 -0
- package/internals/hooks/validation/useValidation.js +19 -0
- package/internals/index.d.ts +40 -0
- package/internals/index.js +22 -0
- package/internals/models/helpers.d.ts +9 -0
- package/internals/models/helpers.js +1 -0
- package/internals/models/index.d.ts +2 -0
- package/internals/models/index.js +2 -0
- package/internals/models/muiPickersAdapter.d.ts +2 -0
- package/internals/models/muiPickersAdapter.js +1 -0
- package/internals/models/parseableDate.d.ts +1 -0
- package/internals/models/parseableDate.js +1 -0
- package/internals/models/props/basePickerProps.d.ts +79 -0
- package/internals/models/props/basePickerProps.js +1 -0
- package/internals/models/props/baseToolbarProps.d.ts +23 -0
- package/internals/models/props/baseToolbarProps.js +1 -0
- package/internals/models/views.d.ts +3 -0
- package/internals/models/views.js +1 -0
- package/internals/package.json +6 -0
- package/internals/utils/date-utils.d.ts +13 -0
- package/internals/utils/date-utils.js +67 -0
- package/internals/utils/defaultReduceAnimations.d.ts +1 -0
- package/internals/utils/defaultReduceAnimations.js +1 -0
- package/internals/utils/text-field-helper.d.ts +11 -0
- package/internals/utils/text-field-helper.js +66 -0
- package/internals/utils/time-utils.d.ts +8 -0
- package/internals/utils/time-utils.js +32 -0
- package/internals/utils/utils.d.ts +7 -0
- package/internals/utils/utils.js +36 -0
- package/legacy/AdapterDateFns/index.js +1 -0
- package/legacy/AdapterDayjs/index.js +1 -0
- package/legacy/AdapterLuxon/index.js +1 -0
- package/legacy/AdapterMoment/index.js +1 -0
- package/legacy/CalendarPicker/CalendarPicker.js +402 -0
- package/legacy/CalendarPicker/DayPicker.js +154 -0
- package/legacy/CalendarPicker/PickersCalendarHeader.js +173 -0
- package/legacy/CalendarPicker/PickersFadeTransitionGroup.js +42 -0
- package/legacy/CalendarPicker/PickersSlideTransition.js +97 -0
- package/legacy/CalendarPicker/calendarPickerClasses.js +5 -0
- package/legacy/CalendarPicker/index.js +2 -0
- package/legacy/CalendarPicker/useCalendarState.js +120 -0
- package/legacy/CalendarPickerSkeleton/CalendarPickerSkeleton.js +126 -0
- package/legacy/CalendarPickerSkeleton/calendarPickerSkeletonClasses.js +5 -0
- package/legacy/CalendarPickerSkeleton/index.js +2 -0
- package/legacy/ClockPicker/Clock.js +268 -0
- package/legacy/ClockPicker/ClockNumber.js +70 -0
- package/legacy/ClockPicker/ClockNumbers.js +83 -0
- package/legacy/ClockPicker/ClockPicker.js +454 -0
- package/legacy/ClockPicker/ClockPointer.js +130 -0
- package/legacy/ClockPicker/clockPickerClasses.js +5 -0
- package/legacy/ClockPicker/index.js +2 -0
- package/legacy/ClockPicker/shared.js +61 -0
- package/legacy/DatePicker/DatePicker.js +455 -0
- package/legacy/DatePicker/DatePickerToolbar.js +82 -0
- package/legacy/DatePicker/index.js +1 -0
- package/legacy/DatePicker/shared.js +58 -0
- package/legacy/DateTimePicker/DateTimePicker.js +541 -0
- package/legacy/DateTimePicker/DateTimePickerTabs.js +81 -0
- package/legacy/DateTimePicker/DateTimePickerToolbar.js +147 -0
- package/legacy/DateTimePicker/index.js +1 -0
- package/legacy/DateTimePicker/shared.js +59 -0
- package/legacy/DesktopDatePicker/DesktopDatePicker.js +434 -0
- package/legacy/DesktopDatePicker/index.js +1 -0
- package/legacy/DesktopDateTimePicker/DesktopDateTimePicker.js +515 -0
- package/legacy/DesktopDateTimePicker/index.js +1 -0
- package/legacy/DesktopTimePicker/DesktopTimePicker.js +364 -0
- package/legacy/DesktopTimePicker/index.js +1 -0
- package/legacy/LocalizationProvider/LocalizationProvider.js +100 -0
- package/legacy/LocalizationProvider/index.js +1 -0
- package/legacy/MobileDatePicker/MobileDatePicker.js +440 -0
- package/legacy/MobileDatePicker/index.js +1 -0
- package/legacy/MobileDateTimePicker/MobileDateTimePicker.js +527 -0
- package/legacy/MobileDateTimePicker/index.js +1 -0
- package/legacy/MobileTimePicker/MobileTimePicker.js +376 -0
- package/legacy/MobileTimePicker/index.js +1 -0
- package/legacy/MonthPicker/MonthPicker.js +159 -0
- package/legacy/MonthPicker/PickersMonth.js +69 -0
- package/legacy/MonthPicker/index.js +2 -0
- package/legacy/MonthPicker/monthPickerClasses.js +5 -0
- package/legacy/PickersDay/PickersDay.js +348 -0
- package/legacy/PickersDay/index.js +2 -0
- package/legacy/PickersDay/pickersDayClasses.js +5 -0
- package/legacy/StaticDatePicker/StaticDatePicker.js +402 -0
- package/legacy/StaticDatePicker/index.js +1 -0
- package/legacy/StaticDateTimePicker/StaticDateTimePicker.js +489 -0
- package/legacy/StaticDateTimePicker/index.js +1 -0
- package/legacy/StaticTimePicker/StaticTimePicker.js +336 -0
- package/legacy/StaticTimePicker/index.js +1 -0
- package/legacy/TimePicker/TimePicker.js +394 -0
- package/legacy/TimePicker/TimePickerToolbar.js +175 -0
- package/legacy/TimePicker/index.js +1 -0
- package/legacy/TimePicker/shared.js +45 -0
- package/legacy/TimePicker/timePickerToolbarClasses.js +5 -0
- package/legacy/YearPicker/PickersYear.js +114 -0
- package/legacy/YearPicker/YearPicker.js +193 -0
- package/legacy/YearPicker/index.js +2 -0
- package/legacy/YearPicker/yearPickerClasses.js +5 -0
- package/legacy/index.js +24 -0
- package/legacy/internals/components/CalendarOrClockPicker/CalendarOrClockPicker.js +133 -0
- package/legacy/internals/components/CalendarOrClockPicker/index.js +1 -0
- package/legacy/internals/components/KeyboardDateInput.js +57 -0
- package/legacy/internals/components/PickerStaticWrapper/PickerStaticWrapper.js +56 -0
- package/legacy/internals/components/PickerStaticWrapper/index.js +2 -0
- package/legacy/internals/components/PickerStaticWrapper/pickerStaticWrapperClasses.js +5 -0
- package/legacy/internals/components/PickerViewRoot/PickerViewRoot.js +10 -0
- package/legacy/internals/components/PickerViewRoot/index.js +1 -0
- package/legacy/internals/components/PickersArrowSwitcher.js +91 -0
- package/legacy/internals/components/PickersModalDialog.js +82 -0
- package/legacy/internals/components/PickersPopper.js +276 -0
- package/legacy/internals/components/PickersToolbar.js +86 -0
- package/legacy/internals/components/PickersToolbarButton.js +36 -0
- package/legacy/internals/components/PickersToolbarText.js +34 -0
- package/legacy/internals/components/PureDateInput.js +52 -0
- package/legacy/internals/components/icons/index.js +68 -0
- package/legacy/internals/components/wrappers/DesktopTooltipWrapper.js +50 -0
- package/legacy/internals/components/wrappers/DesktopWrapper.js +40 -0
- package/legacy/internals/components/wrappers/MobileWrapper.js +45 -0
- package/legacy/internals/components/wrappers/ResponsiveWrapper.js +43 -0
- package/legacy/internals/components/wrappers/WrapperProps.js +1 -0
- package/legacy/internals/components/wrappers/WrapperVariantContext.js +12 -0
- package/legacy/internals/constants/dimensions.js +4 -0
- package/legacy/internals/hooks/date-helpers-hooks.js +35 -0
- package/legacy/internals/hooks/useIsLandscape.js +47 -0
- package/legacy/internals/hooks/useMaskedInput.js +107 -0
- package/legacy/internals/hooks/useOpenState.js +42 -0
- package/legacy/internals/hooks/usePickerState.js +147 -0
- package/legacy/internals/hooks/useUtils.js +24 -0
- package/legacy/internals/hooks/useViews.js +55 -0
- package/legacy/internals/hooks/validation/useDateTimeValidation.js +35 -0
- package/legacy/internals/hooks/validation/useDateValidation.js +45 -0
- package/legacy/internals/hooks/validation/useTimeValidation.js +45 -0
- package/legacy/internals/hooks/validation/useValidation.js +17 -0
- package/legacy/internals/index.js +22 -0
- package/legacy/internals/models/helpers.js +1 -0
- package/legacy/internals/models/index.js +2 -0
- package/legacy/internals/models/muiPickersAdapter.js +1 -0
- package/legacy/internals/models/parseableDate.js +1 -0
- package/legacy/internals/models/props/basePickerProps.js +1 -0
- package/legacy/internals/models/props/baseToolbarProps.js +1 -0
- package/legacy/internals/models/views.js +1 -0
- package/legacy/internals/utils/date-utils.js +66 -0
- package/legacy/internals/utils/defaultReduceAnimations.js +1 -0
- package/legacy/internals/utils/text-field-helper.js +68 -0
- package/legacy/internals/utils/time-utils.js +34 -0
- package/legacy/internals/utils/utils.js +52 -0
- package/legacy/themeAugmentation/index.js +3 -0
- package/modern/AdapterDateFns/index.js +1 -0
- package/modern/AdapterDayjs/index.js +1 -0
- package/modern/AdapterLuxon/index.js +1 -0
- package/modern/AdapterMoment/index.js +1 -0
- package/modern/CalendarPicker/CalendarPicker.js +390 -0
- package/modern/CalendarPicker/DayPicker.js +140 -0
- package/modern/CalendarPicker/PickersCalendarHeader.js +162 -0
- package/modern/CalendarPicker/PickersFadeTransitionGroup.js +42 -0
- package/modern/CalendarPicker/PickersSlideTransition.js +101 -0
- package/modern/CalendarPicker/calendarPickerClasses.js +3 -0
- package/modern/CalendarPicker/index.js +2 -0
- package/modern/CalendarPicker/useCalendarState.js +108 -0
- package/modern/CalendarPickerSkeleton/CalendarPickerSkeleton.js +119 -0
- package/modern/CalendarPickerSkeleton/calendarPickerSkeletonClasses.js +3 -0
- package/modern/CalendarPickerSkeleton/index.js +2 -0
- package/modern/ClockPicker/Clock.js +262 -0
- package/modern/ClockPicker/ClockNumber.js +70 -0
- package/modern/ClockPicker/ClockNumbers.js +80 -0
- package/modern/ClockPicker/ClockPicker.js +407 -0
- package/modern/ClockPicker/ClockPointer.js +102 -0
- package/modern/ClockPicker/clockPickerClasses.js +5 -0
- package/modern/ClockPicker/index.js +2 -0
- package/modern/ClockPicker/shared.js +57 -0
- package/modern/DatePicker/DatePicker.js +456 -0
- package/modern/DatePicker/DatePickerToolbar.js +81 -0
- package/modern/DatePicker/index.js +1 -0
- package/modern/DatePicker/shared.js +54 -0
- package/modern/DateTimePicker/DateTimePicker.js +542 -0
- package/modern/DateTimePicker/DateTimePickerTabs.js +80 -0
- package/modern/DateTimePicker/DateTimePickerToolbar.js +134 -0
- package/modern/DateTimePicker/index.js +1 -0
- package/modern/DateTimePicker/shared.js +58 -0
- package/modern/DesktopDatePicker/DesktopDatePicker.js +431 -0
- package/modern/DesktopDatePicker/index.js +1 -0
- package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +512 -0
- package/modern/DesktopDateTimePicker/index.js +1 -0
- package/modern/DesktopTimePicker/DesktopTimePicker.js +361 -0
- package/modern/DesktopTimePicker/index.js +1 -0
- package/modern/LocalizationProvider/LocalizationProvider.js +100 -0
- package/modern/LocalizationProvider/index.js +1 -0
- package/modern/MobileDatePicker/MobileDatePicker.js +436 -0
- package/modern/MobileDatePicker/index.js +1 -0
- package/modern/MobileDateTimePicker/MobileDateTimePicker.js +523 -0
- package/modern/MobileDateTimePicker/index.js +1 -0
- package/modern/MobileTimePicker/MobileTimePicker.js +372 -0
- package/modern/MobileTimePicker/index.js +1 -0
- package/modern/MonthPicker/MonthPicker.js +161 -0
- package/modern/MonthPicker/PickersMonth.js +70 -0
- package/modern/MonthPicker/index.js +2 -0
- package/modern/MonthPicker/monthPickerClasses.js +5 -0
- package/modern/PickersDay/PickersDay.js +344 -0
- package/modern/PickersDay/index.js +2 -0
- package/modern/PickersDay/pickersDayClasses.js +5 -0
- package/modern/StaticDatePicker/StaticDatePicker.js +397 -0
- package/modern/StaticDatePicker/index.js +1 -0
- package/modern/StaticDateTimePicker/StaticDateTimePicker.js +484 -0
- package/modern/StaticDateTimePicker/index.js +1 -0
- package/modern/StaticTimePicker/StaticTimePicker.js +332 -0
- package/modern/StaticTimePicker/index.js +1 -0
- package/modern/TimePicker/TimePicker.js +395 -0
- package/modern/TimePicker/TimePickerToolbar.js +167 -0
- package/modern/TimePicker/index.js +1 -0
- package/modern/TimePicker/shared.js +45 -0
- package/modern/TimePicker/timePickerToolbarClasses.js +5 -0
- package/modern/YearPicker/PickersYear.js +111 -0
- package/modern/YearPicker/YearPicker.js +188 -0
- package/modern/YearPicker/index.js +2 -0
- package/modern/YearPicker/yearPickerClasses.js +5 -0
- package/modern/index.js +24 -0
- package/modern/internals/components/CalendarOrClockPicker/CalendarOrClockPicker.js +125 -0
- package/modern/internals/components/CalendarOrClockPicker/index.js +1 -0
- package/modern/internals/components/KeyboardDateInput.js +58 -0
- package/modern/internals/components/PickerStaticWrapper/PickerStaticWrapper.js +57 -0
- package/modern/internals/components/PickerStaticWrapper/index.js +2 -0
- package/modern/internals/components/PickerStaticWrapper/pickerStaticWrapperClasses.js +5 -0
- package/modern/internals/components/PickerViewRoot/PickerViewRoot.js +10 -0
- package/modern/internals/components/PickerViewRoot/index.js +1 -0
- package/modern/internals/components/PickersArrowSwitcher.js +89 -0
- package/modern/internals/components/PickersModalDialog.js +75 -0
- package/modern/internals/components/PickersPopper.js +262 -0
- package/modern/internals/components/PickersToolbar.js +82 -0
- package/modern/internals/components/PickersToolbarButton.js +38 -0
- package/modern/internals/components/PickersToolbarText.js +35 -0
- package/modern/internals/components/PureDateInput.js +50 -0
- package/modern/internals/components/icons/index.js +68 -0
- package/modern/internals/components/wrappers/DesktopTooltipWrapper.js +50 -0
- package/modern/internals/components/wrappers/DesktopWrapper.js +42 -0
- package/modern/internals/components/wrappers/MobileWrapper.js +47 -0
- package/modern/internals/components/wrappers/ResponsiveWrapper.js +44 -0
- package/modern/internals/components/wrappers/WrapperProps.js +1 -0
- package/modern/internals/components/wrappers/WrapperVariantContext.js +12 -0
- package/modern/internals/constants/dimensions.js +4 -0
- package/modern/internals/hooks/date-helpers-hooks.js +37 -0
- package/modern/internals/hooks/useIsLandscape.js +42 -0
- package/modern/internals/hooks/useMaskedInput.js +92 -0
- package/modern/internals/hooks/useOpenState.js +37 -0
- package/modern/internals/hooks/usePickerState.js +117 -0
- package/modern/internals/hooks/useUtils.js +20 -0
- package/modern/internals/hooks/useViews.js +48 -0
- package/modern/internals/hooks/validation/useDateTimeValidation.js +35 -0
- package/modern/internals/hooks/validation/useDateValidation.js +42 -0
- package/modern/internals/hooks/validation/useTimeValidation.js +42 -0
- package/modern/internals/hooks/validation/useValidation.js +19 -0
- package/modern/internals/index.js +22 -0
- package/modern/internals/models/helpers.js +1 -0
- package/modern/internals/models/index.js +2 -0
- package/modern/internals/models/muiPickersAdapter.js +1 -0
- package/modern/internals/models/parseableDate.js +1 -0
- package/modern/internals/models/props/basePickerProps.js +1 -0
- package/modern/internals/models/props/baseToolbarProps.js +1 -0
- package/modern/internals/models/views.js +1 -0
- package/modern/internals/utils/date-utils.js +67 -0
- package/modern/internals/utils/defaultReduceAnimations.js +1 -0
- package/modern/internals/utils/text-field-helper.js +66 -0
- package/modern/internals/utils/time-utils.js +32 -0
- package/modern/internals/utils/utils.js +36 -0
- package/modern/themeAugmentation/index.js +3 -0
- package/node/AdapterDateFns/index.js +15 -0
- package/node/AdapterDayjs/index.js +15 -0
- package/node/AdapterLuxon/index.js +15 -0
- package/node/AdapterMoment/index.js +15 -0
- package/node/CalendarPicker/CalendarPicker.js +420 -0
- package/node/CalendarPicker/DayPicker.js +161 -0
- package/node/CalendarPicker/PickersCalendarHeader.js +185 -0
- package/node/CalendarPicker/PickersFadeTransitionGroup.js +64 -0
- package/node/CalendarPicker/PickersSlideTransition.js +126 -0
- package/node/CalendarPicker/calendarPickerClasses.js +14 -0
- package/node/CalendarPicker/index.js +27 -0
- package/node/CalendarPicker/useCalendarState.js +132 -0
- package/node/CalendarPickerSkeleton/CalendarPickerSkeleton.js +142 -0
- package/node/CalendarPickerSkeleton/calendarPickerSkeletonClasses.js +14 -0
- package/node/CalendarPickerSkeleton/index.js +27 -0
- package/node/ClockPicker/Clock.js +285 -0
- package/node/ClockPicker/ClockNumber.js +93 -0
- package/node/ClockPicker/ClockNumbers.js +98 -0
- package/node/ClockPicker/ClockPicker.js +437 -0
- package/node/ClockPicker/ClockPointer.js +123 -0
- package/node/ClockPicker/clockPickerClasses.js +16 -0
- package/node/ClockPicker/index.js +27 -0
- package/node/ClockPicker/shared.js +70 -0
- package/node/DatePicker/DatePicker.js +477 -0
- package/node/DatePicker/DatePickerToolbar.js +105 -0
- package/node/DatePicker/index.js +13 -0
- package/node/DatePicker/shared.js +73 -0
- package/node/DateTimePicker/DateTimePicker.js +562 -0
- package/node/DateTimePicker/DateTimePickerTabs.js +100 -0
- package/node/DateTimePicker/DateTimePickerToolbar.js +160 -0
- package/node/DateTimePicker/index.js +13 -0
- package/node/DateTimePicker/shared.js +72 -0
- package/node/DesktopDatePicker/DesktopDatePicker.js +456 -0
- package/node/DesktopDatePicker/index.js +13 -0
- package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +537 -0
- package/node/DesktopDateTimePicker/index.js +13 -0
- package/node/DesktopTimePicker/DesktopTimePicker.js +386 -0
- package/node/DesktopTimePicker/index.js +13 -0
- package/node/LocalizationProvider/LocalizationProvider.js +119 -0
- package/node/LocalizationProvider/index.js +13 -0
- package/node/MobileDatePicker/MobileDatePicker.js +462 -0
- package/node/MobileDatePicker/index.js +13 -0
- package/node/MobileDateTimePicker/MobileDateTimePicker.js +549 -0
- package/node/MobileDateTimePicker/index.js +13 -0
- package/node/MobileTimePicker/MobileTimePicker.js +398 -0
- package/node/MobileTimePicker/index.js +13 -0
- package/node/MonthPicker/MonthPicker.js +184 -0
- package/node/MonthPicker/PickersMonth.js +95 -0
- package/node/MonthPicker/index.js +27 -0
- package/node/MonthPicker/monthPickerClasses.js +16 -0
- package/node/PickersDay/PickersDay.js +372 -0
- package/node/PickersDay/index.js +27 -0
- package/node/PickersDay/pickersDayClasses.js +16 -0
- package/node/StaticDatePicker/StaticDatePicker.js +422 -0
- package/node/StaticDatePicker/index.js +13 -0
- package/node/StaticDateTimePicker/StaticDateTimePicker.js +509 -0
- package/node/StaticDateTimePicker/index.js +13 -0
- package/node/StaticTimePicker/StaticTimePicker.js +356 -0
- package/node/StaticTimePicker/index.js +13 -0
- package/node/TimePicker/TimePicker.js +416 -0
- package/node/TimePicker/TimePickerToolbar.js +192 -0
- package/node/TimePicker/index.js +13 -0
- package/node/TimePicker/shared.js +59 -0
- package/node/TimePicker/timePickerToolbarClasses.js +16 -0
- package/node/YearPicker/PickersYear.js +135 -0
- package/node/YearPicker/YearPicker.js +212 -0
- package/node/YearPicker/index.js +27 -0
- package/node/YearPicker/yearPickerClasses.js +16 -0
- package/node/index.js +257 -0
- package/node/internals/components/CalendarOrClockPicker/CalendarOrClockPicker.js +151 -0
- package/node/internals/components/CalendarOrClockPicker/index.js +13 -0
- package/node/internals/components/KeyboardDateInput.js +83 -0
- package/node/internals/components/PickerStaticWrapper/PickerStaticWrapper.js +78 -0
- package/node/internals/components/PickerStaticWrapper/index.js +27 -0
- package/node/internals/components/PickerStaticWrapper/pickerStaticWrapperClasses.js +16 -0
- package/node/internals/components/PickerViewRoot/PickerViewRoot.js +20 -0
- package/node/internals/components/PickerViewRoot/index.js +13 -0
- package/node/internals/components/PickersArrowSwitcher.js +110 -0
- package/node/internals/components/PickersModalDialog.js +99 -0
- package/node/internals/components/PickersPopper.js +287 -0
- package/node/internals/components/PickersToolbar.js +105 -0
- package/node/internals/components/PickersToolbarButton.js +59 -0
- package/node/internals/components/PickersToolbarText.js +57 -0
- package/node/internals/components/PureDateInput.js +70 -0
- package/node/internals/components/icons/index.js +88 -0
- package/node/internals/components/wrappers/DesktopTooltipWrapper.js +71 -0
- package/node/internals/components/wrappers/DesktopWrapper.js +60 -0
- package/node/internals/components/wrappers/MobileWrapper.js +65 -0
- package/node/internals/components/wrappers/ResponsiveWrapper.js +64 -0
- package/node/internals/components/wrappers/WrapperProps.js +5 -0
- package/node/internals/components/wrappers/WrapperVariantContext.js +25 -0
- package/node/internals/constants/dimensions.js +14 -0
- package/node/internals/hooks/date-helpers-hooks.js +55 -0
- package/node/internals/hooks/useIsLandscape.js +57 -0
- package/node/internals/hooks/useMaskedInput.js +113 -0
- package/node/internals/hooks/useOpenState.js +51 -0
- package/node/internals/hooks/usePickerState.js +136 -0
- package/node/internals/hooks/useUtils.js +40 -0
- package/node/internals/hooks/useViews.js +64 -0
- package/node/internals/hooks/validation/useDateTimeValidation.js +51 -0
- package/node/internals/hooks/validation/useDateValidation.js +54 -0
- package/node/internals/hooks/validation/useTimeValidation.js +55 -0
- package/node/internals/hooks/validation/useValidation.js +32 -0
- package/node/internals/index.js +193 -0
- package/node/internals/models/helpers.js +5 -0
- package/node/internals/models/index.js +31 -0
- package/node/internals/models/muiPickersAdapter.js +5 -0
- package/node/internals/models/parseableDate.js +5 -0
- package/node/internals/models/props/basePickerProps.js +5 -0
- package/node/internals/models/props/baseToolbarProps.js +5 -0
- package/node/internals/models/views.js +5 -0
- package/node/internals/utils/date-utils.js +79 -0
- package/node/internals/utils/defaultReduceAnimations.js +8 -0
- package/node/internals/utils/text-field-helper.js +86 -0
- package/node/internals/utils/time-utils.js +53 -0
- package/node/internals/utils/utils.js +58 -0
- package/node/themeAugmentation/index.js +44 -0
- package/package.json +78 -0
- package/themeAugmentation/components.d.ts +53 -0
- package/themeAugmentation/index.d.ts +3 -0
- package/themeAugmentation/index.js +3 -0
- package/themeAugmentation/overrides.d.ts +27 -0
- package/themeAugmentation/package.json +6 -0
- package/themeAugmentation/props.d.ts +46 -0
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
const _excluded = ["ToolbarComponent", "value", "onChange"];
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import { useTimePickerDefaultizedProps } from '../TimePicker/shared';
|
|
7
|
+
import { TimePickerToolbar } from '../TimePicker/TimePickerToolbar';
|
|
8
|
+
import { MobileWrapper } from '../internals/components/wrappers/MobileWrapper';
|
|
9
|
+
import { CalendarOrClockPicker } from '../internals/components/CalendarOrClockPicker';
|
|
10
|
+
import { useTimeValidation } from '../internals/hooks/validation/useTimeValidation';
|
|
11
|
+
import { parsePickerInputValue } from '../internals/utils/date-utils';
|
|
12
|
+
import { PureDateInput } from '../internals/components/PureDateInput';
|
|
13
|
+
import { usePickerState } from '../internals/hooks/usePickerState';
|
|
14
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
+
const valueManager = {
|
|
16
|
+
emptyValue: null,
|
|
17
|
+
parseInput: parsePickerInputValue,
|
|
18
|
+
areValuesEqual: (utils, a, b) => utils.isEqual(a, b)
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
*
|
|
23
|
+
* Demos:
|
|
24
|
+
*
|
|
25
|
+
* - [Time Picker](https://mui.com/components/x/react-date-pickers/time-picker/)
|
|
26
|
+
*
|
|
27
|
+
* API:
|
|
28
|
+
*
|
|
29
|
+
* - [MobileTimePicker API](https://mui.com/api/mobile-time-picker/)
|
|
30
|
+
*/
|
|
31
|
+
export const MobileTimePicker = /*#__PURE__*/React.forwardRef(function MobileTimePicker(inProps, ref) {
|
|
32
|
+
// TODO: TDate needs to be instantiated at every usage.
|
|
33
|
+
const props = useTimePickerDefaultizedProps(inProps, 'MuiMobileTimePicker');
|
|
34
|
+
const validationError = useTimeValidation(props) !== null;
|
|
35
|
+
const {
|
|
36
|
+
pickerProps,
|
|
37
|
+
inputProps,
|
|
38
|
+
wrapperProps
|
|
39
|
+
} = usePickerState(props, valueManager); // Note that we are passing down all the value without spread.
|
|
40
|
+
// It saves us >1kb gzip and make any prop available automatically on any level down.
|
|
41
|
+
|
|
42
|
+
const {
|
|
43
|
+
ToolbarComponent = TimePickerToolbar
|
|
44
|
+
} = props,
|
|
45
|
+
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
46
|
+
|
|
47
|
+
const DateInputProps = _extends({}, inputProps, other, {
|
|
48
|
+
ref,
|
|
49
|
+
validationError
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
return /*#__PURE__*/_jsx(MobileWrapper, _extends({}, other, wrapperProps, {
|
|
53
|
+
DateInputProps: DateInputProps,
|
|
54
|
+
PureDateInputComponent: PureDateInput,
|
|
55
|
+
children: /*#__PURE__*/_jsx(CalendarOrClockPicker, _extends({}, pickerProps, {
|
|
56
|
+
autoFocus: true,
|
|
57
|
+
toolbarTitle: props.label || props.toolbarTitle,
|
|
58
|
+
ToolbarComponent: ToolbarComponent,
|
|
59
|
+
DateInputProps: DateInputProps
|
|
60
|
+
}, other))
|
|
61
|
+
}));
|
|
62
|
+
});
|
|
63
|
+
process.env.NODE_ENV !== "production" ? MobileTimePicker.propTypes = {
|
|
64
|
+
// ----------------------------- Warning --------------------------------
|
|
65
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
66
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
67
|
+
// ----------------------------------------------------------------------
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Regular expression to detect "accepted" symbols.
|
|
71
|
+
* @default /\dap/gi
|
|
72
|
+
*/
|
|
73
|
+
acceptRegex: PropTypes.instanceOf(RegExp),
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* 12h/24h view for hour selection clock.
|
|
77
|
+
* @default false
|
|
78
|
+
*/
|
|
79
|
+
ampm: PropTypes.bool,
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Display ampm controls under the clock (instead of in the toolbar).
|
|
83
|
+
* @default false
|
|
84
|
+
*/
|
|
85
|
+
ampmInClock: PropTypes.bool,
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Cancel text message.
|
|
89
|
+
* @default 'Cancel'
|
|
90
|
+
*/
|
|
91
|
+
cancelText: PropTypes.node,
|
|
92
|
+
children: PropTypes.node,
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* className applied to the root component.
|
|
96
|
+
*/
|
|
97
|
+
className: PropTypes.string,
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* If `true`, it shows the clear action in the picker dialog.
|
|
101
|
+
* @default false
|
|
102
|
+
*/
|
|
103
|
+
clearable: PropTypes.bool,
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Clear text message.
|
|
107
|
+
* @default 'Clear'
|
|
108
|
+
*/
|
|
109
|
+
clearText: PropTypes.node,
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* The components used for each slot.
|
|
113
|
+
* Either a string to use a HTML element or a component.
|
|
114
|
+
*/
|
|
115
|
+
components: PropTypes.object,
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Props applied to the [`Dialog`](/api/dialog/) element.
|
|
119
|
+
*/
|
|
120
|
+
DialogProps: PropTypes.object,
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* If `true` the popup or dialog will immediately close after submitting full date.
|
|
124
|
+
* @default `true` for Desktop, `false` for Mobile (based on the chosen wrapper and `desktopModeMediaQuery` prop).
|
|
125
|
+
*/
|
|
126
|
+
disableCloseOnSelect: PropTypes.bool,
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* If `true`, the picker and text field are disabled.
|
|
130
|
+
*/
|
|
131
|
+
disabled: PropTypes.bool,
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Do not ignore date part when validating min/max time.
|
|
135
|
+
* @default false
|
|
136
|
+
*/
|
|
137
|
+
disableIgnoringDatePartForTimeValidation: PropTypes.bool,
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Disable mask on the keyboard, this should be used rarely. Consider passing proper mask for your format.
|
|
141
|
+
* @default false
|
|
142
|
+
*/
|
|
143
|
+
disableMaskedInput: PropTypes.bool,
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Do not render open picker button (renders only text field with validation).
|
|
147
|
+
* @default false
|
|
148
|
+
*/
|
|
149
|
+
disableOpenPicker: PropTypes.bool,
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Accessible text that helps user to understand which time and view is selected.
|
|
153
|
+
* @param {ClockPickerView} view The current view rendered.
|
|
154
|
+
* @param {TDate | null} time The current time.
|
|
155
|
+
* @param {MuiPickersAdapter<TDate>} adapter The current date adapter.
|
|
156
|
+
* @returns {string} The clock label.
|
|
157
|
+
* @default <TDate extends any>(
|
|
158
|
+
* view: ClockView,
|
|
159
|
+
* time: TDate | null,
|
|
160
|
+
* adapter: MuiPickersAdapter<TDate>,
|
|
161
|
+
* ) =>
|
|
162
|
+
* `Select ${view}. ${
|
|
163
|
+
* time === null ? 'No time selected' : `Selected time is ${adapter.format(time, 'fullTime')}`
|
|
164
|
+
* }`
|
|
165
|
+
*/
|
|
166
|
+
getClockLabelText: PropTypes.func,
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Get aria-label text for control that opens picker dialog. Aria-label text must include selected date. @DateIOType
|
|
170
|
+
* @default (value, utils) => `Choose date, selected date is ${utils.format(utils.date(value), 'fullDate')}`
|
|
171
|
+
* @param {ParseableDate<TDateValue>} value The date from which we want to add an aria-text.
|
|
172
|
+
* @param {MuiPickersAdapter<TDateValue>} utils The utils to manipulate the date.
|
|
173
|
+
* @returns {string} The aria-text to render inside the dialog.
|
|
174
|
+
*/
|
|
175
|
+
getOpenDialogAriaText: PropTypes.func,
|
|
176
|
+
ignoreInvalidInputs: PropTypes.bool,
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Props to pass to keyboard input adornment.
|
|
180
|
+
*/
|
|
181
|
+
InputAdornmentProps: PropTypes.object,
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Format string.
|
|
185
|
+
*/
|
|
186
|
+
inputFormat: PropTypes.string,
|
|
187
|
+
InputProps: PropTypes.object,
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Pass a ref to the `input` element.
|
|
191
|
+
*/
|
|
192
|
+
inputRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
193
|
+
current: PropTypes.object
|
|
194
|
+
})]),
|
|
195
|
+
label: PropTypes.node,
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Custom mask. Can be used to override generate from format. (e.g. `__/__/____ __:__` or `__/__/____ __:__ _M`).
|
|
199
|
+
*/
|
|
200
|
+
mask: PropTypes.string,
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Max time acceptable time.
|
|
204
|
+
* For input validation date part of passed object will be ignored if `disableIgnoringDatePartForTimeValidation` not specified.
|
|
205
|
+
*/
|
|
206
|
+
maxTime: PropTypes.any,
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Min time acceptable time.
|
|
210
|
+
* For input validation date part of passed object will be ignored if `disableIgnoringDatePartForTimeValidation` not specified.
|
|
211
|
+
*/
|
|
212
|
+
minTime: PropTypes.any,
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Step over minutes.
|
|
216
|
+
* @default 1
|
|
217
|
+
*/
|
|
218
|
+
minutesStep: PropTypes.number,
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Ok button text.
|
|
222
|
+
* @default 'OK'
|
|
223
|
+
*/
|
|
224
|
+
okText: PropTypes.node,
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Callback fired when date is accepted @DateIOType.
|
|
228
|
+
* @param {TDateValue} date The date that was just accepted.
|
|
229
|
+
*/
|
|
230
|
+
onAccept: PropTypes.func,
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Callback fired when the value (the selected date) changes @DateIOType.
|
|
234
|
+
* @param {DateRange<TDate>} date The new parsed date.
|
|
235
|
+
* @param {string} keyboardInputValue The current value of the keyboard input.
|
|
236
|
+
*/
|
|
237
|
+
onChange: PropTypes.func.isRequired,
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Callback fired when the popup requests to be closed.
|
|
241
|
+
* Use in controlled mode (see open).
|
|
242
|
+
*/
|
|
243
|
+
onClose: PropTypes.func,
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* Callback that fired when input value or new `value` prop validation returns **new** validation error (or value is valid after error).
|
|
247
|
+
* In case of validation error detected `reason` prop return non-null value and `TextField` must be displayed in `error` state.
|
|
248
|
+
* This can be used to render appropriate form error.
|
|
249
|
+
*
|
|
250
|
+
* [Read the guide](https://next.material-ui-pickers.dev/guides/forms) about form integration and error displaying.
|
|
251
|
+
* @DateIOType
|
|
252
|
+
*
|
|
253
|
+
* @param {TError} reason The reason why the current value is not valid.
|
|
254
|
+
* @param {TDateValue} value The invalid value.
|
|
255
|
+
*/
|
|
256
|
+
onError: PropTypes.func,
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Callback fired when the popup requests to be opened.
|
|
260
|
+
* Use in controlled mode (see open).
|
|
261
|
+
*/
|
|
262
|
+
onOpen: PropTypes.func,
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Callback fired on view change.
|
|
266
|
+
* @param {ClockPickerView} view The new view.
|
|
267
|
+
*/
|
|
268
|
+
onViewChange: PropTypes.func,
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Control the popup or dialog open state.
|
|
272
|
+
*/
|
|
273
|
+
open: PropTypes.bool,
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Props to pass to keyboard adornment button.
|
|
277
|
+
*/
|
|
278
|
+
OpenPickerButtonProps: PropTypes.object,
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* First view to show.
|
|
282
|
+
*/
|
|
283
|
+
openTo: PropTypes.oneOf(['hours', 'minutes', 'seconds']),
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Force rendering in particular orientation.
|
|
287
|
+
*/
|
|
288
|
+
orientation: PropTypes.oneOf(['landscape', 'portrait']),
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Make picker read only.
|
|
292
|
+
*/
|
|
293
|
+
readOnly: PropTypes.bool,
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* The `renderInput` prop allows you to customize the rendered input.
|
|
297
|
+
* The `props` argument of this render prop contains props of [TextField](https://mui.com/api/text-field/#textfield-api) that you need to forward.
|
|
298
|
+
* Pay specific attention to the `ref` and `inputProps` keys.
|
|
299
|
+
* @example ```jsx
|
|
300
|
+
* renderInput={props => <TextField {...props} />}
|
|
301
|
+
* ````
|
|
302
|
+
* @param {MuiTextFieldPropsType} props The props of the input.
|
|
303
|
+
* @returns {React.ReactNode} The node to render as the input.
|
|
304
|
+
*/
|
|
305
|
+
renderInput: PropTypes.func.isRequired,
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* Custom formatter to be passed into Rifm component.
|
|
309
|
+
* @param {string} str The un-formatted string.
|
|
310
|
+
* @returns {string} The formatted string.
|
|
311
|
+
*/
|
|
312
|
+
rifmFormatter: PropTypes.func,
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Dynamically check if time is disabled or not.
|
|
316
|
+
* If returns `false` appropriate time point will ot be acceptable.
|
|
317
|
+
* @param {number} timeValue The value to check.
|
|
318
|
+
* @param {ClockPickerView} clockType The clock type of the timeValue.
|
|
319
|
+
* @returns {boolean} Returns `true` if the time should be disabled
|
|
320
|
+
*/
|
|
321
|
+
shouldDisableTime: PropTypes.func,
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* If `true`, the today button is displayed. **Note** that `showClearButton` has a higher priority.
|
|
325
|
+
* @default false
|
|
326
|
+
*/
|
|
327
|
+
showTodayButton: PropTypes.bool,
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* If `true`, show the toolbar even in desktop mode.
|
|
331
|
+
*/
|
|
332
|
+
showToolbar: PropTypes.bool,
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* Today text message.
|
|
336
|
+
* @default 'Today'
|
|
337
|
+
*/
|
|
338
|
+
todayText: PropTypes.node,
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Component that will replace default toolbar renderer.
|
|
342
|
+
* @default TimePickerToolbar
|
|
343
|
+
*/
|
|
344
|
+
ToolbarComponent: PropTypes.elementType,
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Date format, that is displaying in toolbar.
|
|
348
|
+
*/
|
|
349
|
+
toolbarFormat: PropTypes.string,
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* Mobile picker date value placeholder, displaying if `value` === `null`.
|
|
353
|
+
* @default '–'
|
|
354
|
+
*/
|
|
355
|
+
toolbarPlaceholder: PropTypes.node,
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* Mobile picker title, displaying in the toolbar.
|
|
359
|
+
* @default 'Select time'
|
|
360
|
+
*/
|
|
361
|
+
toolbarTitle: PropTypes.node,
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* The value of the picker.
|
|
365
|
+
*/
|
|
366
|
+
value: PropTypes.oneOfType([PropTypes.any, PropTypes.instanceOf(Date), PropTypes.number, PropTypes.string]),
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* Array of views to show.
|
|
370
|
+
*/
|
|
371
|
+
views: PropTypes.arrayOf(PropTypes.oneOf(['hours', 'minutes', 'seconds']).isRequired)
|
|
372
|
+
} : void 0;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MobileTimePicker } from './MobileTimePicker';
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
const _excluded = ["className", "date", "disabled", "disableFuture", "disablePast", "maxDate", "minDate", "onChange", "onMonthChange", "readOnly"];
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import clsx from 'clsx';
|
|
7
|
+
import { styled, useThemeProps } from '@mui/material/styles';
|
|
8
|
+
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
9
|
+
import { PickersMonth } from './PickersMonth';
|
|
10
|
+
import { useUtils, useNow } from '../internals/hooks/useUtils';
|
|
11
|
+
import { getMonthPickerUtilityClass } from './monthPickerClasses';
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
|
|
14
|
+
const useUtilityClasses = ownerState => {
|
|
15
|
+
const {
|
|
16
|
+
classes
|
|
17
|
+
} = ownerState;
|
|
18
|
+
const slots = {
|
|
19
|
+
root: ['root']
|
|
20
|
+
};
|
|
21
|
+
return composeClasses(slots, getMonthPickerUtilityClass, classes);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const MonthPickerRoot = styled('div', {
|
|
25
|
+
name: 'MuiMonthPicker',
|
|
26
|
+
slot: 'Root',
|
|
27
|
+
overridesResolver: (props, styles) => styles.root
|
|
28
|
+
})({
|
|
29
|
+
width: 310,
|
|
30
|
+
display: 'flex',
|
|
31
|
+
flexWrap: 'wrap',
|
|
32
|
+
alignContent: 'stretch',
|
|
33
|
+
margin: '0 4px'
|
|
34
|
+
});
|
|
35
|
+
export const MonthPicker = /*#__PURE__*/React.forwardRef(function MonthPicker(inProps, ref) {
|
|
36
|
+
const props = useThemeProps({
|
|
37
|
+
props: inProps,
|
|
38
|
+
name: 'MuiMonthPicker'
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const {
|
|
42
|
+
className,
|
|
43
|
+
date,
|
|
44
|
+
disabled,
|
|
45
|
+
disableFuture,
|
|
46
|
+
disablePast,
|
|
47
|
+
maxDate,
|
|
48
|
+
minDate,
|
|
49
|
+
onChange,
|
|
50
|
+
onMonthChange,
|
|
51
|
+
readOnly
|
|
52
|
+
} = props,
|
|
53
|
+
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
54
|
+
|
|
55
|
+
const ownerState = props;
|
|
56
|
+
const classes = useUtilityClasses(ownerState);
|
|
57
|
+
const utils = useUtils();
|
|
58
|
+
const now = useNow();
|
|
59
|
+
const currentMonth = utils.getMonth(date || now);
|
|
60
|
+
|
|
61
|
+
const shouldDisableMonth = month => {
|
|
62
|
+
const firstEnabledMonth = utils.startOfMonth(disablePast && utils.isAfter(now, minDate) ? now : minDate);
|
|
63
|
+
const lastEnabledMonth = utils.startOfMonth(disableFuture && utils.isBefore(now, maxDate) ? now : maxDate);
|
|
64
|
+
const isBeforeFirstEnabled = utils.isBefore(month, firstEnabledMonth);
|
|
65
|
+
const isAfterLastEnabled = utils.isAfter(month, lastEnabledMonth);
|
|
66
|
+
return isBeforeFirstEnabled || isAfterLastEnabled;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const onMonthSelect = month => {
|
|
70
|
+
if (readOnly) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const newDate = utils.setMonth(date || now, month);
|
|
75
|
+
onChange(newDate, 'finish');
|
|
76
|
+
|
|
77
|
+
if (onMonthChange) {
|
|
78
|
+
onMonthChange(newDate);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
return /*#__PURE__*/_jsx(MonthPickerRoot, _extends({
|
|
83
|
+
ref: ref,
|
|
84
|
+
className: clsx(classes.root, className),
|
|
85
|
+
ownerState: ownerState
|
|
86
|
+
}, other, {
|
|
87
|
+
children: utils.getMonthArray(date || now).map(month => {
|
|
88
|
+
const monthNumber = utils.getMonth(month);
|
|
89
|
+
const monthText = utils.format(month, 'monthShort');
|
|
90
|
+
return /*#__PURE__*/_jsx(PickersMonth, {
|
|
91
|
+
value: monthNumber,
|
|
92
|
+
selected: monthNumber === currentMonth,
|
|
93
|
+
onSelect: onMonthSelect,
|
|
94
|
+
disabled: disabled || shouldDisableMonth(month),
|
|
95
|
+
children: monthText
|
|
96
|
+
}, monthText);
|
|
97
|
+
})
|
|
98
|
+
}));
|
|
99
|
+
});
|
|
100
|
+
process.env.NODE_ENV !== "production" ? MonthPicker.propTypes = {
|
|
101
|
+
// ----------------------------- Warning --------------------------------
|
|
102
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
103
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
104
|
+
// ----------------------------------------------------------------------
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Override or extend the styles applied to the component.
|
|
108
|
+
*/
|
|
109
|
+
classes: PropTypes.object,
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* className applied to the root element.
|
|
113
|
+
*/
|
|
114
|
+
className: PropTypes.string,
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Date value for the MonthPicker
|
|
118
|
+
*/
|
|
119
|
+
date: PropTypes.any,
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* If `true` picker is disabled
|
|
123
|
+
*/
|
|
124
|
+
disabled: PropTypes.bool,
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* If `true` future days are disabled.
|
|
128
|
+
*/
|
|
129
|
+
disableFuture: PropTypes.bool,
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* If `true` past days are disabled.
|
|
133
|
+
*/
|
|
134
|
+
disablePast: PropTypes.bool,
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Maximal selectable date.
|
|
138
|
+
*/
|
|
139
|
+
maxDate: PropTypes.any.isRequired,
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Minimal selectable date.
|
|
143
|
+
*/
|
|
144
|
+
minDate: PropTypes.any.isRequired,
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Callback fired on date change.
|
|
148
|
+
*/
|
|
149
|
+
onChange: PropTypes.func.isRequired,
|
|
150
|
+
onMonthChange: PropTypes.func,
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* If `true` picker is readonly
|
|
154
|
+
*/
|
|
155
|
+
readOnly: PropTypes.bool,
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
159
|
+
*/
|
|
160
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
|
161
|
+
} : void 0;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
+
const _excluded = ["disabled", "onSelect", "selected", "value"];
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
import Typography from '@mui/material/Typography';
|
|
7
|
+
import { styled, alpha } from '@mui/material/styles';
|
|
8
|
+
import { generateUtilityClasses } from '@mui/material';
|
|
9
|
+
import { onSpaceOrEnter } from '../internals/utils/utils';
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
const classes = generateUtilityClasses('PrivatePickersMonth', ['root', 'selected']);
|
|
12
|
+
const PickersMonthRoot = styled(Typography)(({
|
|
13
|
+
theme
|
|
14
|
+
}) => _extends({
|
|
15
|
+
flex: '1 0 33.33%',
|
|
16
|
+
display: 'flex',
|
|
17
|
+
alignItems: 'center',
|
|
18
|
+
justifyContent: 'center',
|
|
19
|
+
color: 'unset',
|
|
20
|
+
backgroundColor: 'transparent',
|
|
21
|
+
border: 0,
|
|
22
|
+
outline: 0
|
|
23
|
+
}, theme.typography.subtitle1, {
|
|
24
|
+
margin: '8px 0',
|
|
25
|
+
height: 36,
|
|
26
|
+
borderRadius: 18,
|
|
27
|
+
cursor: 'pointer',
|
|
28
|
+
'&:focus, &:hover': {
|
|
29
|
+
backgroundColor: alpha(theme.palette.action.active, theme.palette.action.hoverOpacity)
|
|
30
|
+
},
|
|
31
|
+
'&:disabled': {
|
|
32
|
+
pointerEvents: 'none',
|
|
33
|
+
color: theme.palette.text.secondary
|
|
34
|
+
},
|
|
35
|
+
[`&.${classes.selected}`]: {
|
|
36
|
+
color: theme.palette.primary.contrastText,
|
|
37
|
+
backgroundColor: theme.palette.primary.main,
|
|
38
|
+
'&:focus, &:hover': {
|
|
39
|
+
backgroundColor: theme.palette.primary.dark
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}));
|
|
43
|
+
/**
|
|
44
|
+
* @ignore - do not document.
|
|
45
|
+
*/
|
|
46
|
+
|
|
47
|
+
export const PickersMonth = props => {
|
|
48
|
+
const {
|
|
49
|
+
disabled,
|
|
50
|
+
onSelect,
|
|
51
|
+
selected,
|
|
52
|
+
value
|
|
53
|
+
} = props,
|
|
54
|
+
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
55
|
+
|
|
56
|
+
const handleSelection = () => {
|
|
57
|
+
onSelect(value);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
return /*#__PURE__*/_jsx(PickersMonthRoot, _extends({
|
|
61
|
+
component: "button",
|
|
62
|
+
className: clsx(classes.root, selected && classes.selected),
|
|
63
|
+
tabIndex: disabled ? -1 : 0,
|
|
64
|
+
onClick: handleSelection,
|
|
65
|
+
onKeyDown: onSpaceOrEnter(handleSelection),
|
|
66
|
+
color: selected ? 'primary' : undefined,
|
|
67
|
+
variant: selected ? 'h5' : 'subtitle1',
|
|
68
|
+
disabled: disabled
|
|
69
|
+
}, other));
|
|
70
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { generateUtilityClass, generateUtilityClasses } from '@mui/material';
|
|
2
|
+
export function getMonthPickerUtilityClass(slot) {
|
|
3
|
+
return generateUtilityClass('MuiMonthPicker', slot);
|
|
4
|
+
}
|
|
5
|
+
export const monthPickerClasses = generateUtilityClasses('MuiMonthPicker', ['root']);
|