@mui/x-date-pickers 7.0.0-beta.7 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AdapterDateFns/AdapterDateFns.js +1 -1
- package/AdapterDateFnsBase/AdapterDateFnsBase.js +1 -2
- package/AdapterDateFnsJalali/AdapterDateFnsJalali.js +2 -4
- package/AdapterDateFnsV3/AdapterDateFnsV3.js +1 -1
- package/AdapterDayjs/AdapterDayjs.js +2 -4
- package/AdapterLuxon/AdapterLuxon.js +12 -9
- package/AdapterMoment/AdapterMoment.js +5 -6
- package/CHANGELOG.md +195 -12
- package/DateCalendar/DateCalendar.js +14 -16
- package/DateCalendar/DayCalendar.js +5 -6
- package/DateField/DateField.js +3 -4
- package/DatePicker/DatePicker.js +1 -1
- package/DatePicker/shared.d.ts +2 -1
- package/DatePicker/shared.js +3 -5
- package/DateTimeField/DateTimeField.js +3 -4
- package/DateTimePicker/DateTimePicker.js +1 -1
- package/DateTimePicker/DateTimePickerToolbar.js +1 -1
- package/DateTimePicker/shared.d.ts +2 -1
- package/DateTimePicker/shared.js +11 -13
- package/DesktopDatePicker/DesktopDatePicker.js +7 -11
- package/DesktopDateTimePicker/DesktopDateTimePicker.js +72 -37
- package/DesktopDateTimePicker/DesktopDateTimePickerLayout.d.ts +12 -0
- package/DesktopDateTimePicker/DesktopDateTimePickerLayout.js +101 -0
- package/DesktopDateTimePicker/index.d.ts +1 -0
- package/DesktopDateTimePicker/index.js +2 -1
- package/DesktopTimePicker/DesktopTimePicker.js +8 -12
- package/DigitalClock/DigitalClock.js +2 -3
- package/LocalizationProvider/LocalizationProvider.js +1 -2
- package/MobileDatePicker/MobileDatePicker.js +6 -10
- package/MobileDateTimePicker/MobileDateTimePicker.js +8 -12
- package/MobileTimePicker/MobileTimePicker.js +6 -10
- package/MonthCalendar/MonthCalendar.js +4 -4
- package/MonthCalendar/PickersMonth.js +1 -2
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +1 -1
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +1 -1
- package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +3 -5
- package/PickersActionBar/PickersActionBar.js +1 -1
- package/PickersCalendarHeader/PickersCalendarHeader.js +4 -5
- package/PickersLayout/usePickerLayout.js +8 -9
- package/PickersSectionList/PickersSectionList.js +9 -11
- package/PickersTextField/PickersFilledInput/PickersFilledInput.js +2 -3
- package/PickersTextField/PickersInput/PickersInput.js +1 -1
- package/PickersTextField/PickersInputBase/PickersInputBase.js +4 -5
- package/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.js +2 -2
- package/README.md +1 -1
- package/StaticDatePicker/StaticDatePicker.js +4 -5
- package/StaticDateTimePicker/StaticDateTimePicker.js +6 -7
- package/StaticTimePicker/StaticTimePicker.js +3 -4
- package/TimeClock/TimeClock.js +1 -1
- package/TimeField/TimeField.js +2 -3
- package/TimePicker/shared.d.ts +2 -1
- package/TimePicker/shared.js +5 -7
- package/YearCalendar/YearCalendar.js +5 -6
- package/hooks/useClearableField.js +6 -7
- package/index.js +1 -1
- package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +8 -9
- package/internals/components/PickersModalDialog.js +6 -7
- package/internals/components/PickersPopper.js +13 -16
- package/internals/components/PickersToolbar.js +9 -12
- package/internals/hooks/date-helpers-hooks.js +1 -1
- package/internals/hooks/defaultizedFieldProps.js +15 -18
- package/internals/hooks/useClockReferenceDate.js +1 -1
- package/internals/hooks/useDesktopPicker/index.d.ts +1 -1
- package/internals/hooks/useDesktopPicker/useDesktopPicker.js +11 -12
- package/internals/hooks/useDesktopPicker/useDesktopPicker.types.d.ts +2 -2
- package/internals/hooks/useField/buildSectionsFromFormat.js +35 -31
- package/internals/hooks/useField/useField.js +2 -2
- package/internals/hooks/useField/useField.utils.js +4 -7
- package/internals/hooks/useField/useFieldCharacterEditing.js +1 -2
- package/internals/hooks/useField/useFieldState.js +1 -1
- package/internals/hooks/useField/useFieldV6TextField.js +9 -15
- package/internals/hooks/useField/useFieldV7TextField.js +9 -11
- package/internals/hooks/useMobilePicker/useMobilePicker.js +7 -8
- package/internals/hooks/useOpenState.js +1 -1
- package/internals/hooks/usePicker/index.d.ts +1 -0
- package/internals/hooks/usePicker/usePickerViews.d.ts +4 -2
- package/internals/hooks/usePicker/usePickerViews.js +1 -2
- package/internals/hooks/useStaticPicker/useStaticPicker.js +13 -17
- package/internals/hooks/useValueWithTimezone.js +5 -6
- package/internals/hooks/useViews.js +3 -4
- package/internals/index.d.ts +1 -1
- package/internals/models/validation.d.ts +1 -1
- package/internals/utils/convertFieldResponseIntoMuiTextFieldProps.js +3 -3
- package/internals/utils/date-time-utils.js +2 -5
- package/internals/utils/fields.js +1 -1
- package/internals/utils/getDefaultReferenceDate.js +2 -6
- package/internals/utils/views.js +1 -1
- package/locales/csCZ.js +1 -4
- package/locales/daDK.js +1 -4
- package/locales/deDE.js +1 -4
- package/locales/huHU.js +1 -4
- package/locales/jaJP.js +1 -4
- package/locales/roRO.js +1 -4
- package/locales/skSK.js +1 -4
- package/modern/AdapterLuxon/AdapterLuxon.js +9 -4
- package/modern/DateCalendar/DateCalendar.js +1 -1
- package/modern/DateField/DateField.js +1 -1
- package/modern/DatePicker/DatePicker.js +1 -1
- package/modern/DateTimeField/DateTimeField.js +1 -1
- package/modern/DateTimePicker/DateTimePicker.js +1 -1
- package/modern/DesktopDatePicker/DesktopDatePicker.js +1 -1
- package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +64 -25
- package/modern/DesktopDateTimePicker/DesktopDateTimePickerLayout.js +101 -0
- package/modern/DesktopDateTimePicker/index.js +2 -1
- package/modern/MobileDatePicker/MobileDatePicker.js +1 -1
- package/modern/MobileDateTimePicker/MobileDateTimePicker.js +1 -1
- package/modern/StaticDatePicker/StaticDatePicker.js +1 -1
- package/modern/StaticDateTimePicker/StaticDateTimePicker.js +1 -1
- package/modern/index.js +1 -1
- package/modern/internals/components/PickersPopper.js +1 -1
- package/modern/internals/hooks/useField/buildSectionsFromFormat.js +34 -30
- package/modern/internals/hooks/useField/useFieldV7TextField.js +1 -1
- package/modern/internals/hooks/useOpenState.js +1 -1
- package/modern/internals/utils/fields.js +1 -1
- package/node/AdapterLuxon/AdapterLuxon.js +9 -4
- package/node/DateCalendar/DateCalendar.js +1 -1
- package/node/DateField/DateField.js +1 -1
- package/node/DatePicker/DatePicker.js +1 -1
- package/node/DateTimeField/DateTimeField.js +1 -1
- package/node/DateTimePicker/DateTimePicker.js +1 -1
- package/node/DesktopDatePicker/DesktopDatePicker.js +1 -1
- package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +63 -25
- package/node/DesktopDateTimePicker/DesktopDateTimePickerLayout.js +108 -0
- package/node/DesktopDateTimePicker/index.js +8 -1
- package/node/MobileDatePicker/MobileDatePicker.js +1 -1
- package/node/MobileDateTimePicker/MobileDateTimePicker.js +1 -1
- package/node/StaticDatePicker/StaticDatePicker.js +1 -1
- package/node/StaticDateTimePicker/StaticDateTimePicker.js +1 -1
- package/node/index.js +1 -1
- package/node/internals/components/PickersPopper.js +1 -1
- package/node/internals/hooks/useField/buildSectionsFromFormat.js +34 -30
- package/node/internals/hooks/useField/useFieldV7TextField.js +1 -1
- package/node/internals/hooks/useOpenState.js +1 -1
- package/node/internals/utils/fields.js +1 -1
- package/package.json +5 -5
- package/timeViewRenderers/timeViewRenderers.js +1 -1
- package/dateTimeViewRenderers/dateTimeViewRenderers.d.ts +0 -15
- package/dateTimeViewRenderers/dateTimeViewRenderers.js +0 -163
- package/dateTimeViewRenderers/index.d.ts +0 -2
- package/dateTimeViewRenderers/index.js +0 -1
- package/dateTimeViewRenderers/package.json +0 -6
- package/modern/dateTimeViewRenderers/dateTimeViewRenderers.js +0 -162
- package/modern/dateTimeViewRenderers/index.js +0 -1
- package/node/dateTimeViewRenderers/dateTimeViewRenderers.js +0 -171
- package/node/dateTimeViewRenderers/index.js +0 -12
|
@@ -23,7 +23,6 @@ import { resolveDateFormat } from '../internals/utils/date-utils';
|
|
|
23
23
|
* - [MobileDatePicker API](https://mui.com/x/api/date-pickers/mobile-date-picker/)
|
|
24
24
|
*/
|
|
25
25
|
const MobileDatePicker = /*#__PURE__*/React.forwardRef(function MobileDatePicker(inProps, ref) {
|
|
26
|
-
var _defaultizedProps$slo2, _props$localeText$ope, _props$localeText;
|
|
27
26
|
const localeText = useLocaleText();
|
|
28
27
|
const utils = useUtils();
|
|
29
28
|
|
|
@@ -43,15 +42,12 @@ const MobileDatePicker = /*#__PURE__*/React.forwardRef(function MobileDatePicker
|
|
|
43
42
|
field: DateField
|
|
44
43
|
}, defaultizedProps.slots),
|
|
45
44
|
slotProps: _extends({}, defaultizedProps.slotProps, {
|
|
46
|
-
field: ownerState => {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
ref
|
|
50
|
-
});
|
|
51
|
-
},
|
|
45
|
+
field: ownerState => _extends({}, resolveComponentProps(defaultizedProps.slotProps?.field, ownerState), extractValidationProps(defaultizedProps), {
|
|
46
|
+
ref
|
|
47
|
+
}),
|
|
52
48
|
toolbar: _extends({
|
|
53
49
|
hidden: false
|
|
54
|
-
},
|
|
50
|
+
}, defaultizedProps.slotProps?.toolbar)
|
|
55
51
|
})
|
|
56
52
|
});
|
|
57
53
|
const {
|
|
@@ -60,7 +56,7 @@ const MobileDatePicker = /*#__PURE__*/React.forwardRef(function MobileDatePicker
|
|
|
60
56
|
props,
|
|
61
57
|
valueManager: singleItemValueManager,
|
|
62
58
|
valueType: 'date',
|
|
63
|
-
getOpenDialogAriaText:
|
|
59
|
+
getOpenDialogAriaText: props.localeText?.openDatePickerDialogue ?? localeText.openDatePickerDialogue,
|
|
64
60
|
validator: validateDate
|
|
65
61
|
});
|
|
66
62
|
return renderPicker();
|
|
@@ -282,7 +278,7 @@ MobileDatePicker.propTypes = {
|
|
|
282
278
|
/**
|
|
283
279
|
* Disable specific date.
|
|
284
280
|
*
|
|
285
|
-
* Warning: This function can be called multiple times (
|
|
281
|
+
* Warning: This function can be called multiple times (for example when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.
|
|
286
282
|
*
|
|
287
283
|
* @template TDate
|
|
288
284
|
* @param {TDate} day The date to test.
|
|
@@ -24,7 +24,6 @@ import { resolveDateTimeFormat } from '../internals/utils/date-time-utils';
|
|
|
24
24
|
* - [MobileDateTimePicker API](https://mui.com/x/api/date-pickers/mobile-date-time-picker/)
|
|
25
25
|
*/
|
|
26
26
|
const MobileDateTimePicker = /*#__PURE__*/React.forwardRef(function MobileDateTimePicker(inProps, ref) {
|
|
27
|
-
var _defaultizedProps$amp, _defaultizedProps$slo2, _defaultizedProps$slo3, _props$localeText$ope, _props$localeText;
|
|
28
27
|
const localeText = useLocaleText();
|
|
29
28
|
const utils = useUtils();
|
|
30
29
|
|
|
@@ -38,7 +37,7 @@ const MobileDateTimePicker = /*#__PURE__*/React.forwardRef(function MobileDateTi
|
|
|
38
37
|
minutes: renderTimeViewClock,
|
|
39
38
|
seconds: renderTimeViewClock
|
|
40
39
|
}, defaultizedProps.viewRenderers);
|
|
41
|
-
const ampmInClock =
|
|
40
|
+
const ampmInClock = defaultizedProps.ampmInClock ?? false;
|
|
42
41
|
|
|
43
42
|
// Props with the default values specific to the mobile variant
|
|
44
43
|
const props = _extends({}, defaultizedProps, {
|
|
@@ -49,19 +48,16 @@ const MobileDateTimePicker = /*#__PURE__*/React.forwardRef(function MobileDateTi
|
|
|
49
48
|
field: DateTimeField
|
|
50
49
|
}, defaultizedProps.slots),
|
|
51
50
|
slotProps: _extends({}, defaultizedProps.slotProps, {
|
|
52
|
-
field: ownerState => {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
ref
|
|
56
|
-
});
|
|
57
|
-
},
|
|
51
|
+
field: ownerState => _extends({}, resolveComponentProps(defaultizedProps.slotProps?.field, ownerState), extractValidationProps(defaultizedProps), {
|
|
52
|
+
ref
|
|
53
|
+
}),
|
|
58
54
|
toolbar: _extends({
|
|
59
55
|
hidden: false,
|
|
60
56
|
ampmInClock
|
|
61
|
-
},
|
|
57
|
+
}, defaultizedProps.slotProps?.toolbar),
|
|
62
58
|
tabs: _extends({
|
|
63
59
|
hidden: false
|
|
64
|
-
},
|
|
60
|
+
}, defaultizedProps.slotProps?.tabs)
|
|
65
61
|
})
|
|
66
62
|
});
|
|
67
63
|
const {
|
|
@@ -70,7 +66,7 @@ const MobileDateTimePicker = /*#__PURE__*/React.forwardRef(function MobileDateTi
|
|
|
70
66
|
props,
|
|
71
67
|
valueManager: singleItemValueManager,
|
|
72
68
|
valueType: 'date-time',
|
|
73
|
-
getOpenDialogAriaText:
|
|
69
|
+
getOpenDialogAriaText: props.localeText?.openDatePickerDialogue ?? localeText.openDatePickerDialogue,
|
|
74
70
|
validator: validateDateTime
|
|
75
71
|
});
|
|
76
72
|
return renderPicker();
|
|
@@ -330,7 +326,7 @@ MobileDateTimePicker.propTypes = {
|
|
|
330
326
|
/**
|
|
331
327
|
* Disable specific date.
|
|
332
328
|
*
|
|
333
|
-
* Warning: This function can be called multiple times (
|
|
329
|
+
* Warning: This function can be called multiple times (for example when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.
|
|
334
330
|
*
|
|
335
331
|
* @template TDate
|
|
336
332
|
* @param {TDate} day The date to test.
|
|
@@ -23,7 +23,6 @@ import { resolveTimeFormat } from '../internals/utils/time-utils';
|
|
|
23
23
|
* - [MobileTimePicker API](https://mui.com/x/api/date-pickers/mobile-time-picker/)
|
|
24
24
|
*/
|
|
25
25
|
const MobileTimePicker = /*#__PURE__*/React.forwardRef(function MobileTimePicker(inProps, ref) {
|
|
26
|
-
var _defaultizedProps$amp, _defaultizedProps$slo2, _props$localeText$ope, _props$localeText;
|
|
27
26
|
const localeText = useLocaleText();
|
|
28
27
|
const utils = useUtils();
|
|
29
28
|
|
|
@@ -34,7 +33,7 @@ const MobileTimePicker = /*#__PURE__*/React.forwardRef(function MobileTimePicker
|
|
|
34
33
|
minutes: renderTimeViewClock,
|
|
35
34
|
seconds: renderTimeViewClock
|
|
36
35
|
}, defaultizedProps.viewRenderers);
|
|
37
|
-
const ampmInClock =
|
|
36
|
+
const ampmInClock = defaultizedProps.ampmInClock ?? false;
|
|
38
37
|
|
|
39
38
|
// Props with the default values specific to the mobile variant
|
|
40
39
|
const props = _extends({}, defaultizedProps, {
|
|
@@ -45,16 +44,13 @@ const MobileTimePicker = /*#__PURE__*/React.forwardRef(function MobileTimePicker
|
|
|
45
44
|
field: TimeField
|
|
46
45
|
}, defaultizedProps.slots),
|
|
47
46
|
slotProps: _extends({}, defaultizedProps.slotProps, {
|
|
48
|
-
field: ownerState => {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
ref
|
|
52
|
-
});
|
|
53
|
-
},
|
|
47
|
+
field: ownerState => _extends({}, resolveComponentProps(defaultizedProps.slotProps?.field, ownerState), extractValidationProps(defaultizedProps), {
|
|
48
|
+
ref
|
|
49
|
+
}),
|
|
54
50
|
toolbar: _extends({
|
|
55
51
|
hidden: false,
|
|
56
52
|
ampmInClock
|
|
57
|
-
},
|
|
53
|
+
}, defaultizedProps.slotProps?.toolbar)
|
|
58
54
|
})
|
|
59
55
|
});
|
|
60
56
|
const {
|
|
@@ -63,7 +59,7 @@ const MobileTimePicker = /*#__PURE__*/React.forwardRef(function MobileTimePicker
|
|
|
63
59
|
props,
|
|
64
60
|
valueManager: singleItemValueManager,
|
|
65
61
|
valueType: 'time',
|
|
66
|
-
getOpenDialogAriaText:
|
|
62
|
+
getOpenDialogAriaText: props.localeText?.openTimePickerDialogue ?? localeText.openTimePickerDialogue,
|
|
67
63
|
validator: validateTime
|
|
68
64
|
});
|
|
69
65
|
return renderPicker();
|
|
@@ -124,7 +124,7 @@ export const MonthCalendar = /*#__PURE__*/React.forwardRef(function MonthCalenda
|
|
|
124
124
|
name: 'MonthCalendar',
|
|
125
125
|
state: 'hasFocus',
|
|
126
126
|
controlled: hasFocus,
|
|
127
|
-
default: autoFocus
|
|
127
|
+
default: autoFocus ?? false
|
|
128
128
|
});
|
|
129
129
|
const changeHasFocus = useEventCallback(newHasFocus => {
|
|
130
130
|
setInternalHasFocus(newHasFocus);
|
|
@@ -151,11 +151,11 @@ export const MonthCalendar = /*#__PURE__*/React.forwardRef(function MonthCalenda
|
|
|
151
151
|
if (readOnly) {
|
|
152
152
|
return;
|
|
153
153
|
}
|
|
154
|
-
const newDate = utils.setMonth(value
|
|
154
|
+
const newDate = utils.setMonth(value ?? referenceDate, month);
|
|
155
155
|
handleValueChange(newDate);
|
|
156
156
|
});
|
|
157
157
|
const focusMonth = useEventCallback(month => {
|
|
158
|
-
if (!isMonthDisabled(utils.setMonth(value
|
|
158
|
+
if (!isMonthDisabled(utils.setMonth(value ?? referenceDate, month))) {
|
|
159
159
|
setFocusedMonth(month);
|
|
160
160
|
changeHasFocus(true);
|
|
161
161
|
if (onMonthFocus) {
|
|
@@ -205,7 +205,7 @@ export const MonthCalendar = /*#__PURE__*/React.forwardRef(function MonthCalenda
|
|
|
205
205
|
role: "radiogroup",
|
|
206
206
|
"aria-labelledby": gridLabelId
|
|
207
207
|
}, other, {
|
|
208
|
-
children: getMonthsInYear(utils, value
|
|
208
|
+
children: getMonthsInYear(utils, value ?? referenceDate).map(month => {
|
|
209
209
|
const monthNumber = utils.getMonth(month);
|
|
210
210
|
const monthText = utils.format(month, 'monthShort');
|
|
211
211
|
const monthLabel = utils.format(month, 'month');
|
|
@@ -101,8 +101,7 @@ export const PickersMonth = /*#__PURE__*/React.memo(function PickersMonth(inProp
|
|
|
101
101
|
const classes = useUtilityClasses(props);
|
|
102
102
|
useEnhancedEffect(() => {
|
|
103
103
|
if (autoFocus) {
|
|
104
|
-
|
|
105
|
-
(_ref$current = ref.current) == null || _ref$current.focus();
|
|
104
|
+
ref.current?.focus();
|
|
106
105
|
}
|
|
107
106
|
}, [autoFocus]);
|
|
108
107
|
return /*#__PURE__*/_jsx(PickersMonthRoot, _extends({
|
|
@@ -314,7 +314,7 @@ export const MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function M
|
|
|
314
314
|
items: viewOptions.items,
|
|
315
315
|
onChange: viewOptions.onChange,
|
|
316
316
|
active: view === timeView,
|
|
317
|
-
autoFocus: autoFocus
|
|
317
|
+
autoFocus: autoFocus ?? focusedView === timeView,
|
|
318
318
|
disabled: disabled,
|
|
319
319
|
readOnly: readOnly,
|
|
320
320
|
slots: slots,
|
|
@@ -11,7 +11,7 @@ export const getHourSectionOptions = ({
|
|
|
11
11
|
const currentHours = value ? utils.getHours(value) : null;
|
|
12
12
|
const result = [];
|
|
13
13
|
const isSelected = (hour, overriddenCurrentHours) => {
|
|
14
|
-
const resolvedCurrentHours = overriddenCurrentHours
|
|
14
|
+
const resolvedCurrentHours = overriddenCurrentHours ?? currentHours;
|
|
15
15
|
if (resolvedCurrentHours === null) {
|
|
16
16
|
return false;
|
|
17
17
|
}
|
|
@@ -86,7 +86,6 @@ const MultiSectionDigitalClockSectionItem = styled(MenuItem, {
|
|
|
86
86
|
* @ignore - internal component.
|
|
87
87
|
*/
|
|
88
88
|
export const MultiSectionDigitalClockSection = /*#__PURE__*/React.forwardRef(function MultiSectionDigitalClockSection(inProps, ref) {
|
|
89
|
-
var _slots$digitalClockSe;
|
|
90
89
|
const containerRef = React.useRef(null);
|
|
91
90
|
const handleRef = useForkRef(ref, containerRef);
|
|
92
91
|
const previousActive = React.useRef(null);
|
|
@@ -111,7 +110,7 @@ export const MultiSectionDigitalClockSection = /*#__PURE__*/React.forwardRef(fun
|
|
|
111
110
|
alreadyRendered: !!containerRef.current
|
|
112
111
|
}), [props]);
|
|
113
112
|
const classes = useUtilityClasses(ownerState);
|
|
114
|
-
const DigitalClockSectionItem =
|
|
113
|
+
const DigitalClockSectionItem = slots?.digitalClockSectionItem ?? MultiSectionDigitalClockSectionItem;
|
|
115
114
|
React.useEffect(() => {
|
|
116
115
|
if (containerRef.current === null) {
|
|
117
116
|
return;
|
|
@@ -138,8 +137,7 @@ export const MultiSectionDigitalClockSection = /*#__PURE__*/React.forwardRef(fun
|
|
|
138
137
|
role: "listbox"
|
|
139
138
|
}, other, {
|
|
140
139
|
children: items.map((option, index) => {
|
|
141
|
-
|
|
142
|
-
const isItemDisabled = (_option$isDisabled = option.isDisabled) == null ? void 0 : _option$isDisabled.call(option, option.value);
|
|
140
|
+
const isItemDisabled = option.isDisabled?.(option.value);
|
|
143
141
|
const isDisabled = disabled || isItemDisabled;
|
|
144
142
|
if (skipDisabled && isDisabled) {
|
|
145
143
|
return null;
|
|
@@ -159,7 +157,7 @@ export const MultiSectionDigitalClockSection = /*#__PURE__*/React.forwardRef(fun
|
|
|
159
157
|
"aria-selected": isSelected,
|
|
160
158
|
tabIndex: tabIndex,
|
|
161
159
|
className: classes.item
|
|
162
|
-
}, slotProps
|
|
160
|
+
}, slotProps?.digitalClockSectionItem, {
|
|
163
161
|
children: option.label
|
|
164
162
|
}), option.label);
|
|
165
163
|
})
|
|
@@ -30,7 +30,7 @@ function PickersActionBar(props) {
|
|
|
30
30
|
if (actions == null || actions.length === 0) {
|
|
31
31
|
return null;
|
|
32
32
|
}
|
|
33
|
-
const buttons = actions
|
|
33
|
+
const buttons = actions?.map(actionType => {
|
|
34
34
|
switch (actionType) {
|
|
35
35
|
case 'clear':
|
|
36
36
|
return /*#__PURE__*/_jsx(Button, {
|
|
@@ -104,7 +104,6 @@ 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 _slots$switchViewButt, _slots$switchViewIcon;
|
|
108
107
|
const localeText = useLocaleText();
|
|
109
108
|
const utils = useUtils();
|
|
110
109
|
const props = useThemeProps({
|
|
@@ -133,10 +132,10 @@ 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?.switchViewButton ?? PickersCalendarHeaderSwitchViewButton;
|
|
137
136
|
const switchViewButtonProps = useSlotProps({
|
|
138
137
|
elementType: SwitchViewButton,
|
|
139
|
-
externalSlotProps: slotProps
|
|
138
|
+
externalSlotProps: slotProps?.switchViewButton,
|
|
140
139
|
additionalProps: {
|
|
141
140
|
size: 'small',
|
|
142
141
|
'aria-label': localeText.calendarViewSwitchingButtonAriaLabel(view)
|
|
@@ -144,11 +143,11 @@ 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 ?? PickersCalendarHeaderSwitchViewIcon;
|
|
148
147
|
// The spread is here to avoid this bug mui/material-ui#34056
|
|
149
148
|
const _useSlotProps = useSlotProps({
|
|
150
149
|
elementType: SwitchViewIcon,
|
|
151
|
-
externalSlotProps: slotProps
|
|
150
|
+
externalSlotProps: slotProps?.switchViewIcon,
|
|
152
151
|
ownerState: undefined,
|
|
153
152
|
className: classes.switchViewIcon
|
|
154
153
|
}),
|
|
@@ -26,7 +26,6 @@ const useUtilityClasses = ownerState => {
|
|
|
26
26
|
return composeClasses(slots, getPickersLayoutUtilityClass, classes);
|
|
27
27
|
};
|
|
28
28
|
const usePickerLayout = props => {
|
|
29
|
-
var _slots$actionBar, _slots$shortcuts;
|
|
30
29
|
const {
|
|
31
30
|
wrapperVariant,
|
|
32
31
|
onAccept,
|
|
@@ -55,10 +54,10 @@ const usePickerLayout = props => {
|
|
|
55
54
|
|
|
56
55
|
// Action bar
|
|
57
56
|
|
|
58
|
-
const ActionBar =
|
|
57
|
+
const ActionBar = slots?.actionBar ?? PickersActionBar;
|
|
59
58
|
const actionBarProps = useSlotProps({
|
|
60
59
|
elementType: ActionBar,
|
|
61
|
-
externalSlotProps: slotProps
|
|
60
|
+
externalSlotProps: slotProps?.actionBar,
|
|
62
61
|
additionalProps: {
|
|
63
62
|
onAccept,
|
|
64
63
|
onClear,
|
|
@@ -75,10 +74,10 @@ const usePickerLayout = props => {
|
|
|
75
74
|
|
|
76
75
|
// Toolbar
|
|
77
76
|
|
|
78
|
-
const Toolbar = slots
|
|
77
|
+
const Toolbar = slots?.toolbar;
|
|
79
78
|
const toolbarProps = useSlotProps({
|
|
80
79
|
elementType: Toolbar,
|
|
81
|
-
externalSlotProps: slotProps
|
|
80
|
+
externalSlotProps: slotProps?.toolbar,
|
|
82
81
|
additionalProps: {
|
|
83
82
|
isLandscape,
|
|
84
83
|
onChange,
|
|
@@ -102,19 +101,19 @@ const usePickerLayout = props => {
|
|
|
102
101
|
|
|
103
102
|
// Tabs
|
|
104
103
|
|
|
105
|
-
const Tabs = slots
|
|
104
|
+
const Tabs = slots?.tabs;
|
|
106
105
|
const tabs = view && Tabs ? /*#__PURE__*/_jsx(Tabs, _extends({
|
|
107
106
|
view: view,
|
|
108
107
|
onViewChange: onViewChange,
|
|
109
108
|
className: classes.tabs
|
|
110
|
-
}, slotProps
|
|
109
|
+
}, slotProps?.tabs)) : null;
|
|
111
110
|
|
|
112
111
|
// Shortcuts
|
|
113
112
|
|
|
114
|
-
const Shortcuts =
|
|
113
|
+
const Shortcuts = slots?.shortcuts ?? PickersShortcuts;
|
|
115
114
|
const shortcutsProps = useSlotProps({
|
|
116
115
|
elementType: Shortcuts,
|
|
117
|
-
externalSlotProps: slotProps
|
|
116
|
+
externalSlotProps: slotProps?.shortcuts,
|
|
118
117
|
additionalProps: {
|
|
119
118
|
isValid,
|
|
120
119
|
isLandscape,
|
|
@@ -58,25 +58,24 @@ const useUtilityClasses = ownerState => {
|
|
|
58
58
|
* - [PickersSectionList API](https://mui.com/x/api/date-pickers/pickers-section-list/)
|
|
59
59
|
*/
|
|
60
60
|
function PickersSection(props) {
|
|
61
|
-
var _slots$section, _slots$sectionContent, _slots$sectionSeparat;
|
|
62
61
|
const {
|
|
63
62
|
slots,
|
|
64
63
|
slotProps,
|
|
65
64
|
element,
|
|
66
65
|
classes
|
|
67
66
|
} = props;
|
|
68
|
-
const Section =
|
|
67
|
+
const Section = slots?.section ?? PickersSectionListSection;
|
|
69
68
|
const sectionProps = useSlotProps({
|
|
70
69
|
elementType: Section,
|
|
71
|
-
externalSlotProps: slotProps
|
|
70
|
+
externalSlotProps: slotProps?.section,
|
|
72
71
|
externalForwardedProps: element.container,
|
|
73
72
|
className: classes.section,
|
|
74
73
|
ownerState: {}
|
|
75
74
|
});
|
|
76
|
-
const SectionContent =
|
|
75
|
+
const SectionContent = slots?.sectionContent ?? PickersSectionListSectionContent;
|
|
77
76
|
const sectionContentProps = useSlotProps({
|
|
78
77
|
elementType: SectionContent,
|
|
79
|
-
externalSlotProps: slotProps
|
|
78
|
+
externalSlotProps: slotProps?.sectionContent,
|
|
80
79
|
externalForwardedProps: element.content,
|
|
81
80
|
additionalProps: {
|
|
82
81
|
suppressContentEditableWarning: true
|
|
@@ -84,10 +83,10 @@ function PickersSection(props) {
|
|
|
84
83
|
className: classes.sectionContent,
|
|
85
84
|
ownerState: {}
|
|
86
85
|
});
|
|
87
|
-
const SectionSeparator =
|
|
86
|
+
const SectionSeparator = slots?.sectionSeparator ?? PickersSectionListSectionSeparator;
|
|
88
87
|
const sectionSeparatorBeforeProps = useSlotProps({
|
|
89
88
|
elementType: SectionSeparator,
|
|
90
|
-
externalSlotProps: slotProps
|
|
89
|
+
externalSlotProps: slotProps?.sectionSeparator,
|
|
91
90
|
externalForwardedProps: element.before,
|
|
92
91
|
ownerState: {
|
|
93
92
|
position: 'before'
|
|
@@ -95,7 +94,7 @@ function PickersSection(props) {
|
|
|
95
94
|
});
|
|
96
95
|
const sectionSeparatorAfterProps = useSlotProps({
|
|
97
96
|
elementType: SectionSeparator,
|
|
98
|
-
externalSlotProps: slotProps
|
|
97
|
+
externalSlotProps: slotProps?.sectionSeparator,
|
|
99
98
|
externalForwardedProps: element.after,
|
|
100
99
|
ownerState: {
|
|
101
100
|
position: 'after'
|
|
@@ -106,7 +105,6 @@ function PickersSection(props) {
|
|
|
106
105
|
}));
|
|
107
106
|
}
|
|
108
107
|
const PickersSectionList = /*#__PURE__*/React.forwardRef(function PickersSectionList(inProps, ref) {
|
|
109
|
-
var _slots$root;
|
|
110
108
|
const props = useThemeProps({
|
|
111
109
|
props: inProps,
|
|
112
110
|
name: 'MuiPickersSectionList'
|
|
@@ -156,10 +154,10 @@ const PickersSectionList = /*#__PURE__*/React.forwardRef(function PickersSection
|
|
|
156
154
|
return Number(sectionContainer.dataset.sectionindex);
|
|
157
155
|
}
|
|
158
156
|
}));
|
|
159
|
-
const Root =
|
|
157
|
+
const Root = slots?.root ?? PickersSectionListRoot;
|
|
160
158
|
const rootProps = useSlotProps({
|
|
161
159
|
elementType: Root,
|
|
162
|
-
externalSlotProps: slotProps
|
|
160
|
+
externalSlotProps: slotProps?.root,
|
|
163
161
|
externalForwardedProps: other,
|
|
164
162
|
additionalProps: {
|
|
165
163
|
ref: handleRootRef,
|
|
@@ -19,7 +19,6 @@ const PickersFilledInputRoot = styled(PickersInputBaseRoot, {
|
|
|
19
19
|
theme,
|
|
20
20
|
ownerState
|
|
21
21
|
}) => {
|
|
22
|
-
var _palette;
|
|
23
22
|
const light = theme.palette.mode === 'light';
|
|
24
23
|
const bottomLineColor = light ? 'rgba(0, 0, 0, 0.42)' : 'rgba(255, 255, 255, 0.7)';
|
|
25
24
|
const backgroundColor = light ? 'rgba(0, 0, 0, 0.06)' : 'rgba(255, 255, 255, 0.09)';
|
|
@@ -48,7 +47,7 @@ const PickersFilledInputRoot = styled(PickersInputBaseRoot, {
|
|
|
48
47
|
}
|
|
49
48
|
}, !ownerState.disableUnderline && {
|
|
50
49
|
'&::after': {
|
|
51
|
-
borderBottom: `2px solid ${(
|
|
50
|
+
borderBottom: `2px solid ${(theme.vars || theme).palette[ownerState.color || 'primary']?.main}`,
|
|
52
51
|
left: 0,
|
|
53
52
|
bottom: 0,
|
|
54
53
|
// Doing the other way around crash on IE11 "''" https://github.com/cssinjs/jss/issues/242
|
|
@@ -149,7 +148,7 @@ const PickersFilledInput = /*#__PURE__*/React.forwardRef(function PickersFilledI
|
|
|
149
148
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
150
149
|
const muiFormControl = useFormControl();
|
|
151
150
|
const ownerState = _extends({}, props, ownerStateProp, muiFormControl, {
|
|
152
|
-
color:
|
|
151
|
+
color: muiFormControl?.color || 'primary'
|
|
153
152
|
});
|
|
154
153
|
const classes = useUtilityClasses(ownerState);
|
|
155
154
|
return /*#__PURE__*/_jsx(PickersInputBase, _extends({
|
|
@@ -108,7 +108,7 @@ const PickersInput = /*#__PURE__*/React.forwardRef(function PickersInput(inProps
|
|
|
108
108
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
109
109
|
const muiFormControl = useFormControl();
|
|
110
110
|
const ownerState = _extends({}, props, ownerStateProp, muiFormControl, {
|
|
111
|
-
color:
|
|
111
|
+
color: muiFormControl?.color || 'primary'
|
|
112
112
|
});
|
|
113
113
|
const classes = useUtilityClasses(ownerState);
|
|
114
114
|
return /*#__PURE__*/_jsx(PickersInputBase, _extends({
|
|
@@ -167,20 +167,19 @@ const PickersInputBase = /*#__PURE__*/React.forwardRef(function PickersInputBase
|
|
|
167
167
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
168
168
|
const rootRef = React.useRef(null);
|
|
169
169
|
const handleRootRef = useForkRef(ref, rootRef);
|
|
170
|
-
const handleInputRef = useForkRef(inputProps
|
|
170
|
+
const handleInputRef = useForkRef(inputProps?.ref, inputRef);
|
|
171
171
|
const muiFormControl = useFormControl();
|
|
172
172
|
if (!muiFormControl) {
|
|
173
173
|
throw new Error('MUI X: PickersInputBase should always be used inside a PickersTextField component');
|
|
174
174
|
}
|
|
175
175
|
const handleInputFocus = event => {
|
|
176
|
-
var _muiFormControl$onFoc;
|
|
177
176
|
// Fix a bug with IE11 where the focus/blur events are triggered
|
|
178
177
|
// while the component is disabled.
|
|
179
178
|
if (muiFormControl.disabled) {
|
|
180
179
|
event.stopPropagation();
|
|
181
180
|
return;
|
|
182
181
|
}
|
|
183
|
-
|
|
182
|
+
muiFormControl.onFocus?.(event);
|
|
184
183
|
};
|
|
185
184
|
React.useEffect(() => {
|
|
186
185
|
if (muiFormControl) {
|
|
@@ -199,8 +198,8 @@ const PickersInputBase = /*#__PURE__*/React.forwardRef(function PickersInputBase
|
|
|
199
198
|
}, [muiFormControl, areAllSectionsEmpty]);
|
|
200
199
|
const ownerState = _extends({}, props, muiFormControl);
|
|
201
200
|
const classes = useUtilityClasses(ownerState);
|
|
202
|
-
const InputRoot =
|
|
203
|
-
const InputSectionsContainer =
|
|
201
|
+
const InputRoot = slots?.root || PickersInputBaseRoot;
|
|
202
|
+
const InputSectionsContainer = slots?.input || PickersInputBaseSectionsContainer;
|
|
204
203
|
return /*#__PURE__*/_jsxs(InputRoot, _extends({}, other, {
|
|
205
204
|
className: classes.root,
|
|
206
205
|
ownerState: ownerState,
|
|
@@ -92,7 +92,7 @@ const PickersOutlinedInput = /*#__PURE__*/React.forwardRef(function PickersOutli
|
|
|
92
92
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
93
93
|
const muiFormControl = useFormControl();
|
|
94
94
|
const ownerState = _extends({}, props, ownerStateProp, muiFormControl, {
|
|
95
|
-
color:
|
|
95
|
+
color: muiFormControl?.color || 'primary'
|
|
96
96
|
});
|
|
97
97
|
const classes = useUtilityClasses(ownerState);
|
|
98
98
|
return /*#__PURE__*/_jsx(PickersInputBase, _extends({
|
|
@@ -104,7 +104,7 @@ const PickersOutlinedInput = /*#__PURE__*/React.forwardRef(function PickersOutli
|
|
|
104
104
|
shrink: Boolean(notched || state.adornedStart || state.focused || state.filled),
|
|
105
105
|
notched: Boolean(notched || state.adornedStart || state.focused || state.filled),
|
|
106
106
|
className: classes.notchedOutline,
|
|
107
|
-
label: label != null && label !== '' && muiFormControl
|
|
107
|
+
label: label != null && label !== '' && muiFormControl?.required ? /*#__PURE__*/_jsxs(React.Fragment, {
|
|
108
108
|
children: [label, "\u2009", '*']
|
|
109
109
|
}) : label,
|
|
110
110
|
ownerState: ownerState
|
package/README.md
CHANGED
|
@@ -17,9 +17,8 @@ import { singleItemValueManager } from '../internals/utils/valueManagers';
|
|
|
17
17
|
* - [StaticDatePicker API](https://mui.com/x/api/date-pickers/static-date-picker/)
|
|
18
18
|
*/
|
|
19
19
|
const StaticDatePicker = /*#__PURE__*/React.forwardRef(function StaticDatePicker(inProps, ref) {
|
|
20
|
-
var _defaultizedProps$dis, _defaultizedProps$yea, _defaultizedProps$slo;
|
|
21
20
|
const defaultizedProps = useDatePickerDefaultizedProps(inProps, 'MuiStaticDatePicker');
|
|
22
|
-
const displayStaticWrapperAs =
|
|
21
|
+
const displayStaticWrapperAs = defaultizedProps.displayStaticWrapperAs ?? 'mobile';
|
|
23
22
|
const viewRenderers = _extends({
|
|
24
23
|
day: renderDateViewCalendar,
|
|
25
24
|
month: renderDateViewCalendar,
|
|
@@ -30,11 +29,11 @@ const StaticDatePicker = /*#__PURE__*/React.forwardRef(function StaticDatePicker
|
|
|
30
29
|
const props = _extends({}, defaultizedProps, {
|
|
31
30
|
viewRenderers,
|
|
32
31
|
displayStaticWrapperAs,
|
|
33
|
-
yearsPerRow:
|
|
32
|
+
yearsPerRow: defaultizedProps.yearsPerRow ?? (displayStaticWrapperAs === 'mobile' ? 3 : 4),
|
|
34
33
|
slotProps: _extends({}, defaultizedProps.slotProps, {
|
|
35
34
|
toolbar: _extends({
|
|
36
35
|
hidden: displayStaticWrapperAs === 'desktop'
|
|
37
|
-
},
|
|
36
|
+
}, defaultizedProps.slotProps?.toolbar)
|
|
38
37
|
})
|
|
39
38
|
});
|
|
40
39
|
const {
|
|
@@ -209,7 +208,7 @@ StaticDatePicker.propTypes = {
|
|
|
209
208
|
/**
|
|
210
209
|
* Disable specific date.
|
|
211
210
|
*
|
|
212
|
-
* Warning: This function can be called multiple times (
|
|
211
|
+
* Warning: This function can be called multiple times (for example when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.
|
|
213
212
|
*
|
|
214
213
|
* @template TDate
|
|
215
214
|
* @param {TDate} day The date to test.
|
|
@@ -18,10 +18,9 @@ import { validateDateTime } from '../internals/utils/validation/validateDateTime
|
|
|
18
18
|
* - [StaticDateTimePicker API](https://mui.com/x/api/date-pickers/static-date-time-picker/)
|
|
19
19
|
*/
|
|
20
20
|
const StaticDateTimePicker = /*#__PURE__*/React.forwardRef(function StaticDateTimePicker(inProps, ref) {
|
|
21
|
-
var _defaultizedProps$dis, _defaultizedProps$amp, _defaultizedProps$yea, _defaultizedProps$slo, _defaultizedProps$slo2;
|
|
22
21
|
const defaultizedProps = useDateTimePickerDefaultizedProps(inProps, 'MuiStaticDateTimePicker');
|
|
23
|
-
const displayStaticWrapperAs =
|
|
24
|
-
const ampmInClock =
|
|
22
|
+
const displayStaticWrapperAs = defaultizedProps.displayStaticWrapperAs ?? 'mobile';
|
|
23
|
+
const ampmInClock = defaultizedProps.ampmInClock ?? displayStaticWrapperAs === 'desktop';
|
|
25
24
|
const viewRenderers = _extends({
|
|
26
25
|
day: renderDateViewCalendar,
|
|
27
26
|
month: renderDateViewCalendar,
|
|
@@ -36,15 +35,15 @@ const StaticDateTimePicker = /*#__PURE__*/React.forwardRef(function StaticDateTi
|
|
|
36
35
|
viewRenderers,
|
|
37
36
|
displayStaticWrapperAs,
|
|
38
37
|
ampmInClock,
|
|
39
|
-
yearsPerRow:
|
|
38
|
+
yearsPerRow: defaultizedProps.yearsPerRow ?? (displayStaticWrapperAs === 'mobile' ? 3 : 4),
|
|
40
39
|
slotProps: _extends({}, defaultizedProps.slotProps, {
|
|
41
40
|
tabs: _extends({
|
|
42
41
|
hidden: displayStaticWrapperAs === 'desktop'
|
|
43
|
-
},
|
|
42
|
+
}, defaultizedProps.slotProps?.tabs),
|
|
44
43
|
toolbar: _extends({
|
|
45
44
|
hidden: displayStaticWrapperAs === 'desktop',
|
|
46
45
|
ampmInClock
|
|
47
|
-
},
|
|
46
|
+
}, defaultizedProps.slotProps?.toolbar)
|
|
48
47
|
})
|
|
49
48
|
});
|
|
50
49
|
const {
|
|
@@ -257,7 +256,7 @@ StaticDateTimePicker.propTypes = {
|
|
|
257
256
|
/**
|
|
258
257
|
* Disable specific date.
|
|
259
258
|
*
|
|
260
|
-
* Warning: This function can be called multiple times (
|
|
259
|
+
* Warning: This function can be called multiple times (for example when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.
|
|
261
260
|
*
|
|
262
261
|
* @template TDate
|
|
263
262
|
* @param {TDate} day The date to test.
|
|
@@ -17,10 +17,9 @@ import { validateTime } from '../internals/utils/validation/validateTime';
|
|
|
17
17
|
* - [StaticTimePicker API](https://mui.com/x/api/date-pickers/static-time-picker/)
|
|
18
18
|
*/
|
|
19
19
|
const StaticTimePicker = /*#__PURE__*/React.forwardRef(function StaticTimePicker(inProps, ref) {
|
|
20
|
-
var _defaultizedProps$dis, _defaultizedProps$amp, _defaultizedProps$slo;
|
|
21
20
|
const defaultizedProps = useTimePickerDefaultizedProps(inProps, 'MuiStaticTimePicker');
|
|
22
|
-
const displayStaticWrapperAs =
|
|
23
|
-
const ampmInClock =
|
|
21
|
+
const displayStaticWrapperAs = defaultizedProps.displayStaticWrapperAs ?? 'mobile';
|
|
22
|
+
const ampmInClock = defaultizedProps.ampmInClock ?? displayStaticWrapperAs === 'desktop';
|
|
24
23
|
const viewRenderers = _extends({
|
|
25
24
|
hours: renderTimeViewClock,
|
|
26
25
|
minutes: renderTimeViewClock,
|
|
@@ -36,7 +35,7 @@ const StaticTimePicker = /*#__PURE__*/React.forwardRef(function StaticTimePicker
|
|
|
36
35
|
toolbar: _extends({
|
|
37
36
|
hidden: displayStaticWrapperAs === 'desktop',
|
|
38
37
|
ampmInClock
|
|
39
|
-
},
|
|
38
|
+
}, defaultizedProps.slotProps?.toolbar)
|
|
40
39
|
})
|
|
41
40
|
});
|
|
42
41
|
const {
|
package/TimeClock/TimeClock.js
CHANGED
|
@@ -284,7 +284,7 @@ export const TimeClock = /*#__PURE__*/React.forwardRef(function TimeClock(inProp
|
|
|
284
284
|
ownerState: ownerState
|
|
285
285
|
}, other, {
|
|
286
286
|
children: [/*#__PURE__*/_jsx(Clock, _extends({
|
|
287
|
-
autoFocus: autoFocus
|
|
287
|
+
autoFocus: autoFocus ?? !!focusedView,
|
|
288
288
|
ampmInClock: ampmInClock && views.includes('hours'),
|
|
289
289
|
value: value,
|
|
290
290
|
type: view,
|