@mui/x-data-grid 5.0.0 → 5.0.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,72 @@
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.1
7
+
8
+ _Nov 17, 2021_
9
+
10
+ A big thanks to the 3 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 🎁 New API to validate the editing values (#3006) @m4theushw
13
+
14
+ You can now use the `preProcessEditCellProps` key in `GridColDef` to synchronously or asynchronously validate the values committed.
15
+
16
+ ```ts
17
+ const columns: GridColDef[] = [
18
+ {
19
+ field: 'firstName',
20
+ preProcessEditCellProps: (params: GridEditCellPropsChangeParams) => {
21
+ const hasError = params.props.value.length < 3;
22
+ return { ...params.props, error: hasError };
23
+ },
24
+ },
25
+ {
26
+ field: 'email',
27
+ preProcessEditCellProps: async (params: GridEditCellPropsChangeParams) => {
28
+ const userWithEmail = await fetchUserByEmail(params.value);
29
+ const hasError = !!userWithEmail;
30
+ return { ...params.props, error: hasError };
31
+ }
32
+ }
33
+ ];
34
+ ```
35
+
36
+ - ✨ New method `getRootDimensions` to access the size of the grid (#3007) @flaviendelangle
37
+
38
+ It contains the size of the viewport (which is the scrollable container containing the rows and columns) considering scrollbars or not.
39
+
40
+ ```ts
41
+ const dimensions = apiRef.current.getRootDimensions();
42
+ ```
43
+
44
+ ### `@mui/x-data-grid@v5.0.1` / `@mui/x-data-grid-pro@v5.0.1`
45
+
46
+ #### Changes
47
+
48
+ - [DataGrid] New API to validate the editing values (#3006) @m4theushw
49
+ - [DataGrid] Use color-scheme to set dark mode on native components (#3146) @alexfauquette
50
+ - [DataGrid] Fix the `@mui/x-data-grid` type entrypoint (#3196) @flaviendelangle
51
+
52
+ ### Core
53
+
54
+ - [core] Drop `useGridContainerProps` (#3007) @flaviendelangle
55
+ - [core] Move `getRowIdFromRowIndex` and `getRowIndex` to the sorting API (#3126) @flaviendelangle
56
+ - [core] Polish v5 CHANGELOG (#3194) @oliviertassinari
57
+ - [core] Remove the `index.ts` of the export hooks (#3165) @flaviendelangle
58
+ - [core] Set the correct release date for v5.0.0 in the CHANGELOG.md (#3192) @flaviendelangle
59
+
60
+ ### Docs
61
+
62
+ - [docs] Move sentence about disabling multi rows selection (#3167) @alexfauquette
63
+
6
64
  ## 5.0.0
7
65
 
8
- _Nov 15, 2021_
66
+ _Nov 16, 2021_
9
67
 
10
- 🎉 This is the new stable release of the data grid component 🎉!
68
+ 🎉 We are execited to introduce [MUI X v5.0.0](https://mui.com/blog/mui-x-v5/) 🎉!
11
69
 
12
70
  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)
71
+ 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
72
 
15
73
  A big thanks to the 7 contributors who made this release possible. Here are some highlights ✨:
16
74
 
@@ -35,15 +93,15 @@ A big thanks to the 7 contributors who made this release possible. Here are some
35
93
 
36
94
  ```diff
37
95
  <DataGrid
38
- components={{
96
+ components={{
39
97
  - checkbox: MyCustomCheckbox,
40
98
  + BaseCheckbox: MyCustomCheckbox,
41
- }}
42
- componentsProps={{
99
+ }}
100
+ componentsProps={{
43
101
  - checkbox: {},
44
102
  + baseCheckbox: {},
45
- }}
46
- />;
103
+ }}
104
+ />
47
105
  ```
48
106
 
49
107
  **Note**: these changes apply to both the `DataGrid` and `DataGridPro` components.