@mui/x-data-grid-premium 8.19.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.
- package/CHANGELOG.md +62 -0
- package/DataGridPremium/DataGridPremium.d.ts +1 -1
- package/DataGridPremium/DataGridPremium.js +27 -1
- package/DataGridPremium/useDataGridPremiumComponent.d.ts +1 -1
- package/esm/DataGridPremium/DataGridPremium.d.ts +1 -1
- package/esm/DataGridPremium/DataGridPremium.js +27 -1
- package/esm/DataGridPremium/useDataGridPremiumComponent.d.ts +1 -1
- package/esm/hooks/features/rowGrouping/useGridRowGrouping.d.ts +1 -1
- package/esm/hooks/features/rowGrouping/useGridRowGrouping.js +21 -17
- package/esm/hooks/features/rowReorder/operations.d.ts +7 -27
- package/esm/hooks/features/rowReorder/operations.js +133 -274
- package/esm/hooks/features/rowReorder/rowGroupingReorderExecutor.d.ts +2 -0
- package/esm/hooks/features/rowReorder/rowGroupingReorderExecutor.js +3 -0
- package/esm/hooks/features/rowReorder/rowGroupingReorderValidator.d.ts +2 -0
- package/esm/hooks/features/rowReorder/{reorderValidator.js → rowGroupingReorderValidator.js} +2 -22
- package/esm/hooks/features/rows/useGridRowsOverridableMethods.d.ts +3 -3
- package/esm/hooks/features/rows/useGridRowsOverridableMethods.js +61 -7
- package/esm/index.js +1 -1
- package/hooks/features/rowGrouping/useGridRowGrouping.d.ts +1 -1
- package/hooks/features/rowGrouping/useGridRowGrouping.js +20 -16
- package/hooks/features/rowReorder/operations.d.ts +7 -27
- package/hooks/features/rowReorder/operations.js +136 -279
- package/hooks/features/rowReorder/rowGroupingReorderExecutor.d.ts +2 -0
- package/hooks/features/rowReorder/rowGroupingReorderExecutor.js +9 -0
- package/hooks/features/rowReorder/rowGroupingReorderValidator.d.ts +2 -0
- package/hooks/features/rowReorder/rowGroupingReorderValidator.js +102 -0
- package/hooks/features/rows/useGridRowsOverridableMethods.d.ts +3 -3
- package/hooks/features/rows/useGridRowsOverridableMethods.js +61 -7
- package/index.js +1 -1
- package/package.json +3 -3
- package/esm/hooks/features/rowReorder/reorderExecutor.d.ts +0 -15
- package/esm/hooks/features/rowReorder/reorderExecutor.js +0 -25
- package/esm/hooks/features/rowReorder/reorderValidator.d.ts +0 -16
- package/esm/hooks/features/rowReorder/types.d.ts +0 -42
- package/esm/hooks/features/rowReorder/types.js +0 -1
- package/esm/hooks/features/rowReorder/utils.d.ts +0 -127
- package/esm/hooks/features/rowReorder/utils.js +0 -343
- package/hooks/features/rowReorder/reorderExecutor.d.ts +0 -15
- package/hooks/features/rowReorder/reorderExecutor.js +0 -31
- package/hooks/features/rowReorder/reorderValidator.d.ts +0 -16
- package/hooks/features/rowReorder/reorderValidator.js +0 -122
- package/hooks/features/rowReorder/types.d.ts +0 -42
- package/hooks/features/rowReorder/types.js +0 -5
- package/hooks/features/rowReorder/utils.d.ts +0 -127
- package/hooks/features/rowReorder/utils.js +0 -360
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,68 @@
|
|
|
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` [](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` [](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` [](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` [](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
|
+
|
|
8
70
|
## 8.19.0
|
|
9
71
|
|
|
10
72
|
_Nov 20, 2025_
|
|
@@ -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 = "
|
|
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
|
|
@@ -598,12 +598,29 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
598
598
|
* @returns {boolean} A boolean indicating if the group is expanded.
|
|
599
599
|
*/
|
|
600
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,
|
|
601
609
|
/**
|
|
602
610
|
* Determines if a row can be selected.
|
|
603
611
|
* @param {GridRowParams} params With all properties from [[GridRowParams]].
|
|
604
612
|
* @returns {boolean} A boolean indicating if the row is selectable.
|
|
605
613
|
*/
|
|
606
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,
|
|
607
624
|
/**
|
|
608
625
|
* If `true`, moving the mouse pointer outside the grid before releasing the mouse button
|
|
609
626
|
* in a column re-order action will not cause the column to jump back to its original position.
|
|
@@ -1274,6 +1291,15 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
1274
1291
|
* @default 80
|
|
1275
1292
|
*/
|
|
1276
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,
|
|
1277
1303
|
/**
|
|
1278
1304
|
* If `true`, vertical borders will be displayed between cells.
|
|
1279
1305
|
* @default false
|
|
@@ -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
|
|
5
|
+
export declare const useDataGridPremiumComponent: (apiRef: RefObject<GridPrivateApiPremium>, inProps: DataGridPremiumProcessedProps, configuration: GridConfiguration) => DataGridPremiumProcessedProps;
|
|
@@ -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 = "
|
|
46
|
+
const releaseInfo = "MTc2NDExNTIwMDAwMA==";
|
|
47
47
|
const watermark = /*#__PURE__*/_jsx(Watermark, {
|
|
48
48
|
packageName: "x-data-grid-premium",
|
|
49
49
|
releaseInfo: releaseInfo
|
|
@@ -591,12 +591,29 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
591
591
|
* @returns {boolean} A boolean indicating if the group is expanded.
|
|
592
592
|
*/
|
|
593
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,
|
|
594
602
|
/**
|
|
595
603
|
* Determines if a row can be selected.
|
|
596
604
|
* @param {GridRowParams} params With all properties from [[GridRowParams]].
|
|
597
605
|
* @returns {boolean} A boolean indicating if the row is selectable.
|
|
598
606
|
*/
|
|
599
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,
|
|
600
617
|
/**
|
|
601
618
|
* If `true`, moving the mouse pointer outside the grid before releasing the mouse button
|
|
602
619
|
* in a column re-order action will not cause the column to jump back to its original position.
|
|
@@ -1267,6 +1284,15 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
1267
1284
|
* @default 80
|
|
1268
1285
|
*/
|
|
1269
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,
|
|
1270
1296
|
/**
|
|
1271
1297
|
* If `true`, vertical borders will be displayed between cells.
|
|
1272
1298
|
* @default false
|
|
@@ -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
|
|
5
|
+
export declare const useDataGridPremiumComponent: (apiRef: RefObject<GridPrivateApiPremium>, inProps: DataGridPremiumProcessedProps, configuration: GridConfiguration) => DataGridPremiumProcessedProps;
|
|
@@ -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;
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import * as React from 'react';
|
|
5
|
-
import { useGridEvent, useGridApiMethod, gridColumnLookupSelector, gridRowMaximumTreeDepthSelector, gridRowTreeSelector, gridExpandedSortedRowIdsSelector } from '@mui/x-data-grid-pro';
|
|
6
|
-
import { useGridRegisterPipeProcessor, GridStrategyGroup,
|
|
5
|
+
import { useGridEvent, useGridApiMethod, gridColumnLookupSelector, gridRowMaximumTreeDepthSelector, gridRowTreeSelector, gridExpandedSortedRowIdsSelector, gridExpandedSortedRowIndexLookupSelector } from '@mui/x-data-grid-pro';
|
|
6
|
+
import { useGridRegisterPipeProcessor, GridStrategyGroup, RowGroupingStrategy } from '@mui/x-data-grid-pro/internals';
|
|
7
7
|
import { gridRowGroupingModelSelector, gridRowGroupingSanitizedModelSelector } from "./gridRowGroupingSelector.js";
|
|
8
8
|
import { getRowGroupingFieldFromGroupingCriteria, isGroupingColumn, mergeStateWithRowGroupingModel, setStrategyAvailability, getGroupingRules, areGroupingRulesEqual } from "./gridRowGroupingUtils.js";
|
|
9
|
-
import { rowGroupingReorderValidator } from "../rowReorder/
|
|
9
|
+
import { rowGroupingReorderValidator } from "../rowReorder/rowGroupingReorderValidator.js";
|
|
10
10
|
export const rowGroupingStateInitializer = (state, props, apiRef) => {
|
|
11
11
|
apiRef.current.caches.rowGrouping = {
|
|
12
12
|
rulesOnLastRowTreeCreation: []
|
|
@@ -169,7 +169,8 @@ export const useGridRowGrouping = (apiRef, props) => {
|
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
}, [apiRef, props.disableRowGrouping]);
|
|
172
|
-
const
|
|
172
|
+
const isValidRowReorderProp = props.isValidRowReorder;
|
|
173
|
+
const isRowReorderValid = React.useCallback((initialValue, {
|
|
173
174
|
sourceRowId,
|
|
174
175
|
targetRowId,
|
|
175
176
|
dropPosition,
|
|
@@ -181,7 +182,6 @@ export const useGridRowGrouping = (apiRef, props) => {
|
|
|
181
182
|
const expandedSortedRowIndexLookup = gridExpandedSortedRowIndexLookupSelector(apiRef);
|
|
182
183
|
const expandedSortedRowIds = gridExpandedSortedRowIdsSelector(apiRef);
|
|
183
184
|
const rowTree = gridRowTreeSelector(apiRef);
|
|
184
|
-
const sourceRowIndex = expandedSortedRowIndexLookup[sourceRowId];
|
|
185
185
|
const targetRowIndex = expandedSortedRowIndexLookup[targetRowId];
|
|
186
186
|
const sourceNode = rowTree[sourceRowId];
|
|
187
187
|
const targetNode = rowTree[targetRowId];
|
|
@@ -190,30 +190,34 @@ export const useGridRowGrouping = (apiRef, props) => {
|
|
|
190
190
|
|
|
191
191
|
// Basic validity checks
|
|
192
192
|
if (!sourceNode || !targetNode) {
|
|
193
|
-
return
|
|
193
|
+
return false;
|
|
194
194
|
}
|
|
195
195
|
|
|
196
196
|
// Create context object
|
|
197
197
|
const context = {
|
|
198
|
+
apiRef,
|
|
198
199
|
sourceNode,
|
|
199
200
|
targetNode,
|
|
200
201
|
prevNode,
|
|
201
202
|
nextNode,
|
|
202
|
-
rowTree,
|
|
203
203
|
dropPosition,
|
|
204
|
-
dragDirection
|
|
205
|
-
targetRowIndex,
|
|
206
|
-
sourceRowIndex,
|
|
207
|
-
expandedSortedRowIndexLookup
|
|
204
|
+
dragDirection
|
|
208
205
|
};
|
|
209
206
|
|
|
210
|
-
//
|
|
211
|
-
|
|
212
|
-
|
|
207
|
+
// First apply internal validation
|
|
208
|
+
let isValid = rowGroupingReorderValidator.validate(context);
|
|
209
|
+
|
|
210
|
+
// If internal validation passes AND user provided additional validation
|
|
211
|
+
if (isValid && isValidRowReorderProp) {
|
|
212
|
+
// Apply additional user restrictions
|
|
213
|
+
isValid = isValidRowReorderProp(context);
|
|
214
|
+
}
|
|
215
|
+
if (isValid) {
|
|
216
|
+
return true;
|
|
213
217
|
}
|
|
214
|
-
return
|
|
215
|
-
}, [apiRef, props.treeData]);
|
|
216
|
-
useGridRegisterPipeProcessor(apiRef, '
|
|
218
|
+
return false;
|
|
219
|
+
}, [apiRef, props.treeData, isValidRowReorderProp]);
|
|
220
|
+
useGridRegisterPipeProcessor(apiRef, 'isRowReorderValid', isRowReorderValid);
|
|
217
221
|
useGridEvent(apiRef, 'cellKeyDown', handleCellKeyDown);
|
|
218
222
|
useGridEvent(apiRef, 'columnsChange', checkGroupingColumnsModelDiff);
|
|
219
223
|
useGridEvent(apiRef, 'rowGroupingModelChange', checkGroupingColumnsModelDiff);
|
|
@@ -1,34 +1,13 @@
|
|
|
1
|
-
import type
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* Provides abstract methods for operation detection and execution.
|
|
5
|
-
*/
|
|
6
|
-
export declare abstract class BaseReorderOperation {
|
|
7
|
-
abstract readonly operationType: string;
|
|
8
|
-
/**
|
|
9
|
-
* Detects if this operation can handle the given context.
|
|
10
|
-
*/
|
|
11
|
-
abstract detectOperation(ctx: ReorderExecutionContext): ReorderOperation | null;
|
|
12
|
-
/**
|
|
13
|
-
* Executes the detected operation.
|
|
14
|
-
*/
|
|
15
|
-
abstract executeOperation(operation: ReorderOperation, ctx: ReorderExecutionContext): Promise<void> | void;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Handles reordering of items within the same parent group.
|
|
19
|
-
*/
|
|
20
|
-
export declare class SameParentSwapOperation extends BaseReorderOperation {
|
|
21
|
-
readonly operationType = "same-parent-swap";
|
|
22
|
-
detectOperation(ctx: ReorderExecutionContext): ReorderOperation | null;
|
|
23
|
-
executeOperation(operation: ReorderOperation, ctx: ReorderExecutionContext): void;
|
|
24
|
-
}
|
|
1
|
+
import { BaseReorderOperation, type ReorderOperation, type ReorderExecutionContext } from '@mui/x-data-grid-pro/internals';
|
|
2
|
+
import { GridPrivateApiPremium } from "../../../models/gridApiPremium.js";
|
|
3
|
+
type ReorderExecutionContextType = ReorderExecutionContext<GridPrivateApiPremium>;
|
|
25
4
|
/**
|
|
26
5
|
* Handles moving leaf nodes between different parent groups.
|
|
27
6
|
*/
|
|
28
7
|
export declare class CrossParentLeafOperation extends BaseReorderOperation {
|
|
29
8
|
readonly operationType = "cross-parent-leaf";
|
|
30
9
|
detectOperation(ctx: ReorderExecutionContext): ReorderOperation | null;
|
|
31
|
-
executeOperation(operation: ReorderOperation, ctx:
|
|
10
|
+
executeOperation(operation: ReorderOperation, ctx: ReorderExecutionContextType): Promise<void>;
|
|
32
11
|
}
|
|
33
12
|
/**
|
|
34
13
|
* Handles moving entire groups between different parents.
|
|
@@ -36,5 +15,6 @@ export declare class CrossParentLeafOperation extends BaseReorderOperation {
|
|
|
36
15
|
export declare class CrossParentGroupOperation extends BaseReorderOperation {
|
|
37
16
|
readonly operationType = "cross-parent-group";
|
|
38
17
|
detectOperation(ctx: ReorderExecutionContext): ReorderOperation | null;
|
|
39
|
-
executeOperation(operation: ReorderOperation, ctx:
|
|
40
|
-
}
|
|
18
|
+
executeOperation(operation: ReorderOperation, ctx: ReorderExecutionContextType): Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
export {};
|