@mui/x-data-grid 6.19.5 → 6.19.6

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 CHANGED
@@ -3,6 +3,47 @@
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.19.6
7
+
8
+ _Mar 1, 2024_
9
+
10
+ We'd like to offer a big thanks to the 4 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 🌍 Improve Korean (ko-KR) and Chinese (zh-CN) locales on the Pickers
13
+ - 🐞 Bugfixes
14
+ - 📚 Documentation improvements
15
+
16
+ ### Data Grid
17
+
18
+ #### `@mui/x-data-grid@6.19.6`
19
+
20
+ - [DataGrid] Fix error when existing rows are passed to `replaceRows` (@martijn-basesoft)
21
+
22
+ #### `@mui/x-data-grid-pro@6.19.6` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
23
+
24
+ Same changes as in `@mui/x-data-grid@6.19.6`.
25
+
26
+ #### `@mui/x-data-grid-premium@6.19.6` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
27
+
28
+ Same changes as in `@mui/x-data-grid-pro@6.19.6`, plus:
29
+
30
+ - [DataGridPremium] Make clipboard copy respect the sorting during cell selection (#12255) @MBilalShafi
31
+
32
+ ### Date Pickers
33
+
34
+ #### `@mui/x-date-pickers@6.19.6`
35
+
36
+ - [l10n] Improve Chinese (zh-CN) locale (#12250) @headironc
37
+ - [l10n] Improve Korean (ko-KR) locale (#12186) @Luzi
38
+
39
+ #### `@mui/x-date-pickers-pro@6.19.6` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
40
+
41
+ Same changes as in `@mui/x-date-pickers@6.19.6`.
42
+
43
+ ### Docs
44
+
45
+ - [docs] Update lazy loading demo to show skeleton rows during initial rows fetch (#12062) @cherniavskii
46
+
6
47
  ## 6.19.5
7
48
 
8
49
  _Feb 23, 2024_
@@ -266,13 +266,16 @@ export const useGridRows = (apiRef, props) => {
266
266
  const dataRowIdToIdLookup = _extends({}, gridRowsDataRowIdToIdLookupSelector(apiRef));
267
267
  const rootGroup = tree[GRID_ROOT_GROUP_ID];
268
268
  const rootGroupChildren = [...rootGroup.children];
269
+ const seenIds = new Set();
269
270
  for (let i = 0; i < newRows.length; i += 1) {
270
271
  const rowModel = newRows[i];
271
272
  const rowId = getRowIdFromRowModel(rowModel, props.getRowId, 'A row was provided without id when calling replaceRows().');
272
- const [replacedRowId] = rootGroupChildren.splice(firstRowToRender + i, 1, rowId);
273
- delete dataRowIdToModelLookup[replacedRowId];
274
- delete dataRowIdToIdLookup[replacedRowId];
275
- delete tree[replacedRowId];
273
+ const [removedRowId] = rootGroupChildren.splice(firstRowToRender + i, 1, rowId);
274
+ if (!seenIds.has(removedRowId)) {
275
+ delete dataRowIdToModelLookup[removedRowId];
276
+ delete dataRowIdToIdLookup[removedRowId];
277
+ delete tree[removedRowId];
278
+ }
276
279
  const rowTreeNodeConfig = {
277
280
  id: rowId,
278
281
  depth: 0,
@@ -283,6 +286,7 @@ export const useGridRows = (apiRef, props) => {
283
286
  dataRowIdToModelLookup[rowId] = rowModel;
284
287
  dataRowIdToIdLookup[rowId] = rowId;
285
288
  tree[rowId] = rowTreeNodeConfig;
289
+ seenIds.add(rowId);
286
290
  }
287
291
  tree[GRID_ROOT_GROUP_ID] = _extends({}, rootGroup, {
288
292
  children: rootGroupChildren
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v6.19.5
2
+ * @mui/x-data-grid v6.19.6
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -277,15 +277,18 @@ export var useGridRows = function useGridRows(apiRef, props) {
277
277
  var dataRowIdToIdLookup = _extends({}, gridRowsDataRowIdToIdLookupSelector(apiRef));
278
278
  var rootGroup = tree[GRID_ROOT_GROUP_ID];
279
279
  var rootGroupChildren = _toConsumableArray(rootGroup.children);
280
+ var seenIds = new Set();
280
281
  for (var i = 0; i < newRows.length; i += 1) {
281
282
  var rowModel = newRows[i];
282
283
  var rowId = getRowIdFromRowModel(rowModel, props.getRowId, 'A row was provided without id when calling replaceRows().');
283
284
  var _rootGroupChildren$sp = rootGroupChildren.splice(firstRowToRender + i, 1, rowId),
284
285
  _rootGroupChildren$sp2 = _slicedToArray(_rootGroupChildren$sp, 1),
285
- replacedRowId = _rootGroupChildren$sp2[0];
286
- delete dataRowIdToModelLookup[replacedRowId];
287
- delete dataRowIdToIdLookup[replacedRowId];
288
- delete tree[replacedRowId];
286
+ removedRowId = _rootGroupChildren$sp2[0];
287
+ if (!seenIds.has(removedRowId)) {
288
+ delete dataRowIdToModelLookup[removedRowId];
289
+ delete dataRowIdToIdLookup[removedRowId];
290
+ delete tree[removedRowId];
291
+ }
289
292
  var rowTreeNodeConfig = {
290
293
  id: rowId,
291
294
  depth: 0,
@@ -296,6 +299,7 @@ export var useGridRows = function useGridRows(apiRef, props) {
296
299
  dataRowIdToModelLookup[rowId] = rowModel;
297
300
  dataRowIdToIdLookup[rowId] = rowId;
298
301
  tree[rowId] = rowTreeNodeConfig;
302
+ seenIds.add(rowId);
299
303
  }
300
304
  tree[GRID_ROOT_GROUP_ID] = _extends({}, rootGroup, {
301
305
  children: rootGroupChildren
package/legacy/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v6.19.5
2
+ * @mui/x-data-grid v6.19.6
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -260,13 +260,16 @@ export const useGridRows = (apiRef, props) => {
260
260
  const dataRowIdToIdLookup = _extends({}, gridRowsDataRowIdToIdLookupSelector(apiRef));
261
261
  const rootGroup = tree[GRID_ROOT_GROUP_ID];
262
262
  const rootGroupChildren = [...rootGroup.children];
263
+ const seenIds = new Set();
263
264
  for (let i = 0; i < newRows.length; i += 1) {
264
265
  const rowModel = newRows[i];
265
266
  const rowId = getRowIdFromRowModel(rowModel, props.getRowId, 'A row was provided without id when calling replaceRows().');
266
- const [replacedRowId] = rootGroupChildren.splice(firstRowToRender + i, 1, rowId);
267
- delete dataRowIdToModelLookup[replacedRowId];
268
- delete dataRowIdToIdLookup[replacedRowId];
269
- delete tree[replacedRowId];
267
+ const [removedRowId] = rootGroupChildren.splice(firstRowToRender + i, 1, rowId);
268
+ if (!seenIds.has(removedRowId)) {
269
+ delete dataRowIdToModelLookup[removedRowId];
270
+ delete dataRowIdToIdLookup[removedRowId];
271
+ delete tree[removedRowId];
272
+ }
270
273
  const rowTreeNodeConfig = {
271
274
  id: rowId,
272
275
  depth: 0,
@@ -277,6 +280,7 @@ export const useGridRows = (apiRef, props) => {
277
280
  dataRowIdToModelLookup[rowId] = rowModel;
278
281
  dataRowIdToIdLookup[rowId] = rowId;
279
282
  tree[rowId] = rowTreeNodeConfig;
283
+ seenIds.add(rowId);
280
284
  }
281
285
  tree[GRID_ROOT_GROUP_ID] = _extends({}, rootGroup, {
282
286
  children: rootGroupChildren
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v6.19.5
2
+ * @mui/x-data-grid v6.19.6
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -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.6
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.6",
4
4
  "description": "The community edition of the data grid component (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",