@mui/x-data-grid-pro 8.10.2 → 8.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +140 -13
- package/DataGridPro/DataGridPro.js +4 -3
- package/DataGridPro/useDataGridProComponent.d.ts +2 -1
- package/DataGridPro/useDataGridProComponent.js +2 -2
- package/components/GridRowReorderCell.js +4 -4
- package/esm/DataGridPro/DataGridPro.js +5 -4
- package/esm/DataGridPro/useDataGridProComponent.d.ts +2 -1
- package/esm/DataGridPro/useDataGridProComponent.js +2 -2
- package/esm/components/GridRowReorderCell.js +5 -5
- package/esm/hooks/features/columnReorder/useGridColumnReorder.js +19 -0
- package/esm/hooks/features/dataSource/models.d.ts +6 -4
- package/esm/hooks/features/rowReorder/useGridRowReorder.d.ts +3 -3
- package/esm/hooks/features/rowReorder/useGridRowReorder.js +145 -106
- package/esm/index.js +1 -1
- package/hooks/features/columnReorder/useGridColumnReorder.js +19 -0
- package/hooks/features/dataSource/models.d.ts +6 -4
- package/hooks/features/rowReorder/useGridRowReorder.d.ts +3 -3
- package/hooks/features/rowReorder/useGridRowReorder.js +143 -104
- package/index.js +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,127 @@
|
|
|
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.11.0
|
|
9
|
+
|
|
10
|
+
_Aug 29, 2025_
|
|
11
|
+
|
|
12
|
+
We'd like to extend a big thank you to the 19 contributors who made this release possible. Here are some highlights ✨:
|
|
13
|
+
|
|
14
|
+
- 📊 Add new `SankeyChart`
|
|
15
|
+
|
|
16
|
+
<img height="300" alt="Screenshot 2025-07-24 at 12 54 33" src="https://github.com/user-attachments/assets/d77bcec1-044b-48c6-b37d-d7b74793b91c" />
|
|
17
|
+
|
|
18
|
+
- 🚀 Data Grid row grouping now supports row reordering
|
|
19
|
+
|
|
20
|
+
See the [Drag-and-drop group reordering](https://mui.com/x/react-data-grid/row-grouping/#drag-and-drop-group-reordering) section for more details.
|
|
21
|
+
|
|
22
|
+
- 📚 Documentation improvements
|
|
23
|
+
|
|
24
|
+
Special thanks go out to the community members for their valuable contributions:
|
|
25
|
+
@dwrth, @lauri865, @Webini
|
|
26
|
+
|
|
27
|
+
The following are all team members who have contributed to this release:
|
|
28
|
+
@alexfauquette, @arminmeh, @brijeshb42, @cherniavskii, @flaviendelangle, @Janpot, @JCQuintas, @mapache-salvaje, @MBilalShafi, @michelengelen, @noraleonte, @oliviertassinari, @rita-codes, @romgrk, @sai6855, @siriwatknp
|
|
29
|
+
|
|
30
|
+
### Data Grid
|
|
31
|
+
|
|
32
|
+
#### `@mui/x-data-grid@8.11.0`
|
|
33
|
+
|
|
34
|
+
- [DataGrid] Fix focused column header scroll jump (#19323) @lauri865
|
|
35
|
+
- [DataGrid] Bring `columnUnsortedIcon` slot back (#19268) @arminmeh
|
|
36
|
+
- [DataGrid] Do not add `menu` role to the empty actions menu (#19338) @arminmeh
|
|
37
|
+
- [DataGrid] Fix `columnsManagementRow` style override slot not working (#19097) @dwrth
|
|
38
|
+
- [DataGrid] Fix pagination state synchronization issue (#19290) @MBilalShafi
|
|
39
|
+
- [DataGrid] Fix scroll issue in R17 (#19265) @romgrk
|
|
40
|
+
- [DataGrid] Hide column separator of non-resizable pinned column (#19277) @arminmeh
|
|
41
|
+
|
|
42
|
+
#### `@mui/x-data-grid-pro@8.11.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
43
|
+
|
|
44
|
+
Same changes as in `@mui/x-data-grid@8.11.0`, plus:
|
|
45
|
+
|
|
46
|
+
- [DataGridPro] Fix column menu sort when `multipleColumnsSortingMode="always"` (#19099) @MBilalShafi
|
|
47
|
+
- [DataGridPro] Keep the drop effect if `keepColumnPositionIfDraggedOutside` is enabled (#19372) @arminmeh
|
|
48
|
+
|
|
49
|
+
#### `@mui/x-data-grid-premium@8.11.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
50
|
+
|
|
51
|
+
Same changes as in `@mui/x-data-grid-pro@8.11.0`, plus:
|
|
52
|
+
|
|
53
|
+
- [DataGridPremium] Fix `valueFormatter` issues when `rowGroupingColumnMode="single"` (#18967) @cherniavskii
|
|
54
|
+
- [DataGridPremium] Reordering support for row grouping (#18251) @MBilalShafi
|
|
55
|
+
|
|
56
|
+
### Date and Time Pickers
|
|
57
|
+
|
|
58
|
+
#### `@mui/x-date-pickers@8.11.0`
|
|
59
|
+
|
|
60
|
+
- [pickers] Fix Firefox bug causing crash when `startContainer` is a restricted object (#18772) @Webini
|
|
61
|
+
- [pickers] RTL not applied correctly for Calendar Systems examples (works in v7.x but broken in latest version) (#19287) @rita-codes
|
|
62
|
+
- [pickers] Use the locale week day on the Luxon adapter (#19230) @flaviendelangle
|
|
63
|
+
- [pickers] Fix display of placeholder when label is shrunk (#19318) @sai6855
|
|
64
|
+
|
|
65
|
+
#### `@mui/x-date-pickers-pro@8.11.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
66
|
+
|
|
67
|
+
Same changes as in `@mui/x-date-pickers@8.11.0`.
|
|
68
|
+
|
|
69
|
+
### Charts
|
|
70
|
+
|
|
71
|
+
#### `@mui/x-charts@8.11.0`
|
|
72
|
+
|
|
73
|
+
- [charts] Add `RadarAxis` component to render labels (#19240) @alexfauquette
|
|
74
|
+
- [charts] Handle item identifier with data (#19295) @JCQuintas
|
|
75
|
+
- [charts] Refactor optional chaining for props in PieChart, PieChartPro, and ScatterChartPro components (#19292) @sai6855
|
|
76
|
+
- [charts] Remove unused `fill` and `stroke` properties (#19316) @sai6855
|
|
77
|
+
- [charts] Correct `hideLegend` prop description in docs (#19371) @sai6855
|
|
78
|
+
|
|
79
|
+
#### `@mui/x-charts-pro@8.11.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
80
|
+
|
|
81
|
+
Same changes as in `@mui/x-charts@8.11.0`, plus:
|
|
82
|
+
|
|
83
|
+
- [charts-pro] Add new `SankeyChart` (#18895) @JCQuintas
|
|
84
|
+
|
|
85
|
+
### Tree View
|
|
86
|
+
|
|
87
|
+
#### `@mui/x-tree-view@8.11.0`
|
|
88
|
+
|
|
89
|
+
- [tree view] Improve the typing of the item's checkbox `slotProps` (#19247) @flaviendelangle
|
|
90
|
+
|
|
91
|
+
#### `@mui/x-tree-view-pro@8.11.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
92
|
+
|
|
93
|
+
Same changes as in `@mui/x-tree-view@8.11.0`.
|
|
94
|
+
|
|
95
|
+
### Codemod
|
|
96
|
+
|
|
97
|
+
#### `@mui/x-codemod@8.11.0`
|
|
98
|
+
|
|
99
|
+
Internal changes.
|
|
100
|
+
|
|
101
|
+
### Docs
|
|
102
|
+
|
|
103
|
+
- [docs][TreeView] Fix grammar and spelling mistakes (#19299) @mapache-salvaje
|
|
104
|
+
- [docs][DataGrid] Add pagination number formatting doc with a demo (#19221) @siriwatknp
|
|
105
|
+
- [docs][Charts] Correct some small grammar mistakes (#19297) @mapache-salvaje
|
|
106
|
+
- [docs][DataGrid] Correct grammar mistakes (#19298) @mapache-salvaje
|
|
107
|
+
- [docs][DataGrid] Make it clear that the API key for AI Assistant must be private (#19244) @oliviertassinari
|
|
108
|
+
|
|
109
|
+
### Core
|
|
110
|
+
|
|
111
|
+
- [code-infra] Remove unnecessary triggers from publish workflow (#19348) @Janpot
|
|
112
|
+
- [code-infra] Set up publishing from GitHub actions (#19264) @Janpot
|
|
113
|
+
- [code-infra] Update renovate, exclude infra packages from MUI group (#19288) @Janpot
|
|
114
|
+
- [internal] Add comment for Codspeed triggers (#19302) @oliviertassinari
|
|
115
|
+
- [internal] Fix changelog generation for infra tags (#19266) @oliviertassinari
|
|
116
|
+
- [internal] Remove dead repository field (#19301) @oliviertassinari
|
|
117
|
+
- [internal] Sentence case @oliviertassinari
|
|
118
|
+
- [internal] Update 8.10.1 changelog with missing changes (#19345) @cherniavskii
|
|
119
|
+
- [support-infra] Improve GitHub Action that check PRs labels (#19303) @oliviertassinari
|
|
120
|
+
|
|
121
|
+
### Miscellaneous
|
|
122
|
+
|
|
123
|
+
- [infra] Add `synchronize` to workflow triggers (#19342) @michelengelen
|
|
124
|
+
- [infra] Add charts docs folder in codowner (#19317) @alexfauquette
|
|
125
|
+
- [infra] Fix publish workflow complaint (#19346) @JCQuintas
|
|
126
|
+
- [infra] Migrate to use eslint without airbnb config (#19269) @brijeshb42
|
|
127
|
+
- [infra] Simplify release preparation script (#19351) @michelengelen
|
|
128
|
+
|
|
8
129
|
## 8.10.2
|
|
9
130
|
|
|
10
131
|
_Aug 20, 2025_
|
|
@@ -27,13 +148,13 @@ The following are all team members who have contributed to this release:
|
|
|
27
148
|
- [DataGrid] Fix column header sortable classname when using `disableColumnSorting` (#19222) @wilcoschoneveld
|
|
28
149
|
- [l10n] Improve finnish (fi-FI) locale (#19163) @lauri-heinonen-2025-04
|
|
29
150
|
|
|
30
|
-
#### `@mui/x-data-grid-pro@8.10.2` [](https://mui.com/r/x-pro-svg-link
|
|
151
|
+
#### `@mui/x-data-grid-pro@8.10.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
31
152
|
|
|
32
153
|
Same changes as in `@mui/x-data-grid@8.10.2`, plus:
|
|
33
154
|
|
|
34
155
|
- [DataGridPro] Fix quick filter not working in List View mode (#19254) @cherniavskii
|
|
35
156
|
|
|
36
|
-
#### `@mui/x-data-grid-premium@8.10.2` [](https://mui.com/r/x-premium-svg-link
|
|
157
|
+
#### `@mui/x-data-grid-premium@8.10.2` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
37
158
|
|
|
38
159
|
Same changes as in `@mui/x-data-grid-pro@8.10.2`.
|
|
39
160
|
|
|
@@ -43,7 +164,7 @@ Same changes as in `@mui/x-data-grid-pro@8.10.2`.
|
|
|
43
164
|
|
|
44
165
|
Internal changes.
|
|
45
166
|
|
|
46
|
-
#### `@mui/x-date-pickers-pro@8.10.2` [](https://mui.com/r/x-pro-svg-link
|
|
167
|
+
#### `@mui/x-date-pickers-pro@8.10.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
47
168
|
|
|
48
169
|
Same changes as in `@mui/x-date-pickers@8.10.2`.
|
|
49
170
|
|
|
@@ -53,7 +174,7 @@ Same changes as in `@mui/x-date-pickers@8.10.2`.
|
|
|
53
174
|
|
|
54
175
|
Internal changes.
|
|
55
176
|
|
|
56
|
-
#### `@mui/x-charts-pro@8.10.2` [](https://mui.com/r/x-pro-svg-link
|
|
177
|
+
#### `@mui/x-charts-pro@8.10.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
57
178
|
|
|
58
179
|
Same changes as in `@mui/x-charts@8.10.2`.
|
|
59
180
|
|
|
@@ -63,7 +184,7 @@ Same changes as in `@mui/x-charts@8.10.2`.
|
|
|
63
184
|
|
|
64
185
|
- [tree view] Add `aria-hidden` to the Tree Item Checkbox (#19246) @flaviendelangle
|
|
65
186
|
|
|
66
|
-
#### `@mui/x-tree-view-pro@8.10.2` [](https://mui.com/r/x-pro-svg-link
|
|
187
|
+
#### `@mui/x-tree-view-pro@8.10.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
67
188
|
|
|
68
189
|
Same changes as in `@mui/x-tree-view@8.10.2`.
|
|
69
190
|
|
|
@@ -95,13 +216,13 @@ Internal changes.
|
|
|
95
216
|
|
|
96
217
|
_Aug 15, 2025_
|
|
97
218
|
|
|
98
|
-
We'd like to extend a big thank you to the
|
|
219
|
+
We'd like to extend a big thank you to the 11 contributors who made this release possible. Here are some highlights ✨:
|
|
99
220
|
|
|
100
221
|
- 📊 Y-axes can now be grouped by category when using `band` and `point` scales.
|
|
101
222
|
- 📚 Documentation improvements
|
|
102
223
|
|
|
103
224
|
The following are all team members who have contributed to this release:
|
|
104
|
-
@alexfauquette, @bernardobelchior, @Janpot, @JCQuintas, @mnajdova, @oliviertassinari, @prakhargupta1, @romgrk
|
|
225
|
+
@alexfauquette, @bernardobelchior, @Janpot, @JCQuintas, @mnajdova, @oliviertassinari, @prakhargupta1, @romgrk, @brijeshb42, @noraleonte, @rita-codes
|
|
105
226
|
|
|
106
227
|
### Data Grid
|
|
107
228
|
|
|
@@ -110,12 +231,14 @@ The following are all team members who have contributed to this release:
|
|
|
110
231
|
- [DataGrid] Fix scroll jumping (#19156) @romgrk
|
|
111
232
|
- [DataGrid] Fix scroll restoration (#19182) @romgrk
|
|
112
233
|
- [DataGrid] Fix "no row with id" error (#19193) @romgrk
|
|
234
|
+
- [DataGrid] Fix missing rows in the print export window (#19159) @cherniavskii
|
|
235
|
+
- [DataGrid] Fix broken scroll (#19178) @romgrk
|
|
113
236
|
|
|
114
|
-
#### `@mui/x-data-grid-pro@8.10.1` [](https://mui.com/r/x-pro-svg-link
|
|
237
|
+
#### `@mui/x-data-grid-pro@8.10.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
115
238
|
|
|
116
239
|
Same changes as in `@mui/x-data-grid@8.10.1`.
|
|
117
240
|
|
|
118
|
-
#### `@mui/x-data-grid-premium@8.10.1` [](https://mui.com/r/x-premium-svg-link
|
|
241
|
+
#### `@mui/x-data-grid-premium@8.10.1` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
119
242
|
|
|
120
243
|
Same changes as in `@mui/x-data-grid-pro@8.10.1`.
|
|
121
244
|
|
|
@@ -125,7 +248,7 @@ Same changes as in `@mui/x-data-grid-pro@8.10.1`.
|
|
|
125
248
|
|
|
126
249
|
Internal changes.
|
|
127
250
|
|
|
128
|
-
#### `@mui/x-date-pickers-pro@8.10.0` [](https://mui.com/r/x-pro-svg-link
|
|
251
|
+
#### `@mui/x-date-pickers-pro@8.10.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
129
252
|
|
|
130
253
|
Same changes as in `@mui/x-date-pickers@8.10.0`.
|
|
131
254
|
|
|
@@ -141,8 +264,10 @@ Same changes as in `@mui/x-date-pickers@8.10.0`.
|
|
|
141
264
|
- [charts] Fix default axis highlight for axes without data attribute (#18985) @alexfauquette
|
|
142
265
|
- [charts] Fix tooltip mark unexpected wrapping in mobile (#19122) @bernardobelchior
|
|
143
266
|
- [charts] Prevent overflow on charts tooltip (#19123) @bernardobelchior
|
|
267
|
+
- [charts] Add demo for log-scale ticks without labels (#19152) @bernardobelchior
|
|
268
|
+
- [charts] Update animation customization docs (#19185) @bernardobelchior
|
|
144
269
|
|
|
145
|
-
#### `@mui/x-charts-pro@8.10.1` [](https://mui.com/r/x-pro-svg-link
|
|
270
|
+
#### `@mui/x-charts-pro@8.10.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
146
271
|
|
|
147
272
|
Same changes as in `@mui/x-charts@8.10.1`.
|
|
148
273
|
|
|
@@ -150,9 +275,10 @@ Same changes as in `@mui/x-charts@8.10.1`.
|
|
|
150
275
|
|
|
151
276
|
#### `@mui/x-tree-view@8.10.1`
|
|
152
277
|
|
|
153
|
-
|
|
278
|
+
- [tree view] Fix root not loading from cache on remount (#19088) @noraleonte
|
|
279
|
+
- [tree view] Don't overwrite childrenIds when collapsed to preserve indeterminate state of the parent (#19196) @rita-codes
|
|
154
280
|
|
|
155
|
-
#### `@mui/x-tree-view-pro@8.10.1` [](https://mui.com/r/x-pro-svg-link
|
|
281
|
+
#### `@mui/x-tree-view-pro@8.10.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
156
282
|
|
|
157
283
|
Same changes as in `@mui/x-tree-view@8.10.1`.
|
|
158
284
|
|
|
@@ -182,6 +308,7 @@ Internal changes.
|
|
|
182
308
|
- [code-infra] Fix `fs-extra` removal from `formattedTSDemos` script (#19132) @bernardobelchior
|
|
183
309
|
- [code-infra] Remove unused code and dependency (#19139) @bernardobelchior
|
|
184
310
|
- [code-infra] Replace `fs-extra` with `node:fs` where possible (#19127) @bernardobelchior
|
|
311
|
+
- [code-infra] Migrate build command to code-infra (#19006) @brijeshb42
|
|
185
312
|
- [internal] Edit, keep `lockFileMaintenance` simple @oliviertassinari
|
|
186
313
|
- [internal] Fix writing style action name @oliviertassinari
|
|
187
314
|
- [internal] Make it clear that `lockFileMaintenance` is enabled @oliviertassinari
|
|
@@ -26,10 +26,11 @@ const configuration = {
|
|
|
26
26
|
useCSSVariables: _material.useMaterialCSSVariables,
|
|
27
27
|
useGridAriaAttributes: _useGridAriaAttributes.useGridAriaAttributesPro,
|
|
28
28
|
useGridRowAriaAttributes: _useGridRowAriaAttributes.useGridRowAriaAttributesPro,
|
|
29
|
+
useGridRowsOverridableMethods: _internals.useGridRowsOverridableMethods,
|
|
29
30
|
useCellAggregationResult: () => null
|
|
30
31
|
}
|
|
31
32
|
};
|
|
32
|
-
const releaseInfo = "
|
|
33
|
+
const releaseInfo = "MTc1NjQxNDgwMDAwMA==";
|
|
33
34
|
const watermark = /*#__PURE__*/(0, _jsxRuntime.jsx)(_xLicense.Watermark, {
|
|
34
35
|
packageName: "x-data-grid-pro",
|
|
35
36
|
releaseInfo: releaseInfo
|
|
@@ -37,7 +38,7 @@ const watermark = /*#__PURE__*/(0, _jsxRuntime.jsx)(_xLicense.Watermark, {
|
|
|
37
38
|
const DataGridProRaw = (0, _forwardRef.forwardRef)(function DataGridPro(inProps, ref) {
|
|
38
39
|
const props = (0, _useDataGridProProps.useDataGridProProps)(inProps);
|
|
39
40
|
const privateApiRef = (0, _internals.useGridApiInitialization)(props.apiRef, props);
|
|
40
|
-
(0, _useDataGridProComponent.useDataGridProComponent)(privateApiRef, props);
|
|
41
|
+
(0, _useDataGridProComponent.useDataGridProComponent)(privateApiRef, props, configuration);
|
|
41
42
|
(0, _xLicense.useLicenseVerifier)('x-data-grid-pro', releaseInfo);
|
|
42
43
|
if (process.env.NODE_ENV !== 'production') {
|
|
43
44
|
(0, _internals.validateProps)(props, _propValidation.propValidatorsDataGridPro);
|
|
@@ -744,7 +745,7 @@ DataGridProRaw.propTypes = {
|
|
|
744
745
|
*/
|
|
745
746
|
onPreferencePanelOpen: _propTypes.default.func,
|
|
746
747
|
/**
|
|
747
|
-
* Callback called when `processRowUpdate` throws an error or rejects.
|
|
748
|
+
* Callback called when `processRowUpdate()` throws an error or rejects.
|
|
748
749
|
* @param {any} error The error thrown.
|
|
749
750
|
*/
|
|
750
751
|
onProcessRowUpdateError: _propTypes.default.func,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { RefObject } from '@mui/x-internals/types';
|
|
2
|
+
import { GridConfiguration } from '@mui/x-data-grid/internals';
|
|
2
3
|
import { GridPrivateApiPro } from "../models/gridApiPro.js";
|
|
3
4
|
import { DataGridProProcessedProps } from "../models/dataGridProProps.js";
|
|
4
|
-
export declare const useDataGridProComponent: (apiRef: RefObject<GridPrivateApiPro>, props: DataGridProProcessedProps) => void;
|
|
5
|
+
export declare const useDataGridProComponent: (apiRef: RefObject<GridPrivateApiPro>, props: DataGridProProcessedProps, configuration: GridConfiguration) => void;
|
|
@@ -28,7 +28,7 @@ var _useGridDataSourceLazyLoader = require("../hooks/features/serverSideLazyLoad
|
|
|
28
28
|
var _useGridInfiniteLoadingIntersection = require("../hooks/features/serverSideLazyLoader/useGridInfiniteLoadingIntersection");
|
|
29
29
|
// Pro-only features
|
|
30
30
|
|
|
31
|
-
const useDataGridProComponent = (apiRef, props) => {
|
|
31
|
+
const useDataGridProComponent = (apiRef, props, configuration) => {
|
|
32
32
|
(0, _internals.useGridInitialization)(apiRef, props);
|
|
33
33
|
|
|
34
34
|
/**
|
|
@@ -87,7 +87,7 @@ const useDataGridProComponent = (apiRef, props) => {
|
|
|
87
87
|
(0, _useGridColumnPinning.useGridColumnPinning)(apiRef, props);
|
|
88
88
|
(0, _useGridRowPinning.useGridRowPinning)(apiRef, props);
|
|
89
89
|
(0, _internals.useGridColumns)(apiRef, props);
|
|
90
|
-
(0, _internals.useGridRows)(apiRef, props);
|
|
90
|
+
(0, _internals.useGridRows)(apiRef, props, configuration);
|
|
91
91
|
(0, _internals.useGridRowSpanning)(apiRef, props);
|
|
92
92
|
(0, _internals.useGridParamsApi)(apiRef, props);
|
|
93
93
|
(0, _useGridDetailPanel.useGridDetailPanel)(apiRef, props);
|
|
@@ -38,15 +38,15 @@ function GridRowReorderCell(params) {
|
|
|
38
38
|
const apiRef = (0, _xDataGrid.useGridApiContext)();
|
|
39
39
|
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
40
40
|
const sortModel = (0, _xDataGrid.useGridSelector)(apiRef, _xDataGrid.gridSortModelSelector);
|
|
41
|
-
const treeDepth = (0, _xDataGrid.useGridSelector)(apiRef, _xDataGrid.gridRowMaximumTreeDepthSelector);
|
|
42
41
|
const editRowsState = (0, _xDataGrid.useGridSelector)(apiRef, _internals.gridEditRowsStateSelector);
|
|
42
|
+
const cellValue =
|
|
43
43
|
// eslint-disable-next-line no-underscore-dangle
|
|
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
47
|
|
|
48
|
-
// TODO: remove sortModel and
|
|
49
|
-
const isDraggable = React.useMemo(() => !!rootProps.rowReordering && !sortModel.length &&
|
|
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]);
|
|
50
50
|
const ownerState = {
|
|
51
51
|
isDraggable,
|
|
52
52
|
classes: rootProps.classes
|
|
@@ -5,7 +5,7 @@ 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 } from '@mui/x-data-grid/internals';
|
|
8
|
+
import { validateProps, useGridApiInitialization, useGridRowsOverridableMethods } 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
11
|
import { useDataGridProComponent } from "./useDataGridProComponent.js";
|
|
@@ -19,10 +19,11 @@ const configuration = {
|
|
|
19
19
|
useCSSVariables: useMaterialCSSVariables,
|
|
20
20
|
useGridAriaAttributes: useGridAriaAttributesPro,
|
|
21
21
|
useGridRowAriaAttributes: useGridRowAriaAttributesPro,
|
|
22
|
+
useGridRowsOverridableMethods,
|
|
22
23
|
useCellAggregationResult: () => null
|
|
23
24
|
}
|
|
24
25
|
};
|
|
25
|
-
const releaseInfo = "
|
|
26
|
+
const releaseInfo = "MTc1NjQxNDgwMDAwMA==";
|
|
26
27
|
const watermark = /*#__PURE__*/_jsx(Watermark, {
|
|
27
28
|
packageName: "x-data-grid-pro",
|
|
28
29
|
releaseInfo: releaseInfo
|
|
@@ -30,7 +31,7 @@ const watermark = /*#__PURE__*/_jsx(Watermark, {
|
|
|
30
31
|
const DataGridProRaw = forwardRef(function DataGridPro(inProps, ref) {
|
|
31
32
|
const props = useDataGridProProps(inProps);
|
|
32
33
|
const privateApiRef = useGridApiInitialization(props.apiRef, props);
|
|
33
|
-
useDataGridProComponent(privateApiRef, props);
|
|
34
|
+
useDataGridProComponent(privateApiRef, props, configuration);
|
|
34
35
|
useLicenseVerifier('x-data-grid-pro', releaseInfo);
|
|
35
36
|
if (process.env.NODE_ENV !== 'production') {
|
|
36
37
|
validateProps(props, propValidatorsDataGridPro);
|
|
@@ -737,7 +738,7 @@ DataGridProRaw.propTypes = {
|
|
|
737
738
|
*/
|
|
738
739
|
onPreferencePanelOpen: PropTypes.func,
|
|
739
740
|
/**
|
|
740
|
-
* Callback called when `processRowUpdate` throws an error or rejects.
|
|
741
|
+
* Callback called when `processRowUpdate()` throws an error or rejects.
|
|
741
742
|
* @param {any} error The error thrown.
|
|
742
743
|
*/
|
|
743
744
|
onProcessRowUpdateError: PropTypes.func,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { RefObject } from '@mui/x-internals/types';
|
|
2
|
+
import { GridConfiguration } from '@mui/x-data-grid/internals';
|
|
2
3
|
import { GridPrivateApiPro } from "../models/gridApiPro.js";
|
|
3
4
|
import { DataGridProProcessedProps } from "../models/dataGridProProps.js";
|
|
4
|
-
export declare const useDataGridProComponent: (apiRef: RefObject<GridPrivateApiPro>, props: DataGridProProcessedProps) => void;
|
|
5
|
+
export declare const useDataGridProComponent: (apiRef: RefObject<GridPrivateApiPro>, props: DataGridProProcessedProps, configuration: GridConfiguration) => void;
|
|
@@ -21,7 +21,7 @@ import { useGridRowPinningPreProcessors } from "../hooks/features/rowPinning/use
|
|
|
21
21
|
import { useGridDataSourcePro as useGridDataSource, dataSourceStateInitializer } from "../hooks/features/dataSource/useGridDataSourcePro.js";
|
|
22
22
|
import { useGridDataSourceLazyLoader } from "../hooks/features/serverSideLazyLoader/useGridDataSourceLazyLoader.js";
|
|
23
23
|
import { useGridInfiniteLoadingIntersection } from "../hooks/features/serverSideLazyLoader/useGridInfiniteLoadingIntersection.js";
|
|
24
|
-
export const useDataGridProComponent = (apiRef, props) => {
|
|
24
|
+
export const useDataGridProComponent = (apiRef, props, configuration) => {
|
|
25
25
|
useGridInitialization(apiRef, props);
|
|
26
26
|
|
|
27
27
|
/**
|
|
@@ -80,7 +80,7 @@ export const useDataGridProComponent = (apiRef, props) => {
|
|
|
80
80
|
useGridColumnPinning(apiRef, props);
|
|
81
81
|
useGridRowPinning(apiRef, props);
|
|
82
82
|
useGridColumns(apiRef, props);
|
|
83
|
-
useGridRows(apiRef, props);
|
|
83
|
+
useGridRows(apiRef, props, configuration);
|
|
84
84
|
useGridRowSpanning(apiRef, props);
|
|
85
85
|
useGridParamsApi(apiRef, props);
|
|
86
86
|
useGridDetailPanel(apiRef, props);
|
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { styled } from '@mui/system';
|
|
5
5
|
import composeClasses from '@mui/utils/composeClasses';
|
|
6
|
-
import {
|
|
6
|
+
import { gridSortModelSelector, useGridApiContext, useGridSelector, getDataGridUtilityClass, gridClasses } from '@mui/x-data-grid';
|
|
7
7
|
import { gridEditRowsStateSelector, isEventTargetInPortal, vars } from '@mui/x-data-grid/internals';
|
|
8
8
|
import { useGridRootProps } from "../hooks/utils/useGridRootProps.js";
|
|
9
9
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -29,15 +29,15 @@ function GridRowReorderCell(params) {
|
|
|
29
29
|
const apiRef = useGridApiContext();
|
|
30
30
|
const rootProps = useGridRootProps();
|
|
31
31
|
const sortModel = useGridSelector(apiRef, gridSortModelSelector);
|
|
32
|
-
const treeDepth = useGridSelector(apiRef, gridRowMaximumTreeDepthSelector);
|
|
33
32
|
const editRowsState = useGridSelector(apiRef, gridEditRowsStateSelector);
|
|
33
|
+
const cellValue =
|
|
34
34
|
// eslint-disable-next-line no-underscore-dangle
|
|
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
38
|
|
|
39
|
-
// TODO: remove sortModel and
|
|
40
|
-
const isDraggable = React.useMemo(() => !!rootProps.rowReordering && !sortModel.length &&
|
|
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]);
|
|
41
41
|
const ownerState = {
|
|
42
42
|
isDraggable,
|
|
43
43
|
classes: rootProps.classes
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import composeClasses from '@mui/utils/composeClasses';
|
|
6
|
+
import ownerDocument from '@mui/utils/ownerDocument';
|
|
6
7
|
import { useRtl } from '@mui/system/RtlProvider';
|
|
7
8
|
import { useGridEvent, getDataGridUtilityClass, useGridLogger, useGridEventPriority } from '@mui/x-data-grid';
|
|
8
9
|
import { gridColumnReorderDragColSelector } from "./columnReorderSelector.js";
|
|
@@ -239,6 +240,24 @@ export const useGridColumnReorder = (apiRef, props) => {
|
|
|
239
240
|
cursorPosition.current = coordinates;
|
|
240
241
|
}
|
|
241
242
|
}, [apiRef, logger, isRtl]);
|
|
243
|
+
React.useEffect(() => {
|
|
244
|
+
if (!props.keepColumnPositionIfDraggedOutside) {
|
|
245
|
+
return () => {};
|
|
246
|
+
}
|
|
247
|
+
const doc = ownerDocument(apiRef.current.rootElementRef.current);
|
|
248
|
+
const listener = event => {
|
|
249
|
+
if (event.dataTransfer) {
|
|
250
|
+
// keep the drop effect if we are keeping the column position if dragged outside
|
|
251
|
+
// https://github.com/mui/mui-x/issues/19183#issuecomment-3202307783
|
|
252
|
+
event.preventDefault();
|
|
253
|
+
event.dataTransfer.dropEffect = 'move';
|
|
254
|
+
}
|
|
255
|
+
};
|
|
256
|
+
doc.addEventListener('dragover', listener);
|
|
257
|
+
return () => {
|
|
258
|
+
doc.removeEventListener('dragover', listener);
|
|
259
|
+
};
|
|
260
|
+
}, [apiRef, props.keepColumnPositionIfDraggedOutside]);
|
|
242
261
|
useGridEvent(apiRef, 'columnHeaderDragStart', handleDragStart);
|
|
243
262
|
useGridEvent(apiRef, 'columnHeaderDragEnter', handleDragEnter);
|
|
244
263
|
useGridEvent(apiRef, 'columnHeaderDragOver', handleDragOver);
|
|
@@ -7,9 +7,9 @@ export interface GridDataSourceState {
|
|
|
7
7
|
export interface GridGetRowsResponsePro extends GridGetRowsResponse {}
|
|
8
8
|
export interface GridGetRowsParamsPro extends GridGetRowsParams {
|
|
9
9
|
/**
|
|
10
|
-
* Array of keys returned by `getGroupKey` of all the parent rows until the row for which the data is requested
|
|
11
|
-
* `getGroupKey` prop must be implemented to use this.
|
|
12
|
-
*
|
|
10
|
+
* Array of keys returned by `getGroupKey()` of all the parent rows until the row for which the data is requested
|
|
11
|
+
* `getGroupKey()` prop must be implemented to use this.
|
|
12
|
+
* Used with "tree data" and "row grouping" features only.
|
|
13
13
|
*/
|
|
14
14
|
groupKeys?: string[];
|
|
15
15
|
}
|
|
@@ -21,7 +21,9 @@ export interface GridDataSourcePro extends Omit<GridDataSource, 'getRows'> {
|
|
|
21
21
|
*/
|
|
22
22
|
getRows(params: GridGetRowsParamsPro): Promise<GridGetRowsResponsePro>;
|
|
23
23
|
/**
|
|
24
|
-
* Used to group rows by their parent group.
|
|
24
|
+
* Used to group rows by their parent group.
|
|
25
|
+
* Replaces `getTreeDataPath()` used in client side tree-data
|
|
26
|
+
* Replaces `colDef.groupingValueGetter` used in client side row grouping
|
|
25
27
|
* @param {GridRowModel} row The row to get the group key of.
|
|
26
28
|
* @returns {string} The group key for the row.
|
|
27
29
|
*/
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { RefObject } from '@mui/x-internals/types';
|
|
2
|
-
import { GridStateInitializer } from '@mui/x-data-grid/internals';
|
|
2
|
+
import { type GridStateInitializer } from '@mui/x-data-grid/internals';
|
|
3
3
|
import { GridPrivateApiPro } from "../../../models/gridApiPro.js";
|
|
4
4
|
import { DataGridProProcessedProps } from "../../../models/dataGridProProps.js";
|
|
5
5
|
export declare const rowReorderStateInitializer: GridStateInitializer;
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Hook for row reordering (Pro package)
|
|
8
8
|
* @requires useGridRows (method)
|
|
9
9
|
*/
|
|
10
|
-
export declare const useGridRowReorder: (apiRef: RefObject<GridPrivateApiPro>, props: Pick<DataGridProProcessedProps, "rowReordering" | "onRowOrderChange" | "classes">) => void;
|
|
10
|
+
export declare const useGridRowReorder: (apiRef: RefObject<GridPrivateApiPro>, props: Pick<DataGridProProcessedProps, "rowReordering" | "onRowOrderChange" | "classes" | "treeData" | "dataSource">) => void;
|