@mui/x-date-pickers 7.0.0-alpha.8 → 7.0.0-alpha.9
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.d.ts +1 -1
- package/AdapterLuxon/AdapterLuxon.js +4 -12
- package/CHANGELOG.md +379 -2
- package/DatePicker/DatePicker.js +0 -3
- package/DatePicker/DatePickerToolbar.js +0 -3
- package/DateTimePicker/DateTimePicker.js +0 -3
- package/DateTimePicker/DateTimePickerToolbar.js +0 -3
- package/DesktopDatePicker/DesktopDatePicker.js +0 -3
- package/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -3
- package/DesktopTimePicker/DesktopTimePicker.js +0 -3
- package/MobileDatePicker/MobileDatePicker.js +0 -3
- package/MobileDateTimePicker/MobileDateTimePicker.js +0 -3
- package/MobileTimePicker/MobileTimePicker.js +0 -3
- package/MonthCalendar/MonthCalendar.js +0 -3
- package/MonthCalendar/MonthCalendar.types.d.ts +0 -3
- package/PickersCalendarHeader/PickersCalendarHeader.js +0 -3
- package/PickersCalendarHeader/PickersCalendarHeader.types.d.ts +0 -3
- package/PickersSectionList/PickersSectionList.js +6 -1
- package/PickersTextField/PickersFilledInput/PickersFilledInput.d.ts +11 -0
- package/{internals/components/PickersInput → PickersTextField/PickersFilledInput}/PickersFilledInput.js +98 -25
- package/PickersTextField/PickersFilledInput/index.d.ts +4 -0
- package/PickersTextField/PickersFilledInput/index.js +2 -0
- package/PickersTextField/PickersFilledInput/pickersFilledInputClasses.d.ts +23 -0
- package/PickersTextField/PickersFilledInput/pickersFilledInputClasses.js +8 -0
- package/PickersTextField/PickersInput/PickersInput.d.ts +10 -0
- package/PickersTextField/PickersInput/PickersInput.js +196 -0
- package/{internals/components → PickersTextField}/PickersInput/index.d.ts +2 -2
- package/PickersTextField/PickersInput/index.js +2 -0
- package/PickersTextField/PickersInput/pickersInputClasses.d.ts +22 -0
- package/PickersTextField/PickersInput/pickersInputClasses.js +8 -0
- package/PickersTextField/PickersInputBase/PickersInputBase.d.ts +16 -0
- package/{internals/components/PickersInput/PickersInput.js → PickersTextField/PickersInputBase/PickersInputBase.js} +106 -27
- package/{internals/components/PickersInput/PickersInput.types.d.ts → PickersTextField/PickersInputBase/PickersInputBase.types.d.ts} +3 -13
- package/PickersTextField/PickersInputBase/index.d.ts +4 -0
- package/PickersTextField/PickersInputBase/index.js +2 -0
- package/PickersTextField/PickersInputBase/pickersInputBaseClasses.d.ts +31 -0
- package/PickersTextField/PickersInputBase/pickersInputBaseClasses.js +6 -0
- package/{internals/components/PickersInput → PickersTextField/PickersOutlinedInput}/Outline.d.ts +3 -0
- package/{modern/internals/components/PickersInput → PickersTextField/PickersOutlinedInput}/Outline.js +5 -1
- package/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.d.ts +10 -0
- package/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.js +190 -0
- package/PickersTextField/PickersOutlinedInput/index.d.ts +4 -0
- package/PickersTextField/PickersOutlinedInput/index.js +2 -0
- package/PickersTextField/PickersOutlinedInput/pickersOutlinedInputClasses.d.ts +22 -0
- package/PickersTextField/PickersOutlinedInput/pickersOutlinedInputClasses.js +8 -0
- package/PickersTextField/PickersTextField.d.ts +3 -0
- package/PickersTextField/PickersTextField.js +258 -0
- package/{internals/components/PickersTextField → PickersTextField}/PickersTextField.types.d.ts +5 -2
- package/PickersTextField/index.d.ts +8 -0
- package/PickersTextField/index.js +6 -0
- package/PickersTextField/package.json +6 -0
- package/README.md +1 -1
- package/StaticDatePicker/StaticDatePicker.js +0 -3
- package/StaticDateTimePicker/StaticDateTimePicker.js +0 -3
- package/StaticTimePicker/StaticTimePicker.js +0 -3
- package/TimePicker/TimePicker.js +0 -3
- package/TimePicker/TimePickerToolbar.js +0 -3
- package/YearCalendar/YearCalendar.js +0 -3
- package/YearCalendar/YearCalendar.types.d.ts +0 -3
- package/index.d.ts +2 -1
- package/index.js +3 -2
- package/internals/hooks/useField/useField.js +6 -4
- package/internals/hooks/useField/useField.types.d.ts +4 -2
- package/internals/hooks/useField/useField.utils.d.ts +19 -9
- package/internals/hooks/useField/useField.utils.js +68 -21
- package/internals/hooks/useField/useFieldCharacterEditing.d.ts +2 -1
- package/internals/hooks/useField/useFieldCharacterEditing.js +12 -8
- package/internals/hooks/useField/useFieldState.d.ts +1 -0
- package/internals/hooks/useField/useFieldState.js +9 -7
- package/internals/models/props/basePickerProps.d.ts +0 -3
- package/internals/models/props/toolbar.d.ts +0 -3
- package/internals/utils/valueManagers.js +2 -2
- package/legacy/AdapterLuxon/AdapterLuxon.js +4 -12
- package/legacy/DatePicker/DatePicker.js +0 -3
- package/legacy/DatePicker/DatePickerToolbar.js +0 -3
- package/legacy/DateTimePicker/DateTimePicker.js +0 -3
- package/legacy/DateTimePicker/DateTimePickerToolbar.js +0 -3
- package/legacy/DesktopDatePicker/DesktopDatePicker.js +0 -3
- package/legacy/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -3
- package/legacy/DesktopTimePicker/DesktopTimePicker.js +0 -3
- package/legacy/MobileDatePicker/MobileDatePicker.js +0 -3
- package/legacy/MobileDateTimePicker/MobileDateTimePicker.js +0 -3
- package/legacy/MobileTimePicker/MobileTimePicker.js +0 -3
- package/legacy/MonthCalendar/MonthCalendar.js +0 -3
- package/legacy/PickersCalendarHeader/PickersCalendarHeader.js +0 -3
- package/legacy/PickersSectionList/PickersSectionList.js +6 -1
- package/legacy/{internals/components/PickersInput → PickersTextField/PickersFilledInput}/PickersFilledInput.js +99 -26
- package/legacy/PickersTextField/PickersFilledInput/index.js +2 -0
- package/legacy/PickersTextField/PickersFilledInput/pickersFilledInputClasses.js +8 -0
- package/legacy/PickersTextField/PickersInput/PickersInput.js +190 -0
- package/legacy/PickersTextField/PickersInput/index.js +2 -0
- package/legacy/PickersTextField/PickersInput/pickersInputClasses.js +8 -0
- package/legacy/{internals/components/PickersInput/PickersInput.js → PickersTextField/PickersInputBase/PickersInputBase.js} +106 -27
- package/legacy/PickersTextField/PickersInputBase/index.js +2 -0
- package/legacy/PickersTextField/PickersInputBase/pickersInputBaseClasses.js +6 -0
- package/legacy/{internals/components/PickersInput → PickersTextField/PickersOutlinedInput}/Outline.js +7 -1
- package/legacy/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.js +183 -0
- package/legacy/PickersTextField/PickersOutlinedInput/index.js +2 -0
- package/legacy/PickersTextField/PickersOutlinedInput/pickersOutlinedInputClasses.js +8 -0
- package/legacy/{internals/components/PickersTextField → PickersTextField}/PickersTextField.js +128 -8
- package/legacy/PickersTextField/index.js +6 -0
- package/legacy/StaticDatePicker/StaticDatePicker.js +0 -3
- package/legacy/StaticDateTimePicker/StaticDateTimePicker.js +0 -3
- package/legacy/StaticTimePicker/StaticTimePicker.js +0 -3
- package/legacy/TimePicker/TimePicker.js +0 -3
- package/legacy/TimePicker/TimePickerToolbar.js +0 -3
- package/legacy/YearCalendar/YearCalendar.js +0 -3
- package/legacy/index.js +3 -2
- package/legacy/internals/hooks/useField/useField.js +6 -4
- package/legacy/internals/hooks/useField/useField.utils.js +71 -20
- package/legacy/internals/hooks/useField/useFieldCharacterEditing.js +12 -8
- package/legacy/internals/hooks/useField/useFieldState.js +15 -11
- package/legacy/internals/utils/valueManagers.js +2 -2
- package/modern/AdapterLuxon/AdapterLuxon.js +3 -11
- package/modern/DatePicker/DatePicker.js +0 -3
- package/modern/DatePicker/DatePickerToolbar.js +0 -3
- package/modern/DateTimePicker/DateTimePicker.js +0 -3
- package/modern/DateTimePicker/DateTimePickerToolbar.js +0 -3
- package/modern/DesktopDatePicker/DesktopDatePicker.js +0 -3
- package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -3
- package/modern/DesktopTimePicker/DesktopTimePicker.js +0 -3
- package/modern/MobileDatePicker/MobileDatePicker.js +0 -3
- package/modern/MobileDateTimePicker/MobileDateTimePicker.js +0 -3
- package/modern/MobileTimePicker/MobileTimePicker.js +0 -3
- package/modern/MonthCalendar/MonthCalendar.js +0 -3
- package/modern/PickersCalendarHeader/PickersCalendarHeader.js +0 -3
- package/modern/PickersSectionList/PickersSectionList.js +6 -1
- package/modern/{internals/components/PickersInput → PickersTextField/PickersFilledInput}/PickersFilledInput.js +98 -25
- package/modern/PickersTextField/PickersFilledInput/index.js +2 -0
- package/modern/PickersTextField/PickersFilledInput/pickersFilledInputClasses.js +8 -0
- package/modern/PickersTextField/PickersInput/PickersInput.js +196 -0
- package/modern/PickersTextField/PickersInput/index.js +2 -0
- package/modern/PickersTextField/PickersInput/pickersInputClasses.js +8 -0
- package/modern/{internals/components/PickersInput/PickersInput.js → PickersTextField/PickersInputBase/PickersInputBase.js} +106 -27
- package/modern/PickersTextField/PickersInputBase/index.js +2 -0
- package/modern/PickersTextField/PickersInputBase/pickersInputBaseClasses.js +6 -0
- package/{internals/components/PickersInput → modern/PickersTextField/PickersOutlinedInput}/Outline.js +5 -1
- package/modern/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.js +190 -0
- package/modern/PickersTextField/PickersOutlinedInput/index.js +2 -0
- package/modern/PickersTextField/PickersOutlinedInput/pickersOutlinedInputClasses.js +8 -0
- package/modern/PickersTextField/PickersTextField.js +258 -0
- package/modern/PickersTextField/index.js +6 -0
- package/modern/StaticDatePicker/StaticDatePicker.js +0 -3
- package/modern/StaticDateTimePicker/StaticDateTimePicker.js +0 -3
- package/modern/StaticTimePicker/StaticTimePicker.js +0 -3
- package/modern/TimePicker/TimePicker.js +0 -3
- package/modern/TimePicker/TimePickerToolbar.js +0 -3
- package/modern/YearCalendar/YearCalendar.js +0 -3
- package/modern/index.js +3 -2
- package/modern/internals/hooks/useField/useField.js +5 -3
- package/modern/internals/hooks/useField/useField.utils.js +68 -21
- package/modern/internals/hooks/useField/useFieldCharacterEditing.js +12 -8
- package/modern/internals/hooks/useField/useFieldState.js +9 -7
- package/modern/internals/utils/valueManagers.js +2 -2
- package/node/AdapterLuxon/AdapterLuxon.js +3 -11
- package/node/DatePicker/DatePicker.js +0 -3
- package/node/DatePicker/DatePickerToolbar.js +0 -3
- package/node/DateTimePicker/DateTimePicker.js +0 -3
- package/node/DateTimePicker/DateTimePickerToolbar.js +0 -3
- package/node/DesktopDatePicker/DesktopDatePicker.js +0 -3
- package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -3
- package/node/DesktopTimePicker/DesktopTimePicker.js +0 -3
- package/node/MobileDatePicker/MobileDatePicker.js +0 -3
- package/node/MobileDateTimePicker/MobileDateTimePicker.js +0 -3
- package/node/MobileTimePicker/MobileTimePicker.js +0 -3
- package/node/MonthCalendar/MonthCalendar.js +0 -3
- package/node/PickersCalendarHeader/PickersCalendarHeader.js +0 -3
- package/node/PickersSectionList/PickersSectionList.js +6 -1
- package/node/{internals/components/PickersInput → PickersTextField/PickersFilledInput}/PickersFilledInput.js +102 -30
- package/node/PickersTextField/PickersFilledInput/index.js +25 -0
- package/node/PickersTextField/PickersFilledInput/pickersFilledInputClasses.js +16 -0
- package/node/PickersTextField/PickersInput/PickersInput.js +204 -0
- package/node/{internals/components → PickersTextField}/PickersInput/index.js +0 -7
- package/node/PickersTextField/PickersInput/pickersInputClasses.js +16 -0
- package/node/{internals/components/PickersInput/PickersInput.js → PickersTextField/PickersInputBase/PickersInputBase.js} +105 -27
- package/node/PickersTextField/PickersInputBase/index.js +25 -0
- package/node/PickersTextField/PickersInputBase/pickersInputBaseClasses.js +14 -0
- package/node/{internals/components/PickersInput → PickersTextField/PickersOutlinedInput}/Outline.js +5 -1
- package/node/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.js +197 -0
- package/node/PickersTextField/PickersOutlinedInput/index.js +25 -0
- package/node/PickersTextField/PickersOutlinedInput/pickersOutlinedInputClasses.js +16 -0
- package/node/{internals/components/PickersTextField → PickersTextField}/PickersTextField.js +128 -9
- package/node/PickersTextField/index.js +78 -0
- package/node/StaticDatePicker/StaticDatePicker.js +0 -3
- package/node/StaticDateTimePicker/StaticDateTimePicker.js +0 -3
- package/node/StaticTimePicker/StaticTimePicker.js +0 -3
- package/node/TimePicker/TimePicker.js +0 -3
- package/node/TimePicker/TimePickerToolbar.js +0 -3
- package/node/YearCalendar/YearCalendar.js +0 -3
- package/node/index.js +17 -5
- package/node/internals/hooks/useField/useField.js +5 -3
- package/node/internals/hooks/useField/useField.utils.js +73 -22
- package/node/internals/hooks/useField/useFieldCharacterEditing.js +11 -7
- package/node/internals/hooks/useField/useFieldState.js +8 -6
- package/node/internals/utils/valueManagers.js +2 -2
- package/package.json +7 -7
- package/themeAugmentation/components.d.ts +26 -0
- package/themeAugmentation/overrides.d.ts +16 -0
- package/themeAugmentation/props.d.ts +16 -0
- package/internals/components/PickersInput/PickersFilledInput.d.ts +0 -3
- package/internals/components/PickersInput/PickersInput.d.ts +0 -13
- package/internals/components/PickersInput/PickersOutlinedInput.d.ts +0 -3
- package/internals/components/PickersInput/PickersOutlinedInput.js +0 -117
- package/internals/components/PickersInput/PickersStandardInput.d.ts +0 -3
- package/internals/components/PickersInput/PickersStandardInput.js +0 -123
- package/internals/components/PickersInput/index.js +0 -3
- package/internals/components/PickersInput/pickersInputClasses.d.ts +0 -84
- package/internals/components/PickersInput/pickersInputClasses.js +0 -18
- package/internals/components/PickersTextField/PickersTextField.d.ts +0 -2
- package/internals/components/PickersTextField/PickersTextField.js +0 -138
- package/internals/components/PickersTextField/index.d.ts +0 -1
- package/internals/components/PickersTextField/index.js +0 -1
- package/legacy/internals/components/PickersInput/PickersOutlinedInput.js +0 -110
- package/legacy/internals/components/PickersInput/PickersStandardInput.js +0 -117
- package/legacy/internals/components/PickersInput/index.js +0 -3
- package/legacy/internals/components/PickersInput/pickersInputClasses.js +0 -18
- package/legacy/internals/components/PickersTextField/index.js +0 -1
- package/modern/internals/components/PickersInput/PickersOutlinedInput.js +0 -117
- package/modern/internals/components/PickersInput/PickersStandardInput.js +0 -123
- package/modern/internals/components/PickersInput/index.js +0 -3
- package/modern/internals/components/PickersInput/pickersInputClasses.js +0 -18
- package/modern/internals/components/PickersTextField/PickersTextField.js +0 -138
- package/modern/internals/components/PickersTextField/index.js +0 -1
- package/node/internals/components/PickersInput/PickersOutlinedInput.js +0 -125
- package/node/internals/components/PickersInput/PickersStandardInput.js +0 -132
- package/node/internals/components/PickersInput/pickersInputClasses.js +0 -29
- package/node/internals/components/PickersTextField/index.js +0 -12
- /package/{internals/components/PickersInput/PickersInput.types.js → PickersTextField/PickersInputBase/PickersInputBase.types.js} +0 -0
- /package/{internals/components/PickersTextField → PickersTextField}/PickersTextField.types.js +0 -0
- /package/{internals/components/PickersTextField → PickersTextField}/pickersTextFieldClasses.d.ts +0 -0
- /package/{internals/components/PickersTextField → PickersTextField}/pickersTextFieldClasses.js +0 -0
- /package/legacy/{internals/components/PickersInput/PickersInput.types.js → PickersTextField/PickersInputBase/PickersInputBase.types.js} +0 -0
- /package/legacy/{internals/components/PickersTextField → PickersTextField}/PickersTextField.types.js +0 -0
- /package/legacy/{internals/components/PickersTextField → PickersTextField}/pickersTextFieldClasses.js +0 -0
- /package/modern/{internals/components/PickersInput/PickersInput.types.js → PickersTextField/PickersInputBase/PickersInputBase.types.js} +0 -0
- /package/modern/{internals/components/PickersTextField → PickersTextField}/PickersTextField.types.js +0 -0
- /package/modern/{internals/components/PickersTextField → PickersTextField}/pickersTextFieldClasses.js +0 -0
- /package/node/{internals/components/PickersInput/PickersInput.types.js → PickersTextField/PickersInputBase/PickersInputBase.types.js} +0 -0
- /package/node/{internals/components/PickersTextField → PickersTextField}/PickersTextField.types.js +0 -0
- /package/node/{internals/components/PickersTextField → PickersTextField}/pickersTextFieldClasses.js +0 -0
|
@@ -65,7 +65,54 @@ export const getLetterEditingOptions = (utils, timezone, sectionType, format) =>
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
|
-
|
|
68
|
+
|
|
69
|
+
// This format should be the same on all the adapters
|
|
70
|
+
// If some adapter does not respect this convention, then we will need to hardcode the format on each adapter.
|
|
71
|
+
export const FORMAT_SECONDS_NO_LEADING_ZEROS = 's';
|
|
72
|
+
const NON_LOCALIZED_DIGITS = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];
|
|
73
|
+
export const getLocalizedDigits = utils => {
|
|
74
|
+
const today = utils.date(undefined);
|
|
75
|
+
const formattedZero = utils.formatByString(utils.setSeconds(today, 0), FORMAT_SECONDS_NO_LEADING_ZEROS);
|
|
76
|
+
if (formattedZero === '0') {
|
|
77
|
+
return NON_LOCALIZED_DIGITS;
|
|
78
|
+
}
|
|
79
|
+
return Array.from({
|
|
80
|
+
length: 10
|
|
81
|
+
}).map((_, index) => utils.formatByString(utils.setSeconds(today, index), FORMAT_SECONDS_NO_LEADING_ZEROS));
|
|
82
|
+
};
|
|
83
|
+
export const removeLocalizedDigits = (valueStr, localizedDigits) => {
|
|
84
|
+
if (localizedDigits[0] === '0') {
|
|
85
|
+
return valueStr;
|
|
86
|
+
}
|
|
87
|
+
const digits = [];
|
|
88
|
+
let currentFormattedDigit = '';
|
|
89
|
+
for (let i = 0; i < valueStr.length; i += 1) {
|
|
90
|
+
currentFormattedDigit += valueStr[i];
|
|
91
|
+
const matchingDigitIndex = localizedDigits.indexOf(currentFormattedDigit);
|
|
92
|
+
if (matchingDigitIndex > -1) {
|
|
93
|
+
digits.push(matchingDigitIndex.toString());
|
|
94
|
+
currentFormattedDigit = '';
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return digits.join('');
|
|
98
|
+
};
|
|
99
|
+
export const applyLocalizedDigits = (valueStr, localizedDigits) => {
|
|
100
|
+
if (localizedDigits[0] === '0') {
|
|
101
|
+
return valueStr;
|
|
102
|
+
}
|
|
103
|
+
return valueStr.split('').map(char => localizedDigits[Number(char)]).join('');
|
|
104
|
+
};
|
|
105
|
+
export const isStringNumber = (valueStr, localizedDigits) => {
|
|
106
|
+
const nonLocalizedValueStr = removeLocalizedDigits(valueStr, localizedDigits);
|
|
107
|
+
return !Number.isNaN(Number(nonLocalizedValueStr));
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Remove the leading zeroes to a digit section value.
|
|
112
|
+
* E.g.: `03` => `3`
|
|
113
|
+
* Warning: Should only be called with non-localized digits. Call `removeLocalizedDigits` with your value if needed.
|
|
114
|
+
*/
|
|
115
|
+
export const cleanLeadingZeros = (valueStr, size) => {
|
|
69
116
|
let cleanValueStr = valueStr;
|
|
70
117
|
|
|
71
118
|
// Remove the leading zeros
|
|
@@ -77,7 +124,7 @@ export const cleanLeadingZeros = (utils, valueStr, size) => {
|
|
|
77
124
|
}
|
|
78
125
|
return cleanValueStr;
|
|
79
126
|
};
|
|
80
|
-
export const cleanDigitSectionValue = (utils,
|
|
127
|
+
export const cleanDigitSectionValue = (utils, value, sectionBoundaries, localizedDigits, section) => {
|
|
81
128
|
if (process.env.NODE_ENV !== 'production') {
|
|
82
129
|
if (section.type !== 'day' && section.contentType === 'digit-with-letter') {
|
|
83
130
|
throw new Error([`MUI X: The token "${section.format}" is a digit format with letter in it.'
|
|
@@ -90,13 +137,13 @@ export const cleanDigitSectionValue = (utils, timezone, value, sectionBoundaries
|
|
|
90
137
|
}
|
|
91
138
|
|
|
92
139
|
// queryValue without leading `0` (`01` => `1`)
|
|
93
|
-
|
|
140
|
+
let valueStr = value.toString();
|
|
94
141
|
if (section.hasLeadingZerosInInput) {
|
|
95
|
-
|
|
142
|
+
valueStr = cleanLeadingZeros(valueStr, section.maxLength);
|
|
96
143
|
}
|
|
97
|
-
return valueStr;
|
|
144
|
+
return applyLocalizedDigits(valueStr, localizedDigits);
|
|
98
145
|
};
|
|
99
|
-
export const adjustSectionValue = (utils, timezone, section, keyCode, sectionsValueBoundaries, activeDate, stepsAttributes) => {
|
|
146
|
+
export const adjustSectionValue = (utils, timezone, section, keyCode, sectionsValueBoundaries, localizedDigits, activeDate, stepsAttributes) => {
|
|
100
147
|
const delta = getDeltaFromKeyCode(keyCode);
|
|
101
148
|
const isStart = keyCode === 'Home';
|
|
102
149
|
const isEnd = keyCode === 'End';
|
|
@@ -107,9 +154,9 @@ export const adjustSectionValue = (utils, timezone, section, keyCode, sectionsVa
|
|
|
107
154
|
format: section.format,
|
|
108
155
|
contentType: section.contentType
|
|
109
156
|
});
|
|
110
|
-
const getCleanValue = value => cleanDigitSectionValue(utils,
|
|
157
|
+
const getCleanValue = value => cleanDigitSectionValue(utils, value, sectionBoundaries, localizedDigits, section);
|
|
111
158
|
const step = section.type === 'minutes' && stepsAttributes?.minutesStep ? stepsAttributes.minutesStep : 1;
|
|
112
|
-
const currentSectionValue = parseInt(section.value, 10);
|
|
159
|
+
const currentSectionValue = parseInt(removeLocalizedDigits(section.value, localizedDigits), 10);
|
|
113
160
|
let newSectionValueNumber = currentSectionValue + delta * step;
|
|
114
161
|
if (shouldSetAbsolute) {
|
|
115
162
|
if (section.type === 'year' && !isEnd && !isStart) {
|
|
@@ -157,11 +204,11 @@ export const adjustSectionValue = (utils, timezone, section, keyCode, sectionsVa
|
|
|
157
204
|
}
|
|
158
205
|
return adjustLetterSection();
|
|
159
206
|
};
|
|
160
|
-
export const getSectionVisibleValue = (section, target) => {
|
|
207
|
+
export const getSectionVisibleValue = (section, target, localizedDigits) => {
|
|
161
208
|
let value = section.value || section.placeholder;
|
|
162
209
|
const hasLeadingZeros = target === 'non-input' ? section.hasLeadingZerosInFormat : section.hasLeadingZerosInInput;
|
|
163
210
|
if (target === 'non-input' && section.hasLeadingZerosInInput && !section.hasLeadingZerosInFormat) {
|
|
164
|
-
value = Number(value).toString();
|
|
211
|
+
value = Number(removeLocalizedDigits(value, localizedDigits)).toString();
|
|
165
212
|
}
|
|
166
213
|
|
|
167
214
|
// In the input, we add an empty character at the end of each section without leading zeros.
|
|
@@ -179,13 +226,13 @@ export const getSectionVisibleValue = (section, target) => {
|
|
|
179
226
|
return value;
|
|
180
227
|
};
|
|
181
228
|
export const cleanString = dirtyString => dirtyString.replace(/[\u2066\u2067\u2068\u2069]/g, '');
|
|
182
|
-
export const addPositionPropertiesToSections = (sections, isRTL) => {
|
|
229
|
+
export const addPositionPropertiesToSections = (sections, localizedDigits, isRTL) => {
|
|
183
230
|
let position = 0;
|
|
184
231
|
let positionInInput = isRTL ? 1 : 0;
|
|
185
232
|
const newSections = [];
|
|
186
233
|
for (let i = 0; i < sections.length; i += 1) {
|
|
187
234
|
const section = sections[i];
|
|
188
|
-
const renderedValue = getSectionVisibleValue(section, isRTL ? 'input-rtl' : 'input-ltr');
|
|
235
|
+
const renderedValue = getSectionVisibleValue(section, isRTL ? 'input-rtl' : 'input-ltr', localizedDigits);
|
|
189
236
|
const sectionStr = `${section.startSeparator}${renderedValue}${section.endSeparator}`;
|
|
190
237
|
const sectionLength = cleanString(sectionStr).length;
|
|
191
238
|
const sectionLengthInInput = sectionStr.length;
|
|
@@ -337,7 +384,7 @@ const getEscapedPartsFromFormat = (utils, format) => {
|
|
|
337
384
|
}
|
|
338
385
|
return escapedParts;
|
|
339
386
|
};
|
|
340
|
-
export const splitFormatIntoSections = (utils, timezone, localeText, format, date, formatDensity, shouldRespectLeadingZeros, isRTL) => {
|
|
387
|
+
export const splitFormatIntoSections = (utils, timezone, localeText, localizedDigits, format, date, formatDensity, shouldRespectLeadingZeros, isRTL) => {
|
|
341
388
|
let startSeparator = '';
|
|
342
389
|
const sections = [];
|
|
343
390
|
const now = utils.date();
|
|
@@ -360,7 +407,7 @@ export const splitFormatIntoSections = (utils, timezone, localeText, format, dat
|
|
|
360
407
|
}
|
|
361
408
|
maxLength = sectionConfig.maxLength;
|
|
362
409
|
if (isValidDate) {
|
|
363
|
-
sectionValue = cleanLeadingZeros(
|
|
410
|
+
sectionValue = applyLocalizedDigits(cleanLeadingZeros(removeLocalizedDigits(sectionValue, localizedDigits), maxLength), localizedDigits);
|
|
364
411
|
}
|
|
365
412
|
}
|
|
366
413
|
}
|
|
@@ -461,7 +508,7 @@ export const splitFormatIntoSections = (utils, timezone, localeText, format, dat
|
|
|
461
508
|
* Some date libraries like `dayjs` don't support parsing from date with escaped characters.
|
|
462
509
|
* To make sure that the parsing works, we are building a format and a date without any separator.
|
|
463
510
|
*/
|
|
464
|
-
export const getDateFromDateSections = (utils, sections) => {
|
|
511
|
+
export const getDateFromDateSections = (utils, sections, localizedDigits) => {
|
|
465
512
|
// If we have both a day and a weekDay section,
|
|
466
513
|
// Then we skip the weekDay in the parsing because libraries like dayjs can't parse complicated formats containing a weekDay.
|
|
467
514
|
// dayjs(dayjs().format('dddd MMMM D YYYY'), 'dddd MMMM D YYYY')) // returns `Invalid Date` even if the format is valid.
|
|
@@ -473,16 +520,16 @@ export const getDateFromDateSections = (utils, sections) => {
|
|
|
473
520
|
const shouldSkip = shouldSkipWeekDays && section.type === 'weekDay';
|
|
474
521
|
if (!shouldSkip) {
|
|
475
522
|
sectionFormats.push(section.format);
|
|
476
|
-
sectionValues.push(getSectionVisibleValue(section, 'non-input'));
|
|
523
|
+
sectionValues.push(getSectionVisibleValue(section, 'non-input', localizedDigits));
|
|
477
524
|
}
|
|
478
525
|
}
|
|
479
526
|
const formatWithoutSeparator = sectionFormats.join(' ');
|
|
480
527
|
const dateWithoutSeparatorStr = sectionValues.join(' ');
|
|
481
528
|
return utils.parse(dateWithoutSeparatorStr, formatWithoutSeparator);
|
|
482
529
|
};
|
|
483
|
-
export const createDateStrForInputFromSections = (sections, isRTL) => {
|
|
530
|
+
export const createDateStrForInputFromSections = (sections, localizedDigits, isRTL) => {
|
|
484
531
|
const formattedSections = sections.map(section => {
|
|
485
|
-
const dateValue = getSectionVisibleValue(section, isRTL ? 'input-rtl' : 'input-ltr');
|
|
532
|
+
const dateValue = getSectionVisibleValue(section, isRTL ? 'input-rtl' : 'input-ltr', localizedDigits);
|
|
486
533
|
return `${section.startSeparator}${dateValue}${section.endSeparator}`;
|
|
487
534
|
});
|
|
488
535
|
const dateStr = formattedSections.join('');
|
|
@@ -497,7 +544,7 @@ export const createDateStrForInputFromSections = (sections, isRTL) => {
|
|
|
497
544
|
// wrap into an isolated group such that separators can split the string in smaller ones by adding \u2069\u2068
|
|
498
545
|
return `\u2066${dateStr}\u2069`;
|
|
499
546
|
};
|
|
500
|
-
export const getSectionsBoundaries = (utils, timezone) => {
|
|
547
|
+
export const getSectionsBoundaries = (utils, localizedDigits, timezone) => {
|
|
501
548
|
const today = utils.date(undefined, timezone);
|
|
502
549
|
const endOfYear = utils.endOfYear(today);
|
|
503
550
|
const endOfDay = utils.endOfDay(today);
|
|
@@ -556,11 +603,11 @@ export const getSectionsBoundaries = (utils, timezone) => {
|
|
|
556
603
|
format
|
|
557
604
|
}) => {
|
|
558
605
|
const lastHourInDay = utils.getHours(endOfDay);
|
|
559
|
-
const hasMeridiem = utils.formatByString(utils.endOfDay(today), format) !== lastHourInDay.toString();
|
|
606
|
+
const hasMeridiem = removeLocalizedDigits(utils.formatByString(utils.endOfDay(today), format), localizedDigits) !== lastHourInDay.toString();
|
|
560
607
|
if (hasMeridiem) {
|
|
561
608
|
return {
|
|
562
609
|
minimum: 1,
|
|
563
|
-
maximum: Number(utils.formatByString(utils.startOfDay(today), format))
|
|
610
|
+
maximum: Number(removeLocalizedDigits(utils.formatByString(utils.startOfDay(today), format), localizedDigits))
|
|
564
611
|
};
|
|
565
612
|
}
|
|
566
613
|
return {
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import useEventCallback from '@mui/utils/useEventCallback';
|
|
4
4
|
import { useUtils } from '../useUtils';
|
|
5
|
-
import { changeSectionValueFormat, cleanDigitSectionValue, doesSectionFormatHaveLeadingZeros, getDateSectionConfigFromFormatToken, getDaysInWeekStr, getLetterEditingOptions } from './useField.utils';
|
|
5
|
+
import { changeSectionValueFormat, cleanDigitSectionValue, doesSectionFormatHaveLeadingZeros, getDateSectionConfigFromFormatToken, getDaysInWeekStr, getLetterEditingOptions, applyLocalizedDigits, removeLocalizedDigits, isStringNumber } from './useField.utils';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* The letter editing and the numeric editing each define a `CharacterEditingApplier`.
|
|
@@ -40,6 +40,7 @@ export const useFieldCharacterEditing = ({
|
|
|
40
40
|
sections,
|
|
41
41
|
updateSectionValue,
|
|
42
42
|
sectionsValueBoundaries,
|
|
43
|
+
localizedDigits,
|
|
43
44
|
setTempAndroidValueStr,
|
|
44
45
|
timezone
|
|
45
46
|
}) => {
|
|
@@ -68,7 +69,7 @@ export const useFieldCharacterEditing = ({
|
|
|
68
69
|
const activeSection = sections[sectionIndex];
|
|
69
70
|
|
|
70
71
|
// The current query targets the section being editing
|
|
71
|
-
// We can try to
|
|
72
|
+
// We can try to concatenate the value
|
|
72
73
|
if (query != null && (!isValidQueryValue || isValidQueryValue(query.value)) && query.sectionIndex === sectionIndex) {
|
|
73
74
|
const concatenatedQueryValue = `${query.value}${cleanKeyPressed}`;
|
|
74
75
|
const queryResponse = getFirstSectionValueMatchingWithQuery(concatenatedQueryValue, activeSection);
|
|
@@ -162,7 +163,8 @@ export const useFieldCharacterEditing = ({
|
|
|
162
163
|
};
|
|
163
164
|
const applyNumericEditing = params => {
|
|
164
165
|
const getNewSectionValue = (queryValue, section) => {
|
|
165
|
-
const
|
|
166
|
+
const cleanQueryValue = removeLocalizedDigits(queryValue, localizedDigits);
|
|
167
|
+
const queryValueNumber = Number(cleanQueryValue);
|
|
166
168
|
const sectionBoundaries = sectionsValueBoundaries[section.type]({
|
|
167
169
|
currentDate: null,
|
|
168
170
|
format: section.format,
|
|
@@ -182,8 +184,8 @@ export const useFieldCharacterEditing = ({
|
|
|
182
184
|
saveQuery: true
|
|
183
185
|
};
|
|
184
186
|
}
|
|
185
|
-
const shouldGoToNextSection =
|
|
186
|
-
const newSectionValue = cleanDigitSectionValue(utils,
|
|
187
|
+
const shouldGoToNextSection = queryValueNumber * 10 > sectionBoundaries.maximum || cleanQueryValue.length === sectionBoundaries.maximum.toString().length;
|
|
188
|
+
const newSectionValue = cleanDigitSectionValue(utils, queryValueNumber, sectionBoundaries, localizedDigits, section);
|
|
187
189
|
return {
|
|
188
190
|
sectionValue: newSectionValue,
|
|
189
191
|
shouldGoToNextSection
|
|
@@ -231,12 +233,14 @@ export const useFieldCharacterEditing = ({
|
|
|
231
233
|
saveQuery: false
|
|
232
234
|
};
|
|
233
235
|
};
|
|
234
|
-
return applyQuery(params, getFirstSectionValueMatchingWithQuery, queryValue =>
|
|
236
|
+
return applyQuery(params, getFirstSectionValueMatchingWithQuery, queryValue => isStringNumber(queryValue, localizedDigits));
|
|
235
237
|
};
|
|
236
238
|
const applyCharacterEditing = useEventCallback(params => {
|
|
237
239
|
const activeSection = sections[params.sectionIndex];
|
|
238
|
-
const isNumericEditing =
|
|
239
|
-
const response = isNumericEditing ? applyNumericEditing(params
|
|
240
|
+
const isNumericEditing = isStringNumber(params.keyPressed, localizedDigits);
|
|
241
|
+
const response = isNumericEditing ? applyNumericEditing(_extends({}, params, {
|
|
242
|
+
keyPressed: applyLocalizedDigits(params.keyPressed, localizedDigits)
|
|
243
|
+
})) : applyLetterEditing(params);
|
|
240
244
|
if (response == null) {
|
|
241
245
|
setTempAndroidValueStr(null);
|
|
242
246
|
} else {
|
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import useControlled from '@mui/utils/useControlled';
|
|
4
4
|
import { useTheme } from '@mui/material/styles';
|
|
5
5
|
import { useUtils, useLocaleText, useLocalizationContext } from '../useUtils';
|
|
6
|
-
import { addPositionPropertiesToSections, splitFormatIntoSections, mergeDateIntoReferenceDate, getSectionsBoundaries, validateSections, getDateFromDateSections } from './useField.utils';
|
|
6
|
+
import { addPositionPropertiesToSections, splitFormatIntoSections, mergeDateIntoReferenceDate, getSectionsBoundaries, validateSections, getDateFromDateSections, getLocalizedDigits } from './useField.utils';
|
|
7
7
|
import { useValueWithTimezone } from '../useValueWithTimezone';
|
|
8
8
|
import { getSectionTypeGranularity } from '../../utils/getDefaultReferenceDate';
|
|
9
9
|
export const useFieldState = params => {
|
|
@@ -42,9 +42,10 @@ export const useFieldState = params => {
|
|
|
42
42
|
onChange,
|
|
43
43
|
valueManager
|
|
44
44
|
});
|
|
45
|
-
const
|
|
46
|
-
const
|
|
47
|
-
const
|
|
45
|
+
const localizedDigits = React.useMemo(() => getLocalizedDigits(utils), [utils]);
|
|
46
|
+
const sectionsValueBoundaries = React.useMemo(() => getSectionsBoundaries(utils, localizedDigits, timezone), [utils, localizedDigits, timezone]);
|
|
47
|
+
const getSectionsFromValue = React.useCallback((value, fallbackSections = null) => fieldValueManager.getSectionsFromValue(utils, value, fallbackSections, localizedDigits, isRTL, date => splitFormatIntoSections(utils, timezone, localeText, localizedDigits, format, date, formatDensity, shouldRespectLeadingZeros, isRTL)), [fieldValueManager, format, localeText, localizedDigits, isRTL, shouldRespectLeadingZeros, utils, formatDensity, timezone]);
|
|
48
|
+
const placeholder = React.useMemo(() => fieldValueManager.getValueStrFromSections(getSectionsFromValue(valueManager.emptyValue), localizedDigits, isRTL), [fieldValueManager, getSectionsFromValue, valueManager.emptyValue, localizedDigits, isRTL]);
|
|
48
49
|
const [state, setState] = React.useState(() => {
|
|
49
50
|
const sections = getSectionsFromValue(valueFromTheOutside);
|
|
50
51
|
validateSections(sections, valueType);
|
|
@@ -142,7 +143,7 @@ export const useFieldState = params => {
|
|
|
142
143
|
value: newSectionValue,
|
|
143
144
|
modified: true
|
|
144
145
|
});
|
|
145
|
-
return addPositionPropertiesToSections(newSections, isRTL);
|
|
146
|
+
return addPositionPropertiesToSections(newSections, localizedDigits, isRTL);
|
|
146
147
|
};
|
|
147
148
|
const clearValue = () => {
|
|
148
149
|
publishValue({
|
|
@@ -179,7 +180,7 @@ export const useFieldState = params => {
|
|
|
179
180
|
if (date == null || !utils.isValid(date)) {
|
|
180
181
|
return null;
|
|
181
182
|
}
|
|
182
|
-
const sections = splitFormatIntoSections(utils, timezone, localeText, format, date, formatDensity, shouldRespectLeadingZeros, isRTL);
|
|
183
|
+
const sections = splitFormatIntoSections(utils, timezone, localeText, localizedDigits, format, date, formatDensity, shouldRespectLeadingZeros, isRTL);
|
|
183
184
|
return mergeDateIntoReferenceDate(utils, timezone, date, sections, referenceDate, false);
|
|
184
185
|
};
|
|
185
186
|
const newValue = fieldValueManager.parseValueStr(valueStr, state.referenceValue, parseDateStr);
|
|
@@ -210,7 +211,7 @@ export const useFieldState = params => {
|
|
|
210
211
|
const activeDateManager = fieldValueManager.getActiveDateManager(utils, state, activeSection);
|
|
211
212
|
const newSections = setSectionValue(selectedSectionIndexes.startIndex, newSectionValue);
|
|
212
213
|
const newActiveDateSections = activeDateManager.getSections(newSections);
|
|
213
|
-
const newActiveDate = getDateFromDateSections(utils, newActiveDateSections);
|
|
214
|
+
const newActiveDate = getDateFromDateSections(utils, newActiveDateSections, localizedDigits);
|
|
214
215
|
let values;
|
|
215
216
|
let shouldPublish;
|
|
216
217
|
|
|
@@ -278,6 +279,7 @@ export const useFieldState = params => {
|
|
|
278
279
|
updateValueFromValueStr,
|
|
279
280
|
setTempAndroidValueStr,
|
|
280
281
|
sectionsValueBoundaries,
|
|
282
|
+
localizedDigits,
|
|
281
283
|
placeholder,
|
|
282
284
|
timezone
|
|
283
285
|
};
|
|
@@ -30,12 +30,12 @@ export const singleItemValueManager = {
|
|
|
30
30
|
};
|
|
31
31
|
export const singleItemFieldValueManager = {
|
|
32
32
|
updateReferenceValue: (utils, value, prevReferenceValue) => value == null || !utils.isValid(value) ? prevReferenceValue : value,
|
|
33
|
-
getSectionsFromValue: (utils, date, prevSections, isRTL, getSectionsFromDate) => {
|
|
33
|
+
getSectionsFromValue: (utils, date, prevSections, localizedDigits, isRTL, getSectionsFromDate) => {
|
|
34
34
|
const shouldReUsePrevDateSections = !utils.isValid(date) && !!prevSections;
|
|
35
35
|
if (shouldReUsePrevDateSections) {
|
|
36
36
|
return prevSections;
|
|
37
37
|
}
|
|
38
|
-
return addPositionPropertiesToSections(getSectionsFromDate(date), isRTL);
|
|
38
|
+
return addPositionPropertiesToSections(getSectionsFromDate(date), localizedDigits, isRTL);
|
|
39
39
|
},
|
|
40
40
|
getValueStrFromSections: createDateStrForInputFromSections,
|
|
41
41
|
getActiveDateManager: (utils, state) => ({
|
|
@@ -345,10 +345,7 @@ class AdapterLuxon {
|
|
|
345
345
|
return value.startOf('month');
|
|
346
346
|
};
|
|
347
347
|
this.startOfWeek = value => {
|
|
348
|
-
return value.startOf('week',
|
|
349
|
-
// TODO: remove when `@types/luxon` add support for the parameter.
|
|
350
|
-
// @ts-ignore
|
|
351
|
-
{
|
|
348
|
+
return value.startOf('week', {
|
|
352
349
|
useLocaleWeeks: true
|
|
353
350
|
});
|
|
354
351
|
};
|
|
@@ -362,10 +359,7 @@ class AdapterLuxon {
|
|
|
362
359
|
return value.endOf('month');
|
|
363
360
|
};
|
|
364
361
|
this.endOfWeek = value => {
|
|
365
|
-
return value.endOf('week',
|
|
366
|
-
// TODO: remove when `@types/luxon` add support for the parameter.
|
|
367
|
-
// @ts-ignore
|
|
368
|
-
{
|
|
362
|
+
return value.endOf('week', {
|
|
369
363
|
useLocaleWeeks: true
|
|
370
364
|
});
|
|
371
365
|
};
|
|
@@ -487,9 +481,7 @@ class AdapterLuxon {
|
|
|
487
481
|
return weeks;
|
|
488
482
|
};
|
|
489
483
|
this.getWeekNumber = value => {
|
|
490
|
-
|
|
491
|
-
// @ts-ignore
|
|
492
|
-
return value.localeWeekNumber ?? value.weekNumber;
|
|
484
|
+
return value.localWeekNumber ?? value.weekNumber;
|
|
493
485
|
};
|
|
494
486
|
this.getYearRange = ([start, end]) => {
|
|
495
487
|
const startDate = this.startOfYear(start);
|
|
@@ -64,9 +64,6 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
|
|
|
64
64
|
* - the `input` element if there is a field rendered.
|
|
65
65
|
*/
|
|
66
66
|
autoFocus: _propTypes.default.bool,
|
|
67
|
-
/**
|
|
68
|
-
* Class name applied to the root element.
|
|
69
|
-
*/
|
|
70
67
|
className: _propTypes.default.string,
|
|
71
68
|
/**
|
|
72
69
|
* If `true`, the popover or modal will close after submitting the full date.
|
|
@@ -102,9 +102,6 @@ process.env.NODE_ENV !== "production" ? DatePickerToolbar.propTypes = {
|
|
|
102
102
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
103
103
|
// ----------------------------------------------------------------------
|
|
104
104
|
classes: _propTypes.default.object,
|
|
105
|
-
/**
|
|
106
|
-
* className applied to the root component.
|
|
107
|
-
*/
|
|
108
105
|
className: _propTypes.default.string,
|
|
109
106
|
disabled: _propTypes.default.bool,
|
|
110
107
|
/**
|
|
@@ -74,9 +74,6 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
|
|
|
74
74
|
* - the `input` element if there is a field rendered.
|
|
75
75
|
*/
|
|
76
76
|
autoFocus: _propTypes.default.bool,
|
|
77
|
-
/**
|
|
78
|
-
* Class name applied to the root element.
|
|
79
|
-
*/
|
|
80
77
|
className: _propTypes.default.string,
|
|
81
78
|
/**
|
|
82
79
|
* If `true`, the popover or modal will close after submitting the full date.
|
|
@@ -316,9 +316,6 @@ process.env.NODE_ENV !== "production" ? DateTimePickerToolbar.propTypes = {
|
|
|
316
316
|
* Override or extend the styles applied to the component.
|
|
317
317
|
*/
|
|
318
318
|
classes: _propTypes.default.object,
|
|
319
|
-
/**
|
|
320
|
-
* className applied to the root component.
|
|
321
|
-
*/
|
|
322
319
|
className: _propTypes.default.string,
|
|
323
320
|
disabled: _propTypes.default.bool,
|
|
324
321
|
/**
|
|
@@ -85,9 +85,6 @@ DesktopDatePicker.propTypes = {
|
|
|
85
85
|
* - the `input` element if there is a field rendered.
|
|
86
86
|
*/
|
|
87
87
|
autoFocus: _propTypes.default.bool,
|
|
88
|
-
/**
|
|
89
|
-
* Class name applied to the root element.
|
|
90
|
-
*/
|
|
91
88
|
className: _propTypes.default.string,
|
|
92
89
|
/**
|
|
93
90
|
* If `true`, the popover or modal will close after submitting the full date.
|
|
@@ -133,9 +133,6 @@ DesktopDateTimePicker.propTypes = {
|
|
|
133
133
|
* - the `input` element if there is a field rendered.
|
|
134
134
|
*/
|
|
135
135
|
autoFocus: _propTypes.default.bool,
|
|
136
|
-
/**
|
|
137
|
-
* Class name applied to the root element.
|
|
138
|
-
*/
|
|
139
136
|
className: _propTypes.default.string,
|
|
140
137
|
/**
|
|
141
138
|
* If `true`, the popover or modal will close after submitting the full date.
|
|
@@ -116,9 +116,6 @@ DesktopTimePicker.propTypes = {
|
|
|
116
116
|
* - the `input` element if there is a field rendered.
|
|
117
117
|
*/
|
|
118
118
|
autoFocus: _propTypes.default.bool,
|
|
119
|
-
/**
|
|
120
|
-
* Class name applied to the root element.
|
|
121
|
-
*/
|
|
122
119
|
className: _propTypes.default.string,
|
|
123
120
|
/**
|
|
124
121
|
* If `true`, the popover or modal will close after submitting the full date.
|
|
@@ -82,9 +82,6 @@ MobileDatePicker.propTypes = {
|
|
|
82
82
|
* - the `input` element if there is a field rendered.
|
|
83
83
|
*/
|
|
84
84
|
autoFocus: _propTypes.default.bool,
|
|
85
|
-
/**
|
|
86
|
-
* Class name applied to the root element.
|
|
87
|
-
*/
|
|
88
85
|
className: _propTypes.default.string,
|
|
89
86
|
/**
|
|
90
87
|
* If `true`, the popover or modal will close after submitting the full date.
|
|
@@ -102,9 +102,6 @@ MobileDateTimePicker.propTypes = {
|
|
|
102
102
|
* - the `input` element if there is a field rendered.
|
|
103
103
|
*/
|
|
104
104
|
autoFocus: _propTypes.default.bool,
|
|
105
|
-
/**
|
|
106
|
-
* Class name applied to the root element.
|
|
107
|
-
*/
|
|
108
105
|
className: _propTypes.default.string,
|
|
109
106
|
/**
|
|
110
107
|
* If `true`, the popover or modal will close after submitting the full date.
|
|
@@ -95,9 +95,6 @@ MobileTimePicker.propTypes = {
|
|
|
95
95
|
* - the `input` element if there is a field rendered.
|
|
96
96
|
*/
|
|
97
97
|
autoFocus: _propTypes.default.bool,
|
|
98
|
-
/**
|
|
99
|
-
* Class name applied to the root element.
|
|
100
|
-
*/
|
|
101
98
|
className: _propTypes.default.string,
|
|
102
99
|
/**
|
|
103
100
|
* If `true`, the popover or modal will close after submitting the full date.
|
|
@@ -249,9 +249,6 @@ process.env.NODE_ENV !== "production" ? MonthCalendar.propTypes = {
|
|
|
249
249
|
* Override or extend the styles applied to the component.
|
|
250
250
|
*/
|
|
251
251
|
classes: _propTypes.default.object,
|
|
252
|
-
/**
|
|
253
|
-
* className applied to the root element.
|
|
254
|
-
*/
|
|
255
252
|
className: _propTypes.default.string,
|
|
256
253
|
/**
|
|
257
254
|
* The default selected value.
|
|
@@ -238,9 +238,6 @@ process.env.NODE_ENV !== "production" ? PickersCalendarHeader.propTypes = {
|
|
|
238
238
|
* Override or extend the styles applied to the component.
|
|
239
239
|
*/
|
|
240
240
|
classes: _propTypes.default.object,
|
|
241
|
-
/**
|
|
242
|
-
* className applied to the root element.
|
|
243
|
-
*/
|
|
244
241
|
className: _propTypes.default.string,
|
|
245
242
|
currentMonth: _propTypes.default.any.isRequired,
|
|
246
243
|
disabled: _propTypes.default.bool,
|
|
@@ -13,6 +13,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
13
13
|
var _utils = require("@mui/base/utils");
|
|
14
14
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
15
15
|
var _useForkRef = _interopRequireDefault(require("@mui/utils/useForkRef"));
|
|
16
|
+
var _styles = require("@mui/material/styles");
|
|
16
17
|
var _pickersSectionListClasses = require("./pickersSectionListClasses");
|
|
17
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
19
|
const _excluded = ["slots", "slotProps", "elements", "sectionListRef"];
|
|
@@ -112,7 +113,11 @@ function PickersSection(props) {
|
|
|
112
113
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(SectionSeparator, (0, _extends2.default)({}, sectionSeparatorBeforeProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(SectionContent, (0, _extends2.default)({}, sectionContentProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(SectionSeparator, (0, _extends2.default)({}, sectionSeparatorAfterProps))]
|
|
113
114
|
}));
|
|
114
115
|
}
|
|
115
|
-
const PickersSectionList = exports.PickersSectionList = /*#__PURE__*/React.forwardRef(function PickersSectionList(
|
|
116
|
+
const PickersSectionList = exports.PickersSectionList = /*#__PURE__*/React.forwardRef(function PickersSectionList(inProps, ref) {
|
|
117
|
+
const props = (0, _styles.useThemeProps)({
|
|
118
|
+
props: inProps,
|
|
119
|
+
name: 'MuiPickersSectionList'
|
|
120
|
+
});
|
|
116
121
|
const {
|
|
117
122
|
slots,
|
|
118
123
|
slotProps,
|