@mui/x-data-grid-pro 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 (85) hide show
  1. package/CHANGELOG.md +175 -0
  2. package/DataGridPro/DataGridPro.js +42 -8
  3. package/DataGridPro/useDataGridProComponent.js +3 -2
  4. package/components/GridDetailPanelToggleCell.js +0 -10
  5. package/components/GridRowReorderCell.js +15 -13
  6. package/components/GridTreeDataGroupingCell.js +0 -10
  7. package/components/headerFiltering/GridHeaderFilterCell.js +2 -3
  8. package/esm/DataGridPro/DataGridPro.js +42 -8
  9. package/esm/DataGridPro/useDataGridProComponent.js +4 -3
  10. package/esm/components/GridDetailPanelToggleCell.js +0 -10
  11. package/esm/components/GridRowReorderCell.js +15 -13
  12. package/esm/components/GridTreeDataGroupingCell.js +0 -10
  13. package/esm/components/headerFiltering/GridHeaderFilterCell.js +2 -3
  14. package/esm/hooks/features/columnPinning/useGridColumnPinningPreProcessors.js +4 -0
  15. package/esm/hooks/features/dataSource/useGridDataSourceBasePro.js +1 -1
  16. package/esm/hooks/features/detailPanel/useGridDetailPanel.js +6 -5
  17. package/esm/hooks/features/infiniteLoader/useGridInfiniteLoader.js +4 -4
  18. package/esm/hooks/features/rowReorder/commonReorderConditions.d.ts +30 -0
  19. package/esm/hooks/features/rowReorder/commonReorderConditions.js +78 -0
  20. package/esm/hooks/features/rowReorder/index.d.ts +2 -1
  21. package/esm/hooks/features/rowReorder/index.js +2 -1
  22. package/esm/hooks/features/rowReorder/models.d.ts +17 -0
  23. package/esm/hooks/features/rowReorder/models.js +1 -0
  24. package/esm/hooks/features/rowReorder/reorderExecutor.d.ts +27 -0
  25. package/esm/hooks/features/rowReorder/reorderExecutor.js +29 -0
  26. package/esm/hooks/features/rowReorder/reorderValidator.d.ts +12 -0
  27. package/esm/hooks/features/rowReorder/reorderValidator.js +14 -0
  28. package/esm/hooks/features/rowReorder/types.d.ts +25 -0
  29. package/esm/hooks/features/rowReorder/types.js +1 -0
  30. package/esm/hooks/features/rowReorder/useGridRowReorder.d.ts +1 -1
  31. package/esm/hooks/features/rowReorder/useGridRowReorder.js +171 -82
  32. package/esm/hooks/features/rowReorder/utils.d.ts +82 -0
  33. package/esm/hooks/features/rowReorder/utils.js +259 -0
  34. package/esm/hooks/features/rows/useGridRowsOverridableMethods.d.ts +7 -0
  35. package/esm/hooks/features/rows/useGridRowsOverridableMethods.js +59 -0
  36. package/esm/hooks/features/serverSideLazyLoader/useGridInfiniteLoadingIntersection.js +3 -3
  37. package/esm/hooks/features/treeData/treeDataReorderExecutor.d.ts +11 -0
  38. package/esm/hooks/features/treeData/treeDataReorderExecutor.js +534 -0
  39. package/esm/hooks/features/treeData/treeDataReorderValidator.d.ts +2 -0
  40. package/esm/hooks/features/treeData/treeDataReorderValidator.js +35 -0
  41. package/esm/hooks/features/treeData/useGridTreeData.d.ts +3 -3
  42. package/esm/hooks/features/treeData/useGridTreeData.js +49 -4
  43. package/esm/hooks/features/treeData/utils.d.ts +8 -0
  44. package/esm/hooks/features/treeData/utils.js +96 -0
  45. package/esm/index.js +1 -1
  46. package/esm/internals/index.d.ts +8 -0
  47. package/esm/internals/index.js +6 -0
  48. package/esm/models/dataGridProProps.d.ts +32 -4
  49. package/esm/models/gridRowOrderChangeParams.d.ts +29 -5
  50. package/hooks/features/columnPinning/useGridColumnPinningPreProcessors.js +4 -0
  51. package/hooks/features/dataSource/useGridDataSourceBasePro.js +1 -1
  52. package/hooks/features/detailPanel/useGridDetailPanel.js +5 -4
  53. package/hooks/features/infiniteLoader/useGridInfiniteLoader.js +2 -2
  54. package/hooks/features/rowReorder/commonReorderConditions.d.ts +30 -0
  55. package/hooks/features/rowReorder/commonReorderConditions.js +84 -0
  56. package/hooks/features/rowReorder/index.d.ts +2 -1
  57. package/hooks/features/rowReorder/models.d.ts +17 -0
  58. package/hooks/features/rowReorder/models.js +5 -0
  59. package/hooks/features/rowReorder/reorderExecutor.d.ts +27 -0
  60. package/hooks/features/rowReorder/reorderExecutor.js +37 -0
  61. package/hooks/features/rowReorder/reorderValidator.d.ts +12 -0
  62. package/hooks/features/rowReorder/reorderValidator.js +21 -0
  63. package/hooks/features/rowReorder/types.d.ts +25 -0
  64. package/hooks/features/rowReorder/types.js +5 -0
  65. package/hooks/features/rowReorder/useGridRowReorder.d.ts +1 -1
  66. package/hooks/features/rowReorder/useGridRowReorder.js +169 -80
  67. package/hooks/features/rowReorder/utils.d.ts +82 -0
  68. package/hooks/features/rowReorder/utils.js +286 -0
  69. package/hooks/features/rows/useGridRowsOverridableMethods.d.ts +7 -0
  70. package/hooks/features/rows/useGridRowsOverridableMethods.js +67 -0
  71. package/hooks/features/serverSideLazyLoader/useGridInfiniteLoadingIntersection.js +3 -3
  72. package/hooks/features/treeData/treeDataReorderExecutor.d.ts +11 -0
  73. package/hooks/features/treeData/treeDataReorderExecutor.js +541 -0
  74. package/hooks/features/treeData/treeDataReorderValidator.d.ts +2 -0
  75. package/hooks/features/treeData/treeDataReorderValidator.js +41 -0
  76. package/hooks/features/treeData/useGridTreeData.d.ts +3 -3
  77. package/hooks/features/treeData/useGridTreeData.js +48 -3
  78. package/hooks/features/treeData/utils.d.ts +8 -0
  79. package/hooks/features/treeData/utils.js +109 -0
  80. package/index.js +1 -1
  81. package/internals/index.d.ts +8 -0
  82. package/internals/index.js +53 -1
  83. package/models/dataGridProProps.d.ts +32 -4
  84. package/models/gridRowOrderChangeParams.d.ts +29 -5
  85. package/package.json +4 -4
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 -->
@@ -15,6 +15,7 @@ var _xDataGrid = require("@mui/x-data-grid");
15
15
  var _internals = require("@mui/x-data-grid/internals");
