@mui/x-data-grid-pro 6.10.0 → 6.10.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 +72 -3
- package/components/GridTreeDataGroupingCell.js +1 -1
- package/components/headerFiltering/GridHeaderFilterCell.js +1 -1
- package/hooks/features/detailPanel/useGridDetailPanel.js +2 -2
- package/hooks/features/rowPinning/useGridRowPinning.js +2 -2
- package/hooks/features/rowPinning/useGridRowPinningPreProcessors.js +2 -2
- package/index.js +1 -1
- package/legacy/components/GridTreeDataGroupingCell.js +1 -1
- package/legacy/components/headerFiltering/GridHeaderFilterCell.js +1 -1
- package/legacy/hooks/features/detailPanel/useGridDetailPanel.js +2 -2
- package/legacy/hooks/features/rowPinning/useGridRowPinning.js +2 -2
- package/legacy/hooks/features/rowPinning/useGridRowPinningPreProcessors.js +2 -2
- package/legacy/index.js +1 -1
- package/legacy/utils/domUtils.js +7 -1
- package/legacy/utils/releaseInfo.js +1 -1
- package/legacy/utils/tree/insertDataRowInTree.js +2 -2
- package/legacy/utils/tree/utils.js +12 -22
- package/modern/index.js +1 -1
- package/modern/utils/domUtils.js +7 -1
- package/modern/utils/releaseInfo.js +1 -1
- package/modern/utils/tree/utils.js +2 -11
- package/node/index.js +1 -1
- package/node/utils/domUtils.js +7 -1
- package/node/utils/releaseInfo.js +1 -1
- package/node/utils/tree/utils.js +2 -11
- package/package.json +4 -4
- package/utils/domUtils.d.ts +2 -2
- package/utils/domUtils.js +8 -1
- package/utils/releaseInfo.js +1 -1
- package/utils/tree/insertDataRowInTree.js +2 -2
- package/utils/tree/utils.js +3 -12
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,75 @@
|
|
|
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
|
+
## 6.10.1
|
|
7
|
+
|
|
8
|
+
_Jul 20, 2023_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 11 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🎁 Fix CSV export for values containing double quotes
|
|
13
|
+
- 🚀 Improve tree data performance
|
|
14
|
+
- 🐞 Bugfixes
|
|
15
|
+
- 📚 Documentation improvements
|
|
16
|
+
|
|
17
|
+
### Data Grid
|
|
18
|
+
|
|
19
|
+
#### `@mui/x-data-grid@v6.10.1`
|
|
20
|
+
|
|
21
|
+
- [DataGrid] Filtering performance: compile filter applier with `eval` (#9635) @romgrk
|
|
22
|
+
- [DataGrid] Fix CSV export for values containing double quotes (#9667) @cherniavskii
|
|
23
|
+
- [DataGrid] Fix column type change not working correctly (#9594) @cherniavskii
|
|
24
|
+
- [DataGrid] Fix quick filter `undefined` row error (#9708) @romgrk
|
|
25
|
+
- [DataGrid] Prevent `viewportOuterSize.height` going negative (#9664) @gitstart
|
|
26
|
+
- [DataGrid] Update focused cell on page change via keyboard (#9203) @m4theushw
|
|
27
|
+
- [DataGrid] Wait for remote stylesheets to load before print (#9665) @cherniavskii
|
|
28
|
+
|
|
29
|
+
#### `@mui/x-data-grid-pro@v6.10.1` [](https://mui.com/r/x-pro-svg-link)
|
|
30
|
+
|
|
31
|
+
Same changes as in `@mui/x-data-grid@v6.10.1`, plus:
|
|
32
|
+
|
|
33
|
+
- [DataGridPro] Improve tree data performance (#9682) @cherniavskii
|
|
34
|
+
- [DataGridPro] Prevent affecting cells from child DataGrid when resizing a column (#9670) @m4theushw
|
|
35
|
+
|
|
36
|
+
#### `@mui/x-data-grid-premium@v6.10.1` [](https://mui.com/r/x-premium-svg-link)
|
|
37
|
+
|
|
38
|
+
Same changes as in `@mui/x-data-grid-pro@v6.10.1`.
|
|
39
|
+
|
|
40
|
+
### Date Pickers
|
|
41
|
+
|
|
42
|
+
#### `@mui/x-date-pickers@v6.10.1`
|
|
43
|
+
|
|
44
|
+
- [fields] Fix `format` and `value` update order (#9715) @LukasTy
|
|
45
|
+
- [pickers] Remove `require` usage in comment (#9675) @LukasTy
|
|
46
|
+
|
|
47
|
+
#### `@mui/x-date-pickers-pro@v6.10.1` [](https://mui.com/r/x-pro-svg-link)
|
|
48
|
+
|
|
49
|
+
Same changes as in `@mui/x-date-pickers@v6.10.1`.
|
|
50
|
+
|
|
51
|
+
### Charts / `@mui/x-charts@v6.0.0-alpha.4`
|
|
52
|
+
|
|
53
|
+
- [charts] Fix blinking in responsive charts and extremums computation for line charts (#9734) @alexfauquette
|
|
54
|
+
- [charts] Use ESM with imports (#9645) @alexfauquette
|
|
55
|
+
|
|
56
|
+
### Docs
|
|
57
|
+
|
|
58
|
+
- [docs] Add additional note for license key installation on Next.js (#9575) @joserodolfofreitas
|
|
59
|
+
- [docs] Add paragraph about managing focus of custom edit components (#9658) @m4theushw
|
|
60
|
+
- [docs] Add unsorted icon slot to the custom sort icons demo (#9169) @d4rekanguok
|
|
61
|
+
- [docs] Disable ad for onboarding pages (#9700) @oliviertassinari
|
|
62
|
+
- [docs] Disabling ads without toolbar has no effect @oliviertassinari
|
|
63
|
+
- [docs] Fix Date Pickers usage to Title Case (#9680) @richbustos
|
|
64
|
+
- [docs] Fix sorting in `CustomSortIcons` demo (#9656) @MBilalShafi
|
|
65
|
+
- [docs] Improve the UI for pickers introduction (#9644) @alexfauquette
|
|
66
|
+
- [docs] Improve the demo design @oliviertassinari
|
|
67
|
+
- [docs] Localization progress, polish (#9672) @oliviertassinari
|
|
68
|
+
- [docs] Normalize the WIP items (#9671) @oliviertassinari
|
|
69
|
+
|
|
70
|
+
### Core
|
|
71
|
+
|
|
72
|
+
- [core] Add `validate` command (#9714) @romgrk
|
|
73
|
+
- [CHANGELOG] Update generator to new format @oliviertassinari
|
|
74
|
+
|
|
6
75
|
## 6.10.0
|
|
7
76
|
|
|
8
77
|
_Jul 13, 2023_
|
|
@@ -26,11 +95,11 @@ We'd like to offer a big thanks to the 10 contributors who made this release pos
|
|
|
26
95
|
- [DataGrid] Make `rowExpansionChange` event public (#9611) @MBilalShafi
|
|
27
96
|
- [l10n] Improve Polish (pl-PL) locale (#9625) @ch1llysense
|
|
28
97
|
|
|
29
|
-
#### `@mui/x-data-grid-pro@6.10.0`
|
|
98
|
+
#### `@mui/x-data-grid-pro@6.10.0` [](https://mui.com/r/x-pro-svg-link)
|
|
30
99
|
|
|
31
100
|
Same changes as in `@mui/x-data-grid@6.10.0`.
|
|
32
101
|
|
|
33
|
-
#### `@mui/x-data-grid-premium@6.10.0`
|
|
102
|
+
#### `@mui/x-data-grid-premium@6.10.0` [](https://mui.com/r/x-premium-svg-link)
|
|
34
103
|
|
|
35
104
|
Same changes as in `@mui/x-data-grid-pro@6.10.0`.
|
|
36
105
|
|
|
@@ -41,7 +110,7 @@ Same changes as in `@mui/x-data-grid-pro@6.10.0`.
|
|
|
41
110
|
- [pickers] Fix date calendar issues (#9652) @LukasTy
|
|
42
111
|
- [l10n] Improve Norwegian (nb-NO) locale (#9608) @JosteinBrevik
|
|
43
112
|
|
|
44
|
-
#### `@mui/x-date-pickers-pro@6.10.0`
|
|
113
|
+
#### `@mui/x-date-pickers-pro@6.10.0` [](https://mui.com/r/x-pro-svg-link)
|
|
45
114
|
|
|
46
115
|
Same changes as in `@mui/x-date-pickers@6.10.0`.
|
|
47
116
|
|
|
@@ -55,7 +55,7 @@ function GridTreeDataGroupingCell(props) {
|
|
|
55
55
|
onClick: handleClick,
|
|
56
56
|
tabIndex: -1,
|
|
57
57
|
"aria-label": rowNode.childrenExpanded ? apiRef.current.getLocaleText('treeDataCollapse') : apiRef.current.getLocaleText('treeDataExpand')
|
|
58
|
-
}, rootProps == null
|
|
58
|
+
}, rootProps == null || (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseIconButton, {
|
|
59
59
|
children: /*#__PURE__*/_jsx(Icon, {
|
|
60
60
|
fontSize: "inherit"
|
|
61
61
|
})
|
|
@@ -146,7 +146,7 @@ const GridHeaderFilterCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
146
146
|
colDef
|
|
147
147
|
});
|
|
148
148
|
const classes = useUtilityClasses(ownerState);
|
|
149
|
-
const isNoInputOperator = (filterOperators == null
|
|
149
|
+
const isNoInputOperator = (filterOperators == null || (_filterOperators$find = filterOperators.find(({
|
|
150
150
|
value
|
|
151
151
|
}) => item.operator === value)) == null ? void 0 : _filterOperators$find.requiresFilterValue) === false;
|
|
152
152
|
const isApplied = Boolean(item == null ? void 0 : item.value) || isNoInputOperator;
|
|
@@ -5,11 +5,11 @@ import { useGridRegisterPipeProcessor } from '@mui/x-data-grid/internals';
|
|
|
5
5
|
import { GRID_DETAIL_PANEL_TOGGLE_FIELD } from './gridDetailPanelToggleColDef';
|
|
6
6
|
import { gridDetailPanelExpandedRowIdsSelector, gridDetailPanelExpandedRowsContentCacheSelector, gridDetailPanelExpandedRowsHeightCacheSelector, gridDetailPanelRawHeightCacheSelector } from './gridDetailPanelSelector';
|
|
7
7
|
export const detailPanelStateInitializer = (state, props) => {
|
|
8
|
-
var _ref, _props$detailPanelExp, _props$initialState
|
|
8
|
+
var _ref, _props$detailPanelExp, _props$initialState;
|
|
9
9
|
return _extends({}, state, {
|
|
10
10
|
detailPanel: {
|
|
11
11
|
heightCache: {},
|
|
12
|
-
expandedRowIds: (_ref = (_props$detailPanelExp = props.detailPanelExpandedRowIds) != null ? _props$detailPanelExp : (_props$initialState = props.initialState) == null
|
|
12
|
+
expandedRowIds: (_ref = (_props$detailPanelExp = props.detailPanelExpandedRowIds) != null ? _props$detailPanelExp : (_props$initialState = props.initialState) == null || (_props$initialState = _props$initialState.detailPanel) == null ? void 0 : _props$initialState.expandedRowIds) != null ? _ref : []
|
|
13
13
|
}
|
|
14
14
|
});
|
|
15
15
|
};
|
|
@@ -9,12 +9,12 @@ function createPinnedRowsInternalCache(pinnedRows, getRowId) {
|
|
|
9
9
|
bottomIds: [],
|
|
10
10
|
idLookup: {}
|
|
11
11
|
};
|
|
12
|
-
pinnedRows == null
|
|
12
|
+
pinnedRows == null || (_pinnedRows$top = pinnedRows.top) == null ? void 0 : _pinnedRows$top.forEach(rowModel => {
|
|
13
13
|
const id = getRowIdFromRowModel(rowModel, getRowId);
|
|
14
14
|
cache.topIds.push(id);
|
|
15
15
|
cache.idLookup[id] = rowModel;
|
|
16
16
|
});
|
|
17
|
-
pinnedRows == null
|
|
17
|
+
pinnedRows == null || (_pinnedRows$bottom = pinnedRows.bottom) == null ? void 0 : _pinnedRows$bottom.forEach(rowModel => {
|
|
18
18
|
const id = getRowIdFromRowModel(rowModel, getRowId);
|
|
19
19
|
cache.bottomIds.push(id);
|
|
20
20
|
cache.idLookup[id] = rowModel;
|
|
@@ -11,7 +11,7 @@ export function addPinnedRow({
|
|
|
11
11
|
apiRef,
|
|
12
12
|
isAutoGenerated
|
|
13
13
|
}) {
|
|
14
|
-
var _groupingParams$addit, _groupingParams$addit2
|
|
14
|
+
var _groupingParams$addit, _groupingParams$addit2;
|
|
15
15
|
const dataRowIdToModelLookup = _extends({}, groupingParams.dataRowIdToModelLookup);
|
|
16
16
|
const dataRowIdToIdLookup = _extends({}, groupingParams.dataRowIdToIdLookup);
|
|
17
17
|
const tree = _extends({}, groupingParams.tree);
|
|
@@ -40,7 +40,7 @@ export function addPinnedRow({
|
|
|
40
40
|
id: rowId,
|
|
41
41
|
model: rowModel
|
|
42
42
|
};
|
|
43
|
-
if ((_groupingParams$addit2 = groupingParams.additionalRowGroups) != null && (_groupingParams$
|
|
43
|
+
if ((_groupingParams$addit2 = groupingParams.additionalRowGroups) != null && (_groupingParams$addit2 = _groupingParams$addit2.pinnedRows) != null && (_groupingParams$addit2 = _groupingParams$addit2[position]) != null && _groupingParams$addit2.includes(newPinnedRow)) {
|
|
44
44
|
return _extends({}, groupingParams, {
|
|
45
45
|
dataRowIdToModelLookup,
|
|
46
46
|
dataRowIdToIdLookup,
|
package/index.js
CHANGED
|
@@ -52,7 +52,7 @@ function GridTreeDataGroupingCell(props) {
|
|
|
52
52
|
onClick: handleClick,
|
|
53
53
|
tabIndex: -1,
|
|
54
54
|
"aria-label": rowNode.childrenExpanded ? apiRef.current.getLocaleText('treeDataCollapse') : apiRef.current.getLocaleText('treeDataExpand')
|
|
55
|
-
}, rootProps == null
|
|
55
|
+
}, rootProps == null || (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseIconButton, {
|
|
56
56
|
children: /*#__PURE__*/_jsx(Icon, {
|
|
57
57
|
fontSize: "inherit"
|
|
58
58
|
})
|
|
@@ -146,7 +146,7 @@ var GridHeaderFilterCell = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
146
146
|
colDef: colDef
|
|
147
147
|
});
|
|
148
148
|
var classes = useUtilityClasses(ownerState);
|
|
149
|
-
var isNoInputOperator = (filterOperators == null
|
|
149
|
+
var isNoInputOperator = (filterOperators == null || (_filterOperators$find = filterOperators.find(function (_ref) {
|
|
150
150
|
var value = _ref.value;
|
|
151
151
|
return item.operator === value;
|
|
152
152
|
})) == null ? void 0 : _filterOperators$find.requiresFilterValue) === false;
|
|
@@ -7,11 +7,11 @@ import { useGridRegisterPipeProcessor } from '@mui/x-data-grid/internals';
|
|
|
7
7
|
import { GRID_DETAIL_PANEL_TOGGLE_FIELD } from './gridDetailPanelToggleColDef';
|
|
8
8
|
import { gridDetailPanelExpandedRowIdsSelector, gridDetailPanelExpandedRowsContentCacheSelector, gridDetailPanelExpandedRowsHeightCacheSelector, gridDetailPanelRawHeightCacheSelector } from './gridDetailPanelSelector';
|
|
9
9
|
export var detailPanelStateInitializer = function detailPanelStateInitializer(state, props) {
|
|
10
|
-
var _ref, _props$detailPanelExp, _props$initialState
|
|
10
|
+
var _ref, _props$detailPanelExp, _props$initialState;
|
|
11
11
|
return _extends({}, state, {
|
|
12
12
|
detailPanel: {
|
|
13
13
|
heightCache: {},
|
|
14
|
-
expandedRowIds: (_ref = (_props$detailPanelExp = props.detailPanelExpandedRowIds) != null ? _props$detailPanelExp : (_props$initialState = props.initialState) == null
|
|
14
|
+
expandedRowIds: (_ref = (_props$detailPanelExp = props.detailPanelExpandedRowIds) != null ? _props$detailPanelExp : (_props$initialState = props.initialState) == null || (_props$initialState = _props$initialState.detailPanel) == null ? void 0 : _props$initialState.expandedRowIds) != null ? _ref : []
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
17
|
};
|
|
@@ -9,12 +9,12 @@ function createPinnedRowsInternalCache(pinnedRows, getRowId) {
|
|
|
9
9
|
bottomIds: [],
|
|
10
10
|
idLookup: {}
|
|
11
11
|
};
|
|
12
|
-
pinnedRows == null
|
|
12
|
+
pinnedRows == null || (_pinnedRows$top = pinnedRows.top) == null ? void 0 : _pinnedRows$top.forEach(function (rowModel) {
|
|
13
13
|
var id = getRowIdFromRowModel(rowModel, getRowId);
|
|
14
14
|
cache.topIds.push(id);
|
|
15
15
|
cache.idLookup[id] = rowModel;
|
|
16
16
|
});
|
|
17
|
-
pinnedRows == null
|
|
17
|
+
pinnedRows == null || (_pinnedRows$bottom = pinnedRows.bottom) == null ? void 0 : _pinnedRows$bottom.forEach(function (rowModel) {
|
|
18
18
|
var id = getRowIdFromRowModel(rowModel, getRowId);
|
|
19
19
|
cache.bottomIds.push(id);
|
|
20
20
|
cache.idLookup[id] = rowModel;
|
|
@@ -6,7 +6,7 @@ import { useGridRegisterPipeProcessor } from '@mui/x-data-grid/internals';
|
|
|
6
6
|
import { GRID_ROOT_GROUP_ID } from '@mui/x-data-grid';
|
|
7
7
|
import { insertNodeInTree } from '../../../utils/tree/utils';
|
|
8
8
|
export function addPinnedRow(_ref) {
|
|
9
|
-
var _groupingParams$addit, _groupingParams$addit2
|
|
9
|
+
var _groupingParams$addit, _groupingParams$addit2;
|
|
10
10
|
var groupingParams = _ref.groupingParams,
|
|
11
11
|
rowModel = _ref.rowModel,
|
|
12
12
|
rowId = _ref.rowId,
|
|
@@ -41,7 +41,7 @@ export function addPinnedRow(_ref) {
|
|
|
41
41
|
id: rowId,
|
|
42
42
|
model: rowModel
|
|
43
43
|
};
|
|
44
|
-
if ((_groupingParams$addit2 = groupingParams.additionalRowGroups) != null && (_groupingParams$
|
|
44
|
+
if ((_groupingParams$addit2 = groupingParams.additionalRowGroups) != null && (_groupingParams$addit2 = _groupingParams$addit2.pinnedRows) != null && (_groupingParams$addit2 = _groupingParams$addit2[position]) != null && _groupingParams$addit2.includes(newPinnedRow)) {
|
|
45
45
|
return _extends({}, groupingParams, {
|
|
46
46
|
dataRowIdToModelLookup: dataRowIdToModelLookup,
|
|
47
47
|
dataRowIdToIdLookup: dataRowIdToIdLookup,
|
package/legacy/index.js
CHANGED
package/legacy/utils/domUtils.js
CHANGED
|
@@ -11,6 +11,7 @@ export function findGroupHeaderElementsFromField(elem, field) {
|
|
|
11
11
|
return Array.from((_elem$querySelectorAl = elem.querySelectorAll("[data-fields*=\"|-".concat(field, "-|\"]"))) != null ? _elem$querySelectorAl : []);
|
|
12
12
|
}
|
|
13
13
|
export function findGridCellElementsFromCol(col, api) {
|
|
14
|
+
var _api$virtualScrollerR;
|
|
14
15
|
var root = findParentElementFromClassName(col, gridClasses.root);
|
|
15
16
|
if (!root) {
|
|
16
17
|
throw new Error('MUI: The root element is not found.');
|
|
@@ -21,7 +22,12 @@ export function findGridCellElementsFromCol(col, api) {
|
|
|
21
22
|
}
|
|
22
23
|
var colIndex = Number(ariaColIndex) - 1;
|
|
23
24
|
var cells = [];
|
|
24
|
-
var
|
|
25
|
+
var virtualScrollerContent = (_api$virtualScrollerR = api.virtualScrollerRef) == null || (_api$virtualScrollerR = _api$virtualScrollerR.current) == null ? void 0 : _api$virtualScrollerR.firstElementChild;
|
|
26
|
+
if (!virtualScrollerContent) {
|
|
27
|
+
return [];
|
|
28
|
+
}
|
|
29
|
+
var renderedRowElements = virtualScrollerContent.querySelectorAll(":scope > div > .".concat(gridClasses.row) // Use > to ignore rows from detail panels
|
|
30
|
+
);
|
|
25
31
|
renderedRowElements.forEach(function (rowElement) {
|
|
26
32
|
var rowId = rowElement.getAttribute('data-id');
|
|
27
33
|
if (!rowId) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export var getReleaseInfo = function getReleaseInfo() {
|
|
3
|
-
var releaseInfo = "
|
|
3
|
+
var releaseInfo = "MTY4OTgyMjAwMDAwMA==";
|
|
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
|
|
@@ -18,13 +18,13 @@ export var insertDataRowInTree = function insertDataRowInTree(_ref) {
|
|
|
18
18
|
defaultGroupingExpansionDepth = _ref.defaultGroupingExpansionDepth;
|
|
19
19
|
var parentNodeId = GRID_ROOT_GROUP_ID;
|
|
20
20
|
for (var depth = 0; depth < path.length; depth += 1) {
|
|
21
|
-
var _childrenFromPath
|
|
21
|
+
var _childrenFromPath;
|
|
22
22
|
var _path$depth = path[depth],
|
|
23
23
|
key = _path$depth.key,
|
|
24
24
|
field = _path$depth.field;
|
|
25
25
|
var fieldWithDefaultValue = field != null ? field : '__no_field__';
|
|
26
26
|
var keyWithDefaultValue = key != null ? key : '__no_key__';
|
|
27
|
-
var existingNodeIdWithPartialPath = (_childrenFromPath = tree[parentNodeId].childrenFromPath) == null
|
|
27
|
+
var existingNodeIdWithPartialPath = (_childrenFromPath = tree[parentNodeId].childrenFromPath) == null || (_childrenFromPath = _childrenFromPath[fieldWithDefaultValue]) == null ? void 0 : _childrenFromPath[keyWithDefaultValue.toString()];
|
|
28
28
|
|
|
29
29
|
// When we reach the last step of the path,
|
|
30
30
|
// We need to create a node for the row passed to `insertNodeInTree`
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
|
-
import _toPropertyKey from "@babel/runtime/helpers/esm/toPropertyKey";
|
|
3
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
2
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
5
3
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
@@ -106,24 +104,16 @@ export var removeNodeFromTree = function removeNodeFromTree(_ref2) {
|
|
|
106
104
|
// For groups and leaves,
|
|
107
105
|
// Unregister the node from its parents `children` and `childrenFromPath` properties.
|
|
108
106
|
else {
|
|
109
|
-
var _groupingField2, _groupingKey2
|
|
107
|
+
var _groupingField2, _groupingKey2;
|
|
110
108
|
var groupingField = (_groupingField2 = node.groupingField) != null ? _groupingField2 : '__no_field__';
|
|
111
109
|
var groupingKey = (_groupingKey2 = node.groupingKey) != null ? _groupingKey2 : '__no_key__';
|
|
112
|
-
var _ref3 = (_parentNode$childrenF3 = (_parentNode$childrenF4 = parentNode.childrenFromPath) == null ? void 0 : _parentNode$childrenF4[groupingField]) != null ? _parentNode$childrenF3 : {},
|
|
113
|
-
_groupingKey$toString = groupingKey.toString(),
|
|
114
|
-
childrenToRemove = _ref3[_groupingKey$toString],
|
|
115
|
-
newChildrenFromPathWithField = _objectWithoutProperties(_ref3, [_groupingKey$toString].map(_toPropertyKey));
|
|
116
110
|
|
|
117
111
|
// TODO rows v6: Can we avoid this linear complexity ?
|
|
118
112
|
var children = parentNode.children.filter(function (childId) {
|
|
119
113
|
return childId !== node.id;
|
|
120
114
|
});
|
|
121
|
-
var childrenFromPath =
|
|
122
|
-
|
|
123
|
-
delete childrenFromPath[groupingField];
|
|
124
|
-
} else {
|
|
125
|
-
childrenFromPath[groupingField] = newChildrenFromPathWithField;
|
|
126
|
-
}
|
|
115
|
+
var childrenFromPath = parentNode.childrenFromPath;
|
|
116
|
+
delete childrenFromPath[groupingField][groupingKey.toString()];
|
|
127
117
|
tree[parentNode.id] = _extends({}, parentNode, {
|
|
128
118
|
children: children,
|
|
129
119
|
childrenFromPath: childrenFromPath
|
|
@@ -134,12 +124,12 @@ export var removeNodeFromTree = function removeNodeFromTree(_ref2) {
|
|
|
134
124
|
/**
|
|
135
125
|
* Updates the `id` and `isAutoGenerated` properties of a group node.
|
|
136
126
|
*/
|
|
137
|
-
export var updateGroupNodeIdAndAutoGenerated = function updateGroupNodeIdAndAutoGenerated(
|
|
138
|
-
var node =
|
|
139
|
-
updatedNode =
|
|
140
|
-
previousTree =
|
|
141
|
-
tree =
|
|
142
|
-
treeDepths =
|
|
127
|
+
export var updateGroupNodeIdAndAutoGenerated = function updateGroupNodeIdAndAutoGenerated(_ref3) {
|
|
128
|
+
var node = _ref3.node,
|
|
129
|
+
updatedNode = _ref3.updatedNode,
|
|
130
|
+
previousTree = _ref3.previousTree,
|
|
131
|
+
tree = _ref3.tree,
|
|
132
|
+
treeDepths = _ref3.treeDepths;
|
|
143
133
|
// 1. Set the new parent for all children from the old group
|
|
144
134
|
node.children.forEach(function (childId) {
|
|
145
135
|
tree[childId] = _extends({}, tree[childId], {
|
|
@@ -169,9 +159,9 @@ export var createUpdatedGroupsManager = function createUpdatedGroupsManager() {
|
|
|
169
159
|
}
|
|
170
160
|
};
|
|
171
161
|
};
|
|
172
|
-
export var getVisibleRowsLookup = function getVisibleRowsLookup(
|
|
173
|
-
var tree =
|
|
174
|
-
filteredRowsLookup =
|
|
162
|
+
export var getVisibleRowsLookup = function getVisibleRowsLookup(_ref4) {
|
|
163
|
+
var tree = _ref4.tree,
|
|
164
|
+
filteredRowsLookup = _ref4.filteredRowsLookup;
|
|
175
165
|
if (!filteredRowsLookup) {
|
|
176
166
|
return {};
|
|
177
167
|
}
|
package/modern/index.js
CHANGED
package/modern/utils/domUtils.js
CHANGED
|
@@ -20,7 +20,13 @@ export function findGridCellElementsFromCol(col, api) {
|
|
|
20
20
|
}
|
|
21
21
|
const colIndex = Number(ariaColIndex) - 1;
|
|
22
22
|
const cells = [];
|
|
23
|
-
const
|
|
23
|
+
const virtualScrollerContent = api.virtualScrollerRef?.current?.firstElementChild;
|
|
24
|
+
if (!virtualScrollerContent) {
|
|
25
|
+
return [];
|
|
26
|
+
}
|
|
27
|
+
const renderedRowElements = virtualScrollerContent.querySelectorAll(`:scope > div > .${gridClasses.row}` // Use > to ignore rows from detail panels
|
|
28
|
+
);
|
|
29
|
+
|
|
24
30
|
renderedRowElements.forEach(rowElement => {
|
|
25
31
|
const rowId = rowElement.getAttribute('data-id');
|
|
26
32
|
if (!rowId) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "
|
|
3
|
+
const releaseInfo = "MTY4OTgyMjAwMDAwMA==";
|
|
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,5 +1,3 @@
|
|
|
1
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
|
-
import _toPropertyKey from "@babel/runtime/helpers/esm/toPropertyKey";
|
|
3
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
2
|
import { GRID_ROOT_GROUP_ID } from '@mui/x-data-grid';
|
|
5
3
|
export const getGroupRowIdFromPath = path => {
|
|
@@ -106,18 +104,11 @@ export const removeNodeFromTree = ({
|
|
|
106
104
|
else {
|
|
107
105
|
const groupingField = node.groupingField ?? '__no_field__';
|
|
108
106
|
const groupingKey = node.groupingKey ?? '__no_key__';
|
|
109
|
-
const _ref = parentNode.childrenFromPath?.[groupingField] ?? {},
|
|
110
|
-
_groupingKey$toString = groupingKey.toString(),
|
|
111
|
-
newChildrenFromPathWithField = _objectWithoutPropertiesLoose(_ref, [_groupingKey$toString].map(_toPropertyKey));
|
|
112
107
|
|
|
113
108
|
// TODO rows v6: Can we avoid this linear complexity ?
|
|
114
109
|
const children = parentNode.children.filter(childId => childId !== node.id);
|
|
115
|
-
const childrenFromPath =
|
|
116
|
-
|
|
117
|
-
delete childrenFromPath[groupingField];
|
|
118
|
-
} else {
|
|
119
|
-
childrenFromPath[groupingField] = newChildrenFromPathWithField;
|
|
120
|
-
}
|
|
110
|
+
const childrenFromPath = parentNode.childrenFromPath;
|
|
111
|
+
delete childrenFromPath[groupingField][groupingKey.toString()];
|
|
121
112
|
tree[parentNode.id] = _extends({}, parentNode, {
|
|
122
113
|
children,
|
|
123
114
|
childrenFromPath
|
package/node/index.js
CHANGED
package/node/utils/domUtils.js
CHANGED
|
@@ -29,7 +29,13 @@ function findGridCellElementsFromCol(col, api) {
|
|
|
29
29
|
}
|
|
30
30
|
const colIndex = Number(ariaColIndex) - 1;
|
|
31
31
|
const cells = [];
|
|
32
|
-
const
|
|
32
|
+
const virtualScrollerContent = api.virtualScrollerRef?.current?.firstElementChild;
|
|
33
|
+
if (!virtualScrollerContent) {
|
|
34
|
+
return [];
|
|
35
|
+
}
|
|
36
|
+
const renderedRowElements = virtualScrollerContent.querySelectorAll(`:scope > div > .${_xDataGrid.gridClasses.row}` // Use > to ignore rows from detail panels
|
|
37
|
+
);
|
|
38
|
+
|
|
33
39
|
renderedRowElements.forEach(rowElement => {
|
|
34
40
|
const rowId = rowElement.getAttribute('data-id');
|
|
35
41
|
if (!rowId) {
|
|
@@ -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 = "MTY4OTgyMjAwMDAwMA==";
|
|
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
|
package/node/utils/tree/utils.js
CHANGED
|
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.updateGroupNodeIdAndAutoGenerated = exports.updateGroupDefaultExpansion = exports.removeNodeFromTree = exports.insertNodeInTree = exports.getVisibleRowsLookup = exports.getNodePathInTree = exports.getGroupRowIdFromPath = exports.createUpdatedGroupsManager = void 0;
|
|
8
|
-
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
9
|
-
var _toPropertyKey2 = _interopRequireDefault(require("@babel/runtime/helpers/toPropertyKey"));
|
|
10
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
9
|
var _xDataGrid = require("@mui/x-data-grid");
|
|
12
10
|
const getGroupRowIdFromPath = path => {
|
|
@@ -117,18 +115,11 @@ const removeNodeFromTree = ({
|
|
|
117
115
|
else {
|
|
118
116
|
const groupingField = node.groupingField ?? '__no_field__';
|
|
119
117
|
const groupingKey = node.groupingKey ?? '__no_key__';
|
|
120
|
-
const _ref = parentNode.childrenFromPath?.[groupingField] ?? {},
|
|
121
|
-
_groupingKey$toString = groupingKey.toString(),
|
|
122
|
-
newChildrenFromPathWithField = (0, _objectWithoutPropertiesLoose2.default)(_ref, [_groupingKey$toString].map(_toPropertyKey2.default));
|
|
123
118
|
|
|
124
119
|
// TODO rows v6: Can we avoid this linear complexity ?
|
|
125
120
|
const children = parentNode.children.filter(childId => childId !== node.id);
|
|
126
|
-
const childrenFromPath =
|
|
127
|
-
|
|
128
|
-
delete childrenFromPath[groupingField];
|
|
129
|
-
} else {
|
|
130
|
-
childrenFromPath[groupingField] = newChildrenFromPathWithField;
|
|
131
|
-
}
|
|
121
|
+
const childrenFromPath = parentNode.childrenFromPath;
|
|
122
|
+
delete childrenFromPath[groupingField][groupingKey.toString()];
|
|
132
123
|
tree[parentNode.id] = (0, _extends2.default)({}, parentNode, {
|
|
133
124
|
children,
|
|
134
125
|
childrenFromPath
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-data-grid-pro",
|
|
3
|
-
"version": "6.10.
|
|
3
|
+
"version": "6.10.1",
|
|
4
4
|
"description": "The Pro plan edition of the data grid component (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./node/index.js",
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
"directory": "packages/grid/x-data-grid-pro"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@babel/runtime": "^7.22.
|
|
35
|
-
"@mui/utils": "^5.13.
|
|
36
|
-
"@mui/x-data-grid": "6.10.
|
|
34
|
+
"@babel/runtime": "^7.22.6",
|
|
35
|
+
"@mui/utils": "^5.13.7",
|
|
36
|
+
"@mui/x-data-grid": "6.10.1",
|
|
37
37
|
"@mui/x-license-pro": "6.10.0",
|
|
38
38
|
"@types/format-util": "^1.0.2",
|
|
39
39
|
"clsx": "^1.2.1",
|
package/utils/domUtils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GridPrivateApiPro } from '../models/gridApiPro';
|
|
2
2
|
export declare function getFieldFromHeaderElem(colCellEl: Element): string;
|
|
3
3
|
export declare function findHeaderElementFromField(elem: Element, field: string): Element | null;
|
|
4
4
|
export declare function findGroupHeaderElementsFromField(elem: Element, field: string): Element[];
|
|
5
|
-
export declare function findGridCellElementsFromCol(col: HTMLElement, api:
|
|
5
|
+
export declare function findGridCellElementsFromCol(col: HTMLElement, api: GridPrivateApiPro): Element[];
|
package/utils/domUtils.js
CHANGED
|
@@ -11,6 +11,7 @@ export function findGroupHeaderElementsFromField(elem, field) {
|
|
|
11
11
|
return Array.from((_elem$querySelectorAl = elem.querySelectorAll(`[data-fields*="|-${field}-|"]`)) != null ? _elem$querySelectorAl : []);
|
|
12
12
|
}
|
|
13
13
|
export function findGridCellElementsFromCol(col, api) {
|
|
14
|
+
var _api$virtualScrollerR;
|
|
14
15
|
const root = findParentElementFromClassName(col, gridClasses.root);
|
|
15
16
|
if (!root) {
|
|
16
17
|
throw new Error('MUI: The root element is not found.');
|
|
@@ -21,7 +22,13 @@ export function findGridCellElementsFromCol(col, api) {
|
|
|
21
22
|
}
|
|
22
23
|
const colIndex = Number(ariaColIndex) - 1;
|
|
23
24
|
const cells = [];
|
|
24
|
-
const
|
|
25
|
+
const virtualScrollerContent = (_api$virtualScrollerR = api.virtualScrollerRef) == null || (_api$virtualScrollerR = _api$virtualScrollerR.current) == null ? void 0 : _api$virtualScrollerR.firstElementChild;
|
|
26
|
+
if (!virtualScrollerContent) {
|
|
27
|
+
return [];
|
|
28
|
+
}
|
|
29
|
+
const renderedRowElements = virtualScrollerContent.querySelectorAll(`:scope > div > .${gridClasses.row}` // Use > to ignore rows from detail panels
|
|
30
|
+
);
|
|
31
|
+
|
|
25
32
|
renderedRowElements.forEach(rowElement => {
|
|
26
33
|
const rowId = rowElement.getAttribute('data-id');
|
|
27
34
|
if (!rowId) {
|
package/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 = "MTY4OTgyMjAwMDAwMA==";
|
|
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
|
|
@@ -19,14 +19,14 @@ export const insertDataRowInTree = ({
|
|
|
19
19
|
}) => {
|
|
20
20
|
let parentNodeId = GRID_ROOT_GROUP_ID;
|
|
21
21
|
for (let depth = 0; depth < path.length; depth += 1) {
|
|
22
|
-
var _childrenFromPath
|
|
22
|
+
var _childrenFromPath;
|
|
23
23
|
const {
|
|
24
24
|
key,
|
|
25
25
|
field
|
|
26
26
|
} = path[depth];
|
|
27
27
|
const fieldWithDefaultValue = field != null ? field : '__no_field__';
|
|
28
28
|
const keyWithDefaultValue = key != null ? key : '__no_key__';
|
|
29
|
-
const existingNodeIdWithPartialPath = (_childrenFromPath = tree[parentNodeId].childrenFromPath) == null
|
|
29
|
+
const existingNodeIdWithPartialPath = (_childrenFromPath = tree[parentNodeId].childrenFromPath) == null || (_childrenFromPath = _childrenFromPath[fieldWithDefaultValue]) == null ? void 0 : _childrenFromPath[keyWithDefaultValue.toString()];
|
|
30
30
|
|
|
31
31
|
// When we reach the last step of the path,
|
|
32
32
|
// We need to create a node for the row passed to `insertNodeInTree`
|
package/utils/tree/utils.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
|
-
import _toPropertyKey from "@babel/runtime/helpers/esm/toPropertyKey";
|
|
3
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
2
|
import { GRID_ROOT_GROUP_ID } from '@mui/x-data-grid';
|
|
5
3
|
export const getGroupRowIdFromPath = path => {
|
|
@@ -106,21 +104,14 @@ export const removeNodeFromTree = ({
|
|
|
106
104
|
// For groups and leaves,
|
|
107
105
|
// Unregister the node from its parents `children` and `childrenFromPath` properties.
|
|
108
106
|
else {
|
|
109
|
-
var _groupingField2, _groupingKey2
|
|
107
|
+
var _groupingField2, _groupingKey2;
|
|
110
108
|
const groupingField = (_groupingField2 = node.groupingField) != null ? _groupingField2 : '__no_field__';
|
|
111
109
|
const groupingKey = (_groupingKey2 = node.groupingKey) != null ? _groupingKey2 : '__no_key__';
|
|
112
|
-
const _ref = (_parentNode$childrenF2 = (_parentNode$childrenF3 = parentNode.childrenFromPath) == null ? void 0 : _parentNode$childrenF3[groupingField]) != null ? _parentNode$childrenF2 : {},
|
|
113
|
-
_groupingKey$toString = groupingKey.toString(),
|
|
114
|
-
newChildrenFromPathWithField = _objectWithoutPropertiesLoose(_ref, [_groupingKey$toString].map(_toPropertyKey));
|
|
115
110
|
|
|
116
111
|
// TODO rows v6: Can we avoid this linear complexity ?
|
|
117
112
|
const children = parentNode.children.filter(childId => childId !== node.id);
|
|
118
|
-
const childrenFromPath =
|
|
119
|
-
|
|
120
|
-
delete childrenFromPath[groupingField];
|
|
121
|
-
} else {
|
|
122
|
-
childrenFromPath[groupingField] = newChildrenFromPathWithField;
|
|
123
|
-
}
|
|
113
|
+
const childrenFromPath = parentNode.childrenFromPath;
|
|
114
|
+
delete childrenFromPath[groupingField][groupingKey.toString()];
|
|
124
115
|
tree[parentNode.id] = _extends({}, parentNode, {
|
|
125
116
|
children,
|
|
126
117
|
childrenFromPath
|