@mui/x-date-pickers 7.1.0 → 7.1.1

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 (84) hide show
  1. package/CHANGELOG.md +175 -4
  2. package/DateCalendar/DateCalendar.js +1 -1
  3. package/DateCalendar/DayCalendar.d.ts +1 -1
  4. package/DateField/DateField.js +1 -1
  5. package/DatePicker/DatePicker.js +1 -1
  6. package/DateTimeField/DateTimeField.js +2 -2
  7. package/DateTimeField/DateTimeField.types.d.ts +1 -1
  8. package/DateTimePicker/DateTimePicker.js +2 -2
  9. package/DesktopDatePicker/DesktopDatePicker.js +1 -1
  10. package/DesktopDateTimePicker/DesktopDateTimePicker.js +2 -2
  11. package/DesktopTimePicker/DesktopTimePicker.js +1 -1
  12. package/DigitalClock/DigitalClock.js +1 -1
  13. package/MobileDatePicker/MobileDatePicker.js +1 -1
  14. package/MobileDateTimePicker/MobileDateTimePicker.js +2 -2
  15. package/MobileTimePicker/MobileTimePicker.js +1 -1
  16. package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +1 -1
  17. package/PickersShortcuts/PickersShortcuts.d.ts +1 -1
  18. package/PickersShortcuts/PickersShortcuts.js +1 -1
  19. package/README.md +1 -1
  20. package/StaticDatePicker/StaticDatePicker.js +1 -1
  21. package/StaticDateTimePicker/StaticDateTimePicker.js +2 -2
  22. package/StaticTimePicker/StaticTimePicker.js +1 -1
  23. package/TimeClock/TimeClock.js +1 -1
  24. package/TimeField/TimeField.js +2 -2
  25. package/TimeField/TimeField.types.d.ts +1 -1
  26. package/TimePicker/TimePicker.js +1 -1
  27. package/index.js +1 -1
  28. package/internals/hooks/useField/useField.types.d.ts +1 -1
  29. package/internals/hooks/useField/useFieldV6TextField.js +3 -1
  30. package/internals/models/props/clock.d.ts +1 -1
  31. package/locales/faIR.js +7 -8
  32. package/locales/ptBR.js +14 -17
  33. package/locales/ukUA.js +15 -19
  34. package/modern/DateCalendar/DateCalendar.js +1 -1
  35. package/modern/DateField/DateField.js +1 -1
  36. package/modern/DatePicker/DatePicker.js +1 -1
  37. package/modern/DateTimeField/DateTimeField.js +2 -2
  38. package/modern/DateTimePicker/DateTimePicker.js +2 -2
  39. package/modern/DesktopDatePicker/DesktopDatePicker.js +1 -1
  40. package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +2 -2
  41. package/modern/DesktopTimePicker/DesktopTimePicker.js +1 -1
  42. package/modern/DigitalClock/DigitalClock.js +1 -1
  43. package/modern/MobileDatePicker/MobileDatePicker.js +1 -1
  44. package/modern/MobileDateTimePicker/MobileDateTimePicker.js +2 -2
  45. package/modern/MobileTimePicker/MobileTimePicker.js +1 -1
  46. package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.js +1 -1
  47. package/modern/PickersShortcuts/PickersShortcuts.js +1 -1
  48. package/modern/StaticDatePicker/StaticDatePicker.js +1 -1
  49. package/modern/StaticDateTimePicker/StaticDateTimePicker.js +2 -2
  50. package/modern/StaticTimePicker/StaticTimePicker.js +1 -1
  51. package/modern/TimeClock/TimeClock.js +1 -1
  52. package/modern/TimeField/TimeField.js +2 -2
  53. package/modern/TimePicker/TimePicker.js +1 -1
  54. package/modern/index.js +1 -1
  55. package/modern/internals/hooks/useField/useFieldV6TextField.js +3 -1
  56. package/modern/locales/faIR.js +7 -8
  57. package/modern/locales/ptBR.js +14 -17
  58. package/modern/locales/ukUA.js +15 -19
  59. package/node/DateCalendar/DateCalendar.js +1 -1
  60. package/node/DateField/DateField.js +1 -1
  61. package/node/DatePicker/DatePicker.js +1 -1
  62. package/node/DateTimeField/DateTimeField.js +2 -2
  63. package/node/DateTimePicker/DateTimePicker.js +2 -2
  64. package/node/DesktopDatePicker/DesktopDatePicker.js +1 -1
  65. package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +2 -2
  66. package/node/DesktopTimePicker/DesktopTimePicker.js +1 -1
  67. package/node/DigitalClock/DigitalClock.js +1 -1
  68. package/node/MobileDatePicker/MobileDatePicker.js +1 -1
  69. package/node/MobileDateTimePicker/MobileDateTimePicker.js +2 -2
  70. package/node/MobileTimePicker/MobileTimePicker.js +1 -1
  71. package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.js +1 -1
  72. package/node/PickersShortcuts/PickersShortcuts.js +1 -1
  73. package/node/StaticDatePicker/StaticDatePicker.js +1 -1
  74. package/node/StaticDateTimePicker/StaticDateTimePicker.js +2 -2
  75. package/node/StaticTimePicker/StaticTimePicker.js +1 -1
  76. package/node/TimeClock/TimeClock.js +1 -1
  77. package/node/TimeField/TimeField.js +2 -2
  78. package/node/TimePicker/TimePicker.js +1 -1
  79. package/node/index.js +1 -1
  80. package/node/internals/hooks/useField/useFieldV6TextField.js +3 -1
  81. package/node/locales/faIR.js +7 -8
  82. package/node/locales/ptBR.js +14 -17
  83. package/node/locales/ukUA.js +15 -19
  84. package/package.json +2 -2
