@mui/x-data-grid-pro 6.0.0-alpha.3 → 6.0.0-alpha.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/CHANGELOG.md +420 -168
  2. package/DataGridPro/DataGridPro.js +14 -14
  3. package/DataGridPro/useDataGridProComponent.js +4 -5
  4. package/LICENSE +6 -7
  5. package/hooks/features/columnPinning/useGridColumnPinningPreProcessors.js +8 -8
  6. package/hooks/features/columnReorder/useGridColumnReorder.js +13 -15
  7. package/hooks/features/detailPanel/useGridDetailPanelPreProcessors.js +2 -2
  8. package/hooks/features/rowReorder/useGridRowReorderPreProcessors.js +2 -2
  9. package/hooks/features/treeData/useGridTreeDataPreProcessors.js +3 -3
  10. package/index.js +1 -1
  11. package/legacy/DataGridPro/DataGridPro.js +14 -14
  12. package/legacy/DataGridPro/useDataGridProComponent.js +4 -5
  13. package/legacy/hooks/features/columnPinning/useGridColumnPinningPreProcessors.js +8 -8
  14. package/legacy/hooks/features/columnReorder/useGridColumnReorder.js +13 -15
  15. package/legacy/hooks/features/detailPanel/useGridDetailPanelPreProcessors.js +2 -2
  16. package/legacy/hooks/features/rowReorder/useGridRowReorderPreProcessors.js +2 -2
  17. package/legacy/hooks/features/treeData/useGridTreeDataPreProcessors.js +3 -3
  18. package/legacy/index.js +1 -1
  19. package/legacy/utils/releaseInfo.js +1 -1
  20. package/modern/DataGridPro/DataGridPro.js +14 -14
  21. package/modern/DataGridPro/useDataGridProComponent.js +4 -5
  22. package/modern/hooks/features/columnPinning/useGridColumnPinningPreProcessors.js +8 -8
  23. package/modern/hooks/features/columnReorder/useGridColumnReorder.js +13 -7
  24. package/modern/hooks/features/detailPanel/useGridDetailPanelPreProcessors.js +2 -2
  25. package/modern/hooks/features/rowReorder/useGridRowReorderPreProcessors.js +2 -2
  26. package/modern/hooks/features/treeData/useGridTreeDataPreProcessors.js +3 -3
  27. package/modern/index.js +1 -1
  28. package/modern/utils/releaseInfo.js +1 -1
  29. package/node/DataGridPro/DataGridPro.js +14 -14
  30. package/node/DataGridPro/useDataGridProComponent.js +3 -4
  31. package/node/hooks/features/columnPinning/useGridColumnPinningPreProcessors.js +8 -8
  32. package/node/hooks/features/columnReorder/useGridColumnReorder.js +13 -15
  33. package/node/hooks/features/detailPanel/useGridDetailPanelPreProcessors.js +2 -2
  34. package/node/hooks/features/rowReorder/useGridRowReorderPreProcessors.js +2 -2
  35. package/node/hooks/features/treeData/useGridTreeDataPreProcessors.js +3 -3
  36. package/node/index.js +1 -1
  37. package/node/utils/releaseInfo.js +1 -1
  38. package/package.json +3 -3
  39. package/utils/releaseInfo.js +1 -1
