@mui/x-data-grid-pro 6.5.0 → 6.7.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 +150 -2
- package/DataGridPro/DataGridPro.js +10 -3
- package/README.md +2 -2
- package/components/DataGridProVirtualScroller.js +12 -12
- package/components/GridColumnHeaders.js +9 -3
- package/components/GridColumnMenuPinningItem.d.ts +2 -2
- package/components/GridDetailPanel.d.ts +1 -1
- package/components/GridDetailPanelToggleCell.d.ts +2 -2
- package/components/GridRowReorderCell.d.ts +3 -3
- package/components/GridScrollArea.d.ts +10 -0
- package/components/GridScrollArea.js +140 -0
- package/components/GridTreeDataGroupingCell.d.ts +2 -2
- package/components/headerFiltering/GridHeaderFilterCell.d.ts +0 -1
- package/components/headerFiltering/GridHeaderFilterCell.js +36 -23
- package/components/headerFiltering/GridHeaderFilterClearButton.d.ts +2 -2
- package/components/headerFiltering/GridHeaderFilterClearButton.js +1 -1
- package/components/headerFiltering/GridHeaderFilterMenu.d.ts +5 -2
- package/components/headerFiltering/GridHeaderFilterMenu.js +36 -15
- package/components/headerFiltering/{GridHeaderFilterAdornment.d.ts → GridHeaderFilterMenuContainer.d.ts} +4 -4
- package/{modern/components/headerFiltering/GridHeaderFilterAdornment.js → components/headerFiltering/GridHeaderFilterMenuContainer.js} +23 -24
- package/components/headerFiltering/index.d.ts +2 -1
- package/components/headerFiltering/index.js +3 -2
- package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +3 -3
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +16 -8
- package/hooks/features/columnResize/useGridColumnResize.js +11 -12
- package/hooks/features/detailPanel/useGridDetailPanel.js +4 -6
- package/hooks/features/lazyLoader/useGridLazyLoaderPreProcessors.js +2 -2
- package/hooks/features/rowPinning/useGridRowPinningPreProcessors.js +1 -6
- package/hooks/features/treeData/gridTreeDataUtils.js +0 -8
- package/hooks/features/treeData/useGridTreeDataPreProcessors.js +2 -0
- package/index.js +1 -1
- package/internals/index.d.ts +1 -1
- package/internals/index.js +1 -1
- package/legacy/DataGridPro/DataGridPro.js +10 -3
- package/legacy/components/DataGridProVirtualScroller.js +12 -12
- package/legacy/components/GridColumnHeaders.js +9 -3
- package/legacy/components/GridScrollArea.js +143 -0
- package/legacy/components/headerFiltering/GridHeaderFilterCell.js +39 -27
- package/legacy/components/headerFiltering/GridHeaderFilterClearButton.js +1 -1
- package/legacy/components/headerFiltering/GridHeaderFilterMenu.js +36 -15
- package/legacy/components/headerFiltering/{GridHeaderFilterAdornment.js → GridHeaderFilterMenuContainer.js} +23 -25
- package/legacy/components/headerFiltering/index.js +3 -2
- package/legacy/hooks/features/columnHeaders/useGridColumnHeaders.js +14 -8
- package/legacy/hooks/features/columnResize/useGridColumnResize.js +11 -12
- package/legacy/hooks/features/detailPanel/useGridDetailPanel.js +4 -6
- package/legacy/hooks/features/lazyLoader/useGridLazyLoaderPreProcessors.js +2 -2
- package/legacy/hooks/features/rowPinning/useGridRowPinningPreProcessors.js +1 -6
- package/legacy/hooks/features/treeData/gridTreeDataUtils.js +0 -8
- package/legacy/hooks/features/treeData/useGridTreeDataPreProcessors.js +2 -0
- package/legacy/index.js +1 -1
- package/legacy/internals/index.js +1 -1
- package/legacy/material/icons.js +1 -4
- package/legacy/material/index.js +2 -3
- package/legacy/utils/releaseInfo.js +1 -1
- package/legacy/utils/tree/insertDataRowInTree.js +8 -24
- package/legacy/utils/tree/sortRowTree.js +78 -18
- package/legacy/utils/tree/utils.js +55 -37
- package/material/icons.d.ts +0 -3
- package/material/icons.js +1 -4
- package/material/index.d.ts +0 -1
- package/material/index.js +2 -3
- package/models/gridProIconSlotsComponent.d.ts +0 -5
- package/modern/DataGridPro/DataGridPro.js +10 -3
- package/modern/components/DataGridProVirtualScroller.js +12 -12
- package/modern/components/GridColumnHeaders.js +9 -3
- package/modern/components/GridScrollArea.js +140 -0
- package/modern/components/headerFiltering/GridHeaderFilterCell.js +36 -23
- package/modern/components/headerFiltering/GridHeaderFilterClearButton.js +1 -1
- package/modern/components/headerFiltering/GridHeaderFilterMenu.js +36 -15
- package/{components/headerFiltering/GridHeaderFilterAdornment.js → modern/components/headerFiltering/GridHeaderFilterMenuContainer.js} +22 -25
- package/modern/components/headerFiltering/index.js +3 -2
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +16 -8
- package/modern/hooks/features/columnResize/useGridColumnResize.js +11 -12
- package/modern/hooks/features/detailPanel/useGridDetailPanel.js +4 -6
- package/modern/hooks/features/lazyLoader/useGridLazyLoaderPreProcessors.js +2 -2
- package/modern/hooks/features/rowPinning/useGridRowPinningPreProcessors.js +1 -6
- package/modern/hooks/features/treeData/gridTreeDataUtils.js +0 -8
- package/modern/hooks/features/treeData/useGridTreeDataPreProcessors.js +2 -0
- package/modern/index.js +1 -1
- package/modern/internals/index.js +1 -1
- package/modern/material/icons.js +1 -4
- package/modern/material/index.js +2 -3
- package/modern/utils/releaseInfo.js +1 -1
- package/modern/utils/tree/insertDataRowInTree.js +8 -24
- package/modern/utils/tree/sortRowTree.js +64 -18
- package/modern/utils/tree/utils.js +43 -26
- package/node/DataGridPro/DataGridPro.js +10 -3
- package/node/components/DataGridProVirtualScroller.js +12 -12
- package/node/components/GridColumnHeaders.js +8 -3
- package/node/components/GridScrollArea.js +149 -0
- package/node/components/headerFiltering/GridHeaderFilterCell.js +36 -23
- package/node/components/headerFiltering/GridHeaderFilterClearButton.js +1 -1
- package/node/components/headerFiltering/GridHeaderFilterMenu.js +36 -14
- package/node/components/headerFiltering/{GridHeaderFilterAdornment.js → GridHeaderFilterMenuContainer.js} +22 -24
- package/node/components/headerFiltering/index.js +15 -4
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +15 -7
- package/node/hooks/features/columnResize/useGridColumnResize.js +11 -12
- package/node/hooks/features/detailPanel/useGridDetailPanel.js +4 -6
- package/node/hooks/features/lazyLoader/useGridLazyLoaderPreProcessors.js +2 -2
- package/node/hooks/features/rowPinning/useGridRowPinningPreProcessors.js +1 -6
- package/node/hooks/features/treeData/gridTreeDataUtils.js +0 -8
- package/node/hooks/features/treeData/useGridTreeDataPreProcessors.js +2 -0
- package/node/index.js +1 -1
- package/node/internals/index.js +8 -1
- package/node/material/icons.js +2 -6
- package/node/material/index.js +1 -2
- package/node/utils/releaseInfo.js +1 -1
- package/node/utils/tree/insertDataRowInTree.js +7 -23
- package/node/utils/tree/sortRowTree.js +64 -18
- package/node/utils/tree/utils.js +46 -28
- package/package.json +6 -6
- package/themeAugmentation/overrides.d.ts +1 -1
- package/typeOverloads/modules.d.ts +6 -6
- package/utils/releaseInfo.js +1 -1
- package/utils/tree/insertDataRowInTree.js +8 -24
- package/utils/tree/sortRowTree.js +64 -18
- package/utils/tree/utils.d.ts +7 -38
- package/utils/tree/utils.js +43 -26
- package/components/headerFiltering/constants.d.ts +0 -3
- package/components/headerFiltering/constants.js +0 -30
- package/legacy/components/headerFiltering/constants.js +0 -30
- package/modern/components/headerFiltering/constants.js +0 -30
- package/node/components/headerFiltering/constants.js +0 -37
package/utils/tree/utils.js
CHANGED
|
@@ -22,11 +22,7 @@ export const getNodePathInTree = ({
|
|
|
22
22
|
path.reverse();
|
|
23
23
|
return path;
|
|
24
24
|
};
|
|
25
|
-
export const
|
|
26
|
-
node,
|
|
27
|
-
isGroupExpandedByDefault,
|
|
28
|
-
defaultGroupingExpansionDepth
|
|
29
|
-
}) => {
|
|
25
|
+
export const updateGroupDefaultExpansion = (node, defaultGroupingExpansionDepth, isGroupExpandedByDefault) => {
|
|
30
26
|
let childrenExpanded;
|
|
31
27
|
if (node.id === GRID_ROOT_GROUP_ID) {
|
|
32
28
|
childrenExpanded = true;
|
|
@@ -35,20 +31,14 @@ export const addGroupDefaultExpansion = ({
|
|
|
35
31
|
} else {
|
|
36
32
|
childrenExpanded = defaultGroupingExpansionDepth === -1 || defaultGroupingExpansionDepth > node.depth;
|
|
37
33
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
});
|
|
34
|
+
node.childrenExpanded = childrenExpanded;
|
|
35
|
+
return node;
|
|
41
36
|
};
|
|
42
37
|
|
|
43
38
|
/**
|
|
44
39
|
* Insert a node in the tree
|
|
45
40
|
*/
|
|
46
|
-
export const insertNodeInTree = ({
|
|
47
|
-
node,
|
|
48
|
-
previousTree,
|
|
49
|
-
tree,
|
|
50
|
-
treeDepths
|
|
51
|
-
}) => {
|
|
41
|
+
export const insertNodeInTree = (node, tree, treeDepths, previousTree) => {
|
|
52
42
|
var _treeDepths$node$dept;
|
|
53
43
|
// 1. Insert node in the tree.
|
|
54
44
|
tree[node.id] = node;
|
|
@@ -58,11 +48,7 @@ export const insertNodeInTree = ({
|
|
|
58
48
|
|
|
59
49
|
// 3. Register the new node in its parent.
|
|
60
50
|
const parentNode = tree[node.parent];
|
|
61
|
-
if (node.type === '
|
|
62
|
-
// For footers,
|
|
63
|
-
// Register the node from its parent `footerId` property.
|
|
64
|
-
parentNode.footerId = node.id;
|
|
65
|
-
} else if (node.type === 'group' || node.type === 'leaf') {
|
|
51
|
+
if (node.type === 'group' || node.type === 'leaf') {
|
|
66
52
|
var _groupingField, _groupingKey, _parentNode$childrenF;
|
|
67
53
|
// For groups and leaves,
|
|
68
54
|
// Register the node from its parents `children` and `childrenFromPath` properties.
|
|
@@ -81,6 +67,10 @@ export const insertNodeInTree = ({
|
|
|
81
67
|
} else {
|
|
82
68
|
groupingField[groupingKeyName.toString()] = node.id;
|
|
83
69
|
}
|
|
70
|
+
} else if (node.type === 'footer') {
|
|
71
|
+
// For footers,
|
|
72
|
+
// Register the node from its parent `footerId` property.
|
|
73
|
+
parentNode.footerId = node.id;
|
|
84
74
|
}
|
|
85
75
|
};
|
|
86
76
|
|
|
@@ -164,12 +154,7 @@ export const updateGroupNodeIdAndAutoGenerated = ({
|
|
|
164
154
|
|
|
165
155
|
// 3. Add the new group in the tree
|
|
166
156
|
const groupNode = _extends({}, node, updatedNode);
|
|
167
|
-
insertNodeInTree(
|
|
168
|
-
previousTree,
|
|
169
|
-
node: groupNode,
|
|
170
|
-
tree,
|
|
171
|
-
treeDepths
|
|
172
|
-
});
|
|
157
|
+
insertNodeInTree(groupNode, tree, treeDepths, previousTree);
|
|
173
158
|
};
|
|
174
159
|
export const createUpdatedGroupsManager = () => ({
|
|
175
160
|
value: {},
|
|
@@ -179,4 +164,36 @@ export const createUpdatedGroupsManager = () => ({
|
|
|
179
164
|
}
|
|
180
165
|
this.value[groupId][action] = true;
|
|
181
166
|
}
|
|
182
|
-
});
|
|
167
|
+
});
|
|
168
|
+
export const getVisibleRowsLookup = ({
|
|
169
|
+
tree,
|
|
170
|
+
filteredRowsLookup
|
|
171
|
+
}) => {
|
|
172
|
+
if (!filteredRowsLookup) {
|
|
173
|
+
return {};
|
|
174
|
+
}
|
|
175
|
+
const visibleRowsLookup = {};
|
|
176
|
+
const handleTreeNode = (node, areAncestorsExpanded) => {
|
|
177
|
+
const isPassingFiltering = filteredRowsLookup[node.id];
|
|
178
|
+
if (node.type === 'group') {
|
|
179
|
+
node.children.forEach(childId => {
|
|
180
|
+
const childNode = tree[childId];
|
|
181
|
+
handleTreeNode(childNode, areAncestorsExpanded && !!node.childrenExpanded);
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
visibleRowsLookup[node.id] = isPassingFiltering && areAncestorsExpanded;
|
|
185
|
+
|
|
186
|
+
// TODO rows v6: Should we keep storing the visibility status of footer independently or rely on the group visibility in the selector ?
|
|
187
|
+
if (node.type === 'group' && node.footerId != null) {
|
|
188
|
+
visibleRowsLookup[node.footerId] = isPassingFiltering && areAncestorsExpanded && !!node.childrenExpanded;
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
const nodes = Object.values(tree);
|
|
192
|
+
for (let i = 0; i < nodes.length; i += 1) {
|
|
193
|
+
const node = nodes[i];
|
|
194
|
+
if (node.depth === 0) {
|
|
195
|
+
handleTreeNode(node, true);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
return visibleRowsLookup;
|
|
199
|
+
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
export const OPERATOR_SYMBOL_MAPPING = {
|
|
2
|
-
contains: '∋',
|
|
3
|
-
equals: '=',
|
|
4
|
-
'=': '=',
|
|
5
|
-
'!=': '≠',
|
|
6
|
-
'>': '>',
|
|
7
|
-
'>=': '≥',
|
|
8
|
-
'<': '<',
|
|
9
|
-
'<=': '≤',
|
|
10
|
-
startsWith: '⊃',
|
|
11
|
-
endsWith: '⊂',
|
|
12
|
-
is: '=',
|
|
13
|
-
not: '≠',
|
|
14
|
-
isNot: '≠',
|
|
15
|
-
isEmpty: '∅',
|
|
16
|
-
isNotEmpty: '∉',
|
|
17
|
-
isIn: '∈',
|
|
18
|
-
isNotIn: '∉',
|
|
19
|
-
isLessThan: '<',
|
|
20
|
-
isLessThanOrEqual: '≤',
|
|
21
|
-
isGreaterThan: '>',
|
|
22
|
-
isGreaterThanOrEqual: '≥',
|
|
23
|
-
isBetween: '∈',
|
|
24
|
-
isNotBetween: '∉',
|
|
25
|
-
isAnyOf: '∈',
|
|
26
|
-
after: '>',
|
|
27
|
-
onOrAfter: '≥',
|
|
28
|
-
before: '<',
|
|
29
|
-
onOrBefore: '≤'
|
|
30
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
export var OPERATOR_SYMBOL_MAPPING = {
|
|
2
|
-
contains: '∋',
|
|
3
|
-
equals: '=',
|
|
4
|
-
'=': '=',
|
|
5
|
-
'!=': '≠',
|
|
6
|
-
'>': '>',
|
|
7
|
-
'>=': '≥',
|
|
8
|
-
'<': '<',
|
|
9
|
-
'<=': '≤',
|
|
10
|
-
startsWith: '⊃',
|
|
11
|
-
endsWith: '⊂',
|
|
12
|
-
is: '=',
|
|
13
|
-
not: '≠',
|
|
14
|
-
isNot: '≠',
|
|
15
|
-
isEmpty: '∅',
|
|
16
|
-
isNotEmpty: '∉',
|
|
17
|
-
isIn: '∈',
|
|
18
|
-
isNotIn: '∉',
|
|
19
|
-
isLessThan: '<',
|
|
20
|
-
isLessThanOrEqual: '≤',
|
|
21
|
-
isGreaterThan: '>',
|
|
22
|
-
isGreaterThanOrEqual: '≥',
|
|
23
|
-
isBetween: '∈',
|
|
24
|
-
isNotBetween: '∉',
|
|
25
|
-
isAnyOf: '∈',
|
|
26
|
-
after: '>',
|
|
27
|
-
onOrAfter: '≥',
|
|
28
|
-
before: '<',
|
|
29
|
-
onOrBefore: '≤'
|
|
30
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
export const OPERATOR_SYMBOL_MAPPING = {
|
|
2
|
-
contains: '∋',
|
|
3
|
-
equals: '=',
|
|
4
|
-
'=': '=',
|
|
5
|
-
'!=': '≠',
|
|
6
|
-
'>': '>',
|
|
7
|
-
'>=': '≥',
|
|
8
|
-
'<': '<',
|
|
9
|
-
'<=': '≤',
|
|
10
|
-
startsWith: '⊃',
|
|
11
|
-
endsWith: '⊂',
|
|
12
|
-
is: '=',
|
|
13
|
-
not: '≠',
|
|
14
|
-
isNot: '≠',
|
|
15
|
-
isEmpty: '∅',
|
|
16
|
-
isNotEmpty: '∉',
|
|
17
|
-
isIn: '∈',
|
|
18
|
-
isNotIn: '∉',
|
|
19
|
-
isLessThan: '<',
|
|
20
|
-
isLessThanOrEqual: '≤',
|
|
21
|
-
isGreaterThan: '>',
|
|
22
|
-
isGreaterThanOrEqual: '≥',
|
|
23
|
-
isBetween: '∈',
|
|
24
|
-
isNotBetween: '∉',
|
|
25
|
-
isAnyOf: '∈',
|
|
26
|
-
after: '>',
|
|
27
|
-
onOrAfter: '≥',
|
|
28
|
-
before: '<',
|
|
29
|
-
onOrBefore: '≤'
|
|
30
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.OPERATOR_SYMBOL_MAPPING = void 0;
|
|
7
|
-
const OPERATOR_SYMBOL_MAPPING = {
|
|
8
|
-
contains: '∋',
|
|
9
|
-
equals: '=',
|
|
10
|
-
'=': '=',
|
|
11
|
-
'!=': '≠',
|
|
12
|
-
'>': '>',
|
|
13
|
-
'>=': '≥',
|
|
14
|
-
'<': '<',
|
|
15
|
-
'<=': '≤',
|
|
16
|
-
startsWith: '⊃',
|
|
17
|
-
endsWith: '⊂',
|
|
18
|
-
is: '=',
|
|
19
|
-
not: '≠',
|
|
20
|
-
isNot: '≠',
|
|
21
|
-
isEmpty: '∅',
|
|
22
|
-
isNotEmpty: '∉',
|
|
23
|
-
isIn: '∈',
|
|
24
|
-
isNotIn: '∉',
|
|
25
|
-
isLessThan: '<',
|
|
26
|
-
isLessThanOrEqual: '≤',
|
|
27
|
-
isGreaterThan: '>',
|
|
28
|
-
isGreaterThanOrEqual: '≥',
|
|
29
|
-
isBetween: '∈',
|
|
30
|
-
isNotBetween: '∉',
|
|
31
|
-
isAnyOf: '∈',
|
|
32
|
-
after: '>',
|
|
33
|
-
onOrAfter: '≥',
|
|
34
|
-
before: '<',
|
|
35
|
-
onOrBefore: '≤'
|
|
36
|
-
};
|
|
37
|
-
exports.OPERATOR_SYMBOL_MAPPING = OPERATOR_SYMBOL_MAPPING;
|