@mui/x-date-pickers 6.0.2 → 6.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AdapterDateFns/index.js +1 -0
- package/AdapterDateFnsJalali/index.js +69 -0
- package/AdapterDayjs/index.js +5 -0
- package/AdapterLuxon/index.js +13 -3
- package/AdapterMoment/index.js +5 -0
- package/AdapterMomentHijri/index.js +5 -0
- package/AdapterMomentJalaali/index.js +5 -0
- package/CHANGELOG.md +119 -5
- package/DateCalendar/DateCalendar.types.d.ts +1 -1
- package/DateCalendar/PickersCalendarHeader.d.ts +1 -1
- package/DateCalendar/index.d.ts +0 -1
- package/DateField/DateField.js +4 -0
- package/DateField/DateField.types.d.ts +2 -2
- package/DateField/useDateField.js +5 -3
- package/DatePicker/DatePickerToolbar.d.ts +1 -1
- package/DatePicker/shared.d.ts +2 -2
- package/DateTimeField/DateTimeField.js +4 -0
- package/DateTimeField/DateTimeField.types.d.ts +2 -2
- package/DateTimeField/useDateTimeField.js +5 -3
- package/DateTimePicker/DateTimePickerTabs.d.ts +1 -1
- package/DateTimePicker/DateTimePickerToolbar.d.ts +1 -1
- package/DateTimePicker/shared.d.ts +1 -2
- package/DesktopDatePicker/DesktopDatePicker.types.d.ts +1 -1
- package/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +1 -1
- package/DesktopTimePicker/DesktopTimePicker.types.d.ts +1 -1
- package/MobileDatePicker/MobileDatePicker.types.d.ts +1 -1
- package/MobileDateTimePicker/MobileDateTimePicker.types.d.ts +1 -1
- package/MobileTimePicker/MobileTimePicker.types.d.ts +1 -1
- package/PickersDay/PickersDay.js +4 -4
- package/PickersLayout/PickersLayout.d.ts +1 -1
- package/PickersLayout/PickersLayout.types.d.ts +1 -1
- package/PickersLayout/index.d.ts +1 -1
- package/PickersLayout/usePickerLayout.d.ts +1 -1
- package/README.md +1 -1
- package/StaticDatePicker/StaticDatePicker.types.d.ts +2 -1
- package/StaticDateTimePicker/StaticDateTimePicker.types.d.ts +2 -1
- package/StaticTimePicker/StaticTimePicker.types.d.ts +2 -1
- package/TimeClock/Clock.d.ts +1 -1
- package/TimeClock/ClockPointer.d.ts +1 -1
- package/TimeClock/TimeClock.types.d.ts +1 -1
- package/TimeClock/index.d.ts +0 -1
- package/TimeField/TimeField.js +4 -0
- package/TimeField/TimeField.types.d.ts +2 -2
- package/TimeField/useTimeField.js +5 -3
- package/TimePicker/TimePickerToolbar.d.ts +1 -1
- package/TimePicker/shared.d.ts +1 -2
- package/dateViewRenderers/dateViewRenderers.d.ts +1 -1
- package/index.d.ts +1 -6
- package/index.js +4 -2
- package/internals/components/PickersToolbar.d.ts +1 -1
- package/internals/demo/DemoContainer.js +15 -7
- package/internals/hooks/useDesktopPicker/useDesktopPicker.d.ts +1 -1
- package/internals/hooks/useDesktopPicker/useDesktopPicker.types.d.ts +7 -7
- package/internals/hooks/useField/index.d.ts +2 -2
- package/internals/hooks/useField/index.js +1 -1
- package/internals/hooks/useField/useField.d.ts +3 -2
- package/internals/hooks/useField/useField.js +61 -30
- package/internals/hooks/useField/useField.types.d.ts +48 -116
- package/internals/hooks/useField/useField.utils.d.ts +7 -5
- package/internals/hooks/useField/useField.utils.js +68 -50
- package/internals/hooks/useField/useFieldCharacterEditing.d.ts +2 -1
- package/internals/hooks/useField/useFieldState.d.ts +4 -3
- package/internals/hooks/useField/useFieldState.js +86 -65
- package/internals/hooks/useIsLandscape.d.ts +1 -1
- package/internals/hooks/useMobilePicker/useMobilePicker.d.ts +1 -1
- package/internals/hooks/useMobilePicker/useMobilePicker.types.d.ts +7 -7
- package/internals/hooks/usePicker/usePicker.d.ts +2 -2
- package/internals/hooks/usePicker/usePicker.types.d.ts +4 -4
- package/internals/hooks/usePicker/usePickerLayoutProps.d.ts +1 -1
- package/internals/hooks/usePicker/usePickerValue.d.ts +9 -8
- package/internals/hooks/usePicker/usePickerValue.js +7 -11
- package/internals/hooks/usePicker/usePickerViews.d.ts +1 -1
- package/internals/hooks/useStaticPicker/useStaticPicker.d.ts +1 -1
- package/internals/hooks/useStaticPicker/useStaticPicker.types.d.ts +2 -2
- package/internals/hooks/useViews.d.ts +1 -1
- package/internals/hooks/useViews.js +8 -0
- package/internals/hooks/validation/models.d.ts +1 -1
- package/internals/hooks/validation/useDateTimeValidation.d.ts +3 -3
- package/internals/hooks/validation/useDateValidation.d.ts +2 -2
- package/internals/hooks/validation/useTimeValidation.d.ts +2 -2
- package/internals/index.d.ts +4 -8
- package/internals/index.js +2 -2
- package/internals/models/fields.d.ts +2 -20
- package/internals/models/index.d.ts +0 -1
- package/internals/models/index.js +0 -1
- package/internals/models/muiPickersAdapter.d.ts +1 -10
- package/internals/models/props/basePickerProps.d.ts +3 -3
- package/internals/models/props/tabs.d.ts +1 -1
- package/internals/models/props/toolbar.d.ts +1 -1
- package/internals/utils/date-utils.d.ts +1 -0
- package/internals/utils/date-utils.js +6 -0
- package/internals/utils/time-utils.d.ts +2 -1
- package/internals/utils/utils.d.ts +1 -1
- package/internals/utils/utils.js +3 -3
- package/internals/utils/validation.d.ts +1 -1
- package/internals/utils/valueManagers.d.ts +2 -4
- package/internals/utils/valueManagers.js +11 -12
- package/internals/utils/views.d.ts +1 -1
- package/legacy/AdapterDateFns/index.js +1 -0
- package/legacy/AdapterDateFnsJalali/index.js +69 -0
- package/legacy/AdapterDayjs/index.js +5 -0
- package/legacy/AdapterLuxon/index.js +13 -3
- package/legacy/AdapterMoment/index.js +5 -0
- package/legacy/AdapterMomentHijri/index.js +5 -0
- package/legacy/AdapterMomentJalaali/index.js +5 -0
- package/legacy/DateField/DateField.js +4 -0
- package/legacy/DateField/useDateField.js +4 -2
- package/legacy/DateTimeField/DateTimeField.js +4 -0
- package/legacy/DateTimeField/useDateTimeField.js +4 -2
- package/legacy/PickersDay/PickersDay.js +4 -4
- package/legacy/TimeField/TimeField.js +4 -0
- package/legacy/TimeField/useTimeField.js +4 -2
- package/legacy/index.js +4 -2
- package/legacy/internals/demo/DemoContainer.js +12 -6
- package/legacy/internals/hooks/useField/index.js +1 -1
- package/legacy/internals/hooks/useField/useField.js +86 -44
- package/legacy/internals/hooks/useField/useField.utils.js +76 -54
- package/legacy/internals/hooks/useField/useFieldState.js +92 -72
- package/legacy/internals/hooks/usePicker/usePickerValue.js +9 -13
- package/legacy/internals/hooks/useViews.js +10 -0
- package/legacy/internals/index.js +2 -2
- package/legacy/internals/models/index.js +0 -1
- package/legacy/internals/utils/date-utils.js +6 -0
- package/legacy/internals/utils/utils.js +3 -3
- package/legacy/internals/utils/valueManagers.js +12 -19
- package/legacy/locales/daDK.js +91 -0
- package/legacy/locales/faIR.js +33 -16
- package/legacy/locales/nbNO.js +12 -10
- package/legacy/locales/nlNL.js +12 -10
- package/legacy/locales/plPL.js +12 -10
- package/legacy/locales/svSE.js +12 -10
- package/legacy/models/index.js +3 -0
- package/legacy/tests/describeValue/testPickerOpenCloseLifeCycle.js +2 -3
- package/locales/daDK.d.ts +51 -0
- package/locales/daDK.js +59 -0
- package/locales/faIR.js +13 -16
- package/locales/nbNO.js +8 -10
- package/locales/nlNL.d.ts +4 -4
- package/locales/nlNL.js +8 -10
- package/locales/plPL.js +8 -10
- package/locales/svSE.js +8 -10
- package/locales/utils/pickersLocaleTextApi.d.ts +2 -1
- package/models/fields.d.ts +117 -0
- package/models/fields.js +1 -0
- package/models/index.d.ts +3 -0
- package/models/index.js +3 -0
- package/models/package.json +6 -0
- package/models/validation.d.ts +8 -0
- package/models/validation.js +1 -0
- package/models/views.js +1 -0
- package/modern/AdapterDateFns/index.js +1 -0
- package/modern/AdapterDateFnsJalali/index.js +69 -0
- package/modern/AdapterDayjs/index.js +5 -0
- package/modern/AdapterLuxon/index.js +13 -3
- package/modern/AdapterMoment/index.js +5 -0
- package/modern/AdapterMomentHijri/index.js +5 -0
- package/modern/AdapterMomentJalaali/index.js +5 -0
- package/modern/DateField/DateField.js +4 -0
- package/modern/DateField/useDateField.js +5 -3
- package/modern/DateTimeField/DateTimeField.js +4 -0
- package/modern/DateTimeField/useDateTimeField.js +5 -3
- package/modern/PickersDay/PickersDay.js +4 -4
- package/modern/TimeField/TimeField.js +4 -0
- package/modern/TimeField/useTimeField.js +5 -3
- package/modern/index.js +4 -2
- package/modern/internals/demo/DemoContainer.js +15 -7
- package/modern/internals/hooks/useField/index.js +1 -1
- package/modern/internals/hooks/useField/useField.js +59 -29
- package/modern/internals/hooks/useField/useField.utils.js +68 -50
- package/modern/internals/hooks/useField/useFieldState.js +86 -65
- package/modern/internals/hooks/usePicker/usePickerValue.js +7 -11
- package/modern/internals/hooks/useViews.js +8 -0
- package/modern/internals/index.js +2 -2
- package/modern/internals/models/index.js +0 -1
- package/modern/internals/utils/date-utils.js +6 -0
- package/modern/internals/utils/utils.js +3 -3
- package/modern/internals/utils/valueManagers.js +11 -12
- package/modern/locales/daDK.js +56 -0
- package/modern/locales/faIR.js +13 -16
- package/modern/locales/nbNO.js +8 -10
- package/modern/locales/nlNL.js +8 -10
- package/modern/locales/plPL.js +8 -10
- package/modern/locales/svSE.js +8 -10
- package/modern/models/fields.js +1 -0
- package/modern/models/index.js +3 -0
- package/modern/models/validation.js +1 -0
- package/modern/models/views.js +1 -0
- package/modern/tests/describeValue/testPickerOpenCloseLifeCycle.js +2 -3
- package/node/AdapterDateFns/index.js +1 -0
- package/node/AdapterDateFnsJalali/index.js +69 -0
- package/node/AdapterDayjs/index.js +5 -0
- package/node/AdapterLuxon/index.js +13 -3
- package/node/AdapterMoment/index.js +5 -0
- package/node/AdapterMomentHijri/index.js +5 -0
- package/node/AdapterMomentJalaali/index.js +5 -0
- package/node/DateField/DateField.js +4 -0
- package/node/DateField/useDateField.js +5 -3
- package/node/DateTimeField/DateTimeField.js +4 -0
- package/node/DateTimeField/useDateTimeField.js +5 -3
- package/node/PickersDay/PickersDay.js +4 -4
- package/node/TimeField/TimeField.js +4 -0
- package/node/TimeField/useTimeField.js +5 -3
- package/node/index.js +14 -2
- package/node/internals/demo/DemoContainer.js +15 -7
- package/node/internals/hooks/useField/index.js +0 -6
- package/node/internals/hooks/useField/useField.js +58 -28
- package/node/internals/hooks/useField/useField.utils.js +71 -52
- package/node/internals/hooks/useField/useFieldState.js +85 -64
- package/node/internals/hooks/usePicker/usePickerValue.js +7 -11
- package/node/internals/hooks/useViews.js +8 -0
- package/node/internals/index.js +6 -12
- package/node/internals/models/index.js +0 -11
- package/node/internals/utils/date-utils.js +9 -2
- package/node/internals/utils/utils.js +3 -3
- package/node/internals/utils/valueManagers.js +9 -10
- package/node/locales/daDK.js +62 -0
- package/node/locales/faIR.js +13 -16
- package/node/locales/nbNO.js +8 -10
- package/node/locales/nlNL.js +8 -10
- package/node/locales/plPL.js +8 -10
- package/node/locales/svSE.js +8 -10
- package/node/models/index.js +38 -0
- package/node/models/validation.js +5 -0
- package/node/models/views.js +5 -0
- package/node/tests/describeValue/testPickerOpenCloseLifeCycle.js +2 -3
- package/package.json +2 -2
- package/tests/describeValue/testPickerOpenCloseLifeCycle.js +2 -3
- package/themeAugmentation/props.d.ts +1 -1
- package/timeViewRenderers/timeViewRenderers.d.ts +1 -1
- /package/{internals/models/views.js → legacy/models/fields.js} +0 -0
- /package/legacy/{internals/models/views.js → models/validation.js} +0 -0
- /package/{modern/internals → legacy}/models/views.js +0 -0
- /package/{internals/models → models}/views.d.ts +0 -0
- /package/node/{internals/models/views.js → models/fields.js} +0 -0
package/AdapterDateFns/index.js
CHANGED
|
@@ -136,6 +136,7 @@ export class AdapterDateFns extends BaseAdapterDateFns {
|
|
|
136
136
|
return token;
|
|
137
137
|
}).join('');
|
|
138
138
|
};
|
|
139
|
+
// Redefined here just to show how it can be written using expandFormat
|
|
139
140
|
this.getFormatHelperText = format => {
|
|
140
141
|
return this.expandFormat(format).replace(/(aaa|aa|a)/g, '(a|p)m').toLocaleLowerCase();
|
|
141
142
|
};
|
|
@@ -31,6 +31,74 @@ const formatTokenMap = {
|
|
|
31
31
|
// Day of the month
|
|
32
32
|
d: 'day',
|
|
33
33
|
dd: 'day',
|
|
34
|
+
do: 'day',
|
|
35
|
+
// Day of the week
|
|
36
|
+
E: {
|
|
37
|
+
sectionType: 'weekDay',
|
|
38
|
+
contentType: 'letter'
|
|
39
|
+
},
|
|
40
|
+
EE: {
|
|
41
|
+
sectionType: 'weekDay',
|
|
42
|
+
contentType: 'letter'
|
|
43
|
+
},
|
|
44
|
+
EEE: {
|
|
45
|
+
sectionType: 'weekDay',
|
|
46
|
+
contentType: 'letter'
|
|
47
|
+
},
|
|
48
|
+
EEEE: {
|
|
49
|
+
sectionType: 'weekDay',
|
|
50
|
+
contentType: 'letter'
|
|
51
|
+
},
|
|
52
|
+
EEEEE: {
|
|
53
|
+
sectionType: 'weekDay',
|
|
54
|
+
contentType: 'letter'
|
|
55
|
+
},
|
|
56
|
+
i: 'weekDay',
|
|
57
|
+
ii: 'weekDay',
|
|
58
|
+
iii: {
|
|
59
|
+
sectionType: 'weekDay',
|
|
60
|
+
contentType: 'letter'
|
|
61
|
+
},
|
|
62
|
+
iiii: {
|
|
63
|
+
sectionType: 'weekDay',
|
|
64
|
+
contentType: 'letter'
|
|
65
|
+
},
|
|
66
|
+
e: 'weekDay',
|
|
67
|
+
ee: 'weekDay',
|
|
68
|
+
eee: {
|
|
69
|
+
sectionType: 'weekDay',
|
|
70
|
+
contentType: 'letter'
|
|
71
|
+
},
|
|
72
|
+
eeee: {
|
|
73
|
+
sectionType: 'weekDay',
|
|
74
|
+
contentType: 'letter'
|
|
75
|
+
},
|
|
76
|
+
eeeee: {
|
|
77
|
+
sectionType: 'weekDay',
|
|
78
|
+
contentType: 'letter'
|
|
79
|
+
},
|
|
80
|
+
eeeeee: {
|
|
81
|
+
sectionType: 'weekDay',
|
|
82
|
+
contentType: 'letter'
|
|
83
|
+
},
|
|
84
|
+
c: 'weekDay',
|
|
85
|
+
cc: 'weekDay',
|
|
86
|
+
ccc: {
|
|
87
|
+
sectionType: 'weekDay',
|
|
88
|
+
contentType: 'letter'
|
|
89
|
+
},
|
|
90
|
+
cccc: {
|
|
91
|
+
sectionType: 'weekDay',
|
|
92
|
+
contentType: 'letter'
|
|
93
|
+
},
|
|
94
|
+
ccccc: {
|
|
95
|
+
sectionType: 'weekDay',
|
|
96
|
+
contentType: 'letter'
|
|
97
|
+
},
|
|
98
|
+
cccccc: {
|
|
99
|
+
sectionType: 'weekDay',
|
|
100
|
+
contentType: 'letter'
|
|
101
|
+
},
|
|
34
102
|
// Meridiem
|
|
35
103
|
a: 'meridiem',
|
|
36
104
|
aa: 'meridiem',
|
|
@@ -68,6 +136,7 @@ export class AdapterDateFnsJalali extends BaseAdapterDateFnsJalali {
|
|
|
68
136
|
return token;
|
|
69
137
|
}).join('');
|
|
70
138
|
};
|
|
139
|
+
// Redefined here just to show how it can be written using expandFormat
|
|
71
140
|
this.getFormatHelperText = format => {
|
|
72
141
|
return this.expandFormat(format).replace(/(aaa|aa|a)/g, '(a|p)m').toLocaleLowerCase();
|
|
73
142
|
};
|
package/AdapterDayjs/index.js
CHANGED
|
@@ -76,6 +76,10 @@ export class AdapterDayjs extends BaseAdapterDayjs {
|
|
|
76
76
|
/* istanbul ignore next */
|
|
77
77
|
return /A|a/.test(this.getLocaleFormats().LT || '');
|
|
78
78
|
};
|
|
79
|
+
/**
|
|
80
|
+
* The current getFormatHelperText method uses an outdated format parsing logic.
|
|
81
|
+
* We should use this one in the future to support all localized formats.
|
|
82
|
+
*/
|
|
79
83
|
this.expandFormat = format => {
|
|
80
84
|
const localeFormats = this.getLocaleFormats();
|
|
81
85
|
|
|
@@ -86,6 +90,7 @@ export class AdapterDayjs extends BaseAdapterDayjs {
|
|
|
86
90
|
return a || localeFormats[b] || t(localeFormats[B]);
|
|
87
91
|
});
|
|
88
92
|
};
|
|
93
|
+
// Redefined here just to show how it can be written using expandFormat
|
|
89
94
|
this.getFormatHelperText = format => {
|
|
90
95
|
return this.expandFormat(format).replace(/a/gi, '(a|p)m').toLocaleLowerCase();
|
|
91
96
|
};
|
package/AdapterLuxon/index.js
CHANGED
|
@@ -84,13 +84,23 @@ export class AdapterLuxon extends BaseAdapterLuxon {
|
|
|
84
84
|
if (!DateTime.expandFormat) {
|
|
85
85
|
throw Error('Your luxon version does not support `expandFormat`. Consider upgrading it to v3.0.2');
|
|
86
86
|
}
|
|
87
|
+
// Extract escaped section to avoid entending them
|
|
88
|
+
const longFormatRegexp = /''|'(''|[^'])+('|$)|[^']*/g;
|
|
89
|
+
return format.match(longFormatRegexp).map(token => {
|
|
90
|
+
const firstCharacter = token[0];
|
|
91
|
+
if (firstCharacter === "'") {
|
|
92
|
+
return token;
|
|
93
|
+
}
|
|
94
|
+
return DateTime.expandFormat(token, {
|
|
95
|
+
locale: this.locale
|
|
96
|
+
});
|
|
97
|
+
}).join('')
|
|
87
98
|
// The returned format can contain `yyyyy` which means year between 4 and 6 digits.
|
|
88
99
|
// This value is supported by luxon parser but not luxon formatter.
|
|
89
100
|
// To avoid conflicts, we replace it by 4 digits which is enough for most use-cases.
|
|
90
|
-
|
|
91
|
-
locale: this.locale
|
|
92
|
-
}).replace('yyyyy', 'yyyy');
|
|
101
|
+
.replace('yyyyy', 'yyyy');
|
|
93
102
|
};
|
|
103
|
+
// Redefined here just to show how it can be written using expandFormat
|
|
94
104
|
this.getFormatHelperText = format => {
|
|
95
105
|
return this.expandFormat(format).replace(/(a)/g, '(a|p)m').toLocaleLowerCase();
|
|
96
106
|
};
|
package/AdapterMoment/index.js
CHANGED
|
@@ -64,6 +64,10 @@ export class AdapterMoment extends BaseAdapterMoment {
|
|
|
64
64
|
start: '[',
|
|
65
65
|
end: ']'
|
|
66
66
|
};
|
|
67
|
+
/**
|
|
68
|
+
* The current getFormatHelperText method uses an outdated format parsing logic.
|
|
69
|
+
* We should use this one in the future to support all localized formats.
|
|
70
|
+
*/
|
|
67
71
|
this.expandFormat = format => {
|
|
68
72
|
// @see https://github.com/moment/moment/blob/develop/src/lib/format/format.js#L6
|
|
69
73
|
const localFormattingTokens = /(\[[^[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})|./g;
|
|
@@ -78,6 +82,7 @@ export class AdapterMoment extends BaseAdapterMoment {
|
|
|
78
82
|
this.getCurrentLocaleCode = () => {
|
|
79
83
|
return this.locale || defaultMoment.locale();
|
|
80
84
|
};
|
|
85
|
+
// Redefined here just to show how it can be written using expandFormat
|
|
81
86
|
this.getFormatHelperText = format => {
|
|
82
87
|
return this.expandFormat(format).replace(/a/gi, '(a|p)m').toLocaleLowerCase();
|
|
83
88
|
};
|
|
@@ -48,6 +48,10 @@ export class AdapterMomentHijri extends BaseAdapterMomentHijri {
|
|
|
48
48
|
start: '[',
|
|
49
49
|
end: ']'
|
|
50
50
|
};
|
|
51
|
+
/**
|
|
52
|
+
* The current getFormatHelperText method uses an outdated format parsing logic.
|
|
53
|
+
* We should use this one in the future to support all localized formats.
|
|
54
|
+
*/
|
|
51
55
|
this.expandFormat = format => {
|
|
52
56
|
// @see https://github.com/moment/moment/blob/develop/src/lib/format/format.js#L6
|
|
53
57
|
const localFormattingTokens = /(\[[^[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})|./g;
|
|
@@ -59,6 +63,7 @@ export class AdapterMomentHijri extends BaseAdapterMomentHijri {
|
|
|
59
63
|
return token;
|
|
60
64
|
}).join('').replace('dd', 'iDD'); // Fix for https://github.com/dmtrKovalenko/date-io/pull/632
|
|
61
65
|
};
|
|
66
|
+
// Redefined here just to show how it can be written using expandFormat
|
|
62
67
|
this.getFormatHelperText = format => {
|
|
63
68
|
return this.expandFormat(format).replace(/a/gi, '(a|p)m').replace('iY', 'Y').replace('iM', 'M').replace('iD', 'D').toLocaleLowerCase();
|
|
64
69
|
};
|
|
@@ -45,6 +45,10 @@ export class AdapterMomentJalaali extends BaseAdapterMomentJalaali {
|
|
|
45
45
|
start: '[',
|
|
46
46
|
end: ']'
|
|
47
47
|
};
|
|
48
|
+
/**
|
|
49
|
+
* The current getFormatHelperText method uses an outdated format parsing logic.
|
|
50
|
+
* We should use this one in the future to support all localized formats.
|
|
51
|
+
*/
|
|
48
52
|
this.expandFormat = format => {
|
|
49
53
|
// @see https://github.com/moment/moment/blob/develop/src/lib/format/format.js#L6
|
|
50
54
|
const localFormattingTokens = /(\[[^[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})|./g;
|
|
@@ -56,6 +60,7 @@ export class AdapterMomentJalaali extends BaseAdapterMomentJalaali {
|
|
|
56
60
|
return token;
|
|
57
61
|
}).join('').replace('dd', 'jDD'); // Fix for https://github.com/dmtrKovalenko/date-io/pull/632;
|
|
58
62
|
};
|
|
63
|
+
// Redefined here just to show how it can be written using expandFormat
|
|
59
64
|
this.getFormatHelperText = format => {
|
|
60
65
|
return this.expandFormat(format).replace(/a/gi, '(a|p)m').replace('jY', 'Y').replace('jM', 'M').replace('jD', 'D').toLocaleLowerCase();
|
|
61
66
|
};
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,121 @@
|
|
|
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.0.4
|
|
7
|
+
|
|
8
|
+
_Mar 30, 2023_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 9 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🌍 Add Danish (da-DK), and improve Norwegian (nb-NO), Spanish (es-ES), and Swedish (sv-SE) locales
|
|
13
|
+
- 🐞 Bugfixes
|
|
14
|
+
- 📚 Documentation improvements
|
|
15
|
+
|
|
16
|
+
### `@mui/x-data-grid@v6.0.4` / `@mui/x-data-grid-pro@v6.0.4` / `@mui/x-data-grid-premium@v6.0.4`
|
|
17
|
+
|
|
18
|
+
#### Changes
|
|
19
|
+
|
|
20
|
+
- [DataGrid] Fix column header tooltip not showing when the title is truncated (#8433) @rohitnatesh
|
|
21
|
+
- [DataGrid] Fix filter model buttons' display condition (#8415) @MBilalShafi
|
|
22
|
+
- [DataGrid] Fix infinite rerender in a flex parent (#8436) @cherniavskii
|
|
23
|
+
- [DataGrid] Prevent reopening column menu when clicking in the button while it is open (#8286) @tanuj-22
|
|
24
|
+
- [DataGrid] Rename `components` by `slots` in column menu API (#7999) @MBilalShafi
|
|
25
|
+
- [DataGrid] Remove hardcoded CSS classes' usages (#8444) @MBilalShafi
|
|
26
|
+
- [DataGridPremium] Fix aggregation initial state causing issue with quick filter (#8441) @MBilalShafi
|
|
27
|
+
- [l10n] Improve Danish (da-DK) locale (#8368) @BossElijah
|
|
28
|
+
- [l10n] Improve Danish (da-DK) locale (#8378) @BossElijah
|
|
29
|
+
- [l10n] Improve Norwegian (nb-NO) locale (#8367) @BossElijah
|
|
30
|
+
- [l10n] Improve Norwegian (nb-NO) locale (#8409) @BossElijah
|
|
31
|
+
- [l10n] Improve Spanish (es-ES) locale (#8420) @martjanz
|
|
32
|
+
- [l10n] Improve Swedish (sv-SE) locale (#8381) @BossElijah
|
|
33
|
+
|
|
34
|
+
### `@mui/x-date-pickers@v6.0.4` / `@mui/x-date-pickers-pro@v6.0.4`
|
|
35
|
+
|
|
36
|
+
#### Changes
|
|
37
|
+
|
|
38
|
+
- [fields] Add missing tokens to `AdapterDateFnsJalali` (#8402) @flaviendelangle
|
|
39
|
+
- [fields] Clean the active date manager (#8370) @flaviendelangle
|
|
40
|
+
- [fields] Cleanup `useFieldState` (#8292) @flaviendelangle
|
|
41
|
+
- [fields] Only add RTL characters when needed (#8325) @flaviendelangle
|
|
42
|
+
- [pickers] Add support for single input fields in range pickers (#7927) @flaviendelangle
|
|
43
|
+
- [pickers] Allows non token characters in format (#8256) @alexfauquette
|
|
44
|
+
- [pickers] Avoid root imports and move public models to the models folder (#8337) @flaviendelangle
|
|
45
|
+
- [pickers] Update `view` when `views` or `openTo` changes (#8361) @LukasTy
|
|
46
|
+
- [l10n] Improve Norwegian (nb-NO) locale (#8382) @BossElijah
|
|
47
|
+
- [l10n] Add Danish (da-DK) locale (#8379) @BossElijah
|
|
48
|
+
- [l10n] Improve Swedish (sv-SE) locale (#8381) @BossElijah
|
|
49
|
+
|
|
50
|
+
### `@mui/x-codemod@v6.0.4`
|
|
51
|
+
|
|
52
|
+
#### Changes
|
|
53
|
+
|
|
54
|
+
- [codemod] Fix `remove-stabilized-experimentalFeatures` codemod (#8289) @alexfauquette
|
|
55
|
+
|
|
56
|
+
### Docs
|
|
57
|
+
|
|
58
|
+
- [docs] Fix `GridCellParams` signature in migration guide (#8427) @cherniavskii
|
|
59
|
+
- [docs] Fix "Custom field" demos responsive styles (#8408) @LukasTy
|
|
60
|
+
- [docs] Remove `label` from demos where it reduces clarity (#8416) @LukasTy
|
|
61
|
+
- [docs] Update slots' references in Data Grid migration guide (#8159) @MBilalShafi
|
|
62
|
+
|
|
63
|
+
### Core
|
|
64
|
+
|
|
65
|
+
- [charts] Work on typing (#8421) @flaviendelangle
|
|
66
|
+
|
|
67
|
+
## 6.0.3
|
|
68
|
+
|
|
69
|
+
_Mar 23, 2023_
|
|
70
|
+
|
|
71
|
+
We'd like to offer a big thanks to the 11 contributors who made this release possible. Here are some highlights ✨:
|
|
72
|
+
|
|
73
|
+
- 🌍 Improve Bulgarian (bg-BG), Persian (fa-IR), Polish (pl-PL), and Dutch (nl-NL) locales
|
|
74
|
+
- 🐞 Bugfixes
|
|
75
|
+
- 📚 Documentation improvements
|
|
76
|
+
|
|
77
|
+
### `@mui/x-data-grid@v6.0.3` / `@mui/x-data-grid-pro@v6.0.3` / `@mui/x-data-grid-premium@v6.0.3`
|
|
78
|
+
|
|
79
|
+
#### Changes
|
|
80
|
+
|
|
81
|
+
- [DataGrid] Fix overflow calculation issue in column group headers (#8246) @MBilalShafi
|
|
82
|
+
- [DataGridPro] Fix column reorder glitches (#8335) @cherniavskii
|
|
83
|
+
- [l10n] Improve Bulgarian (bg-BG) locale (#8315) @todevmilen
|
|
84
|
+
- [l10n] Improve Persian (fa-IR) locale (#8268) @fakhamatia
|
|
85
|
+
- [l10n] improve Dutch (nl-NL) locale (#8317) @developenguin
|
|
86
|
+
|
|
87
|
+
### `@mui/x-date-pickers@v6.0.3` / `@mui/x-date-pickers-pro@v6.0.3`
|
|
88
|
+
|
|
89
|
+
#### Changes
|
|
90
|
+
|
|
91
|
+
- [fields] Allow to reset the value from the outside (#8287) @flaviendelangle
|
|
92
|
+
- [fields] Cleanup section order generation (#8290) @flaviendelangle
|
|
93
|
+
- [fields] Fix Safari input selection resetting regression (#8295) @LukasTy
|
|
94
|
+
- [fields] Fix editing when all sections are selected (#8330) @flaviendelangle
|
|
95
|
+
- [fields] Fix iOS browser scroll jumping when entering data (#8328) @LukasTy
|
|
96
|
+
- [fields] New prop `unstableFieldRef` to imperatively interact with the selected sections (#8235) @flaviendelangle
|
|
97
|
+
- [pickers] Align date calendar colors (#8318) @LukasTy
|
|
98
|
+
- [pickers] Support invalid dates from the field (#8298) @flaviendelangle
|
|
99
|
+
- [l10n] Improve Persian (fa-IR) locale (#8268) @fakhamatia
|
|
100
|
+
- [l10n] Improve Polish (pl-PL) locale (#8344) @drmats
|
|
101
|
+
- [l10n] improve Dutch (nl-NL) locale (#8317) @developenguin
|
|
102
|
+
|
|
103
|
+
### Docs
|
|
104
|
+
|
|
105
|
+
- [docs] Create examples of pickers with custom fields (#8034) @flaviendelangle
|
|
106
|
+
- [docs] Fix 301 redirections @oliviertassinari
|
|
107
|
+
- [docs] Fix link to React's docs @oliviertassinari
|
|
108
|
+
- [docs] Fix pro license links to point to the same page (#8303) @LukasTy
|
|
109
|
+
- [docs] Give an incentive to upgrade (#8269) @oliviertassinari
|
|
110
|
+
- [docs] Improve contrast on data grid navigation (#8239) @oliviertassinari
|
|
111
|
+
- [docs] Update shortcuts page to use slotProps (#8288) @dcorb
|
|
112
|
+
- [docs] Explain the `shouldDisableTime` migration in more depth (#8348) @LukasTy
|
|
113
|
+
|
|
114
|
+
### Core
|
|
115
|
+
|
|
116
|
+
- [core] Remove unused `visx` chart package (#8259) @LukasTy
|
|
117
|
+
- [core] Upgrade monorepo (#8331) @cherniavskii
|
|
118
|
+
- [charts] Project setup (#8308) @alexfauquette
|
|
119
|
+
- [test] Track visual regressions of column menu and filter/column panels (#8095) @cherniavskii
|
|
120
|
+
|
|
6
121
|
## 6.0.2
|
|
7
122
|
|
|
8
123
|
_Mar 16, 2023_
|
|
@@ -98,11 +213,9 @@ We'd like to offer a big thanks to the 8 contributors who made this release poss
|
|
|
98
213
|
|
|
99
214
|
_Mar 3, 2023_
|
|
100
215
|
|
|
101
|
-
We're
|
|
216
|
+
We're excited to [announce the first v6 stable release](https://mui.com/blog/mui-x-v6/)! 🎉🚀
|
|
102
217
|
|
|
103
218
|
This is now the officially supported major version, where we'll keep rolling out new features, bug fixes, and improvements.
|
|
104
|
-
Head over to the [what's new](https://mui.com/x/whats-new/) page to check the highlighted new features.
|
|
105
|
-
|
|
106
219
|
Migration guides are available with a complete list of the breaking changes:
|
|
107
220
|
|
|
108
221
|
- [Data Grid](https://mui.com/x/migration/migration-data-grid-v5/)
|
|
@@ -119,6 +232,7 @@ We'd like to offer a big thanks to the 12 contributors who made this release pos
|
|
|
119
232
|
- experimentalFeatures={{ rowPinning: true }}
|
|
120
233
|
/>
|
|
121
234
|
```
|
|
235
|
+
|
|
122
236
|
- ⚡️ Improved grid performance by rows and cells memoization (#7846) @m4theushw
|
|
123
237
|
- ✨ Fields have a distinct visual state when empty (#8069) @LukasTy
|
|
124
238
|
- 🌍 Improve Czech (cs-CZ) locale (#8113) @BlastyCZ
|
|
@@ -556,14 +670,14 @@ We'd like to offer a big thanks to the 10 contributors who made this release pos
|
|
|
556
670
|
```
|
|
557
671
|
|
|
558
672
|
- The `error` and `onError` props were removed - the grid no longer catches errors during rendering.
|
|
559
|
-
To catch errors that happen during rendering use the [error boundary](https://
|
|
673
|
+
To catch errors that happen during rendering use the [error boundary](https://react.dev/reference/react/Component#catching-rendering-errors-with-an-error-boundary).
|
|
560
674
|
|
|
561
675
|
- The `components.ErrorOverlay` slot was removed.
|
|
562
676
|
|
|
563
677
|
- The `GridErrorOverlay` component was removed.
|
|
564
678
|
|
|
565
679
|
- The `componentError` event was removed.
|
|
566
|
-
Use the [error boundary](https://
|
|
680
|
+
Use the [error boundary](https://react.dev/reference/react/Component#catching-rendering-errors-with-an-error-boundary) to catch errors thrown during rendering.
|
|
567
681
|
|
|
568
682
|
- The `apiRef.current.showError` method was removed.
|
|
569
683
|
The UI for errors is no longer handled by the grid.
|
|
@@ -7,7 +7,7 @@ import { DateCalendarClasses } from './dateCalendarClasses';
|
|
|
7
7
|
import { BaseDateValidationProps, YearValidationProps, MonthValidationProps, DayValidationProps } from '../internals/hooks/validation/models';
|
|
8
8
|
import { PickerSelectionState } from '../internals/hooks/usePicker/usePickerValue';
|
|
9
9
|
import { ExportedUseViewsOptions } from '../internals/hooks/useViews';
|
|
10
|
-
import { DateView } from '../
|
|
10
|
+
import { DateView } from '../models';
|
|
11
11
|
import { DefaultizedProps } from '../internals/models/helpers';
|
|
12
12
|
import { SlotsAndSlotProps } from '../internals/utils/slots-migration';
|
|
13
13
|
import { ExportedYearCalendarProps } from '../YearCalendar/YearCalendar.types';
|
|
@@ -5,7 +5,7 @@ import SvgIcon from '@mui/material/SvgIcon';
|
|
|
5
5
|
import { SlideDirection } from './PickersSlideTransition';
|
|
6
6
|
import { DateComponentValidationProps } from '../internals/hooks/validation/useDateValidation';
|
|
7
7
|
import { ExportedPickersArrowSwitcherProps, PickersArrowSwitcherSlotsComponent, PickersArrowSwitcherSlotsComponentsProps } from '../internals/components/PickersArrowSwitcher';
|
|
8
|
-
import { DateView } from '../
|
|
8
|
+
import { DateView } from '../models';
|
|
9
9
|
import { PickersCalendarHeaderClasses } from './pickersCalendarHeaderClasses';
|
|
10
10
|
import { UncapitalizeObjectKeys } from '../internals/utils/slots-migration';
|
|
11
11
|
export type ExportedCalendarHeaderProps<TDate> = Pick<PickersCalendarHeaderProps<TDate>, 'classes'>;
|
package/DateCalendar/index.d.ts
CHANGED
|
@@ -12,4 +12,3 @@ export type { PickersFadeTransitionGroupClassKey, PickersFadeTransitionGroupClas
|
|
|
12
12
|
export { pickersSlideTransitionClasses } from './pickersSlideTransitionClasses';
|
|
13
13
|
export type { PickersSlideTransitionClassKey, PickersSlideTransitionClasses, } from './pickersSlideTransitionClasses';
|
|
14
14
|
export type { ExportedSlideTransitionProps } from './PickersSlideTransition';
|
|
15
|
-
export type { DateView } from '../internals/models';
|
package/DateField/DateField.js
CHANGED
|
@@ -269,6 +269,10 @@ process.env.NODE_ENV !== "production" ? DateField.propTypes = {
|
|
|
269
269
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
270
270
|
*/
|
|
271
271
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
272
|
+
/**
|
|
273
|
+
* The ref object used to imperatively interact with the field.
|
|
274
|
+
*/
|
|
275
|
+
unstableFieldRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
272
276
|
/**
|
|
273
277
|
* The selected value.
|
|
274
278
|
* Used when the component is controlled.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { SlotComponentProps } from '@mui/base/utils';
|
|
3
3
|
import TextField from '@mui/material/TextField';
|
|
4
|
+
import { DateValidationError, FieldSection } from '../models';
|
|
4
5
|
import { UseFieldInternalProps } from '../internals/hooks/useField';
|
|
5
|
-
import { DateValidationError } from '../internals/hooks/validation/useDateValidation';
|
|
6
6
|
import { DefaultizedProps, MakeOptional } from '../internals/models/helpers';
|
|
7
7
|
import { BaseDateValidationProps, DayValidationProps, MonthValidationProps, YearValidationProps } from '../internals/hooks/validation/models';
|
|
8
8
|
import { FieldsTextFieldProps } from '../internals';
|
|
@@ -11,7 +11,7 @@ export interface UseDateFieldParams<TDate, TChildProps extends {}> {
|
|
|
11
11
|
props: UseDateFieldComponentProps<TDate, TChildProps>;
|
|
12
12
|
inputRef?: React.Ref<HTMLInputElement>;
|
|
13
13
|
}
|
|
14
|
-
export interface UseDateFieldProps<TDate> extends MakeOptional<UseFieldInternalProps<TDate | null, DateValidationError>, 'format'>, DayValidationProps<TDate>, MonthValidationProps<TDate>, YearValidationProps<TDate>, BaseDateValidationProps<TDate> {
|
|
14
|
+
export interface UseDateFieldProps<TDate> extends MakeOptional<UseFieldInternalProps<TDate | null, FieldSection, DateValidationError>, 'format'>, DayValidationProps<TDate>, MonthValidationProps<TDate>, YearValidationProps<TDate>, BaseDateValidationProps<TDate> {
|
|
15
15
|
}
|
|
16
16
|
export type UseDateFieldDefaultizedProps<TDate> = DefaultizedProps<UseDateFieldProps<TDate>, keyof BaseDateValidationProps<TDate> | 'format'>;
|
|
17
17
|
export type UseDateFieldComponentProps<TDate, TChildProps extends {}> = Omit<TChildProps, keyof UseDateFieldProps<TDate>> & UseDateFieldProps<TDate>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["value", "defaultValue", "format", "onChange", "readOnly", "onError", "shouldDisableDate", "shouldDisableMonth", "shouldDisableYear", "minDate", "maxDate", "disableFuture", "disablePast", "selectedSections", "onSelectedSectionsChange"];
|
|
3
|
+
const _excluded = ["value", "defaultValue", "format", "onChange", "readOnly", "onError", "shouldDisableDate", "shouldDisableMonth", "shouldDisableYear", "minDate", "maxDate", "disableFuture", "disablePast", "selectedSections", "onSelectedSectionsChange", "unstableFieldRef"];
|
|
4
4
|
import { singleItemFieldValueManager, singleItemValueManager } from '../internals/utils/valueManagers';
|
|
5
5
|
import { useField } from '../internals/hooks/useField';
|
|
6
6
|
import { validateDate } from '../internals/hooks/validation/useDateValidation';
|
|
@@ -38,7 +38,8 @@ export const useDateField = ({
|
|
|
38
38
|
disableFuture,
|
|
39
39
|
disablePast,
|
|
40
40
|
selectedSections,
|
|
41
|
-
onSelectedSectionsChange
|
|
41
|
+
onSelectedSectionsChange,
|
|
42
|
+
unstableFieldRef
|
|
42
43
|
} = _useDefaultizedDateFi,
|
|
43
44
|
other = _objectWithoutPropertiesLoose(_useDefaultizedDateFi, _excluded);
|
|
44
45
|
return useField({
|
|
@@ -59,7 +60,8 @@ export const useDateField = ({
|
|
|
59
60
|
disableFuture,
|
|
60
61
|
disablePast,
|
|
61
62
|
selectedSections,
|
|
62
|
-
onSelectedSectionsChange
|
|
63
|
+
onSelectedSectionsChange,
|
|
64
|
+
unstableFieldRef
|
|
63
65
|
},
|
|
64
66
|
valueManager: singleItemValueManager,
|
|
65
67
|
fieldValueManager: singleItemFieldValueManager,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { SxProps, Theme } from '@mui/material/styles';
|
|
3
3
|
import { BaseToolbarProps, ExportedBaseToolbarProps } from '../internals/models/props/toolbar';
|
|
4
|
-
import { DateView } from '../
|
|
4
|
+
import { DateView } from '../models';
|
|
5
5
|
import { DatePickerToolbarClasses } from './datePickerToolbarClasses';
|
|
6
6
|
export interface DatePickerToolbarProps<TDate> extends BaseToolbarProps<TDate | null, DateView> {
|
|
7
7
|
classes?: Partial<DatePickerToolbarClasses>;
|
package/DatePicker/shared.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { DefaultizedProps } from '../internals/models/helpers';
|
|
3
3
|
import { DateCalendarSlotsComponent, DateCalendarSlotsComponentsProps, ExportedDateCalendarProps } from '../DateCalendar/DateCalendar.types';
|
|
4
|
-
import { DateValidationError } from '../
|
|
4
|
+
import { DateValidationError, DateView } from '../models';
|
|
5
5
|
import { BasePickerInputProps } from '../internals/models/props/basePickerProps';
|
|
6
|
-
import { BaseDateValidationProps,
|
|
6
|
+
import { BaseDateValidationProps, MuiPickersAdapter, UncapitalizeObjectKeys } from '../internals';
|
|
7
7
|
import { LocalizedComponent } from '../locales/utils/pickersLocaleTextApi';
|
|
8
8
|
import { DatePickerToolbarProps, ExportedDatePickerToolbarProps } from './DatePickerToolbar';
|
|
9
9
|
import { PickerViewRendererLookup } from '../internals/hooks/usePicker/usePickerViews';
|
|
@@ -317,6 +317,10 @@ process.env.NODE_ENV !== "production" ? DateTimeField.propTypes = {
|
|
|
317
317
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
318
318
|
*/
|
|
319
319
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
320
|
+
/**
|
|
321
|
+
* The ref object used to imperatively interact with the field.
|
|
322
|
+
*/
|
|
323
|
+
unstableFieldRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
320
324
|
/**
|
|
321
325
|
* The selected value.
|
|
322
326
|
* Used when the component is controlled.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { SlotComponentProps } from '@mui/base/utils';
|
|
3
3
|
import TextField from '@mui/material/TextField';
|
|
4
|
+
import { DateTimeValidationError, FieldSection } from '../models';
|
|
4
5
|
import { UseFieldInternalProps } from '../internals/hooks/useField';
|
|
5
|
-
import { DateTimeValidationError } from '../internals/hooks/validation/useDateTimeValidation';
|
|
6
6
|
import { DefaultizedProps, MakeOptional } from '../internals/models/helpers';
|
|
7
7
|
import { BaseDateValidationProps, BaseTimeValidationProps, DayValidationProps, MonthValidationProps, TimeValidationProps, YearValidationProps } from '../internals/hooks/validation/models';
|
|
8
8
|
import { FieldsTextFieldProps, UncapitalizeObjectKeys } from '../internals';
|
|
@@ -10,7 +10,7 @@ export interface UseDateTimeFieldParams<TDate, TChildProps extends {}> {
|
|
|
10
10
|
props: UseDateTimeFieldComponentProps<TDate, TChildProps>;
|
|
11
11
|
inputRef?: React.Ref<HTMLInputElement>;
|
|
12
12
|
}
|
|
13
|
-
export interface UseDateTimeFieldProps<TDate> extends MakeOptional<UseFieldInternalProps<TDate | null, DateTimeValidationError>, 'format'>, DayValidationProps<TDate>, MonthValidationProps<TDate>, YearValidationProps<TDate>, BaseDateValidationProps<TDate>, TimeValidationProps<TDate>, BaseTimeValidationProps {
|
|
13
|
+
export interface UseDateTimeFieldProps<TDate> extends MakeOptional<UseFieldInternalProps<TDate | null, FieldSection, DateTimeValidationError>, 'format'>, DayValidationProps<TDate>, MonthValidationProps<TDate>, YearValidationProps<TDate>, BaseDateValidationProps<TDate>, TimeValidationProps<TDate>, BaseTimeValidationProps {
|
|
14
14
|
/**
|
|
15
15
|
* 12h/24h view for hour selection clock.
|
|
16
16
|
* @default `utils.is12HourCycleInCurrentLocale()`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["value", "defaultValue", "format", "onChange", "readOnly", "onError", "shouldDisableDate", "shouldDisableMonth", "shouldDisableYear", "minDate", "maxDate", "disableFuture", "disablePast", "minTime", "maxTime", "minDateTime", "maxDateTime", "minutesStep", "disableIgnoringDatePartForTimeValidation", "shouldDisableClock", "shouldDisableTime", "selectedSections", "onSelectedSectionsChange", "ampm"];
|
|
3
|
+
const _excluded = ["value", "defaultValue", "format", "onChange", "readOnly", "onError", "shouldDisableDate", "shouldDisableMonth", "shouldDisableYear", "minDate", "maxDate", "disableFuture", "disablePast", "minTime", "maxTime", "minDateTime", "maxDateTime", "minutesStep", "disableIgnoringDatePartForTimeValidation", "shouldDisableClock", "shouldDisableTime", "selectedSections", "onSelectedSectionsChange", "ampm", "unstableFieldRef"];
|
|
4
4
|
import { singleItemFieldValueManager, singleItemValueManager } from '../internals/utils/valueManagers';
|
|
5
5
|
import { useField } from '../internals/hooks/useField';
|
|
6
6
|
import { validateDateTime } from '../internals/hooks/validation/useDateTimeValidation';
|
|
@@ -50,7 +50,8 @@ export const useDateTimeField = ({
|
|
|
50
50
|
shouldDisableTime,
|
|
51
51
|
selectedSections,
|
|
52
52
|
onSelectedSectionsChange,
|
|
53
|
-
ampm
|
|
53
|
+
ampm,
|
|
54
|
+
unstableFieldRef
|
|
54
55
|
} = _useDefaultizedDateTi,
|
|
55
56
|
other = _objectWithoutPropertiesLoose(_useDefaultizedDateTi, _excluded);
|
|
56
57
|
return useField({
|
|
@@ -78,7 +79,8 @@ export const useDateTimeField = ({
|
|
|
78
79
|
disableIgnoringDatePartForTimeValidation,
|
|
79
80
|
selectedSections,
|
|
80
81
|
onSelectedSectionsChange,
|
|
81
|
-
ampm
|
|
82
|
+
ampm,
|
|
83
|
+
unstableFieldRef
|
|
82
84
|
},
|
|
83
85
|
valueManager: singleItemValueManager,
|
|
84
86
|
fieldValueManager: singleItemFieldValueManager,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { DateOrTimeView } from '../
|
|
2
|
+
import { DateOrTimeView } from '../models';
|
|
3
3
|
import { DateTimePickerTabsClasses } from './dateTimePickerTabsClasses';
|
|
4
4
|
import { BaseTabsProps, ExportedBaseTabsProps } from '../internals/models/props/tabs';
|
|
5
5
|
export interface ExportedDateTimePickerTabsProps extends ExportedBaseTabsProps {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { BaseToolbarProps, ExportedBaseToolbarProps } from '../internals/models/props/toolbar';
|
|
3
3
|
import { DateTimePickerToolbarClasses } from './dateTimePickerToolbarClasses';
|
|
4
|
-
import { DateOrTimeView } from '../
|
|
4
|
+
import { DateOrTimeView } from '../models';
|
|
5
5
|
export interface ExportedDateTimePickerToolbarProps extends ExportedBaseToolbarProps {
|
|
6
6
|
ampm?: boolean;
|
|
7
7
|
ampmInClock?: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { DefaultizedProps } from '../internals/models/helpers';
|
|
3
|
-
import { DateOrTimeView } from '../
|
|
3
|
+
import { DateOrTimeView, DateTimeValidationError } from '../models';
|
|
4
4
|
import { DateCalendarSlotsComponent, DateCalendarSlotsComponentsProps, ExportedDateCalendarProps } from '../DateCalendar/DateCalendar.types';
|
|
5
5
|
import { TimeClockSlotsComponent, TimeClockSlotsComponentsProps, ExportedTimeClockProps } from '../TimeClock/TimeClock.types';
|
|
6
6
|
import { BasePickerInputProps } from '../internals/models/props/basePickerProps';
|
|
@@ -8,7 +8,6 @@ import { DateTimePickerTabsProps, ExportedDateTimePickerTabsProps } from './Date
|
|
|
8
8
|
import { BaseDateValidationProps, BaseTimeValidationProps } from '../internals/hooks/validation/models';
|
|
9
9
|
import { LocalizedComponent } from '../locales/utils/pickersLocaleTextApi';
|
|
10
10
|
import { DateTimePickerToolbarProps, ExportedDateTimePickerToolbarProps } from './DateTimePickerToolbar';
|
|
11
|
-
import { DateTimeValidationError } from '../internals/hooks/validation/useDateTimeValidation';
|
|
12
11
|
import { PickerViewRendererLookup } from '../internals/hooks/usePicker/usePickerViews';
|
|
13
12
|
import { DateViewRendererProps } from '../dateViewRenderers';
|
|
14
13
|
import { TimeViewRendererProps } from '../timeViewRenderers';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UseDesktopPickerSlotsComponent, ExportedUseDesktopPickerSlotsComponentsProps, DesktopOnlyPickerProps } from '../internals/hooks/useDesktopPicker';
|
|
2
2
|
import { BaseDatePickerProps, BaseDatePickerSlotsComponent, BaseDatePickerSlotsComponentsProps } from '../DatePicker/shared';
|
|
3
3
|
import { MakeOptional } from '../internals/models/helpers';
|
|
4
|
-
import { DateView } from '../
|
|
4
|
+
import { DateView } from '../models';
|
|
5
5
|
import { UncapitalizeObjectKeys } from '../internals/utils/slots-migration';
|
|
6
6
|
export interface DesktopDatePickerSlotsComponent<TDate> extends BaseDatePickerSlotsComponent<TDate>, MakeOptional<UseDesktopPickerSlotsComponent<TDate, DateView>, 'Field' | 'OpenPickerIcon'> {
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UseDesktopPickerSlotsComponent, ExportedUseDesktopPickerSlotsComponentsProps, DesktopOnlyPickerProps } from '../internals/hooks/useDesktopPicker';
|
|
2
2
|
import { BaseDateTimePickerProps, BaseDateTimePickerSlotsComponent, BaseDateTimePickerSlotsComponentsProps } from '../DateTimePicker/shared';
|
|
3
3
|
import { MakeOptional } from '../internals/models/helpers';
|
|
4
|
-
import { DateOrTimeView } from '../
|
|
4
|
+
import { DateOrTimeView } from '../models';
|
|
5
5
|
import { UncapitalizeObjectKeys } from '../internals/utils/slots-migration';
|
|
6
6
|
export interface DesktopDateTimePickerSlotsComponent<TDate> extends BaseDateTimePickerSlotsComponent<TDate>, MakeOptional<UseDesktopPickerSlotsComponent<TDate, DateOrTimeView>, 'Field' | 'OpenPickerIcon'> {
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UseDesktopPickerSlotsComponent, ExportedUseDesktopPickerSlotsComponentsProps, DesktopOnlyPickerProps } from '../internals/hooks/useDesktopPicker';
|
|
2
2
|
import { BaseTimePickerProps, BaseTimePickerSlotsComponent, BaseTimePickerSlotsComponentsProps } from '../TimePicker/shared';
|
|
3
3
|
import { MakeOptional } from '../internals/models/helpers';
|
|
4
|
-
import { TimeView } from '../
|
|
4
|
+
import { TimeView } from '../models';
|
|
5
5
|
import { UncapitalizeObjectKeys } from '../internals/utils/slots-migration';
|
|
6
6
|
export interface DesktopTimePickerSlotsComponent<TDate> extends BaseTimePickerSlotsComponent<TDate>, MakeOptional<UseDesktopPickerSlotsComponent<TDate, TimeView>, 'Field' | 'OpenPickerIcon'> {
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UseMobilePickerSlotsComponent, MobileOnlyPickerProps, ExportedUseMobilePickerSlotsComponentsProps } from '../internals/hooks/useMobilePicker';
|
|
2
2
|
import { BaseDatePickerProps, BaseDatePickerSlotsComponent, BaseDatePickerSlotsComponentsProps } from '../DatePicker/shared';
|
|
3
3
|
import { MakeOptional } from '../internals/models/helpers';
|
|
4
|
-
import { DateView } from '../
|
|
4
|
+
import { DateView } from '../models';
|
|
5
5
|
import { UncapitalizeObjectKeys } from '../internals/utils/slots-migration';
|
|
6
6
|
export interface MobileDatePickerSlotsComponent<TDate> extends BaseDatePickerSlotsComponent<TDate>, MakeOptional<UseMobilePickerSlotsComponent<TDate, DateView>, 'Field'> {
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UseMobilePickerSlotsComponent, ExportedUseMobilePickerSlotsComponentsProps, MobileOnlyPickerProps } from '../internals/hooks/useMobilePicker';
|
|
2
2
|
import { BaseDateTimePickerProps, BaseDateTimePickerSlotsComponent, BaseDateTimePickerSlotsComponentsProps } from '../DateTimePicker/shared';
|
|
3
3
|
import { MakeOptional } from '../internals/models/helpers';
|
|
4
|
-
import { DateOrTimeView } from '../
|
|
4
|
+
import { DateOrTimeView } from '../models';
|
|
5
5
|
import { UncapitalizeObjectKeys } from '../internals/utils/slots-migration';
|
|
6
6
|
export interface MobileDateTimePickerSlotsComponent<TDate> extends BaseDateTimePickerSlotsComponent<TDate>, MakeOptional<UseMobilePickerSlotsComponent<TDate, DateOrTimeView>, 'Field'> {
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UseMobilePickerSlotsComponent, ExportedUseMobilePickerSlotsComponentsProps, MobileOnlyPickerProps } from '../internals/hooks/useMobilePicker';
|
|
2
2
|
import { BaseTimePickerProps, BaseTimePickerSlotsComponent, BaseTimePickerSlotsComponentsProps } from '../TimePicker/shared';
|
|
3
3
|
import { MakeOptional } from '../internals/models/helpers';
|
|
4
|
-
import { TimeView } from '../
|
|
4
|
+
import { TimeView } from '../models';
|
|
5
5
|
import { UncapitalizeObjectKeys } from '../internals/utils/slots-migration';
|
|
6
6
|
export interface MobileTimePickerSlotsComponent<TDate> extends BaseTimePickerSlotsComponent<TDate>, MakeOptional<UseMobilePickerSlotsComponent<TDate, TimeView>, 'Field'> {
|
|
7
7
|
}
|