16
16
  var _material = require("@mui/x-data-grid/material");
17
17
  var _forwardRef = require("@mui/x-internals/forwardRef");
18
+ var _useGridRowsOverridableMethods = require("../hooks/features/rows/useGridRowsOverridableMethods");
18
19
  var _useDataGridProComponent = require("./useDataGridProComponent");
19
20
  var _useDataGridProProps = require("./useDataGridProProps");
20
21
  var _propValidation = require("../internals/propValidation");
@@ -26,14 +27,14 @@ const configuration = {
26
27
  useCSSVariables: _material.useMaterialCSSVariables,
27
28
  useGridAriaAttributes: _useGridAriaAttributes.useGridAriaAttributesPro,
28
29
  useGridRowAriaAttributes: _useGridRowAriaAttributes.useGridRowAriaAttributesPro,
29
- useGridRowsOverridableMethods: _internals.useGridRowsOverridableMethods,
30
+ useGridRowsOverridableMethods: _useGridRowsOverridableMethods.useGridRowsOverridableMethods,
30
31
  useGridParamsOverridableMethods: _internals.useGridParamsOverridableMethods,
31
32
  useIsCellEditable: _internals.useIsCellEditable,
32
33
  useCellAggregationResult: () => null,
33
34
  useFilterValueGetter: apiRef => apiRef.current.getRowValue
34
35
  }
35
36
  };