package/CHANGELOG.md CHANGED
@@ -3,7 +3,257 @@
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
- ## v6.0.0-alpha.3
6
+ ## 6.0.0-alpha.5
7
+
8
+ _Oct 31, 2022_
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
+ - ⚡ Fix memory leak during unmount of the DataGrid (#6620) @cherniavskii
13
+ - 📝 New guide for migrating pickers from v5 to v6 (#6472) @flaviendelangle
14
+ - 🎁 Allow to disable the autofocus of the search field when opening the column visibility panel (#6444) @e-cloud
15
+ - 🐞 Bugfixes
16
+
17
+ ### `@mui/x-data-grid@v6.0.0-alpha.5` / `@mui/x-data-grid-pro@v6.0.0-alpha.5` / `@mui/x-data-grid-premium@v6.0.0-alpha.5`
18
+
19
+ #### Breaking changes
20
+
21
+ - Stop exporting `gridColumnsSelector` (#6693) @m4theushw
22
+
23
+ The `gridColumnsSelector` was deprecated during v5 and is now removed from the export list.
24
+
25
+ Please consider using one of the following selectors as a replacement:
26
+
27
+ - `gridColumnFieldsSelector`, to obtain the column fields in the order they appear on the screen;
28
+ - `gridColumnLookupSelector`, to access column definitions by field;
29
+ - `gridColumnVisibilityModelSelector`, for the visibility state of each column.
30
+
31
+ #### Changes
32
+
33
+ - [DataGrid] Allow to disable autofocusing the search field in the columns panel (#6444) @e-cloud
34
+ - [DataGrid] Fix `setRows` method not persisting new rows data after `loading` prop change (#6493) @cherniavskii
35
+ - [DataGrid] Fix memory leak on grid unmount (#6620) @cherniavskii
36
+ - [DataGrid] Rename `GridColumnsState['all']` to `GridColumnsState['orderedFields']` (#6562) @DanailH
37
+ - [DataGrid] Remove `React.memo` from `GridCellCheckboxRenderer` (#6655) @mattcorner
38
+ - [DataGrid] Stop exporting `gridColumnsSelector` (#6693)
39
+ - [l10n] Improve Bulgarian (bg-BG) locale (#6578) @AtanasVA
40
+
41
+ ### `@mui/x-date-pickers@v6.0.0-alpha.5` / `@mui/x-date-pickers-pro@v6.0.0-alpha.5`
42
+
43
+ #### Breaking changes
44
+
45
+ - [pickers] Rename remaining `private` components (#6550) @LukasTy
46
+ Previously we had 4 component names with `Private` prefix in order to avoid breaking changes in v5.
47
+ These components were renamed:
48
+
49
+ - `PrivatePickersMonth` -> `MuiPickersMonth`
50
+ - `PrivatePickersSlideTransition` -> `MuiPickersSlideTransition`
51
+ - `PrivatePickersToolbarText` -> `MuiPickersToolbarText`
52
+ - `PrivatePickersYear` -> `MuiPickersYear`
53
+
54
+ Manual style overriding will need to use updated classes:
55
+
56
+ ```diff
57
+ -.PrivatePickersMonth-root {
58
+ +.MuiPickersMonth-root {
59
+
60
+ -.PrivatePickersSlideTransition-root {
61
+ +.MuiPickersSlideTransition-root {
62
+
63
+ -.PrivatePickersToolbarText-root {
64
+ +.MuiPickersToolbarText-root {
65
+
66
+ -.PrivatePickersYear-root {
67
+ +.MuiPickersYear-root {
68
+ ```
69
+
70
+ Component name changes are also reflected in `themeAugmentation`:
71
+
72
+ ```diff
73
+ const theme = createTheme({
74
+ components: {
75
+ - PrivatePickersMonth: {
76
+ + MuiPickersMonth: {
77
+ // overrides
78
+ },
79
+ - PrivatePickersSlideTransition: {
80
+ + MuiPickersSlideTransition: {
81
+ // overrides
82
+ },
83
+ - PrivatePickersToolbarText: {
84
+ + MuiPickersToolbarText: {
85
+ // overrides
86
+ },
87
+ - PrivatePickersYear: {
88
+ + MuiPickersYear: {
89
+ // overrides
90
+ },
91
+ },
92
+ });
93
+ ```
94
+
95
+ #### Changes
96
+
97
+ - [DateTimePicker] Fix toolbar time order when `theme.rtl=true` (#6636) @alexfauquette
98
+ - [pickers] Import fixes for mask editing (#6623) @alexfauquette
99
+ - [pickers] Rename remaining `private` components (#6550) @LukasTy
100
+ - [pickers] New `DesktopDatePicker` based on `DateField` (#6548) @flaviendelangle
101
+
102
+ ### Docs
103
+
104
+ - [docs] Add feedback in next doc (#6591) @alexfauquette
105
+ - [docs] Check link validity in PR (#6497) @alexfauquette
106
+ - [docs] Disable translations (#6560) @cherniavskii
107
+ - [docs] Fix typo in DataGrid demo page (#6632) @banoth-ravinder
108
+ - [docs] New page to migrate pickers from v5 to v6 (#6472) @flaviendelangle
109
+ - [docs] Remove broken welcome page (#6585) @alexfauquette
110
+ - [docs] Mark data grid column group as available (#6660) @alexfauquette
111
+ - [docs] Fix double space @oliviertassinari
112
+
113
+ ### Core
114
+
115
+ - [core] Fix duplicate CodeQL build @oliviertassinari
116
+ - [core] Fix spreading on validation page (#6624) @flaviendelangle
117
+ - [core] Small TypeScript improvements (#6575) @flaviendelangle
118
+ - [core] Upgrade monorepo (#6594) @oliviertassinari
119
+ - [core] Change reproduction position (#6621) @oliviertassinari
120
+ - [core] Fix permissions in `no-response` workflow (#6658) @cherniavskii
121
+ - [core] Remove legacy migration function (#6669) @oliviertassinari
122
+ - [license] Improve the license content (#6459) @oliviertassinari
123
+ - [test] Test Arrow up/down on every token (#6563) @alexfauquette
124
+
125
+ ## 6.0.0-alpha.4
126
+
127
+ _Oct 20, 2022_
128
+
129
+ We'd like to offer a big thanks to the 9 contributors who made this release possible. Here are some highlights ✨:
130
+
131
+ - 📝 Manage pickers' toolbar customization with slots
132
+ - 🐞 Bugfixes
133
+ - 🌍 Improve Turkish (tr-TR) locale on the data grid and pickers (#6542) @ramazansancar
134
+
135
+ ### `@mui/x-data-grid@v6.0.0-alpha.4` / `@mui/x-data-grid-pro@v6.0.0-alpha.4` / `@mui/x-data-grid-premium@v6.0.0-alpha.4`
136
+
137
+ #### Breaking changes
138
+
139
+ - To avoid confusion with the props that will be added for the cell selection feature, some props related to row selection were renamed to have "row" in their name.
140
+ The renamed props are the following:
141
+
142
+ | Old name | New name |
143
+ |----------------------------|-------------------------------|
144
+ | `selectionModel` | `rowSelectionModel` |
145
+ | `onSelectionModelChange` | `onRowSelectionModelChange` |
146
+ | `disableSelectionOnClick` | `disableRowSelectionOnClick` |
147
+ | `disableMultipleSelection` | `disableMultipleRowSelection` |
148
+
149
+ - The `gridSelectionStateSelector` selector was renamed to `gridRowSelectionStateSelector`.
150
+
151
+ - The `selectionChange` event was renamed to `rowSelectionChange`.
152
+
153
+ #### Changes
154
+
155
+ - [DataGrid] Add `searchPredicate` prop to `GridColumnsPanel` component (#6557) @cherniavskii
156
+ - [DataGrid] Support keyboard navigation in column group header (#5947) @alexfauquette
157
+ - [DataGrid] Fix grid not updating state on `rowCount` prop change (#5982) @cherniavskii
158
+ - [DataGrid] Rename selection props (#6556) @m4theushw
159
+ - [l10n] Improve Turkish (tr-TR) locale on the data grid and pickers (#6542) @ramazansancar
160
+
161
+ ### `@mui/x-date-pickers@v6.0.0-alpha.4` / `@mui/x-date-pickers-pro@v6.0.0-alpha.4`
162
+
163
+ #### Breaking changes
164
+
165
+ - The `ToolbarComponent` has been replaced by a `Toolbar` component slot.
166
+ You can find more information about this pattern in the [MUI Base documentation](https://mui.com/base/getting-started/usage/#shared-props):
167
+
168
+ ```diff
169
+ // Same on all other pickers
170
+ <DatePicker
171
+ - ToolbarComponent: MyToolbar,
172
+ + components={{ Toolbar: MyToolbar }}
173
+ />
174
+ ```
175
+
176
+ - The `toolbarPlaceholder` and `toolbarFormat` props have been moved to the `toolbar` components props slot:
177
+
178
+ ```diff
179
+ // Same on all other pickers
180
+ <DatePicker
181
+ - toolbarPlaceholder="__"
182
+ - toolbarFormat="DD / MM / YYYY"
183
+ + componentsProps={{
184
+ + toolbar: {
185
+ + toolbarPlaceholder: '__',
186
+ + toolbarFormat: 'DD / MM / YYYY',
187
+ + }
188
+ + }}
189
+ />
190
+ ```
191
+
192
+ - The `toolbarTitle` prop has been moved to the localization object:
193
+
194
+ ```diff
195
+ // Same on all other pickers
196
+ <DatePicker
197
+ - toolbarTitle="Title"
198
+ + localeText={{ toolbarTitle: 'Title' }}
199
+ />
200
+ ```
201
+
202
+ - The toolbar related translation keys have been renamed to better fit their usage:
203
+
204
+ ```diff
205
+ // Same on all other pickers
206
+ <DatePicker
207
+ localeText={{
208
+ - datePickerDefaultToolbarTitle: 'Date Picker',
209
+ + datePickerToolbarTitle: 'Date Picker',
210
+
211
+ - timePickerDefaultToolbarTitle: 'Time Picker',
212
+ + timePickerToolbarTitle: 'Time Picker',
213
+
214
+ - dateTimePickerDefaultToolbarTitle: 'Date Time Picker',
215
+ + dateTimePickerToolbarTitle: 'Date Time Picker',
216
+
217
+ - dateRangePickerDefaultToolbarTitle: 'Date Range Picker',
218
+ + dateRangePickerToolbarTitle: 'Date Range Picker',
219
+ }}
220
+ />
221
+ ```
222
+
223
+ - The `onChange` / `openView` props on the toolbar have been renamed `onViewChange` / `view`
224
+
225
+ #### Changes
226
+
227
+ - [fields] Add a `validationError` property to the `onChange` callback (#6539) @flaviendelangle
228
+ - [fields] Distinguish start and end input error on multi input fields (#6503) @flaviendelangle
229
+ - [pickers] Clean the `Tabs` component slot (#6543) @flaviendelangle
230
+ - [pickers] Fix localization of the placeholder (#6547) @alexfauquette
231
+ - [pickers] Fix TypeScript issues (#6322) @flaviendelangle
232
+ - [pickers] Improve error consistency between single and multiple range pickers (#6561) @alexfauquette
233
+ - [pickers] Refactor `@mui/material` imports to `@mui/utils` (#6443) @LukasTy
234
+ - [pickers] Replace toolbar's props by a component slot (#6445) @flaviendelangle
235
+
236
+ ### Docs
237
+
238
+ - [docs] Enable inlined preview for disabled date picker (#6477) @oliviertassinari
239
+ - [docs] Fix 404 errors (#6541) @alexfauquette
240
+ - [docs] Fix broken links on field pages (#6501) @flaviendelangle
241
+ - [docs] Improve markdownlint (#6518) @oliviertassinari
242
+
243
+ ### Core
244
+
245
+ - [core] Run CodeQL only on schedule @oliviertassinari
246
+ - [core] Fix trailing spaces and git diff format (#6523) @oliviertassinari
247
+ - [core] Harden GitHub Actions permissions (#6396) @step-security-bot
248
+ - [core] Improve the playground DX (#6514) @oliviertassinari
249
+ - [core] Link Netlify in the danger comment (#6513) @oliviertassinari
250
+ - [core] Organize tests for pickers slots (#6546) @flaviendelangle
251
+ - [core] Remove outdated `docsearch.js` dependency (#6242) @oliviertassinari
252
+ - [core] Upgrade monorepo (#6549) @cherniavskii
253
+ - [test] Add validation test on range pickers (#6504) @alexfauquette
254
+ - [test] Remove BrowserStack (#6263) @DanailH
255
+
256
+ ## 6.0.0-alpha.3
7
257
 
8
258
  _Oct 13, 2022_
9
259
 
@@ -17,7 +267,7 @@ We'd like to offer a big thanks to the 8 contributors who made this release poss
17
267
  - [`MultiInputDateRangeField` / `SingleInputDateRangeField`](https://next.mui.com/x/react-date-pickers/date-range-field/) to edit date range
18
268
  - [`MultiInputTimeRangeField`](https://next.mui.com/x/react-date-pickers/time-range-field/) to edit time range with two inputs
19
269
  - [`MultiInputDateTimeRangeField`](https://next.mui.com/x/react-date-pickers/date-time-range-field/) to edit date and time range with two inputs
20
-
270
+
21
271
  ⚠️ These components are unstable.
22
272
  They might receive breaking changes on their props to have the best components possible by the time of the stable release.
23
273
 
@@ -71,83 +321,83 @@ We'd like to offer a big thanks to the 8 contributors who made this release poss
71
321
  The `DialogProps` prop has been replaced by a `dialog` component props slot on responsive and mobile pickers:
72
322
 
73
323
  ```diff
74
- // Same on MobileDatePicker, DateTimePicker, MobileDateTimePicker,
75
- // TimePicker, MobileTimePicker, DateRangePicker and MobileDateRangePicker.
76
- <DatePicker
324
+ // Same on MobileDatePicker, DateTimePicker, MobileDateTimePicker,
325
+ // TimePicker, MobileTimePicker, DateRangePicker and MobileDateRangePicker.
326
+ <DatePicker
77
327
  - DialogProps={{ backgroundColor: 'red' }}
78
328
  + componentsProps={{ dialog: { backgroundColor: 'red }}}
79
- />
329
+ />
80
330
  ```
81
331
 
82
332
  The `PaperProps` prop has been replaced by a `desktopPaper` component props slot on all responsive and desktop pickers:
83
333
 
84
334
  ```diff
85
- // Same on DesktopDatePicker, DateTimePicker, DesktopDateTimePicker,
86
- // TimePicker, DesktopTimePicker, DateRangePicker and DesktopDateRangePicker.
87
- <DatePicker
335
+ // Same on DesktopDatePicker, DateTimePicker, DesktopDateTimePicker,
336
+ // TimePicker, DesktopTimePicker, DateRangePicker and DesktopDateRangePicker.
337
+ <DatePicker
88
338
  - PaperProps={{ backgroundColor: 'red' }}
89
339
  + componentsProps={{ desktopPaper: { backgroundColor: 'red }}}
90
- />
340
+ />
91
341
  ```
92
342
 
93
343
  The `PopperProps` prop has been replaced by a `popper` component props slot on all responsive and desktop pickers:
94
344
 
95
345
  ```diff
96
- // Same on DesktopDatePicker, DateTimePicker, DesktopDateTimePicker,
97
- // TimePicker, DesktopTimePicker, DateRangePicker and DesktopDateRangePicker.
98
- <DatePicker
346
+ // Same on DesktopDatePicker, DateTimePicker, DesktopDateTimePicker,
347
+ // TimePicker, DesktopTimePicker, DateRangePicker and DesktopDateRangePicker.
348
+ <DatePicker
99
349
  - PopperProps={{ onClick: handleClick }}
100
350
  + componentsProps={{ popper: { onClick: handleClick }}}
101
- />
351
+ />
102
352
  ```
103
353
 
104
354
  The `TransitionComponent` prop has been replaced by a `DesktopTransition` component slot on all responsive and desktop pickers:
105
355
 
106
356
  ```diff
107
- // Same on DesktopDatePicker, DateTimePicker, DesktopDateTimePicker,
108
- // TimePicker, DesktopTimePicker, DateRangePicker and DesktopDateRangePicker.
109
- <DatePicker
357
+ // Same on DesktopDatePicker, DateTimePicker, DesktopDateTimePicker,
358
+ // TimePicker, DesktopTimePicker, DateRangePicker and DesktopDateRangePicker.
359
+ <DatePicker
110
360
  - TransitionComponent={Fade}
111
361
  + components={{ DesktopTransition: Fade }}
112
- />
362
+ />
113
363
  ```
114
364
 
115
365
  The `TrapFocusProps` prop has been replaced by a `desktopTrapFocus` component props slot on all responsive and desktop pickers:
116
366
 
117
367
  ```diff
118
- // Same on DesktopDatePicker, DateTimePicker, DesktopDateTimePicker,
119
- // TimePicker, DesktopTimePicker, DateRangePicker and DesktopDateRangePicker.
120
- <DatePicker
368
+ // Same on DesktopDatePicker, DateTimePicker, DesktopDateTimePicker,
369
+ // TimePicker, DesktopTimePicker, DateRangePicker and DesktopDateRangePicker.
370
+ <DatePicker
121
371
  - TrapFocusProps={{ isEnabled: () => false }}
122
372
  + componentsProps={{ desktopTrapFocus: { isEnabled: () => false }}}
123
- />
373
+ />
124
374
  ```
125
-
375
+
126
376
  - The view components allowing to pick a date or parts of a date without an input have been renamed to better fit their usage:
127
377
 
128
378
  ```diff
129
379
  -<CalendarPicker {...props} />
130
- +<DateCalendar {...props} />
380
+ +<DateCalendar {...props} />
131
381
  ```
132
382
 
133
383
  ```diff
134
384
  -<DayPicker {...props} />
135
- +<DayCalendar {...props} />
385
+ +<DayCalendar {...props} />
136
386
  ```
137
387
 
138
388
  ```diff
139
389
  -<CalendarPickerSkeleton {...props} />
140
- +<DayCalendarSkeleton {...props} />
390
+ +<DayCalendarSkeleton {...props} />
141
391
  ```
142
392
 
143
393
  ```diff
144
394
  -<MonthPicker {...props} />
145
- +<MonthCalendar {...props} />
395
+ +<MonthCalendar {...props} />
146
396
  ```
147
397
 
148
398
  ```diff
149
399
  -<YearPicker {...props} />
150
- +<YearCalendar {...props} />
400
+ +<YearCalendar {...props} />
151
401
  ```
152
402
 
153
403
  - Component names in the theme have changed as well:
@@ -211,7 +461,7 @@ We'd like to offer a big thanks to the 8 contributors who made this release poss
211
461
  - [core] Test validation on textfield and date views (#6265) @alexfauquette
212
462
  - [test] Sync comment with monorepo @oliviertassinari
213
463
 
214
- ## v6.0.0-alpha.2
464
+ ## 6.0.0-alpha.2
215
465
 
216
466
  _Oct 7, 2022_
217
467
 
@@ -256,7 +506,7 @@ We'd like to offer a big thanks to the 10 contributors who made this release pos
256
506
  You can find more information about this pattern in the [MUI Base documentation](https://mui.com/base/getting-started/usage/#shared-props).
257
507
 
258
508
  ```diff
259
- // Same for any other date, date time or date range picker.
509
+ // Same for any other date, date time or date range picker.
260
510
  <DatePicker
261
511
  - renderDay={(_, dayProps) => <CustomDay {...dayProps} />}
262
512
  + components={{ Day: CustomDay }}
@@ -438,17 +688,17 @@ We'd like to offer a big thanks to the 12 contributors who made this release pos
438
688
  - The deprecated `hide` column property has been removed in favor of the `columnVisibilityModel` prop and initial state.
439
689
 
440
690
  ```diff
441
- <DataGrid
442
- columns={[
443
- field: 'id,
444
- - hide: true,
445
- ]}
691
+ <DataGrid
692
+ columns={[
693
+ field: 'id,
694
+ - hide: true,
695
+ ]}
446
696
  + initialState={{
447
697
  + columns: {
448
698
  + columnVisibilityModel: { id: false },
449
- + }
699
+ + },
450
700
  + }}
451
- />
701
+ />
452
702
  ```
453
703
 
454
704
  You can find more information about this new API on our [documentation](https://next.mui.com/x/react-data-grid/column-visibility/).
@@ -456,8 +706,8 @@ We'd like to offer a big thanks to the 12 contributors who made this release pos
456
706
  - The `GridEvents` enum is now a TypeScript type.
457
707
 
458
708
  ```diff
459
- - apiRef.current.subscribeEvent(GridEvents.rowClick', handleRowClick)
460
- + apiRef.current.subscribeEvent('rowClick', handleRowClick)
709
+ -apiRef.current.subscribeEvent(GridEvents.rowClick', handleRowClick);
710
+ +apiRef.current.subscribeEvent('rowClick', handleRowClick);
461
711
  ```
462
712
 
463
713
  #### Changes
@@ -491,14 +741,14 @@ We'd like to offer a big thanks to the 12 contributors who made this release pos
491
741
  For instance if you want to replace the `startText` / `endText`
492
742
 
493
743
  ```diff
494
- <DateRangePicker
744
+ <DateRangePicker
495
745
  - startText="From"
496
746
  - endText="To"
497
747
  + localeText={{
498
748
  + start: 'From',
499
749
  + end: 'To',
500
750
  + }}
501
- />
751
+ />
502
752
  ```
503
753
 
504
754
  You can find more information about the new api, including how to set those translations on all your components at once in the [documentation](https://next.mui.com/x/react-date-pickers/localization/)
@@ -506,51 +756,50 @@ You can find more information about the new api, including how to set those tran
506
756
  - The deprecated `locale` prop of the `LocalizationProvider` component have been renamed `adapterLocale`:
507
757
 
508
758
  ```diff
509
- <LocalizationProvider
510
- dateAdapter={AdapterDayjs}
511
- - locale="fr"
759
+ <LocalizationProvider
760
+ dateAdapter={AdapterDayjs}
761
+ - locale="fr"
512
762
  + adapterLocale="fr"
513
- >
514
- {children}
515
- </LocalizationProvider>
763
+ >
764
+ {children}
765
+ </LocalizationProvider>
516
766
  ```
517
767
 
518
768
  - The component slots `LeftArrowButton` and `RightArrowButton` have been renamed `PreviousIconButton` and `NextIconButton` to better describe there usage:
519
769
 
520
770
  ```diff
521
- <DatePicker
522
- components={{
523
- - LeftArrowButton: CustomButton,
524
- + PreviousIconButton: CustomButton,
525
-
526
- - RightArrowButton: CustomButton,
527
- + NextIconButton: CustomButton,
528
- }}
771
+ <DatePicker
772
+ components={{
773
+ - LeftArrowButton: CustomButton,
774
+ + PreviousIconButton: CustomButton,
529
775
 
530
- componentsProps={{
531
- - leftArrowButton: {},
532
- + previousIconButton: {},
776
+ - RightArrowButton: CustomButton,
777
+ + NextIconButton: CustomButton,
778
+ }}
779
+ componentsProps={{
780
+ - leftArrowButton: {},
781
+ + previousIconButton: {},
533
782
 
534
- - rightArrowButton: {},
535
- + nextIconButton: {},
536
- }}
537
- />
783
+ - rightArrowButton: {},
784
+ + nextIconButton: {},
785
+ }}
786
+ />
538
787
  ```
539
788
 
540
789
  - The `date` prop has been renamed `value` on `MonthPicker` / `YearPicker`, `ClockPicker` and `CalendarPicker`.
541
790
 
542
791
  ```diff
543
- - <MonthPicker date={dayjs()} onChange={handleMonthChange} />
544
- + <MonthPicker value={dayjs()} onChange={handleMonthChange} />
792
+ -<MonthPicker date={dayjs()} onChange={handleMonthChange} />
793
+ +<MonthPicker value={dayjs()} onChange={handleMonthChange} />
545
794
 
546
- - <YearPicker date={dayjs()} onChange={handleYearChange} />
547
- + <YearPicker value={dayjs()} onChange={handleYearChange} />
795
+ -<YearPicker date={dayjs()} onChange={handleYearChange} />
796
+ +<YearPicker value={dayjs()} onChange={handleYearChange} />
548
797
 
549
- - <ClockPicker date={dayjs()} onChange={handleTimeChange} />
550
- + <ClockPicker value={dayjs()} onChange={handleTimeChange} />
798
+ -<ClockPicker date={dayjs()} onChange={handleTimeChange} />
799
+ +<ClockPicker value={dayjs()} onChange={handleTimeChange} />
551
800
 
552
- - <CalendarPicker date={dayjs()} onChange={handleDateChange} />
553
- + <CalendarPicker value={dayjs()} onChange={handleDateChange} />
801
+ -<CalendarPicker date={dayjs()} onChange={handleDateChange} />
802
+ +<CalendarPicker value={dayjs()} onChange={handleDateChange} />
554
803
  ```
555
804
 
556
805
  #### Changes
@@ -606,7 +855,7 @@ You can find more information about the new api, including how to set those tran
606
855
  - [test] Skip tests for column pinning and dynamic row height (#5997) @m4theushw
607
856
  - [website] Improve security header @oliviertassinari
608
857
 
609
- ## v5.17.4
858
+ ## 5.17.4
610
859
 
611
860
  _Sep 22, 2022_
612
861
 
@@ -1994,10 +2243,10 @@ We'd like to offer a big thanks to the 15 contributors who made this release pos
1994
2243
  | `filterableGridColumnsSelector` | `gridFilterableColumnDefinitionsSelector` |
1995
2244
 
1996
2245
  ```diff
1997
- -const { all, lookup, columnVisibilityModel } = gridColumnsSelector(apiRef)
1998
- +const all = gridColumnFieldsSelector(apiRef)
1999
- +const lookup = gridColumnLookupSelector(apiRef)
2000
- +const columnVisibilityModel = gridColumnVisibilityModelSelector(apiRef)
2246
+ -const { all, lookup, columnVisibilityModel } = gridColumnsSelector(apiRef);
2247
+ +const all = gridColumnFieldsSelector(apiRef);
2248
+ +const lookup = gridColumnLookupSelector(apiRef);
2249
+ +const columnVisibilityModel = gridColumnVisibilityModelSelector(apiRef);
2001
2250
 
2002
2251
  -const filterableFields = filterableGridColumnsIdsSelector(apiRef);
2003
2252
  +const lookup = gridFilterableColumnLookupSelector(apiRef);
@@ -2934,7 +3183,7 @@ A big thanks to the 7 contributors who made this release possible. Here are some
2934
3183
 
2935
3184
  ```diff
2936
3185
  -visibleSortedGridRowsAsArraySelector: (state: GridState) => [GridRowId, GridRowData][];
2937
- +gridVisibleSortedRowEntriesSelector: (state: GridState) => GridRowEntry[]
3186
+ +gridVisibleSortedRowEntriesSelector: (state: GridState) => GridRowEntry[];
2938
3187
  ```
2939
3188
 
2940
3189
  - [DataGridPro] The `filterGridItemsCounterSelector` selector was removed. (#2942) @flaviendelangle
@@ -3034,15 +3283,15 @@ A big thanks to the 5 contributors who made this release possible. Here are some
3034
3283
  To fully control the state, use the feature's model prop and change callback (e.g. `filterModel` and `onFilterModelChange`).
3035
3284
 
3036
3285
  ```diff
3037
- <DataGrid
3286
+ <DataGrid
3038
3287
  - state={{
3039
3288
  + initialState={{
3040
- preferencePanel: {
3041
- open: true,
3042
- openedPanelValue: GridPreferencePanelsValue.filters,
3043
- },
3044
- }}
3045
- />
3289
+ preferencePanel: {
3290
+ open: true,
3291
+ openedPanelValue: GridPreferencePanelsValue.filters,
3292
+ },
3293
+ }}
3294
+ />
3046
3295
  ```
3047
3296
 
3048
3297
  - [DataGridPro] Remove the `onViewportRowsChange` prop and the `viewportRowsChange` event (#2673) @m4theushw
@@ -3145,12 +3394,12 @@ A big thanks to the 7 contributors who made this release possible. Here are some
3145
3394
  For more information, check [this page](https://mui.com/x/react-data-grid/components/#row). Example:
3146
3395
 
3147
3396
  ```diff
3148
- -<DataGrid onRowOver={handleRowOver} />;
3149
- +<DataGrid
3397
+ <DataGrid
3398
+ - onRowOver={handleRowOver}
3150
3399
  + componentsProps={{
3151
3400
  + row: { onMouseOver: handleRowOver },
3152
3401
  + }}
3153
- +/>;
3402
+ />;
3154
3403
  ```
3155
3404
 
3156
3405
  The `data-rowindex` and `data-rowselected` attributes were removed from the cell element. Equivalent attributes can be found in the row element.
@@ -3182,33 +3431,33 @@ A big thanks to the 7 contributors who made this release possible. Here are some
3182
3431
  - [DataGrid] The CSS classes constants are not exported anymore. Use `gridClasses` instead. (#2788) @flaviendelangle
3183
3432
 
3184
3433
  ```diff
3185
- -const columnHeaderClass = GRID_COLUMN_HEADER_CSS_CLASS
3186
- +const columnHeaderClass = gridClasses.columnHeader
3434
+ -const columnHeaderClass = GRID_COLUMN_HEADER_CSS_CLASS;
3435
+ +const columnHeaderClass = gridClasses.columnHeader;
3187
3436
 
3188
- -const rowClass = GRID_ROW_CSS_CLASS
3189
- +const rowClass = gridClasses.row
3437
+ -const rowClass = GRID_ROW_CSS_CLASS;
3438
+ +const rowClass = gridClasses.row;
3190
3439
 
3191
- -const cellClass = GRID_CELL_CSS_CLASS
3192
- +const cellClass = gridClasses.cell
3440
+ -const cellClass = GRID_CELL_CSS_CLASS;
3441
+ +const cellClass = gridClasses.cell;
3193
3442
 
3194
- -const columnSeparatorClass = GRID_COLUMN_HEADER_SEPARATOR_RESIZABLE_CSS_CLASS
3195
- +const columnSeparatorClass = gridClasses['columnSeparator--resizable']
3443
+ -const columnSeparatorClass = GRID_COLUMN_HEADER_SEPARATOR_RESIZABLE_CSS_CLASS;
3444
+ +const columnSeparatorClass = gridClasses['columnSeparator--resizable'];
3196
3445
 
3197
- -const columnHeaderTitleClass = GRID_COLUMN_HEADER_TITLE_CSS_CLASS
3198
- +const columnHeaderTitleClass = gridClasses.columnHeaderTitle
3446
+ -const columnHeaderTitleClass = GRID_COLUMN_HEADER_TITLE_CSS_CLASS;
3447
+ +const columnHeaderTitleClass = gridClasses.columnHeaderTitle;
3199
3448
 
3200
- -const columnHeaderDropZoneClass = GRID_COLUMN_HEADER_DROP_ZONE_CSS_CLASS
3201
- +const columnHeaderDropZoneClass = gridClasses.columnHeaderDropZone
3449
+ -const columnHeaderDropZoneClass = GRID_COLUMN_HEADER_DROP_ZONE_CSS_CLASS;
3450
+ +const columnHeaderDropZoneClass = gridClasses.columnHeaderDropZone;
3202
3451
 
3203
- -const columnHeaderDraggingClass = GRID_COLUMN_HEADER_DRAGGING_CSS_CLASS
3204
- +const columnHeaderDraggingClass = gridClasses["columnHeader--dragging"]
3452
+ -const columnHeaderDraggingClass = GRID_COLUMN_HEADER_DRAGGING_CSS_CLASS;
3453
+ +const columnHeaderDraggingClass = gridClasses['columnHeader--dragging'];
3205
3454
  ```
3206
3455
 
3207
3456
  - [DataGrid] Rename `gridCheckboxSelectionColDef` to `GRID_CHECKBOX_SELECTION_COL_DEF` (#2793) @flaviendelangle
3208
3457
 
3209
3458
  ```diff
3210
- - gridCheckboxSelectionColDef
3211
- + GRID_CHECKBOX_SELECTION_COL_DEF
3459
+ -gridCheckboxSelectionColDef
3460
+ +GRID_CHECKBOX_SELECTION_COL_DEF
3212
3461
  ```
3213
3462
 
3214
3463
  - [DataGrid] The constants referring to the column types were removed (#2791) @flaviendelangle
@@ -3376,7 +3625,7 @@ A big thanks to the 5 contributors who made this release possible. Here are some
3376
3625
  -export type GridValueFormatterParams = Omit<GridRenderCellParams, 'formattedValue' | 'isEditable'>;
3377
3626
  +export interface GridValueFormatterParams {
3378
3627
  + /**
3379
- + * The column field of the cell that triggered the event
3628
+ + * The column field of the cell that triggered the event.
3380
3629
  + */
3381
3630
  + field: string;
3382
3631
  + /**
@@ -3462,7 +3711,7 @@ A big thanks to the 9 contributors who made this release possible. Here are some
3462
3711
 
3463
3712
  ```diff
3464
3713
  -const state = apiRef.current.getState();
3465
- +const state = apiRef.current.state
3714
+ +const state = apiRef.current.state;
3466
3715
  ```
3467
3716
 
3468
3717
  - [DataGridPro] The third argument in `apiRef.current.selectRow` is now inverted to keep consistency with other selection APIs. (#2523) @flaviendelangle
@@ -3756,16 +4005,15 @@ Big thanks to the 6 contributors who made this release possible. Here are some h
3756
4005
  - The `width` property of the columns is no longer updated with the actual width of of the column. Use the new `computedWidth` property in the callbacks instead.
3757
4006
 
3758
4007
  ```diff
3759
- const columns: GridColDef = [
3760
- {
3761
- field: "name",
3762
- width: 100,
3763
- renderCell: ({ value, colDef }) => {
3764
- - console.log(colDef.width!)
3765
- + console.log(colDef.computedWidth)
3766
- return value
3767
- }
3768
- ]
4008
+ const columns: GridColDef = [{
4009
+ field: 'name',
4010
+ width: 100,
4011
+ renderCell: ({ value, colDef }) => {
4012
+ - console.log(colDef.width!);
4013
+ + console.log(colDef.computedWidth);
4014
+ return value;
4015
+ },
4016
+ }];
3769
4017
  ```
3770
4018
 
3771
4019
  #### Changes
@@ -3828,21 +4076,21 @@ Big thanks to the 8 contributors who made this release possible. Here are some h
3828
4076
  - Change the controllable API signature:
3829
4077
 
3830
4078
  ```diff
3831
- // Signature
4079
+ // Signature
3832
4080
  -onPageChange?: (params: GridPageChangeParams) => void;
3833
4081
  +onPageChange?: (page: number) => void;
3834
4082
 
3835
- // Usage
4083
+ // Usage
3836
4084
  -<DataGrid onPageChange={(params: GridPageChangeParams) => setPage(params.page)} />
3837
4085
  +<DataGrid onPageChange={(page: number) => setPage(page)} />
3838
4086
  ```
3839
4087
 
3840
4088
  ```diff
3841
- // Signature
4089
+ // Signature
3842
4090
  -onPageSizeChange?: (params: GridPageChangeParams) => void;
3843
4091
  +onPageSizeChange?: (pageSize: number) => void;
3844
4092
 
3845
- // Usage
4093
+ // Usage
3846
4094
  -<DataGrid onPageSizeChange={(params: GridPageChangeParams) => setPageSize(params.pageSize)} />
3847
4095
  +<DataGrid onPageSizeChange={(pageSize: number) => setPageSize(pageSize)} />
3848
4096
  ```
@@ -3900,7 +4148,7 @@ Big thanks to the 11 contributors who made this release possible. Here are some
3900
4148
  Remove public `apiRef.current.isColumnVisibleInWindow()` as it servers private use cases.
3901
4149
 
3902
4150
  ```diff
3903
- -apiRef.current.isColumnVisibleInWindow()
4151
+ -apiRef.current.isColumnVisibleInWindow();
3904
4152
  ```
3905
4153
 
3906
4154
  - [DataGrid] Remove stateId argument from GridApi getState method (#2141) @flaviendelangle
@@ -3947,7 +4195,7 @@ Big thanks to the 11 contributors who made this release possible. Here are some
3947
4195
 
3948
4196
  ```diff
3949
4197
  +apiRef.current.setCellMode(1, 'name', 'edit');
3950
- apiRef.current.commitCellChange({ id: 1, field: 'name' });
4198
+ apiRef.current.commitCellChange({ id: 1, field: 'name' });
3951
4199
  ```
3952
4200
 
3953
4201
  - The `setCellValue` was removed from the API. Use `commitCellChange` or `updateRows` in place.
@@ -4738,31 +4986,33 @@ Big thanks to the 5 contributors who made this release possible. Here are some h
4738
4986
 
4739
4987
  - Changes on `apiRef.current`.
4740
4988
 
4741
- ```diff
4742
- - getRowModels: () => GridRowModel[];
4743
- + getRowModels: () => Map<GridRowId, GridRowModel>;
4744
- - getVisibleRowModels: () => GridRowModel[];
4745
- + getVisibleRowModels: () => Map<GridRowId, GridRowModel>;
4746
- - getSelectedRows: () => GridRowModel[];
4747
- + getSelectedRows: () => Map<GridRowId, GridRowModel>;
4748
- ```
4749
-
4750
- - Changes on `GridFilterModelParams`.
4751
-
4752
- ```diff
4753
- export interface GridFilterModelParams {
4754
- /**
4755
- * The full set of rows.
4756
- */
4757
- - rows: GridRowModel[];
4758
- + rows: Map<GridRowId, GridRowModel>;
4759
- /**
4760
- * The set of currently visible rows.
4761
- */
4762
- - visibleRows: GridRowModel[];
4763
- + visibleRows: Map<GridRowId, GridRowModel>;
4764
- }
4765
- ```
4989
+ ```diff
4990
+ -getRowModels: () => GridRowModel[];
4991
+ +getRowModels: () => Map<GridRowId, GridRowModel>;
4992
+
4993
+ -getVisibleRowModels: () => GridRowModel[];
4994
+ +getVisibleRowModels: () => Map<GridRowId, GridRowModel>;
4995
+
4996
+ -getSelectedRows: () => GridRowModel[];
4997
+ +getSelectedRows: () => Map<GridRowId, GridRowModel>;
4998
+ ```
4999
+
5000
+ - Changes on `GridFilterModelParams`.
5001
+
5002
+ ```diff
5003
+ export interface GridFilterModelParams {
5004
+ /**
5005
+ * The full set of rows.
5006
+ */
5007
+ - rows: GridRowModel[];
5008
+ + rows: Map<GridRowId, GridRowModel>;
5009
+ /**
5010
+ * The set of currently visible rows.
5011
+ */
5012
+ - visibleRows: GridRowModel[];
5013
+ + visibleRows: Map<GridRowId, GridRowModel>;
5014
+ }
5015
+ ```
4766
5016
 
4767
5017
  - [DataGrid] Upgrade mininum supported version of React to 17.0.0 (#1410) @m4theushw
4768
5018
 
@@ -4980,11 +5230,12 @@ Big thanks to the 4 contributors who made this release possible. Here are some h
4980
5230
  ```diff
4981
5231
  -columns[1] = { ...columns[1], sortDirection: 'asc' };
4982
5232
 
4983
- return (
4984
- <div>
5233
+ return (
5234
+ <div>
4985
5235
  - <DataGrid rows={rows} columns={columns} />
4986
5236
  + <DataGrid rows={rows} columns={columns} sortModel={[{ field: columns[1].field, sort: 'asc' }]} />
4987
- </div>
5237
+ </div>
5238
+ );
4988
5239
  ```
4989
5240
 
4990
5241
  - [DataGrid] Rename the `onSelectionChange` prop to `onSelectionModelChange` for consistency. (#986) @dtassone
@@ -5011,10 +5262,11 @@ Big thanks to the 4 contributors who made this release possible. Here are some h
5011
5262
  -const [page, setPage] = React.useState(1);
5012
5263
  +const [page, setPage] = React.useState(0);
5013
5264
 
5014
- return (
5015
- <div className="grid-container">
5016
- <DataGrid rows={rows} columns={columns} page={page} />
5017
- </div>
5265
+ return (
5266
+ <div className="grid-container">
5267
+ <DataGrid rows={rows} columns={columns} page={page} />
5268
+ </div>
5269
+ );
5018
5270
  ```
5019
5271
 
5020
5272
  #### Changes
@@ -5115,25 +5367,25 @@ Big thanks to the 5 contributors who made this release possible. Here are some h
5115
5367
  - Capitalize the keys of the `components` prop. This change aims to bring consistency with the customization pattern of Material UI v5:
5116
5368
 
5117
5369
  ```diff
5118
- <DataGrid
5119
- components={{
5120
- - noRowsOverlay: CustomNoRowsOverlay,
5121
- + NoRowOverlay: CustomNoRowsOverlay,
5122
- }}
5123
- />
5370
+ <DataGrid
5371
+ components={{
5372
+ - noRowsOverlay: CustomNoRowsOverlay,
5373
+ + NoRowOverlay: CustomNoRowsOverlay,
5374
+ }}
5375
+ />
5124
5376
  ```
5125
5377
 
5126
5378
  - Move all the icon components overrides in the `components` prop. And added the suffix 'Icon' on each icon component. This change aims to bring consistency with the customization pattern of Material UI v5:
5127
5379
 
5128
5380
  ```diff
5129
- <DataGrid
5130
- - icons: {{
5131
- - ColumnSortedAscending: SortedAscending,
5132
- - }},
5133
- + components={{
5134
- + ColumnSortedAscendingIcon: SortedAscending,
5135
- + }}
5136
- />
5381
+ <DataGrid
5382
+ - icons: {{
5383
+ - ColumnSortedAscending: SortedAscending,
5384
+ - }},
5385
+ + components={{
5386
+ + ColumnSortedAscendingIcon: SortedAscending,
5387
+ + }}
5388
+ />
5137
5389
  ```
5138
5390
 
5139
5391
  - Change the props provided to the component of the `components` prop. Expose the whole state instead of an arbitrary set of props:
@@ -5151,9 +5403,9 @@ Big thanks to the 5 contributors who made this release possible. Here are some h
5151
5403
  + page={state.pagination.page}
5152
5404
  + count={state.pagination.pageCount}
5153
5405
 
5154
- // ...
5406
+ // ...
5155
5407
 
5156
- <DataGrid components={{ Pagination: CustomPagination }} />
5408
+ <DataGrid components={{ Pagination: CustomPagination }} />
5157
5409
  ```
5158
5410
 
5159
5411
  #### Changes