@mui/x-data-grid 5.17.10 → 5.17.11
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 +29 -0
- package/DataGrid/useDataGridProps.js +3 -1
- package/components/cell/GridActionsCell.js +3 -1
- package/components/cell/GridCell.js +1 -1
- package/components/columnSelection/GridCellCheckboxRenderer.js +4 -2
- package/index.js +1 -1
- package/legacy/DataGrid/useDataGridProps.js +3 -1
- package/legacy/components/cell/GridActionsCell.js +3 -1
- package/legacy/components/cell/GridCell.js +1 -1
- package/legacy/components/columnSelection/GridCellCheckboxRenderer.js +4 -2
- package/legacy/index.js +1 -1
- package/models/props/DataGridProps.d.ts +7 -1
- package/modern/DataGrid/useDataGridProps.js +3 -1
- package/modern/components/cell/GridActionsCell.js +3 -1
- package/modern/components/cell/GridCell.js +1 -1
- package/modern/components/columnSelection/GridCellCheckboxRenderer.js +4 -2
- package/modern/index.js +1 -1
- package/node/DataGrid/useDataGridProps.js +3 -1
- package/node/components/cell/GridActionsCell.js +3 -1
- package/node/components/cell/GridCell.js +1 -1
- package/node/components/columnSelection/GridCellCheckboxRenderer.js +4 -2
- package/node/index.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,35 @@
|
|
|
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
|
+
## 5.17.11
|
|
7
|
+
|
|
8
|
+
_Nov 10, 2022_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 5 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🐞 Bugfixes
|
|
13
|
+
|
|
14
|
+
### `@mui/x-data-grid@v5.17.11` / `@mui/x-data-grid-pro@v5.17.11` / `@mui/x-data-grid-premium@v5.17.11`
|
|
15
|
+
|
|
16
|
+
#### Changes
|
|
17
|
+
|
|
18
|
+
- [DataGrid] Fix for cell focus preventing scroll when virtualization enabled (#6622) @yaredtsy
|
|
19
|
+
- [DataGridPro] Opt-out for column jump back on re-order (#6697) @gavbrennan
|
|
20
|
+
|
|
21
|
+
### `@mui/x-date-pickers@v5.0.8` / `@mui/x-date-pickers-pro@v5.0.8`
|
|
22
|
+
|
|
23
|
+
#### Changes
|
|
24
|
+
|
|
25
|
+
- [pickers] Fix pickers toolbar styling (#6793) @LukasTy
|
|
26
|
+
|
|
27
|
+
### Docs
|
|
28
|
+
|
|
29
|
+
- [docs] Fix link to localization page (#6766) @alexfauquette
|
|
30
|
+
|
|
31
|
+
### Core
|
|
32
|
+
|
|
33
|
+
- [license] Add new license status 'Out of scope' (#6774) @oliviertassinari
|
|
34
|
+
|
|
6
35
|
## 5.17.10
|
|
7
36
|
|
|
8
37
|
_Nov 4, 2022_
|
|
@@ -14,6 +14,7 @@ const DATA_GRID_FORCED_PROPS = {
|
|
|
14
14
|
checkboxSelectionVisibleOnly: false,
|
|
15
15
|
disableColumnReorder: true,
|
|
16
16
|
disableColumnResize: true,
|
|
17
|
+
keepColumnPositionIfDraggedOutside: false,
|
|
17
18
|
signature: 'DataGrid'
|
|
18
19
|
};
|
|
19
20
|
export const MAX_PAGE_SIZE = 100;
|
|
@@ -63,7 +64,8 @@ export const DATA_GRID_PROPS_DEFAULT_VALUES = {
|
|
|
63
64
|
throttleRowsMs: 0,
|
|
64
65
|
disableColumnReorder: false,
|
|
65
66
|
disableColumnResize: false,
|
|
66
|
-
keepNonExistentRowsSelected: false
|
|
67
|
+
keepNonExistentRowsSelected: false,
|
|
68
|
+
keepColumnPositionIfDraggedOutside: false
|
|
67
69
|
};
|
|
68
70
|
export const useDataGridProps = inProps => {
|
|
69
71
|
if (inProps.pageSize > MAX_PAGE_SIZE) {
|
|
@@ -131,7 +131,7 @@ function GridCell(props) {
|
|
|
131
131
|
maxHeight: height === 'auto' ? 'none' : height // max-height doesn't support "auto"
|
|
132
132
|
|
|
133
133
|
};
|
|
134
|
-
React.
|
|
134
|
+
React.useEffect(() => {
|
|
135
135
|
if (!hasFocus || cellMode === GridCellModes.Edit) {
|
|
136
136
|
return;
|
|
137
137
|
}
|
|
@@ -58,12 +58,14 @@ const GridCellCheckboxForwardRef = /*#__PURE__*/React.forwardRef(function GridCe
|
|
|
58
58
|
element.tabIndex = -1;
|
|
59
59
|
}
|
|
60
60
|
}, [element, tabIndex]);
|
|
61
|
-
React.
|
|
61
|
+
React.useEffect(() => {
|
|
62
62
|
if (hasFocus) {
|
|
63
63
|
var _checkboxElement$curr;
|
|
64
64
|
|
|
65
65
|
const input = (_checkboxElement$curr = checkboxElement.current) == null ? void 0 : _checkboxElement$curr.querySelector('input');
|
|
66
|
-
input == null ? void 0 : input.focus(
|
|
66
|
+
input == null ? void 0 : input.focus({
|
|
67
|
+
preventScroll: true
|
|
68
|
+
});
|
|
67
69
|
} else if (rippleRef.current) {
|
|
68
70
|
// Only available in @mui/material v5.4.1 or later
|
|
69
71
|
rippleRef.current.stop({});
|
package/index.js
CHANGED
|
@@ -15,6 +15,7 @@ var DATA_GRID_FORCED_PROPS = {
|
|
|
15
15
|
checkboxSelectionVisibleOnly: false,
|
|
16
16
|
disableColumnReorder: true,
|
|
17
17
|
disableColumnResize: true,
|
|
18
|
+
keepColumnPositionIfDraggedOutside: false,
|
|
18
19
|
signature: 'DataGrid'
|
|
19
20
|
};
|
|
20
21
|
export var MAX_PAGE_SIZE = 100;
|
|
@@ -64,7 +65,8 @@ export var DATA_GRID_PROPS_DEFAULT_VALUES = {
|
|
|
64
65
|
throttleRowsMs: 0,
|
|
65
66
|
disableColumnReorder: false,
|
|
66
67
|
disableColumnResize: false,
|
|
67
|
-
keepNonExistentRowsSelected: false
|
|
68
|
+
keepNonExistentRowsSelected: false,
|
|
69
|
+
keepColumnPositionIfDraggedOutside: false
|
|
68
70
|
};
|
|
69
71
|
export var useDataGridProps = function useDataGridProps(inProps) {
|
|
70
72
|
if (inProps.pageSize > MAX_PAGE_SIZE) {
|
|
@@ -78,7 +78,9 @@ var GridActionsCell = function GridActionsCell(props) {
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
var child = rootRef.current.children[focusedButtonIndex];
|
|
81
|
-
child.focus(
|
|
81
|
+
child.focus({
|
|
82
|
+
preventScroll: true
|
|
83
|
+
});
|
|
82
84
|
}, [focusedButtonIndex]);
|
|
83
85
|
React.useEffect(function () {
|
|
84
86
|
if (!hasFocus) {
|
|
@@ -136,7 +136,7 @@ function GridCell(props) {
|
|
|
136
136
|
maxHeight: height === 'auto' ? 'none' : height // max-height doesn't support "auto"
|
|
137
137
|
|
|
138
138
|
};
|
|
139
|
-
React.
|
|
139
|
+
React.useEffect(function () {
|
|
140
140
|
if (!hasFocus || cellMode === GridCellModes.Edit) {
|
|
141
141
|
return;
|
|
142
142
|
}
|
|
@@ -61,12 +61,14 @@ var GridCellCheckboxForwardRef = /*#__PURE__*/React.forwardRef(function GridCell
|
|
|
61
61
|
element.tabIndex = -1;
|
|
62
62
|
}
|
|
63
63
|
}, [element, tabIndex]);
|
|
64
|
-
React.
|
|
64
|
+
React.useEffect(function () {
|
|
65
65
|
if (hasFocus) {
|
|
66
66
|
var _checkboxElement$curr;
|
|
67
67
|
|
|
68
68
|
var input = (_checkboxElement$curr = checkboxElement.current) == null ? void 0 : _checkboxElement$curr.querySelector('input');
|
|
69
|
-
input == null ? void 0 : input.focus(
|
|
69
|
+
input == null ? void 0 : input.focus({
|
|
70
|
+
preventScroll: true
|
|
71
|
+
});
|
|
70
72
|
} else if (rippleRef.current) {
|
|
71
73
|
// Only available in @mui/material v5.4.1 or later
|
|
72
74
|
rippleRef.current.stop({});
|
package/legacy/index.js
CHANGED
|
@@ -58,7 +58,7 @@ export interface DataGridProcessedProps<R extends GridValidRowModel = any> exten
|
|
|
58
58
|
* The props of the `DataGrid` component after the pre-processing phase that the user should not be able to override.
|
|
59
59
|
* Those are usually used in feature-hook for which the pro-plan has more advanced features (eg: multi-sorting, multi-filtering, ...).
|
|
60
60
|
*/
|
|
61
|
-
export declare type DataGridForcedPropsKey = 'apiRef' | 'checkboxSelectionVisibleOnly' | 'disableMultipleColumnsFiltering' | 'disableMultipleColumnsSorting' | 'disableMultipleSelection' | 'disableColumnReorder' | 'disableColumnResize' | 'throttleRowsMs' | 'hideFooterRowCount' | 'pagination' | 'signature';
|
|
61
|
+
export declare type DataGridForcedPropsKey = 'apiRef' | 'checkboxSelectionVisibleOnly' | 'disableMultipleColumnsFiltering' | 'disableMultipleColumnsSorting' | 'disableMultipleSelection' | 'disableColumnReorder' | 'disableColumnResize' | 'keepColumnPositionIfDraggedOutside' | 'throttleRowsMs' | 'hideFooterRowCount' | 'pagination' | 'signature';
|
|
62
62
|
/**
|
|
63
63
|
* The `DataGrid` options with a default value that must be merged with the value given through props.
|
|
64
64
|
*/
|
|
@@ -307,6 +307,12 @@ export interface DataGridPropsWithDefaultValues {
|
|
|
307
307
|
* @default false
|
|
308
308
|
*/
|
|
309
309
|
disableColumnResize: boolean;
|
|
310
|
+
/**
|
|
311
|
+
* If `true`, moving the mouse pointer outside the grid before releasing the mouse button
|
|
312
|
+
* in a column re-order action will not cause the column to jump back to its original position.
|
|
313
|
+
* @default false
|
|
314
|
+
*/
|
|
315
|
+
keepColumnPositionIfDraggedOutside: boolean;
|
|
310
316
|
}
|
|
311
317
|
/**
|
|
312
318
|
* The `DataGrid` props with no default value.
|
|
@@ -14,6 +14,7 @@ const DATA_GRID_FORCED_PROPS = {
|
|
|
14
14
|
checkboxSelectionVisibleOnly: false,
|
|
15
15
|
disableColumnReorder: true,
|
|
16
16
|
disableColumnResize: true,
|
|
17
|
+
keepColumnPositionIfDraggedOutside: false,
|
|
17
18
|
signature: 'DataGrid'
|
|
18
19
|
};
|
|
19
20
|
export const MAX_PAGE_SIZE = 100;
|
|
@@ -63,7 +64,8 @@ export const DATA_GRID_PROPS_DEFAULT_VALUES = {
|
|
|
63
64
|
throttleRowsMs: 0,
|
|
64
65
|
disableColumnReorder: false,
|
|
65
66
|
disableColumnResize: false,
|
|
66
|
-
keepNonExistentRowsSelected: false
|
|
67
|
+
keepNonExistentRowsSelected: false,
|
|
68
|
+
keepColumnPositionIfDraggedOutside: false
|
|
67
69
|
};
|
|
68
70
|
export const useDataGridProps = inProps => {
|
|
69
71
|
if (inProps.pageSize > MAX_PAGE_SIZE) {
|
|
@@ -129,7 +129,7 @@ function GridCell(props) {
|
|
|
129
129
|
maxHeight: height === 'auto' ? 'none' : height // max-height doesn't support "auto"
|
|
130
130
|
|
|
131
131
|
};
|
|
132
|
-
React.
|
|
132
|
+
React.useEffect(() => {
|
|
133
133
|
if (!hasFocus || cellMode === GridCellModes.Edit) {
|
|
134
134
|
return;
|
|
135
135
|
}
|
|
@@ -56,10 +56,12 @@ const GridCellCheckboxForwardRef = /*#__PURE__*/React.forwardRef(function GridCe
|
|
|
56
56
|
element.tabIndex = -1;
|
|
57
57
|
}
|
|
58
58
|
}, [element, tabIndex]);
|
|
59
|
-
React.
|
|
59
|
+
React.useEffect(() => {
|
|
60
60
|
if (hasFocus) {
|
|
61
61
|
const input = checkboxElement.current?.querySelector('input');
|
|
62
|
-
input?.focus(
|
|
62
|
+
input?.focus({
|
|
63
|
+
preventScroll: true
|
|
64
|
+
});
|
|
63
65
|
} else if (rippleRef.current) {
|
|
64
66
|
// Only available in @mui/material v5.4.1 or later
|
|
65
67
|
rippleRef.current.stop({});
|
package/modern/index.js
CHANGED
|
@@ -32,6 +32,7 @@ const DATA_GRID_FORCED_PROPS = {
|
|
|
32
32
|
checkboxSelectionVisibleOnly: false,
|
|
33
33
|
disableColumnReorder: true,
|
|
34
34
|
disableColumnResize: true,
|
|
35
|
+
keepColumnPositionIfDraggedOutside: false,
|
|
35
36
|
signature: 'DataGrid'
|
|
36
37
|
};
|
|
37
38
|
const MAX_PAGE_SIZE = 100;
|
|
@@ -82,7 +83,8 @@ const DATA_GRID_PROPS_DEFAULT_VALUES = {
|
|
|
82
83
|
throttleRowsMs: 0,
|
|
83
84
|
disableColumnReorder: false,
|
|
84
85
|
disableColumnResize: false,
|
|
85
|
-
keepNonExistentRowsSelected: false
|
|
86
|
+
keepNonExistentRowsSelected: false,
|
|
87
|
+
keepColumnPositionIfDraggedOutside: false
|
|
86
88
|
};
|
|
87
89
|
exports.DATA_GRID_PROPS_DEFAULT_VALUES = DATA_GRID_PROPS_DEFAULT_VALUES;
|
|
88
90
|
|
|
@@ -155,7 +155,7 @@ function GridCell(props) {
|
|
|
155
155
|
maxHeight: height === 'auto' ? 'none' : height // max-height doesn't support "auto"
|
|
156
156
|
|
|
157
157
|
};
|
|
158
|
-
React.
|
|
158
|
+
React.useEffect(() => {
|
|
159
159
|
if (!hasFocus || cellMode === _models.GridCellModes.Edit) {
|
|
160
160
|
return;
|
|
161
161
|
}
|
|
@@ -81,12 +81,14 @@ const GridCellCheckboxForwardRef = /*#__PURE__*/React.forwardRef(function GridCe
|
|
|
81
81
|
element.tabIndex = -1;
|
|
82
82
|
}
|
|
83
83
|
}, [element, tabIndex]);
|
|
84
|
-
React.
|
|
84
|
+
React.useEffect(() => {
|
|
85
85
|
if (hasFocus) {
|
|
86
86
|
var _checkboxElement$curr;
|
|
87
87
|
|
|
88
88
|
const input = (_checkboxElement$curr = checkboxElement.current) == null ? void 0 : _checkboxElement$curr.querySelector('input');
|
|
89
|
-
input == null ? void 0 : input.focus(
|
|
89
|
+
input == null ? void 0 : input.focus({
|
|
90
|
+
preventScroll: true
|
|
91
|
+
});
|
|
90
92
|
} else if (rippleRef.current) {
|
|
91
93
|
// Only available in @mui/material v5.4.1 or later
|
|
92
94
|
rippleRef.current.stop({});
|
package/node/index.js
CHANGED