@mui/x-date-pickers 6.10.2 → 6.11.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.
- package/AdapterDayjs/AdapterDayjs.d.ts +8 -1
- package/AdapterDayjs/AdapterDayjs.js +66 -38
- package/CHANGELOG.md +92 -0
- package/DateCalendar/DateCalendar.d.ts +1 -1
- package/DateCalendar/DateCalendar.js +48 -38
- package/DateCalendar/DateCalendar.types.d.ts +9 -1
- package/DateCalendar/index.d.ts +1 -2
- package/DateCalendar/index.js +3 -2
- package/DateCalendar/useCalendarState.d.ts +1 -1
- package/DateField/DateField.d.ts +1 -1
- package/DateField/DateField.js +2 -2
- package/DatePicker/DatePicker.d.ts +1 -1
- package/DatePicker/DatePickerToolbar.d.ts +1 -1
- package/DateTimeField/DateTimeField.d.ts +1 -1
- package/DateTimeField/DateTimeField.js +2 -2
- package/DateTimePicker/DateTimePicker.d.ts +1 -1
- package/DayCalendarSkeleton/DayCalendarSkeleton.d.ts +1 -1
- package/DesktopDatePicker/DesktopDatePicker.d.ts +1 -1
- package/DesktopDatePicker/DesktopDatePicker.js +2 -2
- package/DesktopDateTimePicker/DesktopDateTimePicker.d.ts +1 -1
- package/DesktopDateTimePicker/DesktopDateTimePicker.js +2 -2
- package/DesktopTimePicker/DesktopTimePicker.d.ts +1 -1
- package/DesktopTimePicker/DesktopTimePicker.js +2 -2
- package/DigitalClock/DigitalClock.d.ts +1 -1
- package/LocalizationProvider/LocalizationProvider.d.ts +1 -1
- package/MobileDatePicker/MobileDatePicker.d.ts +1 -1
- package/MobileDatePicker/MobileDatePicker.js +2 -2
- package/MobileDateTimePicker/MobileDateTimePicker.d.ts +1 -1
- package/MobileDateTimePicker/MobileDateTimePicker.js +2 -2
- package/MobileTimePicker/MobileTimePicker.d.ts +1 -1
- package/MobileTimePicker/MobileTimePicker.js +2 -2
- package/MonthCalendar/MonthCalendar.d.ts +1 -1
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.d.ts +1 -1
- package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.d.ts +1 -1
- package/{DateCalendar → PickersCalendarHeader}/PickersCalendarHeader.d.ts +21 -9
- package/{DateCalendar → PickersCalendarHeader}/PickersCalendarHeader.js +72 -28
- package/PickersCalendarHeader/index.d.ts +4 -0
- package/PickersCalendarHeader/index.js +2 -0
- package/PickersCalendarHeader/package.json +6 -0
- package/PickersDay/PickersDay.d.ts +1 -1
- package/StaticDatePicker/StaticDatePicker.d.ts +1 -1
- package/StaticDateTimePicker/StaticDateTimePicker.d.ts +1 -1
- package/StaticTimePicker/StaticTimePicker.d.ts +1 -1
- package/TimeClock/ClockNumbers.d.ts +1 -1
- package/TimeClock/TimeClock.d.ts +1 -1
- package/TimeField/TimeField.d.ts +1 -1
- package/TimeField/TimeField.js +2 -2
- package/TimePicker/TimePicker.d.ts +1 -1
- package/YearCalendar/YearCalendar.d.ts +2 -2
- package/index.js +1 -1
- package/internals/components/PickersModalDialog.d.ts +2 -2
- package/internals/components/PickersPopper.d.ts +3 -3
- package/internals/components/PickersToolbar.d.ts +1 -1
- package/internals/hooks/date-helpers-hooks.d.ts +1 -2
- package/internals/hooks/useDefaultReduceAnimations.d.ts +2 -0
- package/internals/hooks/useDefaultReduceAnimations.js +9 -0
- package/internals/hooks/useField/useField.js +9 -4
- package/internals/hooks/useField/useField.utils.d.ts +1 -1
- package/internals/hooks/useField/useField.utils.js +6 -5
- package/internals/index.d.ts +1 -3
- package/internals/index.js +1 -2
- package/internals/utils/valueManagers.js +1 -1
- package/legacy/AdapterDayjs/AdapterDayjs.js +64 -38
- package/legacy/DateCalendar/DateCalendar.js +50 -40
- package/legacy/DateCalendar/index.js +3 -2
- package/legacy/DateField/DateField.js +2 -2
- package/legacy/DateTimeField/DateTimeField.js +2 -2
- package/legacy/DesktopDatePicker/DesktopDatePicker.js +2 -2
- package/legacy/DesktopDateTimePicker/DesktopDateTimePicker.js +2 -2
- package/legacy/DesktopTimePicker/DesktopTimePicker.js +2 -2
- package/legacy/MobileDatePicker/MobileDatePicker.js +2 -2
- package/legacy/MobileDateTimePicker/MobileDateTimePicker.js +2 -2
- package/legacy/MobileTimePicker/MobileTimePicker.js +2 -2
- package/legacy/{DateCalendar → PickersCalendarHeader}/PickersCalendarHeader.js +57 -13
- package/legacy/PickersCalendarHeader/index.js +2 -0
- package/legacy/TimeField/TimeField.js +2 -2
- package/legacy/index.js +1 -1
- package/legacy/internals/hooks/useDefaultReduceAnimations.js +9 -0
- package/legacy/internals/hooks/useField/useField.js +9 -4
- package/legacy/internals/hooks/useField/useField.utils.js +6 -5
- package/legacy/internals/index.js +1 -2
- package/legacy/internals/utils/valueManagers.js +1 -1
- package/legacy/tests/describeGregorianAdapter/testCalculations.js +63 -16
- package/modern/AdapterDayjs/AdapterDayjs.js +65 -38
- package/modern/DateCalendar/DateCalendar.js +46 -38
- package/modern/DateCalendar/index.js +3 -2
- package/modern/DateField/DateField.js +2 -2
- package/modern/DateTimeField/DateTimeField.js +2 -2
- package/modern/DesktopDatePicker/DesktopDatePicker.js +1 -1
- package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +1 -1
- package/modern/DesktopTimePicker/DesktopTimePicker.js +1 -1
- package/modern/MobileDatePicker/MobileDatePicker.js +1 -1
- package/modern/MobileDateTimePicker/MobileDateTimePicker.js +1 -1
- package/modern/MobileTimePicker/MobileTimePicker.js +1 -1
- package/modern/{DateCalendar → PickersCalendarHeader}/PickersCalendarHeader.js +72 -28
- package/modern/PickersCalendarHeader/index.js +2 -0
- package/modern/TimeField/TimeField.js +2 -2
- package/modern/index.js +1 -1
- package/modern/internals/hooks/useDefaultReduceAnimations.js +9 -0
- package/modern/internals/hooks/useField/useField.js +9 -4
- package/modern/internals/hooks/useField/useField.utils.js +6 -5
- package/modern/internals/index.js +1 -2
- package/modern/internals/utils/valueManagers.js +1 -1
- package/modern/tests/describeGregorianAdapter/testCalculations.js +63 -16
- package/node/AdapterDayjs/AdapterDayjs.js +65 -38
- package/node/DateCalendar/DateCalendar.js +52 -44
- package/node/DateCalendar/index.js +21 -8
- package/node/DateField/DateField.js +2 -2
- package/node/DateTimeField/DateTimeField.js +2 -2
- package/node/DesktopDatePicker/DesktopDatePicker.js +1 -1
- package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +1 -1
- package/node/DesktopTimePicker/DesktopTimePicker.js +1 -1
- package/node/MobileDatePicker/MobileDatePicker.js +1 -1
- package/node/MobileDateTimePicker/MobileDateTimePicker.js +1 -1
- package/node/MobileTimePicker/MobileTimePicker.js +1 -1
- package/node/{DateCalendar → PickersCalendarHeader}/PickersCalendarHeader.js +73 -29
- package/node/PickersCalendarHeader/index.js +19 -0
- package/node/TimeField/TimeField.js +2 -2
- package/node/index.js +1 -1
- package/node/internals/hooks/useDefaultReduceAnimations.js +18 -0
- package/node/internals/hooks/useField/useField.js +9 -4
- package/node/internals/hooks/useField/useField.utils.js +6 -5
- package/node/internals/index.js +7 -14
- package/node/internals/utils/valueManagers.js +1 -1
- package/node/tests/describeGregorianAdapter/testCalculations.js +61 -16
- package/package.json +2 -2
- package/tests/describeGregorianAdapter/testCalculations.js +63 -16
- package/themeAugmentation/props.d.ts +2 -2
- package/internals/utils/defaultReduceAnimations.d.ts +0 -1
- package/internals/utils/defaultReduceAnimations.js +0 -1
- package/legacy/internals/utils/defaultReduceAnimations.js +0 -1
- package/modern/internals/utils/defaultReduceAnimations.js +0 -1
- package/node/internals/utils/defaultReduceAnimations.js +0 -8
- /package/{DateCalendar → PickersCalendarHeader}/pickersCalendarHeaderClasses.d.ts +0 -0
- /package/{DateCalendar → PickersCalendarHeader}/pickersCalendarHeaderClasses.js +0 -0
- /package/legacy/{DateCalendar → PickersCalendarHeader}/pickersCalendarHeaderClasses.js +0 -0
- /package/modern/{DateCalendar → PickersCalendarHeader}/pickersCalendarHeaderClasses.js +0 -0
- /package/node/{DateCalendar → PickersCalendarHeader}/pickersCalendarHeaderClasses.js +0 -0
|
@@ -45,13 +45,20 @@ export declare class AdapterDayjs implements MuiPickersAdapter<Dayjs, string> {
|
|
|
45
45
|
private hasTimezonePlugin;
|
|
46
46
|
private isSame;
|
|
47
47
|
/**
|
|
48
|
-
*
|
|
48
|
+
* Replaces "default" by undefined and "system" by the system timezone before passing it to `dayjs`.
|
|
49
49
|
*/
|
|
50
50
|
private cleanTimezone;
|
|
51
51
|
private createSystemDate;
|
|
52
52
|
private createUTCDate;
|
|
53
53
|
private createTZDate;
|
|
54
54
|
private getLocaleFormats;
|
|
55
|
+
/**
|
|
56
|
+
* If the new day does not have the same offset as the old one (when switching to summer day time for example),
|
|
57
|
+
* Then dayjs will not automatically adjust the offset (moment does).
|
|
58
|
+
* We have to parse again the value to make sure the `fixOffset` method is applied.
|
|
59
|
+
* See https://github.com/iamkun/dayjs/blob/b3624de619d6e734cd0ffdbbd3502185041c1b60/src/plugin/timezone/index.js#L72
|
|
60
|
+
*/
|
|
61
|
+
private adjustOffset;
|
|
55
62
|
date: (value?: any) => defaultDayjs.Dayjs | null;
|
|
56
63
|
dateWithTimezone: (value: string | null | undefined, timezone: PickersTimezone) => Dayjs | null;
|
|
57
64
|
getTimezone: (value: Dayjs) => string;
|
|
@@ -185,9 +185,24 @@ export class AdapterDayjs {
|
|
|
185
185
|
return value.format(comparisonTemplate) === comparingInValueTimezone.format(comparisonTemplate);
|
|
186
186
|
};
|
|
187
187
|
/**
|
|
188
|
-
*
|
|
188
|
+
* Replaces "default" by undefined and "system" by the system timezone before passing it to `dayjs`.
|
|
189
189
|
*/
|
|
190
|
-
this.cleanTimezone = timezone =>
|
|
190
|
+
this.cleanTimezone = timezone => {
|
|
191
|
+
switch (timezone) {
|
|
192
|
+
case 'default':
|
|
193
|
+
{
|
|
194
|
+
return undefined;
|
|
195
|
+
}
|
|
196
|
+
case 'system':
|
|
197
|
+
{
|
|
198
|
+
return defaultDayjs.tz.guess();
|
|
199
|
+
}
|
|
200
|
+
default:
|
|
201
|
+
{
|
|
202
|
+
return timezone;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
};
|
|
191
206
|
this.createSystemDate = value => {
|
|
192
207
|
// TODO v7: Stop using `this.rawDayJsInstance` (drop the `instance` param on the adapters)
|
|
193
208
|
/* istanbul ignore next */
|
|
@@ -236,6 +251,28 @@ export class AdapterDayjs {
|
|
|
236
251
|
}
|
|
237
252
|
return localeObject.formats;
|
|
238
253
|
};
|
|
254
|
+
/**
|
|
255
|
+
* If the new day does not have the same offset as the old one (when switching to summer day time for example),
|
|
256
|
+
* Then dayjs will not automatically adjust the offset (moment does).
|
|
257
|
+
* We have to parse again the value to make sure the `fixOffset` method is applied.
|
|
258
|
+
* See https://github.com/iamkun/dayjs/blob/b3624de619d6e734cd0ffdbbd3502185041c1b60/src/plugin/timezone/index.js#L72
|
|
259
|
+
*/
|
|
260
|
+
this.adjustOffset = value => {
|
|
261
|
+
if (!this.hasTimezonePlugin()) {
|
|
262
|
+
return value;
|
|
263
|
+
}
|
|
264
|
+
const timezone = this.getTimezone(value);
|
|
265
|
+
if (timezone !== 'UTC') {
|
|
266
|
+
var _fixedValue$$offset, _value$$offset;
|
|
267
|
+
const fixedValue = value.tz(this.cleanTimezone(timezone), true);
|
|
268
|
+
// @ts-ignore
|
|
269
|
+
if (((_fixedValue$$offset = fixedValue.$offset) != null ? _fixedValue$$offset : 0) === ((_value$$offset = value.$offset) != null ? _value$$offset : 0)) {
|
|
270
|
+
return value;
|
|
271
|
+
}
|
|
272
|
+
return fixedValue;
|
|
273
|
+
}
|
|
274
|
+
return value;
|
|
275
|
+
};
|
|
239
276
|
this.date = value => {
|
|
240
277
|
if (value === null) {
|
|
241
278
|
return null;
|
|
@@ -404,49 +441,49 @@ export class AdapterDayjs {
|
|
|
404
441
|
return value >= start && value <= end;
|
|
405
442
|
};
|
|
406
443
|
this.startOfYear = value => {
|
|
407
|
-
return value.startOf('year');
|
|
444
|
+
return this.adjustOffset(value.startOf('year'));
|
|
408
445
|
};
|
|
409
446
|
this.startOfMonth = value => {
|
|
410
|
-
return value.startOf('month');
|
|
447
|
+
return this.adjustOffset(value.startOf('month'));
|
|
411
448
|
};
|
|
412
449
|
this.startOfWeek = value => {
|
|
413
|
-
return value.startOf('week');
|
|
450
|
+
return this.adjustOffset(value.startOf('week'));
|
|
414
451
|
};
|
|
415
452
|
this.startOfDay = value => {
|
|
416
|
-
return value.startOf('day');
|
|
453
|
+
return this.adjustOffset(value.startOf('day'));
|
|
417
454
|
};
|
|
418
455
|
this.endOfYear = value => {
|
|
419
|
-
return value.endOf('year');
|
|
456
|
+
return this.adjustOffset(value.endOf('year'));
|
|
420
457
|
};
|
|
421
458
|
this.endOfMonth = value => {
|
|
422
|
-
return value.endOf('month');
|
|
459
|
+
return this.adjustOffset(value.endOf('month'));
|
|
423
460
|
};
|
|
424
461
|
this.endOfWeek = value => {
|
|
425
|
-
return value.endOf('week');
|
|
462
|
+
return this.adjustOffset(value.endOf('week'));
|
|
426
463
|
};
|
|
427
464
|
this.endOfDay = value => {
|
|
428
|
-
return value.endOf('day');
|
|
465
|
+
return this.adjustOffset(value.endOf('day'));
|
|
429
466
|
};
|
|
430
467
|
this.addYears = (value, amount) => {
|
|
431
|
-
return amount < 0 ? value.subtract(Math.abs(amount), 'year') : value.add(amount, 'year');
|
|
468
|
+
return this.adjustOffset(amount < 0 ? value.subtract(Math.abs(amount), 'year') : value.add(amount, 'year'));
|
|
432
469
|
};
|
|
433
470
|
this.addMonths = (value, amount) => {
|
|
434
|
-
return amount < 0 ? value.subtract(Math.abs(amount), 'month') : value.add(amount, 'month');
|
|
471
|
+
return this.adjustOffset(amount < 0 ? value.subtract(Math.abs(amount), 'month') : value.add(amount, 'month'));
|
|
435
472
|
};
|
|
436
473
|
this.addWeeks = (value, amount) => {
|
|
437
|
-
return amount < 0 ? value.subtract(Math.abs(amount), 'week') : value.add(amount, 'week');
|
|
474
|
+
return this.adjustOffset(amount < 0 ? value.subtract(Math.abs(amount), 'week') : value.add(amount, 'week'));
|
|
438
475
|
};
|
|
439
476
|
this.addDays = (value, amount) => {
|
|
440
|
-
return amount < 0 ? value.subtract(Math.abs(amount), 'day') : value.add(amount, 'day');
|
|
477
|
+
return this.adjustOffset(amount < 0 ? value.subtract(Math.abs(amount), 'day') : value.add(amount, 'day'));
|
|
441
478
|
};
|
|
442
479
|
this.addHours = (value, amount) => {
|
|
443
|
-
return amount < 0 ? value.subtract(Math.abs(amount), 'hour') : value.add(amount, 'hour');
|
|
480
|
+
return this.adjustOffset(amount < 0 ? value.subtract(Math.abs(amount), 'hour') : value.add(amount, 'hour'));
|
|
444
481
|
};
|
|
445
482
|
this.addMinutes = (value, amount) => {
|
|
446
|
-
return amount < 0 ? value.subtract(Math.abs(amount), 'minute') : value.add(amount, 'minute');
|
|
483
|
+
return this.adjustOffset(amount < 0 ? value.subtract(Math.abs(amount), 'minute') : value.add(amount, 'minute'));
|
|
447
484
|
};
|
|
448
485
|
this.addSeconds = (value, amount) => {
|
|
449
|
-
return amount < 0 ? value.subtract(Math.abs(amount), 'second') : value.add(amount, 'second');
|
|
486
|
+
return this.adjustOffset(amount < 0 ? value.subtract(Math.abs(amount), 'second') : value.add(amount, 'second'));
|
|
450
487
|
};
|
|
451
488
|
this.getYear = value => {
|
|
452
489
|
return value.year();
|
|
@@ -470,34 +507,34 @@ export class AdapterDayjs {
|
|
|
470
507
|
return value.millisecond();
|
|
471
508
|
};
|
|
472
509
|
this.setYear = (value, year) => {
|
|
473
|
-
return value.set('year', year);
|
|
510
|
+
return this.adjustOffset(value.set('year', year));
|
|
474
511
|
};
|
|
475
512
|
this.setMonth = (value, month) => {
|
|
476
|
-
return value.set('month', month);
|
|
513
|
+
return this.adjustOffset(value.set('month', month));
|
|
477
514
|
};
|
|
478
515
|
this.setDate = (value, date) => {
|
|
479
|
-
return value.set('date', date);
|
|
516
|
+
return this.adjustOffset(value.set('date', date));
|
|
480
517
|
};
|
|
481
518
|
this.setHours = (value, hours) => {
|
|
482
|
-
return value.set('hour', hours);
|
|
519
|
+
return this.adjustOffset(value.set('hour', hours));
|
|
483
520
|
};
|
|
484
521
|
this.setMinutes = (value, minutes) => {
|
|
485
|
-
return value.set('minute', minutes);
|
|
522
|
+
return this.adjustOffset(value.set('minute', minutes));
|
|
486
523
|
};
|
|
487
524
|
this.setSeconds = (value, seconds) => {
|
|
488
|
-
return value.set('second', seconds);
|
|
525
|
+
return this.adjustOffset(value.set('second', seconds));
|
|
489
526
|
};
|
|
490
527
|
this.setMilliseconds = (value, milliseconds) => {
|
|
491
|
-
return value.set('millisecond', milliseconds);
|
|
528
|
+
return this.adjustOffset(value.set('millisecond', milliseconds));
|
|
492
529
|
};
|
|
493
530
|
this.getDaysInMonth = value => {
|
|
494
531
|
return value.daysInMonth();
|
|
495
532
|
};
|
|
496
533
|
this.getNextMonth = value => {
|
|
497
|
-
return
|
|
534
|
+
return this.addMonths(value, 1);
|
|
498
535
|
};
|
|
499
536
|
this.getPreviousMonth = value => {
|
|
500
|
-
return
|
|
537
|
+
return this.addMonths(value, -1);
|
|
501
538
|
};
|
|
502
539
|
this.getMonthArray = value => {
|
|
503
540
|
const firstMonth = value.startOf('year');
|
|
@@ -513,10 +550,9 @@ export class AdapterDayjs {
|
|
|
513
550
|
};
|
|
514
551
|
this.getWeekdays = () => {
|
|
515
552
|
const start = this.dayjs().startOf('week');
|
|
516
|
-
return [0, 1, 2, 3, 4, 5, 6].map(diff => this.formatByString(
|
|
553
|
+
return [0, 1, 2, 3, 4, 5, 6].map(diff => this.formatByString(this.addDays(start, diff), 'dd'));
|
|
517
554
|
};
|
|
518
555
|
this.getWeekArray = value => {
|
|
519
|
-
const timezone = this.getTimezone(value);
|
|
520
556
|
const cleanValue = this.setLocaleToValue(value);
|
|
521
557
|
const start = cleanValue.startOf('month').startOf('week');
|
|
522
558
|
const end = cleanValue.endOf('month').endOf('week');
|
|
@@ -527,15 +563,7 @@ export class AdapterDayjs {
|
|
|
527
563
|
const weekNumber = Math.floor(count / 7);
|
|
528
564
|
nestedWeeks[weekNumber] = nestedWeeks[weekNumber] || [];
|
|
529
565
|
nestedWeeks[weekNumber].push(current);
|
|
530
|
-
current =
|
|
531
|
-
|
|
532
|
-
// If the new day does not have the same offset as the old one (when switching to summer day time for example),
|
|
533
|
-
// Then dayjs will not automatically adjust the offset (moment does)
|
|
534
|
-
// We have to parse again the value to make sure the `fixOffset` method is applied
|
|
535
|
-
// See https://github.com/iamkun/dayjs/blob/b3624de619d6e734cd0ffdbbd3502185041c1b60/src/plugin/timezone/index.js#L72
|
|
536
|
-
if (this.hasTimezonePlugin() && timezone !== 'UTC' && timezone !== 'system') {
|
|
537
|
-
current = current.tz(this.cleanTimezone(timezone), true);
|
|
538
|
-
}
|
|
566
|
+
current = this.addDays(current, 1);
|
|
539
567
|
count += 1;
|
|
540
568
|
}
|
|
541
569
|
return nestedWeeks;
|
|
@@ -550,7 +578,7 @@ export class AdapterDayjs {
|
|
|
550
578
|
let current = startDate;
|
|
551
579
|
while (current < endDate) {
|
|
552
580
|
years.push(current);
|
|
553
|
-
current =
|
|
581
|
+
current = this.addYears(current, 1);
|
|
554
582
|
}
|
|
555
583
|
return years;
|
|
556
584
|
};
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,98 @@
|
|
|
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.11.0
|
|
7
|
+
|
|
8
|
+
_Aug 4, 2023_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 12 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- ⌚️ Move the tree view component from `@mui/lab` package
|
|
13
|
+
|
|
14
|
+
The `<TreeView />` component has been moved to the MUI X repository.
|
|
15
|
+
It is now accessible from its own package: `@mui/x-tree-view`.
|
|
16
|
+
|
|
17
|
+
- 🌍 Improve Hebrew (he-IL), Finnish (fi-FI), and Italian (it-IT) locales on the data grid
|
|
18
|
+
- 🐞 Bugfixes
|
|
19
|
+
- 📚 Documentation improvements
|
|
20
|
+
|
|
21
|
+
### Data Grid
|
|
22
|
+
|
|
23
|
+
#### `@mui/x-data-grid@v6.11.0`
|
|
24
|
+
|
|
25
|
+
- [DataGrid] Add `ariaV7` experimental flag (#9496) @cherniavskii
|
|
26
|
+
- [DataGrid] Fix cell size when column width is set to `undefined` (#9871) @gitstart
|
|
27
|
+
- [l10n] Improve Hebrew (he-IL) locale (#9820) @itayG98
|
|
28
|
+
- [l10n] Improve Finnish (fi-FI) locale (#9848) @sambbaahh
|
|
29
|
+
- [l10n] Improve Italian (it-IT) locale (#9627) @fabio-rizzello-omnia
|
|
30
|
+
|
|
31
|
+
#### `@mui/x-data-grid-pro@v6.11.0` [](https://mui.com/r/x-pro-svg-link)
|
|
32
|
+
|
|
33
|
+
Same changes as in `@mui/x-data-grid@v6.11.0`.
|
|
34
|
+
|
|
35
|
+
#### `@mui/x-data-grid-premium@v6.11.0` [](https://mui.com/r/x-premium-svg-link)
|
|
36
|
+
|
|
37
|
+
Same changes as in `@mui/x-data-grid-pro@v6.11.0`.
|
|
38
|
+
|
|
39
|
+
### Date Pickers
|
|
40
|
+
|
|
41
|
+
#### `@mui/x-date-pickers@v6.11.0`
|
|
42
|
+
|
|
43
|
+
- [fields] Correctly handle events with a complete value insertion (#9896) @LukasTy
|
|
44
|
+
- [fields] Fix hours editing on dayjs with timezone and DST (#9901) @flaviendelangle
|
|
45
|
+
- [fields] Fix section clearing with timezone (#9819) @flaviendelangle
|
|
46
|
+
- [pickers] Add `CalendarHeader` slot (#7784) @flaviendelangle
|
|
47
|
+
- [pickers] Allow to override the `InputProps` of the `TextField` using the `slotProps` (#9849) @flaviendelangle
|
|
48
|
+
- [pickers] Allow to override the opening aria text using the `localeText` prop on the pickers (#9870) @flaviendelangle
|
|
49
|
+
- [pickers] Fix `sx` and `className` props on `MobileDateRangePicker` (#9853) @flaviendelangle
|
|
50
|
+
- [pickers] Fix default descriptions (#9887) @LukasTy
|
|
51
|
+
- [pickers] Fix offset management on dayjs adapter (#9884) @flaviendelangle
|
|
52
|
+
- [pickers] Use device motion reduction preference (#9823) @LukasTy
|
|
53
|
+
|
|
54
|
+
#### `@mui/x-date-pickers-pro@v6.11.0` [](https://mui.com/r/x-pro-svg-link)
|
|
55
|
+
|
|
56
|
+
Same changes as in `@mui/x-date-pickers@v6.11.0`.
|
|
57
|
+
|
|
58
|
+
### Charts / `@mui/x-charts@v6.0.0-alpha.6`
|
|
59
|
+
|
|
60
|
+
- [charts] Add TS definition to the exported elements (#9885) @alexfauquette
|
|
61
|
+
- [charts] Add sparkline (#9662) @alexfauquette
|
|
62
|
+
- [charts] Fix missing configuration types (#9886) @alexfauquette
|
|
63
|
+
- [charts] Introduce dataset to simplify plot of data from API (#9774) @alexfauquette
|
|
64
|
+
|
|
65
|
+
### Tree View / `@mui/x-tree-view@v6.0.0-alpha.0`
|
|
66
|
+
|
|
67
|
+
- [TreeView] Add missing exported types (#9862) @flaviendelangle
|
|
68
|
+
- [TreeView] Add tree view to changelog generator script (#9903) @MBilalShafi
|
|
69
|
+
- [TreeView] Create the package on the X repository (#9798) @flaviendelangle
|
|
70
|
+
- [TreeView] Improve props typing (#9855) @flaviendelangle
|
|
71
|
+
|
|
72
|
+
### Docs
|
|
73
|
+
|
|
74
|
+
- [docs] Add Tree View doc (#9825) @flaviendelangle
|
|
75
|
+
- [docs] Add charts nav item (#9821) @LukasTy
|
|
76
|
+
- [docs] Add charts to MUI X introduction pages (#9704) @joserodolfofreitas
|
|
77
|
+
- [docs] Add example for avoiding picker views layout shift (#9781) @noraleonte
|
|
78
|
+
- [docs] Consistency of Next.js App Router @oliviertassinari
|
|
79
|
+
- [docs] Fix API page regression: bring back slots section (#9866) @alexfauquette
|
|
80
|
+
- [docs] Fix demo using Pro while it's MIT (#9842) @oliviertassinari
|
|
81
|
+
- [docs] Get ready for next docs-infra change @oliviertassinari
|
|
82
|
+
- [docs] Improve the slots documentation `Recommended usage` section (#9892) @flaviendelangle
|
|
83
|
+
|
|
84
|
+
### Core
|
|
85
|
+
|
|
86
|
+
- [core] Fix font loading issue dev-mode (#9843) @oliviertassinari
|
|
87
|
+
- [core] Fix pipeline (#9894) @LukasTy
|
|
88
|
+
- [core] Fix the link-check script on Windows (#9888) @alexfauquette
|
|
89
|
+
- [core] Fix v7 capitalization (#9878) @oliviertassinari
|
|
90
|
+
- [core] Regen doc (#9902) @flaviendelangle
|
|
91
|
+
- [core] Remove benchmark package (#9413) @LukasTy
|
|
92
|
+
- [core] Stop using the deprecated `JSX` global namespace (#9854) @flaviendelangle
|
|
93
|
+
- [core] Update monorepo (#9846) @flaviendelangle
|
|
94
|
+
- [core] Update tree data API docs (#9827) @cherniavskii
|
|
95
|
+
- [test] Add pickers e2e tests (#9747) @LukasTy
|
|
96
|
+
- [test] Data grid e2e tests follow-up (#9822) @cherniavskii
|
|
97
|
+
|
|
6
98
|
## 6.10.2
|
|
7
99
|
|
|
8
100
|
_Jul 27, 2023_
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { DateCalendarProps } from './DateCalendar.types';
|
|
3
|
-
type DateCalendarComponent = (<TDate>(props: DateCalendarProps<TDate> & React.RefAttributes<HTMLDivElement>) => JSX.Element) & {
|
|
3
|
+
type DateCalendarComponent = (<TDate>(props: DateCalendarProps<TDate> & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
|
|
4
4
|
propTypes?: any;
|
|
5
5
|
};
|
|
6
6
|
/**
|
|
@@ -4,6 +4,7 @@ const _excluded = ["autoFocus", "onViewChange", "value", "defaultValue", "refere
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
|
+
import { useSlotProps } from '@mui/base/utils';
|
|
7
8
|
import { styled, useThemeProps } from '@mui/material/styles';
|
|
8
9
|
import { unstable_composeClasses as composeClasses, unstable_useId as useId, unstable_useEventCallback as useEventCallback } from '@mui/utils';
|
|
9
10
|
import { useCalendarState } from './useCalendarState';
|
|
@@ -13,10 +14,10 @@ import { DayCalendar } from './DayCalendar';
|
|
|
13
14
|
import { MonthCalendar } from '../MonthCalendar';
|
|
14
15
|
import { YearCalendar } from '../YearCalendar';
|
|
15
16
|
import { useViews } from '../internals/hooks/useViews';
|
|
16
|
-
import { PickersCalendarHeader } from '
|
|
17
|
+
import { PickersCalendarHeader } from '../PickersCalendarHeader';
|
|
17
18
|
import { findClosestEnabledDate, applyDefaultDate, mergeDateAndTime } from '../internals/utils/date-utils';
|
|
18
19
|
import { PickerViewRoot } from '../internals/components/PickerViewRoot';
|
|
19
|
-
import {
|
|
20
|
+
import { useDefaultReduceAnimations } from '../internals/hooks/useDefaultReduceAnimations';
|
|
20
21
|
import { getDateCalendarUtilityClass } from './dateCalendarClasses';
|
|
21
22
|
import { useControlledValueWithTimezone } from '../internals/hooks/useValueWithTimezone';
|
|
22
23
|
import { singleItemValueManager } from '../internals/utils/valueManagers';
|
|
@@ -33,23 +34,24 @@ const useUtilityClasses = ownerState => {
|
|
|
33
34
|
return composeClasses(slots, getDateCalendarUtilityClass, classes);
|
|
34
35
|
};
|
|
35
36
|
function useDateCalendarDefaultizedProps(props, name) {
|
|
37
|
+
var _themeProps$loading, _themeProps$disablePa, _themeProps$disableFu, _themeProps$openTo, _themeProps$views, _themeProps$reduceAni, _themeProps$renderLoa;
|
|
36
38
|
const utils = useUtils();
|
|
37
39
|
const defaultDates = useDefaultDates();
|
|
40
|
+
const defaultReduceAnimations = useDefaultReduceAnimations();
|
|
38
41
|
const themeProps = useThemeProps({
|
|
39
42
|
props,
|
|
40
43
|
name
|
|
41
44
|
});
|
|
42
|
-
return _extends({
|
|
43
|
-
loading: false,
|
|
44
|
-
disablePast: false,
|
|
45
|
-
disableFuture: false,
|
|
46
|
-
openTo: 'day',
|
|
47
|
-
views: ['year', 'day'],
|
|
48
|
-
reduceAnimations: defaultReduceAnimations,
|
|
49
|
-
renderLoading: () => /*#__PURE__*/_jsx("span", {
|
|
45
|
+
return _extends({}, themeProps, {
|
|
46
|
+
loading: (_themeProps$loading = themeProps.loading) != null ? _themeProps$loading : false,
|
|
47
|
+
disablePast: (_themeProps$disablePa = themeProps.disablePast) != null ? _themeProps$disablePa : false,
|
|
48
|
+
disableFuture: (_themeProps$disableFu = themeProps.disableFuture) != null ? _themeProps$disableFu : false,
|
|
49
|
+
openTo: (_themeProps$openTo = themeProps.openTo) != null ? _themeProps$openTo : 'day',
|
|
50
|
+
views: (_themeProps$views = themeProps.views) != null ? _themeProps$views : ['year', 'day'],
|
|
51
|
+
reduceAnimations: (_themeProps$reduceAni = themeProps.reduceAnimations) != null ? _themeProps$reduceAni : defaultReduceAnimations,
|
|
52
|
+
renderLoading: (_themeProps$renderLoa = themeProps.renderLoading) != null ? _themeProps$renderLoa : () => /*#__PURE__*/_jsx("span", {
|
|
50
53
|
children: "..."
|
|
51
|
-
})
|
|
52
|
-
}, themeProps, {
|
|
54
|
+
}),
|
|
53
55
|
minDate: applyDefaultDate(utils, themeProps.minDate, defaultDates.minDate),
|
|
54
56
|
maxDate: applyDefaultDate(utils, themeProps.maxDate, defaultDates.maxDate)
|
|
55
57
|
});
|
|
@@ -78,6 +80,7 @@ const DateCalendarViewTransitionContainer = styled(PickersFadeTransitionGroup, {
|
|
|
78
80
|
* - [DateCalendar API](https://mui.com/x/api/date-pickers/date-calendar/)
|
|
79
81
|
*/
|
|
80
82
|
export const DateCalendar = /*#__PURE__*/React.forwardRef(function DateCalendar(inProps, ref) {
|
|
83
|
+
var _ref, _slots$calendarHeader, _slotProps$calendarHe;
|
|
81
84
|
const utils = useUtils();
|
|
82
85
|
const id = useId();
|
|
83
86
|
const props = useDateCalendarDefaultizedProps(inProps, 'MuiDateCalendar');
|
|
@@ -173,6 +176,38 @@ export const DateCalendar = /*#__PURE__*/React.forwardRef(function DateCalendar(
|
|
|
173
176
|
disableFuture,
|
|
174
177
|
timezone
|
|
175
178
|
});
|
|
179
|
+
|
|
180
|
+
// When disabled, limit the view to the selected date
|
|
181
|
+
const minDateWithDisabled = disabled && value || minDate;
|
|
182
|
+
const maxDateWithDisabled = disabled && value || maxDate;
|
|
183
|
+
const gridLabelId = `${id}-grid-label`;
|
|
184
|
+
const hasFocus = focusedView !== null;
|
|
185
|
+
const CalendarHeader = (_ref = (_slots$calendarHeader = slots == null ? void 0 : slots.calendarHeader) != null ? _slots$calendarHeader : components == null ? void 0 : components.CalendarHeader) != null ? _ref : PickersCalendarHeader;
|
|
186
|
+
const calendarHeaderProps = useSlotProps({
|
|
187
|
+
elementType: CalendarHeader,
|
|
188
|
+
externalSlotProps: (_slotProps$calendarHe = slotProps == null ? void 0 : slotProps.calendarHeader) != null ? _slotProps$calendarHe : componentsProps == null ? void 0 : componentsProps.calendarHeader,
|
|
189
|
+
additionalProps: {
|
|
190
|
+
views,
|
|
191
|
+
view,
|
|
192
|
+
currentMonth: calendarState.currentMonth,
|
|
193
|
+
onViewChange: setView,
|
|
194
|
+
onMonthChange: (newMonth, direction) => handleChangeMonth({
|
|
195
|
+
newMonth,
|
|
196
|
+
direction
|
|
197
|
+
}),
|
|
198
|
+
minDate: minDateWithDisabled,
|
|
199
|
+
maxDate: maxDateWithDisabled,
|
|
200
|
+
disabled,
|
|
201
|
+
disablePast,
|
|
202
|
+
disableFuture,
|
|
203
|
+
reduceAnimations,
|
|
204
|
+
timezone,
|
|
205
|
+
labelId: gridLabelId,
|
|
206
|
+
slots,
|
|
207
|
+
slotProps
|
|
208
|
+
},
|
|
209
|
+
ownerState: props
|
|
210
|
+
});
|
|
176
211
|
const handleDateMonthChange = useEventCallback(newDate => {
|
|
177
212
|
const startOfMonth = utils.startOfMonth(newDate);
|
|
178
213
|
const endOfMonth = utils.endOfMonth(newDate);
|
|
@@ -238,18 +273,12 @@ export const DateCalendar = /*#__PURE__*/React.forwardRef(function DateCalendar(
|
|
|
238
273
|
maxDate,
|
|
239
274
|
minDate
|
|
240
275
|
};
|
|
241
|
-
|
|
242
|
-
// When disabled, limit the view to the selected date
|
|
243
|
-
const minDateWithDisabled = disabled && value || minDate;
|
|
244
|
-
const maxDateWithDisabled = disabled && value || maxDate;
|
|
245
276
|
const commonViewProps = {
|
|
246
277
|
disableHighlightToday,
|
|
247
278
|
readOnly,
|
|
248
279
|
disabled,
|
|
249
280
|
timezone
|
|
250
281
|
};
|
|
251
|
-
const gridLabelId = `${id}-grid-label`;
|
|
252
|
-
const hasFocus = focusedView !== null;
|
|
253
282
|
const prevOpenViewRef = React.useRef(view);
|
|
254
283
|
React.useEffect(() => {
|
|
255
284
|
// If the view change and the focus was on the previous view
|
|
@@ -268,26 +297,7 @@ export const DateCalendar = /*#__PURE__*/React.forwardRef(function DateCalendar(
|
|
|
268
297
|
className: clsx(classes.root, className),
|
|
269
298
|
ownerState: ownerState
|
|
270
299
|
}, other, {
|
|
271
|
-
children: [/*#__PURE__*/_jsx(
|
|
272
|
-
views: views,
|
|
273
|
-
view: view,
|
|
274
|
-
currentMonth: calendarState.currentMonth,
|
|
275
|
-
onViewChange: setView,
|
|
276
|
-
onMonthChange: (newMonth, direction) => handleChangeMonth({
|
|
277
|
-
newMonth,
|
|
278
|
-
direction
|
|
279
|
-
}),
|
|
280
|
-
minDate: minDateWithDisabled,
|
|
281
|
-
maxDate: maxDateWithDisabled,
|
|
282
|
-
disabled: disabled,
|
|
283
|
-
disablePast: disablePast,
|
|
284
|
-
disableFuture: disableFuture,
|
|
285
|
-
reduceAnimations: reduceAnimations,
|
|
286
|
-
labelId: gridLabelId,
|
|
287
|
-
slots: slots,
|
|
288
|
-
slotProps: slotProps,
|
|
289
|
-
timezone: timezone
|
|
290
|
-
}), /*#__PURE__*/_jsx(DateCalendarViewTransitionContainer, {
|
|
300
|
+
children: [/*#__PURE__*/_jsx(CalendarHeader, _extends({}, calendarHeaderProps)), /*#__PURE__*/_jsx(DateCalendarViewTransitionContainer, {
|
|
291
301
|
reduceAnimations: reduceAnimations,
|
|
292
302
|
className: classes.viewTransitionContainer,
|
|
293
303
|
transKey: view,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { SxProps } from '@mui/system';
|
|
3
3
|
import { Theme } from '@mui/material/styles';
|
|
4
|
-
import {
|
|
4
|
+
import { SlotComponentProps } from '@mui/base/utils';
|
|
5
|
+
import { PickersCalendarHeader, PickersCalendarHeaderProps, PickersCalendarHeaderSlotsComponent, PickersCalendarHeaderSlotsComponentsProps } from '../PickersCalendarHeader';
|
|
5
6
|
import { DayCalendarSlotsComponent, DayCalendarSlotsComponentsProps, ExportedDayCalendarProps } from './DayCalendar';
|
|
6
7
|
import { DateCalendarClasses } from './dateCalendarClasses';
|
|
7
8
|
import { BaseDateValidationProps, YearValidationProps, MonthValidationProps, DayValidationProps } from '../internals/models/validation';
|
|
@@ -13,8 +14,15 @@ import { SlotsAndSlotProps } from '../internals/utils/slots-migration';
|
|
|
13
14
|
import { ExportedYearCalendarProps } from '../YearCalendar/YearCalendar.types';
|
|
14
15
|
import { ExportedMonthCalendarProps } from '../MonthCalendar/MonthCalendar.types';
|
|
15
16
|
export interface DateCalendarSlotsComponent<TDate> extends PickersCalendarHeaderSlotsComponent, DayCalendarSlotsComponent<TDate> {
|
|
17
|
+
/**
|
|
18
|
+
* Custom component for calendar header.
|
|
19
|
+
* Check the [PickersCalendarHeader](https://mui.com/x/api/date-pickers/pickers-calendar-header/) component.
|
|
20
|
+
* @default PickersCalendarHeader
|
|
21
|
+
*/
|
|
22
|
+
CalendarHeader?: React.ElementType<PickersCalendarHeaderProps<TDate>>;
|
|
16
23
|
}
|
|
17
24
|
export interface DateCalendarSlotsComponentsProps<TDate> extends PickersCalendarHeaderSlotsComponentsProps<TDate>, DayCalendarSlotsComponentsProps<TDate> {
|
|
25
|
+
calendarHeader?: SlotComponentProps<typeof PickersCalendarHeader, {}, DateCalendarProps<TDate>>;
|
|
18
26
|
}
|
|
19
27
|
export interface ExportedDateCalendarProps<TDate> extends ExportedDayCalendarProps, ExportedMonthCalendarProps, ExportedYearCalendarProps, BaseDateValidationProps<TDate>, DayValidationProps<TDate>, YearValidationProps<TDate>, MonthValidationProps<TDate>, TimezoneProps {
|
|
20
28
|
/**
|
package/DateCalendar/index.d.ts
CHANGED
|
@@ -4,11 +4,10 @@ export { getDateCalendarUtilityClass, dateCalendarClasses } from './dateCalendar
|
|
|
4
4
|
export type { DateCalendarClassKey, DateCalendarClasses } from './dateCalendarClasses';
|
|
5
5
|
export { dayPickerClasses } from './dayCalendarClasses';
|
|
6
6
|
export type { DayCalendarClassKey, DayCalendarClasses } from './dayCalendarClasses';
|
|
7
|
-
export { pickersCalendarHeaderClasses } from './pickersCalendarHeaderClasses';
|
|
8
|
-
export type { PickersCalendarHeaderClassKey, PickersCalendarHeaderClasses, } from './pickersCalendarHeaderClasses';
|
|
9
7
|
export type { PickersFadeTransitionGroupProps } from './PickersFadeTransitionGroup';
|
|
10
8
|
export { pickersFadeTransitionGroupClasses } from './pickersFadeTransitionGroupClasses';
|
|
11
9
|
export type { PickersFadeTransitionGroupClassKey, PickersFadeTransitionGroupClasses, } from './pickersFadeTransitionGroupClasses';
|
|
12
10
|
export { pickersSlideTransitionClasses } from './pickersSlideTransitionClasses';
|
|
13
11
|
export type { PickersSlideTransitionClassKey, PickersSlideTransitionClasses, } from './pickersSlideTransitionClasses';
|
|
14
12
|
export type { ExportedSlideTransitionProps } from './PickersSlideTransition';
|
|
13
|
+
export * from '../PickersCalendarHeader';
|
package/DateCalendar/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { DateCalendar } from './DateCalendar';
|
|
2
2
|
export { getDateCalendarUtilityClass, dateCalendarClasses } from './dateCalendarClasses';
|
|
3
3
|
export { dayPickerClasses } from './dayCalendarClasses';
|
|
4
|
-
export { pickersCalendarHeaderClasses } from './pickersCalendarHeaderClasses';
|
|
5
4
|
export { pickersFadeTransitionGroupClasses } from './pickersFadeTransitionGroupClasses';
|
|
6
|
-
export { pickersSlideTransitionClasses } from './pickersSlideTransitionClasses';
|
|
5
|
+
export { pickersSlideTransitionClasses } from './pickersSlideTransitionClasses';
|
|
6
|
+
// TODO v7: Remove and export the `PickersCalendarHeader` folder from the root instead.
|
|
7
|
+
export * from '../PickersCalendarHeader';
|
|
@@ -33,7 +33,7 @@ export declare const useCalendarState: <TDate extends unknown>(params: UseCalend
|
|
|
33
33
|
referenceDate: any;
|
|
34
34
|
calendarState: CalendarState<TDate>;
|
|
35
35
|
changeMonth: (newDate: TDate) => void;
|
|
36
|
-
changeFocusedDay: (newFocusedDate: TDate | null, withoutMonthSwitchingAnimation?: boolean
|
|
36
|
+
changeFocusedDay: (newFocusedDate: TDate | null, withoutMonthSwitchingAnimation?: boolean) => void;
|
|
37
37
|
isDateDisabled: (day: TDate | null) => boolean;
|
|
38
38
|
onMonthSwitchingAnimationEnd: () => void;
|
|
39
39
|
handleChangeMonth: (payload: ChangeMonthPayload<TDate>) => void;
|
package/DateField/DateField.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { DateFieldProps } from './DateField.types';
|
|
3
|
-
type DateFieldComponent = (<TDate>(props: DateFieldProps<TDate> & React.RefAttributes<HTMLDivElement>) => JSX.Element) & {
|
|
3
|
+
type DateFieldComponent = (<TDate>(props: DateFieldProps<TDate> & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
|
|
4
4
|
propTypes?: any;
|
|
5
5
|
};
|
|
6
6
|
declare const DateField: DateFieldComponent;
|
package/DateField/DateField.js
CHANGED
|
@@ -39,8 +39,8 @@ const DateField = /*#__PURE__*/React.forwardRef(function DateField(inProps, ref)
|
|
|
39
39
|
textFieldProps = _objectWithoutPropertiesLoose(_useSlotProps, _excluded2);
|
|
40
40
|
|
|
41
41
|
// TODO: Remove when mui/material-ui#35088 will be merged
|
|
42
|
-
textFieldProps.inputProps = _extends({},
|
|
43
|
-
textFieldProps.InputProps = _extends({},
|
|
42
|
+
textFieldProps.inputProps = _extends({}, inputProps, textFieldProps.inputProps);
|
|
43
|
+
textFieldProps.InputProps = _extends({}, InputProps, textFieldProps.InputProps);
|
|
44
44
|
const _useDateField = useDateField({
|
|
45
45
|
props: textFieldProps,
|
|
46
46
|
inputRef: externalInputRef
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { DatePickerProps } from './DatePicker.types';
|
|
3
|
-
type DatePickerComponent = (<TDate>(props: DatePickerProps<TDate> & React.RefAttributes<HTMLDivElement>) => JSX.Element) & {
|
|
3
|
+
type DatePickerComponent = (<TDate>(props: DatePickerProps<TDate> & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
|
|
4
4
|
propTypes?: any;
|
|
5
5
|
};
|
|
6
6
|
declare const DatePicker: DatePickerComponent;
|
|
@@ -9,7 +9,7 @@ export interface DatePickerToolbarProps<TDate> extends BaseToolbarProps<TDate |
|
|
|
9
9
|
}
|
|
10
10
|
export interface ExportedDatePickerToolbarProps extends ExportedBaseToolbarProps {
|
|
11
11
|
}
|
|
12
|
-
type DatePickerToolbarComponent = (<TDate>(props: DatePickerToolbarProps<TDate> & React.RefAttributes<HTMLDivElement>) => JSX.Element) & {
|
|
12
|
+
type DatePickerToolbarComponent = (<TDate>(props: DatePickerToolbarProps<TDate> & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
|
|
13
13
|
propTypes?: any;
|
|
14
14
|
};
|
|
15
15
|
declare const DatePickerToolbar: DatePickerToolbarComponent;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { DateTimeFieldProps } from './DateTimeField.types';
|
|
3
|
-
type DateTimeFieldComponent = (<TDate>(props: DateTimeFieldProps<TDate> & React.RefAttributes<HTMLDivElement>) => JSX.Element) & {
|
|
3
|
+
type DateTimeFieldComponent = (<TDate>(props: DateTimeFieldProps<TDate> & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
|
|
4
4
|
propTypes?: any;
|
|
5
5
|
};
|
|
6
6
|
declare const DateTimeField: DateTimeFieldComponent;
|
|
@@ -39,8 +39,8 @@ const DateTimeField = /*#__PURE__*/React.forwardRef(function DateTimeField(inPro
|
|
|
39
39
|
textFieldProps = _objectWithoutPropertiesLoose(_useSlotProps, _excluded2);
|
|
40
40
|
|
|
41
41
|
// TODO: Remove when mui/material-ui#35088 will be merged
|
|
42
|
-
textFieldProps.inputProps = _extends({},
|
|
43
|
-
textFieldProps.InputProps = _extends({},
|
|
42
|
+
textFieldProps.inputProps = _extends({}, inputProps, textFieldProps.inputProps);
|
|
43
|
+
textFieldProps.InputProps = _extends({}, InputProps, textFieldProps.InputProps);
|
|
44
44
|
const _useDateTimeField = useDateTimeField({
|
|
45
45
|
props: textFieldProps,
|
|
46
46
|
inputRef: externalInputRef
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { DateTimePickerProps } from './DateTimePicker.types';
|
|
3
|
-
type DateTimePickerComponent = (<TDate>(props: DateTimePickerProps<TDate> & React.RefAttributes<HTMLDivElement>) => JSX.Element) & {
|
|
3
|
+
type DateTimePickerComponent = (<TDate>(props: DateTimePickerProps<TDate> & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
|
|
4
4
|
propTypes?: any;
|
|
5
5
|
};
|
|
6
6
|
declare const DateTimePicker: DateTimePickerComponent;
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { Theme } from '@mui/material/styles';
|
|
3
3
|
import { SxProps } from '@mui/system';
|
|
4
4
|
import { DayCalendarSkeletonClasses } from './dayCalendarSkeletonClasses';
|
|
5
|
-
type HTMLDivProps = JSX.IntrinsicElements['div'];
|
|
5
|
+
type HTMLDivProps = React.JSX.IntrinsicElements['div'];
|
|
6
6
|
export interface DayCalendarSkeletonProps extends HTMLDivProps {
|
|
7
7
|
/**
|
|
8
8
|
* Override or extend the styles applied to the component.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { DesktopDatePickerProps } from './DesktopDatePicker.types';
|
|
3
|
-
type DesktopDatePickerComponent = (<TDate>(props: DesktopDatePickerProps<TDate> & React.RefAttributes<HTMLDivElement>) => JSX.Element) & {
|
|
3
|
+
type DesktopDatePickerComponent = (<TDate>(props: DesktopDatePickerProps<TDate> & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
|
|
4
4
|
propTypes?: any;
|
|
5
5
|
};
|
|
6
6
|
declare const DesktopDatePicker: DesktopDatePickerComponent;
|