@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
|
@@ -27,7 +27,7 @@ var _useValueWithTimezone = require("../internals/hooks/useValueWithTimezone");
|
|
|
27
27
|
var _valueManagers = require("../internals/utils/valueManagers");
|
|
28
28
|
var _useClockReferenceDate = require("../internals/hooks/useClockReferenceDate");
|
|
29
29
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
30
|
-
const _excluded = ["ampm", "timeStep", "autoFocus", "
|
|
30
|
+
const _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"];
|
|
31
31
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
32
32
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
33
33
|
const useUtilityClasses = ownerState => {
|
|
@@ -110,8 +110,6 @@ const DigitalClock = exports.DigitalClock = /*#__PURE__*/React.forwardRef(functi
|
|
|
110
110
|
ampm = utils.is12HourCycleInCurrentLocale(),
|
|
111
111
|
timeStep = 30,
|
|
112
112
|
autoFocus,
|
|
113
|
-
components,
|
|
114
|
-
componentsProps,
|
|
115
113
|
slots,
|
|
116
114
|
slotProps,
|
|
117
115
|
value: valueProp,
|
|
@@ -157,10 +155,10 @@ const DigitalClock = exports.DigitalClock = /*#__PURE__*/React.forwardRef(functi
|
|
|
157
155
|
alreadyRendered: !!containerRef.current
|
|
158
156
|
}), [props]);
|
|
159
157
|
const classes = useUtilityClasses(ownerState);
|
|
160
|
-
const ClockItem = slots?.digitalClockItem ??
|
|
158
|
+
const ClockItem = slots?.digitalClockItem ?? DigitalClockItem;
|
|
161
159
|
const clockItemProps = (0, _utils.useSlotProps)({
|
|
162
160
|
elementType: ClockItem,
|
|
163
|
-
externalSlotProps: slotProps?.digitalClockItem
|
|
161
|
+
externalSlotProps: slotProps?.digitalClockItem,
|
|
164
162
|
ownerState: {},
|
|
165
163
|
className: classes.item
|
|
166
164
|
});
|
|
@@ -190,11 +188,14 @@ const DigitalClock = exports.DigitalClock = /*#__PURE__*/React.forwardRef(functi
|
|
|
190
188
|
if (containerRef.current === null) {
|
|
191
189
|
return;
|
|
192
190
|
}
|
|
193
|
-
const
|
|
194
|
-
if (!
|
|
191
|
+
const activeItem = containerRef.current.querySelector('[role="listbox"] [role="option"][tabindex="0"], [role="listbox"] [role="option"][aria-selected="true"]');
|
|
192
|
+
if (!activeItem) {
|
|
195
193
|
return;
|
|
196
194
|
}
|
|
197
|
-
const offsetTop =
|
|
195
|
+
const offsetTop = activeItem.offsetTop;
|
|
196
|
+
if (autoFocus || !!focusedView) {
|
|
197
|
+
activeItem.focus();
|
|
198
|
+
}
|
|
198
199
|
|
|
199
200
|
// Subtracting the 4px of extra margin intended for the first visible section item
|
|
200
201
|
containerRef.current.scrollTop = offsetTop - 4;
|
|
@@ -236,21 +237,22 @@ const DigitalClock = exports.DigitalClock = /*#__PURE__*/React.forwardRef(functi
|
|
|
236
237
|
length: Math.ceil(24 * 60 / timeStep) - 1
|
|
237
238
|
}, (_, index) => utils.addMinutes(startOfDay, timeStep * (index + 1)))];
|
|
238
239
|
}, [valueOrReferenceDate, timeStep, utils]);
|
|
240
|
+
const focusedOptionIndex = timeOptions.findIndex(option => utils.isEqual(option, valueOrReferenceDate));
|
|
239
241
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(DigitalClockRoot, (0, _extends2.default)({
|
|
240
242
|
ref: handleRef,
|
|
241
243
|
className: (0, _clsx.default)(classes.root, className),
|
|
242
244
|
ownerState: ownerState
|
|
243
245
|
}, other, {
|
|
244
246
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(DigitalClockList, {
|
|
245
|
-
autoFocusItem: autoFocus || !!focusedView,
|
|
246
247
|
role: "listbox",
|
|
247
248
|
"aria-label": localeText.timePickerToolbarTitle,
|
|
248
249
|
className: classes.list,
|
|
249
|
-
children: timeOptions.map(option => {
|
|
250
|
+
children: timeOptions.map((option, index) => {
|
|
250
251
|
if (skipDisabled && isTimeDisabled(option)) {
|
|
251
252
|
return null;
|
|
252
253
|
}
|
|
253
254
|
const isSelected = utils.isEqual(option, value);
|
|
255
|
+
const tabIndex = focusedOptionIndex === index || focusedOptionIndex === -1 && index === 0 ? 0 : -1;
|
|
254
256
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ClockItem, (0, _extends2.default)({
|
|
255
257
|
onClick: () => !readOnly && handleItemSelect(option),
|
|
256
258
|
selected: isSelected,
|
|
@@ -260,7 +262,8 @@ const DigitalClock = exports.DigitalClock = /*#__PURE__*/React.forwardRef(functi
|
|
|
260
262
|
// aria-readonly is not supported here and does not have any effect
|
|
261
263
|
,
|
|
262
264
|
"aria-disabled": readOnly,
|
|
263
|
-
"aria-selected": isSelected
|
|
265
|
+
"aria-selected": isSelected,
|
|
266
|
+
tabIndex: tabIndex
|
|
264
267
|
}, clockItemProps, {
|
|
265
268
|
children: utils.format(option, ampm ? 'fullTime12h' : 'fullTime24h')
|
|
266
269
|
}), utils.toISO(option));
|
|
@@ -290,18 +293,6 @@ process.env.NODE_ENV !== "production" ? DigitalClock.propTypes = {
|
|
|
290
293
|
*/
|
|
291
294
|
classes: _propTypes.default.object,
|
|
292
295
|
className: _propTypes.default.string,
|
|
293
|
-
/**
|
|
294
|
-
* Overrideable components.
|
|
295
|
-
* @default {}
|
|
296
|
-
* @deprecated Please use `slots`.
|
|
297
|
-
*/
|
|
298
|
-
components: _propTypes.default.object,
|
|
299
|
-
/**
|
|
300
|
-
* The props used for each component slot.
|
|
301
|
-
* @default {}
|
|
302
|
-
* @deprecated Please use `slotProps`.
|
|
303
|
-
*/
|
|
304
|
-
componentsProps: _propTypes.default.object,
|
|
305
296
|
/**
|
|
306
297
|
* The default selected value.
|
|
307
298
|
* Used when the component is not controlled.
|
|
@@ -90,18 +90,6 @@ MobileDatePicker.propTypes = {
|
|
|
90
90
|
* @default `true` for desktop, `false` for mobile (based on the chosen wrapper and `desktopModeMediaQuery` prop).
|
|
91
91
|
*/
|
|
92
92
|
closeOnSelect: _propTypes.default.bool,
|
|
93
|
-
/**
|
|
94
|
-
* Overridable components.
|
|
95
|
-
* @default {}
|
|
96
|
-
* @deprecated Please use `slots`.
|
|
97
|
-
*/
|
|
98
|
-
components: _propTypes.default.object,
|
|
99
|
-
/**
|
|
100
|
-
* The props used for each component slot.
|
|
101
|
-
* @default {}
|
|
102
|
-
* @deprecated Please use `slotProps`.
|
|
103
|
-
*/
|
|
104
|
-
componentsProps: _propTypes.default.object,
|
|
105
93
|
/**
|
|
106
94
|
* Formats the day of week displayed in the calendar header.
|
|
107
95
|
* @param {string} day The day of week provided by the adapter. Deprecated, will be removed in v7: Use `date` instead.
|
|
@@ -111,18 +111,6 @@ MobileDateTimePicker.propTypes = {
|
|
|
111
111
|
* @default `true` for desktop, `false` for mobile (based on the chosen wrapper and `desktopModeMediaQuery` prop).
|
|
112
112
|
*/
|
|
113
113
|
closeOnSelect: _propTypes.default.bool,
|
|
114
|
-
/**
|
|
115
|
-
* Overridable components.
|
|
116
|
-
* @default {}
|
|
117
|
-
* @deprecated Please use `slots`.
|
|
118
|
-
*/
|
|
119
|
-
components: _propTypes.default.object,
|
|
120
|
-
/**
|
|
121
|
-
* The props used for each component slot.
|
|
122
|
-
* @default {}
|
|
123
|
-
* @deprecated Please use `slotProps`.
|
|
124
|
-
*/
|
|
125
|
-
componentsProps: _propTypes.default.object,
|
|
126
114
|
/**
|
|
127
115
|
* Formats the day of week displayed in the calendar header.
|
|
128
116
|
* @param {string} day The day of week provided by the adapter. Deprecated, will be removed in v7: Use `date` instead.
|
|
@@ -104,18 +104,6 @@ MobileTimePicker.propTypes = {
|
|
|
104
104
|
* @default `true` for desktop, `false` for mobile (based on the chosen wrapper and `desktopModeMediaQuery` prop).
|
|
105
105
|
*/
|
|
106
106
|
closeOnSelect: _propTypes.default.bool,
|
|
107
|
-
/**
|
|
108
|
-
* Overridable components.
|
|
109
|
-
* @default {}
|
|
110
|
-
* @deprecated Please use `slots`.
|
|
111
|
-
*/
|
|
112
|
-
components: _propTypes.default.object,
|
|
113
|
-
/**
|
|
114
|
-
* The props used for each component slot.
|
|
115
|
-
* @default {}
|
|
116
|
-
* @deprecated Please use `slotProps`.
|
|
117
|
-
*/
|
|
118
|
-
componentsProps: _propTypes.default.object,
|
|
119
107
|
/**
|
|
120
108
|
* The default value.
|
|
121
109
|
* Used when the component is not controlled.
|
|
@@ -87,7 +87,6 @@ const MonthCalendar = exports.MonthCalendar = /*#__PURE__*/React.forwardRef(func
|
|
|
87
87
|
onChange,
|
|
88
88
|
shouldDisableMonth,
|
|
89
89
|
readOnly,
|
|
90
|
-
disableHighlightToday,
|
|
91
90
|
autoFocus = false,
|
|
92
91
|
onMonthFocus,
|
|
93
92
|
hasFocus,
|
|
@@ -129,12 +128,9 @@ const MonthCalendar = exports.MonthCalendar = /*#__PURE__*/React.forwardRef(func
|
|
|
129
128
|
if (value != null) {
|
|
130
129
|
return utils.getMonth(value);
|
|
131
130
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
return utils.getMonth(referenceDate);
|
|
136
|
-
}, [value, utils, disableHighlightToday, referenceDate]);
|
|
137
|
-
const [focusedMonth, setFocusedMonth] = React.useState(() => selectedMonth || todayMonth);
|
|
131
|
+
return null;
|
|
132
|
+
}, [value, utils]);
|
|
133
|
+
const [focusedMonth, setFocusedMonth] = React.useState(() => selectedMonth || utils.getMonth(referenceDate));
|
|
138
134
|
const [internalHasFocus, setInternalHasFocus] = (0, _utils.unstable_useControlled)({
|
|
139
135
|
name: 'MonthCalendar',
|
|
140
136
|
state: 'hasFocus',
|
|
@@ -26,7 +26,7 @@ var _valueManagers = require("../internals/utils/valueManagers");
|
|
|
26
26
|
var _useClockReferenceDate = require("../internals/hooks/useClockReferenceDate");
|
|
27
27
|
var _dateUtils = require("../internals/utils/date-utils");
|
|
28
28
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
29
|
-
const _excluded = ["ampm", "timeSteps", "autoFocus", "
|
|
29
|
+
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"];
|
|
30
30
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
31
31
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
32
32
|
const useUtilityClasses = ownerState => {
|
|
@@ -70,8 +70,6 @@ const MultiSectionDigitalClock = exports.MultiSectionDigitalClock = /*#__PURE__*
|
|
|
70
70
|
ampm = utils.is12HourCycleInCurrentLocale(),
|
|
71
71
|
timeSteps: inTimeSteps,
|
|
72
72
|
autoFocus,
|
|
73
|
-
components,
|
|
74
|
-
componentsProps,
|
|
75
73
|
slots,
|
|
76
74
|
slotProps,
|
|
77
75
|
value: valueProp,
|
|
@@ -251,7 +249,8 @@ const MultiSectionDigitalClock = exports.MultiSectionDigitalClock = /*#__PURE__*
|
|
|
251
249
|
utils,
|
|
252
250
|
isDisabled: hours => disabled || isTimeDisabled(hours, 'hours'),
|
|
253
251
|
timeStep: timeSteps.hours,
|
|
254
|
-
resolveAriaLabel: localeText.hoursClockNumberText
|
|
252
|
+
resolveAriaLabel: localeText.hoursClockNumberText,
|
|
253
|
+
valueOrReferenceDate
|
|
255
254
|
})
|
|
256
255
|
};
|
|
257
256
|
}
|
|
@@ -297,11 +296,13 @@ const MultiSectionDigitalClock = exports.MultiSectionDigitalClock = /*#__PURE__*
|
|
|
297
296
|
value: 'am',
|
|
298
297
|
label: amLabel,
|
|
299
298
|
isSelected: () => !!value && meridiemMode === 'am',
|
|
299
|
+
isFocused: () => !!valueOrReferenceDate && meridiemMode === 'am',
|
|
300
300
|
ariaLabel: amLabel
|
|
301
301
|
}, {
|
|
302
302
|
value: 'pm',
|
|
303
303
|
label: pmLabel,
|
|
304
304
|
isSelected: () => !!value && meridiemMode === 'pm',
|
|
305
|
+
isFocused: () => !!valueOrReferenceDate && meridiemMode === 'pm',
|
|
305
306
|
ariaLabel: pmLabel
|
|
306
307
|
}]
|
|
307
308
|
};
|
|
@@ -332,8 +333,8 @@ const MultiSectionDigitalClock = exports.MultiSectionDigitalClock = /*#__PURE__*
|
|
|
332
333
|
autoFocus: autoFocus ?? focusedView === timeView,
|
|
333
334
|
disabled: disabled,
|
|
334
335
|
readOnly: readOnly,
|
|
335
|
-
slots: slots
|
|
336
|
-
slotProps: slotProps
|
|
336
|
+
slots: slots,
|
|
337
|
+
slotProps: slotProps,
|
|
337
338
|
skipDisabled: skipDisabled,
|
|
338
339
|
"aria-label": localeText.selectViewText(timeView)
|
|
339
340
|
}, timeView))
|
|
@@ -361,18 +362,6 @@ process.env.NODE_ENV !== "production" ? MultiSectionDigitalClock.propTypes = {
|
|
|
361
362
|
*/
|
|
362
363
|
classes: _propTypes.default.object,
|
|
363
364
|
className: _propTypes.default.string,
|
|
364
|
-
/**
|
|
365
|
-
* Overrideable components.
|
|
366
|
-
* @default {}
|
|
367
|
-
* @deprecated Please use `slots`.
|
|
368
|
-
*/
|
|
369
|
-
components: _propTypes.default.object,
|
|
370
|
-
/**
|
|
371
|
-
* The props used for each component slot.
|
|
372
|
-
* @default {}
|
|
373
|
-
* @deprecated Please use `slotProps`.
|
|
374
|
-
*/
|
|
375
|
-
componentsProps: _propTypes.default.object,
|
|
376
365
|
/**
|
|
377
366
|
* The default selected value.
|
|
378
367
|
* Used when the component is not controlled.
|
|
@@ -11,21 +11,26 @@ const getHourSectionOptions = ({
|
|
|
11
11
|
ampm,
|
|
12
12
|
isDisabled,
|
|
13
13
|
resolveAriaLabel,
|
|
14
|
-
timeStep
|
|
14
|
+
timeStep,
|
|
15
|
+
valueOrReferenceDate
|
|
15
16
|
}) => {
|
|
16
17
|
const currentHours = value ? utils.getHours(value) : null;
|
|
17
18
|
const result = [];
|
|
18
|
-
const isSelected = hour => {
|
|
19
|
-
|
|
19
|
+
const isSelected = (hour, overriddenCurrentHours) => {
|
|
20
|
+
const resolvedCurrentHours = overriddenCurrentHours ?? currentHours;
|
|
21
|
+
if (resolvedCurrentHours === null) {
|
|
20
22
|
return false;
|
|
21
23
|
}
|
|
22
24
|
if (ampm) {
|
|
23
25
|
if (hour === 12) {
|
|
24
|
-
return
|
|
26
|
+
return resolvedCurrentHours === 12 || resolvedCurrentHours === 0;
|
|
25
27
|
}
|
|
26
|
-
return
|
|
28
|
+
return resolvedCurrentHours === hour || resolvedCurrentHours - 12 === hour;
|
|
27
29
|
}
|
|
28
|
-
return
|
|
30
|
+
return resolvedCurrentHours === hour;
|
|
31
|
+
};
|
|
32
|
+
const isFocused = hour => {
|
|
33
|
+
return isSelected(hour, utils.getHours(valueOrReferenceDate));
|
|
29
34
|
};
|
|
30
35
|
const endHour = ampm ? 11 : 23;
|
|
31
36
|
for (let hour = 0; hour <= endHour; hour += timeStep) {
|
|
@@ -37,6 +42,7 @@ const getHourSectionOptions = ({
|
|
|
37
42
|
label,
|
|
38
43
|
isSelected,
|
|
39
44
|
isDisabled,
|
|
45
|
+
isFocused,
|
|
40
46
|
ariaLabel
|
|
41
47
|
});
|
|
42
48
|
}
|
|
@@ -57,6 +63,9 @@ const getTimeSectionOptions = ({
|
|
|
57
63
|
}
|
|
58
64
|
return hasValue && value === timeValue;
|
|
59
65
|
};
|
|
66
|
+
const isFocused = timeValue => {
|
|
67
|
+
return value === timeValue;
|
|
68
|
+
};
|
|
60
69
|
return [...Array.from({
|
|
61
70
|
length: Math.ceil(60 / timeStep)
|
|
62
71
|
}, (_, index) => {
|
|
@@ -66,6 +75,7 @@ const getTimeSectionOptions = ({
|
|
|
66
75
|
label: resolveLabel(timeValue),
|
|
67
76
|
isDisabled,
|
|
68
77
|
isSelected,
|
|
78
|
+
isFocused,
|
|
69
79
|
ariaLabel: resolveAriaLabel(timeValue.toString())
|
|
70
80
|
};
|
|
71
81
|
})];
|
|
@@ -92,7 +92,7 @@ const MultiSectionDigitalClockSectionItem = (0, _styles.styled)(_MenuItem.defaul
|
|
|
92
92
|
const MultiSectionDigitalClockSection = exports.MultiSectionDigitalClockSection = /*#__PURE__*/React.forwardRef(function MultiSectionDigitalClockSection(inProps, ref) {
|
|
93
93
|
const containerRef = React.useRef(null);
|
|
94
94
|
const handleRef = (0, _useForkRef.default)(ref, containerRef);
|
|
95
|
-
const
|
|
95
|
+
const previousActive = React.useRef(null);
|
|
96
96
|
const props = (0, _styles.useThemeProps)({
|
|
97
97
|
props: inProps,
|
|
98
98
|
name: 'MuiMultiSectionDigitalClockSection'
|
|
@@ -119,23 +119,24 @@ const MultiSectionDigitalClockSection = exports.MultiSectionDigitalClockSection
|
|
|
119
119
|
if (containerRef.current === null) {
|
|
120
120
|
return;
|
|
121
121
|
}
|
|
122
|
-
const
|
|
123
|
-
if (!
|
|
122
|
+
const activeItem = containerRef.current.querySelector('[role="option"][tabindex="0"], [role="option"][aria-selected="true"]');
|
|
123
|
+
if (!activeItem || previousActive.current === activeItem) {
|
|
124
124
|
// Handle setting the ref to null if the selected item is ever reset via UI
|
|
125
|
-
if (
|
|
126
|
-
|
|
125
|
+
if (previousActive.current !== activeItem) {
|
|
126
|
+
previousActive.current = activeItem;
|
|
127
127
|
}
|
|
128
128
|
return;
|
|
129
129
|
}
|
|
130
|
-
|
|
130
|
+
previousActive.current = activeItem;
|
|
131
131
|
if (active && autoFocus) {
|
|
132
|
-
|
|
132
|
+
activeItem.focus();
|
|
133
133
|
}
|
|
134
|
-
const offsetTop =
|
|
134
|
+
const offsetTop = activeItem.offsetTop;
|
|
135
135
|
|
|
136
136
|
// Subtracting the 4px of extra margin intended for the first visible section item
|
|
137
137
|
containerRef.current.scrollTop = offsetTop - 4;
|
|
138
138
|
});
|
|
139
|
+
const focusedOptionIndex = items.findIndex(item => item.isFocused(item.value));
|
|
139
140
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(MultiSectionDigitalClockSectionRoot, (0, _extends2.default)({
|
|
140
141
|
ref: handleRef,
|
|
141
142
|
className: (0, _clsx.default)(classes.root, className),
|
|
@@ -143,11 +144,12 @@ const MultiSectionDigitalClockSection = exports.MultiSectionDigitalClockSection
|
|
|
143
144
|
autoFocusItem: autoFocus && active,
|
|
144
145
|
role: "listbox"
|
|
145
146
|
}, other, {
|
|
146
|
-
children: items.map(option => {
|
|
147
|
+
children: items.map((option, index) => {
|
|
147
148
|
if (skipDisabled && option.isDisabled?.(option.value)) {
|
|
148
149
|
return null;
|
|
149
150
|
}
|
|
150
151
|
const isSelected = option.isSelected(option.value);
|
|
152
|
+
const tabIndex = focusedOptionIndex === index || focusedOptionIndex === -1 && index === 0 ? 0 : -1;
|
|
151
153
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(DigitalClockSectionItem, (0, _extends2.default)({
|
|
152
154
|
onClick: () => !readOnly && onChange(option.value),
|
|
153
155
|
selected: isSelected,
|
|
@@ -158,7 +160,8 @@ const MultiSectionDigitalClockSection = exports.MultiSectionDigitalClockSection
|
|
|
158
160
|
,
|
|
159
161
|
"aria-disabled": readOnly,
|
|
160
162
|
"aria-label": option.ariaLabel,
|
|
161
|
-
"aria-selected": isSelected
|
|
163
|
+
"aria-selected": isSelected,
|
|
164
|
+
tabIndex: tabIndex
|
|
162
165
|
}, slotProps?.digitalClockSectionItem, {
|
|
163
166
|
children: option.label
|
|
164
167
|
}), option.label);
|
|
@@ -22,7 +22,7 @@ var _PickersArrowSwitcher = require("../internals/components/PickersArrowSwitche
|
|
|
22
22
|
var _dateHelpersHooks = require("../internals/hooks/date-helpers-hooks");
|
|
23
23
|
var _pickersCalendarHeaderClasses = require("./pickersCalendarHeaderClasses");
|
|
24
24
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
25
|
-
const _excluded = ["slots", "slotProps", "
|
|
25
|
+
const _excluded = ["slots", "slotProps", "currentMonth", "disabled", "disableFuture", "disablePast", "maxDate", "minDate", "onMonthChange", "onViewChange", "view", "reduceAnimations", "views", "labelId", "className", "timezone"],
|
|
26
26
|
_excluded2 = ["ownerState"];
|
|
27
27
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
28
28
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -121,7 +121,6 @@ const PickersCalendarHeader = exports.PickersCalendarHeader = /*#__PURE__*/React
|
|
|
121
121
|
const {
|
|
122
122
|
slots,
|
|
123
123
|
slotProps,
|
|
124
|
-
components,
|
|
125
124
|
currentMonth: month,
|
|
126
125
|
disabled,
|
|
127
126
|
disableFuture,
|
|
@@ -140,7 +139,7 @@ const PickersCalendarHeader = exports.PickersCalendarHeader = /*#__PURE__*/React
|
|
|
140
139
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
141
140
|
const ownerState = props;
|
|
142
141
|
const classes = useUtilityClasses(props);
|
|
143
|
-
const SwitchViewButton = slots?.switchViewButton ??
|
|
142
|
+
const SwitchViewButton = slots?.switchViewButton ?? PickersCalendarHeaderSwitchViewButton;
|
|
144
143
|
const switchViewButtonProps = (0, _utils.useSlotProps)({
|
|
145
144
|
elementType: SwitchViewButton,
|
|
146
145
|
externalSlotProps: slotProps?.switchViewButton,
|
|
@@ -151,7 +150,7 @@ const PickersCalendarHeader = exports.PickersCalendarHeader = /*#__PURE__*/React
|
|
|
151
150
|
ownerState,
|
|
152
151
|
className: classes.switchViewButton
|
|
153
152
|
});
|
|
154
|
-
const SwitchViewIcon = slots?.switchViewIcon ??
|
|
153
|
+
const SwitchViewIcon = slots?.switchViewIcon ?? PickersCalendarHeaderSwitchViewIcon;
|
|
155
154
|
// The spread is here to avoid this bug mui/material-ui#34056
|
|
156
155
|
const _useSlotProps = (0, _utils.useSlotProps)({
|
|
157
156
|
elementType: SwitchViewIcon,
|
|
@@ -241,18 +240,6 @@ process.env.NODE_ENV !== "production" ? PickersCalendarHeader.propTypes = {
|
|
|
241
240
|
* className applied to the root element.
|
|
242
241
|
*/
|
|
243
242
|
className: _propTypes.default.string,
|
|
244
|
-
/**
|
|
245
|
-
* Overridable components.
|
|
246
|
-
* @default {}
|
|
247
|
-
* @deprecated Please use `slots`.
|
|
248
|
-
*/
|
|
249
|
-
components: _propTypes.default.object,
|
|
250
|
-
/**
|
|
251
|
-
* The props used for each component slot.
|
|
252
|
-
* @default {}
|
|
253
|
-
* @deprecated Please use `slotProps`.
|
|
254
|
-
*/
|
|
255
|
-
componentsProps: _propTypes.default.object,
|
|
256
243
|
currentMonth: _propTypes.default.any.isRequired,
|
|
257
244
|
disabled: _propTypes.default.bool,
|
|
258
245
|
disableFuture: _propTypes.default.bool,
|
|
@@ -131,18 +131,6 @@ process.env.NODE_ENV !== "production" ? PickersLayout.propTypes = {
|
|
|
131
131
|
children: _propTypes.default.node,
|
|
132
132
|
classes: _propTypes.default.object,
|
|
133
133
|
className: _propTypes.default.string,
|
|
134
|
-
/**
|
|
135
|
-
* Overridable components.
|
|
136
|
-
* @default {}
|
|
137
|
-
* @deprecated Please use `slots`.
|
|
138
|
-
*/
|
|
139
|
-
components: _propTypes.default.object,
|
|
140
|
-
/**
|
|
141
|
-
* The props used for each component slot.
|
|
142
|
-
* @default {}
|
|
143
|
-
* @deprecated Please use `slotProps`.
|
|
144
|
-
*/
|
|
145
|
-
componentsProps: _propTypes.default.object,
|
|
146
134
|
disabled: _propTypes.default.bool,
|
|
147
135
|
isLandscape: _propTypes.default.bool.isRequired,
|
|
148
136
|
isValid: _propTypes.default.func.isRequired,
|
|
@@ -12,7 +12,6 @@ var _utils2 = require("@mui/utils");
|
|
|
12
12
|
var _PickersActionBar = require("../PickersActionBar");
|
|
13
13
|
var _pickersLayoutClasses = require("./pickersLayoutClasses");
|
|
14
14
|
var _PickersShortcuts = require("../PickersShortcuts");
|
|
15
|
-
var _slotsMigration = require("../internals/utils/slots-migration");
|
|
16
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
16
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
18
17
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -53,17 +52,13 @@ const usePickerLayout = props => {
|
|
|
53
52
|
disabled,
|
|
54
53
|
readOnly,
|
|
55
54
|
children,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
slots: innerSlots,
|
|
59
|
-
slotProps: innerSlotProps
|
|
55
|
+
slots,
|
|
56
|
+
slotProps
|
|
60
57
|
// TODO: Remove this "as" hack. It get introduced to mark `value` prop in PickersLayoutProps as not required.
|
|
61
58
|
// The true type should be
|
|
62
59
|
// - For pickers value: TDate | null
|
|
63
60
|
// - For range pickers value: [TDate | null, TDate | null]
|
|
64
61
|
} = props;
|
|
65
|
-
const slots = innerSlots ?? (0, _slotsMigration.uncapitalizeObjectKeys)(components);
|
|
66
|
-
const slotProps = innerSlotProps ?? componentsProps;
|
|
67
62
|
const classes = useUtilityClasses(props);
|
|
68
63
|
|
|
69
64
|
// Action bar
|
|
@@ -72,18 +72,6 @@ StaticDatePicker.propTypes = {
|
|
|
72
72
|
* Class name applied to the root element.
|
|
73
73
|
*/
|
|
74
74
|
className: _propTypes.default.string,
|
|
75
|
-
/**
|
|
76
|
-
* Overridable components.
|
|
77
|
-
* @default {}
|
|
78
|
-
* @deprecated Please use `slots`.
|
|
79
|
-
*/
|
|
80
|
-
components: _propTypes.default.object,
|
|
81
|
-
/**
|
|
82
|
-
* The props used for each component slot.
|
|
83
|
-
* @default {}
|
|
84
|
-
* @deprecated Please use `slotProps`.
|
|
85
|
-
*/
|
|
86
|
-
componentsProps: _propTypes.default.object,
|
|
87
75
|
/**
|
|
88
76
|
* Formats the day of week displayed in the calendar header.
|
|
89
77
|
* @param {string} day The day of week provided by the adapter. Deprecated, will be removed in v7: Use `date` instead.
|
|
@@ -92,18 +92,6 @@ StaticDateTimePicker.propTypes = {
|
|
|
92
92
|
* Class name applied to the root element.
|
|
93
93
|
*/
|
|
94
94
|
className: _propTypes.default.string,
|
|
95
|
-
/**
|
|
96
|
-
* Overridable components.
|
|
97
|
-
* @default {}
|
|
98
|
-
* @deprecated Please use `slots`.
|
|
99
|
-
*/
|
|
100
|
-
components: _propTypes.default.object,
|
|
101
|
-
/**
|
|
102
|
-
* The props used for each component slot.
|
|
103
|
-
* @default {}
|
|
104
|
-
* @deprecated Please use `slotProps`.
|
|
105
|
-
*/
|
|
106
|
-
componentsProps: _propTypes.default.object,
|
|
107
95
|
/**
|
|
108
96
|
* Formats the day of week displayed in the calendar header.
|
|
109
97
|
* @param {string} day The day of week provided by the adapter. Deprecated, will be removed in v7: Use `date` instead.
|
|
@@ -84,18 +84,6 @@ StaticTimePicker.propTypes = {
|
|
|
84
84
|
* Class name applied to the root element.
|
|
85
85
|
*/
|
|
86
86
|
className: _propTypes.default.string,
|
|
87
|
-
/**
|
|
88
|
-
* Overridable components.
|
|
89
|
-
* @default {}
|
|
90
|
-
* @deprecated Please use `slots`.
|
|
91
|
-
*/
|
|
92
|
-
components: _propTypes.default.object,
|
|
93
|
-
/**
|
|
94
|
-
* The props used for each component slot.
|
|
95
|
-
* @default {}
|
|
96
|
-
* @deprecated Please use `slotProps`.
|
|
97
|
-
*/
|
|
98
|
-
componentsProps: _propTypes.default.object,
|
|
99
87
|
/**
|
|
100
88
|
* The default value.
|
|
101
89
|
* Used when the component is not controlled.
|
|
@@ -23,10 +23,9 @@ var _Clock = require("./Clock");
|
|
|
23
23
|
var _ClockNumbers = require("./ClockNumbers");
|
|
24
24
|
var _useValueWithTimezone = require("../internals/hooks/useValueWithTimezone");
|
|
25
25
|
var _valueManagers = require("../internals/utils/valueManagers");
|
|
26
|
-
var _slotsMigration = require("../internals/utils/slots-migration");
|
|
27
26
|
var _useClockReferenceDate = require("../internals/hooks/useClockReferenceDate");
|
|
28
27
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
29
|
-
const _excluded = ["ampm", "ampmInClock", "autoFocus", "
|
|
28
|
+
const _excluded = ["ampm", "ampmInClock", "autoFocus", "slots", "slotProps", "value", "defaultValue", "referenceDate", "disableIgnoringDatePartForTimeValidation", "maxTime", "minTime", "disableFuture", "disablePast", "minutesStep", "shouldDisableClock", "shouldDisableTime", "showViewSwitcher", "onChange", "view", "views", "openTo", "onViewChange", "focusedView", "onFocusedViewChange", "className", "disabled", "readOnly", "timezone"];
|
|
30
29
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
31
30
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
32
31
|
const useUtilityClasses = ownerState => {
|
|
@@ -79,10 +78,8 @@ const TimeClock = exports.TimeClock = /*#__PURE__*/React.forwardRef(function Tim
|
|
|
79
78
|
ampm = utils.is12HourCycleInCurrentLocale(),
|
|
80
79
|
ampmInClock = false,
|
|
81
80
|
autoFocus,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
slots: innerSlots,
|
|
85
|
-
slotProps: innerSlotProps,
|
|
81
|
+
slots,
|
|
82
|
+
slotProps,
|
|
86
83
|
value: valueProp,
|
|
87
84
|
defaultValue,
|
|
88
85
|
referenceDate: referenceDateProp,
|
|
@@ -108,8 +105,6 @@ const TimeClock = exports.TimeClock = /*#__PURE__*/React.forwardRef(function Tim
|
|
|
108
105
|
timezone: timezoneProp
|
|
109
106
|
} = props,
|
|
110
107
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
111
|
-
const slots = innerSlots ?? (0, _slotsMigration.uncapitalizeObjectKeys)(components);
|
|
112
|
-
const slotProps = innerSlotProps ?? componentsProps;
|
|
113
108
|
const {
|
|
114
109
|
value,
|
|
115
110
|
handleValueChange,
|
|
@@ -354,18 +349,6 @@ process.env.NODE_ENV !== "production" ? TimeClock.propTypes = {
|
|
|
354
349
|
*/
|
|
355
350
|
classes: _propTypes.default.object,
|
|
356
351
|
className: _propTypes.default.string,
|
|
357
|
-
/**
|
|
358
|
-
* Overridable components.
|
|
359
|
-
* @default {}
|
|
360
|
-
* @deprecated Please use `slots`.
|
|
361
|
-
*/
|
|
362
|
-
components: _propTypes.default.object,
|
|
363
|
-
/**
|
|
364
|
-
* The props used for each component slot.
|
|
365
|
-
* @default {}
|
|
366
|
-
* @deprecated Please use `slotProps`.
|
|
367
|
-
*/
|
|
368
|
-
componentsProps: _propTypes.default.object,
|
|
369
352
|
/**
|
|
370
353
|
* The default selected value.
|
|
371
354
|
* Used when the component is not controlled.
|