@mui/x-date-pickers 6.18.0 → 7.0.0-alpha.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/AdapterLuxon/AdapterLuxon.js +13 -3
- package/CHANGELOG.md +212 -5
- package/DateCalendar/DateCalendar.js +4 -20
- package/DateCalendar/DateCalendar.types.d.ts +12 -3
- package/DateCalendar/DayCalendar.d.ts +12 -3
- package/DateCalendar/DayCalendar.js +3 -5
- package/DateCalendar/useCalendarState.js +2 -3
- package/DateField/DateField.js +5 -21
- package/DateField/DateField.types.d.ts +12 -3
- package/DatePicker/DatePicker.js +0 -12
- package/DatePicker/DatePicker.types.d.ts +1 -14
- package/DatePicker/shared.d.ts +3 -15
- package/DatePicker/shared.js +2 -5
- package/DateTimeField/DateTimeField.js +5 -21
- package/DateTimeField/DateTimeField.types.d.ts +2 -15
- package/DateTimePicker/DateTimePicker.js +0 -12
- package/DateTimePicker/DateTimePicker.types.d.ts +1 -14
- package/DateTimePicker/shared.d.ts +3 -16
- package/DateTimePicker/shared.js +4 -7
- package/DesktopDatePicker/DesktopDatePicker.js +0 -12
- package/DesktopDatePicker/DesktopDatePicker.types.d.ts +2 -15
- package/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -12
- package/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +2 -15
- package/DesktopTimePicker/DesktopTimePicker.js +0 -12
- package/DesktopTimePicker/DesktopTimePicker.types.d.ts +2 -15
- package/DigitalClock/DigitalClock.js +15 -24
- package/DigitalClock/DigitalClock.types.d.ts +2 -15
- package/MobileDatePicker/MobileDatePicker.js +0 -12
- package/MobileDatePicker/MobileDatePicker.types.d.ts +2 -15
- package/MobileDateTimePicker/MobileDateTimePicker.js +0 -12
- package/MobileDateTimePicker/MobileDateTimePicker.types.d.ts +2 -15
- package/MobileTimePicker/MobileTimePicker.js +0 -12
- package/MobileTimePicker/MobileTimePicker.types.d.ts +2 -15
- package/MonthCalendar/MonthCalendar.js +3 -7
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +7 -18
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.types.d.ts +3 -15
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.d.ts +2 -1
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +16 -6
- package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.d.ts +1 -2
- package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +13 -10
- package/PickersCalendarHeader/PickersCalendarHeader.js +4 -17
- package/PickersCalendarHeader/PickersCalendarHeader.types.d.ts +3 -16
- package/PickersLayout/PickersLayout.js +0 -12
- package/PickersLayout/PickersLayout.types.d.ts +6 -19
- package/PickersLayout/usePickerLayout.js +2 -7
- package/StaticDatePicker/StaticDatePicker.js +0 -12
- package/StaticDatePicker/StaticDatePicker.types.d.ts +2 -14
- package/StaticDateTimePicker/StaticDateTimePicker.js +0 -12
- package/StaticDateTimePicker/StaticDateTimePicker.types.d.ts +2 -14
- package/StaticTimePicker/StaticTimePicker.js +0 -12
- package/StaticTimePicker/StaticTimePicker.types.d.ts +2 -14
- package/TimeClock/TimeClock.js +3 -20
- package/TimeClock/TimeClock.types.d.ts +1 -14
- package/TimeField/TimeField.js +5 -21
- package/TimeField/TimeField.types.d.ts +2 -15
- package/TimePicker/TimePicker.js +0 -12
- package/TimePicker/TimePicker.types.d.ts +1 -14
- package/TimePicker/shared.d.ts +2 -15
- package/TimePicker/shared.js +4 -7
- package/YearCalendar/YearCalendar.js +3 -7
- package/dateTimeViewRenderers/dateTimeViewRenderers.d.ts +2 -2
- package/dateTimeViewRenderers/dateTimeViewRenderers.js +2 -8
- package/dateViewRenderers/dateViewRenderers.d.ts +1 -1
- package/dateViewRenderers/dateViewRenderers.js +0 -4
- package/hooks/useClearableField.d.ts +1 -3
- package/hooks/useClearableField.js +6 -8
- package/index.js +1 -1
- package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.types.d.ts +5 -6
- package/internals/components/PickersModalDialog.d.ts +4 -5
- package/internals/components/PickersPopper.d.ts +5 -6
- package/internals/hooks/useDesktopPicker/useDesktopPicker.types.d.ts +7 -8
- package/internals/hooks/useField/useField.types.d.ts +2 -2
- package/internals/hooks/useMobilePicker/useMobilePicker.types.d.ts +3 -4
- package/internals/hooks/useStaticPicker/useStaticPicker.types.d.ts +1 -14
- package/internals/hooks/useViews.js +2 -1
- package/internals/index.d.ts +0 -2
- package/internals/index.js +0 -1
- package/legacy/AdapterLuxon/AdapterLuxon.js +13 -3
- package/legacy/DateCalendar/DateCalendar.js +4 -20
- package/legacy/DateCalendar/DayCalendar.js +3 -5
- package/legacy/DateCalendar/useCalendarState.js +2 -3
- package/legacy/DateField/DateField.js +6 -22
- package/legacy/DatePicker/DatePicker.js +0 -12
- package/legacy/DatePicker/shared.js +2 -5
- package/legacy/DateTimeField/DateTimeField.js +6 -22
- package/legacy/DateTimePicker/DateTimePicker.js +0 -12
- package/legacy/DateTimePicker/shared.js +4 -7
- package/legacy/DesktopDatePicker/DesktopDatePicker.js +0 -12
- package/legacy/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -12
- package/legacy/DesktopTimePicker/DesktopTimePicker.js +0 -12
- package/legacy/DigitalClock/DigitalClock.js +17 -24
- package/legacy/MobileDatePicker/MobileDatePicker.js +0 -12
- package/legacy/MobileDateTimePicker/MobileDateTimePicker.js +0 -12
- package/legacy/MobileTimePicker/MobileTimePicker.js +0 -12
- package/legacy/MonthCalendar/MonthCalendar.js +3 -6
- package/legacy/MultiSectionDigitalClock/MultiSectionDigitalClock.js +11 -18
- package/legacy/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +16 -6
- package/legacy/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +15 -10
- package/legacy/PickersCalendarHeader/PickersCalendarHeader.js +4 -18
- package/legacy/PickersLayout/PickersLayout.js +0 -12
- package/legacy/PickersLayout/usePickerLayout.js +2 -7
- package/legacy/StaticDatePicker/StaticDatePicker.js +0 -12
- package/legacy/StaticDateTimePicker/StaticDateTimePicker.js +0 -12
- package/legacy/StaticTimePicker/StaticTimePicker.js +0 -12
- package/legacy/TimeClock/TimeClock.js +3 -20
- package/legacy/TimeField/TimeField.js +5 -21
- package/legacy/TimePicker/TimePicker.js +0 -12
- package/legacy/TimePicker/shared.js +4 -7
- package/legacy/YearCalendar/YearCalendar.js +3 -6
- package/legacy/dateTimeViewRenderers/dateTimeViewRenderers.js +2 -8
- package/legacy/dateViewRenderers/dateViewRenderers.js +0 -4
- package/legacy/hooks/useClearableField.js +6 -8
- package/legacy/index.js +1 -1
- package/legacy/internals/hooks/useViews.js +2 -1
- package/legacy/internals/index.js +0 -1
- package/legacy/locales/esES.js +6 -7
- package/legacy/locales/eu.js +94 -0
- package/legacy/locales/index.js +1 -0
- package/legacy/timeViewRenderers/timeViewRenderers.js +0 -12
- package/locales/esES.js +6 -7
- package/locales/eu.d.ts +54 -0
- package/locales/eu.js +58 -0
- package/locales/index.d.ts +1 -0
- package/locales/index.js +1 -0
- package/modern/AdapterLuxon/AdapterLuxon.js +13 -3
- package/modern/DateCalendar/DateCalendar.js +3 -19
- package/modern/DateCalendar/DayCalendar.js +2 -4
- package/modern/DateCalendar/useCalendarState.js +2 -3
- package/modern/DateField/DateField.js +4 -20
- package/modern/DatePicker/DatePicker.js +0 -12
- package/modern/DatePicker/shared.js +1 -4
- package/modern/DateTimeField/DateTimeField.js +4 -20
- package/modern/DateTimePicker/DateTimePicker.js +0 -12
- package/modern/DateTimePicker/shared.js +3 -6
- package/modern/DesktopDatePicker/DesktopDatePicker.js +0 -12
- package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -12
- package/modern/DesktopTimePicker/DesktopTimePicker.js +0 -12
- package/modern/DigitalClock/DigitalClock.js +14 -23
- package/modern/MobileDatePicker/MobileDatePicker.js +0 -12
- package/modern/MobileDateTimePicker/MobileDateTimePicker.js +0 -12
- package/modern/MobileTimePicker/MobileTimePicker.js +0 -12
- package/modern/MonthCalendar/MonthCalendar.js +3 -7
- package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.js +7 -18
- package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +16 -6
- package/modern/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +13 -10
- package/modern/PickersCalendarHeader/PickersCalendarHeader.js +3 -16
- package/modern/PickersLayout/PickersLayout.js +0 -12
- package/modern/PickersLayout/usePickerLayout.js +2 -7
- package/modern/StaticDatePicker/StaticDatePicker.js +0 -12
- package/modern/StaticDateTimePicker/StaticDateTimePicker.js +0 -12
- package/modern/StaticTimePicker/StaticTimePicker.js +0 -12
- package/modern/TimeClock/TimeClock.js +3 -20
- package/modern/TimeField/TimeField.js +4 -20
- package/modern/TimePicker/TimePicker.js +0 -12
- package/modern/TimePicker/shared.js +3 -6
- package/modern/YearCalendar/YearCalendar.js +3 -7
- package/modern/dateTimeViewRenderers/dateTimeViewRenderers.js +1 -7
- package/modern/dateViewRenderers/dateViewRenderers.js +0 -4
- package/modern/hooks/useClearableField.js +5 -7
- package/modern/index.js +1 -1
- package/modern/internals/hooks/useViews.js +2 -1
- package/modern/internals/index.js +0 -1
- package/modern/locales/esES.js +6 -7
- package/modern/locales/eu.js +58 -0
- package/modern/locales/index.js +1 -0
- package/modern/timeViewRenderers/timeViewRenderers.js +0 -12
- package/node/AdapterLuxon/AdapterLuxon.js +13 -3
- package/node/DateCalendar/DateCalendar.js +3 -19
- package/node/DateCalendar/DayCalendar.js +2 -4
- package/node/DateCalendar/useCalendarState.js +1 -2
- package/node/DateField/DateField.js +4 -20
- package/node/DatePicker/DatePicker.js +0 -12
- package/node/DatePicker/shared.js +1 -4
- package/node/DateTimeField/DateTimeField.js +4 -20
- package/node/DateTimePicker/DateTimePicker.js +0 -12
- package/node/DateTimePicker/shared.js +3 -6
- package/node/DesktopDatePicker/DesktopDatePicker.js +0 -12
- package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -12
- package/node/DesktopTimePicker/DesktopTimePicker.js +0 -12
- package/node/DigitalClock/DigitalClock.js +14 -23
- package/node/MobileDatePicker/MobileDatePicker.js +0 -12
- package/node/MobileDateTimePicker/MobileDateTimePicker.js +0 -12
- package/node/MobileTimePicker/MobileTimePicker.js +0 -12
- package/node/MonthCalendar/MonthCalendar.js +3 -7
- package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.js +7 -18
- package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +16 -6
- package/node/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +13 -10
- package/node/PickersCalendarHeader/PickersCalendarHeader.js +3 -16
- package/node/PickersLayout/PickersLayout.js +0 -12
- package/node/PickersLayout/usePickerLayout.js +2 -7
- package/node/StaticDatePicker/StaticDatePicker.js +0 -12
- package/node/StaticDateTimePicker/StaticDateTimePicker.js +0 -12
- package/node/StaticTimePicker/StaticTimePicker.js +0 -12
- package/node/TimeClock/TimeClock.js +3 -20
- package/node/TimeField/TimeField.js +4 -20
- package/node/TimePicker/TimePicker.js +0 -12
- package/node/TimePicker/shared.js +3 -6
- package/node/YearCalendar/YearCalendar.js +3 -7
- package/node/dateTimeViewRenderers/dateTimeViewRenderers.js +1 -7
- package/node/dateViewRenderers/dateViewRenderers.js +0 -4
- package/node/hooks/useClearableField.js +5 -7
- package/node/index.js +1 -1
- package/node/internals/hooks/useViews.js +2 -1
- package/node/internals/index.js +0 -7
- package/node/locales/esES.js +6 -7
- package/node/locales/eu.js +64 -0
- package/node/locales/index.js +11 -0
- package/node/timeViewRenderers/timeViewRenderers.js +0 -12
- package/package.json +1 -1
- package/timeViewRenderers/timeViewRenderers.d.ts +3 -3
- package/timeViewRenderers/timeViewRenderers.js +0 -12
- package/internals/utils/slots-migration.d.ts +0 -36
- package/internals/utils/slots-migration.js +0 -13
- package/legacy/internals/utils/slots-migration.js +0 -14
- package/modern/internals/utils/slots-migration.js +0 -13
- package/node/internals/utils/slots-migration.js +0 -21
|
@@ -273,15 +273,25 @@ export class AdapterLuxon {
|
|
|
273
273
|
};
|
|
274
274
|
this.expandFormat = format => {
|
|
275
275
|
// Extract escaped section to avoid extending them
|
|
276
|
-
const
|
|
277
|
-
|
|
276
|
+
const catchEscapedSectionsRegexp = /''|'(''|[^'])+('|$)|[^']*/g;
|
|
277
|
+
|
|
278
|
+
// Extract words to test if they are a token or a word to escape.
|
|
279
|
+
const catchWordsRegexp = /(?:^|[^a-z])([a-z]+)(?:[^a-z]|$)|([a-z]+)/gi;
|
|
280
|
+
return format.match(catchEscapedSectionsRegexp).map(token => {
|
|
278
281
|
const firstCharacter = token[0];
|
|
279
282
|
if (firstCharacter === "'") {
|
|
280
283
|
return token;
|
|
281
284
|
}
|
|
282
|
-
|
|
285
|
+
const expandedToken = DateTime.expandFormat(token, {
|
|
283
286
|
locale: this.locale
|
|
284
287
|
});
|
|
288
|
+
return expandedToken.replace(catchWordsRegexp, (correspondance, g1, g2) => {
|
|
289
|
+
const word = g1 || g2; // words are either in group 1 or group 2
|
|
290
|
+
if (word === 'yyyyy' || formatTokenMap[word] !== undefined) {
|
|
291
|
+
return correspondance;
|
|
292
|
+
}
|
|
293
|
+
return `'${correspondance}'`;
|
|
294
|
+
});
|
|
285
295
|
}).join('')
|
|
286
296
|
// The returned format can contain `yyyyy` which means year between 4 and 6 digits.
|
|
287
297
|
// This value is supported by luxon parser but not luxon formatter.
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,213 @@
|
|
|
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
|
+
## 7.0.0-alpha.0
|
|
7
|
+
|
|
8
|
+
_Nov 10, 2023_
|
|
9
|
+
|
|
10
|
+
We're thrilled to announce the first alpha release of our next major version, v7.
|
|
11
|
+
This release introduces a few breaking changes, paving the way for the upcoming features like Pivoting and DateTimeRangePicker.
|
|
12
|
+
|
|
13
|
+
A special shoutout to thank the 12 contributors who made this release possible. Here are some highlights ✨:
|
|
14
|
+
|
|
15
|
+
- 🚀 First v7 alpha release
|
|
16
|
+
- ✨ Fix aggregation label not showing when `renderHeader` is used (#10961) @cherniavskii
|
|
17
|
+
- 📘 Server side data source [early documentation](https://mui.com/x/react-data-grid/server-side-data/)
|
|
18
|
+
- 💫 New recipes added for the data grid
|
|
19
|
+
- 📈 `<ChartsReferenceLine />` component is now available
|
|
20
|
+
- 🌍 Add Basque (eu) locale, improve Czech (cs-CZ) and Spanish (es-ES) locales
|
|
21
|
+
- 🐞 Bugfixes
|
|
22
|
+
- 📚 Documentation improvements
|
|
23
|
+
|
|
24
|
+
### Data Grid
|
|
25
|
+
|
|
26
|
+
#### Breaking changes
|
|
27
|
+
|
|
28
|
+
- The deprecated `components` and `componentsProps` props have been removed. Use `slots` and `slotProps` instead. See [components section](/x/react-data-grid/components/) for more details.
|
|
29
|
+
- The print export will now only print the selected rows if there are any.
|
|
30
|
+
If there are no selected rows, it will print all rows. This makes the print export consistent with the other exports.
|
|
31
|
+
You can [customize the rows to export by using the `getRowsToExport` function](/x/react-data-grid/export/#customizing-the-rows-to-export).
|
|
32
|
+
- The `getApplyFilterFnV7` in `GridFilterOperator` was renamed to `getApplyFilterFn`.
|
|
33
|
+
If you use `getApplyFilterFnV7` directly - rename it to `getApplyFilterFn`.
|
|
34
|
+
- The signature of the function returned by `getApplyFilterFn` has changed for performance reasons:
|
|
35
|
+
|
|
36
|
+
```diff
|
|
37
|
+
const getApplyFilterFn: GetApplyFilterFn<any, unknown> = (filterItem) => {
|
|
38
|
+
if (!filterItem.value) {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
const filterRegex = new RegExp(escapeRegExp(filterItem.value), 'i');
|
|
42
|
+
- return (cellParams) => {
|
|
43
|
+
- const { value } = cellParams;
|
|
44
|
+
+ return (value, row, colDef, apiRef) => {
|
|
45
|
+
return value != null ? filterRegex.test(String(value)) : false;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
- The `getApplyQuickFilterFnV7` in `GridColDef` was renamed to `getApplyQuickFilterFn`.
|
|
51
|
+
If you use `getApplyQuickFilterFnV7` directly - rename it to `getApplyQuickFilterFn`.
|
|
52
|
+
- The signature of the function returned by `getApplyQuickFilterFn` has changed for performance reasons:
|
|
53
|
+
|
|
54
|
+
```diff
|
|
55
|
+
const getGridStringQuickFilterFn: GetApplyQuickFilterFn<any, unknown> = (value) => {
|
|
56
|
+
if (!value) {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
const filterRegex = new RegExp(escapeRegExp(value), 'i');
|
|
60
|
+
- return (cellParams) => {
|
|
61
|
+
- const { formattedValue } = cellParams;
|
|
62
|
+
+ return (value, row, column, apiRef) => {
|
|
63
|
+
+ let formattedValue = apiRef.current.getRowFormattedValue(row, column);
|
|
64
|
+
return formattedValue != null ? filterRegex.test(formattedValue.toString()) : false;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
#### `@mui/x-data-grid@7.0.0-alpha.0`
|
|
70
|
+
|
|
71
|
+
- [DataGrid] Fix for error thrown when removing skeleton rows, after sorting is applied (#10807) @benjaminbialy
|
|
72
|
+
- [DataGrid] Fix: `undefined` slot value (#10937) @romgrk
|
|
73
|
+
- [DataGrid] Print selected rows by default (#10846) @cherniavskii
|
|
74
|
+
- [DataGrid] Remove deprecated `components` and `componentsProps` (#10911) @MBilalShafi
|
|
75
|
+
- [DataGrid] Remove legacy filtering API (#10897) @cherniavskii
|
|
76
|
+
- [DataGrid] Fix keyboard navigation for actions cell with disabled buttons (#10882) @michelengelen
|
|
77
|
+
- [DataGrid] Added a recipe for using non-native select in filter panel (#10916) @michelengelen
|
|
78
|
+
- [DataGrid] Added a recipe to style cells without impacting the aggregation cells (#10913) @michelengelen
|
|
79
|
+
- [l10n] Improve Czech (cs-CZ) locale (#10949) @luborepka
|
|
80
|
+
|
|
81
|
+
#### `@mui/x-data-grid-pro@7.0.0-alpha.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
82
|
+
|
|
83
|
+
Same changes as in `@mui/x-data-grid@7.0.0-alpha.0`, plus:
|
|
84
|
+
|
|
85
|
+
- [DataGridPro] Autosize Columns - Fix headers being cut off (#10666) @gitstart
|
|
86
|
+
- [DataGridPro] Add data source interface and basic documentation (#10543) @MBilalShafi
|
|
87
|
+
|
|
88
|
+
#### `@mui/x-data-grid-premium@7.0.0-alpha.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
89
|
+
|
|
90
|
+
Same changes as in `@mui/x-data-grid-pro@7.0.0-alpha.0`, plus:
|
|
91
|
+
|
|
92
|
+
- [DataGridPremium] Render aggregation label when `renderHeader` is used (#10936) @cherniavskii
|
|
93
|
+
|
|
94
|
+
### Date Pickers
|
|
95
|
+
|
|
96
|
+
#### Breaking changes
|
|
97
|
+
|
|
98
|
+
- The deprecated `components` and `componentsProps` props have been removed. Use `slots` and `slotProps` instead.
|
|
99
|
+
|
|
100
|
+
#### `@mui/x-date-pickers@7.0.0-alpha.0`
|
|
101
|
+
|
|
102
|
+
- [pickers] Escape non tokens words (#10400) @alexfauquette
|
|
103
|
+
- [fields] Fix `MultiInputTimeRangeField` section selection (#10922) @noraleonte
|
|
104
|
+
- [pickers] Refine `referenceDate` behavior in views (#10863) @LukasTy
|
|
105
|
+
- [pickers] Remove `components` and `componentsProps` props (#10700) @alexfauquette
|
|
106
|
+
- [l10n] Add Basque (eu) locale and improve Spanish (es-ES) locale (#10819) @lajtomekadimon
|
|
107
|
+
- [pickers] Add short weekdays token (#10988) @alexfauquette
|
|
108
|
+
|
|
109
|
+
#### `@mui/x-date-pickers-pro@7.0.0-alpha.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
110
|
+
|
|
111
|
+
Same changes as in `@mui/x-date-pickers@7.0.0-alpha.0`.
|
|
112
|
+
|
|
113
|
+
### Charts / `@mui/x-charts@7.0.0-alpha.0`
|
|
114
|
+
|
|
115
|
+
#### Breaking changes
|
|
116
|
+
|
|
117
|
+
Types for `slots` and `slotProps` got renamed by removing the "Component" which is meaningless for charts.
|
|
118
|
+
Unless you imported those types, to create a wrapper, you should not be impacted by this breaking change.
|
|
119
|
+
|
|
120
|
+
Here is an example of the renaming for the `<ChartsTooltip />` component.
|
|
121
|
+
|
|
122
|
+
```diff
|
|
123
|
+
-ChartsTooltipSlotsComponent
|
|
124
|
+
+ChartsTooltipSlots
|
|
125
|
+
|
|
126
|
+
-ChartsTooltipSlotComponentProps
|
|
127
|
+
+ChartsTooltipSlotProps
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
- [charts] Add `<ChartsReferenceLine />` component (#10597) (#10946) @alexfauquette
|
|
131
|
+
- [charts] Improve properties JSDoc (#10931) (#10955) @alexfauquette
|
|
132
|
+
- [charts] Rename `slots` and `slotProps` types (#10875) @alexfauquette
|
|
133
|
+
|
|
134
|
+
### `@mui/x-codemod@7.0.0-alpha.0`
|
|
135
|
+
|
|
136
|
+
- [codemod] Add `v7.0.0/preset-safe` (#10973) @LukasTy
|
|
137
|
+
|
|
138
|
+
### Docs
|
|
139
|
+
|
|
140
|
+
- [docs] Add `@next` tag to the installation instructions (#10963) @MBilalShafi
|
|
141
|
+
- [docs] Document how to hide the legend (#10951) @alexfauquette
|
|
142
|
+
- [docs] Fix typo in the migration guide (#10972) @flaviendelangle
|
|
143
|
+
|
|
144
|
+
### Core
|
|
145
|
+
|
|
146
|
+
- [core] Adds migration docs for charts, pickers and tree view (#10926) @michelengelen
|
|
147
|
+
- [core] Bump monorepo (#10959) @LukasTy
|
|
148
|
+
- [core] Changed prettier branch value to next (#10917) @michelengelen
|
|
149
|
+
- [core] Fix GitHub title tag consistency @oliviertassinari
|
|
150
|
+
- [core] Fixed wrong package names in migration docs (#10953) @michelengelen
|
|
151
|
+
- [core] Merge `master` into `next` (#10929) @cherniavskii
|
|
152
|
+
- [core] Update release instructions as per v7 configuration (#10962) @MBilalShafi
|
|
153
|
+
- [license] Correctly throw errors (#10924) @oliviertassinari
|
|
154
|
+
|
|
155
|
+
## 6.18.1
|
|
156
|
+
|
|
157
|
+
_Nov 9, 2023_
|
|
158
|
+
|
|
159
|
+
We'd like to offer a big thanks to the 9 contributors who made this release possible. Here are some highlights ✨:
|
|
160
|
+
|
|
161
|
+
- ✨ Fix aggregation label not showing when `renderHeader` is used (#10961) @cherniavskii
|
|
162
|
+
- 📘 Server side data source [early documentation](https://mui.com/x/react-data-grid/server-side-data/) published
|
|
163
|
+
- 📈 `<ChartsReferenceLine />` component is now available
|
|
164
|
+
- 🐞 Bugfixes
|
|
165
|
+
- 📚 Documentation improvements
|
|
166
|
+
|
|
167
|
+
### Data Grid
|
|
168
|
+
|
|
169
|
+
#### `@mui/x-data-grid@6.18.1`
|
|
170
|
+
|
|
171
|
+
- [DataGrid] Fix cell value type in quick filtering v7 (#10884) @cherniavskii
|
|
172
|
+
- [DataGrid] Fix keyboard navigation for actions cell with disabled buttons (#10947) @michelengelen
|
|
173
|
+
- [DataGrid] Fix `undefined` slot values (#10934) @romgrk
|
|
174
|
+
|
|
175
|
+
#### `@mui/x-data-grid-pro@6.18.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
176
|
+
|
|
177
|
+
Same changes as in `@mui/x-data-grid@6.18.1`, plus:
|
|
178
|
+
|
|
179
|
+
- [DataGridPro] Add data source interface and basic documentation (#10543) @MBilalShafi
|
|
180
|
+
|
|
181
|
+
#### `@mui/x-data-grid-premium@6.18.1` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
182
|
+
|
|
183
|
+
Same changes as in `@mui/x-data-grid-pro@6.18.1`, plus:
|
|
184
|
+
|
|
185
|
+
- [DataGridPremium] Render aggregation label when `renderHeader` is used (#10961) @cherniavskii
|
|
186
|
+
|
|
187
|
+
### Date Pickers
|
|
188
|
+
|
|
189
|
+
#### `@mui/x-date-pickers@6.18.1`
|
|
190
|
+
|
|
191
|
+
- [fields] Fix multi input date time field section selection (#10915) @noraleonte
|
|
192
|
+
- [pickers] Always use up-to-date `defaultView` (#10889) @LukasTy
|
|
193
|
+
|
|
194
|
+
#### `@mui/x-date-pickers-pro@6.18.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
195
|
+
|
|
196
|
+
Same changes as in `@mui/x-date-pickers@6.18.1`.
|
|
197
|
+
|
|
198
|
+
### Charts / `@mui/x-charts@6.18.1`
|
|
199
|
+
|
|
200
|
+
- [charts] Add `<ChartsReferenceLine />` component (#10597) @wascou
|
|
201
|
+
- [charts] Improve properties JSDoc (#10931) @alexfauquette
|
|
202
|
+
|
|
203
|
+
### Docs
|
|
204
|
+
|
|
205
|
+
- [docs] Fix charts docs as stable (#10888) @alexfauquette
|
|
206
|
+
- [docs] Document how to hide the legend (#10954) @alexfauquette
|
|
207
|
+
|
|
208
|
+
### Core
|
|
209
|
+
|
|
210
|
+
- [core] Adds new alpha version to version select on the docs (#10944) @michelengelen
|
|
211
|
+
- [core] Fix GitHub title tag consistency @oliviertassinari
|
|
212
|
+
|
|
6
213
|
## 6.18.0
|
|
7
214
|
|
|
8
215
|
_Nov 3, 2023_
|
|
@@ -357,7 +564,7 @@ Same changes as in `@mui/x-date-pickers@6.16.1`, plus:
|
|
|
357
564
|
|
|
358
565
|
- [core] Fix casing consistency with legal and marketing content @oliviertassinari
|
|
359
566
|
- [core] Revert the link in the priority support ticket description (#10517) @michelengelen
|
|
360
|
-
- [
|
|
567
|
+
- [changelog] Polish image @oliviertassinari
|
|
361
568
|
|
|
362
569
|
## 6.16.0
|
|
363
570
|
|
|
@@ -1149,7 +1356,7 @@ Same changes as in `@mui/x-date-pickers@6.10.1`.
|
|
|
1149
1356
|
### Core
|
|
1150
1357
|
|
|
1151
1358
|
- [core] Add `validate` command (#9714) @romgrk
|
|
1152
|
-
- [
|
|
1359
|
+
- [changelog] Update generator to new format @oliviertassinari
|
|
1153
1360
|
|
|
1154
1361
|
## 6.10.0
|
|
1155
1362
|
|
|
@@ -1207,7 +1414,7 @@ Same changes as in `@mui/x-date-pickers@6.10.0`.
|
|
|
1207
1414
|
|
|
1208
1415
|
- [core] Disambiguate eslint plugin name @oliviertassinari
|
|
1209
1416
|
- [core] Update priority support issue template and prompt (#9574) @DanailH
|
|
1210
|
-
- [
|
|
1417
|
+
- [changelog] Clarify each plan (#9446) @oliviertassinari
|
|
1211
1418
|
- [license] Fix error terminology (#9614) @oliviertassinari
|
|
1212
1419
|
|
|
1213
1420
|
## 6.9.2
|
|
@@ -1356,8 +1563,8 @@ Same changes as in `@mui/x-date-pickers@6.9.1`.
|
|
|
1356
1563
|
- [core] Fix priority support prompt action (#9472) @DanailH
|
|
1357
1564
|
- [core] Update `uses` for priority support action (#9480) @DanailH
|
|
1358
1565
|
- [core] Bumb update monorepo (#9476) @alexfauquette
|
|
1359
|
-
- [
|
|
1360
|
-
- [
|
|
1566
|
+
- [changelog] Fix media quality (#9439) @oliviertassinari
|
|
1567
|
+
- [changelog] Remove height img attribute @oliviertassinari
|
|
1361
1568
|
- [test] Skip flaky row pinning tests in JSDOM (#9511) @cherniavskii
|
|
1362
1569
|
|
|
1363
1570
|
## 6.9.0
|
|
@@ -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 = ["autoFocus", "onViewChange", "value", "defaultValue", "referenceDate", "disableFuture", "disablePast", "defaultCalendarMonth", "onChange", "onYearChange", "onMonthChange", "reduceAnimations", "shouldDisableDate", "shouldDisableMonth", "shouldDisableYear", "view", "views", "openTo", "className", "disabled", "readOnly", "minDate", "maxDate", "disableHighlightToday", "focusedView", "onFocusedViewChange", "showDaysOutsideCurrentMonth", "fixedWeekNumber", "dayOfWeekFormatter", "
|
|
3
|
+
const _excluded = ["autoFocus", "onViewChange", "value", "defaultValue", "referenceDate", "disableFuture", "disablePast", "defaultCalendarMonth", "onChange", "onYearChange", "onMonthChange", "reduceAnimations", "shouldDisableDate", "shouldDisableMonth", "shouldDisableYear", "view", "views", "openTo", "className", "disabled", "readOnly", "minDate", "maxDate", "disableHighlightToday", "focusedView", "onFocusedViewChange", "showDaysOutsideCurrentMonth", "fixedWeekNumber", "dayOfWeekFormatter", "slots", "slotProps", "loading", "renderLoading", "displayWeekNumber", "yearsPerRow", "monthsPerRow", "timezone"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
@@ -83,7 +83,7 @@ const DateCalendarViewTransitionContainer = styled(PickersFadeTransitionGroup, {
|
|
|
83
83
|
* - [DateCalendar API](https://mui.com/x/api/date-pickers/date-calendar/)
|
|
84
84
|
*/
|
|
85
85
|
export const DateCalendar = /*#__PURE__*/React.forwardRef(function DateCalendar(inProps, ref) {
|
|
86
|
-
var
|
|
86
|
+
var _slots$calendarHeader;
|
|
87
87
|
const utils = useUtils();
|
|
88
88
|
const id = useId();
|
|
89
89
|
const props = useDateCalendarDefaultizedProps(inProps, 'MuiDateCalendar');
|
|
@@ -117,8 +117,6 @@ export const DateCalendar = /*#__PURE__*/React.forwardRef(function DateCalendar(
|
|
|
117
117
|
showDaysOutsideCurrentMonth,
|
|
118
118
|
fixedWeekNumber,
|
|
119
119
|
dayOfWeekFormatter,
|
|
120
|
-
components,
|
|
121
|
-
componentsProps,
|
|
122
120
|
slots,
|
|
123
121
|
slotProps,
|
|
124
122
|
loading,
|
|
@@ -185,10 +183,10 @@ export const DateCalendar = /*#__PURE__*/React.forwardRef(function DateCalendar(
|
|
|
185
183
|
const maxDateWithDisabled = disabled && value || maxDate;
|
|
186
184
|
const gridLabelId = `${id}-grid-label`;
|
|
187
185
|
const hasFocus = focusedView !== null;
|
|
188
|
-
const CalendarHeader = (
|
|
186
|
+
const CalendarHeader = (_slots$calendarHeader = slots == null ? void 0 : slots.calendarHeader) != null ? _slots$calendarHeader : PickersCalendarHeader;
|
|
189
187
|
const calendarHeaderProps = useSlotProps({
|
|
190
188
|
elementType: CalendarHeader,
|
|
191
|
-
externalSlotProps:
|
|
189
|
+
externalSlotProps: slotProps == null ? void 0 : slotProps.calendarHeader,
|
|
192
190
|
additionalProps: {
|
|
193
191
|
views,
|
|
194
192
|
view,
|
|
@@ -339,8 +337,6 @@ export const DateCalendar = /*#__PURE__*/React.forwardRef(function DateCalendar(
|
|
|
339
337
|
fixedWeekNumber: fixedWeekNumber,
|
|
340
338
|
dayOfWeekFormatter: dayOfWeekFormatter,
|
|
341
339
|
displayWeekNumber: displayWeekNumber,
|
|
342
|
-
components: components,
|
|
343
|
-
componentsProps: componentsProps,
|
|
344
340
|
slots: slots,
|
|
345
341
|
slotProps: slotProps,
|
|
346
342
|
loading: loading,
|
|
@@ -364,18 +360,6 @@ process.env.NODE_ENV !== "production" ? DateCalendar.propTypes = {
|
|
|
364
360
|
autoFocus: PropTypes.bool,
|
|
365
361
|
classes: PropTypes.object,
|
|
366
362
|
className: PropTypes.string,
|
|
367
|
-
/**
|
|
368
|
-
* Overridable components.
|
|
369
|
-
* @default {}
|
|
370
|
-
* @deprecated Please use `slots`.
|
|
371
|
-
*/
|
|
372
|
-
components: PropTypes.object,
|
|
373
|
-
/**
|
|
374
|
-
* The props used for each component slot.
|
|
375
|
-
* @default {}
|
|
376
|
-
* @deprecated Please use `slotProps`.
|
|
377
|
-
*/
|
|
378
|
-
componentsProps: PropTypes.object,
|
|
379
363
|
/**
|
|
380
364
|
* Formats the day of week displayed in the calendar header.
|
|
381
365
|
* @param {string} day The day of week provided by the adapter. Deprecated, will be removed in v7: Use `date` instead.
|
|
@@ -10,7 +10,6 @@ import { PickerSelectionState } from '../internals/hooks/usePicker/usePickerValu
|
|
|
10
10
|
import { ExportedUseViewsOptions } from '../internals/hooks/useViews';
|
|
11
11
|
import { DateView, TimezoneProps } from '../models';
|
|
12
12
|
import { DefaultizedProps } from '../internals/models/helpers';
|
|
13
|
-
import { SlotsAndSlotProps } from '../internals/utils/slots-migration';
|
|
14
13
|
import { ExportedYearCalendarProps } from '../YearCalendar/YearCalendar.types';
|
|
15
14
|
import { ExportedMonthCalendarProps } from '../MonthCalendar/MonthCalendar.types';
|
|
16
15
|
export interface DateCalendarSlotsComponent<TDate> extends PickersCalendarHeaderSlotsComponent, DayCalendarSlotsComponent<TDate> {
|
|
@@ -19,7 +18,7 @@ export interface DateCalendarSlotsComponent<TDate> extends PickersCalendarHeader
|
|
|
19
18
|
* Check the [PickersCalendarHeader](https://mui.com/x/api/date-pickers/pickers-calendar-header/) component.
|
|
20
19
|
* @default PickersCalendarHeader
|
|
21
20
|
*/
|
|
22
|
-
|
|
21
|
+
calendarHeader?: React.ElementType<PickersCalendarHeaderProps<TDate>>;
|
|
23
22
|
}
|
|
24
23
|
export interface DateCalendarSlotsComponentsProps<TDate> extends PickersCalendarHeaderSlotsComponentsProps<TDate>, DayCalendarSlotsComponentsProps<TDate> {
|
|
25
24
|
calendarHeader?: SlotComponentProps<typeof PickersCalendarHeader, {}, DateCalendarProps<TDate>>;
|
|
@@ -63,7 +62,7 @@ export interface ExportedDateCalendarProps<TDate> extends ExportedDayCalendarPro
|
|
|
63
62
|
*/
|
|
64
63
|
onMonthChange?: (month: TDate) => void;
|
|
65
64
|
}
|
|
66
|
-
export interface DateCalendarProps<TDate> extends ExportedDateCalendarProps<TDate>, ExportedUseViewsOptions<DateView
|
|
65
|
+
export interface DateCalendarProps<TDate> extends ExportedDateCalendarProps<TDate>, ExportedUseViewsOptions<DateView> {
|
|
67
66
|
/**
|
|
68
67
|
* The selected value.
|
|
69
68
|
* Used when the component is controlled.
|
|
@@ -92,5 +91,15 @@ export interface DateCalendarProps<TDate> extends ExportedDateCalendarProps<TDat
|
|
|
92
91
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
93
92
|
*/
|
|
94
93
|
sx?: SxProps<Theme>;
|
|
94
|
+
/**
|
|
95
|
+
* Overridable component slots.
|
|
96
|
+
* @default {}
|
|
97
|
+
*/
|
|
98
|
+
slots?: DateCalendarSlotsComponent<TDate>;
|
|
99
|
+
/**
|
|
100
|
+
* The props used for each component slot.
|
|
101
|
+
* @default {}
|
|
102
|
+
*/
|
|
103
|
+
slotProps?: DateCalendarSlotsComponentsProps<TDate>;
|
|
95
104
|
}
|
|
96
105
|
export type DateCalendarDefaultizedProps<TDate> = DefaultizedProps<DateCalendarProps<TDate>, 'views' | 'openTo' | 'loading' | 'reduceAnimations' | 'renderLoading' | keyof BaseDateValidationProps<TDate>>;
|
|
@@ -5,7 +5,6 @@ import { PickerOnChangeFn } from '../internals/hooks/useViews';
|
|
|
5
5
|
import { SlideDirection, SlideTransitionProps } from './PickersSlideTransition';
|
|
6
6
|
import { BaseDateValidationProps, DayValidationProps, MonthValidationProps, YearValidationProps } from '../internals/models/validation';
|
|
7
7
|
import { DayCalendarClasses } from './dayCalendarClasses';
|
|
8
|
-
import { SlotsAndSlotProps } from '../internals/utils/slots-migration';
|
|
9
8
|
import { TimezoneProps } from '../models';
|
|
10
9
|
import { DefaultizedProps } from '../internals/models/helpers';
|
|
11
10
|
export interface DayCalendarSlotsComponent<TDate> {
|
|
@@ -14,7 +13,7 @@ export interface DayCalendarSlotsComponent<TDate> {
|
|
|
14
13
|
* Check the [PickersDay](https://mui.com/x/api/date-pickers/pickers-day/) component.
|
|
15
14
|
* @default PickersDay
|
|
16
15
|
*/
|
|
17
|
-
|
|
16
|
+
day?: React.ElementType<PickersDayProps<TDate>>;
|
|
18
17
|
}
|
|
19
18
|
export interface DayCalendarSlotsComponentsProps<TDate> {
|
|
20
19
|
day?: SlotComponentProps<typeof PickersDay, {}, DayCalendarProps<TDate> & {
|
|
@@ -54,7 +53,7 @@ export interface ExportedDayCalendarProps<TDate> extends ExportedPickersDayProps
|
|
|
54
53
|
*/
|
|
55
54
|
fixedWeekNumber?: number;
|
|
56
55
|
}
|
|
57
|
-
export interface DayCalendarProps<TDate> extends ExportedDayCalendarProps<TDate>, DayValidationProps<TDate>, MonthValidationProps<TDate>, YearValidationProps<TDate>, Required<BaseDateValidationProps<TDate>>, DefaultizedProps<TimezoneProps, 'timezone'
|
|
56
|
+
export interface DayCalendarProps<TDate> extends ExportedDayCalendarProps<TDate>, DayValidationProps<TDate>, MonthValidationProps<TDate>, YearValidationProps<TDate>, Required<BaseDateValidationProps<TDate>>, DefaultizedProps<TimezoneProps, 'timezone'> {
|
|
58
57
|
autoFocus?: boolean;
|
|
59
58
|
className?: string;
|
|
60
59
|
currentMonth: TDate;
|
|
@@ -73,6 +72,16 @@ export interface DayCalendarProps<TDate> extends ExportedDayCalendarProps<TDate>
|
|
|
73
72
|
onFocusedViewChange?: (newHasFocus: boolean) => void;
|
|
74
73
|
gridLabelId?: string;
|
|
75
74
|
classes?: Partial<DayCalendarClasses>;
|
|
75
|
+
/**
|
|
76
|
+
* Overridable component slots.
|
|
77
|
+
* @default {}
|
|
78
|
+
*/
|
|
79
|
+
slots?: DayCalendarSlotsComponent<TDate>;
|
|
80
|
+
/**
|
|
81
|
+
* The props used for each component slot.
|
|
82
|
+
* @default {}
|
|
83
|
+
*/
|
|
84
|
+
slotProps?: DayCalendarSlotsComponentsProps<TDate>;
|
|
76
85
|
}
|
|
77
86
|
/**
|
|
78
87
|
* @ignore - do not document.
|
|
@@ -133,7 +133,7 @@ const PickersCalendarWeek = styled('div', {
|
|
|
133
133
|
justifyContent: 'center'
|
|
134
134
|
});
|
|
135
135
|
function WrappedDay(_ref) {
|
|
136
|
-
var
|
|
136
|
+
var _slots$day;
|
|
137
137
|
let {
|
|
138
138
|
parentProps,
|
|
139
139
|
day,
|
|
@@ -149,8 +149,6 @@ function WrappedDay(_ref) {
|
|
|
149
149
|
disableHighlightToday,
|
|
150
150
|
isMonthSwitchingAnimating,
|
|
151
151
|
showDaysOutsideCurrentMonth,
|
|
152
|
-
components,
|
|
153
|
-
componentsProps,
|
|
154
152
|
slots,
|
|
155
153
|
slotProps,
|
|
156
154
|
timezone
|
|
@@ -160,11 +158,11 @@ function WrappedDay(_ref) {
|
|
|
160
158
|
const isFocusableDay = focusableDay !== null && utils.isSameDay(day, focusableDay);
|
|
161
159
|
const isSelected = selectedDays.some(selectedDay => utils.isSameDay(selectedDay, day));
|
|
162
160
|
const isToday = utils.isSameDay(day, now);
|
|
163
|
-
const Day = (
|
|
161
|
+
const Day = (_slots$day = slots == null ? void 0 : slots.day) != null ? _slots$day : PickersDay;
|
|
164
162
|
// We don't want to pass to ownerState down, to avoid re-rendering all the day whenever a prop changes.
|
|
165
163
|
const _useSlotProps = useSlotProps({
|
|
166
164
|
elementType: Day,
|
|
167
|
-
externalSlotProps:
|
|
165
|
+
externalSlotProps: slotProps == null ? void 0 : slotProps.day,
|
|
168
166
|
additionalProps: _extends({
|
|
169
167
|
disableHighlightToday,
|
|
170
168
|
showDaysOutsideCurrentMonth,
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import useEventCallback from '@mui/utils/useEventCallback';
|
|
4
4
|
import { useIsDateDisabled } from './useIsDateDisabled';
|
|
5
|
-
import { useUtils
|
|
5
|
+
import { useUtils } from '../internals/hooks/useUtils';
|
|
6
6
|
import { singleItemValueManager } from '../internals/utils/valueManagers';
|
|
7
7
|
import { SECTION_TYPE_GRANULARITY } from '../internals/utils/getDefaultReferenceDate';
|
|
8
8
|
export const createCalendarStateReducer = (reduceAnimations, disableSwitchToMonthOnDayFocus, utils) => (state, action) => {
|
|
@@ -49,7 +49,6 @@ export const useCalendarState = params => {
|
|
|
49
49
|
shouldDisableDate,
|
|
50
50
|
timezone
|
|
51
51
|
} = params;
|
|
52
|
-
const now = useNow(timezone);
|
|
53
52
|
const utils = useUtils();
|
|
54
53
|
const reducerFn = React.useRef(createCalendarStateReducer(Boolean(reduceAnimations), disableSwitchToMonthOnDayFocus, utils)).current;
|
|
55
54
|
const referenceDate = React.useMemo(() => {
|
|
@@ -73,7 +72,7 @@ export const useCalendarState = params => {
|
|
|
73
72
|
|
|
74
73
|
const [calendarState, dispatch] = React.useReducer(reducerFn, {
|
|
75
74
|
isMonthSwitchingAnimating: false,
|
|
76
|
-
focusedDay:
|
|
75
|
+
focusedDay: referenceDate,
|
|
77
76
|
currentMonth: utils.startOfMonth(referenceDate),
|
|
78
77
|
slideDirection: 'left'
|
|
79
78
|
});
|
package/DateField/DateField.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["
|
|
3
|
+
const _excluded = ["slots", "slotProps", "InputProps", "inputProps"],
|
|
4
4
|
_excluded2 = ["inputRef"],
|
|
5
5
|
_excluded3 = ["ref", "onPaste", "onKeyDown", "inputMode", "readOnly", "clearable", "onClear"];
|
|
6
6
|
import * as React from 'react';
|
|
@@ -23,14 +23,12 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
23
23
|
* - [DateField API](https://mui.com/x/api/date-pickers/date-field/)
|
|
24
24
|
*/
|
|
25
25
|
const DateField = /*#__PURE__*/React.forwardRef(function DateField(inProps, ref) {
|
|
26
|
-
var
|
|
26
|
+
var _slots$textField;
|
|
27
27
|
const themeProps = useThemeProps({
|
|
28
28
|
props: inProps,
|
|
29
29
|
name: 'MuiDateField'
|
|
30
30
|
});
|
|
31
31
|
const {
|
|
32
|
-
components,
|
|
33
|
-
componentsProps,
|
|
34
32
|
slots,
|
|
35
33
|
slotProps,
|
|
36
34
|
InputProps,
|
|
@@ -38,10 +36,10 @@ const DateField = /*#__PURE__*/React.forwardRef(function DateField(inProps, ref)
|
|
|
38
36
|
} = themeProps,
|
|
39
37
|
other = _objectWithoutPropertiesLoose(themeProps, _excluded);
|
|
40
38
|
const ownerState = themeProps;
|
|
41
|
-
const TextField = (
|
|
39
|
+
const TextField = (_slots$textField = slots == null ? void 0 : slots.textField) != null ? _slots$textField : MuiTextField;
|
|
42
40
|
const _useSlotProps = useSlotProps({
|
|
43
41
|
elementType: TextField,
|
|
44
|
-
externalSlotProps:
|
|
42
|
+
externalSlotProps: slotProps == null ? void 0 : slotProps.textField,
|
|
45
43
|
externalForwardedProps: other,
|
|
46
44
|
ownerState
|
|
47
45
|
}),
|
|
@@ -76,9 +74,7 @@ const DateField = /*#__PURE__*/React.forwardRef(function DateField(inProps, ref)
|
|
|
76
74
|
fieldProps,
|
|
77
75
|
InputProps: fieldProps.InputProps,
|
|
78
76
|
slots,
|
|
79
|
-
slotProps
|
|
80
|
-
components,
|
|
81
|
-
componentsProps
|
|
77
|
+
slotProps
|
|
82
78
|
});
|
|
83
79
|
return /*#__PURE__*/_jsx(TextField, _extends({
|
|
84
80
|
ref: ref
|
|
@@ -118,18 +114,6 @@ process.env.NODE_ENV !== "production" ? DateField.propTypes = {
|
|
|
118
114
|
*/
|
|
119
115
|
color: PropTypes.oneOf(['error', 'info', 'primary', 'secondary', 'success', 'warning']),
|
|
120
116
|
component: PropTypes.elementType,
|
|
121
|
-
/**
|
|
122
|
-
* Overridable components.
|
|
123
|
-
* @default {}
|
|
124
|
-
* @deprecated Please use `slots`.
|
|
125
|
-
*/
|
|
126
|
-
components: PropTypes.object,
|
|
127
|
-
/**
|
|
128
|
-
* The props used for each component slot.
|
|
129
|
-
* @default {}
|
|
130
|
-
* @deprecated Please use `slotProps`.
|
|
131
|
-
*/
|
|
132
|
-
componentsProps: PropTypes.object,
|
|
133
117
|
/**
|
|
134
118
|
* The default value. Use when the component is not controlled.
|
|
135
119
|
*/
|
|
@@ -7,7 +7,6 @@ import { UseFieldInternalProps } from '../internals/hooks/useField';
|
|
|
7
7
|
import { DefaultizedProps, MakeOptional } from '../internals/models/helpers';
|
|
8
8
|
import { BaseDateValidationProps, DayValidationProps, MonthValidationProps, YearValidationProps } from '../internals/models/validation';
|
|
9
9
|
import { FieldsTextFieldProps } from '../internals/models/fields';
|
|
10
|
-
import { SlotsAndSlotProps } from '../internals/utils/slots-migration';
|
|
11
10
|
export interface UseDateFieldParams<TDate, TChildProps extends {}> {
|
|
12
11
|
props: UseDateFieldComponentProps<TDate, TChildProps>;
|
|
13
12
|
inputRef?: React.Ref<HTMLInputElement>;
|
|
@@ -16,7 +15,17 @@ export interface UseDateFieldProps<TDate> extends MakeOptional<UseFieldInternalP
|
|
|
16
15
|
}
|
|
17
16
|
export type UseDateFieldDefaultizedProps<TDate> = DefaultizedProps<UseDateFieldProps<TDate>, keyof BaseDateValidationProps<any> | 'format'>;
|
|
18
17
|
export type UseDateFieldComponentProps<TDate, TChildProps extends {}> = Omit<TChildProps, keyof UseDateFieldProps<TDate>> & UseDateFieldProps<TDate>;
|
|
19
|
-
export interface DateFieldProps<TDate> extends UseDateFieldComponentProps<TDate, FieldsTextFieldProps
|
|
18
|
+
export interface DateFieldProps<TDate> extends UseDateFieldComponentProps<TDate, FieldsTextFieldProps> {
|
|
19
|
+
/**
|
|
20
|
+
* Overridable component slots.
|
|
21
|
+
* @default {}
|
|
22
|
+
*/
|
|
23
|
+
slots?: DateFieldSlotsComponent;
|
|
24
|
+
/**
|
|
25
|
+
* The props used for each component slot.
|
|
26
|
+
* @default {}
|
|
27
|
+
*/
|
|
28
|
+
slotProps?: DateFieldSlotsComponentsProps<TDate>;
|
|
20
29
|
}
|
|
21
30
|
export type DateFieldOwnerState<TDate> = DateFieldProps<TDate>;
|
|
22
31
|
export interface DateFieldSlotsComponent extends FieldSlotsComponents {
|
|
@@ -25,7 +34,7 @@ export interface DateFieldSlotsComponent extends FieldSlotsComponents {
|
|
|
25
34
|
* Receives the same props as `@mui/material/TextField`.
|
|
26
35
|
* @default TextField from '@mui/material'
|
|
27
36
|
*/
|
|
28
|
-
|
|
37
|
+
textField?: React.ElementType;
|
|
29
38
|
}
|
|
30
39
|
export interface DateFieldSlotsComponentsProps<TDate> extends FieldSlotsComponentsProps {
|
|
31
40
|
textField?: SlotComponentProps<typeof TextField, {}, DateFieldOwnerState<TDate>>;
|
package/DatePicker/DatePicker.js
CHANGED
|
@@ -64,18 +64,6 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
|
|
|
64
64
|
* @default `true` for desktop, `false` for mobile (based on the chosen wrapper and `desktopModeMediaQuery` prop).
|
|
65
65
|
*/
|
|
66
66
|
closeOnSelect: PropTypes.bool,
|
|
67
|
-
/**
|
|
68
|
-
* Overridable components.
|
|
69
|
-
* @default {}
|
|
70
|
-
* @deprecated Please use `slots`.
|
|
71
|
-
*/
|
|
72
|
-
components: PropTypes.object,
|
|
73
|
-
/**
|
|
74
|
-
* The props used for each component slot.
|
|
75
|
-
* @default {}
|
|
76
|
-
* @deprecated Please use `slotProps`.
|
|
77
|
-
*/
|
|
78
|
-
componentsProps: PropTypes.object,
|
|
79
67
|
/**
|
|
80
68
|
* Formats the day of week displayed in the calendar header.
|
|
81
69
|
* @param {string} day The day of week provided by the adapter. Deprecated, will be removed in v7: Use `date` instead.
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { DesktopDatePickerProps, DesktopDatePickerSlotsComponent, DesktopDatePickerSlotsComponentsProps } from '../DesktopDatePicker';
|
|
2
|
-
import { UncapitalizeObjectKeys } from '../internals/utils/slots-migration';
|
|
3
2
|
import { MobileDatePickerProps, MobileDatePickerSlotsComponent, MobileDatePickerSlotsComponentsProps } from '../MobileDatePicker';
|
|
4
3
|
export interface DatePickerSlotsComponents<TDate> extends DesktopDatePickerSlotsComponent<TDate>, MobileDatePickerSlotsComponent<TDate> {
|
|
5
4
|
}
|
|
@@ -17,23 +16,11 @@ export interface DatePickerProps<TDate> extends DesktopDatePickerProps<TDate>, M
|
|
|
17
16
|
* @default 4 on desktop, 3 on mobile
|
|
18
17
|
*/
|
|
19
18
|
yearsPerRow?: 3 | 4;
|
|
20
|
-
/**
|
|
21
|
-
* Overridable components.
|
|
22
|
-
* @default {}
|
|
23
|
-
* @deprecated Please use `slots`.
|
|
24
|
-
*/
|
|
25
|
-
components?: DatePickerSlotsComponents<TDate>;
|
|
26
|
-
/**
|
|
27
|
-
* The props used for each component slot.
|
|
28
|
-
* @default {}
|
|
29
|
-
* @deprecated Please use `slotProps`.
|
|
30
|
-
*/
|
|
31
|
-
componentsProps?: DatePickerSlotsComponentsProps<TDate>;
|
|
32
19
|
/**
|
|
33
20
|
* Overridable component slots.
|
|
34
21
|
* @default {}
|
|
35
22
|
*/
|
|
36
|
-
slots?:
|
|
23
|
+
slots?: DatePickerSlotsComponents<TDate>;
|
|
37
24
|
/**
|
|
38
25
|
* The props used for each component slot.
|
|
39
26
|
* @default {}
|