@mui/x-data-grid-generator 8.5.3 → 8.6.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 +107 -0
- package/esm/hooks/serverUtils.d.ts +1 -1
- package/esm/hooks/serverUtils.js +4 -3
- package/esm/hooks/useMockServer.d.ts +1 -1
- package/esm/hooks/useMockServer.js +3 -3
- package/esm/index.js +1 -1
- package/hooks/serverUtils.d.ts +1 -1
- package/hooks/serverUtils.js +4 -3
- package/hooks/useMockServer.d.ts +1 -1
- package/hooks/useMockServer.js +3 -3
- package/index.js +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,113 @@
|
|
|
5
5
|
All notable changes to this project will be documented in this file.
|
|
6
6
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
7
7
|
|
|
8
|
+
## 8.6.0
|
|
9
|
+
|
|
10
|
+
_Jun 27, 2025_
|
|
11
|
+
|
|
12
|
+
We'd like to extend a big thank you to the 12 contributors who made this release possible. Here are some highlights ✨:
|
|
13
|
+
|
|
14
|
+
- 📊 Add export menu to charts toolbar
|
|
15
|
+
- 📅 Add `usePickerAdapter` hook to access the date adapter.
|
|
16
|
+
|
|
17
|
+
You can use the adapter in your custom components if you need them to work with multiple date libraries — [Learn more](https://mui.com/x/react-date-pickers/custom-components/#access-date-adapter).
|
|
18
|
+
- 🌎 Improve Danish (da-DK) locale
|
|
19
|
+
- 🌎 Improve German (de-DE) locale
|
|
20
|
+
|
|
21
|
+
Special thanks go out to the community members for their valuable contributions:
|
|
22
|
+
@ShahrazH, @vadimka123
|
|
23
|
+
|
|
24
|
+
The following are all team members who have contributed to this release:
|
|
25
|
+
@arminmeh, @bernardobelchior, @JCQuintas, @KenanYusuf, @LukasTy, @MBilalShafi, @michelengelen, @noraleonte, @rita-codes, @sai6855
|
|
26
|
+
|
|
27
|
+
### Data Grid
|
|
28
|
+
|
|
29
|
+
#### `@mui/x-data-grid@8.6.0`
|
|
30
|
+
|
|
31
|
+
- [DataGrid] Fix `label` type in `GridActionsCellItem` type (#18175) @sai6855
|
|
32
|
+
- [DataGrid] Fix grid menu not closing when pressing escape/tab (#18300) @KenanYusuf
|
|
33
|
+
- [l10n] Improve Danish (da-DK) locale (#18428) @ShahrazH
|
|
34
|
+
- [l10n] Improve German (de-DE) locale (#18388) @omalyutin
|
|
35
|
+
|
|
36
|
+
#### `@mui/x-data-grid-pro@8.6.0` [](https://mui.com/r/x-pro-svg-link "Pro plan")
|
|
37
|
+
|
|
38
|
+
Same changes as in `@mui/x-data-grid@8.6.0`, plus:
|
|
39
|
+
|
|
40
|
+
- [DataGridPro] Fix lazy loading params calculated from rendering context (#18460) @arminmeh
|
|
41
|
+
|
|
42
|
+
#### `@mui/x-data-grid-premium@8.6.0` [](https://mui.com/r/x-premium-svg-link "Premium plan")
|
|
43
|
+
|
|
44
|
+
Same changes as in `@mui/x-data-grid-pro@8.6.0`.
|
|
45
|
+
|
|
46
|
+
### Date and Time Pickers
|
|
47
|
+
|
|
48
|
+
#### `@mui/x-date-pickers@8.6.0`
|
|
49
|
+
|
|
50
|
+
- [pickers] Add `usePickerAdapter` hook (#18457) @LukasTy
|
|
51
|
+
- [pickers] Fix to use latest `value` when updating `lastCommittedValue` in internal state (#18518) @LukasTy
|
|
52
|
+
- [pickers] Use `usePickerAdapter` hook internally instead of `useUtils` (#18465) @LukasTy
|
|
53
|
+
|
|
54
|
+
#### `@mui/x-date-pickers-pro@8.6.0` [](https://mui.com/r/x-pro-svg-link "Pro plan")
|
|
55
|
+
|
|
56
|
+
Same changes as in `@mui/x-date-pickers@8.6.0`.
|
|
57
|
+
|
|
58
|
+
### Charts
|
|
59
|
+
|
|
60
|
+
#### `@mui/x-charts@8.6.0`
|
|
61
|
+
|
|
62
|
+
- [charts] Add `data-series` to charts legend item (#18414) @bernardobelchior
|
|
63
|
+
- [charts] Add `data-series` to bar charts (#18413) @bernardobelchior
|
|
64
|
+
- [charts] Add `data-series` to elements of line chart (#18409) @bernardobelchior
|
|
65
|
+
- [charts] Add `data-series` to pie charts (#18432) @bernardobelchior
|
|
66
|
+
- [charts] Fix missing key in bar plot (#18502) @bernardobelchior
|
|
67
|
+
- [charts] Split axis utils from main file (#18517) @JCQuintas
|
|
68
|
+
- [charts] Improve touch behavior for polar axis (#18531) @JCQuintas
|
|
69
|
+
- [charts] Add `isElementInside` helper (#18530) @JCQuintas
|
|
70
|
+
|
|
71
|
+
#### `@mui/x-charts-pro@8.6.0` [](https://mui.com/r/x-pro-svg-link "Pro plan")
|
|
72
|
+
|
|
73
|
+
Same changes as in `@mui/x-charts@8.6.0`, plus:
|
|
74
|
+
|
|
75
|
+
- [charts-pro] Add export menu to charts toolbar (#18210) @bernardobelchior
|
|
76
|
+
- [charts-pro] Fix export docs mentioning tooltip instead of toolbar (#18490) @bernardobelchior
|
|
77
|
+
- [charts-pro] Fix iframe not being removed after print export (#18500) @bernardobelchior
|
|
78
|
+
|
|
79
|
+
### Tree View
|
|
80
|
+
|
|
81
|
+
#### `@mui/x-tree-view@8.6.0`
|
|
82
|
+
|
|
83
|
+
Internal changes.
|
|
84
|
+
|
|
85
|
+
#### `@mui/x-tree-view-pro@8.6.0` [](https://mui.com/r/x-pro-svg-link "Pro plan")
|
|
86
|
+
|
|
87
|
+
Same changes as in `@mui/x-tree-view@8.6.0`, plus:
|
|
88
|
+
|
|
89
|
+
- [tree view pro] Fix theme augmentation (#18437) @LukasTy
|
|
90
|
+
|
|
91
|
+
### Codemod
|
|
92
|
+
|
|
93
|
+
#### `@mui/x-codemod@8.6.0`
|
|
94
|
+
|
|
95
|
+
Internal changes.
|
|
96
|
+
|
|
97
|
+
### Docs
|
|
98
|
+
|
|
99
|
+
- [docs] Document `GridRenderContext` (#18492) @arminmeh
|
|
100
|
+
- [docs] Prevent stale rows to appear on sort and filter change in the lazy loading demo (#18461) @arminmeh
|
|
101
|
+
- [docs][pickers] Update action bar demo to use the `nextOrAccept` action (#18505) @LukasTy
|
|
102
|
+
- [docs] Update indeterminate checkbox section in migration guide (#18229) @michelengelen
|
|
103
|
+
- [docs] Data source nested pagination recipe (#14777) @MBilalShafi
|
|
104
|
+
|
|
105
|
+
### Core
|
|
106
|
+
|
|
107
|
+
- [core] Avoid json stringify whole window object (#18512) @vadimka123
|
|
108
|
+
|
|
109
|
+
### Miscellaneous
|
|
110
|
+
|
|
111
|
+
- [code-infra] Dynamically get pickers adapters dependencies versions (#18446) @JCQuintas
|
|
112
|
+
- [infra] Adjust inquirer version and usage (#18495) @michelengelen
|
|
113
|
+
- [infra] Use `String.raw` for creating the remote regex (#18462) @michelengelen
|
|
114
|
+
|
|
8
115
|
## 8.5.3
|
|
9
116
|
|
|
10
117
|
_Jun 19, 2025_
|
|
@@ -53,7 +53,7 @@ interface NestedDataRowsResponse {
|
|
|
53
53
|
/**
|
|
54
54
|
* Simulates server data for tree-data feature
|
|
55
55
|
*/
|
|
56
|
-
export declare const processTreeDataRows: (rows: GridRowModel[], queryOptions: ServerSideQueryOptions, serverOptions: ServerOptions, columnsWithDefaultColDef: GridColDef[]) => Promise<NestedDataRowsResponse>;
|
|
56
|
+
export declare const processTreeDataRows: (rows: GridRowModel[], queryOptions: ServerSideQueryOptions, serverOptions: ServerOptions, columnsWithDefaultColDef: GridColDef[], nestedPagination: boolean) => Promise<NestedDataRowsResponse>;
|
|
57
57
|
/**
|
|
58
58
|
* Simulates server data for row grouping feature
|
|
59
59
|
*/
|
package/esm/hooks/serverUtils.js
CHANGED
|
@@ -336,7 +336,7 @@ const getTreeDataFilteredRows = (rows, filterModel, columnsWithDefaultColDef) =>
|
|
|
336
336
|
/**
|
|
337
337
|
* Simulates server data for tree-data feature
|
|
338
338
|
*/
|
|
339
|
-
export const processTreeDataRows = (rows, queryOptions, serverOptions, columnsWithDefaultColDef) => {
|
|
339
|
+
export const processTreeDataRows = (rows, queryOptions, serverOptions, columnsWithDefaultColDef, nestedPagination) => {
|
|
340
340
|
const {
|
|
341
341
|
minDelay = 100,
|
|
342
342
|
maxDelay = 300
|
|
@@ -355,7 +355,7 @@ export const processTreeDataRows = (rows, queryOptions, serverOptions, columnsWi
|
|
|
355
355
|
const filteredRows = getTreeDataFilteredRows(rows, queryOptions.filterModel, columnsWithDefaultColDef);
|
|
356
356
|
|
|
357
357
|
// get root row count
|
|
358
|
-
const rootRowCount = findTreeDataRowChildren(filteredRows, []).length;
|
|
358
|
+
const rootRowCount = findTreeDataRowChildren(filteredRows, nestedPagination ? queryOptions.groupKeys : []).length;
|
|
359
359
|
|
|
360
360
|
// find direct children referring to the `parentPath`
|
|
361
361
|
const childRows = findTreeDataRowChildren(filteredRows, queryOptions.groupKeys);
|
|
@@ -381,8 +381,9 @@ export const processTreeDataRows = (rows, queryOptions, serverOptions, columnsWi
|
|
|
381
381
|
if (queryOptions.aggregationModel) {
|
|
382
382
|
aggregateRow = applyAggregation(queryOptions.aggregationModel, columnsWithDefaultColDef, filteredRows);
|
|
383
383
|
}
|
|
384
|
-
if (queryOptions.paginationModel && queryOptions.groupKeys.length === 0) {
|
|
384
|
+
if (queryOptions.paginationModel && (queryOptions.groupKeys.length === 0 || nestedPagination)) {
|
|
385
385
|
// Only paginate root rows, grid should refetch root rows when `paginationModel` updates
|
|
386
|
+
// Except when nested pagination is enabled, in which case we paginate the children of the current group node
|
|
386
387
|
const {
|
|
387
388
|
pageSize,
|
|
388
389
|
page
|
|
@@ -27,5 +27,5 @@ interface UseMockServerOptions {
|
|
|
27
27
|
}
|
|
28
28
|
export declare const useMockServer: <T extends GridGetRowsResponse>(dataSetOptions?: Partial<UseMockServerOptions>, serverOptions?: ServerOptions & {
|
|
29
29
|
verbose?: boolean;
|
|
30
|
-
}, shouldRequestsFail?: boolean) => UseMockServerResponse<T>;
|
|
30
|
+
}, shouldRequestsFail?: boolean, nestedPagination?: boolean) => UseMockServerResponse<T>;
|
|
31
31
|
export {};
|
|
@@ -85,7 +85,7 @@ function sendEmptyResponse() {
|
|
|
85
85
|
});
|
|
86
86
|
});
|
|
87
87
|
}
|
|
88
|
-
export const useMockServer = (dataSetOptions, serverOptions, shouldRequestsFail) => {
|
|
88
|
+
export const useMockServer = (dataSetOptions, serverOptions, shouldRequestsFail, nestedPagination) => {
|
|
89
89
|
const dataRef = React.useRef(null);
|
|
90
90
|
const [isDataReady, setDataReady] = React.useState(false);
|
|
91
91
|
const [index, setIndex] = React.useState(0);
|
|
@@ -208,7 +208,7 @@ export const useMockServer = (dataSetOptions, serverOptions, shouldRequestsFail)
|
|
|
208
208
|
rows,
|
|
209
209
|
rootRowCount,
|
|
210
210
|
aggregateRow
|
|
211
|
-
} = await processTreeDataRows(dataRef.current?.rows ?? [], params, serverOptionsWithDefault, columnsWithDefaultColDef);
|
|
211
|
+
} = await processTreeDataRows(dataRef.current?.rows ?? [], params, serverOptionsWithDefault, columnsWithDefaultColDef, nestedPagination ?? false);
|
|
212
212
|
getRowsResponse = _extends({
|
|
213
213
|
rows: rows.slice().map(row => _extends({}, row, {
|
|
214
214
|
path: undefined
|
|
@@ -254,7 +254,7 @@ export const useMockServer = (dataSetOptions, serverOptions, shouldRequestsFail)
|
|
|
254
254
|
}
|
|
255
255
|
resolve(getRowsResponse);
|
|
256
256
|
});
|
|
257
|
-
}, [dataRef, isDataReady, serverOptions?.verbose, serverOptions?.minDelay, serverOptions?.maxDelay, serverOptions?.useCursorPagination, isTreeData, columnsWithDefaultColDef, isRowGrouping]);
|
|
257
|
+
}, [dataRef, isDataReady, serverOptions?.verbose, serverOptions?.minDelay, serverOptions?.maxDelay, serverOptions?.useCursorPagination, isTreeData, columnsWithDefaultColDef, nestedPagination, isRowGrouping]);
|
|
258
258
|
const editRow = React.useCallback(async (rowId, updatedRow) => {
|
|
259
259
|
return new Promise((resolve, reject) => {
|
|
260
260
|
const minDelay = serverOptions?.minDelay ?? DEFAULT_SERVER_OPTIONS.minDelay;
|
package/esm/index.js
CHANGED
package/hooks/serverUtils.d.ts
CHANGED
|
@@ -53,7 +53,7 @@ interface NestedDataRowsResponse {
|
|
|
53
53
|
/**
|
|
54
54
|
* Simulates server data for tree-data feature
|
|
55
55
|
*/
|
|
56
|
-
export declare const processTreeDataRows: (rows: GridRowModel[], queryOptions: ServerSideQueryOptions, serverOptions: ServerOptions, columnsWithDefaultColDef: GridColDef[]) => Promise<NestedDataRowsResponse>;
|
|
56
|
+
export declare const processTreeDataRows: (rows: GridRowModel[], queryOptions: ServerSideQueryOptions, serverOptions: ServerOptions, columnsWithDefaultColDef: GridColDef[], nestedPagination: boolean) => Promise<NestedDataRowsResponse>;
|
|
57
57
|
/**
|
|
58
58
|
* Simulates server data for row grouping feature
|
|
59
59
|
*/
|
package/hooks/serverUtils.js
CHANGED
|
@@ -344,7 +344,7 @@ const getTreeDataFilteredRows = (rows, filterModel, columnsWithDefaultColDef) =>
|
|
|
344
344
|
/**
|
|
345
345
|
* Simulates server data for tree-data feature
|
|
346
346
|
*/
|
|
347
|
-
const processTreeDataRows = (rows, queryOptions, serverOptions, columnsWithDefaultColDef) => {
|
|
347
|
+
const processTreeDataRows = (rows, queryOptions, serverOptions, columnsWithDefaultColDef, nestedPagination) => {
|
|
348
348
|
const {
|
|
349
349
|
minDelay = 100,
|
|
350
350
|
maxDelay = 300
|
|
@@ -363,7 +363,7 @@ const processTreeDataRows = (rows, queryOptions, serverOptions, columnsWithDefau
|
|
|
363
363
|
const filteredRows = getTreeDataFilteredRows(rows, queryOptions.filterModel, columnsWithDefaultColDef);
|
|
364
364
|
|
|
365
365
|
// get root row count
|
|
366
|
-
const rootRowCount = findTreeDataRowChildren(filteredRows, []).length;
|
|
366
|
+
const rootRowCount = findTreeDataRowChildren(filteredRows, nestedPagination ? queryOptions.groupKeys : []).length;
|
|
367
367
|
|
|
368
368
|
// find direct children referring to the `parentPath`
|
|
369
369
|
const childRows = findTreeDataRowChildren(filteredRows, queryOptions.groupKeys);
|
|
@@ -389,8 +389,9 @@ const processTreeDataRows = (rows, queryOptions, serverOptions, columnsWithDefau
|
|
|
389
389
|
if (queryOptions.aggregationModel) {
|
|
390
390
|
aggregateRow = applyAggregation(queryOptions.aggregationModel, columnsWithDefaultColDef, filteredRows);
|
|
391
391
|
}
|
|
392
|
-
if (queryOptions.paginationModel && queryOptions.groupKeys.length === 0) {
|
|
392
|
+
if (queryOptions.paginationModel && (queryOptions.groupKeys.length === 0 || nestedPagination)) {
|
|
393
393
|
// Only paginate root rows, grid should refetch root rows when `paginationModel` updates
|
|
394
|
+
// Except when nested pagination is enabled, in which case we paginate the children of the current group node
|
|
394
395
|
const {
|
|
395
396
|
pageSize,
|
|
396
397
|
page
|
package/hooks/useMockServer.d.ts
CHANGED
|
@@ -27,5 +27,5 @@ interface UseMockServerOptions {
|
|
|
27
27
|
}
|
|
28
28
|
export declare const useMockServer: <T extends GridGetRowsResponse>(dataSetOptions?: Partial<UseMockServerOptions>, serverOptions?: ServerOptions & {
|
|
29
29
|
verbose?: boolean;
|
|
30
|
-
}, shouldRequestsFail?: boolean) => UseMockServerResponse<T>;
|
|
30
|
+
}, shouldRequestsFail?: boolean, nestedPagination?: boolean) => UseMockServerResponse<T>;
|
|
31
31
|
export {};
|
package/hooks/useMockServer.js
CHANGED
|
@@ -92,7 +92,7 @@ function sendEmptyResponse() {
|
|
|
92
92
|
});
|
|
93
93
|
});
|
|
94
94
|
}
|
|
95
|
-
const useMockServer = (dataSetOptions, serverOptions, shouldRequestsFail) => {
|
|
95
|
+
const useMockServer = (dataSetOptions, serverOptions, shouldRequestsFail, nestedPagination) => {
|
|
96
96
|
const dataRef = React.useRef(null);
|
|
97
97
|
const [isDataReady, setDataReady] = React.useState(false);
|
|
98
98
|
const [index, setIndex] = React.useState(0);
|
|
@@ -215,7 +215,7 @@ const useMockServer = (dataSetOptions, serverOptions, shouldRequestsFail) => {
|
|
|
215
215
|
rows,
|
|
216
216
|
rootRowCount,
|
|
217
217
|
aggregateRow
|
|
218
|
-
} = await (0, _serverUtils.processTreeDataRows)(dataRef.current?.rows ?? [], params, serverOptionsWithDefault, columnsWithDefaultColDef);
|
|
218
|
+
} = await (0, _serverUtils.processTreeDataRows)(dataRef.current?.rows ?? [], params, serverOptionsWithDefault, columnsWithDefaultColDef, nestedPagination ?? false);
|
|
219
219
|
getRowsResponse = (0, _extends2.default)({
|
|
220
220
|
rows: rows.slice().map(row => (0, _extends2.default)({}, row, {
|
|
221
221
|
path: undefined
|
|
@@ -261,7 +261,7 @@ const useMockServer = (dataSetOptions, serverOptions, shouldRequestsFail) => {
|
|
|
261
261
|
}
|
|
262
262
|
resolve(getRowsResponse);
|
|
263
263
|
});
|
|
264
|
-
}, [dataRef, isDataReady, serverOptions?.verbose, serverOptions?.minDelay, serverOptions?.maxDelay, serverOptions?.useCursorPagination, isTreeData, columnsWithDefaultColDef, isRowGrouping]);
|
|
264
|
+
}, [dataRef, isDataReady, serverOptions?.verbose, serverOptions?.minDelay, serverOptions?.maxDelay, serverOptions?.useCursorPagination, isTreeData, columnsWithDefaultColDef, nestedPagination, isRowGrouping]);
|
|
265
265
|
const editRow = React.useCallback(async (rowId, updatedRow) => {
|
|
266
266
|
return new Promise((resolve, reject) => {
|
|
267
267
|
const minDelay = serverOptions?.minDelay ?? _serverUtils.DEFAULT_SERVER_OPTIONS.minDelay;
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-data-grid-generator",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.6.0",
|
|
4
4
|
"author": "MUI Team",
|
|
5
5
|
"description": "Generate fake data for demo purposes only.",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
"chance": "^1.1.13",
|
|
28
28
|
"clsx": "^2.1.1",
|
|
29
29
|
"lru-cache": "^11.1.0",
|
|
30
|
-
"@mui/x-data-grid": "8.
|
|
31
|
-
"@mui/x-data-grid-premium": "8.
|
|
32
|
-
"@mui/x-data-grid-pro": "8.
|
|
33
|
-
"@mui/x-internals": "8.
|
|
30
|
+
"@mui/x-data-grid": "8.6.0",
|
|
31
|
+
"@mui/x-data-grid-premium": "8.6.0",
|
|
32
|
+
"@mui/x-data-grid-pro": "8.6.0",
|
|
33
|
+
"@mui/x-internals": "8.6.0"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"@emotion/react": "^11.9.0",
|