@mui/x-data-grid-premium 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_
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
3
  import { ownerDocument, useEventCallback } from '@mui/material/utils';
4
4
  import { isNavigationKey, serializeCellValue, useGridRegisterPipeProcessor, useGridVisibleRows } from '@mui/x-data-grid-pro/internals';
5
- import { useGridApiEventHandler, useGridApiMethod, GRID_ACTIONS_COLUMN_TYPE, GRID_CHECKBOX_SELECTION_COL_DEF, GRID_DETAIL_PANEL_TOGGLE_FIELD, gridRowsDataRowIdToIdLookupSelector, gridClasses, gridFocusCellSelector, GRID_REORDER_COL_DEF } from '@mui/x-data-grid-pro';
5
+ import { useGridApiEventHandler, useGridApiMethod, GRID_ACTIONS_COLUMN_TYPE, GRID_CHECKBOX_SELECTION_COL_DEF, GRID_DETAIL_PANEL_TOGGLE_FIELD, gridRowsDataRowIdToIdLookupSelector, gridClasses, gridFocusCellSelector, GRID_REORDER_COL_DEF, useGridSelector, gridSortedRowIdsSelector } from '@mui/x-data-grid-pro';
6
6
  import { gridCellSelectionStateSelector } from './gridCellSelectionSelector';
