@mui/x-data-grid-premium 7.20.0 → 7.22.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.
Files changed (37) hide show
  1. package/CHANGELOG.md +200 -31
  2. package/DataGridPremium/DataGridPremium.js +16 -0
  3. package/DataGridPremium/useDataGridPremiumComponent.js +5 -1
  4. package/components/GridDataSourceGroupingCriteriaCell.d.ts +7 -0
  5. package/components/GridDataSourceGroupingCriteriaCell.js +134 -0
  6. package/esm/DataGridPremium/DataGridPremium.js +16 -0
  7. package/esm/DataGridPremium/useDataGridPremiumComponent.js +6 -2
  8. package/esm/components/GridDataSourceGroupingCriteriaCell.js +126 -0
  9. package/esm/hooks/features/rowGrouping/createGroupingColDef.js +18 -8
  10. package/esm/hooks/features/rowGrouping/gridRowGroupingUtils.js +10 -5
  11. package/esm/hooks/features/rowGrouping/useGridDataSourceRowGroupingPreProcessors.js +73 -0
  12. package/esm/hooks/features/rowGrouping/useGridRowGrouping.js +16 -6
  13. package/esm/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +17 -22
  14. package/esm/utils/releaseInfo.js +1 -1
  15. package/hooks/features/rowGrouping/createGroupingColDef.d.ts +5 -2
  16. package/hooks/features/rowGrouping/createGroupingColDef.js +17 -7
  17. package/hooks/features/rowGrouping/gridRowGroupingUtils.d.ts +7 -4
  18. package/hooks/features/rowGrouping/gridRowGroupingUtils.js +11 -6
  19. package/hooks/features/rowGrouping/useGridDataSourceRowGroupingPreProcessors.d.ts +4 -0
  20. package/hooks/features/rowGrouping/useGridDataSourceRowGroupingPreProcessors.js +81 -0
  21. package/hooks/features/rowGrouping/useGridRowGrouping.d.ts +1 -1
  22. package/hooks/features/rowGrouping/useGridRowGrouping.js +15 -5
  23. package/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.d.ts +1 -1
  24. package/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +16 -21
  25. package/index.js +1 -1
  26. package/modern/DataGridPremium/DataGridPremium.js +16 -0
  27. package/modern/DataGridPremium/useDataGridPremiumComponent.js +6 -2
  28. package/modern/components/GridDataSourceGroupingCriteriaCell.js +126 -0
  29. package/modern/hooks/features/rowGrouping/createGroupingColDef.js +18 -8
  30. package/modern/hooks/features/rowGrouping/gridRowGroupingUtils.js +10 -5
  31. package/modern/hooks/features/rowGrouping/useGridDataSourceRowGroupingPreProcessors.js +73 -0
  32. package/modern/hooks/features/rowGrouping/useGridRowGrouping.js +16 -6
  33. package/modern/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +17 -22
  34. package/modern/index.js +1 -1
  35. package/modern/utils/releaseInfo.js +1 -1
  36. package/package.json +5 -5
  37. package/utils/releaseInfo.js +1 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,175 @@
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
+ ## 7.22.0
7
+
8
+ _Oct 25, 2024_
9
+
10
+ We'd like to offer a big thanks to the 11 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 🛰 Introduce [server-side support for Data Grid row grouping](https://mui.com/x/react-data-grid/server-side-data/row-grouping/)
13
+ - 🐞 Bugfixes
14
+ - 📚 Documentation improvements
15
+ - 🌍 Improve Portuguese (pt-BR) locale on the Data Grid component
16
+
17
+ Special thanks go out to the community contributors who have helped make this release possible:
18
+ @clins1994, @GITPHLAP, @k-rajat19, @kalyan90, @merotosc, @yash49.
19
+ Following are all team members who have contributed to this release:
20
+ @cherniavskii, @flaviendelangle, @LukasTy, @MBilalShafi, @romgrk.
21
+
22
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
23
+
24
+ ### Data Grid
25
+
26
+ #### `@mui/x-data-grid@7.22.0`
27
+
28
+ - [DataGrid] Fix `GridPanelAnchor` positioning (#15022) @k-rajat19
29
+ - [DataGrid] Fix ugly prop-types for the `pageStyle` prop of the `GridPrintExportMenuItem` component (#15015) @flaviendelangle
30
+ - [DataGrid] Fix value type in filter model for number and boolean column type (#14733) @k-rajat19
31
+ - [DataGrid] Focus next row when the focused row is deleted (#15067) @cherniavskii
32
+ - [DataGrid] Remove some usages of `<Box />` and `<Badge />` (#15013) @romgrk
33
+ - [DataGrid] Fix number of rows to display for page size options with negative value (#14890) @kalyan90
34
+ - [l10n] Improve Portuguese (pt-BR) locale (#15021) @k-rajat19
35
+
36
+ #### `@mui/x-data-grid-pro@7.22.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
37
+
38
+ Same changes as in `@mui/x-data-grid@7.22.0`, plus:
39
+
40
+ - [DataGridPro] Fix column pinning layout (#15073) @cherniavskii
41
+
42
+ #### `@mui/x-data-grid-premium@7.22.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
43
+
44
+ Same changes as in `@mui/x-data-grid-pro@7.22.0`, plus:
45
+
46
+ - [DataGridPremium] Server-side data source with row grouping (#15109) @MBilalShafi
47
+
48
+ ### Date and Time Pickers
49
+
50
+ #### `@mui/x-date-pickers@7.22.0`
51
+
52
+ - [pickers] Fix `DateCalendar` timezone management (#15119) @LukasTy
53
+ - [pickers] Fix `DigitalClock` time options on a `DST` switch day (#15092) @LukasTy
54
+
55
+ #### `@mui/x-date-pickers-pro@7.22.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
56
+
57
+ Same changes as in `@mui/x-date-pickers@7.22.0`.
58
+
59
+ ### Charts
60
+
61
+ #### `@mui/x-charts@7.22.0`
62
+
63
+ - [charts] Export data type in `onAxisClick(_, data)` callback (#15038) @clins1994
64
+
65
+ #### `@mui/x-charts-pro@7.0.0-beta.6` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
66
+
67
+ Same changes as in `@mui/x-charts@7.22.0`.
68
+
69
+ ### Tree View
70
+
71
+ #### `@mui/x-tree-view@7.22.0`
72
+
73
+ - [TreeView] Make the cancellable event types public (#14992) @flaviendelangle
74
+
75
+ ### Docs
76
+
77
+ - [docs] Fix typo in Tree View docs (#15047) @yash49
78
+
79
+ ### Core
80
+
81
+ - [core] Adjust cherry-pick GH actions (#15101) @LukasTy
82
+ - [core] Update prettier target branch (#15100) @MBilalShafi
83
+ - [core] Update some `default-branch-switch` instances for `v7.x` (#15085) @MBilalShafi
84
+ - [test] Revert to using `fireEvent` instead of `userEvent` (#14927) @LukasTy
85
+
86
+ ## 7.21.0
87
+
88
+ _Oct 17, 2024_
89
+
90
+ We'd like to offer a big thanks to the 13 contributors who made this release possible. Here are some highlights ✨:
91
+
92
+ - 💫 Added [`dataset` prop support for the Scatter Chart component](https://mui.com/x/react-charts/scatter/#using-a-dataset)
93
+ - 🐞 Bugfixes
94
+ - 📚 Documentation improvements
95
+
96
+ Special thanks go out to the community contributors who have helped make this release possible:
97
+ @k-rajat19, @kalyan90, @rotembarsela, @wangkailang.
98
+ Following are all team members who have contributed to this release:
99
+ @arthurbalduini, @cherniavskii, @flaviendelangle, @JCQuintas, @LukasTy, @MBilalShafi, @arminmeh, @romgrk, @KenanYusuf, @oliviertassinari, @samuelsycamore.
100
+
101
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
102
+
103
+ ### Data Grid
104
+
105
+ #### `@mui/x-data-grid@7.21.0`
106
+
107
+ - [DataGrid] Fix `onRowSelectionModelChange` firing unnecessarily on initial render (#14909) @MBilalShafi
108
+ - [DataGrid] Fix `onRowSelectionModelChange` not being called after row is removed (#14972) @arminmeh
109
+ - [DataGrid] Fix pagination scrollbar issue on small zoom (#14911) @cherniavskii
110
+ - [DataGrid] Fix scroll jumping (#14929) @romgrk
111
+ - [DataGrid] Fix excessive white space at the end of the Data Grid (#14864) @kalyan90
112
+
113
+ #### `@mui/x-data-grid-pro@7.21.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
114
+
115
+ Same changes as in `@mui/x-data-grid@7.21.0`, plus:
116
+
117
+ - [DataGridPro] Fix indeterminate checkbox state for server-side data (#14956) @MBilalShafi
118
+ - [DataGridPro] Fix scrolling performance when `rowHeight={undefined}` (#14983) @cherniavskii
119
+ - [DataGridPro] List view (#14393) @KenanYusuf @cherniavskii
120
+
121
+ #### `@mui/x-data-grid-premium@7.21.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
122
+
123
+ Same changes as in `@mui/x-data-grid-pro@7.21.0`.
124
+
125
+ ### Date and Time Pickers
126
+
127
+ #### `@mui/x-date-pickers@7.21.0`
128
+
129
+ - [pickers] Cleanup `PageUp` and `PageDown` event handlers on time components (#14928) @arthurbalduini
130
+ - [pickers] Create the new picker's `ownerState` object (#14889) @flaviendelangle
131
+ - [pickers] Fix `PickerValidDate` usage in the Date Range Picker Toolbar (#14925) @flaviendelangle
132
+
133
+ #### `@mui/x-date-pickers-pro@7.21.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
134
+
135
+ Same changes as in `@mui/x-date-pickers@7.21.0`.
136
+
137
+ ### Charts
138
+
139
+ #### `@mui/x-charts@7.21.0`
140
+
141
+ - [charts] Allow `dataset` to be used with the Scatter Chart (#14915) @JCQuintas
142
+ - [charts] Ensure `reduce motion` preference disables animation on page load (#14417) @JCQuintas
143
+
144
+ #### `@mui/x-charts-pro@7.0.0-beta.5` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
145
+
146
+ Same changes as in `@mui/x-charts@7.21.0`.
147
+
148
+ ### Tree View
149
+
150
+ #### `@mui/x-tree-view@7.21.0`
151
+
152
+ - [TreeView] Fix `alpha` usage with CSS variables (#14969) @wangkailang
153
+ - [TreeView] Fix usage of the `aria-selected` attribute (#14991) @flaviendelangle
154
+ - [TreeView] Fix hydration error (#15002) @flaviendelangle
155
+
156
+ ### `@mui/x-codemod@7.21.0`
157
+
158
+ - [codemod] Add a new utility to rename imports (#14919) @flaviendelangle
159
+
160
+ ### Docs
161
+
162
+ - [docs] Add recipe showing how to toggle detail panels on row click (#14666) @k-rajat19
163
+ - [docs] Fix broken link to the validation section in the Data grid component (#14973) @arminmeh
164
+ - [docs] Update v5 migration codesandbox @oliviertassinari
165
+ - [docs] Enforce component style rules for the Tree View (#14963) @samuelsycamore
166
+
167
+ ### Core
168
+
169
+ - [core] Fix shortcut with localization keyboard (#14220) @rotembarsela
170
+ - [core] Fix docs deploy command (#14920) @arminmeh
171
+ - [code-infra] Prepare some tests to work in `vitest/playwright` (#14926) @JCQuintas
172
+ - [test] Fix `AdapterDayjs` coverage calculation (#14957) @LukasTy
173
+ - [test] Fix split infinitive API convention use @oliviertassinari
174
+
6
175
  ## 7.20.0
7
176
 
8
177
  _Oct 11, 2024_
@@ -79,7 +248,7 @@ Same changes as in `@mui/x-charts@7.20.0`.
79
248
  - [docs] Add custom columns panel demo (#14825) @cherniavskii
80
249
  - [docs] Capitalize all instances of "Data Grid" (#14884) @samuelsycamore
81
250
  - [docs] Divide charts `tooltip` and `highlighting` pages (#14824) @JCQuintas
82
- - [docs] Document the `TreeItem2` component and the `useTreeItem2` hook (#14551) @noraleonte
251
+ - [docs] Document the `<TreeItem2 />` component and the `useTreeItem2` hook (#14551) @noraleonte
83
252
  - [docs] Fix column pinning for "Disable detail panel content scroll" section (#14854 and #14885) @kalyan90
84
253
  - [docs] Fix detail panel demo not working well with pinned columns (#14883) @cherniavskii
85
254
  - [docs] New recipe of a read-only field (#14606) @flaviendelangle
@@ -367,7 +536,7 @@ Same changes as in `@mui/x-charts@7.17.0`.
367
536
 
368
537
  ### Docs
369
538
 
370
- - [docs] Add missing callout on "Imperative API" tree view sections (#14503) @flaviendelangle
539
+ - [docs] Add missing callout on "Imperative API" Tree View sections (#14503) @flaviendelangle
371
540
  - [docs] Fix broken redirection to MUI X v5 @oliviertassinari
372
541
  - [docs] Fix multiple `console.error` messages on `charts` docs (#14554) @JCQuintas
373
542
  - [docs] Fixed typo in Row Grouping recipes (#14549) @Miodini
@@ -708,7 +877,7 @@ Same changes as in `@mui/x-charts@7.13.0`.
708
877
  - [core] Fix ESLint issue (#14207) @LukasTy
709
878
  - [core] Fix Netlify build cache issue (#14182) @cherniavskii
710
879
  - [code-infra] Refactor Netlify `cache-docs` plugin setup (#14105) @LukasTy
711
- - [internals] Move utils needed for tree view virtualization to shared package (#14202) @flaviendelangle
880
+ - [internals] Move utils needed for Tree View virtualization to shared package (#14202) @flaviendelangle
712
881
 
713
882
  ## 7.12.1
714
883
 
@@ -799,7 +968,7 @@ This expansion of the Pro plan comes with some adjustments to our pricing strate
799
968
 
800
969
  We'd like to offer a big thanks to the 12 contributors who made this release possible. Here are some highlights ✨:
801
970
 
802
- - 🎁 Introduce [item reordering using drag and drop](https://mui.com/x/react-tree-view/rich-tree-view/ordering/) on the `RichTreeViewPro` component
971
+ - 🎁 Introduce [item reordering using drag and drop](https://mui.com/x/react-tree-view/rich-tree-view/ordering/) on the `<RichTreeViewPro />` component
803
972
 
804
973
  <img width="287" src="https://github.com/user-attachments/assets/78bd83c5-7ce4-4ed7-acf9-be70b2dbce54" alt="Item reordering using drag and drop" />
805
974
 
@@ -1292,7 +1461,7 @@ Same changes as in `@mui/x-date-pickers@7.8.0`.
1292
1461
 
1293
1462
  - [core] Add eslint rule to restrict import from `../internals` root (#13633) @JCQuintas
1294
1463
  - [docs-infra] Sync `\_app` folder with monorepo (#13582) @Janpot
1295
- - [license] Allow usage of charts and tree view pro package for old premium licenses (#13619) @flaviendelangle
1464
+ - [license] Allow usage of Charts and Tree View Pro package for old premium licenses (#13619) @flaviendelangle
1296
1465
 
1297
1466
  ## 7.7.1
1298
1467
 
@@ -1360,7 +1529,7 @@ Same changes as in `@mui/x-date-pickers@7.7.1`, plus:
1360
1529
  - [TreeView] Improve typing to support optional dependencies in plugins and in the item (#13523) @flaviendelangle
1361
1530
  - [TreeView] Move `useTreeViewId` to the core plugins (#13566) @flaviendelangle
1362
1531
  - [TreeView] Remove unused state from `useTreeViewId` (#13579) @flaviendelangle
1363
- - [TreeView] Support `itemId` with escaping characters when using `SimpleTreeView` (#13487) @oukunan
1532
+ - [TreeView] Support `itemId` with escaping characters when using Simple Tree View (#13487) @oukunan
1364
1533
 
1365
1534
  ### Docs
1366
1535
 
@@ -1440,7 +1609,7 @@ Same changes as in `@mui/x-date-pickers@7.7.0`.
1440
1609
  - [TreeView] Improve TypeScript for plugins (#13380) @flaviendelangle
1441
1610
  - [TreeView] Improve the typing of the cancelable events (#13152) @flaviendelangle
1442
1611
  - [TreeView] Prepare support for PigmentCSS (#13412) @flaviendelangle
1443
- - [TreeView] Refactor the tree view internals to prepare for headless API (#13311) @flaviendelangle
1612
+ - [TreeView] Refactor the Tree View internals to prepare for headless API (#13311) @flaviendelangle
1444
1613
 
1445
1614
  ### Docs
1446
1615
 
@@ -1455,7 +1624,7 @@ Same changes as in `@mui/x-date-pickers@7.7.0`.
1455
1624
  - [core] Add `eslint-plugin-react-compiler` experimental version and rules (#13415) @JCQuintas
1456
1625
  - [core] Minor setup cleanup (#13467) @LukasTy
1457
1626
  - [infra] Adjust CI setup (#13448) @LukasTy
1458
- - [test] Add tests for the custom slots of `TreeItem2` (#13314) @flaviendelangle
1627
+ - [test] Add tests for the custom slots of `<TreeItem2 />` (#13314) @flaviendelangle
1459
1628
 
1460
1629
  ## 7.6.2
1461
1630
 
@@ -1640,7 +1809,7 @@ _May 23, 2024_
1640
1809
 
1641
1810
  We'd like to offer a big thanks to the 6 contributors who made this release possible. Here are some highlights ✨:
1642
1811
 
1643
- - 🧰 Improve tree view testing
1812
+ - 🧰 Improve Tree View testing
1644
1813
  - 📊 Add `label` to be displayed in BarChart
1645
1814
 
1646
1815
  ### Data Grid
@@ -1816,7 +1985,7 @@ Same changes as in `@mui/x-date-pickers@7.4.0`.
1816
1985
 
1817
1986
  #### `@mui/x-tree-view@7.4.0`
1818
1987
 
1819
- - [TreeView] Fix props propagation and theme entry in `TreeItem2` (#12889) @flaviendelangle
1988
+ - [TreeView] Fix props propagation and theme entry in `<TreeItem2 />` (#12889) @flaviendelangle
1820
1989
 
1821
1990
  ### Docs
1822
1991
 
@@ -2126,7 +2295,7 @@ Same changes as in `@mui/x-date-pickers@7.2.0`, plus:
2126
2295
  ### Docs
2127
2296
 
2128
2297
  - [docs] Add `AxisFormatter` documentation for customizing tick/tooltip value formatting (#12700) @JCQuintas
2129
- - [docs] Add file explorer example to rich tree view customization docs (#12707) @noraleonte
2298
+ - [docs] Add file explorer example to rich Tree View customization docs (#12707) @noraleonte
2130
2299
  - [docs] Do not use import of depth 3 in the doc (#12716) @flaviendelangle
2131
2300
  - [docs] Explain how to clip plots with composition (#12679) @alexfauquette
2132
2301
  - [docs] Fix typo in Data Grid v7 migration page (#12720) @bfaulk96
@@ -2202,7 +2371,7 @@ Same changes as in `@mui/x-date-pickers@7.1.1`, plus:
2202
2371
  #### `@mui/x-tree-view@7.1.1`
2203
2372
 
2204
2373
  - [TreeView] Add JSDoc to all `publicAPI` methods (#12649) @flaviendelangle
2205
- - [TreeView] Create `RichTreeViewPro` component (not released yet) (#12610) @flaviendelangle
2374
+ - [TreeView] Create `<RichTreeViewPro />` component (not released yet) (#12610) @flaviendelangle
2206
2375
  - [TreeView] Create Pro package (not released yet) (#12240) @flaviendelangle
2207
2376
  - [TreeView] Fix typo in errors (#12623) @alissa-tung
2208
2377
  - [TreeView] New API method: `setItemExpansion` (#12595) @flaviendelangle
@@ -2222,13 +2391,13 @@ Same changes as in `@mui/x-date-pickers@7.1.1`, plus:
2222
2391
  - [docs] Move Data Grid interfaces to standard API page layout (#12016) @alexfauquette
2223
2392
  - [docs] Remove ` around @default values (#12158) @alexfauquette
2224
2393
  - [docs] Remove `day` from the default `dayOfWeekFormatter` function params (#12644) @LukasTy
2225
- - [docs] Use `TreeItem2` for icon expansion example on `RichTreeView` (#12563) @flaviendelangle
2394
+ - [docs] Use `<TreeItem2 />` for icon expansion example on `<RichTreeView />` (#12563) @flaviendelangle
2226
2395
 
2227
2396
  ### Core
2228
2397
 
2229
2398
  - [core] Add cherry-pick `master` to `v6` action (#12648) @LukasTy
2230
2399
  - [core] Fix typo in `@mui/x-tree-view-pro/themeAugmentation` (#12674) @flaviendelangle
2231
- - [core] Introduce `describeTreeView` to run test on `SimpleTreeView` and `RichTreeView`, using `TreeItem` and `TreeItem2` + migrate expansion tests (#12428) @flaviendelangle
2400
+ - [core] Introduce `describeTreeView` to run test on `<SimpleTreeView />` and `<RichTreeView />`, using `<TreeItem />` and `<TreeItem2 />` + migrate expansion tests (#12428) @flaviendelangle
2232
2401
  - [core] Limit `test-types` CI step allowed memory (#12651) @LukasTy
2233
2402
  - [core] Remove explicit `express` package (#12602) @LukasTy
2234
2403
  - [core] Update to new embedded translations in the docs package (#12232) @Janpot
@@ -2293,7 +2462,7 @@ Same changes as in `@mui/x-date-pickers@7.1.0`, plus:
2293
2462
 
2294
2463
  #### `@mui/x-tree-view@7.1.0`
2295
2464
 
2296
- - [TreeView] Do not use outdated version of the state to compute new label first char in `RichTreeView` (#12512) @flaviendelangle
2465
+ - [TreeView] Do not use outdated version of the state to compute new label first char in Rich Tree View (#12512) @flaviendelangle
2297
2466
 
2298
2467
  ### Docs
2299
2468
 
@@ -2420,7 +2589,7 @@ Same changes as in `@mui/x-date-pickers@7.0.0`, plus:
2420
2589
 
2421
2590
  #### Breaking changes
2422
2591
 
2423
- - The required `nodeId` prop used by the `TreeItem` has been renamed to `itemId` for consistency:
2592
+ - The required `nodeId` prop used by `<TreeItem />` has been renamed to `itemId` for consistency:
2424
2593
 
2425
2594
  ```diff
2426
2595
  <TreeView>
@@ -2573,7 +2742,7 @@ The `onNodeFocus` callback has been renamed to `onItemFocus` for consistency:
2573
2742
  #### `@mui/x-tree-view@7.0.0-beta.7`
2574
2743
 
2575
2744
  - [TreeView] Clean the usage of the term "item" and "node" in API introduced during v7 (#12368) @noraleonte
2576
- - [TreeView] Introduce a new `TreeItem2` component and a new `useTreeItem2` hook (#11721) @flaviendelangle
2745
+ - [TreeView] Introduce a new `<TreeItem2 />` component and a new `useTreeItem2` hook (#11721) @flaviendelangle
2577
2746
  - [TreeView] Rename `onNodeFocus` to `onItemFocus` (#12419) @noraleonte
2578
2747
 
2579
2748
  ### Docs
@@ -2631,9 +2800,9 @@ Same changes as in `@mui/x-data-grid-pro@7.0.0-beta.6`.
2631
2800
 
2632
2801
  #### Breaking changes
2633
2802
 
2634
- - The component used to animate the item children is now defined as a slot on the `TreeItem` component.
2803
+ - The component used to animate the item children is now defined as a slot on the `<TreeItem />` component.
2635
2804
 
2636
- If you were passing a `TransitionComponent` or `TransitionProps` to your `TreeItem` component,
2805
+ If you were passing a `TransitionComponent` or `TransitionProps` to your `<TreeItem />` component,
2637
2806
  you need to use the new `groupTransition` slot on this component:
2638
2807
 
2639
2808
  ```diff
@@ -2649,7 +2818,7 @@ Same changes as in `@mui/x-data-grid-pro@7.0.0-beta.6`.
2649
2818
  </SimpleTreeView>
2650
2819
  ```
2651
2820
 
2652
- - The `group` class of the `TreeItem` component has been renamed to `groupTransition` to match with its new slot name.
2821
+ - The `group` class of the `<TreeItem />` component has been renamed to `groupTransition` to match with its new slot name.
2653
2822
 
2654
2823
  ```diff
2655
2824
  const StyledTreeItem = styled(TreeItem)({
@@ -2663,14 +2832,14 @@ Same changes as in `@mui/x-data-grid-pro@7.0.0-beta.6`.
2663
2832
  #### `@mui/x-tree-view@7.0.0-beta.6`
2664
2833
 
2665
2834
  - [TreeView] Fix invalid nodes state when updating `props.items` (#12359) @flaviendelangle
2666
- - [TreeView] In the `RichTreeView`, do not use the item id as the HTML id attribute (#12319) @flaviendelangle
2835
+ - [TreeView] In the Rich Tree View, do not use the item id as the HTML id attribute (#12319) @flaviendelangle
2667
2836
  - [TreeView] New instance and publicAPI method: `getItem` (#12251) @flaviendelangle
2668
2837
  - [TreeView] Replace `TransitionComponent` and `TransitionProps` with a `groupTransition` slot (#12336) @flaviendelangle
2669
2838
 
2670
2839
  ### Docs
2671
2840
 
2672
2841
  - [docs] Add a note about `z-index` usage in SVG (#12337) @alexfauquette
2673
- - [docs] `RichTreeView` customization docs (#12231) @noraleonte
2842
+ - [docs] Rich Tree View customization docs (#12231) @noraleonte
2674
2843
 
2675
2844
  ### Core
2676
2845
 
@@ -3323,7 +3492,7 @@ Same changes as in `@mui/x-date-pickers@7.0.0-beta.0`, plus:
3323
3492
 
3324
3493
  ### Docs
3325
3494
 
3326
- - [docs] Add `contextValue` to the headless tree view doc (#11705) @flaviendelangle
3495
+ - [docs] Add `contextValue` to the headless Tree View doc (#11705) @flaviendelangle
3327
3496
  - [docs] Add section for the `disableSelection` prop (#11821) @flaviendelangle
3328
3497
  - [docs] Fix brand name non-breaking space (#11758) @oliviertassinari
3329
3498
  - [docs] Fix typo in Data Grid components page (#11775) @flaviendelangle
@@ -3346,7 +3515,7 @@ We'd like to offer a big thanks to the 11 contributors who made this release pos
3346
3515
 
3347
3516
  - 🎁 The Data Grid headers have been refactored to bring immense improvements to scrolling, state management, and overall performance of the grid.
3348
3517
  - ⚙️ The Data Grid disabled column-specific features like filtering, sorting, grouping, etc. could now be accessed programmatically. See the related [docs](https://next.mui.com/x/react-data-grid/api-object/#access-the-disabled-column-features) section.
3349
- - 🚀 Uplift the `SimpleTreeView` customization examples (#11424) @noraleonte
3518
+ - 🚀 Uplift the Simple Tree View customization examples (#11424) @noraleonte
3350
3519
  - 🌍 Add Croatian (hr-HR), Portuguese (pt-PT), and Chinese (Hong Kong) (zh-HK) locales (#11668) on the Data Grid @BCaspari
3351
3520
  - 🐞 Bugfixes
3352
3521
  - 💔 Bump `@mui/material` peer dependency for all packages (#11692) @LukasTy
@@ -3557,7 +3726,7 @@ Same changes as in `@mui/x-date-pickers@7.0.0-alpha.9`.
3557
3726
  ```
3558
3727
 
3559
3728
  - The `useTreeItem` hook has been renamed `useTreeItemState`.
3560
- This will help create a new headless version of the `TreeItem` component based on a future `useTreeItem` hook.
3729
+ This will help create a new headless version of the Tree Item component based on a future `useTreeItem` hook.
3561
3730
 
3562
3731
  ```diff
3563
3732
  -import { TreeItem, useTreeItem } from '@mui/x-tree-view/TreeItem';
@@ -3657,13 +3826,13 @@ Same changes as in `@mui/x-date-pickers@7.0.0-alpha.9`.
3657
3826
  - [docs] Cleanup and fix Pickers Playground styling (#11700) @LukasTy
3658
3827
  - [docs] First draft of the Tree View custom plugin doc (#11564) @flaviendelangle
3659
3828
  - [docs] Fix Pickers migration syntax and diffs (#11695) @LukasTy
3660
- - [docs] Fix generated tree view API docs (#11737) @LukasTy
3829
+ - [docs] Fix generated Tree View API docs (#11737) @LukasTy
3661
3830
  - [docs] Generate docs for Tree View slots (#11730) @flaviendelangle
3662
3831
  - [docs] Improve codemod for v7 (#11650) @oliviertassinari
3663
3832
  - [docs] Improve Data Grid `pageSizeOptions` prop documentation (#11682) @oliviertassinari
3664
3833
  - [docs] Parse markdown on API docs demo titles (#11728) @LukasTy
3665
3834
  - [docs] Remove the description from the `className` prop (#11693) @oliviertassinari
3666
- - [docs] Uplift `SimpleTreeView` customization examples (#11424) @noraleonte
3835
+ - [docs] Uplift Simple Tree View customization examples (#11424) @noraleonte
3667
3836
  - [docs] Uplift the Date Pickers playground (#11555) @danilo-leal
3668
3837
 
3669
3838
  ### Core
@@ -3740,8 +3909,8 @@ Same changes as in `@mui/x-date-pickers@7.0.0-alpha.8`.
3740
3909
 
3741
3910
  ### Tree View / `@mui/x-tree-view@7.0.0-alpha.8`
3742
3911
 
3743
- - [tree view] Cleanup `onKeyDown` handler (#11481) @flaviendelangle
3744
- - [tree view] Define the parameters used by each plugin to avoid listing them in each component (#11473) @flaviendelangle
3912
+ - [TreeView] Cleanup `onKeyDown` handler (#11481) @flaviendelangle
3913
+ - [TreeView] Define the parameters used by each plugin to avoid listing them in each component (#11473) @flaviendelangle
3745
3914
 
3746
3915
  ### Docs
3747
3916
 
@@ -3768,7 +3937,7 @@ We'd like to offer a big thanks to the 7 contributors who made this release poss
3768
3937
 
3769
3938
  - 🎁 New component to create a Tree View from a structured data source:
3770
3939
 
3771
- You can now directly pass your data to the `RichTreeView` component instead of manually converting it into JSX `TreeItem` components:
3940
+ You can now directly pass your data to the `<RichTreeView />` component instead of manually converting it into JSX `<TreeItem />` components:
3772
3941
 
3773
3942
  ```tsx
3774
3943
  const ITEMS = [
@@ -5099,7 +5268,7 @@ Here is an example of the renaming for the `<ChartsTooltip />` component.
5099
5268
 
5100
5269
  ### Core
5101
5270
 
5102
- - [core] Adds migration docs for charts, pickers and tree view (#10926) @michelengelen
5271
+ - [core] Adds migration docs for Charts, Pickers, and Tree View (#10926) @michelengelen
5103
5272
  - [core] Bump monorepo (#10959) @LukasTy
5104
5273
  - [core] Changed prettier branch value to next (#10917) @michelengelen
5105
5274
  - [core] Fix GitHub title tag consistency @oliviertassinari
@@ -939,6 +939,7 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
939
939
  * Setting it to a lower value could be useful when using dynamic row height,
940
940
  * but might reduce performance when displaying a large number of rows.
941
941
  * @default 166
942
+ * @deprecated
942
943
  */
943
944
  rowPositionsDebounceMs: _propTypes.default.number,
944
945
  /**
@@ -1067,6 +1068,21 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
1067
1068
  get: _propTypes.default.func.isRequired,
1068
1069
  set: _propTypes.default.func.isRequired
1069
1070
  }),
1071
+ /**
1072
+ * Definition of the column rendered when the `unstable_listView` prop is enabled.
1073
+ */
1074
+ unstable_listColumn: _propTypes.default.shape({
1075
+ align: _propTypes.default.oneOf(['center', 'left', 'right']),
1076
+ cellClassName: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.string]),
1077
+ display: _propTypes.default.oneOf(['flex', 'text']),
1078
+ field: _propTypes.default.string.isRequired,
1079
+ renderCell: _propTypes.default.func
1080
+ }),
1081
+ /**
1082
+ * If `true`, displays the data in a list view.
1083
+ * Use in combination with `unstable_listColumn`.
1084
+ */
1085
+ unstable_listView: _propTypes.default.bool,
1070
1086
  unstable_onDataSourceError: _propTypes.default.func,
1071
1087
  /**
1072
1088
  * If `true`, the Data Grid will auto span the cells over the rows having the same value.
@@ -9,6 +9,7 @@ var _useGridAggregation = require("../hooks/features/aggregation/useGridAggregat
9
9
  var _useGridAggregationPreProcessors = require("../hooks/features/aggregation/useGridAggregationPreProcessors");
10
10
  var _useGridRowGrouping = require("../hooks/features/rowGrouping/useGridRowGrouping");
11
11
  var _useGridRowGroupingPreProcessors = require("../hooks/features/rowGrouping/useGridRowGroupingPreProcessors");
12
+ var _useGridDataSourceRowGroupingPreProcessors = require("../hooks/features/rowGrouping/useGridDataSourceRowGroupingPreProcessors");
12
13
  var _useGridExcelExport = require("../hooks/features/export/useGridExcelExport");
13
14
  var _useGridCellSelection = require("../hooks/features/cellSelection/useGridCellSelection");
14
15
  var _useGridClipboardImport = require("../hooks/features/clipboard/useGridClipboardImport");
@@ -23,6 +24,7 @@ const useDataGridPremiumComponent = (inputApiRef, props) => {
23
24
  (0, _internals.useGridRowSelectionPreProcessors)(apiRef, props);
24
25
  (0, _internals.useGridRowReorderPreProcessors)(apiRef, props);
25
26
  (0, _useGridRowGroupingPreProcessors.useGridRowGroupingPreProcessors)(apiRef, props);
27
+ (0, _useGridDataSourceRowGroupingPreProcessors.useGridDataSourceRowGroupingPreProcessors)(apiRef, props);
26
28
  (0, _internals.useGridTreeDataPreProcessors)(apiRef, props);
27
29
  (0, _internals.useGridDataSourceTreeDataPreProcessors)(apiRef, props);
28
30
  (0, _internals.useGridLazyLoaderPreProcessors)(apiRef, props);
@@ -63,6 +65,7 @@ const useDataGridPremiumComponent = (inputApiRef, props) => {
63
65
  (0, _internals.useGridInitializeState)(_internals.columnGroupsStateInitializer, apiRef, props);
64
66
  (0, _internals.useGridInitializeState)(_internals.virtualizationStateInitializer, apiRef, props);
65
67
  (0, _internals.useGridInitializeState)(_internals.dataSourceStateInitializer, apiRef, props);
68
+ (0, _internals.useGridInitializeState)(_internals.listViewStateInitializer, apiRef, props);
66
69
  (0, _useGridRowGrouping.useGridRowGrouping)(apiRef, props);
67
70
  (0, _internals.useGridHeaderFiltering)(apiRef, props);
68
71
  (0, _internals.useGridTreeData)(apiRef, props);
@@ -75,7 +78,7 @@ const useDataGridPremiumComponent = (inputApiRef, props) => {
75
78
  (0, _internals.useGridColumns)(apiRef, props);
76
79
  (0, _internals.useGridRows)(apiRef, props);
77
80
  (0, _internals.useGridRowSpanning)(apiRef, props);
78
- (0, _internals.useGridParamsApi)(apiRef);
81
+ (0, _internals.useGridParamsApi)(apiRef, props);
79
82
  (0, _internals.useGridDetailPanel)(apiRef, props);
80
83
  (0, _internals.useGridColumnSpanning)(apiRef);
81
84
  (0, _internals.useGridColumnGrouping)(apiRef, props);
@@ -104,6 +107,7 @@ const useDataGridPremiumComponent = (inputApiRef, props) => {
104
107
  (0, _internals.useGridStatePersistence)(apiRef);
105
108
  (0, _internals.useGridDataSource)(apiRef, props);
106
109
  (0, _internals.useGridVirtualization)(apiRef, props);
110
+ (0, _internals.useGridListView)(apiRef, props);
107
111
  return apiRef;
108
112
  };
109
113
  exports.useDataGridPremiumComponent = useDataGridPremiumComponent;
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ import { GridRenderCellParams, GridGroupNode } from '@mui/x-data-grid-pro';
3
+ interface GridGroupingCriteriaCellProps extends GridRenderCellParams<any, any, any, GridGroupNode> {
4
+ hideDescendantCount?: boolean;
5
+ }
6
+ export declare function GridDataSourceGroupingCriteriaCell(props: GridGroupingCriteriaCellProps): React.JSX.Element;
7
+ export {};
@@ -0,0 +1,134 @@
1
+ "use strict";
2
+
3
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.GridDataSourceGroupingCriteriaCell = GridDataSourceGroupingCriteriaCell;
9
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
+ var React = _interopRequireWildcard(require("react"));
11
+ var _utils = require("@mui/utils");
12
+ var _Box = _interopRequireDefault(require("@mui/material/Box"));
13
+ var _CircularProgress = _interopRequireDefault(require("@mui/material/CircularProgress"));
14
+ var _internals = require("@mui/x-data-grid-pro/internals");
15
+ var _xDataGridPro = require("@mui/x-data-grid-pro");
16
+ var _useGridApiContext = require("../hooks/utils/useGridApiContext");
17
+ var _useGridRootProps = require("../hooks/utils/useGridRootProps");
18
+ var _jsxRuntime = require("react/jsx-runtime");
19
+ const useUtilityClasses = ownerState => {
20
+ const {
21
+ classes
22
+ } = ownerState;
23
+ const slots = {
24
+ root: ['groupingCriteriaCell'],
25
+ toggle: ['groupingCriteriaCellToggle'],
26
+ loadingContainer: ['groupingCriteriaCellLoadingContainer']
27
+ };
28
+ return (0, _utils.unstable_composeClasses)(slots, _xDataGridPro.getDataGridUtilityClass, classes);
29
+ };
30
+ function GridGroupingCriteriaCellIcon(props) {
31
+ const apiRef = (0, _internals.useGridPrivateApiContext)();
32
+ const rootProps = (0, _useGridRootProps.useGridRootProps)();
33
+ const classes = useUtilityClasses(rootProps);
34
+ const {
35
+ rowNode,
36
+ id,
37
+ field,
38
+ descendantCount
39
+ } = props;
40
+ const loadingSelector = state => state.dataSource.loading[id] ?? false;
41
+ const errorSelector = state => state.dataSource.errors[id];
42
+ const isDataLoading = (0, _xDataGridPro.useGridSelector)(apiRef, loadingSelector);
43
+ const error = (0, _xDataGridPro.useGridSelector)(apiRef, errorSelector);
44
+ const handleClick = event => {
45
+ if (!rowNode.childrenExpanded) {
46
+ // always fetch/get from cache the children when the node is expanded
47
+ apiRef.current.unstable_dataSource.fetchRows(id);
48
+ } else {
49
+ apiRef.current.setRowChildrenExpansion(id, !rowNode.childrenExpanded);
50
+ }
51
+ apiRef.current.setCellFocus(id, field);
52
+ event.stopPropagation();
53
+ };
54
+ const Icon = rowNode.childrenExpanded ? rootProps.slots.groupingCriteriaCollapseIcon : rootProps.slots.groupingCriteriaExpandIcon;
55
+ if (isDataLoading) {
56
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
57
+ className: classes.loadingContainer,
58
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CircularProgress.default, {
59
+ size: "1rem",
60
+ color: "inherit"
61
+ })
62
+ });
63
+ }
64
+ return descendantCount > 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseIconButton, (0, _extends2.default)({
65
+ size: "small",
66
+ onClick: handleClick,
67
+ tabIndex: -1,
68
+ "aria-label": rowNode.childrenExpanded ? apiRef.current.getLocaleText('treeDataCollapse') : apiRef.current.getLocaleText('treeDataExpand')
69
+ }, rootProps?.slotProps?.baseIconButton, {
70
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseTooltip, {
71
+ title: error?.message ?? null,
72
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseBadge, {
73
+ variant: "dot",
74
+ color: "error",
75
+ invisible: !error,
76
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Icon, {
77
+ fontSize: "inherit"
78
+ })
79
+ })
80
+ })
81
+ })) : null;
82
+ }
83
+ function GridDataSourceGroupingCriteriaCell(props) {
84
+ const {
85
+ id,
86
+ field,
87
+ rowNode,
88
+ hideDescendantCount,
89
+ formattedValue
90
+ } = props;
91
+ const rootProps = (0, _useGridRootProps.useGridRootProps)();
92
+ const apiRef = (0, _useGridApiContext.useGridApiContext)();
93
+ const rowSelector = state => state.rows.dataRowIdToModelLookup[id];
94
+ const row = (0, _xDataGridPro.useGridSelector)(apiRef, rowSelector);
95
+ const classes = useUtilityClasses(rootProps);
96
+ let descendantCount = 0;
97
+ if (row) {
98
+ descendantCount = Math.max(rootProps.unstable_dataSource?.getChildrenCount?.(row) ?? 0, 0);
99
+ }
100
+ let cellContent;
101
+ const colDef = apiRef.current.getColumn(rowNode.groupingField);
102
+ if (typeof colDef?.renderCell === 'function') {
103
+ cellContent = colDef.renderCell(props);
104
+ } else if (typeof formattedValue !== 'undefined') {
105
+ cellContent = /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
106
+ children: formattedValue
107
+ });
108
+ } else {
109
+ cellContent = /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
110
+ children: rowNode.groupingKey
111
+ });
112
+ }
113
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
114
+ className: classes.root,
115
+ sx: {
116
+ ml: rootProps.rowGroupingColumnMode === 'multiple' ? 0 : theme => `calc(var(--DataGrid-cellOffsetMultiplier) * ${theme.spacing(rowNode.depth)})`
117
+ },
118
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
119
+ className: classes.toggle,
120
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(GridGroupingCriteriaCellIcon, {
121
+ id: id,
122
+ field: field,
123
+ rowNode: rowNode,
124
+ row: row,
125
+ descendantCount: descendantCount
126
+ })
127
+ }), cellContent, !hideDescendantCount && descendantCount > 0 ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
128
+ style: {
129
+ whiteSpace: 'pre'
130
+ },
131
+ children: [" (", descendantCount, ")"]
132
+ }) : null]
133
+ });
134
+ }