@mui/x-data-grid 6.19.9 → 6.19.10

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,34 @@
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.10
7
+
8
+ _Apr 12, 2024_
9
+
10
+ We'd like to offer a big thanks to the 2 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 🐞 Bugfixes
13
+ - 📚 Documentation improvements
14
+
15
+ ### Data Grid
16
+
17
+ #### `@mui/x-data-grid@6.19.10`
18
+
19
+ - [DataGrid] Do not escape double quotes when copying to clipboard (#12734) @cherniavskii
20
+ - [DataGrid] Fix bug in suspense (#12754) @cherniavskii
21
+
22
+ #### `@mui/x-data-grid-pro@6.19.10` [![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.10`.
25
+
26
+ #### `@mui/x-data-grid-premium@6.19.10` [![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.10`.
29
+
30
+ ### Core
31
+
32
+ - [core] Update the docs release source branch (#12685) @LukasTy
33
+
6
34
  ## 6.19.9
7
35
 
8
36
  _Apr 5, 2024_
@@ -138,10 +138,13 @@ function GridColumnHeaderItem(props) {
138
138
  React.useLayoutEffect(() => {
139
139
  const columnMenuState = apiRef.current.state.columnMenu;
140
140
  if (hasFocus && !columnMenuState.open) {
141
+ var _apiRef$current$colum;
141
142
  const focusableElement = headerCellRef.current.querySelector('[tabindex="0"]');
142
143
  const elementToFocus = focusableElement || headerCellRef.current;
143
144
  elementToFocus == null || elementToFocus.focus();
144
- apiRef.current.columnHeadersContainerElementRef.current.scrollLeft = 0;
145
+ if ((_apiRef$current$colum = apiRef.current.columnHeadersContainerElementRef) != null && _apiRef$current$colum.current) {
146
+ apiRef.current.columnHeadersContainerElementRef.current.scrollLeft = 0;
147
+ }
145
148
  }
146
149
  }, [apiRef, hasFocus]);
147
150
  const headerClassName = typeof colDef.headerClassName === 'function' ? colDef.headerClassName({
@@ -65,7 +65,10 @@ export const useGridColumnHeaders = props => {
65
65
  setRenderContextRaw(nextRenderContext);
66
66
  }, [renderContext]);
67
67
  React.useEffect(() => {
68
- apiRef.current.columnHeadersContainerElementRef.current.scrollLeft = 0;
68
+ var _apiRef$current$colum;
69
+ if ((_apiRef$current$colum = apiRef.current.columnHeadersContainerElementRef) != null && _apiRef$current$colum.current) {
70
+ apiRef.current.columnHeadersContainerElementRef.current.scrollLeft = 0;
71
+ }
69
72
  }, [apiRef]);
70
73
 
71
74
  // memoize `getFirstColumnIndexToRender`, since it's called on scroll
@@ -2,12 +2,13 @@ import { GRID_CHECKBOX_SELECTION_COL_DEF } from '../../../../colDef';
2
2
  import { buildWarning } from '../../../../utils/warning';
3
3
  function sanitizeCellValue(value, delimiterCharacter, shouldAppendQuotes) {
4
4
  if (typeof value === 'string') {
5
- // Make sure value containing delimiter or line break won't be split into multiple rows
6
- if ([delimiterCharacter, '\n', '\r', '"'].some(delimiter => value.includes(delimiter))) {
7
- if (shouldAppendQuotes) {
8
- return `"${value.replace(/"/g, '""')}"`;
5
+ if (shouldAppendQuotes) {
6
+ const escapedValue = value.replace(/"/g, '""');
7
+ // Make sure value containing delimiter or line break won't be split into multiple rows
8
+ if ([delimiterCharacter, '\n', '\r', '"'].some(delimiter => value.includes(delimiter))) {
9
+ return `"${escapedValue}"`;
9
10
  }
10
- return `${value.replace(/"/g, '""')}`;
11
+ return escapedValue;
11
12
  }
12
13
  return value;
13
14
  }
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v6.19.9
2
+ * @mui/x-data-grid v6.19.10
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -148,10 +148,13 @@ function GridColumnHeaderItem(props) {
148
148
  React.useLayoutEffect(function () {
149
149
  var columnMenuState = apiRef.current.state.columnMenu;
150
150
  if (hasFocus && !columnMenuState.open) {
151
+ var _apiRef$current$colum;
151
152
  var focusableElement = headerCellRef.current.querySelector('[tabindex="0"]');
152
153
  var elementToFocus = focusableElement || headerCellRef.current;
153
154
  elementToFocus == null || elementToFocus.focus();
154
- apiRef.current.columnHeadersContainerElementRef.current.scrollLeft = 0;
155
+ if ((_apiRef$current$colum = apiRef.current.columnHeadersContainerElementRef) != null && _apiRef$current$colum.current) {
156
+ apiRef.current.columnHeadersContainerElementRef.current.scrollLeft = 0;
157
+ }
155
158
  }
156
159
  }, [apiRef, hasFocus]);
157
160
  var headerClassName = typeof colDef.headerClassName === 'function' ? colDef.headerClassName({
@@ -78,7 +78,10 @@ export var useGridColumnHeaders = function useGridColumnHeaders(props) {
78
78
  setRenderContextRaw(nextRenderContext);
79
79
  }, [renderContext]);
80
80
  React.useEffect(function () {
81
- apiRef.current.columnHeadersContainerElementRef.current.scrollLeft = 0;
81
+ var _apiRef$current$colum;
82
+ if ((_apiRef$current$colum = apiRef.current.columnHeadersContainerElementRef) != null && _apiRef$current$colum.current) {
83
+ apiRef.current.columnHeadersContainerElementRef.current.scrollLeft = 0;
84
+ }
82
85
  }, [apiRef]);
83
86
 
84
87
  // memoize `getFirstColumnIndexToRender`, since it's called on scroll
@@ -4,14 +4,15 @@ import { GRID_CHECKBOX_SELECTION_COL_DEF } from '../../../../colDef';
4
4
  import { buildWarning } from '../../../../utils/warning';
5
5
  function sanitizeCellValue(value, delimiterCharacter, shouldAppendQuotes) {
6
6
  if (typeof value === 'string') {
7
- // Make sure value containing delimiter or line break won't be split into multiple rows
8
- if ([delimiterCharacter, '\n', '\r', '"'].some(function (delimiter) {
9
- return value.includes(delimiter);
10
- })) {
11
- if (shouldAppendQuotes) {
12
- return "\"".concat(value.replace(/"/g, '""'), "\"");
7
+ if (shouldAppendQuotes) {
8
+ var escapedValue = value.replace(/"/g, '""');
9
+ // Make sure value containing delimiter or line break won't be split into multiple rows
10
+ if ([delimiterCharacter, '\n', '\r', '"'].some(function (delimiter) {
11
+ return value.includes(delimiter);
12
+ })) {
13
+ return "\"".concat(escapedValue, "\"");
13
14
  }
14
- return "".concat(value.replace(/"/g, '""'));
15
+ return escapedValue;
15
16
  }
16
17
  return value;
17
18
  }
package/legacy/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v6.19.9
2
+ * @mui/x-data-grid v6.19.10
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -140,7 +140,9 @@ function GridColumnHeaderItem(props) {
140
140
  const focusableElement = headerCellRef.current.querySelector('[tabindex="0"]');
141
141
  const elementToFocus = focusableElement || headerCellRef.current;
142
142
  elementToFocus?.focus();
143
- apiRef.current.columnHeadersContainerElementRef.current.scrollLeft = 0;
143
+ if (apiRef.current.columnHeadersContainerElementRef?.current) {
144
+ apiRef.current.columnHeadersContainerElementRef.current.scrollLeft = 0;
145
+ }
144
146
  }
145
147
  }, [apiRef, hasFocus]);
146
148
  const headerClassName = typeof colDef.headerClassName === 'function' ? colDef.headerClassName({
@@ -65,7 +65,9 @@ export const useGridColumnHeaders = props => {
65
65
  setRenderContextRaw(nextRenderContext);
66
66
  }, [renderContext]);
67
67
  React.useEffect(() => {
68
- apiRef.current.columnHeadersContainerElementRef.current.scrollLeft = 0;
68
+ if (apiRef.current.columnHeadersContainerElementRef?.current) {
69
+ apiRef.current.columnHeadersContainerElementRef.current.scrollLeft = 0;
70
+ }
69
71
  }, [apiRef]);
70
72
 
71
73
  // memoize `getFirstColumnIndexToRender`, since it's called on scroll
@@ -2,12 +2,13 @@ import { GRID_CHECKBOX_SELECTION_COL_DEF } from '../../../../colDef';
2
2
  import { buildWarning } from '../../../../utils/warning';
3
3
  function sanitizeCellValue(value, delimiterCharacter, shouldAppendQuotes) {
4
4
  if (typeof value === 'string') {
5
- // Make sure value containing delimiter or line break won't be split into multiple rows
6
- if ([delimiterCharacter, '\n', '\r', '"'].some(delimiter => value.includes(delimiter))) {
7
- if (shouldAppendQuotes) {
8
- return `"${value.replace(/"/g, '""')}"`;
5
+ if (shouldAppendQuotes) {
6
+ const escapedValue = value.replace(/"/g, '""');
7
+ // Make sure value containing delimiter or line break won't be split into multiple rows
8
+ if ([delimiterCharacter, '\n', '\r', '"'].some(delimiter => value.includes(delimiter))) {
9
+ return `"${escapedValue}"`;
9
10
  }
10
- return `${value.replace(/"/g, '""')}`;
11
+ return escapedValue;
11
12
  }
12
13
  return value;
13
14
  }
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v6.19.9
2
+ * @mui/x-data-grid v6.19.10
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -148,7 +148,9 @@ function GridColumnHeaderItem(props) {
148
148
  const focusableElement = headerCellRef.current.querySelector('[tabindex="0"]');
149
149
  const elementToFocus = focusableElement || headerCellRef.current;
150
150
  elementToFocus?.focus();
151
- apiRef.current.columnHeadersContainerElementRef.current.scrollLeft = 0;
151
+ if (apiRef.current.columnHeadersContainerElementRef?.current) {
152
+ apiRef.current.columnHeadersContainerElementRef.current.scrollLeft = 0;
153
+ }
152
154
  }
153
155
  }, [apiRef, hasFocus]);
154
156
  const headerClassName = typeof colDef.headerClassName === 'function' ? colDef.headerClassName({
@@ -74,7 +74,9 @@ const useGridColumnHeaders = props => {
74
74
  setRenderContextRaw(nextRenderContext);
75
75
  }, [renderContext]);
76
76
  React.useEffect(() => {
77
- apiRef.current.columnHeadersContainerElementRef.current.scrollLeft = 0;
77
+ if (apiRef.current.columnHeadersContainerElementRef?.current) {
78
+ apiRef.current.columnHeadersContainerElementRef.current.scrollLeft = 0;
79
+ }
78
80
  }, [apiRef]);
79
81
 
80
82
  // memoize `getFirstColumnIndexToRender`, since it's called on scroll
@@ -9,12 +9,13 @@ var _colDef = require("../../../../colDef");
9
9
  var _warning = require("../../../../utils/warning");
10
10
  function sanitizeCellValue(value, delimiterCharacter, shouldAppendQuotes) {
11
11
  if (typeof value === 'string') {
12
- // Make sure value containing delimiter or line break won't be split into multiple rows
13
- if ([delimiterCharacter, '\n', '\r', '"'].some(delimiter => value.includes(delimiter))) {
14
- if (shouldAppendQuotes) {
15
- return `"${value.replace(/"/g, '""')}"`;
12
+ if (shouldAppendQuotes) {
13
+ const escapedValue = value.replace(/"/g, '""');
14
+ // Make sure value containing delimiter or line break won't be split into multiple rows
15
+ if ([delimiterCharacter, '\n', '\r', '"'].some(delimiter => value.includes(delimiter))) {
16
+ return `"${escapedValue}"`;
16
17
  }
17
- return `${value.replace(/"/g, '""')}`;
18
+ return escapedValue;
18
19
  }
19
20
  return value;
20
21
  }
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v6.19.9
2
+ * @mui/x-data-grid v6.19.10
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.9",
3
+ "version": "6.19.10",
4
4
  "description": "The community edition of the data grid component (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",