@mui/lab 5.0.0-alpha.75 → 5.0.0-alpha.76
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 -1
- package/AdapterDateFns/index.js +1 -1
- package/AdapterDayjs/index.d.ts +1 -1
- package/AdapterDayjs/index.js +1 -1
- package/AdapterLuxon/index.d.ts +1 -1
- package/AdapterLuxon/index.js +1 -1
- package/AdapterMoment/index.d.ts +1 -1
- package/AdapterMoment/index.js +1 -1
- package/CHANGELOG.md +74 -0
- package/CalendarPicker/index.d.ts +2 -5
- package/CalendarPicker/index.js +1 -1
- package/CalendarPickerSkeleton/index.d.ts +2 -3
- package/CalendarPickerSkeleton/index.js +1 -1
- package/ClockPicker/index.d.ts +2 -5
- package/ClockPicker/index.js +1 -2
- package/DatePicker/index.d.ts +2 -2
- package/DatePicker/index.js +1 -2
- package/DateRangePicker/DateRangePicker.d.ts +11 -65
- package/DateRangePicker/DateRangePicker.js +14 -512
- package/DateRangePicker/index.d.ts +2 -3
- package/DateRangePicker/index.js +2 -2
- package/DateRangePickerDay/DateRangePickerDay.d.ts +13 -79
- package/DateRangePickerDay/DateRangePickerDay.js +17 -240
- package/DateRangePickerDay/index.d.ts +2 -2
- package/DateRangePickerDay/index.js +2 -2
- package/DateTimePicker/index.d.ts +2 -2
- package/DateTimePicker/index.js +1 -2
- package/DesktopDatePicker/index.d.ts +2 -2
- package/DesktopDatePicker/index.js +1 -2
- package/DesktopDateRangePicker/DesktopDateRangePicker.d.ts +10 -64
- package/DesktopDateRangePicker/DesktopDateRangePicker.js +13 -477
- package/DesktopDateRangePicker/index.d.ts +2 -2
- package/DesktopDateRangePicker/index.js +2 -2
- package/DesktopDateTimePicker/index.d.ts +2 -2
- package/DesktopDateTimePicker/index.js +1 -2
- package/DesktopTimePicker/index.d.ts +2 -2
- package/DesktopTimePicker/index.js +1 -2
- package/LoadingButton/loadingButtonClasses.d.ts +22 -22
- package/LocalizationProvider/index.d.ts +2 -2
- package/LocalizationProvider/index.js +1 -2
- package/Masonry/masonryClasses.d.ts +8 -8
- package/MobileDatePicker/index.d.ts +2 -2
- package/MobileDatePicker/index.js +1 -2
- package/MobileDateRangePicker/MobileDateRangePicker.d.ts +10 -64
- package/MobileDateRangePicker/MobileDateRangePicker.js +13 -487
- package/MobileDateRangePicker/index.d.ts +2 -2
- package/MobileDateRangePicker/index.js +2 -2
- package/MobileDateTimePicker/index.d.ts +2 -2
- package/MobileDateTimePicker/index.js +1 -2
- package/MobileTimePicker/index.d.ts +2 -2
- package/MobileTimePicker/index.js +1 -2
- package/MonthPicker/index.d.ts +2 -3
- package/MonthPicker/index.js +1 -1
- package/PickersDay/index.d.ts +2 -4
- package/PickersDay/index.js +1 -2
- package/StaticDatePicker/index.d.ts +2 -2
- package/StaticDatePicker/index.js +1 -2
- package/StaticDateRangePicker/StaticDateRangePicker.d.ts +10 -67
- package/StaticDateRangePicker/StaticDateRangePicker.js +13 -443
- package/StaticDateRangePicker/index.d.ts +2 -2
- package/StaticDateRangePicker/index.js +2 -2
- package/StaticDateTimePicker/index.d.ts +2 -2
- package/StaticDateTimePicker/index.js +1 -2
- package/StaticTimePicker/index.d.ts +2 -2
- package/StaticTimePicker/index.js +1 -2
- package/TabPanel/tabPanelClasses.d.ts +8 -8
- package/TimePicker/index.d.ts +2 -2
- package/TimePicker/index.js +1 -2
- package/Timeline/Timeline.d.ts +59 -59
- package/Timeline/TimelineContext.d.ts +6 -6
- package/Timeline/index.d.ts +5 -5
- package/Timeline/timelineClasses.d.ts +3 -3
- package/TimelineConnector/timelineConnectorClasses.d.ts +8 -8
- package/TimelineContent/timelineContentClasses.d.ts +14 -14
- package/TimelineDot/timelineDotClasses.d.ts +24 -24
- package/TimelineItem/timelineItemClasses.d.ts +16 -16
- package/TimelineOppositeContent/timelineOppositeContentClasses.d.ts +14 -14
- package/TimelineSeparator/timelineSeparatorClasses.d.ts +8 -8
- package/TreeItem/treeItemClasses.d.ts +24 -24
- package/TreeView/treeViewClasses.d.ts +8 -8
- package/YearPicker/index.d.ts +2 -5
- package/YearPicker/index.js +1 -3
- package/index.js +1 -1
- package/internal/svg-icons/ArrowDropDown.d.ts +7 -7
- package/internal/svg-icons/ArrowLeft.d.ts +7 -7
- package/internal/svg-icons/ArrowRight.d.ts +7 -7
- package/internal/svg-icons/Calendar.d.ts +7 -7
- package/internal/svg-icons/Clock.d.ts +7 -7
- package/internal/svg-icons/DateRange.d.ts +7 -7
- package/internal/svg-icons/Pen.d.ts +7 -7
- package/internal/svg-icons/Time.d.ts +7 -7
- package/legacy/AdapterDateFns/index.js +1 -1
- package/legacy/AdapterDayjs/index.js +1 -1
- package/legacy/AdapterLuxon/index.js +1 -1
- package/legacy/AdapterMoment/index.js +1 -1
- package/legacy/CalendarPicker/index.js +1 -1
- package/legacy/CalendarPickerSkeleton/index.js +1 -1
- package/legacy/ClockPicker/index.js +1 -2
- package/legacy/DatePicker/index.js +1 -2
- package/legacy/DateRangePicker/DateRangePicker.js +13 -517
- package/legacy/DateRangePicker/index.js +2 -2
- package/legacy/DateRangePickerDay/DateRangePickerDay.js +17 -245
- package/legacy/DateRangePickerDay/index.js +2 -2
- package/legacy/DateTimePicker/index.js +1 -2
- package/legacy/DesktopDatePicker/index.js +1 -2
- package/legacy/DesktopDateRangePicker/DesktopDateRangePicker.js +12 -482
- package/legacy/DesktopDateRangePicker/index.js +2 -2
- package/legacy/DesktopDateTimePicker/index.js +1 -2
- package/legacy/DesktopTimePicker/index.js +1 -2
- package/legacy/LocalizationProvider/index.js +1 -2
- package/legacy/MobileDatePicker/index.js +1 -2
- package/legacy/MobileDateRangePicker/MobileDateRangePicker.js +12 -492
- package/legacy/MobileDateRangePicker/index.js +2 -2
- package/legacy/MobileDateTimePicker/index.js +1 -2
- package/legacy/MobileTimePicker/index.js +1 -2
- package/legacy/MonthPicker/index.js +1 -1
- package/legacy/PickersDay/index.js +1 -2
- package/legacy/StaticDatePicker/index.js +1 -2
- package/legacy/StaticDateRangePicker/StaticDateRangePicker.js +12 -449
- package/legacy/StaticDateRangePicker/index.js +2 -2
- package/legacy/StaticDateTimePicker/index.js +1 -2
- package/legacy/StaticTimePicker/index.js +1 -2
- package/legacy/TimePicker/index.js +1 -2
- package/legacy/YearPicker/index.js +1 -3
- package/legacy/index.js +1 -1
- package/modern/AdapterDateFns/index.js +1 -1
- package/modern/AdapterDayjs/index.js +1 -1
- package/modern/AdapterLuxon/index.js +1 -1
- package/modern/AdapterMoment/index.js +1 -1
- package/modern/CalendarPicker/index.js +1 -1
- package/modern/CalendarPickerSkeleton/index.js +1 -1
- package/modern/ClockPicker/index.js +1 -2
- package/modern/DatePicker/index.js +1 -2
- package/modern/DateRangePicker/DateRangePicker.js +14 -512
- package/modern/DateRangePicker/index.js +2 -2
- package/modern/DateRangePickerDay/DateRangePickerDay.js +17 -240
- package/modern/DateRangePickerDay/index.js +2 -2
- package/modern/DateTimePicker/index.js +1 -2
- package/modern/DesktopDatePicker/index.js +1 -2
- package/modern/DesktopDateRangePicker/DesktopDateRangePicker.js +13 -477
- package/modern/DesktopDateRangePicker/index.js +2 -2
- package/modern/DesktopDateTimePicker/index.js +1 -2
- package/modern/DesktopTimePicker/index.js +1 -2
- package/modern/LocalizationProvider/index.js +1 -2
- package/modern/MobileDatePicker/index.js +1 -2
- package/modern/MobileDateRangePicker/MobileDateRangePicker.js +13 -487
- package/modern/MobileDateRangePicker/index.js +2 -2
- package/modern/MobileDateTimePicker/index.js +1 -2
- package/modern/MobileTimePicker/index.js +1 -2
- package/modern/MonthPicker/index.js +1 -1
- package/modern/PickersDay/index.js +1 -2
- package/modern/StaticDatePicker/index.js +1 -2
- package/modern/StaticDateRangePicker/StaticDateRangePicker.js +13 -443
- package/modern/StaticDateRangePicker/index.js +2 -2
- package/modern/StaticDateTimePicker/index.js +1 -2
- package/modern/StaticTimePicker/index.js +1 -2
- package/modern/TimePicker/index.js +1 -2
- package/modern/YearPicker/index.js +1 -3
- package/modern/index.js +1 -1
- package/node/AdapterDateFns/index.js +2 -4
- package/node/AdapterDayjs/index.js +2 -4
- package/node/AdapterLuxon/index.js +2 -4
- package/node/AdapterMoment/index.js +2 -4
- package/node/CalendarPicker/index.js +2 -6
- package/node/CalendarPickerSkeleton/index.js +2 -6
- package/node/ClockPicker/index.js +2 -6
- package/node/DatePicker/index.js +2 -19
- package/node/DateRangePicker/DateRangePicker.js +14 -517
- package/node/DateRangePickerDay/DateRangePickerDay.js +20 -254
- package/node/DateTimePicker/index.js +2 -19
- package/node/DesktopDatePicker/index.js +2 -19
- package/node/DesktopDateRangePicker/DesktopDateRangePicker.js +13 -482
- package/node/DesktopDateTimePicker/index.js +2 -19
- package/node/DesktopTimePicker/index.js +2 -19
- package/node/LocalizationProvider/index.js +2 -19
- package/node/MobileDatePicker/index.js +2 -19
- package/node/MobileDateRangePicker/MobileDateRangePicker.js +13 -492
- package/node/MobileDateTimePicker/index.js +2 -19
- package/node/MobileTimePicker/index.js +2 -19
- package/node/MonthPicker/index.js +2 -6
- package/node/PickersDay/index.js +2 -6
- package/node/StaticDatePicker/index.js +2 -19
- package/node/StaticDateRangePicker/StaticDateRangePicker.js +13 -447
- package/node/StaticDateTimePicker/index.js +2 -19
- package/node/StaticTimePicker/index.js +2 -19
- package/node/TimePicker/index.js +2 -19
- package/node/YearPicker/index.js +9 -26
- package/node/index.js +1 -1
- package/package.json +8 -11
- package/themeAugmentation/components.d.ts +0 -50
- package/themeAugmentation/index.d.ts +2 -0
- package/themeAugmentation/overrides.d.ts +0 -16
- package/themeAugmentation/props.d.ts +0 -36
- package/CalendarPicker/CalendarPicker.d.ts +0 -106
- package/CalendarPicker/CalendarPicker.js +0 -344
- package/CalendarPicker/PickersCalendar.d.ts +0 -47
- package/CalendarPicker/PickersCalendar.js +0 -145
- package/CalendarPicker/PickersCalendarHeader.d.ts +0 -43
- package/CalendarPicker/PickersCalendarHeader.js +0 -165
- package/CalendarPicker/PickersFadeTransitionGroup.d.ts +0 -12
- package/CalendarPicker/PickersFadeTransitionGroup.js +0 -44
- package/CalendarPicker/PickersSlideTransition.d.ts +0 -16
- package/CalendarPicker/PickersSlideTransition.js +0 -103
- package/CalendarPicker/shared.d.ts +0 -1
- package/CalendarPicker/shared.js +0 -1
- package/CalendarPicker/useCalendarState.d.ts +0 -32
- package/CalendarPicker/useCalendarState.js +0 -110
- package/CalendarPickerSkeleton/CalendarPickerSkeleton.d.ts +0 -41
- package/CalendarPickerSkeleton/CalendarPickerSkeleton.js +0 -149
- package/ClockPicker/Clock.d.ts +0 -28
- package/ClockPicker/Clock.js +0 -267
- package/ClockPicker/ClockNumber.d.ts +0 -19
- package/ClockPicker/ClockNumber.js +0 -72
- package/ClockPicker/ClockNumbers.d.ts +0 -24
- package/ClockPicker/ClockNumbers.js +0 -80
- package/ClockPicker/ClockPicker.d.ts +0 -121
- package/ClockPicker/ClockPicker.js +0 -398
- package/ClockPicker/ClockPickerStandalone.d.ts +0 -28
- package/ClockPicker/ClockPickerStandalone.js +0 -47
- package/ClockPicker/ClockPointer.d.ts +0 -23
- package/ClockPicker/ClockPointer.js +0 -103
- package/ClockPicker/shared.d.ts +0 -5
- package/ClockPicker/shared.js +0 -57
- package/DatePicker/DatePicker.d.ts +0 -27
- package/DatePicker/DatePicker.js +0 -469
- package/DatePicker/DatePickerToolbar.d.ts +0 -23
- package/DatePicker/DatePickerToolbar.js +0 -82
- package/DatePicker/shared.d.ts +0 -45
- package/DatePicker/shared.js +0 -54
- package/DateRangePicker/DateRangePickerInput.d.ts +0 -35
- package/DateRangePicker/DateRangePickerInput.js +0 -132
- package/DateRangePicker/DateRangePickerToolbar.d.ts +0 -15
- package/DateRangePicker/DateRangePickerToolbar.js +0 -65
- package/DateRangePicker/DateRangePickerView.d.ts +0 -44
- package/DateRangePicker/DateRangePickerView.js +0 -177
- package/DateRangePicker/DateRangePickerViewDesktop.d.ts +0 -29
- package/DateRangePicker/DateRangePickerViewDesktop.js +0 -159
- package/DateRangePicker/DateRangePickerViewMobile.d.ts +0 -17
- package/DateRangePicker/DateRangePickerViewMobile.js +0 -62
- package/DateRangePicker/RangeTypes.d.ts +0 -8
- package/DateRangePicker/RangeTypes.js +0 -1
- package/DateRangePicker/date-range-manager.d.ts +0 -14
- package/DateRangePicker/date-range-manager.js +0 -43
- package/DateTimePicker/DateTimePicker.d.ts +0 -27
- package/DateTimePicker/DateTimePicker.js +0 -547
- package/DateTimePicker/DateTimePickerTabs.d.ts +0 -13
- package/DateTimePicker/DateTimePickerTabs.js +0 -87
- package/DateTimePicker/DateTimePickerToolbar.d.ts +0 -7
- package/DateTimePicker/DateTimePickerToolbar.js +0 -139
- package/DateTimePicker/shared.d.ts +0 -67
- package/DateTimePicker/shared.js +0 -58
- package/DesktopDatePicker/DesktopDatePicker.d.ts +0 -20
- package/DesktopDatePicker/DesktopDatePicker.js +0 -444
- package/DesktopDateTimePicker/DesktopDateTimePicker.d.ts +0 -20
- package/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -518
- package/DesktopTimePicker/DesktopTimePicker.d.ts +0 -20
- package/DesktopTimePicker/DesktopTimePicker.js +0 -366
- package/LocalizationProvider/LocalizationProvider.d.ts +0 -35
- package/LocalizationProvider/LocalizationProvider.js +0 -108
- package/MobileDatePicker/MobileDatePicker.d.ts +0 -20
- package/MobileDatePicker/MobileDatePicker.js +0 -449
- package/MobileDateTimePicker/MobileDateTimePicker.d.ts +0 -20
- package/MobileDateTimePicker/MobileDateTimePicker.js +0 -529
- package/MobileTimePicker/MobileTimePicker.d.ts +0 -20
- package/MobileTimePicker/MobileTimePicker.js +0 -377
- package/MonthPicker/MonthPicker.d.ts +0 -53
- package/MonthPicker/MonthPicker.js +0 -182
- package/MonthPicker/PickersMonth.d.ts +0 -15
- package/MonthPicker/PickersMonth.js +0 -72
- package/PickersDay/PickersDay.d.ts +0 -93
- package/PickersDay/PickersDay.js +0 -396
- package/StaticDatePicker/StaticDatePicker.d.ts +0 -25
- package/StaticDatePicker/StaticDatePicker.js +0 -406
- package/StaticDateTimePicker/StaticDateTimePicker.d.ts +0 -25
- package/StaticDateTimePicker/StaticDateTimePicker.js +0 -486
- package/StaticTimePicker/StaticTimePicker.d.ts +0 -25
- package/StaticTimePicker/StaticTimePicker.js +0 -333
- package/TimePicker/TimePicker.d.ts +0 -27
- package/TimePicker/TimePicker.js +0 -395
- package/TimePicker/TimePickerToolbar.d.ts +0 -23
- package/TimePicker/TimePickerToolbar.js +0 -172
- package/TimePicker/shared.d.ts +0 -36
- package/TimePicker/shared.js +0 -45
- package/YearPicker/PickersYear.d.ts +0 -27
- package/YearPicker/PickersYear.js +0 -112
- package/YearPicker/YearPicker.d.ts +0 -44
- package/YearPicker/YearPicker.js +0 -251
- package/YearPicker/yearPickerClasses.d.ts +0 -3
- package/YearPicker/yearPickerClasses.js +0 -6
- package/internal/pickers/KeyboardDateInput.d.ts +0 -4
- package/internal/pickers/KeyboardDateInput.js +0 -59
- package/internal/pickers/Picker/Picker.d.ts +0 -33
- package/internal/pickers/Picker/Picker.js +0 -130
- package/internal/pickers/Picker/PickerView.d.ts +0 -3
- package/internal/pickers/Picker/PickerView.js +0 -11
- package/internal/pickers/PickersArrowSwitcher.d.ts +0 -41
- package/internal/pickers/PickersArrowSwitcher.js +0 -91
- package/internal/pickers/PickersModalDialog.d.ts +0 -47
- package/internal/pickers/PickersModalDialog.js +0 -78
- package/internal/pickers/PickersPopper.d.ts +0 -44
- package/internal/pickers/PickersPopper.js +0 -267
- package/internal/pickers/PickersToolbar.d.ts +0 -14
- package/internal/pickers/PickersToolbar.js +0 -88
- package/internal/pickers/PickersToolbarButton.d.ts +0 -13
- package/internal/pickers/PickersToolbarButton.js +0 -39
- package/internal/pickers/PickersToolbarText.d.ts +0 -8
- package/internal/pickers/PickersToolbarText.js +0 -36
- package/internal/pickers/PureDateInput.d.ts +0 -80
- package/internal/pickers/PureDateInput.js +0 -51
- package/internal/pickers/constants/dimensions.d.ts +0 -4
- package/internal/pickers/constants/dimensions.js +0 -4
- package/internal/pickers/constants/prop-types.d.ts +0 -1
- package/internal/pickers/constants/prop-types.js +0 -1
- package/internal/pickers/date-time-utils.d.ts +0 -8
- package/internal/pickers/date-time-utils.js +0 -28
- package/internal/pickers/date-utils.d.ts +0 -52
- package/internal/pickers/date-utils.js +0 -138
- package/internal/pickers/hooks/date-helpers-hooks.d.ts +0 -16
- package/internal/pickers/hooks/date-helpers-hooks.js +0 -37
- package/internal/pickers/hooks/useIsLandscape.d.ts +0 -4
- package/internal/pickers/hooks/useIsLandscape.js +0 -43
- package/internal/pickers/hooks/useMaskedInput.d.ts +0 -7
- package/internal/pickers/hooks/useMaskedInput.js +0 -93
- package/internal/pickers/hooks/useOpenState.d.ts +0 -10
- package/internal/pickers/hooks/useOpenState.js +0 -38
- package/internal/pickers/hooks/usePickerState.d.ts +0 -38
- package/internal/pickers/hooks/usePickerState.js +0 -117
- package/internal/pickers/hooks/useUtils.d.ts +0 -7
- package/internal/pickers/hooks/useUtils.js +0 -25
- package/internal/pickers/hooks/useValidation.d.ts +0 -23
- package/internal/pickers/hooks/useValidation.js +0 -44
- package/internal/pickers/hooks/useViews.d.ts +0 -19
- package/internal/pickers/hooks/useViews.js +0 -50
- package/internal/pickers/test-utils.js +0 -91
- package/internal/pickers/text-field-helper.d.ts +0 -11
- package/internal/pickers/text-field-helper.js +0 -66
- package/internal/pickers/time-utils.d.ts +0 -33
- package/internal/pickers/time-utils.js +0 -68
- package/internal/pickers/typings/BasePicker.d.ts +0 -95
- package/internal/pickers/typings/BasePicker.js +0 -1
- package/internal/pickers/typings/Views.d.ts +0 -1
- package/internal/pickers/typings/Views.js +0 -1
- package/internal/pickers/typings/helpers.d.ts +0 -9
- package/internal/pickers/typings/helpers.js +0 -1
- package/internal/pickers/utils.d.ts +0 -7
- package/internal/pickers/utils.js +0 -36
- package/internal/pickers/wrappers/DesktopTooltipWrapper.d.ts +0 -4
- package/internal/pickers/wrappers/DesktopTooltipWrapper.js +0 -55
- package/internal/pickers/wrappers/DesktopWrapper.d.ts +0 -16
- package/internal/pickers/wrappers/DesktopWrapper.js +0 -45
- package/internal/pickers/wrappers/MobileWrapper.d.ts +0 -14
- package/internal/pickers/wrappers/MobileWrapper.js +0 -50
- package/internal/pickers/wrappers/PickerStaticWrapper.d.ts +0 -21
- package/internal/pickers/wrappers/PickerStaticWrapper.js +0 -63
- package/internal/pickers/wrappers/ResponsiveWrapper.d.ts +0 -23
- package/internal/pickers/wrappers/ResponsiveWrapper.js +0 -44
- package/internal/pickers/wrappers/WrapperProps.d.ts +0 -13
- package/internal/pickers/wrappers/WrapperProps.js +0 -1
- package/internal/pickers/wrappers/WrapperVariantContext.d.ts +0 -11
- package/internal/pickers/wrappers/WrapperVariantContext.js +0 -12
- package/legacy/CalendarPicker/CalendarPicker.js +0 -355
- package/legacy/CalendarPicker/PickersCalendar.js +0 -159
- package/legacy/CalendarPicker/PickersCalendarHeader.js +0 -176
- package/legacy/CalendarPicker/PickersFadeTransitionGroup.js +0 -44
- package/legacy/CalendarPicker/PickersSlideTransition.js +0 -98
- package/legacy/CalendarPicker/shared.js +0 -1
- package/legacy/CalendarPicker/useCalendarState.js +0 -118
- package/legacy/CalendarPickerSkeleton/CalendarPickerSkeleton.js +0 -155
- package/legacy/ClockPicker/Clock.js +0 -273
- package/legacy/ClockPicker/ClockNumber.js +0 -71
- package/legacy/ClockPicker/ClockNumbers.js +0 -83
- package/legacy/ClockPicker/ClockPicker.js +0 -437
- package/legacy/ClockPicker/ClockPickerStandalone.js +0 -49
- package/legacy/ClockPicker/ClockPointer.js +0 -130
- package/legacy/ClockPicker/shared.js +0 -61
- package/legacy/DatePicker/DatePicker.js +0 -467
- package/legacy/DatePicker/DatePickerToolbar.js +0 -82
- package/legacy/DatePicker/shared.js +0 -57
- package/legacy/DateRangePicker/DateRangePickerInput.js +0 -144
- package/legacy/DateRangePicker/DateRangePickerToolbar.js +0 -73
- package/legacy/DateRangePicker/DateRangePickerView.js +0 -181
- package/legacy/DateRangePicker/DateRangePickerViewDesktop.js +0 -174
- package/legacy/DateRangePicker/DateRangePickerViewMobile.js +0 -64
- package/legacy/DateRangePicker/RangeTypes.js +0 -1
- package/legacy/DateRangePicker/date-range-manager.js +0 -51
- package/legacy/DateTimePicker/DateTimePicker.js +0 -545
- package/legacy/DateTimePicker/DateTimePickerTabs.js +0 -88
- package/legacy/DateTimePicker/DateTimePickerToolbar.js +0 -151
- package/legacy/DateTimePicker/shared.js +0 -58
- package/legacy/DesktopDatePicker/DesktopDatePicker.js +0 -446
- package/legacy/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -520
- package/legacy/DesktopTimePicker/DesktopTimePicker.js +0 -368
- package/legacy/LocalizationProvider/LocalizationProvider.js +0 -108
- package/legacy/MobileDatePicker/MobileDatePicker.js +0 -452
- package/legacy/MobileDateTimePicker/MobileDateTimePicker.js +0 -532
- package/legacy/MobileTimePicker/MobileTimePicker.js +0 -380
- package/legacy/MonthPicker/MonthPicker.js +0 -179
- package/legacy/MonthPicker/PickersMonth.js +0 -70
- package/legacy/PickersDay/PickersDay.js +0 -399
- package/legacy/StaticDatePicker/StaticDatePicker.js +0 -410
- package/legacy/StaticDateTimePicker/StaticDateTimePicker.js +0 -490
- package/legacy/StaticTimePicker/StaticTimePicker.js +0 -336
- package/legacy/TimePicker/TimePicker.js +0 -393
- package/legacy/TimePicker/TimePickerToolbar.js +0 -179
- package/legacy/TimePicker/shared.js +0 -44
- package/legacy/YearPicker/PickersYear.js +0 -115
- package/legacy/YearPicker/YearPicker.js +0 -254
- package/legacy/YearPicker/yearPickerClasses.js +0 -6
- package/legacy/internal/pickers/KeyboardDateInput.js +0 -57
- package/legacy/internal/pickers/Picker/Picker.js +0 -141
- package/legacy/internal/pickers/Picker/PickerView.js +0 -11
- package/legacy/internal/pickers/PickersArrowSwitcher.js +0 -92
- package/legacy/internal/pickers/PickersModalDialog.js +0 -85
- package/legacy/internal/pickers/PickersPopper.js +0 -280
- package/legacy/internal/pickers/PickersToolbar.js +0 -92
- package/legacy/internal/pickers/PickersToolbarButton.js +0 -36
- package/legacy/internal/pickers/PickersToolbarText.js +0 -34
- package/legacy/internal/pickers/PureDateInput.js +0 -53
- package/legacy/internal/pickers/constants/dimensions.js +0 -4
- package/legacy/internal/pickers/constants/prop-types.js +0 -1
- package/legacy/internal/pickers/date-time-utils.js +0 -25
- package/legacy/internal/pickers/date-utils.js +0 -143
- package/legacy/internal/pickers/hooks/date-helpers-hooks.js +0 -35
- package/legacy/internal/pickers/hooks/useIsLandscape.js +0 -46
- package/legacy/internal/pickers/hooks/useMaskedInput.js +0 -105
- package/legacy/internal/pickers/hooks/useOpenState.js +0 -41
- package/legacy/internal/pickers/hooks/usePickerState.js +0 -143
- package/legacy/internal/pickers/hooks/useUtils.js +0 -25
- package/legacy/internal/pickers/hooks/useValidation.js +0 -43
- package/legacy/internal/pickers/hooks/useViews.js +0 -55
- package/legacy/internal/pickers/test-utils.js +0 -112
- package/legacy/internal/pickers/text-field-helper.js +0 -68
- package/legacy/internal/pickers/time-utils.js +0 -69
- package/legacy/internal/pickers/typings/BasePicker.js +0 -1
- package/legacy/internal/pickers/typings/Views.js +0 -1
- package/legacy/internal/pickers/typings/helpers.js +0 -1
- package/legacy/internal/pickers/utils.js +0 -52
- package/legacy/internal/pickers/wrappers/DesktopTooltipWrapper.js +0 -53
- package/legacy/internal/pickers/wrappers/DesktopWrapper.js +0 -43
- package/legacy/internal/pickers/wrappers/MobileWrapper.js +0 -47
- package/legacy/internal/pickers/wrappers/PickerStaticWrapper.js +0 -61
- package/legacy/internal/pickers/wrappers/ResponsiveWrapper.js +0 -42
- package/legacy/internal/pickers/wrappers/WrapperProps.js +0 -1
- package/legacy/internal/pickers/wrappers/WrapperVariantContext.js +0 -12
- package/modern/CalendarPicker/CalendarPicker.js +0 -344
- package/modern/CalendarPicker/PickersCalendar.js +0 -145
- package/modern/CalendarPicker/PickersCalendarHeader.js +0 -165
- package/modern/CalendarPicker/PickersFadeTransitionGroup.js +0 -44
- package/modern/CalendarPicker/PickersSlideTransition.js +0 -103
- package/modern/CalendarPicker/shared.js +0 -1
- package/modern/CalendarPicker/useCalendarState.js +0 -108
- package/modern/CalendarPickerSkeleton/CalendarPickerSkeleton.js +0 -149
- package/modern/ClockPicker/Clock.js +0 -267
- package/modern/ClockPicker/ClockNumber.js +0 -72
- package/modern/ClockPicker/ClockNumbers.js +0 -80
- package/modern/ClockPicker/ClockPicker.js +0 -398
- package/modern/ClockPicker/ClockPickerStandalone.js +0 -47
- package/modern/ClockPicker/ClockPointer.js +0 -103
- package/modern/ClockPicker/shared.js +0 -57
- package/modern/DatePicker/DatePicker.js +0 -469
- package/modern/DatePicker/DatePickerToolbar.js +0 -82
- package/modern/DatePicker/shared.js +0 -54
- package/modern/DateRangePicker/DateRangePickerInput.js +0 -128
- package/modern/DateRangePicker/DateRangePickerToolbar.js +0 -65
- package/modern/DateRangePicker/DateRangePickerView.js +0 -177
- package/modern/DateRangePicker/DateRangePickerViewDesktop.js +0 -159
- package/modern/DateRangePicker/DateRangePickerViewMobile.js +0 -62
- package/modern/DateRangePicker/RangeTypes.js +0 -1
- package/modern/DateRangePicker/date-range-manager.js +0 -43
- package/modern/DateTimePicker/DateTimePicker.js +0 -547
- package/modern/DateTimePicker/DateTimePickerTabs.js +0 -87
- package/modern/DateTimePicker/DateTimePickerToolbar.js +0 -139
- package/modern/DateTimePicker/shared.js +0 -58
- package/modern/DesktopDatePicker/DesktopDatePicker.js +0 -444
- package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -518
- package/modern/DesktopTimePicker/DesktopTimePicker.js +0 -366
- package/modern/LocalizationProvider/LocalizationProvider.js +0 -108
- package/modern/MobileDatePicker/MobileDatePicker.js +0 -449
- package/modern/MobileDateTimePicker/MobileDateTimePicker.js +0 -529
- package/modern/MobileTimePicker/MobileTimePicker.js +0 -377
- package/modern/MonthPicker/MonthPicker.js +0 -182
- package/modern/MonthPicker/PickersMonth.js +0 -72
- package/modern/PickersDay/PickersDay.js +0 -396
- package/modern/StaticDatePicker/StaticDatePicker.js +0 -406
- package/modern/StaticDateTimePicker/StaticDateTimePicker.js +0 -486
- package/modern/StaticTimePicker/StaticTimePicker.js +0 -333
- package/modern/TimePicker/TimePicker.js +0 -395
- package/modern/TimePicker/TimePickerToolbar.js +0 -172
- package/modern/TimePicker/shared.js +0 -45
- package/modern/YearPicker/PickersYear.js +0 -112
- package/modern/YearPicker/YearPicker.js +0 -251
- package/modern/YearPicker/yearPickerClasses.js +0 -6
- package/modern/internal/pickers/KeyboardDateInput.js +0 -59
- package/modern/internal/pickers/Picker/Picker.js +0 -130
- package/modern/internal/pickers/Picker/PickerView.js +0 -11
- package/modern/internal/pickers/PickersArrowSwitcher.js +0 -91
- package/modern/internal/pickers/PickersModalDialog.js +0 -78
- package/modern/internal/pickers/PickersPopper.js +0 -267
- package/modern/internal/pickers/PickersToolbar.js +0 -88
- package/modern/internal/pickers/PickersToolbarButton.js +0 -39
- package/modern/internal/pickers/PickersToolbarText.js +0 -36
- package/modern/internal/pickers/PureDateInput.js +0 -51
- package/modern/internal/pickers/constants/dimensions.js +0 -4
- package/modern/internal/pickers/constants/prop-types.js +0 -1
- package/modern/internal/pickers/date-time-utils.js +0 -28
- package/modern/internal/pickers/date-utils.js +0 -138
- package/modern/internal/pickers/hooks/date-helpers-hooks.js +0 -37
- package/modern/internal/pickers/hooks/useIsLandscape.js +0 -43
- package/modern/internal/pickers/hooks/useMaskedInput.js +0 -93
- package/modern/internal/pickers/hooks/useOpenState.js +0 -38
- package/modern/internal/pickers/hooks/usePickerState.js +0 -117
- package/modern/internal/pickers/hooks/useUtils.js +0 -25
- package/modern/internal/pickers/hooks/useValidation.js +0 -44
- package/modern/internal/pickers/hooks/useViews.js +0 -48
- package/modern/internal/pickers/test-utils.js +0 -91
- package/modern/internal/pickers/text-field-helper.js +0 -66
- package/modern/internal/pickers/time-utils.js +0 -68
- package/modern/internal/pickers/typings/BasePicker.js +0 -1
- package/modern/internal/pickers/typings/Views.js +0 -1
- package/modern/internal/pickers/typings/helpers.js +0 -1
- package/modern/internal/pickers/utils.js +0 -36
- package/modern/internal/pickers/wrappers/DesktopTooltipWrapper.js +0 -53
- package/modern/internal/pickers/wrappers/DesktopWrapper.js +0 -45
- package/modern/internal/pickers/wrappers/MobileWrapper.js +0 -50
- package/modern/internal/pickers/wrappers/PickerStaticWrapper.js +0 -63
- package/modern/internal/pickers/wrappers/ResponsiveWrapper.js +0 -44
- package/modern/internal/pickers/wrappers/WrapperProps.js +0 -1
- package/modern/internal/pickers/wrappers/WrapperVariantContext.js +0 -12
- package/node/CalendarPicker/CalendarPicker.js +0 -377
- package/node/CalendarPicker/PickersCalendar.js +0 -166
- package/node/CalendarPicker/PickersCalendarHeader.js +0 -189
- package/node/CalendarPicker/PickersFadeTransitionGroup.js +0 -65
- package/node/CalendarPicker/PickersSlideTransition.js +0 -127
- package/node/CalendarPicker/shared.js +0 -5
- package/node/CalendarPicker/useCalendarState.js +0 -131
- package/node/CalendarPickerSkeleton/CalendarPickerSkeleton.js +0 -177
- package/node/ClockPicker/Clock.js +0 -290
- package/node/ClockPicker/ClockNumber.js +0 -95
- package/node/ClockPicker/ClockNumbers.js +0 -100
- package/node/ClockPicker/ClockPicker.js +0 -428
- package/node/ClockPicker/ClockPickerStandalone.js +0 -68
- package/node/ClockPicker/ClockPointer.js +0 -123
- package/node/ClockPicker/shared.js +0 -70
- package/node/DatePicker/DatePicker.js +0 -490
- package/node/DatePicker/DatePickerToolbar.js +0 -106
- package/node/DatePicker/shared.js +0 -73
- package/node/DateRangePicker/DateRangePickerInput.js +0 -155
- package/node/DateRangePicker/DateRangePickerToolbar.js +0 -86
- package/node/DateRangePicker/DateRangePickerView.js +0 -205
- package/node/DateRangePicker/DateRangePickerViewDesktop.js +0 -184
- package/node/DateRangePicker/DateRangePickerViewMobile.js +0 -84
- package/node/DateRangePicker/RangeTypes.js +0 -5
- package/node/DateRangePicker/date-range-manager.js +0 -52
- package/node/DateTimePicker/DateTimePicker.js +0 -568
- package/node/DateTimePicker/DateTimePickerTabs.js +0 -106
- package/node/DateTimePicker/DateTimePickerToolbar.js +0 -163
- package/node/DateTimePicker/shared.js +0 -72
- package/node/DesktopDatePicker/DesktopDatePicker.js +0 -469
- package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -543
- package/node/DesktopTimePicker/DesktopTimePicker.js +0 -391
- package/node/LocalizationProvider/LocalizationProvider.js +0 -126
- package/node/MobileDatePicker/MobileDatePicker.js +0 -475
- package/node/MobileDateTimePicker/MobileDateTimePicker.js +0 -555
- package/node/MobileTimePicker/MobileTimePicker.js +0 -403
- package/node/MonthPicker/MonthPicker.js +0 -209
- package/node/MonthPicker/PickersMonth.js +0 -96
- package/node/PickersDay/PickersDay.js +0 -429
- package/node/StaticDatePicker/StaticDatePicker.js +0 -431
- package/node/StaticDateTimePicker/StaticDateTimePicker.js +0 -511
- package/node/StaticTimePicker/StaticTimePicker.js +0 -357
- package/node/TimePicker/TimePicker.js +0 -416
- package/node/TimePicker/TimePickerToolbar.js +0 -200
- package/node/TimePicker/shared.js +0 -59
- package/node/YearPicker/PickersYear.js +0 -136
- package/node/YearPicker/YearPicker.js +0 -275
- package/node/YearPicker/yearPickerClasses.js +0 -17
- package/node/internal/pickers/KeyboardDateInput.js +0 -85
- package/node/internal/pickers/Picker/Picker.js +0 -156
- package/node/internal/pickers/Picker/PickerView.js +0 -21
- package/node/internal/pickers/PickersArrowSwitcher.js +0 -113
- package/node/internal/pickers/PickersModalDialog.js +0 -100
- package/node/internal/pickers/PickersPopper.js +0 -291
- package/node/internal/pickers/PickersToolbar.js +0 -112
- package/node/internal/pickers/PickersToolbarButton.js +0 -60
- package/node/internal/pickers/PickersToolbarText.js +0 -58
- package/node/internal/pickers/PureDateInput.js +0 -70
- package/node/internal/pickers/constants/dimensions.js +0 -14
- package/node/internal/pickers/constants/prop-types.js +0 -5
- package/node/internal/pickers/date-time-utils.js +0 -40
- package/node/internal/pickers/date-utils.js +0 -170
- package/node/internal/pickers/hooks/date-helpers-hooks.js +0 -55
- package/node/internal/pickers/hooks/useIsLandscape.js +0 -59
- package/node/internal/pickers/hooks/useMaskedInput.js +0 -115
- package/node/internal/pickers/hooks/useOpenState.js +0 -53
- package/node/internal/pickers/hooks/usePickerState.js +0 -134
- package/node/internal/pickers/hooks/useUtils.js +0 -42
- package/node/internal/pickers/hooks/useValidation.js +0 -65
- package/node/internal/pickers/hooks/useViews.js +0 -64
- package/node/internal/pickers/test-utils.js +0 -122
- package/node/internal/pickers/text-field-helper.js +0 -86
- package/node/internal/pickers/time-utils.js +0 -92
- package/node/internal/pickers/typings/BasePicker.js +0 -5
- package/node/internal/pickers/typings/Views.js +0 -5
- package/node/internal/pickers/typings/helpers.js +0 -5
- package/node/internal/pickers/utils.js +0 -58
- package/node/internal/pickers/wrappers/DesktopTooltipWrapper.js +0 -74
- package/node/internal/pickers/wrappers/DesktopWrapper.js +0 -63
- package/node/internal/pickers/wrappers/MobileWrapper.js +0 -68
- package/node/internal/pickers/wrappers/PickerStaticWrapper.js +0 -88
- package/node/internal/pickers/wrappers/ResponsiveWrapper.js +0 -64
- package/node/internal/pickers/wrappers/WrapperProps.js +0 -5
- package/node/internal/pickers/wrappers/WrapperVariantContext.js +0 -25
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
export const findClosestEnabledDate = ({
|
|
2
|
-
date,
|
|
3
|
-
disableFuture,
|
|
4
|
-
disablePast,
|
|
5
|
-
maxDate,
|
|
6
|
-
minDate,
|
|
7
|
-
shouldDisableDate,
|
|
8
|
-
utils
|
|
9
|
-
}) => {
|
|
10
|
-
const today = utils.startOfDay(utils.date());
|
|
11
|
-
|
|
12
|
-
if (disablePast && utils.isBefore(minDate, today)) {
|
|
13
|
-
minDate = today;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
if (disableFuture && utils.isAfter(maxDate, today)) {
|
|
17
|
-
maxDate = today;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
let forward = date;
|
|
21
|
-
let backward = date;
|
|
22
|
-
|
|
23
|
-
if (utils.isBefore(date, minDate)) {
|
|
24
|
-
forward = utils.date(minDate);
|
|
25
|
-
backward = null;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
if (utils.isAfter(date, maxDate)) {
|
|
29
|
-
if (backward) {
|
|
30
|
-
backward = utils.date(maxDate);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
forward = null;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
while (forward || backward) {
|
|
37
|
-
if (forward && utils.isAfter(forward, maxDate)) {
|
|
38
|
-
forward = null;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
if (backward && utils.isBefore(backward, minDate)) {
|
|
42
|
-
backward = null;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
if (forward) {
|
|
46
|
-
if (!shouldDisableDate(forward)) {
|
|
47
|
-
return forward;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
forward = utils.addDays(forward, 1);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
if (backward) {
|
|
54
|
-
if (!shouldDisableDate(backward)) {
|
|
55
|
-
return backward;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
backward = utils.addDays(backward, -1);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
return today;
|
|
63
|
-
};
|
|
64
|
-
export function parsePickerInputValue(utils, value) {
|
|
65
|
-
const parsedValue = utils.date(value);
|
|
66
|
-
return utils.isValid(parsedValue) ? parsedValue : null;
|
|
67
|
-
}
|
|
68
|
-
export function parseRangeInputValue(utils, value = [null, null]) {
|
|
69
|
-
return value.map(date => !utils.isValid(date) || date === null ? null : utils.startOfDay(utils.date(date)));
|
|
70
|
-
}
|
|
71
|
-
export const isRangeValid = (utils, range) => {
|
|
72
|
-
return Boolean(range && range[0] && range[1] && !utils.isBefore(range[1], range[0]));
|
|
73
|
-
};
|
|
74
|
-
export const isWithinRange = (utils, day, range) => {
|
|
75
|
-
return isRangeValid(utils, range) && utils.isWithinRange(day, range);
|
|
76
|
-
};
|
|
77
|
-
export const isStartOfRange = (utils, day, range) => {
|
|
78
|
-
return isRangeValid(utils, range) && utils.isSameDay(day, range[0]);
|
|
79
|
-
};
|
|
80
|
-
export const isEndOfRange = (utils, day, range) => {
|
|
81
|
-
return isRangeValid(utils, range) && utils.isSameDay(day, range[1]);
|
|
82
|
-
};
|
|
83
|
-
export const validateDate = (utils, value, {
|
|
84
|
-
disablePast,
|
|
85
|
-
disableFuture,
|
|
86
|
-
minDate,
|
|
87
|
-
maxDate,
|
|
88
|
-
shouldDisableDate
|
|
89
|
-
}) => {
|
|
90
|
-
const now = utils.date();
|
|
91
|
-
const date = utils.date(value);
|
|
92
|
-
|
|
93
|
-
if (date === null) {
|
|
94
|
-
return null;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
switch (true) {
|
|
98
|
-
case !utils.isValid(value):
|
|
99
|
-
return 'invalidDate';
|
|
100
|
-
|
|
101
|
-
case Boolean(shouldDisableDate && shouldDisableDate(date)):
|
|
102
|
-
return 'shouldDisableDate';
|
|
103
|
-
|
|
104
|
-
case Boolean(disableFuture && utils.isAfterDay(date, now)):
|
|
105
|
-
return 'disableFuture';
|
|
106
|
-
|
|
107
|
-
case Boolean(disablePast && utils.isBeforeDay(date, now)):
|
|
108
|
-
return 'disablePast';
|
|
109
|
-
|
|
110
|
-
case Boolean(minDate && utils.isBeforeDay(date, minDate)):
|
|
111
|
-
return 'minDate';
|
|
112
|
-
|
|
113
|
-
case Boolean(maxDate && utils.isAfterDay(date, maxDate)):
|
|
114
|
-
return 'maxDate';
|
|
115
|
-
|
|
116
|
-
default:
|
|
117
|
-
return null;
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
export const validateDateRange = (utils, value, dateValidationProps) => {
|
|
121
|
-
const [start, end] = value; // for partial input
|
|
122
|
-
|
|
123
|
-
if (start === null || end === null) {
|
|
124
|
-
return [null, null];
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
const dateValidations = [validateDate(utils, start, dateValidationProps), validateDate(utils, end, dateValidationProps)];
|
|
128
|
-
|
|
129
|
-
if (dateValidations[0] || dateValidations[1]) {
|
|
130
|
-
return dateValidations;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
if (!isRangeValid(utils, [utils.date(start), utils.date(end)])) {
|
|
134
|
-
return ['invalidRange', 'invalidRange'];
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
return [null, null];
|
|
138
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { useUtils } from './useUtils';
|
|
3
|
-
import { getMeridiem, convertToMeridiem } from '../time-utils';
|
|
4
|
-
export function useNextMonthDisabled(month, {
|
|
5
|
-
disableFuture,
|
|
6
|
-
maxDate
|
|
7
|
-
}) {
|
|
8
|
-
const utils = useUtils();
|
|
9
|
-
return React.useMemo(() => {
|
|
10
|
-
const now = utils.date();
|
|
11
|
-
const lastEnabledMonth = utils.startOfMonth(disableFuture && utils.isBefore(now, maxDate) ? now : maxDate);
|
|
12
|
-
return !utils.isAfter(lastEnabledMonth, month);
|
|
13
|
-
}, [disableFuture, maxDate, month, utils]);
|
|
14
|
-
}
|
|
15
|
-
export function usePreviousMonthDisabled(month, {
|
|
16
|
-
disablePast,
|
|
17
|
-
minDate
|
|
18
|
-
}) {
|
|
19
|
-
const utils = useUtils();
|
|
20
|
-
return React.useMemo(() => {
|
|
21
|
-
const now = utils.date();
|
|
22
|
-
const firstEnabledMonth = utils.startOfMonth(disablePast && utils.isAfter(now, minDate) ? now : minDate);
|
|
23
|
-
return !utils.isBefore(firstEnabledMonth, month);
|
|
24
|
-
}, [disablePast, minDate, month, utils]);
|
|
25
|
-
}
|
|
26
|
-
export function useMeridiemMode(date, ampm, onChange) {
|
|
27
|
-
const utils = useUtils();
|
|
28
|
-
const meridiemMode = getMeridiem(date, utils);
|
|
29
|
-
const handleMeridiemChange = React.useCallback(mode => {
|
|
30
|
-
const timeWithMeridiem = convertToMeridiem(date, mode, Boolean(ampm), utils);
|
|
31
|
-
onChange(timeWithMeridiem, 'partial');
|
|
32
|
-
}, [ampm, date, onChange, utils]);
|
|
33
|
-
return {
|
|
34
|
-
meridiemMode,
|
|
35
|
-
handleMeridiemChange
|
|
36
|
-
};
|
|
37
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';
|
|
3
|
-
import { arrayIncludes } from '../utils';
|
|
4
|
-
|
|
5
|
-
function getOrientation() {
|
|
6
|
-
if (typeof window === 'undefined') {
|
|
7
|
-
return 'portrait';
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
if (window.screen && window.screen.orientation && window.screen.orientation.angle) {
|
|
11
|
-
return Math.abs(window.screen.orientation.angle) === 90 ? 'landscape' : 'portrait';
|
|
12
|
-
} // Support IOS safari
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
if (window.orientation) {
|
|
16
|
-
return Math.abs(Number(window.orientation)) === 90 ? 'landscape' : 'portrait';
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
return 'portrait';
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function useIsLandscape(views, customOrientation) {
|
|
23
|
-
const [orientation, setOrientation] = React.useState(getOrientation);
|
|
24
|
-
useEnhancedEffect(() => {
|
|
25
|
-
const eventHandler = () => {
|
|
26
|
-
setOrientation(getOrientation());
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
window.addEventListener('orientationchange', eventHandler);
|
|
30
|
-
return () => {
|
|
31
|
-
window.removeEventListener('orientationchange', eventHandler);
|
|
32
|
-
};
|
|
33
|
-
}, []);
|
|
34
|
-
|
|
35
|
-
if (arrayIncludes(views, ['hours', 'minutes', 'seconds'])) {
|
|
36
|
-
// could not display 13:34:44 in landscape mode
|
|
37
|
-
return false;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const orientationToUse = customOrientation || orientation;
|
|
41
|
-
return orientationToUse === 'landscape';
|
|
42
|
-
}
|
|
43
|
-
export default useIsLandscape;
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { useRifm } from 'rifm';
|
|
4
|
-
import { useUtils } from './useUtils';
|
|
5
|
-
import { createDelegatedEventHandler } from '../utils';
|
|
6
|
-
import { maskedDateFormatter, getDisplayDate, checkMaskIsValidForCurrentFormat } from '../text-field-helper';
|
|
7
|
-
export function useMaskedInput({
|
|
8
|
-
acceptRegex = /[\d]/gi,
|
|
9
|
-
disabled,
|
|
10
|
-
disableMaskedInput,
|
|
11
|
-
ignoreInvalidInputs,
|
|
12
|
-
inputFormat,
|
|
13
|
-
inputProps,
|
|
14
|
-
label,
|
|
15
|
-
mask,
|
|
16
|
-
onChange,
|
|
17
|
-
rawValue,
|
|
18
|
-
readOnly,
|
|
19
|
-
rifmFormatter,
|
|
20
|
-
TextFieldProps,
|
|
21
|
-
validationError
|
|
22
|
-
}) {
|
|
23
|
-
const utils = useUtils();
|
|
24
|
-
const [isFocused, setIsFocused] = React.useState(false);
|
|
25
|
-
const formatHelperText = utils.getFormatHelperText(inputFormat);
|
|
26
|
-
const shouldUseMaskedInput = React.useMemo(() => {
|
|
27
|
-
// formatting of dates is a quite slow thing, so do not make useless .format calls
|
|
28
|
-
if (!mask || disableMaskedInput) {
|
|
29
|
-
return false;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
return checkMaskIsValidForCurrentFormat(mask, inputFormat, acceptRegex, utils);
|
|
33
|
-
}, [acceptRegex, disableMaskedInput, inputFormat, mask, utils]);
|
|
34
|
-
const formatter = React.useMemo(() => shouldUseMaskedInput && mask ? maskedDateFormatter(mask, acceptRegex) : st => st, [acceptRegex, mask, shouldUseMaskedInput]); // TODO: Implement with controlled vs unctrolled `rawValue`
|
|
35
|
-
|
|
36
|
-
const currentInputValue = getDisplayDate(utils, rawValue, inputFormat);
|
|
37
|
-
const [innerInputValue, setInnerInputValue] = React.useState(currentInputValue);
|
|
38
|
-
const previousInputValueRef = React.useRef(currentInputValue);
|
|
39
|
-
React.useEffect(() => {
|
|
40
|
-
previousInputValueRef.current = currentInputValue;
|
|
41
|
-
}, [currentInputValue]);
|
|
42
|
-
const notTyping = !isFocused;
|
|
43
|
-
const valueChanged = previousInputValueRef.current !== currentInputValue; // Update the input value only if the value changed outside of typing
|
|
44
|
-
|
|
45
|
-
if (notTyping && valueChanged && (rawValue === null || utils.isValid(rawValue))) {
|
|
46
|
-
if (currentInputValue !== innerInputValue) {
|
|
47
|
-
setInnerInputValue(currentInputValue);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const handleChange = text => {
|
|
52
|
-
const finalString = text === '' || text === mask ? '' : text;
|
|
53
|
-
setInnerInputValue(finalString);
|
|
54
|
-
const date = finalString === null ? null : utils.parse(finalString, inputFormat);
|
|
55
|
-
|
|
56
|
-
if (ignoreInvalidInputs && !utils.isValid(date)) {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
onChange(date, finalString || undefined);
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
const rifmProps = useRifm({
|
|
64
|
-
value: innerInputValue,
|
|
65
|
-
onChange: handleChange,
|
|
66
|
-
format: rifmFormatter || formatter
|
|
67
|
-
});
|
|
68
|
-
const inputStateArgs = shouldUseMaskedInput ? rifmProps : {
|
|
69
|
-
value: innerInputValue,
|
|
70
|
-
onChange: event => {
|
|
71
|
-
handleChange(event.currentTarget.value);
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
return _extends({
|
|
75
|
-
label,
|
|
76
|
-
disabled,
|
|
77
|
-
error: validationError,
|
|
78
|
-
inputProps: _extends({}, inputStateArgs, {
|
|
79
|
-
disabled,
|
|
80
|
-
placeholder: formatHelperText,
|
|
81
|
-
readOnly,
|
|
82
|
-
type: shouldUseMaskedInput ? 'tel' : 'text'
|
|
83
|
-
}, inputProps, {
|
|
84
|
-
onFocus: createDelegatedEventHandler(() => {
|
|
85
|
-
setIsFocused(true);
|
|
86
|
-
}, inputProps?.onFocus),
|
|
87
|
-
onBlur: createDelegatedEventHandler(() => {
|
|
88
|
-
setIsFocused(false);
|
|
89
|
-
}, inputProps?.onBlur)
|
|
90
|
-
})
|
|
91
|
-
}, TextFieldProps);
|
|
92
|
-
}
|
|
93
|
-
export default useMaskedInput;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
export function useOpenState({
|
|
3
|
-
open,
|
|
4
|
-
onOpen,
|
|
5
|
-
onClose
|
|
6
|
-
}) {
|
|
7
|
-
const isControllingOpenProp = React.useRef(typeof open === 'boolean').current;
|
|
8
|
-
const [openState, setIsOpenState] = React.useState(false); // It is required to update inner state in useEffect in order to avoid situation when
|
|
9
|
-
// Our component is not mounted yet, but `open` state is set to `true` (e.g. initially opened)
|
|
10
|
-
|
|
11
|
-
React.useEffect(() => {
|
|
12
|
-
if (isControllingOpenProp) {
|
|
13
|
-
if (typeof open !== 'boolean') {
|
|
14
|
-
throw new Error('You must not mix controlling and uncontrolled mode for `open` prop');
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
setIsOpenState(open);
|
|
18
|
-
}
|
|
19
|
-
}, [isControllingOpenProp, open]);
|
|
20
|
-
const setIsOpen = React.useCallback(newIsOpen => {
|
|
21
|
-
if (!isControllingOpenProp) {
|
|
22
|
-
setIsOpenState(newIsOpen);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
if (newIsOpen && onOpen) {
|
|
26
|
-
onOpen();
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
if (!newIsOpen && onClose) {
|
|
30
|
-
onClose();
|
|
31
|
-
}
|
|
32
|
-
}, [isControllingOpenProp, onOpen, onClose]);
|
|
33
|
-
return {
|
|
34
|
-
isOpen: openState,
|
|
35
|
-
setIsOpen
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
export default useOpenState;
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { useOpenState } from './useOpenState';
|
|
4
|
-
import { useUtils } from './useUtils';
|
|
5
|
-
export function usePickerState(props, valueManager) {
|
|
6
|
-
const {
|
|
7
|
-
disableCloseOnSelect,
|
|
8
|
-
onAccept,
|
|
9
|
-
onChange,
|
|
10
|
-
value
|
|
11
|
-
} = props;
|
|
12
|
-
const utils = useUtils();
|
|
13
|
-
const {
|
|
14
|
-
isOpen,
|
|
15
|
-
setIsOpen
|
|
16
|
-
} = useOpenState(props);
|
|
17
|
-
|
|
18
|
-
function initDraftableDate(date) {
|
|
19
|
-
return {
|
|
20
|
-
committed: date,
|
|
21
|
-
draft: date
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const parsedDateValue = valueManager.parseInput(utils, value);
|
|
26
|
-
const [draftState, dispatch] = React.useReducer((state, action) => {
|
|
27
|
-
switch (action.type) {
|
|
28
|
-
case 'reset':
|
|
29
|
-
return initDraftableDate(action.payload);
|
|
30
|
-
|
|
31
|
-
case 'update':
|
|
32
|
-
return _extends({}, state, {
|
|
33
|
-
draft: action.payload
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
default:
|
|
37
|
-
return state;
|
|
38
|
-
}
|
|
39
|
-
}, parsedDateValue, initDraftableDate);
|
|
40
|
-
|
|
41
|
-
if (!valueManager.areValuesEqual(utils, draftState.committed, parsedDateValue)) {
|
|
42
|
-
dispatch({
|
|
43
|
-
type: 'reset',
|
|
44
|
-
payload: parsedDateValue
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
const [initialDate, setInitialDate] = React.useState(draftState.committed); // Mobile keyboard view is a special case.
|
|
49
|
-
// When it's open picker should work like closed, cause we are just showing text field
|
|
50
|
-
|
|
51
|
-
const [isMobileKeyboardViewOpen, setMobileKeyboardViewOpen] = React.useState(false);
|
|
52
|
-
const acceptDate = React.useCallback((acceptedDate, needClosePicker) => {
|
|
53
|
-
onChange(acceptedDate);
|
|
54
|
-
|
|
55
|
-
if (needClosePicker) {
|
|
56
|
-
setIsOpen(false);
|
|
57
|
-
setInitialDate(acceptedDate);
|
|
58
|
-
|
|
59
|
-
if (onAccept) {
|
|
60
|
-
onAccept(acceptedDate);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}, [onAccept, onChange, setIsOpen]);
|
|
64
|
-
const wrapperProps = React.useMemo(() => ({
|
|
65
|
-
open: isOpen,
|
|
66
|
-
onClear: () => acceptDate(valueManager.emptyValue, true),
|
|
67
|
-
onAccept: () => acceptDate(draftState.draft, true),
|
|
68
|
-
onDismiss: () => acceptDate(initialDate, true),
|
|
69
|
-
onSetToday: () => {
|
|
70
|
-
const now = utils.date();
|
|
71
|
-
dispatch({
|
|
72
|
-
type: 'update',
|
|
73
|
-
payload: now
|
|
74
|
-
});
|
|
75
|
-
acceptDate(now, !disableCloseOnSelect);
|
|
76
|
-
}
|
|
77
|
-
}), [acceptDate, disableCloseOnSelect, isOpen, utils, draftState.draft, valueManager.emptyValue, initialDate]);
|
|
78
|
-
const pickerProps = React.useMemo(() => ({
|
|
79
|
-
date: draftState.draft,
|
|
80
|
-
isMobileKeyboardViewOpen,
|
|
81
|
-
toggleMobileKeyboardView: () => setMobileKeyboardViewOpen(!isMobileKeyboardViewOpen),
|
|
82
|
-
onDateChange: (newDate, wrapperVariant, selectionState = 'partial') => {
|
|
83
|
-
dispatch({
|
|
84
|
-
type: 'update',
|
|
85
|
-
payload: newDate
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
if (selectionState === 'partial') {
|
|
89
|
-
acceptDate(newDate, false);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
if (selectionState === 'finish') {
|
|
93
|
-
const shouldCloseOnSelect = !(disableCloseOnSelect ?? wrapperVariant === 'mobile');
|
|
94
|
-
acceptDate(newDate, shouldCloseOnSelect);
|
|
95
|
-
} // if selectionState === "shallow" do nothing (we already update the draft state)
|
|
96
|
-
|
|
97
|
-
}
|
|
98
|
-
}), [acceptDate, disableCloseOnSelect, isMobileKeyboardViewOpen, draftState.draft]);
|
|
99
|
-
const inputProps = React.useMemo(() => ({
|
|
100
|
-
onChange,
|
|
101
|
-
open: isOpen,
|
|
102
|
-
rawValue: value,
|
|
103
|
-
openPicker: () => setIsOpen(true)
|
|
104
|
-
}), [onChange, isOpen, value, setIsOpen]);
|
|
105
|
-
const pickerState = {
|
|
106
|
-
pickerProps,
|
|
107
|
-
inputProps,
|
|
108
|
-
wrapperProps
|
|
109
|
-
};
|
|
110
|
-
React.useDebugValue(pickerState, () => ({
|
|
111
|
-
MuiPickerState: {
|
|
112
|
-
pickerDraft: draftState,
|
|
113
|
-
other: pickerState
|
|
114
|
-
}
|
|
115
|
-
}));
|
|
116
|
-
return pickerState;
|
|
117
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { formatMuiErrorMessage as _formatMuiErrorMessage } from "@mui/utils";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { MuiPickersAdapterContext } from '../../../LocalizationProvider'; // Required for babel https://github.com/vercel/next.js/issues/7882. Replace with `export type` in future
|
|
4
|
-
|
|
5
|
-
function useLocalizationContext() {
|
|
6
|
-
const localization = React.useContext(MuiPickersAdapterContext);
|
|
7
|
-
|
|
8
|
-
if (localization === null) {
|
|
9
|
-
throw new Error(process.env.NODE_ENV !== "production" ? `Can not find utils in context. It looks like you forgot to wrap your component in LocalizationProvider, or pass dateAdapter prop directly.` : _formatMuiErrorMessage(13));
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
return localization;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export function useUtils() {
|
|
16
|
-
return useLocalizationContext().utils;
|
|
17
|
-
}
|
|
18
|
-
export function useDefaultDates() {
|
|
19
|
-
return useLocalizationContext().defaultDates;
|
|
20
|
-
}
|
|
21
|
-
export function useNow() {
|
|
22
|
-
const utils = useUtils();
|
|
23
|
-
const now = React.useRef(utils.date());
|
|
24
|
-
return now.current;
|
|
25
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { useUtils } from './useUtils';
|
|
3
|
-
import { validateDate, validateDateRange } from '../date-utils';
|
|
4
|
-
import { validateDateTime } from '../date-time-utils';
|
|
5
|
-
import { validateTime } from '../time-utils';
|
|
6
|
-
|
|
7
|
-
function isSameDateOrTimeError(a, b) {
|
|
8
|
-
return a === b;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
function isSameDateRangeError(a, b) {
|
|
12
|
-
return b !== null && a[1] === b[1] && a[0] === b[0];
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
function useValidation(props, validate, isSameError = isSameDateOrTimeError) {
|
|
16
|
-
const {
|
|
17
|
-
value,
|
|
18
|
-
onError
|
|
19
|
-
} = props;
|
|
20
|
-
const utils = useUtils();
|
|
21
|
-
const previousValidationErrorRef = React.useRef(null);
|
|
22
|
-
const validationError = validate(utils, value, props);
|
|
23
|
-
React.useEffect(() => {
|
|
24
|
-
if (onError && !isSameError(validationError, previousValidationErrorRef.current)) {
|
|
25
|
-
onError(validationError, value);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
previousValidationErrorRef.current = validationError;
|
|
29
|
-
}, [isSameError, onError, previousValidationErrorRef, validationError, value]);
|
|
30
|
-
return validationError;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export function useTimeValidation(props) {
|
|
34
|
-
return useValidation(props, validateTime, isSameDateOrTimeError);
|
|
35
|
-
}
|
|
36
|
-
export function useDateValidation(props) {
|
|
37
|
-
return useValidation(props, validateDate, isSameDateOrTimeError);
|
|
38
|
-
}
|
|
39
|
-
export function useDateTimeValidation(props) {
|
|
40
|
-
return useValidation(props, validateDateTime, isSameDateOrTimeError);
|
|
41
|
-
}
|
|
42
|
-
export function useDateRangeValidation(props) {
|
|
43
|
-
return useValidation(props, validateDateRange, isSameDateRangeError);
|
|
44
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { useControlled } from '@mui/material/utils';
|
|
3
|
-
import { arrayIncludes } from '../utils';
|
|
4
|
-
export function useViews({
|
|
5
|
-
onChange,
|
|
6
|
-
onViewChange,
|
|
7
|
-
openTo,
|
|
8
|
-
view,
|
|
9
|
-
views
|
|
10
|
-
}) {
|
|
11
|
-
const [openView, setOpenView] = useControlled({
|
|
12
|
-
name: 'Picker',
|
|
13
|
-
state: 'view',
|
|
14
|
-
controlled: view,
|
|
15
|
-
default: openTo && arrayIncludes(views, openTo) ? openTo : views[0]
|
|
16
|
-
});
|
|
17
|
-
const previousView = views[views.indexOf(openView) - 1] ?? null;
|
|
18
|
-
const nextView = views[views.indexOf(openView) + 1] ?? null;
|
|
19
|
-
const changeView = React.useCallback(newView => {
|
|
20
|
-
setOpenView(newView);
|
|
21
|
-
|
|
22
|
-
if (onViewChange) {
|
|
23
|
-
onViewChange(newView);
|
|
24
|
-
}
|
|
25
|
-
}, [setOpenView, onViewChange]);
|
|
26
|
-
const openNext = React.useCallback(() => {
|
|
27
|
-
if (nextView) {
|
|
28
|
-
changeView(nextView);
|
|
29
|
-
}
|
|
30
|
-
}, [nextView, changeView]);
|
|
31
|
-
const handleChangeAndOpenNext = React.useCallback((date, currentViewSelectionState) => {
|
|
32
|
-
const isSelectionFinishedOnCurrentView = currentViewSelectionState === 'finish';
|
|
33
|
-
const globalSelectionState = isSelectionFinishedOnCurrentView && Boolean(nextView) ? 'partial' : currentViewSelectionState;
|
|
34
|
-
onChange(date, globalSelectionState);
|
|
35
|
-
|
|
36
|
-
if (isSelectionFinishedOnCurrentView) {
|
|
37
|
-
openNext();
|
|
38
|
-
}
|
|
39
|
-
}, [nextView, onChange, openNext]);
|
|
40
|
-
return {
|
|
41
|
-
handleChangeAndOpenNext,
|
|
42
|
-
nextView,
|
|
43
|
-
previousView,
|
|
44
|
-
openNext,
|
|
45
|
-
openView,
|
|
46
|
-
setOpenView: changeView
|
|
47
|
-
};
|
|
48
|
-
}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["locale"];
|
|
4
|
-
import * as React from 'react';
|
|
5
|
-
import { parseISO } from 'date-fns';
|
|
6
|
-
import { createRenderer, fireEvent, screen } from 'test/utils';
|
|
7
|
-
import AdapterDateFns from '@mui/lab/AdapterDateFns';
|
|
8
|
-
import LocalizationProvider from '@mui/lab/LocalizationProvider'; // TODO make possible to pass here any utils using cli
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Wrapper around `@date-io/date-fns` that resolves https://github.com/dmtrKovalenko/date-io/issues/479.
|
|
12
|
-
* We're not using `adapter.date` in the implementation which means the implementation is safe.
|
|
13
|
-
* But we do use it in tests where usage of ISO dates without timezone is problematic
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
-
export class AdapterClassToUse extends AdapterDateFns {
|
|
18
|
-
constructor(...args) {
|
|
19
|
-
super(...args);
|
|
20
|
-
|
|
21
|
-
this.date = value => {
|
|
22
|
-
if (typeof value === 'string') {
|
|
23
|
-
return parseISO(value);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
if (typeof value === 'undefined') {
|
|
27
|
-
return new Date();
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
if (value === null) {
|
|
31
|
-
// @ts-expect-error AdapterDateFns#date says it returns NotNullable but that's not true
|
|
32
|
-
return null;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return new Date(value);
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
export const adapterToUse = new AdapterClassToUse();
|
|
41
|
-
export const FakeTransitionComponent = /*#__PURE__*/React.forwardRef(function FakeTransitionComponent({
|
|
42
|
-
children
|
|
43
|
-
}, ref) {
|
|
44
|
-
// set tabIndex in case it is used as a child of <TrapFocus />
|
|
45
|
-
return /*#__PURE__*/_jsx("div", {
|
|
46
|
-
ref: ref,
|
|
47
|
-
tabIndex: -1,
|
|
48
|
-
children: children
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
export function wrapPickerMount(mount) {
|
|
52
|
-
return node => mount( /*#__PURE__*/_jsx(LocalizationProvider, {
|
|
53
|
-
dateAdapter: AdapterClassToUse,
|
|
54
|
-
children: node
|
|
55
|
-
}));
|
|
56
|
-
}
|
|
57
|
-
export function createPickerRenderer(_ref = {}) {
|
|
58
|
-
let {
|
|
59
|
-
locale
|
|
60
|
-
} = _ref,
|
|
61
|
-
createRendererOptions = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
62
|
-
|
|
63
|
-
const {
|
|
64
|
-
clock,
|
|
65
|
-
render: clientRender
|
|
66
|
-
} = createRenderer(createRendererOptions);
|
|
67
|
-
|
|
68
|
-
function Wrapper({
|
|
69
|
-
children
|
|
70
|
-
}) {
|
|
71
|
-
return /*#__PURE__*/_jsx(LocalizationProvider, {
|
|
72
|
-
locale: locale,
|
|
73
|
-
dateAdapter: AdapterClassToUse,
|
|
74
|
-
children: children
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return {
|
|
79
|
-
clock,
|
|
80
|
-
|
|
81
|
-
render(node, options) {
|
|
82
|
-
return clientRender(node, _extends({}, options, {
|
|
83
|
-
wrapper: Wrapper
|
|
84
|
-
}));
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
export function openMobilePicker() {
|
|
90
|
-
fireEvent.click(screen.getByRole('textbox'));
|
|
91
|
-
}
|