@mui/x-date-pickers 7.3.2 → 7.4.0

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.
@@ -0,0 +1,554 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.AdapterDateFnsJalali = void 0;
8
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
+ var _addSeconds = require("date-fns-jalali/addSeconds");
10
+ var _addMinutes = require("date-fns-jalali/addMinutes");
11
+ var _addHours = require("date-fns-jalali/addHours");
12
+ var _addDays = require("date-fns-jalali/addDays");
13
+ var _addWeeks = require("date-fns-jalali/addWeeks");
14
+ var _addMonths = require("date-fns-jalali/addMonths");
15
+ var _addYears = require("date-fns-jalali/addYears");
16
+ var _endOfDay = require("date-fns-jalali/endOfDay");
17
+ var _endOfWeek = require("date-fns-jalali/endOfWeek");
18
+ var _endOfYear = require("date-fns-jalali/endOfYear");
19
+ var _format = require("date-fns-jalali/format");
20
+ var _getHours = require("date-fns-jalali/getHours");
21
+ var _getSeconds = require("date-fns-jalali/getSeconds");
22
+ var _getMilliseconds = require("date-fns-jalali/getMilliseconds");
23
+ var _getWeek = require("date-fns-jalali/getWeek");
24
+ var _getYear = require("date-fns-jalali/getYear");
25
+ var _getMonth = require("date-fns-jalali/getMonth");
26
+ var _getDate = require("date-fns-jalali/getDate");
27
+ var _getDaysInMonth = require("date-fns-jalali/getDaysInMonth");
28
+ var _getMinutes = require("date-fns-jalali/getMinutes");
29
+ var _isAfter = require("date-fns-jalali/isAfter");
30
+ var _isBefore = require("date-fns-jalali/isBefore");
31
+ var _isEqual = require("date-fns-jalali/isEqual");
32
+ var _isSameDay = require("date-fns-jalali/isSameDay");
33
+ var _isSameYear = require("date-fns-jalali/isSameYear");
34
+ var _isSameMonth = require("date-fns-jalali/isSameMonth");
35
+ var _isSameHour = require("date-fns-jalali/isSameHour");
36
+ var _isValid = require("date-fns-jalali/isValid");
37
+ var _parse = require("date-fns-jalali/parse");
38
+ var _setDate = require("date-fns-jalali/setDate");
39
+ var _setHours = require("date-fns-jalali/setHours");
40
+ var _setMinutes = require("date-fns-jalali/setMinutes");
41
+ var _setMonth = require("date-fns-jalali/setMonth");
42
+ var _setSeconds = require("date-fns-jalali/setSeconds");
43
+ var _setMilliseconds = require("date-fns-jalali/setMilliseconds");
44
+ var _setYear = require("date-fns-jalali/setYear");
45
+ var _startOfDay = require("date-fns-jalali/startOfDay");
46
+ var _startOfMonth = require("date-fns-jalali/startOfMonth");
47
+ var _endOfMonth = require("date-fns-jalali/endOfMonth");
48
+ var _startOfWeek = require("date-fns-jalali/startOfWeek");
49
+ var _startOfYear = require("date-fns-jalali/startOfYear");
50
+ var _isWithinInterval = require("date-fns-jalali/isWithinInterval");
51
+ var _faIR = require("date-fns-jalali/locale/fa-IR");
52
+ /* eslint-disable class-methods-use-this */
53
+ // TODO remove when date-fns-jalali-v3 is the default
54
+ // @ts-nocheck
55
+
56
+ // date-fns-jalali v2 does not export types
57
+ // @ts-ignore TODO remove when date-fns-jalali-v3 is the default
58
+
59
+ const formatTokenMap = {
60
+ // Year
61
+ y: {
62
+ sectionType: 'year',
63
+ contentType: 'digit',
64
+ maxLength: 4
65
+ },
66
+ yy: 'year',
67
+ yyy: {
68
+ sectionType: 'year',
69
+ contentType: 'digit',
70
+ maxLength: 4
71
+ },
72
+ yyyy: 'year',
73
+ // Month
74
+ M: {
75
+ sectionType: 'month',
76
+ contentType: 'digit',
77
+ maxLength: 2
78
+ },
79
+ MM: 'month',
80
+ MMMM: {
81
+ sectionType: 'month',
82
+ contentType: 'letter'
83
+ },
84
+ MMM: {
85
+ sectionType: 'month',
86
+ contentType: 'letter'
87
+ },
88
+ L: {
89
+ sectionType: 'month',
90
+ contentType: 'digit',
91
+ maxLength: 2
92
+ },
93
+ LL: 'month',
94
+ LLL: {
95
+ sectionType: 'month',
96
+ contentType: 'letter'
97
+ },
98
+ LLLL: {
99
+ sectionType: 'month',
100
+ contentType: 'letter'
101
+ },
102
+ // Day of the month
103
+ d: {
104
+ sectionType: 'day',
105
+ contentType: 'digit',
106
+ maxLength: 2
107
+ },
108
+ dd: 'day',
109
+ do: {
110
+ sectionType: 'day',
111
+ contentType: 'digit-with-letter'
112
+ },
113
+ // Day of the week
114
+ E: {
115
+ sectionType: 'weekDay',
116
+ contentType: 'letter'
117
+ },
118
+ EE: {
119
+ sectionType: 'weekDay',
120
+ contentType: 'letter'
121
+ },
122
+ EEE: {
123
+ sectionType: 'weekDay',
124
+ contentType: 'letter'
125
+ },
126
+ EEEE: {
127
+ sectionType: 'weekDay',
128
+ contentType: 'letter'
129
+ },
130
+ EEEEE: {
131
+ sectionType: 'weekDay',
132
+ contentType: 'letter'
133
+ },
134
+ i: {
135
+ sectionType: 'weekDay',
136
+ contentType: 'digit',
137
+ maxLength: 1
138
+ },
139
+ ii: 'weekDay',
140
+ iii: {
141
+ sectionType: 'weekDay',
142
+ contentType: 'letter'
143
+ },
144
+ iiii: {
145
+ sectionType: 'weekDay',
146
+ contentType: 'letter'
147
+ },
148
+ e: {
149
+ sectionType: 'weekDay',
150
+ contentType: 'digit',
151
+ maxLength: 1
152
+ },
153
+ ee: 'weekDay',
154
+ eee: {
155
+ sectionType: 'weekDay',
156
+ contentType: 'letter'
157
+ },
158
+ eeee: {
159
+ sectionType: 'weekDay',
160
+ contentType: 'letter'
161
+ },
162
+ eeeee: {
163
+ sectionType: 'weekDay',
164
+ contentType: 'letter'
165
+ },
166
+ eeeeee: {
167
+ sectionType: 'weekDay',
168
+ contentType: 'letter'
169
+ },
170
+ c: {
171
+ sectionType: 'weekDay',
172
+ contentType: 'digit',
173
+ maxLength: 1
174
+ },
175
+ cc: 'weekDay',
176
+ ccc: {
177
+ sectionType: 'weekDay',
178
+ contentType: 'letter'
179
+ },
180
+ cccc: {
181
+ sectionType: 'weekDay',
182
+ contentType: 'letter'
183
+ },
184
+ ccccc: {
185
+ sectionType: 'weekDay',
186
+ contentType: 'letter'
187
+ },
188
+ cccccc: {
189
+ sectionType: 'weekDay',
190
+ contentType: 'letter'
191
+ },
192
+ // Meridiem
193
+ a: 'meridiem',
194
+ aa: 'meridiem',
195
+ aaa: 'meridiem',
196
+ // Hours
197
+ H: {
198
+ sectionType: 'hours',
199
+ contentType: 'digit',
200
+ maxLength: 2
201
+ },
202
+ HH: 'hours',
203
+ h: {
204
+ sectionType: 'hours',
205
+ contentType: 'digit',
206
+ maxLength: 2
207
+ },
208
+ hh: 'hours',
209
+ // Minutes
210
+ m: {
211
+ sectionType: 'minutes',
212
+ contentType: 'digit',
213
+ maxLength: 2
214
+ },
215
+ mm: 'minutes',
216
+ // Seconds
217
+ s: {
218
+ sectionType: 'seconds',
219
+ contentType: 'digit',
220
+ maxLength: 2
221
+ },
222
+ ss: 'seconds'
223
+ };
224
+ const defaultFormats = {
225
+ year: 'yyyy',
226
+ month: 'LLLL',
227
+ monthShort: 'MMM',
228
+ dayOfMonth: 'd',
229
+ dayOfMonthFull: 'do',
230
+ weekday: 'EEEE',
231
+ weekdayShort: 'EEEEEE',
232
+ hours24h: 'HH',
233
+ hours12h: 'hh',
234
+ meridiem: 'aa',
235
+ minutes: 'mm',
236
+ seconds: 'ss',
237
+ fullDate: 'PPP',
238
+ keyboardDate: 'P',
239
+ shortDate: 'd MMM',
240
+ normalDate: 'd MMMM',
241
+ normalDateWithWeekday: 'EEE, d MMMM',
242
+ fullTime: 'p',
243
+ fullTime12h: 'hh:mm aaa',
244
+ fullTime24h: 'HH:mm',
245
+ keyboardDateTime: 'P p',
246
+ keyboardDateTime12h: 'P hh:mm aa',
247
+ keyboardDateTime24h: 'P HH:mm'
248
+ };
249
+ const NUMBER_SYMBOL_MAP = {
250
+ '1': '۱',
251
+ '2': '۲',
252
+ '3': '۳',
253
+ '4': '۴',
254
+ '5': '۵',
255
+ '6': '۶',
256
+ '7': '۷',
257
+ '8': '۸',
258
+ '9': '۹',
259
+ '0': '۰'
260
+ };
261
+ /**
262
+ * Based on `@date-io/date-fns-jalali`
263
+ *
264
+ * MIT License
265
+ *
266
+ * Copyright (c) 2017 Dmitriy Kovalenko
267
+ *
268
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
269
+ * of this software and associated documentation files (the "Software"), to deal
270
+ * in the Software without restriction, including without limitation the rights
271
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
272
+ * copies of the Software, and to permit persons to whom the Software is
273
+ * furnished to do so, subject to the following conditions:
274
+ *
275
+ * The above copyright notice and this permission notice shall be included in all
276
+ * copies or substantial portions of the Software.
277
+ *
278
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
279
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
280
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
281
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
282
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
283
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
284
+ * SOFTWARE.
285
+ */
286
+ class AdapterDateFnsJalali {
287
+ constructor({
288
+ locale: _locale,
289
+ formats
290
+ } = {}) {
291
+ this.isMUIAdapter = true;
292
+ this.isTimezoneCompatible = false;
293
+ this.lib = 'date-fns-jalali';
294
+ this.locale = void 0;
295
+ this.formats = void 0;
296
+ this.formatTokenMap = formatTokenMap;
297
+ this.escapedCharacters = {
298
+ start: "'",
299
+ end: "'"
300
+ };
301
+ this.date = value => {
302
+ if (typeof value === 'undefined') {
303
+ return new Date();
304
+ }
305
+ if (value === null) {
306
+ return null;
307
+ }
308
+ return new Date(value);
309
+ };
310
+ this.getInvalidDate = () => new Date('Invalid Date');
311
+ this.getTimezone = () => {
312
+ return 'default';
313
+ };
314
+ this.setTimezone = value => {
315
+ return value;
316
+ };
317
+ this.toJsDate = value => {
318
+ return value;
319
+ };
320
+ this.parse = (value, format) => {
321
+ if (value === '') {
322
+ return null;
323
+ }
324
+ return (0, _parse.parse)(value, format, new Date(), {
325
+ locale: this.locale
326
+ });
327
+ };
328
+ this.getCurrentLocaleCode = () => {
329
+ return this.locale?.code || 'fa-IR';
330
+ };
331
+ // Note: date-fns input types are more lenient than this adapter, so we need to expose our more
332
+ // strict signature and delegate to the more lenient signature. Otherwise, we have downstream type errors upon usage.
333
+ this.is12HourCycleInCurrentLocale = () => {
334
+ if (this.locale) {
335
+ return /a/.test(this.locale.formatLong.time());
336
+ }
337
+
338
+ // By default, date-fns-jalali is using fa-IR locale with am/pm enabled
339
+ return true;
340
+ };
341
+ this.expandFormat = format => {
342
+ // @see https://github.com/date-fns/date-fns/blob/master/src/format/index.js#L31
343
+ const longFormatRegexp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
344
+ const locale = this.locale ?? _faIR.faIR;
345
+ return format.match(longFormatRegexp).map(token => {
346
+ const firstCharacter = token[0];
347
+ if (firstCharacter === 'p' || firstCharacter === 'P') {
348
+ const longFormatter = _format.longFormatters[firstCharacter];
349
+ return longFormatter(token, locale.formatLong, {});
350
+ }
351
+ return token;
352
+ }).join('');
353
+ };
354
+ this.isValid = value => {
355
+ if (value == null) {
356
+ return false;
357
+ }
358
+ return (0, _isValid.isValid)(value);
359
+ };
360
+ this.format = (value, formatKey) => {
361
+ return this.formatByString(value, this.formats[formatKey]);
362
+ };
363
+ this.formatByString = (value, formatString) => {
364
+ return (0, _format.format)(value, formatString, {
365
+ locale: this.locale
366
+ });
367
+ };
368
+ this.formatNumber = numberToFormat => {
369
+ return numberToFormat.replace(/\d/g, match => NUMBER_SYMBOL_MAP[match]).replace(/,/g, '،');
370
+ };
371
+ this.isEqual = (value, comparing) => {
372
+ if (value === null && comparing === null) {
373
+ return true;
374
+ }
375
+ if (value === null || comparing === null) {
376
+ return false;
377
+ }
378
+ return (0, _isEqual.isEqual)(value, comparing);
379
+ };
380
+ this.isSameYear = (value, comparing) => {
381
+ return (0, _isSameYear.isSameYear)(value, comparing);
382
+ };
383
+ this.isSameMonth = (value, comparing) => {
384
+ return (0, _isSameMonth.isSameMonth)(value, comparing);
385
+ };
386
+ this.isSameDay = (value, comparing) => {
387
+ return (0, _isSameDay.isSameDay)(value, comparing);
388
+ };
389
+ this.isSameHour = (value, comparing) => {
390
+ return (0, _isSameHour.isSameHour)(value, comparing);
391
+ };
392
+ this.isAfter = (value, comparing) => {
393
+ return (0, _isAfter.isAfter)(value, comparing);
394
+ };
395
+ this.isAfterYear = (value, comparing) => {
396
+ return (0, _isAfter.isAfter)(value, this.endOfYear(comparing));
397
+ };
398
+ this.isAfterDay = (value, comparing) => {
399
+ return (0, _isAfter.isAfter)(value, this.endOfDay(comparing));
400
+ };
401
+ this.isBefore = (value, comparing) => {
402
+ return (0, _isBefore.isBefore)(value, comparing);
403
+ };
404
+ this.isBeforeYear = (value, comparing) => {
405
+ return (0, _isBefore.isBefore)(value, this.startOfYear(comparing));
406
+ };
407
+ this.isBeforeDay = (value, comparing) => {
408
+ return (0, _isBefore.isBefore)(value, this.startOfDay(comparing));
409
+ };
410
+ this.isWithinRange = (value, [start, end]) => {
411
+ return (0, _isWithinInterval.isWithinInterval)(value, {
412
+ start,
413
+ end
414
+ });
415
+ };
416
+ this.startOfYear = value => {
417
+ return (0, _startOfYear.startOfYear)(value);
418
+ };
419
+ this.startOfMonth = value => {
420
+ return (0, _startOfMonth.startOfMonth)(value);
421
+ };
422
+ this.startOfWeek = value => {
423
+ return (0, _startOfWeek.startOfWeek)(value, {
424
+ locale: this.locale
425
+ });
426
+ };
427
+ this.startOfDay = value => {
428
+ return (0, _startOfDay.startOfDay)(value);
429
+ };
430
+ this.endOfYear = value => {
431
+ return (0, _endOfYear.endOfYear)(value);
432
+ };
433
+ this.endOfMonth = value => {
434
+ return (0, _endOfMonth.endOfMonth)(value);
435
+ };
436
+ this.endOfWeek = value => {
437
+ return (0, _endOfWeek.endOfWeek)(value, {
438
+ locale: this.locale
439
+ });
440
+ };
441
+ this.endOfDay = value => {
442
+ return (0, _endOfDay.endOfDay)(value);
443
+ };
444
+ this.addYears = (value, amount) => {
445
+ return (0, _addYears.addYears)(value, amount);
446
+ };
447
+ this.addMonths = (value, amount) => {
448
+ return (0, _addMonths.addMonths)(value, amount);
449
+ };
450
+ this.addWeeks = (value, amount) => {
451
+ return (0, _addWeeks.addWeeks)(value, amount);
452
+ };
453
+ this.addDays = (value, amount) => {
454
+ return (0, _addDays.addDays)(value, amount);
455
+ };
456
+ this.addHours = (value, amount) => {
457
+ return (0, _addHours.addHours)(value, amount);
458
+ };
459
+ this.addMinutes = (value, amount) => {
460
+ return (0, _addMinutes.addMinutes)(value, amount);
461
+ };
462
+ this.addSeconds = (value, amount) => {
463
+ return (0, _addSeconds.addSeconds)(value, amount);
464
+ };
465
+ this.getYear = value => {
466
+ return (0, _getYear.getYear)(value);
467
+ };
468
+ this.getMonth = value => {
469
+ return (0, _getMonth.getMonth)(value);
470
+ };
471
+ this.getDate = value => {
472
+ return (0, _getDate.getDate)(value);
473
+ };
474
+ this.getHours = value => {
475
+ return (0, _getHours.getHours)(value);
476
+ };
477
+ this.getMinutes = value => {
478
+ return (0, _getMinutes.getMinutes)(value);
479
+ };
480
+ this.getSeconds = value => {
481
+ return (0, _getSeconds.getSeconds)(value);
482
+ };
483
+ this.getMilliseconds = value => {
484
+ return (0, _getMilliseconds.getMilliseconds)(value);
485
+ };
486
+ this.setYear = (value, year) => {
487
+ return (0, _setYear.setYear)(value, year);
488
+ };
489
+ this.setMonth = (value, month) => {
490
+ return (0, _setMonth.setMonth)(value, month);
491
+ };
492
+ this.setDate = (value, date) => {
493
+ return (0, _setDate.setDate)(value, date);
494
+ };
495
+ this.setHours = (value, hours) => {
496
+ return (0, _setHours.setHours)(value, hours);
497
+ };
498
+ this.setMinutes = (value, minutes) => {
499
+ return (0, _setMinutes.setMinutes)(value, minutes);
500
+ };
501
+ this.setSeconds = (value, seconds) => {
502
+ return (0, _setSeconds.setSeconds)(value, seconds);
503
+ };
504
+ this.setMilliseconds = (value, milliseconds) => {
505
+ return (0, _setMilliseconds.setMilliseconds)(value, milliseconds);
506
+ };
507
+ this.getDaysInMonth = value => {
508
+ return (0, _getDaysInMonth.getDaysInMonth)(value);
509
+ };
510
+ this.getWeekArray = value => {
511
+ const start = this.startOfWeek(this.startOfMonth(value));
512
+ const end = this.endOfWeek(this.endOfMonth(value));
513
+ let count = 0;
514
+ let current = start;
515
+ const nestedWeeks = [];
516
+ while (this.isBefore(current, end)) {
517
+ const weekNumber = Math.floor(count / 7);
518
+ nestedWeeks[weekNumber] = nestedWeeks[weekNumber] || [];
519
+ nestedWeeks[weekNumber].push(current);
520
+ current = this.addDays(current, 1);
521
+ count += 1;
522
+ }
523
+ return nestedWeeks;
524
+ };
525
+ this.getWeekNumber = date => {
526
+ return (0, _getWeek.getWeek)(date, {
527
+ locale: this.locale
528
+ });
529
+ };
530
+ this.getYearRange = ([start, end]) => {
531
+ const startDate = this.startOfYear(start);
532
+ const endDate = this.endOfYear(end);
533
+ const years = [];
534
+ let current = startDate;
535
+ while (this.isBefore(current, endDate)) {
536
+ years.push(current);
537
+ current = this.addYears(current, 1);
538
+ }
539
+ return years;
540
+ };
541
+ if (typeof _addDays.addDays !== 'function') {
542
+ throw new Error([`MUI: The \`date-fns-jalali\` package v2.x is not compatible with this adapter.`, 'Please, install v3.x of the package or use the `AdapterDateFnsJalali` instead.'].join('\n'));
543
+ }
544
+ if (!_format.longFormatters) {
545
+ throw new Error('MUI: The minimum supported `date-fns-jalali` package version compatible with this adapter is `3.2.x`.');
546
+ }
547
+ this.locale = _locale;
548
+ this.formats = (0, _extends2.default)({}, defaultFormats, formats);
549
+ }
550
+ getDayOfWeek(value) {
551
+ return value.getDay() + 1;
552
+ }
553
+ }
554
+ exports.AdapterDateFnsJalali = AdapterDateFnsJalali;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "AdapterDateFnsJalali", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _AdapterDateFnsJalaliV.AdapterDateFnsJalali;
10
+ }
11
+ });
12
+ var _AdapterDateFnsJalaliV = require("./AdapterDateFnsJalaliV3");
@@ -46,13 +46,13 @@ function PickersShortcuts(props) {
46
46
  const newValue = getValue({
47
47
  isValid
48
48
  });
49
- return {
49
+ return (0, _extends2.default)({}, item, {
50
50
  label: item.label,
51
51
  onClick: () => {
52
52
  onChange(newValue, changeImportance, item);
53
53
  },
54
54
  disabled: !isValid(newValue)
55
- };
55
+ });
56
56
  });
