@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.
Files changed (63) hide show
  1. package/CHANGELOG.md +101 -1
  2. package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +2 -0
  3. package/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.d.ts +3 -2
  4. package/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +2 -1
  5. package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +8 -2
  6. package/MultiSectionDigitalClock/multiSectionDigitalClockSectionClasses.js +2 -2
  7. package/index.js +1 -1
  8. package/internals/hooks/useField/useField.utils.js +23 -10
  9. package/legacy/MultiSectionDigitalClock/MultiSectionDigitalClock.js +2 -0
  10. package/legacy/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +2 -1
  11. package/legacy/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +8 -2
  12. package/legacy/MultiSectionDigitalClock/multiSectionDigitalClockSectionClasses.js +2 -2
  13. package/legacy/index.js +1 -1
  14. package/legacy/internals/hooks/useField/useField.utils.js +23 -10
  15. package/locales/beBY.d.ts +18 -5
  16. package/locales/caES.d.ts +18 -5
  17. package/locales/csCZ.d.ts +18 -5
  18. package/locales/daDK.d.ts +18 -5
  19. package/locales/deDE.d.ts +18 -5
  20. package/locales/elGR.d.ts +18 -5
  21. package/locales/enUS.d.ts +18 -5
  22. package/locales/esES.d.ts +18 -5
  23. package/locales/eu.d.ts +18 -5
  24. package/locales/faIR.d.ts +18 -5
  25. package/locales/fiFI.d.ts +18 -5
  26. package/locales/frFR.d.ts +18 -5
  27. package/locales/heIL.d.ts +18 -5
  28. package/locales/huHU.d.ts +18 -5
  29. package/locales/isIS.d.ts +18 -5
  30. package/locales/itIT.d.ts +18 -5
  31. package/locales/jaJP.d.ts +18 -5
  32. package/locales/koKR.d.ts +18 -5
  33. package/locales/kzKZ.d.ts +18 -5
  34. package/locales/mk.d.ts +18 -5
  35. package/locales/nbNO.d.ts +18 -5
  36. package/locales/nlNL.d.ts +18 -5
  37. package/locales/plPL.d.ts +18 -5
  38. package/locales/ptBR.d.ts +18 -5
  39. package/locales/roRO.d.ts +18 -5
  40. package/locales/ruRU.d.ts +18 -5
  41. package/locales/skSK.d.ts +18 -5
  42. package/locales/svSE.d.ts +18 -5
  43. package/locales/trTR.d.ts +18 -5
  44. package/locales/ukUA.d.ts +18 -5
  45. package/locales/urPK.d.ts +18 -5
  46. package/locales/utils/getPickersLocalization.d.ts +18 -5
  47. package/locales/utils/pickersLocaleTextApi.d.ts +18 -5
  48. package/locales/viVN.d.ts +18 -5
  49. package/locales/zhCN.d.ts +18 -5
  50. package/locales/zhHK.d.ts +18 -5
  51. package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.js +2 -0
  52. package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +2 -1
  53. package/modern/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +8 -2
  54. package/modern/MultiSectionDigitalClock/multiSectionDigitalClockSectionClasses.js +2 -2
  55. package/modern/index.js +1 -1
  56. package/modern/internals/hooks/useField/useField.utils.js +23 -10
  57. package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.js +2 -0
  58. package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +2 -1
  59. package/node/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +8 -2
  60. package/node/MultiSectionDigitalClock/multiSectionDigitalClockSectionClasses.js +2 -2
  61. package/node/index.js +1 -1
  62. package/node/internals/hooks/useField/useField.utils.js +23 -10
  63. 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, currentTokenValue) => {
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), currentTokenValue).length
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 currentTokenValue;
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
- '&:hover': {
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)('MuiMultiSectionDigitalClock', slot);
12
+ return (0, _generateUtilityClass.default)('MuiMultiSectionDigitalClockSection', slot);
13
13
  }
14
- const multiSectionDigitalClockSectionClasses = exports.multiSectionDigitalClockSectionClasses = (0, _generateUtilityClasses.default)('MuiMultiSectionDigitalClock', ['root', 'item']);
14
+ const multiSectionDigitalClockSectionClasses = exports.multiSectionDigitalClockSectionClasses = (0, _generateUtilityClasses.default)('MuiMultiSectionDigitalClockSection', ['root', 'item']);
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers v6.18.2
2
+ * @mui/x-date-pickers v6.18.4
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -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, currentTokenValue) => {
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), currentTokenValue).length
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 currentTokenValue;
281
+ return sectionFormat;
269
282
  }
270
283
  }
271
284
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-date-pickers",
3
- "version": "6.18.2",
3
+ "version": "6.18.4",
4
4
  "description": "The community edition of the date picker components (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",