@mui/x-data-grid 5.0.0-beta.3 → 5.0.0-beta.7
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 +491 -1
- package/LICENSE +1 -1
- package/README.md +0 -1
- package/data-grid.d.ts +1643 -789
- package/index-cjs.js +2 -3
- package/index-esm.js +2 -3
- package/package.json +3 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,496 @@
|
|
|
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.7
|
|
7
|
+
|
|
8
|
+
_Nov 4, 2021_
|
|
9
|
+
|
|
10
|
+
- 💅 Reduce styles specificity to make simpler to override (#3012) @DanailH
|
|
11
|
+
- 🌍 Add Hebrew (heIL) locale (#3028) @ColdAtNight
|
|
12
|
+
- 📚 Documentation improvements
|
|
13
|
+
- 🐞 Bugfixes
|
|
14
|
+
|
|
15
|
+
### `@mui/x-data-grid@v5.0.0-beta.7` / `@mui/x-data-grid-pro@v5.0.0-beta.7`
|
|
16
|
+
|
|
17
|
+
#### Breaking changes
|
|
18
|
+
|
|
19
|
+
- [core] Prefix selectors from `useGridContainerProps` with `unsafe` (#3002) @flaviendelangle
|
|
20
|
+
|
|
21
|
+
The dimension API is being temporarily made private to allow to clean it in future minor releases. The current approach causes useless re-renders.
|
|
22
|
+
If you relay on any of these selectors, open an issue explaining the use case so that will be taken into account when refactoring them.
|
|
23
|
+
|
|
24
|
+
The following selectors were prefixed by `unstable_`. Use the provided alternatives.
|
|
25
|
+
|
|
26
|
+
1. `gridContainerSizesSelector` was renamed to `unstable_gridContainerSizesSelector`
|
|
27
|
+
2. `gridViewportSizesSelector` was renamed to `unstable_gridViewportSizesSelector`
|
|
28
|
+
3. `gridScrollBarSizeSelector` was renamed to `unstable_gridScrollBarSizeSelector`
|
|
29
|
+
|
|
30
|
+
The following selectors were removed. You can hard-code their logic in your application if you really need them.
|
|
31
|
+
|
|
32
|
+
1. `gridDataContainerSizesSelector`
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
const dataContainerSizes = gridContainerSizesSelector(state)?.dataContainerSizes ?? null;
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
2. `gridDataContainerHeightSelector`
|
|
39
|
+
|
|
40
|
+
```ts
|
|
41
|
+
const dataContainerHeight = gridContainerSizesSelector(state)?.dataContainerSizes.height ?? null;
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
The selector `gridViewportSizeStateSelector` was a duplicate and has been removed, you can use the selector `unstable_gridViewportSizesSelector` instead.
|
|
45
|
+
|
|
46
|
+
#### Changes
|
|
47
|
+
|
|
48
|
+
- [DataGrid] Add Hebrew (heIL) locale (#3028) @ColdAtNight
|
|
49
|
+
- [DataGrid] Move virtualization logic to hook (#3079) @m4theushw
|
|
50
|
+
- [DataGrid] Revert year change in the MIT license (#3059) @oliviertassinari
|
|
51
|
+
- [DataGrid] Fix filtering of nullish numeric cells (#3070) @flaviendelangle
|
|
52
|
+
- [DataGrid] Improve performance when selecting 100k rows (#3077) @m4theushw
|
|
53
|
+
- [DataGrid] Fix `GridEditDateCell` to handle timezone correctly (#2918) @flaviendelangle
|
|
54
|
+
- [DataGrid] Fix keyboard navigation on page > 0 (#3074) @flaviendelangle
|
|
55
|
+
- [DataGrid] Prevents bubbling in menu header (#3000) @alexfauquette
|
|
56
|
+
- [DataGrid] Fix wrong params provided to `cellModeChange` when `setCellMode` is called (#3025) @flaviendelangle
|
|
57
|
+
|
|
58
|
+
### Core
|
|
59
|
+
|
|
60
|
+
- [core] Adapt `useDemoData` for Tree Data (#2978) @flaviendelangle
|
|
61
|
+
- [core] Group update of MUI Core (#3055) @oliviertassinari
|
|
62
|
+
- [core] Ignore `*.tsbuildinfo` files (#3068) @m4theushw
|
|
63
|
+
- [core] Implement tree-based row management (#2996) @flaviendelangle
|
|
64
|
+
- [core] Invert Codesandbox examples on README (#3073) @flaviendelangle
|
|
65
|
+
- [core] Prefix selectors from `useGridContainerProps` with `unsafe` (#3002) @flaviendelangle
|
|
66
|
+
- [core] Reduce `setGridState` and `applyFilters` call when updating `filterModel` (#3023) @flaviendelangle
|
|
67
|
+
- [core] Reduce styles complexity (#3012) @DanailH
|
|
68
|
+
- [core] Upgrade monorepo (#3067) @m4theushw
|
|
69
|
+
- [core] Use official MUI repo as monorepo (#3084) @m4theushw
|
|
70
|
+
- [test] Retry each expect until success (#3027) @m4theushw
|
|
71
|
+
- [core] Adapt changelog script to new GitHub DOM (#3087) @alexfauquette
|
|
72
|
+
|
|
73
|
+
### Docs
|
|
74
|
+
|
|
75
|
+
- [docs] Explain how to use `valueGetter` to transform type (#3003) @alexfauquette
|
|
76
|
+
- [docs] Fix the outdated demo of the docs (#3058) @oliviertassinari
|
|
77
|
+
- [docs] Fix inline previews #3081) @DanailH
|
|
78
|
+
|
|
79
|
+
## 5.0.0-beta.6
|
|
80
|
+
|
|
81
|
+
_Oct 29, 2021_
|
|
82
|
+
|
|
83
|
+
A big thanks to the 7 contributors who made this release possible. Here are some highlights ✨:
|
|
84
|
+
|
|
85
|
+
- ✨ Allow `valueOptions` from `GridColDef` to accept a function (#2850) @alexfauquette
|
|
86
|
+
- 💅 Prefix undocumented `apiRef` methods with `unsafe_` (#2985) @flaviendelangle
|
|
87
|
+
- 👁 Unify filtering, sorting, and rows selectors names (#2942) @flaviendelangle
|
|
88
|
+
- 💡 Support style overrides added in the theme (#2995) @DanailH
|
|
89
|
+
- 📚 Documentation improvements
|
|
90
|
+
- 🐞 Bugfixes
|
|
91
|
+
|
|
92
|
+
### `@mui/x-data-grid@v5.0.0-beta.6` / `@mui/x-data-grid-pro@v5.0.0-beta.6`
|
|
93
|
+
|
|
94
|
+
#### Breaking changes
|
|
95
|
+
|
|
96
|
+
- [DataGridPro] The following methods from `apiRef` were renamed. Use the provided alternatives. (#2870) @flaviendelangle
|
|
97
|
+
|
|
98
|
+
1. `apiRef.current.applyFilters` was renamed to `apiRef.current.unsafe_applyFilters`
|
|
99
|
+
2. `apiRef.current.applyFilterLinkOperator` was renamed to `apiRef.current.setFilterLinkOperator`
|
|
100
|
+
3. `apiRef.current.upsertFilter` was renamed to `apiRef.current.upsertFilterItem`
|
|
101
|
+
4. `apiRef.current.deleteFilter` was renamed to `apiRef.current.deleteFilterItem`
|
|
102
|
+
|
|
103
|
+
- [DataGridPro] The `apiRef.current.applyFilter` method was removed. (#2870) @flaviendelangle
|
|
104
|
+
You should never have to call it directly since the filters are already applied when the `filterModel` prop changes.
|
|
105
|
+
To manually apply the filters, use `apiRef.current.unsafe_applyFilters`.
|
|
106
|
+
|
|
107
|
+
```diff
|
|
108
|
+
-apiRef.current.applyFilter
|
|
109
|
+
+apiRef.current.unsafe_applyFilters
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
- [DataGridPro] Rename filtering, sorting, and rows selectors to match the naming convention (#2942) @flaviendelangle
|
|
113
|
+
|
|
114
|
+
1. `unorderedGridRowIdsSelector` was renamed to `gridRowIdsSelector`
|
|
115
|
+
2. `sortingGridStateSelector` was renamed to `gridSortingStateSelector`
|
|
116
|
+
3. `sortedGridRowIdsSelector` was renamed to `gridSortedRowIdsSelector`
|
|
117
|
+
4. `visibleSortedGridRowIdsSelector` was renamed to `gridVisibleSortedRowIdsSelector`
|
|
118
|
+
5. `visibleGridRowCountSelector` was renamed to `gridVisibleRowCountSelector`
|
|
119
|
+
6. `filterGridColumnLookupSelector` was renamed to `gridFilterActiveItemsSelector`
|
|
120
|
+
|
|
121
|
+
- [DataGridPro] The `sortedGridRowsSelector` was renamed to `gridSortedRowEntriesSelector` (#2942) @flaviendelangle
|
|
122
|
+
|
|
123
|
+
The return value was also changed as below:
|
|
124
|
+
|
|
125
|
+
```diff
|
|
126
|
+
-sortedGridRowsSelector: (state: GridState) => Map<GridRowId, GridRowModel>
|
|
127
|
+
-const map = sortedGridRowsSelector(state);
|
|
128
|
+
+gridSortedRowEntriesSelector: (state: GridState) => GridRowEntry[]
|
|
129
|
+
+const map = new Map(gridSortedRowEntriesSelector(state).map(row => [row.id, row.model]));
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
- [DataGridPro] The `visibleSortedGridRowsSelector` was replaced with `gridVisibleSortedRowEntriesSelector` (#2942) @flaviendelangle
|
|
133
|
+
|
|
134
|
+
The return value was also changed as below:
|
|
135
|
+
|
|
136
|
+
```diff
|
|
137
|
+
-visibleSortedGridRowsSelector: (state: GridState) => Map<GridRowId, GridRowModel>;
|
|
138
|
+
-const map = visibleSortedGridRowsSelector(state);
|
|
139
|
+
+gridVisibleSortedRowEntriesSelector: (state: GridState) => GridRowEntry[]
|
|
140
|
+
+const map = new Map(gridVisibleSortedRowEntriesSelector(state).map(row => [row.id, row.model]));
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
- [DataGridPro] The `visibleSortedGridRowsAsArraySelector` was replaced with `gridVisibleSortedRowEntriesSelector` (#2942) @flaviendelangle
|
|
144
|
+
|
|
145
|
+
The return value was also changed as below:
|
|
146
|
+
|
|
147
|
+
```diff
|
|
148
|
+
-visibleSortedGridRowsAsArraySelector: (state: GridState) => [GridRowId, GridRowData][];
|
|
149
|
+
+gridVisibleSortedRowEntriesSelector: (state: GridState) => GridRowEntry[]
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
- [DataGridPro] The `filterGridItemsCounterSelector` selector was removed. (#2942) @flaviendelangle
|
|
153
|
+
Use `gridFilterActiveItemsSelector` as replacement.
|
|
154
|
+
|
|
155
|
+
```diff
|
|
156
|
+
-const filterCount = filterGridItemsCounterSelector(state);
|
|
157
|
+
+const filterCount = gridFilterActiveItemsSelector(state).length;
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
- [DataGridPro] The `unorderedGridRowModelsSelector` selector was removed. (#2942) @flaviendelangle
|
|
161
|
+
Use `apiRef.current.getRowModels` or `gridRowIdsSelector` and `gridRowsLookupSelector`.
|
|
162
|
+
|
|
163
|
+
#### Changes
|
|
164
|
+
|
|
165
|
+
- [DataGrid] Allow `valueOptions` to accept a function (#2850) @alexfauquette
|
|
166
|
+
- [DataGrid] Add `overridesResolver` (#2995) @DanailH
|
|
167
|
+
- [DataGrid] Unify filtering, sorting, and rows selectors names (#2942) @flaviendelangle
|
|
168
|
+
- [DataGridPro] Prefix undocumented `apiRef` methods with `unsafe_` (#2985) @flaviendelangle
|
|
169
|
+
|
|
170
|
+
### Docs
|
|
171
|
+
|
|
172
|
+
- [docs] Explain how to use MUI X v5 with MUI Core v4 (#2846) @m4theushw
|
|
173
|
+
- [docs] Generate docs for components (#2465) @m4theushw
|
|
174
|
+
- [docs] Improve `scrollEndThreshold` API docs (#3001) @ZeeshanTamboli
|
|
175
|
+
- [docs] Fix CodeSandbox and feature request templates (#2986) @flaviendelangle
|
|
176
|
+
|
|
177
|
+
### Core
|
|
178
|
+
|
|
179
|
+
- [core] Add step for announcing the releases on Twitter (#2997) @DanailH
|
|
180
|
+
- [core] Apply all filters to a row before moving to the next one (#2870) @flaviendelangle
|
|
181
|
+
- [core] Change monorepo repository URL (#2983) @m4theushw
|
|
182
|
+
- [core] Clean Storybook examples (#2805) @flaviendelangle
|
|
183
|
+
- [core] Generate list of all grid exports (#2801) @flaviendelangle
|
|
184
|
+
- [core] Improve typing of `buildApi.ts` (#2922) @flaviendelangle
|
|
185
|
+
- [core] Add additional test for `checkboxSelection` toggling (#2979) @flaviendelangle
|
|
186
|
+
- [test] Fix flaky visual regression test (#2981) @m4theushw
|
|
187
|
+
|
|
188
|
+
## 5.0.0-beta.5
|
|
189
|
+
|
|
190
|
+
_Oct 22, 2021_
|
|
191
|
+
|
|
192
|
+
A big thanks to the 5 contributors who made this release possible. Here are some highlights ✨:
|
|
193
|
+
|
|
194
|
+
- 💅 Remove dependency on `@mui/styles` and use the same styling solution from MUI Core (#2784) @DanailH
|
|
195
|
+
- ✨ Add support for generics in `GridRowParams`, `GridCellParams` and `GridRenderCellParams` (#2436) @ZeeshanTamboli
|
|
196
|
+
- 👁 Rework the virtualization engine (#2673) @m4theushw
|
|
197
|
+
- 💡 Enhance internal code structure
|
|
198
|
+
- 🐞 Bugfixes
|
|
199
|
+
|
|
200
|
+
### `@mui/x-data-grid@v5.0.0-beta.5` / `@mui/x-data-grid-pro@v5.0.0-beta.5`
|
|
201
|
+
|
|
202
|
+
#### Breaking changes
|
|
203
|
+
|
|
204
|
+
- The `DataGrid` and `DataGridPro` no longer depends on `@mui/styles`. Use `styled` to provide custom styling. (#2784) @DanailH
|
|
205
|
+
|
|
206
|
+
```diff
|
|
207
|
+
-import { createTheme } from '@mui/material/styles';
|
|
208
|
+
-import { makeStyles } from '@mui/styles';
|
|
209
|
+
+import { styled } from '@mui/material/styles';
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
The following CSS classes were renamed:
|
|
213
|
+
|
|
214
|
+
- `.MuiDataGrid-gridMenuList` was renamed to `.MuiDataGrid-menuList`
|
|
215
|
+
- `.MuiGridToolbarContainer-root` was renamed to `.MuiDataGrid-toolbarContainer`
|
|
216
|
+
- `.MuiGridMenu-root` was renamed to `.MuiDataGrid-menu`
|
|
217
|
+
- `.MuiDataGridColumnsPanel-root` was renamed to `.MuiDataGrid-columnsPanel`
|
|
218
|
+
- `.MuiGridPanel-root` was renamed to `.MuiDataGrid-panel`
|
|
219
|
+
- `.MuiGridPanelContent-root` was renamed to `.MuiDataGrid-panelContent`
|
|
220
|
+
- `.MuiGridPanelFooter-root` was renamed to `.MuiDataGrid-panelFooter`
|
|
221
|
+
- `.MuiDataGridPanelHeader-root` was renamed to `.MuiDataGrid-panelHeader`
|
|
222
|
+
- `.MuiGridPanelWrapper-root` was renamed to `.MuiDataGrid-panelWrapper`
|
|
223
|
+
- `.MuiGridFilterForm-root` was renamed to `.MuiDataGrid-filterForm`
|
|
224
|
+
- `.MuiGridToolbarFilterButton-root` was renamed to `.MuiDataGrid-toolbarFilterList`
|
|
225
|
+
|
|
226
|
+
- [DataGrid] The CSS classes `.MuiDataGrid-window` and `.MuiDataGrid-windowContainer` were removed (#2673) @m4theushw
|
|
227
|
+
|
|
228
|
+
The following CSS classes were renamed:
|
|
229
|
+
|
|
230
|
+
- `.MuiDataGrid-viewport` was renamed to `.MuiDataGrid-virtualScroller`
|
|
231
|
+
- `.MuiDataGrid-dataContainer` was renamed to `.MuiDataGrid-virtualScrollerContent`
|
|
232
|
+
- `.MuiDataGrid-renderingZone` was renamed to `.MuiDataGrid-virtualScrollerRenderZone`
|
|
233
|
+
|
|
234
|
+
- [DataGrid] Remove the `useGridSlotComponentProps` hook and replace it as below: (#2856) @flaviendelangle
|
|
235
|
+
|
|
236
|
+
```diff
|
|
237
|
+
-const { apiRef, state, rootElement } = useGridSlotComponentProps();
|
|
238
|
+
+const apiRef = useGridApiContext();
|
|
239
|
+
+const [state] = useGridState(apiRef);
|
|
240
|
+
+const rootElement = apiRef.current.rootElementRef;
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
- [DataGrid] Remove the `state` prop and use the `initialState` prop (#2848) @flaviendelangle
|
|
244
|
+
|
|
245
|
+
Note that `initialState` only allows the `preferencePanel`, `filter.filterModel` and `sort.sortModel` keys.
|
|
246
|
+
To fully control the state, use the the feature's model prop and change callback (e.g. `filterModel` and `onFilterModelChange`).
|
|
247
|
+
|
|
248
|
+
```diff
|
|
249
|
+
<DataGrid
|
|
250
|
+
- state={{
|
|
251
|
+
+ initialState={{
|
|
252
|
+
preferencePanel: {
|
|
253
|
+
open: true,
|
|
254
|
+
openedPanelValue: GridPreferencePanelsValue.filters,
|
|
255
|
+
},
|
|
256
|
+
}}
|
|
257
|
+
/>
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
- [DataGridPro] Remove the `onViewportRowsChange` prop and the `viewportRowsChange` event (#2673) @m4theushw
|
|
261
|
+
|
|
262
|
+
A listener on the `rowsScroll` event, as shown below, can be used to replace the prop:
|
|
263
|
+
|
|
264
|
+
```tsx
|
|
265
|
+
const apiRef = useGridApiRef();
|
|
266
|
+
const prevRenderContext = React.useRef(null);
|
|
267
|
+
|
|
268
|
+
React.useEffect(() => {
|
|
269
|
+
return apiRef.current.subscribeEvent('rowsScroll', ({ renderContext }) => {
|
|
270
|
+
if (
|
|
271
|
+
!prevRenderContext.current ||
|
|
272
|
+
renderContext.firstRowIdx !== prevRenderContext.current.firstRowIndex ||
|
|
273
|
+
renderContext.lastRowIdx !== prevRenderContext.current.lastRowIndex
|
|
274
|
+
) {
|
|
275
|
+
prevRenderContext.current = renderContext;
|
|
276
|
+
const params = {
|
|
277
|
+
firstRowIndex: renderContext.firstRowIndex,
|
|
278
|
+
lastRowIndex: renderContext.lastRowIndex,
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
}, [apiRef]);
|
|
283
|
+
|
|
284
|
+
<DataGridPro apiRef={apiRef} />;
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
#### Changes
|
|
288
|
+
|
|
289
|
+
- [DataGrid] Add `valueSetter` (#2876) @m4theushw
|
|
290
|
+
- [DataGrid] Add support for generic types in `GridRowParams`, `GridCellParams`, `GridRenderCellParams` (#2436) @ZeeshanTamboli
|
|
291
|
+
- [DataGrid] Fix `actions` column type to not select the row when clicking on an item (#2862) @m4theushw
|
|
292
|
+
- [DataGrid] Fix column headers misalignment when the render context changes (#2937) @m4theushw
|
|
293
|
+
- [DataGrid] Rework virtualization (#2673) @m4theushw
|
|
294
|
+
- [DataGrid] Remove `@mui/styles` dependency (#2784) @DanailH
|
|
295
|
+
- [DataGrid] Remove `useGridSlotComponentProps` (#2856) @flaviendelangle
|
|
296
|
+
- [DataGrid] Replace `prop.state` with `prop.initialState` (#2848) @flaviendelangle
|
|
297
|
+
- [DataGrid] Use true content height to dispatch `rowsScrollEnd` (#2938) @m4theushw
|
|
298
|
+
- [DataGrid] Fix the typing of `GridToolbarFilterButton` (#2841) @alexfauquette
|
|
299
|
+
|
|
300
|
+
### Docs
|
|
301
|
+
|
|
302
|
+
- [docs] Improve the README for releases (#2908) @flaviendelangle
|
|
303
|
+
- [docs] Re-add Pro icon (#2928) @m4theushw
|
|
304
|
+
- [docs] Fix to not commit changes when clicking outside the cell (#2906) @ZeeshanTamboli
|
|
305
|
+
- [docs] Update link to Quick Filter issue (#2909) @m4theushw
|
|
306
|
+
|
|
307
|
+
### Core
|
|
308
|
+
|
|
309
|
+
- [core] Small fixes on the Components page (#2877) @flaviendelangle
|
|
310
|
+
- [core] Make each feature hook responsible for its column pre-processing (#2839) @flaviendelangle
|
|
311
|
+
- [core] Add `useGridRowGroupsPreProcessing` internal hook (#2840) @flaviendelangle
|
|
312
|
+
- [core] Register events async if not registered (#2916) @m4theushw
|
|
313
|
+
- [core] Remove `material-ui-utils.ts` (#2872) @DanailH
|
|
314
|
+
- [core] Remove outdated hooks requirements (#2939) @flaviendelangle
|
|
315
|
+
- [core] Remove test event (#2912) @m4theushw
|
|
316
|
+
- [core] Remove unused `GridSlotComponentProps` interface (#2911) @flaviendelangle
|
|
317
|
+
- [core] Rename 'UNSTABLE_' prefix to 'unstable_' (#2931) @flaviendelangle
|
|
318
|
+
- [core] Replace usage of `GridRowData` with `GridRowModel` (#2936) @flaviendelangle
|
|
319
|
+
- [core] Revert hardcoded typings (#2907) @DanailH
|
|
320
|
+
- [core] Simplify the CSV export (#2941) @flaviendelangle
|
|
321
|
+
- [core] Update monorepo version (#2927) @m4theushw
|
|
322
|
+
- [test] Take screenshot of the print export (#2881) @m4theushw
|
|
323
|
+
|
|
324
|
+
## 5.0.0-beta.4
|
|
325
|
+
|
|
326
|
+
_Oct 14, 2021_
|
|
327
|
+
|
|
328
|
+
A big thanks to the 7 contributors who made this release possible. Here are some highlights ✨:
|
|
329
|
+
|
|
330
|
+
- 🎁 Add the ability to print the grid (#2519) @DanailH
|
|
331
|
+
|
|
332
|
+
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.
|
|
333
|
+
|
|
334
|
+
- 💡 Enhance internal code structure
|
|
335
|
+
- ✨ New slots for `row` and `cell` (#2753) @m4theushw
|
|
336
|
+
- 📚 Documentation improvements
|
|
337
|
+
- 🐞 Bugfixes
|
|
338
|
+
|
|
339
|
+
### `@mui/x-data-grid@v5.0.0-beta.4` / `@mui/x-data-grid-pro@v5.0.0-beta.4`
|
|
340
|
+
|
|
341
|
+
#### Breaking changes
|
|
342
|
+
|
|
343
|
+
- [DataGrid] Remove unused event listeners and redundant DOM attributes on `GridCell` and `GridRow` (#2810) @m4theushw
|
|
344
|
+
|
|
345
|
+
The following props were removed. If you depend on them, use `componentsProps.row` and `componentsProps.cell` to pass custom props to the row or cell.
|
|
346
|
+
|
|
347
|
+
- `onCellBlur`
|
|
348
|
+
- `onCellOver`
|
|
349
|
+
- `onCellOut`
|
|
350
|
+
- `onCellEnter`
|
|
351
|
+
- `onCellLeave`
|
|
352
|
+
- `onRowOver`
|
|
353
|
+
- `onRowOut`
|
|
354
|
+
- `onRowEnter`
|
|
355
|
+
- `onRowLeave`
|
|
356
|
+
|
|
357
|
+
For more information, check [this page](https://mui.com/components/data-grid/components/#row). Example:
|
|
358
|
+
|
|
359
|
+
```diff
|
|
360
|
+
-<DataGrid onRowOver={handleRowOver} />;
|
|
361
|
+
+<DataGrid
|
|
362
|
+
+ componentsProps={{
|
|
363
|
+
+ row: { onMouseOver: handleRowOver },
|
|
364
|
+
+ }}
|
|
365
|
+
+/>;
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
The `data-rowindex` and `data-rowselected` attributes were removed from the cell element. Equivalent attributes can be found in the row element.
|
|
369
|
+
|
|
370
|
+
The `data-editable` attribute was removed from the cell element. Use the `.MuiDataGrid-cell--editable` CSS class.
|
|
371
|
+
|
|
372
|
+
The `data-mode` attribute was removed from the cell element. Use the `.MuiDataGrid-cell--editing` CSS class.
|
|
373
|
+
|
|
374
|
+
- [DataGrid] The `state.filter` and `state.visibleRows` were merged into a single `state.filter` sub-state (#2782) @flaviendelangle
|
|
375
|
+
|
|
376
|
+
To still access this information, use `state.filter` or the selectors as below:
|
|
377
|
+
|
|
378
|
+
```diff
|
|
379
|
+
-const filterModel = state.filter
|
|
380
|
+
-const filterModel = gridFilterStateSelector(state)
|
|
381
|
+
+const filterModel = state.filter.filterModel
|
|
382
|
+
+const filterModel = gridFilterModelSelector(state) // preferred method
|
|
383
|
+
|
|
384
|
+
-const visibleRowsLookup = state.visibleRows.visibleRowsLookup
|
|
385
|
+
-const visibleRowsLookup = visibleGridRowsStateSelector(state).visibleRowsLookup
|
|
386
|
+
+const visibleRowsLookup = state.filter.visibleRowsLookup
|
|
387
|
+
+const visibleRowsLookup = gridVisibleRowsLookupSelector(state).visibleRowsLookup // preferred method
|
|
388
|
+
|
|
389
|
+
-const visibleRows = state.visibleRows.visibleRows
|
|
390
|
+
+const visibleRows = state.filter.visibleRows
|
|
391
|
+
+const visibleRows = gridVisibleRowsLookupSelector(state).visibleRows // preferred method
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
- [DataGrid] The CSS classes constants are not exported anymore. Use `gridClasses` instead. (#2788) @flaviendelangle
|
|
395
|
+
|
|
396
|
+
```diff
|
|
397
|
+
-const columnHeaderClass = GRID_COLUMN_HEADER_CSS_CLASS
|
|
398
|
+
+const columnHeaderClass = gridClasses.columnHeader
|
|
399
|
+
|
|
400
|
+
-const rowClass = GRID_ROW_CSS_CLASS
|
|
401
|
+
+const rowClass = gridClasses.row
|
|
402
|
+
|
|
403
|
+
-const cellClass = GRID_CELL_CSS_CLASS
|
|
404
|
+
+const cellClass = gridClasses.cell
|
|
405
|
+
|
|
406
|
+
-const columnSeparatorClass = GRID_COLUMN_HEADER_SEPARATOR_RESIZABLE_CSS_CLASS
|
|
407
|
+
+const columnSeparatorClass = gridClasses['columnSeparator--resizable']
|
|
408
|
+
|
|
409
|
+
-const columnHeaderTitleClass = GRID_COLUMN_HEADER_TITLE_CSS_CLASS
|
|
410
|
+
+const columnHeaderTitleClass = gridClasses.columnHeaderTitle
|
|
411
|
+
|
|
412
|
+
-const columnHeaderDropZoneClass = GRID_COLUMN_HEADER_DROP_ZONE_CSS_CLASS
|
|
413
|
+
+const columnHeaderDropZoneClass = gridClasses.columnHeaderDropZone
|
|
414
|
+
|
|
415
|
+
-const columnHeaderDraggingClass = GRID_COLUMN_HEADER_DRAGGING_CSS_CLASS
|
|
416
|
+
+const columnHeaderDraggingClass = gridClasses["columnHeader--dragging"]
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
- [DataGrid] Rename `gridCheckboxSelectionColDef` to `GRID_CHECKBOX_SELECTION_COL_DEF` (#2793) @flaviendelangle
|
|
420
|
+
|
|
421
|
+
```diff
|
|
422
|
+
- gridCheckboxSelectionColDef
|
|
423
|
+
+ GRID_CHECKBOX_SELECTION_COL_DEF
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
- [DataGrid] The constants referring to the column types were removed (#2791) @flaviendelangle
|
|
427
|
+
Replace them as below:
|
|
428
|
+
|
|
429
|
+
```diff
|
|
430
|
+
-const isColumnString = column.type === GRID_STRING_COLUMN_TYPE;
|
|
431
|
+
+const isColumnString = col.type === 'string';
|
|
432
|
+
|
|
433
|
+
-const isColumnNumber = col.type === GRID_NUMBER_COLUMN_TYPE;
|
|
434
|
+
+const isColumnNumber = col.type === 'number';
|
|
435
|
+
|
|
436
|
+
-const isColumnDate = col.type === GRID_DATE_COLUMN_TYPE;
|
|
437
|
+
+const isColumnDate = col.type === 'date';
|
|
438
|
+
|
|
439
|
+
-const isColumnDateTime = col.type === GRID_DATETIME_COLUMN_TYPE;
|
|
440
|
+
+const isColumnDateTime = col.type === 'dateTime';
|
|
441
|
+
|
|
442
|
+
-const isColumnBoolean = col.type === GRID_BOOLEAN_COLUMN_TYPE;
|
|
443
|
+
+const isColumnBoolean = col.type === 'boolean';
|
|
444
|
+
```
|
|
445
|
+
|
|
446
|
+
- [DataGrid] The state initializers were removed (#2782) @flaviendelangle
|
|
447
|
+
|
|
448
|
+
Use `getDefaultGridFilterModel` instead of `getInitialGridFilterState`:
|
|
449
|
+
|
|
450
|
+
```diff
|
|
451
|
+
-const [filterModel, setFilterModel] = React.useState(getInitialGridFilterState);
|
|
452
|
+
+const [filterModel, setFilterModel] = React.useState(getDefaultGridFilterModel);
|
|
453
|
+
```
|
|
454
|
+
|
|
455
|
+
For the other methods, you can hardcode the value you want to apply:
|
|
456
|
+
|
|
457
|
+
```diff
|
|
458
|
+
-const [sortModel, setSortModel] = React.useState(() => getInitialGridSortingState().sortModel);
|
|
459
|
+
+const [sortModel, setSortModel] React.useState([]);
|
|
460
|
+
|
|
461
|
+
-getInitialGridColumnReorderState
|
|
462
|
+
-getInitialGridColumnResizeState
|
|
463
|
+
-getInitialGridColumnsState
|
|
464
|
+
-getInitialGridRenderingState
|
|
465
|
+
-getInitialGridRowState
|
|
466
|
+
-getInitialGridState
|
|
467
|
+
-getInitialVisibleGridRowsState
|
|
468
|
+
-getInitialGridState
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
#### Changes
|
|
472
|
+
|
|
473
|
+
- [DataGrid] Add `row` and `cell` component slots (#2753) @m4theushw
|
|
474
|
+
- [DataGrid] Rename `gridCheckboxSelectionColDef` to `GRID_CHECKBOX_SELECTION_COL_DEF` (#2793) @flaviendelangle
|
|
475
|
+
- [DataGrid] Clean hook folder structure and stop exporting internal hooks (#2789) @flaviendelangle
|
|
476
|
+
- [DataGrid] Add support for Print export (#2519) @DanailH
|
|
477
|
+
- [DataGrid] Remove internal localization and column type constant exports (#2791) @flaviendelangle
|
|
478
|
+
- [DataGrid] Remove `GridRowCells` component (#2811) @m4theushw
|
|
479
|
+
- [DataGrid] Remove class constants exports (#2788) @flaviendelangle
|
|
480
|
+
- [DataGrid] Remove unused event listeners on `GridCell` and `GridRow` (#2810) @m4theushw
|
|
481
|
+
- [DataGrid] Fix the header selection checkbox to work with `prop.checkboxSelectionVisibleOnly` (#2781) @flaviendelangle
|
|
482
|
+
|
|
483
|
+
### Docs
|
|
484
|
+
|
|
485
|
+
- [docs] Add link to installation page (#2778) @MostafaKMilly
|
|
486
|
+
- [docs] Add redirect from docs home page to `DataGrid` home page (#2737) @flaviendelangle
|
|
487
|
+
- [docs] Fix JSX closing tag in `getActions` example (#2847) @dstarner
|
|
488
|
+
- [docs] Fix pagination in Ant Design demo (#2787) @ZeeshanTamboli
|
|
489
|
+
- [docs] Update the `page` prop docs (#2812) @m4theushw
|
|
490
|
+
|
|
491
|
+
### Core
|
|
492
|
+
|
|
493
|
+
- [core] Update hooks to initialize their state synchronously (#2782) @flaviendelangle
|
|
494
|
+
- [core] Fix rollup external warnings (#2736) @eps1lon
|
|
495
|
+
|
|
6
496
|
## 5.0.0-beta.3
|
|
7
497
|
|
|
8
498
|
_Oct 7, 2021_
|
|
@@ -11,7 +501,7 @@ A big thanks to the 9 contributors who made this release possible. Here are some
|
|
|
11
501
|
|
|
12
502
|
- 🌎 Add Persian (faIR) locale (#2712) @devlifeX
|
|
13
503
|
- 🎁 Allow to select range of rows with Shift + click (#2456) @flaviendelangle
|
|
14
|
-
- 🚀 Allow to throttle the row updates with the `throttleRowsMs` prop on `DataGridPro` and remove the default 100ms row update
|
|
504
|
+
- 🚀 Allow to throttle the row updates with the `throttleRowsMs` prop on `DataGridPro` and remove the default 100ms row update delay (#2561) @flaviendelangle
|
|
15
505
|
- 💡 Enhance internal code structure
|
|
16
506
|
- 📚 Documentation improvements
|
|
17
507
|
- 🐞 Bugfixes
|
package/LICENSE
CHANGED