@mui/x-date-pickers 6.18.2 → 6.18.4
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/CHANGELOG.md +101 -1
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +2 -0
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.d.ts +3 -2
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +2 -1
- package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +8 -2
- package/MultiSectionDigitalClock/multiSectionDigitalClockSectionClasses.js +2 -2
- package/index.js +1 -1
- package/internals/hooks/useField/useField.utils.js +23 -10
- package/legacy/MultiSectionDigitalClock/MultiSectionDigitalClock.js +2 -0
- package/legacy/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +2 -1
- package/legacy/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +8 -2
- package/legacy/MultiSectionDigitalClock/multiSectionDigitalClockSectionClasses.js +2 -2
- package/legacy/index.js +1 -1
- package/legacy/internals/hooks/useField/useField.utils.js +23 -10
- package/locales/beBY.d.ts +18 -5
- package/locales/caES.d.ts +18 -5
- package/locales/csCZ.d.ts +18 -5
- package/locales/daDK.d.ts +18 -5
- package/locales/deDE.d.ts +18 -5
- package/locales/elGR.d.ts +18 -5
- package/locales/enUS.d.ts +18 -5
- package/locales/esES.d.ts +18 -5
- package/locales/eu.d.ts +18 -5
- package/locales/faIR.d.ts +18 -5
- package/locales/fiFI.d.ts +18 -5
- package/locales/frFR.d.ts +18 -5
- package/locales/heIL.d.ts +18 -5
- package/locales/huHU.d.ts +18 -5
- package/locales/isIS.d.ts +18 -5
- package/locales/itIT.d.ts +18 -5
- package/locales/jaJP.d.ts +18 -5
- package/locales/koKR.d.ts +18 -5
- package/locales/kzKZ.d.ts +18 -5
- package/locales/mk.d.ts +18 -5
- package/locales/nbNO.d.ts +18 -5
- package/locales/nlNL.d.ts +18 -5
- package/locales/plPL.d.ts +18 -5
- package/locales/ptBR.d.ts +18 -5
- package/locales/roRO.d.ts +18 -5
- package/locales/ruRU.d.ts +18 -5
- package/locales/skSK.d.ts +18 -5
- package/locales/svSE.d.ts +18 -5
- package/locales/trTR.d.ts +18 -5
- package/locales/ukUA.d.ts +18 -5
- package/locales/urPK.d.ts +18 -5
- package/locales/utils/getPickersLocalization.d.ts +18 -5
- package/locales/utils/pickersLocaleTextApi.d.ts +18 -5
- package/locales/viVN.d.ts +18 -5
- package/locales/zhCN.d.ts +18 -5
- package/locales/zhHK.d.ts +18 -5
- package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.js +2 -0
- package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +2 -1
- package/modern/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +8 -2
- package/modern/MultiSectionDigitalClock/multiSectionDigitalClockSectionClasses.js +2 -2
- package/modern/index.js +1 -1
- package/modern/internals/hooks/useField/useField.utils.js +23 -10
- package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.js +2 -0
- package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +2 -1
- package/node/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +8 -2
- package/node/MultiSectionDigitalClock/multiSectionDigitalClockSectionClasses.js +2 -2
- package/node/index.js +1 -1
- package/node/internals/hooks/useField/useField.utils.js +23 -10
- package/package.json +1 -1
|
@@ -207,49 +207,62 @@ export const addPositionPropertiesToSections = (sections, isRTL) => {
|
|
|
207
207
|
}
|
|
208
208
|
return newSections;
|
|
209
209
|
};
|
|
210
|
-
const getSectionPlaceholder = (utils, timezone, localeText, sectionConfig,
|
|
210
|
+
const getSectionPlaceholder = (utils, timezone, localeText, sectionConfig, sectionFormat) => {
|
|
211
211
|
switch (sectionConfig.type) {
|
|
212
212
|
case 'year':
|
|
213
213
|
{
|
|
214
214
|
return localeText.fieldYearPlaceholder({
|
|
215
|
-
digitAmount: utils.formatByString(utils.dateWithTimezone(undefined, timezone),
|
|
215
|
+
digitAmount: utils.formatByString(utils.dateWithTimezone(undefined, timezone), sectionFormat).length,
|
|
216
|
+
format: sectionFormat
|
|
216
217
|
});
|
|
217
218
|
}
|
|
218
219
|
case 'month':
|
|
219
220
|
{
|
|
220
221
|
return localeText.fieldMonthPlaceholder({
|
|
221
|
-
contentType: sectionConfig.contentType
|
|
222
|
+
contentType: sectionConfig.contentType,
|
|
223
|
+
format: sectionFormat
|
|
222
224
|
});
|
|
223
225
|
}
|
|
224
226
|
case 'day':
|
|
225
227
|
{
|
|
226
|
-
return localeText.fieldDayPlaceholder(
|
|
228
|
+
return localeText.fieldDayPlaceholder({
|
|
229
|
+
format: sectionFormat
|
|
230
|
+
});
|
|
227
231
|
}
|
|
228
232
|
case 'weekDay':
|
|
229
233
|
{
|
|
230
234
|
return localeText.fieldWeekDayPlaceholder({
|
|
231
|
-
contentType: sectionConfig.contentType
|
|
235
|
+
contentType: sectionConfig.contentType,
|
|
236
|
+
format: sectionFormat
|
|
232
237
|
});
|
|
233
238
|
}
|
|
234
239
|
case 'hours':
|
|
235
240
|
{
|
|
236
|
-
return localeText.fieldHoursPlaceholder(
|
|
241
|
+
return localeText.fieldHoursPlaceholder({
|
|
242
|
+
format: sectionFormat
|
|
243
|
+
});
|
|
237
244
|
}
|
|
238
245
|
case 'minutes':
|
|
239
246
|
{
|
|
240
|
-
return localeText.fieldMinutesPlaceholder(
|
|
247
|
+
return localeText.fieldMinutesPlaceholder({
|
|
248
|
+
format: sectionFormat
|
|
249
|
+
});
|
|
241
250
|
}
|
|
242
251
|
case 'seconds':
|
|
243
252
|
{
|
|
244
|
-
return localeText.fieldSecondsPlaceholder(
|
|
253
|
+
return localeText.fieldSecondsPlaceholder({
|
|
254
|
+
format: sectionFormat
|
|
255
|
+
});
|
|
245
256
|
}
|
|
246
257
|
case 'meridiem':
|
|
247
258
|
{
|
|
248
|
-
return localeText.fieldMeridiemPlaceholder(
|
|
259
|
+
return localeText.fieldMeridiemPlaceholder({
|
|
260
|
+
format: sectionFormat
|
|
261
|
+
});
|
|
249
262
|
}
|
|
250
263
|
default:
|
|
251
264
|
{
|
|
252
|
-
return
|
|
265
|
+
return sectionFormat;
|
|
253
266
|
}
|
|
254
267
|
}
|
|
255
268
|
};
|
|
@@ -263,6 +263,7 @@ const MultiSectionDigitalClock = exports.MultiSectionDigitalClock = /*#__PURE__*
|
|
|
263
263
|
},
|
|
264
264
|
items: (0, _MultiSectionDigitalClock.getTimeSectionOptions)({
|
|
265
265
|
value: utils.getMinutes(valueOrReferenceDate),
|
|
266
|
+
utils,
|
|
266
267
|
isDisabled: minutes => disabled || isTimeDisabled(minutes, 'minutes'),
|
|
267
268
|
resolveLabel: minutes => utils.format(utils.setMinutes(now, minutes), 'minutes'),
|
|
268
269
|
timeStep: timeSteps.minutes,
|
|
@@ -279,6 +280,7 @@ const MultiSectionDigitalClock = exports.MultiSectionDigitalClock = /*#__PURE__*
|
|
|
279
280
|
},
|
|
280
281
|
items: (0, _MultiSectionDigitalClock.getTimeSectionOptions)({
|
|
281
282
|
value: utils.getSeconds(valueOrReferenceDate),
|
|
283
|
+
utils,
|
|
282
284
|
isDisabled: seconds => disabled || isTimeDisabled(seconds, 'seconds'),
|
|
283
285
|
resolveLabel: seconds => utils.format(utils.setSeconds(now, seconds), 'seconds'),
|
|
284
286
|
timeStep: timeSteps.seconds,
|
|
@@ -45,6 +45,7 @@ const getHourSectionOptions = ({
|
|
|
45
45
|
exports.getHourSectionOptions = getHourSectionOptions;
|
|
46
46
|
const getTimeSectionOptions = ({
|
|
47
47
|
value,
|
|
48
|
+
utils,
|
|
48
49
|
isDisabled,
|
|
49
50
|
timeStep,
|
|
50
51
|
resolveLabel,
|
|
@@ -63,7 +64,7 @@ const getTimeSectionOptions = ({
|
|
|
63
64
|
const timeValue = timeStep * index;
|
|
64
65
|
return {
|
|
65
66
|
value: timeValue,
|
|
66
|
-
label: resolveLabel(timeValue),
|
|
67
|
+
label: utils.formatNumber(resolveLabel(timeValue)),
|
|
67
68
|
isDisabled,
|
|
68
69
|
isSelected,
|
|
69
70
|
ariaLabel: resolveAriaLabel(timeValue.toString())
|
|
@@ -45,7 +45,12 @@ const MultiSectionDigitalClockSectionRoot = (0, _styles.styled)(_MenuList.defaul
|
|
|
45
45
|
'@media (prefers-reduced-motion: no-preference)': {
|
|
46
46
|
scrollBehavior: ownerState.alreadyRendered ? 'smooth' : 'auto'
|
|
47
47
|
},
|
|
48
|
-
'
|
|
48
|
+
'@media (pointer: fine)': {
|
|
49
|
+
'&:hover': {
|
|
50
|
+
overflowY: 'auto'
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
'@media (pointer: none), (pointer: coarse)': {
|
|
49
54
|
overflowY: 'auto'
|
|
50
55
|
},
|
|
51
56
|
'&:not(:first-of-type)': {
|
|
@@ -158,7 +163,8 @@ const MultiSectionDigitalClockSection = exports.MultiSectionDigitalClockSection
|
|
|
158
163
|
,
|
|
159
164
|
"aria-disabled": readOnly,
|
|
160
165
|
"aria-label": option.ariaLabel,
|
|
161
|
-
"aria-selected": isSelected
|
|
166
|
+
"aria-selected": isSelected,
|
|
167
|
+
className: classes.item
|
|
162
168
|
}, slotProps?.digitalClockSectionItem, {
|
|
163
169
|
children: option.label
|
|
164
170
|
}), option.label);
|
|
@@ -9,6 +9,6 @@ exports.multiSectionDigitalClockSectionClasses = void 0;
|
|
|
9
9
|
var _generateUtilityClass = _interopRequireDefault(require("@mui/utils/generateUtilityClass"));
|
|
10
10
|
var _generateUtilityClasses = _interopRequireDefault(require("@mui/utils/generateUtilityClasses"));
|
|
11
11
|
function getMultiSectionDigitalClockSectionUtilityClass(slot) {
|
|
12
|
-
return (0, _generateUtilityClass.default)('
|
|
12
|
+
return (0, _generateUtilityClass.default)('MuiMultiSectionDigitalClockSection', slot);
|
|
13
13
|
}
|
|
14
|
-
const multiSectionDigitalClockSectionClasses = exports.multiSectionDigitalClockSectionClasses = (0, _generateUtilityClasses.default)('
|
|
14
|
+
const multiSectionDigitalClockSectionClasses = exports.multiSectionDigitalClockSectionClasses = (0, _generateUtilityClasses.default)('MuiMultiSectionDigitalClockSection', ['root', 'item']);
|
package/node/index.js
CHANGED
|
@@ -223,49 +223,62 @@ const addPositionPropertiesToSections = (sections, isRTL) => {
|
|
|
223
223
|
return newSections;
|
|
224
224
|
};
|
|
225
225
|
exports.addPositionPropertiesToSections = addPositionPropertiesToSections;
|
|
226
|
-
const getSectionPlaceholder = (utils, timezone, localeText, sectionConfig,
|
|
226
|
+
const getSectionPlaceholder = (utils, timezone, localeText, sectionConfig, sectionFormat) => {
|
|
227
227
|
switch (sectionConfig.type) {
|
|
228
228
|
case 'year':
|
|
229
229
|
{
|
|
230
230
|
return localeText.fieldYearPlaceholder({
|
|
231
|
-
digitAmount: utils.formatByString(utils.dateWithTimezone(undefined, timezone),
|
|
231
|
+
digitAmount: utils.formatByString(utils.dateWithTimezone(undefined, timezone), sectionFormat).length,
|
|
232
|
+
format: sectionFormat
|
|
232
233
|
});
|
|
233
234
|
}
|
|
234
235
|
case 'month':
|
|
235
236
|
{
|
|
236
237
|
return localeText.fieldMonthPlaceholder({
|
|
237
|
-
contentType: sectionConfig.contentType
|
|
238
|
+
contentType: sectionConfig.contentType,
|
|
239
|
+
format: sectionFormat
|
|
238
240
|
});
|
|
239
241
|
}
|
|
240
242
|
case 'day':
|
|
241
243
|
{
|
|
242
|
-
return localeText.fieldDayPlaceholder(
|
|
244
|
+
return localeText.fieldDayPlaceholder({
|
|
245
|
+
format: sectionFormat
|
|
246
|
+
});
|
|
243
247
|
}
|
|
244
248
|
case 'weekDay':
|
|
245
249
|
{
|
|
246
250
|
return localeText.fieldWeekDayPlaceholder({
|
|
247
|
-
contentType: sectionConfig.contentType
|
|
251
|
+
contentType: sectionConfig.contentType,
|
|
252
|
+
format: sectionFormat
|
|
248
253
|
});
|
|
249
254
|
}
|
|
250
255
|
case 'hours':
|
|
251
256
|
{
|
|
252
|
-
return localeText.fieldHoursPlaceholder(
|
|
257
|
+
return localeText.fieldHoursPlaceholder({
|
|
258
|
+
format: sectionFormat
|
|
259
|
+
});
|
|
253
260
|
}
|
|
254
261
|
case 'minutes':
|
|
255
262
|
{
|
|
256
|
-
return localeText.fieldMinutesPlaceholder(
|
|
263
|
+
return localeText.fieldMinutesPlaceholder({
|
|
264
|
+
format: sectionFormat
|
|
265
|
+
});
|
|
257
266
|
}
|
|
258
267
|
case 'seconds':
|
|
259
268
|
{
|
|
260
|
-
return localeText.fieldSecondsPlaceholder(
|
|
269
|
+
return localeText.fieldSecondsPlaceholder({
|
|
270
|
+
format: sectionFormat
|
|
271
|
+
});
|
|
261
272
|
}
|
|
262
273
|
case 'meridiem':
|
|
263
274
|
{
|
|
264
|
-
return localeText.fieldMeridiemPlaceholder(
|
|
275
|
+
return localeText.fieldMeridiemPlaceholder({
|
|
276
|
+
format: sectionFormat
|
|
277
|
+
});
|
|
265
278
|
}
|
|
266
279
|
default:
|
|
267
280
|
{
|
|
268
|
-
return
|
|
281
|
+
return sectionFormat;
|
|
269
282
|
}
|
|
270
283
|
}
|
|
271
284
|
};
|