36
- const releaseInfo = "MTc2Mjk5MjAwMDAwMA==";
37
+ const releaseInfo = "MTc2NDExNTIwMDAwMA==";
37
38
  const watermark = /*#__PURE__*/(0, _jsxRuntime.jsx)(_xLicense.Watermark, {
38
39
  packageName: "x-data-grid-pro",
39
40
  releaseInfo: releaseInfo
@@ -90,13 +91,11 @@ DataGridProRaw.propTypes = {
90
91
  */
91
92
  'aria-labelledby': _propTypes.default.string,
92
93
  /**
93
- * If `true`, the Data Grid height is dynamic and follows the number of rows in the Data Grid.
94
+ * If `true`, the Data Grid height is dynamic and takes as much space as it needs to display all rows.
95
+ * Use it instead of a flex parent container approach, if:
96
+ * - you don't need to set a minimum or maximum height for the Data Grid
97
+ * - you want to avoid the scrollbar flickering when the content changes
94
98
  * @default false
95
- * @deprecated Use flex parent container instead: https://mui.com/x/react-data-grid/layout/#flex-parent-container
96
- * @example
97
- * <div style={{ display: 'flex', flexDirection: 'column' }}>
98
- * <DataGrid />
99
- * </div>
100
99
  */
101
100
  autoHeight: _propTypes.default.bool,
102
101
  /**
@@ -470,12 +469,29 @@ DataGridProRaw.propTypes = {
470
469
  * @returns {boolean} A boolean indicating if the group is expanded.
471
470
  */
472
471
  isGroupExpandedByDefault: _propTypes.default.func,
472
+ /**
473
+ * Indicates whether a row is reorderable.
474
+ * @param {object} params With all properties from the row.
475
+ * @param {R} params.row The row model of the row that the current cell belongs to.
476
+ * @param {GridTreeNode} params.rowNode The node of the row that the current cell belongs to.
477
+ * @returns {boolean} A boolean indicating if the row is reorderable.
478
+ */
479
+ isRowReorderable: _propTypes.default.func,
473
480
  /**
474
481
  * Determines if a row can be selected.
475
482
  * @param {GridRowParams} params With all properties from [[GridRowParams]].
476
483
  * @returns {boolean} A boolean indicating if the row is selectable.
477
484
  */
478
485
  isRowSelectable: _propTypes.default.func,
486
+ /**
487
+ * Indicates if a row reorder attempt is valid.
488
+ * Can be used to disable certain row reorder operations based on the context.
489
+ * The internal validation is still applied, preventing unsupported use-cases.
490
+ * Use `isValidRowReorder()` to add additional validation rules to the default ones.
491
+ * @param {ReorderValidationContext} context The context object containing all information about the reorder operation.
492
+ * @returns {boolean} A boolean indicating if the reorder operation should go through.
493
+ */
494
+ isValidRowReorder: _propTypes.default.func,
479
495
  /**
480
496
  * If `true`, moving the mouse pointer outside the grid before releasing the mouse button
481
497
  * in a column re-order action will not cause the column to jump back to its original position.
@@ -992,6 +1008,15 @@ DataGridProRaw.propTypes = {
992
1008
  * @default 80
993
1009
  */
994
1010
  scrollEndThreshold: _propTypes.default.number,
1011
+ /**
1012
+ * Updates the tree path in a row model.
1013
+ * Used when reordering rows across different parents in tree data.
1014
+ * @template R
1015
+ * @param {string[]} path The new path for the row.
1016
+ * @param {R} row The row model to update.
1017
+ * @returns {R} The updated row model with the new path.
1018
+ */
1019
+ setTreeDataPath: _propTypes.default.func,
995
1020
  /**
996
1021
  * If `true`, vertical borders will be displayed between cells.
997
1022
  * @default false
@@ -1039,6 +1064,15 @@ DataGridProRaw.propTypes = {
1039
1064
  * The system prop that allows defining system overrides as well as additional CSS styles.
1040
1065
  */
1041
1066
  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]),
1067
+ /**
1068
+ * Sets the tab navigation behavior for the Data Grid.
1069
+ * - "none": No Data Grid specific tab navigation. Pressing the tab key will move the focus to the next element in the tab sequence.
1070
+ * - "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.
1071
+ * - "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.
1072
+ * - "all": Combines the "content" and "header" behavior.
1073
+ * @default "none"
1074
+ */
1075
+ tabNavigation: _propTypes.default.oneOf(['all', 'content', 'header', 'none']),
1042
1076
  /**
1043
1077
  * If positive, the Data Grid will throttle updates coming from `apiRef.current.updateRows` and `apiRef.current.setRows`.
1044
1078
  * 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.
@@ -79,7 +79,6 @@ const useDataGridProComponent = (apiRef, props, configuration) => {
79
79
  (0, _internals.useGridInitializeState)(_internals.dimensionsStateInitializer, apiRef, props);
80
80
  (0, _internals.useGridInitializeState)(_internals.rowsMetaStateInitializer, apiRef, props);
81
81
  (0, _internals.useGridInitializeState)(_internals.listViewStateInitializer, apiRef, props);
82
- (0, _internals.useGridVirtualizer)(apiRef, props);
83
82
  (0, _internals.useGridHeaderFiltering)(apiRef, props);
84
83
  (0, _useGridTreeData.useGridTreeData)(apiRef, props);
85
84
  (0, _internals.useGridKeyboardNavigation)(apiRef, props);
@@ -102,7 +101,6 @@ const useDataGridProComponent = (apiRef, props, configuration) => {
102
101
  (0, _useGridColumnReorder.useGridColumnReorder)(apiRef, props);
103
102
  (0, _internals.useGridColumnResize)(apiRef, props);
104
103
  (0, _internals.useGridPagination)(apiRef, props);
105
- (0, _internals.useGridRowsMeta)(apiRef, props);
106
104
  (0, _useGridRowReorder.useGridRowReorder)(apiRef, props);
107
105
  (0, _internals.useGridScroll)(apiRef, props);
108
106
  (0, _useGridInfiniteLoader.useGridInfiniteLoader)(apiRef, props);
@@ -121,6 +119,9 @@ const useDataGridProComponent = (apiRef, props, configuration) => {
121
119
  (0, _internals.useGridListView)(apiRef, props);
122
120
 
123
121
  // Should be the last thing to run, because all pre-processors should have been registered by now.
122
+ (0, _internals.useFirstRender)(() => {
123
+ apiRef.current.runAppliersForPendingProcessors();
124
+ });
124
125
  React.useEffect(() => {
125
126
  apiRef.current.runAppliersForPendingProcessors();
126
127
  });
@@ -83,16 +83,6 @@ process.env.NODE_ENV !== "production" ? GridDetailPanelToggleCell.propTypes = {
83
83
  * The column field of the cell that triggered the event.
84
84
  */
85
85
  field: _propTypes.default.string.isRequired,
86
- /**
87
- * A ref allowing to set imperative focus.
88
- * It can be passed to the element that should receive focus.
89
- * @ignore - do not document.
90
- */
91
- focusElementRef: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.shape({
92
- current: _propTypes.default.shape({
93
- focus: _propTypes.default.func.isRequired
94
- })
95
- })]),
96
86
  /**
97
87
  * The cell value formatted with the column valueFormatter.
98
88
  */
