@mui/x-date-pickers 6.18.4 → 6.18.6

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 (61) hide show
  1. package/CHANGELOG.md +91 -0
  2. package/DatePicker/DatePicker.js +4 -0
  3. package/DateTimePicker/DateTimePicker.js +4 -0
  4. package/DesktopDatePicker/DesktopDatePicker.js +4 -0
  5. package/DesktopDateTimePicker/DesktopDateTimePicker.js +4 -0
  6. package/DesktopTimePicker/DesktopTimePicker.js +4 -0
  7. package/MobileDatePicker/MobileDatePicker.js +4 -0
  8. package/MobileDateTimePicker/MobileDateTimePicker.js +4 -0
  9. package/MobileTimePicker/MobileTimePicker.js +4 -0
  10. package/TimePicker/TimePicker.js +4 -0
  11. package/index.js +1 -1
  12. package/internals/hooks/useDesktopPicker/useDesktopPicker.js +2 -0
  13. package/internals/hooks/useField/useField.js +8 -1
  14. package/internals/hooks/useField/useField.types.d.ts +1 -1
  15. package/internals/hooks/useMobilePicker/useMobilePicker.js +3 -1
  16. package/internals/models/props/basePickerProps.d.ts +4 -0
  17. package/legacy/DatePicker/DatePicker.js +4 -0
  18. package/legacy/DateTimePicker/DateTimePicker.js +4 -0
  19. package/legacy/DesktopDatePicker/DesktopDatePicker.js +4 -0
  20. package/legacy/DesktopDateTimePicker/DesktopDateTimePicker.js +4 -0
  21. package/legacy/DesktopTimePicker/DesktopTimePicker.js +4 -0
  22. package/legacy/MobileDatePicker/MobileDatePicker.js +4 -0
  23. package/legacy/MobileDateTimePicker/MobileDateTimePicker.js +4 -0
  24. package/legacy/MobileTimePicker/MobileTimePicker.js +4 -0
  25. package/legacy/TimePicker/TimePicker.js +4 -0
  26. package/legacy/index.js +1 -1
  27. package/legacy/internals/hooks/useDesktopPicker/useDesktopPicker.js +2 -0
  28. package/legacy/internals/hooks/useField/useField.js +8 -1
  29. package/legacy/internals/hooks/useMobilePicker/useMobilePicker.js +3 -1
  30. package/legacy/locales/ruRU.js +1 -2
  31. package/locales/ruRU.js +1 -2
  32. package/models/fields.d.ts +1 -0
  33. package/modern/DatePicker/DatePicker.js +4 -0
  34. package/modern/DateTimePicker/DateTimePicker.js +4 -0
  35. package/modern/DesktopDatePicker/DesktopDatePicker.js +4 -0
  36. package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +4 -0
  37. package/modern/DesktopTimePicker/DesktopTimePicker.js +4 -0
  38. package/modern/MobileDatePicker/MobileDatePicker.js +4 -0
  39. package/modern/MobileDateTimePicker/MobileDateTimePicker.js +4 -0
  40. package/modern/MobileTimePicker/MobileTimePicker.js +4 -0
  41. package/modern/TimePicker/TimePicker.js +4 -0
  42. package/modern/index.js +1 -1
  43. package/modern/internals/hooks/useDesktopPicker/useDesktopPicker.js +2 -0
  44. package/modern/internals/hooks/useField/useField.js +8 -1
  45. package/modern/internals/hooks/useMobilePicker/useMobilePicker.js +3 -1
  46. package/modern/locales/ruRU.js +1 -2
  47. package/node/DatePicker/DatePicker.js +4 -0
  48. package/node/DateTimePicker/DateTimePicker.js +4 -0
  49. package/node/DesktopDatePicker/DesktopDatePicker.js +4 -0
  50. package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +4 -0
  51. package/node/DesktopTimePicker/DesktopTimePicker.js +4 -0
  52. package/node/MobileDatePicker/MobileDatePicker.js +4 -0
  53. package/node/MobileDateTimePicker/MobileDateTimePicker.js +4 -0
  54. package/node/MobileTimePicker/MobileTimePicker.js +4 -0
  55. package/node/TimePicker/TimePicker.js +4 -0
  56. package/node/index.js +1 -1
  57. package/node/internals/hooks/useDesktopPicker/useDesktopPicker.js +2 -0
  58. package/node/internals/hooks/useField/useField.js +8 -1
  59. package/node/internals/hooks/useMobilePicker/useMobilePicker.js +3 -1
  60. package/node/locales/ruRU.js +1 -2
  61. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,97 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 6.18.6
