@mui/x-data-grid-premium 8.18.0 → 8.20.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 (53) hide show
  1. package/CHANGELOG.md +175 -0
  2. package/DataGridPremium/DataGridPremium.d.ts +1 -1
  3. package/DataGridPremium/DataGridPremium.js +40 -7
  4. package/DataGridPremium/useDataGridPremiumComponent.d.ts +1 -1
  5. package/DataGridPremium/useDataGridPremiumComponent.js +3 -2
  6. package/components/GridFooterCell.js +1 -1
  7. package/esm/DataGridPremium/DataGridPremium.d.ts +1 -1
  8. package/esm/DataGridPremium/DataGridPremium.js +40 -7
  9. package/esm/DataGridPremium/useDataGridPremiumComponent.d.ts +1 -1
  10. package/esm/DataGridPremium/useDataGridPremiumComponent.js +4 -3
  11. package/esm/components/GridFooterCell.js +1 -1
  12. package/esm/hooks/features/aggregation/useGridAggregation.js +38 -17
  13. package/esm/hooks/features/chartsIntegration/useGridChartsIntegration.js +1 -0
  14. package/esm/hooks/features/rowGrouping/useGridRowGrouping.d.ts +1 -1
  15. package/esm/hooks/features/rowGrouping/useGridRowGrouping.js +21 -17
  16. package/esm/hooks/features/rowReorder/operations.d.ts +7 -27
  17. package/esm/hooks/features/rowReorder/operations.js +133 -274
  18. package/esm/hooks/features/rowReorder/rowGroupingReorderExecutor.d.ts +2 -0
  19. package/esm/hooks/features/rowReorder/rowGroupingReorderExecutor.js +3 -0
  20. package/esm/hooks/features/rowReorder/rowGroupingReorderValidator.d.ts +2 -0
  21. package/esm/hooks/features/rowReorder/{reorderValidator.js → rowGroupingReorderValidator.js} +2 -22
  22. package/esm/hooks/features/rows/useGridRowsOverridableMethods.d.ts +3 -3
  23. package/esm/hooks/features/rows/useGridRowsOverridableMethods.js +61 -7
  24. package/esm/index.js +1 -1
  25. package/hooks/features/aggregation/useGridAggregation.js +37 -16
  26. package/hooks/features/chartsIntegration/useGridChartsIntegration.js +1 -0
  27. package/hooks/features/rowGrouping/useGridRowGrouping.d.ts +1 -1
  28. package/hooks/features/rowGrouping/useGridRowGrouping.js +20 -16
  29. package/hooks/features/rowReorder/operations.d.ts +7 -27
  30. package/hooks/features/rowReorder/operations.js +136 -279
  31. package/hooks/features/rowReorder/rowGroupingReorderExecutor.d.ts +2 -0
  32. package/hooks/features/rowReorder/rowGroupingReorderExecutor.js +9 -0
  33. package/hooks/features/rowReorder/rowGroupingReorderValidator.d.ts +2 -0
  34. package/hooks/features/rowReorder/rowGroupingReorderValidator.js +102 -0
  35. package/hooks/features/rows/useGridRowsOverridableMethods.d.ts +3 -3
  36. package/hooks/features/rows/useGridRowsOverridableMethods.js +61 -7
  37. package/index.js +1 -1
  38. package/package.json +6 -6
  39. package/esm/hooks/features/rowReorder/reorderExecutor.d.ts +0 -15
  40. package/esm/hooks/features/rowReorder/reorderExecutor.js +0 -25
  41. package/esm/hooks/features/rowReorder/reorderValidator.d.ts +0 -16
  42. package/esm/hooks/features/rowReorder/types.d.ts +0 -42
  43. package/esm/hooks/features/rowReorder/types.js +0 -1
  44. package/esm/hooks/features/rowReorder/utils.d.ts +0 -127
  45. package/esm/hooks/features/rowReorder/utils.js +0 -343
  46. package/hooks/features/rowReorder/reorderExecutor.d.ts +0 -15
  47. package/hooks/features/rowReorder/reorderExecutor.js +0 -31
  48. package/hooks/features/rowReorder/reorderValidator.d.ts +0 -16
  49. package/hooks/features/rowReorder/reorderValidator.js +0 -122
  50. package/hooks/features/rowReorder/types.d.ts +0 -42
  51. package/hooks/features/rowReorder/types.js +0 -5
  52. package/hooks/features/rowReorder/utils.d.ts +0 -127
  53. package/hooks/features/rowReorder/utils.js +0 -360
package/CHANGELOG.md CHANGED
@@ -5,6 +5,181 @@
5
5
  All notable changes to this project will be documented in this file.
6
6
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
7
7
 
