@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.
Files changed (38) hide show
  1. package/CHANGELOG.md +89 -0
  2. package/components/GridPagination.d.ts +6 -5
  3. package/components/GridPagination.js +12 -3
  4. package/components/cell/GridActionsCellItem.d.ts +8 -25
  5. package/components/cell/GridActionsCellItem.js +4 -0
  6. package/hooks/features/clipboard/useGridClipboard.js +4 -2
  7. package/hooks/features/export/serializers/csvSerializer.d.ts +2 -0
  8. package/hooks/features/export/serializers/csvSerializer.js +23 -12
  9. package/hooks/features/export/useGridCsvExport.js +3 -2
  10. package/hooks/features/rowSelection/useGridRowSelection.js +3 -2
  11. package/hooks/features/rows/useGridRows.js +8 -4
  12. package/index.js +1 -1
  13. package/legacy/components/GridPagination.js +12 -3
  14. package/legacy/components/cell/GridActionsCellItem.js +4 -0
  15. package/legacy/hooks/features/clipboard/useGridClipboard.js +4 -2
  16. package/legacy/hooks/features/export/serializers/csvSerializer.js +23 -12
  17. package/legacy/hooks/features/export/useGridCsvExport.js +3 -2
  18. package/legacy/hooks/features/rowSelection/useGridRowSelection.js +3 -2
  19. package/legacy/hooks/features/rows/useGridRows.js +8 -4
  20. package/legacy/index.js +1 -1
  21. package/models/gridExport.d.ts +6 -0
  22. package/modern/components/GridPagination.js +12 -3
  23. package/modern/components/cell/GridActionsCellItem.js +4 -0
  24. package/modern/hooks/features/clipboard/useGridClipboard.js +4 -2
  25. package/modern/hooks/features/export/serializers/csvSerializer.js +23 -12
  26. package/modern/hooks/features/export/useGridCsvExport.js +2 -1
  27. package/modern/hooks/features/rowSelection/useGridRowSelection.js +3 -2
  28. package/modern/hooks/features/rows/useGridRows.js +8 -4
  29. package/modern/index.js +1 -1
  30. package/node/components/GridPagination.js +10 -2
  31. package/node/components/cell/GridActionsCellItem.js +4 -0
  32. package/node/hooks/features/clipboard/useGridClipboard.js +4 -2
  33. package/node/hooks/features/export/serializers/csvSerializer.js +23 -12
  34. package/node/hooks/features/export/useGridCsvExport.js +2 -1
  35. package/node/hooks/features/rowSelection/useGridRowSelection.js +2 -1
  36. package/node/hooks/features/rows/useGridRows.js +8 -4
  37. package/node/index.js +1 -1
  38. 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 [replacedRowId] = rootGroupChildren.splice(firstRowToRender + i, 1, rowId);
277
- delete dataRowIdToModelLookup[replacedRowId];
278
- delete dataRowIdToIdLookup[replacedRowId];
279
- delete tree[replacedRowId];
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
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v6.19.5
2
+ * @mui/x-data-grid v6.19.8
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-data-grid",
3
- "version": "6.19.5",
3
+ "version": "6.19.8",
4
4
  "description": "The community edition of the data grid component (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",