@@ -44,9 +44,21 @@ function GridRowReorderCell(params) {
44
44
  params.row.__reorder__ || (params.rowNode.type === 'group' ? params.rowNode.groupingKey ?? params.id : params.id);
45
45
  const cellRef = React.useRef(null);
46
46
  const listenerNodeRef = React.useRef(null);
47
-
48
- // TODO: remove sortModel and treeData checks once row reorder is compatible
49
- const isDraggable = React.useMemo(() => !!rootProps.rowReordering && !sortModel.length && !rootProps.treeData && Object.keys(editRowsState).length === 0, [rootProps.rowReordering, sortModel, rootProps.treeData, editRowsState]);
47
+ const isRowReorderable = rootProps.isRowReorderable;
48
+ // TODO: remove sortModel check once row reorder is compatible
49
+ const isDraggable = React.useMemo(() => {
50
+ const baseCondition = !!rootProps.rowReordering && !sortModel.length && Object.keys(editRowsState).length === 0;
51
+ if (!baseCondition) {
52
+ return false;
53
+ }
54
+ if (isRowReorderable) {
55
+ return isRowReorderable({
56
+ row: params.row,
57
+ rowNode: params.rowNode
58
+ });
59
+ }
60
+ return true;
61
+ }, [rootProps.rowReordering, isRowReorderable, sortModel, editRowsState, params.row, params.rowNode]);
50
62
  const ownerState = {
51
63
  isDraggable,
52
64
  classes: rootProps.classes
@@ -137,16 +149,6 @@ process.env.NODE_ENV !== "production" ? GridRowReorderCell.propTypes = {
137
149
  * The column field of the cell that triggered the event.
138
150
  */
139
151
  field: _propTypes.default.string.isRequired,
140
- /**
141
- * A ref allowing to set imperative focus.
142
- * It can be passed to the element that should receive focus.
143
- * @ignore - do not document.
144
- */
145
- focusElementRef: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.shape({
146
- current: _propTypes.default.shape({
147
- focus: _propTypes.default.func.isRequired
148
- })
149
- })]),
150
152
  /**
151
153
  * The cell value formatted with the column valueFormatter.
152
154
  */
@@ -88,16 +88,6 @@ process.env.NODE_ENV !== "production" ? GridTreeDataGroupingCell.propTypes = {
88
88
  * The column field of the cell that triggered the event.
89
89
  */
90
90
  field: _propTypes.default.string.isRequired,
91
- /**
92
- * A ref allowing to set imperative focus.
93
- * It can be passed to the element that should receive focus.
94
- * @ignore - do not document.
95
- */
96
- focusElementRef: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.shape({
97
- current: _propTypes.default.shape({
98
- focus: _propTypes.default.func.isRequired
99
- })
100
- })]),
101
91
  /**
102
92
  * The cell value formatted with the column valueFormatter.
103
93
  */
