@mui/x-data-grid 5.0.0-beta.5 → 5.0.0-beta.6
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/CHANGELOG.md +127 -18
- package/data-grid.d.ts +133 -86
- package/index-cjs.js +2 -2
- package/index-esm.js +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,115 @@
|
|
|
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
|
+
## 5.0.0-beta.6
|
|
7
|
+
|
|
8
|
+
_Oct 29, 2021_
|
|
9
|
+
|
|
10
|
+
A big thanks to the 7 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- ✨ Allow `valueOptions` from `GridColDef` to accept a function (#2850) @alexfauquette
|
|
13
|
+
- 💅 Prefix undocumented `apiRef` methods with `unsafe_` (#2985) @flaviendelangle
|
|
14
|
+
- 👁 Unify filtering, sorting, and rows selectors names (#2942) @flaviendelangle
|
|
15
|
+
- 💡 Support style overrides added in the theme (#2995) @DanailH
|
|
16
|
+
- 📚 Documentation improvements
|
|
17
|
+
- 🐞 Bugfixes
|
|
18
|
+
|
|
19
|
+
### `@mui/x-data-grid@v5.0.0-beta.6` / `@mui/x-data-grid-pro@v5.0.0-beta.6`
|
|
20
|
+
|
|
21
|
+
#### Breaking changes
|
|
22
|
+
|
|
23
|
+
- [DataGridPro] The following methods from `apiRef` were renamed. Use the provided alternatives. (#2870) @flaviendelangle
|
|
24
|
+
|
|
25
|
+
1. `apiRef.current.applyFilters` was renamed to `apiRef.current.unsafe_applyFilters`
|
|
26
|
+
2. `apiRef.current.applyFilterLinkOperator` was renamed to `apiRef.current.setFilterLinkOperator`
|
|
27
|
+
3. `apiRef.current.upsertFilter` was renamed to `apiRef.current.upsertFilterItem`
|
|
28
|
+
4. `apiRef.current.deleteFilter` was renamed to `apiRef.current.deleteFilterItem`
|
|
29
|
+
|
|
30
|
+
- [DataGridPro] The `apiRef.current.applyFilter` method was removed. (#2870) @flaviendelangle
|
|
31
|
+
You should never have to call it directly since the filters are already applied when the `filterModel` prop changes.
|
|
32
|
+
To manually apply the filters, use `apiRef.current.unsafe_applyFilters`.
|
|
33
|
+
|
|
34
|
+
```diff
|
|
35
|
+
-apiRef.current.applyFilter
|
|
36
|
+
+apiRef.current.unsafe_applyFilters
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
- [DataGridPro] Rename filtering, sorting, and rows selectors to match the naming convention (#2942) @flaviendelangle
|
|
40
|
+
|
|
41
|
+
1. `unorderedGridRowIdsSelector` was renamed to `gridRowIdsSelector`
|
|
42
|
+
2. `sortingGridStateSelector` was renamed to `gridSortingStateSelector`
|
|
43
|
+
3. `sortedGridRowIdsSelector` was renamed to `gridSortedRowIdsSelector`
|
|
44
|
+
4. `visibleSortedGridRowIdsSelector` was renamed to `gridVisibleSortedRowIdsSelector`
|
|
45
|
+
5. `visibleGridRowCountSelector` was renamed to `gridVisibleRowCountSelector`
|
|
46
|
+
6. `filterGridColumnLookupSelector` was renamed to `gridFilterActiveItemsSelector`
|
|
47
|
+
|
|
48
|
+
- [DataGridPro] The `sortedGridRowsSelector` was renamed to `gridSortedRowEntriesSelector` (#2942) @flaviendelangle
|
|
49
|
+
|
|
50
|
+
The return value was also changed as below:
|
|
51
|
+
|
|
52
|
+
```diff
|
|
53
|
+
-sortedGridRowsSelector: (state: GridState) => Map<GridRowId, GridRowModel>
|
|
54
|
+
-const map = sortedGridRowsSelector(state);
|
|
55
|
+
+gridSortedRowEntriesSelector: (state: GridState) => GridRowEntry[]
|
|
56
|
+
+const map = new Map(gridSortedRowEntriesSelector(state).map(row => [row.id, row.model]));
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
- [DataGridPro] The `visibleSortedGridRowsSelector` was replaced with `gridVisibleSortedRowEntriesSelector` (#2942) @flaviendelangle
|
|
60
|
+
|
|
61
|
+
The return value was also changed as below:
|
|
62
|
+
|
|
63
|
+
```diff
|
|
64
|
+
-visibleSortedGridRowsSelector: (state: GridState) => Map<GridRowId, GridRowModel>;
|
|
65
|
+
-const map = visibleSortedGridRowsSelector(state);
|
|
66
|
+
+gridVisibleSortedRowEntriesSelector: (state: GridState) => GridRowEntry[]
|
|
67
|
+
+const map = new Map(gridVisibleSortedRowEntriesSelector(state).map(row => [row.id, row.model]));
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
- [DataGridPro] The `visibleSortedGridRowsAsArraySelector` was replaced with `gridVisibleSortedRowEntriesSelector` (#2942) @flaviendelangle
|
|
71
|
+
|
|
72
|
+
The return value was also changed as below:
|
|
73
|
+
|
|
74
|
+
```diff
|
|
75
|
+
-visibleSortedGridRowsAsArraySelector: (state: GridState) => [GridRowId, GridRowData][];
|
|
76
|
+
+gridVisibleSortedRowEntriesSelector: (state: GridState) => GridRowEntry[]
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
- [DataGridPro] The `filterGridItemsCounterSelector` selector was removed. (#2942) @flaviendelangle
|
|
80
|
+
Use `gridFilterActiveItemsSelector` as replacement.
|
|
81
|
+
|
|
82
|
+
```diff
|
|
83
|
+
-const filterCount = filterGridItemsCounterSelector(state);
|
|
84
|
+
+const filterCount = gridFilterActiveItemsSelector(state).length;
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
- [DataGridPro] The `unorderedGridRowModelsSelector` selector was removed. (#2942) @flaviendelangle
|
|
88
|
+
Use `apiRef.current.getRowModels` or `gridRowIdsSelector` and `gridRowsLookupSelector`.
|
|
89
|
+
|
|
90
|
+
#### Changes
|
|
91
|
+
|
|
92
|
+
- [DataGrid] Allow `valueOptions` to accept a function (#2850) @alexfauquette
|
|
93
|
+
- [DataGrid] Add `overridesResolver` (#2995) @DanailH
|
|
94
|
+
- [DataGrid] Unify filtering, sorting, and rows selectors names (#2942) @flaviendelangle
|
|
95
|
+
- [DataGridPro] Prefix undocumented `apiRef` methods with `unsafe_` (#2985) @flaviendelangle
|
|
96
|
+
|
|
97
|
+
### Docs
|
|
98
|
+
|
|
99
|
+
- [docs] Explain how to use MUI X v5 with MUI Core v4 (#2846) @m4theushw
|
|
100
|
+
- [docs] Generate docs for components (#2465) @m4theushw
|
|
101
|
+
- [docs] Improve `scrollEndThreshold` API docs (#3001) @ZeeshanTamboli
|
|
102
|
+
- [docs] Fix CodeSandbox and feature request templates (#2986) @flaviendelangle
|
|
103
|
+
|
|
104
|
+
### Core
|
|
105
|
+
|
|
106
|
+
- [core] Add step for announcing the releases on Twitter (#2997) @DanailH
|
|
107
|
+
- [core] Apply all filters to a row before moving to the next one (#2870) @flaviendelangle
|
|
108
|
+
- [core] Change monorepo repository URL (#2983) @m4theushw
|
|
109
|
+
- [core] Clean Storybook examples (#2805) @flaviendelangle
|
|
110
|
+
- [core] Generate list of all grid exports (#2801) @flaviendelangle
|
|
111
|
+
- [core] Improve typing of `buildApi.ts` (#2922) @flaviendelangle
|
|
112
|
+
- [core] Add additional test for `checkboxSelection` toggling (#2979) @flaviendelangle
|
|
113
|
+
- [test] Fix flaky visual regression test (#2981) @m4theushw
|
|
114
|
+
|
|
6
115
|
## 5.0.0-beta.5
|
|
7
116
|
|
|
8
117
|
_Oct 22, 2021_
|
|
@@ -146,7 +255,7 @@ _Oct 14, 2021_
|
|
|
146
255
|
A big thanks to the 7 contributors who made this release possible. Here are some highlights ✨:
|
|
147
256
|
|
|
148
257
|
- 🎁 Add the ability to print the grid (#2519) @DanailH
|
|
149
|
-
|
|
258
|
+
|
|
150
259
|
This new feature adds a button to the toolbar to generate a printer-friendly layout. Check the [documentation](https://mui.com/components/data-grid/export/#print) about it.
|
|
151
260
|
|
|
152
261
|
- 💡 Enhance internal code structure
|
|
@@ -182,11 +291,11 @@ A big thanks to the 7 contributors who made this release possible. Here are some
|
|
|
182
291
|
+ }}
|
|
183
292
|
+/>;
|
|
184
293
|
```
|
|
185
|
-
|
|
294
|
+
|
|
186
295
|
The `data-rowindex` and `data-rowselected` attributes were removed from the cell element. Equivalent attributes can be found in the row element.
|
|
187
|
-
|
|
296
|
+
|
|
188
297
|
The `data-editable` attribute was removed from the cell element. Use the `.MuiDataGrid-cell--editable` CSS class.
|
|
189
|
-
|
|
298
|
+
|
|
190
299
|
The `data-mode` attribute was removed from the cell element. Use the `.MuiDataGrid-cell--editing` CSS class.
|
|
191
300
|
|
|
192
301
|
- [DataGrid] The `state.filter` and `state.visibleRows` were merged into a single `state.filter` sub-state (#2782) @flaviendelangle
|
|
@@ -198,12 +307,12 @@ A big thanks to the 7 contributors who made this release possible. Here are some
|
|
|
198
307
|
-const filterModel = gridFilterStateSelector(state)
|
|
199
308
|
+const filterModel = state.filter.filterModel
|
|
200
309
|
+const filterModel = gridFilterModelSelector(state) // preferred method
|
|
201
|
-
|
|
310
|
+
|
|
202
311
|
-const visibleRowsLookup = state.visibleRows.visibleRowsLookup
|
|
203
312
|
-const visibleRowsLookup = visibleGridRowsStateSelector(state).visibleRowsLookup
|
|
204
313
|
+const visibleRowsLookup = state.filter.visibleRowsLookup
|
|
205
314
|
+const visibleRowsLookup = gridVisibleRowsLookupSelector(state).visibleRowsLookup // preferred method
|
|
206
|
-
|
|
315
|
+
|
|
207
316
|
-const visibleRows = state.visibleRows.visibleRows
|
|
208
317
|
+const visibleRows = state.filter.visibleRows
|
|
209
318
|
+const visibleRows = gridVisibleRowsLookupSelector(state).visibleRows // preferred method
|
|
@@ -214,22 +323,22 @@ A big thanks to the 7 contributors who made this release possible. Here are some
|
|
|
214
323
|
```diff
|
|
215
324
|
-const columnHeaderClass = GRID_COLUMN_HEADER_CSS_CLASS
|
|
216
325
|
+const columnHeaderClass = gridClasses.columnHeader
|
|
217
|
-
|
|
326
|
+
|
|
218
327
|
-const rowClass = GRID_ROW_CSS_CLASS
|
|
219
328
|
+const rowClass = gridClasses.row
|
|
220
|
-
|
|
329
|
+
|
|
221
330
|
-const cellClass = GRID_CELL_CSS_CLASS
|
|
222
331
|
+const cellClass = gridClasses.cell
|
|
223
|
-
|
|
332
|
+
|
|
224
333
|
-const columnSeparatorClass = GRID_COLUMN_HEADER_SEPARATOR_RESIZABLE_CSS_CLASS
|
|
225
334
|
+const columnSeparatorClass = gridClasses['columnSeparator--resizable']
|
|
226
|
-
|
|
335
|
+
|
|
227
336
|
-const columnHeaderTitleClass = GRID_COLUMN_HEADER_TITLE_CSS_CLASS
|
|
228
337
|
+const columnHeaderTitleClass = gridClasses.columnHeaderTitle
|
|
229
|
-
|
|
338
|
+
|
|
230
339
|
-const columnHeaderDropZoneClass = GRID_COLUMN_HEADER_DROP_ZONE_CSS_CLASS
|
|
231
340
|
+const columnHeaderDropZoneClass = gridClasses.columnHeaderDropZone
|
|
232
|
-
|
|
341
|
+
|
|
233
342
|
-const columnHeaderDraggingClass = GRID_COLUMN_HEADER_DRAGGING_CSS_CLASS
|
|
234
343
|
+const columnHeaderDraggingClass = gridClasses["columnHeader--dragging"]
|
|
235
344
|
```
|
|
@@ -247,16 +356,16 @@ A big thanks to the 7 contributors who made this release possible. Here are some
|
|
|
247
356
|
```diff
|
|
248
357
|
-const isColumnString = column.type === GRID_STRING_COLUMN_TYPE;
|
|
249
358
|
+const isColumnString = col.type === 'string';
|
|
250
|
-
|
|
359
|
+
|
|
251
360
|
-const isColumnNumber = col.type === GRID_NUMBER_COLUMN_TYPE;
|
|
252
361
|
+const isColumnNumber = col.type === 'number';
|
|
253
|
-
|
|
362
|
+
|
|
254
363
|
-const isColumnDate = col.type === GRID_DATE_COLUMN_TYPE;
|
|
255
364
|
+const isColumnDate = col.type === 'date';
|
|
256
|
-
|
|
365
|
+
|
|
257
366
|
-const isColumnDateTime = col.type === GRID_DATETIME_COLUMN_TYPE;
|
|
258
367
|
+const isColumnDateTime = col.type === 'dateTime';
|
|
259
|
-
|
|
368
|
+
|
|
260
369
|
-const isColumnBoolean = col.type === GRID_BOOLEAN_COLUMN_TYPE;
|
|
261
370
|
+const isColumnBoolean = col.type === 'boolean';
|
|
262
371
|
```
|
|
@@ -269,13 +378,13 @@ A big thanks to the 7 contributors who made this release possible. Here are some
|
|
|
269
378
|
-const [filterModel, setFilterModel] = React.useState(getInitialGridFilterState);
|
|
270
379
|
+const [filterModel, setFilterModel] = React.useState(getDefaultGridFilterModel);
|
|
271
380
|
```
|
|
272
|
-
|
|
381
|
+
|
|
273
382
|
For the other methods, you can hardcode the value you want to apply:
|
|
274
383
|
|
|
275
384
|
```diff
|
|
276
385
|
-const [sortModel, setSortModel] = React.useState(() => getInitialGridSortingState().sortModel);
|
|
277
386
|
+const [sortModel, setSortModel] React.useState([]);
|
|
278
|
-
|
|
387
|
+
|
|
279
388
|
-getInitialGridColumnReorderState
|
|
280
389
|
-getInitialGridColumnResizeState
|
|
281
390
|
-getInitialGridColumnsState
|