@mui/x-data-grid-premium 5.13.1 → 5.14.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 +44 -1
- package/DataGridPremium/DataGridPremium.js +47 -0
- package/DataGridPremium/useDataGridPremiumComponent.js +6 -1
- package/DataGridPremium/useDataGridPremiumProps.js +17 -7
- package/components/GridAggregationColumnMenuItem.d.ts +9 -0
- package/components/GridAggregationColumnMenuItem.js +93 -0
- package/components/GridAggregationHeader.d.ts +4 -0
- package/components/GridAggregationHeader.js +94 -0
- package/components/GridExcelExportMenuItem.js +11 -4
- package/components/GridFooterCell.d.ts +9 -0
- package/components/GridFooterCell.js +51 -0
- package/components/GridGroupingColumnFooterCell.d.ts +4 -0
- package/components/GridGroupingColumnFooterCell.js +29 -0
- package/hooks/features/aggregation/createAggregationLookup.d.ts +10 -0
- package/hooks/features/aggregation/createAggregationLookup.js +128 -0
- package/hooks/features/aggregation/gridAggregationFunctions.d.ts +8 -0
- package/hooks/features/aggregation/gridAggregationFunctions.js +96 -0
- package/hooks/features/aggregation/gridAggregationInterfaces.d.ts +104 -0
- package/hooks/features/aggregation/gridAggregationInterfaces.js +1 -0
- package/hooks/features/aggregation/gridAggregationSelectors.d.ts +4 -0
- package/hooks/features/aggregation/gridAggregationSelectors.js +5 -0
- package/hooks/features/aggregation/gridAggregationUtils.d.ts +40 -0
- package/hooks/features/aggregation/gridAggregationUtils.js +177 -0
- package/hooks/features/aggregation/index.d.ts +4 -0
- package/hooks/features/aggregation/index.js +4 -0
- package/hooks/features/aggregation/useGridAggregation.d.ts +6 -0
- package/hooks/features/aggregation/useGridAggregation.js +94 -0
- package/hooks/features/aggregation/useGridAggregationPreProcessors.d.ts +4 -0
- package/hooks/features/aggregation/useGridAggregationPreProcessors.js +137 -0
- package/hooks/features/aggregation/wrapColumnWithAggregation.d.ts +29 -0
- package/hooks/features/aggregation/wrapColumnWithAggregation.js +257 -0
- package/hooks/features/export/serializer/excelSerializer.js +2 -1
- package/hooks/features/index.d.ts +1 -0
- package/hooks/features/index.js +1 -0
- package/hooks/features/rowGrouping/createGroupingColDef.js +13 -2
- package/hooks/features/rowGrouping/gridRowGroupingUtils.js +5 -1
- package/hooks/features/rowGrouping/useGridRowGrouping.d.ts +1 -1
- package/hooks/features/rowGrouping/useGridRowGrouping.js +20 -10
- package/index.js +1 -1
- package/legacy/DataGridPremium/DataGridPremium.js +47 -0
- package/legacy/DataGridPremium/useDataGridPremiumComponent.js +6 -1
- package/legacy/DataGridPremium/useDataGridPremiumProps.js +12 -2
- package/legacy/components/GridAggregationColumnMenuItem.js +95 -0
- package/legacy/components/GridAggregationHeader.js +95 -0
- package/legacy/components/GridExcelExportMenuItem.js +11 -4
- package/legacy/components/GridFooterCell.js +63 -0
- package/legacy/components/GridGroupingColumnFooterCell.js +27 -0
- package/legacy/hooks/features/aggregation/createAggregationLookup.js +127 -0
- package/legacy/hooks/features/aggregation/gridAggregationFunctions.js +94 -0
- package/legacy/hooks/features/aggregation/gridAggregationInterfaces.js +1 -0
- package/legacy/hooks/features/aggregation/gridAggregationSelectors.js +11 -0
- package/legacy/hooks/features/aggregation/gridAggregationUtils.js +189 -0
- package/legacy/hooks/features/aggregation/index.js +4 -0
- package/legacy/hooks/features/aggregation/useGridAggregation.js +95 -0
- package/legacy/hooks/features/aggregation/useGridAggregationPreProcessors.js +140 -0
- package/legacy/hooks/features/aggregation/wrapColumnWithAggregation.js +262 -0
- package/legacy/hooks/features/export/serializer/excelSerializer.js +2 -1
- package/legacy/hooks/features/index.js +1 -0
- package/legacy/hooks/features/rowGrouping/createGroupingColDef.js +13 -2
- package/legacy/hooks/features/rowGrouping/gridRowGroupingUtils.js +5 -1
- package/legacy/hooks/features/rowGrouping/useGridRowGrouping.js +24 -10
- package/legacy/index.js +1 -1
- package/legacy/typeOverloads/index.js +1 -1
- package/legacy/utils/releaseInfo.js +1 -1
- package/models/dataGridPremiumProps.d.ts +46 -1
- package/models/gridApiPremium.d.ts +2 -2
- package/models/gridStatePremium.d.ts +3 -1
- package/modern/DataGridPremium/DataGridPremium.js +47 -0
- package/modern/DataGridPremium/useDataGridPremiumComponent.js +6 -1
- package/modern/DataGridPremium/useDataGridPremiumProps.js +8 -2
- package/modern/components/GridAggregationColumnMenuItem.js +93 -0
- package/modern/components/GridAggregationHeader.js +92 -0
- package/modern/components/GridExcelExportMenuItem.js +11 -4
- package/modern/components/GridFooterCell.js +51 -0
- package/modern/components/GridGroupingColumnFooterCell.js +29 -0
- package/modern/hooks/features/aggregation/createAggregationLookup.js +122 -0
- package/modern/hooks/features/aggregation/gridAggregationFunctions.js +96 -0
- package/modern/hooks/features/aggregation/gridAggregationInterfaces.js +1 -0
- package/modern/hooks/features/aggregation/gridAggregationSelectors.js +5 -0
- package/modern/hooks/features/aggregation/gridAggregationUtils.js +175 -0
- package/modern/hooks/features/aggregation/index.js +4 -0
- package/modern/hooks/features/aggregation/useGridAggregation.js +92 -0
- package/modern/hooks/features/aggregation/useGridAggregationPreProcessors.js +135 -0
- package/modern/hooks/features/aggregation/wrapColumnWithAggregation.js +251 -0
- package/modern/hooks/features/export/serializer/excelSerializer.js +2 -1
- package/modern/hooks/features/index.js +1 -0
- package/modern/hooks/features/rowGrouping/createGroupingColDef.js +13 -2
- package/modern/hooks/features/rowGrouping/gridRowGroupingUtils.js +5 -1
- package/modern/hooks/features/rowGrouping/useGridRowGrouping.js +17 -11
- package/modern/index.js +1 -1
- package/modern/typeOverloads/index.js +1 -1
- package/modern/utils/releaseInfo.js +1 -1
- package/node/DataGridPremium/DataGridPremium.js +47 -0
- package/node/DataGridPremium/useDataGridPremiumComponent.js +8 -1
- package/node/DataGridPremium/useDataGridPremiumProps.js +17 -6
- package/node/components/GridAggregationColumnMenuItem.js +120 -0
- package/node/components/GridAggregationHeader.js +115 -0
- package/node/components/GridExcelExportMenuItem.js +12 -4
- package/node/components/GridFooterCell.js +73 -0
- package/node/components/GridGroupingColumnFooterCell.js +46 -0
- package/node/hooks/features/aggregation/createAggregationLookup.js +139 -0
- package/node/hooks/features/aggregation/gridAggregationFunctions.js +105 -0
- package/node/hooks/features/aggregation/gridAggregationInterfaces.js +5 -0
- package/node/hooks/features/aggregation/gridAggregationSelectors.js +17 -0
- package/node/hooks/features/aggregation/gridAggregationUtils.js +212 -0
- package/node/hooks/features/aggregation/index.js +65 -0
- package/node/hooks/features/aggregation/useGridAggregation.js +118 -0
- package/node/hooks/features/aggregation/useGridAggregationPreProcessors.js +161 -0
- package/node/hooks/features/aggregation/wrapColumnWithAggregation.js +279 -0
- package/node/hooks/features/export/serializer/excelSerializer.js +2 -1
- package/node/hooks/features/index.js +13 -0
- package/node/hooks/features/rowGrouping/createGroupingColDef.js +14 -2
- package/node/hooks/features/rowGrouping/gridRowGroupingUtils.js +5 -1
- package/node/hooks/features/rowGrouping/useGridRowGrouping.js +19 -10
- package/node/index.js +1 -1
- package/node/typeOverloads/index.js +16 -1
- package/node/utils/releaseInfo.js +1 -1
- package/package.json +4 -4
- package/typeOverloads/index.d.ts +1 -1
- package/typeOverloads/index.js +1 -1
- package/typeOverloads/modules.d.ts +32 -2
- package/utils/releaseInfo.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,49 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 5.14.0
|
|
7
|
+
|
|
8
|
+
_Jul 21, 2022_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 10 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🧪 Export `GridBooleanCell` component from data grid (#5537) @cliedeman
|
|
13
|
+
- ⚙️ Improve accessibility of the Export menu (#5486) @nogalpaulina
|
|
14
|
+
- 🌍 Improvements to different locales
|
|
15
|
+
- 📚 Documentation improvements
|
|
16
|
+
- 🐞 Bugfixes
|
|
17
|
+
|
|
18
|
+
### `@mui/x-data-grid@5.14.0` / `@mui/x-data-grid-pro@5.14.0` / `@mui/x-data-grid-premium@5.14.0`
|
|
19
|
+
|
|
20
|
+
#### Changes
|
|
21
|
+
|
|
22
|
+
- [DataGrid] Add generics to `GridPreProcessEditCellProps` (#5510) @YunosukeY
|
|
23
|
+
- [DataGrid] Avoid inconsistent state export (#5390) @flaviendelangle
|
|
24
|
+
- [DataGrid] Export `GridBooleanCell` component (#5537) @cliedeman
|
|
25
|
+
- [DataGrid] Fix `date`/`dateTime` edit input font size to match view mode (#5304) @cherniavskii
|
|
26
|
+
- [DataGrid] Fix loading overlay position (#5558) @DanailH
|
|
27
|
+
- [DataGrid] Improve accessibility of the Export menu in the toolbar (#5486) @nogalpaulina
|
|
28
|
+
- [DataGridPremium] Implement Aggregation - not publicly released (#4208) @flaviendelangle
|
|
29
|
+
- [DataGridPremium] Fix crash when exporting all columns to Excel (#5425) @cherniavskii
|
|
30
|
+
- [l10n] Add Traditional Chinese (zh-TW) locale (#5498) @happyincent
|
|
31
|
+
|
|
32
|
+
### `@mui/x-date-pickers@v5.0.0-beta.2` / `@mui/x-date-picker-pro@5.0.0-beta.2`
|
|
33
|
+
|
|
34
|
+
#### Changes
|
|
35
|
+
|
|
36
|
+
- [l10n] Add Norwegian (nb-NO) locale (#5475) @elkebab
|
|
37
|
+
|
|
38
|
+
### Docs
|
|
39
|
+
|
|
40
|
+
- [docs] New page presenting the `apiRef` (#5273) @flaviendelangle
|
|
41
|
+
- [docs] Remove blank line @oliviertassinari
|
|
42
|
+
|
|
43
|
+
### Core
|
|
44
|
+
|
|
45
|
+
- [core] Add missing comments on zh-TW translation (#5559) @flaviendelangle
|
|
46
|
+
- [core] Polish on the bug issue template (#5525) @oliviertassinari
|
|
47
|
+
- [test] Add more tests related to `isPrintableKey` (#5458) @mnajdova
|
|
48
|
+
|
|
6
49
|
## 5.13.1
|
|
7
50
|
|
|
8
51
|
_Jul 15, 2022_
|
|
@@ -1466,7 +1509,7 @@ A big thanks to the 5 contributors who made this release possible. Here are some
|
|
|
1466
1509
|
- [core] Fix `yarn prettier` script (#3292) @oliviertassinari
|
|
1467
1510
|
- [core] Improve tests for Tree Data (#3366) @flaviendelangle
|
|
1468
1511
|
- [core] Never import directly from the `__modules__` folder in the `x-data-grid-generator` package (#3379) @flaviendelangle
|
|
1469
|
-
- [core] Transition to a new
|
|
1512
|
+
- [core] Transition to a new Stack Overflow tag (#3308) @oliviertassinari
|
|
1470
1513
|
- [core] Update monorepo (#3370) @flaviendelangle
|
|
1471
1514
|
- [core] Use pre-processors for sorting and filtering (#3318) @flaviendelangle
|
|
1472
1515
|
- [test] Replace `useFakeTimers` (#3323) @m4theushw
|
|
@@ -275,6 +275,7 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
275
275
|
experimentalFeatures: PropTypes.shape({
|
|
276
276
|
newEditingApi: PropTypes.bool,
|
|
277
277
|
preventCommitWhileValidating: PropTypes.bool,
|
|
278
|
+
private_aggregation: PropTypes.bool,
|
|
278
279
|
warnIfFocusStateIsNotSynced: PropTypes.bool
|
|
279
280
|
}),
|
|
280
281
|
|
|
@@ -866,6 +867,52 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
866
867
|
right: PropTypes.arrayOf(PropTypes.string)
|
|
867
868
|
}),
|
|
868
869
|
|
|
870
|
+
/**
|
|
871
|
+
* Aggregation functions available on the grid.
|
|
872
|
+
* @default GRID_AGGREGATION_FUNCTIONS
|
|
873
|
+
* @ignore - do not document.
|
|
874
|
+
*/
|
|
875
|
+
private_aggregationFunctions: PropTypes.object,
|
|
876
|
+
|
|
877
|
+
/**
|
|
878
|
+
* Set the aggregation model of the grid.
|
|
879
|
+
* @ignore - do not document.
|
|
880
|
+
*/
|
|
881
|
+
private_aggregationModel: PropTypes.object,
|
|
882
|
+
|
|
883
|
+
/**
|
|
884
|
+
* Rows used to generate the aggregated value.
|
|
885
|
+
* If `filtered`, the aggregated values will be generated using only the rows currently passing the filtering process.
|
|
886
|
+
* If `all`, the aggregated values will be generated using all the rows.
|
|
887
|
+
* @default "filtered"
|
|
888
|
+
* @ignore - do not document.
|
|
889
|
+
*/
|
|
890
|
+
private_aggregationRowsScope: PropTypes.oneOf(['all', 'filtered']),
|
|
891
|
+
|
|
892
|
+
/**
|
|
893
|
+
* If `true`, aggregation is disabled.
|
|
894
|
+
* @default false
|
|
895
|
+
* @ignore - do not document.
|
|
896
|
+
*/
|
|
897
|
+
private_disableAggregation: PropTypes.bool,
|
|
898
|
+
|
|
899
|
+
/**
|
|
900
|
+
* Determines the position of an aggregated value.
|
|
901
|
+
* @param {GridRowTreeNodeConfig | null} groupNode The current group (`null` being the top level group).
|
|
902
|
+
* @returns {GridAggregationPosition | null} Position of the aggregated value (if `null`, the group will not be aggregated).
|
|
903
|
+
* @default `(groupNode) => groupNode == null ? 'footer' : 'inline'`
|
|
904
|
+
* @ignore - do not document.
|
|
905
|
+
*/
|
|
906
|
+
private_getAggregationPosition: PropTypes.func,
|
|
907
|
+
|
|
908
|
+
/**
|
|
909
|
+
* Callback fired when the row grouping model changes.
|
|
910
|
+
* @param {GridAggregationModel} model The aggregated columns.
|
|
911
|
+
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
912
|
+
* @ignore - do not document.
|
|
913
|
+
*/
|
|
914
|
+
private_onAggregationModelChange: PropTypes.func,
|
|
915
|
+
|
|
869
916
|
/**
|
|
870
917
|
* Callback called before updating a row with new values in the row and cell editing.
|
|
871
918
|
* Only applied if `props.experimentalFeatures.newEditingApi: true`.
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { useGridInitialization, useGridInitializeState, useGridClipboard, useGridColumnMenu, useGridColumns, columnsStateInitializer, useGridDensity, useGridCsvExport, useGridPrintExport, useGridFilter, filterStateInitializer, useGridFocus, useGridKeyboardNavigation, useGridPagination, paginationStateInitializer, useGridPreferencesPanel, useGridEditing_new, useGridEditing_old, editingStateInitializer_old, editingStateInitializer_new, useGridRows, useGridRowsPreProcessors, rowsStateInitializer, useGridRowsMeta, useGridParamsApi, useGridSelection, useGridSorting, sortingStateInitializer, useGridScroll, useGridEvents, useGridDimensions, useGridStatePersistence, useGridSelectionPreProcessors, columnMenuStateInitializer, densityStateInitializer, focusStateInitializer, preferencePanelStateInitializer, rowsMetaStateInitializer, selectionStateInitializer, useGridColumnReorder, columnReorderStateInitializer, useGridColumnResize, columnResizeStateInitializer, useGridTreeData, useGridTreeDataPreProcessors, useGridColumnPinning, columnPinningStateInitializer, useGridColumnPinningPreProcessors, useGridDetailPanel, detailPanelStateInitializer, useGridDetailPanelPreProcessors, useGridInfiniteLoader, useGridColumnSpanning, useGridRowReorder, useGridRowReorderPreProcessors } from '@mui/x-data-grid-pro/internals';
|
|
2
2
|
// Premium-only features
|
|
3
|
+
import { useGridAggregation, aggregationStateInitializer } from '../hooks/features/aggregation/useGridAggregation';
|
|
4
|
+
import { useGridAggregationPreProcessors } from '../hooks/features/aggregation/useGridAggregationPreProcessors';
|
|
3
5
|
import { useGridRowGrouping, rowGroupingStateInitializer } from '../hooks/features/rowGrouping/useGridRowGrouping';
|
|
4
6
|
import { useGridRowGroupingPreProcessors } from '../hooks/features/rowGrouping/useGridRowGroupingPreProcessors';
|
|
5
7
|
import { useGridExcelExport } from '../hooks/features/export/useGridExcelExport';
|
|
@@ -15,6 +17,7 @@ export const useDataGridPremiumComponent = (inputApiRef, props) => {
|
|
|
15
17
|
useGridRowReorderPreProcessors(apiRef, props);
|
|
16
18
|
useGridRowGroupingPreProcessors(apiRef, props);
|
|
17
19
|
useGridTreeDataPreProcessors(apiRef, props);
|
|
20
|
+
useGridAggregationPreProcessors(apiRef, props);
|
|
18
21
|
useGridDetailPanelPreProcessors(apiRef, props); // The column pinning `hydrateColumns` pre-processor must be after every other `hydrateColumns` pre-processors
|
|
19
22
|
// Because it changes the order of the columns.
|
|
20
23
|
|
|
@@ -25,6 +28,7 @@ export const useDataGridPremiumComponent = (inputApiRef, props) => {
|
|
|
25
28
|
*/
|
|
26
29
|
|
|
27
30
|
useGridInitializeState(rowGroupingStateInitializer, apiRef, props);
|
|
31
|
+
useGridInitializeState(aggregationStateInitializer, apiRef, props);
|
|
28
32
|
useGridInitializeState(selectionStateInitializer, apiRef, props);
|
|
29
33
|
useGridInitializeState(detailPanelStateInitializer, apiRef, props);
|
|
30
34
|
useGridInitializeState(columnPinningStateInitializer, apiRef, props);
|
|
@@ -43,6 +47,7 @@ export const useDataGridPremiumComponent = (inputApiRef, props) => {
|
|
|
43
47
|
useGridInitializeState(columnMenuStateInitializer, apiRef, props);
|
|
44
48
|
useGridRowGrouping(apiRef, props);
|
|
45
49
|
useGridTreeData(apiRef);
|
|
50
|
+
useGridAggregation(apiRef, props);
|
|
46
51
|
useGridKeyboardNavigation(apiRef, props);
|
|
47
52
|
useGridSelection(apiRef, props);
|
|
48
53
|
useGridColumnPinning(apiRef, props);
|
|
@@ -54,7 +59,7 @@ export const useDataGridPremiumComponent = (inputApiRef, props) => {
|
|
|
54
59
|
const useGridEditing = (_props$experimentalFe2 = props.experimentalFeatures) != null && _props$experimentalFe2.newEditingApi ? useGridEditing_new : useGridEditing_old;
|
|
55
60
|
useGridEditing(apiRef, props);
|
|
56
61
|
useGridFocus(apiRef, props);
|
|
57
|
-
useGridPreferencesPanel(apiRef);
|
|
62
|
+
useGridPreferencesPanel(apiRef, props);
|
|
58
63
|
useGridFilter(apiRef, props);
|
|
59
64
|
useGridSorting(apiRef, props);
|
|
60
65
|
useGridDensity(apiRef, props);
|
|
@@ -2,13 +2,18 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useThemeProps } from '@mui/material/styles';
|
|
4
4
|
import { DATA_GRID_PRO_PROPS_DEFAULT_VALUES, DATA_GRID_DEFAULT_SLOTS_COMPONENTS, GRID_DEFAULT_LOCALE_TEXT } from '@mui/x-data-grid-pro';
|
|
5
|
-
|
|
5
|
+
import { PRIVATE_GRID_AGGREGATION_FUNCTIONS } from '../hooks/features/aggregation';
|
|
6
6
|
/**
|
|
7
7
|
* The default values of `DataGridPremiumPropsWithDefaultValue` to inject in the props of DataGridPremium.
|
|
8
8
|
*/
|
|
9
|
+
|
|
9
10
|
export const DATA_GRID_PREMIUM_PROPS_DEFAULT_VALUES = _extends({}, DATA_GRID_PRO_PROPS_DEFAULT_VALUES, {
|
|
11
|
+
private_disableAggregation: false,
|
|
10
12
|
disableRowGrouping: false,
|
|
11
|
-
rowGroupingColumnMode: 'single'
|
|
13
|
+
rowGroupingColumnMode: 'single',
|
|
14
|
+
private_aggregationFunctions: PRIVATE_GRID_AGGREGATION_FUNCTIONS,
|
|
15
|
+
private_aggregationRowsScope: 'filtered',
|
|
16
|
+
private_getAggregationPosition: groupNode => groupNode == null ? 'footer' : 'inline'
|
|
12
17
|
});
|
|
13
18
|
export const useDataGridPremiumProps = inProps => {
|
|
14
19
|
const themedProps = useThemeProps({
|
|
@@ -29,9 +34,14 @@ export const useDataGridPremiumProps = inProps => {
|
|
|
29
34
|
});
|
|
30
35
|
return mergedComponents;
|
|
31
36
|
}, [themedProps.components]);
|
|
32
|
-
return React.useMemo(() =>
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
return React.useMemo(() => {
|
|
38
|
+
var _themedProps$experime;
|
|
39
|
+
|
|
40
|
+
return _extends({}, DATA_GRID_PREMIUM_PROPS_DEFAULT_VALUES, themedProps, {
|
|
41
|
+
private_disableAggregation: themedProps.private_disableAggregation || !((_themedProps$experime = themedProps.experimentalFeatures) != null && _themedProps$experime.private_aggregation),
|
|
42
|
+
localeText,
|
|
43
|
+
components,
|
|
44
|
+
signature: 'DataGridPremium'
|
|
45
|
+
});
|
|
46
|
+
}, [themedProps, localeText, components]);
|
|
37
47
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { GridColDef } from '@mui/x-data-grid-pro';
|
|
3
|
+
interface GridAggregationColumnMenuItemsProps {
|
|
4
|
+
column: GridColDef;
|
|
5
|
+
label: string;
|
|
6
|
+
availableAggregationFunctions: string[];
|
|
7
|
+
}
|
|
8
|
+
export declare const GridAggregationColumnMenuItem: (props: GridAggregationColumnMenuItemsProps) => JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
import _toPropertyKey from "@babel/runtime/helpers/esm/toPropertyKey";
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { useGridSelector } from '@mui/x-data-grid-pro';
|
|
6
|
+
import MenuItem from '@mui/material/MenuItem';
|
|
7
|
+
import FormControl from '@mui/material/FormControl';
|
|
8
|
+
import InputLabel from '@mui/material/InputLabel';
|
|
9
|
+
import { unstable_useId as useId } from '@mui/material/utils';
|
|
10
|
+
import Select from '@mui/material/Select';
|
|
11
|
+
import { useGridApiContext } from '../hooks/utils/useGridApiContext';
|
|
12
|
+
import { useGridRootProps } from '../hooks/utils/useGridRootProps';
|
|
13
|
+
import { canColumnHaveAggregationFunction, getAggregationFunctionLabel } from '../hooks/features/aggregation/gridAggregationUtils';
|
|
14
|
+
import { gridAggregationModelSelector } from '../hooks/features/aggregation/gridAggregationSelectors';
|
|
15
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
|
+
export const GridAggregationColumnMenuItem = props => {
|
|
18
|
+
const {
|
|
19
|
+
column,
|
|
20
|
+
label,
|
|
21
|
+
availableAggregationFunctions
|
|
22
|
+
} = props;
|
|
23
|
+
const apiRef = useGridApiContext();
|
|
24
|
+
const rootProps = useGridRootProps();
|
|
25
|
+
const id = useId();
|
|
26
|
+
const aggregationModel = useGridSelector(apiRef, gridAggregationModelSelector);
|
|
27
|
+
const selectedAggregationRule = React.useMemo(() => {
|
|
28
|
+
if (!column || !aggregationModel[column.field]) {
|
|
29
|
+
return '';
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const aggregationFunctionName = aggregationModel[column.field];
|
|
33
|
+
|
|
34
|
+
if (canColumnHaveAggregationFunction({
|
|
35
|
+
column,
|
|
36
|
+
aggregationFunctionName,
|
|
37
|
+
aggregationFunction: rootProps.private_aggregationFunctions[aggregationFunctionName]
|
|
38
|
+
})) {
|
|
39
|
+
return aggregationFunctionName;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return '';
|
|
43
|
+
}, [rootProps.private_aggregationFunctions, aggregationModel, column]);
|
|
44
|
+
|
|
45
|
+
const handleAggregationItemChange = event => {
|
|
46
|
+
const newAggregationItem = event.target.value || undefined;
|
|
47
|
+
const currentModel = gridAggregationModelSelector(apiRef);
|
|
48
|
+
|
|
49
|
+
const _column$field = column.field,
|
|
50
|
+
otherColumnItems = _objectWithoutPropertiesLoose(currentModel, [_column$field].map(_toPropertyKey));
|
|
51
|
+
|
|
52
|
+
const newModel = newAggregationItem == null ? otherColumnItems : _extends({}, otherColumnItems, {
|
|
53
|
+
[column.field]: newAggregationItem
|
|
54
|
+
});
|
|
55
|
+
apiRef.current.private_setAggregationModel(newModel);
|
|
56
|
+
apiRef.current.hideColumnMenu();
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
return /*#__PURE__*/_jsx(MenuItem, {
|
|
60
|
+
disableRipple: true,
|
|
61
|
+
children: /*#__PURE__*/_jsxs(FormControl, {
|
|
62
|
+
size: "small",
|
|
63
|
+
sx: {
|
|
64
|
+
width: 150
|
|
65
|
+
},
|
|
66
|
+
children: [/*#__PURE__*/_jsx(InputLabel, {
|
|
67
|
+
id: `${id}-label`,
|
|
68
|
+
children: label
|
|
69
|
+
}), /*#__PURE__*/_jsxs(Select, {
|
|
70
|
+
labelId: `${id}-label`,
|
|
71
|
+
id: `${id}-input`,
|
|
72
|
+
value: selectedAggregationRule,
|
|
73
|
+
label: label,
|
|
74
|
+
onChange: handleAggregationItemChange,
|
|
75
|
+
onBlur: e => e.stopPropagation(),
|
|
76
|
+
fullWidth: true,
|
|
77
|
+
children: [/*#__PURE__*/_jsx(MenuItem, {
|
|
78
|
+
value: "",
|
|
79
|
+
children: "..."
|
|
80
|
+
}), availableAggregationFunctions.map(aggFunc => /*#__PURE__*/_jsx(MenuItem, {
|
|
81
|
+
value: aggFunc,
|
|
82
|
+
children: getAggregationFunctionLabel({
|
|
83
|
+
apiRef,
|
|
84
|
+
aggregationRule: {
|
|
85
|
+
aggregationFunctionName: aggFunc,
|
|
86
|
+
aggregationFunction: rootProps.private_aggregationFunctions[aggFunc]
|
|
87
|
+
}
|
|
88
|
+
})
|
|
89
|
+
}, aggFunc))]
|
|
90
|
+
})]
|
|
91
|
+
})
|
|
92
|
+
});
|
|
93
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
3
|
+
import Box from '@mui/material/Box';
|
|
4
|
+
import { styled } from '@mui/material/styles';
|
|
5
|
+
import { getDataGridUtilityClass, gridClasses, GridColumnHeaderTitle, gridDensityHeaderHeightSelector, useGridSelector } from '@mui/x-data-grid';
|
|
6
|
+
import { getAggregationFunctionLabel } from '../hooks/features/aggregation/gridAggregationUtils';
|
|
7
|
+
import { useGridApiContext } from '../hooks/utils/useGridApiContext';
|
|
8
|
+
import { useGridRootProps } from '../hooks/utils/useGridRootProps';
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
const GridAggregationHeaderRoot = styled(Box, {
|
|
12
|
+
name: 'MuiDataGrid',
|
|
13
|
+
slot: 'AggregationColumnHeader',
|
|
14
|
+
overridesResolver: (_, styles) => styles.aggregationColumnHeader
|
|
15
|
+
})({
|
|
16
|
+
display: 'flex',
|
|
17
|
+
flexDirection: 'column',
|
|
18
|
+
[`&.${gridClasses['aggregationColumnHeader--alignRight']}`]: {
|
|
19
|
+
alignItems: 'flex-end'
|
|
20
|
+
},
|
|
21
|
+
[`&.${gridClasses['aggregationColumnHeader--alignCenter']}`]: {
|
|
22
|
+
alignItems: 'center'
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
const GridAggregationFunctionLabel = styled('div', {
|
|
26
|
+
name: 'MuiDataGrid',
|
|
27
|
+
slot: 'AggregationColumnHeaderLabel',
|
|
28
|
+
overridesResolver: (_, styles) => styles.aggregationColumnHeaderLabel
|
|
29
|
+
})(({
|
|
30
|
+
theme
|
|
31
|
+
}) => {
|
|
32
|
+
return {
|
|
33
|
+
fontSize: theme.typography.caption.fontSize,
|
|
34
|
+
lineHeight: theme.typography.caption.fontSize,
|
|
35
|
+
marginTop: `calc(-2px - ${theme.typography.caption.fontSize})`,
|
|
36
|
+
fontWeight: theme.typography.fontWeightMedium,
|
|
37
|
+
color: theme.palette.primary.dark,
|
|
38
|
+
textTransform: 'uppercase'
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const useUtilityClasses = ownerState => {
|
|
43
|
+
const {
|
|
44
|
+
classes,
|
|
45
|
+
colDef
|
|
46
|
+
} = ownerState;
|
|
47
|
+
const slots = {
|
|
48
|
+
root: ['aggregationColumnHeader', colDef.headerAlign === 'left' && 'aggregationColumnHeader--alignLeft', colDef.headerAlign === 'center' && 'aggregationColumnHeader--alignCenter', colDef.headerAlign === 'right' && 'aggregationColumnHeader--alignRight'],
|
|
49
|
+
aggregationLabel: ['aggregationColumnHeaderLabel']
|
|
50
|
+
};
|
|
51
|
+
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const GridAggregationHeader = props => {
|
|
55
|
+
var _colDef$headerName;
|
|
56
|
+
|
|
57
|
+
const {
|
|
58
|
+
colDef,
|
|
59
|
+
aggregation
|
|
60
|
+
} = props;
|
|
61
|
+
const apiRef = useGridApiContext();
|
|
62
|
+
const rootProps = useGridRootProps();
|
|
63
|
+
const headerHeight = useGridSelector(apiRef, gridDensityHeaderHeightSelector);
|
|
64
|
+
const ownerState = {
|
|
65
|
+
classes: rootProps.classes,
|
|
66
|
+
headerHeight,
|
|
67
|
+
colDef
|
|
68
|
+
};
|
|
69
|
+
const classes = useUtilityClasses(ownerState);
|
|
70
|
+
|
|
71
|
+
if (!aggregation) {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const aggregationLabel = getAggregationFunctionLabel({
|
|
76
|
+
apiRef,
|
|
77
|
+
aggregationRule: aggregation.aggregationRule
|
|
78
|
+
});
|
|
79
|
+
return /*#__PURE__*/_jsxs(GridAggregationHeaderRoot, {
|
|
80
|
+
ownerState: ownerState,
|
|
81
|
+
className: classes.root,
|
|
82
|
+
children: [/*#__PURE__*/_jsx(GridColumnHeaderTitle, {
|
|
83
|
+
label: (_colDef$headerName = colDef.headerName) != null ? _colDef$headerName : colDef.field,
|
|
84
|
+
description: colDef.description,
|
|
85
|
+
columnWidth: colDef.computedWidth
|
|
86
|
+
}), /*#__PURE__*/_jsx(GridAggregationFunctionLabel, {
|
|
87
|
+
ownerState: ownerState,
|
|
88
|
+
className: classes.aggregationLabel,
|
|
89
|
+
children: aggregationLabel
|
|
90
|
+
})]
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export { GridAggregationHeader };
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
const _excluded = ["hideMenu", "options"];
|
|
1
4
|
import * as React from 'react';
|
|
2
5
|
import PropTypes from 'prop-types';
|
|
3
6
|
import MenuItem from '@mui/material/MenuItem';
|
|
@@ -6,17 +9,21 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
6
9
|
|
|
7
10
|
const GridExcelExportMenuItem = props => {
|
|
8
11
|
const apiRef = useGridApiContext();
|
|
12
|
+
|
|
9
13
|
const {
|
|
10
14
|
hideMenu,
|
|
11
15
|
options
|
|
12
|
-
} = props
|
|
13
|
-
|
|
16
|
+
} = props,
|
|
17
|
+
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
18
|
+
|
|
19
|
+
return /*#__PURE__*/_jsx(MenuItem, _extends({
|
|
14
20
|
onClick: () => {
|
|
15
21
|
apiRef.current.exportDataAsExcel(options);
|
|
16
22
|
hideMenu == null ? void 0 : hideMenu();
|
|
17
|
-
}
|
|
23
|
+
}
|
|
24
|
+
}, other, {
|
|
18
25
|
children: apiRef.current.getLocaleText('toolbarExportExcel')
|
|
19
|
-
});
|
|
26
|
+
}));
|
|
20
27
|
};
|
|
21
28
|
|
|
22
29
|
process.env.NODE_ENV !== "production" ? GridExcelExportMenuItem.propTypes = {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { GridRenderCellParams } from '@mui/x-data-grid';
|
|
3
|
+
import { Theme } from '@mui/material/styles';
|
|
4
|
+
import { SxProps } from '@mui/system';
|
|
5
|
+
interface GridFooterCellProps extends GridRenderCellParams {
|
|
6
|
+
sx?: SxProps<Theme>;
|
|
7
|
+
}
|
|
8
|
+
declare const GridFooterCell: (props: GridFooterCellProps) => JSX.Element;
|
|
9
|
+
export { GridFooterCell };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
const _excluded = ["formattedValue", "colDef", "cellMode", "row", "api", "getValue", "id", "value", "rowNode", "field", "focusElementRef", "hasFocus", "tabIndex", "isEditable"];
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { getDataGridUtilityClass } from '@mui/x-data-grid';
|
|
6
|
+
import { styled } from '@mui/material/styles';
|
|
7
|
+
import Box from '@mui/material/Box';
|
|
8
|
+
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
9
|
+
import { useGridRootProps } from '../hooks/utils/useGridRootProps';
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
const GridFooterCellRoot = styled(Box, {
|
|
12
|
+
name: 'MuiDataGrid',
|
|
13
|
+
slot: 'FooterCell',
|
|
14
|
+
overridesResolver: (_, styles) => styles.footerCell
|
|
15
|
+
})(({
|
|
16
|
+
theme
|
|
17
|
+
}) => ({
|
|
18
|
+
fontWeight: theme.typography.fontWeightMedium,
|
|
19
|
+
color: theme.palette.primary.dark
|
|
20
|
+
}));
|
|
21
|
+
|
|
22
|
+
const useUtilityClasses = ownerState => {
|
|
23
|
+
const {
|
|
24
|
+
classes
|
|
25
|
+
} = ownerState;
|
|
26
|
+
const slots = {
|
|
27
|
+
root: ['footerCell']
|
|
28
|
+
};
|
|
29
|
+
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const GridFooterCell = props => {
|
|
33
|
+
const {
|
|
34
|
+
formattedValue
|
|
35
|
+
} = props,
|
|
36
|
+
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
37
|
+
|
|
38
|
+
const rootProps = useGridRootProps();
|
|
39
|
+
const ownerState = {
|
|
40
|
+
classes: rootProps.classes
|
|
41
|
+
};
|
|
42
|
+
const classes = useUtilityClasses(ownerState);
|
|
43
|
+
return /*#__PURE__*/_jsx(GridFooterCellRoot, _extends({
|
|
44
|
+
ownerState: ownerState,
|
|
45
|
+
className: classes.root
|
|
46
|
+
}, other, {
|
|
47
|
+
children: formattedValue
|
|
48
|
+
}));
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export { GridFooterCell };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useGridRootProps } from '../hooks/utils/useGridRootProps';
|
|
4
|
+
import { GridFooterCell } from './GridFooterCell';
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
const GridGroupingColumnFooterCell = props => {
|
|
8
|
+
const {
|
|
9
|
+
rowNode
|
|
10
|
+
} = props;
|
|
11
|
+
const rootProps = useGridRootProps();
|
|
12
|
+
let marginLeft;
|
|
13
|
+
|
|
14
|
+
if (rowNode.parent == null) {
|
|
15
|
+
marginLeft = 0;
|
|
16
|
+
} else if (rootProps.rowGroupingColumnMode === 'multiple') {
|
|
17
|
+
marginLeft = 2;
|
|
18
|
+
} else {
|
|
19
|
+
marginLeft = rowNode.depth * 2;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return /*#__PURE__*/_jsx(GridFooterCell, _extends({
|
|
23
|
+
sx: {
|
|
24
|
+
ml: marginLeft
|
|
25
|
+
}
|
|
26
|
+
}, props));
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export { GridGroupingColumnFooterCell };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { GridApiPremium } from '../../../models/gridApiPremium';
|
|
3
|
+
import { DataGridPremiumProcessedProps } from '../../../models/dataGridPremiumProps';
|
|
4
|
+
import { GridAggregationFunction, GridAggregationLookup } from './gridAggregationInterfaces';
|
|
5
|
+
export declare const createAggregationLookup: ({ apiRef, aggregationFunctions, aggregationRowsScope, getAggregationPosition, }: {
|
|
6
|
+
apiRef: React.MutableRefObject<GridApiPremium>;
|
|
7
|
+
aggregationFunctions: Record<string, GridAggregationFunction>;
|
|
8
|
+
aggregationRowsScope: DataGridPremiumProcessedProps['private_aggregationRowsScope'];
|
|
9
|
+
getAggregationPosition: DataGridPremiumProcessedProps['private_getAggregationPosition'];
|
|
10
|
+
}) => GridAggregationLookup;
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { gridColumnLookupSelector, gridFilteredRowsLookupSelector, gridRowIdsSelector, gridRowTreeSelector } from '@mui/x-data-grid-pro';
|
|
2
|
+
import { getAggregationRules } from './gridAggregationUtils';
|
|
3
|
+
import { gridAggregationModelSelector } from './gridAggregationSelectors';
|
|
4
|
+
|
|
5
|
+
const getAggregationCellValue = ({
|
|
6
|
+
apiRef,
|
|
7
|
+
groupId,
|
|
8
|
+
field,
|
|
9
|
+
aggregationFunction,
|
|
10
|
+
aggregationRowsScope
|
|
11
|
+
}) => {
|
|
12
|
+
const rowTree = gridRowTreeSelector(apiRef);
|
|
13
|
+
const filteredRowsLookup = gridFilteredRowsLookupSelector(apiRef);
|
|
14
|
+
let rowIds; // TODO: Add custom root id
|
|
15
|
+
|
|
16
|
+
if (groupId === '') {
|
|
17
|
+
rowIds = gridRowIdsSelector(apiRef).filter(rowId => !rowTree[rowId].isAutoGenerated);
|
|
18
|
+
} else {
|
|
19
|
+
rowIds = apiRef.current.getRowGroupChildren({
|
|
20
|
+
groupId
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const values = [];
|
|
25
|
+
rowIds.forEach(rowId => {
|
|
26
|
+
if (aggregationRowsScope === 'filtered' && filteredRowsLookup[rowId] === false) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
values.push(apiRef.current.getCellValue(rowId, field));
|
|
31
|
+
});
|
|
32
|
+
return aggregationFunction.apply({
|
|
33
|
+
values
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const getGroupAggregatedValue = ({
|
|
38
|
+
groupId,
|
|
39
|
+
apiRef,
|
|
40
|
+
aggregationRowsScope,
|
|
41
|
+
aggregatedFields,
|
|
42
|
+
aggregationRules,
|
|
43
|
+
position
|
|
44
|
+
}) => {
|
|
45
|
+
const groupAggregationLookup = {};
|
|
46
|
+
|
|
47
|
+
for (let j = 0; j < aggregatedFields.length; j += 1) {
|
|
48
|
+
const aggregatedField = aggregatedFields[j];
|
|
49
|
+
const columnAggregationRules = aggregationRules[aggregatedField];
|
|
50
|
+
groupAggregationLookup[aggregatedField] = {
|
|
51
|
+
position,
|
|
52
|
+
value: getAggregationCellValue({
|
|
53
|
+
apiRef,
|
|
54
|
+
groupId,
|
|
55
|
+
field: aggregatedField,
|
|
56
|
+
aggregationFunction: columnAggregationRules.aggregationFunction,
|
|
57
|
+
aggregationRowsScope
|
|
58
|
+
})
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return groupAggregationLookup;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export const createAggregationLookup = ({
|
|
66
|
+
apiRef,
|
|
67
|
+
aggregationFunctions,
|
|
68
|
+
aggregationRowsScope,
|
|
69
|
+
getAggregationPosition
|
|
70
|
+
}) => {
|
|
71
|
+
const aggregationRules = getAggregationRules({
|
|
72
|
+
columnsLookup: gridColumnLookupSelector(apiRef),
|
|
73
|
+
aggregationModel: gridAggregationModelSelector(apiRef),
|
|
74
|
+
aggregationFunctions
|
|
75
|
+
});
|
|
76
|
+
const aggregatedFields = Object.keys(aggregationRules);
|
|
77
|
+
|
|
78
|
+
if (aggregatedFields.length === 0) {
|
|
79
|
+
return {};
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const aggregationLookup = {};
|
|
83
|
+
const rowIds = gridRowIdsSelector(apiRef);
|
|
84
|
+
const rowTree = gridRowTreeSelector(apiRef);
|
|
85
|
+
|
|
86
|
+
for (let i = 0; i < rowIds.length; i += 1) {
|
|
87
|
+
var _node$children;
|
|
88
|
+
|
|
89
|
+
const rowId = rowIds[i];
|
|
90
|
+
const node = rowTree[rowId];
|
|
91
|
+
const hasChildren = (_node$children = node.children) == null ? void 0 : _node$children.some(childId => {
|
|
92
|
+
var _rowTree$childId$posi;
|
|
93
|
+
|
|
94
|
+
return ((_rowTree$childId$posi = rowTree[childId].position) != null ? _rowTree$childId$posi : 'body') === 'body';
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
if (hasChildren) {
|
|
98
|
+
const position = getAggregationPosition(node);
|
|
99
|
+
|
|
100
|
+
if (position != null) {
|
|
101
|
+
aggregationLookup[rowId] = getGroupAggregatedValue({
|
|
102
|
+
groupId: rowId,
|
|
103
|
+
apiRef,
|
|
104
|
+
aggregatedFields,
|
|
105
|
+
aggregationRowsScope,
|
|
106
|
+
aggregationRules,
|
|
107
|
+
position
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
} // TODO: Add custom root id
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
const position = getAggregationPosition(null);
|
|
115
|
+
|
|
116
|
+
if (position != null) {
|
|
117
|
+
aggregationLookup[''] = getGroupAggregatedValue({
|
|
118
|
+
groupId: '',
|
|
119
|
+
apiRef,
|
|
120
|
+
aggregatedFields,
|
|
121
|
+
aggregationRowsScope,
|
|
122
|
+
aggregationRules,
|
|
123
|
+
position
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
return aggregationLookup;
|
|
128
|
+
};
|