@@ -150,10 +150,9 @@ const GridHeaderFilterCell = (0, _forwardRef.forwardRef)((props, ref) => {
150
150
  focusableElement = inputRef.current;
151
151
  }
152
152
  const elementToFocus = focusableElement || cellRef.current;
153
+ const scrollPosition = apiRef.current.getScrollPosition();
153
154
  elementToFocus?.focus();
154
- if (apiRef.current.columnHeadersContainerRef.current) {
155
- apiRef.current.columnHeadersContainerRef.current.scrollLeft = 0;
156
- }
155
+ apiRef.current.scroll(scrollPosition);
157
156
  }
158
157
  }, [InputComponent, apiRef, hasFocus, isEditing, isMenuOpen]);
159
158
  const onKeyDown = React.useCallback(event => {
@@ -5,9 +5,10 @@ import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import { useLicenseVerifier, Watermark } from '@mui/x-license';
7
7
  import { GridRoot, GridContextProvider } from '@mui/x-data-grid';
8
- import { validateProps, useGridApiInitialization, useGridRowsOverridableMethods, useGridParamsOverridableMethods, useIsCellEditable } from '@mui/x-data-grid/internals';
8
+ import { validateProps, useGridApiInitialization, useGridParamsOverridableMethods, useIsCellEditable } from '@mui/x-data-grid/internals';
9
9
  import { useMaterialCSSVariables } from '@mui/x-data-grid/material';
10
10
  import { forwardRef } from '@mui/x-internals/forwardRef';
11
+ import { useGridRowsOverridableMethods } from "../hooks/features/rows/useGridRowsOverridableMethods.js";
11
12
  import { useDataGridProComponent } from "./useDataGridProComponent.js";
12
13
  import { useDataGridProProps } from "./useDataGridProProps.js";
13
14
  import { propValidatorsDataGridPro } from "../internals/propValidation.js";
@@ -26,7 +27,7 @@ const configuration = {
26
27
  useFilterValueGetter: apiRef => apiRef.current.getRowValue
27
28
  }
28
29
  };
29
- const releaseInfo = "MTc2Mjk5MjAwMDAwMA==";
30
+ const releaseInfo = "MTc2NDExNTIwMDAwMA==";
30
31
  const watermark = /*#__PURE__*/_jsx(Watermark, {
31
32
  packageName: "x-data-grid-pro",
32
33
  releaseInfo: releaseInfo
@@ -83,13 +84,11 @@ DataGridProRaw.propTypes = {
83
84
  */
84
85
  'aria-labelledby': PropTypes.string,
85
86
  /**
86
- * If `true`, the Data Grid height is dynamic and follows the number of rows in the Data Grid.
87
+ * If `true`, the Data Grid height is dynamic and takes as much space as it needs to display all rows.
88
+ * Use it instead of a flex parent container approach, if:
89
+ * - you don't need to set a minimum or maximum height for the Data Grid
90
+ * - you want to avoid the scrollbar flickering when the content changes
87
91
  * @default false
88
- * @deprecated Use flex parent container instead: https://mui.com/x/react-data-grid/layout/#flex-parent-container
89
- * @example
90
- * <div style={{ display: 'flex', flexDirection: 'column' }}>
91
- * <DataGrid />
92
- * </div>
93
92
  */
94
93
  autoHeight: PropTypes.bool,
95
94
  /**
@@ -463,12 +462,29 @@ DataGridProRaw.propTypes = {
463
462
  * @returns {boolean} A boolean indicating if the group is expanded.
464
463
  */
465
464
  isGroupExpandedByDefault: PropTypes.func,
465
+ /**
466
+ * Indicates whether a row is reorderable.
467
+ * @param {object} params With all properties from the row.
468
+ * @param {R} params.row The row model of the row that the current cell belongs to.
469
+ * @param {GridTreeNode} params.rowNode The node of the row that the current cell belongs to.
470
+ * @returns {boolean} A boolean indicating if the row is reorderable.
471
+ */
472
+ isRowReorderable: PropTypes.func,
466
473
  /**
467
474
  * Determines if a row can be selected.
468
475
  * @param {GridRowParams} params With all properties from [[GridRowParams]].
469
476
  * @returns {boolean} A boolean indicating if the row is selectable.
470
477
  */
471
478
  isRowSelectable: PropTypes.func,
479
+ /**
480
+ * Indicates if a row reorder attempt is valid.
481
+ * Can be used to disable certain row reorder operations based on the context.
482
+ * The internal validation is still applied, preventing unsupported use-cases.
483
+ * Use `isValidRowReorder()` to add additional validation rules to the default ones.
484
+ * @param {ReorderValidationContext} context The context object containing all information about the reorder operation.
485
+ * @returns {boolean} A boolean indicating if the reorder operation should go through.
486
+ */
487
+ isValidRowReorder: PropTypes.func,
472
488
  /**
473
489
  * If `true`, moving the mouse pointer outside the grid before releasing the mouse button
474
490
  * in a column re-order action will not cause the column to jump back to its original position.
@@ -985,6 +1001,15 @@ DataGridProRaw.propTypes = {
985
1001
  * @default 80
986
1002
  */
987
1003
  scrollEndThreshold: PropTypes.number,
1004
+ /**
1005
+ * Updates the tree path in a row model.
1006
+ * Used when reordering rows across different parents in tree data.
1007
+ * @template R
1008
+ * @param {string[]} path The new path for the row.
1009
+ * @param {R} row The row model to update.
1010
+ * @returns {R} The updated row model with the new path.
1011
+ */
1012
+ setTreeDataPath: PropTypes.func,
988
1013
  /**
989
1014
  * If `true`, vertical borders will be displayed between cells.
990
1015
  * @default false
@@ -1032,6 +1057,15 @@ DataGridProRaw.propTypes = {
1032
1057
  * The system prop that allows defining system overrides as well as additional CSS styles.
1033
1058
  */
1034
1059
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
1060
+ /**
1061
+ * Sets the tab navigation behavior for the Data Grid.
1062
+ * - "none": No Data Grid specific tab navigation. Pressing the tab key will move the focus to the next element in the tab sequence.
1063
+ * - "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.
1064
+ * - "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.
1065
+ * - "all": Combines the "content" and "header" behavior.
1066
+ * @default "none"
1067
+ */
1068
+ tabNavigation: PropTypes.oneOf(['all', 'content', 'header', 'none']),
1035
1069
  /**
1036
1070
  * If positive, the Data Grid will throttle updates coming from `apiRef.current.updateRows` and `apiRef.current.setRows`.
1037
1071
  * 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.
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
 
3
3
  import * as React from 'react';
4
- 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, useGridColumnSpanning, columnMenuStateInitializer, densityStateInitializer, focusStateInitializer, preferencePanelStateInitializer, rowsMetaStateInitializer, rowSelectionStateInitializer, useGridColumnGrouping, columnGroupsStateInitializer, headerFilteringStateInitializer, useGridHeaderFiltering, virtualizationStateInitializer, useGridVirtualization, useGridColumnResize, columnResizeStateInitializer, useGridRowSpanning, rowSpanningStateInitializer, useGridListView, listViewStateInitializer, propsStateInitializer } from '@mui/x-data-grid/internals';
4
+ 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, useGridColumnSpanning, columnMenuStateInitializer, densityStateInitializer, focusStateInitializer, preferencePanelStateInitializer, rowsMetaStateInitializer, rowSelectionStateInitializer, useGridColumnGrouping, columnGroupsStateInitializer, headerFilteringStateInitializer, useGridHeaderFiltering, virtualizationStateInitializer, useGridVirtualization, useGridColumnResize, columnResizeStateInitializer, useGridRowSpanning, rowSpanningStateInitializer, useGridListView, listViewStateInitializer, propsStateInitializer, useFirstRender } from '@mui/x-data-grid/internals';
5
5
  // Pro-only features
6
6
  import { useGridInfiniteLoader } from "../hooks/features/infiniteLoader/useGridInfiniteLoader.js";
7
7
  import { useGridColumnReorder, columnReorderStateInitializer } from "../hooks/features/columnReorder/useGridColumnReorder.js";
@@ -72,7 +72,6 @@ export const useDataGridProComponent = (apiRef, props, configuration) => {
72
72
  useGridInitializeState(dimensionsStateInitializer, apiRef, props);
73
73
  useGridInitializeState(rowsMetaStateInitializer, apiRef, props);
74
74
  useGridInitializeState(listViewStateInitializer, apiRef, props);
75
- useGridVirtualizer(apiRef, props);
76
75
  useGridHeaderFiltering(apiRef, props);
77
76
  useGridTreeData(apiRef, props);
78
77
  useGridKeyboardNavigation(apiRef, props);
@@ -95,7 +94,6 @@ export const useDataGridProComponent = (apiRef, props, configuration) => {
95
94
  useGridColumnReorder(apiRef, props);
96
95
  useGridColumnResize(apiRef, props);
97
96
  useGridPagination(apiRef, props);
98
- useGridRowsMeta(apiRef, props);
99
97
  useGridRowReorder(apiRef, props);
100
98
  useGridScroll(apiRef, props);
101
99
  useGridInfiniteLoader(apiRef, props);
@@ -114,6 +112,9 @@ export const useDataGridProComponent = (apiRef, props, configuration) => {
114
112
  useGridListView(apiRef, props);
115
113
 
116
114
  // Should be the last thing to run, because all pre-processors should have been registered by now.
115
+ useFirstRender(() => {
116
+ apiRef.current.runAppliersForPendingProcessors();
117
+ });
117
118
  React.useEffect(() => {
118
119
  apiRef.current.runAppliersForPendingProcessors();
119
120
  });
@@ -75,16 +75,6 @@ process.env.NODE_ENV !== "production" ? GridDetailPanelToggleCell.propTypes = {
75
75
  * The column field of the cell that triggered the event.
76
76
  */
77
77
  field: PropTypes.string.isRequired,
78
- /**
79
- * A ref allowing to set imperative focus.
80
- * It can be passed to the element that should receive focus.
81
- * @ignore - do not document.
82
- */
83
- focusElementRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
84
- current: PropTypes.shape({
85
- focus: PropTypes.func.isRequired
86
- })
87
- })]),
88
78
  /**
89
79
  * The cell value formatted with the column valueFormatter.
90
80
  */
