@mui/x-data-grid-premium 7.21.0 → 7.22.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 +80 -0
- package/DataGridPremium/useDataGridPremiumComponent.js +2 -0
- package/components/GridDataSourceGroupingCriteriaCell.d.ts +7 -0
- package/components/GridDataSourceGroupingCriteriaCell.js +134 -0
- package/esm/DataGridPremium/useDataGridPremiumComponent.js +2 -0
- package/esm/components/GridDataSourceGroupingCriteriaCell.js +126 -0
- package/esm/hooks/features/rowGrouping/createGroupingColDef.js +18 -8
- package/esm/hooks/features/rowGrouping/gridRowGroupingUtils.js +10 -5
- package/esm/hooks/features/rowGrouping/useGridDataSourceRowGroupingPreProcessors.js +73 -0
- package/esm/hooks/features/rowGrouping/useGridRowGrouping.js +16 -6
- package/esm/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +17 -22
- package/esm/utils/releaseInfo.js +1 -1
- package/hooks/features/rowGrouping/createGroupingColDef.d.ts +5 -2
- package/hooks/features/rowGrouping/createGroupingColDef.js +17 -7
- package/hooks/features/rowGrouping/gridRowGroupingUtils.d.ts +7 -4
- package/hooks/features/rowGrouping/gridRowGroupingUtils.js +11 -6
- package/hooks/features/rowGrouping/useGridDataSourceRowGroupingPreProcessors.d.ts +4 -0
- package/hooks/features/rowGrouping/useGridDataSourceRowGroupingPreProcessors.js +81 -0
- package/hooks/features/rowGrouping/useGridRowGrouping.d.ts +1 -1
- package/hooks/features/rowGrouping/useGridRowGrouping.js +15 -5
- package/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.d.ts +1 -1
- package/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +16 -21
- package/index.js +1 -1
- package/modern/DataGridPremium/useDataGridPremiumComponent.js +2 -0
- package/modern/components/GridDataSourceGroupingCriteriaCell.js +126 -0
- package/modern/hooks/features/rowGrouping/createGroupingColDef.js +18 -8
- package/modern/hooks/features/rowGrouping/gridRowGroupingUtils.js +10 -5
- package/modern/hooks/features/rowGrouping/useGridDataSourceRowGroupingPreProcessors.js +73 -0
- package/modern/hooks/features/rowGrouping/useGridRowGrouping.js +16 -6
- package/modern/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +17 -22
- package/modern/index.js +1 -1
- package/modern/utils/releaseInfo.js +1 -1
- package/package.json +4 -4
- package/utils/releaseInfo.js +1 -1
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import { useGridApiEventHandler, useGridApiMethod, gridColumnLookupSelector } from '@mui/x-data-grid-pro';
|
|
4
4
|
import { useGridRegisterPipeProcessor } from '@mui/x-data-grid-pro/internals';
|
|
5
5
|
import { gridRowGroupingModelSelector, gridRowGroupingSanitizedModelSelector } from "./gridRowGroupingSelector.js";
|
|
6
|
-
import { getRowGroupingFieldFromGroupingCriteria,
|
|
6
|
+
import { getRowGroupingFieldFromGroupingCriteria, RowGroupingStrategy, isGroupingColumn, mergeStateWithRowGroupingModel, setStrategyAvailability, getGroupingRules, areGroupingRulesEqual } from "./gridRowGroupingUtils.js";
|
|
7
7
|
export const rowGroupingStateInitializer = (state, props, apiRef) => {
|
|
8
8
|
apiRef.current.caches.rowGrouping = {
|
|
9
9
|
rulesOnLastRowTreeCreation: []
|
|
@@ -29,7 +29,7 @@ export const useGridRowGrouping = (apiRef, props) => {
|
|
|
29
29
|
changeEvent: 'rowGroupingModelChange'
|
|
30
30
|
});
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
/*
|
|
33
33
|
* API METHODS
|
|
34
34
|
*/
|
|
35
35
|
const setRowGroupingModel = React.useCallback(model => {
|
|
@@ -86,6 +86,11 @@ export const useGridRowGrouping = (apiRef, props) => {
|
|
|
86
86
|
}
|
|
87
87
|
return columnMenuItems;
|
|
88
88
|
}, [props.disableRowGrouping]);
|
|
89
|
+
const addGetRowsParams = React.useCallback(params => {
|
|
90
|
+
return _extends({}, params, {
|
|
91
|
+
groupFields: gridRowGroupingModelSelector(apiRef)
|
|
92
|
+
});
|
|
93
|
+
}, [apiRef]);
|
|
89
94
|
const stateExportPreProcessing = React.useCallback((prevState, context) => {
|
|
90
95
|
const rowGroupingModelToExport = gridRowGroupingModelSelector(apiRef);
|
|
91
96
|
const shouldExportRowGroupingModel =
|
|
@@ -117,10 +122,11 @@ export const useGridRowGrouping = (apiRef, props) => {
|
|
|
117
122
|
return params;
|
|
118
123
|
}, [apiRef, props.disableRowGrouping]);
|
|
119
124
|
useGridRegisterPipeProcessor(apiRef, 'columnMenu', addColumnMenuButtons);
|
|
125
|
+
useGridRegisterPipeProcessor(apiRef, 'getRowsParams', addGetRowsParams);
|
|
120
126
|
useGridRegisterPipeProcessor(apiRef, 'exportState', stateExportPreProcessing);
|
|
121
127
|
useGridRegisterPipeProcessor(apiRef, 'restoreState', stateRestorePreProcessing);
|
|
122
128
|
|
|
123
|
-
|
|
129
|
+
/*
|
|
124
130
|
* EVENTS
|
|
125
131
|
*/
|
|
126
132
|
const handleCellKeyDown = React.useCallback((params, event) => {
|
|
@@ -135,9 +141,13 @@ export const useGridRowGrouping = (apiRef, props) => {
|
|
|
135
141
|
if (!isOnGroupingCell) {
|
|
136
142
|
return;
|
|
137
143
|
}
|
|
144
|
+
if (props.unstable_dataSource && !params.rowNode.childrenExpanded) {
|
|
145
|
+
apiRef.current.unstable_dataSource.fetchRows(params.id);
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
138
148
|
apiRef.current.setRowChildrenExpansion(params.id, !params.rowNode.childrenExpanded);
|
|
139
149
|
}
|
|
140
|
-
}, [apiRef, props.rowGroupingColumnMode]);
|
|
150
|
+
}, [apiRef, props.rowGroupingColumnMode, props.unstable_dataSource]);
|
|
141
151
|
const checkGroupingColumnsModelDiff = React.useCallback(() => {
|
|
142
152
|
const sanitizedRowGroupingModel = gridRowGroupingSanitizedModelSelector(apiRef);
|
|
143
153
|
const rulesOnLastRowTreeCreation = apiRef.current.caches.rowGrouping.rulesOnLastRowTreeCreation || [];
|
|
@@ -152,7 +162,7 @@ export const useGridRowGrouping = (apiRef, props) => {
|
|
|
152
162
|
|
|
153
163
|
// Refresh the row tree creation strategy processing
|
|
154
164
|
// TODO: Add a clean way to re-run a strategy processing without publishing a private event
|
|
155
|
-
if (apiRef.current.getActiveStrategy('rowTree') ===
|
|
165
|
+
if (apiRef.current.getActiveStrategy('rowTree') === RowGroupingStrategy.Default) {
|
|
156
166
|
apiRef.current.publishEvent('activeStrategyProcessorChange', 'rowTreeCreation');
|
|
157
167
|
}
|
|
158
168
|
}
|
|
@@ -161,7 +171,7 @@ export const useGridRowGrouping = (apiRef, props) => {
|
|
|
161
171
|
useGridApiEventHandler(apiRef, 'columnsChange', checkGroupingColumnsModelDiff);
|
|
162
172
|
useGridApiEventHandler(apiRef, 'rowGroupingModelChange', checkGroupingColumnsModelDiff);
|
|
163
173
|
|
|
164
|
-
|
|
174
|
+
/*
|
|
165
175
|
* EFFECTS
|
|
166
176
|
*/
|
|
167
177
|
React.useEffect(() => {
|
|
@@ -3,12 +3,13 @@ import { gridColumnLookupSelector, gridRowTreeSelector, useFirstRender, GRID_CHE
|
|
|
3
3
|
import { useGridRegisterPipeProcessor, useGridRegisterStrategyProcessor, sortRowTree, createRowTree, updateRowTree, getVisibleRowsLookup } from '@mui/x-data-grid-pro/internals';
|
|
4
4
|
import { gridRowGroupingModelSelector, gridRowGroupingSanitizedModelSelector } from "./gridRowGroupingSelector.js";
|
|
5
5
|
import { createGroupingColDefForAllGroupingCriteria, createGroupingColDefForOneGroupingCriteria } from "./createGroupingColDef.js";
|
|
6
|
-
import { filterRowTreeFromGroupingColumns, getColDefOverrides,
|
|
6
|
+
import { filterRowTreeFromGroupingColumns, getColDefOverrides, RowGroupingStrategy, isGroupingColumn, setStrategyAvailability, getCellGroupingCriteria, getGroupingRules } from "./gridRowGroupingUtils.js";
|
|
7
7
|
export const useGridRowGroupingPreProcessors = (apiRef, props) => {
|
|
8
8
|
const getGroupingColDefs = React.useCallback(columnsState => {
|
|
9
9
|
if (props.disableRowGrouping) {
|
|
10
10
|
return [];
|
|
11
11
|
}
|
|
12
|
+
const strategy = props.unstable_dataSource ? RowGroupingStrategy.DataSource : RowGroupingStrategy.Default;
|
|
12
13
|
const groupingColDefProp = props.groupingColDef;
|
|
13
14
|
|
|
14
15
|
// We can't use `gridGroupingRowsSanitizedModelSelector` here because the new columns are not in the state yet
|
|
@@ -22,8 +23,9 @@ export const useGridRowGroupingPreProcessors = (apiRef, props) => {
|
|
|
22
23
|
return [createGroupingColDefForAllGroupingCriteria({
|
|
23
24
|
apiRef,
|
|
24
25
|
rowGroupingModel,
|
|
25
|
-
colDefOverride: getColDefOverrides(groupingColDefProp, rowGroupingModel),
|
|
26
|
-
columnsLookup: columnsState.lookup
|
|
26
|
+
colDefOverride: getColDefOverrides(groupingColDefProp, rowGroupingModel, strategy),
|
|
27
|
+
columnsLookup: columnsState.lookup,
|
|
28
|
+
strategy
|
|
27
29
|
})];
|
|
28
30
|
}
|
|
29
31
|
case 'multiple':
|
|
@@ -32,7 +34,8 @@ export const useGridRowGroupingPreProcessors = (apiRef, props) => {
|
|
|
32
34
|
groupingCriteria,
|
|
33
35
|
colDefOverride: getColDefOverrides(groupingColDefProp, [groupingCriteria]),
|
|
34
36
|
groupedByColDef: columnsState.lookup[groupingCriteria],
|
|
35
|
-
columnsLookup: columnsState.lookup
|
|
37
|
+
columnsLookup: columnsState.lookup,
|
|
38
|
+
strategy
|
|
36
39
|
}));
|
|
37
40
|
}
|
|
38
41
|
default:
|
|
@@ -40,7 +43,7 @@ export const useGridRowGroupingPreProcessors = (apiRef, props) => {
|
|
|
40
43
|
return [];
|
|
41
44
|
}
|
|
42
45
|
}
|
|
43
|
-
}, [apiRef, props.groupingColDef, props.rowGroupingColumnMode, props.disableRowGrouping]);
|
|
46
|
+
}, [apiRef, props.groupingColDef, props.rowGroupingColumnMode, props.disableRowGrouping, props.unstable_dataSource]);
|
|
44
47
|
const updateGroupingColumn = React.useCallback(columnsState => {
|
|
45
48
|
const groupingColDefs = getGroupingColDefs(columnsState);
|
|
46
49
|
let newColumnFields = [];
|
|
@@ -100,7 +103,7 @@ export const useGridRowGroupingPreProcessors = (apiRef, props) => {
|
|
|
100
103
|
nodes: params.updates.rows.map(getRowTreeBuilderNode),
|
|
101
104
|
defaultGroupingExpansionDepth: props.defaultGroupingExpansionDepth,
|
|
102
105
|
isGroupExpandedByDefault: props.isGroupExpandedByDefault,
|
|
103
|
-
groupingName:
|
|
106
|
+
groupingName: RowGroupingStrategy.Default
|
|
104
107
|
});
|
|
105
108
|
}
|
|
106
109
|
return updateRowTree({
|
|
@@ -113,7 +116,7 @@ export const useGridRowGroupingPreProcessors = (apiRef, props) => {
|
|
|
113
116
|
previousTreeDepth: params.previousTreeDepths,
|
|
114
117
|
defaultGroupingExpansionDepth: props.defaultGroupingExpansionDepth,
|
|
115
118
|
isGroupExpandedByDefault: props.isGroupExpandedByDefault,
|
|
116
|
-
groupingName:
|
|
119
|
+
groupingName: RowGroupingStrategy.Default
|
|
117
120
|
});
|
|
118
121
|
}, [apiRef, props.defaultGroupingExpansionDepth, props.isGroupExpandedByDefault]);
|
|
119
122
|
const filterRows = React.useCallback(params => {
|
|
@@ -135,27 +138,19 @@ export const useGridRowGroupingPreProcessors = (apiRef, props) => {
|
|
|
135
138
|
});
|
|
136
139
|
}, [apiRef]);
|
|
137
140
|
useGridRegisterPipeProcessor(apiRef, 'hydrateColumns', updateGroupingColumn);
|
|
138
|
-
useGridRegisterStrategyProcessor(apiRef,
|
|
139
|
-
useGridRegisterStrategyProcessor(apiRef,
|
|
140
|
-
useGridRegisterStrategyProcessor(apiRef,
|
|
141
|
-
useGridRegisterStrategyProcessor(apiRef,
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* 1ST RENDER
|
|
145
|
-
*/
|
|
141
|
+
useGridRegisterStrategyProcessor(apiRef, RowGroupingStrategy.Default, 'rowTreeCreation', createRowTreeForRowGrouping);
|
|
142
|
+
useGridRegisterStrategyProcessor(apiRef, RowGroupingStrategy.Default, 'filtering', filterRows);
|
|
143
|
+
useGridRegisterStrategyProcessor(apiRef, RowGroupingStrategy.Default, 'sorting', sortRows);
|
|
144
|
+
useGridRegisterStrategyProcessor(apiRef, RowGroupingStrategy.Default, 'visibleRowsLookupCreation', getVisibleRowsLookup);
|
|
146
145
|
useFirstRender(() => {
|
|
147
|
-
setStrategyAvailability(apiRef, props.disableRowGrouping);
|
|
146
|
+
setStrategyAvailability(apiRef, props.disableRowGrouping, props.unstable_dataSource);
|
|
148
147
|
});
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* EFFECTS
|
|
152
|
-
*/
|
|
153
148
|
const isFirstRender = React.useRef(true);
|
|
154
149
|
React.useEffect(() => {
|
|
155
150
|
if (!isFirstRender.current) {
|
|
156
|
-
setStrategyAvailability(apiRef, props.disableRowGrouping);
|
|
151
|
+
setStrategyAvailability(apiRef, props.disableRowGrouping, props.unstable_dataSource);
|
|
157
152
|
} else {
|
|
158
153
|
isFirstRender.current = false;
|
|
159
154
|
}
|
|
160
|
-
}, [apiRef, props.disableRowGrouping]);
|
|
155
|
+
}, [apiRef, props.disableRowGrouping, props.unstable_dataSource]);
|
|
161
156
|
};
|
package/esm/utils/releaseInfo.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "
|
|
3
|
+
const releaseInfo = "MTcyOTc5NjQwMDAwMA==";
|
|
4
4
|
if (process.env.NODE_ENV !== 'production') {
|
|
5
5
|
// A simple hack to set the value in the test environment (has no build step).
|
|
6
6
|
// eslint-disable-next-line no-useless-concat
|
|
@@ -2,6 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { GridColDef, GridGroupingColDefOverride } from '@mui/x-data-grid-pro';
|
|
3
3
|
import { GridColumnRawLookup } from '@mui/x-data-grid-pro/internals';
|
|
4
4
|
import { GridApiPremium } from '../../../models/gridApiPremium';
|
|
5
|
+
import { RowGroupingStrategy } from './gridRowGroupingUtils';
|
|
5
6
|
interface CreateGroupingColDefMonoCriteriaParams {
|
|
6
7
|
columnsLookup: GridColumnRawLookup;
|
|
7
8
|
/**
|
|
@@ -17,11 +18,12 @@ interface CreateGroupingColDefMonoCriteriaParams {
|
|
|
17
18
|
* This value comes `prop.groupingColDef`.
|
|
18
19
|
*/
|
|
19
20
|
colDefOverride: GridGroupingColDefOverride | null | undefined;
|
|
21
|
+
strategy?: RowGroupingStrategy;
|
|
20
22
|
}
|
|
21
23
|
/**
|
|
22
24
|
* Creates the `GridColDef` for a grouping column that only takes care of a single grouping criteria
|
|
23
25
|
*/
|
|
24
|
-
export declare const createGroupingColDefForOneGroupingCriteria: ({ columnsLookup, groupedByColDef, groupingCriteria, colDefOverride, }: CreateGroupingColDefMonoCriteriaParams) => GridColDef;
|
|
26
|
+
export declare const createGroupingColDefForOneGroupingCriteria: ({ columnsLookup, groupedByColDef, groupingCriteria, colDefOverride, strategy, }: CreateGroupingColDefMonoCriteriaParams) => GridColDef;
|
|
25
27
|
interface CreateGroupingColDefSeveralCriteriaParams {
|
|
26
28
|
apiRef: React.MutableRefObject<GridApiPremium>;
|
|
27
29
|
columnsLookup: GridColumnRawLookup;
|
|
@@ -34,9 +36,10 @@ interface CreateGroupingColDefSeveralCriteriaParams {
|
|
|
34
36
|
* This value comes `prop.groupingColDef`.
|
|
35
37
|
*/
|
|
36
38
|
colDefOverride: GridGroupingColDefOverride | null | undefined;
|
|
39
|
+
strategy?: RowGroupingStrategy;
|
|
37
40
|
}
|
|
38
41
|
/**
|
|
39
42
|
* Creates the `GridColDef` for a grouping column that takes care of all the grouping criteria
|
|
40
43
|
*/
|
|
41
|
-
export declare const createGroupingColDefForAllGroupingCriteria: ({ apiRef, columnsLookup, rowGroupingModel, colDefOverride, }: CreateGroupingColDefSeveralCriteriaParams) => GridColDef;
|
|
44
|
+
export declare const createGroupingColDefForAllGroupingCriteria: ({ apiRef, columnsLookup, rowGroupingModel, colDefOverride, strategy, }: CreateGroupingColDefSeveralCriteriaParams) => GridColDef;
|
|
42
45
|
export {};
|
|
@@ -13,6 +13,7 @@ var _xDataGridPro = require("@mui/x-data-grid-pro");
|
|
|
13
13
|
var _internals = require("@mui/x-data-grid-pro/internals");
|
|
14
14
|
var _GridGroupingColumnFooterCell = require("../../../components/GridGroupingColumnFooterCell");
|
|
15
15
|
var _GridGroupingCriteriaCell = require("../../../components/GridGroupingCriteriaCell");
|
|
16
|
+
var _GridDataSourceGroupingCriteriaCell = require("../../../components/GridDataSourceGroupingCriteriaCell");
|
|
16
17
|
var _GridGroupingColumnLeafCell = require("../../../components/GridGroupingColumnLeafCell");
|
|
17
18
|
var _gridRowGroupingUtils = require("./gridRowGroupingUtils");
|
|
18
19
|
var _gridRowGroupingSelector = require("./gridRowGroupingSelector");
|
|
@@ -23,10 +24,15 @@ const GROUPING_COL_DEF_DEFAULT_PROPERTIES = (0, _extends2.default)({}, _xDataGri
|
|
|
23
24
|
type: 'custom',
|
|
24
25
|
disableReorder: true
|
|
25
26
|
});
|
|
26
|
-
const
|
|
27
|
+
const GROUPING_COL_DEF_FORCED_PROPERTIES_DEFAULT = {
|
|
27
28
|
editable: false,
|
|
28
29
|
groupable: false
|
|
29
30
|
};
|
|
31
|
+
const GROUPING_COL_DEF_FORCED_PROPERTIES_DATA_SOURCE = (0, _extends2.default)({}, GROUPING_COL_DEF_FORCED_PROPERTIES_DEFAULT, {
|
|
32
|
+
// TODO: Support these features on the grouping column(s)
|
|
33
|
+
filterable: false,
|
|
34
|
+
sortable: false
|
|
35
|
+
});
|
|
30
36
|
|
|
31
37
|
/**
|
|
32
38
|
* When sorting two cells with different grouping criteria, we consider that the cell with the grouping criteria coming first in the model should be displayed below.
|
|
@@ -92,7 +98,8 @@ const createGroupingColDefForOneGroupingCriteria = ({
|
|
|
92
98
|
columnsLookup,
|
|
93
99
|
groupedByColDef,
|
|
94
100
|
groupingCriteria,
|
|
95
|
-
colDefOverride
|
|
101
|
+
colDefOverride,
|
|
102
|
+
strategy = _gridRowGroupingUtils.RowGroupingStrategy.Default
|
|
96
103
|
}) => {
|
|
97
104
|
const _ref = colDefOverride ?? {},
|
|
98
105
|
{
|
|
@@ -102,6 +109,7 @@ const createGroupingColDefForOneGroupingCriteria = ({
|
|
|
102
109
|
} = _ref,
|
|
103
110
|
colDefOverrideProperties = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
|
|
104
111
|
const leafColDef = leafField ? columnsLookup[leafField] : null;
|
|
112
|
+
const CriteriaCell = strategy === _gridRowGroupingUtils.RowGroupingStrategy.Default ? _GridGroupingCriteriaCell.GridGroupingCriteriaCell : _GridDataSourceGroupingCriteriaCell.GridDataSourceGroupingCriteriaCell;
|
|
105
113
|
|
|
106
114
|
// The properties that do not depend on the presence of a `leafColDef` and that can be overridden by `colDefOverride`
|
|
107
115
|
const commonProperties = {
|
|
@@ -129,7 +137,7 @@ const createGroupingColDefForOneGroupingCriteria = ({
|
|
|
129
137
|
|
|
130
138
|
// Render current grouping criteria groups
|
|
131
139
|
if (params.rowNode.groupingField === groupingCriteria) {
|
|
132
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
140
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(CriteriaCell, (0, _extends2.default)({}, params, {
|
|
133
141
|
hideDescendantCount: hideDescendantCount
|
|
134
142
|
}));
|
|
135
143
|
}
|
|
@@ -174,7 +182,7 @@ const createGroupingColDefForOneGroupingCriteria = ({
|
|
|
174
182
|
// The properties that can't be overridden with `colDefOverride`
|
|
175
183
|
const forcedProperties = (0, _extends2.default)({
|
|
176
184
|
field: (0, _gridRowGroupingUtils.getRowGroupingFieldFromGroupingCriteria)(groupingCriteria)
|
|
177
|
-
},
|
|
185
|
+
}, GROUPING_COL_DEF_FORCED_PROPERTIES_DEFAULT);
|
|
178
186
|
return (0, _extends2.default)({}, GROUPING_COL_DEF_DEFAULT_PROPERTIES, commonProperties, sourceProperties, colDefOverrideProperties, forcedProperties);
|
|
179
187
|
};
|
|
180
188
|
exports.createGroupingColDefForOneGroupingCriteria = createGroupingColDefForOneGroupingCriteria;
|
|
@@ -185,7 +193,8 @@ const createGroupingColDefForAllGroupingCriteria = ({
|
|
|
185
193
|
apiRef,
|
|
186
194
|
columnsLookup,
|
|
187
195
|
rowGroupingModel,
|
|
188
|
-
colDefOverride
|
|
196
|
+
colDefOverride,
|
|
197
|
+
strategy = _gridRowGroupingUtils.RowGroupingStrategy.Default
|
|
189
198
|
}) => {
|
|
190
199
|
const _ref2 = colDefOverride ?? {},
|
|
191
200
|
{
|
|
@@ -195,6 +204,7 @@ const createGroupingColDefForAllGroupingCriteria = ({
|
|
|
195
204
|
} = _ref2,
|
|
196
205
|
colDefOverrideProperties = (0, _objectWithoutPropertiesLoose2.default)(_ref2, _excluded2);
|
|
197
206
|
const leafColDef = leafField ? columnsLookup[leafField] : null;
|
|
207
|
+
const CriteriaCell = strategy === _gridRowGroupingUtils.RowGroupingStrategy.Default ? _GridGroupingCriteriaCell.GridGroupingCriteriaCell : _GridDataSourceGroupingCriteriaCell.GridDataSourceGroupingCriteriaCell;
|
|
198
208
|
|
|
199
209
|
// The properties that do not depend on the presence of a `leafColDef` and that can be overridden by `colDefOverride`
|
|
200
210
|
const commonProperties = {
|
|
@@ -222,7 +232,7 @@ const createGroupingColDefForAllGroupingCriteria = ({
|
|
|
222
232
|
}
|
|
223
233
|
|
|
224
234
|
// Render the groups
|
|
225
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
235
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(CriteriaCell, (0, _extends2.default)({}, params, {
|
|
226
236
|
hideDescendantCount: hideDescendantCount
|
|
227
237
|
}));
|
|
228
238
|
},
|
|
@@ -262,7 +272,7 @@ const createGroupingColDefForAllGroupingCriteria = ({
|
|
|
262
272
|
// The properties that can't be overridden with `colDefOverride`
|
|
263
273
|
const forcedProperties = (0, _extends2.default)({
|
|
264
274
|
field: _gridRowGroupingUtils.GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD
|
|
265
|
-
},
|
|
275
|
+
}, strategy === _gridRowGroupingUtils.RowGroupingStrategy.Default ? GROUPING_COL_DEF_FORCED_PROPERTIES_DEFAULT : GROUPING_COL_DEF_FORCED_PROPERTIES_DATA_SOURCE);
|
|
266
276
|
return (0, _extends2.default)({}, GROUPING_COL_DEF_DEFAULT_PROPERTIES, commonProperties, sourceProperties, colDefOverrideProperties, forcedProperties);
|
|
267
277
|
};
|
|
268
278
|
exports.createGroupingColDefForAllGroupingCriteria = createGroupingColDefForAllGroupingCriteria;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { GridRowTreeConfig, GridFilterState, GridFilterModel, GridRowModel, GridColDef, GridKeyValue } from '@mui/x-data-grid-pro';
|
|
2
|
+
import { GridRowTreeConfig, GridFilterState, GridFilterModel, GridRowModel, GridColDef, GridKeyValue, GridDataSource } from '@mui/x-data-grid-pro';
|
|
3
3
|
import { GridAggregatedFilterItemApplier, GridColumnRawLookup } from '@mui/x-data-grid-pro/internals';
|
|
4
4
|
import { DataGridPremiumProcessedProps } from '../../../models/dataGridPremiumProps';
|
|
5
5
|
import { GridGroupingRule, GridGroupingRules, GridRowGroupingModel } from './gridRowGroupingInterfaces';
|
|
6
6
|
import { GridStatePremium } from '../../../models/gridStatePremium';
|
|
7
7
|
import { GridPrivateApiPremium } from '../../../models/gridApiPremium';
|
|
8
8
|
export declare const GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD = "__row_group_by_columns_group__";
|
|
9
|
-
export declare
|
|
9
|
+
export declare enum RowGroupingStrategy {
|
|
10
|
+
Default = "grouping-columns",
|
|
11
|
+
DataSource = "grouping-columns-data-source"
|
|
12
|
+
}
|
|
10
13
|
export declare const getRowGroupingFieldFromGroupingCriteria: (groupingCriteria: string | null) => string;
|
|
11
14
|
export declare const getRowGroupingCriteriaFromGroupingField: (groupingColDefField: string) => string | null;
|
|
12
15
|
export declare const isGroupingColumn: (field: string) => boolean;
|
|
@@ -23,9 +26,9 @@ interface FilterRowTreeFromTreeDataParams {
|
|
|
23
26
|
* - It is passing the filter
|
|
24
27
|
*/
|
|
25
28
|
export declare const filterRowTreeFromGroupingColumns: (params: FilterRowTreeFromTreeDataParams) => Omit<GridFilterState, "filterModel">;
|
|
26
|
-
export declare const getColDefOverrides: (groupingColDefProp: DataGridPremiumProcessedProps["groupingColDef"], fields: string[]) => import("@mui/x-data-grid-pro").GridGroupingColDefOverride<any> | null | undefined;
|
|
29
|
+
export declare const getColDefOverrides: (groupingColDefProp: DataGridPremiumProcessedProps["groupingColDef"], fields: string[], strategy?: RowGroupingStrategy) => import("@mui/x-data-grid-pro").GridGroupingColDefOverride<any> | null | undefined;
|
|
27
30
|
export declare const mergeStateWithRowGroupingModel: (rowGroupingModel: GridRowGroupingModel) => (state: GridStatePremium) => GridStatePremium;
|
|
28
|
-
export declare const setStrategyAvailability: (privateApiRef: React.MutableRefObject<GridPrivateApiPremium>, disableRowGrouping: boolean) => void;
|
|
31
|
+
export declare const setStrategyAvailability: (privateApiRef: React.MutableRefObject<GridPrivateApiPremium>, disableRowGrouping: boolean, dataSource?: GridDataSource) => void;
|
|
29
32
|
export declare const getCellGroupingCriteria: ({ row, colDef, groupingRule, apiRef, }: {
|
|
30
33
|
row: GridRowModel;
|
|
31
34
|
colDef: GridColDef;
|
|
@@ -4,12 +4,16 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.setStrategyAvailability = exports.mergeStateWithRowGroupingModel = exports.isGroupingColumn = exports.getRowGroupingFieldFromGroupingCriteria = exports.getRowGroupingCriteriaFromGroupingField = exports.getGroupingRules = exports.getColDefOverrides = exports.getCellGroupingCriteria = exports.filterRowTreeFromGroupingColumns = exports.areGroupingRulesEqual = exports.
|
|
7
|
+
exports.setStrategyAvailability = exports.mergeStateWithRowGroupingModel = exports.isGroupingColumn = exports.getRowGroupingFieldFromGroupingCriteria = exports.getRowGroupingCriteriaFromGroupingField = exports.getGroupingRules = exports.getColDefOverrides = exports.getCellGroupingCriteria = exports.filterRowTreeFromGroupingColumns = exports.areGroupingRulesEqual = exports.RowGroupingStrategy = exports.GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD = void 0;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _internals = require("@mui/x-data-grid-pro/internals");
|
|
10
10
|
var _gridRowGroupingSelector = require("./gridRowGroupingSelector");
|
|
11
11
|
const GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD = exports.GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD = '__row_group_by_columns_group__';
|
|
12
|
-
|
|
12
|
+
let RowGroupingStrategy = exports.RowGroupingStrategy = /*#__PURE__*/function (RowGroupingStrategy) {
|
|
13
|
+
RowGroupingStrategy["Default"] = "grouping-columns";
|
|
14
|
+
RowGroupingStrategy["DataSource"] = "grouping-columns-data-source";
|
|
15
|
+
return RowGroupingStrategy;
|
|
16
|
+
}({});
|
|
13
17
|
const getRowGroupingFieldFromGroupingCriteria = groupingCriteria => {
|
|
14
18
|
if (groupingCriteria === null) {
|
|
15
19
|
return GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD;
|
|
@@ -114,10 +118,10 @@ const filterRowTreeFromGroupingColumns = params => {
|
|
|
114
118
|
};
|
|
115
119
|
};
|
|
116
120
|
exports.filterRowTreeFromGroupingColumns = filterRowTreeFromGroupingColumns;
|
|
117
|
-
const getColDefOverrides = (groupingColDefProp, fields) => {
|
|
121
|
+
const getColDefOverrides = (groupingColDefProp, fields, strategy) => {
|
|
118
122
|
if (typeof groupingColDefProp === 'function') {
|
|
119
123
|
return groupingColDefProp({
|
|
120
|
-
groupingName:
|
|
124
|
+
groupingName: strategy ?? RowGroupingStrategy.Default,
|
|
121
125
|
fields
|
|
122
126
|
});
|
|
123
127
|
}
|
|
@@ -130,7 +134,7 @@ const mergeStateWithRowGroupingModel = rowGroupingModel => state => (0, _extends
|
|
|
130
134
|
})
|
|
131
135
|
});
|
|
132
136
|
exports.mergeStateWithRowGroupingModel = mergeStateWithRowGroupingModel;
|
|
133
|
-
const setStrategyAvailability = (privateApiRef, disableRowGrouping) => {
|
|
137
|
+
const setStrategyAvailability = (privateApiRef, disableRowGrouping, dataSource) => {
|
|
134
138
|
let isAvailable;
|
|
135
139
|
if (disableRowGrouping) {
|
|
136
140
|
isAvailable = () => false;
|
|
@@ -140,7 +144,8 @@ const setStrategyAvailability = (privateApiRef, disableRowGrouping) => {
|
|
|
140
144
|
return rowGroupingSanitizedModel.length > 0;
|
|
141
145
|
};
|
|
142
146
|
}
|
|
143
|
-
|
|
147
|
+
const strategy = dataSource ? RowGroupingStrategy.DataSource : RowGroupingStrategy.Default;
|
|
148
|
+
privateApiRef.current.setStrategyAvailability('rowTree', strategy, isAvailable);
|
|
144
149
|
};
|
|
145
150
|
exports.setStrategyAvailability = setStrategyAvailability;
|
|
146
151
|
const getCellGroupingCriteria = ({
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { DataGridPremiumProcessedProps } from '../../../models/dataGridPremiumProps';
|
|
3
|
+
import { GridPrivateApiPremium } from '../../../models/gridApiPremium';
|
|
4
|
+
export declare const useGridDataSourceRowGroupingPreProcessors: (apiRef: React.MutableRefObject<GridPrivateApiPremium>, props: Pick<DataGridPremiumProcessedProps, "disableRowGrouping" | "groupingColDef" | "rowGroupingColumnMode" | "defaultGroupingExpansionDepth" | "isGroupExpandedByDefault" | "unstable_dataSource">) => void;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.useGridDataSourceRowGroupingPreProcessors = void 0;
|
|
8
|
+
var React = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _xDataGridPro = require("@mui/x-data-grid-pro");
|
|
10
|
+
var _internals = require("@mui/x-data-grid-pro/internals");
|
|
11
|
+
var _gridRowGroupingUtils = require("./gridRowGroupingUtils");
|
|
12
|
+
var _gridRowGroupingSelector = require("./gridRowGroupingSelector");
|
|
13
|
+
const useGridDataSourceRowGroupingPreProcessors = (apiRef, props) => {
|
|
14
|
+
const createRowTreeForRowGrouping = React.useCallback(params => {
|
|
15
|
+
const getGroupKey = props.unstable_dataSource?.getGroupKey;
|
|
16
|
+
if (!getGroupKey) {
|
|
17
|
+
throw new Error('MUI X: No `getGroupKey` method provided with the dataSource.');
|
|
18
|
+
}
|
|
19
|
+
const getChildrenCount = props.unstable_dataSource?.getChildrenCount;
|
|
20
|
+
if (!getChildrenCount) {
|
|
21
|
+
throw new Error('MUI X: No `getChildrenCount` method provided with the dataSource.');
|
|
22
|
+
}
|
|
23
|
+
const sanitizedRowGroupingModel = (0, _gridRowGroupingSelector.gridRowGroupingSanitizedModelSelector)(apiRef);
|
|
24
|
+
const columnsLookup = (0, _xDataGridPro.gridColumnLookupSelector)(apiRef);
|
|
25
|
+
const groupingRules = (0, _gridRowGroupingUtils.getGroupingRules)({
|
|
26
|
+
sanitizedRowGroupingModel,
|
|
27
|
+
columnsLookup
|
|
28
|
+
});
|
|
29
|
+
apiRef.current.caches.rowGrouping.rulesOnLastRowTreeCreation = groupingRules;
|
|
30
|
+
const getRowTreeBuilderNode = rowId => {
|
|
31
|
+
const parentPath = params.updates.groupKeys ?? [];
|
|
32
|
+
const row = params.dataRowIdToModelLookup[rowId];
|
|
33
|
+
const groupingRule = groupingRules[parentPath.length];
|
|
34
|
+
const groupingValueGetter = groupingRule?.groupingValueGetter;
|
|
35
|
+
const leafKey = groupingValueGetter?.(row[groupingRule.field], row, columnsLookup[groupingRule.field], apiRef) ?? getGroupKey(params.dataRowIdToModelLookup[rowId]);
|
|
36
|
+
return {
|
|
37
|
+
id: rowId,
|
|
38
|
+
path: [...parentPath, leafKey ?? rowId.toString()].map((key, i) => ({
|
|
39
|
+
key,
|
|
40
|
+
field: groupingRules[i]?.field ?? null
|
|
41
|
+
})),
|
|
42
|
+
serverChildrenCount: getChildrenCount(params.dataRowIdToModelLookup[rowId]) ?? 0
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
if (params.updates.type === 'full') {
|
|
46
|
+
return (0, _internals.createRowTree)({
|
|
47
|
+
previousTree: params.previousTree,
|
|
48
|
+
nodes: params.updates.rows.map(getRowTreeBuilderNode),
|
|
49
|
+
defaultGroupingExpansionDepth: props.defaultGroupingExpansionDepth,
|
|
50
|
+
isGroupExpandedByDefault: props.isGroupExpandedByDefault,
|
|
51
|
+
groupingName: _gridRowGroupingUtils.RowGroupingStrategy.DataSource
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
return (0, _internals.updateRowTree)({
|
|
55
|
+
nodes: {
|
|
56
|
+
inserted: params.updates.actions.insert.map(getRowTreeBuilderNode),
|
|
57
|
+
modified: params.updates.actions.modify.map(getRowTreeBuilderNode),
|
|
58
|
+
removed: params.updates.actions.remove
|
|
59
|
+
},
|
|
60
|
+
previousTree: params.previousTree,
|
|
61
|
+
previousGroupsToFetch: params.previousGroupsToFetch,
|
|
62
|
+
previousTreeDepth: params.previousTreeDepths,
|
|
63
|
+
defaultGroupingExpansionDepth: props.defaultGroupingExpansionDepth,
|
|
64
|
+
isGroupExpandedByDefault: props.isGroupExpandedByDefault,
|
|
65
|
+
groupingName: _gridRowGroupingUtils.RowGroupingStrategy.DataSource
|
|
66
|
+
});
|
|
67
|
+
}, [apiRef, props.unstable_dataSource, props.defaultGroupingExpansionDepth, props.isGroupExpandedByDefault]);
|
|
68
|
+
const filterRows = React.useCallback(() => {
|
|
69
|
+
const rowTree = (0, _xDataGridPro.gridRowTreeSelector)(apiRef);
|
|
70
|
+
return (0, _internals.skipFiltering)(rowTree);
|
|
71
|
+
}, [apiRef]);
|
|
72
|
+
const sortRows = React.useCallback(() => {
|
|
73
|
+
const rowTree = (0, _xDataGridPro.gridRowTreeSelector)(apiRef);
|
|
74
|
+
return (0, _internals.skipSorting)(rowTree);
|
|
75
|
+
}, [apiRef]);
|
|
76
|
+
(0, _internals.useGridRegisterStrategyProcessor)(apiRef, _gridRowGroupingUtils.RowGroupingStrategy.DataSource, 'rowTreeCreation', createRowTreeForRowGrouping);
|
|
77
|
+
(0, _internals.useGridRegisterStrategyProcessor)(apiRef, _gridRowGroupingUtils.RowGroupingStrategy.DataSource, 'filtering', filterRows);
|
|
78
|
+
(0, _internals.useGridRegisterStrategyProcessor)(apiRef, _gridRowGroupingUtils.RowGroupingStrategy.DataSource, 'sorting', sortRows);
|
|
79
|
+
(0, _internals.useGridRegisterStrategyProcessor)(apiRef, _gridRowGroupingUtils.RowGroupingStrategy.DataSource, 'visibleRowsLookupCreation', _internals.getVisibleRowsLookup);
|
|
80
|
+
};
|
|
81
|
+
exports.useGridDataSourceRowGroupingPreProcessors = useGridDataSourceRowGroupingPreProcessors;
|
|
@@ -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: React.MutableRefObject<GridPrivateApiPremium>, props: Pick<DataGridPremiumProcessedProps, "initialState" | "rowGroupingModel" | "onRowGroupingModelChange" | "defaultGroupingExpansionDepth" | "isGroupExpandedByDefault" | "groupingColDef" | "rowGroupingColumnMode" | "disableRowGrouping" | "slotProps" | "slots">) => void;
|
|
11
|
+
export declare const useGridRowGrouping: (apiRef: React.MutableRefObject<GridPrivateApiPremium>, props: Pick<DataGridPremiumProcessedProps, "initialState" | "rowGroupingModel" | "onRowGroupingModelChange" | "defaultGroupingExpansionDepth" | "isGroupExpandedByDefault" | "groupingColDef" | "rowGroupingColumnMode" | "disableRowGrouping" | "slotProps" | "slots" | "unstable_dataSource">) => void;
|
|
@@ -38,7 +38,7 @@ const useGridRowGrouping = (apiRef, props) => {
|
|
|
38
38
|
changeEvent: 'rowGroupingModelChange'
|
|
39
39
|
});
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
/*
|
|
42
42
|
* API METHODS
|
|
43
43
|
*/
|
|
44
44
|
const setRowGroupingModel = React.useCallback(model => {
|
|
@@ -95,6 +95,11 @@ const useGridRowGrouping = (apiRef, props) => {
|
|
|
95
95
|
}
|
|
96
96
|
return columnMenuItems;
|
|
97
97
|
}, [props.disableRowGrouping]);
|
|
98
|
+
const addGetRowsParams = React.useCallback(params => {
|
|
99
|
+
return (0, _extends2.default)({}, params, {
|
|
100
|
+
groupFields: (0, _gridRowGroupingSelector.gridRowGroupingModelSelector)(apiRef)
|
|
101
|
+
});
|
|
102
|
+
}, [apiRef]);
|
|
98
103
|
const stateExportPreProcessing = React.useCallback((prevState, context) => {
|
|
99
104
|
const rowGroupingModelToExport = (0, _gridRowGroupingSelector.gridRowGroupingModelSelector)(apiRef);
|
|
100
105
|
const shouldExportRowGroupingModel =
|
|
@@ -126,10 +131,11 @@ const useGridRowGrouping = (apiRef, props) => {
|
|
|
126
131
|
return params;
|
|
127
132
|
}, [apiRef, props.disableRowGrouping]);
|
|
128
133
|
(0, _internals.useGridRegisterPipeProcessor)(apiRef, 'columnMenu', addColumnMenuButtons);
|
|
134
|
+
(0, _internals.useGridRegisterPipeProcessor)(apiRef, 'getRowsParams', addGetRowsParams);
|
|
129
135
|
(0, _internals.useGridRegisterPipeProcessor)(apiRef, 'exportState', stateExportPreProcessing);
|
|
130
136
|
(0, _internals.useGridRegisterPipeProcessor)(apiRef, 'restoreState', stateRestorePreProcessing);
|
|
131
137
|
|
|
132
|
-
|
|
138
|
+
/*
|
|
133
139
|
* EVENTS
|
|
134
140
|
*/
|
|
135
141
|
const handleCellKeyDown = React.useCallback((params, event) => {
|
|
@@ -144,9 +150,13 @@ const useGridRowGrouping = (apiRef, props) => {
|
|
|
144
150
|
if (!isOnGroupingCell) {
|
|
145
151
|
return;
|
|
146
152
|
}
|
|
153
|
+
if (props.unstable_dataSource && !params.rowNode.childrenExpanded) {
|
|
154
|
+
apiRef.current.unstable_dataSource.fetchRows(params.id);
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
147
157
|
apiRef.current.setRowChildrenExpansion(params.id, !params.rowNode.childrenExpanded);
|
|
148
158
|
}
|
|
149
|
-
}, [apiRef, props.rowGroupingColumnMode]);
|
|
159
|
+
}, [apiRef, props.rowGroupingColumnMode, props.unstable_dataSource]);
|
|
150
160
|
const checkGroupingColumnsModelDiff = React.useCallback(() => {
|
|
151
161
|
const sanitizedRowGroupingModel = (0, _gridRowGroupingSelector.gridRowGroupingSanitizedModelSelector)(apiRef);
|
|
152
162
|
const rulesOnLastRowTreeCreation = apiRef.current.caches.rowGrouping.rulesOnLastRowTreeCreation || [];
|
|
@@ -161,7 +171,7 @@ const useGridRowGrouping = (apiRef, props) => {
|
|
|
161
171
|
|
|
162
172
|
// Refresh the row tree creation strategy processing
|
|
163
173
|
// TODO: Add a clean way to re-run a strategy processing without publishing a private event
|
|
164
|
-
if (apiRef.current.getActiveStrategy('rowTree') === _gridRowGroupingUtils.
|
|
174
|
+
if (apiRef.current.getActiveStrategy('rowTree') === _gridRowGroupingUtils.RowGroupingStrategy.Default) {
|
|
165
175
|
apiRef.current.publishEvent('activeStrategyProcessorChange', 'rowTreeCreation');
|
|
166
176
|
}
|
|
167
177
|
}
|
|
@@ -170,7 +180,7 @@ const useGridRowGrouping = (apiRef, props) => {
|
|
|
170
180
|
(0, _xDataGridPro.useGridApiEventHandler)(apiRef, 'columnsChange', checkGroupingColumnsModelDiff);
|
|
171
181
|
(0, _xDataGridPro.useGridApiEventHandler)(apiRef, 'rowGroupingModelChange', checkGroupingColumnsModelDiff);
|
|
172
182
|
|
|
173
|
-
|
|
183
|
+
/*
|
|
174
184
|
* EFFECTS
|
|
175
185
|
*/
|
|
176
186
|
React.useEffect(() => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { DataGridPremiumProcessedProps } from '../../../models/dataGridPremiumProps';
|
|
3
3
|
import { GridPrivateApiPremium } from '../../../models/gridApiPremium';
|
|
4
|
-
export declare const useGridRowGroupingPreProcessors: (apiRef: React.MutableRefObject<GridPrivateApiPremium>, props: Pick<DataGridPremiumProcessedProps, "disableRowGrouping" | "groupingColDef" | "rowGroupingColumnMode" | "defaultGroupingExpansionDepth" | "isGroupExpandedByDefault">) => void;
|
|
4
|
+
export declare const useGridRowGroupingPreProcessors: (apiRef: React.MutableRefObject<GridPrivateApiPremium>, props: Pick<DataGridPremiumProcessedProps, "disableRowGrouping" | "groupingColDef" | "rowGroupingColumnMode" | "defaultGroupingExpansionDepth" | "isGroupExpandedByDefault" | "unstable_dataSource">) => void;
|