@mui/x-data-grid-premium 7.17.0 → 7.19.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 (27) hide show
  1. package/CHANGELOG.md +208 -5
  2. package/DataGridPremium/DataGridPremium.js +33 -2
  3. package/DataGridPremium/useDataGridPremiumComponent.js +2 -0
  4. package/components/GridPremiumColumnMenu.d.ts +3 -3
  5. package/esm/DataGridPremium/DataGridPremium.js +33 -2
  6. package/esm/DataGridPremium/useDataGridPremiumComponent.js +3 -1
  7. package/esm/hooks/features/aggregation/gridAggregationUtils.js +1 -1
  8. package/esm/hooks/features/aggregation/wrapColumnWithAggregation.js +2 -2
  9. package/esm/hooks/features/cellSelection/useGridCellSelection.js +11 -8
  10. package/esm/utils/releaseInfo.js +1 -1
  11. package/hooks/features/aggregation/gridAggregationUtils.js +1 -1
  12. package/hooks/features/aggregation/wrapColumnWithAggregation.d.ts +22 -21
  13. package/hooks/features/aggregation/wrapColumnWithAggregation.js +2 -2
  14. package/hooks/features/cellSelection/useGridCellSelection.js +11 -8
  15. package/hooks/features/rowGrouping/gridRowGroupingSelector.d.ts +2 -2
  16. package/hooks/features/rows/useGridRowAriaAttributes.d.ts +1 -1
  17. package/index.js +1 -1
  18. package/material/index.d.ts +3 -3
  19. package/modern/DataGridPremium/DataGridPremium.js +33 -2
  20. package/modern/DataGridPremium/useDataGridPremiumComponent.js +3 -1
  21. package/modern/hooks/features/aggregation/gridAggregationUtils.js +1 -1
  22. package/modern/hooks/features/aggregation/wrapColumnWithAggregation.js +2 -2
  23. package/modern/hooks/features/cellSelection/useGridCellSelection.js +11 -8
  24. package/modern/index.js +1 -1
  25. package/modern/utils/releaseInfo.js +1 -1
  26. package/package.json +6 -6
  27. package/utils/releaseInfo.js +1 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,209 @@
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.19.0
7
+
8
+ _Oct 4, 2024_
9
+
10
+ We'd like to offer a big thanks to the 26 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 🔁 Automatic parents and children selection for Data Grid ["tree data"](https://mui.com/x/react-data-grid/tree-data/) and ["row grouping"](https://mui.com/x/react-data-grid/row-grouping/) features
13
+ - 💫 Support `minHeight` and `maxHeight` on flex parent container for the Data Grid component
14
+ - 🎁 Export `publicAPI` from the `useTreeItem2Utils` hook for the Tree View
15
+ - 🌍 Improve Bulgarian (bg-BG), Croatian (hr-HR), French (fr-FR), German (de-DE), Japanese (ja-JP) and Vietnamese (vi-VN) locales and add Portuguese (pt-PT) locale on the Data Grid component
16
+ - 🌏 Improve Czech (cs-CZ) and Portuguese (pt-BR) locales and add Bulgarian (bg-BG), Croatian (hr-HR) and Portuguese (pt-PT) locales on the Pickers components
17
+ - 🐞 Bugfixes
18
+ - 📚 Documentation improvements
19
+
20
+ Special thanks goes out to our community contributors who have helped make this release possible:
21
+ @AWAIS97, @chucamphong, @GMchris, @JakubSveda, @k-rajat19, @k725, @lhilgert9, @ruiaraujo012, @Sanderand, @thomasmoon, @vallereaugabriel.
22
+ Following are all team members who have contributed to this release:
23
+ @alexfauquette, @arminmeh, @arthurbalduini, @cherniavskii, @flaviendelangle, @Janpot, @JCQuintas, @KenanYusuf, @MBilalShafi, @michelengelen, @noraleonte, @oliviertassinari, @romgrk, @sai6855, @samuelsycamore.
24
+
25
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
26
+
27
+ ### Data Grid
28
+
29
+ #### `@mui/x-data-grid@7.19.0`
30
+
31
+ - [DataGrid] Fix column definition `undefined` value (#14456) @sai6855
32
+ - [DataGrid] Fix `checkboxSelectionVisibleOnly` reset the selection on filtering (#14677) @MBilalShafi
33
+ - [DataGrid] Fix background colors when `CSSVarsProvider` is used (#12901) @cherniavskii
34
+ - [DataGrid] Fix error when initializing aggregation with row spanning (#14710) @MBilalShafi
35
+ - [DataGrid] Fix scroll to cell logic for keyboard navigating cells and drag selection with pinned columns (#14550) @KenanYusuf
36
+ - [DataGrid] Support `minHeight` and `maxHeight` on flex parent container (#14614) @cherniavskii
37
+ - [l10n] Add missing Portuguese (pt-PT) translations (#14707) @ruiaraujo012
38
+ - [l10n] Improve Bulgarian (bg-BG) locale (#14451) @GMchris
39
+ - [l10n] Improve Croatian (hr-HR) locale (#14794) @arminmeh
40
+ - [l10n] Improve French (fr-FR) locale (#14750) @vallereaugabriel
41
+ - [l10n] Improve German (de-DE) locale (#14755) @lhilgert9
42
+ - [l10n] Improve Japanese (ja-JP) locale (#14381) @k725
43
+ - [l10n] Improve Vietnamese (vi-VN) locale (#14769) @chucamphong
44
+
45
+ #### `@mui/x-data-grid-pro@7.19.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
46
+
47
+ Same changes as in `@mui/x-data-grid@7.19.0`, plus:
48
+
49
+ - [DataGridPro] Fix dragging styles removal in column reorder (#14680) @k-rajat19
50
+ - [DataGridPro] Fix row pre-processing running with a stale data source (#14810) @MBilalShafi
51
+ - [DataGridPro] Fix `onRowsScrollEnd` not firing on very fast scrolling (#14171) @arminmeh
52
+
53
+ #### `@mui/x-data-grid-premium@7.19.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
54
+
55
+ Same changes as in `@mui/x-data-grid-pro@7.19.0`, plus:
56
+
57
+ - [DataGridPremium] Automatic parents and children selection (#13757) @MBilalShafi
58
+
59
+ ### Date and Time Pickers
60
+
61
+ #### `@mui/x-date-pickers@7.19.0`
62
+
63
+ - [pickers] Fix left-right keyboard nav with `yearsOrder="desc"` and `direction="rtl"` (#14682) @thomasmoon
64
+ - [pickers] Improve `PickerValidDate` type (#14771) @flaviendelangle
65
+ - [pickers] Improve typing of the range pickers (#14716) @flaviendelangle
66
+ - [l10n] Add Bulgarian (bg-BG) locale (#14469) @GMchris
67
+ - [l10n] Add Croatian (hr-HR) locale (#14795) @arminmeh
68
+ - [l10n] Add Portuguese (pt-PT) locale (#14722) @ruiaraujo012
69
+ - [l10n] Improve Czech (cs-CZ) locale (#14732) @JakubSveda
70
+ - [l10n] Improve Portuguese (pt-BR) locale (#14725) @arthurbalduini
71
+
72
+ #### `@mui/x-date-pickers-pro@7.19.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
73
+
74
+ Same changes as in `@mui/x-date-pickers@7.19.0`.
75
+
76
+ ### Charts
77
+
78
+ #### `@mui/x-charts@7.19.0`
79
+
80
+ - [charts] Fix `LineChart` area animation being stuck when resizing container (#14711) @alexfauquette
81
+ - [charts] Improve types and start using `warnOnce` (#14792) @JCQuintas
82
+
83
+ #### `@mui/x-charts-pro@7.0.0-beta.3` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
84
+
85
+ Same changes as in `@mui/x-charts@7.19.0`.
86
+
87
+ ### Tree View
88
+
89
+ #### `@mui/x-tree-view@7.19.0`
90
+
91
+ - [TreeView] Apply experimental features in `getDefaultizedParams` instead of in the plugin render (#14661) @flaviendelangle
92
+ - [TreeView] Export `publicAPI` form `useTreeItem2Utils` (#14729) @noraleonte
93
+ - [TreeView] Fix cursor navigation interfering with browser shortcut keys (#14798) @sai6855
94
+ - [TreeView] Fix invalid test for items reordering (#14665) @flaviendelangle
95
+ - [TreeView] Remove `instance.getTreeItemIdAttribute` (#14667) @flaviendelangle
96
+
97
+ ### Docs
98
+
99
+ - [docs] Added warning callout for Firefox reordering bug (#14516) @michelengelen
100
+ - [docs] Copyedit `pages.ts` navigation (#14782) @samuelsycamore
101
+ - [docs] Fix typo in row spanning doc (#14770) @flaviendelangle
102
+ - [docs] Fix typo in the Tree View migration guide to v7 (#14727) @Sanderand
103
+ - [docs] Fix typo in usage of Moment guide for UTC and timezones (#14780) @AWAIS97
104
+ - [docs] Fix what's new link to use absolute URL (#14543) @oliviertassinari
105
+
106
+ ### Core
107
+
108
+ - [core] Fix class name composition order (#14775) @oliviertassinari
109
+ - [core] Replace minWidth, maxWidth with width (#14776) @oliviertassinari
110
+ - [code-infra] Remove custom playwright installation steps (#14728) @Janpot
111
+ - [code-infra] Replace or remove all instances of `e` identifier (#14724) @samuelsycamore
112
+ - [infra] Adds community contribution section to the changelog script (#14799) @michelengelen
113
+ - [infra] Fix line break in Stack Overflow message @oliviertassinari
114
+ - [test] Fix `Escape` event firing event (#14797) @oliviertassinari
115
+
116
+ ## 7.18.0
117
+
118
+ _Sep 20, 2024_
119
+
120
+ We'd like to offer a big thanks to the 14 contributors who made this release possible. Here are some highlights ✨:
121
+
122
+ - 💫 Support [Row spanning](https://mui.com/x/react-data-grid/row-spanning/) on the Data Grid that automatically merges the consecutive cells in a column based on the cell value
123
+
124
+ <img width="600" src="https://github.com/user-attachments/assets/d32ec936-d238-4c92-9e1a-af6788d74cdf" alt="data grid row spanning" />
125
+
126
+ - ⏰ Support `date-fns` v4 (#14673) @LukasTy
127
+ - 🎉 Add option for Pickers to change the order of displayed years (#11780) @thomasmoon
128
+ - 🐞 Bugfixes
129
+ - 📚 Documentation improvements
130
+
131
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
132
+
133
+ ### Data Grid
134
+
135
+ #### `@mui/x-data-grid@7.18.0`
136
+
137
+ - [DataGrid] Add default reset value in row edit mode (#14050) @michelengelen
138
+ - [DataGrid] Add `columnGroupHeaderHeight` prop for sizing column group headers (#14637) @KenanYusuf
139
+ - [DataGrid] Fix `document` reference when the grid is rendered in a popup window (#14649) @arminmeh
140
+ - [DataGrid] Remove `minFirstColumn` from `GetHeadersParams` interface (#14450) @k-rajat19
141
+ - [DataGrid] Row spanning (#14124) @MBilalShafi
142
+
143
+ #### `@mui/x-data-grid-pro@7.18.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
144
+
145
+ Same changes as in `@mui/x-data-grid@7.18.0`, plus:
146
+
147
+ - [DataGridPro] Fix `onRowsScrollEnd` being triggered instantly when bottom pinned row is present (#14602) @arminmeh
148
+ - [DataGridPro] Fix header filters rendering issue for `isEmpty` and `isNotEmpty` filter operators (#14493) @k-rajat19
149
+ - [DataGridPro] Fix pinned columns in RTL mode (#14586) @KenanYusuf
150
+
151
+ #### `@mui/x-data-grid-premium@7.18.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
152
+
153
+ Same changes as in `@mui/x-data-grid-pro@7.18.0`.
154
+
155
+ ### Date and Time Pickers
156
+
157
+ #### `@mui/x-date-pickers@7.18.0`
158
+
159
+ - [pickers] Add option to change the order of displayed years (#11780) @thomasmoon
160
+ - [pickers] Support `date-fns` v4 (#14673) @LukasTy
161
+
162
+ #### `@mui/x-date-pickers-pro@7.18.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
163
+
164
+ Same changes as in `@mui/x-date-pickers@7.18.0`.
165
+
166
+ ### Charts
167
+
168
+ #### `@mui/x-charts@7.18.0`
169
+
170
+ - [charts] Add a `PolarProvider` to manage polar axes (#14642) @alexfauquette
171
+ - [charts] Fix `LineChart` animation being stuck with initial drawing area value (#14553) @JCQuintas
172
+ - [charts] Fix legend slot typing (#14657) @alexfauquette
173
+ - [charts] Pass the axis index to extremum getter (#14641) @alexfauquette
174
+ - [charts] Provide hooks to create custom tooltip (#14377) @alexfauquette
175
+
176
+ #### `@mui/x-charts-pro@7.0.0-beta.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
177
+
178
+ Same changes as in `@mui/x-charts@7.18.0`.
179
+
180
+ ### Tree View
181
+
182
+ #### `@mui/x-tree-view@7.18.0`
183
+
184
+ - [TreeView] Add `"use client"` directive to every public component and hook (#14579) @flaviendelangle
185
+
186
+ ### Docs
187
+
188
+ - [docs] Add `groupingValueGetter` callout in column definition docs (#14599) @michelengelen
189
+ - [docs] Clean v6 => v7 migration guide (#14652) @flaviendelangle
190
+ - [docs] Copy `vale-action.yml` from main repo @oliviertassinari
191
+ - [docs] Edit the Pickers Getting started doc (#14555) @samuelsycamore
192
+ - [docs] Fix TypeScript capitalization @oliviertassinari
193
+ - [docs] Fix Vale error @oliviertassinari
194
+ - [docs] Make the migration guide diff a bit easier to read @oliviertassinari
195
+ - [docs] Report Vale at warning level (#14660) @oliviertassinari
196
+ - [docs] Warn about the `valueGetter` and `valueFormatter` signature change (#14613) @cherniavskii
197
+ - [docs] Polish code formatting (#14603) @oliviertassinari
198
+ - [test] Spy on `observe` method to avoid flaky wait for a callback (#14640) @arminmeh
199
+
200
+ ### Core
201
+
202
+ - [core] Fix 301 link to Next.js and git diff @oliviertassinari
203
+ - [core] Fix failing CI on `master` (#14644) @cherniavskii
204
+ - [core] Fix `package.json` repository rule @oliviertassinari
205
+ - [core] MUI X repository moved to a new location @oliviertassinari
206
+ - [docs-infra] Strengthen CSP (#14581) @oliviertassinari
207
+ - [license] Finish renaming of LicensingModel (#14615) @oliviertassinari
208
+
6
209
  ## 7.17.0
7
210
 
8
211
  _Sep 13, 2024_
@@ -75,7 +278,7 @@ Same changes as in `@mui/x-charts@7.17.0`.
75
278
  ### Docs
76
279
 
77
280
  - [docs] Add missing callout on "Imperative API" tree view sections (#14503) @flaviendelangle
78
- - [docs] Fix broken redirection to MUI X v5 @oliviertassinari
281
+ - [docs] Fix broken redirection to MUI X v5 @oliviertassinari
79
282
  - [docs] Fix multiple `console.error` messages on `charts` docs (#14554) @JCQuintas
80
283
  - [docs] Fixed typo in Row Grouping recipes (#14549) @Miodini
81
284
  - [docs] Match title with blog posts @oliviertassinari
@@ -195,7 +398,7 @@ We'd like to offer a big thanks to the 8 contributors who made this release poss
195
398
 
196
399
  - 💫 Support Material UI v6 (`@mui/material@6`) peer dependency (#14142) @cherniavskii
197
400
 
198
- You can now use MUI X components with either v5 or v6 of `@mui/material` package 🎉
401
+ You can now use MUI X components with either v5 or v6 of `@mui/material` package 🎉
199
402
 
200
403
  - 🐞 Bugfixes
201
404
 
@@ -240,7 +443,7 @@ Same changes as in `@mui/x-charts@7.15.0`, plus:
240
443
 
241
444
  - [docs] Fix sentence case `h2` @oliviertassinari
242
445
  - [docs] Clarify contribution guide references @oliviertassinari
243
- - [docs] Fix Stack Overflow issue canned response @oliviertassinari
446
+ - [docs] Fix Stack Overflow issue canned response @oliviertassinari
244
447
  - [docs] Fix outdated link to support page @oliviertassinari
245
448
  - [docs] Fix use of Material UI @oliviertassinari
246
449
  - [docs] Update deprecated props in docs (#14295) @JCQuintas
@@ -498,7 +701,7 @@ The [Pro plan](https://mui.com/x/introduction/licensing/#pro-plan) is receiving
498
701
 
499
702
  As always, every feature released as part of the MIT plan will remain free and MIT licensed forever.
500
703
 
501
- This expansion of the Pro plan comes with some adjustments to our pricing strategy. Learn more about those in the [Upcoming changes to MUI X pricing in 2024](https://mui.com/blog/mui-x-sep-2024-price-update/) blog post.
704
+ This expansion of the Pro plan comes with some adjustments to our pricing strategy. Learn more about those in the [Upcoming changes to MUI X pricing in 2024](https://mui.com/blog/mui-x-sep-2024-price-update/) blog post.
502
705
 
503
706
  ### Highlights
504
707
 
@@ -563,7 +766,7 @@ Same changes as in `@mui/x-date-pickers@7.12.0`.
563
766
  #### `@mui/x-charts@7.12.0`
564
767
 
565
768
  - [charts] Fix incorrect `axisId` prop being allowed in xAxis/yAxis config. Use `id` instead. (#13986) @JCQuintas
566
- - [charts] Use vendor to have Common JS bundle working out of the box (#13608) @alexfauquette
769
+ - [charts] Use vendor to have CommonJS bundle working out of the box (#13608) @alexfauquette
567
770
  - [charts] Divide the `SeriesProvider` to use in filtering (#14026) @JCQuintas
568
771
 
569
772
  ### Tree View
@@ -94,6 +94,11 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
94
94
  /**
95
95
  * If `true`, the Data Grid height is dynamic and follows the number of rows in the Data Grid.
96
96
  * @default false
97
+ * @deprecated Use flex parent container instead: https://mui.com/x/react-data-grid/layout/#flex-parent-container
98
+ * @example
99
+ * <div style={{ display: 'flex', flexDirection: 'column' }}>
100
+ * <DataGrid />
101
+ * </div>
97
102
  */
98
103
  autoHeight: _propTypes.default.bool,
99
104
  /**
@@ -154,6 +159,11 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
154
159
  * @default 150
155
160
  */
156
161
  columnBufferPx: _propTypes.default.number,
162
+ /**
163
+ * Sets the height in pixels of the column group headers in the Data Grid.
164
+ * Inherits the `columnHeaderHeight` value if not set.
165
+ */
166
+ columnGroupHeaderHeight: _propTypes.default.number,
157
167
  columnGroupingModel: _propTypes.default.arrayOf(_propTypes.default.object),
158
168
  /**
159
169
  * Sets the height in pixel of the column headers in the Data Grid.
@@ -409,7 +419,7 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
409
419
  */
410
420
  headerFilterHeight: _propTypes.default.number,
411
421
  /**
412
- * If `true`, enables the data grid filtering on header feature.
422
+ * If `true`, the header filters feature is enabled.
413
423
  * @default false
414
424
  */
415
425
  headerFilters: _propTypes.default.bool,
@@ -943,6 +953,22 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
943
953
  * Sets the row selection model of the Data Grid.
944
954
  */
945
955
  rowSelectionModel: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired), _propTypes.default.number, _propTypes.default.string]),
956
+ /**
957
+ * When `rowSelectionPropagation.descendants` is set to `true`.
958
+ * - Selecting a parent will auto-select all its filtered descendants.
959
+ * - Deselecting a parent will auto-deselect all its filtered descendants.
960
+ *
961
+ * When `rowSelectionPropagation.parents=true`
962
+ * - Selecting all descendants of a parent would auto-select it.
963
+ * - Deselecting a descendant of a selected parent would deselect the parent.
964
+ *
965
+ * Works with tree data and row grouping on the client-side only.
966
+ * @default { parents: false, descendants: false }
967
+ */
968
+ rowSelectionPropagation: _propTypes.default.shape({
969
+ descendants: _propTypes.default.bool,
970
+ parents: _propTypes.default.bool
971
+ }),
946
972
  /**
947
973
  * Loading rows can be processed on the server or client-side.
948
974
  * Set it to 'client' if you would like enable infnite loading.
@@ -1034,7 +1060,12 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
1034
1060
  get: _propTypes.default.func.isRequired,
1035
1061
  set: _propTypes.default.func.isRequired
1036
1062
  }),
1037
- unstable_onDataSourceError: _propTypes.default.func
1063
+ unstable_onDataSourceError: _propTypes.default.func,
1064
+ /**
1065
+ * If `true`, the Data Grid will auto span the cells over the rows having the same value.
1066
+ * @default false
1067
+ */
1068
+ unstable_rowSpanning: _propTypes.default.bool
1038
1069
  } : void 0;
1039
1070
  /**
1040
1071
  * Demos:
@@ -53,6 +53,7 @@ const useDataGridPremiumComponent = (inputApiRef, props) => {
53
53
  (0, _internals.useGridInitializeState)(_internals.sortingStateInitializer, apiRef, props);
54
54
  (0, _internals.useGridInitializeState)(_internals.preferencePanelStateInitializer, apiRef, props);
55
55
  (0, _internals.useGridInitializeState)(_internals.filterStateInitializer, apiRef, props);
56
+ (0, _internals.useGridInitializeState)(_internals.rowSpanningStateInitializer, apiRef, props);
56
57
  (0, _internals.useGridInitializeState)(_internals.densityStateInitializer, apiRef, props);
57
58
  (0, _internals.useGridInitializeState)(_internals.columnReorderStateInitializer, apiRef, props);
58
59
  (0, _internals.useGridInitializeState)(_internals.columnResizeStateInitializer, apiRef, props);
@@ -73,6 +74,7 @@ const useDataGridPremiumComponent = (inputApiRef, props) => {
73
74
  (0, _internals.useGridRowPinning)(apiRef, props);
74
75
  (0, _internals.useGridColumns)(apiRef, props);
75
76
  (0, _internals.useGridRows)(apiRef, props);
77
+ (0, _internals.useGridRowSpanning)(apiRef, props);
76
78
  (0, _internals.useGridParamsApi)(apiRef);
77
79
  (0, _internals.useGridDetailPanel)(apiRef, props);
78
80
  (0, _internals.useGridColumnSpanning)(apiRef);
@@ -6,9 +6,9 @@ export declare const GRID_COLUMN_MENU_SLOTS_PREMIUM: {
6
6
  columnMenuAggregationItem: typeof GridColumnMenuAggregationItem;
7
7
  columnMenuGroupingItem: typeof GridColumnMenuGroupingItem;
8
8
  columnMenuPinningItem: typeof import("@mui/x-data-grid-pro").GridColumnMenuPinningItem;
9
- columnMenuSortItem: typeof import("@mui/x-data-grid-pro").GridColumnMenuSortItem;
10
- columnMenuFilterItem: typeof import("@mui/x-data-grid-pro").GridColumnMenuFilterItem;
11
- columnMenuColumnsItem: typeof import("@mui/x-data-grid-pro").GridColumnMenuColumnsItem;
9
+ columnMenuSortItem: typeof import("@mui/x-data-grid").GridColumnMenuSortItem;
10
+ columnMenuFilterItem: typeof import("@mui/x-data-grid").GridColumnMenuFilterItem;
11
+ columnMenuColumnsItem: typeof import("@mui/x-data-grid").GridColumnMenuColumnsItem;
12
12
  };
13
13
  export declare const GRID_COLUMN_MENU_SLOT_PROPS_PREMIUM: {
14
14
  columnMenuAggregationItem: {
@@ -87,6 +87,11 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
87
87
  /**
88
88
  * If `true`, the Data Grid height is dynamic and follows the number of rows in the Data Grid.
89
89
  * @default false
90
+ * @deprecated Use flex parent container instead: https://mui.com/x/react-data-grid/layout/#flex-parent-container
91
+ * @example
92
+ * <div style={{ display: 'flex', flexDirection: 'column' }}>
93
+ * <DataGrid />
94
+ * </div>
90
95
  */
91
96
  autoHeight: PropTypes.bool,
92
97
  /**
@@ -147,6 +152,11 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
147
152
  * @default 150
148
153
  */
149
154
  columnBufferPx: PropTypes.number,
155
+ /**
156
+ * Sets the height in pixels of the column group headers in the Data Grid.
157
+ * Inherits the `columnHeaderHeight` value if not set.
158
+ */
159
+ columnGroupHeaderHeight: PropTypes.number,
150
160
  columnGroupingModel: PropTypes.arrayOf(PropTypes.object),
151
161
  /**
152
162
  * Sets the height in pixel of the column headers in the Data Grid.
@@ -402,7 +412,7 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
402
412
  */
403
413
  headerFilterHeight: PropTypes.number,
404
414
  /**
405
- * If `true`, enables the data grid filtering on header feature.
415
+ * If `true`, the header filters feature is enabled.
406
416
  * @default false
407
417
  */
408
418
  headerFilters: PropTypes.bool,
@@ -936,6 +946,22 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
936
946
  * Sets the row selection model of the Data Grid.
937
947
  */
938
948
  rowSelectionModel: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired), PropTypes.number, PropTypes.string]),
949
+ /**
950
+ * When `rowSelectionPropagation.descendants` is set to `true`.
951
+ * - Selecting a parent will auto-select all its filtered descendants.
952
+ * - Deselecting a parent will auto-deselect all its filtered descendants.
953
+ *
954
+ * When `rowSelectionPropagation.parents=true`
955
+ * - Selecting all descendants of a parent would auto-select it.
956
+ * - Deselecting a descendant of a selected parent would deselect the parent.
957
+ *
958
+ * Works with tree data and row grouping on the client-side only.
959
+ * @default { parents: false, descendants: false }
960
+ */
961
+ rowSelectionPropagation: PropTypes.shape({
962
+ descendants: PropTypes.bool,
963
+ parents: PropTypes.bool
964
+ }),
939
965
  /**
940
966
  * Loading rows can be processed on the server or client-side.
941
967
  * Set it to 'client' if you would like enable infnite loading.
@@ -1027,7 +1053,12 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
1027
1053
  get: PropTypes.func.isRequired,
1028
1054
  set: PropTypes.func.isRequired
1029
1055
  }),
1030
- unstable_onDataSourceError: PropTypes.func
1056
+ unstable_onDataSourceError: PropTypes.func,
1057
+ /**
1058
+ * If `true`, the Data Grid will auto span the cells over the rows having the same value.
1059
+ * @default false
1060
+ */
1061
+ unstable_rowSpanning: PropTypes.bool
1031
1062
  } : void 0;
1032
1063
  /**
1033
1064
  * Demos:
@@ -1,4 +1,4 @@
1
- import { useGridInitialization, useGridInitializeState, useGridClipboard, useGridColumnMenu, useGridColumns, columnsStateInitializer, useGridDensity, useGridCsvExport, useGridPrintExport, useGridFilter, filterStateInitializer, useGridFocus, useGridKeyboardNavigation, useGridPagination, paginationStateInitializer, useGridPreferencesPanel, useGridEditing, editingStateInitializer, useGridRows, useGridRowsPreProcessors, rowsStateInitializer, useGridRowsMeta, useGridParamsApi, useGridRowSelection, useGridSorting, sortingStateInitializer, useGridScroll, useGridEvents, dimensionsStateInitializer, useGridDimensions, useGridStatePersistence, useGridRowSelectionPreProcessors, columnMenuStateInitializer, densityStateInitializer, focusStateInitializer, preferencePanelStateInitializer, rowsMetaStateInitializer, rowSelectionStateInitializer, useGridColumnReorder, columnReorderStateInitializer, useGridColumnResize, columnResizeStateInitializer, useGridTreeData, useGridTreeDataPreProcessors, useGridColumnPinning, columnPinningStateInitializer, useGridColumnPinningPreProcessors, useGridDetailPanel, detailPanelStateInitializer, useGridDetailPanelPreProcessors, useGridInfiniteLoader, useGridColumnSpanning, useGridRowReorder, useGridRowReorderPreProcessors, useGridRowPinning, useGridRowPinningPreProcessors, rowPinningStateInitializer, useGridColumnGrouping, columnGroupsStateInitializer, useGridLazyLoader, useGridLazyLoaderPreProcessors, headerFilteringStateInitializer, useGridHeaderFiltering, virtualizationStateInitializer, useGridVirtualization, useGridDataSourceTreeDataPreProcessors, useGridDataSource, dataSourceStateInitializer } from '@mui/x-data-grid-pro/internals';
1
+ import { useGridInitialization, useGridInitializeState, useGridClipboard, useGridColumnMenu, useGridColumns, columnsStateInitializer, useGridDensity, useGridCsvExport, useGridPrintExport, useGridFilter, filterStateInitializer, useGridFocus, useGridKeyboardNavigation, useGridPagination, paginationStateInitializer, useGridPreferencesPanel, useGridEditing, editingStateInitializer, useGridRows, useGridRowsPreProcessors, rowsStateInitializer, useGridRowsMeta, useGridParamsApi, useGridRowSelection, useGridSorting, sortingStateInitializer, useGridScroll, useGridEvents, dimensionsStateInitializer, useGridDimensions, useGridStatePersistence, useGridRowSelectionPreProcessors, columnMenuStateInitializer, densityStateInitializer, focusStateInitializer, preferencePanelStateInitializer, rowsMetaStateInitializer, rowSelectionStateInitializer, useGridColumnReorder, columnReorderStateInitializer, useGridColumnResize, columnResizeStateInitializer, useGridTreeData, useGridTreeDataPreProcessors, useGridColumnPinning, columnPinningStateInitializer, useGridColumnPinningPreProcessors, useGridDetailPanel, detailPanelStateInitializer, useGridDetailPanelPreProcessors, useGridInfiniteLoader, useGridColumnSpanning, useGridRowReorder, useGridRowReorderPreProcessors, useGridRowPinning, useGridRowPinningPreProcessors, rowPinningStateInitializer, useGridColumnGrouping, columnGroupsStateInitializer, useGridLazyLoader, useGridLazyLoaderPreProcessors, headerFilteringStateInitializer, useGridHeaderFiltering, virtualizationStateInitializer, useGridVirtualization, useGridDataSourceTreeDataPreProcessors, useGridDataSource, dataSourceStateInitializer, useGridRowSpanning, rowSpanningStateInitializer } from '@mui/x-data-grid-pro/internals';
2
2
  // Premium-only features
3
3
  import { useGridAggregation, aggregationStateInitializer } from "../hooks/features/aggregation/useGridAggregation.js";
4
4
  import { useGridAggregationPreProcessors } from "../hooks/features/aggregation/useGridAggregationPreProcessors.js";
@@ -46,6 +46,7 @@ export const useDataGridPremiumComponent = (inputApiRef, props) => {
46
46
  useGridInitializeState(sortingStateInitializer, apiRef, props);
47
47
  useGridInitializeState(preferencePanelStateInitializer, apiRef, props);
48
48
  useGridInitializeState(filterStateInitializer, apiRef, props);
49
+ useGridInitializeState(rowSpanningStateInitializer, apiRef, props);
49
50
  useGridInitializeState(densityStateInitializer, apiRef, props);
50
51
  useGridInitializeState(columnReorderStateInitializer, apiRef, props);
51
52
  useGridInitializeState(columnResizeStateInitializer, apiRef, props);
@@ -66,6 +67,7 @@ export const useDataGridPremiumComponent = (inputApiRef, props) => {
66
67
  useGridRowPinning(apiRef, props);
67
68
  useGridColumns(apiRef, props);
68
69
  useGridRows(apiRef, props);
70
+ useGridRowSpanning(apiRef, props);
69
71
  useGridParamsApi(apiRef);
70
72
  useGridDetailPanel(apiRef, props);
71
73
  useGridColumnSpanning(apiRef);
@@ -169,7 +169,7 @@ export const getAggregationFunctionLabel = ({
169
169
  }
170
170
  try {
171
171
  return apiRef.current.getLocaleText(`aggregationFunctionLabel${capitalize(aggregationRule.aggregationFunctionName)}`);
172
- } catch (e) {
172
+ } catch {
173
173
  return aggregationRule.aggregationFunctionName;
174
174
  }
175
175
  };
@@ -12,8 +12,8 @@ const getAggregationValueWrappedValueGetter = ({
12
12
  getCellAggregationResult
13
13
  }) => {
14
14
  const wrappedValueGetter = (value, row, column, apiRef) => {
15
- const rowId = apiRef.current.getRowId(row);
16
- const cellAggregationResult = getCellAggregationResult(rowId, column.field);
15
+ const rowId = apiRef.current.getRowId?.(row);
16
+ const cellAggregationResult = rowId ? getCellAggregationResult(rowId, column.field) : null;
17
17
  if (cellAggregationResult != null) {
18
18
  return cellAggregationResult?.value ?? null;
19
19
  }
@@ -14,6 +14,7 @@ const AUTO_SCROLL_SENSITIVITY = 50; // The distance from the edge to start scrol
14
14
  const AUTO_SCROLL_SPEED = 20; // The speed to scroll once the mouse enters the sensitivity area
15
15
 
16
16
  export const useGridCellSelection = (apiRef, props) => {
17
+ const hasRootReference = apiRef.current.rootElementRef.current !== null;
17
18
  const visibleRows = useGridVisibleRows(apiRef, props);
18
19
  const cellWithVirtualFocus = React.useRef();
19
20
  const lastMouseDownCell = React.useRef();
@@ -190,9 +191,10 @@ export const useGridCellSelection = (apiRef, props) => {
190
191
  y: mouseY
191
192
  } = mousePosition.current;
192
193
  const {
193
- height,
194
- width
195
- } = dimensions.viewportInnerSize;
194
+ width,
195
+ height: viewportOuterHeight
196
+ } = dimensions.viewportOuterSize;
197
+ const height = viewportOuterHeight - totalHeaderHeight;
196
198
  let deltaX = 0;
197
199
  let deltaY = 0;
198
200
  let factor = 0;
@@ -226,7 +228,7 @@ export const useGridCellSelection = (apiRef, props) => {
226
228
  autoScrollRAF.current = requestAnimationFrame(autoScroll);
227
229
  }
228
230
  autoScroll();
229
- }, [apiRef, dimensions]);
231
+ }, [apiRef, dimensions, totalHeaderHeight]);
230
232
  const handleCellMouseOver = React.useCallback((params, event) => {
231
233
  if (!lastMouseDownCell.current) {
232
234
  return;
@@ -248,9 +250,10 @@ export const useGridCellSelection = (apiRef, props) => {
248
250
  y
249
251
  } = virtualScrollerRect;
250
252
  const {
251
- height,
252
- width
253
- } = dimensions.viewportInnerSize;
253
+ width,
254
+ height: viewportOuterHeight
255
+ } = dimensions.viewportOuterSize;
256
+ const height = viewportOuterHeight - totalHeaderHeight;
254
257
  const mouseX = event.clientX - x;
255
258
  const mouseY = event.clientY - y - totalHeaderHeight;
256
259
  mousePosition.current = {
@@ -368,7 +371,7 @@ export const useGridCellSelection = (apiRef, props) => {
368
371
  const document = ownerDocument(rootRef);
369
372
  document.removeEventListener('mouseup', handleMouseUp);
370
373
  };
371
- }, [apiRef, handleMouseUp, stopAutoScroll]);
374
+ }, [apiRef, hasRootReference, handleMouseUp, stopAutoScroll]);
372
375
  const checkIfCellIsSelected = React.useCallback((isSelected, {
373
376
  id,
374
377
  field
@@ -1,6 +1,6 @@
1
1
  import { ponyfillGlobal } from '@mui/utils';
2
2
  export const getReleaseInfo = () => {
3
- const releaseInfo = "MTcyNjE5NjQwMDAwMA==";
3
+ const releaseInfo = "MTcyNzk4OTIwMDAwMA==";
4
4
  if (process.env.NODE_ENV !== 'production') {
5
5
  // A simple hack to set the value in the test environment (has no build step).
6
6
  // eslint-disable-next-line no-useless-concat
@@ -183,7 +183,7 @@ const getAggregationFunctionLabel = ({
183
183
  }
184
184
  try {
185
185
  return apiRef.current.getLocaleText(`aggregationFunctionLabel${(0, _utils.unstable_capitalize)(aggregationRule.aggregationFunctionName)}`);
186
- } catch (e) {
186
+ } catch {
187
187
  return aggregationRule.aggregationFunctionName;
188
188
  }
189
189
  };
@@ -35,39 +35,40 @@ export declare const unwrapColumnFromAggregation: ({ column, }: {
35
35
  maxWidth?: number;
36
36
  hideable?: boolean;
37
37
  sortable?: boolean;
38
- sortingOrder?: readonly import("@mui/x-data-grid-pro").GridSortDirection[];
38
+ sortingOrder?: readonly import("@mui/x-data-grid").GridSortDirection[];
39
39
  resizable?: boolean;
40
40
  editable?: boolean;
41
41
  groupable?: boolean;
42
42
  pinnable?: boolean;
43
- sortComparator?: import("@mui/x-data-grid-pro").GridComparatorFn<any> | undefined;
44
- getSortComparator?: ((sortDirection: import("@mui/x-data-grid-pro").GridSortDirection) => import("@mui/x-data-grid-pro").GridComparatorFn<any> | undefined) | undefined;
45
- type?: import("@mui/x-data-grid-pro").GridColType;
46
- align?: import("@mui/x-data-grid-pro").GridAlignment;
47
- valueGetter?: import("@mui/x-data-grid-pro").GridValueGetter<import("@mui/x-data-grid-pro").GridValidRowModel, any, any, never> | undefined;
48
- valueSetter?: import("@mui/x-data-grid-pro").GridValueSetter<import("@mui/x-data-grid-pro").GridValidRowModel, any, any> | undefined;
49
- valueFormatter?: import("@mui/x-data-grid-pro").GridValueFormatter<import("@mui/x-data-grid-pro").GridValidRowModel, any, any, never> | undefined;
50
- valueParser?: import("@mui/x-data-grid-pro").GridValueParser<import("@mui/x-data-grid-pro").GridValidRowModel, any, any> | undefined;
51
- cellClassName?: import("@mui/x-data-grid-pro").GridCellClassNamePropType<import("@mui/x-data-grid-pro").GridValidRowModel, any> | undefined;
43
+ sortComparator?: import("@mui/x-data-grid").GridComparatorFn<any> | undefined;
44
+ getSortComparator?: ((sortDirection: import("@mui/x-data-grid").GridSortDirection) => import("@mui/x-data-grid").GridComparatorFn<any> | undefined) | undefined;
45
+ type?: import("@mui/x-data-grid").GridColType;
46
+ align?: import("@mui/x-data-grid").GridAlignment;
47
+ valueGetter?: import("@mui/x-data-grid").GridValueGetter<import("@mui/x-data-grid").GridValidRowModel, any, any, never> | undefined;
48
+ rowSpanValueGetter?: import("@mui/x-data-grid").GridValueGetter<import("@mui/x-data-grid").GridValidRowModel, any, any, never> | undefined;
49
+ valueSetter?: import("@mui/x-data-grid").GridValueSetter<import("@mui/x-data-grid").GridValidRowModel, any, any> | undefined;
50
+ valueFormatter?: import("@mui/x-data-grid").GridValueFormatter<import("@mui/x-data-grid").GridValidRowModel, any, any, never> | undefined;
51
+ valueParser?: import("@mui/x-data-grid").GridValueParser<import("@mui/x-data-grid").GridValidRowModel, any, any> | undefined;
52
+ cellClassName?: import("@mui/x-data-grid").GridCellClassNamePropType<import("@mui/x-data-grid").GridValidRowModel, any> | undefined;
52
53
  display?: "text" | "flex";
53
- renderCell?: ((params: import("@mui/x-data-grid-pro").GridRenderCellParams<import("@mui/x-data-grid-pro").GridValidRowModel, any, any, import("@mui/x-data-grid-pro").GridTreeNodeWithRender>) => React.ReactNode) | undefined;
54
- renderEditCell?: ((params: import("@mui/x-data-grid-pro").GridRenderEditCellParams<import("@mui/x-data-grid-pro").GridValidRowModel, any, any, import("@mui/x-data-grid-pro").GridTreeNodeWithRender>) => React.ReactNode) | undefined;
55
- preProcessEditCellProps?: ((params: import("@mui/x-data-grid-pro").GridPreProcessEditCellProps) => import("@mui/x-data-grid-pro").GridEditCellProps | Promise<import("@mui/x-data-grid-pro").GridEditCellProps>) | undefined;
56
- headerClassName?: import("@mui/x-data-grid-pro").GridColumnHeaderClassNamePropType;
57
- renderHeader?: ((params: import("@mui/x-data-grid-pro").GridColumnHeaderParams<import("@mui/x-data-grid-pro").GridValidRowModel, any, any>) => React.ReactNode) | undefined;
58
- headerAlign?: import("@mui/x-data-grid-pro").GridAlignment;
54
+ renderCell?: ((params: import("@mui/x-data-grid").GridRenderCellParams<import("@mui/x-data-grid").GridValidRowModel, any, any, import("@mui/x-data-grid").GridTreeNodeWithRender>) => React.ReactNode) | undefined;
55
+ renderEditCell?: ((params: import("@mui/x-data-grid").GridRenderEditCellParams<import("@mui/x-data-grid").GridValidRowModel, any, any, import("@mui/x-data-grid").GridTreeNodeWithRender>) => React.ReactNode) | undefined;
56
+ preProcessEditCellProps?: ((params: import("@mui/x-data-grid").GridPreProcessEditCellProps) => import("@mui/x-data-grid").GridEditCellProps | Promise<import("@mui/x-data-grid").GridEditCellProps>) | undefined;
57
+ headerClassName?: import("@mui/x-data-grid").GridColumnHeaderClassNamePropType;
58
+ renderHeader?: ((params: import("@mui/x-data-grid").GridColumnHeaderParams<import("@mui/x-data-grid").GridValidRowModel, any, any>) => React.ReactNode) | undefined;
59
+ headerAlign?: import("@mui/x-data-grid").GridAlignment;
59
60
  hideSortIcons?: boolean;
60
61
  disableColumnMenu?: boolean;
61
62
  filterable?: boolean;
62
- filterOperators?: readonly GridFilterOperator<import("@mui/x-data-grid-pro").GridValidRowModel, any, any>[] | undefined;
63
- getApplyQuickFilterFn?: import("@mui/x-data-grid-pro").GetApplyQuickFilterFn<import("@mui/x-data-grid-pro").GridValidRowModel, any> | undefined;
63
+ filterOperators?: readonly GridFilterOperator<import("@mui/x-data-grid").GridValidRowModel, any, any>[] | undefined;
64
+ getApplyQuickFilterFn?: import("@mui/x-data-grid").GetApplyQuickFilterFn<import("@mui/x-data-grid").GridValidRowModel, any> | undefined;
64
65
  disableReorder?: boolean;
65
66
  disableExport?: boolean;
66
- colSpan?: number | import("@mui/x-data-grid-pro").GridColSpanFn<import("@mui/x-data-grid-pro").GridValidRowModel, any, any> | undefined;
67
+ colSpan?: number | import("@mui/x-data-grid").GridColSpanFn<import("@mui/x-data-grid").GridValidRowModel, any, any> | undefined;
67
68
  renderHeaderFilter?: (params: import("@mui/x-data-grid-pro").GridRenderHeaderFilterProps) => React.ReactNode;
68
69
  aggregable?: boolean;
69
70
  availableAggregationFunctions?: string[];
70
- groupingValueGetter?: import("../../..").GridGroupingValueGetter<import("@mui/x-data-grid-pro").GridValidRowModel> | undefined;
71
- pastedValueParser?: import("../../..").GridPastedValueParser<import("@mui/x-data-grid-pro").GridValidRowModel, any, any> | undefined;
71
+ groupingValueGetter?: import("../../..").GridGroupingValueGetter<import("@mui/x-data-grid").GridValidRowModel> | undefined;
72
+ pastedValueParser?: import("../../..").GridPastedValueParser<import("@mui/x-data-grid").GridValidRowModel, any, any> | undefined;
72
73
  };
73
74
  export {};
@@ -20,8 +20,8 @@ const getAggregationValueWrappedValueGetter = ({
20
20
  getCellAggregationResult
21
21
  }) => {
22
22
  const wrappedValueGetter = (value, row, column, apiRef) => {
23
- const rowId = apiRef.current.getRowId(row);
24
- const cellAggregationResult = getCellAggregationResult(rowId, column.field);
23
+ const rowId = apiRef.current.getRowId?.(row);
24
+ const cellAggregationResult = rowId ? getCellAggregationResult(rowId, column.field) : null;
25
25
  if (cellAggregationResult != null) {
26
26
  return cellAggregationResult?.value ?? null;
27
27
  }
@@ -23,6 +23,7 @@ const AUTO_SCROLL_SENSITIVITY = 50; // The distance from the edge to start scrol
23
23
  const AUTO_SCROLL_SPEED = 20; // The speed to scroll once the mouse enters the sensitivity area
24
24
 
25
25
  const useGridCellSelection = (apiRef, props) => {
26
+ const hasRootReference = apiRef.current.rootElementRef.current !== null;
26
27
  const visibleRows = (0, _internals.useGridVisibleRows)(apiRef, props);
27
28
  const cellWithVirtualFocus = React.useRef();
28
29
  const lastMouseDownCell = React.useRef();
@@ -199,9 +200,10 @@ const useGridCellSelection = (apiRef, props) => {
199
200
  y: mouseY
200
201
  } = mousePosition.current;
201
202
  const {
202
- height,
203
- width
204
- } = dimensions.viewportInnerSize;
203
+ width,
204
+ height: viewportOuterHeight
205
+ } = dimensions.viewportOuterSize;
206
+ const height = viewportOuterHeight - totalHeaderHeight;
205
207
  let deltaX = 0;
206
208
  let deltaY = 0;
207
209
  let factor = 0;
@@ -235,7 +237,7 @@ const useGridCellSelection = (apiRef, props) => {
235
237
  autoScrollRAF.current = requestAnimationFrame(autoScroll);
236
238
  }
237
239
  autoScroll();
238
- }, [apiRef, dimensions]);
240
+ }, [apiRef, dimensions, totalHeaderHeight]);
239
241
  const handleCellMouseOver = React.useCallback((params, event) => {
240
242
  if (!lastMouseDownCell.current) {
241
243
  return;
@@ -257,9 +259,10 @@ const useGridCellSelection = (apiRef, props) => {
257
259
  y
258
260
  } = virtualScrollerRect;
259
261
  const {
260
- height,
261
- width
262
- } = dimensions.viewportInnerSize;
262
+ width,
263
+ height: viewportOuterHeight
264
+ } = dimensions.viewportOuterSize;
265
+ const height = viewportOuterHeight - totalHeaderHeight;
263
266
  const mouseX = event.clientX - x;
264
267
  const mouseY = event.clientY - y - totalHeaderHeight;
265
268
  mousePosition.current = {
@@ -377,7 +380,7 @@ const useGridCellSelection = (apiRef, props) => {
377
380
  const document = (0, _utils.ownerDocument)(rootRef);
378
381
  document.removeEventListener('mouseup', handleMouseUp);
379
382
  };
380
- }, [apiRef, handleMouseUp, stopAutoScroll]);
383
+ }, [apiRef, hasRootReference, handleMouseUp, stopAutoScroll]);
381
384
  const checkIfCellIsSelected = React.useCallback((isSelected, {
382
385
  id,
383
386
  field
@@ -1,3 +1,3 @@
1
1
  import { GridStatePremium } from '../../../models/gridStatePremium';
2
- export declare const gridRowGroupingModelSelector: import("@mui/x-data-grid-pro").OutputSelector<GridStatePremium, import("./gridRowGroupingInterfaces").GridRowGroupingModel>;
3
- export declare const gridRowGroupingSanitizedModelSelector: import("@mui/x-data-grid-pro").OutputSelector<GridStatePremium, string[]>;
2
+ export declare const gridRowGroupingModelSelector: import("@mui/x-data-grid").OutputSelector<GridStatePremium, import("./gridRowGroupingInterfaces").GridRowGroupingModel>;
3
+ export declare const gridRowGroupingSanitizedModelSelector: import("@mui/x-data-grid").OutputSelector<GridStatePremium, string[]>;
@@ -1 +1 @@
1
- export declare const useGridRowAriaAttributes: () => (rowNode: import("@mui/x-data-grid").GridTreeNode, index: number) => import("react").HTMLAttributes<HTMLElement>;
1
+ export declare const useGridRowAriaAttributes: () => (rowNode: import("@mui/x-data-grid").GridTreeNode, index: number) => React.HTMLAttributes<HTMLElement>;
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid-premium v7.17.0
2
+ * @mui/x-data-grid-premium v7.19.0
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -1,6 +1,6 @@
1
1
  declare const materialSlots: {
2
- columnMenuUngroupIcon: import("react").JSXElementConstructor<any>;
3
- columnMenuGroupIcon: import("react").JSXElementConstructor<any>;
4
- columnMenuAggregationIcon: import("react").JSXElementConstructor<any>;
2
+ columnMenuUngroupIcon: React.JSXElementConstructor<any>;
3
+ columnMenuGroupIcon: React.JSXElementConstructor<any>;
4
+ columnMenuAggregationIcon: React.JSXElementConstructor<any>;
5
5
  };
6
6
  export default materialSlots;
@@ -87,6 +87,11 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
87
87
  /**
88
88
  * If `true`, the Data Grid height is dynamic and follows the number of rows in the Data Grid.
89
89
  * @default false
90
+ * @deprecated Use flex parent container instead: https://mui.com/x/react-data-grid/layout/#flex-parent-container
91
+ * @example
92
+ * <div style={{ display: 'flex', flexDirection: 'column' }}>
93
+ * <DataGrid />
94
+ * </div>
90
95
  */
91
96
  autoHeight: PropTypes.bool,
92
97
  /**
@@ -147,6 +152,11 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
147
152
  * @default 150
148
153
  */
149
154
  columnBufferPx: PropTypes.number,
155
+ /**
156
+ * Sets the height in pixels of the column group headers in the Data Grid.
157
+ * Inherits the `columnHeaderHeight` value if not set.
158
+ */
159
+ columnGroupHeaderHeight: PropTypes.number,
150
160
  columnGroupingModel: PropTypes.arrayOf(PropTypes.object),
151
161
  /**
152
162
  * Sets the height in pixel of the column headers in the Data Grid.
@@ -402,7 +412,7 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
402
412
  */
403
413
  headerFilterHeight: PropTypes.number,
404
414
  /**
405
- * If `true`, enables the data grid filtering on header feature.
415
+ * If `true`, the header filters feature is enabled.
406
416
  * @default false
407
417
  */
408
418
  headerFilters: PropTypes.bool,
@@ -936,6 +946,22 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
936
946
  * Sets the row selection model of the Data Grid.
937
947
  */
938
948
  rowSelectionModel: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired), PropTypes.number, PropTypes.string]),
949
+ /**
950
+ * When `rowSelectionPropagation.descendants` is set to `true`.
951
+ * - Selecting a parent will auto-select all its filtered descendants.
952
+ * - Deselecting a parent will auto-deselect all its filtered descendants.
953
+ *
954
+ * When `rowSelectionPropagation.parents=true`
955
+ * - Selecting all descendants of a parent would auto-select it.
956
+ * - Deselecting a descendant of a selected parent would deselect the parent.
957
+ *
958
+ * Works with tree data and row grouping on the client-side only.
959
+ * @default { parents: false, descendants: false }
960
+ */
961
+ rowSelectionPropagation: PropTypes.shape({
962
+ descendants: PropTypes.bool,
963
+ parents: PropTypes.bool
964
+ }),
939
965
  /**
940
966
  * Loading rows can be processed on the server or client-side.
941
967
  * Set it to 'client' if you would like enable infnite loading.
@@ -1027,7 +1053,12 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
1027
1053
  get: PropTypes.func.isRequired,
1028
1054
  set: PropTypes.func.isRequired
1029
1055
  }),
1030
- unstable_onDataSourceError: PropTypes.func
1056
+ unstable_onDataSourceError: PropTypes.func,
1057
+ /**
1058
+ * If `true`, the Data Grid will auto span the cells over the rows having the same value.
1059
+ * @default false
1060
+ */
1061
+ unstable_rowSpanning: PropTypes.bool
1031
1062
  } : void 0;
1032
1063
  /**
1033
1064
  * Demos:
@@ -1,4 +1,4 @@
1
- import { useGridInitialization, useGridInitializeState, useGridClipboard, useGridColumnMenu, useGridColumns, columnsStateInitializer, useGridDensity, useGridCsvExport, useGridPrintExport, useGridFilter, filterStateInitializer, useGridFocus, useGridKeyboardNavigation, useGridPagination, paginationStateInitializer, useGridPreferencesPanel, useGridEditing, editingStateInitializer, useGridRows, useGridRowsPreProcessors, rowsStateInitializer, useGridRowsMeta, useGridParamsApi, useGridRowSelection, useGridSorting, sortingStateInitializer, useGridScroll, useGridEvents, dimensionsStateInitializer, useGridDimensions, useGridStatePersistence, useGridRowSelectionPreProcessors, columnMenuStateInitializer, densityStateInitializer, focusStateInitializer, preferencePanelStateInitializer, rowsMetaStateInitializer, rowSelectionStateInitializer, useGridColumnReorder, columnReorderStateInitializer, useGridColumnResize, columnResizeStateInitializer, useGridTreeData, useGridTreeDataPreProcessors, useGridColumnPinning, columnPinningStateInitializer, useGridColumnPinningPreProcessors, useGridDetailPanel, detailPanelStateInitializer, useGridDetailPanelPreProcessors, useGridInfiniteLoader, useGridColumnSpanning, useGridRowReorder, useGridRowReorderPreProcessors, useGridRowPinning, useGridRowPinningPreProcessors, rowPinningStateInitializer, useGridColumnGrouping, columnGroupsStateInitializer, useGridLazyLoader, useGridLazyLoaderPreProcessors, headerFilteringStateInitializer, useGridHeaderFiltering, virtualizationStateInitializer, useGridVirtualization, useGridDataSourceTreeDataPreProcessors, useGridDataSource, dataSourceStateInitializer } from '@mui/x-data-grid-pro/internals';
1
+ import { useGridInitialization, useGridInitializeState, useGridClipboard, useGridColumnMenu, useGridColumns, columnsStateInitializer, useGridDensity, useGridCsvExport, useGridPrintExport, useGridFilter, filterStateInitializer, useGridFocus, useGridKeyboardNavigation, useGridPagination, paginationStateInitializer, useGridPreferencesPanel, useGridEditing, editingStateInitializer, useGridRows, useGridRowsPreProcessors, rowsStateInitializer, useGridRowsMeta, useGridParamsApi, useGridRowSelection, useGridSorting, sortingStateInitializer, useGridScroll, useGridEvents, dimensionsStateInitializer, useGridDimensions, useGridStatePersistence, useGridRowSelectionPreProcessors, columnMenuStateInitializer, densityStateInitializer, focusStateInitializer, preferencePanelStateInitializer, rowsMetaStateInitializer, rowSelectionStateInitializer, useGridColumnReorder, columnReorderStateInitializer, useGridColumnResize, columnResizeStateInitializer, useGridTreeData, useGridTreeDataPreProcessors, useGridColumnPinning, columnPinningStateInitializer, useGridColumnPinningPreProcessors, useGridDetailPanel, detailPanelStateInitializer, useGridDetailPanelPreProcessors, useGridInfiniteLoader, useGridColumnSpanning, useGridRowReorder, useGridRowReorderPreProcessors, useGridRowPinning, useGridRowPinningPreProcessors, rowPinningStateInitializer, useGridColumnGrouping, columnGroupsStateInitializer, useGridLazyLoader, useGridLazyLoaderPreProcessors, headerFilteringStateInitializer, useGridHeaderFiltering, virtualizationStateInitializer, useGridVirtualization, useGridDataSourceTreeDataPreProcessors, useGridDataSource, dataSourceStateInitializer, useGridRowSpanning, rowSpanningStateInitializer } from '@mui/x-data-grid-pro/internals';
2
2
  // Premium-only features
3
3
  import { useGridAggregation, aggregationStateInitializer } from "../hooks/features/aggregation/useGridAggregation.js";
4
4
  import { useGridAggregationPreProcessors } from "../hooks/features/aggregation/useGridAggregationPreProcessors.js";
@@ -46,6 +46,7 @@ export const useDataGridPremiumComponent = (inputApiRef, props) => {
46
46
  useGridInitializeState(sortingStateInitializer, apiRef, props);
47
47
  useGridInitializeState(preferencePanelStateInitializer, apiRef, props);
48
48
  useGridInitializeState(filterStateInitializer, apiRef, props);
49
+ useGridInitializeState(rowSpanningStateInitializer, apiRef, props);
49
50
  useGridInitializeState(densityStateInitializer, apiRef, props);
50
51
  useGridInitializeState(columnReorderStateInitializer, apiRef, props);
51
52
  useGridInitializeState(columnResizeStateInitializer, apiRef, props);
@@ -66,6 +67,7 @@ export const useDataGridPremiumComponent = (inputApiRef, props) => {
66
67
  useGridRowPinning(apiRef, props);
67
68
  useGridColumns(apiRef, props);
68
69
  useGridRows(apiRef, props);
70
+ useGridRowSpanning(apiRef, props);
69
71
  useGridParamsApi(apiRef);
70
72
  useGridDetailPanel(apiRef, props);
71
73
  useGridColumnSpanning(apiRef);
@@ -169,7 +169,7 @@ export const getAggregationFunctionLabel = ({
169
169
  }
170
170
  try {
171
171
  return apiRef.current.getLocaleText(`aggregationFunctionLabel${capitalize(aggregationRule.aggregationFunctionName)}`);
172
- } catch (e) {
172
+ } catch {
173
173
  return aggregationRule.aggregationFunctionName;
174
174
  }
175
175
  };
@@ -12,8 +12,8 @@ const getAggregationValueWrappedValueGetter = ({
12
12
  getCellAggregationResult
13
13
  }) => {
14
14
  const wrappedValueGetter = (value, row, column, apiRef) => {
15
- const rowId = apiRef.current.getRowId(row);
16
- const cellAggregationResult = getCellAggregationResult(rowId, column.field);
15
+ const rowId = apiRef.current.getRowId?.(row);
16
+ const cellAggregationResult = rowId ? getCellAggregationResult(rowId, column.field) : null;
17
17
  if (cellAggregationResult != null) {
18
18
  return cellAggregationResult?.value ?? null;
19
19
  }
@@ -14,6 +14,7 @@ const AUTO_SCROLL_SENSITIVITY = 50; // The distance from the edge to start scrol
14
14
  const AUTO_SCROLL_SPEED = 20; // The speed to scroll once the mouse enters the sensitivity area
15
15
 
16
16
  export const useGridCellSelection = (apiRef, props) => {
17
+ const hasRootReference = apiRef.current.rootElementRef.current !== null;
17
18
  const visibleRows = useGridVisibleRows(apiRef, props);
18
19
  const cellWithVirtualFocus = React.useRef();
19
20
  const lastMouseDownCell = React.useRef();
@@ -190,9 +191,10 @@ export const useGridCellSelection = (apiRef, props) => {
190
191
  y: mouseY
191
192
  } = mousePosition.current;
192
193
  const {
193
- height,
194
- width
195
- } = dimensions.viewportInnerSize;
194
+ width,
195
+ height: viewportOuterHeight
196
+ } = dimensions.viewportOuterSize;
197
+ const height = viewportOuterHeight - totalHeaderHeight;
196
198
  let deltaX = 0;
197
199
  let deltaY = 0;
198
200
  let factor = 0;
@@ -226,7 +228,7 @@ export const useGridCellSelection = (apiRef, props) => {
226
228
  autoScrollRAF.current = requestAnimationFrame(autoScroll);
227
229
  }
228
230
  autoScroll();
229
- }, [apiRef, dimensions]);
231
+ }, [apiRef, dimensions, totalHeaderHeight]);
230
232
  const handleCellMouseOver = React.useCallback((params, event) => {
231
233
  if (!lastMouseDownCell.current) {
232
234
  return;
@@ -248,9 +250,10 @@ export const useGridCellSelection = (apiRef, props) => {
248
250
  y
249
251
  } = virtualScrollerRect;
250
252
  const {
251
- height,
252
- width
253
- } = dimensions.viewportInnerSize;
253
+ width,
254
+ height: viewportOuterHeight
255
+ } = dimensions.viewportOuterSize;
256
+ const height = viewportOuterHeight - totalHeaderHeight;
254
257
  const mouseX = event.clientX - x;
255
258
  const mouseY = event.clientY - y - totalHeaderHeight;
256
259
  mousePosition.current = {
@@ -368,7 +371,7 @@ export const useGridCellSelection = (apiRef, props) => {
368
371
  const document = ownerDocument(rootRef);
369
372
  document.removeEventListener('mouseup', handleMouseUp);
370
373
  };
371
- }, [apiRef, handleMouseUp, stopAutoScroll]);
374
+ }, [apiRef, hasRootReference, handleMouseUp, stopAutoScroll]);
372
375
  const checkIfCellIsSelected = React.useCallback((isSelected, {
373
376
  id,
374
377
  field
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid-premium v7.17.0
2
+ * @mui/x-data-grid-premium v7.19.0
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -1,6 +1,6 @@
1
1
  import { ponyfillGlobal } from '@mui/utils';
2
2
  export const getReleaseInfo = () => {
3
- const releaseInfo = "MTcyNjE5NjQwMDAwMA==";
3
+ const releaseInfo = "MTcyNzk4OTIwMDAwMA==";
4
4
  if (process.env.NODE_ENV !== 'production') {
5
5
  // A simple hack to set the value in the test environment (has no build step).
6
6
  // eslint-disable-next-line no-useless-concat
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-data-grid-premium",
3
- "version": "7.17.0",
3
+ "version": "7.19.0",
4
4
  "description": "The Premium plan edition of the Data Grid Components (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./index.js",
@@ -29,7 +29,7 @@
29
29
  ],
30
30
  "repository": {
31
31
  "type": "git",
32
- "url": "https://github.com/mui/mui-x.git",
32
+ "url": "git+https://github.com/mui/mui-x.git",
33
33
  "directory": "packages/x-data-grid-premium"
34
34
  },
35
35
  "dependencies": {
@@ -40,10 +40,10 @@
40
40
  "exceljs": "^4.4.0",
41
41
  "prop-types": "^15.8.1",
42
42
  "reselect": "^5.1.1",
43
- "@mui/x-data-grid-pro": "7.17.0",
44
- "@mui/x-internals": "7.17.0",
45
- "@mui/x-data-grid": "7.17.0",
46
- "@mui/x-license": "7.17.0"
43
+ "@mui/x-data-grid": "7.19.0",
44
+ "@mui/x-internals": "7.18.0",
45
+ "@mui/x-data-grid-pro": "7.19.0",
46
+ "@mui/x-license": "7.18.0"
47
47
  },
48
48
  "peerDependencies": {
49
49
  "@emotion/react": "^11.9.0",
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.getReleaseInfo = void 0;
7
7
  var _utils = require("@mui/utils");
8
8
  const getReleaseInfo = () => {
9
- const releaseInfo = "MTcyNjE5NjQwMDAwMA==";
9
+ const releaseInfo = "MTcyNzk4OTIwMDAwMA==";
10
10
  if (process.env.NODE_ENV !== 'production') {
11
11
  // A simple hack to set the value in the test environment (has no build step).
12
12
  // eslint-disable-next-line no-useless-concat