@@ -100,7 +100,7 @@ process.env.NODE_ENV !== "production" ? PickersShortcuts.propTypes = {
100
100
  /**
101
101
  * Ordered array of shortcuts to display.
102
102
  * If empty, does not display the shortcuts.
103
- * @default `[]`
103
+ * @default []
104
104
  */
105
105
  items: _propTypes.default.arrayOf(_propTypes.default.shape({
106
106
  getValue: _propTypes.default.func.isRequired,
@@ -73,7 +73,7 @@ StaticDatePicker.propTypes = {
73
73
  * Formats the day of week displayed in the calendar header.
74
74
  * @param {TDate} date The date of the day of week provided by the adapter.
75
75
  * @returns {string} The name to display.
76
- * @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
76
+ * @default (date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
77
77
  */
78
78
  dayOfWeekFormatter: _propTypes.default.func,
79
79
  /**
@@ -73,7 +73,7 @@ StaticDateTimePicker.propTypes = {
73
73
  // ----------------------------------------------------------------------
74
74
  /**
75
75
  * 12h/24h view for hour selection clock.
76
- * @default `utils.is12HourCycleInCurrentLocale()`
76
+ * @default utils.is12HourCycleInCurrentLocale()
77
77
  */
78
78
  ampm: _propTypes.default.bool,
79
79
  /**
@@ -93,7 +93,7 @@ StaticDateTimePicker.propTypes = {
93
93
  * Formats the day of week displayed in the calendar header.
94
94
  * @param {TDate} date The date of the day of week provided by the adapter.
95
95
  * @returns {string} The name to display.
96
- * @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
96
+ * @default (date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
97
97
  */
98
98
  dayOfWeekFormatter: _propTypes.default.func,
99
99
  /**
@@ -65,7 +65,7 @@ StaticTimePicker.propTypes = {
65
65
  // ----------------------------------------------------------------------
66
66
  /**
67
67
  * 12h/24h view for hour selection clock.
68
- * @default `utils.is12HourCycleInCurrentLocale()`
68
+ * @default utils.is12HourCycleInCurrentLocale()
69
69
  */
70
70
  ampm: _propTypes.default.bool,
71
71
  /**
@@ -325,7 +325,7 @@ process.env.NODE_ENV !== "production" ? TimeClock.propTypes = {
325
325
  // ----------------------------------------------------------------------
326
326
  /**
327
327
  * 12h/24h view for hour selection clock.
328
- * @default `utils.is12HourCycleInCurrentLocale()`
328
+ * @default utils.is12HourCycleInCurrentLocale()
329
329
  */
330
330
  ampm: _propTypes.default.bool,
331
331
  /**
@@ -73,7 +73,7 @@ process.env.NODE_ENV !== "production" ? TimeField.propTypes = {
73
73
  // ----------------------------------------------------------------------
74
74
  /**
75
75
  * 12h/24h view for hour selection clock.
76
- * @default `utils.is12HourCycleInCurrentLocale()`
76
+ * @default utils.is12HourCycleInCurrentLocale()
77
77
  */
78
78
  ampm: _propTypes.default.bool,
79
79
  /**
@@ -284,7 +284,7 @@ process.env.NODE_ENV !== "production" ? TimeField.propTypes = {
284
284
  * Warning n°3: When used in strict mode, dayjs and moment require to respect the leading zeros.
285
285
  * This mean that when using `shouldRespectLeadingZeros={false}`, if you retrieve the value directly from the input (not listening to `onChange`) and your format contains tokens without leading zeros, the value will not be parsed by your library.
286
286
  *
287
- * @default `false`
287
+ * @default false
288
288
  */
289
289
  shouldRespectLeadingZeros: _propTypes.default.bool,
290
290
  /**
@@ -59,7 +59,7 @@ process.env.NODE_ENV !== "production" ? TimePicker.propTypes = {
59
59
  // ----------------------------------------------------------------------
60
60
  /**
61
61
  * 12h/24h view for hour selection clock.
62
- * @default `utils.is12HourCycleInCurrentLocale()`
62
+ * @default utils.is12HourCycleInCurrentLocale()
63
63
  */
64
64
  ampm: _propTypes.default.bool,
65
65
  /**
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers v7.1.0
2
+ * @mui/x-date-pickers v7.1.1
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -122,7 +122,8 @@ const useFieldV6TextField = params => {
122
122
  getActiveSectionIndexFromDOM: () => {
123
123
  const browserStartIndex = inputRef.current.selectionStart ?? 0;
124
124
  const browserEndIndex = inputRef.current.selectionEnd ?? 0;
125
- if (browserStartIndex === 0 && browserEndIndex === 0) {
125
+ const isInputReadOnly = !!inputRef.current?.readOnly;
126
+ if (browserStartIndex === 0 && browserEndIndex === 0 || isInputReadOnly) {
126
127
  return null;
127
128
  }
128
129
  const nextSectionIndex = browserStartIndex <= sections[0].startInInput ? 1 // Special case if browser index is in invisible characters at the beginning.
@@ -138,6 +139,7 @@ const useFieldV6TextField = params => {
138
139
  }), [inputRef, parsedSelectedSections, sections, setSelectedSections]);
139
140
  const syncSelectionFromDOM = () => {
140
141
  if (readOnly) {
142
+ setSelectedSections(null);
141
143
  return;
142
144
  }
143
145
  const browserStartIndex = inputRef.current.selectionStart ?? 0;
@@ -65,16 +65,15 @@ const faIRPickers = {
65
65
  fieldHoursPlaceholder: () => 'hh',
66
66
  fieldMinutesPlaceholder: () => 'mm',
67
67
  fieldSecondsPlaceholder: () => 'ss',
68
- fieldMeridiemPlaceholder: () => 'aa'
69
-
68
+ fieldMeridiemPlaceholder: () => 'aa',
70
69
  // View names
71
- // year: 'Year',
72
- // month: 'Month',
73
- // day: 'Day',
70
+ year: 'سال',
71
+ month: 'ماه',
72
+ day: 'روز',
74
73
  // weekDay: 'Week day',
75
- // hours: 'Hours',
76
- // minutes: 'Minutes',
77
- // seconds: 'Seconds',
74
+ hours: 'ساعت ها',
75
+ minutes: 'دقیقه ها',
76
+ seconds: 'ثانیه ها'
78
77
  // meridiem: 'Meridiem',
79
78
 
80
79
  // Common
@@ -22,11 +22,10 @@ const ptBRPickers = {
22
22
  // DateRange labels
23
23
  start: 'Início',
24
24
  end: 'Fim',
25
- // startDate: 'Start date',
26
- // startTime: 'Start time',
27
- // endDate: 'End date',
28
- // endTime: 'End time',
29
-
25
+ startDate: 'Data de início',
26
+ startTime: 'Hora de início',
27
+ endDate: 'Data de Término',
28
+ endTime: 'Hora de Término',
30
29
  // Action bar
31
30
  cancelButtonLabel: 'Cancelar',
32
31
  clearButtonLabel: 'Limpar',
@@ -65,19 +64,17 @@ const ptBRPickers = {
65
64
  fieldHoursPlaceholder: () => 'hh',
66
65
  fieldMinutesPlaceholder: () => 'mm',
67
66
  fieldSecondsPlaceholder: () => 'ss',
68
- fieldMeridiemPlaceholder: () => 'aa'
69
-
67
+ fieldMeridiemPlaceholder: () => 'aa',
70
68
  // View names
71
- // year: 'Year',
72
- // month: 'Month',
73
- // day: 'Day',
74
- // weekDay: 'Week day',
75
- // hours: 'Hours',
76
- // minutes: 'Minutes',
77
- // seconds: 'Seconds',
78
- // meridiem: 'Meridiem',
79
-
69
+ year: 'Ano',
70
+ month: 'Mês',
71
+ day: 'Dia',
72
+ weekDay: 'Dia da Semana',
73
+ hours: 'Horas',
74
+ minutes: 'Minutos',
75
+ seconds: 'Segundos',
76
+ meridiem: 'Meio dia',
80
77
  // Common
81
- // empty: 'Empty',
78
+ empty: 'Vazio'
82
79
  };
83
80
  const ptBR = exports.ptBR = (0, _getPickersLocalization.getPickersLocalization)(ptBRPickers);
@@ -22,11 +22,10 @@ const ukUAPickers = {
22
22
  // DateRange labels
23
23
  start: 'Початок',
24
24
  end: 'Кінець',
25
- // startDate: 'Start date',
26
- // startTime: 'Start time',
27
- // endDate: 'End date',
28
- // endTime: 'End time',
29
-
25
+ startDate: 'День початку',
26
+ startTime: 'Час початку',
27
+ endDate: 'День закінчення',
28
+ endTime: 'Час закінчення',
30
29
  // Action bar
31
30
  cancelButtonLabel: 'Відміна',
32
31
  clearButtonLabel: 'Очистити',
@@ -52,8 +51,7 @@ const ukUAPickers = {
52
51
  // Open picker labels
53
52
  openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Оберіть дату, обрана дата ${utils.format(value, 'fullDate')}` : 'Оберіть дату',
54
53
  openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Оберіть час, обраний час ${utils.format(value, 'fullTime')}` : 'Оберіть час',
55
- // fieldClearLabel: 'Clear value',
56
-
54
+ fieldClearLabel: 'Очистити дані',
57
55
  // Table labels
58
56
  timeTableLabel: 'оберіть час',
59
57
  dateTableLabel: 'оберіть дату',
@@ -65,19 +63,17 @@ const ukUAPickers = {
65
63
  fieldHoursPlaceholder: () => 'hh',
66
64
  fieldMinutesPlaceholder: () => 'mm',
67
65
  fieldSecondsPlaceholder: () => 'ss',
68
- fieldMeridiemPlaceholder: () => 'aa'
69
-
66
+ fieldMeridiemPlaceholder: () => 'aa',
70
67
  // View names
71
- // year: 'Year',
72
- // month: 'Month',
73
- // day: 'Day',
74
- // weekDay: 'Week day',
75
- // hours: 'Hours',
76
- // minutes: 'Minutes',
77
- // seconds: 'Seconds',
78
- // meridiem: 'Meridiem',
79
-
68
+ year: 'Рік',
69
+ month: 'Місяць',
70
+ day: 'День',
71
+ weekDay: 'День тижня',
72
+ hours: 'Годин',
73
+ minutes: 'Хвилин',
74
+ seconds: 'Секунд',
75
+ meridiem: 'Меридіем',
80
76
  // Common
81
- // empty: 'Empty',
77
+ empty: 'Порожній'
82
78
  };
83
79
  const ukUA = exports.ukUA = (0, _getPickersLocalization.getPickersLocalization)(ukUAPickers);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mui/x-date-pickers",
3
- "version": "7.1.0",
4
- "description": "The community edition of the date picker components (MUI X).",
3
+ "version": "7.1.1",
4
+ "description": "The community edition of the Date and Time Picker components (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",
7
7
  "license": "MIT",