@mui/x-data-grid 5.0.0 → 5.2.1

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,14 +3,289 @@
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.2.1
7
+
8
+ _Dec 17, 2021_
9
+
10
+ A big thanks to the 8 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 🖨️ Improve the print export to break the pages correctly (#3302) @flaviendelangle
13
+ - 🎁 Add `pinnable` option to `GridColDef` (#3425) @m4theushw
14
+ - 📚 Documentation improvements
15
+ - 🐞 Bugfixes
16
+
17
+ ### `@mui/x-data-grid@v5.2.1` / `@mui/x-data-grid-pro@v5.2.1`
18
+
19
+ #### Changes
20
+
21
+ - [DataGridPro] Add `pinnable` option (#3425) @m4theushw
22
+ - [DataGridPro] Avoid filtering columns if no column is pinned (#3438) @m4theushw
23
+ - [DataGrid] Avoid page break inside a row in the Print Export (#3302) @flaviendelangle
24
+ - [DataGrid] Fix `GridEditDateCell` to handle `editRowsModel` correctly (#3267) @alexfauquette
25
+ - [DataGrid] Refactor keyboard/click event management (#3275) @alexfauquette
26
+ - [DataGrid] Fire change event when the state changes, instead of when the prop changes (#3388) @flaviendelangle
27
+ - [DataGrid] Unsubscribe event listeners registered in uncommitted renders (#3310) @m4theushw
28
+ - [l10n] Improve German (deDE) locale (#3430) @sebastianfrey
29
+ - [l10n] Improve Hebrew (heIL) locale (#3445) @ColdAtNight
30
+ - [l10n] Improve Dutch (nlNL) locale (#3429) @jaapjr
31
+
32
+ ### Core
33
+
34
+ - [core] Rework state update methods and deprecate `useGridApi` and `useGridState` (#3325) @flaviendelangle
35
+ - [core] Add sections to some of the feature hooks (#3391) @flaviendelangle
36
+ - [core] Generate exports snapshot for both `x-data-grid` and `x-data-grid-pro` packages (#3427) @flaviendelangle
37
+ - [core] Remove 'x-data-grid' folder from DataGridPro bundle (#3394) @m4theushw
38
+ - [core] Add link to OpenCollective (#3392) @oliviertassinari
39
+
40
+ ### Docs
41
+
42
+ - [docs] Improve pagination documentation page (#3424) @flaviendelangle
43
+ - [docs] Include @mui/x-data-grid as dependency in the CodeSandbox (#3396) @m4theushw
44
+ - [docs] Stop using TypeDoc to generate the API documentation (#3320) @flaviendelangle
45
+ - [docs] Remove column pinning from "Upcoming features" (#3443) @alexfauquette
46
+
47
+ ## 5.2.0
48
+
49
+ _Dec 9, 2021_
50
+
51
+ A big thanks to the 5 contributors who made this release possible. Here are some highlights ✨:
52
+
53
+ ### `@mui/x-data-grid@v5.2.0` / `@mui/x-data-grid-pro@v5.2.0`
54
+
55
+ - 🚀 Introduce the [column pinning](https://mui.com/components/data-grid/columns/#column-pinning) feature (#2946) @m4theushw
56
+
57
+ <img src="https://user-images.githubusercontent.com/42154031/145425635-b6314fbe-2f1e-4b73-908f-33ee1fda20c7.gif" width="964" height="657">
58
+
59
+ - 🔥 Add ability to disable export options (#3270) @alexfauquette
60
+
61
+ You can disable either export options by setting `disableToolbarButton` to `true`.
62
+
63
+ ```tsx
64
+ <GridToolbarExport csvOptions={{ disableToolbarButton: true }} />
65
+ ```
66
+
67
+ ```tsx
68
+ <GridToolbarExport printOptions={{ disableToolbarButton: true }} />
69
+ ```
70
+
71
+ - 🙈 Add a new option to hide the amount of descendant on the grouping cells of the Tree Data (#3368) @flaviendelangle
72
+
73
+ ```tsx
74
+ <DataGridPro
75
+ treeData
76
+ rows={rows}
77
+ columns={columns}
78
+ groupingColDef={{ hideDescendantCount }}
79
+ />
80
+ ```
81
+
82
+ - ⚠️ Deprecate the `getValue` param for the `valueGetter` callback (#3314) @flaviendelangle
83
+
84
+ Instead, you can access directly the row in the params
85
+
86
+ ```diff
87
+ -valueGetter: (params) => `${params.getValue(params.id, 'firstName') || ''} ${params.getValue(params.id, 'lastName') || ''}`
88
+ +valueGetter: (params) => `${params.row.firstName || ''} ${params.row.lastName || ''}`
89
+ ```
90
+
91
+ - 📚 Documentation improvements
92
+ - 🐞 Bugfixes
93
+
94
+ #### Changes
95
+
96
+ - [DataGridPro] Add column pinning (#2946) @m4theushw
97
+ - [DataGridPro] Add `hideDescendantCount` option to Tree Data (#3368) @flaviendelangle
98
+ - [DataGridPro] Do not expand row children with <kbd>Shift</kbd> + Space (#3380) @flaviendelangle
99
+ - [DataGridPro] Pass a list of `fields` to the callback version of `groupingColDef` (#3316) @flaviendelangle
100
+ - [DataGrid] Deprecate the `getValue` param for the `valueGetter` callback (#3314) @flaviendelangle
101
+ - [DataGrid] Add ability to disable export options (#3270) @alexfauquette
102
+ - [DataGrid] Filter value are conserved when possible (#3198) @alexfauquette
103
+ - [DataGrid] Fix `DatePicker` bug by limiting years to 4 digits (#3222) @alexfauquette
104
+ - [DataGrid] Fix column menu position when closing (#3289) @m4theushw
105
+ - [DataGrid] Fix to not crash when a sort item uses a non-existing column (#3224) @flaviendelangle
106
+
107
+ ### Core
108
+
109
+ - [core] Add funding field (#3331) @oliviertassinari
110
+ - [core] Fix missing LICENSE file (#3330) @oliviertassinari
111
+ - [core] Fix release month in CHANGELOG (#3367) @m4theushw
112
+ - [core] Fix `yarn prettier` script (#3292) @oliviertassinari
113
+ - [core] Improve tests for Tree Data (#3366) @flaviendelangle
114
+ - [core] Never import directly from the `__modules__` folder in the `x-data-grid-generator` package (#3379) @flaviendelangle
115
+ - [core] Transition to a new StackOverflow tag (#3308) @oliviertassinari
116
+ - [core] Type the `api` param in callback interfaces (#3315) @flaviendelangle
117
+ - [core] Update monorepo (#3370) @flaviendelangle
118
+ - [core] Use pre-processors for sorting and filtering (#3318) @flaviendelangle
119
+ - [test] Replace `useFakeTimers` (#3323) @m4theushw
120
+
121
+ ### Docs
122
+
123
+ - [docs] Always use auto-generated `apiRef` documentation (#3266) @flaviendelangle
124
+ - [docs] Avoid 301 links (#3329) @oliviertassinari
125
+ - [docs] Disable the ad when not MIT (#3334) @oliviertassinari
126
+ - [docs] Fix 404 link to Zendesk @oliviertassinari
127
+ - [docs] Fix dead link on the overview page (#3326) @flaviendelangle
128
+ - [docs] Fix double MUI in the title (#3332) @oliviertassinari
129
+ - [docs] Fix duplicate "the" (#3365) @noam-honig
130
+ - [docs] Update branch to deploy docs (#3321) @m4theushw
131
+
132
+ ## 5.1.0
133
+
134
+ _Dec 2, 2021_
135
+
136
+ A big thanks to the 11 contributors who made this release possible. Here are some highlights ✨:
137
+
138
+ ### `@mui/x-data-grid@v5.1.0` / `@mui/x-data-grid-pro@v5.1.0`
139
+
140
+ - 🚀 Introduce the [tree data](https://mui.com/components/data-grid/group-pivot/#tree-data) feature (#2725) @flaviendelangle
141
+
142
+ <img src="https://user-images.githubusercontent.com/42154031/144259216-fc4f90ac-4d8b-4253-bc95-009204349a4c.gif" width="854" height="453" />
143
+
144
+ - 💅 Add support for `sx` prop in the DataGrid and DataGridPro (#3281) @m4theushw
145
+ - 🔦 Improve focus management in the filter panel (#3004) @alexfauquette
146
+ - 🎁 Add strict typing to the event publisher and listener (#3022) (@flaviendelangle)
147
+
148
+ 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.
149
+
150
+ ```ts
151
+ const handleRowClick: GridEventListener<'rowClick'> = (
152
+ params, // has type `GridRowParams`
153
+ event, // has type `MuiEvent<React.MouseEvent<HTMLElement>>
154
+ details, // has type `GridCallbackDetails
155
+ ) => {
156
+ /* ... */
157
+ };
158
+
159
+ // with string event name
160
+ apiRef.current.subscribeEvent('rowClick', handleRowClick);
161
+ useGridApiEventHandler(apiRef, 'rowClick', handleRowClick);
162
+
163
+ // or with enum event name
164
+ apiRef.current.subscribeEvent(GridEvents.rowClick, handleRowClick);
165
+ useGridApiEventHandler(apiRef, GridEvents.rowClick, handleRowClick);
166
+ ```
167
+
168
+ - 🌎 Translation updates for many locales
169
+
170
+ 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.
171
+
172
+ - 📚 Documentation improvements
173
+ - 🐞 Bugfixes
174
+
175
+ #### Changes
176
+
177
+ - [DataGridPro] Add tree data (#2725) @flaviendelangle
178
+ - [DataGridPro] Remove the callback version of the `groupigColDef` prop (#3317) @flaviendelangle
179
+ - [DataGridPro] Improve license file (#3278) @oliviertassinari
180
+ - [DataGridPro] Add types for event publishers and listeners (#3022) @flaviendelangle
181
+ - [DataGrid] Add support for `sx` prop (#3281) @m4theushw
182
+ - [DataGrid] Do not debounce the initial resizing of the grid (#3213) @flaviendelangle
183
+ - [DataGrid] Fix usage of dynamic columns (#3204) @flaviendelangle
184
+ - [DataGrid] Move focus when selecting option with <kbd>Enter</kbd> in the `singleSelect` (#3220) @m4theushw
185
+ - [DataGrid] Focus on the last value input when a filter is added or removed (#3004) @alexfauquette
186
+ - [DataGrid] Prepare the tree structure for grouping sorting / filtering (#3301) @flaviendelangle
187
+ - [DataGrid] Rework keyboard navigation (#3193) @flaviendelangle
188
+ - [DataGrid] Set minimum dimensions to `GridOverlay` when no row is provided (#3261) @flaviendelangle
189
+ - [DataGrid] Improve German (deDE) locale (#3271, #3230, #3293) @sebastianfrey
190
+ - [DataGrid] Improve Hebrew (heIL) locale (#3294) @ColdAtNight
191
+ - [DataGrid] Improve Russian (ruRU) locale (#3290, #3288) @Alim-El
192
+ - [DataGrid] Improve Korean (koKR) locale (#3232, #3273) @zzossig
193
+ - [DataGrid] Improve Greek (elGR) locale (#3169) @clytras
194
+
195
+ ### Core
196
+
197
+ - [core] Add script to sync translation files (#3201) @m4theushw
198
+ - [core] Create dedicated `InputComponent` for `singleSelect` and `date` columns #3227 @alexfauquette
199
+ - [core] Fix `EventManager` to not run listeners removed after registration #3206 @flaviendelangle
200
+ - [core] Group Renovate updates (#3263) @flaviendelangle
201
+ - [core] Reflect the change of default branch (#3235) @oliviertassinari
202
+ - [core] Replace @mui/core with @mui/base (#3217) @m4theushw
203
+ - [core] Split docs generation script (#3189) @flaviendelangle
204
+ - [core] Update monorepo (#3303) @m4theushw
205
+ - [test] Improve testing of the keyboard navigation (#3187) @flaviendelangle
206
+ - [test] Force effect to run on location change (#3283) @m4theushw
207
+ - [core] Rework columns state management (#3264) @flaviendelangle
208
+
209
+ ### Docs
210
+
211
+ - [docs] Improve demo to allow to experiment with `autoHeight` (#3216) @alexfauquette
212
+ - [docs] Fix broken images (#3300) @oliviertassinari
213
+ - [docs] Fix the wrong release date (#3269) @DanailH
214
+ - [docs] Fix typo in CHANGELOG.md (#3214) @gjoseph
215
+ - [docs] Improve plan icon placement (#3298) @oliviertassinari
216
+ - [docs] Improve rows documentation (#3209) @flaviendelangle
217
+ - [docs] Include row pinning (#3191) @oliviertassinari
218
+ - [docs] Fix presentation of key combinations (#3297) @oliviertassinari
219
+ - [docs] Replace @mui/styles on demos (#3274) @m4theushw
220
+ - [docs] Add demos using cell/row editing with server-side persistence (#3124) @flaviendelangle
221
+ - [docs] Use relative links (#3299) @oliviertassinari
222
+
223
+ ## 5.0.1
224
+
225
+ _Nov 23, 2021_
226
+
227
+ A big thanks to the 3 contributors who made this release possible. Here are some highlights ✨:
228
+
229
+ - 🎁 New API to validate the editing values (#3006) @m4theushw
230
+
231
+ You can now use the `preProcessEditCellProps` key in `GridColDef` to synchronously or asynchronously validate the values committed.
232
+
233
+ ```ts
234
+ const columns: GridColDef[] = [
235
+ {
236
+ field: 'firstName',
237
+ preProcessEditCellProps: (params: GridEditCellPropsChangeParams) => {
238
+ const hasError = params.props.value.length < 3;
239
+ return { ...params.props, error: hasError };
240
+ },
241
+ },
242
+ {
243
+ field: 'email',
244
+ preProcessEditCellProps: async (params: GridEditCellPropsChangeParams) => {
245
+ const userWithEmail = await fetchUserByEmail(params.value);
246
+ const hasError = !!userWithEmail;
247
+ return { ...params.props, error: hasError };
248
+ }
249
+ }
250
+ ];
251
+ ```
252
+
253
+ - ✨ New method `getRootDimensions` to access the size of the grid (#3007) @flaviendelangle
254
+
255
+ It contains the size of the viewport (which is the scrollable container containing the rows and columns) considering scrollbars or not.
256
+
257
+ ```ts
258
+ const dimensions = apiRef.current.getRootDimensions();
259
+ ```
260
+
261
+ ### `@mui/x-data-grid@v5.0.1` / `@mui/x-data-grid-pro@v5.0.1`
262
+
263
+ #### Changes
264
+
265
+ - [DataGrid] New API to validate the editing values (#3006) @m4theushw
266
+ - [DataGrid] Use color-scheme to set dark mode on native components (#3146) @alexfauquette
267
+ - [DataGrid] Fix the `@mui/x-data-grid` type entrypoint (#3196) @flaviendelangle
268
+
269
+ ### Core
270
+
271
+ - [core] Drop `useGridContainerProps` (#3007) @flaviendelangle
272
+ - [core] Move `getRowIdFromRowIndex` and `getRowIndex` to the sorting API (#3126) @flaviendelangle
273
+ - [core] Polish v5 CHANGELOG (#3194) @oliviertassinari
274
+ - [core] Remove the `index.ts` of the export hooks (#3165) @flaviendelangle
275
+ - [core] Set the correct release date for v5.0.0 in the CHANGELOG.md (#3192) @flaviendelangle
276
+
277
+ ### Docs
278
+
279
+ - [docs] Move sentence about disabling multi rows selection (#3167) @alexfauquette
280
+
6
281
  ## 5.0.0
7
282
 
8
- _Nov 15, 2021_
283
+ _Nov 23, 2021_
9
284
 
10
- 🎉 This is the new stable release of the data grid component 🎉!
285
+ 🎉 We are excited to introduce [MUI X v5.0.0](https://mui.com/blog/mui-x-v5/) 🎉!
11
286
 
12
287
  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/).
13
- This version is fully compatible with `@mui/material@5.X` and can be used with `@material-ui/core@4.x` with some additional steps as described [here](https://mui.com/components/data-grid/migration-v4/#using-mui-x-v5-with-mui-core-v4)
288
+ 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).
14
289
 
15
290
  A big thanks to the 7 contributors who made this release possible. Here are some highlights ✨:
16
291
 
@@ -35,15 +310,15 @@ A big thanks to the 7 contributors who made this release possible. Here are some
35
310
 
36
311
  ```diff
37
312
  <DataGrid
38
- components={{
313
+ components={{
39
314
  - checkbox: MyCustomCheckbox,
40
315
  + BaseCheckbox: MyCustomCheckbox,
41
- }}
42
- componentsProps={{
316
+ }}
317
+ componentsProps={{
43
318
  - checkbox: {},
44
319
  + baseCheckbox: {},
45
- }}
46
- />;
320
+ }}
321
+ />
47
322
  ```
48
323
 
49
324
  **Note**: these changes apply to both the `DataGrid` and `DataGridPro` components.
@@ -325,7 +600,7 @@ A big thanks to the 5 contributors who made this release possible. Here are some
325
600
  - [DataGrid] Remove the `state` prop and use the `initialState` prop (#2848) @flaviendelangle
326
601
 
327
602
  Note that `initialState` only allows the `preferencePanel`, `filter.filterModel` and `sort.sortModel` keys.
328
- To fully control the state, use the the feature's model prop and change callback (e.g. `filterModel` and `onFilterModelChange`).
603
+ To fully control the state, use the feature's model prop and change callback (e.g. `filterModel` and `onFilterModelChange`).
329
604
 
330
605
  ```diff
331
606
  <DataGrid