@mui/x-data-grid-premium 8.0.0-alpha.1 → 8.0.0-alpha.10
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 +1903 -231
- package/DataGridPremium/DataGridPremium.js +40 -40
- package/DataGridPremium/useDataGridPremiumComponent.d.ts +2 -2
- package/DataGridPremium/useDataGridPremiumComponent.js +4 -2
- package/DataGridPremium/useDataGridPremiumProps.js +5 -3
- package/README.md +1 -1
- package/components/GridAggregationHeader.js +6 -1
- package/components/GridColumnMenuAggregationItem.js +77 -49
- package/components/GridColumnMenuRowGroupItem.js +5 -11
- package/components/GridColumnMenuRowUngroupItem.js +10 -19
- package/components/GridDataSourceGroupingCriteriaCell.js +1 -2
- package/components/GridPremiumColumnMenu.d.ts +1 -1
- package/components/GridPremiumColumnMenu.js +5 -5
- package/components/promptControl/GridToolbarPromptControl.js +47 -36
- package/esm/DataGridPremium/DataGridPremium.js +42 -42
- package/esm/DataGridPremium/useDataGridPremiumComponent.js +5 -3
- package/esm/DataGridPremium/useDataGridPremiumProps.js +6 -4
- package/esm/components/GridAggregationHeader.js +6 -1
- package/esm/components/GridColumnMenuAggregationItem.js +75 -47
- package/esm/components/GridColumnMenuRowGroupItem.js +6 -11
- package/esm/components/GridColumnMenuRowUngroupItem.js +11 -19
- package/esm/components/GridDataSourceGroupingCriteriaCell.js +1 -2
- package/esm/components/GridPremiumColumnMenu.js +5 -5
- package/esm/components/promptControl/GridToolbarPromptControl.js +47 -36
- package/esm/hooks/features/aggregation/createAggregationLookup.js +52 -55
- package/esm/hooks/features/aggregation/gridAggregationUtils.js +17 -13
- package/esm/hooks/features/aggregation/index.js +0 -1
- package/esm/hooks/features/aggregation/useGridAggregation.js +22 -10
- package/esm/hooks/features/aggregation/useGridAggregationPreProcessors.js +8 -14
- package/esm/hooks/features/cellSelection/useGridCellSelection.js +5 -6
- package/esm/hooks/features/clipboard/useGridClipboardImport.js +1 -1
- package/esm/hooks/features/dataSource/cache.js +3 -0
- package/esm/hooks/features/dataSource/models.js +1 -0
- package/esm/hooks/features/dataSource/useGridDataSourcePremium.js +53 -0
- package/esm/hooks/features/rowGrouping/createGroupingColDef.js +5 -1
- package/esm/hooks/features/rowGrouping/gridRowGroupingUtils.js +2 -2
- package/esm/hooks/features/rowGrouping/useGridRowGrouping.js +2 -2
- package/esm/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +9 -4
- package/esm/hooks/utils/useGridAriaAttributes.js +1 -3
- package/esm/hooks/utils/useKeepGroupedColumnsHidden.js +2 -2
- package/esm/utils/releaseInfo.js +1 -1
- package/hooks/features/aggregation/createAggregationLookup.d.ts +7 -6
- package/hooks/features/aggregation/createAggregationLookup.js +52 -55
- package/hooks/features/aggregation/gridAggregationInterfaces.d.ts +18 -5
- package/hooks/features/aggregation/gridAggregationSelectors.d.ts +2 -2
- package/hooks/features/aggregation/gridAggregationUtils.d.ts +12 -13
- package/hooks/features/aggregation/gridAggregationUtils.js +17 -13
- package/hooks/features/aggregation/index.d.ts +1 -1
- package/hooks/features/aggregation/index.js +0 -12
- package/hooks/features/aggregation/useGridAggregation.d.ts +2 -2
- package/hooks/features/aggregation/useGridAggregation.js +22 -10
- package/hooks/features/aggregation/useGridAggregationPreProcessors.d.ts +2 -2
- package/hooks/features/aggregation/useGridAggregationPreProcessors.js +8 -14
- package/hooks/features/aggregation/wrapColumnWithAggregation.d.ts +3 -2
- package/hooks/features/cellSelection/gridCellSelectionInterfaces.d.ts +3 -3
- package/hooks/features/cellSelection/useGridCellSelection.d.ts +2 -2
- package/hooks/features/cellSelection/useGridCellSelection.js +4 -5
- package/hooks/features/clipboard/useGridClipboardImport.d.ts +2 -2
- package/hooks/features/clipboard/useGridClipboardImport.js +1 -1
- package/hooks/features/dataSource/cache.d.ts +2 -0
- package/hooks/features/dataSource/cache.js +9 -0
- package/hooks/features/dataSource/models.d.ts +47 -0
- package/hooks/features/dataSource/models.js +5 -0
- package/hooks/features/dataSource/useGridDataSourcePremium.d.ts +4 -0
- package/hooks/features/dataSource/useGridDataSourcePremium.js +62 -0
- package/hooks/features/export/serializer/excelSerializer.d.ts +3 -2
- package/hooks/features/export/useGridExcelExport.d.ts +2 -2
- package/hooks/features/rowGrouping/createGroupingColDef.d.ts +2 -2
- package/hooks/features/rowGrouping/createGroupingColDef.js +5 -1
- package/hooks/features/rowGrouping/gridRowGroupingSelector.d.ts +2 -2
- package/hooks/features/rowGrouping/gridRowGroupingUtils.d.ts +4 -4
- package/hooks/features/rowGrouping/gridRowGroupingUtils.js +1 -1
- package/hooks/features/rowGrouping/useGridDataSourceRowGroupingPreProcessors.d.ts +2 -2
- package/hooks/features/rowGrouping/useGridRowGrouping.d.ts +2 -2
- package/hooks/features/rowGrouping/useGridRowGrouping.js +1 -1
- package/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.d.ts +2 -2
- package/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +9 -4
- package/hooks/utils/useGridApiContext.d.ts +1 -1
- package/hooks/utils/useGridApiRef.d.ts +3 -1
- package/hooks/utils/useGridAriaAttributes.js +1 -3
- package/hooks/utils/useGridPrivateApiContext.d.ts +1 -1
- package/hooks/utils/useKeepGroupedColumnsHidden.d.ts +2 -2
- package/hooks/utils/useKeepGroupedColumnsHidden.js +2 -2
- package/index.d.ts +2 -0
- package/index.js +1 -1
- package/models/dataGridPremiumProps.d.ts +8 -12
- package/models/gridApiPremium.d.ts +5 -3
- package/models/gridGroupingValueGetter.d.ts +2 -1
- package/models/gridPastedValueParser.d.ts +2 -1
- package/modern/DataGridPremium/DataGridPremium.js +42 -42
- package/modern/DataGridPremium/useDataGridPremiumComponent.js +5 -3
- package/modern/DataGridPremium/useDataGridPremiumProps.js +6 -4
- package/modern/components/GridAggregationHeader.js +6 -1
- package/modern/components/GridColumnMenuAggregationItem.js +75 -47
- package/modern/components/GridColumnMenuRowGroupItem.js +6 -11
- package/modern/components/GridColumnMenuRowUngroupItem.js +11 -19
- package/modern/components/GridDataSourceGroupingCriteriaCell.js +1 -2
- package/modern/components/GridPremiumColumnMenu.js +5 -5
- package/modern/components/promptControl/GridToolbarPromptControl.js +47 -36
- package/modern/hooks/features/aggregation/createAggregationLookup.js +52 -55
- package/modern/hooks/features/aggregation/gridAggregationUtils.js +17 -13
- package/modern/hooks/features/aggregation/index.js +0 -1
- package/modern/hooks/features/aggregation/useGridAggregation.js +22 -10
- package/modern/hooks/features/aggregation/useGridAggregationPreProcessors.js +8 -14
- package/modern/hooks/features/cellSelection/useGridCellSelection.js +5 -6
- package/modern/hooks/features/clipboard/useGridClipboardImport.js +1 -1
- package/modern/hooks/features/dataSource/cache.js +3 -0
- package/modern/hooks/features/dataSource/models.js +1 -0
- package/modern/hooks/features/dataSource/useGridDataSourcePremium.js +53 -0
- package/modern/hooks/features/rowGrouping/createGroupingColDef.js +5 -1
- package/modern/hooks/features/rowGrouping/gridRowGroupingUtils.js +2 -2
- package/modern/hooks/features/rowGrouping/useGridRowGrouping.js +2 -2
- package/modern/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +9 -4
- package/modern/hooks/utils/useGridAriaAttributes.js +1 -3
- package/modern/hooks/utils/useKeepGroupedColumnsHidden.js +2 -2
- package/modern/index.js +1 -1
- package/modern/utils/releaseInfo.js +1 -1
- package/package.json +6 -6
- package/utils/releaseInfo.js +1 -1
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useGridApiEventHandler as addEventHandler, useGridApiMethod, GRID_ROOT_GROUP_ID } from '@mui/x-data-grid-pro';
|
|
4
|
+
import { useGridDataSourceBase, useGridRegisterStrategyProcessor, useGridRegisterPipeProcessor } from '@mui/x-data-grid-pro/internals';
|
|
5
|
+
import { getKeyPremium } from "./cache.js";
|
|
6
|
+
const options = {
|
|
7
|
+
cacheOptions: {
|
|
8
|
+
getKey: getKeyPremium
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
export const useGridDataSourcePremium = (apiRef, props) => {
|
|
12
|
+
const {
|
|
13
|
+
api,
|
|
14
|
+
strategyProcessor,
|
|
15
|
+
events
|
|
16
|
+
} = useGridDataSourceBase(apiRef, props, options);
|
|
17
|
+
const aggregateRowRef = React.useRef({});
|
|
18
|
+
const processDataSourceRows = React.useCallback(({
|
|
19
|
+
params,
|
|
20
|
+
response
|
|
21
|
+
}, applyRowHydration) => {
|
|
22
|
+
if (response.aggregateRow) {
|
|
23
|
+
aggregateRowRef.current = response.aggregateRow;
|
|
24
|
+
}
|
|
25
|
+
if (Object.keys(params.aggregationModel || {}).length > 0) {
|
|
26
|
+
if (applyRowHydration) {
|
|
27
|
+
apiRef.current.requestPipeProcessorsApplication('hydrateRows');
|
|
28
|
+
}
|
|
29
|
+
apiRef.current.applyAggregation();
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
params,
|
|
33
|
+
response
|
|
34
|
+
};
|
|
35
|
+
}, [apiRef]);
|
|
36
|
+
const resolveGroupAggregation = React.useCallback((groupId, field) => {
|
|
37
|
+
if (groupId === GRID_ROOT_GROUP_ID) {
|
|
38
|
+
return props.unstable_dataSource?.getAggregatedValue?.(aggregateRowRef.current, field);
|
|
39
|
+
}
|
|
40
|
+
const row = apiRef.current.getRow(groupId);
|
|
41
|
+
return props.unstable_dataSource?.getAggregatedValue?.(row, field);
|
|
42
|
+
}, [apiRef, props.unstable_dataSource]);
|
|
43
|
+
const privateApi = _extends({}, api.private, {
|
|
44
|
+
resolveGroupAggregation
|
|
45
|
+
});
|
|
46
|
+
useGridApiMethod(apiRef, api.public, 'public');
|
|
47
|
+
useGridApiMethod(apiRef, privateApi, 'private');
|
|
48
|
+
useGridRegisterStrategyProcessor(apiRef, strategyProcessor.strategyName, strategyProcessor.group, strategyProcessor.processor);
|
|
49
|
+
useGridRegisterPipeProcessor(apiRef, 'processDataSourceRows', processDataSourceRows);
|
|
50
|
+
Object.entries(events).forEach(([event, handler]) => {
|
|
51
|
+
addEventHandler(apiRef, event, handler);
|
|
52
|
+
});
|
|
53
|
+
};
|
|
@@ -32,7 +32,9 @@ const GROUPING_COL_DEF_FORCED_PROPERTIES_DATA_SOURCE = _extends({}, GROUPING_COL
|
|
|
32
32
|
* TODO: Make this index comparator depth invariant, the logic should not be inverted when sorting in the "desc" direction (but the current return format of `sortComparator` does not support this behavior).
|
|
33
33
|
*/
|
|
34
34
|
const groupingFieldIndexComparator = (v1, v2, cellParams1, cellParams2) => {
|
|
35
|
-
const model = gridRowGroupingSanitizedModelSelector(
|
|
35
|
+
const model = gridRowGroupingSanitizedModelSelector({
|
|
36
|
+
current: cellParams1.api
|
|
37
|
+
});
|
|
36
38
|
const groupingField1 = cellParams1.rowNode.groupingField ?? null;
|
|
37
39
|
const groupingField2 = cellParams2.rowNode.groupingField ?? null;
|
|
38
40
|
if (groupingField1 === groupingField2) {
|
|
@@ -63,10 +65,12 @@ const getLeafProperties = leafColDef => ({
|
|
|
63
65
|
return groupingFieldIndexComparator(v1, v2, cellParams1, cellParams2);
|
|
64
66
|
}
|
|
65
67
|
});
|
|
68
|
+
const groupedByColValueFormatter = groupedByColDef => (value, row, _, apiRef) => groupedByColDef.valueFormatter(value, row, groupedByColDef, apiRef);
|
|
66
69
|
const getGroupingCriteriaProperties = (groupedByColDef, applyHeaderName) => {
|
|
67
70
|
const properties = {
|
|
68
71
|
sortable: groupedByColDef.sortable,
|
|
69
72
|
filterable: groupedByColDef.filterable,
|
|
73
|
+
valueFormatter: groupedByColDef.valueFormatter ? groupedByColValueFormatter(groupedByColDef) : undefined,
|
|
70
74
|
valueOptions: isSingleSelectColDef(groupedByColDef) ? groupedByColDef.valueOptions : undefined,
|
|
71
75
|
sortComparator: (v1, v2, cellParams1, cellParams2) => {
|
|
72
76
|
// We only want to sort the groups of the current grouping criteria
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import { passFilterLogic, GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD, getRowGroupingCriteriaFromGroupingField, isGroupingColumn } from '@mui/x-data-grid-pro/internals';
|
|
2
|
+
import { passFilterLogic, GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD, getRowGroupingCriteriaFromGroupingField, isGroupingColumn, GridStrategyGroup } from '@mui/x-data-grid-pro/internals';
|
|
3
3
|
import { gridRowGroupingSanitizedModelSelector } from "./gridRowGroupingSelector.js";
|
|
4
4
|
export { GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD, getRowGroupingCriteriaFromGroupingField, isGroupingColumn };
|
|
5
5
|
export let RowGroupingStrategy = /*#__PURE__*/function (RowGroupingStrategy) {
|
|
@@ -124,7 +124,7 @@ export const setStrategyAvailability = (privateApiRef, disableRowGrouping, dataS
|
|
|
124
124
|
};
|
|
125
125
|
}
|
|
126
126
|
const strategy = dataSource ? RowGroupingStrategy.DataSource : RowGroupingStrategy.Default;
|
|
127
|
-
privateApiRef.current.setStrategyAvailability(
|
|
127
|
+
privateApiRef.current.setStrategyAvailability(GridStrategyGroup.RowTree, strategy, isAvailable);
|
|
128
128
|
};
|
|
129
129
|
export const getCellGroupingCriteria = ({
|
|
130
130
|
row,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useGridApiEventHandler, useGridApiMethod, gridColumnLookupSelector } from '@mui/x-data-grid-pro';
|
|
4
|
-
import { useGridRegisterPipeProcessor } from '@mui/x-data-grid-pro/internals';
|
|
4
|
+
import { useGridRegisterPipeProcessor, GridStrategyGroup } from '@mui/x-data-grid-pro/internals';
|
|
5
5
|
import { gridRowGroupingModelSelector, gridRowGroupingSanitizedModelSelector } from "./gridRowGroupingSelector.js";
|
|
6
6
|
import { getRowGroupingFieldFromGroupingCriteria, RowGroupingStrategy, isGroupingColumn, mergeStateWithRowGroupingModel, setStrategyAvailability, getGroupingRules, areGroupingRulesEqual } from "./gridRowGroupingUtils.js";
|
|
7
7
|
export const rowGroupingStateInitializer = (state, props, apiRef) => {
|
|
@@ -162,7 +162,7 @@ export const useGridRowGrouping = (apiRef, props) => {
|
|
|
162
162
|
|
|
163
163
|
// Refresh the row tree creation strategy processing
|
|
164
164
|
// TODO: Add a clean way to re-run a strategy processing without publishing a private event
|
|
165
|
-
if (apiRef.current.getActiveStrategy(
|
|
165
|
+
if (apiRef.current.getActiveStrategy(GridStrategyGroup.RowTree) === RowGroupingStrategy.Default) {
|
|
166
166
|
apiRef.current.publishEvent('activeStrategyProcessorChange', 'rowTreeCreation');
|
|
167
167
|
}
|
|
168
168
|
}
|
|
@@ -48,10 +48,13 @@ export const useGridRowGroupingPreProcessors = (apiRef, props) => {
|
|
|
48
48
|
const groupingColDefs = getGroupingColDefs(columnsState);
|
|
49
49
|
let newColumnFields = [];
|
|
50
50
|
const newColumnsLookup = {};
|
|
51
|
+
const prevGroupingfields = [];
|
|
51
52
|
|
|
52
53
|
// We only keep the non-grouping columns
|
|
53
54
|
columnsState.orderedFields.forEach(field => {
|
|
54
|
-
if (
|
|
55
|
+
if (isGroupingColumn(field)) {
|
|
56
|
+
prevGroupingfields.push(field);
|
|
57
|
+
} else {
|
|
55
58
|
newColumnFields.push(field);
|
|
56
59
|
newColumnsLookup[field] = columnsState.lookup[field];
|
|
57
60
|
}
|
|
@@ -66,9 +69,11 @@ export const useGridRowGroupingPreProcessors = (apiRef, props) => {
|
|
|
66
69
|
}
|
|
67
70
|
newColumnsLookup[groupingColDef.field] = groupingColDef;
|
|
68
71
|
});
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
+
if (prevGroupingfields.length !== groupingColDefs.length) {
|
|
73
|
+
const startIndex = newColumnFields[0] === GRID_CHECKBOX_SELECTION_FIELD ? 1 : 0;
|
|
74
|
+
newColumnFields = [...newColumnFields.slice(0, startIndex), ...groupingColDefs.map(colDef => colDef.field), ...newColumnFields.slice(startIndex)];
|
|
75
|
+
columnsState.orderedFields = newColumnFields;
|
|
76
|
+
}
|
|
72
77
|
columnsState.lookup = newColumnsLookup;
|
|
73
78
|
return columnsState;
|
|
74
79
|
}, [getGroupingColDefs]);
|
|
@@ -2,13 +2,11 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import { useGridAriaAttributes as useGridAriaAttributesPro, useGridSelector } from '@mui/x-data-grid-pro/internals';
|
|
3
3
|
import { gridRowGroupingSanitizedModelSelector } from "../features/rowGrouping/gridRowGroupingSelector.js";
|
|
4
4
|
import { useGridPrivateApiContext } from "./useGridPrivateApiContext.js";
|
|
5
|
-
import { useGridRootProps } from "./useGridRootProps.js";
|
|
6
5
|
export const useGridAriaAttributes = () => {
|
|
7
|
-
const rootProps = useGridRootProps();
|
|
8
6
|
const ariaAttributesPro = useGridAriaAttributesPro();
|
|
9
7
|
const apiRef = useGridPrivateApiContext();
|
|
10
8
|
const gridRowGroupingModel = useGridSelector(apiRef, gridRowGroupingSanitizedModelSelector);
|
|
11
|
-
const ariaAttributesPremium =
|
|
9
|
+
const ariaAttributesPremium = gridRowGroupingModel.length > 0 ? {
|
|
12
10
|
role: 'treegrid'
|
|
13
11
|
} : {};
|
|
14
12
|
return _extends({}, ariaAttributesPro, ariaAttributesPremium);
|
|
@@ -25,9 +25,9 @@ export const useKeepGroupedColumnsHidden = props => {
|
|
|
25
25
|
const initialProps = React.useRef(props);
|
|
26
26
|
const rowGroupingModel = React.useRef(props.rowGroupingModel ?? props.initialState?.rowGrouping?.model);
|
|
27
27
|
React.useEffect(() => {
|
|
28
|
-
props.apiRef.current
|
|
28
|
+
props.apiRef.current?.subscribeEvent('rowGroupingModelChange', newModel => {
|
|
29
29
|
const columnVisibilityModel = updateColumnVisibilityModel(gridColumnVisibilityModelSelector(props.apiRef), newModel, rowGroupingModel.current);
|
|
30
|
-
props.apiRef.current
|
|
30
|
+
props.apiRef.current?.setColumnVisibilityModel(columnVisibilityModel);
|
|
31
31
|
rowGroupingModel.current = newModel;
|
|
32
32
|
});
|
|
33
33
|
}, [props.apiRef]);
|
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 = "MTczODI5OTYwMDAwMA==";
|
|
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
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
|
+
import { GridPrivateApiPremium } from '../../../models/gridApiPremium';
|
|
3
3
|
import { DataGridPremiumProcessedProps } from '../../../models/dataGridPremiumProps';
|
|
4
|
-
import { GridAggregationFunction, GridAggregationLookup } from './gridAggregationInterfaces';
|
|
5
|
-
export declare const createAggregationLookup: ({ apiRef, aggregationFunctions, aggregationRowsScope, getAggregationPosition, }: {
|
|
6
|
-
apiRef:
|
|
7
|
-
aggregationFunctions: Record<string, GridAggregationFunction>;
|
|
4
|
+
import { GridAggregationFunction, GridAggregationFunctionDataSource, GridAggregationLookup } from './gridAggregationInterfaces';
|
|
5
|
+
export declare const createAggregationLookup: ({ apiRef, aggregationFunctions, aggregationRowsScope, getAggregationPosition, isDataSource, }: {
|
|
6
|
+
apiRef: RefObject<GridPrivateApiPremium>;
|
|
7
|
+
aggregationFunctions: Record<string, GridAggregationFunction> | Record<string, GridAggregationFunctionDataSource>;
|
|
8
8
|
aggregationRowsScope: DataGridPremiumProcessedProps["aggregationRowsScope"];
|
|
9
9
|
getAggregationPosition: DataGridPremiumProcessedProps["getAggregationPosition"];
|
|
10
|
+
isDataSource: boolean;
|
|
10
11
|
}) => GridAggregationLookup;
|
|
@@ -7,18 +7,13 @@ exports.createAggregationLookup = void 0;
|
|
|
7
7
|
var _xDataGridPro = require("@mui/x-data-grid-pro");
|
|
8
8
|
var _gridAggregationUtils = require("./gridAggregationUtils");
|
|
9
9
|
var _gridAggregationSelectors = require("./gridAggregationSelectors");
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
field,
|
|
14
|
-
aggregationFunction,
|
|
15
|
-
aggregationRowsScope
|
|
16
|
-
}) => {
|
|
17
|
-
const filteredRowsLookup = (0, _xDataGridPro.gridFilteredRowsLookupSelector)(apiRef);
|
|
10
|
+
const getGroupAggregatedValue = (groupId, apiRef, aggregationRowsScope, aggregatedFields, aggregationRules, position) => {
|
|
11
|
+
const groupAggregationLookup = {};
|
|
12
|
+
const aggregatedValues = [];
|
|
18
13
|
const rowIds = apiRef.current.getRowGroupChildren({
|
|
19
14
|
groupId
|
|
20
15
|
});
|
|
21
|
-
const
|
|
16
|
+
const filteredRowsLookup = (0, _xDataGridPro.gridFilteredRowsLookupSelector)(apiRef);
|
|
22
17
|
rowIds.forEach(rowId => {
|
|
23
18
|
if (aggregationRowsScope === 'filtered' && filteredRowsLookup[rowId] === false) {
|
|
24
19
|
return;
|
|
@@ -35,42 +30,53 @@ const getAggregationCellValue = ({
|
|
|
35
30
|
if (rowNode.type === 'group') {
|
|
36
31
|
return;
|
|
37
32
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
33
|
+
const row = apiRef.current.getRow(rowId);
|
|
34
|
+
for (let j = 0; j < aggregatedFields.length; j += 1) {
|
|
35
|
+
const aggregatedField = aggregatedFields[j];
|
|
36
|
+
const columnAggregationRules = aggregationRules[aggregatedField];
|
|
37
|
+
const aggregationFunction = columnAggregationRules.aggregationFunction;
|
|
38
|
+
const field = aggregatedField;
|
|
39
|
+
if (aggregatedValues[j] === undefined) {
|
|
40
|
+
aggregatedValues[j] = {
|
|
41
|
+
aggregatedField,
|
|
42
|
+
values: []
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
if (typeof aggregationFunction.getCellValue === 'function') {
|
|
46
|
+
aggregatedValues[j].values.push(aggregationFunction.getCellValue({
|
|
47
|
+
row
|
|
48
|
+
}));
|
|
49
|
+
} else {
|
|
50
|
+
const colDef = apiRef.current.getColumn(field);
|
|
51
|
+
aggregatedValues[j].values.push(apiRef.current.getRowValue(row, colDef));
|
|
52
|
+
}
|
|
45
53
|
}
|
|
46
54
|
});
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
55
|
+
for (let i = 0; i < aggregatedValues.length; i += 1) {
|
|
56
|
+
const {
|
|
57
|
+
aggregatedField,
|
|
58
|
+
values
|
|
59
|
+
} = aggregatedValues[i];
|
|
60
|
+
const aggregationFunction = aggregationRules[aggregatedField].aggregationFunction;
|
|
61
|
+
const value = aggregationFunction.apply({
|
|
62
|
+
values,
|
|
63
|
+
groupId,
|
|
64
|
+
field: aggregatedField // Added per user request in https://github.com/mui/mui-x/issues/6995#issuecomment-1327423455
|
|
65
|
+
});
|
|
66
|
+
groupAggregationLookup[aggregatedField] = {
|
|
67
|
+
position,
|
|
68
|
+
value
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
return groupAggregationLookup;
|
|
52
72
|
};
|
|
53
|
-
const
|
|
54
|
-
groupId,
|
|
55
|
-
apiRef,
|
|
56
|
-
aggregationRowsScope,
|
|
57
|
-
aggregatedFields,
|
|
58
|
-
aggregationRules,
|
|
59
|
-
position
|
|
60
|
-
}) => {
|
|
73
|
+
const getGroupAggregatedValueDataSource = (groupId, apiRef, aggregatedFields, position) => {
|
|
61
74
|
const groupAggregationLookup = {};
|
|
62
75
|
for (let j = 0; j < aggregatedFields.length; j += 1) {
|
|
63
76
|
const aggregatedField = aggregatedFields[j];
|
|
64
|
-
const columnAggregationRules = aggregationRules[aggregatedField];
|
|
65
77
|
groupAggregationLookup[aggregatedField] = {
|
|
66
78
|
position,
|
|
67
|
-
value:
|
|
68
|
-
apiRef,
|
|
69
|
-
groupId,
|
|
70
|
-
field: aggregatedField,
|
|
71
|
-
aggregationFunction: columnAggregationRules.aggregationFunction,
|
|
72
|
-
aggregationRowsScope
|
|
73
|
-
})
|
|
79
|
+
value: apiRef.current.resolveGroupAggregation(groupId, aggregatedField)
|
|
74
80
|
};
|
|
75
81
|
}
|
|
76
82
|
return groupAggregationLookup;
|
|
@@ -79,13 +85,10 @@ const createAggregationLookup = ({
|
|
|
79
85
|
apiRef,
|
|
80
86
|
aggregationFunctions,
|
|
81
87
|
aggregationRowsScope,
|
|
82
|
-
getAggregationPosition
|
|
88
|
+
getAggregationPosition,
|
|
89
|
+
isDataSource
|
|
83
90
|
}) => {
|
|
84
|
-
const aggregationRules = (0, _gridAggregationUtils.getAggregationRules)(
|
|
85
|
-
columnsLookup: (0, _xDataGridPro.gridColumnLookupSelector)(apiRef),
|
|
86
|
-
aggregationModel: (0, _gridAggregationSelectors.gridAggregationModelSelector)(apiRef),
|
|
87
|
-
aggregationFunctions
|
|
88
|
-
});
|
|
91
|
+
const aggregationRules = (0, _gridAggregationUtils.getAggregationRules)((0, _xDataGridPro.gridColumnLookupSelector)(apiRef), (0, _gridAggregationSelectors.gridAggregationModelSelector)(apiRef), aggregationFunctions, isDataSource);
|
|
89
92
|
const aggregatedFields = Object.keys(aggregationRules);
|
|
90
93
|
if (aggregatedFields.length === 0) {
|
|
91
94
|
return {};
|
|
@@ -100,18 +103,12 @@ const createAggregationLookup = ({
|
|
|
100
103
|
createGroupAggregationLookup(childNode);
|
|
101
104
|
}
|
|
102
105
|
}
|
|
103
|
-
const
|
|
104
|
-
if (
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
apiRef,
|
|
110
|
-
aggregatedFields,
|
|
111
|
-
aggregationRowsScope,
|
|
112
|
-
aggregationRules,
|
|
113
|
-
position
|
|
114
|
-
});
|
|
106
|
+
const position = getAggregationPosition(groupNode);
|
|
107
|
+
if (position !== null) {
|
|
108
|
+
if (isDataSource) {
|
|
109
|
+
aggregationLookup[groupNode.id] = getGroupAggregatedValueDataSource(groupNode.id, apiRef, aggregatedFields, position);
|
|
110
|
+
} else if (groupNode.children.length) {
|
|
111
|
+
aggregationLookup[groupNode.id] = getGroupAggregatedValue(groupNode.id, apiRef, aggregationRowsScope, aggregatedFields, aggregationRules, position);
|
|
115
112
|
}
|
|
116
113
|
}
|
|
117
114
|
};
|
|
@@ -17,6 +17,12 @@ export interface GridAggregationApi {
|
|
|
17
17
|
*/
|
|
18
18
|
setAggregationModel: (model: GridAggregationModel) => void;
|
|
19
19
|
}
|
|
20
|
+
export interface GridAggregationPrivateApi {
|
|
21
|
+
/**
|
|
22
|
+
* Applies the aggregation to the rows.
|
|
23
|
+
*/
|
|
24
|
+
applyAggregation: () => void;
|
|
25
|
+
}
|
|
20
26
|
export interface GridAggregationGetCellValueParams {
|
|
21
27
|
/**
|
|
22
28
|
* The row model of the row that the current cell belongs to.
|
|
@@ -38,7 +44,7 @@ export interface GridAggregationFunction<V = any, AV = V> {
|
|
|
38
44
|
apply: (params: GridAggregationParams<V>) => AV | null | undefined;
|
|
39
45
|
/**
|
|
40
46
|
* Label of the aggregation function.
|
|
41
|
-
*
|
|
47
|
+
* Used for adding a label to the footer of the grouping column when this aggregation function is the only one being used.
|
|
42
48
|
* @default apiRef.current.getLocaleText('aggregationFunctionLabel{capitalize(name)})
|
|
43
49
|
*/
|
|
44
50
|
label?: string;
|
|
@@ -48,12 +54,12 @@ export interface GridAggregationFunction<V = any, AV = V> {
|
|
|
48
54
|
*/
|
|
49
55
|
columnTypes?: string[];
|
|
50
56
|
/**
|
|
51
|
-
* Function
|
|
52
|
-
* If not defined, the grid
|
|
57
|
+
* Function for applying a formatter to the aggregated value.
|
|
58
|
+
* If not defined, the grid uses the formatter of the column.
|
|
53
59
|
*/
|
|
54
60
|
valueFormatter?: GridValueFormatter;
|
|
55
61
|
/**
|
|
56
|
-
* Indicates if the aggregated value
|
|
62
|
+
* Indicates if the aggregated value has the same unit as the cells used to generate it.
|
|
57
63
|
* It can be used to apply a custom cell renderer only if the aggregated value has the same unit.
|
|
58
64
|
* @default true
|
|
59
65
|
*/
|
|
@@ -67,6 +73,13 @@ export interface GridAggregationFunction<V = any, AV = V> {
|
|
|
67
73
|
*/
|
|
68
74
|
getCellValue?: (params: GridAggregationGetCellValueParams) => V;
|
|
69
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* Grid aggregation function data source definition interface.
|
|
78
|
+
* @demos
|
|
79
|
+
* - [Server-side aggregation](/x/react-data-grid/server-side-data/aggregation/)
|
|
80
|
+
*/
|
|
81
|
+
export interface GridAggregationFunctionDataSource extends Omit<GridAggregationFunction, 'apply' | 'getCellValue'> {
|
|
82
|
+
}
|
|
70
83
|
export interface GridAggregationParams<V = any> {
|
|
71
84
|
values: (V | undefined)[];
|
|
72
85
|
groupId: GridRowId;
|
|
@@ -102,7 +115,7 @@ export interface GridAggregationHeaderMeta {
|
|
|
102
115
|
}
|
|
103
116
|
export interface GridAggregationRule {
|
|
104
117
|
aggregationFunctionName: string;
|
|
105
|
-
aggregationFunction: GridAggregationFunction;
|
|
118
|
+
aggregationFunction: GridAggregationFunction | GridAggregationFunctionDataSource;
|
|
106
119
|
}
|
|
107
120
|
/**
|
|
108
121
|
* Object containing all the aggregation rules that must be applied to the current columns.
|
|
@@ -5,9 +5,9 @@ export declare const gridAggregationStateSelector: (state: GridStatePremium) =>
|
|
|
5
5
|
* If a column is not in the model, it is not aggregated.
|
|
6
6
|
* @category Aggregation
|
|
7
7
|
*/
|
|
8
|
-
export declare const gridAggregationModelSelector: import("@mui/x-data-grid").OutputSelector<GridStatePremium, import("./gridAggregationInterfaces").GridAggregationModel>;
|
|
8
|
+
export declare const gridAggregationModelSelector: import("@mui/x-data-grid").OutputSelector<GridStatePremium, import("./gridAggregationInterfaces").GridAggregationState, import("./gridAggregationInterfaces").GridAggregationModel>;
|
|
9
9
|
/**
|
|
10
10
|
* Get the aggregation results as a lookup.
|
|
11
11
|
* @category Aggregation
|
|
12
12
|
*/
|
|
13
|
-
export declare const gridAggregationLookupSelector: import("@mui/x-data-grid").OutputSelector<GridStatePremium, import("./gridAggregationInterfaces").GridAggregationLookup>;
|
|
13
|
+
export declare const gridAggregationLookupSelector: import("@mui/x-data-grid").OutputSelector<GridStatePremium, import("./gridAggregationInterfaces").GridAggregationState, import("./gridAggregationInterfaces").GridAggregationLookup>;
|
|
@@ -1,27 +1,26 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { GridColDef, GridRowId } from '@mui/x-data-grid-pro';
|
|
3
3
|
import { GridColumnRawLookup, GridHydrateRowsValue } from '@mui/x-data-grid-pro/internals';
|
|
4
|
-
import { GridAggregationFunction, GridAggregationModel, GridAggregationRule, GridAggregationRules } from './gridAggregationInterfaces';
|
|
4
|
+
import { GridAggregationFunction, GridAggregationFunctionDataSource, GridAggregationModel, GridAggregationRule, GridAggregationRules } from './gridAggregationInterfaces';
|
|
5
5
|
import { GridStatePremium } from '../../../models/gridStatePremium';
|
|
6
6
|
import { DataGridPremiumProcessedProps } from '../../../models/dataGridPremiumProps';
|
|
7
7
|
import { GridApiPremium, GridPrivateApiPremium } from '../../../models/gridApiPremium';
|
|
8
8
|
export declare const GRID_AGGREGATION_ROOT_FOOTER_ROW_ID = "auto-generated-group-footer-root";
|
|
9
9
|
export declare const getAggregationFooterRowIdFromGroupId: (groupId: GridRowId | null) => string;
|
|
10
|
-
|
|
10
|
+
type AggregationFunction = GridAggregationFunction | GridAggregationFunctionDataSource | undefined;
|
|
11
|
+
export declare const canColumnHaveAggregationFunction: ({ colDef, aggregationFunctionName, aggregationFunction, isDataSource, }: {
|
|
11
12
|
colDef: GridColDef | undefined;
|
|
12
13
|
aggregationFunctionName: string;
|
|
13
|
-
aggregationFunction:
|
|
14
|
+
aggregationFunction: AggregationFunction;
|
|
15
|
+
isDataSource: boolean;
|
|
14
16
|
}) => boolean;
|
|
15
|
-
export declare const getAvailableAggregationFunctions: ({ aggregationFunctions, colDef, }: {
|
|
16
|
-
aggregationFunctions: Record<string, GridAggregationFunction>;
|
|
17
|
+
export declare const getAvailableAggregationFunctions: ({ aggregationFunctions, colDef, isDataSource, }: {
|
|
18
|
+
aggregationFunctions: Record<string, GridAggregationFunction> | Record<string, GridAggregationFunctionDataSource>;
|
|
17
19
|
colDef: GridColDef;
|
|
20
|
+
isDataSource: boolean;
|
|
18
21
|
}) => string[];
|
|
19
22
|
export declare const mergeStateWithAggregationModel: (aggregationModel: GridAggregationModel) => (state: GridStatePremium) => GridStatePremium;
|
|
20
|
-
export declare const getAggregationRules: (
|
|
21
|
-
columnsLookup: GridColumnRawLookup;
|
|
22
|
-
aggregationModel: GridAggregationModel;
|
|
23
|
-
aggregationFunctions: Record<string, GridAggregationFunction>;
|
|
24
|
-
}) => GridAggregationRules;
|
|
23
|
+
export declare const getAggregationRules: (columnsLookup: GridColumnRawLookup, aggregationModel: GridAggregationModel, aggregationFunctions: Record<string, GridAggregationFunction> | Record<string, GridAggregationFunctionDataSource>, isDataSource: boolean) => GridAggregationRules;
|
|
25
24
|
interface AddFooterRowsParams {
|
|
26
25
|
groupingParams: GridHydrateRowsValue;
|
|
27
26
|
getAggregationPosition: DataGridPremiumProcessedProps['getAggregationPosition'];
|
|
@@ -29,7 +28,7 @@ interface AddFooterRowsParams {
|
|
|
29
28
|
* If `true`, there are some aggregation rules to apply
|
|
30
29
|
*/
|
|
31
30
|
hasAggregationRule: boolean;
|
|
32
|
-
apiRef:
|
|
31
|
+
apiRef: RefObject<GridPrivateApiPremium>;
|
|
33
32
|
}
|
|
34
33
|
/**
|
|
35
34
|
* Add a footer for each group that has at least one column with an aggregated value.
|
|
@@ -40,7 +39,7 @@ export declare const addFooterRows: ({ groupingParams, apiRef, getAggregationPos
|
|
|
40
39
|
*/
|
|
41
40
|
export declare const areAggregationRulesEqual: (previousValue: GridAggregationRules | undefined, newValue: GridAggregationRules) => boolean;
|
|
42
41
|
export declare const getAggregationFunctionLabel: ({ apiRef, aggregationRule, }: {
|
|
43
|
-
apiRef:
|
|
42
|
+
apiRef: RefObject<GridApiPremium>;
|
|
44
43
|
aggregationRule: GridAggregationRule;
|
|
45
44
|
}) => string;
|
|
46
45
|
export {};
|
|
@@ -18,21 +18,23 @@ const getAggregationFooterRowIdFromGroupId = groupId => {
|
|
|
18
18
|
return `auto-generated-group-footer-${groupId}`;
|
|
19
19
|
};
|
|
20
20
|
exports.getAggregationFooterRowIdFromGroupId = getAggregationFooterRowIdFromGroupId;
|
|
21
|
+
const isClientSideAggregateFunction = aggregationFunction => !!aggregationFunction && 'apply' in aggregationFunction;
|
|
21
22
|
const canColumnHaveAggregationFunction = ({
|
|
22
23
|
colDef,
|
|
23
24
|
aggregationFunctionName,
|
|
24
|
-
aggregationFunction
|
|
25
|
+
aggregationFunction,
|
|
26
|
+
isDataSource
|
|
25
27
|
}) => {
|
|
26
28
|
if (!colDef) {
|
|
27
29
|
return false;
|
|
28
30
|
}
|
|
29
|
-
if (!aggregationFunction) {
|
|
31
|
+
if (!isClientSideAggregateFunction(aggregationFunction) && !isDataSource) {
|
|
30
32
|
return false;
|
|
31
33
|
}
|
|
32
34
|
if (colDef.availableAggregationFunctions != null) {
|
|
33
35
|
return colDef.availableAggregationFunctions.includes(aggregationFunctionName);
|
|
34
36
|
}
|
|
35
|
-
if (!aggregationFunction
|
|
37
|
+
if (!aggregationFunction?.columnTypes) {
|
|
36
38
|
return true;
|
|
37
39
|
}
|
|
38
40
|
return aggregationFunction.columnTypes.includes(colDef.type);
|
|
@@ -40,11 +42,13 @@ const canColumnHaveAggregationFunction = ({
|
|
|
40
42
|
exports.canColumnHaveAggregationFunction = canColumnHaveAggregationFunction;
|
|
41
43
|
const getAvailableAggregationFunctions = ({
|
|
42
44
|
aggregationFunctions,
|
|
43
|
-
colDef
|
|
45
|
+
colDef,
|
|
46
|
+
isDataSource
|
|
44
47
|
}) => Object.keys(aggregationFunctions).filter(aggregationFunctionName => canColumnHaveAggregationFunction({
|
|
45
48
|
colDef,
|
|
46
49
|
aggregationFunctionName,
|
|
47
|
-
aggregationFunction: aggregationFunctions[aggregationFunctionName]
|
|
50
|
+
aggregationFunction: aggregationFunctions[aggregationFunctionName],
|
|
51
|
+
isDataSource
|
|
48
52
|
}));
|
|
49
53
|
exports.getAvailableAggregationFunctions = getAvailableAggregationFunctions;
|
|
50
54
|
const mergeStateWithAggregationModel = aggregationModel => state => (0, _extends2.default)({}, state, {
|
|
@@ -53,24 +57,24 @@ const mergeStateWithAggregationModel = aggregationModel => state => (0, _extends
|
|
|
53
57
|
})
|
|
54
58
|
});
|
|
55
59
|
exports.mergeStateWithAggregationModel = mergeStateWithAggregationModel;
|
|
56
|
-
const getAggregationRules = ({
|
|
57
|
-
columnsLookup,
|
|
58
|
-
aggregationModel,
|
|
59
|
-
aggregationFunctions
|
|
60
|
-
}) => {
|
|
60
|
+
const getAggregationRules = (columnsLookup, aggregationModel, aggregationFunctions, isDataSource) => {
|
|
61
61
|
const aggregationRules = {};
|
|
62
|
-
|
|
62
|
+
|
|
63
|
+
// eslint-disable-next-line guard-for-in
|
|
64
|
+
for (const field in aggregationModel) {
|
|
65
|
+
const columnItem = aggregationModel[field];
|
|
63
66
|
if (columnsLookup[field] && canColumnHaveAggregationFunction({
|
|
64
67
|
colDef: columnsLookup[field],
|
|
65
68
|
aggregationFunctionName: columnItem,
|
|
66
|
-
aggregationFunction: aggregationFunctions[columnItem]
|
|
69
|
+
aggregationFunction: aggregationFunctions[columnItem],
|
|
70
|
+
isDataSource
|
|
67
71
|
})) {
|
|
68
72
|
aggregationRules[field] = {
|
|
69
73
|
aggregationFunctionName: columnItem,
|
|
70
74
|
aggregationFunction: aggregationFunctions[columnItem]
|
|
71
75
|
};
|
|
72
76
|
}
|
|
73
|
-
}
|
|
77
|
+
}
|
|
74
78
|
return aggregationRules;
|
|
75
79
|
};
|
|
76
80
|
exports.getAggregationRules = getAggregationRules;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type { GridAggregationState, GridAggregationInitialState, GridAggregationInternalCache, GridAggregationApi, GridAggregationGetCellValueParams, GridAggregationFunction, GridAggregationFunctionDataSource, GridAggregationParams, GridAggregationModel, GridAggregationLookup, GridAggregationPosition, GridAggregationCellMeta, GridAggregationHeaderMeta, GridAggregationRule, GridAggregationRules, } from './gridAggregationInterfaces';
|
|
2
2
|
export * from './gridAggregationSelectors';
|
|
3
3
|
export * from './gridAggregationFunctions';
|
|
4
4
|
export { GRID_AGGREGATION_ROOT_FOOTER_ROW_ID, getAggregationFooterRowIdFromGroupId, } from './gridAggregationUtils';
|
|
@@ -19,18 +19,6 @@ Object.defineProperty(exports, "getAggregationFooterRowIdFromGroupId", {
|
|
|
19
19
|
return _gridAggregationUtils.getAggregationFooterRowIdFromGroupId;
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
|
-
var _gridAggregationInterfaces = require("./gridAggregationInterfaces");
|
|
23
|
-
Object.keys(_gridAggregationInterfaces).forEach(function (key) {
|
|
24
|
-
if (key === "default" || key === "__esModule") return;
|
|
25
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
26
|
-
if (key in exports && exports[key] === _gridAggregationInterfaces[key]) return;
|
|
27
|
-
Object.defineProperty(exports, key, {
|
|
28
|
-
enumerable: true,
|
|
29
|
-
get: function () {
|
|
30
|
-
return _gridAggregationInterfaces[key];
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
22
|
var _gridAggregationSelectors = require("./gridAggregationSelectors");
|
|
35
23
|
Object.keys(_gridAggregationSelectors).forEach(function (key) {
|
|
36
24
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { GridStateInitializer } from '@mui/x-data-grid-pro/internals';
|
|
3
3
|
import { DataGridPremiumProcessedProps } from '../../../models/dataGridPremiumProps';
|
|
4
4
|
import { GridPrivateApiPremium } from '../../../models/gridApiPremium';
|
|
5
5
|
export declare const aggregationStateInitializer: GridStateInitializer<Pick<DataGridPremiumProcessedProps, 'aggregationModel' | 'initialState'>, GridPrivateApiPremium>;
|
|
6
|
-
export declare const useGridAggregation: (apiRef:
|
|
6
|
+
export declare const useGridAggregation: (apiRef: RefObject<GridPrivateApiPremium>, props: Pick<DataGridPremiumProcessedProps, "onAggregationModelChange" | "initialState" | "aggregationModel" | "getAggregationPosition" | "aggregationFunctions" | "aggregationRowsScope" | "disableAggregation" | "rowGroupingColumnMode" | "unstable_dataSource">) => void;
|