8
+ ## 8.20.0
9
+
10
+ _Nov 26, 2025_
11
+
12
+ We'd like to extend a big thank you to the 8 contributors who made this release possible. Here are some highlights ✨:
13
+
14
+ - 🔃 Data Grid tree data now supports row reordering. See the [Drag-and-drop tree data reordering](https://mui.com/x/react-data-grid/tree-data/#drag-and-drop-tree-data-reordering) section for more details.
15
+ - 🐞 Bugfixes
16
+
17
+ The following team members contributed to this release:
18
+ @alexfauquette, @arminmeh, @bernardobelchior, @cherniavskii, @siriwatknp, @JCQuintas, @MBilalShafi, @prakhargupta1
19
+
20
+ ### Data Grid
21
+
22
+ #### `@mui/x-data-grid@8.20.0`
23
+
24
+ - [DataGrid] Fix RTL virtualization to display columns when viewport width is larger than the grid (#20409) @siriwatknp
25
+ - [DataGrid] Fix row range selection (#20442) @arminmeh
26
+ - [DataGrid] Initialize data grid core packages (#20276) @cherniavskii
27
+ - [DataGrid] Improve accessibility of the sort icon (#20430) @arminmeh
28
+ - [DataGrid] Use `viewport` as a boundary for the `BasePopper` flip (#20311) @arminmeh
29
+
30
+ #### `@mui/x-data-grid-pro@8.20.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
31
+
32
+ Same changes as in `@mui/x-data-grid@8.20.0`, plus:
33
+
34
+ - [DataGridPro] Avoid automatic scroll back to the focused header filter after it leaves the viewport (#20416) @arminmeh
35
+ - [DataGridPro] Tree data row reordering (#19401) @MBilalShafi
36
+
37
+ #### `@mui/x-data-grid-premium@8.20.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
38
+
39
+ Same changes as in `@mui/x-data-grid-pro@8.20.0`.
40
+
41
+ ### Charts
42
+
43
+ #### `@mui/x-charts@8.20.0`
44
+
45
+ - [charts] Fix item tooltip position with node anchor (#20421) @alexfauquette
46
+ - [charts] Fix radar item tooltip closing bug (#20429) @alexfauquette
47
+ - [charts] Move series processing to selector (#20388) @JCQuintas
48
+ - [charts] Prevent pointer out from removing controlled highlight (#20385) @alexfauquette
49
+
50
+ #### `@mui/x-charts-pro@8.20.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
51
+
52
+ Same changes as in `@mui/x-charts@8.20.0`, plus:
53
+
54
+ - [charts-pro] Fix Content-Security-Policy nonce not being correctly set on export (#20395) @bernardobelchior
55
+ - [charts-pro] Improve vertical zoom slider thumb on mobile (#20439) @bernardobelchior
56
+ - [charts-pro] Provide arguments to the `AreaPlotRoot` styled component (#20414) @arminmeh
57
+ - [charts-pro] Remove grid outside the drawing area (#20412) @alexfauquette
58
+
59
+ #### `@mui/x-charts-premium@8.20.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
60
+
61
+ Same changes as in `@mui/x-charts-pro@8.20.0`, plus:
62
+
63
+ - [charts-premium] Add explicit return type to `ChartsRenderer` for better compatibility with React 18 (#20413) @arminmeh
64
+
65
+ ### Docs
66
+
67
+ - [docs] Add `llms.txt` link to the sidebar (#20312) @siriwatknp
68
+ - [docs] Add a line chart demo for the Overview section (#20239) @prakhargupta1
69
+
70
+ ## 8.19.0
71
+
72
+ _Nov 20, 2025_
73
+
74
+ We'd like to extend a big thank you to the 15 contributors who made this release possible. Here are some highlights ✨:
75
+
76
+ - 🔎 Add pan on `wheel` to the charts zoom
77
+ - ⌨️ Allow opt-in to [tab navigation](https://mui.com/x/react-data-grid/accessibility/#tab-navigation) inside the Data Grid.
78
+ - ⚙️ New way of defining [action columns](https://mui.com/x/react-data-grid/column-definition/#ActionsWithModalGrid.tsx) in the Data Grid that makes it easier to keep `columns` prop stable.
79
+ - 🐞 Bugfixes
80
+ - 📚 Documentation improvements
81
+
82
+ Special thanks go out to these community members for their valuable contributions:
83
+ @lauri865, @noobyogi0010, @sai6855
84
+
85
+ The following team members contributed to this release:
86
+ @alexfauquette, @arminmeh, @bernardobelchior, @cherniavskii, @flaviendelangle, @Janpot, @JCQuintas, @mj12albert, @noraleonte, @rita-codes, @siriwatknp, @ZeeshanTamboli
87
+
88
+ ### Data Grid
89
+
90
+ #### `@mui/x-data-grid@8.19.0`
91
+
92
+ - [DataGrid] Add `tabNavigation` prop to control tab navigation in the grid (#20286) @arminmeh
93
+ - [DataGrid] Allow to focus disabled checkbox cells (#19959) @mj12albert
94
+ - [DataGrid] Alternative actions column definition API (#15041) @cherniavskii
95
+ - [DataGrid] Fix failing tests (#20332) @cherniavskii
96
+ - [DataGrid] Prevent Safari 26 error in the event handler (#20369) @arminmeh
97
+ - [DataGrid] Undeprecate the `autoHeight` prop (#20363) @cherniavskii
98
+ - [DataGrid] Fix print export grid dimensions with dynamic row height and print styles (#19835) @cherniavskii
99
+
100
+ #### `@mui/x-data-grid-pro@8.19.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
101
+
102
+ Same changes as in `@mui/x-data-grid@8.19.0`.
103
+
104
+ #### `@mui/x-data-grid-premium@8.19.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
105
+
106
+ Same changes as in `@mui/x-data-grid-pro@8.19.0`, plus:
107
+
108
+ - [DataGridPremium] Fix aggregation with sorting (#19892) @lauri865
109
+ - [DataGridPremium] Lock `ExcelJS` version (#20329) @cherniavskii
110
+
111
+ ### Date and Time Pickers
112
+
113
+ #### `@mui/x-date-pickers@8.19.0`
114
+
115
+ - [pickers] Do not loose `slotProps.field.slotProps` (#20322) @flaviendelangle
116
+
117
+ #### `@mui/x-date-pickers-pro@8.19.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
118
+
119
+ Same changes as in `@mui/x-date-pickers@8.19.0`.
120
+
121
+ ### Charts
122
+
123
+ #### `@mui/x-charts@8.19.0`
124
+
125
+ - [charts] Expose `niceDomain` utility (#20250) @bernardobelchior
126
+ - [charts] Fix benchmark regression by downgrading to JSDOM v26 (#20405) @bernardobelchior
127
+ - [charts] Fix Pie Chart keyboard focus highlight (#20358) @JCQuintas
128
+ - [charts] Memoize series selectors (#20326) @JCQuintas
129
+ - [charts] Relax dataset type (#20294) @bernardobelchior
130
+ - [charts] Remove `touch-action: pan-y` when zoom is disabled (#20204) @bernardobelchior
131
+ - [charts] Use `getBBox()` for correct SVG sizes in firefox (#20309) @JCQuintas
132
+ - [charts] Use directly selector from `@mui/x-internals` (#20365) @alexfauquette
133
+ - [charts] Fix unnecessary errors in dev mode (#20380) @JCQuintas
134
+
135
+ #### `@mui/x-charts-pro@8.19.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
136
+
137
+ Same changes as in `@mui/x-charts@8.19.0`, plus:
138
+
139
+ - [charts-pro] Add pan on `wheel` to zoom (#19998) @JCQuintas
140
+ - [charts-pro] Fix zoom slider preview having an opaque background in dark mode (#20367) @bernardobelchior
141
+
142
+ #### `@mui/x-charts-premium@8.19.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
143
+
144
+ Same changes as in `@mui/x-charts-pro@8.19.0`.
145
+
146
+ ### Tree View
147
+
148
+ #### `@mui/x-tree-view@8.19.0`
149
+
150
+ - [tree view] Enable lazy load when children count is not know in tree view (#18680) @noobyogi0010
151
+ - [tree view] Fix unwanted behaviors on the item re-ordering (#20368) @flaviendelangle
152
+
153
+ #### `@mui/x-tree-view-pro@8.19.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
154
+
155
+ Same changes as in `@mui/x-tree-view@8.19.0`.
156
+
157
+ ### Codemod
158
+
159
+ #### `@mui/x-codemod@8.19.0`
160
+
161
+ Internal changes.
162
+
163
+ ### Docs
164
+
165
+ - [docs] Add minimum Typescript version to migration guide (#20320) @siriwatknp
166
+ - [docs] Fix Autosizing documentation (#20348) @siriwatknp
167
+ - [docs] Fix separator opacity in demo (#20293) @sai6855
168
+ - [docs] Replace deprecated `LoadingButton` with `Button` component (#20208) @Janpot
169
+
170
+ ### Core
171
+
172
+ - [code-infra] Add new broken links checker (#20120) @Janpot
173
+ - [code-infra] Disable Codspeed pipeline (#20370) @JCQuintas
174
+ - [code-infra] Optimize `checkMaterialVersion` (#20307) @Janpot
175
+ - [code-infra] Use utils from code-infra for changelog and PR creation (#20406) @brijeshb42
176
+ - [docs-infra] Revert `@docsearch/react` (#20313) @Janpot
177
+
178
+ ### Miscellaneous
179
+
180
+ - [test] Fix browser tests skipping some projects (#20318) @cherniavskii
181
+ - [test] Update `use-react-version` pnpm script (#20319) @cherniavskii
182
+
8
183
  ## 8.18.0
9
184
 
10
185
  <!-- generated comparing v8.17.0..master -->
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { GridValidRowModel } from '@mui/x-data-grid-pro';
2
+ import { type GridValidRowModel } from '@mui/x-data-grid-pro';
3
3
  import { DataGridPremiumProps } from "../models/dataGridPremiumProps.js";
4
4
  export type { GridPremiumSlotsComponent as GridSlots } from "../models/index.js";
5
5
  interface DataGridPremiumComponent {
@@ -50,7 +50,7 @@ const configuration = {
50
50
  useGridParamsOverridableMethods: _useGridParamsOverridableMethods.useGridParamsOverridableMethods
51
51
  }
52
52
  };
53
- const releaseInfo = "MTc2Mjk5MjAwMDAwMA==";
53
+ const releaseInfo = "MTc2NDExNTIwMDAwMA==";
54
54
  const watermark = /*#__PURE__*/(0, _jsxRuntime.jsx)(_xLicense.Watermark, {
55
55
  packageName: "x-data-grid-premium",
56
56
  releaseInfo: releaseInfo
@@ -168,13 +168,11 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
168
168
  */
169
169
  'aria-labelledby': _propTypes.default.string,
170
170
  /**
171
- * If `true`, the Data Grid height is dynamic and follows the number of rows in the Data Grid.
171
+ * If `true`, the Data Grid height is dynamic and takes as much space as it needs to display all rows.
172
+ * Use it instead of a flex parent container approach, if:
173
+ * - you don't need to set a minimum or maximum height for the Data Grid
174
+ * - you want to avoid the scrollbar flickering when the content changes
172
175
  * @default false
173
- * @deprecated Use flex parent container instead: https://mui.com/x/react-data-grid/layout/#flex-parent-container
174
- * @example
175
- * <div style={{ display: 'flex', flexDirection: 'column' }}>
176
- * <DataGrid />
177
- * </div>
178
176
  */
179
177
  autoHeight: _propTypes.default.bool,
180
178
  /**
@@ -600,12 +598,29 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
600
598
  * @returns {boolean} A boolean indicating if the group is expanded.
601
599
  */
602
600
  isGroupExpandedByDefault: _propTypes.default.func,
601
+ /**
602
+ * Indicates whether a row is reorderable.
603
+ * @param {object} params With all properties from the row.
604
+ * @param {R} params.row The row model of the row that the current cell belongs to.
605
+ * @param {GridTreeNode} params.rowNode The node of the row that the current cell belongs to.
606
+ * @returns {boolean} A boolean indicating if the row is reorderable.
607
+ */
608
+ isRowReorderable: _propTypes.default.func,
603
609
  /**
604
610
  * Determines if a row can be selected.
605
611
  * @param {GridRowParams} params With all properties from [[GridRowParams]].
606
612
  * @returns {boolean} A boolean indicating if the row is selectable.
607
613
  */
608
614
  isRowSelectable: _propTypes.default.func,
615
+ /**
616
+ * Indicates if a row reorder attempt is valid.
617
+ * Can be used to disable certain row reorder operations based on the context.
618
+ * The internal validation is still applied, preventing unsupported use-cases.
619
+ * Use `isValidRowReorder()` to add additional validation rules to the default ones.
620
+ * @param {ReorderValidationContext} context The context object containing all information about the reorder operation.
621
+ * @returns {boolean} A boolean indicating if the reorder operation should go through.
622
+ */
623
+ isValidRowReorder: _propTypes.default.func,
609
624
  /**
610
625
  * If `true`, moving the mouse pointer outside the grid before releasing the mouse button
611
626
  * in a column re-order action will not cause the column to jump back to its original position.
@@ -1276,6 +1291,15 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
1276
1291
  * @default 80
1277
1292
  */
1278
1293
  scrollEndThreshold: _propTypes.default.number,
1294
+ /**
1295
+ * Updates the tree path in a row model.
1296
+ * Used when reordering rows across different parents in tree data.
1297
+ * @template R
1298
+ * @param {string[]} path The new path for the row.
1299
+ * @param {R} row The row model to update.
1300
+ * @returns {R} The updated row model with the new path.
1301
+ */
1302
+ setTreeDataPath: _propTypes.default.func,
1279
1303
  /**
1280
1304
  * If `true`, vertical borders will be displayed between cells.
1281
1305
  * @default false
@@ -1331,6 +1355,15 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
1331
1355
  * The system prop that allows defining system overrides as well as additional CSS styles.
1332
1356
  */
1333
1357
  sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
1358
+ /**
1359
+ * Sets the tab navigation behavior for the Data Grid.
1360
+ * - "none": No Data Grid specific tab navigation. Pressing the tab key will move the focus to the next element in the tab sequence.
1361
+ * - "content": Pressing the tab key will move the focus to the next cell in the same row or the first cell in the next row. Shift+Tab will move the focus to the previous cell in the same row or the last cell in the previous row. Tab navigation is not enabled for the header.
1362
+ * - "header": Pressing the tab key will move the focus to the next column group, column header or header filter. Shift+Tab will move the focus to the previous column group, column header or header filter. Tab navigation is not enabled for the content.
1363
+ * - "all": Combines the "content" and "header" behavior.
1364
+ * @default "none"
1365
+ */
1366
+ tabNavigation: _propTypes.default.oneOf(['all', 'content', 'header', 'none']),
1334
1367
  /**
1335
1368
  * If positive, the Data Grid will throttle updates coming from `apiRef.current.updateRows` and `apiRef.current.setRows`.
1336
1369
  * It can be useful if you have a high update rate but do not want to do heavy work like filtering / sorting or rendering on each individual update.
@@ -2,4 +2,4 @@ import { RefObject } from '@mui/x-internals/types';
2
2
  import { type GridConfiguration } from '@mui/x-data-grid-pro/internals';
3
3
  import { GridPrivateApiPremium } from "../models/gridApiPremium.js";
4
4
  import { DataGridPremiumProcessedProps } from "../models/dataGridPremiumProps.js";
5
- export declare const useDataGridPremiumComponent: (apiRef: RefObject<GridPrivateApiPremium>, inProps: DataGridPremiumProcessedProps, configuration: GridConfiguration<GridPrivateApiPremium, DataGridPremiumProcessedProps>) => DataGridPremiumProcessedProps;
5
+ export declare const useDataGridPremiumComponent: (apiRef: RefObject<GridPrivateApiPremium>, inProps: DataGridPremiumProcessedProps, configuration: GridConfiguration) => DataGridPremiumProcessedProps;
@@ -100,7 +100,6 @@ const useDataGridPremiumComponent = (apiRef, inProps, configuration) => {
100
100
  (0, _internals.useGridInitializeState)(_internals.listViewStateInitializer, apiRef, props);
101
101
  (0, _internals.useGridInitializeState)(_useGridAiAssistant.aiAssistantStateInitializer, apiRef, props);
102
102
  (0, _internals.useGridInitializeState)(_useGridChartsIntegration.chartsIntegrationStateInitializer, apiRef, props);
103
- (0, _internals.useGridVirtualizer)(apiRef, props);
104
103
  (0, _useGridSidebar.useGridSidebar)(apiRef, props);
105
104
  (0, _useGridPivoting.useGridPivoting)(apiRef, props, inProps.columns, inProps.rows);
106
105
  (0, _useGridRowGrouping.useGridRowGrouping)(apiRef, props);
@@ -129,7 +128,6 @@ const useDataGridPremiumComponent = (apiRef, inProps, configuration) => {
129
128
  (0, _internals.useGridColumnReorder)(apiRef, props);
130
129
  (0, _internals.useGridColumnResize)(apiRef, props);
131
130
  (0, _internals.useGridPagination)(apiRef, props);
132
- (0, _internals.useGridRowsMeta)(apiRef, props);
133
131
  (0, _internals.useGridRowReorder)(apiRef, props);
134
132
  (0, _internals.useGridScroll)(apiRef, props);
135
133
  (0, _internals.useGridInfiniteLoader)(apiRef, props);
@@ -152,6 +150,9 @@ const useDataGridPremiumComponent = (apiRef, inProps, configuration) => {
152
150
  (0, _useGridPivoting.useGridPivotingExportState)(apiRef);
153
151
 
154
152
  // Should be the last thing to run, because all pre-processors should have been registered by now.
153
+ (0, _internals.useFirstRender)(() => {
154
+ apiRef.current.runAppliersForPendingProcessors();
155
+ });
155
156
  React.useEffect(() => {
156
157
  apiRef.current.runAppliersForPendingProcessors();
157
158
  });
@@ -13,7 +13,7 @@ var _styles = require("@mui/material/styles");
13
13
  var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
14
14
  var _useGridRootProps = require("../hooks/utils/useGridRootProps");
15
15
  var _jsxRuntime = require("react/jsx-runtime");
16
- const _excluded = ["formattedValue", "colDef", "cellMode", "row", "api", "id", "value", "rowNode", "field", "focusElementRef", "hasFocus", "tabIndex", "isEditable"];
16
+ const _excluded = ["formattedValue", "colDef", "cellMode", "row", "api", "id", "value", "rowNode", "field", "hasFocus", "tabIndex", "isEditable"];
17
17
  const GridFooterCellRoot = (0, _styles.styled)('div', {
18
18
  name: 'MuiDataGrid',
19
19
  slot: 'FooterCell'
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { GridValidRowModel } from '@mui/x-data-grid-pro';
2
+ import { type GridValidRowModel } from '@mui/x-data-grid-pro';
3
3
  import { DataGridPremiumProps } from "../models/dataGridPremiumProps.js";
4
4
  export type { GridPremiumSlotsComponent as GridSlots } from "../models/index.js";
5
5
  interface DataGridPremiumComponent {
@@ -43,7 +43,7 @@ const configuration = {
43
43
  useGridParamsOverridableMethods
44
44
  }
45
45
  };
46
- const releaseInfo = "MTc2Mjk5MjAwMDAwMA==";
46
+ const releaseInfo = "MTc2NDExNTIwMDAwMA==";
47
47
  const watermark = /*#__PURE__*/_jsx(Watermark, {
48
48
  packageName: "x-data-grid-premium",
49
49
  releaseInfo: releaseInfo
@@ -161,13 +161,11 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
161
161
  */
162
162
  'aria-labelledby': PropTypes.string,
163
163
  /**
164
- * If `true`, the Data Grid height is dynamic and follows the number of rows in the Data Grid.
164
+ * If `true`, the Data Grid height is dynamic and takes as much space as it needs to display all rows.
165
+ * Use it instead of a flex parent container approach, if:
166
+ * - you don't need to set a minimum or maximum height for the Data Grid
167
+ * - you want to avoid the scrollbar flickering when the content changes
165
168
  * @default false
166
- * @deprecated Use flex parent container instead: https://mui.com/x/react-data-grid/layout/#flex-parent-container
167
- * @example
168
- * <div style={{ display: 'flex', flexDirection: 'column' }}>
169
- * <DataGrid />
170
- * </div>
171
169
  */
172
170
  autoHeight: PropTypes.bool,
173
171
  /**
@@ -593,12 +591,29 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
593
591
  * @returns {boolean} A boolean indicating if the group is expanded.
594
592
  */
595
593
  isGroupExpandedByDefault: PropTypes.func,
594
+ /**
595
+ * Indicates whether a row is reorderable.
596
+ * @param {object} params With all properties from the row.
597
+ * @param {R} params.row The row model of the row that the current cell belongs to.
598
+ * @param {GridTreeNode} params.rowNode The node of the row that the current cell belongs to.
599
+ * @returns {boolean} A boolean indicating if the row is reorderable.
600
+ */
601
+ isRowReorderable: PropTypes.func,
596
602
  /**
597
603
  * Determines if a row can be selected.
598
604
  * @param {GridRowParams} params With all properties from [[GridRowParams]].
599
605
  * @returns {boolean} A boolean indicating if the row is selectable.
600
606
  */
601
607
  isRowSelectable: PropTypes.func,
608
+ /**
609
+ * Indicates if a row reorder attempt is valid.
610
+ * Can be used to disable certain row reorder operations based on the context.
611
+ * The internal validation is still applied, preventing unsupported use-cases.
612
+ * Use `isValidRowReorder()` to add additional validation rules to the default ones.
613
+ * @param {ReorderValidationContext} context The context object containing all information about the reorder operation.
614
+ * @returns {boolean} A boolean indicating if the reorder operation should go through.
615
+ */
616
+ isValidRowReorder: PropTypes.func,
602
617
  /**
603
618
  * If `true`, moving the mouse pointer outside the grid before releasing the mouse button
604
619
  * in a column re-order action will not cause the column to jump back to its original position.
@@ -1269,6 +1284,15 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
1269
1284
  * @default 80
1270
1285
  */
1271
1286
  scrollEndThreshold: PropTypes.number,
1287
+ /**
1288
+ * Updates the tree path in a row model.
1289
+ * Used when reordering rows across different parents in tree data.
1290
+ * @template R
1291
+ * @param {string[]} path The new path for the row.
1292
+ * @param {R} row The row model to update.
1293
+ * @returns {R} The updated row model with the new path.
1294
+ */
1295
+ setTreeDataPath: PropTypes.func,
1272
1296
  /**
1273
1297
  * If `true`, vertical borders will be displayed between cells.
1274
1298
  * @default false
@@ -1324,6 +1348,15 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
1324
1348
  * The system prop that allows defining system overrides as well as additional CSS styles.
1325
1349
  */
1326
1350
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
1351
+ /**
1352
+ * Sets the tab navigation behavior for the Data Grid.
1353
+ * - "none": No Data Grid specific tab navigation. Pressing the tab key will move the focus to the next element in the tab sequence.
1354
+ * - "content": Pressing the tab key will move the focus to the next cell in the same row or the first cell in the next row. Shift+Tab will move the focus to the previous cell in the same row or the last cell in the previous row. Tab navigation is not enabled for the header.
1355
+ * - "header": Pressing the tab key will move the focus to the next column group, column header or header filter. Shift+Tab will move the focus to the previous column group, column header or header filter. Tab navigation is not enabled for the content.
1356
+ * - "all": Combines the "content" and "header" behavior.
1357
+ * @default "none"
1358
+ */
1359
+ tabNavigation: PropTypes.oneOf(['all', 'content', 'header', 'none']),
1327
1360
  /**
1328
1361
  * If positive, the Data Grid will throttle updates coming from `apiRef.current.updateRows` and `apiRef.current.setRows`.
1329
1362
  * It can be useful if you have a high update rate but do not want to do heavy work like filtering / sorting or rendering on each individual update.
@@ -2,4 +2,4 @@ import { RefObject } from '@mui/x-internals/types';
2
2
  import { type GridConfiguration } from '@mui/x-data-grid-pro/internals';
3
3
  import { GridPrivateApiPremium } from "../models/gridApiPremium.js";
4
4
  import { DataGridPremiumProcessedProps } from "../models/dataGridPremiumProps.js";
5
- export declare const useDataGridPremiumComponent: (apiRef: RefObject<GridPrivateApiPremium>, inProps: DataGridPremiumProcessedProps, configuration: GridConfiguration<GridPrivateApiPremium, DataGridPremiumProcessedProps>) => DataGridPremiumProcessedProps;
5
+ export declare const useDataGridPremiumComponent: (apiRef: RefObject<GridPrivateApiPremium>, inProps: DataGridPremiumProcessedProps, configuration: GridConfiguration) => DataGridPremiumProcessedProps;
@@ -2,7 +2,7 @@
2
2
 
3
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
4
  import * as React from 'react';
5
- import { useGridInitialization, useGridInitializeState, useGridVirtualizer, 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, useGridDataSourceLazyLoader, useGridInfiniteLoadingIntersection, headerFilteringStateInitializer, useGridHeaderFiltering, virtualizationStateInitializer, useGridVirtualization, useGridDataSourceTreeDataPreProcessors, dataSourceStateInitializer, useGridRowSpanning, rowSpanningStateInitializer, useGridListView, listViewStateInitializer, propsStateInitializer, rowReorderStateInitializer } from '@mui/x-data-grid-pro/internals';
5
+ import { useGridInitialization, useGridInitializeState, useGridClipboard, useGridColumnMenu, useGridColumns, columnsStateInitializer, useGridDensity, useGridCsvExport, useGridPrintExport, useGridFilter, filterStateInitializer, useGridFocus, useGridKeyboardNavigation, useGridPagination, paginationStateInitializer, useGridPreferencesPanel, useGridEditing, editingStateInitializer, useGridRows, useGridRowsPreProcessors, rowsStateInitializer, 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, useGridDataSourceLazyLoader, useGridInfiniteLoadingIntersection, headerFilteringStateInitializer, useGridHeaderFiltering, virtualizationStateInitializer, useGridVirtualization, useGridDataSourceTreeDataPreProcessors, dataSourceStateInitializer, useGridRowSpanning, rowSpanningStateInitializer, useGridListView, listViewStateInitializer, propsStateInitializer, rowReorderStateInitializer, useFirstRender } from '@mui/x-data-grid-pro/internals';
6
6
  import { useGridSelector } from '@mui/x-data-grid-pro';
7
7
  import { useGridDataSourcePremium as useGridDataSource } from "../hooks/features/dataSource/useGridDataSourcePremium.js";
8
8
  // Premium-only features
@@ -92,7 +92,6 @@ export const useDataGridPremiumComponent = (apiRef, inProps, configuration) => {
92
92
  useGridInitializeState(listViewStateInitializer, apiRef, props);
93
93
  useGridInitializeState(aiAssistantStateInitializer, apiRef, props);
94
94
  useGridInitializeState(chartsIntegrationStateInitializer, apiRef, props);
95
- useGridVirtualizer(apiRef, props);
96
95
  useGridSidebar(apiRef, props);
97
96
  useGridPivoting(apiRef, props, inProps.columns, inProps.rows);
98
97
  useGridRowGrouping(apiRef, props);
@@ -121,7 +120,6 @@ export const useDataGridPremiumComponent = (apiRef, inProps, configuration) => {
121
120
  useGridColumnReorder(apiRef, props);
122
121
  useGridColumnResize(apiRef, props);
123
122
  useGridPagination(apiRef, props);
124
- useGridRowsMeta(apiRef, props);
125
123
  useGridRowReorder(apiRef, props);
126
124
  useGridScroll(apiRef, props);
127
125
  useGridInfiniteLoader(apiRef, props);
@@ -144,6 +142,9 @@ export const useDataGridPremiumComponent = (apiRef, inProps, configuration) => {
144
142
  useGridPivotingExportState(apiRef);
145
143
 
146
144
  // Should be the last thing to run, because all pre-processors should have been registered by now.
145
+ useFirstRender(() => {
146
+ apiRef.current.runAppliersForPendingProcessors();
147
+ });
147
148
  React.useEffect(() => {
148
149
  apiRef.current.runAppliersForPendingProcessors();
149
150
  });
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["formattedValue", "colDef", "cellMode", "row", "api", "id", "value", "rowNode", "field", "focusElementRef", "hasFocus", "tabIndex", "isEditable"];
3
+ const _excluded = ["formattedValue", "colDef", "cellMode", "row", "api", "id", "value", "rowNode", "field", "hasFocus", "tabIndex", "isEditable"];
4
4
  import { getDataGridUtilityClass } from '@mui/x-data-grid';
5
5
  import { vars } from '@mui/x-data-grid/internals';
6
6
  import { styled } from '@mui/material/styles';
@@ -3,7 +3,7 @@
3
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
4
  import * as React from 'react';
5
5
  import { isObjectEmpty } from '@mui/x-internals/isObjectEmpty';
6
- import { gridColumnLookupSelector, useGridEvent, useGridApiMethod, useRunOncePerLoop, gridRenderContextSelector, gridVisibleColumnFieldsSelector, gridSortModelSelector } from '@mui/x-data-grid-pro';
6
+ import { gridColumnLookupSelector, useGridEvent, useGridApiMethod, useRunOncePerLoop, gridRenderContextSelector, gridVisibleColumnFieldsSelector, gridSortModelSelector, gridRowMaximumTreeDepthSelector } from '@mui/x-data-grid-pro';
7
7
  import { useGridRegisterPipeProcessor, gridPivotActiveSelector } from '@mui/x-data-grid-pro/internals';
8
8
  import { gridAggregationLookupSelector, gridAggregationModelSelector } from "./gridAggregationSelectors.js";
9
9
  import { getAggregationRules, mergeStateWithAggregationModel, areAggregationRulesEqual } from "./gridAggregationUtils.js";
@@ -38,8 +38,8 @@ export const useGridAggregation = (apiRef, props) => {
38
38
  }
39
39
  }, [apiRef]);
40
40
  const abortControllerRef = React.useRef(null);
41
- const applyAggregation = React.useCallback(reason => {
42
- // Abort previous if any
41
+ const applyAggregation = React.useCallback(() => {
42
+ // Abort previous if we're proceeding
43
43
  if (abortControllerRef.current) {
44
44
  abortControllerRef.current.abort();
45
45
  }
@@ -48,19 +48,17 @@ export const useGridAggregation = (apiRef, props) => {
48
48
  const aggregationRules = getAggregationRules(gridColumnLookupSelector(apiRef), gridAggregationModelSelector(apiRef), props.aggregationFunctions, !!props.dataSource);
49
49
  const aggregatedFields = Object.keys(aggregationRules);
50
50
  const currentAggregationLookup = gridAggregationLookupSelector(apiRef);
51
- const needsSorting = shouldApplySorting(aggregationRules, aggregatedFields);
52
- if (reason === 'sort' && !needsSorting) {
53
- // no need to re-apply aggregation on `sortedRowsSet` if sorting is not needed
54
- return;
55
- }
56
51
  const renderContext = gridRenderContextSelector(apiRef);
57
52
  const visibleColumns = gridVisibleColumnFieldsSelector(apiRef);
58
53
  const chunks = [];
54
+ const sortedAggregatedFields = gridSortModelSelector(apiRef).map(s => s.field).filter(field => aggregatedFields.includes(field));
59
55
  const visibleAggregatedFields = visibleColumns.slice(renderContext.firstColumnIndex, renderContext.lastColumnIndex + 1).filter(field => aggregatedFields.includes(field));
56
+ const visibleAggregatedFieldsWithSort = [...visibleAggregatedFields, ...sortedAggregatedFields.filter(field => !visibleAggregatedFields.includes(field))];
57
+ const hasAggregatedSortedField = gridRowMaximumTreeDepthSelector(apiRef) > 1 && sortedAggregatedFields.length > 0;
60
58
  if (visibleAggregatedFields.length > 0) {
61
- chunks.push(visibleAggregatedFields);
59
+ chunks.push(visibleAggregatedFieldsWithSort);
62
60
  }
63
- const otherAggregatedFields = aggregatedFields.filter(field => !visibleAggregatedFields.includes(field));
61
+ const otherAggregatedFields = aggregatedFields.filter(field => !visibleAggregatedFieldsWithSort.includes(field));
64
62
  const chunkSize = 20; // columns per chunk
65
63
  for (let i = 0; i < otherAggregatedFields.length; i += chunkSize) {
66
64
  chunks.push(otherAggregatedFields.slice(i, i + chunkSize));
@@ -75,11 +73,7 @@ export const useGridAggregation = (apiRef, props) => {
75
73
  }
76
74
  const currentChunk = chunks[chunkIndex];
77
75
  if (!currentChunk) {
78
- const sortModel = gridSortModelSelector(apiRef).map(s => s.field);
79
- const hasAggregatedSorting = sortModel.some(field => aggregationRules[field]);
80
- if (hasAggregatedSorting) {
81
- apiRef.current.applySorting();
82
- }
76
+ apiRef.current.publishEvent('aggregationLookupSet');
83
77
  abortControllerRef.current = null;
84
78
  return;
85
79
  }
@@ -106,6 +100,9 @@ export const useGridAggregation = (apiRef, props) => {
106
100
  lookup: _extends({}, aggregationLookup)
107
101
  })
108
102
  }));
103
+ if (chunkIndex === 0 && hasAggregatedSortedField) {
104
+ apiRef.current.applySorting();
105
+ }
109
106
  chunkIndex += 1;
110
107
  if (performance.now() - chunkStartTime < timeLimit) {
111
108
  processChunk();
@@ -136,7 +133,9 @@ export const useGridAggregation = (apiRef, props) => {
136
133
  }
137
134
  };
138
135
  }, []);
139
- const deferredApplyAggregation = useRunOncePerLoop(applyAggregation);
136
+ const {
137
+ schedule: deferredApplyAggregation
138
+ } = useRunOncePerLoop(applyAggregation);
140
139
  const aggregationApi = {
141
140
  setAggregationModel
142
141
  };
@@ -177,7 +176,24 @@ export const useGridAggregation = (apiRef, props) => {
177
176
  useGridEvent(apiRef, 'aggregationModelChange', checkAggregationRulesDiff);
178
177
  useGridEvent(apiRef, 'columnsChange', checkAggregationRulesDiff);
179
178
  useGridEvent(apiRef, 'filteredRowsSet', deferredApplyAggregation);
180
- useGridEvent(apiRef, 'sortedRowsSet', () => deferredApplyAggregation('sort'));
179
+ const lastSortModel = React.useRef(gridSortModelSelector(apiRef));
180
+ useGridEvent(apiRef, 'sortedRowsSet', () => {
181
+ const sortModel = gridSortModelSelector(apiRef);
182
+ if (lastSortModel.current === sortModel) {
183
+ return;
184
+ }
185
+ lastSortModel.current = sortModel;
186
+ const aggregationRules = getAggregationRules(gridColumnLookupSelector(apiRef), gridAggregationModelSelector(apiRef), props.aggregationFunctions, !!props.dataSource);
187
+ const aggregatedFields = Object.keys(aggregationRules);
188
+ if (!aggregatedFields.length) {
189
+ return;
190
+ }
191
+ const needsSorting = shouldApplySorting(aggregationRules, aggregatedFields);
192
+ if (!needsSorting) {
193
+ return;
194
+ }
195
+ deferredApplyAggregation();
196
+ });
181
197
 
182
198
  /**
183
199
  * EFFECTS
@@ -187,4 +203,9 @@ export const useGridAggregation = (apiRef, props) => {
187
203
  apiRef.current.setAggregationModel(props.aggregationModel);
188
204
  }
189
205
  }, [apiRef, props.aggregationModel]);
206
+ React.useEffect(() => {
207
+ if (props.getAggregationPosition !== undefined) {
208
+ deferredApplyAggregation();
209
+ }
210
+ }, [deferredApplyAggregation, props.getAggregationPosition]);
190
211
  };
@@ -498,6 +498,7 @@ export const useGridChartsIntegration = (apiRef, props) => {
498
498
  useGridEvent(apiRef, 'pivotModeChange', runIf(isChartsIntegrationAvailable, () => debouncedHandleColumnDataUpdate(syncedChartIds)));
499
499
  useGridEvent(apiRef, 'filteredRowsSet', runIf(isChartsIntegrationAvailable, () => debouncedHandleRowDataUpdate(syncedChartIds)));
500
500
  useGridEvent(apiRef, 'sortedRowsSet', runIf(isChartsIntegrationAvailable, () => debouncedHandleRowDataUpdate(syncedChartIds)));
501
+ useGridEvent(apiRef, 'aggregationLookupSet', runIf(isChartsIntegrationAvailable, () => debouncedHandleRowDataUpdate(syncedChartIds)));
501
502
  const stateExportPreProcessing = React.useCallback((prevState, exportContext) => {
502
503
  if (!props.chartsIntegration || !props.experimentalFeatures?.charts) {
503
504
  return prevState;
@@ -8,4 +8,4 @@ export declare const rowGroupingStateInitializer: GridStateInitializer<Pick<Data
8
8
  * @requires useGridRows (state, method) - can be after, async only
9
9
  * @requires useGridParamsApi (method) - can be after, async only
10
10
  */
11
- export declare const useGridRowGrouping: (apiRef: RefObject<GridPrivateApiPremium>, props: Pick<DataGridPremiumProcessedProps, "initialState" | "rowGroupingModel" | "onRowGroupingModelChange" | "isGroupExpandedByDefault" | "rowGroupingColumnMode" | "disableRowGrouping" | "slotProps" | "slots" | "dataSource" | "treeData">) => void;
11
+ export declare const useGridRowGrouping: (apiRef: RefObject<GridPrivateApiPremium>, props: Pick<DataGridPremiumProcessedProps, "initialState" | "rowGroupingModel" | "onRowGroupingModelChange" | "isGroupExpandedByDefault" | "rowGroupingColumnMode" | "disableRowGrouping" | "slotProps" | "slots" | "dataSource" | "treeData" | "isValidRowReorder">) => void;