@mui/x-data-grid-pro 5.7.0 → 5.10.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 +241 -53
- package/DataGridPro/DataGridPro.d.ts +7 -1
- package/DataGridPro/DataGridPro.js +44 -6
- package/DataGridPro/useDataGridProComponent.js +8 -4
- package/DataGridPro/useDataGridProProps.d.ts +2 -1
- package/DataGridPro/useDataGridProProps.js +1 -0
- package/LICENSE +12 -0
- package/README.md +6 -4
- package/components/DataGridProColumnHeaders.js +0 -6
- package/components/DataGridProVirtualScroller.js +1 -3
- package/components/GridDetailPanelToggleCell.js +15 -4
- package/components/GridGroupingCriteriaCell.d.ts +2 -5
- package/components/GridGroupingCriteriaCell.js +2 -74
- package/components/GridRowReorderCell.d.ts +5 -0
- package/components/GridRowReorderCell.js +72 -0
- package/components/GridTreeDataGroupingCell.js +15 -4
- package/hooks/features/columnPinning/useGridColumnPinning.js +6 -6
- package/hooks/features/columnPinning/useGridColumnPinningPreProcessors.js +2 -2
- package/hooks/features/columnReorder/useGridColumnReorder.js +3 -3
- package/hooks/features/columnResize/useGridColumnResize.js +18 -6
- package/hooks/features/detailPanel/useGridDetailPanel.js +12 -4
- package/hooks/features/detailPanel/useGridDetailPanelCache.js +1 -1
- package/hooks/features/detailPanel/useGridDetailPanelPreProcessors.js +2 -2
- package/hooks/features/index.d.ts +1 -0
- package/hooks/features/index.js +1 -0
- package/hooks/features/rowGrouping/gridRowGroupingUtils.d.ts +1 -1
- package/hooks/features/rowGrouping/useGridRowGrouping.js +6 -8
- package/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +2 -2
- package/hooks/features/rowReorder/gridRowReorderColDef.d.ts +2 -0
- package/hooks/features/rowReorder/gridRowReorderColDef.js +18 -0
- package/hooks/features/rowReorder/index.d.ts +1 -0
- package/hooks/features/rowReorder/index.js +1 -0
- package/hooks/features/rowReorder/useGridRowReorder.d.ts +8 -0
- package/hooks/features/rowReorder/useGridRowReorder.js +111 -0
- package/hooks/features/rowReorder/useGridRowReorderPreProcessors.d.ts +4 -0
- package/hooks/features/rowReorder/useGridRowReorderPreProcessors.js +51 -0
- package/hooks/features/treeData/useGridTreeData.js +0 -2
- package/hooks/features/treeData/useGridTreeDataPreProcessors.js +2 -2
- package/index.d.ts +1 -1
- package/index.js +2 -2
- package/legacy/DataGridPro/DataGridPro.js +44 -6
- package/legacy/DataGridPro/useDataGridProComponent.js +8 -4
- package/legacy/DataGridPro/useDataGridProProps.js +1 -0
- package/legacy/components/DataGridProColumnHeaders.js +0 -6
- package/legacy/components/DataGridProVirtualScroller.js +1 -3
- package/legacy/components/GridDetailPanelToggleCell.js +15 -4
- package/legacy/components/GridGroupingCriteriaCell.js +2 -74
- package/legacy/components/GridRowReorderCell.js +74 -0
- package/legacy/components/GridTreeDataGroupingCell.js +15 -4
- package/legacy/hooks/features/columnPinning/useGridColumnPinning.js +6 -6
- package/legacy/hooks/features/columnPinning/useGridColumnPinningPreProcessors.js +2 -2
- package/legacy/hooks/features/columnReorder/useGridColumnReorder.js +3 -3
- package/legacy/hooks/features/columnResize/useGridColumnResize.js +18 -6
- package/legacy/hooks/features/detailPanel/useGridDetailPanel.js +12 -4
- package/legacy/hooks/features/detailPanel/useGridDetailPanelCache.js +1 -1
- package/legacy/hooks/features/detailPanel/useGridDetailPanelPreProcessors.js +2 -2
- package/legacy/hooks/features/index.js +1 -0
- package/legacy/hooks/features/rowGrouping/useGridRowGrouping.js +6 -8
- package/legacy/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +2 -2
- package/legacy/hooks/features/rowReorder/gridRowReorderColDef.js +20 -0
- package/legacy/hooks/features/rowReorder/index.js +1 -0
- package/legacy/hooks/features/rowReorder/useGridRowReorder.js +115 -0
- package/legacy/hooks/features/rowReorder/useGridRowReorderPreProcessors.js +52 -0
- package/legacy/hooks/features/treeData/useGridTreeData.js +0 -2
- package/legacy/hooks/features/treeData/useGridTreeDataPreProcessors.js +2 -2
- package/legacy/index.js +2 -2
- package/legacy/models/gridRowOrderChangeParams.js +1 -0
- package/legacy/models/index.js +1 -0
- package/legacy/utils/domUtils.js +30 -3
- package/legacy/utils/releaseInfo.js +1 -1
- package/models/dataGridProProps.d.ts +21 -8
- package/models/gridGroupingColDefOverride.d.ts +2 -2
- package/models/gridGroupingValueGetterParams.d.ts +1 -1
- package/models/gridRowOrderChangeParams.d.ts +18 -0
- package/models/gridRowOrderChangeParams.js +1 -0
- package/models/index.d.ts +1 -0
- package/models/index.js +1 -0
- package/modern/DataGridPro/DataGridPro.js +44 -6
- package/modern/DataGridPro/useDataGridProComponent.js +8 -4
- package/modern/DataGridPro/useDataGridProProps.js +1 -0
- package/modern/components/DataGridProColumnHeaders.js +0 -6
- package/modern/components/DataGridProVirtualScroller.js +1 -3
- package/modern/components/GridDetailPanelToggleCell.js +15 -4
- package/modern/components/GridGroupingCriteriaCell.js +2 -74
- package/modern/components/GridRowReorderCell.js +72 -0
- package/modern/components/GridTreeDataGroupingCell.js +15 -4
- package/modern/hooks/features/columnPinning/useGridColumnPinning.js +6 -6
- package/modern/hooks/features/columnPinning/useGridColumnPinningPreProcessors.js +2 -2
- package/modern/hooks/features/columnReorder/useGridColumnReorder.js +3 -3
- package/modern/hooks/features/columnResize/useGridColumnResize.js +18 -6
- package/modern/hooks/features/detailPanel/useGridDetailPanel.js +12 -4
- package/modern/hooks/features/detailPanel/useGridDetailPanelCache.js +1 -1
- package/modern/hooks/features/detailPanel/useGridDetailPanelPreProcessors.js +2 -2
- package/modern/hooks/features/index.js +1 -0
- package/modern/hooks/features/rowGrouping/useGridRowGrouping.js +6 -8
- package/modern/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +2 -2
- package/modern/hooks/features/rowReorder/gridRowReorderColDef.js +18 -0
- package/modern/hooks/features/rowReorder/index.js +1 -0
- package/modern/hooks/features/rowReorder/useGridRowReorder.js +111 -0
- package/modern/hooks/features/rowReorder/useGridRowReorderPreProcessors.js +51 -0
- package/modern/hooks/features/treeData/useGridTreeData.js +0 -2
- package/modern/hooks/features/treeData/useGridTreeDataPreProcessors.js +2 -2
- package/modern/index.js +2 -2
- package/modern/models/gridRowOrderChangeParams.js +1 -0
- package/modern/models/index.js +1 -0
- package/modern/utils/domUtils.js +30 -3
- package/modern/utils/releaseInfo.js +1 -1
- package/node/DataGridPro/DataGridPro.js +44 -6
- package/node/DataGridPro/useDataGridProComponent.js +9 -3
- package/node/DataGridPro/useDataGridProProps.js +1 -0
- package/node/components/DataGridProColumnHeaders.js +0 -6
- package/node/components/DataGridProVirtualScroller.js +1 -3
- package/node/components/GridDetailPanelToggleCell.js +15 -4
- package/node/components/GridGroupingCriteriaCell.js +1 -72
- package/node/components/GridRowReorderCell.js +92 -0
- package/node/components/GridTreeDataGroupingCell.js +15 -4
- package/node/hooks/features/columnPinning/useGridColumnPinning.js +5 -5
- package/node/hooks/features/columnPinning/useGridColumnPinningPreProcessors.js +1 -1
- package/node/hooks/features/columnReorder/useGridColumnReorder.js +3 -3
- package/node/hooks/features/columnResize/useGridColumnResize.js +18 -6
- package/node/hooks/features/detailPanel/useGridDetailPanel.js +11 -3
- package/node/hooks/features/detailPanel/useGridDetailPanelCache.js +1 -1
- package/node/hooks/features/detailPanel/useGridDetailPanelPreProcessors.js +1 -1
- package/node/hooks/features/index.js +13 -0
- package/node/hooks/features/rowGrouping/useGridRowGrouping.js +5 -7
- package/node/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +1 -1
- package/node/hooks/features/rowReorder/gridRowReorderColDef.js +31 -0
- package/node/hooks/features/rowReorder/index.js +18 -0
- package/node/hooks/features/rowReorder/useGridRowReorder.js +126 -0
- package/node/hooks/features/rowReorder/useGridRowReorderPreProcessors.js +70 -0
- package/node/hooks/features/treeData/useGridTreeData.js +0 -2
- package/node/hooks/features/treeData/useGridTreeDataPreProcessors.js +1 -1
- package/node/index.js +9 -9
- package/node/models/gridRowOrderChangeParams.js +5 -0
- package/node/models/index.js +13 -0
- package/node/utils/domUtils.js +30 -3
- package/node/utils/releaseInfo.js +1 -1
- package/package.json +7 -7
- package/typeOverloads/modules.d.ts +10 -7
- package/typeOverloads/reexports.d.ts +1 -1
- package/utils/domUtils.d.ts +2 -1
- package/utils/domUtils.js +30 -3
- package/utils/releaseInfo.js +1 -1
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
4
|
+
import { GridEvents, gridRowTreeDepthSelector, gridSortModelSelector, useGridApiContext, useGridSelector, getDataGridUtilityClass, gridEditRowsStateSelector } from '@mui/x-data-grid';
|
|
5
|
+
import { useGridRootProps } from '../hooks/utils/useGridRootProps';
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
|
|
9
|
+
const useUtilityClasses = ownerState => {
|
|
10
|
+
const {
|
|
11
|
+
isDraggable,
|
|
12
|
+
classes
|
|
13
|
+
} = ownerState;
|
|
14
|
+
const slots = {
|
|
15
|
+
root: ['rowReorderCell', isDraggable && 'rowReorderCell--draggable'],
|
|
16
|
+
placeholder: ['rowReorderCellPlaceholder']
|
|
17
|
+
};
|
|
18
|
+
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const GridRowReorderCell = params => {
|
|
22
|
+
const apiRef = useGridApiContext();
|
|
23
|
+
const rootProps = useGridRootProps();
|
|
24
|
+
const sortModel = useGridSelector(apiRef, gridSortModelSelector);
|
|
25
|
+
const treeDepth = useGridSelector(apiRef, gridRowTreeDepthSelector);
|
|
26
|
+
const editRowsState = useGridSelector(apiRef, gridEditRowsStateSelector); // eslint-disable-next-line no-underscore-dangle
|
|
27
|
+
|
|
28
|
+
const cellValue = params.row.__reorder__ || params.id; // TODO: remove sortModel and treeDepth checks once row reorder is compatible
|
|
29
|
+
|
|
30
|
+
const isDraggable = !!rootProps.rowReordering && !sortModel.length && treeDepth === 1 && Object.keys(editRowsState).length === 0;
|
|
31
|
+
const ownerState = {
|
|
32
|
+
isDraggable,
|
|
33
|
+
classes: rootProps.classes
|
|
34
|
+
};
|
|
35
|
+
const classes = useUtilityClasses(ownerState);
|
|
36
|
+
const publish = React.useCallback((eventName, propHandler) => event => {
|
|
37
|
+
// Ignore portal
|
|
38
|
+
// The target is not an element when triggered by a Select inside the cell
|
|
39
|
+
// See https://github.com/mui/material-ui/issues/10534
|
|
40
|
+
if (event.target.nodeType === 1 && !event.currentTarget.contains(event.target)) {
|
|
41
|
+
return;
|
|
42
|
+
} // The row might have been deleted
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
if (!apiRef.current.getRow(params.row.id)) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
apiRef.current.publishEvent(eventName, apiRef.current.getRowParams(params.row.id), event);
|
|
50
|
+
|
|
51
|
+
if (propHandler) {
|
|
52
|
+
propHandler(event);
|
|
53
|
+
}
|
|
54
|
+
}, [apiRef, params.row.id]);
|
|
55
|
+
const draggableEventHandlers = {
|
|
56
|
+
onDragStart: publish(GridEvents.rowDragStart),
|
|
57
|
+
onDragOver: publish(GridEvents.rowDragOver),
|
|
58
|
+
onDragEnd: publish(GridEvents.rowDragEnd)
|
|
59
|
+
};
|
|
60
|
+
return /*#__PURE__*/_jsxs("div", _extends({
|
|
61
|
+
className: classes.root,
|
|
62
|
+
draggable: isDraggable
|
|
63
|
+
}, draggableEventHandlers, {
|
|
64
|
+
children: [/*#__PURE__*/_jsx(rootProps.components.RowReorderIcon, {}), /*#__PURE__*/_jsx("div", {
|
|
65
|
+
className: classes.placeholder,
|
|
66
|
+
children: cellValue
|
|
67
|
+
})]
|
|
68
|
+
}));
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export { GridRowReorderCell };
|
|
72
|
+
export const renderRowReorderCell = params => /*#__PURE__*/_jsx(GridRowReorderCell, _extends({}, params));
|
|
@@ -105,16 +105,27 @@ process.env.NODE_ENV !== "production" ? GridTreeDataGroupingCell.propTypes = {
|
|
|
105
105
|
*/
|
|
106
106
|
field: PropTypes.string.isRequired,
|
|
107
107
|
|
|
108
|
+
/**
|
|
109
|
+
* A ref allowing to set imperative focus.
|
|
110
|
+
* It can be passed to the element that should receive focus.
|
|
111
|
+
* @ignore - do not document.
|
|
112
|
+
*/
|
|
113
|
+
focusElementRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
114
|
+
current: PropTypes.shape({
|
|
115
|
+
focus: PropTypes.func.isRequired
|
|
116
|
+
})
|
|
117
|
+
})]),
|
|
118
|
+
|
|
108
119
|
/**
|
|
109
120
|
* The cell value formatted with the column valueFormatter.
|
|
110
121
|
*/
|
|
111
|
-
formattedValue: PropTypes.any
|
|
122
|
+
formattedValue: PropTypes.any,
|
|
112
123
|
|
|
113
124
|
/**
|
|
114
125
|
* Get the cell value of a row and field.
|
|
115
126
|
* @param {GridRowId} id The row id.
|
|
116
127
|
* @param {string} field The field.
|
|
117
|
-
* @returns {
|
|
128
|
+
* @returns {any} The cell value.
|
|
118
129
|
* @deprecated Use `params.row` to directly access the fields you want instead.
|
|
119
130
|
*/
|
|
120
131
|
getValue: PropTypes.func.isRequired,
|
|
@@ -138,7 +149,7 @@ process.env.NODE_ENV !== "production" ? GridTreeDataGroupingCell.propTypes = {
|
|
|
138
149
|
/**
|
|
139
150
|
* The row model of the row that the current cell belongs to.
|
|
140
151
|
*/
|
|
141
|
-
row: PropTypes.
|
|
152
|
+
row: PropTypes.object.isRequired,
|
|
142
153
|
|
|
143
154
|
/**
|
|
144
155
|
* The node of the row that the current cell belongs to.
|
|
@@ -153,6 +164,6 @@ process.env.NODE_ENV !== "production" ? GridTreeDataGroupingCell.propTypes = {
|
|
|
153
164
|
/**
|
|
154
165
|
* The cell value, but if the column has valueGetter, use getValue.
|
|
155
166
|
*/
|
|
156
|
-
value: PropTypes.any
|
|
167
|
+
value: PropTypes.any
|
|
157
168
|
} : void 0;
|
|
158
169
|
export { GridTreeDataGroupingCell };
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import MuiDivider from '@mui/material/Divider';
|
|
4
4
|
import { useGridSelector, gridVisibleColumnDefinitionsSelector, gridColumnsTotalWidthSelector, gridColumnPositionsSelector, gridVisibleColumnFieldsSelector, gridClasses, GridEvents, useGridApiMethod, useGridApiEventHandler } from '@mui/x-data-grid';
|
|
5
|
-
import {
|
|
5
|
+
import { useGridRegisterPipeProcessor } from '@mui/x-data-grid/internals';
|
|
6
6
|
import { GridColumnPinningMenuItems } from '../../../components/GridColumnPinningMenuItems';
|
|
7
7
|
import { GridPinnedPosition } from './gridColumnPinningInterface';
|
|
8
8
|
import { gridPinnedColumnsSelector } from './gridColumnPinningSelector';
|
|
@@ -175,11 +175,11 @@ export const useGridColumnPinning = (apiRef, props) => {
|
|
|
175
175
|
|
|
176
176
|
return params;
|
|
177
177
|
}, [apiRef]);
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
178
|
+
useGridRegisterPipeProcessor(apiRef, 'scrollToIndexes', calculateScrollLeft);
|
|
179
|
+
useGridRegisterPipeProcessor(apiRef, 'columnMenu', addColumnMenuButtons);
|
|
180
|
+
useGridRegisterPipeProcessor(apiRef, 'canBeReordered', checkIfCanBeReordered);
|
|
181
|
+
useGridRegisterPipeProcessor(apiRef, 'exportState', stateExportPreProcessing);
|
|
182
|
+
useGridRegisterPipeProcessor(apiRef, 'restoreState', stateRestorePreProcessing);
|
|
183
183
|
apiRef.current.unstable_updateControlState({
|
|
184
184
|
stateId: 'pinnedColumns',
|
|
185
185
|
propModel: props.pinnedColumns,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { useGridRegisterPipeProcessor } from '@mui/x-data-grid/internals';
|
|
4
4
|
import { gridPinnedColumnsSelector } from './gridColumnPinningSelector';
|
|
5
5
|
import { columnPinningStateInitializer } from './useGridColumnPinning';
|
|
6
6
|
import { filterColumns } from '../../../components/DataGridProVirtualScroller';
|
|
@@ -41,5 +41,5 @@ export const useGridColumnPinningPreProcessors = (apiRef, props) => {
|
|
|
41
41
|
all: [...leftPinnedColumns, ...centerColumns, ...rightPinnedColumns]
|
|
42
42
|
});
|
|
43
43
|
}, [disableColumnPinning, pinnedColumns]);
|
|
44
|
-
|
|
44
|
+
useGridRegisterPipeProcessor(apiRef, 'hydrateColumns', reorderPinnedColumns);
|
|
45
45
|
};
|
|
@@ -50,7 +50,7 @@ export const useGridColumnReorder = (apiRef, props) => {
|
|
|
50
50
|
clearTimeout(removeDnDStylesTimeout.current);
|
|
51
51
|
};
|
|
52
52
|
}, []);
|
|
53
|
-
const
|
|
53
|
+
const handleDragStart = React.useCallback((params, event) => {
|
|
54
54
|
if (props.disableColumnReorder || params.colDef.disableReorder) {
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
@@ -116,7 +116,7 @@ export const useGridColumnReorder = (apiRef, props) => {
|
|
|
116
116
|
canBeReordered = targetColIndex < visibleColumns.length - 1 && !visibleColumns[targetColIndex + 1].disableReorder;
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
const canBeReorderedProcessed = apiRef.current.
|
|
119
|
+
const canBeReorderedProcessed = apiRef.current.unstable_applyPipeProcessors('canBeReordered', canBeReordered, {
|
|
120
120
|
targetIndex: targetColVisibleIndex
|
|
121
121
|
});
|
|
122
122
|
|
|
@@ -156,7 +156,7 @@ export const useGridColumnReorder = (apiRef, props) => {
|
|
|
156
156
|
}));
|
|
157
157
|
apiRef.current.forceUpdate();
|
|
158
158
|
}, [props.disableColumnReorder, logger, apiRef]);
|
|
159
|
-
useGridApiEventHandler(apiRef, GridEvents.columnHeaderDragStart,
|
|
159
|
+
useGridApiEventHandler(apiRef, GridEvents.columnHeaderDragStart, handleDragStart);
|
|
160
160
|
useGridApiEventHandler(apiRef, GridEvents.columnHeaderDragEnter, handleDragEnter);
|
|
161
161
|
useGridApiEventHandler(apiRef, GridEvents.columnHeaderDragOver, handleDragOver);
|
|
162
162
|
useGridApiEventHandler(apiRef, GridEvents.columnHeaderDragEnd, handleDragEnd);
|
|
@@ -100,17 +100,29 @@ export const useGridColumnResize = (apiRef, props) => {
|
|
|
100
100
|
|
|
101
101
|
const updateWidth = newWidth => {
|
|
102
102
|
logger.debug(`Updating width to ${newWidth} for col ${colDefRef.current.field}`);
|
|
103
|
+
const prevWidth = colElementRef.current.offsetWidth;
|
|
104
|
+
const widthDiff = newWidth - prevWidth;
|
|
103
105
|
colDefRef.current.computedWidth = newWidth;
|
|
104
106
|
colDefRef.current.width = newWidth;
|
|
105
|
-
colDefRef.current.flex =
|
|
107
|
+
colDefRef.current.flex = 0;
|
|
106
108
|
colElementRef.current.style.width = `${newWidth}px`;
|
|
107
109
|
colElementRef.current.style.minWidth = `${newWidth}px`;
|
|
108
110
|
colElementRef.current.style.maxWidth = `${newWidth}px`;
|
|
109
111
|
colCellElementsRef.current.forEach(element => {
|
|
110
112
|
const div = element;
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
div.
|
|
113
|
+
let finalWidth;
|
|
114
|
+
|
|
115
|
+
if (div.getAttribute('aria-colspan') === '1') {
|
|
116
|
+
finalWidth = `${newWidth}px`;
|
|
117
|
+
} else {
|
|
118
|
+
// Cell with colspan > 1 cannot be just updated width new width.
|
|
119
|
+
// Instead, we add width diff to the current width.
|
|
120
|
+
finalWidth = `${div.offsetWidth + widthDiff}px`;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
div.style.width = finalWidth;
|
|
124
|
+
div.style.minWidth = finalWidth;
|
|
125
|
+
div.style.maxWidth = finalWidth;
|
|
114
126
|
});
|
|
115
127
|
};
|
|
116
128
|
|
|
@@ -170,7 +182,7 @@ export const useGridColumnResize = (apiRef, props) => {
|
|
|
170
182
|
}, event);
|
|
171
183
|
colDefRef.current = colDef;
|
|
172
184
|
colElementRef.current = apiRef.current.columnHeadersContainerElementRef?.current.querySelector(`[data-field="${colDef.field}"]`);
|
|
173
|
-
colCellElementsRef.current = findGridCellElementsFromCol(colElementRef.current);
|
|
185
|
+
colCellElementsRef.current = findGridCellElementsFromCol(colElementRef.current, apiRef.current);
|
|
174
186
|
const doc = ownerDocument(apiRef.current.rootElementRef.current);
|
|
175
187
|
doc.body.style.cursor = 'col-resize';
|
|
176
188
|
separatorSide.current = getSeparatorSide(event.currentTarget);
|
|
@@ -245,7 +257,7 @@ export const useGridColumnResize = (apiRef, props) => {
|
|
|
245
257
|
}, event);
|
|
246
258
|
colDefRef.current = colDef;
|
|
247
259
|
colElementRef.current = findHeaderElementFromField(apiRef.current.columnHeadersElementRef?.current, colDef.field);
|
|
248
|
-
colCellElementsRef.current = findGridCellElementsFromCol(colElementRef.current);
|
|
260
|
+
colCellElementsRef.current = findGridCellElementsFromCol(colElementRef.current, apiRef.current);
|
|
249
261
|
separatorSide.current = getSeparatorSide(event.target);
|
|
250
262
|
initialOffsetToSeparator.current = computeOffsetToSeparator(touch.clientX, colElementRef.current.getBoundingClientRect(), separatorSide.current);
|
|
251
263
|
const doc = ownerDocument(event.currentTarget);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { GridEvents, useGridSelector, useGridApiEventHandler, useGridApiMethod } from '@mui/x-data-grid';
|
|
4
|
-
import {
|
|
4
|
+
import { useGridRegisterPipeProcessor } from '@mui/x-data-grid/internals';
|
|
5
5
|
import { GRID_DETAIL_PANEL_TOGGLE_FIELD } from './gridDetailPanelToggleColDef';
|
|
6
6
|
import { gridDetailPanelExpandedRowIdsSelector, gridDetailPanelExpandedRowsContentCacheSelector, gridDetailPanelExpandedRowsHeightCacheSelector } from './gridDetailPanelSelector';
|
|
7
7
|
export const detailPanelStateInitializer = (state, props) => {
|
|
@@ -33,11 +33,19 @@ export const useGridDetailPanel = (apiRef, props) => {
|
|
|
33
33
|
apiRef.current.toggleDetailPanel(params.id);
|
|
34
34
|
}, [apiRef, contentCache, props.getDetailPanelContent]);
|
|
35
35
|
const handleCellKeyDown = React.useCallback((params, event) => {
|
|
36
|
-
if (
|
|
36
|
+
if (props.getDetailPanelContent == null) {
|
|
37
37
|
return;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
if ((event.ctrlKey || event.metaKey) && event.key === 'Enter') {
|
|
41
|
+
// TODO v6: only support Space on the detail toggle
|
|
42
|
+
apiRef.current.toggleDetailPanel(params.id);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (params.field === GRID_DETAIL_PANEL_TOGGLE_FIELD && event.key === ' ') {
|
|
47
|
+
apiRef.current.toggleDetailPanel(params.id);
|
|
48
|
+
}
|
|
41
49
|
}, [apiRef, props.getDetailPanelContent]);
|
|
42
50
|
useGridApiEventHandler(apiRef, GridEvents.cellClick, handleCellClick);
|
|
43
51
|
useGridApiEventHandler(apiRef, GridEvents.cellKeyDown, handleCellKeyDown);
|
|
@@ -54,7 +62,7 @@ export const useGridDetailPanel = (apiRef, props) => {
|
|
|
54
62
|
|
|
55
63
|
});
|
|
56
64
|
}, [apiRef, expandedRowIds]);
|
|
57
|
-
|
|
65
|
+
useGridRegisterPipeProcessor(apiRef, 'rowHeight', addDetailHeight);
|
|
58
66
|
apiRef.current.unstable_updateControlState({
|
|
59
67
|
stateId: 'detailPanels',
|
|
60
68
|
propModel: props.detailPanelExpandedRowIds,
|
|
@@ -39,7 +39,7 @@ export const useGridDetailPanelCache = (apiRef, props) => {
|
|
|
39
39
|
});
|
|
40
40
|
apiRef.current.forceUpdate();
|
|
41
41
|
}, [apiRef, props.getDetailPanelContent, props.getDetailPanelHeight]);
|
|
42
|
-
useGridApiEventHandler(apiRef, GridEvents.
|
|
42
|
+
useGridApiEventHandler(apiRef, GridEvents.sortedRowsSet, updateCaches);
|
|
43
43
|
const isFirstRender = React.useRef(true);
|
|
44
44
|
|
|
45
45
|
if (isFirstRender.current) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { useGridRegisterPipeProcessor } from '@mui/x-data-grid/internals';
|
|
3
3
|
import { GRID_DETAIL_PANEL_TOGGLE_FIELD, GRID_DETAIL_PANEL_TOGGLE_COL_DEF } from './gridDetailPanelToggleColDef';
|
|
4
4
|
export const useGridDetailPanelPreProcessors = (apiRef, props) => {
|
|
5
5
|
const addToggleColumn = React.useCallback(columnsState => {
|
|
@@ -24,5 +24,5 @@ export const useGridDetailPanelPreProcessors = (apiRef, props) => {
|
|
|
24
24
|
columnsState.lookup[GRID_DETAIL_PANEL_TOGGLE_FIELD] = GRID_DETAIL_PANEL_TOGGLE_COL_DEF;
|
|
25
25
|
return columnsState;
|
|
26
26
|
}, [props.getDetailPanelContent]);
|
|
27
|
-
|
|
27
|
+
useGridRegisterPipeProcessor(apiRef, 'hydrateColumns', addToggleColumn);
|
|
28
28
|
};
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import Divider from '@mui/material/Divider';
|
|
4
4
|
import { GridEvents, useGridApiEventHandler, useGridApiMethod, gridFilteredDescendantCountLookupSelector } from '@mui/x-data-grid';
|
|
5
|
-
import {
|
|
5
|
+
import { useGridRegisterPipeProcessor, isDeepEqual } from '@mui/x-data-grid/internals';
|
|
6
6
|
import { gridRowGroupingModelSelector, gridRowGroupingSanitizedModelSelector, gridRowGroupingStateSelector } from './gridRowGroupingSelector';
|
|
7
7
|
import { getRowGroupingFieldFromGroupingCriteria, ROW_GROUPING_STRATEGY, isGroupingColumn, mergeStateWithRowGroupingModel, setStrategyAvailability } from './gridRowGroupingUtils';
|
|
8
8
|
import { GridRowGroupableColumnMenuItems } from '../../../components/GridRowGroupableColumnMenuItems';
|
|
@@ -137,9 +137,9 @@ export const useGridRowGrouping = (apiRef, props) => {
|
|
|
137
137
|
|
|
138
138
|
return params;
|
|
139
139
|
}, [apiRef, props.disableRowGrouping]);
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
140
|
+
useGridRegisterPipeProcessor(apiRef, 'columnMenu', addColumnMenuButtons);
|
|
141
|
+
useGridRegisterPipeProcessor(apiRef, 'exportState', stateExportPreProcessing);
|
|
142
|
+
useGridRegisterPipeProcessor(apiRef, 'restoreState', stateRestorePreProcessing);
|
|
143
143
|
/**
|
|
144
144
|
* EVENTS
|
|
145
145
|
*/
|
|
@@ -169,10 +169,8 @@ export const useGridRowGrouping = (apiRef, props) => {
|
|
|
169
169
|
rowGrouping: _extends({}, state.rowGrouping, {
|
|
170
170
|
unstable_sanitizedModelOnLastRowTreeCreation: rowGroupingModel
|
|
171
171
|
})
|
|
172
|
-
}));
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
apiRef.current.updateColumns([]);
|
|
172
|
+
}));
|
|
173
|
+
apiRef.current.unstable_requestPipeProcessorsApplication('hydrateColumns');
|
|
176
174
|
setStrategyAvailability(apiRef, props.disableRowGrouping); // Refresh the row tree creation strategy processing
|
|
177
175
|
// TODO: Add a clean way to re-run a strategy processing without publishing a private event
|
|
178
176
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { gridColumnLookupSelector, gridRowIdsSelector, gridRowTreeSelector, useFirstRender } from '@mui/x-data-grid';
|
|
4
|
-
import {
|
|
4
|
+
import { useGridRegisterPipeProcessor, useGridRegisterStrategyProcessor } from '@mui/x-data-grid/internals';
|
|
5
5
|
import { gridRowGroupingModelSelector, gridRowGroupingSanitizedModelSelector } from './gridRowGroupingSelector';
|
|
6
6
|
import { createGroupingColDefForAllGroupingCriteria, createGroupingColDefForOneGroupingCriteria } from './createGroupingColDef';
|
|
7
7
|
import { filterRowTreeFromGroupingColumns, getColDefOverrides, ROW_GROUPING_STRATEGY, isGroupingColumn, setStrategyAvailability } from './gridRowGroupingUtils';
|
|
@@ -177,7 +177,7 @@ export const useGridRowGroupingPreProcessors = (apiRef, props) => {
|
|
|
177
177
|
disableChildrenSorting: false
|
|
178
178
|
});
|
|
179
179
|
}, [apiRef]);
|
|
180
|
-
|
|
180
|
+
useGridRegisterPipeProcessor(apiRef, 'hydrateColumns', updateGroupingColumn);
|
|
181
181
|
useGridRegisterStrategyProcessor(apiRef, ROW_GROUPING_STRATEGY, 'rowTreeCreation', createRowTree);
|
|
182
182
|
useGridRegisterStrategyProcessor(apiRef, ROW_GROUPING_STRATEGY, 'filtering', filterRows);
|
|
183
183
|
useGridRegisterStrategyProcessor(apiRef, ROW_GROUPING_STRATEGY, 'sorting', sortRows);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import { GRID_STRING_COL_DEF } from '@mui/x-data-grid';
|
|
3
|
+
import { renderRowReorderCell } from '../../../components/GridRowReorderCell';
|
|
4
|
+
export const GRID_REORDER_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
|
|
5
|
+
field: '__reorder__',
|
|
6
|
+
type: 'reorder',
|
|
7
|
+
sortable: false,
|
|
8
|
+
filterable: false,
|
|
9
|
+
width: 50,
|
|
10
|
+
align: 'center',
|
|
11
|
+
headerAlign: 'center',
|
|
12
|
+
disableColumnMenu: true,
|
|
13
|
+
disableExport: true,
|
|
14
|
+
disableReorder: true,
|
|
15
|
+
resizable: false,
|
|
16
|
+
renderHeader: () => ' ',
|
|
17
|
+
renderCell: renderRowReorderCell
|
|
18
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './gridRowReorderColDef';
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
3
|
+
import { useGridLogger, GridEvents, useGridApiEventHandler, getDataGridUtilityClass, useGridSelector, gridSortModelSelector, gridRowTreeDepthSelector, useGridApiOptionHandler, gridEditRowsStateSelector } from '@mui/x-data-grid';
|
|
4
|
+
|
|
5
|
+
const useUtilityClasses = ownerState => {
|
|
6
|
+
const {
|
|
7
|
+
classes
|
|
8
|
+
} = ownerState;
|
|
9
|
+
const slots = {
|
|
10
|
+
rowDragging: ['row--dragging']
|
|
11
|
+
};
|
|
12
|
+
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Only available in DataGridPro
|
|
16
|
+
* @requires useGridRows (method)
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
export const useGridRowReorder = (apiRef, props) => {
|
|
21
|
+
const logger = useGridLogger(apiRef, 'useGridRowReorder');
|
|
22
|
+
const sortModel = useGridSelector(apiRef, gridSortModelSelector);
|
|
23
|
+
const treeDepth = useGridSelector(apiRef, gridRowTreeDepthSelector);
|
|
24
|
+
const dragRowNode = React.useRef(null);
|
|
25
|
+
const originRowIndex = React.useRef(null);
|
|
26
|
+
const removeDnDStylesTimeout = React.useRef();
|
|
27
|
+
const ownerState = {
|
|
28
|
+
classes: props.classes
|
|
29
|
+
};
|
|
30
|
+
const classes = useUtilityClasses(ownerState);
|
|
31
|
+
const [dragRowId, setDragRowId] = React.useState('');
|
|
32
|
+
React.useEffect(() => {
|
|
33
|
+
return () => {
|
|
34
|
+
clearTimeout(removeDnDStylesTimeout.current);
|
|
35
|
+
};
|
|
36
|
+
}, []); // TODO: remove sortModel check once row reorder is sorting compatible
|
|
37
|
+
// remove treeDepth once row reorder is tree compatible
|
|
38
|
+
|
|
39
|
+
const isRowReorderDisabled = React.useMemo(() => {
|
|
40
|
+
return !props.rowReordering || !!sortModel.length || treeDepth !== 1;
|
|
41
|
+
}, [props.rowReordering, sortModel, treeDepth]);
|
|
42
|
+
const handleDragStart = React.useCallback((params, event) => {
|
|
43
|
+
// Call the gridEditRowsStateSelector directly to avoid infnite loop
|
|
44
|
+
const editRowsState = gridEditRowsStateSelector(apiRef.current.state);
|
|
45
|
+
|
|
46
|
+
if (isRowReorderDisabled || Object.keys(editRowsState).length !== 0) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
logger.debug(`Start dragging row ${params.id}`); // Prevent drag events propagation.
|
|
51
|
+
// For more information check here https://github.com/mui/mui-x/issues/2680.
|
|
52
|
+
|
|
53
|
+
event.stopPropagation();
|
|
54
|
+
dragRowNode.current = event.currentTarget;
|
|
55
|
+
dragRowNode.current.classList.add(classes.rowDragging);
|
|
56
|
+
setDragRowId(params.id);
|
|
57
|
+
removeDnDStylesTimeout.current = setTimeout(() => {
|
|
58
|
+
dragRowNode.current.classList.remove(classes.rowDragging);
|
|
59
|
+
});
|
|
60
|
+
originRowIndex.current = apiRef.current.getRowIndex(params.id);
|
|
61
|
+
}, [isRowReorderDisabled, classes.rowDragging, logger, apiRef]);
|
|
62
|
+
const handleDragOver = React.useCallback((params, event) => {
|
|
63
|
+
logger.debug(`Dragging over row ${params.id}`);
|
|
64
|
+
event.preventDefault(); // Prevent drag events propagation.
|
|
65
|
+
// For more information check here https://github.com/mui/mui-x/issues/2680.
|
|
66
|
+
|
|
67
|
+
event.stopPropagation();
|
|
68
|
+
|
|
69
|
+
if (params.id !== dragRowId) {
|
|
70
|
+
const targetRowIndex = apiRef.current.getRowIndex(params.id);
|
|
71
|
+
apiRef.current.setRowIndex(dragRowId, targetRowIndex);
|
|
72
|
+
}
|
|
73
|
+
}, [apiRef, logger, dragRowId]);
|
|
74
|
+
const handleDragEnd = React.useCallback((params, event) => {
|
|
75
|
+
// Call the gridEditRowsStateSelector directly to avoid infnite loop
|
|
76
|
+
const editRowsState = gridEditRowsStateSelector(apiRef.current.state);
|
|
77
|
+
|
|
78
|
+
if (isRowReorderDisabled || Object.keys(editRowsState).length !== 0) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
logger.debug('End dragging row');
|
|
83
|
+
event.preventDefault(); // Prevent drag events propagation.
|
|
84
|
+
// For more information check here https://github.com/mui/mui-x/issues/2680.
|
|
85
|
+
|
|
86
|
+
event.stopPropagation();
|
|
87
|
+
clearTimeout(removeDnDStylesTimeout.current);
|
|
88
|
+
dragRowNode.current = null; // Check if the row was dropped outside the grid.
|
|
89
|
+
|
|
90
|
+
if (event.dataTransfer.dropEffect === 'none') {
|
|
91
|
+
// Accessing params.field may contain the wrong field as header elements are reused
|
|
92
|
+
apiRef.current.setRowIndex(dragRowId, originRowIndex.current);
|
|
93
|
+
originRowIndex.current = null;
|
|
94
|
+
} else {
|
|
95
|
+
// Emit the rowOrderChange event only once when the reordering stops.
|
|
96
|
+
const rowOrderChangeParams = {
|
|
97
|
+
row: apiRef.current.getRow(dragRowId),
|
|
98
|
+
targetIndex: apiRef.current.getRowIndex(params.id),
|
|
99
|
+
oldIndex: originRowIndex.current
|
|
100
|
+
};
|
|
101
|
+
apiRef.current.publishEvent(GridEvents.rowOrderChange, rowOrderChangeParams);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
setDragRowId('');
|
|
105
|
+
}, [isRowReorderDisabled, logger, apiRef, dragRowId]);
|
|
106
|
+
useGridApiEventHandler(apiRef, GridEvents.rowDragStart, handleDragStart);
|
|
107
|
+
useGridApiEventHandler(apiRef, GridEvents.rowDragOver, handleDragOver);
|
|
108
|
+
useGridApiEventHandler(apiRef, GridEvents.rowDragEnd, handleDragEnd);
|
|
109
|
+
useGridApiEventHandler(apiRef, GridEvents.cellDragOver, handleDragOver);
|
|
110
|
+
useGridApiOptionHandler(apiRef, GridEvents.rowOrderChange, props.onRowOrderChange);
|
|
111
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
4
|
+
import { getDataGridUtilityClass } from '@mui/x-data-grid';
|
|
5
|
+
import { useGridRegisterPipeProcessor } from '@mui/x-data-grid/internals';
|
|
6
|
+
import { GRID_REORDER_COL_DEF } from './gridRowReorderColDef';
|
|
7
|
+
|
|
8
|
+
const useUtilityClasses = ownerState => {
|
|
9
|
+
const {
|
|
10
|
+
classes
|
|
11
|
+
} = ownerState;
|
|
12
|
+
return React.useMemo(() => {
|
|
13
|
+
const slots = {
|
|
14
|
+
rowReorderCellContainer: ['rowReorderCellContainer'],
|
|
15
|
+
columnHeaderReorder: ['columnHeaderReorder']
|
|
16
|
+
};
|
|
17
|
+
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
18
|
+
}, [classes]);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const useGridRowReorderPreProcessors = (apiRef, props) => {
|
|
22
|
+
const ownerState = {
|
|
23
|
+
classes: props.classes
|
|
24
|
+
};
|
|
25
|
+
const classes = useUtilityClasses(ownerState);
|
|
26
|
+
const updateReorderColumn = React.useCallback(columnsState => {
|
|
27
|
+
const reorderColumn = _extends({}, GRID_REORDER_COL_DEF, {
|
|
28
|
+
cellClassName: classes.rowReorderCellContainer,
|
|
29
|
+
headerClassName: classes.columnHeaderReorder,
|
|
30
|
+
headerName: apiRef.current.getLocaleText('rowReorderingHeaderName')
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const shouldHaveReorderColumn = props.rowReordering;
|
|
34
|
+
const haveReorderColumn = columnsState.lookup[reorderColumn.field] != null;
|
|
35
|
+
|
|
36
|
+
if (shouldHaveReorderColumn && haveReorderColumn) {
|
|
37
|
+
return columnsState;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (shouldHaveReorderColumn && !haveReorderColumn) {
|
|
41
|
+
columnsState.lookup[reorderColumn.field] = reorderColumn;
|
|
42
|
+
columnsState.all = [reorderColumn.field, ...columnsState.all];
|
|
43
|
+
} else if (!shouldHaveReorderColumn && haveReorderColumn) {
|
|
44
|
+
delete columnsState.lookup[reorderColumn.field];
|
|
45
|
+
columnsState.all = columnsState.all.filter(field => field !== reorderColumn.field);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return columnsState;
|
|
49
|
+
}, [apiRef, classes, props.rowReordering]);
|
|
50
|
+
useGridRegisterPipeProcessor(apiRef, 'hydrateColumns', updateReorderColumn);
|
|
51
|
+
};
|
|
@@ -12,8 +12,6 @@ export const useGridTreeData = apiRef => {
|
|
|
12
12
|
const cellParams = apiRef.current.getCellParams(params.id, params.field);
|
|
13
13
|
|
|
14
14
|
if (cellParams.colDef.type === 'treeDataGroup' && event.key === ' ' && !event.shiftKey) {
|
|
15
|
-
event.stopPropagation();
|
|
16
|
-
event.preventDefault();
|
|
17
15
|
const filteredDescendantCount = gridFilteredDescendantCountLookupSelector(apiRef)[params.id] ?? 0;
|
|
18
16
|
|
|
19
17
|
if (filteredDescendantCount === 0) {
|
|
@@ -3,7 +3,7 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
3
3
|
const _excluded = ["hideDescendantCount"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { gridRowIdsSelector, gridRowTreeSelector, useFirstRender } from '@mui/x-data-grid';
|
|
6
|
-
import {
|
|
6
|
+
import { useGridRegisterPipeProcessor, useGridRegisterStrategyProcessor } from '@mui/x-data-grid/internals';
|
|
7
7
|
import { GRID_TREE_DATA_GROUPING_COL_DEF, GRID_TREE_DATA_GROUPING_COL_DEF_FORCED_PROPERTIES } from './gridTreeDataGroupColDef';
|
|
8
8
|
import { filterRowTreeFromTreeData, TREE_DATA_STRATEGY } from './gridTreeDataUtils';
|
|
9
9
|
import { GridTreeDataGroupingCell } from '../../../components';
|
|
@@ -110,7 +110,7 @@ export const useGridTreeDataPreProcessors = (apiRef, props) => {
|
|
|
110
110
|
disableChildrenSorting: props.disableChildrenSorting
|
|
111
111
|
});
|
|
112
112
|
}, [apiRef, props.disableChildrenSorting]);
|
|
113
|
-
|
|
113
|
+
useGridRegisterPipeProcessor(apiRef, 'hydrateColumns', updateGroupingColumn);
|
|
114
114
|
useGridRegisterStrategyProcessor(apiRef, TREE_DATA_STRATEGY, 'rowTreeCreation', createRowTree);
|
|
115
115
|
useGridRegisterStrategyProcessor(apiRef, TREE_DATA_STRATEGY, 'filtering', filterRows);
|
|
116
116
|
useGridRegisterStrategyProcessor(apiRef, TREE_DATA_STRATEGY, 'sorting', sortRows);
|
package/modern/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MUI v5.
|
|
1
|
+
/** @license MUI v5.10.0
|
|
2
2
|
*
|
|
3
3
|
* This source code is licensed under the MIT license found in the
|
|
4
4
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -11,8 +11,8 @@ export * from '@mui/x-data-grid/hooks';
|
|
|
11
11
|
export * from '@mui/x-data-grid/locales';
|
|
12
12
|
export * from '@mui/x-data-grid/models';
|
|
13
13
|
export * from '@mui/x-data-grid/context';
|
|
14
|
-
export * from '@mui/x-data-grid/colDef';
|
|
15
14
|
export * from '@mui/x-data-grid/utils';
|
|
15
|
+
export * from '@mui/x-data-grid/colDef';
|
|
16
16
|
export * from './DataGridPro';
|
|
17
17
|
export * from './hooks';
|
|
18
18
|
export * from './models';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|