@mui/x-data-grid 6.19.5 → 6.19.8
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 +89 -0
- package/components/GridPagination.d.ts +6 -5
- package/components/GridPagination.js +12 -3
- package/components/cell/GridActionsCellItem.d.ts +8 -25
- package/components/cell/GridActionsCellItem.js +4 -0
- package/hooks/features/clipboard/useGridClipboard.js +4 -2
- package/hooks/features/export/serializers/csvSerializer.d.ts +2 -0
- package/hooks/features/export/serializers/csvSerializer.js +23 -12
- package/hooks/features/export/useGridCsvExport.js +3 -2
- package/hooks/features/rowSelection/useGridRowSelection.js +3 -2
- package/hooks/features/rows/useGridRows.js +8 -4
- package/index.js +1 -1
- package/legacy/components/GridPagination.js +12 -3
- package/legacy/components/cell/GridActionsCellItem.js +4 -0
- package/legacy/hooks/features/clipboard/useGridClipboard.js +4 -2
- package/legacy/hooks/features/export/serializers/csvSerializer.js +23 -12
- package/legacy/hooks/features/export/useGridCsvExport.js +3 -2
- package/legacy/hooks/features/rowSelection/useGridRowSelection.js +3 -2
- package/legacy/hooks/features/rows/useGridRows.js +8 -4
- package/legacy/index.js +1 -1
- package/models/gridExport.d.ts +6 -0
- package/modern/components/GridPagination.js +12 -3
- package/modern/components/cell/GridActionsCellItem.js +4 -0
- package/modern/hooks/features/clipboard/useGridClipboard.js +4 -2
- package/modern/hooks/features/export/serializers/csvSerializer.js +23 -12
- package/modern/hooks/features/export/useGridCsvExport.js +2 -1
- package/modern/hooks/features/rowSelection/useGridRowSelection.js +3 -2
- package/modern/hooks/features/rows/useGridRows.js +8 -4
- package/modern/index.js +1 -1
- package/node/components/GridPagination.js +10 -2
- package/node/components/cell/GridActionsCellItem.js +4 -0
- package/node/hooks/features/clipboard/useGridClipboard.js +4 -2
- package/node/hooks/features/export/serializers/csvSerializer.js +23 -12
- package/node/hooks/features/export/useGridCsvExport.js +2 -1
- package/node/hooks/features/rowSelection/useGridRowSelection.js +2 -1
- package/node/hooks/features/rows/useGridRows.js +8 -4
- package/node/index.js +1 -1
- package/package.json +1 -1
|
@@ -270,13 +270,16 @@ const useGridRows = (apiRef, props) => {
|
|
|
270
270
|
const dataRowIdToIdLookup = (0, _extends2.default)({}, (0, _gridRowsSelector.gridRowsDataRowIdToIdLookupSelector)(apiRef));
|
|
271
271
|
const rootGroup = tree[_gridRowsUtils.GRID_ROOT_GROUP_ID];
|
|
272
272
|
const rootGroupChildren = [...rootGroup.children];
|
|
273
|
+
const seenIds = new Set();
|
|
273
274
|
for (let i = 0; i < newRows.length; i += 1) {
|
|
274
275
|
const rowModel = newRows[i];
|
|
275
276
|
const rowId = (0, _gridRowsUtils.getRowIdFromRowModel)(rowModel, props.getRowId, 'A row was provided without id when calling replaceRows().');
|
|
276
|
-
const [
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
277
|
+
const [removedRowId] = rootGroupChildren.splice(firstRowToRender + i, 1, rowId);
|
|
278
|
+
if (!seenIds.has(removedRowId)) {
|
|
279
|
+
delete dataRowIdToModelLookup[removedRowId];
|
|
280
|
+
delete dataRowIdToIdLookup[removedRowId];
|
|
281
|
+
delete tree[removedRowId];
|
|
282
|
+
}
|
|
280
283
|
const rowTreeNodeConfig = {
|
|
281
284
|
id: rowId,
|
|
282
285
|
depth: 0,
|
|
@@ -287,6 +290,7 @@ const useGridRows = (apiRef, props) => {
|
|
|
287
290
|
dataRowIdToModelLookup[rowId] = rowModel;
|
|
288
291
|
dataRowIdToIdLookup[rowId] = rowId;
|
|
289
292
|
tree[rowId] = rowTreeNodeConfig;
|
|
293
|
+
seenIds.add(rowId);
|
|
290
294
|
}
|
|
291
295
|
tree[_gridRowsUtils.GRID_ROOT_GROUP_ID] = (0, _extends2.default)({}, rootGroup, {
|
|
292
296
|
children: rootGroupChildren
|
package/node/index.js
CHANGED