7
+
8
+ _Dec 22, 2023_
9
+
10
+ We'd like to offer a big thanks to the 5 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 🌍 Improve Russian (ru-RU) locale (#11429) @wensiet
13
+ - 🐞 Bugfixes
14
+
15
+ ### Data Grid
16
+
17
+ #### `@mui/x-data-grid@6.18.6`
18
+
19
+ - [DataGrid] Fix typos in the JSDoc (#11475) @flaviendelangle
20
+ - [l10n] Improve Russian (ru-RU) locale (#11429) @wensiet
21
+
22
+ #### `@mui/x-data-grid-pro@6.18.6` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
23
+
24
+ Same changes as in `@mui/x-data-grid@6.18.6`.
25
+
26
+ #### `@mui/x-data-grid-premium@6.18.6` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
27
+
28
+ Same changes as in `@mui/x-data-grid-pro@6.18.6`.
29
+
30
+ ### Date Pickers
31
+
32
+ #### `@mui/x-date-pickers@6.18.6`
33
+
34
+ - [fields] Fix section pasting (#11467) @LukasTy
35
+
36
+ #### `@mui/x-date-pickers-pro@6.18.6` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
37
+
38
+ Same changes as in `@mui/x-date-pickers@6.18.6`.
39
+
40
+ ### Charts / `@mui/x-charts@6.18.6`
41
+
42
+ - [charts] Allow percentage values for pie chart center and radius (#11464) @alexfauquette
43
+ - [charts] Make error message more explicit (#11457) @alexfauquette
44
+ - [charts] Make the helper `ChartsText` component public (#11370) @alexfauquette
45
+ - [charts] Improve dataset typing (#11372) @alexfauquette
46
+ - [charts] Fix size overflow (#11385) @alexfauquette
47
+
48
+ ### Docs
49
+
50
+ - [docs] Document false default values for boolean props (#11489) @cherniavskii
51
+ - [docs] Improve Pickers `name` prop examples (#11442) @LukasTy
52
+ - [docs] Limit `date-fns` package to v2 in codesandbox (#11478) @LukasTy
53
+ - [test] Reload the page if its blank and there are no links to the remaining tests (#11471) @cherniavskii
54
+
55
+ ## 6.18.5
56
+
57
+ _Dec 14, 2023_
58
+
59
+ We'd like to offer a big thanks to the 7 contributors who made this release possible. Here are some highlights ✨:
60
+
61
+ - 🌍 Improve Swedish (sv-SE) and Urdu (ur-PK) locales on the Data Grid
62
+ - 🐞 Bugfixes
63
+
64
+ ### Data Grid
65
+
66
+ #### `@mui/x-data-grid@6.18.5`
67
+
68
+ - [l10n] Improve Swedish (sv-SE) locale (#11379) @fredrikcarlbom
69
+ - [l10n] Improve Urdu (ur-PK) locale for data grid (#11409) @MBilalShafi
70
+
71
+ #### `@mui/x-data-grid-pro@6.18.5` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
72
+
73
+ Same changes as in `@mui/x-data-grid@6.18.5`.
74
+
75
+ #### `@mui/x-data-grid-premium@6.18.5` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
76
+
77
+ Same changes as in `@mui/x-data-grid-pro@6.18.5`.
78
+
79
+ ### Date Pickers
80
+
81
+ #### `@mui/x-date-pickers@6.18.5`
82
+
83
+ - [pickers] Fix field types to avoid error on latest `@types/react` version (#11398) @LukasTy
84
+ - [pickers] Support name prop (#11380) @gitstart
85
+
86
+ #### `@mui/x-date-pickers-pro@6.18.5` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
87
+
88
+ Same changes as in `@mui/x-date-pickers@6.18.5`, plus:
89
+
90
+ - [DateRangePicker] Fix `autoFocus` behavior (#11376) @kealjones-wk
91
+
92
+ ### Docs
93
+
94
+ - [docs] Respect GoT books (#11294) @janoma
95
+ - [test] Fix flaky screenshots (#11391) @cherniavskii
96
+
6
97
  ## 6.18.4
7
98
 
8
99
  _Dec 8, 2023_
@@ -178,6 +178,10 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
178
178
  * @default 3
179
179
  */
180
180
  monthsPerRow: PropTypes.oneOf([3, 4]),
181
+ /**
182
+ * Name attribute used by the `input` element in the Field.
183
+ */
184
+ name: PropTypes.string,
181
185
  /**
182
186
  * Callback fired when the value is accepted.
183
187
  * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
@@ -216,6 +216,10 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
216
216
  * @default 3
217
217
  */
218
218
  monthsPerRow: PropTypes.oneOf([3, 4]),
219
+ /**
220
+ * Name attribute used by the `input` element in the Field.
221
+ */
222
+ name: PropTypes.string,
219
223
  /**
220
224
  * Callback fired when the value is accepted.
221
225
  * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
@@ -196,6 +196,10 @@ DesktopDatePicker.propTypes = {
196
196
  * @default 3
197
197
  */
198
198
  monthsPerRow: PropTypes.oneOf([3, 4]),
199
+ /**
200
+ * Name attribute used by the `input` element in the Field.
201
+ */
202
+ name: PropTypes.string,
199
203
  /**
200
204
  * Callback fired when the value is accepted.
201
205
  * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
@@ -273,6 +273,10 @@ DesktopDateTimePicker.propTypes = {
273
273
  * @default 3
274
274
  */
275
275
  monthsPerRow: PropTypes.oneOf([3, 4]),
276
+ /**
277
+ * Name attribute used by the `input` element in the Field.
278
+ */
279
+ name: PropTypes.string,
276
280
  /**
277
281
  * Callback fired when the value is accepted.
278
282
  * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
@@ -201,6 +201,10 @@ DesktopTimePicker.propTypes = {
201
201
  * @default 1
202
202
  */
203
203
  minutesStep: PropTypes.number,
204
+ /**
205
+ * Name attribute used by the `input` element in the Field.
206
+ */
207
+ name: PropTypes.string,
204
208
  /**
205
209
  * Callback fired when the value is accepted.
206
210
  * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
@@ -193,6 +193,10 @@ MobileDatePicker.propTypes = {
193
193
  * @default 3
194
194
  */
195
195
  monthsPerRow: PropTypes.oneOf([3, 4]),
196
+ /**
197
+ * Name attribute used by the `input` element in the Field.
198
+ */
199
+ name: PropTypes.string,
196
200
  /**
197
201
  * Callback fired when the value is accepted.
198
202
  * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
@@ -242,6 +242,10 @@ MobileDateTimePicker.propTypes = {
242
242
  * @default 3
243
243
  */
244
244
  monthsPerRow: PropTypes.oneOf([3, 4]),
245
+ /**
246
+ * Name attribute used by the `input` element in the Field.
247
+ */
248
+ name: PropTypes.string,
245
249
  /**
246
250
  * Callback fired when the value is accepted.
247
251
  * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
@@ -180,6 +180,10 @@ MobileTimePicker.propTypes = {
180
180
  * @default 1
181
181
  */
182
182
  minutesStep: PropTypes.number,
183
+ /**
184
+ * Name attribute used by the `input` element in the Field.
185
+ */
186
+ name: PropTypes.string,
183
187
  /**
184
188
  * Callback fired when the value is accepted.
185
189
  * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
@@ -161,6 +161,10 @@ process.env.NODE_ENV !== "production" ? TimePicker.propTypes = {
161
161
  * @default 1
162
162
  */
163
163
  minutesStep: PropTypes.number,
164
+ /**
165
+ * Name attribute used by the `input` element in the Field.
166
+ */
167
+ name: PropTypes.string,
164
168
  /**
165
169
  * Callback fired when the value is accepted.
166
170
  * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers v6.18.4
2
+ * @mui/x-date-pickers v6.18.6
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -37,6 +37,7 @@ export const useDesktopPicker = _ref => {
37
37
  format,
38
38
  formatDensity,
39
39
  timezone,
40
+ name,
40
41
  label,
41
42
  inputRef,
42
43
  readOnly,
@@ -104,6 +105,7 @@ export const useDesktopPicker = _ref => {
104
105
  formatDensity,
105
106
  timezone,
106
107
  label,
108
+ name,
107
109
  autoFocus: autoFocus && !props.open,
108
110
  focused: open ? true : undefined
109
111
  }),
@@ -143,7 +143,14 @@ export const useField = params => {
143
143
  const digitsAndLetterOnly = /^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(pastedValue);
144
144
  const isValidPastedValue = activeSection.contentType === 'letter' && lettersOnly || activeSection.contentType === 'digit' && digitsOnly || activeSection.contentType === 'digit-with-letter' && digitsAndLetterOnly;
145
145
  if (isValidPastedValue) {
146
- // Early return to let the paste update section, value
146
+ resetCharacterQuery();
147
+ updateSectionValue({
148
+ activeSection,
149
+ newSectionValue: pastedValue,
150
+ shouldGoToNextSection: true
151
+ });
152
+ // prevent default to avoid the input change handler being called
153
+ event.preventDefault();
147
154
  return;
148
155
  }
149
156
  if (lettersOnly || digitsOnly) {
@@ -141,7 +141,7 @@ export interface UseFieldForwardedProps {
141
141
  clearable?: boolean;
142
142
  disabled?: boolean;
143
143
  }
144
- export type UseFieldResponse<TForwardedProps extends UseFieldForwardedProps> = Omit<TForwardedProps, keyof UseFieldForwardedProps> & Required<UseFieldForwardedProps> & Pick<React.HTMLAttributes<HTMLInputElement>, 'autoCorrect' | 'inputMode' | 'placeholder'> & {
144
+ export type UseFieldResponse<TForwardedProps extends UseFieldForwardedProps> = Omit<TForwardedProps, keyof UseFieldForwardedProps> & Required<UseFieldForwardedProps> & Pick<React.InputHTMLAttributes<HTMLInputElement>, 'autoCorrect' | 'inputMode' | 'placeholder'> & {
145
145
  ref: React.Ref<HTMLInputElement>;
146
146
  value: string;
147
147
  onChange: React.ChangeEventHandler<HTMLInputElement>;
@@ -34,6 +34,7 @@ export const useMobilePicker = _ref => {
34
34
  format,
35
35
  formatDensity,
36
36
  timezone,
37
+ name,
37
38
  label,
38
39
  inputRef,
39
40
  readOnly,
@@ -74,7 +75,8 @@ export const useMobilePicker = _ref => {
74
75
  format,
75
76
  formatDensity,
76
77
  timezone,
77
- label
78
+ label,
79
+ name
78
80
  }),
79
81
  ownerState: props
80
82
  });
@@ -59,4 +59,8 @@ export interface BaseNonRangeNonStaticPickerProps {
59
59
  * Pass a ref to the `input` element.
60
60
  */
61
61
  inputRef?: React.Ref<HTMLInputElement>;
62
+ /**
63
+ * Name attribute used by the `input` element in the Field.
64
+ */
65
+ name?: string;
62
66
  }
@@ -177,6 +177,10 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
177
177
  * @default 3
178
178
  */
179
179
  monthsPerRow: PropTypes.oneOf([3, 4]),
180
+ /**
181
+ * Name attribute used by the `input` element in the Field.
182
+ */
183
+ name: PropTypes.string,
180
184
  /**
181
185
  * Callback fired when the value is accepted.
182
186
  * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
@@ -215,6 +215,10 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
215
215
  * @default 3
216
216
  */
217
217
  monthsPerRow: PropTypes.oneOf([3, 4]),
218
+ /**
219
+ * Name attribute used by the `input` element in the Field.
220
+ */
221
+ name: PropTypes.string,
218
222
  /**
219
223
  * Callback fired when the value is accepted.
220
224
  * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
@@ -195,6 +195,10 @@ DesktopDatePicker.propTypes = {
195
195
  * @default 3
196
196
  */
197
197
  monthsPerRow: PropTypes.oneOf([3, 4]),
198
+ /**
199
+ * Name attribute used by the `input` element in the Field.
200
+ */
201
+ name: PropTypes.string,
198
202
  /**
199
203
  * Callback fired when the value is accepted.
200
204
  * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
@@ -271,6 +271,10 @@ DesktopDateTimePicker.propTypes = {
271
271
  * @default 3
272
272
  */
273
273
  monthsPerRow: PropTypes.oneOf([3, 4]),
274
+ /**
275
+ * Name attribute used by the `input` element in the Field.
276
+ */
277
+ name: PropTypes.string,
274
278
  /**
275
279
  * Callback fired when the value is accepted.
276
280
  * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
@@ -201,6 +201,10 @@ DesktopTimePicker.propTypes = {
201
201
  * @default 1
202
202
  */
203
203
  minutesStep: PropTypes.number,
204
+ /**
205
+ * Name attribute used by the `input` element in the Field.
206
+ */
207
+ name: PropTypes.string,
204
208
  /**
205
209
  * Callback fired when the value is accepted.
206
210
  * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
@@ -192,6 +192,10 @@ MobileDatePicker.propTypes = {
192
192
  * @default 3
193
193
  */
194
194
  monthsPerRow: PropTypes.oneOf([3, 4]),
195
+ /**
196
+ * Name attribute used by the `input` element in the Field.
197
+ */
198
+ name: PropTypes.string,
195
199
  /**
196
200
  * Callback fired when the value is accepted.
197
201
  * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
@@ -241,6 +241,10 @@ MobileDateTimePicker.propTypes = {
241
241
  * @default 3
242
242
  */
243
243
  monthsPerRow: PropTypes.oneOf([3, 4]),
244
+ /**
245
+ * Name attribute used by the `input` element in the Field.
246
+ */
247
+ name: PropTypes.string,
244
248
  /**
245
249
  * Callback fired when the value is accepted.
246
250
  * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
@@ -179,6 +179,10 @@ MobileTimePicker.propTypes = {
179
179
  * @default 1
180
180
  */
181
181
  minutesStep: PropTypes.number,
182
+ /**
183
+ * Name attribute used by the `input` element in the Field.
184
+ */
185
+ name: PropTypes.string,
182
186
  /**
183
187
  * Callback fired when the value is accepted.
184
188
  * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
@@ -160,6 +160,10 @@ process.env.NODE_ENV !== "production" ? TimePicker.propTypes = {
160
160
  * @default 1
161
161
  */
162
162
  minutesStep: PropTypes.number,
163
+ /**
164
+ * Name attribute used by the `input` element in the Field.
165
+ */
166
+ name: PropTypes.string,
163
167
  /**
164
168
  * Callback fired when the value is accepted.
165
169
  * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
package/legacy/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers v6.18.4
2
+ * @mui/x-date-pickers v6.18.6
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -35,6 +35,7 @@ export var useDesktopPicker = function useDesktopPicker(_ref) {
35
35
  format = props.format,
36
36
  formatDensity = props.formatDensity,
37
37
  timezone = props.timezone,
38
+ name = props.name,
38
39
  label = props.label,
39
40
  inputRef = props.inputRef,
40
41
  readOnly = props.readOnly,
@@ -102,6 +103,7 @@ export var useDesktopPicker = function useDesktopPicker(_ref) {
102
103
  formatDensity: formatDensity,
103
104
  timezone: timezone,
104
105
  label: label,
106
+ name: name,
105
107
  autoFocus: autoFocus && !props.open,
106
108
  focused: open ? true : undefined
107
109
  }),
@@ -152,7 +152,14 @@ export var useField = function useField(params) {
152
152
  var digitsAndLetterOnly = /^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(pastedValue);
153
153
  var isValidPastedValue = activeSection.contentType === 'letter' && lettersOnly || activeSection.contentType === 'digit' && digitsOnly || activeSection.contentType === 'digit-with-letter' && digitsAndLetterOnly;
154
154
  if (isValidPastedValue) {
155
- // Early return to let the paste update section, value
155
+ resetCharacterQuery();
156
+ updateSectionValue({
157
+ activeSection: activeSection,
158
+ newSectionValue: pastedValue,
159
+ shouldGoToNextSection: true
160
+ });
161
+ // prevent default to avoid the input change handler being called
162
+ event.preventDefault();
156
163
  return;
157
164
  }
158
165
  if (lettersOnly || digitsOnly) {
@@ -31,6 +31,7 @@ export var useMobilePicker = function useMobilePicker(_ref) {
31
31
  format = props.format,
32
32
  formatDensity = props.formatDensity,
33
33
  timezone = props.timezone,
34
+ name = props.name,
34
35
  label = props.label,
35
36
  inputRef = props.inputRef,
36
37
  readOnly = props.readOnly,
@@ -69,7 +70,8 @@ export var useMobilePicker = function useMobilePicker(_ref) {
69
70
  format: format,
70
71
  formatDensity: formatDensity,
71
72
  timezone: timezone,
72
- label: label
73
+ label: label,
74
+ name: name
73
75
  }),
74
76
  ownerState: props
75
77
  });
@@ -62,8 +62,7 @@ var ruRUPickers = {
62
62
  openTimePickerDialogue: function openTimePickerDialogue(value, utils) {
63
63
  return value !== null && utils.isValid(value) ? "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0432\u0440\u0435\u043C\u044F, \u0432\u044B\u0431\u0440\u0430\u043D\u043E \u0432\u0440\u0435\u043C\u044F ".concat(utils.format(value, 'fullTime')) : 'Выберите время';
64
64
  },
65
- // fieldClearLabel: 'Clear value',
66
-
65
+ fieldClearLabel: 'Очистить значение',
67
66
  // Table labels
68
67
  timeTableLabel: 'выбрать время',
69
68
  dateTableLabel: 'выбрать дату',
package/locales/ruRU.js CHANGED
@@ -42,8 +42,7 @@ const ruRUPickers = {
42
42
  // Open picker labels
43
43
  openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Выберите дату, выбрана дата ${utils.format(value, 'fullDate')}` : 'Выберите дату',
44
44
  openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Выберите время, выбрано время ${utils.format(value, 'fullTime')}` : 'Выберите время',
45
- // fieldClearLabel: 'Clear value',
46
-
45
+ fieldClearLabel: 'Очистить значение',
47
46
  // Table labels
48
47
  timeTableLabel: 'выбрать время',
49
48
  dateTableLabel: 'выбрать дату',
@@ -118,6 +118,7 @@ export type FieldSelectedSections = number | FieldSectionType | null | 'all' | {
118
118
  export interface BaseSingleInputFieldProps<TValue, TDate, TSection extends FieldSection, TError> extends BaseFieldProps<TValue, TDate, TSection, TError> {
119
119
  label?: React.ReactNode;
120
120
  id?: string;
121
+ name?: string;
121
122
  inputRef?: React.Ref<HTMLInputElement>;
122
123
  onKeyDown?: React.KeyboardEventHandler;
123
124
  onBlur?: React.FocusEventHandler;
@@ -178,6 +178,10 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
178
178
  * @default 3
179
179
  */
180
180
  monthsPerRow: PropTypes.oneOf([3, 4]),
181
+ /**
182
+ * Name attribute used by the `input` element in the Field.
183
+ */
184
+ name: PropTypes.string,
181
185
  /**
182
186
  * Callback fired when the value is accepted.
183
187
  * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
@@ -216,6 +216,10 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
216
216
  * @default 3
217
217
  */
218
218
  monthsPerRow: PropTypes.oneOf([3, 4]),
219
+ /**
220
+ * Name attribute used by the `input` element in the Field.
221
+ */
222
+ name: PropTypes.string,
219
223
  /**
220
224
  * Callback fired when the value is accepted.
221
225
  * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
@@ -192,6 +192,10 @@ DesktopDatePicker.propTypes = {
192
192
  * @default 3
193
193
  */
194
194
  monthsPerRow: PropTypes.oneOf([3, 4]),
195
+ /**
196
+ * Name attribute used by the `input` element in the Field.
197
+ */
198
+ name: PropTypes.string,
195
199
  /**
196
200
  * Callback fired when the value is accepted.
197
201
  * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
@@ -269,6 +269,10 @@ DesktopDateTimePicker.propTypes = {
269
269
  * @default 3
270
270
  */
271
271
  monthsPerRow: PropTypes.oneOf([3, 4]),
272
+ /**
273
+ * Name attribute used by the `input` element in the Field.
274
+ */
275
+ name: PropTypes.string,
272
276
  /**
273
277
  * Callback fired when the value is accepted.
274
278
  * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
@@ -197,6 +197,10 @@ DesktopTimePicker.propTypes = {
197
197
  * @default 1
198
198
  */
199
199
  minutesStep: PropTypes.number,
200
+ /**
201
+ * Name attribute used by the `input` element in the Field.
202
+ */
203
+ name: PropTypes.string,
200
204
  /**
201
205
  * Callback fired when the value is accepted.
202
206
  * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
@@ -189,6 +189,10 @@ MobileDatePicker.propTypes = {
189
189
  * @default 3
190
190
  */
191
191
  monthsPerRow: PropTypes.oneOf([3, 4]),
192
+ /**
193
+ * Name attribute used by the `input` element in the Field.
194
+ */
195
+ name: PropTypes.string,
192
196
  /**
193
197
  * Callback fired when the value is accepted.
194
198
  * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
@@ -238,6 +238,10 @@ MobileDateTimePicker.propTypes = {
238
238
  * @default 3
239
239
  */
240
240
  monthsPerRow: PropTypes.oneOf([3, 4]),
241
+ /**
242
+ * Name attribute used by the `input` element in the Field.
243
+ */
244
+ name: PropTypes.string,
241
245
  /**
242
246
  * Callback fired when the value is accepted.
243
247
  * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
@@ -176,6 +176,10 @@ MobileTimePicker.propTypes = {
176
176
  * @default 1
177
177
  */
178
178
  minutesStep: PropTypes.number,
179
+ /**
180
+ * Name attribute used by the `input` element in the Field.
181
+ */
182
+ name: PropTypes.string,
179
183
  /**
180
184
  * Callback fired when the value is accepted.
181
185
  * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
@@ -161,6 +161,10 @@ process.env.NODE_ENV !== "production" ? TimePicker.propTypes = {
161
161
  * @default 1
162
162
  */
163
163
  minutesStep: PropTypes.number,
164
+ /**
165
+ * Name attribute used by the `input` element in the Field.
166
+ */
167
+ name: PropTypes.string,
164
168
  /**
165
169
  * Callback fired when the value is accepted.
166
170
  * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers v6.18.4
2
+ * @mui/x-date-pickers v6.18.6
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -36,6 +36,7 @@ export const useDesktopPicker = _ref => {
36
36
  format,
37
37
  formatDensity,
38
38
  timezone,
39
+ name,
39
40
  label,
40
41
  inputRef,
41
42
  readOnly,
@@ -103,6 +104,7 @@ export const useDesktopPicker = _ref => {
103
104
  formatDensity,
104
105
  timezone,
105
106
  label,
107
+ name,
106
108
  autoFocus: autoFocus && !props.open,
107
109
  focused: open ? true : undefined
108
110
  }),
@@ -142,7 +142,14 @@ export const useField = params => {
142
142
  const digitsAndLetterOnly = /^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(pastedValue);
143
143
  const isValidPastedValue = activeSection.contentType === 'letter' && lettersOnly || activeSection.contentType === 'digit' && digitsOnly || activeSection.contentType === 'digit-with-letter' && digitsAndLetterOnly;
144
144
  if (isValidPastedValue) {
145
- // Early return to let the paste update section, value
145
+ resetCharacterQuery();
146
+ updateSectionValue({
147
+ activeSection,
148
+ newSectionValue: pastedValue,
149
+ shouldGoToNextSection: true
150
+ });
151
+ // prevent default to avoid the input change handler being called
152
+ event.preventDefault();
146
153
  return;
147
154
  }
148
155
  if (lettersOnly || digitsOnly) {
@@ -33,6 +33,7 @@ export const useMobilePicker = _ref => {
33
33
  format,
34
34
  formatDensity,
35
35
  timezone,
36
+ name,
36
37
  label,
37
38
  inputRef,
38
39
  readOnly,
@@ -73,7 +74,8 @@ export const useMobilePicker = _ref => {
73
74
  format,
74
75
  formatDensity,
75
76
  timezone,
76
- label
77
+ label,
78
+ name
77
79
  }),
78
80
  ownerState: props
79
81
  });
@@ -42,8 +42,7 @@ const ruRUPickers = {
42
42
  // Open picker labels
43
43
  openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Выберите дату, выбрана дата ${utils.format(value, 'fullDate')}` : 'Выберите дату',
44
44
  openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Выберите время, выбрано время ${utils.format(value, 'fullTime')}` : 'Выберите время',
45
- // fieldClearLabel: 'Clear value',
46
-
45
+ fieldClearLabel: 'Очистить значение',
47
46
  // Table labels
48
47
  timeTableLabel: 'выбрать время',
49
48
  dateTableLabel: 'выбрать дату',
@@ -187,6 +187,10 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
187
187
  * @default 3
188
188
  */
189
189
  monthsPerRow: _propTypes.default.oneOf([3, 4]),
190
+ /**
191
+ * Name attribute used by the `input` element in the Field.
192
+ */
193
+ name: _propTypes.default.string,
190
194
  /**
191
195
  * Callback fired when the value is accepted.
192
196
  * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
@@ -225,6 +225,10 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
225
225
  * @default 3
226
226
  */
227
227
  monthsPerRow: _propTypes.default.oneOf([3, 4]),
228
+ /**
229
+ * Name attribute used by the `input` element in the Field.
230
+ */
231
+ name: _propTypes.default.string,
228
232
  /**
229
233
  * Callback fired when the value is accepted.
230
234
  * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
@@ -201,6 +201,10 @@ DesktopDatePicker.propTypes = {
201
201
  * @default 3
202
202
  */
203
203
  monthsPerRow: _propTypes.default.oneOf([3, 4]),
204
+ /**
205
+ * Name attribute used by the `input` element in the Field.
206
+ */
207
+ name: _propTypes.default.string,
204
208
  /**
205
209
  * Callback fired when the value is accepted.
206
210
  * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
@@ -278,6 +278,10 @@ DesktopDateTimePicker.propTypes = {
278
278
  * @default 3
279
279
  */
280
280
  monthsPerRow: _propTypes.default.oneOf([3, 4]),
281
+ /**
282
+ * Name attribute used by the `input` element in the Field.
283
+ */
284
+ name: _propTypes.default.string,
281
285
  /**
282
286
  * Callback fired when the value is accepted.
283
287
  * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
@@ -206,6 +206,10 @@ DesktopTimePicker.propTypes = {
206
206
  * @default 1
207
207
  */
208
208
  minutesStep: _propTypes.default.number,
209
+ /**
210
+ * Name attribute used by the `input` element in the Field.
211
+ */
212
+ name: _propTypes.default.string,
209
213
  /**
210
214
  * Callback fired when the value is accepted.
211
215
  * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
@@ -198,6 +198,10 @@ MobileDatePicker.propTypes = {
198
198
  * @default 3
199
199
  */
200
200
  monthsPerRow: _propTypes.default.oneOf([3, 4]),
201
+ /**
202
+ * Name attribute used by the `input` element in the Field.
203
+ */
204
+ name: _propTypes.default.string,
201
205
  /**
202
206
  * Callback fired when the value is accepted.
203
207
  * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
@@ -247,6 +247,10 @@ MobileDateTimePicker.propTypes = {
247
247
  * @default 3
248
248
  */
249
249
  monthsPerRow: _propTypes.default.oneOf([3, 4]),
250
+ /**
251
+ * Name attribute used by the `input` element in the Field.
252
+ */
253
+ name: _propTypes.default.string,
250
254
  /**
251
255
  * Callback fired when the value is accepted.
252
256
  * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
@@ -185,6 +185,10 @@ MobileTimePicker.propTypes = {
185
185
  * @default 1
186
186
  */
187
187
  minutesStep: _propTypes.default.number,
188
+ /**
189
+ * Name attribute used by the `input` element in the Field.
190
+ */
191
+ name: _propTypes.default.string,
188
192
  /**
189
193
  * Callback fired when the value is accepted.
190
194
  * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
@@ -170,6 +170,10 @@ process.env.NODE_ENV !== "production" ? TimePicker.propTypes = {
170
170
  * @default 1
171
171
  */
172
172
  minutesStep: _propTypes.default.number,
173
+ /**
174
+ * Name attribute used by the `input` element in the Field.
175
+ */
176
+ name: _propTypes.default.string,
173
177
  /**
174
178
  * Callback fired when the value is accepted.
175
179
  * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers v6.18.4
2
+ * @mui/x-date-pickers v6.18.6
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -44,6 +44,7 @@ const useDesktopPicker = _ref => {
44
44
  format,
45
45
  formatDensity,
46
46
  timezone,
47
+ name,
47
48
  label,
48
49
  inputRef,
49
50
  readOnly,
@@ -111,6 +112,7 @@ const useDesktopPicker = _ref => {
111
112
  formatDensity,
112
113
  timezone,
113
114
  label,
115
+ name,
114
116
  autoFocus: autoFocus && !props.open,
115
117
  focused: open ? true : undefined
116
118
  }),
@@ -151,7 +151,14 @@ const useField = params => {
151
151
  const digitsAndLetterOnly = /^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(pastedValue);
152
152
  const isValidPastedValue = activeSection.contentType === 'letter' && lettersOnly || activeSection.contentType === 'digit' && digitsOnly || activeSection.contentType === 'digit-with-letter' && digitsAndLetterOnly;
153
153
  if (isValidPastedValue) {
154
- // Early return to let the paste update section, value
154
+ resetCharacterQuery();
155
+ updateSectionValue({
156
+ activeSection,
157
+ newSectionValue: pastedValue,
158
+ shouldGoToNextSection: true
159
+ });
160
+ // prevent default to avoid the input change handler being called
161
+ event.preventDefault();
155
162
  return;
156
163
  }
157
164
  if (lettersOnly || digitsOnly) {
@@ -41,6 +41,7 @@ const useMobilePicker = _ref => {
41
41
  format,
42
42
  formatDensity,
43
43
  timezone,
44
+ name,
44
45
  label,
45
46
  inputRef,
46
47
  readOnly,
@@ -81,7 +82,8 @@ const useMobilePicker = _ref => {
81
82
  format,
82
83
  formatDensity,
83
84
  timezone,
84
- label
85
+ label,
86
+ name
85
87
  }),
86
88
  ownerState: props
87
89
  });
@@ -48,8 +48,7 @@ const ruRUPickers = {
48
48
  // Open picker labels
49
49
  openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Выберите дату, выбрана дата ${utils.format(value, 'fullDate')}` : 'Выберите дату',
50
50
  openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Выберите время, выбрано время ${utils.format(value, 'fullTime')}` : 'Выберите время',
51
- // fieldClearLabel: 'Clear value',
52
-
51
+ fieldClearLabel: 'Очистить значение',
53
52
  // Table labels
54
53
  timeTableLabel: 'выбрать время',
55
54
  dateTableLabel: 'выбрать дату',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-date-pickers",
3
- "version": "6.18.4",
3
+ "version": "6.18.6",
4
4
  "description": "The community edition of the date picker components (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",