57
57
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_List.default, (0, _extends2.default)({
58
58
  dense: true,
@@ -65,7 +65,7 @@ function PickersShortcuts(props) {
65
65
  children: resolvedItems.map(item => {
66
66
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ListItem.default, {
67
67
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Chip.default, (0, _extends2.default)({}, item))
68
- }, item.label);
68
+ }, item.id ?? item.label);
69
69
  })
70
70
  }));
71
71
  }
@@ -104,6 +104,7 @@ process.env.NODE_ENV !== "production" ? PickersShortcuts.propTypes = {
104
104
  */
105
105
  items: _propTypes.default.arrayOf(_propTypes.default.shape({
106
106
  getValue: _propTypes.default.func.isRequired,
107
+ id: _propTypes.default.string,
107
108
  label: _propTypes.default.string.isRequired
108
109
  })),
109
110
  onChange: _propTypes.default.func.isRequired,
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers v7.3.2
2
+ * @mui/x-date-pickers v7.4.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -91,11 +91,6 @@ const useField = params => {
91
91
  setSelectedSections('all');
92
92
  break;
93
93
  }
94
- case event.key === 'Enter':
95
- {
96
- event.preventDefault();
97
- break;
98
- }
99
94
 
100
95
  // Move selection to next section
101
96
  case event.key === 'ArrowRight':
@@ -291,6 +291,11 @@ const useFieldV7TextField = params => {
291
291
  revertDOMSectionChange(sectionIndex);
292
292
  return;
293
293
  }
294
+ const inputType = event.nativeEvent.inputType;
295
+ if (inputType === 'insertParagraph' || inputType === 'insertLineBreak') {
296
+ revertDOMSectionChange(sectionIndex);
297
+ return;
298
+ }
294
299
  resetCharacterQuery();
295
300
  clearActiveSection();
296
301
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-date-pickers",
3
- "version": "7.3.2",
3
+ "version": "7.4.0",
4
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",
@@ -40,7 +40,7 @@
40
40
  "@mui/system": "^5.15.14",
41
41
  "@mui/utils": "^5.15.14",
42
42
  "@types/react-transition-group": "^4.4.10",
43
- "clsx": "^2.1.0",
43
+ "clsx": "^2.1.1",
44
44
  "prop-types": "^15.8.1",
45
45
  "react-transition-group": "^4.4.5"
46
46
  },
@@ -49,7 +49,7 @@
49
49
  "@emotion/styled": "^11.8.1",
50
50
  "@mui/material": "^5.15.14",
51
51
  "date-fns": "^2.25.0 || ^3.2.0",
52
- "date-fns-jalali": "^2.13.0-0",
52
+ "date-fns-jalali": "^2.13.0-0 || ^3.2.0-0",
53
53
  "dayjs": "^1.10.7",
54
54
  "luxon": "^3.0.2",
55
55
  "moment": "^2.29.4",