@mui/x-data-grid-generator 9.3.0 → 9.4.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 +196 -0
- package/LICENSE +21 -0
- package/hooks/serverUtils.d.mts +1 -1
- package/hooks/serverUtils.d.ts +1 -1
- package/hooks/serverUtils.js +43 -22
- package/hooks/serverUtils.mjs +43 -22
- package/hooks/useMockServer.js +5 -4
- package/hooks/useMockServer.mjs +5 -4
- package/index.js +3 -3
- package/index.mjs +3 -3
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,201 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 9.4.0
|
|
4
|
+
|
|
5
|
+
<!-- generated comparing v9.3.0..master -->
|
|
6
|
+
|
|
7
|
+
_Jun 4, 2026_
|
|
8
|
+
|
|
9
|
+
We'd like to extend a big thank you to the 21 contributors who made this release possible. Here are some highlights ✨:
|
|
10
|
+
|
|
11
|
+
- 🎉 Scheduler is now in Beta shipping with Timeline vitualization and lazy loading
|
|
12
|
+
- 📆 Implement Event Timeline virtualization (#22339)
|
|
13
|
+
- 🫧 Introduce bubble charts (#22537)
|
|
14
|
+
- 🐞 Bugfixes
|
|
15
|
+
- 📚 Documentation improvements
|
|
16
|
+
|
|
17
|
+
Special thanks go out to these community members for their valuable contributions:
|
|
18
|
+
@imxv, @mixelburg, @mustafajw07
|
|
19
|
+
|
|
20
|
+
The following team members contributed to this release:
|
|
21
|
+
@aemartos, @alexfauquette, @arminmeh, @bernardobelchior, @cherniavskii, @flaviendelangle, @hasdfa, @Janpot, @JCQuintas, @joserodolfofreitas, @LukasTy, @MBilalShafi, @michelengelen, @mj12albert, @noraleonte, @oliviertassinari, @rita-codes, @romgrk, @sai6855
|
|
22
|
+
|
|
23
|
+
### Data Grid
|
|
24
|
+
|
|
25
|
+
#### `@mui/x-data-grid@9.4.0`
|
|
26
|
+
|
|
27
|
+
- [DataGrid] Fix `avg` aggregation when the average is zero (#22652) @mj12albert
|
|
28
|
+
- [DataGrid] Inherit icon `fontSize` from `baseIconButton` size (#22187) @imxv
|
|
29
|
+
- [DataGrid] Fix `noRowsOverlay` flicker between `dataSource` re-fetches (#22465) @LukasTy
|
|
30
|
+
|
|
31
|
+
#### `@mui/x-data-grid-pro@9.4.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
32
|
+
|
|
33
|
+
Same changes as in `@mui/x-data-grid@9.4.0`.
|
|
34
|
+
|
|
35
|
+
#### `@mui/x-data-grid-premium@9.4.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
36
|
+
|
|
37
|
+
> This release includes a version bump of the `@mui/x-internal-exceljs-fork` package to address the vulnerable dependencies.
|
|
38
|
+
> The following CVEs are fixed:
|
|
39
|
+
>
|
|
40
|
+
> - <https://github.com/advisories/GHSA-ph9p-34f9-6g65>
|
|
41
|
+
> - <https://github.com/isaacs/minimatch/security/advisories/GHSA-23c5-xmqv-rm74>
|
|
42
|
+
> - <https://github.com/advisories/GHSA-w5hq-g745-h8pq>
|
|
43
|
+
>
|
|
44
|
+
> To make this security update possible, we bumped the `node` version requirement from `>=14.0.0` to `>=14.17.0`.
|
|
45
|
+
> [Node.js 14.17.0](https://nodejs.org/en/blog/release/v14.17.0) was released in May 2021, so we consider it safe to bump the requirement without causing issues for our users.
|
|
46
|
+
|
|
47
|
+
Same changes as in `@mui/x-data-grid-pro@9.4.0`, plus:
|
|
48
|
+
|
|
49
|
+
- [DataGridPremium] Nested Lazy Loading (#21043) @MBilalShafi
|
|
50
|
+
- [DataGridPremium] Update exceljs fork (#22658) @cherniavskii
|
|
51
|
+
|
|
52
|
+
### Date and Time Pickers
|
|
53
|
+
|
|
54
|
+
#### `@mui/x-date-pickers@9.4.0`
|
|
55
|
+
|
|
56
|
+
Internal changes.
|
|
57
|
+
|
|
58
|
+
#### `@mui/x-date-pickers-pro@9.4.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
59
|
+
|
|
60
|
+
Same changes as in `@mui/x-date-pickers@9.4.0`.
|
|
61
|
+
|
|
62
|
+
### Charts
|
|
63
|
+
|
|
64
|
+
#### `@mui/x-charts@9.4.0`
|
|
65
|
+
|
|
66
|
+
- [charts] Add functionality to hide elements during chart export (#22525) @sai6855
|
|
67
|
+
- [charts] Add option to show marks only on the first/last values (#22645) @alexfauquette
|
|
68
|
+
- [charts] Add text customization section and demo for axis labels (#22597) @sai6855
|
|
69
|
+
- [charts] Allow axes to scale according to the visible series only (#22566) @alexfauquette
|
|
70
|
+
- [charts] Correctly handle different identifiers for each series (#22556) @sai6855
|
|
71
|
+
- [charts] Fix inverted Y axis zoom/pan on ordinal scales (#22654) @JCQuintas
|
|
72
|
+
- [charts] Introduce bubble charts (#22537) @alexfauquette
|
|
73
|
+
- [charts] Let scatter chart tooltip ignore hidden series (#22614) @alexfauquette
|
|
74
|
+
- [charts] Make `'sqrt'` size mapping the default (#22683) @alexfauquette
|
|
75
|
+
- [charts] Remove unused proptypes (#22618) @alexfauquette
|
|
76
|
+
- [charts] Support module augmentation for slots (#22519) @sai6855
|
|
77
|
+
- [charts] Support multiple marker size in `findClosestPoint` (#22622) @alexfauquette
|
|
78
|
+
- [charts] Upgrade bezier-easing to v3 and use it for line chart hit-detection (#22608) @sai6855
|
|
79
|
+
- [charts] Use `useLayoutEffect` with `ResizeObserver` (#22646) @JCQuintas
|
|
80
|
+
|
|
81
|
+
#### `@mui/x-charts-pro@9.4.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
82
|
+
|
|
83
|
+
Same changes as in `@mui/x-charts@9.4.0`, plus:
|
|
84
|
+
|
|
85
|
+
- [charts-pro] Auto-select range button matching current zoom (#22137) @JCQuintas
|
|
86
|
+
- [charts-pro] Support range values in `initialZoom` (#22563) @JCQuintas
|
|
87
|
+
|
|
88
|
+
#### `@mui/x-charts-premium@9.4.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
89
|
+
|
|
90
|
+
Same changes as in `@mui/x-charts-pro@9.4.0`, plus:
|
|
91
|
+
|
|
92
|
+
- [charts-premium] Support range-bar series in WebGL bar renderer (#22607) @JCQuintas
|
|
93
|
+
- [charts-premium] Fix `onAxisClick` for radial bar and lines (#22522) @alexfauquette
|
|
94
|
+
|
|
95
|
+
### Tree View
|
|
96
|
+
|
|
97
|
+
#### `@mui/x-tree-view@9.4.0`
|
|
98
|
+
|
|
99
|
+
Internal changes.
|
|
100
|
+
|
|
101
|
+
#### `@mui/x-tree-view-pro@9.4.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
102
|
+
|
|
103
|
+
Same changes as in `@mui/x-tree-view@9.4.0`.
|
|
104
|
+
|
|
105
|
+
### Scheduler
|
|
106
|
+
|
|
107
|
+
#### Breaking changes
|
|
108
|
+
|
|
109
|
+
The theme `styleOverrides` slots for the skeleton and the error container were
|
|
110
|
+
renamed and unified. The CSS utility class names (for example
|
|
111
|
+
`.MuiEventCalendar-eventSkeleton`) are **not** affected — only
|
|
112
|
+
`theme.components.*` overrides need updating.
|
|
113
|
+
|
|
114
|
+
**Event skeleton**
|
|
115
|
+
|
|
116
|
+
| Before | After |
|
|
117
|
+
| --------------------------------------- | ------------------------------ |
|
|
118
|
+
| `MuiEventCalendar` slot `EventSkeleton` | `MuiEventSkeleton` slot `Root` |
|
|
119
|
+
| `MuiEventTimeline` slot `EventSkeleton` | `MuiEventSkeleton` slot `Root` |
|
|
120
|
+
|
|
121
|
+
**Error container**
|
|
122
|
+
|
|
123
|
+
| Before | After |
|
|
124
|
+
| ------------------------------------------------------------- | --------------------------------------- |
|
|
125
|
+
| `MuiEventCalendar` / `MuiEventTimeline` slot `ErrorContainer` | `MuiEventErrorContainer` slot `Root` |
|
|
126
|
+
| `MuiEventCalendar` / `MuiEventTimeline` slot `ErrorAlert` | `MuiEventErrorContainer` slot `Alert` |
|
|
127
|
+
| `MuiEventCalendar` / `MuiEventTimeline` slot `ErrorMessage` | `MuiEventErrorContainer` slot `Message` |
|
|
128
|
+
|
|
129
|
+
If you customized these through the theme, update the component name and slot
|
|
130
|
+
names accordingly:
|
|
131
|
+
|
|
132
|
+
```diff
|
|
133
|
+
components: {
|
|
134
|
+
- MuiEventCalendar: {
|
|
135
|
+
+ MuiEventSkeleton: {
|
|
136
|
+
styleOverrides: {
|
|
137
|
+
- EventSkeleton: { /* ... */ },
|
|
138
|
+
+ Root: { /* ... */ },
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
#### `@mui/x-scheduler@9.0.0-beta.0`
|
|
146
|
+
|
|
147
|
+
- [scheduler] Add a prop to control whether the resource of an event can be cleared (#22464) @rita-codes
|
|
148
|
+
- [scheduler] Add week number labels to agenda, day and week views (#22594) @mustafajw07
|
|
149
|
+
- [scheduler] Add `weekStartsOn` preference and update date functions to support custom week start (#22426) @mustafajw07
|
|
150
|
+
- [scheduler] Export premium version of the standalone views (#22621) @flaviendelangle
|
|
151
|
+
- [scheduler] Implement timeline virtualization (#22339) @romgrk
|
|
152
|
+
- [scheduler] Split scheduler overview (#22453) @joserodolfofreitas
|
|
153
|
+
- [scheduler] Unify `EventSkeleton` and `ErrorContainer` between `EventCalendar` and `EventTimeline` (#22676) @noraleonte
|
|
154
|
+
|
|
155
|
+
#### `@mui/x-scheduler-premium@9.0.0-beta.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
156
|
+
|
|
157
|
+
Same changes as in `@mui/x-scheduler@9.0.0-beta.0`.
|
|
158
|
+
|
|
159
|
+
### Docs
|
|
160
|
+
|
|
161
|
+
- [docs] Add a performance docs page for charts (#22656) @alexfauquette
|
|
162
|
+
- [docs] Add real dataset for maps documentation (#22599) @alexfauquette
|
|
163
|
+
- [docs] Add spacing between selects on charts overview demo (#22589) @bernardobelchior
|
|
164
|
+
- [docs] Reorganize existing chat docs navigation (#22478) @hasdfa
|
|
165
|
+
- [docs] Switch to visionscarto's world atlas dataset (#22669) @cherniavskii
|
|
166
|
+
- [docs] Update TreeView `domstructure` docs and add demo (#22420) @mj12albert
|
|
167
|
+
- [docs] Fix indexation of Scheduler (#22567) @oliviertassinari
|
|
168
|
+
- [docs] Fix wide layout on event timeline lazy loading and Import title (#22604) @rita-codes
|
|
169
|
+
- [docs] Derive class name owners for shared charts classes (#22674) @JCQuintas
|
|
170
|
+
|
|
171
|
+
### Core
|
|
172
|
+
|
|
173
|
+
- [code-infra] Drop unused and now-transitive deps from docs/package.json (#22549) @LukasTy
|
|
174
|
+
- [code-infra] Refresh CI Node pins to 22.22.3 (#22598) @LukasTy
|
|
175
|
+
- [code-infra] Skip empty product sections in changelog (#22541) @rita-codes
|
|
176
|
+
- [code-infra] Stabilize DataGridScrollRestoration visual regression test (#22553) @Janpot
|
|
177
|
+
- [internal] Add license to the `x-data-grid-generator` (#22240) @arminmeh
|
|
178
|
+
- [internal] Express default value for resource_class (#22569) @oliviertassinari
|
|
179
|
+
- [internal] Fix use of ellipsis (#21852) @oliviertassinari
|
|
180
|
+
- [internal] `useLayoutEffect` with `ResizeObserver` (#22428) @romgrk
|
|
181
|
+
|
|
182
|
+
### Miscellaneous
|
|
183
|
+
|
|
184
|
+
- [chat-headless] Add built-in chat adapters (#22479) @hasdfa
|
|
185
|
+
- [chat-headless] Harden runtime model and message errors (#22480) @hasdfa
|
|
186
|
+
- [core] Prepare for TypeScript 6 bump (#22551) @LukasTy
|
|
187
|
+
- [core] Use CircleCI Gen2 resource classes (#22610) @LukasTy
|
|
188
|
+
- [infra] Fix broken tag retrieval on `master` during release (#22174) @michelengelen
|
|
189
|
+
- [infra] Group Base UI renovate updates (#22590) @LukasTy
|
|
190
|
+
- [pnpm] Add security settings to pnpm-workspace.yaml (#22611) @Janpot
|
|
191
|
+
- [release] Fix release PR scripts (#22680) @JCQuintas
|
|
192
|
+
- [test] Add a Tree View regression test for lazy loading with getChildrenCount returning -1 (#22605) @mixelburg
|
|
193
|
+
- [test] Disable LCD subpixel antialiasing in regression screenshots (#22602) @Janpot
|
|
194
|
+
- [test] Fix flaky Data Grid Pro data source tree data tests (#22659) @LukasTy
|
|
195
|
+
- [test] Remove stale form-submit TODO from e2e suite (#22564) @LukasTy
|
|
196
|
+
- [x-license] Exclude test keys from the published npm package (#22647) @aemartos
|
|
197
|
+
- [test] Fix flaky WebGL benchmark by polling for canvas content (#22535) @JCQuintas
|
|
198
|
+
|
|
3
199
|
## 9.3.0
|
|
4
200
|
|
|
5
201
|
_May 21, 2026_
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 Material-UI SAS
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/hooks/serverUtils.d.mts
CHANGED
|
@@ -69,7 +69,7 @@ export declare const processTreeDataRows: (rows: GridRowModel[], queryOptions: S
|
|
|
69
69
|
/**
|
|
70
70
|
* Simulates server data for row grouping feature
|
|
71
71
|
*/
|
|
72
|
-
export declare const processRowGroupingRows: (rows: GridValidRowModel[], queryOptions: ServerSideQueryOptions, serverOptions: ServerOptions, columnsWithDefaultColDef: GridColDef[]) => Promise<NestedDataRowsResponse>;
|
|
72
|
+
export declare const processRowGroupingRows: (rows: GridValidRowModel[], queryOptions: ServerSideQueryOptions, serverOptions: ServerOptions, columnsWithDefaultColDef: GridColDef[], nestedPagination: boolean) => Promise<NestedDataRowsResponse>;
|
|
73
73
|
/**
|
|
74
74
|
* Simulates server data for pivoting feature
|
|
75
75
|
*/
|
package/hooks/serverUtils.d.ts
CHANGED
|
@@ -69,7 +69,7 @@ export declare const processTreeDataRows: (rows: GridRowModel[], queryOptions: S
|
|
|
69
69
|
/**
|
|
70
70
|
* Simulates server data for row grouping feature
|
|
71
71
|
*/
|
|
72
|
-
export declare const processRowGroupingRows: (rows: GridValidRowModel[], queryOptions: ServerSideQueryOptions, serverOptions: ServerOptions, columnsWithDefaultColDef: GridColDef[]) => Promise<NestedDataRowsResponse>;
|
|
72
|
+
export declare const processRowGroupingRows: (rows: GridValidRowModel[], queryOptions: ServerSideQueryOptions, serverOptions: ServerOptions, columnsWithDefaultColDef: GridColDef[], nestedPagination: boolean) => Promise<NestedDataRowsResponse>;
|
|
73
73
|
/**
|
|
74
74
|
* Simulates server data for pivoting feature
|
|
75
75
|
*/
|
package/hooks/serverUtils.js
CHANGED
|
@@ -417,14 +417,18 @@ const processTreeDataRows = (rows, queryOptions, serverOptions, columnsWithDefau
|
|
|
417
417
|
let childRowsWithDescendantCounts = childRows.map(row => {
|
|
418
418
|
const descendants = findTreeDataRowChildren(filteredRows, row[pathKey], pathKey, -1);
|
|
419
419
|
const descendantCount = descendants.length;
|
|
420
|
+
const children = findTreeDataRowChildren(filteredRows, row[pathKey], pathKey, 1);
|
|
421
|
+
const childrenCount = children.length;
|
|
420
422
|
if (descendantCount > 0 && queryOptions.aggregationModel) {
|
|
421
423
|
// Parent row, compute aggregation
|
|
422
424
|
return (0, _extends2.default)({}, row, {
|
|
423
|
-
descendantCount
|
|
425
|
+
descendantCount,
|
|
426
|
+
childrenCount
|
|
424
427
|
}, applyAggregation(queryOptions.aggregationModel, columnsWithDefaultColDef, descendants, row.id));
|
|
425
428
|
}
|
|
426
429
|
return (0, _extends2.default)({}, row, {
|
|
427
|
-
descendantCount
|
|
430
|
+
descendantCount,
|
|
431
|
+
childrenCount
|
|
428
432
|
});
|
|
429
433
|
});
|
|
430
434
|
if (queryOptions.sortModel) {
|
|
@@ -436,15 +440,21 @@ const processTreeDataRows = (rows, queryOptions, serverOptions, columnsWithDefau
|
|
|
436
440
|
if (queryOptions.aggregationModel) {
|
|
437
441
|
aggregateRow = applyAggregation(queryOptions.aggregationModel, columnsWithDefaultColDef, filteredRows);
|
|
438
442
|
}
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
|
|
443
|
+
|
|
444
|
+
// Apply pagination using start/end if provided, otherwise fall back to paginationModel
|
|
445
|
+
if (queryOptions.groupKeys.length === 0 || nestedPagination) {
|
|
446
|
+
if (queryOptions.start !== undefined && queryOptions.end !== undefined) {
|
|
447
|
+
// Use start/end for range-based pagination (needed for nested lazy loading)
|
|
448
|
+
childRowsWithDescendantCounts = childRowsWithDescendantCounts.slice(queryOptions.start, queryOptions.end + 1);
|
|
449
|
+
} else if (queryOptions.paginationModel) {
|
|
450
|
+
// Fall back to paginationModel for backward compatibility
|
|
451
|
+
const {
|
|
452
|
+
pageSize,
|
|
453
|
+
page
|
|
454
|
+
} = queryOptions.paginationModel;
|
|
455
|
+
if (pageSize < childRowsWithDescendantCounts.length) {
|
|
456
|
+
childRowsWithDescendantCounts = childRowsWithDescendantCounts.slice(page * pageSize, page * pageSize + pageSize);
|
|
457
|
+
}
|
|
448
458
|
}
|
|
449
459
|
}
|
|
450
460
|
return new Promise(resolve => {
|
|
@@ -462,7 +472,7 @@ const processTreeDataRows = (rows, queryOptions, serverOptions, columnsWithDefau
|
|
|
462
472
|
* Simulates server data for row grouping feature
|
|
463
473
|
*/
|
|
464
474
|
exports.processTreeDataRows = processTreeDataRows;
|
|
465
|
-
const processRowGroupingRows = (rows, queryOptions, serverOptions, columnsWithDefaultColDef) => {
|
|
475
|
+
const processRowGroupingRows = (rows, queryOptions, serverOptions, columnsWithDefaultColDef, nestedPagination) => {
|
|
466
476
|
const {
|
|
467
477
|
minDelay = 100,
|
|
468
478
|
maxDelay = 300
|
|
@@ -546,14 +556,18 @@ const processRowGroupingRows = (rows, queryOptions, serverOptions, columnsWithDe
|
|
|
546
556
|
id
|
|
547
557
|
}) => typeof id !== 'string' || !id.startsWith('auto-generated-parent-'));
|
|
548
558
|
const descendantCount = descendants.length;
|
|
559
|
+
const children = findTreeDataRowChildren(filteredRows, row[pathKey], pathKey, 1);
|
|
560
|
+
const childrenCount = children.length;
|
|
549
561
|
if (descendantCount > 0 && queryOptions.aggregationModel) {
|
|
550
562
|
// Parent row, compute aggregation
|
|
551
563
|
return (0, _extends2.default)({}, row, {
|
|
552
|
-
descendantCount
|
|
564
|
+
descendantCount,
|
|
565
|
+
childrenCount
|
|
553
566
|
}, applyAggregation(queryOptions.aggregationModel, columnsWithDefaultColDef, descendants, row.id));
|
|
554
567
|
}
|
|
555
568
|
return (0, _extends2.default)({}, row, {
|
|
556
|
-
descendantCount
|
|
569
|
+
descendantCount,
|
|
570
|
+
childrenCount
|
|
557
571
|
});
|
|
558
572
|
});
|
|
559
573
|
if (queryOptions.sortModel) {
|
|
@@ -566,14 +580,21 @@ const processRowGroupingRows = (rows, queryOptions, serverOptions, columnsWithDe
|
|
|
566
580
|
if (queryOptions.aggregationModel) {
|
|
567
581
|
aggregateRow = applyAggregation(queryOptions.aggregationModel, columnsWithDefaultColDef, filteredRows);
|
|
568
582
|
}
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
if (
|
|
576
|
-
|
|
583
|
+
|
|
584
|
+
// Apply pagination using start/end if provided, otherwise fall back to paginationModel
|
|
585
|
+
if (queryOptions.groupKeys.length === 0 || nestedPagination) {
|
|
586
|
+
if (queryOptions.start !== undefined && queryOptions.end !== undefined) {
|
|
587
|
+
// Use start/end for range-based pagination (needed for nested lazy loading)
|
|
588
|
+
childRowsWithDescendantCounts = childRowsWithDescendantCounts.slice(queryOptions.start, queryOptions.end + 1);
|
|
589
|
+
} else if (queryOptions.paginationModel) {
|
|
590
|
+
// Fall back to paginationModel for backward compatibility
|
|
591
|
+
const {
|
|
592
|
+
pageSize,
|
|
593
|
+
page
|
|
594
|
+
} = queryOptions.paginationModel;
|
|
595
|
+
if (pageSize < childRowsWithDescendantCounts.length) {
|
|
596
|
+
childRowsWithDescendantCounts = childRowsWithDescendantCounts.slice(page * pageSize, (page + 1) * pageSize);
|
|
597
|
+
}
|
|
577
598
|
}
|
|
578
599
|
}
|
|
579
600
|
return new Promise(resolve => {
|
package/hooks/serverUtils.mjs
CHANGED
|
@@ -409,14 +409,18 @@ export const processTreeDataRows = (rows, queryOptions, serverOptions, columnsWi
|
|
|
409
409
|
let childRowsWithDescendantCounts = childRows.map(row => {
|
|
410
410
|
const descendants = findTreeDataRowChildren(filteredRows, row[pathKey], pathKey, -1);
|
|
411
411
|
const descendantCount = descendants.length;
|
|
412
|
+
const children = findTreeDataRowChildren(filteredRows, row[pathKey], pathKey, 1);
|
|
413
|
+
const childrenCount = children.length;
|
|
412
414
|
if (descendantCount > 0 && queryOptions.aggregationModel) {
|
|
413
415
|
// Parent row, compute aggregation
|
|
414
416
|
return _extends({}, row, {
|
|
415
|
-
descendantCount
|
|
417
|
+
descendantCount,
|
|
418
|
+
childrenCount
|
|
416
419
|
}, applyAggregation(queryOptions.aggregationModel, columnsWithDefaultColDef, descendants, row.id));
|
|
417
420
|
}
|
|
418
421
|
return _extends({}, row, {
|
|
419
|
-
descendantCount
|
|
422
|
+
descendantCount,
|
|
423
|
+
childrenCount
|
|
420
424
|
});
|
|
421
425
|
});
|
|
422
426
|
if (queryOptions.sortModel) {
|
|
@@ -428,15 +432,21 @@ export const processTreeDataRows = (rows, queryOptions, serverOptions, columnsWi
|
|
|
428
432
|
if (queryOptions.aggregationModel) {
|
|
429
433
|
aggregateRow = applyAggregation(queryOptions.aggregationModel, columnsWithDefaultColDef, filteredRows);
|
|
430
434
|
}
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
|
|
435
|
+
|
|
436
|
+
// Apply pagination using start/end if provided, otherwise fall back to paginationModel
|
|
437
|
+
if (queryOptions.groupKeys.length === 0 || nestedPagination) {
|
|
438
|
+
if (queryOptions.start !== undefined && queryOptions.end !== undefined) {
|
|
439
|
+
// Use start/end for range-based pagination (needed for nested lazy loading)
|
|
440
|
+
childRowsWithDescendantCounts = childRowsWithDescendantCounts.slice(queryOptions.start, queryOptions.end + 1);
|
|
441
|
+
} else if (queryOptions.paginationModel) {
|
|
442
|
+
// Fall back to paginationModel for backward compatibility
|
|
443
|
+
const {
|
|
444
|
+
pageSize,
|
|
445
|
+
page
|
|
446
|
+
} = queryOptions.paginationModel;
|
|
447
|
+
if (pageSize < childRowsWithDescendantCounts.length) {
|
|
448
|
+
childRowsWithDescendantCounts = childRowsWithDescendantCounts.slice(page * pageSize, page * pageSize + pageSize);
|
|
449
|
+
}
|
|
440
450
|
}
|
|
441
451
|
}
|
|
442
452
|
return new Promise(resolve => {
|
|
@@ -453,7 +463,7 @@ export const processTreeDataRows = (rows, queryOptions, serverOptions, columnsWi
|
|
|
453
463
|
/**
|
|
454
464
|
* Simulates server data for row grouping feature
|
|
455
465
|
*/
|
|
456
|
-
export const processRowGroupingRows = (rows, queryOptions, serverOptions, columnsWithDefaultColDef) => {
|
|
466
|
+
export const processRowGroupingRows = (rows, queryOptions, serverOptions, columnsWithDefaultColDef, nestedPagination) => {
|
|
457
467
|
const {
|
|
458
468
|
minDelay = 100,
|
|
459
469
|
maxDelay = 300
|
|
@@ -537,14 +547,18 @@ export const processRowGroupingRows = (rows, queryOptions, serverOptions, column
|
|
|
537
547
|
id
|
|
538
548
|
}) => typeof id !== 'string' || !id.startsWith('auto-generated-parent-'));
|
|
539
549
|
const descendantCount = descendants.length;
|
|
550
|
+
const children = findTreeDataRowChildren(filteredRows, row[pathKey], pathKey, 1);
|
|
551
|
+
const childrenCount = children.length;
|
|
540
552
|
if (descendantCount > 0 && queryOptions.aggregationModel) {
|
|
541
553
|
// Parent row, compute aggregation
|
|
542
554
|
return _extends({}, row, {
|
|
543
|
-
descendantCount
|
|
555
|
+
descendantCount,
|
|
556
|
+
childrenCount
|
|
544
557
|
}, applyAggregation(queryOptions.aggregationModel, columnsWithDefaultColDef, descendants, row.id));
|
|
545
558
|
}
|
|
546
559
|
return _extends({}, row, {
|
|
547
|
-
descendantCount
|
|
560
|
+
descendantCount,
|
|
561
|
+
childrenCount
|
|
548
562
|
});
|
|
549
563
|
});
|
|
550
564
|
if (queryOptions.sortModel) {
|
|
@@ -557,14 +571,21 @@ export const processRowGroupingRows = (rows, queryOptions, serverOptions, column
|
|
|
557
571
|
if (queryOptions.aggregationModel) {
|
|
558
572
|
aggregateRow = applyAggregation(queryOptions.aggregationModel, columnsWithDefaultColDef, filteredRows);
|
|
559
573
|
}
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
if (
|
|
567
|
-
|
|
574
|
+
|
|
575
|
+
// Apply pagination using start/end if provided, otherwise fall back to paginationModel
|
|
576
|
+
if (queryOptions.groupKeys.length === 0 || nestedPagination) {
|
|
577
|
+
if (queryOptions.start !== undefined && queryOptions.end !== undefined) {
|
|
578
|
+
// Use start/end for range-based pagination (needed for nested lazy loading)
|
|
579
|
+
childRowsWithDescendantCounts = childRowsWithDescendantCounts.slice(queryOptions.start, queryOptions.end + 1);
|
|
580
|
+
} else if (queryOptions.paginationModel) {
|
|
581
|
+
// Fall back to paginationModel for backward compatibility
|
|
582
|
+
const {
|
|
583
|
+
pageSize,
|
|
584
|
+
page
|
|
585
|
+
} = queryOptions.paginationModel;
|
|
586
|
+
if (pageSize < childRowsWithDescendantCounts.length) {
|
|
587
|
+
childRowsWithDescendantCounts = childRowsWithDescendantCounts.slice(page * pageSize, (page + 1) * pageSize);
|
|
588
|
+
}
|
|
568
589
|
}
|
|
569
590
|
}
|
|
570
591
|
return new Promise(resolve => {
|
package/hooks/useMockServer.js
CHANGED
|
@@ -148,12 +148,13 @@ const useMockServer = (dataSetOptions, serverOptions, shouldRequestsFail, nested
|
|
|
148
148
|
}, [options.treeData?.groupingField, isTreeData]);
|
|
149
149
|
const getChildrenCount = React.useMemo(() => {
|
|
150
150
|
if (isTreeData) {
|
|
151
|
-
return row => row.
|
|
151
|
+
return row => row.childrenCount;
|
|
152
152
|
}
|
|
153
153
|
return undefined;
|
|
154
154
|
}, [isTreeData]);
|
|
155
155
|
React.useEffect(() => {
|
|
156
|
-
const
|
|
156
|
+
const treeDataKey = (options.treeData?.maxDepth ?? 1) > 1 ? `${options.treeData?.maxDepth}-${options.treeData?.averageChildren ?? 2}-${options.treeData?.groupingField ?? ''}` : 'false';
|
|
157
|
+
const cacheKey = `${options.dataSet}-${options.rowLength}-${index}-${options.maxColumns}-treeData:${treeDataKey}`;
|
|
157
158
|
|
|
158
159
|
// Cache to allow fast switch between the JavaScript and TypeScript version
|
|
159
160
|
// of the demos.
|
|
@@ -254,7 +255,7 @@ const useMockServer = (dataSetOptions, serverOptions, shouldRequestsFail, nested
|
|
|
254
255
|
rows,
|
|
255
256
|
rootRowCount,
|
|
256
257
|
aggregateRow
|
|
257
|
-
} = await (0, _serverUtils.processTreeDataRows)(dataRef.current?.rows ?? [], params, serverOptionsWithDefault, columnsWithDefaultColDef, nestedPagination ??
|
|
258
|
+
} = await (0, _serverUtils.processTreeDataRows)(dataRef.current?.rows ?? [], params, serverOptionsWithDefault, columnsWithDefaultColDef, nestedPagination ?? (params.start !== undefined && params.end !== undefined));
|
|
258
259
|
getRowsResponse = (0, _extends2.default)({
|
|
259
260
|
rows: rows.slice().map(row => (0, _extends2.default)({}, row, {
|
|
260
261
|
path: undefined
|
|
@@ -281,7 +282,7 @@ const useMockServer = (dataSetOptions, serverOptions, shouldRequestsFail, nested
|
|
|
281
282
|
rows,
|
|
282
283
|
rootRowCount,
|
|
283
284
|
aggregateRow
|
|
284
|
-
} = await (0, _serverUtils.processRowGroupingRows)(dataRef.current?.rows ?? [], params, serverOptionsWithDefault, columnsWithDefaultColDef);
|
|
285
|
+
} = await (0, _serverUtils.processRowGroupingRows)(dataRef.current?.rows ?? [], params, serverOptionsWithDefault, columnsWithDefaultColDef, params.start !== undefined && params.end !== undefined);
|
|
285
286
|
getRowsResponse = (0, _extends2.default)({
|
|
286
287
|
rows: rows.slice().map(row => (0, _extends2.default)({}, row, {
|
|
287
288
|
path: undefined
|
package/hooks/useMockServer.mjs
CHANGED
|
@@ -141,12 +141,13 @@ export const useMockServer = (dataSetOptions, serverOptions, shouldRequestsFail,
|
|
|
141
141
|
}, [options.treeData?.groupingField, isTreeData]);
|
|
142
142
|
const getChildrenCount = React.useMemo(() => {
|
|
143
143
|
if (isTreeData) {
|
|
144
|
-
return row => row.
|
|
144
|
+
return row => row.childrenCount;
|
|
145
145
|
}
|
|
146
146
|
return undefined;
|
|
147
147
|
}, [isTreeData]);
|
|
148
148
|
React.useEffect(() => {
|
|
149
|
-
const
|
|
149
|
+
const treeDataKey = (options.treeData?.maxDepth ?? 1) > 1 ? `${options.treeData?.maxDepth}-${options.treeData?.averageChildren ?? 2}-${options.treeData?.groupingField ?? ''}` : 'false';
|
|
150
|
+
const cacheKey = `${options.dataSet}-${options.rowLength}-${index}-${options.maxColumns}-treeData:${treeDataKey}`;
|
|
150
151
|
|
|
151
152
|
// Cache to allow fast switch between the JavaScript and TypeScript version
|
|
152
153
|
// of the demos.
|
|
@@ -247,7 +248,7 @@ export const useMockServer = (dataSetOptions, serverOptions, shouldRequestsFail,
|
|
|
247
248
|
rows,
|
|
248
249
|
rootRowCount,
|
|
249
250
|
aggregateRow
|
|
250
|
-
} = await processTreeDataRows(dataRef.current?.rows ?? [], params, serverOptionsWithDefault, columnsWithDefaultColDef, nestedPagination ??
|
|
251
|
+
} = await processTreeDataRows(dataRef.current?.rows ?? [], params, serverOptionsWithDefault, columnsWithDefaultColDef, nestedPagination ?? (params.start !== undefined && params.end !== undefined));
|
|
251
252
|
getRowsResponse = _extends({
|
|
252
253
|
rows: rows.slice().map(row => _extends({}, row, {
|
|
253
254
|
path: undefined
|
|
@@ -274,7 +275,7 @@ export const useMockServer = (dataSetOptions, serverOptions, shouldRequestsFail,
|
|
|
274
275
|
rows,
|
|
275
276
|
rootRowCount,
|
|
276
277
|
aggregateRow
|
|
277
|
-
} = await processRowGroupingRows(dataRef.current?.rows ?? [], params, serverOptionsWithDefault, columnsWithDefaultColDef);
|
|
278
|
+
} = await processRowGroupingRows(dataRef.current?.rows ?? [], params, serverOptionsWithDefault, columnsWithDefaultColDef, params.start !== undefined && params.end !== undefined);
|
|
278
279
|
getRowsResponse = _extends({
|
|
279
280
|
rows: rows.slice().map(row => _extends({}, row, {
|
|
280
281
|
path: undefined
|
package/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @mui/x-data-grid-generator v9.
|
|
2
|
+
* @mui/x-data-grid-generator v9.4.0
|
|
3
3
|
*
|
|
4
|
-
* @license
|
|
5
|
-
* This source code is licensed under the
|
|
4
|
+
* @license MIT
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
8
|
"use strict";
|
package/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @mui/x-data-grid-generator v9.
|
|
2
|
+
* @mui/x-data-grid-generator v9.4.0
|
|
3
3
|
*
|
|
4
|
-
* @license
|
|
5
|
-
* This source code is licensed under the
|
|
4
|
+
* @license MIT
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
8
|
export * from "./renderer/index.mjs";
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-data-grid-generator",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.4.0",
|
|
4
4
|
"author": "MUI Team",
|
|
5
5
|
"description": "Generate fake data for demo purposes only.",
|
|
6
|
-
"license": "
|
|
6
|
+
"license": "MIT",
|
|
7
7
|
"bugs": {
|
|
8
8
|
"url": "https://github.com/mui/mui-x/issues"
|
|
9
9
|
},
|
|
@@ -21,14 +21,14 @@
|
|
|
21
21
|
"directory": "packages/x-data-grid-generator"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@babel/runtime": "^7.29.
|
|
24
|
+
"@babel/runtime": "^7.29.7",
|
|
25
25
|
"chance": "^1.1.13",
|
|
26
26
|
"clsx": "^2.1.1",
|
|
27
|
-
"lru-cache": "^11.
|
|
28
|
-
"@mui/x-data-grid": "^9.
|
|
29
|
-
"@mui/x-data-grid-
|
|
30
|
-
"@mui/x-
|
|
31
|
-
"@mui/x-
|
|
27
|
+
"lru-cache": "^11.5.1",
|
|
28
|
+
"@mui/x-data-grid": "^9.4.0",
|
|
29
|
+
"@mui/x-data-grid-pro": "^9.4.0",
|
|
30
|
+
"@mui/x-internals": "^9.1.0",
|
|
31
|
+
"@mui/x-data-grid-premium": "^9.4.0"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"@emotion/react": "^11.9.0",
|