7
7
  export const cellSelectionStateInitializer = (state, props) => {
8
8
  var _props$unstable_cellS, _props$initialState;
@@ -22,6 +22,7 @@ export const useGridCellSelection = (apiRef, props) => {
22
22
  const lastMouseDownCell = React.useRef();
23
23
  const mousePosition = React.useRef(null);
24
24
  const autoScrollRAF = React.useRef();
25
+ const sortedRowIds = useGridSelector(apiRef, gridSortedRowIdsSelector);
25
26
  const ignoreValueFormatterProp = props.unstable_ignoreValueFormatterDuringExport;
26
27
  const ignoreValueFormatter = (typeof ignoreValueFormatterProp === 'object' ? ignoreValueFormatterProp == null ? void 0 : ignoreValueFormatterProp.clipboardExport : ignoreValueFormatterProp) || false;
27
28
  const clipboardCopyCellDelimiter = props.clipboardCopyCellDelimiter;
@@ -445,7 +446,9 @@ export const useGridCellSelection = (apiRef, props) => {
445
446
  return value;
446
447
  }
447
448
  const cellSelectionModel = apiRef.current.unstable_getCellSelectionModel();
448
- const copyData = Object.keys(cellSelectionModel).reduce((acc, rowId) => {
449
+ const unsortedSelectedRowIds = Object.keys(cellSelectionModel);
450
+ const sortedSelectedRowIds = sortedRowIds.filter(id => unsortedSelectedRowIds.includes(`${id}`));
451
+ const copyData = sortedSelectedRowIds.reduce((acc, rowId) => {
449
452
  const fieldsMap = cellSelectionModel[rowId];
450
453
  const rowString = Object.keys(fieldsMap).reduce((acc2, field) => {
451
454
  let cellData;
@@ -463,7 +466,7 @@ export const useGridCellSelection = (apiRef, props) => {
463
466
  return acc === '' ? rowString : [acc, rowString].join('\r\n');
464
467
  }, '');
465
468
  return copyData;
466
- }, [apiRef, ignoreValueFormatter, clipboardCopyCellDelimiter]);
469
+ }, [apiRef, ignoreValueFormatter, clipboardCopyCellDelimiter, sortedRowIds]);
467
470
  useGridRegisterPipeProcessor(apiRef, 'isCellSelected', checkIfCellIsSelected);
468
471
  useGridRegisterPipeProcessor(apiRef, 'cellClassName', addClassesToCells);
469
472
  useGridRegisterPipeProcessor(apiRef, 'canUpdateFocus', canUpdateFocus);
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid-premium v6.19.5
2
+ * @mui/x-data-grid-premium v6.19.6
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -6,7 +6,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
6
6
  import * as React from 'react';
7
7
  import { ownerDocument, useEventCallback } from '@mui/material/utils';
8
8
  import { isNavigationKey, serializeCellValue, useGridRegisterPipeProcessor, useGridVisibleRows } from '@mui/x-data-grid-pro/internals';
9
- import { useGridApiEventHandler, useGridApiMethod, GRID_ACTIONS_COLUMN_TYPE, GRID_CHECKBOX_SELECTION_COL_DEF, GRID_DETAIL_PANEL_TOGGLE_FIELD, gridRowsDataRowIdToIdLookupSelector, gridClasses, gridFocusCellSelector, GRID_REORDER_COL_DEF } from '@mui/x-data-grid-pro';
9
+ import { useGridApiEventHandler, useGridApiMethod, GRID_ACTIONS_COLUMN_TYPE, GRID_CHECKBOX_SELECTION_COL_DEF, GRID_DETAIL_PANEL_TOGGLE_FIELD, gridRowsDataRowIdToIdLookupSelector, gridClasses, gridFocusCellSelector, GRID_REORDER_COL_DEF, useGridSelector, gridSortedRowIdsSelector } from '@mui/x-data-grid-pro';
10
10
  import { gridCellSelectionStateSelector } from './gridCellSelectionSelector';
11
11
  export var cellSelectionStateInitializer = function cellSelectionStateInitializer(state, props) {
12
12
  var _props$unstable_cellS, _props$initialState;
@@ -26,6 +26,7 @@ export var useGridCellSelection = function useGridCellSelection(apiRef, props) {
26
26
  var lastMouseDownCell = React.useRef();
27
27
  var mousePosition = React.useRef(null);
28
28
  var autoScrollRAF = React.useRef();
29
+ var sortedRowIds = useGridSelector(apiRef, gridSortedRowIdsSelector);
29
30
  var ignoreValueFormatterProp = props.unstable_ignoreValueFormatterDuringExport;
30
31
  var ignoreValueFormatter = (_typeof(ignoreValueFormatterProp) === 'object' ? ignoreValueFormatterProp == null ? void 0 : ignoreValueFormatterProp.clipboardExport : ignoreValueFormatterProp) || false;
31
32
  var clipboardCopyCellDelimiter = props.clipboardCopyCellDelimiter;
@@ -429,7 +430,11 @@ export var useGridCellSelection = function useGridCellSelection(apiRef, props) {
429
430
  return value;
430
431
  }
431
432
  var cellSelectionModel = apiRef.current.unstable_getCellSelectionModel();
432
- var copyData = Object.keys(cellSelectionModel).reduce(function (acc, rowId) {
433
+ var unsortedSelectedRowIds = Object.keys(cellSelectionModel);
434
+ var sortedSelectedRowIds = sortedRowIds.filter(function (id) {
435
+ return unsortedSelectedRowIds.includes("".concat(id));
436
+ });
437
+ var copyData = sortedSelectedRowIds.reduce(function (acc, rowId) {
433
438
  var fieldsMap = cellSelectionModel[rowId];
434
439
  var rowString = Object.keys(fieldsMap).reduce(function (acc2, field) {
435
440
  var cellData;
@@ -447,7 +452,7 @@ export var useGridCellSelection = function useGridCellSelection(apiRef, props) {
447
452
  return acc === '' ? rowString : [acc, rowString].join('\r\n');
448
453
  }, '');
449
454
  return copyData;
450
- }, [apiRef, ignoreValueFormatter, clipboardCopyCellDelimiter]);
455
+ }, [apiRef, ignoreValueFormatter, clipboardCopyCellDelimiter, sortedRowIds]);
451
456
  useGridRegisterPipeProcessor(apiRef, 'isCellSelected', checkIfCellIsSelected);
452
457
  useGridRegisterPipeProcessor(apiRef, 'cellClassName', addClassesToCells);
453
458
  useGridRegisterPipeProcessor(apiRef, 'canUpdateFocus', canUpdateFocus);
package/legacy/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid-premium v6.19.5
2
+ * @mui/x-data-grid-premium v6.19.6
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -1,6 +1,6 @@
1
1
  import { ponyfillGlobal } from '@mui/utils';
2
2
  export var getReleaseInfo = function getReleaseInfo() {
3
- var releaseInfo = "MTcwODYyODQwMDAwMA==";
3
+ var releaseInfo = "MTcwOTM1NTYwMDAwMA==";
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
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
3
  import { ownerDocument, useEventCallback } from '@mui/material/utils';
4
4
  import { isNavigationKey, serializeCellValue, useGridRegisterPipeProcessor, useGridVisibleRows } from '@mui/x-data-grid-pro/internals';
5
- import { useGridApiEventHandler, useGridApiMethod, GRID_ACTIONS_COLUMN_TYPE, GRID_CHECKBOX_SELECTION_COL_DEF, GRID_DETAIL_PANEL_TOGGLE_FIELD, gridRowsDataRowIdToIdLookupSelector, gridClasses, gridFocusCellSelector, GRID_REORDER_COL_DEF } from '@mui/x-data-grid-pro';
5
+ import { useGridApiEventHandler, useGridApiMethod, GRID_ACTIONS_COLUMN_TYPE, GRID_CHECKBOX_SELECTION_COL_DEF, GRID_DETAIL_PANEL_TOGGLE_FIELD, gridRowsDataRowIdToIdLookupSelector, gridClasses, gridFocusCellSelector, GRID_REORDER_COL_DEF, useGridSelector, gridSortedRowIdsSelector } from '@mui/x-data-grid-pro';
6
6
  import { gridCellSelectionStateSelector } from './gridCellSelectionSelector';
7
7
  export const cellSelectionStateInitializer = (state, props) => _extends({}, state, {
8
8
  cellSelection: _extends({}, props.unstable_cellSelectionModel ?? props.initialState?.cellSelection)
@@ -19,6 +19,7 @@ export const useGridCellSelection = (apiRef, props) => {
19
19
  const lastMouseDownCell = React.useRef();
20
20
  const mousePosition = React.useRef(null);
21
21
  const autoScrollRAF = React.useRef();
22
+ const sortedRowIds = useGridSelector(apiRef, gridSortedRowIdsSelector);
22
23
  const ignoreValueFormatterProp = props.unstable_ignoreValueFormatterDuringExport;
23
24
  const ignoreValueFormatter = (typeof ignoreValueFormatterProp === 'object' ? ignoreValueFormatterProp?.clipboardExport : ignoreValueFormatterProp) || false;
24
25
  const clipboardCopyCellDelimiter = props.clipboardCopyCellDelimiter;
@@ -436,7 +437,9 @@ export const useGridCellSelection = (apiRef, props) => {
436
437
  return value;
437
438
  }
438
439
  const cellSelectionModel = apiRef.current.unstable_getCellSelectionModel();
439
- const copyData = Object.keys(cellSelectionModel).reduce((acc, rowId) => {
440
+ const unsortedSelectedRowIds = Object.keys(cellSelectionModel);
441
+ const sortedSelectedRowIds = sortedRowIds.filter(id => unsortedSelectedRowIds.includes(`${id}`));
442
+ const copyData = sortedSelectedRowIds.reduce((acc, rowId) => {
440
443
  const fieldsMap = cellSelectionModel[rowId];
441
444
  const rowString = Object.keys(fieldsMap).reduce((acc2, field) => {
442
445
  let cellData;
@@ -454,7 +457,7 @@ export const useGridCellSelection = (apiRef, props) => {
454
457
  return acc === '' ? rowString : [acc, rowString].join('\r\n');
455
458
  }, '');
456
459
  return copyData;
457
- }, [apiRef, ignoreValueFormatter, clipboardCopyCellDelimiter]);
460
+ }, [apiRef, ignoreValueFormatter, clipboardCopyCellDelimiter, sortedRowIds]);
458
461
  useGridRegisterPipeProcessor(apiRef, 'isCellSelected', checkIfCellIsSelected);
459
462
  useGridRegisterPipeProcessor(apiRef, 'cellClassName', addClassesToCells);
460
463
  useGridRegisterPipeProcessor(apiRef, 'canUpdateFocus', canUpdateFocus);
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid-premium v6.19.5
2
+ * @mui/x-data-grid-premium v6.19.6
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -1,6 +1,6 @@
1
1
  import { ponyfillGlobal } from '@mui/utils';
2
2
  export const getReleaseInfo = () => {
3
- const releaseInfo = "MTcwODYyODQwMDAwMA==";
3
+ const releaseInfo = "MTcwOTM1NTYwMDAwMA==";
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
@@ -29,6 +29,7 @@ const useGridCellSelection = (apiRef, props) => {
29
29
  const lastMouseDownCell = React.useRef();
30
30
  const mousePosition = React.useRef(null);
31
31
  const autoScrollRAF = React.useRef();
32
+ const sortedRowIds = (0, _xDataGridPro.useGridSelector)(apiRef, _xDataGridPro.gridSortedRowIdsSelector);
32
33
  const ignoreValueFormatterProp = props.unstable_ignoreValueFormatterDuringExport;
33
34
  const ignoreValueFormatter = (typeof ignoreValueFormatterProp === 'object' ? ignoreValueFormatterProp?.clipboardExport : ignoreValueFormatterProp) || false;
34
35
  const clipboardCopyCellDelimiter = props.clipboardCopyCellDelimiter;
@@ -446,7 +447,9 @@ const useGridCellSelection = (apiRef, props) => {
446
447
  return value;
447
448
  }
448
449
  const cellSelectionModel = apiRef.current.unstable_getCellSelectionModel();
449
- const copyData = Object.keys(cellSelectionModel).reduce((acc, rowId) => {
450
+ const unsortedSelectedRowIds = Object.keys(cellSelectionModel);
451
+ const sortedSelectedRowIds = sortedRowIds.filter(id => unsortedSelectedRowIds.includes(`${id}`));
452
+ const copyData = sortedSelectedRowIds.reduce((acc, rowId) => {
450
453
  const fieldsMap = cellSelectionModel[rowId];
451
454
  const rowString = Object.keys(fieldsMap).reduce((acc2, field) => {
452
455
  let cellData;
@@ -464,7 +467,7 @@ const useGridCellSelection = (apiRef, props) => {
464
467
  return acc === '' ? rowString : [acc, rowString].join('\r\n');
465
468
  }, '');
466
469
  return copyData;
467
- }, [apiRef, ignoreValueFormatter, clipboardCopyCellDelimiter]);
470
+ }, [apiRef, ignoreValueFormatter, clipboardCopyCellDelimiter, sortedRowIds]);
468
471
  (0, _internals.useGridRegisterPipeProcessor)(apiRef, 'isCellSelected', checkIfCellIsSelected);
469
472
  (0, _internals.useGridRegisterPipeProcessor)(apiRef, 'cellClassName', addClassesToCells);
470
473
  (0, _internals.useGridRegisterPipeProcessor)(apiRef, 'canUpdateFocus', canUpdateFocus);
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid-premium v6.19.5
2
+ * @mui/x-data-grid-premium v6.19.6
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -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 = "MTcwODYyODQwMDAwMA==";
9
+ const releaseInfo = "MTcwOTM1NTYwMDAwMA==";
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-data-grid-premium",
3
- "version": "6.19.5",
3
+ "version": "6.19.6",
4
4
  "description": "The Premium plan edition of the data grid component (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",
@@ -33,8 +33,8 @@
33
33
  "dependencies": {
34
34
  "@babel/runtime": "^7.23.2",
35
35
  "@mui/utils": "^5.14.16",
36
- "@mui/x-data-grid": "6.19.5",
37
- "@mui/x-data-grid-pro": "6.19.5",
36
+ "@mui/x-data-grid": "6.19.6",
37
+ "@mui/x-data-grid-pro": "6.19.6",
38
38
  "@mui/x-license-pro": "6.10.2",
39
39
  "@types/format-util": "^1.0.3",
40
40
  "clsx": "^2.0.0",
@@ -1,6 +1,6 @@
1
1
  import { ponyfillGlobal } from '@mui/utils';
2
2
  export const getReleaseInfo = () => {
3
- const releaseInfo = "MTcwODYyODQwMDAwMA==";
3
+ const releaseInfo = "MTcwOTM1NTYwMDAwMA==";
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