@@ -35,9 +35,21 @@ function GridRowReorderCell(params) {
35
35
  params.row.__reorder__ || (params.rowNode.type === 'group' ? params.rowNode.groupingKey ?? params.id : params.id);
36
36
  const cellRef = React.useRef(null);
37
37
  const listenerNodeRef = React.useRef(null);
38
-
39
- // TODO: remove sortModel and treeData checks once row reorder is compatible
40
- const isDraggable = React.useMemo(() => !!rootProps.rowReordering && !sortModel.length && !rootProps.treeData && Object.keys(editRowsState).length === 0, [rootProps.rowReordering, sortModel, rootProps.treeData, editRowsState]);
38
+ const isRowReorderable = rootProps.isRowReorderable;
39
+ // TODO: remove sortModel check once row reorder is compatible
40
+ const isDraggable = React.useMemo(() => {
41
+ const baseCondition = !!rootProps.rowReordering && !sortModel.length && Object.keys(editRowsState).length === 0;
42
+ if (!baseCondition) {
43
+ return false;
44
+ }
45
+ if (isRowReorderable) {
46
+ return isRowReorderable({
47
+ row: params.row,
48
+ rowNode: params.rowNode
49
+ });
50
+ }
51
+ return true;
52
+ }, [rootProps.rowReordering, isRowReorderable, sortModel, editRowsState, params.row, params.rowNode]);
41
53
  const ownerState = {
42
54
  isDraggable,
43
55
  classes: rootProps.classes
@@ -128,16 +140,6 @@ process.env.NODE_ENV !== "production" ? GridRowReorderCell.propTypes = {
128
140
  * The column field of the cell that triggered the event.
129
141
  */
130
142
  field: PropTypes.string.isRequired,
131
- /**
132
- * A ref allowing to set imperative focus.
133
- * It can be passed to the element that should receive focus.
134
- * @ignore - do not document.
135
- */
136
- focusElementRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
137
- current: PropTypes.shape({
138
- focus: PropTypes.func.isRequired
139
- })
140
- })]),
141
143
  /**
142
144
  * The cell value formatted with the column valueFormatter.
143
145
  */
