@mui/x-data-grid 8.11.0 → 8.11.2
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 +169 -0
- package/DataGrid/DataGrid.js +5 -0
- package/components/cell/GridCell.js +1 -1
- package/components/columnSelection/GridHeaderCheckbox.js +2 -2
- package/components/columnsManagement/GridColumnsManagement.js +1 -1
- package/constants/dataGridPropsDefaultValues.js +1 -0
- package/esm/DataGrid/DataGrid.js +5 -0
- package/esm/components/cell/GridCell.js +1 -1
- package/esm/components/columnSelection/GridHeaderCheckbox.js +2 -2
- package/esm/components/columnsManagement/GridColumnsManagement.js +1 -1
- package/esm/constants/dataGridPropsDefaultValues.js +1 -0
- package/esm/hooks/features/rowSelection/useGridRowSelection.d.ts +1 -1
- package/esm/hooks/features/rowSelection/useGridRowSelection.js +2 -2
- package/esm/index.js +1 -1
- package/esm/material/variables.js +29 -2
- package/esm/models/props/DataGridProps.d.ts +5 -0
- package/hooks/features/rowSelection/useGridRowSelection.d.ts +1 -1
- package/hooks/features/rowSelection/useGridRowSelection.js +2 -2
- package/index.js +1 -1
- package/material/variables.js +28 -1
- package/models/props/DataGridProps.d.ts +5 -0
- package/package.json +13 -13
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,175 @@
|
|
|
5
5
|
All notable changes to this project will be documented in this file.
|
|
6
6
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
7
7
|
|
|
8
|
+
## 8.11.2
|
|
9
|
+
|
|
10
|
+
_Sep 10, 2025_
|
|
11
|
+
|
|
12
|
+
We'd like to extend a big thank you to the 13 contributors who made this release possible. Here are some highlights ✨:
|
|
13
|
+
|
|
14
|
+
- 🐞 Bugfixes
|
|
15
|
+
- 📚 Documentation improvements
|
|
16
|
+
|
|
17
|
+
Special thanks go out to the community members for their valuable contributions:
|
|
18
|
+
@ludvigeriksson, @sai6855
|
|
19
|
+
|
|
20
|
+
The following are all team members who have contributed to this release:
|
|
21
|
+
@alexfauquette, @bernardobelchior, @brijeshb42, @flaviendelangle, @Janpot, @LukasTy, @MBilalShafi, @noraleonte, @rita-codes, @romgrk, @siriwatknp
|
|
22
|
+
|
|
23
|
+
### Data Grid
|
|
24
|
+
|
|
25
|
+
#### `@mui/x-data-grid@8.11.2`
|
|
26
|
+
|
|
27
|
+
- [DataGrid] Allow opting out of the exclude row selection model (#19423) @MBilalShafi
|
|
28
|
+
- [DataGrid] Fix column dropdown menu text alignment for the "Unpin" menu item (#19462) @MBilalShafi
|
|
29
|
+
- [DataGrid] Fix indeterminate state for "Select all" checkbox with exclude model (#19466) @MBilalShafi
|
|
30
|
+
- [DataGrid] Fix styled API arguments error (#19460) @MBilalShafi
|
|
31
|
+
- [DataGrid] Fix `stringify()` for theme objects (#19427) @romgrk
|
|
32
|
+
|
|
33
|
+
#### `@mui/x-data-grid-pro@8.11.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
34
|
+
|
|
35
|
+
Same changes as in `@mui/x-data-grid@8.11.2`.
|
|
36
|
+
|
|
37
|
+
#### `@mui/x-data-grid-premium@8.11.2` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
38
|
+
|
|
39
|
+
Same changes as in `@mui/x-data-grid-pro@8.11.2`, plus:
|
|
40
|
+
|
|
41
|
+
- [DataGridPremium] Fallback to the regular reorder method for plain data (#19467) @MBilalShafi
|
|
42
|
+
- [DataGridPremium] Fix showing `0` as total aggregation value when aggregation position is set to `null` for row groups (#19515) @cherniavskii
|
|
43
|
+
|
|
44
|
+
### Date and Time Pickers
|
|
45
|
+
|
|
46
|
+
#### `@mui/x-date-pickers@8.11.2`
|
|
47
|
+
|
|
48
|
+
- [pickers] Gracefully handle `textField.slotProps` (#18980) @LukasTy
|
|
49
|
+
- [pickers] Improve hour and minute placement in Date Time Picker (#19227) @MBilalShafi
|
|
50
|
+
- [pickers] Use `calendarState.currentMonth` in Month Calendar when available (#19073) @LukasTy
|
|
51
|
+
- [pickers] Improve invalid value pasting into a section (#19357) @sai6855
|
|
52
|
+
- [fields] Remove redundant `id` and `aria-labelledby` attributes from spinbuttons (#19523) @LukasTy
|
|
53
|
+
|
|
54
|
+
#### `@mui/x-date-pickers-pro@8.11.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
55
|
+
|
|
56
|
+
Same changes as in `@mui/x-date-pickers@8.11.2`.
|
|
57
|
+
|
|
58
|
+
### Charts
|
|
59
|
+
|
|
60
|
+
#### `@mui/x-charts@8.11.2`
|
|
61
|
+
|
|
62
|
+
- [charts] Fix highlight regression (#19486) @alexfauquette
|
|
63
|
+
- [charts] Improve code reuse in `ChartsXAxis` and `ChartsYAxis` (#19198) @bernardobelchior
|
|
64
|
+
- [charts] Simplify params in `getRange` and `createDateFormatter` (#19517) @bernardobelchior
|
|
65
|
+
- [charts] Handle domain edge cases with `filterMode: 'discard'` (#19199) @bernardobelchior
|
|
66
|
+
- [l10n] Add Swedish (sv-SE) locale (#19489) @ludvigeriksson
|
|
67
|
+
|
|
68
|
+
#### `@mui/x-charts-pro@8.11.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
69
|
+
|
|
70
|
+
Same changes as in `@mui/x-charts@8.11.2`.
|
|
71
|
+
|
|
72
|
+
### Tree View
|
|
73
|
+
|
|
74
|
+
#### `@mui/x-tree-view@8.11.2`
|
|
75
|
+
|
|
76
|
+
- [TreeView] Do not mutate `props.items` in the `getItemTree()` method (#19483) @flaviendelangle
|
|
77
|
+
- [TreeView] Expose a new hook to apply selection propagation on the selected items (#19402) @flaviendelangle
|
|
78
|
+
|
|
79
|
+
#### `@mui/x-tree-view-pro@8.11.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
80
|
+
|
|
81
|
+
Same changes as in `@mui/x-tree-view@8.11.2`.
|
|
82
|
+
|
|
83
|
+
### Codemod
|
|
84
|
+
|
|
85
|
+
#### `@mui/x-codemod@8.11.2`
|
|
86
|
+
|
|
87
|
+
Internal changes.
|
|
88
|
+
|
|
89
|
+
### Docs
|
|
90
|
+
|
|
91
|
+
- [docs] Add recipe for save and manage filters from the panel (#19361) @siriwatknp
|
|
92
|
+
|
|
93
|
+
### Core
|
|
94
|
+
|
|
95
|
+
- [code-infra] Remove log when restarting dev server (#19490) @bernardobelchior
|
|
96
|
+
- [code-infra] Store test results in CI (#19507) @Janpot
|
|
97
|
+
|
|
98
|
+
### Miscellaneous
|
|
99
|
+
|
|
100
|
+
- [infra] Set nodejs versions of various CIs to 22.18 (#19503) @brijeshb42
|
|
101
|
+
- [test] Split infinitive @romgrk
|
|
102
|
+
|
|
103
|
+
## 8.11.1
|
|
104
|
+
|
|
105
|
+
_Sep 4, 2025_
|
|
106
|
+
|
|
107
|
+
We'd like to extend a big thank you to the 6 contributors who made this release possible. Here are some highlights ✨:
|
|
108
|
+
|
|
109
|
+
Special thanks go out to the community members for their valuable contributions:
|
|
110
|
+
@sai6855
|
|
111
|
+
|
|
112
|
+
The following are all team members who have contributed to this release:
|
|
113
|
+
@brijeshb42, @flaviendelangle, @JCQuintas, @mapache-salvaje, @oliviertassinari
|
|
114
|
+
|
|
115
|
+
### Data Grid
|
|
116
|
+
|
|
117
|
+
#### `@mui/x-data-grid@8.11.1`
|
|
118
|
+
|
|
119
|
+
- [DataGrid] Refine types in `GridCell` component (#19384) @sai6855
|
|
120
|
+
|
|
121
|
+
#### `@mui/x-data-grid-pro@8.11.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
122
|
+
|
|
123
|
+
Same changes as in `@mui/x-data-grid@8.11.1`.
|
|
124
|
+
|
|
125
|
+
#### `@mui/x-data-grid-premium@8.11.1` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
126
|
+
|
|
127
|
+
Same changes as in `@mui/x-data-grid-pro@8.11.1`.
|
|
128
|
+
|
|
129
|
+
### Date and Time Pickers
|
|
130
|
+
|
|
131
|
+
#### `@mui/x-date-pickers@8.11.1`
|
|
132
|
+
|
|
133
|
+
- [pickers] Merge `slotProps` for input adornment in `PickerFieldUI` component (#19399) @sai6855
|
|
134
|
+
|
|
135
|
+
#### `@mui/x-date-pickers-pro@8.11.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
136
|
+
|
|
137
|
+
Same changes as in `@mui/x-date-pickers@8.11.1`.
|
|
138
|
+
|
|
139
|
+
### Charts
|
|
140
|
+
|
|
141
|
+
#### `@mui/x-charts@8.11.1`
|
|
142
|
+
|
|
143
|
+
- [charts] Prevent crash and warn user on incorrect `axisId` when composing (#19397) @JCQuintas
|
|
144
|
+
|
|
145
|
+
#### `@mui/x-charts-pro@8.11.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
146
|
+
|
|
147
|
+
Same changes as in `@mui/x-charts@8.11.1`.
|
|
148
|
+
|
|
149
|
+
### Tree View
|
|
150
|
+
|
|
151
|
+
#### `@mui/x-tree-view@8.11.1`
|
|
152
|
+
|
|
153
|
+
- [tree view] Expose the methods to manually refetch the children of an item (#19248) @flaviendelangle
|
|
154
|
+
- [tree view] Use the shared store implementation instead of the custom one (#19261) @flaviendelangle
|
|
155
|
+
|
|
156
|
+
#### `@mui/x-tree-view-pro@8.11.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
157
|
+
|
|
158
|
+
Same changes as in `@mui/x-tree-view@8.11.1`.
|
|
159
|
+
|
|
160
|
+
### Codemod
|
|
161
|
+
|
|
162
|
+
#### `@mui/x-codemod@8.11.1`
|
|
163
|
+
|
|
164
|
+
Internal changes.
|
|
165
|
+
|
|
166
|
+
### Docs
|
|
167
|
+
|
|
168
|
+
- [docs] Fix grammar and spelling mistakes on the Date and Time Pickers pages (#19300) @mapache-salvaje
|
|
169
|
+
- [docs] Remove wrong legend info (#19383) @JCQuintas
|
|
170
|
+
|
|
171
|
+
### Core
|
|
172
|
+
|
|
173
|
+
- [internal] Fix action alert (#19388) @oliviertassinari
|
|
174
|
+
- [internal] Fix pnpm valelint to have 0 errors @oliviertassinari
|
|
175
|
+
- [infra] Remove "main" fields from publishable packages (#19407) @brijeshb42
|
|
176
|
+
|
|
8
177
|
## 8.11.0
|
|
9
178
|
|
|
10
179
|
_Aug 29, 2025_
|
package/DataGrid/DataGrid.js
CHANGED
|
@@ -226,6 +226,11 @@ DataGridRaw.propTypes = {
|
|
|
226
226
|
* @default false (`!props.checkboxSelection` for MIT Data Grid)
|
|
227
227
|
*/
|
|
228
228
|
disableMultipleRowSelection: _propTypes.default.bool,
|
|
229
|
+
/**
|
|
230
|
+
* If `true`, the Data Grid will not use the exclude model optimization when selecting all rows.
|
|
231
|
+
* @default false
|
|
232
|
+
*/
|
|
233
|
+
disableRowSelectionExcludeModel: _propTypes.default.bool,
|
|
229
234
|
/**
|
|
230
235
|
* If `true`, the selection on click on a row or cell is disabled.
|
|
231
236
|
* @default false
|
|
@@ -132,7 +132,7 @@ const GridCell = (0, _forwardRef.forwardRef)(function GridCell(props, ref) {
|
|
|
132
132
|
isEditable = false,
|
|
133
133
|
value
|
|
134
134
|
} = cellParams;
|
|
135
|
-
const canManageOwnFocus = column.type === 'actions' && column.getActions
|
|
135
|
+
const canManageOwnFocus = column.type === 'actions' && 'getActions' in column && typeof column.getActions === 'function' && column.getActions(apiRef.current.getRowParams(rowId)).some(action => !action.props.disabled);
|
|
136
136
|
const tabIndex = (cellMode === 'view' || !isEditable) && !canManageOwnFocus ? cellParams.tabIndex : -1;
|
|
137
137
|
const {
|
|
138
138
|
classes: rootClasses,
|
|
@@ -107,7 +107,7 @@ const GridHeaderCheckbox = exports.GridHeaderCheckbox = (0, _forwardRef.forwardR
|
|
|
107
107
|
return size;
|
|
108
108
|
}, [filteredSelection, selectionCandidates]);
|
|
109
109
|
const isIndeterminate = React.useMemo(() => {
|
|
110
|
-
if (
|
|
110
|
+
if (currentSelectionSize === 0) {
|
|
111
111
|
return false;
|
|
112
112
|
}
|
|
113
113
|
const selectionManager = (0, _gridRowSelectionManager.createRowSelectionManager)(filteredSelection);
|
|
@@ -117,7 +117,7 @@ const GridHeaderCheckbox = exports.GridHeaderCheckbox = (0, _forwardRef.forwardR
|
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
return false;
|
|
120
|
-
}, [filteredSelection, selectionCandidates]);
|
|
120
|
+
}, [currentSelectionSize, filteredSelection, selectionCandidates]);
|
|
121
121
|
const isChecked = currentSelectionSize > 0;
|
|
122
122
|
const handleChange = event => {
|
|
123
123
|
const params = {
|
|
@@ -31,6 +31,7 @@ const DATA_GRID_PROPS_DEFAULT_VALUES = exports.DATA_GRID_PROPS_DEFAULT_VALUES =
|
|
|
31
31
|
disableMultipleColumnsSorting: false,
|
|
32
32
|
disableMultipleRowSelection: false,
|
|
33
33
|
disableRowSelectionOnClick: false,
|
|
34
|
+
disableRowSelectionExcludeModel: false,
|
|
34
35
|
disableVirtualization: false,
|
|
35
36
|
editMode: _gridEditRowModel.GridEditModes.Cell,
|
|
36
37
|
filterDebounceMs: 150,
|
package/esm/DataGrid/DataGrid.js
CHANGED
|
@@ -219,6 +219,11 @@ DataGridRaw.propTypes = {
|
|
|
219
219
|
* @default false (`!props.checkboxSelection` for MIT Data Grid)
|
|
220
220
|
*/
|
|
221
221
|
disableMultipleRowSelection: PropTypes.bool,
|
|
222
|
+
/**
|
|
223
|
+
* If `true`, the Data Grid will not use the exclude model optimization when selecting all rows.
|
|
224
|
+
* @default false
|
|
225
|
+
*/
|
|
226
|
+
disableRowSelectionExcludeModel: PropTypes.bool,
|
|
222
227
|
/**
|
|
223
228
|
* If `true`, the selection on click on a row or cell is disabled.
|
|
224
229
|
* @default false
|
|
@@ -125,7 +125,7 @@ const GridCell = forwardRef(function GridCell(props, ref) {
|
|
|
125
125
|
isEditable = false,
|
|
126
126
|
value
|
|
127
127
|
} = cellParams;
|
|
128
|
-
const canManageOwnFocus = column.type === 'actions' && column.getActions
|
|
128
|
+
const canManageOwnFocus = column.type === 'actions' && 'getActions' in column && typeof column.getActions === 'function' && column.getActions(apiRef.current.getRowParams(rowId)).some(action => !action.props.disabled);
|
|
129
129
|
const tabIndex = (cellMode === 'view' || !isEditable) && !canManageOwnFocus ? cellParams.tabIndex : -1;
|
|
130
130
|
const {
|
|
131
131
|
classes: rootClasses,
|
|
@@ -100,7 +100,7 @@ const GridHeaderCheckbox = forwardRef(function GridHeaderCheckbox(props, ref) {
|
|
|
100
100
|
return size;
|
|
101
101
|
}, [filteredSelection, selectionCandidates]);
|
|
102
102
|
const isIndeterminate = React.useMemo(() => {
|
|
103
|
-
if (
|
|
103
|
+
if (currentSelectionSize === 0) {
|
|
104
104
|
return false;
|
|
105
105
|
}
|
|
106
106
|
const selectionManager = createRowSelectionManager(filteredSelection);
|
|
@@ -110,7 +110,7 @@ const GridHeaderCheckbox = forwardRef(function GridHeaderCheckbox(props, ref) {
|
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
return false;
|
|
113
|
-
}, [filteredSelection, selectionCandidates]);
|
|
113
|
+
}, [currentSelectionSize, filteredSelection, selectionCandidates]);
|
|
114
114
|
const isChecked = currentSelectionSize > 0;
|
|
115
115
|
const handleChange = event => {
|
|
116
116
|
const params = {
|
|
@@ -25,6 +25,7 @@ export const DATA_GRID_PROPS_DEFAULT_VALUES = {
|
|
|
25
25
|
disableMultipleColumnsSorting: false,
|
|
26
26
|
disableMultipleRowSelection: false,
|
|
27
27
|
disableRowSelectionOnClick: false,
|
|
28
|
+
disableRowSelectionExcludeModel: false,
|
|
28
29
|
disableVirtualization: false,
|
|
29
30
|
editMode: GridEditModes.Cell,
|
|
30
31
|
filterDebounceMs: 150,
|
|
@@ -9,4 +9,4 @@ export declare const rowSelectionStateInitializer: GridStateInitializer<Pick<Dat
|
|
|
9
9
|
* @requires useGridFocus (state) - can be after
|
|
10
10
|
* @requires useGridKeyboardNavigation (`cellKeyDown` event must first be consumed by it)
|
|
11
11
|
*/
|
|
12
|
-
export declare const useGridRowSelection: (apiRef: RefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "checkboxSelection" | "rowSelectionModel" | "onRowSelectionModelChange" | "disableMultipleRowSelection" | "disableRowSelectionOnClick" | "isRowSelectable" | "checkboxSelectionVisibleOnly" | "pagination" | "paginationMode" | "filterMode" | "classes" | "keepNonExistentRowsSelected" | "rowSelection" | "rowSelectionPropagation" | "signature">) => void;
|
|
12
|
+
export declare const useGridRowSelection: (apiRef: RefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "checkboxSelection" | "rowSelectionModel" | "onRowSelectionModelChange" | "disableMultipleRowSelection" | "disableRowSelectionOnClick" | "disableRowSelectionExcludeModel" | "isRowSelectable" | "checkboxSelectionVisibleOnly" | "pagination" | "paginationMode" | "filterMode" | "classes" | "keepNonExistentRowsSelected" | "rowSelection" | "rowSelectionPropagation" | "signature">) => void;
|
|
@@ -431,7 +431,7 @@ export const useGridRowSelection = (apiRef, props) => {
|
|
|
431
431
|
const filterModel = gridFilterModelSelector(apiRef);
|
|
432
432
|
const quickFilterModel = gridQuickFilterValuesSelector(apiRef);
|
|
433
433
|
const hasFilters = filterModel.items.length > 0 || quickFilterModel?.some(val => val.length);
|
|
434
|
-
if (!props.isRowSelectable && !props.checkboxSelectionVisibleOnly && (!isNestedData || props.rowSelectionPropagation?.descendants) && !hasFilters) {
|
|
434
|
+
if (!props.isRowSelectable && !props.checkboxSelectionVisibleOnly && (!isNestedData || props.rowSelectionPropagation?.descendants) && !hasFilters && !props.disableRowSelectionExcludeModel) {
|
|
435
435
|
apiRef.current.setRowSelectionModel({
|
|
436
436
|
type: value ? 'exclude' : 'include',
|
|
437
437
|
ids: new Set()
|
|
@@ -439,7 +439,7 @@ export const useGridRowSelection = (apiRef, props) => {
|
|
|
439
439
|
} else {
|
|
440
440
|
apiRef.current.selectRows(getRowsToBeSelected(), value);
|
|
441
441
|
}
|
|
442
|
-
}, [apiRef, getRowsToBeSelected, props.checkboxSelectionVisibleOnly, props.isRowSelectable, props.rowSelectionPropagation?.descendants, isNestedData]);
|
|
442
|
+
}, [apiRef, getRowsToBeSelected, props.checkboxSelectionVisibleOnly, props.isRowSelectable, props.rowSelectionPropagation?.descendants, props.disableRowSelectionExcludeModel, isNestedData]);
|
|
443
443
|
const handleHeaderSelectionCheckboxChange = React.useCallback(params => {
|
|
444
444
|
toggleAllRows(params.value);
|
|
445
445
|
}, [toggleAllRows]);
|
package/esm/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { alpha, darken, lighten } from '@mui/material/styles';
|
|
3
3
|
import { useTheme } from '@mui/material/styles';
|
|
4
|
-
import { hash
|
|
4
|
+
import { hash } from '@mui/x-internals/hash';
|
|
5
5
|
import { vars } from "../constants/cssVariables.js";
|
|
6
6
|
export function useMaterialCSSVariables() {
|
|
7
7
|
const theme = useTheme();
|
|
8
8
|
return React.useMemo(() => {
|
|
9
|
-
const id = hash(
|
|
9
|
+
const id = hash(stringifyTheme(theme));
|
|
10
10
|
const variables = transformTheme(theme);
|
|
11
11
|
return {
|
|
12
12
|
id,
|
|
@@ -98,4 +98,31 @@ function formatFont(font) {
|
|
|
98
98
|
return undefined;
|
|
99
99
|
}
|
|
100
100
|
return `${font.fontWeight} ${font.fontSize} / ${font.lineHeight} ${font.fontFamily}`;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* A version of JSON.stringify for theme objects.
|
|
105
|
+
* Fixes: https://github.com/mui/mui-x/issues/17521
|
|
106
|
+
* Source: https://www.30secondsofcode.org/js/s/stringify-circular-json/
|
|
107
|
+
*/
|
|
108
|
+
function stringifyTheme(input) {
|
|
109
|
+
const seen = new WeakSet();
|
|
110
|
+
return JSON.stringify(input, (_, v) => {
|
|
111
|
+
// https://github.com/mui/mui-x/issues/17855
|
|
112
|
+
if (typeof window !== 'undefined' && v === window || typeof document !== 'undefined' && v === document) {
|
|
113
|
+
return v.toString();
|
|
114
|
+
}
|
|
115
|
+
if (v !== null && typeof v === 'object') {
|
|
116
|
+
// Do not attempt to serialize React elements due to performance concerns.
|
|
117
|
+
// Fixes https://github.com/mui/mui-x/issues/19414
|
|
118
|
+
if (/*#__PURE__*/React.isValidElement(v)) {
|
|
119
|
+
return null;
|
|
120
|
+
}
|
|
121
|
+
if (seen.has(v)) {
|
|
122
|
+
return null;
|
|
123
|
+
}
|
|
124
|
+
seen.add(v);
|
|
125
|
+
}
|
|
126
|
+
return v;
|
|
127
|
+
});
|
|
101
128
|
}
|
|
@@ -175,6 +175,11 @@ export interface DataGridPropsWithDefaultValues<R extends GridValidRowModel = an
|
|
|
175
175
|
* @default false
|
|
176
176
|
*/
|
|
177
177
|
disableRowSelectionOnClick: boolean;
|
|
178
|
+
/**
|
|
179
|
+
* If `true`, the Data Grid will not use the exclude model optimization when selecting all rows.
|
|
180
|
+
* @default false
|
|
181
|
+
*/
|
|
182
|
+
disableRowSelectionExcludeModel: boolean;
|
|
178
183
|
/**
|
|
179
184
|
* If `true`, the virtualization is disabled.
|
|
180
185
|
* @default false
|
|
@@ -9,4 +9,4 @@ export declare const rowSelectionStateInitializer: GridStateInitializer<Pick<Dat
|
|
|
9
9
|
* @requires useGridFocus (state) - can be after
|
|
10
10
|
* @requires useGridKeyboardNavigation (`cellKeyDown` event must first be consumed by it)
|
|
11
11
|
*/
|
|
12
|
-
export declare const useGridRowSelection: (apiRef: RefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "checkboxSelection" | "rowSelectionModel" | "onRowSelectionModelChange" | "disableMultipleRowSelection" | "disableRowSelectionOnClick" | "isRowSelectable" | "checkboxSelectionVisibleOnly" | "pagination" | "paginationMode" | "filterMode" | "classes" | "keepNonExistentRowsSelected" | "rowSelection" | "rowSelectionPropagation" | "signature">) => void;
|
|
12
|
+
export declare const useGridRowSelection: (apiRef: RefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "checkboxSelection" | "rowSelectionModel" | "onRowSelectionModelChange" | "disableMultipleRowSelection" | "disableRowSelectionOnClick" | "disableRowSelectionExcludeModel" | "isRowSelectable" | "checkboxSelectionVisibleOnly" | "pagination" | "paginationMode" | "filterMode" | "classes" | "keepNonExistentRowsSelected" | "rowSelection" | "rowSelectionPropagation" | "signature">) => void;
|
|
@@ -439,7 +439,7 @@ const useGridRowSelection = (apiRef, props) => {
|
|
|
439
439
|
const filterModel = (0, _gridFilterSelector.gridFilterModelSelector)(apiRef);
|
|
440
440
|
const quickFilterModel = (0, _gridFilterSelector.gridQuickFilterValuesSelector)(apiRef);
|
|
441
441
|
const hasFilters = filterModel.items.length > 0 || quickFilterModel?.some(val => val.length);
|
|
442
|
-
if (!props.isRowSelectable && !props.checkboxSelectionVisibleOnly && (!isNestedData || props.rowSelectionPropagation?.descendants) && !hasFilters) {
|
|
442
|
+
if (!props.isRowSelectable && !props.checkboxSelectionVisibleOnly && (!isNestedData || props.rowSelectionPropagation?.descendants) && !hasFilters && !props.disableRowSelectionExcludeModel) {
|
|
443
443
|
apiRef.current.setRowSelectionModel({
|
|
444
444
|
type: value ? 'exclude' : 'include',
|
|
445
445
|
ids: new Set()
|
|
@@ -447,7 +447,7 @@ const useGridRowSelection = (apiRef, props) => {
|
|
|
447
447
|
} else {
|
|
448
448
|
apiRef.current.selectRows(getRowsToBeSelected(), value);
|
|
449
449
|
}
|
|
450
|
-
}, [apiRef, getRowsToBeSelected, props.checkboxSelectionVisibleOnly, props.isRowSelectable, props.rowSelectionPropagation?.descendants, isNestedData]);
|
|
450
|
+
}, [apiRef, getRowsToBeSelected, props.checkboxSelectionVisibleOnly, props.isRowSelectable, props.rowSelectionPropagation?.descendants, props.disableRowSelectionExcludeModel, isNestedData]);
|
|
451
451
|
const handleHeaderSelectionCheckboxChange = React.useCallback(params => {
|
|
452
452
|
toggleAllRows(params.value);
|
|
453
453
|
}, [toggleAllRows]);
|
package/index.js
CHANGED
package/material/variables.js
CHANGED
|
@@ -12,7 +12,7 @@ var _cssVariables = require("../constants/cssVariables");
|
|
|
12
12
|
function useMaterialCSSVariables() {
|
|
13
13
|
const theme = (0, _styles.useTheme)();
|
|
14
14
|
return React.useMemo(() => {
|
|
15
|
-
const id = (0, _hash.hash)((
|
|
15
|
+
const id = (0, _hash.hash)(stringifyTheme(theme));
|
|
16
16
|
const variables = transformTheme(theme);
|
|
17
17
|
return {
|
|
18
18
|
id,
|
|
@@ -104,4 +104,31 @@ function formatFont(font) {
|
|
|
104
104
|
return undefined;
|
|
105
105
|
}
|
|
106
106
|
return `${font.fontWeight} ${font.fontSize} / ${font.lineHeight} ${font.fontFamily}`;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* A version of JSON.stringify for theme objects.
|
|
111
|
+
* Fixes: https://github.com/mui/mui-x/issues/17521
|
|
112
|
+
* Source: https://www.30secondsofcode.org/js/s/stringify-circular-json/
|
|
113
|
+
*/
|
|
114
|
+
function stringifyTheme(input) {
|
|
115
|
+
const seen = new WeakSet();
|
|
116
|
+
return JSON.stringify(input, (_, v) => {
|
|
117
|
+
// https://github.com/mui/mui-x/issues/17855
|
|
118
|
+
if (typeof window !== 'undefined' && v === window || typeof document !== 'undefined' && v === document) {
|
|
119
|
+
return v.toString();
|
|
120
|
+
}
|
|
121
|
+
if (v !== null && typeof v === 'object') {
|
|
122
|
+
// Do not attempt to serialize React elements due to performance concerns.
|
|
123
|
+
// Fixes https://github.com/mui/mui-x/issues/19414
|
|
124
|
+
if (/*#__PURE__*/React.isValidElement(v)) {
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
127
|
+
if (seen.has(v)) {
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
130
|
+
seen.add(v);
|
|
131
|
+
}
|
|
132
|
+
return v;
|
|
133
|
+
});
|
|
107
134
|
}
|
|
@@ -175,6 +175,11 @@ export interface DataGridPropsWithDefaultValues<R extends GridValidRowModel = an
|
|
|
175
175
|
* @default false
|
|
176
176
|
*/
|
|
177
177
|
disableRowSelectionOnClick: boolean;
|
|
178
|
+
/**
|
|
179
|
+
* If `true`, the Data Grid will not use the exclude model optimization when selecting all rows.
|
|
180
|
+
* @default false
|
|
181
|
+
*/
|
|
182
|
+
disableRowSelectionExcludeModel: boolean;
|
|
178
183
|
/**
|
|
179
184
|
* If `true`, the virtualization is disabled.
|
|
180
185
|
* @default false
|
package/package.json
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-data-grid",
|
|
3
|
-
"version": "8.11.
|
|
3
|
+
"version": "8.11.2",
|
|
4
4
|
"author": "MUI Team",
|
|
5
5
|
"description": "The Community plan edition of the MUI X Data Grid components.",
|
|
6
|
-
"main": "./index.js",
|
|
7
6
|
"license": "MIT",
|
|
8
7
|
"bugs": {
|
|
9
8
|
"url": "https://github.com/mui/mui-x/issues"
|
|
@@ -39,12 +38,12 @@
|
|
|
39
38
|
},
|
|
40
39
|
"dependencies": {
|
|
41
40
|
"@babel/runtime": "^7.28.2",
|
|
42
|
-
"@mui/utils": "^7.3.
|
|
41
|
+
"@mui/utils": "^7.3.2",
|
|
43
42
|
"clsx": "^2.1.1",
|
|
44
43
|
"prop-types": "^15.8.1",
|
|
45
44
|
"use-sync-external-store": "^1.5.0",
|
|
46
|
-
"@mui/x-internals": "8.11.
|
|
47
|
-
"@mui/x-virtualizer": "0.1.
|
|
45
|
+
"@mui/x-internals": "8.11.2",
|
|
46
|
+
"@mui/x-virtualizer": "0.1.6"
|
|
48
47
|
},
|
|
49
48
|
"peerDependencies": {
|
|
50
49
|
"@emotion/react": "^11.9.0",
|
|
@@ -66,27 +65,28 @@
|
|
|
66
65
|
"node": ">=14.0.0"
|
|
67
66
|
},
|
|
68
67
|
"type": "commonjs",
|
|
68
|
+
"main": "./index.js",
|
|
69
69
|
"types": "./index.d.ts",
|
|
70
70
|
"exports": {
|
|
71
71
|
"./package.json": "./package.json",
|
|
72
72
|
".": {
|
|
73
|
-
"import": {
|
|
74
|
-
"types": "./esm/index.d.ts",
|
|
75
|
-
"default": "./esm/index.js"
|
|
76
|
-
},
|
|
77
73
|
"require": {
|
|
78
74
|
"types": "./index.d.ts",
|
|
79
75
|
"default": "./index.js"
|
|
76
|
+
},
|
|
77
|
+
"default": {
|
|
78
|
+
"types": "./esm/index.d.ts",
|
|
79
|
+
"default": "./esm/index.js"
|
|
80
80
|
}
|
|
81
81
|
},
|
|
82
82
|
"./*": {
|
|
83
|
-
"import": {
|
|
84
|
-
"types": "./esm/*/index.d.ts",
|
|
85
|
-
"default": "./esm/*/index.js"
|
|
86
|
-
},
|
|
87
83
|
"require": {
|
|
88
84
|
"types": "./*/index.d.ts",
|
|
89
85
|
"default": "./*/index.js"
|
|
86
|
+
},
|
|
87
|
+
"default": {
|
|
88
|
+
"types": "./esm/*/index.d.ts",
|
|
89
|
+
"default": "./esm/*/index.js"
|
|
90
90
|
}
|
|
91
91
|
},
|
|
92
92
|
"./esm": null
|