@mui/x-data-grid-premium 7.21.0 → 7.22.1
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 +142 -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 +12 -15
- package/esm/hooks/features/rowGrouping/useGridDataSourceRowGroupingPreProcessors.js +73 -0
- package/esm/hooks/features/rowGrouping/useGridRowGrouping.js +17 -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 +9 -9
- package/hooks/features/rowGrouping/gridRowGroupingUtils.js +34 -20
- 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 +16 -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 +12 -15
- package/modern/hooks/features/rowGrouping/useGridDataSourceRowGroupingPreProcessors.js +73 -0
- package/modern/hooks/features/rowGrouping/useGridRowGrouping.js +17 -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,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/modern/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "
|
|
3
|
+
const releaseInfo = "MTczMDQzMzYwMDAwMA==";
|
|
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
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-data-grid-premium",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.22.1",
|
|
4
4
|
"description": "The Premium plan edition of the Data Grid Components (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
"exceljs": "^4.4.0",
|
|
41
41
|
"prop-types": "^15.8.1",
|
|
42
42
|
"reselect": "^5.1.1",
|
|
43
|
-
"@mui/x-
|
|
44
|
-
"@mui/x-data-grid-pro": "7.21.0",
|
|
43
|
+
"@mui/x-data-grid-pro": "7.22.1",
|
|
45
44
|
"@mui/x-license": "7.21.0",
|
|
46
|
-
"@mui/x-data-grid": "7.
|
|
45
|
+
"@mui/x-data-grid": "7.22.1",
|
|
46
|
+
"@mui/x-internals": "7.21.0"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"@emotion/react": "^11.9.0",
|
package/utils/releaseInfo.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.getReleaseInfo = void 0;
|
|
7
7
|
var _utils = require("@mui/utils");
|
|
8
8
|
const getReleaseInfo = () => {
|
|
9
|
-
const releaseInfo = "
|
|
9
|
+
const releaseInfo = "MTczMDQzMzYwMDAwMA==";
|
|
10
10
|
if (process.env.NODE_ENV !== 'production') {
|
|
11
11
|
// A simple hack to set the value in the test environment (has no build step).
|
|
12
12
|
// eslint-disable-next-line no-useless-concat
|