@@ -80,16 +80,6 @@ process.env.NODE_ENV !== "production" ? GridTreeDataGroupingCell.propTypes = {
80
80
  * The column field of the cell that triggered the event.
81
81
  */
82
82
  field: PropTypes.string.isRequired,
83
- /**
84
- * A ref allowing to set imperative focus.
85
- * It can be passed to the element that should receive focus.
86
- * @ignore - do not document.
87
- */
88
- focusElementRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
89
- current: PropTypes.shape({
90
- focus: PropTypes.func.isRequired
91
- })
92
- })]),
93
83
  /**
94
84
  * The cell value formatted with the column valueFormatter.
95
85
  */
@@ -143,10 +143,9 @@ const GridHeaderFilterCell = forwardRef((props, ref) => {
143
143
  focusableElement = inputRef.current;
144
144
  }
145
145
  const elementToFocus = focusableElement || cellRef.current;
146
+ const scrollPosition = apiRef.current.getScrollPosition();
146
147
  elementToFocus?.focus();
147
- if (apiRef.current.columnHeadersContainerRef.current) {
148
- apiRef.current.columnHeadersContainerRef.current.scrollLeft = 0;
149
- }
148
+ apiRef.current.scroll(scrollPosition);
150
149
  }
151
150
  }, [InputComponent, apiRef, hasFocus, isEditing, isMenuOpen]);
