@mui/x-date-pickers 6.18.0 → 7.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/AdapterLuxon/AdapterLuxon.js +13 -3
- package/CHANGELOG.md +212 -5
- package/DateCalendar/DateCalendar.js +4 -20
- package/DateCalendar/DateCalendar.types.d.ts +12 -3
- package/DateCalendar/DayCalendar.d.ts +12 -3
- package/DateCalendar/DayCalendar.js +3 -5
- package/DateCalendar/useCalendarState.js +2 -3
- package/DateField/DateField.js +5 -21
- package/DateField/DateField.types.d.ts +12 -3
- package/DatePicker/DatePicker.js +0 -12
- package/DatePicker/DatePicker.types.d.ts +1 -14
- package/DatePicker/shared.d.ts +3 -15
- package/DatePicker/shared.js +2 -5
- package/DateTimeField/DateTimeField.js +5 -21
- package/DateTimeField/DateTimeField.types.d.ts +2 -15
- package/DateTimePicker/DateTimePicker.js +0 -12
- package/DateTimePicker/DateTimePicker.types.d.ts +1 -14
- package/DateTimePicker/shared.d.ts +3 -16
- package/DateTimePicker/shared.js +4 -7
- package/DesktopDatePicker/DesktopDatePicker.js +0 -12
- package/DesktopDatePicker/DesktopDatePicker.types.d.ts +2 -15
- package/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -12
- package/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +2 -15
- package/DesktopTimePicker/DesktopTimePicker.js +0 -12
- package/DesktopTimePicker/DesktopTimePicker.types.d.ts +2 -15
- package/DigitalClock/DigitalClock.js +15 -24
- package/DigitalClock/DigitalClock.types.d.ts +2 -15
- package/MobileDatePicker/MobileDatePicker.js +0 -12
- package/MobileDatePicker/MobileDatePicker.types.d.ts +2 -15
- package/MobileDateTimePicker/MobileDateTimePicker.js +0 -12
- package/MobileDateTimePicker/MobileDateTimePicker.types.d.ts +2 -15
- package/MobileTimePicker/MobileTimePicker.js +0 -12
- package/MobileTimePicker/MobileTimePicker.types.d.ts +2 -15
- package/MonthCalendar/MonthCalendar.js +3 -7
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +7 -18
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.types.d.ts +3 -15
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.d.ts +2 -1
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +16 -6
- package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.d.ts +1 -2
- package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +13 -10
- package/PickersCalendarHeader/PickersCalendarHeader.js +4 -17
- package/PickersCalendarHeader/PickersCalendarHeader.types.d.ts +3 -16
- package/PickersLayout/PickersLayout.js +0 -12
- package/PickersLayout/PickersLayout.types.d.ts +6 -19
- package/PickersLayout/usePickerLayout.js +2 -7
- package/StaticDatePicker/StaticDatePicker.js +0 -12
- package/StaticDatePicker/StaticDatePicker.types.d.ts +2 -14
- package/StaticDateTimePicker/StaticDateTimePicker.js +0 -12
- package/StaticDateTimePicker/StaticDateTimePicker.types.d.ts +2 -14
- package/StaticTimePicker/StaticTimePicker.js +0 -12
- package/StaticTimePicker/StaticTimePicker.types.d.ts +2 -14
- package/TimeClock/TimeClock.js +3 -20
- package/TimeClock/TimeClock.types.d.ts +1 -14
- package/TimeField/TimeField.js +5 -21
- package/TimeField/TimeField.types.d.ts +2 -15
- package/TimePicker/TimePicker.js +0 -12
- package/TimePicker/TimePicker.types.d.ts +1 -14
- package/TimePicker/shared.d.ts +2 -15
- package/TimePicker/shared.js +4 -7
- package/YearCalendar/YearCalendar.js +3 -7
- package/dateTimeViewRenderers/dateTimeViewRenderers.d.ts +2 -2
- package/dateTimeViewRenderers/dateTimeViewRenderers.js +2 -8
- package/dateViewRenderers/dateViewRenderers.d.ts +1 -1
- package/dateViewRenderers/dateViewRenderers.js +0 -4
- package/hooks/useClearableField.d.ts +1 -3
- package/hooks/useClearableField.js +6 -8
- package/index.js +1 -1
- package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.types.d.ts +5 -6
- package/internals/components/PickersModalDialog.d.ts +4 -5
- package/internals/components/PickersPopper.d.ts +5 -6
- package/internals/hooks/useDesktopPicker/useDesktopPicker.types.d.ts +7 -8
- package/internals/hooks/useField/useField.types.d.ts +2 -2
- package/internals/hooks/useMobilePicker/useMobilePicker.types.d.ts +3 -4
- package/internals/hooks/useStaticPicker/useStaticPicker.types.d.ts +1 -14
- package/internals/hooks/useViews.js +2 -1
- package/internals/index.d.ts +0 -2
- package/internals/index.js +0 -1
- package/legacy/AdapterLuxon/AdapterLuxon.js +13 -3
- package/legacy/DateCalendar/DateCalendar.js +4 -20
- package/legacy/DateCalendar/DayCalendar.js +3 -5
- package/legacy/DateCalendar/useCalendarState.js +2 -3
- package/legacy/DateField/DateField.js +6 -22
- package/legacy/DatePicker/DatePicker.js +0 -12
- package/legacy/DatePicker/shared.js +2 -5
- package/legacy/DateTimeField/DateTimeField.js +6 -22
- package/legacy/DateTimePicker/DateTimePicker.js +0 -12
- package/legacy/DateTimePicker/shared.js +4 -7
- package/legacy/DesktopDatePicker/DesktopDatePicker.js +0 -12
- package/legacy/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -12
- package/legacy/DesktopTimePicker/DesktopTimePicker.js +0 -12
- package/legacy/DigitalClock/DigitalClock.js +17 -24
- package/legacy/MobileDatePicker/MobileDatePicker.js +0 -12
- package/legacy/MobileDateTimePicker/MobileDateTimePicker.js +0 -12
- package/legacy/MobileTimePicker/MobileTimePicker.js +0 -12
- package/legacy/MonthCalendar/MonthCalendar.js +3 -6
- package/legacy/MultiSectionDigitalClock/MultiSectionDigitalClock.js +11 -18
- package/legacy/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +16 -6
- package/legacy/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +15 -10
- package/legacy/PickersCalendarHeader/PickersCalendarHeader.js +4 -18
- package/legacy/PickersLayout/PickersLayout.js +0 -12
- package/legacy/PickersLayout/usePickerLayout.js +2 -7
- package/legacy/StaticDatePicker/StaticDatePicker.js +0 -12
- package/legacy/StaticDateTimePicker/StaticDateTimePicker.js +0 -12
- package/legacy/StaticTimePicker/StaticTimePicker.js +0 -12
- package/legacy/TimeClock/TimeClock.js +3 -20
- package/legacy/TimeField/TimeField.js +5 -21
- package/legacy/TimePicker/TimePicker.js +0 -12
- package/legacy/TimePicker/shared.js +4 -7
- package/legacy/YearCalendar/YearCalendar.js +3 -6
- package/legacy/dateTimeViewRenderers/dateTimeViewRenderers.js +2 -8
- package/legacy/dateViewRenderers/dateViewRenderers.js +0 -4
- package/legacy/hooks/useClearableField.js +6 -8
- package/legacy/index.js +1 -1
- package/legacy/internals/hooks/useViews.js +2 -1
- package/legacy/internals/index.js +0 -1
- package/legacy/locales/esES.js +6 -7
- package/legacy/locales/eu.js +94 -0
- package/legacy/locales/index.js +1 -0
- package/legacy/timeViewRenderers/timeViewRenderers.js +0 -12
- package/locales/esES.js +6 -7
- package/locales/eu.d.ts +54 -0
- package/locales/eu.js +58 -0
- package/locales/index.d.ts +1 -0
- package/locales/index.js +1 -0
- package/modern/AdapterLuxon/AdapterLuxon.js +13 -3
- package/modern/DateCalendar/DateCalendar.js +3 -19
- package/modern/DateCalendar/DayCalendar.js +2 -4
- package/modern/DateCalendar/useCalendarState.js +2 -3
- package/modern/DateField/DateField.js +4 -20
- package/modern/DatePicker/DatePicker.js +0 -12
- package/modern/DatePicker/shared.js +1 -4
- package/modern/DateTimeField/DateTimeField.js +4 -20
- package/modern/DateTimePicker/DateTimePicker.js +0 -12
- package/modern/DateTimePicker/shared.js +3 -6
- package/modern/DesktopDatePicker/DesktopDatePicker.js +0 -12
- package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -12
- package/modern/DesktopTimePicker/DesktopTimePicker.js +0 -12
- package/modern/DigitalClock/DigitalClock.js +14 -23
- package/modern/MobileDatePicker/MobileDatePicker.js +0 -12
- package/modern/MobileDateTimePicker/MobileDateTimePicker.js +0 -12
- package/modern/MobileTimePicker/MobileTimePicker.js +0 -12
- package/modern/MonthCalendar/MonthCalendar.js +3 -7
- package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.js +7 -18
- package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +16 -6
- package/modern/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +13 -10
- package/modern/PickersCalendarHeader/PickersCalendarHeader.js +3 -16
- package/modern/PickersLayout/PickersLayout.js +0 -12
- package/modern/PickersLayout/usePickerLayout.js +2 -7
- package/modern/StaticDatePicker/StaticDatePicker.js +0 -12
- package/modern/StaticDateTimePicker/StaticDateTimePicker.js +0 -12
- package/modern/StaticTimePicker/StaticTimePicker.js +0 -12
- package/modern/TimeClock/TimeClock.js +3 -20
- package/modern/TimeField/TimeField.js +4 -20
- package/modern/TimePicker/TimePicker.js +0 -12
- package/modern/TimePicker/shared.js +3 -6
- package/modern/YearCalendar/YearCalendar.js +3 -7
- package/modern/dateTimeViewRenderers/dateTimeViewRenderers.js +1 -7
- package/modern/dateViewRenderers/dateViewRenderers.js +0 -4
- package/modern/hooks/useClearableField.js +5 -7
- package/modern/index.js +1 -1
- package/modern/internals/hooks/useViews.js +2 -1
- package/modern/internals/index.js +0 -1
- package/modern/locales/esES.js +6 -7
- package/modern/locales/eu.js +58 -0
- package/modern/locales/index.js +1 -0
- package/modern/timeViewRenderers/timeViewRenderers.js +0 -12
- package/node/AdapterLuxon/AdapterLuxon.js +13 -3
- package/node/DateCalendar/DateCalendar.js +3 -19
- package/node/DateCalendar/DayCalendar.js +2 -4
- package/node/DateCalendar/useCalendarState.js +1 -2
- package/node/DateField/DateField.js +4 -20
- package/node/DatePicker/DatePicker.js +0 -12
- package/node/DatePicker/shared.js +1 -4
- package/node/DateTimeField/DateTimeField.js +4 -20
- package/node/DateTimePicker/DateTimePicker.js +0 -12
- package/node/DateTimePicker/shared.js +3 -6
- package/node/DesktopDatePicker/DesktopDatePicker.js +0 -12
- package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -12
- package/node/DesktopTimePicker/DesktopTimePicker.js +0 -12
- package/node/DigitalClock/DigitalClock.js +14 -23
- package/node/MobileDatePicker/MobileDatePicker.js +0 -12
- package/node/MobileDateTimePicker/MobileDateTimePicker.js +0 -12
- package/node/MobileTimePicker/MobileTimePicker.js +0 -12
- package/node/MonthCalendar/MonthCalendar.js +3 -7
- package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.js +7 -18
- package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +16 -6
- package/node/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +13 -10
- package/node/PickersCalendarHeader/PickersCalendarHeader.js +3 -16
- package/node/PickersLayout/PickersLayout.js +0 -12
- package/node/PickersLayout/usePickerLayout.js +2 -7
- package/node/StaticDatePicker/StaticDatePicker.js +0 -12
- package/node/StaticDateTimePicker/StaticDateTimePicker.js +0 -12
- package/node/StaticTimePicker/StaticTimePicker.js +0 -12
- package/node/TimeClock/TimeClock.js +3 -20
- package/node/TimeField/TimeField.js +4 -20
- package/node/TimePicker/TimePicker.js +0 -12
- package/node/TimePicker/shared.js +3 -6
- package/node/YearCalendar/YearCalendar.js +3 -7
- package/node/dateTimeViewRenderers/dateTimeViewRenderers.js +1 -7
- package/node/dateViewRenderers/dateViewRenderers.js +0 -4
- package/node/hooks/useClearableField.js +5 -7
- package/node/index.js +1 -1
- package/node/internals/hooks/useViews.js +2 -1
- package/node/internals/index.js +0 -7
- package/node/locales/esES.js +6 -7
- package/node/locales/eu.js +64 -0
- package/node/locales/index.js +11 -0
- package/node/timeViewRenderers/timeViewRenderers.js +0 -12
- package/package.json +1 -1
- package/timeViewRenderers/timeViewRenderers.d.ts +3 -3
- package/timeViewRenderers/timeViewRenderers.js +0 -12
- package/internals/utils/slots-migration.d.ts +0 -36
- package/internals/utils/slots-migration.js +0 -13
- package/legacy/internals/utils/slots-migration.js +0 -14
- package/modern/internals/utils/slots-migration.js +0 -13
- package/node/internals/utils/slots-migration.js +0 -21
|
@@ -85,18 +85,6 @@ MobileDatePicker.propTypes = {
|
|
|
85
85
|
* @default `true` for desktop, `false` for mobile (based on the chosen wrapper and `desktopModeMediaQuery` prop).
|
|
86
86
|
*/
|
|
87
87
|
closeOnSelect: PropTypes.bool,
|
|
88
|
-
/**
|
|
89
|
-
* Overridable components.
|
|
90
|
-
* @default {}
|
|
91
|
-
* @deprecated Please use `slots`.
|
|
92
|
-
*/
|
|
93
|
-
components: PropTypes.object,
|
|
94
|
-
/**
|
|
95
|
-
* The props used for each component slot.
|
|
96
|
-
* @default {}
|
|
97
|
-
* @deprecated Please use `slotProps`.
|
|
98
|
-
*/
|
|
99
|
-
componentsProps: PropTypes.object,
|
|
100
88
|
/**
|
|
101
89
|
* Formats the day of week displayed in the calendar header.
|
|
102
90
|
* @param {string} day The day of week provided by the adapter. Deprecated, will be removed in v7: Use `date` instead.
|
|
@@ -2,29 +2,16 @@ import { UseMobilePickerSlotsComponent, MobileOnlyPickerProps, ExportedUseMobile
|
|
|
2
2
|
import { BaseDatePickerProps, BaseDatePickerSlotsComponent, BaseDatePickerSlotsComponentsProps } from '../DatePicker/shared';
|
|
3
3
|
import { MakeOptional } from '../internals/models/helpers';
|
|
4
4
|
import { DateView } from '../models';
|
|
5
|
-
|
|
6
|
-
export interface MobileDatePickerSlotsComponent<TDate> extends BaseDatePickerSlotsComponent<TDate>, MakeOptional<UseMobilePickerSlotsComponent<TDate, DateView>, 'Field'> {
|
|
5
|
+
export interface MobileDatePickerSlotsComponent<TDate> extends BaseDatePickerSlotsComponent<TDate>, MakeOptional<UseMobilePickerSlotsComponent<TDate, DateView>, 'field'> {
|
|
7
6
|
}
|
|
8
7
|
export interface MobileDatePickerSlotsComponentsProps<TDate> extends BaseDatePickerSlotsComponentsProps<TDate>, ExportedUseMobilePickerSlotsComponentsProps<TDate, DateView> {
|
|
9
8
|
}
|
|
10
9
|
export interface MobileDatePickerProps<TDate> extends BaseDatePickerProps<TDate>, MobileOnlyPickerProps<TDate> {
|
|
11
|
-
/**
|
|
12
|
-
* Overridable components.
|
|
13
|
-
* @default {}
|
|
14
|
-
* @deprecated Please use `slots`.
|
|
15
|
-
*/
|
|
16
|
-
components?: MobileDatePickerSlotsComponent<TDate>;
|
|
17
|
-
/**
|
|
18
|
-
* The props used for each component slot.
|
|
19
|
-
* @default {}
|
|
20
|
-
* @deprecated Please use `slotProps`.
|
|
21
|
-
*/
|
|
22
|
-
componentsProps?: MobileDatePickerSlotsComponentsProps<TDate>;
|
|
23
10
|
/**
|
|
24
11
|
* Overridable component slots.
|
|
25
12
|
* @default {}
|
|
26
13
|
*/
|
|
27
|
-
slots?:
|
|
14
|
+
slots?: MobileDatePickerSlotsComponent<TDate>;
|
|
28
15
|
/**
|
|
29
16
|
* The props used for each component slot.
|
|
30
17
|
* @default {}
|
|
@@ -106,18 +106,6 @@ MobileDateTimePicker.propTypes = {
|
|
|
106
106
|
* @default `true` for desktop, `false` for mobile (based on the chosen wrapper and `desktopModeMediaQuery` prop).
|
|
107
107
|
*/
|
|
108
108
|
closeOnSelect: PropTypes.bool,
|
|
109
|
-
/**
|
|
110
|
-
* Overridable components.
|
|
111
|
-
* @default {}
|
|
112
|
-
* @deprecated Please use `slots`.
|
|
113
|
-
*/
|
|
114
|
-
components: PropTypes.object,
|
|
115
|
-
/**
|
|
116
|
-
* The props used for each component slot.
|
|
117
|
-
* @default {}
|
|
118
|
-
* @deprecated Please use `slotProps`.
|
|
119
|
-
*/
|
|
120
|
-
componentsProps: PropTypes.object,
|
|
121
109
|
/**
|
|
122
110
|
* Formats the day of week displayed in the calendar header.
|
|
123
111
|
* @param {string} day The day of week provided by the adapter. Deprecated, will be removed in v7: Use `date` instead.
|
|
@@ -2,30 +2,17 @@ import { UseMobilePickerSlotsComponent, ExportedUseMobilePickerSlotsComponentsPr
|
|
|
2
2
|
import { BaseDateTimePickerProps, BaseDateTimePickerSlotsComponent, BaseDateTimePickerSlotsComponentsProps } from '../DateTimePicker/shared';
|
|
3
3
|
import { MakeOptional } from '../internals/models/helpers';
|
|
4
4
|
import { DateOrTimeView } from '../models';
|
|
5
|
-
import { UncapitalizeObjectKeys } from '../internals/utils/slots-migration';
|
|
6
5
|
import { DateOrTimeViewWithMeridiem } from '../internals/models';
|
|
7
|
-
export interface MobileDateTimePickerSlotsComponent<TDate, TView extends DateOrTimeViewWithMeridiem = DateOrTimeView> extends BaseDateTimePickerSlotsComponent<TDate>, MakeOptional<UseMobilePickerSlotsComponent<TDate, TView>, '
|
|
6
|
+
export interface MobileDateTimePickerSlotsComponent<TDate, TView extends DateOrTimeViewWithMeridiem = DateOrTimeView> extends BaseDateTimePickerSlotsComponent<TDate>, MakeOptional<UseMobilePickerSlotsComponent<TDate, TView>, 'field'> {
|
|
8
7
|
}
|
|
9
8
|
export interface MobileDateTimePickerSlotsComponentsProps<TDate, TView extends DateOrTimeViewWithMeridiem = DateOrTimeView> extends BaseDateTimePickerSlotsComponentsProps<TDate>, ExportedUseMobilePickerSlotsComponentsProps<TDate, TView> {
|
|
10
9
|
}
|
|
11
10
|
export interface MobileDateTimePickerProps<TDate, TView extends DateOrTimeViewWithMeridiem = DateOrTimeView> extends BaseDateTimePickerProps<TDate, TView>, MobileOnlyPickerProps<TDate> {
|
|
12
|
-
/**
|
|
13
|
-
* Overridable components.
|
|
14
|
-
* @default {}
|
|
15
|
-
* @deprecated Please use `slots`.
|
|
16
|
-
*/
|
|
17
|
-
components?: MobileDateTimePickerSlotsComponent<TDate, TView>;
|
|
18
|
-
/**
|
|
19
|
-
* The props used for each component slot.
|
|
20
|
-
* @default {}
|
|
21
|
-
* @deprecated Please use `slotProps`.
|
|
22
|
-
*/
|
|
23
|
-
componentsProps?: MobileDateTimePickerSlotsComponentsProps<TDate, TView>;
|
|
24
11
|
/**
|
|
25
12
|
* Overridable component slots.
|
|
26
13
|
* @default {}
|
|
27
14
|
*/
|
|
28
|
-
slots?:
|
|
15
|
+
slots?: MobileDateTimePickerSlotsComponent<TDate, TView>;
|
|
29
16
|
/**
|
|
30
17
|
* The props used for each component slot.
|
|
31
18
|
* @default {}
|
|
@@ -99,18 +99,6 @@ MobileTimePicker.propTypes = {
|
|
|
99
99
|
* @default `true` for desktop, `false` for mobile (based on the chosen wrapper and `desktopModeMediaQuery` prop).
|
|
100
100
|
*/
|
|
101
101
|
closeOnSelect: PropTypes.bool,
|
|
102
|
-
/**
|
|
103
|
-
* Overridable components.
|
|
104
|
-
* @default {}
|
|
105
|
-
* @deprecated Please use `slots`.
|
|
106
|
-
*/
|
|
107
|
-
components: PropTypes.object,
|
|
108
|
-
/**
|
|
109
|
-
* The props used for each component slot.
|
|
110
|
-
* @default {}
|
|
111
|
-
* @deprecated Please use `slotProps`.
|
|
112
|
-
*/
|
|
113
|
-
componentsProps: PropTypes.object,
|
|
114
102
|
/**
|
|
115
103
|
* The default value.
|
|
116
104
|
* Used when the component is not controlled.
|
|
@@ -3,29 +3,16 @@ import { BaseTimePickerProps, BaseTimePickerSlotsComponent, BaseTimePickerSlotsC
|
|
|
3
3
|
import { MakeOptional } from '../internals/models/helpers';
|
|
4
4
|
import { TimeView } from '../models';
|
|
5
5
|
import { TimeViewWithMeridiem } from '../internals/models';
|
|
6
|
-
|
|
7
|
-
export interface MobileTimePickerSlotsComponent<TDate, TView extends TimeViewWithMeridiem = TimeView> extends BaseTimePickerSlotsComponent<TDate>, MakeOptional<UseMobilePickerSlotsComponent<TDate, TView>, 'Field'> {
|
|
6
|
+
export interface MobileTimePickerSlotsComponent<TDate, TView extends TimeViewWithMeridiem = TimeView> extends BaseTimePickerSlotsComponent<TDate>, MakeOptional<UseMobilePickerSlotsComponent<TDate, TView>, 'field'> {
|
|
8
7
|
}
|
|
9
8
|
export interface MobileTimePickerSlotsComponentsProps<TDate, TView extends TimeViewWithMeridiem = TimeView> extends BaseTimePickerSlotsComponentsProps, ExportedUseMobilePickerSlotsComponentsProps<TDate, TView> {
|
|
10
9
|
}
|
|
11
10
|
export interface MobileTimePickerProps<TDate, TView extends TimeViewWithMeridiem = TimeView> extends BaseTimePickerProps<TDate, TView>, MobileOnlyPickerProps<TDate> {
|
|
12
|
-
/**
|
|
13
|
-
* Overridable components.
|
|
14
|
-
* @default {}
|
|
15
|
-
* @deprecated Please use `slots`.
|
|
16
|
-
*/
|
|
17
|
-
components?: MobileTimePickerSlotsComponent<TDate, TView>;
|
|
18
|
-
/**
|
|
19
|
-
* The props used for each component slot.
|
|
20
|
-
* @default {}
|
|
21
|
-
* @deprecated Please use `slotProps`.
|
|
22
|
-
*/
|
|
23
|
-
componentsProps?: MobileTimePickerSlotsComponentsProps<TDate, TView>;
|
|
24
11
|
/**
|
|
25
12
|
* Overridable component slots.
|
|
26
13
|
* @default {}
|
|
27
14
|
*/
|
|
28
|
-
slots?:
|
|
15
|
+
slots?: MobileTimePickerSlotsComponent<TDate, TView>;
|
|
29
16
|
/**
|
|
30
17
|
* The props used for each component slot.
|
|
31
18
|
* @default {}
|
|
@@ -77,7 +77,6 @@ export const MonthCalendar = /*#__PURE__*/React.forwardRef(function MonthCalenda
|
|
|
77
77
|
onChange,
|
|
78
78
|
shouldDisableMonth,
|
|
79
79
|
readOnly,
|
|
80
|
-
disableHighlightToday,
|
|
81
80
|
autoFocus = false,
|
|
82
81
|
onMonthFocus,
|
|
83
82
|
hasFocus,
|
|
@@ -119,12 +118,9 @@ export const MonthCalendar = /*#__PURE__*/React.forwardRef(function MonthCalenda
|
|
|
119
118
|
if (value != null) {
|
|
120
119
|
return utils.getMonth(value);
|
|
121
120
|
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
return utils.getMonth(referenceDate);
|
|
126
|
-
}, [value, utils, disableHighlightToday, referenceDate]);
|
|
127
|
-
const [focusedMonth, setFocusedMonth] = React.useState(() => selectedMonth || todayMonth);
|
|
121
|
+
return null;
|
|
122
|
+
}, [value, utils]);
|
|
123
|
+
const [focusedMonth, setFocusedMonth] = React.useState(() => selectedMonth || utils.getMonth(referenceDate));
|
|
128
124
|
const [internalHasFocus, setInternalHasFocus] = useControlled({
|
|
129
125
|
name: 'MonthCalendar',
|
|
130
126
|
state: 'hasFocus',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["ampm", "timeSteps", "autoFocus", "
|
|
3
|
+
const _excluded = ["ampm", "timeSteps", "autoFocus", "slots", "slotProps", "value", "defaultValue", "referenceDate", "disableIgnoringDatePartForTimeValidation", "maxTime", "minTime", "disableFuture", "disablePast", "minutesStep", "shouldDisableClock", "shouldDisableTime", "onChange", "view", "views", "openTo", "onViewChange", "focusedView", "onFocusedViewChange", "className", "disabled", "readOnly", "skipDisabled", "timezone"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
@@ -61,8 +61,6 @@ export const MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function M
|
|
|
61
61
|
ampm = utils.is12HourCycleInCurrentLocale(),
|
|
62
62
|
timeSteps: inTimeSteps,
|
|
63
63
|
autoFocus,
|
|
64
|
-
components,
|
|
65
|
-
componentsProps,
|
|
66
64
|
slots,
|
|
67
65
|
slotProps,
|
|
68
66
|
value: valueProp,
|
|
@@ -242,7 +240,8 @@ export const MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function M
|
|
|
242
240
|
utils,
|
|
243
241
|
isDisabled: hours => disabled || isTimeDisabled(hours, 'hours'),
|
|
244
242
|
timeStep: timeSteps.hours,
|
|
245
|
-
resolveAriaLabel: localeText.hoursClockNumberText
|
|
243
|
+
resolveAriaLabel: localeText.hoursClockNumberText,
|
|
244
|
+
valueOrReferenceDate
|
|
246
245
|
})
|
|
247
246
|
};
|
|
248
247
|
}
|
|
@@ -288,11 +287,13 @@ export const MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function M
|
|
|
288
287
|
value: 'am',
|
|
289
288
|
label: amLabel,
|
|
290
289
|
isSelected: () => !!value && meridiemMode === 'am',
|
|
290
|
+
isFocused: () => !!valueOrReferenceDate && meridiemMode === 'am',
|
|
291
291
|
ariaLabel: amLabel
|
|
292
292
|
}, {
|
|
293
293
|
value: 'pm',
|
|
294
294
|
label: pmLabel,
|
|
295
295
|
isSelected: () => !!value && meridiemMode === 'pm',
|
|
296
|
+
isFocused: () => !!valueOrReferenceDate && meridiemMode === 'pm',
|
|
296
297
|
ariaLabel: pmLabel
|
|
297
298
|
}]
|
|
298
299
|
};
|
|
@@ -323,8 +324,8 @@ export const MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function M
|
|
|
323
324
|
autoFocus: autoFocus != null ? autoFocus : focusedView === timeView,
|
|
324
325
|
disabled: disabled,
|
|
325
326
|
readOnly: readOnly,
|
|
326
|
-
slots: slots
|
|
327
|
-
slotProps: slotProps
|
|
327
|
+
slots: slots,
|
|
328
|
+
slotProps: slotProps,
|
|
328
329
|
skipDisabled: skipDisabled,
|
|
329
330
|
"aria-label": localeText.selectViewText(timeView)
|
|
330
331
|
}, timeView))
|
|
@@ -352,18 +353,6 @@ process.env.NODE_ENV !== "production" ? MultiSectionDigitalClock.propTypes = {
|
|
|
352
353
|
*/
|
|
353
354
|
classes: PropTypes.object,
|
|
354
355
|
className: PropTypes.string,
|
|
355
|
-
/**
|
|
356
|
-
* Overrideable components.
|
|
357
|
-
* @default {}
|
|
358
|
-
* @deprecated Please use `slots`.
|
|
359
|
-
*/
|
|
360
|
-
components: PropTypes.object,
|
|
361
|
-
/**
|
|
362
|
-
* The props used for each component slot.
|
|
363
|
-
* @default {}
|
|
364
|
-
* @deprecated Please use `slotProps`.
|
|
365
|
-
*/
|
|
366
|
-
componentsProps: PropTypes.object,
|
|
367
356
|
/**
|
|
368
357
|
* The default selected value.
|
|
369
358
|
* Used when the component is not controlled.
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
import { SlotComponentProps } from '@mui/base/utils';
|
|
3
3
|
import MenuItem from '@mui/material/MenuItem';
|
|
4
4
|
import { MultiSectionDigitalClockClasses } from './multiSectionDigitalClockClasses';
|
|
5
|
-
import { UncapitalizeObjectKeys } from '../internals/utils/slots-migration';
|
|
6
5
|
import { BaseClockProps, ExportedBaseClockProps, MultiSectionDigitalClockOnlyProps } from '../internals/models/props/clock';
|
|
7
6
|
import { MultiSectionDigitalClockSectionProps } from './MultiSectionDigitalClockSection';
|
|
8
7
|
import { TimeViewWithMeridiem } from '../internals/models';
|
|
9
8
|
export interface MultiSectionDigitalClockOption<TValue> {
|
|
10
9
|
isDisabled?: (value: TValue) => boolean;
|
|
11
10
|
isSelected: (value: TValue) => boolean;
|
|
11
|
+
isFocused: (value: TValue) => boolean;
|
|
12
12
|
label: string;
|
|
13
13
|
value: TValue;
|
|
14
14
|
ariaLabel: string;
|
|
@@ -22,7 +22,7 @@ export interface MultiSectionDigitalClockSlotsComponent {
|
|
|
22
22
|
* Component responsible for rendering a single multi section digital clock section item.
|
|
23
23
|
* @default MenuItem from '@mui/material'
|
|
24
24
|
*/
|
|
25
|
-
|
|
25
|
+
digitalClockSectionItem?: React.ElementType;
|
|
26
26
|
}
|
|
27
27
|
export interface MultiSectionDigitalClockSlotsComponentsProps {
|
|
28
28
|
digitalClockSectionItem?: SlotComponentProps<typeof MenuItem, {}, Record<string, any>>;
|
|
@@ -32,23 +32,11 @@ export interface MultiSectionDigitalClockProps<TDate> extends ExportedMultiSecti
|
|
|
32
32
|
* Override or extend the styles applied to the component.
|
|
33
33
|
*/
|
|
34
34
|
classes?: Partial<MultiSectionDigitalClockClasses>;
|
|
35
|
-
/**
|
|
36
|
-
* Overrideable components.
|
|
37
|
-
* @default {}
|
|
38
|
-
* @deprecated Please use `slots`.
|
|
39
|
-
*/
|
|
40
|
-
components?: MultiSectionDigitalClockSlotsComponent;
|
|
41
|
-
/**
|
|
42
|
-
* The props used for each component slot.
|
|
43
|
-
* @default {}
|
|
44
|
-
* @deprecated Please use `slotProps`.
|
|
45
|
-
*/
|
|
46
|
-
componentsProps?: MultiSectionDigitalClockSlotsComponentsProps;
|
|
47
35
|
/**
|
|
48
36
|
* Overrideable component slots.
|
|
49
37
|
* @default {}
|
|
50
38
|
*/
|
|
51
|
-
slots?:
|
|
39
|
+
slots?: MultiSectionDigitalClockSlotsComponent;
|
|
52
40
|
/**
|
|
53
41
|
* The props used for each component slot.
|
|
54
42
|
* @default {}
|
|
@@ -8,8 +8,9 @@ interface IGetHoursSectionOptions<TDate> {
|
|
|
8
8
|
isDisabled: (value: number) => boolean;
|
|
9
9
|
timeStep: number;
|
|
10
10
|
resolveAriaLabel: (value: string) => string;
|
|
11
|
+
valueOrReferenceDate: TDate;
|
|
11
12
|
}
|
|
12
|
-
export declare const getHourSectionOptions: <TDate>({ now, value, utils, ampm, isDisabled, resolveAriaLabel, timeStep, }: IGetHoursSectionOptions<TDate>) => MultiSectionDigitalClockOption<number>[];
|
|
13
|
+
export declare const getHourSectionOptions: <TDate>({ now, value, utils, ampm, isDisabled, resolveAriaLabel, timeStep, valueOrReferenceDate, }: IGetHoursSectionOptions<TDate>) => MultiSectionDigitalClockOption<number>[];
|
|
13
14
|
interface IGetTimeSectionOptions {
|
|
14
15
|
value: number | null;
|
|
15
16
|
isDisabled: (value: number) => boolean;
|
|
@@ -5,21 +5,26 @@ export const getHourSectionOptions = ({
|
|
|
5
5
|
ampm,
|
|
6
6
|
isDisabled,
|
|
7
7
|
resolveAriaLabel,
|
|
8
|
-
timeStep
|
|
8
|
+
timeStep,
|
|
9
|
+
valueOrReferenceDate
|
|
9
10
|
}) => {
|
|
10
11
|
const currentHours = value ? utils.getHours(value) : null;
|
|
11
12
|
const result = [];
|
|
12
|
-
const isSelected = hour => {
|
|
13
|
-
|
|
13
|
+
const isSelected = (hour, overriddenCurrentHours) => {
|
|
14
|
+
const resolvedCurrentHours = overriddenCurrentHours != null ? overriddenCurrentHours : currentHours;
|
|
15
|
+
if (resolvedCurrentHours === null) {
|
|
14
16
|
return false;
|
|
15
17
|
}
|
|
16
18
|
if (ampm) {
|
|
17
19
|
if (hour === 12) {
|
|
18
|
-
return
|
|
20
|
+
return resolvedCurrentHours === 12 || resolvedCurrentHours === 0;
|
|
19
21
|
}
|
|
20
|
-
return
|
|
22
|
+
return resolvedCurrentHours === hour || resolvedCurrentHours - 12 === hour;
|
|
21
23
|
}
|
|
22
|
-
return
|
|
24
|
+
return resolvedCurrentHours === hour;
|
|
25
|
+
};
|
|
26
|
+
const isFocused = hour => {
|
|
27
|
+
return isSelected(hour, utils.getHours(valueOrReferenceDate));
|
|
23
28
|
};
|
|
24
29
|
const endHour = ampm ? 11 : 23;
|
|
25
30
|
for (let hour = 0; hour <= endHour; hour += timeStep) {
|
|
@@ -31,6 +36,7 @@ export const getHourSectionOptions = ({
|
|
|
31
36
|
label,
|
|
32
37
|
isSelected,
|
|
33
38
|
isDisabled,
|
|
39
|
+
isFocused,
|
|
34
40
|
ariaLabel
|
|
35
41
|
});
|
|
36
42
|
}
|
|
@@ -50,6 +56,9 @@ export const getTimeSectionOptions = ({
|
|
|
50
56
|
}
|
|
51
57
|
return hasValue && value === timeValue;
|
|
52
58
|
};
|
|
59
|
+
const isFocused = timeValue => {
|
|
60
|
+
return value === timeValue;
|
|
61
|
+
};
|
|
53
62
|
return [...Array.from({
|
|
54
63
|
length: Math.ceil(60 / timeStep)
|
|
55
64
|
}, (_, index) => {
|
|
@@ -59,6 +68,7 @@ export const getTimeSectionOptions = ({
|
|
|
59
68
|
label: resolveLabel(timeValue),
|
|
60
69
|
isDisabled,
|
|
61
70
|
isSelected,
|
|
71
|
+
isFocused,
|
|
62
72
|
ariaLabel: resolveAriaLabel(timeValue.toString())
|
|
63
73
|
};
|
|
64
74
|
})];
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { MultiSectionDigitalClockSectionClasses } from './multiSectionDigitalClockSectionClasses';
|
|
3
3
|
import type { MultiSectionDigitalClockOption, MultiSectionDigitalClockSlotsComponent, MultiSectionDigitalClockSlotsComponentsProps } from './MultiSectionDigitalClock.types';
|
|
4
|
-
import { UncapitalizeObjectKeys } from '../internals/utils/slots-migration';
|
|
5
4
|
export interface ExportedMultiSectionDigitalClockSectionProps {
|
|
6
5
|
className?: string;
|
|
7
6
|
classes?: Partial<MultiSectionDigitalClockSectionClasses>;
|
|
8
|
-
slots?:
|
|
7
|
+
slots?: MultiSectionDigitalClockSlotsComponent;
|
|
9
8
|
slotProps?: MultiSectionDigitalClockSlotsComponentsProps;
|
|
10
9
|
}
|
|
11
10
|
export interface MultiSectionDigitalClockSectionProps<TValue> extends ExportedMultiSectionDigitalClockSectionProps {
|
|
@@ -84,7 +84,7 @@ export const MultiSectionDigitalClockSection = /*#__PURE__*/React.forwardRef(fun
|
|
|
84
84
|
var _slots$digitalClockSe;
|
|
85
85
|
const containerRef = React.useRef(null);
|
|
86
86
|
const handleRef = useForkRef(ref, containerRef);
|
|
87
|
-
const
|
|
87
|
+
const previousActive = React.useRef(null);
|
|
88
88
|
const props = useThemeProps({
|
|
89
89
|
props: inProps,
|
|
90
90
|
name: 'MuiMultiSectionDigitalClockSection'
|
|
@@ -111,23 +111,24 @@ export const MultiSectionDigitalClockSection = /*#__PURE__*/React.forwardRef(fun
|
|
|
111
111
|
if (containerRef.current === null) {
|
|
112
112
|
return;
|
|
113
113
|
}
|
|
114
|
-
const
|
|
115
|
-
if (!
|
|
114
|
+
const activeItem = containerRef.current.querySelector('[role="option"][tabindex="0"], [role="option"][aria-selected="true"]');
|
|
115
|
+
if (!activeItem || previousActive.current === activeItem) {
|
|
116
116
|
// Handle setting the ref to null if the selected item is ever reset via UI
|
|
117
|
-
if (
|
|
118
|
-
|
|
117
|
+
if (previousActive.current !== activeItem) {
|
|
118
|
+
previousActive.current = activeItem;
|
|
119
119
|
}
|
|
120
120
|
return;
|
|
121
121
|
}
|
|
122
|
-
|
|
122
|
+
previousActive.current = activeItem;
|
|
123
123
|
if (active && autoFocus) {
|
|
124
|
-
|
|
124
|
+
activeItem.focus();
|
|
125
125
|
}
|
|
126
|
-
const offsetTop =
|
|
126
|
+
const offsetTop = activeItem.offsetTop;
|
|
127
127
|
|
|
128
128
|
// Subtracting the 4px of extra margin intended for the first visible section item
|
|
129
129
|
containerRef.current.scrollTop = offsetTop - 4;
|
|
130
130
|
});
|
|
131
|
+
const focusedOptionIndex = items.findIndex(item => item.isFocused(item.value));
|
|
131
132
|
return /*#__PURE__*/_jsx(MultiSectionDigitalClockSectionRoot, _extends({
|
|
132
133
|
ref: handleRef,
|
|
133
134
|
className: clsx(classes.root, className),
|
|
@@ -135,12 +136,13 @@ export const MultiSectionDigitalClockSection = /*#__PURE__*/React.forwardRef(fun
|
|
|
135
136
|
autoFocusItem: autoFocus && active,
|
|
136
137
|
role: "listbox"
|
|
137
138
|
}, other, {
|
|
138
|
-
children: items.map(option => {
|
|
139
|
+
children: items.map((option, index) => {
|
|
139
140
|
var _option$isDisabled, _option$isDisabled2;
|
|
140
141
|
if (skipDisabled && (_option$isDisabled = option.isDisabled) != null && _option$isDisabled.call(option, option.value)) {
|
|
141
142
|
return null;
|
|
142
143
|
}
|
|
143
144
|
const isSelected = option.isSelected(option.value);
|
|
145
|
+
const tabIndex = focusedOptionIndex === index || focusedOptionIndex === -1 && index === 0 ? 0 : -1;
|
|
144
146
|
return /*#__PURE__*/_jsx(DigitalClockSectionItem, _extends({
|
|
145
147
|
onClick: () => !readOnly && onChange(option.value),
|
|
146
148
|
selected: isSelected,
|
|
@@ -151,7 +153,8 @@ export const MultiSectionDigitalClockSection = /*#__PURE__*/React.forwardRef(fun
|
|
|
151
153
|
,
|
|
152
154
|
"aria-disabled": readOnly,
|
|
153
155
|
"aria-label": option.ariaLabel,
|
|
154
|
-
"aria-selected": isSelected
|
|
156
|
+
"aria-selected": isSelected,
|
|
157
|
+
tabIndex: tabIndex
|
|
155
158
|
}, slotProps == null ? void 0 : slotProps.digitalClockSectionItem, {
|
|
156
159
|
children: option.label
|
|
157
160
|
}), option.label);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["slots", "slotProps", "
|
|
3
|
+
const _excluded = ["slots", "slotProps", "currentMonth", "disabled", "disableFuture", "disablePast", "maxDate", "minDate", "onMonthChange", "onViewChange", "view", "reduceAnimations", "views", "labelId", "className", "timezone"],
|
|
4
4
|
_excluded2 = ["ownerState"];
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
@@ -104,7 +104,7 @@ const PickersCalendarHeaderSwitchViewIcon = styled(ArrowDropDownIcon, {
|
|
|
104
104
|
* - [PickersCalendarHeader API](https://mui.com/x/api/date-pickers/pickers-calendar-header/)
|
|
105
105
|
*/
|
|
106
106
|
const PickersCalendarHeader = /*#__PURE__*/React.forwardRef(function PickersCalendarHeader(inProps, ref) {
|
|
107
|
-
var
|
|
107
|
+
var _slots$switchViewButt, _slots$switchViewIcon;
|
|
108
108
|
const localeText = useLocaleText();
|
|
109
109
|
const utils = useUtils();
|
|
110
110
|
const props = useThemeProps({
|
|
@@ -114,7 +114,6 @@ const PickersCalendarHeader = /*#__PURE__*/React.forwardRef(function PickersCale
|
|
|
114
114
|
const {
|
|
115
115
|
slots,
|
|
116
116
|
slotProps,
|
|
117
|
-
components,
|
|
118
117
|
currentMonth: month,
|
|
119
118
|
disabled,
|
|
120
119
|
disableFuture,
|
|
@@ -133,7 +132,7 @@ const PickersCalendarHeader = /*#__PURE__*/React.forwardRef(function PickersCale
|
|
|
133
132
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
134
133
|
const ownerState = props;
|
|
135
134
|
const classes = useUtilityClasses(props);
|
|
136
|
-
const SwitchViewButton = (
|
|
135
|
+
const SwitchViewButton = (_slots$switchViewButt = slots == null ? void 0 : slots.switchViewButton) != null ? _slots$switchViewButt : PickersCalendarHeaderSwitchViewButton;
|
|
137
136
|
const switchViewButtonProps = useSlotProps({
|
|
138
137
|
elementType: SwitchViewButton,
|
|
139
138
|
externalSlotProps: slotProps == null ? void 0 : slotProps.switchViewButton,
|
|
@@ -144,7 +143,7 @@ const PickersCalendarHeader = /*#__PURE__*/React.forwardRef(function PickersCale
|
|
|
144
143
|
ownerState,
|
|
145
144
|
className: classes.switchViewButton
|
|
146
145
|
});
|
|
147
|
-
const SwitchViewIcon = (
|
|
146
|
+
const SwitchViewIcon = (_slots$switchViewIcon = slots == null ? void 0 : slots.switchViewIcon) != null ? _slots$switchViewIcon : PickersCalendarHeaderSwitchViewIcon;
|
|
148
147
|
// The spread is here to avoid this bug mui/material-ui#34056
|
|
149
148
|
const _useSlotProps = useSlotProps({
|
|
150
149
|
elementType: SwitchViewIcon,
|
|
@@ -234,18 +233,6 @@ process.env.NODE_ENV !== "production" ? PickersCalendarHeader.propTypes = {
|
|
|
234
233
|
* className applied to the root element.
|
|
235
234
|
*/
|
|
236
235
|
className: PropTypes.string,
|
|
237
|
-
/**
|
|
238
|
-
* Overridable components.
|
|
239
|
-
* @default {}
|
|
240
|
-
* @deprecated Please use `slots`.
|
|
241
|
-
*/
|
|
242
|
-
components: PropTypes.object,
|
|
243
|
-
/**
|
|
244
|
-
* The props used for each component slot.
|
|
245
|
-
* @default {}
|
|
246
|
-
* @deprecated Please use `slotProps`.
|
|
247
|
-
*/
|
|
248
|
-
componentsProps: PropTypes.object,
|
|
249
236
|
currentMonth: PropTypes.any.isRequired,
|
|
250
237
|
disabled: PropTypes.bool,
|
|
251
238
|
disableFuture: PropTypes.bool,
|
|
@@ -5,7 +5,6 @@ import SvgIcon from '@mui/material/SvgIcon';
|
|
|
5
5
|
import { SxProps, Theme } from '@mui/material/styles';
|
|
6
6
|
import { ExportedPickersArrowSwitcherProps, PickersArrowSwitcherSlotsComponent, PickersArrowSwitcherSlotsComponentsProps } from '../internals/components/PickersArrowSwitcher';
|
|
7
7
|
import { MonthValidationOptions } from '../internals/hooks/date-helpers-hooks';
|
|
8
|
-
import { UncapitalizeObjectKeys } from '../internals/utils/slots-migration';
|
|
9
8
|
import { DateView } from '../models/views';
|
|
10
9
|
import { SlideDirection } from '../DateCalendar/PickersSlideTransition';
|
|
11
10
|
import { PickersCalendarHeaderClasses } from './pickersCalendarHeaderClasses';
|
|
@@ -14,12 +13,12 @@ export interface PickersCalendarHeaderSlotsComponent extends PickersArrowSwitche
|
|
|
14
13
|
* Button displayed to switch between different calendar views.
|
|
15
14
|
* @default IconButton
|
|
16
15
|
*/
|
|
17
|
-
|
|
16
|
+
switchViewButton?: React.ElementType;
|
|
18
17
|
/**
|
|
19
18
|
* Icon displayed in the SwitchViewButton. Rotated by 180° when the open view is 'year'.
|
|
20
19
|
* @default ArrowDropDown
|
|
21
20
|
*/
|
|
22
|
-
|
|
21
|
+
switchViewIcon?: React.ElementType;
|
|
23
22
|
}
|
|
24
23
|
export interface PickersCalendarHeaderComponentsPropsOverrides {
|
|
25
24
|
}
|
|
@@ -29,23 +28,11 @@ export interface PickersCalendarHeaderSlotsComponentsProps<TDate> extends Picker
|
|
|
29
28
|
switchViewIcon?: SlotComponentProps<typeof SvgIcon, PickersCalendarHeaderComponentsPropsOverrides, undefined>;
|
|
30
29
|
}
|
|
31
30
|
export interface PickersCalendarHeaderProps<TDate> extends ExportedPickersArrowSwitcherProps, MonthValidationOptions<TDate> {
|
|
32
|
-
/**
|
|
33
|
-
* Overridable components.
|
|
34
|
-
* @default {}
|
|
35
|
-
* @deprecated Please use `slots`.
|
|
36
|
-
*/
|
|
37
|
-
components?: PickersCalendarHeaderSlotsComponent;
|
|
38
|
-
/**
|
|
39
|
-
* The props used for each component slot.
|
|
40
|
-
* @default {}
|
|
41
|
-
* @deprecated Please use `slotProps`.
|
|
42
|
-
*/
|
|
43
|
-
componentsProps?: PickersCalendarHeaderSlotsComponentsProps<TDate>;
|
|
44
31
|
/**
|
|
45
32
|
* Overridable component slots.
|
|
46
33
|
* @default {}
|
|
47
34
|
*/
|
|
48
|
-
slots?:
|
|
35
|
+
slots?: PickersCalendarHeaderSlotsComponent;
|
|
49
36
|
/**
|
|
50
37
|
* The props used for each component slot.
|
|
51
38
|
* @default {}
|
|
@@ -124,18 +124,6 @@ process.env.NODE_ENV !== "production" ? PickersLayout.propTypes = {
|
|
|
124
124
|
children: PropTypes.node,
|
|
125
125
|
classes: PropTypes.object,
|
|
126
126
|
className: PropTypes.string,
|
|
127
|
-
/**
|
|
128
|
-
* Overridable components.
|
|
129
|
-
* @default {}
|
|
130
|
-
* @deprecated Please use `slots`.
|
|
131
|
-
*/
|
|
132
|
-
components: PropTypes.object,
|
|
133
|
-
/**
|
|
134
|
-
* The props used for each component slot.
|
|
135
|
-
* @default {}
|
|
136
|
-
* @deprecated Please use `slotProps`.
|
|
137
|
-
*/
|
|
138
|
-
componentsProps: PropTypes.object,
|
|
139
127
|
disabled: PropTypes.bool,
|
|
140
128
|
isLandscape: PropTypes.bool.isRequired,
|
|
141
129
|
isValid: PropTypes.func.isRequired,
|
|
@@ -5,7 +5,6 @@ import { PickersActionBarProps } from '../PickersActionBar';
|
|
|
5
5
|
import { BaseToolbarProps, ExportedBaseToolbarProps } from '../internals/models/props/toolbar';
|
|
6
6
|
import { BaseTabsProps, ExportedBaseTabsProps } from '../internals/models/props/tabs';
|
|
7
7
|
import { UsePickerLayoutPropsResponseLayoutProps } from '../internals/hooks/usePicker/usePickerLayoutProps';
|
|
8
|
-
import { UncapitalizeObjectKeys } from '../internals/utils/slots-migration';
|
|
9
8
|
import { PickersLayoutClasses } from './pickersLayoutClasses';
|
|
10
9
|
import { DateOrTimeViewWithMeridiem, WrapperVariant } from '../internals/models/common';
|
|
11
10
|
import { PickersShortcutsProps } from '../PickersShortcuts';
|
|
@@ -14,17 +13,17 @@ export interface ExportedPickersLayoutSlotsComponent<TValue, TDate, TView extend
|
|
|
14
13
|
* Custom component for the action bar, it is placed below the picker views.
|
|
15
14
|
* @default PickersActionBar
|
|
16
15
|
*/
|
|
17
|
-
|
|
16
|
+
actionBar?: React.ElementType<PickersActionBarProps>;
|
|
18
17
|
/**
|
|
19
18
|
* Custom component for the shortcuts.
|
|
20
19
|
* @default PickersShortcuts
|
|
21
20
|
*/
|
|
22
|
-
|
|
21
|
+
shortcuts?: React.JSXElementConstructor<PickersShortcutsProps<TValue>>;
|
|
23
22
|
/**
|
|
24
23
|
* Custom component for wrapping the layout.
|
|
25
24
|
* It wraps the toolbar, views, action bar, and shortcuts.
|
|
26
25
|
*/
|
|
27
|
-
|
|
26
|
+
layout?: React.JSXElementConstructor<PickersLayoutProps<TValue, TDate, TView> & React.RefAttributes<HTMLDivElement>>;
|
|
28
27
|
}
|
|
29
28
|
interface PickersLayoutActionBarOwnerState<TValue, TDate, TView extends DateOrTimeViewWithMeridiem> extends PickersLayoutProps<TValue, TDate, TView> {
|
|
30
29
|
wrapperVariant: WrapperVariant;
|
|
@@ -50,12 +49,12 @@ export interface PickersLayoutSlotsComponent<TValue, TDate, TView extends DateOr
|
|
|
50
49
|
/**
|
|
51
50
|
* Tabs enabling toggling between views.
|
|
52
51
|
*/
|
|
53
|
-
|
|
52
|
+
tabs?: React.ElementType<BaseTabsProps<TView>>;
|
|
54
53
|
/**
|
|
55
54
|
* Custom component for the toolbar.
|
|
56
55
|
* It is placed above the picker views.
|
|
57
56
|
*/
|
|
58
|
-
|
|
57
|
+
toolbar?: React.JSXElementConstructor<BaseToolbarProps<TValue, TView>>;
|
|
59
58
|
}
|
|
60
59
|
export interface PickersLayoutSlotsComponentsProps<TValue, TDate, TView extends DateOrTimeViewWithMeridiem> extends ExportedPickersLayoutSlotsComponentsProps<TValue, TDate, TView> {
|
|
61
60
|
/**
|
|
@@ -77,23 +76,11 @@ export interface PickersLayoutProps<TValue, TDate, TView extends DateOrTimeViewW
|
|
|
77
76
|
*/
|
|
78
77
|
ref?: React.Ref<HTMLDivElement>;
|
|
79
78
|
classes?: Partial<PickersLayoutClasses>;
|
|
80
|
-
/**
|
|
81
|
-
* Overridable components.
|
|
82
|
-
* @default {}
|
|
83
|
-
* @deprecated Please use `slots`.
|
|
84
|
-
*/
|
|
85
|
-
components?: PickersLayoutSlotsComponent<TValue, TDate, TView>;
|
|
86
|
-
/**
|
|
87
|
-
* The props used for each component slot.
|
|
88
|
-
* @default {}
|
|
89
|
-
* @deprecated Please use `slotProps`.
|
|
90
|
-
*/
|
|
91
|
-
componentsProps?: PickersLayoutSlotsComponentsProps<TValue, TDate, TView>;
|
|
92
79
|
/**
|
|
93
80
|
* Overridable component slots.
|
|
94
81
|
* @default {}
|
|
95
82
|
*/
|
|
96
|
-
slots?:
|
|
83
|
+
slots?: PickersLayoutSlotsComponent<TValue, TDate, TView>;
|
|
97
84
|
/**
|
|
98
85
|
* The props used for each component slot.
|
|
99
86
|
* @default {}
|