@mui/x-date-pickers 6.18.1 → 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 +149 -0
- 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/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/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/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/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
|
@@ -6,9 +6,8 @@ import { applyDefaultDate } from '../internals/utils/date-utils';
|
|
|
6
6
|
import { DateTimePickerTabs } from './DateTimePickerTabs';
|
|
7
7
|
import { DateTimePickerToolbar } from './DateTimePickerToolbar';
|
|
8
8
|
import { applyDefaultViewProps } from '../internals/utils/views';
|
|
9
|
-
import { uncapitalizeObjectKeys } from '../internals/utils/slots-migration';
|
|
10
9
|
export function useDateTimePickerDefaultizedProps(props, name) {
|
|
11
|
-
var _themeProps$ampm, _themeProps$
|
|
10
|
+
var _themeProps$ampm, _themeProps$orientati, _themeProps$disableIg, _themeProps$disableFu, _themeProps$disablePa, _themeProps$minDateTi, _themeProps$maxDateTi, _themeProps$minDateTi2, _themeProps$maxDateTi2, _themeProps$slotProps;
|
|
12
11
|
var utils = useUtils();
|
|
13
12
|
var defaultDates = useDefaultDates();
|
|
14
13
|
var themeProps = useThemeProps({
|
|
@@ -25,8 +24,6 @@ export function useDateTimePickerDefaultizedProps(props, name) {
|
|
|
25
24
|
dateTimePickerToolbarTitle: themeProps.localeText.toolbarTitle
|
|
26
25
|
});
|
|
27
26
|
}, [themeProps.localeText]);
|
|
28
|
-
var slots = (_themeProps$slots = themeProps.slots) != null ? _themeProps$slots : uncapitalizeObjectKeys(themeProps.components);
|
|
29
|
-
var slotProps = (_themeProps$slotProps = themeProps.slotProps) != null ? _themeProps$slotProps : themeProps.componentsProps;
|
|
30
27
|
return _extends({}, themeProps, applyDefaultViewProps({
|
|
31
28
|
views: themeProps.views,
|
|
32
29
|
openTo: themeProps.openTo,
|
|
@@ -49,11 +46,11 @@ export function useDateTimePickerDefaultizedProps(props, name) {
|
|
|
49
46
|
slots: _extends({
|
|
50
47
|
toolbar: DateTimePickerToolbar,
|
|
51
48
|
tabs: DateTimePickerTabs
|
|
52
|
-
}, slots),
|
|
53
|
-
slotProps: _extends({}, slotProps, {
|
|
49
|
+
}, themeProps.slots),
|
|
50
|
+
slotProps: _extends({}, themeProps.slotProps, {
|
|
54
51
|
toolbar: _extends({
|
|
55
52
|
ampm: ampm
|
|
56
|
-
}, slotProps == null ? void 0 : slotProps.toolbar)
|
|
53
|
+
}, (_themeProps$slotProps = themeProps.slotProps) == null ? void 0 : _themeProps$slotProps.toolbar)
|
|
57
54
|
})
|
|
58
55
|
});
|
|
59
56
|
}
|
|
@@ -87,18 +87,6 @@ DesktopDatePicker.propTypes = {
|
|
|
87
87
|
* @default `true` for desktop, `false` for mobile (based on the chosen wrapper and `desktopModeMediaQuery` prop).
|
|
88
88
|
*/
|
|
89
89
|
closeOnSelect: PropTypes.bool,
|
|
90
|
-
/**
|
|
91
|
-
* Overridable components.
|
|
92
|
-
* @default {}
|
|
93
|
-
* @deprecated Please use `slots`.
|
|
94
|
-
*/
|
|
95
|
-
components: PropTypes.object,
|
|
96
|
-
/**
|
|
97
|
-
* The props used for each component slot.
|
|
98
|
-
* @default {}
|
|
99
|
-
* @deprecated Please use `slotProps`.
|
|
100
|
-
*/
|
|
101
|
-
componentsProps: PropTypes.object,
|
|
102
90
|
/**
|
|
103
91
|
* Formats the day of week displayed in the calendar header.
|
|
104
92
|
* @param {string} day The day of week provided by the adapter. Deprecated, will be removed in v7: Use `date` instead.
|
|
@@ -135,18 +135,6 @@ DesktopDateTimePicker.propTypes = {
|
|
|
135
135
|
* @default `true` for desktop, `false` for mobile (based on the chosen wrapper and `desktopModeMediaQuery` prop).
|
|
136
136
|
*/
|
|
137
137
|
closeOnSelect: PropTypes.bool,
|
|
138
|
-
/**
|
|
139
|
-
* Overridable components.
|
|
140
|
-
* @default {}
|
|
141
|
-
* @deprecated Please use `slots`.
|
|
142
|
-
*/
|
|
143
|
-
components: PropTypes.object,
|
|
144
|
-
/**
|
|
145
|
-
* The props used for each component slot.
|
|
146
|
-
* @default {}
|
|
147
|
-
* @deprecated Please use `slotProps`.
|
|
148
|
-
*/
|
|
149
|
-
componentsProps: PropTypes.object,
|
|
150
138
|
/**
|
|
151
139
|
* Formats the day of week displayed in the calendar header.
|
|
152
140
|
* @param {string} day The day of week provided by the adapter. Deprecated, will be removed in v7: Use `date` instead.
|
|
@@ -120,18 +120,6 @@ DesktopTimePicker.propTypes = {
|
|
|
120
120
|
* @default `true` for desktop, `false` for mobile (based on the chosen wrapper and `desktopModeMediaQuery` prop).
|
|
121
121
|
*/
|
|
122
122
|
closeOnSelect: PropTypes.bool,
|
|
123
|
-
/**
|
|
124
|
-
* Overridable components.
|
|
125
|
-
* @default {}
|
|
126
|
-
* @deprecated Please use `slots`.
|
|
127
|
-
*/
|
|
128
|
-
components: PropTypes.object,
|
|
129
|
-
/**
|
|
130
|
-
* The props used for each component slot.
|
|
131
|
-
* @default {}
|
|
132
|
-
* @deprecated Please use `slotProps`.
|
|
133
|
-
*/
|
|
134
|
-
componentsProps: PropTypes.object,
|
|
135
123
|
/**
|
|
136
124
|
* The default value.
|
|
137
125
|
* Used when the component is not controlled.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["ampm", "timeStep", "autoFocus", "
|
|
4
|
+
var _excluded = ["ampm", "timeStep", "autoFocus", "slots", "slotProps", "value", "defaultValue", "referenceDate", "disableIgnoringDatePartForTimeValidation", "maxTime", "minTime", "disableFuture", "disablePast", "minutesStep", "shouldDisableClock", "shouldDisableTime", "onChange", "view", "openTo", "onViewChange", "focusedView", "onFocusedViewChange", "className", "disabled", "readOnly", "views", "skipDisabled", "timezone"];
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
@@ -97,7 +97,7 @@ var DigitalClockItem = styled(MenuItem, {
|
|
|
97
97
|
* - [DigitalClock API](https://mui.com/x/api/date-pickers/digital-clock/)
|
|
98
98
|
*/
|
|
99
99
|
export var DigitalClock = /*#__PURE__*/React.forwardRef(function DigitalClock(inProps, ref) {
|
|
100
|
-
var
|
|
100
|
+
var _slots$digitalClockIt;
|
|
101
101
|
var utils = useUtils();
|
|
102
102
|
var containerRef = React.useRef(null);
|
|
103
103
|
var handleRef = useForkRef(ref, containerRef);
|
|
@@ -110,8 +110,6 @@ export var DigitalClock = /*#__PURE__*/React.forwardRef(function DigitalClock(in
|
|
|
110
110
|
_props$timeStep = props.timeStep,
|
|
111
111
|
timeStep = _props$timeStep === void 0 ? 30 : _props$timeStep,
|
|
112
112
|
autoFocus = props.autoFocus,
|
|
113
|
-
components = props.components,
|
|
114
|
-
componentsProps = props.componentsProps,
|
|
115
113
|
slots = props.slots,
|
|
116
114
|
slotProps = props.slotProps,
|
|
117
115
|
valueProp = props.value,
|
|
@@ -161,10 +159,10 @@ export var DigitalClock = /*#__PURE__*/React.forwardRef(function DigitalClock(in
|
|
|
161
159
|
});
|
|
162
160
|
}, [props]);
|
|
163
161
|
var classes = useUtilityClasses(ownerState);
|
|
164
|
-
var ClockItem = (
|
|
162
|
+
var ClockItem = (_slots$digitalClockIt = slots == null ? void 0 : slots.digitalClockItem) != null ? _slots$digitalClockIt : DigitalClockItem;
|
|
165
163
|
var clockItemProps = useSlotProps({
|
|
166
164
|
elementType: ClockItem,
|
|
167
|
-
externalSlotProps:
|
|
165
|
+
externalSlotProps: slotProps == null ? void 0 : slotProps.digitalClockItem,
|
|
168
166
|
ownerState: {},
|
|
169
167
|
className: classes.item
|
|
170
168
|
});
|
|
@@ -195,11 +193,14 @@ export var DigitalClock = /*#__PURE__*/React.forwardRef(function DigitalClock(in
|
|
|
195
193
|
if (containerRef.current === null) {
|
|
196
194
|
return;
|
|
197
195
|
}
|
|
198
|
-
var
|
|
199
|
-
if (!
|
|
196
|
+
var activeItem = containerRef.current.querySelector('[role="listbox"] [role="option"][tabindex="0"], [role="listbox"] [role="option"][aria-selected="true"]');
|
|
197
|
+
if (!activeItem) {
|
|
200
198
|
return;
|
|
201
199
|
}
|
|
202
|
-
var offsetTop =
|
|
200
|
+
var offsetTop = activeItem.offsetTop;
|
|
201
|
+
if (autoFocus || !!focusedView) {
|
|
202
|
+
activeItem.focus();
|
|
203
|
+
}
|
|
203
204
|
|
|
204
205
|
// Subtracting the 4px of extra margin intended for the first visible section item
|
|
205
206
|
containerRef.current.scrollTop = offsetTop - 4;
|
|
@@ -243,21 +244,24 @@ export var DigitalClock = /*#__PURE__*/React.forwardRef(function DigitalClock(in
|
|
|
243
244
|
return utils.addMinutes(startOfDay, timeStep * (index + 1));
|
|
244
245
|
})));
|
|
245
246
|
}, [valueOrReferenceDate, timeStep, utils]);
|
|
247
|
+
var focusedOptionIndex = timeOptions.findIndex(function (option) {
|
|
248
|
+
return utils.isEqual(option, valueOrReferenceDate);
|
|
249
|
+
});
|
|
246
250
|
return /*#__PURE__*/_jsx(DigitalClockRoot, _extends({
|
|
247
251
|
ref: handleRef,
|
|
248
252
|
className: clsx(classes.root, className),
|
|
249
253
|
ownerState: ownerState
|
|
250
254
|
}, other, {
|
|
251
255
|
children: /*#__PURE__*/_jsx(DigitalClockList, {
|
|
252
|
-
autoFocusItem: autoFocus || !!focusedView,
|
|
253
256
|
role: "listbox",
|
|
254
257
|
"aria-label": localeText.timePickerToolbarTitle,
|
|
255
258
|
className: classes.list,
|
|
256
|
-
children: timeOptions.map(function (option) {
|
|
259
|
+
children: timeOptions.map(function (option, index) {
|
|
257
260
|
if (skipDisabled && isTimeDisabled(option)) {
|
|
258
261
|
return null;
|
|
259
262
|
}
|
|
260
263
|
var isSelected = utils.isEqual(option, value);
|
|
264
|
+
var tabIndex = focusedOptionIndex === index || focusedOptionIndex === -1 && index === 0 ? 0 : -1;
|
|
261
265
|
return /*#__PURE__*/_jsx(ClockItem, _extends({
|
|
262
266
|
onClick: function onClick() {
|
|
263
267
|
return !readOnly && handleItemSelect(option);
|
|
@@ -269,7 +273,8 @@ export var DigitalClock = /*#__PURE__*/React.forwardRef(function DigitalClock(in
|
|
|
269
273
|
// aria-readonly is not supported here and does not have any effect
|
|
270
274
|
,
|
|
271
275
|
"aria-disabled": readOnly,
|
|
272
|
-
"aria-selected": isSelected
|
|
276
|
+
"aria-selected": isSelected,
|
|
277
|
+
tabIndex: tabIndex
|
|
273
278
|
}, clockItemProps, {
|
|
274
279
|
children: utils.format(option, ampm ? 'fullTime12h' : 'fullTime24h')
|
|
275
280
|
}), utils.toISO(option));
|
|
@@ -299,18 +304,6 @@ process.env.NODE_ENV !== "production" ? DigitalClock.propTypes = {
|
|
|
299
304
|
*/
|
|
300
305
|
classes: PropTypes.object,
|
|
301
306
|
className: PropTypes.string,
|
|
302
|
-
/**
|
|
303
|
-
* Overrideable components.
|
|
304
|
-
* @default {}
|
|
305
|
-
* @deprecated Please use `slots`.
|
|
306
|
-
*/
|
|
307
|
-
components: PropTypes.object,
|
|
308
|
-
/**
|
|
309
|
-
* The props used for each component slot.
|
|
310
|
-
* @default {}
|
|
311
|
-
* @deprecated Please use `slotProps`.
|
|
312
|
-
*/
|
|
313
|
-
componentsProps: PropTypes.object,
|
|
314
307
|
/**
|
|
315
308
|
* The default selected value.
|
|
316
309
|
* Used when the component is not controlled.
|
|
@@ -84,18 +84,6 @@ MobileDatePicker.propTypes = {
|
|
|
84
84
|
* @default `true` for desktop, `false` for mobile (based on the chosen wrapper and `desktopModeMediaQuery` prop).
|
|
85
85
|
*/
|
|
86
86
|
closeOnSelect: PropTypes.bool,
|
|
87
|
-
/**
|
|
88
|
-
* Overridable components.
|
|
89
|
-
* @default {}
|
|
90
|
-
* @deprecated Please use `slots`.
|
|
91
|
-
*/
|
|
92
|
-
components: PropTypes.object,
|
|
93
|
-
/**
|
|
94
|
-
* The props used for each component slot.
|
|
95
|
-
* @default {}
|
|
96
|
-
* @deprecated Please use `slotProps`.
|
|
97
|
-
*/
|
|
98
|
-
componentsProps: PropTypes.object,
|
|
99
87
|
/**
|
|
100
88
|
* Formats the day of week displayed in the calendar header.
|
|
101
89
|
* @param {string} day The day of week provided by the adapter. Deprecated, will be removed in v7: Use `date` instead.
|
|
@@ -105,18 +105,6 @@ MobileDateTimePicker.propTypes = {
|
|
|
105
105
|
* @default `true` for desktop, `false` for mobile (based on the chosen wrapper and `desktopModeMediaQuery` prop).
|
|
106
106
|
*/
|
|
107
107
|
closeOnSelect: PropTypes.bool,
|
|
108
|
-
/**
|
|
109
|
-
* Overridable components.
|
|
110
|
-
* @default {}
|
|
111
|
-
* @deprecated Please use `slots`.
|
|
112
|
-
*/
|
|
113
|
-
components: PropTypes.object,
|
|
114
|
-
/**
|
|
115
|
-
* The props used for each component slot.
|
|
116
|
-
* @default {}
|
|
117
|
-
* @deprecated Please use `slotProps`.
|
|
118
|
-
*/
|
|
119
|
-
componentsProps: PropTypes.object,
|
|
120
108
|
/**
|
|
121
109
|
* Formats the day of week displayed in the calendar header.
|
|
122
110
|
* @param {string} day The day of week provided by the adapter. Deprecated, will be removed in v7: Use `date` instead.
|
|
@@ -98,18 +98,6 @@ MobileTimePicker.propTypes = {
|
|
|
98
98
|
* @default `true` for desktop, `false` for mobile (based on the chosen wrapper and `desktopModeMediaQuery` prop).
|
|
99
99
|
*/
|
|
100
100
|
closeOnSelect: PropTypes.bool,
|
|
101
|
-
/**
|
|
102
|
-
* Overridable components.
|
|
103
|
-
* @default {}
|
|
104
|
-
* @deprecated Please use `slots`.
|
|
105
|
-
*/
|
|
106
|
-
components: PropTypes.object,
|
|
107
|
-
/**
|
|
108
|
-
* The props used for each component slot.
|
|
109
|
-
* @default {}
|
|
110
|
-
* @deprecated Please use `slotProps`.
|
|
111
|
-
*/
|
|
112
|
-
componentsProps: PropTypes.object,
|
|
113
101
|
/**
|
|
114
102
|
* The default value.
|
|
115
103
|
* Used when the component is not controlled.
|
|
@@ -123,13 +123,10 @@ export var MonthCalendar = /*#__PURE__*/React.forwardRef(function MonthCalendar(
|
|
|
123
123
|
if (value != null) {
|
|
124
124
|
return utils.getMonth(value);
|
|
125
125
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
}
|
|
129
|
-
return utils.getMonth(referenceDate);
|
|
130
|
-
}, [value, utils, disableHighlightToday, referenceDate]);
|
|
126
|
+
return null;
|
|
127
|
+
}, [value, utils]);
|
|
131
128
|
var _React$useState = React.useState(function () {
|
|
132
|
-
return selectedMonth ||
|
|
129
|
+
return selectedMonth || utils.getMonth(referenceDate);
|
|
133
130
|
}),
|
|
134
131
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
135
132
|
focusedMonth = _React$useState2[0],
|
|
@@ -3,7 +3,7 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
|
3
3
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
4
4
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
5
5
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
6
|
-
var _excluded = ["ampm", "timeSteps", "autoFocus", "
|
|
6
|
+
var _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"];
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
import clsx from 'clsx';
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
@@ -65,8 +65,6 @@ export var MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function Mul
|
|
|
65
65
|
ampm = _props$ampm === void 0 ? utils.is12HourCycleInCurrentLocale() : _props$ampm,
|
|
66
66
|
inTimeSteps = props.timeSteps,
|
|
67
67
|
autoFocus = props.autoFocus,
|
|
68
|
-
components = props.components,
|
|
69
|
-
componentsProps = props.componentsProps,
|
|
70
68
|
slots = props.slots,
|
|
71
69
|
slotProps = props.slotProps,
|
|
72
70
|
valueProp = props.value,
|
|
@@ -252,7 +250,8 @@ export var MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function Mul
|
|
|
252
250
|
return disabled || isTimeDisabled(hours, 'hours');
|
|
253
251
|
},
|
|
254
252
|
timeStep: timeSteps.hours,
|
|
255
|
-
resolveAriaLabel: localeText.hoursClockNumberText
|
|
253
|
+
resolveAriaLabel: localeText.hoursClockNumberText,
|
|
254
|
+
valueOrReferenceDate: valueOrReferenceDate
|
|
256
255
|
})
|
|
257
256
|
};
|
|
258
257
|
}
|
|
@@ -308,6 +307,9 @@ export var MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function Mul
|
|
|
308
307
|
isSelected: function isSelected() {
|
|
309
308
|
return !!value && meridiemMode === 'am';
|
|
310
309
|
},
|
|
310
|
+
isFocused: function isFocused() {
|
|
311
|
+
return !!valueOrReferenceDate && meridiemMode === 'am';
|
|
312
|
+
},
|
|
311
313
|
ariaLabel: amLabel
|
|
312
314
|
}, {
|
|
313
315
|
value: 'pm',
|
|
@@ -315,6 +317,9 @@ export var MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function Mul
|
|
|
315
317
|
isSelected: function isSelected() {
|
|
316
318
|
return !!value && meridiemMode === 'pm';
|
|
317
319
|
},
|
|
320
|
+
isFocused: function isFocused() {
|
|
321
|
+
return !!valueOrReferenceDate && meridiemMode === 'pm';
|
|
322
|
+
},
|
|
318
323
|
ariaLabel: pmLabel
|
|
319
324
|
}]
|
|
320
325
|
};
|
|
@@ -347,8 +352,8 @@ export var MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function Mul
|
|
|
347
352
|
autoFocus: autoFocus != null ? autoFocus : focusedView === timeView,
|
|
348
353
|
disabled: disabled,
|
|
349
354
|
readOnly: readOnly,
|
|
350
|
-
slots: slots
|
|
351
|
-
slotProps: slotProps
|
|
355
|
+
slots: slots,
|
|
356
|
+
slotProps: slotProps,
|
|
352
357
|
skipDisabled: skipDisabled,
|
|
353
358
|
"aria-label": localeText.selectViewText(timeView)
|
|
354
359
|
}, timeView);
|
|
@@ -377,18 +382,6 @@ process.env.NODE_ENV !== "production" ? MultiSectionDigitalClock.propTypes = {
|
|
|
377
382
|
*/
|
|
378
383
|
classes: PropTypes.object,
|
|
379
384
|
className: PropTypes.string,
|
|
380
|
-
/**
|
|
381
|
-
* Overrideable components.
|
|
382
|
-
* @default {}
|
|
383
|
-
* @deprecated Please use `slots`.
|
|
384
|
-
*/
|
|
385
|
-
components: PropTypes.object,
|
|
386
|
-
/**
|
|
387
|
-
* The props used for each component slot.
|
|
388
|
-
* @default {}
|
|
389
|
-
* @deprecated Please use `slotProps`.
|
|
390
|
-
*/
|
|
391
|
-
componentsProps: PropTypes.object,
|
|
392
385
|
/**
|
|
393
386
|
* The default selected value.
|
|
394
387
|
* Used when the component is not controlled.
|
|
@@ -6,20 +6,25 @@ export var getHourSectionOptions = function getHourSectionOptions(_ref) {
|
|
|
6
6
|
ampm = _ref.ampm,
|
|
7
7
|
isDisabled = _ref.isDisabled,
|
|
8
8
|
resolveAriaLabel = _ref.resolveAriaLabel,
|
|
9
|
-
timeStep = _ref.timeStep
|
|
9
|
+
timeStep = _ref.timeStep,
|
|
10
|
+
valueOrReferenceDate = _ref.valueOrReferenceDate;
|
|
10
11
|
var currentHours = value ? utils.getHours(value) : null;
|
|
11
12
|
var result = [];
|
|
12
|
-
var isSelected = function isSelected(hour) {
|
|
13
|
-
|
|
13
|
+
var isSelected = function isSelected(hour, overriddenCurrentHours) {
|
|
14
|
+
var 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
|
+
var isFocused = function isFocused(hour) {
|
|
27
|
+
return isSelected(hour, utils.getHours(valueOrReferenceDate));
|
|
23
28
|
};
|
|
24
29
|
var endHour = ampm ? 11 : 23;
|
|
25
30
|
for (var hour = 0; hour <= endHour; hour += timeStep) {
|
|
@@ -31,6 +36,7 @@ export var getHourSectionOptions = function getHourSectionOptions(_ref) {
|
|
|
31
36
|
label: label,
|
|
32
37
|
isSelected: isSelected,
|
|
33
38
|
isDisabled: isDisabled,
|
|
39
|
+
isFocused: isFocused,
|
|
34
40
|
ariaLabel: ariaLabel
|
|
35
41
|
});
|
|
36
42
|
}
|
|
@@ -50,6 +56,9 @@ export var getTimeSectionOptions = function getTimeSectionOptions(_ref2) {
|
|
|
50
56
|
}
|
|
51
57
|
return hasValue && value === timeValue;
|
|
52
58
|
};
|
|
59
|
+
var isFocused = function isFocused(timeValue) {
|
|
60
|
+
return value === timeValue;
|
|
61
|
+
};
|
|
53
62
|
return _toConsumableArray(Array.from({
|
|
54
63
|
length: Math.ceil(60 / timeStep)
|
|
55
64
|
}, function (_, index) {
|
|
@@ -59,6 +68,7 @@ export var getTimeSectionOptions = function getTimeSectionOptions(_ref2) {
|
|
|
59
68
|
label: resolveLabel(timeValue),
|
|
60
69
|
isDisabled: isDisabled,
|
|
61
70
|
isSelected: isSelected,
|
|
71
|
+
isFocused: isFocused,
|
|
62
72
|
ariaLabel: resolveAriaLabel(timeValue.toString())
|
|
63
73
|
};
|
|
64
74
|
}));
|
|
@@ -88,7 +88,7 @@ export var MultiSectionDigitalClockSection = /*#__PURE__*/React.forwardRef(funct
|
|
|
88
88
|
var _slots$digitalClockSe;
|
|
89
89
|
var containerRef = React.useRef(null);
|
|
90
90
|
var handleRef = useForkRef(ref, containerRef);
|
|
91
|
-
var
|
|
91
|
+
var previousActive = React.useRef(null);
|
|
92
92
|
var props = useThemeProps({
|
|
93
93
|
props: inProps,
|
|
94
94
|
name: 'MuiMultiSectionDigitalClockSection'
|
|
@@ -115,23 +115,26 @@ export var MultiSectionDigitalClockSection = /*#__PURE__*/React.forwardRef(funct
|
|
|
115
115
|
if (containerRef.current === null) {
|
|
116
116
|
return;
|
|
117
117
|
}
|
|
118
|
-
var
|
|
119
|
-
if (!
|
|
118
|
+
var activeItem = containerRef.current.querySelector('[role="option"][tabindex="0"], [role="option"][aria-selected="true"]');
|
|
119
|
+
if (!activeItem || previousActive.current === activeItem) {
|
|
120
120
|
// Handle setting the ref to null if the selected item is ever reset via UI
|
|
121
|
-
if (
|
|
122
|
-
|
|
121
|
+
if (previousActive.current !== activeItem) {
|
|
122
|
+
previousActive.current = activeItem;
|
|
123
123
|
}
|
|
124
124
|
return;
|
|
125
125
|
}
|
|
126
|
-
|
|
126
|
+
previousActive.current = activeItem;
|
|
127
127
|
if (active && autoFocus) {
|
|
128
|
-
|
|
128
|
+
activeItem.focus();
|
|
129
129
|
}
|
|
130
|
-
var offsetTop =
|
|
130
|
+
var offsetTop = activeItem.offsetTop;
|
|
131
131
|
|
|
132
132
|
// Subtracting the 4px of extra margin intended for the first visible section item
|
|
133
133
|
containerRef.current.scrollTop = offsetTop - 4;
|
|
134
134
|
});
|
|
135
|
+
var focusedOptionIndex = items.findIndex(function (item) {
|
|
136
|
+
return item.isFocused(item.value);
|
|
137
|
+
});
|
|
135
138
|
return /*#__PURE__*/_jsx(MultiSectionDigitalClockSectionRoot, _extends({
|
|
136
139
|
ref: handleRef,
|
|
137
140
|
className: clsx(classes.root, className),
|
|
@@ -139,12 +142,13 @@ export var MultiSectionDigitalClockSection = /*#__PURE__*/React.forwardRef(funct
|
|
|
139
142
|
autoFocusItem: autoFocus && active,
|
|
140
143
|
role: "listbox"
|
|
141
144
|
}, other, {
|
|
142
|
-
children: items.map(function (option) {
|
|
145
|
+
children: items.map(function (option, index) {
|
|
143
146
|
var _option$isDisabled, _option$isDisabled2;
|
|
144
147
|
if (skipDisabled && (_option$isDisabled = option.isDisabled) != null && _option$isDisabled.call(option, option.value)) {
|
|
145
148
|
return null;
|
|
146
149
|
}
|
|
147
150
|
var isSelected = option.isSelected(option.value);
|
|
151
|
+
var tabIndex = focusedOptionIndex === index || focusedOptionIndex === -1 && index === 0 ? 0 : -1;
|
|
148
152
|
return /*#__PURE__*/_jsx(DigitalClockSectionItem, _extends({
|
|
149
153
|
onClick: function onClick() {
|
|
150
154
|
return !readOnly && onChange(option.value);
|
|
@@ -157,7 +161,8 @@ export var MultiSectionDigitalClockSection = /*#__PURE__*/React.forwardRef(funct
|
|
|
157
161
|
,
|
|
158
162
|
"aria-disabled": readOnly,
|
|
159
163
|
"aria-label": option.ariaLabel,
|
|
160
|
-
"aria-selected": isSelected
|
|
164
|
+
"aria-selected": isSelected,
|
|
165
|
+
tabIndex: tabIndex
|
|
161
166
|
}, slotProps == null ? void 0 : slotProps.digitalClockSectionItem, {
|
|
162
167
|
children: option.label
|
|
163
168
|
}), option.label);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
-
var _excluded = ["slots", "slotProps", "
|
|
4
|
+
var _excluded = ["slots", "slotProps", "currentMonth", "disabled", "disableFuture", "disablePast", "maxDate", "minDate", "onMonthChange", "onViewChange", "view", "reduceAnimations", "views", "labelId", "className", "timezone"],
|
|
5
5
|
_excluded2 = ["ownerState"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
@@ -114,7 +114,7 @@ var PickersCalendarHeaderSwitchViewIcon = styled(ArrowDropDownIcon, {
|
|
|
114
114
|
* - [PickersCalendarHeader API](https://mui.com/x/api/date-pickers/pickers-calendar-header/)
|
|
115
115
|
*/
|
|
116
116
|
var PickersCalendarHeader = /*#__PURE__*/React.forwardRef(function PickersCalendarHeader(inProps, ref) {
|
|
117
|
-
var
|
|
117
|
+
var _slots$switchViewButt, _slots$switchViewIcon;
|
|
118
118
|
var localeText = useLocaleText();
|
|
119
119
|
var utils = useUtils();
|
|
120
120
|
var props = useThemeProps({
|
|
@@ -123,8 +123,6 @@ var PickersCalendarHeader = /*#__PURE__*/React.forwardRef(function PickersCalend
|
|
|
123
123
|
});
|
|
124
124
|
var slots = props.slots,
|
|
125
125
|
slotProps = props.slotProps,
|
|
126
|
-
components = props.components,
|
|
127
|
-
componentsProps = props.componentsProps,
|
|
128
126
|
month = props.currentMonth,
|
|
129
127
|
disabled = props.disabled,
|
|
130
128
|
disableFuture = props.disableFuture,
|
|
@@ -142,7 +140,7 @@ var PickersCalendarHeader = /*#__PURE__*/React.forwardRef(function PickersCalend
|
|
|
142
140
|
other = _objectWithoutProperties(props, _excluded);
|
|
143
141
|
var ownerState = props;
|
|
144
142
|
var classes = useUtilityClasses(props);
|
|
145
|
-
var SwitchViewButton = (
|
|
143
|
+
var SwitchViewButton = (_slots$switchViewButt = slots == null ? void 0 : slots.switchViewButton) != null ? _slots$switchViewButt : PickersCalendarHeaderSwitchViewButton;
|
|
146
144
|
var switchViewButtonProps = useSlotProps({
|
|
147
145
|
elementType: SwitchViewButton,
|
|
148
146
|
externalSlotProps: slotProps == null ? void 0 : slotProps.switchViewButton,
|
|
@@ -153,7 +151,7 @@ var PickersCalendarHeader = /*#__PURE__*/React.forwardRef(function PickersCalend
|
|
|
153
151
|
ownerState: ownerState,
|
|
154
152
|
className: classes.switchViewButton
|
|
155
153
|
});
|
|
156
|
-
var SwitchViewIcon = (
|
|
154
|
+
var SwitchViewIcon = (_slots$switchViewIcon = slots == null ? void 0 : slots.switchViewIcon) != null ? _slots$switchViewIcon : PickersCalendarHeaderSwitchViewIcon;
|
|
157
155
|
// The spread is here to avoid this bug mui/material-ui#34056
|
|
158
156
|
var _useSlotProps = useSlotProps({
|
|
159
157
|
elementType: SwitchViewIcon,
|
|
@@ -250,18 +248,6 @@ process.env.NODE_ENV !== "production" ? PickersCalendarHeader.propTypes = {
|
|
|
250
248
|
* className applied to the root element.
|
|
251
249
|
*/
|
|
252
250
|
className: PropTypes.string,
|
|
253
|
-
/**
|
|
254
|
-
* Overridable components.
|
|
255
|
-
* @default {}
|
|
256
|
-
* @deprecated Please use `slots`.
|
|
257
|
-
*/
|
|
258
|
-
components: PropTypes.object,
|
|
259
|
-
/**
|
|
260
|
-
* The props used for each component slot.
|
|
261
|
-
* @default {}
|
|
262
|
-
* @deprecated Please use `slotProps`.
|
|
263
|
-
*/
|
|
264
|
-
componentsProps: PropTypes.object,
|
|
265
251
|
currentMonth: PropTypes.any.isRequired,
|
|
266
252
|
disabled: PropTypes.bool,
|
|
267
253
|
disableFuture: PropTypes.bool,
|
|
@@ -123,18 +123,6 @@ process.env.NODE_ENV !== "production" ? PickersLayout.propTypes = {
|
|
|
123
123
|
children: PropTypes.node,
|
|
124
124
|
classes: PropTypes.object,
|
|
125
125
|
className: PropTypes.string,
|
|
126
|
-
/**
|
|
127
|
-
* Overridable components.
|
|
128
|
-
* @default {}
|
|
129
|
-
* @deprecated Please use `slots`.
|
|
130
|
-
*/
|
|
131
|
-
components: PropTypes.object,
|
|
132
|
-
/**
|
|
133
|
-
* The props used for each component slot.
|
|
134
|
-
* @default {}
|
|
135
|
-
* @deprecated Please use `slotProps`.
|
|
136
|
-
*/
|
|
137
|
-
componentsProps: PropTypes.object,
|
|
138
126
|
disabled: PropTypes.bool,
|
|
139
127
|
isLandscape: PropTypes.bool.isRequired,
|
|
140
128
|
isValid: PropTypes.func.isRequired,
|
|
@@ -5,7 +5,6 @@ import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
|
5
5
|
import { PickersActionBar } from '../PickersActionBar';
|
|
6
6
|
import { getPickersLayoutUtilityClass } from './pickersLayoutClasses';
|
|
7
7
|
import { PickersShortcuts } from '../PickersShortcuts';
|
|
8
|
-
import { uncapitalizeObjectKeys } from '../internals/utils/slots-migration';
|
|
9
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
9
|
function toolbarHasView(toolbarProps) {
|
|
11
10
|
return toolbarProps.view !== null;
|
|
@@ -43,12 +42,8 @@ var usePickerLayout = function usePickerLayout(props) {
|
|
|
43
42
|
disabled = _ref.disabled,
|
|
44
43
|
readOnly = _ref.readOnly,
|
|
45
44
|
children = _ref.children,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
innerSlots = _ref.slots,
|
|
49
|
-
innerSlotProps = _ref.slotProps;
|
|
50
|
-
var slots = innerSlots != null ? innerSlots : uncapitalizeObjectKeys(components);
|
|
51
|
-
var slotProps = innerSlotProps != null ? innerSlotProps : componentsProps;
|
|
45
|
+
slots = _ref.slots,
|
|
46
|
+
slotProps = _ref.slotProps;
|
|
52
47
|
var classes = useUtilityClasses(props);
|
|
53
48
|
|
|
54
49
|
// Action bar
|
|
@@ -63,18 +63,6 @@ StaticDatePicker.propTypes = {
|
|
|
63
63
|
* Class name applied to the root element.
|
|
64
64
|
*/
|
|
65
65
|
className: PropTypes.string,
|
|
66
|
-
/**
|
|
67
|
-
* Overridable components.
|
|
68
|
-
* @default {}
|
|
69
|
-
* @deprecated Please use `slots`.
|
|
70
|
-
*/
|
|
71
|
-
components: PropTypes.object,
|
|
72
|
-
/**
|
|
73
|
-
* The props used for each component slot.
|
|
74
|
-
* @default {}
|
|
75
|
-
* @deprecated Please use `slotProps`.
|
|
76
|
-
*/
|
|
77
|
-
componentsProps: PropTypes.object,
|
|
78
66
|
/**
|
|
79
67
|
* Formats the day of week displayed in the calendar header.
|
|
80
68
|
* @param {string} day The day of week provided by the adapter. Deprecated, will be removed in v7: Use `date` instead.
|
|
@@ -83,18 +83,6 @@ StaticDateTimePicker.propTypes = {
|
|
|
83
83
|
* Class name applied to the root element.
|
|
84
84
|
*/
|
|
85
85
|
className: PropTypes.string,
|
|
86
|
-
/**
|
|
87
|
-
* Overridable components.
|
|
88
|
-
* @default {}
|
|
89
|
-
* @deprecated Please use `slots`.
|
|
90
|
-
*/
|
|
91
|
-
components: PropTypes.object,
|
|
92
|
-
/**
|
|
93
|
-
* The props used for each component slot.
|
|
94
|
-
* @default {}
|
|
95
|
-
* @deprecated Please use `slotProps`.
|
|
96
|
-
*/
|
|
97
|
-
componentsProps: PropTypes.object,
|
|
98
86
|
/**
|
|
99
87
|
* Formats the day of week displayed in the calendar header.
|
|
100
88
|
* @param {string} day The day of week provided by the adapter. Deprecated, will be removed in v7: Use `date` instead.
|
|
@@ -75,18 +75,6 @@ StaticTimePicker.propTypes = {
|
|
|
75
75
|
* Class name applied to the root element.
|
|
76
76
|
*/
|
|
77
77
|
className: PropTypes.string,
|
|
78
|
-
/**
|
|
79
|
-
* Overridable components.
|
|
80
|
-
* @default {}
|
|
81
|
-
* @deprecated Please use `slots`.
|
|
82
|
-
*/
|
|
83
|
-
components: PropTypes.object,
|
|
84
|
-
/**
|
|
85
|
-
* The props used for each component slot.
|
|
86
|
-
* @default {}
|
|
87
|
-
* @deprecated Please use `slotProps`.
|
|
88
|
-
*/
|
|
89
|
-
componentsProps: PropTypes.object,
|
|
90
78
|
/**
|
|
91
79
|
* The default value.
|
|
92
80
|
* Used when the component is not controlled.
|