152
151
  const onKeyDown = React.useCallback(event => {
@@ -88,6 +88,10 @@ export const useGridColumnPinningPreProcessors = (apiRef, props) => {
88
88
  });
89
89
  apiRef.current.caches.columnPinning.orderedFieldsBeforePinningColumns = newOrderedFieldsBeforePinningColumns;
90
90
  } else {
91
+ if (allPinnedColumns.length === 0) {
92
+ prevAllPinnedColumns.current = allPinnedColumns;
93
+ return columnsState;
94
+ }
91
95
  newOrderedFields = [...columnsState.orderedFields];
92
96
  apiRef.current.caches.columnPinning.orderedFieldsBeforePinningColumns = [...columnsState.orderedFields];
93
97
  }
@@ -134,7 +134,7 @@ export const useGridDataSourceBasePro = (apiRef, props, options = {}) => {
134
134
  params: fetchParams,
135
135
  cause: childrenFetchError
136
136
  }));
137
- } else if (process.env.NODE_ENV !== 'production') {
137
+ } else {
138
138
  warnOnce(['MUI X: A call to `dataSource.getRows()` threw an error which was not handled because `onDataSourceError()` is missing.', 'To handle the error pass a callback to the `onDataSourceError` prop, for example `<DataGrid onDataSourceError={(error) => ...} />`.', 'For more detail, see https://mui.com/x/react-data-grid/server-side-data/#error-handling.'], 'error');
139
139
  }
140
140
  } finally {