@mui/x-data-grid 5.0.0-beta.6 → 5.1.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/CHANGELOG.md CHANGED
@@ -3,6 +3,310 @@
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.1.0
7
+
8
+ _Nov 2, 2021_
9
+
10
+ A big thanks to the 11 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ ### `@mui/x-data-grid@v5.1.0` / `@mui/x-data-grid-pro@v5.1.0`
13
+
14
+ - 🚀 Introduce the [tree data](https://mui.com/components/data-grid/group-pivot/#tree-data) feature (#2725) @flaviendelangle
15
+
16
+ <img src="https://user-images.githubusercontent.com/42154031/144259216-fc4f90ac-4d8b-4253-bc95-009204349a4c.gif" width="854" height="453" />
17
+
18
+ - 💅 Add support for `sx` prop in the DataGrid and DataGridPro (#3281) @m4theushw
19
+ - 🔦 Improve focus management in the filter panel (#3004) @alexfauquette
20
+ - 🎁 Add strict typing to the event publisher and listener (#3022) (@flaviendelangle)
21
+
22
+ The `apiRef.current.subscribeEvent`, `apiRef.current.publishEvent` and `useGridApiEventHandler` are now fully typed and gives you the correct arguments based on the event you are listening to or emitting.
23
+
24
+ ```ts
25
+ const handleRowClick: GridEventListener<'rowClick'> = (
26
+ params, // has type `GridRowParams`
27
+ event, // has type `MuiEvent<React.MouseEvent<HTMLElement>>
28
+ details, // has type `GridCallbackDetails
29
+ ) => {
30
+ /* ... */
31
+ };
32
+
33
+ // with string event name
34
+ apiRef.current.subscribeEvent('rowClick', handleRowClick);
35
+ useGridApiEventHandler(apiRef, 'rowClick', handleRowClick);
36
+
37
+ // or with enum event name
38
+ apiRef.current.subscribeEvent(GridEvents.rowClick, handleRowClick);
39
+ useGridApiEventHandler(apiRef, GridEvents.rowClick, handleRowClick);
40
+ ```
41
+
42
+ - 🌎 Translation updates for many locales
43
+
44
+ If you are using DataGrid or DataGridPro in another language, check [this issue](https://github.com/mui-org/material-ui-x/issues/3211) to discover which translations are missing.
45
+
46
+ - 📚 Documentation improvements
47
+ - 🐞 Bugfixes
48
+
49
+ #### Changes
50
+
51
+ - [DataGridPro] Add tree data (#2725) @flaviendelangle
52
+ - [DataGridPro] Remove the callback version of the `groupigColDef` prop (#3317) @flaviendelangle
53
+ - [DataGridPro] Improve license file (#3278) @oliviertassinari
54
+ - [DataGridPro] Add types for event publishers and listeners (#3022) @flaviendelangle
55
+ - [DataGrid] Add support for `sx` prop (#3281) @m4theushw
56
+ - [DataGrid] Do not debounce the initial resizing of the grid (#3213) @flaviendelangle
57
+ - [DataGrid] Fix usage of dynamic columns (#3204) @flaviendelangle
58
+ - [DataGrid] Move focus when selecting option with <kbd>Enter</kbd> in the `singleSelect` (#3220) @m4theushw
59
+ - [DataGrid] Focus on the last value input when a filter is added or removed (#3004) @alexfauquette
60
+ - [DataGrid] Prepare the tree structure for grouping sorting / filtering (#3301) @flaviendelangle
61
+ - [DataGrid] Rework keyboard navigation (#3193) @flaviendelangle
62
+ - [DataGrid] Set minimum dimensions to `GridOverlay` when no row is provided (#3261) @flaviendelangle
63
+ - [DataGrid] Improve German (deDE) locale (#3271, #3230, #3293) @sebastianfrey
64
+ - [DataGrid] Improve Hebrew (heIL) locale (#3294) @ColdAtNight
65
+ - [DataGrid] Improve Russian (ruRU) locale (#3290, #3288) @Alim-El
66
+ - [DataGrid] Improve Korean (koKR) locale (#3232, #3273) @zzossig
67
+ - [DataGrid] Improve Greek (elGR) locale (#3169) @clytras
68
+
69
+ ### Core
70
+
71
+ - [core] Add script to sync translation files (#3201) @m4theushw
72
+ - [core] Create dedicated `InputComponent` for `singleSelect` and `date` columns #3227 @alexfauquette
73
+ - [core] Fix `EventManager` to not run listeners removed after registration #3206 @flaviendelangle
74
+ - [core] Group Renovate updates (#3263) @flaviendelangle
75
+ - [core] Reflect the change of default branch (#3235) @oliviertassinari
76
+ - [core] Replace @mui/core with @mui/base (#3217) @m4theushw
77
+ - [core] Split docs generation script (#3189) @flaviendelangle
78
+ - [core] Update monorepo (#3303) @m4theushw
79
+ - [test] Improve testing of the keyboard navigation (#3187) @flaviendelangle
80
+ - [test] Force effect to run on location change (#3283) @m4theushw
81
+ - [core] Rework columns state management (#3264) @flaviendelangle
82
+
83
+ ### Docs
84
+
85
+ - [docs] Improve demo to allow to experiment with `autoHeight` (#3216) @alexfauquette
86
+ - [docs] Fix broken images (#3300) @oliviertassinari
87
+ - [docs] Fix the wrong release date (#3269) @DanailH
88
+ - [docs] Fix typo in CHANGELOG.md (#3214) @gjoseph
89
+ - [docs] Improve plan icon placement (#3298) @oliviertassinari
90
+ - [docs] Improve rows documentation (#3209) @flaviendelangle
91
+ - [docs] Include row pinning (#3191) @oliviertassinari
92
+ - [docs] Fix presentation of key combinations (#3297) @oliviertassinari
93
+ - [docs] Replace @mui/styles on demos (#3274) @m4theushw
94
+ - [docs] Add demos using cell/row editing with server-side persistence (#3124) @flaviendelangle
95
+ - [docs] Use relative links (#3299) @oliviertassinari
96
+
97
+ ## 5.0.1
98
+
99
+ _Nov 23, 2021_
100
+
101
+ A big thanks to the 3 contributors who made this release possible. Here are some highlights ✨:
102
+
103
+ - 🎁 New API to validate the editing values (#3006) @m4theushw
104
+
105
+ You can now use the `preProcessEditCellProps` key in `GridColDef` to synchronously or asynchronously validate the values committed.
106
+
107
+ ```ts
108
+ const columns: GridColDef[] = [
109
+ {
110
+ field: 'firstName',
111
+ preProcessEditCellProps: (params: GridEditCellPropsChangeParams) => {
112
+ const hasError = params.props.value.length < 3;
113
+ return { ...params.props, error: hasError };
114
+ },
115
+ },
116
+ {
117
+ field: 'email',
118
+ preProcessEditCellProps: async (params: GridEditCellPropsChangeParams) => {
119
+ const userWithEmail = await fetchUserByEmail(params.value);
120
+ const hasError = !!userWithEmail;
121
+ return { ...params.props, error: hasError };
122
+ }
123
+ }
124
+ ];
125
+ ```
126
+
127
+ - ✨ New method `getRootDimensions` to access the size of the grid (#3007) @flaviendelangle
128
+
129
+ It contains the size of the viewport (which is the scrollable container containing the rows and columns) considering scrollbars or not.
130
+
131
+ ```ts
132
+ const dimensions = apiRef.current.getRootDimensions();
133
+ ```
134
+
135
+ ### `@mui/x-data-grid@v5.0.1` / `@mui/x-data-grid-pro@v5.0.1`
136
+
137
+ #### Changes
138
+
139
+ - [DataGrid] New API to validate the editing values (#3006) @m4theushw
140
+ - [DataGrid] Use color-scheme to set dark mode on native components (#3146) @alexfauquette
141
+ - [DataGrid] Fix the `@mui/x-data-grid` type entrypoint (#3196) @flaviendelangle
142
+
143
+ ### Core
144
+
145
+ - [core] Drop `useGridContainerProps` (#3007) @flaviendelangle
146
+ - [core] Move `getRowIdFromRowIndex` and `getRowIndex` to the sorting API (#3126) @flaviendelangle
147
+ - [core] Polish v5 CHANGELOG (#3194) @oliviertassinari
148
+ - [core] Remove the `index.ts` of the export hooks (#3165) @flaviendelangle
149
+ - [core] Set the correct release date for v5.0.0 in the CHANGELOG.md (#3192) @flaviendelangle
150
+
151
+ ### Docs
152
+
153
+ - [docs] Move sentence about disabling multi rows selection (#3167) @alexfauquette
154
+
155
+ ## 5.0.0
156
+
157
+ _Nov 23, 2021_
158
+
159
+ 🎉 We are excited to introduce [MUI X v5.0.0](https://mui.com/blog/mui-x-v5/) 🎉!
160
+
161
+ If you want to migrate the DataGrid or DataGridPro from v4 to v5, take a look at the [migration guide](https://mui.com/components/data-grid/migration-v4/).
162
+ This version is fully compatible with `@mui/material@5.X` and can be used with `@material-ui/core@4.x` with some [additional steps](https://mui.com/components/data-grid/migration-v4/#using-mui-x-v5-with-mui-core-v4).
163
+
164
+ A big thanks to the 7 contributors who made this release possible. Here are some highlights ✨:
165
+
166
+ - ⌨️ Enhance keyboard navigation when pagination is enabled
167
+ - 👁 Better support for flex columns
168
+ - 📚 Documentation improvements
169
+ - 🐞 Bugfixes
170
+
171
+ ### `@mui/x-data-grid@v5.0.0` / `@mui/x-data-grid-pro@v5.0.0`
172
+
173
+ #### Breaking changes
174
+
175
+ - [DataGrid] The following CSS classes were renamed to follow the internal convention:
176
+
177
+ - `MuiDataGrid-columnsContainer` was renamed to `MuiDataGrid-columnHeaders`
178
+ - `MuiDataGrid-columnHeaderWrapper` was renamed to `MuiDataGrid-columnHeadersInner`
179
+ - The `scroll` class applied to `MuiDataGrid-columnHeaderWrapper` was renamed to `MuiDataGrid-columnHeadersInner--scrollable`
180
+
181
+ - [DataGrid] The `props.components.Checkbox` and `props.componentsProps.checkbox` props were renamed to `props.components.BaseCheckbox` and `props.componentsProps.baseCheckbox` respectively.
182
+
183
+ As a first step for [#3066](https://github.com/mui-org/material-ui-x/issues/3066), these slots were renamed to clearly indicate that they are meant to replace a core component.
184
+
185
+ ```diff
186
+ <DataGrid
187
+ components={{
188
+ - checkbox: MyCustomCheckbox,
189
+ + BaseCheckbox: MyCustomCheckbox,
190
+ }}
191
+ componentsProps={{
192
+ - checkbox: {},
193
+ + baseCheckbox: {},
194
+ }}
195
+ />
196
+ ```
197
+
198
+ **Note**: these changes apply to both the `DataGrid` and `DataGridPro` components.
199
+
200
+ #### Changes
201
+
202
+ - [DataGrid] Block multi-rows updates in `apiRef.current.updateRows` on the Community plan (#3095) @flaviendelangle
203
+ - [DataGrid] Fix filter not working after deleting the value (#3018) @m4theushw
204
+ - [DataGrid] Fix performance regression when selecting 100k rows (#3077) @m4theushw
205
+ - [DataGrid] Fix `apiRef.current.updateRows` to not share rows from other instances (#3127) @m4theushw
206
+ - [DataGrid] Fix flex space allocation to not cause a horizontal scroll when there is enough space (#3099) @flaviendelangle
207
+ - [DataGrid] Improve the filter panel behaviors (#3080) @flaviendelangle
208
+ - [DataGrid] Fix keyboard navigation between column headers and rows when not on the first page (#3086) @flaviendelangle
209
+ - [DataGrid] Fix keyboard navigation between rows when not on the first page (#3074) @flaviendelangle
210
+ - [DataGrid] Prevents bubbling in menu header (#3000) @alexfauquette
211
+ - [DataGrid] Remove unused rendering state and selectors (#3133) @flaviendelangle
212
+ - [DataGrid] Rename `Checkbox` component and props slots to `BaseCheckbox` (#3142) @DanailH
213
+
214
+ ### Core
215
+
216
+ - [core] Adapt changelog script to GitHub DOM modification (#3087) @alexfauquette
217
+ - [core] Automatically close issues that are incomplete and inactive (#3029) @oliviertassinari
218
+ - [core] Improve the typing of `LicenseStatus` (#3141) @Himself65
219
+ - [core] Make `useGridColumnsPreProcessing` generic (#3092) @m4theushw
220
+ - [core] Move column headers virtualization to hook (#3078) @m4theushw
221
+ - [core] Move virtualization logic to hook (#3079) @m4theushw
222
+ - [core] Rename directories to match new packages new names (#3088) @flaviendelangle
223
+ - [core] Replace `createClientRender` with new `createRenderer` API (#3125) @flaviendelangle
224
+ - [core] Store the event manager in a key of `GridApi` instead of making the whole `GridApi` extend it (#3069) @flaviendelangle
225
+ - [core] Update monorepo (#3139) @m4theushw
226
+ - [core] Use `unstable_` prefix instead of `unsafe_` for private APIs (#3090) @flaviendelangle
227
+ - [core] Use official MUI repo as monorepo (#3084) @m4theushw
228
+
229
+ ### Docs
230
+
231
+ - [docs] Fix broken example in the component slot example (#3123) @Himself65
232
+ - [docs] Fix inline previews (#3081) @DanailH
233
+ - [docs] Fix the client-side validation link clarity (#3100) @oliviertassinari
234
+ - [docs] Improve `rowCount` CSS class description (#3072) @ZeeshanTamboli
235
+ - [docs] Use core repo constants for doc internationalization (#3143) @flaviendelangle
236
+
237
+ ## 5.0.0-beta.7
238
+
239
+ _Nov 4, 2021_
240
+
241
+ - 💅 Reduce styles specificity to make simpler to override (#3012) @DanailH
242
+ - 🌍 Add Hebrew (heIL) locale (#3028) @ColdAtNight
243
+ - 📚 Documentation improvements
244
+ - 🐞 Bugfixes
245
+
246
+ ### `@mui/x-data-grid@v5.0.0-beta.7` / `@mui/x-data-grid-pro@v5.0.0-beta.7`
247
+
248
+ #### Breaking changes
249
+
250
+ - [core] Prefix selectors from `useGridContainerProps` with `unsafe` (#3002) @flaviendelangle
251
+
252
+ The dimension API is being temporarily made private to allow to clean it in future minor releases. The current approach causes useless re-renders.
253
+ 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.
254
+
255
+ The following selectors were prefixed by `unstable_`. Use the provided alternatives.
256
+
257
+ 1. `gridContainerSizesSelector` was renamed to `unstable_gridContainerSizesSelector`
258
+ 2. `gridViewportSizesSelector` was renamed to `unstable_gridViewportSizesSelector`
259
+ 3. `gridScrollBarSizeSelector` was renamed to `unstable_gridScrollBarSizeSelector`
260
+
261
+ The following selectors were removed. You can hard-code their logic in your application if you really need them.
262
+
263
+ 1. `gridDataContainerSizesSelector`
264
+
265
+ ```ts
266
+ const dataContainerSizes = gridContainerSizesSelector(state)?.dataContainerSizes ?? null;
267
+ ```
268
+
269
+ 2. `gridDataContainerHeightSelector`
270
+
271
+ ```ts
272
+ const dataContainerHeight = gridContainerSizesSelector(state)?.dataContainerSizes.height ?? null;
273
+ ```
274
+
275
+ The selector `gridViewportSizeStateSelector` was a duplicate and has been removed, you can use the selector `unstable_gridViewportSizesSelector` instead.
276
+
277
+ #### Changes
278
+
279
+ - [DataGrid] Add Hebrew (heIL) locale (#3028) @ColdAtNight
280
+ - [DataGrid] Move virtualization logic to hook (#3079) @m4theushw
281
+ - [DataGrid] Revert year change in the MIT license (#3059) @oliviertassinari
282
+ - [DataGrid] Fix filtering of nullish numeric cells (#3070) @flaviendelangle
283
+ - [DataGrid] Improve performance when selecting 100k rows (#3077) @m4theushw
284
+ - [DataGrid] Fix `GridEditDateCell` to handle timezone correctly (#2918) @flaviendelangle
285
+ - [DataGrid] Fix keyboard navigation on page > 0 (#3074) @flaviendelangle
286
+ - [DataGrid] Prevents bubbling in menu header (#3000) @alexfauquette
287
+ - [DataGrid] Fix wrong params provided to `cellModeChange` when `setCellMode` is called (#3025) @flaviendelangle
288
+
289
+ ### Core
290
+
291
+ - [core] Adapt `useDemoData` for Tree Data (#2978) @flaviendelangle
292
+ - [core] Group update of MUI Core (#3055) @oliviertassinari
293
+ - [core] Ignore `*.tsbuildinfo` files (#3068) @m4theushw
294
+ - [core] Implement tree-based row management (#2996) @flaviendelangle
295
+ - [core] Invert Codesandbox examples on README (#3073) @flaviendelangle
296
+ - [core] Prefix selectors from `useGridContainerProps` with `unsafe` (#3002) @flaviendelangle
297
+ - [core] Reduce `setGridState` and `applyFilters` call when updating `filterModel` (#3023) @flaviendelangle
298
+ - [core] Reduce styles complexity (#3012) @DanailH
299
+ - [core] Upgrade monorepo (#3067) @m4theushw
300
+ - [core] Use official MUI repo as monorepo (#3084) @m4theushw
301
+ - [test] Retry each expect until success (#3027) @m4theushw
302
+ - [core] Adapt changelog script to new GitHub DOM (#3087) @alexfauquette
303
+
304
+ ### Docs
305
+
306
+ - [docs] Explain how to use `valueGetter` to transform type (#3003) @alexfauquette
307
+ - [docs] Fix the outdated demo of the docs (#3058) @oliviertassinari
308
+ - [docs] Fix inline previews #3081) @DanailH
309
+
6
310
  ## 5.0.0-beta.6
7
311
 
8
312
  _Oct 29, 2021_
@@ -44,9 +348,9 @@ A big thanks to the 7 contributors who made this release possible. Here are some
44
348
  4. `visibleSortedGridRowIdsSelector` was renamed to `gridVisibleSortedRowIdsSelector`
45
349
  5. `visibleGridRowCountSelector` was renamed to `gridVisibleRowCountSelector`
46
350
  6. `filterGridColumnLookupSelector` was renamed to `gridFilterActiveItemsSelector`
47
-
351
+
48
352
  - [DataGridPro] The `sortedGridRowsSelector` was renamed to `gridSortedRowEntriesSelector` (#2942) @flaviendelangle
49
-
353
+
50
354
  The return value was also changed as below:
51
355
 
52
356
  ```diff
@@ -57,7 +361,7 @@ A big thanks to the 7 contributors who made this release possible. Here are some
57
361
  ```
58
362
 
59
363
  - [DataGridPro] The `visibleSortedGridRowsSelector` was replaced with `gridVisibleSortedRowEntriesSelector` (#2942) @flaviendelangle
60
-
364
+
61
365
  The return value was also changed as below:
62
366
 
63
367
  ```diff
@@ -68,7 +372,7 @@ A big thanks to the 7 contributors who made this release possible. Here are some
68
372
  ```
69
373
 
70
374
  - [DataGridPro] The `visibleSortedGridRowsAsArraySelector` was replaced with `gridVisibleSortedRowEntriesSelector` (#2942) @flaviendelangle
71
-
375
+
72
376
  The return value was also changed as below:
73
377
 
74
378
  ```diff
@@ -193,7 +497,7 @@ A big thanks to the 5 contributors who made this release possible. Here are some
193
497
  const prevRenderContext = React.useRef(null);
194
498
 
195
499
  React.useEffect(() => {
196
- return apiRef.current.subscribeEvent("rowsScroll", ({ renderContext }) => {
500
+ return apiRef.current.subscribeEvent('rowsScroll', ({ renderContext }) => {
197
501
  if (
198
502
  !prevRenderContext.current ||
199
503
  renderContext.firstRowIdx !== prevRenderContext.current.firstRowIndex ||
@@ -202,13 +506,13 @@ A big thanks to the 5 contributors who made this release possible. Here are some
202
506
  prevRenderContext.current = renderContext;
203
507
  const params = {
204
508
  firstRowIndex: renderContext.firstRowIndex,
205
- lastRowIndex: renderContext.lastRowIndex
509
+ lastRowIndex: renderContext.lastRowIndex,
206
510
  };
207
511
  }
208
512
  });
209
513
  }, [apiRef]);
210
514
 
211
- <DataGridPro apiRef={apiRef} />
515
+ <DataGridPro apiRef={apiRef} />;
212
516
  ```
213
517
 
214
518
  #### Changes
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2021 Material-UI SAS
3
+ Copyright (c) 2020 Material-UI SAS
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal