@mui/x-data-grid 6.19.8 → 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 +70 -0
- package/DataGrid/DataGrid.js +0 -6
- package/components/columnHeaders/GridColumnHeaderItem.js +4 -1
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +4 -1
- package/hooks/features/export/serializers/csvSerializer.js +6 -5
- package/index.js +1 -1
- package/legacy/DataGrid/DataGrid.js +0 -6
- package/legacy/components/columnHeaders/GridColumnHeaderItem.js +4 -1
- package/legacy/hooks/features/columnHeaders/useGridColumnHeaders.js +4 -1
- package/legacy/hooks/features/export/serializers/csvSerializer.js +8 -7
- package/legacy/index.js +1 -1
- package/models/events/gridEventLookup.d.ts +1 -8
- package/models/props/DataGridProps.d.ts +0 -6
- package/modern/DataGrid/DataGrid.js +0 -6
- package/modern/components/columnHeaders/GridColumnHeaderItem.js +3 -1
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +3 -1
- package/modern/hooks/features/export/serializers/csvSerializer.js +6 -5
- package/modern/index.js +1 -1
- package/node/DataGrid/DataGrid.js +0 -6
- package/node/components/columnHeaders/GridColumnHeaderItem.js +3 -1
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +3 -1
- package/node/hooks/features/export/serializers/csvSerializer.js +6 -5
- package/node/index.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,76 @@
|
|
|
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` [](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` [](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
|
+
|
|
34
|
+
## 6.19.9
|
|
35
|
+
|
|
36
|
+
_Apr 5, 2024_
|
|
37
|
+
|
|
38
|
+
We'd like to offer a big thanks to the 3 contributors who made this release possible. Here are some highlights ✨:
|
|
39
|
+
|
|
40
|
+
- 🐞 Bugfixes
|
|
41
|
+
- 📚 Documentation improvements
|
|
42
|
+
|
|
43
|
+
### Data Grid
|
|
44
|
+
|
|
45
|
+
#### `@mui/x-data-grid@6.19.9`
|
|
46
|
+
|
|
47
|
+
- [DataGrid] Remove legacy editing API event: `rowEditCommit` (#12087) @MBilalShafi
|
|
48
|
+
|
|
49
|
+
#### `@mui/x-data-grid-pro@6.19.9` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
50
|
+
|
|
51
|
+
Same changes as in `@mui/x-data-grid@6.19.9`.
|
|
52
|
+
|
|
53
|
+
#### `@mui/x-data-grid-premium@6.19.9` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
54
|
+
|
|
55
|
+
Same changes as in `@mui/x-data-grid-pro@6.19.9`.
|
|
56
|
+
|
|
57
|
+
### Date Pickers
|
|
58
|
+
|
|
59
|
+
#### `@mui/x-date-pickers@6.19.9`
|
|
60
|
+
|
|
61
|
+
No changes.
|
|
62
|
+
|
|
63
|
+
#### `@mui/x-date-pickers-pro@6.19.9` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
64
|
+
|
|
65
|
+
- [DateRangePicker] Fix selection behavior with single input field when `readOnly` (#12605) @LukasTy
|
|
66
|
+
|
|
67
|
+
### Docs
|
|
68
|
+
|
|
69
|
+
- [docs] Adds a recipe for the `checkboxSelectionVisibleOnly` prop (#12667) @michelengelen
|
|
70
|
+
- [docs] Explain the use of `_action: 'delete'` in `processRowUpdate` (#12673) @michelengelen
|
|
71
|
+
|
|
72
|
+
### Core
|
|
73
|
+
|
|
74
|
+
- [core] Use Circle CI context (#12607) @cherniavskii
|
|
75
|
+
|
|
6
76
|
## 6.19.8
|
|
7
77
|
|
|
8
78
|
_Mar 20, 2024_
|
package/DataGrid/DataGrid.js
CHANGED
|
@@ -502,12 +502,6 @@ DataGridRaw.propTypes = {
|
|
|
502
502
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
503
503
|
*/
|
|
504
504
|
onRowDoubleClick: PropTypes.func,
|
|
505
|
-
/**
|
|
506
|
-
* Callback fired when the row changes are committed.
|
|
507
|
-
* @param {GridRowId} id The row id.
|
|
508
|
-
* @param {MuiEvent<MuiBaseEvent>} event The event that caused this prop to be called.
|
|
509
|
-
*/
|
|
510
|
-
onRowEditCommit: PropTypes.func,
|
|
511
505
|
/**
|
|
512
506
|
* Callback fired when the row turns to edit mode.
|
|
513
507
|
* @param {GridRowParams} params With all properties from [[GridRowParams]].
|
|
@@ -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
|
|
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
|
-
|
|
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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
|
11
|
+
return escapedValue;
|
|
11
12
|
}
|
|
12
13
|
return value;
|
|
13
14
|
}
|
package/index.js
CHANGED
|
@@ -504,12 +504,6 @@ DataGridRaw.propTypes = {
|
|
|
504
504
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
505
505
|
*/
|
|
506
506
|
onRowDoubleClick: PropTypes.func,
|
|
507
|
-
/**
|
|
508
|
-
* Callback fired when the row changes are committed.
|
|
509
|
-
* @param {GridRowId} id The row id.
|
|
510
|
-
* @param {MuiEvent<MuiBaseEvent>} event The event that caused this prop to be called.
|
|
511
|
-
*/
|
|
512
|
-
onRowEditCommit: PropTypes.func,
|
|
513
507
|
/**
|
|
514
508
|
* Callback fired when the row turns to edit mode.
|
|
515
509
|
* @param {GridRowParams} params With all properties from [[GridRowParams]].
|
|
@@ -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
|
|
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
|
-
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
|
15
|
+
return escapedValue;
|
|
15
16
|
}
|
|
16
17
|
return value;
|
|
17
18
|
}
|
package/legacy/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import type { GridSortModel } from '../gridSortModel';
|
|
|
7
7
|
import type { GridRowSelectionModel } from '../gridRowSelectionModel';
|
|
8
8
|
import type { ElementSize } from '../elementSize';
|
|
9
9
|
import type { MuiBaseEvent } from '../muiEvent';
|
|
10
|
-
import type { GridGroupNode
|
|
10
|
+
import type { GridGroupNode } from '../gridRows';
|
|
11
11
|
import type { GridColumnVisibilityModel } from '../../hooks/features/columns';
|
|
12
12
|
import type { GridStrategyProcessorName } from '../../hooks/core/strategyProcessing';
|
|
13
13
|
import { GridRowEditStartParams, GridRowEditStopParams } from '../params/gridRowParams';
|
|
@@ -531,13 +531,6 @@ export interface GridEventLookup extends GridRowEventLookup, GridColumnHeaderEve
|
|
|
531
531
|
params: GridRowEditStopParams;
|
|
532
532
|
event: MuiBaseEvent;
|
|
533
533
|
};
|
|
534
|
-
/**
|
|
535
|
-
* Fired when the props of the edit input are committed.
|
|
536
|
-
*/
|
|
537
|
-
rowEditCommit: {
|
|
538
|
-
params: GridRowId;
|
|
539
|
-
event: MuiBaseEvent;
|
|
540
|
-
};
|
|
541
534
|
/**
|
|
542
535
|
* Fired when a cell gains focus.
|
|
543
536
|
* @ignore - do not document.
|
|
@@ -447,12 +447,6 @@ export interface DataGridPropsWithoutDefaultValue<R extends GridValidRowModel =
|
|
|
447
447
|
* @param {MuiEvent<MuiBaseEvent>} event The event that caused this prop to be called.
|
|
448
448
|
*/
|
|
449
449
|
onCellEditStop?: GridEventListener<'cellEditStop'>;
|
|
450
|
-
/**
|
|
451
|
-
* Callback fired when the row changes are committed.
|
|
452
|
-
* @param {GridRowId} id The row id.
|
|
453
|
-
* @param {MuiEvent<MuiBaseEvent>} event The event that caused this prop to be called.
|
|
454
|
-
*/
|
|
455
|
-
onRowEditCommit?: GridEventListener<'rowEditCommit'>;
|
|
456
450
|
/**
|
|
457
451
|
* Callback fired when the row turns to edit mode.
|
|
458
452
|
* @param {GridRowParams} params With all properties from [[GridRowParams]].
|
|
@@ -502,12 +502,6 @@ DataGridRaw.propTypes = {
|
|
|
502
502
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
503
503
|
*/
|
|
504
504
|
onRowDoubleClick: PropTypes.func,
|
|
505
|
-
/**
|
|
506
|
-
* Callback fired when the row changes are committed.
|
|
507
|
-
* @param {GridRowId} id The row id.
|
|
508
|
-
* @param {MuiEvent<MuiBaseEvent>} event The event that caused this prop to be called.
|
|
509
|
-
*/
|
|
510
|
-
onRowEditCommit: PropTypes.func,
|
|
511
505
|
/**
|
|
512
506
|
* Callback fired when the row turns to edit mode.
|
|
513
507
|
* @param {GridRowParams} params With all properties from [[GridRowParams]].
|
|
@@ -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
|
|
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
|
|
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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
|
11
|
+
return escapedValue;
|
|
11
12
|
}
|
|
12
13
|
return value;
|
|
13
14
|
}
|
package/modern/index.js
CHANGED
|
@@ -510,12 +510,6 @@ DataGridRaw.propTypes = {
|
|
|
510
510
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
511
511
|
*/
|
|
512
512
|
onRowDoubleClick: _propTypes.default.func,
|
|
513
|
-
/**
|
|
514
|
-
* Callback fired when the row changes are committed.
|
|
515
|
-
* @param {GridRowId} id The row id.
|
|
516
|
-
* @param {MuiEvent<MuiBaseEvent>} event The event that caused this prop to be called.
|
|
517
|
-
*/
|
|
518
|
-
onRowEditCommit: _propTypes.default.func,
|
|
519
513
|
/**
|
|
520
514
|
* Callback fired when the row turns to edit mode.
|
|
521
515
|
* @param {GridRowParams} params With all properties from [[GridRowParams]].
|
|
@@ -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
|
|
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
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
|
18
|
+
return escapedValue;
|
|
18
19
|
}
|
|
19
20
|
return value;
|
|
20
21
|
}
|
package/node/index.js
CHANGED