@mui/x-date-pickers 7.0.0-beta.7 → 7.1.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 +266 -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/DatePickerToolbar.js +11 -6
- 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 +98 -46
- package/DateTimePicker/shared.d.ts +2 -1
- package/DateTimePicker/shared.js +11 -13
- package/DayCalendarSkeleton/DayCalendarSkeleton.js +12 -8
- 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 +16 -9
- 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 +13 -8
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +1 -1
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +1 -1
- package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +16 -9
- package/PickersActionBar/PickersActionBar.js +1 -1
- package/PickersCalendarHeader/PickersCalendarHeader.js +17 -14
- package/PickersDay/PickersDay.js +30 -15
- package/PickersLayout/PickersLayout.js +31 -17
- package/PickersLayout/usePickerLayout.js +8 -9
- package/PickersSectionList/PickersSectionList.js +9 -11
- package/PickersTextField/PickersFilledInput/PickersFilledInput.js +138 -74
- package/PickersTextField/PickersInput/PickersInput.js +77 -55
- package/PickersTextField/PickersInputBase/PickersInputBase.js +67 -28
- package/PickersTextField/PickersInputBase/PickersInputBase.types.d.ts +7 -0
- package/PickersTextField/PickersOutlinedInput/Outline.js +58 -41
- package/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.js +33 -14
- 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/Clock.js +48 -35
- package/TimeClock/ClockNumber.js +12 -7
- package/TimeClock/ClockPointer.js +23 -13
- package/TimeClock/TimeClock.js +1 -1
- package/TimeField/TimeField.js +2 -3
- package/TimePicker/TimePickerToolbar.js +25 -16
- package/TimePicker/shared.d.ts +2 -1
- package/TimePicker/shared.js +5 -7
- package/YearCalendar/PickersYear.js +12 -6
- package/YearCalendar/YearCalendar.js +5 -6
- package/hooks/useClearableField.js +6 -7
- package/index.js +1 -1
- package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +19 -15
- package/internals/components/PickersModalDialog.js +6 -7
- package/internals/components/PickersPopper.js +25 -24
- package/internals/components/PickersToolbar.js +42 -24
- 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 +6 -4
- package/internals/hooks/useField/useField.types.d.ts +1 -0
- 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 +17 -18
- 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/itIT.js +16 -20
- package/locales/jaJP.js +1 -4
- package/locales/roRO.js +1 -4
- package/locales/skSK.js +1 -4
- package/locales/zhHK.js +14 -17
- 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/DatePicker/DatePickerToolbar.js +11 -6
- package/modern/DateTimeField/DateTimeField.js +1 -1
- package/modern/DateTimePicker/DateTimePicker.js +1 -1
- package/modern/DateTimePicker/DateTimePickerToolbar.js +97 -45
- package/modern/DayCalendarSkeleton/DayCalendarSkeleton.js +12 -8
- 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/DigitalClock/DigitalClock.js +14 -6
- package/modern/MobileDatePicker/MobileDatePicker.js +1 -1
- package/modern/MobileDateTimePicker/MobileDateTimePicker.js +1 -1
- package/modern/MonthCalendar/PickersMonth.js +12 -6
- package/modern/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +13 -4
- package/modern/PickersCalendarHeader/PickersCalendarHeader.js +13 -9
- package/modern/PickersDay/PickersDay.js +30 -15
- package/modern/PickersLayout/PickersLayout.js +31 -17
- package/modern/PickersTextField/PickersFilledInput/PickersFilledInput.js +137 -72
- package/modern/PickersTextField/PickersInput/PickersInput.js +76 -54
- package/modern/PickersTextField/PickersInputBase/PickersInputBase.js +64 -24
- package/modern/PickersTextField/PickersOutlinedInput/Outline.js +58 -41
- package/modern/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.js +31 -12
- package/modern/StaticDatePicker/StaticDatePicker.js +1 -1
- package/modern/StaticDateTimePicker/StaticDateTimePicker.js +1 -1
- package/modern/TimeClock/Clock.js +48 -35
- package/modern/TimeClock/ClockNumber.js +12 -7
- package/modern/TimeClock/ClockPointer.js +23 -13
- package/modern/TimePicker/TimePickerToolbar.js +25 -16
- package/modern/YearCalendar/PickersYear.js +12 -6
- package/modern/index.js +1 -1
- package/modern/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +11 -6
- package/modern/internals/components/PickersPopper.js +13 -9
- package/modern/internals/components/PickersToolbar.js +39 -18
- package/modern/internals/hooks/useField/buildSectionsFromFormat.js +34 -30
- package/modern/internals/hooks/useField/useField.js +4 -2
- package/modern/internals/hooks/useField/useFieldV6TextField.js +8 -3
- 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/modern/locales/itIT.js +16 -20
- package/modern/locales/zhHK.js +14 -17
- 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/DatePicker/DatePickerToolbar.js +11 -6
- package/node/DateTimeField/DateTimeField.js +1 -1
- package/node/DateTimePicker/DateTimePicker.js +1 -1
- package/node/DateTimePicker/DateTimePickerToolbar.js +97 -45
- package/node/DayCalendarSkeleton/DayCalendarSkeleton.js +12 -8
- 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/DigitalClock/DigitalClock.js +14 -6
- package/node/MobileDatePicker/MobileDatePicker.js +1 -1
- package/node/MobileDateTimePicker/MobileDateTimePicker.js +1 -1
- package/node/MonthCalendar/PickersMonth.js +12 -6
- package/node/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +13 -4
- package/node/PickersCalendarHeader/PickersCalendarHeader.js +13 -9
- package/node/PickersDay/PickersDay.js +30 -15
- package/node/PickersLayout/PickersLayout.js +31 -17
- package/node/PickersTextField/PickersFilledInput/PickersFilledInput.js +137 -72
- package/node/PickersTextField/PickersInput/PickersInput.js +76 -54
- package/node/PickersTextField/PickersInputBase/PickersInputBase.js +64 -24
- package/node/PickersTextField/PickersOutlinedInput/Outline.js +58 -41
- package/node/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.js +31 -12
- package/node/StaticDatePicker/StaticDatePicker.js +1 -1
- package/node/StaticDateTimePicker/StaticDateTimePicker.js +1 -1
- package/node/TimeClock/Clock.js +48 -35
- package/node/TimeClock/ClockNumber.js +12 -7
- package/node/TimeClock/ClockPointer.js +23 -13
- package/node/TimePicker/TimePickerToolbar.js +25 -16
- package/node/YearCalendar/PickersYear.js +12 -6
- package/node/index.js +1 -1
- package/node/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +11 -6
- package/node/internals/components/PickersPopper.js +13 -9
- package/node/internals/components/PickersToolbar.js +39 -18
- package/node/internals/hooks/useField/buildSectionsFromFormat.js +34 -30
- package/node/internals/hooks/useField/useField.js +4 -2
- package/node/internals/hooks/useField/useFieldV6TextField.js +8 -3
- 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/node/locales/itIT.js +16 -20
- package/node/locales/zhHK.js +14 -17
- 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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["elements", "areAllSectionsEmpty", "defaultValue", "label", "value", "onChange", "id", "autoFocus", "endAdornment", "startAdornment", "renderSuffix", "slots", "contentEditable", "tabIndex", "onInput", "onPaste", "onKeyDown", "fullWidth", "name", "readOnly", "inputProps", "inputRef", "sectionListRef"];
|
|
3
|
+
const _excluded = ["elements", "areAllSectionsEmpty", "defaultValue", "label", "value", "onChange", "id", "autoFocus", "endAdornment", "startAdornment", "renderSuffix", "slots", "slotProps", "contentEditable", "tabIndex", "onInput", "onPaste", "onKeyDown", "fullWidth", "name", "readOnly", "inputProps", "inputRef", "sectionListRef"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { useFormControl } from '@mui/material/FormControl';
|
|
@@ -9,6 +9,7 @@ import useForkRef from '@mui/utils/useForkRef';
|
|
|
9
9
|
import { refType } from '@mui/utils';
|
|
10
10
|
import composeClasses from '@mui/utils/composeClasses';
|
|
11
11
|
import capitalize from '@mui/utils/capitalize';
|
|
12
|
+
import { useSlotProps } from '@mui/base/utils';
|
|
12
13
|
import visuallyHidden from '@mui/utils/visuallyHidden';
|
|
13
14
|
import { pickersInputBaseClasses, getPickersInputBaseUtilityClass } from './pickersInputBaseClasses';
|
|
14
15
|
import { Unstable_PickersSectionList as PickersSectionList, Unstable_PickersSectionListRoot as PickersSectionListRoot, Unstable_PickersSectionListSection as PickersSectionListSection, Unstable_PickersSectionListSectionSeparator as PickersSectionListSectionSeparator, Unstable_PickersSectionListSectionContent as PickersSectionListSectionContent } from '../../PickersSectionList';
|
|
@@ -20,8 +21,7 @@ export const PickersInputBaseRoot = styled('div', {
|
|
|
20
21
|
slot: 'Root',
|
|
21
22
|
overridesResolver: (props, styles) => styles.root
|
|
22
23
|
})(({
|
|
23
|
-
theme
|
|
24
|
-
ownerState
|
|
24
|
+
theme
|
|
25
25
|
}) => _extends({}, theme.typography.body1, {
|
|
26
26
|
color: (theme.vars || theme).palette.text.primary,
|
|
27
27
|
cursor: 'text',
|
|
@@ -32,17 +32,22 @@ export const PickersInputBaseRoot = styled('div', {
|
|
|
32
32
|
position: 'relative',
|
|
33
33
|
boxSizing: 'border-box',
|
|
34
34
|
// Prevent padding issue with fullWidth.
|
|
35
|
-
letterSpacing: `${round(0.15 / 16)}em
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
letterSpacing: `${round(0.15 / 16)}em`,
|
|
36
|
+
variants: [{
|
|
37
|
+
props: {
|
|
38
|
+
fullWidth: true
|
|
39
|
+
},
|
|
40
|
+
style: {
|
|
41
|
+
width: '100%'
|
|
42
|
+
}
|
|
43
|
+
}]
|
|
38
44
|
}));
|
|
39
45
|
export const PickersInputBaseSectionsContainer = styled(PickersSectionListRoot, {
|
|
40
46
|
name: 'MuiPickersInputBase',
|
|
41
47
|
slot: 'SectionsContainer',
|
|
42
48
|
overridesResolver: (props, styles) => styles.sectionsContainer
|
|
43
49
|
})(({
|
|
44
|
-
theme
|
|
45
|
-
ownerState
|
|
50
|
+
theme
|
|
46
51
|
}) => _extends({
|
|
47
52
|
padding: '4px 0 5px',
|
|
48
53
|
fontFamily: theme.typography.fontFamily,
|
|
@@ -57,19 +62,41 @@ export const PickersInputBaseSectionsContainer = styled(PickersSectionListRoot,
|
|
|
57
62
|
letterSpacing: 'inherit',
|
|
58
63
|
// Baseline behavior
|
|
59
64
|
width: '182px'
|
|
60
|
-
}, ownerState.size === 'small' && {
|
|
61
|
-
paddingTop: 1
|
|
62
65
|
}, theme.direction === 'rtl' && {
|
|
63
66
|
textAlign: 'right /*! @noflip */'
|
|
64
|
-
},
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
67
|
+
}, {
|
|
68
|
+
variants: [{
|
|
69
|
+
props: {
|
|
70
|
+
size: 'small'
|
|
71
|
+
},
|
|
72
|
+
style: {
|
|
73
|
+
paddingTop: 1
|
|
74
|
+
}
|
|
75
|
+
}, {
|
|
76
|
+
props: {
|
|
77
|
+
adornedStart: false,
|
|
78
|
+
focused: false,
|
|
79
|
+
filled: false
|
|
80
|
+
},
|
|
81
|
+
style: {
|
|
82
|
+
color: 'currentColor',
|
|
83
|
+
opacity: 0
|
|
84
|
+
}
|
|
85
|
+
}, {
|
|
86
|
+
// Can't use the object notation because label can be null or undefined
|
|
87
|
+
props: ({
|
|
88
|
+
adornedStart,
|
|
89
|
+
focused,
|
|
90
|
+
filled,
|
|
91
|
+
label
|
|
92
|
+
}) => !adornedStart && !focused && !filled && label == null,
|
|
93
|
+
style: theme.vars ? {
|
|
94
|
+
opacity: theme.vars.opacity.inputPlaceholder
|
|
95
|
+
} : {
|
|
96
|
+
opacity: theme.palette.mode === 'light' ? 0.42 : 0.5
|
|
97
|
+
}
|
|
98
|
+
}]
|
|
99
|
+
}));
|
|
73
100
|
const PickersInputBaseSection = styled(PickersSectionListSection, {
|
|
74
101
|
name: 'MuiPickersInputBase',
|
|
75
102
|
slot: 'Section',
|
|
@@ -153,6 +180,7 @@ const PickersInputBase = /*#__PURE__*/React.forwardRef(function PickersInputBase
|
|
|
153
180
|
startAdornment,
|
|
154
181
|
renderSuffix,
|
|
155
182
|
slots,
|
|
183
|
+
slotProps,
|
|
156
184
|
contentEditable,
|
|
157
185
|
tabIndex,
|
|
158
186
|
onInput,
|
|
@@ -199,12 +227,19 @@ const PickersInputBase = /*#__PURE__*/React.forwardRef(function PickersInputBase
|
|
|
199
227
|
const ownerState = _extends({}, props, muiFormControl);
|
|
200
228
|
const classes = useUtilityClasses(ownerState);
|
|
201
229
|
const InputRoot = slots?.root || PickersInputBaseRoot;
|
|
202
|
-
const
|
|
203
|
-
|
|
230
|
+
const inputRootProps = useSlotProps({
|
|
231
|
+
elementType: InputRoot,
|
|
232
|
+
externalSlotProps: slotProps?.root,
|
|
233
|
+
externalForwardedProps: other,
|
|
234
|
+
additionalProps: {
|
|
235
|
+
'aria-invalid': muiFormControl.error,
|
|
236
|
+
ref: handleRootRef
|
|
237
|
+
},
|
|
204
238
|
className: classes.root,
|
|
205
|
-
ownerState
|
|
206
|
-
|
|
207
|
-
|
|
239
|
+
ownerState
|
|
240
|
+
});
|
|
241
|
+
const InputSectionsContainer = slots?.input || PickersInputBaseSectionsContainer;
|
|
242
|
+
return /*#__PURE__*/_jsxs(InputRoot, _extends({}, inputRootProps, {
|
|
208
243
|
children: [startAdornment, /*#__PURE__*/_jsx(PickersSectionList, {
|
|
209
244
|
sectionListRef: sectionListRef,
|
|
210
245
|
elements: elements,
|
|
@@ -307,6 +342,11 @@ process.env.NODE_ENV !== "production" ? PickersInputBase.propTypes = {
|
|
|
307
342
|
getSectionIndexFromDOMElement: PropTypes.func.isRequired
|
|
308
343
|
})
|
|
309
344
|
})]),
|
|
345
|
+
/**
|
|
346
|
+
* The props used for each component slot.
|
|
347
|
+
* @default {}
|
|
348
|
+
*/
|
|
349
|
+
slotProps: PropTypes.object,
|
|
310
350
|
/**
|
|
311
351
|
* The components used for each slot inside.
|
|
312
352
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
3
|
const _excluded = ["children", "className", "label", "notched", "shrink"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { styled } from '@mui/material/styles';
|
|
@@ -37,51 +37,68 @@ const OutlineLabel = styled('span')(({
|
|
|
37
37
|
fontSize: 'inherit'
|
|
38
38
|
}));
|
|
39
39
|
const OutlineLegend = styled('legend')(({
|
|
40
|
-
ownerState,
|
|
41
40
|
theme
|
|
42
|
-
}) =>
|
|
41
|
+
}) => ({
|
|
43
42
|
float: 'unset',
|
|
44
43
|
// Fix conflict with bootstrap
|
|
45
44
|
width: 'auto',
|
|
46
45
|
// Fix conflict with bootstrap
|
|
47
|
-
overflow: 'hidden'
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
46
|
+
overflow: 'hidden',
|
|
47
|
+
// Fix Horizontal scroll when label too long
|
|
48
|
+
variants: [{
|
|
49
|
+
props: {
|
|
50
|
+
withLabel: false
|
|
51
|
+
},
|
|
52
|
+
style: {
|
|
53
|
+
padding: 0,
|
|
54
|
+
lineHeight: '11px',
|
|
55
|
+
// sync with `height` in `legend` styles
|
|
56
|
+
transition: theme.transitions.create('width', {
|
|
57
|
+
duration: 150,
|
|
58
|
+
easing: theme.transitions.easing.easeOut
|
|
59
|
+
})
|
|
60
|
+
}
|
|
61
|
+
}, {
|
|
62
|
+
props: {
|
|
63
|
+
withLabel: true
|
|
64
|
+
},
|
|
65
|
+
style: {
|
|
66
|
+
display: 'block',
|
|
67
|
+
// Fix conflict with normalize.css and sanitize.css
|
|
68
|
+
padding: 0,
|
|
69
|
+
height: 11,
|
|
70
|
+
// sync with `lineHeight` in `legend` styles
|
|
71
|
+
fontSize: '0.75em',
|
|
72
|
+
visibility: 'hidden',
|
|
73
|
+
maxWidth: 0.01,
|
|
74
|
+
transition: theme.transitions.create('max-width', {
|
|
75
|
+
duration: 50,
|
|
76
|
+
easing: theme.transitions.easing.easeOut
|
|
77
|
+
}),
|
|
78
|
+
whiteSpace: 'nowrap',
|
|
79
|
+
'& > span': {
|
|
80
|
+
paddingLeft: 5,
|
|
81
|
+
paddingRight: 5,
|
|
82
|
+
display: 'inline-block',
|
|
83
|
+
opacity: 0,
|
|
84
|
+
visibility: 'visible'
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}, {
|
|
88
|
+
props: {
|
|
89
|
+
withLabel: true,
|
|
90
|
+
notched: true
|
|
91
|
+
},
|
|
92
|
+
style: {
|
|
93
|
+
maxWidth: '100%',
|
|
94
|
+
transition: theme.transitions.create('max-width', {
|
|
95
|
+
duration: 100,
|
|
96
|
+
easing: theme.transitions.easing.easeOut,
|
|
97
|
+
delay: 50
|
|
98
|
+
})
|
|
99
|
+
}
|
|
100
|
+
}]
|
|
101
|
+
}));
|
|
85
102
|
|
|
86
103
|
/**
|
|
87
104
|
* @ignore - internal component.
|
|
@@ -18,8 +18,7 @@ const PickersOutlinedInputRoot = styled(PickersInputBaseRoot, {
|
|
|
18
18
|
slot: 'Root',
|
|
19
19
|
overridesResolver: (props, styles) => styles.root
|
|
20
20
|
})(({
|
|
21
|
-
theme
|
|
22
|
-
ownerState
|
|
21
|
+
theme
|
|
23
22
|
}) => {
|
|
24
23
|
const borderColor = theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)';
|
|
25
24
|
return {
|
|
@@ -36,8 +35,6 @@ const PickersOutlinedInputRoot = styled(PickersInputBaseRoot, {
|
|
|
36
35
|
},
|
|
37
36
|
[`&.${pickersOutlinedInputClasses.focused} .${pickersOutlinedInputClasses.notchedOutline}`]: {
|
|
38
37
|
borderStyle: 'solid',
|
|
39
|
-
// @ts-ignore
|
|
40
|
-
borderColor: (theme.vars || theme).palette[ownerState.color].main,
|
|
41
38
|
borderWidth: 2
|
|
42
39
|
},
|
|
43
40
|
[`&.${pickersOutlinedInputClasses.disabled}`]: {
|
|
@@ -50,20 +47,37 @@ const PickersOutlinedInputRoot = styled(PickersInputBaseRoot, {
|
|
|
50
47
|
},
|
|
51
48
|
[`&.${pickersOutlinedInputClasses.error} .${pickersOutlinedInputClasses.notchedOutline}`]: {
|
|
52
49
|
borderColor: (theme.vars || theme).palette.error.main
|
|
53
|
-
}
|
|
50
|
+
},
|
|
51
|
+
variants: Object.keys((theme.vars ?? theme).palette)
|
|
52
|
+
// @ts-ignore
|
|
53
|
+
.filter(key => (theme.vars ?? theme).palette[key].main).map(color => ({
|
|
54
|
+
props: {
|
|
55
|
+
color
|
|
56
|
+
},
|
|
57
|
+
style: {
|
|
58
|
+
[`&.${pickersOutlinedInputClasses.focused}:not(.${pickersOutlinedInputClasses.error}) .${pickersOutlinedInputClasses.notchedOutline}`]: {
|
|
59
|
+
// @ts-ignore
|
|
60
|
+
borderColor: (theme.vars || theme).palette[color].main
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}))
|
|
54
64
|
};
|
|
55
65
|
});
|
|
56
66
|
const PickersOutlinedInputSectionsContainer = styled(PickersInputBaseSectionsContainer, {
|
|
57
67
|
name: 'MuiPickersOutlinedInput',
|
|
58
68
|
slot: 'SectionsContainer',
|
|
59
69
|
overridesResolver: (props, styles) => styles.sectionsContainer
|
|
60
|
-
})(
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
70
|
+
})({
|
|
71
|
+
padding: '16.5px 0',
|
|
72
|
+
variants: [{
|
|
73
|
+
props: {
|
|
74
|
+
size: 'small'
|
|
75
|
+
},
|
|
76
|
+
style: {
|
|
77
|
+
padding: '8.5px 0'
|
|
78
|
+
}
|
|
79
|
+
}]
|
|
80
|
+
});
|
|
67
81
|
const useUtilityClasses = ownerState => {
|
|
68
82
|
const {
|
|
69
83
|
classes
|
|
@@ -172,6 +186,11 @@ process.env.NODE_ENV !== "production" ? PickersOutlinedInput.propTypes = {
|
|
|
172
186
|
getSectionIndexFromDOMElement: PropTypes.func.isRequired
|
|
173
187
|
})
|
|
174
188
|
})]),
|
|
189
|
+
/**
|
|
190
|
+
* The props used for each component slot.
|
|
191
|
+
* @default {}
|
|
192
|
+
*/
|
|
193
|
+
slotProps: PropTypes.object,
|
|
175
194
|
/**
|
|
176
195
|
* The components used for each slot inside.
|
|
177
196
|
*
|
|
@@ -208,7 +208,7 @@ StaticDatePicker.propTypes = {
|
|
|
208
208
|
/**
|
|
209
209
|
* Disable specific date.
|
|
210
210
|
*
|
|
211
|
-
* 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.
|
|
212
212
|
*
|
|
213
213
|
* @template TDate
|
|
214
214
|
* @param {TDate} day The date to test.
|
|
@@ -256,7 +256,7 @@ StaticDateTimePicker.propTypes = {
|
|
|
256
256
|
/**
|
|
257
257
|
* Disable specific date.
|
|
258
258
|
*
|
|
259
|
-
* 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.
|
|
260
260
|
*
|
|
261
261
|
* @template TDate
|
|
262
262
|
* @param {TDate} day The date to test.
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
1
|
import * as React from 'react';
|
|
3
2
|
import clsx from 'clsx';
|
|
4
3
|
import IconButton from '@mui/material/IconButton';
|
|
@@ -66,9 +65,7 @@ const ClockSquareMask = styled('div', {
|
|
|
66
65
|
name: 'MuiClock',
|
|
67
66
|
slot: 'SquareMask',
|
|
68
67
|
overridesResolver: (_, styles) => styles.squareMask
|
|
69
|
-
})(
|
|
70
|
-
ownerState
|
|
71
|
-
}) => _extends({
|
|
68
|
+
})({
|
|
72
69
|
width: '100%',
|
|
73
70
|
height: '100%',
|
|
74
71
|
position: 'absolute',
|
|
@@ -76,16 +73,22 @@ const ClockSquareMask = styled('div', {
|
|
|
76
73
|
outline: 0,
|
|
77
74
|
// Disable scroll capabilities.
|
|
78
75
|
touchAction: 'none',
|
|
79
|
-
userSelect: 'none'
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
76
|
+
userSelect: 'none',
|
|
77
|
+
variants: [{
|
|
78
|
+
props: {
|
|
79
|
+
disabled: false
|
|
80
|
+
},
|
|
81
|
+
style: {
|
|
82
|
+
'@media (pointer: fine)': {
|
|
83
|
+
cursor: 'pointer',
|
|
84
|
+
borderRadius: '50%'
|
|
85
|
+
},
|
|
86
|
+
'&:active': {
|
|
87
|
+
cursor: 'move'
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}]
|
|
91
|
+
});
|
|
89
92
|
const ClockPin = styled('div', {
|
|
90
93
|
name: 'MuiClock',
|
|
91
94
|
slot: 'Pin',
|
|
@@ -107,44 +110,54 @@ const ClockAmButton = styled(IconButton, {
|
|
|
107
110
|
slot: 'AmButton',
|
|
108
111
|
overridesResolver: (_, styles) => styles.amButton
|
|
109
112
|
})(({
|
|
110
|
-
theme
|
|
111
|
-
|
|
112
|
-
}) => _extends({
|
|
113
|
+
theme
|
|
114
|
+
}) => ({
|
|
113
115
|
zIndex: 1,
|
|
114
116
|
position: 'absolute',
|
|
115
117
|
bottom: 8,
|
|
116
118
|
left: 8,
|
|
117
119
|
paddingLeft: 4,
|
|
118
120
|
paddingRight: 4,
|
|
119
|
-
width: CLOCK_HOUR_WIDTH
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
121
|
+
width: CLOCK_HOUR_WIDTH,
|
|
122
|
+
variants: [{
|
|
123
|
+
props: {
|
|
124
|
+
meridiemMode: 'am'
|
|
125
|
+
},
|
|
126
|
+
style: {
|
|
127
|
+
backgroundColor: (theme.vars || theme).palette.primary.main,
|
|
128
|
+
color: (theme.vars || theme).palette.primary.contrastText,
|
|
129
|
+
'&:hover': {
|
|
130
|
+
backgroundColor: (theme.vars || theme).palette.primary.light
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}]
|
|
126
134
|
}));
|
|
127
135
|
const ClockPmButton = styled(IconButton, {
|
|
128
136
|
name: 'MuiClock',
|
|
129
137
|
slot: 'PmButton',
|
|
130
138
|
overridesResolver: (_, styles) => styles.pmButton
|
|
131
139
|
})(({
|
|
132
|
-
theme
|
|
133
|
-
|
|
134
|
-
}) => _extends({
|
|
140
|
+
theme
|
|
141
|
+
}) => ({
|
|
135
142
|
zIndex: 1,
|
|
136
143
|
position: 'absolute',
|
|
137
144
|
bottom: 8,
|
|
138
145
|
right: 8,
|
|
139
146
|
paddingLeft: 4,
|
|
140
147
|
paddingRight: 4,
|
|
141
|
-
width: CLOCK_HOUR_WIDTH
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
+
width: CLOCK_HOUR_WIDTH,
|
|
149
|
+
variants: [{
|
|
150
|
+
props: {
|
|
151
|
+
meridiemMode: 'pm'
|
|
152
|
+
},
|
|
153
|
+
style: {
|
|
154
|
+
backgroundColor: (theme.vars || theme).palette.primary.main,
|
|
155
|
+
color: (theme.vars || theme).palette.primary.contrastText,
|
|
156
|
+
'&:hover': {
|
|
157
|
+
backgroundColor: (theme.vars || theme).palette.primary.light
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}]
|
|
148
161
|
}));
|
|
149
162
|
const ClockMeridiemText = styled(Typography, {
|
|
150
163
|
name: 'MuiClock',
|
|
@@ -178,7 +191,7 @@ export function Clock(inProps) {
|
|
|
178
191
|
selectedId,
|
|
179
192
|
type,
|
|
180
193
|
viewValue,
|
|
181
|
-
disabled,
|
|
194
|
+
disabled = false,
|
|
182
195
|
readOnly,
|
|
183
196
|
className
|
|
184
197
|
} = props;
|
|
@@ -28,9 +28,8 @@ const ClockNumberRoot = styled('span', {
|
|
|
28
28
|
[`&.${clockNumberClasses.selected}`]: styles.selected
|
|
29
29
|
}]
|
|
30
30
|
})(({
|
|
31
|
-
theme
|
|
32
|
-
|
|
33
|
-
}) => _extends({
|
|
31
|
+
theme
|
|
32
|
+
}) => ({
|
|
34
33
|
height: CLOCK_HOUR_WIDTH,
|
|
35
34
|
width: CLOCK_HOUR_WIDTH,
|
|
36
35
|
position: 'absolute',
|
|
@@ -50,10 +49,16 @@ const ClockNumberRoot = styled('span', {
|
|
|
50
49
|
[`&.${clockNumberClasses.disabled}`]: {
|
|
51
50
|
pointerEvents: 'none',
|
|
52
51
|
color: (theme.vars || theme).palette.text.disabled
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
},
|
|
53
|
+
variants: [{
|
|
54
|
+
props: {
|
|
55
|
+
inner: true
|
|
56
|
+
},
|
|
57
|
+
style: _extends({}, theme.typography.body2, {
|
|
58
|
+
color: (theme.vars || theme).palette.text.secondary
|
|
59
|
+
})
|
|
60
|
+
}]
|
|
61
|
+
}));
|
|
57
62
|
|
|
58
63
|
/**
|
|
59
64
|
* @ignore - internal component.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
3
|
const _excluded = ["className", "hasSelected", "isInner", "type", "viewValue"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import clsx from 'clsx';
|
|
@@ -23,26 +23,30 @@ const ClockPointerRoot = styled('div', {
|
|
|
23
23
|
slot: 'Root',
|
|
24
24
|
overridesResolver: (_, styles) => styles.root
|
|
25
25
|
})(({
|
|
26
|
-
theme
|
|
27
|
-
|
|
28
|
-
}) => _extends({
|
|
26
|
+
theme
|
|
27
|
+
}) => ({
|
|
29
28
|
width: 2,
|
|
30
29
|
backgroundColor: (theme.vars || theme).palette.primary.main,
|
|
31
30
|
position: 'absolute',
|
|
32
31
|
left: 'calc(50% - 1px)',
|
|
33
32
|
bottom: '50%',
|
|
34
|
-
transformOrigin: 'center bottom 0px'
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
transformOrigin: 'center bottom 0px',
|
|
34
|
+
variants: [{
|
|
35
|
+
props: {
|
|
36
|
+
shouldAnimate: true
|
|
37
|
+
},
|
|
38
|
+
style: {
|
|
39
|
+
transition: theme.transitions.create(['transform', 'height'])
|
|
40
|
+
}
|
|
41
|
+
}]
|
|
37
42
|
}));
|
|
38
43
|
const ClockPointerThumb = styled('div', {
|
|
39
44
|
name: 'MuiClockPointer',
|
|
40
45
|
slot: 'Thumb',
|
|
41
46
|
overridesResolver: (_, styles) => styles.thumb
|
|
42
47
|
})(({
|
|
43
|
-
theme
|
|
44
|
-
|
|
45
|
-
}) => _extends({
|
|
48
|
+
theme
|
|
49
|
+
}) => ({
|
|
46
50
|
width: 4,
|
|
47
51
|
height: 4,
|
|
48
52
|
backgroundColor: (theme.vars || theme).palette.primary.contrastText,
|
|
@@ -51,9 +55,15 @@ const ClockPointerThumb = styled('div', {
|
|
|
51
55
|
top: -21,
|
|
52
56
|
left: `calc(50% - ${CLOCK_HOUR_WIDTH / 2}px)`,
|
|
53
57
|
border: `${(CLOCK_HOUR_WIDTH - 4) / 2}px solid ${(theme.vars || theme).palette.primary.main}`,
|
|
54
|
-
boxSizing: 'content-box'
|
|
55
|
-
|
|
56
|
-
|
|
58
|
+
boxSizing: 'content-box',
|
|
59
|
+
variants: [{
|
|
60
|
+
props: {
|
|
61
|
+
hasSelected: true
|
|
62
|
+
},
|
|
63
|
+
style: {
|
|
64
|
+
backgroundColor: (theme.vars || theme).palette.primary.main
|
|
65
|
+
}
|
|
66
|
+
}]
|
|
57
67
|
}));
|
|
58
68
|
|
|
59
69
|
/**
|
|
@@ -53,16 +53,22 @@ const TimePickerToolbarHourMinuteLabel = styled('div', {
|
|
|
53
53
|
[`&.${timePickerToolbarClasses.hourMinuteLabelReverse}`]: styles.hourMinuteLabelReverse
|
|
54
54
|
}, styles.hourMinuteLabel]
|
|
55
55
|
})(({
|
|
56
|
-
theme
|
|
57
|
-
ownerState
|
|
56
|
+
theme
|
|
58
57
|
}) => _extends({
|
|
59
58
|
display: 'flex',
|
|
60
59
|
justifyContent: 'flex-end',
|
|
61
60
|
alignItems: 'flex-end'
|
|
62
|
-
}, ownerState.isLandscape && {
|
|
63
|
-
marginTop: 'auto'
|
|
64
61
|
}, theme.direction === 'rtl' && {
|
|
65
62
|
flexDirection: 'row-reverse'
|
|
63
|
+
}, {
|
|
64
|
+
variants: [{
|
|
65
|
+
props: {
|
|
66
|
+
isLandscape: true
|
|
67
|
+
},
|
|
68
|
+
style: {
|
|
69
|
+
marginTop: 'auto'
|
|
70
|
+
}
|
|
71
|
+
}]
|
|
66
72
|
}));
|
|
67
73
|
TimePickerToolbarHourMinuteLabel.propTypes = {
|
|
68
74
|
// ----------------------------- Warning --------------------------------
|
|
@@ -81,23 +87,26 @@ const TimePickerToolbarAmPmSelection = styled('div', {
|
|
|
81
87
|
}, {
|
|
82
88
|
[`&.${timePickerToolbarClasses.ampmLandscape}`]: styles.ampmLandscape
|
|
83
89
|
}, styles.ampmSelection]
|
|
84
|
-
})(
|
|
85
|
-
ownerState
|
|
86
|
-
}) => _extends({
|
|
90
|
+
})({
|
|
87
91
|
display: 'flex',
|
|
88
92
|
flexDirection: 'column',
|
|
89
93
|
marginRight: 'auto',
|
|
90
|
-
marginLeft: 12
|
|
91
|
-
}, ownerState.isLandscape && {
|
|
92
|
-
margin: '4px 0 auto',
|
|
93
|
-
flexDirection: 'row',
|
|
94
|
-
justifyContent: 'space-around',
|
|
95
|
-
flexBasis: '100%'
|
|
96
|
-
}, {
|
|
94
|
+
marginLeft: 12,
|
|
97
95
|
[`& .${timePickerToolbarClasses.ampmLabel}`]: {
|
|
98
96
|
fontSize: 17
|
|
99
|
-
}
|
|
100
|
-
|
|
97
|
+
},
|
|
98
|
+
variants: [{
|
|
99
|
+
props: {
|
|
100
|
+
isLandscape: true
|
|
101
|
+
},
|
|
102
|
+
style: {
|
|
103
|
+
margin: '4px 0 auto',
|
|
104
|
+
flexDirection: 'row',
|
|
105
|
+
justifyContent: 'space-around',
|
|
106
|
+
flexBasis: '100%'
|
|
107
|
+
}
|
|
108
|
+
}]
|
|
109
|
+
});
|
|
101
110
|
TimePickerToolbarAmPmSelection.propTypes = {
|
|
102
111
|
// ----------------------------- Warning --------------------------------
|
|
103
112
|
// | These PropTypes are generated from the TypeScript type definitions |
|