@mui/x-data-grid 8.17.0 → 8.19.0
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 +213 -0
- package/DataGrid/useDataGridComponent.js +4 -3
- package/components/GridRow.js +1 -1
- package/components/cell/GridActionsCell.d.ts +9 -0
- package/components/cell/GridActionsCell.js +54 -36
- package/components/cell/GridActionsCellItem.js +0 -4
- package/components/cell/GridBooleanCell.js +0 -10
- package/components/cell/GridCell.js +4 -10
- package/components/columnHeaders/GridColumnHeaderItem.js +2 -2
- package/components/columnSelection/GridCellCheckboxRenderer.js +37 -22
- package/components/containers/GridRootStyles.js +1 -1
- package/components/toolbarV8/Toolbar.js +1 -1
- package/components/virtualization/GridVirtualScrollbar.d.ts +1 -0
- package/components/virtualization/GridVirtualScrollbar.js +13 -8
- package/components/virtualization/GridVirtualScroller.js +2 -1
- package/components/virtualization/GridVirtualScrollerRenderZone.js +1 -1
- package/constants/dataGridPropsDefaultValues.js +2 -1
- package/esm/DataGrid/useDataGridComponent.js +5 -4
- package/esm/components/GridRow.js +1 -1
- package/esm/components/cell/GridActionsCell.d.ts +9 -0
- package/esm/components/cell/GridActionsCell.js +55 -36
- package/esm/components/cell/GridActionsCellItem.js +0 -4
- package/esm/components/cell/GridBooleanCell.js +0 -10
- package/esm/components/cell/GridCell.js +4 -10
- package/esm/components/columnHeaders/GridColumnHeaderItem.js +2 -2
- package/esm/components/columnSelection/GridCellCheckboxRenderer.js +37 -22
- package/esm/components/containers/GridRootStyles.js +1 -1
- package/esm/components/toolbarV8/Toolbar.js +1 -1
- package/esm/components/virtualization/GridVirtualScrollbar.d.ts +1 -0
- package/esm/components/virtualization/GridVirtualScrollbar.js +12 -7
- package/esm/components/virtualization/GridVirtualScroller.js +2 -1
- package/esm/components/virtualization/GridVirtualScrollerRenderZone.js +1 -1
- package/esm/constants/dataGridPropsDefaultValues.js +2 -1
- package/esm/hooks/core/gridPropsSelectors.d.ts +2 -1
- package/esm/hooks/core/gridPropsSelectors.js +3 -0
- package/esm/hooks/core/useGridProps.js +8 -2
- package/esm/hooks/core/useGridVirtualizer.d.ts +80 -6
- package/esm/hooks/core/useGridVirtualizer.js +27 -12
- package/esm/hooks/features/columnGrouping/useGridColumnGrouping.js +6 -1
- package/esm/hooks/features/columnMenu/useGridColumnMenu.js +14 -4
- package/esm/hooks/features/columns/useGridColumnSpanning.js +9 -4
- package/esm/hooks/features/dimensions/useGridDimensions.js +12 -6
- package/esm/hooks/features/export/useGridPrintExport.js +18 -18
- package/esm/hooks/features/filter/useGridFilter.d.ts +1 -1
- package/esm/hooks/features/filter/useGridFilter.js +3 -1
- package/esm/hooks/features/focus/useGridFocus.js +0 -1
- package/esm/hooks/features/keyboardNavigation/useGridKeyboardNavigation.d.ts +1 -1
- package/esm/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +189 -25
- package/esm/hooks/features/pagination/useGridPaginationMeta.js +3 -3
- package/esm/hooks/features/pagination/useGridPaginationModel.js +7 -4
- package/esm/hooks/features/pagination/useGridRowCount.js +31 -15
- package/esm/hooks/features/rowSelection/useGridRowSelection.js +8 -7
- package/esm/hooks/features/rowSelection/utils.d.ts +1 -0
- package/esm/hooks/features/rowSelection/utils.js +17 -4
- package/esm/hooks/features/rows/gridRowSpanningUtils.js +8 -5
- package/esm/hooks/features/rows/useGridParamsApi.js +2 -12
- package/esm/hooks/features/rows/useGridRowSpanning.js +23 -60
- package/esm/hooks/features/scroll/useGridScroll.js +2 -3
- package/esm/hooks/features/sorting/useGridSorting.d.ts +1 -1
- package/esm/hooks/features/sorting/useGridSorting.js +3 -1
- package/esm/hooks/features/virtualization/useGridVirtualization.js +24 -5
- package/esm/hooks/utils/useGridApiRef.d.ts +1 -2
- package/esm/hooks/utils/useGridEvent.js +6 -2
- package/esm/hooks/utils/useRunOncePerLoop.d.ts +4 -1
- package/esm/hooks/utils/useRunOncePerLoop.js +28 -18
- package/esm/index.js +1 -1
- package/esm/models/colDef/gridColDef.d.ts +14 -0
- package/esm/models/events/gridEventLookup.d.ts +5 -0
- package/esm/models/gridStateCommunity.d.ts +1 -1
- package/esm/models/params/gridCellParams.d.ts +0 -10
- package/esm/models/props/DataGridProps.d.ts +13 -6
- package/esm/utils/keyboardUtils.d.ts +1 -8
- package/esm/utils/keyboardUtils.js +0 -7
- package/hooks/core/gridPropsSelectors.d.ts +2 -1
- package/hooks/core/gridPropsSelectors.js +4 -1
- package/hooks/core/useGridProps.js +8 -2
- package/hooks/core/useGridVirtualizer.d.ts +80 -6
- package/hooks/core/useGridVirtualizer.js +26 -11
- package/hooks/features/columnGrouping/useGridColumnGrouping.js +6 -1
- package/hooks/features/columnMenu/useGridColumnMenu.js +14 -4
- package/hooks/features/columns/useGridColumnSpanning.js +9 -4
- package/hooks/features/dimensions/useGridDimensions.js +12 -6
- package/hooks/features/export/useGridPrintExport.js +18 -18
- package/hooks/features/filter/useGridFilter.d.ts +1 -1
- package/hooks/features/filter/useGridFilter.js +3 -1
- package/hooks/features/focus/useGridFocus.js +0 -1
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.d.ts +1 -1
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +189 -25
- package/hooks/features/pagination/useGridPaginationMeta.js +2 -2
- package/hooks/features/pagination/useGridPaginationModel.js +7 -4
- package/hooks/features/pagination/useGridRowCount.js +30 -14
- package/hooks/features/rowSelection/useGridRowSelection.js +8 -7
- package/hooks/features/rowSelection/utils.d.ts +1 -0
- package/hooks/features/rowSelection/utils.js +16 -3
- package/hooks/features/rows/gridRowSpanningUtils.js +8 -5
- package/hooks/features/rows/useGridParamsApi.js +2 -12
- package/hooks/features/rows/useGridRowSpanning.js +23 -60
- package/hooks/features/scroll/useGridScroll.js +2 -3
- package/hooks/features/sorting/useGridSorting.d.ts +1 -1
- package/hooks/features/sorting/useGridSorting.js +3 -1
- package/hooks/features/virtualization/useGridVirtualization.js +24 -5
- package/hooks/utils/useGridApiRef.d.ts +1 -2
- package/hooks/utils/useGridEvent.js +6 -2
- package/hooks/utils/useRunOncePerLoop.d.ts +4 -1
- package/hooks/utils/useRunOncePerLoop.js +27 -18
- package/index.js +1 -1
- package/models/colDef/gridColDef.d.ts +14 -0
- package/models/events/gridEventLookup.d.ts +5 -0
- package/models/gridStateCommunity.d.ts +1 -1
- package/models/params/gridCellParams.d.ts +0 -10
- package/models/props/DataGridProps.d.ts +13 -6
- package/package.json +4 -4
- package/utils/keyboardUtils.d.ts +1 -8
- package/utils/keyboardUtils.js +1 -13
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,219 @@
|
|
|
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.19.0
|
|
9
|
+
|
|
10
|
+
_Nov 20, 2025_
|
|
11
|
+
|
|
12
|
+
We'd like to extend a big thank you to the 15 contributors who made this release possible. Here are some highlights ✨:
|
|
13
|
+
|
|
14
|
+
- 🔎 Add pan on `wheel` to the charts zoom
|
|
15
|
+
- ⌨️ Allow opt-in to [tab navigation](https://mui.com/x/react-data-grid/accessibility/#tab-navigation) inside the Data Grid.
|
|
16
|
+
- ⚙️ New way of defining [action columns](https://mui.com/x/react-data-grid/column-definition/#ActionsWithModalGrid.tsx) in the Data Grid that makes it easier to keep `columns` prop stable.
|
|
17
|
+
- 🐞 Bugfixes
|
|
18
|
+
- 📚 Documentation improvements
|
|
19
|
+
|
|
20
|
+
Special thanks go out to these community members for their valuable contributions:
|
|
21
|
+
@lauri865, @noobyogi0010, @sai6855
|
|
22
|
+
|
|
23
|
+
The following team members contributed to this release:
|
|
24
|
+
@alexfauquette, @arminmeh, @bernardobelchior, @cherniavskii, @flaviendelangle, @Janpot, @JCQuintas, @mj12albert, @noraleonte, @rita-codes, @siriwatknp, @ZeeshanTamboli
|
|
25
|
+
|
|
26
|
+
### Data Grid
|
|
27
|
+
|
|
28
|
+
#### `@mui/x-data-grid@8.19.0`
|
|
29
|
+
|
|
30
|
+
- [DataGrid] Add `tabNavigation` prop to control tab navigation in the grid (#20286) @arminmeh
|
|
31
|
+
- [DataGrid] Allow to focus disabled checkbox cells (#19959) @mj12albert
|
|
32
|
+
- [DataGrid] Alternative actions column definition API (#15041) @cherniavskii
|
|
33
|
+
- [DataGrid] Fix failing tests (#20332) @cherniavskii
|
|
34
|
+
- [DataGrid] Prevent Safari 26 error in the event handler (#20369) @arminmeh
|
|
35
|
+
- [DataGrid] Undeprecate the `autoHeight` prop (#20363) @cherniavskii
|
|
36
|
+
- [DataGrid] Fix print export grid dimensions with dynamic row height and print styles (#19835) @cherniavskii
|
|
37
|
+
|
|
38
|
+
#### `@mui/x-data-grid-pro@8.19.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
39
|
+
|
|
40
|
+
Same changes as in `@mui/x-data-grid@8.19.0`.
|
|
41
|
+
|
|
42
|
+
#### `@mui/x-data-grid-premium@8.19.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
43
|
+
|
|
44
|
+
Same changes as in `@mui/x-data-grid-pro@8.19.0`, plus:
|
|
45
|
+
|
|
46
|
+
- [DataGridPremium] Fix aggregation with sorting (#19892) @lauri865
|
|
47
|
+
- [DataGridPremium] Lock `ExcelJS` version (#20329) @cherniavskii
|
|
48
|
+
|
|
49
|
+
### Date and Time Pickers
|
|
50
|
+
|
|
51
|
+
#### `@mui/x-date-pickers@8.19.0`
|
|
52
|
+
|
|
53
|
+
- [pickers] Do not loose `slotProps.field.slotProps` (#20322) @flaviendelangle
|
|
54
|
+
|
|
55
|
+
#### `@mui/x-date-pickers-pro@8.19.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
56
|
+
|
|
57
|
+
Same changes as in `@mui/x-date-pickers@8.19.0`.
|
|
58
|
+
|
|
59
|
+
### Charts
|
|
60
|
+
|
|
61
|
+
#### `@mui/x-charts@8.19.0`
|
|
62
|
+
|
|
63
|
+
- [charts] Expose `niceDomain` utility (#20250) @bernardobelchior
|
|
64
|
+
- [charts] Fix benchmark regression by downgrading to JSDOM v26 (#20405) @bernardobelchior
|
|
65
|
+
- [charts] Fix Pie Chart keyboard focus highlight (#20358) @JCQuintas
|
|
66
|
+
- [charts] Memoize series selectors (#20326) @JCQuintas
|
|
67
|
+
- [charts] Relax dataset type (#20294) @bernardobelchior
|
|
68
|
+
- [charts] Remove `touch-action: pan-y` when zoom is disabled (#20204) @bernardobelchior
|
|
69
|
+
- [charts] Use `getBBox()` for correct SVG sizes in firefox (#20309) @JCQuintas
|
|
70
|
+
- [charts] Use directly selector from `@mui/x-internals` (#20365) @alexfauquette
|
|
71
|
+
- [charts] Fix unnecessary errors in dev mode (#20380) @JCQuintas
|
|
72
|
+
|
|
73
|
+
#### `@mui/x-charts-pro@8.19.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
74
|
+
|
|
75
|
+
Same changes as in `@mui/x-charts@8.19.0`, plus:
|
|
76
|
+
|
|
77
|
+
- [charts-pro] Add pan on `wheel` to zoom (#19998) @JCQuintas
|
|
78
|
+
- [charts-pro] Fix zoom slider preview having an opaque background in dark mode (#20367) @bernardobelchior
|
|
79
|
+
|
|
80
|
+
#### `@mui/x-charts-premium@8.19.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
81
|
+
|
|
82
|
+
Same changes as in `@mui/x-charts-pro@8.19.0`.
|
|
83
|
+
|
|
84
|
+
### Tree View
|
|
85
|
+
|
|
86
|
+
#### `@mui/x-tree-view@8.19.0`
|
|
87
|
+
|
|
88
|
+
- [tree view] Enable lazy load when children count is not know in tree view (#18680) @noobyogi0010
|
|
89
|
+
- [tree view] Fix unwanted behaviors on the item re-ordering (#20368) @flaviendelangle
|
|
90
|
+
|
|
91
|
+
#### `@mui/x-tree-view-pro@8.19.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
92
|
+
|
|
93
|
+
Same changes as in `@mui/x-tree-view@8.19.0`.
|
|
94
|
+
|
|
95
|
+
### Codemod
|
|
96
|
+
|
|
97
|
+
#### `@mui/x-codemod@8.19.0`
|
|
98
|
+
|
|
99
|
+
Internal changes.
|
|
100
|
+
|
|
101
|
+
### Docs
|
|
102
|
+
|
|
103
|
+
- [docs] Add minimum Typescript version to migration guide (#20320) @siriwatknp
|
|
104
|
+
- [docs] Fix Autosizing documentation (#20348) @siriwatknp
|
|
105
|
+
- [docs] Fix separator opacity in demo (#20293) @sai6855
|
|
106
|
+
- [docs] Replace deprecated `LoadingButton` with `Button` component (#20208) @Janpot
|
|
107
|
+
|
|
108
|
+
### Core
|
|
109
|
+
|
|
110
|
+
- [code-infra] Add new broken links checker (#20120) @Janpot
|
|
111
|
+
- [code-infra] Disable Codspeed pipeline (#20370) @JCQuintas
|
|
112
|
+
- [code-infra] Optimize `checkMaterialVersion` (#20307) @Janpot
|
|
113
|
+
- [code-infra] Use utils from code-infra for changelog and PR creation (#20406) @brijeshb42
|
|
114
|
+
- [docs-infra] Revert `@docsearch/react` (#20313) @Janpot
|
|
115
|
+
|
|
116
|
+
### Miscellaneous
|
|
117
|
+
|
|
118
|
+
- [test] Fix browser tests skipping some projects (#20318) @cherniavskii
|
|
119
|
+
- [test] Update `use-react-version` pnpm script (#20319) @cherniavskii
|
|
120
|
+
|
|
121
|
+
## 8.18.0
|
|
122
|
+
|
|
123
|
+
<!-- generated comparing v8.17.0..master -->
|
|
124
|
+
|
|
125
|
+
_Nov 13, 2025_
|
|
126
|
+
|
|
127
|
+
We'd like to extend a big thank you to the 14 contributors who made this release possible. Here are some highlights ✨:
|
|
128
|
+
|
|
129
|
+
- Add `barLabelPlacement` property to customize the bar label position in bar charts, enabling labels to be placed above bars.
|
|
130
|
+
|
|
131
|
+

|
|
132
|
+
|
|
133
|
+
- Add `source` property to the date/time picker lifecycle and event handler context, enabling clearer differentiation between changes initiated by the picker UI and those from direct field input.
|
|
134
|
+
- 🐞 Bugfixes
|
|
135
|
+
- 📚 Documentation improvements
|
|
136
|
+
|
|
137
|
+
Special thanks go out to these community members for their valuable contributions:
|
|
138
|
+
@htollefsen, @sai6855, @Sigdriv
|
|
139
|
+
|
|
140
|
+
The following team members contributed to this release:
|
|
141
|
+
@arminmeh, @bernardobelchior, @brijeshb42, @cherniavskii, @flaviendelangle, @JCQuintas, @michelengelen, @noraleonte, @prakhargupta1, @rita-codes, @siriwatknp
|
|
142
|
+
|
|
143
|
+
### Data Grid
|
|
144
|
+
|
|
145
|
+
#### `@mui/x-data-grid@8.18.0`
|
|
146
|
+
|
|
147
|
+
- [DataGrid] Allow default event in the column action cell item click event handler (#20272) @arminmeh
|
|
148
|
+
- [DataGrid] Remove unnecessary generic from `useGridApiRef` (#20277) @cherniavskii
|
|
149
|
+
|
|
150
|
+
#### `@mui/x-data-grid-pro@8.18.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
151
|
+
|
|
152
|
+
Same changes as in `@mui/x-data-grid@8.18.0`.
|
|
153
|
+
|
|
154
|
+
#### `@mui/x-data-grid-premium@8.18.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
155
|
+
|
|
156
|
+
Same changes as in `@mui/x-data-grid-pro@8.18.0`, plus:
|
|
157
|
+
|
|
158
|
+
- [DataGridPremium] Return the correct `cellParams` value from the aggregation cells (#20224) @arminmeh
|
|
159
|
+
|
|
160
|
+
### Date and Time Pickers
|
|
161
|
+
|
|
162
|
+
#### `@mui/x-date-pickers@8.18.0`
|
|
163
|
+
|
|
164
|
+
- [pickers] Keep invalid date state consistent (#20040) @michelengelen
|
|
165
|
+
- [pickers] Adds new `source` property to `onChange` and `onAccept` context object (#20234) @michelengelen
|
|
166
|
+
|
|
167
|
+
#### `@mui/x-date-pickers-pro@8.18.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
168
|
+
|
|
169
|
+
Same changes as in `@mui/x-date-pickers@8.18.0`.
|
|
170
|
+
|
|
171
|
+
### Charts
|
|
172
|
+
|
|
173
|
+
#### `@mui/x-charts@8.18.0`
|
|
174
|
+
|
|
175
|
+
- [charts] Add prop for positioning a bar label (#20194) @Sigdriv
|
|
176
|
+
- [charts] Fix applying dark mode styles in `ChartAxisZoomSliderThumb` (#20232) @sai6855
|
|
177
|
+
|
|
178
|
+
#### `@mui/x-charts-pro@8.18.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
179
|
+
|
|
180
|
+
Same changes as in `@mui/x-charts@8.18.0`, plus:
|
|
181
|
+
|
|
182
|
+
- [charts-pro] Allow specifying Content Security Policy nonce on export (#20053) @bernardobelchior
|
|
183
|
+
- [charts-pro] Fix applying dark mode styles to slider (#20220) @sai6855
|
|
184
|
+
- [charts-pro] Sankey should respect node order (#20065) @JCQuintas
|
|
185
|
+
|
|
186
|
+
#### `@mui/x-charts-premium@8.18.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
187
|
+
|
|
188
|
+
Same changes as in `@mui/x-charts-pro@8.18.0`.
|
|
189
|
+
|
|
190
|
+
### Tree View
|
|
191
|
+
|
|
192
|
+
#### `@mui/x-tree-view@8.18.0`
|
|
193
|
+
|
|
194
|
+
- [tree view] Prepare tests for the new store structure (#20225) @flaviendelangle
|
|
195
|
+
- [tree view] Prepare the item plugin files for the store migration (#20240) @flaviendelangle
|
|
196
|
+
- [tree view] Use `TreeItemId` type instead of raw string (#20233) @flaviendelangle
|
|
197
|
+
|
|
198
|
+
#### `@mui/x-tree-view-pro@8.18.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
199
|
+
|
|
200
|
+
Same changes as in `@mui/x-tree-view@8.18.0`.
|
|
201
|
+
|
|
202
|
+
### Codemod
|
|
203
|
+
|
|
204
|
+
#### `@mui/x-codemod@8.18.0`
|
|
205
|
+
|
|
206
|
+
Internal changes.
|
|
207
|
+
|
|
208
|
+
### Docs
|
|
209
|
+
|
|
210
|
+
- [charts] Add a demo for a custom tick label (#20073) @prakhargupta1
|
|
211
|
+
- [charts] Create `useAxes()` hook documentation page (#20229) @JCQuintas
|
|
212
|
+
- [charts] Fix logo alignment (#20228) @JCQuintas
|
|
213
|
+
- [charts] Fixes typo in import example (#20236) @htollefsen
|
|
214
|
+
- [Data Grid] Add recipe for cursor pagination with data source (#19700) @siriwatknp
|
|
215
|
+
- [Data Grid] Add a demo for pinned rows aggregation (#20198) @cherniavskii
|
|
216
|
+
|
|
217
|
+
### Core
|
|
218
|
+
|
|
219
|
+
- [docs-infra] Use deployment config from docs-infra package (#20243) @brijeshb42
|
|
220
|
+
|
|
8
221
|
## 8.17.0
|
|
9
222
|
|
|
10
223
|
_Nov 5, 2025_
|
|
@@ -7,8 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.useDataGridComponent = void 0;
|
|
9
9
|
var React = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _useFirstRender = require("@mui/x-internals/useFirstRender");
|
|
10
11
|
var _useGridInitialization = require("../hooks/core/useGridInitialization");
|
|
11
|
-
var _useGridVirtualizer = require("../hooks/core/useGridVirtualizer");
|
|
12
12
|
var _useGridInitializeState = require("../hooks/utils/useGridInitializeState");
|
|
13
13
|
var _useGridClipboard = require("../hooks/features/clipboard/useGridClipboard");
|
|
14
14
|
var _useGridColumnMenu = require("../hooks/features/columnMenu/useGridColumnMenu");
|
|
@@ -72,7 +72,6 @@ const useDataGridComponent = (apiRef, props, configuration) => {
|
|
|
72
72
|
(0, _useGridInitializeState.useGridInitializeState)(_useGridDimensions.dimensionsStateInitializer, apiRef, props);
|
|
73
73
|
(0, _useGridInitializeState.useGridInitializeState)(_useGridRowsMeta.rowsMetaStateInitializer, apiRef, props);
|
|
74
74
|
(0, _useGridInitializeState.useGridInitializeState)(_useGridListView.listViewStateInitializer, apiRef, props);
|
|
75
|
-
(0, _useGridVirtualizer.useGridVirtualizer)(apiRef, props);
|
|
76
75
|
(0, _useGridKeyboardNavigation.useGridKeyboardNavigation)(apiRef, props);
|
|
77
76
|
(0, _useGridRowSelection.useGridRowSelection)(apiRef, props);
|
|
78
77
|
(0, _useGridColumns.useGridColumns)(apiRef, props);
|
|
@@ -89,7 +88,6 @@ const useDataGridComponent = (apiRef, props, configuration) => {
|
|
|
89
88
|
(0, _useGridDensity.useGridDensity)(apiRef, props);
|
|
90
89
|
(0, _useGridColumnResize.useGridColumnResize)(apiRef, props);
|
|
91
90
|
(0, _useGridPagination.useGridPagination)(apiRef, props);
|
|
92
|
-
(0, _useGridRowsMeta.useGridRowsMeta)(apiRef, props);
|
|
93
91
|
(0, _useGridScroll.useGridScroll)(apiRef, props);
|
|
94
92
|
(0, _useGridColumnMenu.useGridColumnMenu)(apiRef);
|
|
95
93
|
(0, _useGridCsvExport.useGridCsvExport)(apiRef, props);
|
|
@@ -103,6 +101,9 @@ const useDataGridComponent = (apiRef, props, configuration) => {
|
|
|
103
101
|
(0, _useGridDataSource.useGridDataSource)(apiRef, props);
|
|
104
102
|
|
|
105
103
|
// Should be the last thing to run, because all pre-processors should have been registered by now.
|
|
104
|
+
(0, _useFirstRender.useFirstRender)(() => {
|
|
105
|
+
apiRef.current.runAppliersForPendingProcessors();
|
|
106
|
+
});
|
|
106
107
|
React.useEffect(() => {
|
|
107
108
|
apiRef.current.runAppliersForPendingProcessors();
|
|
108
109
|
});
|
package/components/GridRow.js
CHANGED
|
@@ -204,7 +204,7 @@ const GridRow = (0, _forwardRef.forwardRef)(function GridRow(props, refProp) {
|
|
|
204
204
|
rowStyle[property] = propertyValue;
|
|
205
205
|
}
|
|
206
206
|
return rowStyle;
|
|
207
|
-
}, [isNotVisible, rowHeight, styleProp, heightEntry, rootProps.rowSpacingType]);
|
|
207
|
+
}, [isNotVisible, rowHeight, styleProp, heightEntry.spacingTop, heightEntry.spacingBottom, rootProps.rowSpacingType]);
|
|
208
208
|
|
|
209
209
|
// HACK: Sometimes, the rowNode has already been removed from the state but the row is still rendered.
|
|
210
210
|
if (!rowNode) {
|
|
@@ -1,8 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
import { GridRenderCellParams } from "../../models/params/gridCellParams.js";
|
|
2
3
|
import { GridMenuProps } from "../menu/GridMenu.js";
|
|
3
4
|
interface GridActionsCellProps extends Omit<GridRenderCellParams, 'api'> {
|
|
4
5
|
api?: GridRenderCellParams['api'];
|
|
5
6
|
position?: GridMenuProps['position'];
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* If true, the children passed to the component will not be validated.
|
|
10
|
+
* If false, only `GridActionsCellItem` and `React.Fragment` are allowed as children.
|
|
11
|
+
* Only use this prop if you know what you are doing.
|
|
12
|
+
* @default false
|
|
13
|
+
*/
|
|
14
|
+
suppressChildrenValidation?: boolean;
|
|
6
15
|
}
|
|
7
16
|
declare function GridActionsCell(props: GridActionsCellProps): import("react/jsx-runtime").JSX.Element;
|
|
8
17
|
declare namespace GridActionsCell {
|
|
@@ -14,21 +14,22 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
14
14
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
15
|
var _RtlProvider = require("@mui/system/RtlProvider");
|
|
16
16
|
var _useId = _interopRequireDefault(require("@mui/utils/useId"));
|
|
17
|
+
var _warning = require("@mui/x-internals/warning");
|
|
17
18
|
var _gridClasses = require("../../constants/gridClasses");
|
|
18
19
|
var _GridMenu = require("../menu/GridMenu");
|
|
19
20
|
var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
|
|
20
21
|
var _useGridApiContext = require("../../hooks/utils/useGridApiContext");
|
|
22
|
+
var _GridActionsCellItem = require("./GridActionsCellItem");
|
|
21
23
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
22
|
-
const _excluded = ["api", "colDef", "id", "hasFocus", "isEditable", "field", "value", "formattedValue", "row", "rowNode", "cellMode", "tabIndex", "position", "
|
|
24
|
+
const _excluded = ["api", "colDef", "id", "hasFocus", "isEditable", "field", "value", "formattedValue", "row", "rowNode", "cellMode", "tabIndex", "position", "children", "suppressChildrenValidation"];
|
|
23
25
|
const hasActions = colDef => typeof colDef.getActions === 'function';
|
|
24
26
|
function GridActionsCell(props) {
|
|
25
27
|
const {
|
|
26
|
-
colDef,
|
|
27
|
-
id,
|
|
28
28
|
hasFocus,
|
|
29
29
|
tabIndex,
|
|
30
30
|
position = 'bottom-end',
|
|
31
|
-
|
|
31
|
+
children,
|
|
32
|
+
suppressChildrenValidation
|
|
32
33
|
} = props,
|
|
33
34
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
34
35
|
const [focusedButtonIndex, setFocusedButtonIndex] = React.useState(-1);
|
|
@@ -42,12 +43,27 @@ function GridActionsCell(props) {
|
|
|
42
43
|
const menuId = (0, _useId.default)();
|
|
43
44
|
const buttonId = (0, _useId.default)();
|
|
44
45
|
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
46
|
+
const actions = [];
|
|
47
|
+
React.Children.forEach(children, child => {
|
|
48
|
+
// Unwrap React.Fragment
|
|
49
|
+
if (/*#__PURE__*/React.isValidElement(child)) {
|
|
50
|
+
if (child.type === React.Fragment) {
|
|
51
|
+
React.Children.forEach(child.props.children, fragChild => {
|
|
52
|
+
if (/*#__PURE__*/React.isValidElement(fragChild)) {
|
|
53
|
+
actions.push(fragChild);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
} else if (child.type === _GridActionsCellItem.GridActionsCellItem || suppressChildrenValidation) {
|
|
57
|
+
actions.push(child);
|
|
58
|
+
} else {
|
|
59
|
+
const childType = typeof child.type === 'function' ? child.type.name : child.type;
|
|
60
|
+
(0, _warning.warnOnce)(`MUI X: Invalid child type in \`GridActionsCell\`. Expected \`GridActionsCellItem\` or \`React.Fragment\`, got \`${childType}\`.
|
|
61
|
+
If this is intentional, you can suppress this warning by passing the \`suppressChildrenValidation\` prop to \`GridActionsCell\`.`, 'error');
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
const iconButtons = actions.filter(option => !option.props.showInMenu);
|
|
66
|
+
const menuButtons = actions.filter(option => option.props.showInMenu);
|
|
51
67
|
const numberOfButtons = iconButtons.length + (menuButtons.length ? 1 : 0);
|
|
52
68
|
React.useLayoutEffect(() => {
|
|
53
69
|
if (!hasFocus) {
|
|
@@ -70,22 +86,16 @@ function GridActionsCell(props) {
|
|
|
70
86
|
preventScroll: true
|
|
71
87
|
});
|
|
72
88
|
}, [focusedButtonIndex]);
|
|
89
|
+
const firstFocusableButtonIndex = actions.findIndex(o => !o.props.disabled);
|
|
73
90
|
React.useEffect(() => {
|
|
91
|
+
if (hasFocus && focusedButtonIndex === -1) {
|
|
92
|
+
setFocusedButtonIndex(firstFocusableButtonIndex);
|
|
93
|
+
}
|
|
74
94
|
if (!hasFocus) {
|
|
75
95
|
setFocusedButtonIndex(-1);
|
|
76
96
|
ignoreCallToFocus.current = false;
|
|
77
97
|
}
|
|
78
|
-
}, [hasFocus]);
|
|
79
|
-
React.useImperativeHandle(focusElementRef, () => ({
|
|
80
|
-
focus() {
|
|
81
|
-
// If ignoreCallToFocus is true, then one of the buttons was clicked and the focus is already set
|
|
82
|
-
if (!ignoreCallToFocus.current) {
|
|
83
|
-
// find the first focusable button and pass the index to the state
|
|
84
|
-
const focusableButtonIndex = options.findIndex(o => !o.props.disabled);
|
|
85
|
-
setFocusedButtonIndex(focusableButtonIndex);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}), [options]);
|
|
98
|
+
}, [hasFocus, focusedButtonIndex, firstFocusableButtonIndex]);
|
|
89
99
|
React.useEffect(() => {
|
|
90
100
|
if (focusedButtonIndex >= numberOfButtons) {
|
|
91
101
|
setFocusedButtonIndex(numberOfButtons - 1);
|
|
@@ -112,8 +122,6 @@ function GridActionsCell(props) {
|
|
|
112
122
|
touchRippleRefs.current[index] = instance;
|
|
113
123
|
};
|
|
114
124
|
const handleButtonClick = (index, onClick) => event => {
|
|
115
|
-
event.stopPropagation();
|
|
116
|
-
event.preventDefault();
|
|
117
125
|
setFocusedButtonIndex(index);
|
|
118
126
|
ignoreCallToFocus.current = true;
|
|
119
127
|
if (onClick) {
|
|
@@ -125,7 +133,7 @@ function GridActionsCell(props) {
|
|
|
125
133
|
return;
|
|
126
134
|
}
|
|
127
135
|
const getNewIndex = (index, direction) => {
|
|
128
|
-
if (index < 0 || index >
|
|
136
|
+
if (index < 0 || index > actions.length) {
|
|
129
137
|
return index;
|
|
130
138
|
}
|
|
131
139
|
|
|
@@ -134,7 +142,7 @@ function GridActionsCell(props) {
|
|
|
134
142
|
const indexMod = (direction === 'left' ? -1 : 1) * rtlMod;
|
|
135
143
|
|
|
136
144
|
// if the button that should receive focus is disabled go one more step
|
|
137
|
-
return
|
|
145
|
+
return actions[index + indexMod]?.props.disabled ? getNewIndex(index + indexMod, direction) : index + indexMod;
|
|
138
146
|
};
|
|
139
147
|
let newIndex = focusedButtonIndex;
|
|
140
148
|
if (event.key === 'ArrowRight') {
|
|
@@ -211,6 +219,7 @@ process.env.NODE_ENV !== "production" ? GridActionsCell.propTypes = {
|
|
|
211
219
|
* The mode of the cell.
|
|
212
220
|
*/
|
|
213
221
|
cellMode: _propTypes.default.oneOf(['edit', 'view']).isRequired,
|
|
222
|
+
children: _propTypes.default.node.isRequired,
|
|
214
223
|
/**
|
|
215
224
|
* The column of the row that the current cell belongs to.
|
|
216
225
|
*/
|
|
@@ -219,16 +228,6 @@ process.env.NODE_ENV !== "production" ? GridActionsCell.propTypes = {
|
|
|
219
228
|
* The column field of the cell that triggered the event.
|
|
220
229
|
*/
|
|
221
230
|
field: _propTypes.default.string.isRequired,
|
|
222
|
-
/**
|
|
223
|
-
* A ref allowing to set imperative focus.
|
|
224
|
-
* It can be passed to the element that should receive focus.
|
|
225
|
-
* @ignore - do not document.
|
|
226
|
-
*/
|
|
227
|
-
focusElementRef: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.shape({
|
|
228
|
-
current: _propTypes.default.shape({
|
|
229
|
-
focus: _propTypes.default.func.isRequired
|
|
230
|
-
})
|
|
231
|
-
})]),
|
|
232
231
|
/**
|
|
233
232
|
* The cell value formatted with the column valueFormatter.
|
|
234
233
|
*/
|
|
@@ -264,6 +263,25 @@ process.env.NODE_ENV !== "production" ? GridActionsCell.propTypes = {
|
|
|
264
263
|
*/
|
|
265
264
|
value: _propTypes.default.any
|
|
266
265
|
} : void 0;
|
|
267
|
-
|
|
266
|
+
// Temporary wrapper for backward compatibility.
|
|
267
|
+
// Only used to support `getActions` method in `GridColDef`.
|
|
268
|
+
// TODO(v9): Remove this wrapper and the default `renderCell` in gridActionsColDef
|
|
269
|
+
function GridActionsCellWrapper(props) {
|
|
270
|
+
const {
|
|
271
|
+
colDef,
|
|
272
|
+
id
|
|
273
|
+
} = props;
|
|
274
|
+
const apiRef = (0, _useGridApiContext.useGridApiContext)();
|
|
275
|
+
if (!hasActions(colDef)) {
|
|
276
|
+
throw new Error('MUI X: Missing the `getActions` property in the `GridColDef`.');
|
|
277
|
+
}
|
|
278
|
+
const actions = colDef.getActions(apiRef.current.getRowParams(id));
|
|
279
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(GridActionsCell, (0, _extends2.default)({
|
|
280
|
+
suppressChildrenValidation: true
|
|
281
|
+
}, props, {
|
|
282
|
+
children: actions
|
|
283
|
+
}));
|
|
284
|
+
}
|
|
285
|
+
const renderActionsCell = params => /*#__PURE__*/(0, _jsxRuntime.jsx)(GridActionsCellWrapper, (0, _extends2.default)({}, params));
|
|
268
286
|
exports.renderActionsCell = renderActionsCell;
|
|
269
287
|
if (process.env.NODE_ENV !== "production") renderActionsCell.displayName = "renderActionsCell";
|
|
@@ -24,8 +24,6 @@ const GridActionsCellItem = exports.GridActionsCellItem = (0, _forwardRef.forwar
|
|
|
24
24
|
} = props,
|
|
25
25
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
26
26
|
const handleClick = event => {
|
|
27
|
-
event.stopPropagation();
|
|
28
|
-
event.preventDefault();
|
|
29
27
|
onClick?.(event);
|
|
30
28
|
};
|
|
31
29
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseIconButton, (0, _extends2.default)({
|
|
@@ -50,8 +48,6 @@ const GridActionsCellItem = exports.GridActionsCellItem = (0, _forwardRef.forwar
|
|
|
50
48
|
} = props,
|
|
51
49
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded2);
|
|
52
50
|
const handleClick = event => {
|
|
53
|
-
event.stopPropagation();
|
|
54
|
-
event.preventDefault();
|
|
55
51
|
onClick?.(event);
|
|
56
52
|
if (closeMenuOnClick) {
|
|
57
53
|
closeMenu?.();
|
|
@@ -77,16 +77,6 @@ process.env.NODE_ENV !== "production" ? GridBooleanCellRaw.propTypes = {
|
|
|
77
77
|
* The column field of the cell that triggered the event.
|
|
78
78
|
*/
|
|
79
79
|
field: _propTypes.default.string.isRequired,
|
|
80
|
-
/**
|
|
81
|
-
* A ref allowing to set imperative focus.
|
|
82
|
-
* It can be passed to the element that should receive focus.
|
|
83
|
-
* @ignore - do not document.
|
|
84
|
-
*/
|
|
85
|
-
focusElementRef: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.shape({
|
|
86
|
-
current: _propTypes.default.shape({
|
|
87
|
-
focus: _propTypes.default.func.isRequired
|
|
88
|
-
})
|
|
89
|
-
})]),
|
|
90
80
|
/**
|
|
91
81
|
* The cell value formatted with the column valueFormatter.
|
|
92
82
|
*/
|
|
@@ -21,6 +21,7 @@ var _RtlProvider = require("@mui/system/RtlProvider");
|
|
|
21
21
|
var _forwardRef = require("@mui/x-internals/forwardRef");
|
|
22
22
|
var _store = require("@mui/x-internals/store");
|
|
23
23
|
var _xVirtualizer = require("@mui/x-virtualizer");
|
|
24
|
+
var _useEnhancedEffect = _interopRequireDefault(require("@mui/utils/useEnhancedEffect"));
|
|
24
25
|
var _doesSupportPreventScroll = require("../../utils/doesSupportPreventScroll");
|
|
25
26
|
var _gridClasses = require("../../constants/gridClasses");
|
|
26
27
|
var _models = require("../../models");
|
|
@@ -142,8 +143,7 @@ const GridCell = (0, _forwardRef.forwardRef)(function GridCell(props, ref) {
|
|
|
142
143
|
isEditable = false,
|
|
143
144
|
value
|
|
144
145
|
} = cellParams;
|
|
145
|
-
const
|
|
146
|
-
const tabIndex = (cellMode === 'view' || !isEditable) && !canManageOwnFocus ? cellParams.tabIndex : -1;
|
|
146
|
+
const tabIndex = (cellMode === 'view' || !isEditable) && column.type !== 'actions' ? cellParams.tabIndex : -1;
|
|
147
147
|
const {
|
|
148
148
|
classes: rootClasses,
|
|
149
149
|
getCellClassName
|
|
@@ -167,7 +167,6 @@ const GridCell = (0, _forwardRef.forwardRef)(function GridCell(props, ref) {
|
|
|
167
167
|
const valueToRender = cellParams.formattedValue ?? value;
|
|
168
168
|
const cellRef = React.useRef(null);
|
|
169
169
|
const handleRef = (0, _useForkRef.default)(ref, cellRef);
|
|
170
|
-
const focusElementRef = React.useRef(null);
|
|
171
170
|
const isSelectionMode = rootProps.cellSelection ?? false;
|
|
172
171
|
const ownerState = {
|
|
173
172
|
align,
|
|
@@ -231,14 +230,14 @@ const GridCell = (0, _forwardRef.forwardRef)(function GridCell(props, ref) {
|
|
|
231
230
|
}
|
|
232
231
|
return cellStyle;
|
|
233
232
|
}, [width, isNotVisible, styleProp, pinnedOffset, pinnedPosition, isRtl, rowSpan]);
|
|
234
|
-
|
|
233
|
+
(0, _useEnhancedEffect.default)(() => {
|
|
235
234
|
if (!hasFocus || cellMode === _models.GridCellModes.Edit) {
|
|
236
235
|
return;
|
|
237
236
|
}
|
|
238
237
|
const doc = (0, _ownerDocument.default)(apiRef.current.rootElementRef.current);
|
|
239
238
|
if (cellRef.current && !cellRef.current.contains(doc.activeElement)) {
|
|
240
239
|
const focusableElement = cellRef.current.querySelector('[tabindex="0"]');
|
|
241
|
-
const elementToFocus =
|
|
240
|
+
const elementToFocus = focusableElement || cellRef.current;
|
|
242
241
|
if ((0, _doesSupportPreventScroll.doesSupportPreventScroll)()) {
|
|
243
242
|
elementToFocus.focus({
|
|
244
243
|
preventScroll: true
|
|
@@ -299,11 +298,6 @@ const GridCell = (0, _forwardRef.forwardRef)(function GridCell(props, ref) {
|
|
|
299
298
|
children = valueString;
|
|
300
299
|
title = valueString;
|
|
301
300
|
}
|
|
302
|
-
if (/*#__PURE__*/React.isValidElement(children) && canManageOwnFocus) {
|
|
303
|
-
children = /*#__PURE__*/React.cloneElement(children, {
|
|
304
|
-
focusElementRef
|
|
305
|
-
});
|
|
306
|
-
}
|
|
307
301
|
const draggableEventHandlers = disableDragEvents ? null : {
|
|
308
302
|
onDragEnter: publish('cellDragEnter', onDragEnter),
|
|
309
303
|
onDragOver: publish('cellDragOver', onDragOver)
|
|
@@ -85,7 +85,7 @@ function GridColumnHeaderItem(props) {
|
|
|
85
85
|
const columnMenuButtonId = (0, _useId.default)();
|
|
86
86
|
const iconButtonRef = React.useRef(null);
|
|
87
87
|
const [showColumnMenuIcon, setShowColumnMenuIcon] = React.useState(columnMenuOpen);
|
|
88
|
-
const isDraggable =
|
|
88
|
+
const isDraggable = !rootProps.disableColumnReorder && !disableReorder && !colDef.disableReorder;
|
|
89
89
|
let headerComponent;
|
|
90
90
|
if (colDef.renderHeader) {
|
|
91
91
|
headerComponent = colDef.renderHeader(apiRef.current.getColumnHeaderParams(colDef.field));
|
|
@@ -131,7 +131,7 @@ function GridColumnHeaderItem(props) {
|
|
|
131
131
|
onDoubleClick: publish('columnSeparatorDoubleClick')
|
|
132
132
|
}), [publish]);
|
|
133
133
|
React.useEffect(() => {
|
|
134
|
-
if (!showColumnMenuIcon) {
|
|
134
|
+
if (!showColumnMenuIcon && columnMenuOpen) {
|
|
135
135
|
setShowColumnMenuIcon(columnMenuOpen);
|
|
136
136
|
}
|
|
137
137
|
}, [showColumnMenuIcon, columnMenuOpen]);
|
|
@@ -11,7 +11,9 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
11
11
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
12
12
|
var React = _interopRequireWildcard(require("react"));
|
|
13
13
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
14
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
14
15
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
16
|
+
var _useEventCallback = _interopRequireDefault(require("@mui/utils/useEventCallback"));
|
|
15
17
|
var _forwardRef = require("@mui/x-internals/forwardRef");
|
|
16
18
|
var _useGridApiContext = require("../../hooks/utils/useGridApiContext");
|
|
17
19
|
var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
|
|
@@ -43,7 +45,19 @@ const GridCellCheckboxForwardRef = exports.GridCellCheckboxForwardRef = (0, _for
|
|
|
43
45
|
classes: rootProps.classes
|
|
44
46
|
};
|
|
45
47
|
const classes = useUtilityClasses(ownerState);
|
|
48
|
+
const {
|
|
49
|
+
isIndeterminate,
|
|
50
|
+
isChecked,
|
|
51
|
+
isSelectable
|
|
52
|
+
} = (0, _useGridSelector.useGridSelector)(apiRef, _utils.checkboxPropsSelector, {
|
|
53
|
+
groupId: id,
|
|
54
|
+
autoSelectParents: rootProps.rowSelectionPropagation?.parents ?? false
|
|
55
|
+
});
|
|
56
|
+
const disabled = !isSelectable;
|
|
46
57
|
const handleChange = event => {
|
|
58
|
+
if (disabled) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
47
61
|
const params = {
|
|
48
62
|
value: event.target.checked,
|
|
49
63
|
id
|
|
@@ -58,20 +72,26 @@ const GridCellCheckboxForwardRef = exports.GridCellCheckboxForwardRef = (0, _for
|
|
|
58
72
|
}
|
|
59
73
|
}
|
|
60
74
|
}, [apiRef, tabIndex, id, field]);
|
|
61
|
-
const handleKeyDown =
|
|
75
|
+
const handleKeyDown = (0, _useEventCallback.default)(event => {
|
|
62
76
|
if (event.key === ' ') {
|
|
63
77
|
// We call event.stopPropagation to avoid selecting the row and also scrolling to bottom
|
|
64
78
|
// TODO: Remove and add a check inside useGridKeyboardNavigation
|
|
65
79
|
event.stopPropagation();
|
|
66
80
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
81
|
+
if (disabled) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
const handleClick = (0, _useEventCallback.default)(event => {
|
|
86
|
+
if (disabled) {
|
|
87
|
+
event.preventDefault();
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
const handleMouseDown = (0, _useEventCallback.default)(() => {
|
|
92
|
+
if (disabled) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
75
95
|
});
|
|
76
96
|
if (rowNode.type === 'footer' || rowNode.type === 'pinnedRow') {
|
|
77
97
|
return null;
|
|
@@ -81,16 +101,21 @@ const GridCellCheckboxForwardRef = exports.GridCellCheckboxForwardRef = (0, _for
|
|
|
81
101
|
tabIndex: tabIndex,
|
|
82
102
|
checked: isChecked && !isIndeterminate,
|
|
83
103
|
onChange: handleChange,
|
|
84
|
-
|
|
104
|
+
onClick: handleClick,
|
|
105
|
+
onMouseDown: handleMouseDown,
|
|
106
|
+
className: (0, _clsx.default)(classes.root, disabled && 'Mui-disabled'),
|
|
107
|
+
material: {
|
|
108
|
+
disableRipple: disabled
|
|
109
|
+
},
|
|
85
110
|
slotProps: {
|
|
86
111
|
htmlInput: {
|
|
112
|
+
'aria-disabled': disabled || undefined,
|
|
87
113
|
'aria-label': label,
|
|
88
114
|
name: 'select_row'
|
|
89
115
|
}
|
|
90
116
|
},
|
|
91
117
|
onKeyDown: handleKeyDown,
|
|
92
|
-
indeterminate: isIndeterminate
|
|
93
|
-
disabled: !isSelectable
|
|
118
|
+
indeterminate: isIndeterminate
|
|
94
119
|
}, rootProps.slotProps?.baseCheckbox, other, {
|
|
95
120
|
ref: ref
|
|
96
121
|
}));
|
|
@@ -117,16 +142,6 @@ process.env.NODE_ENV !== "production" ? GridCellCheckboxForwardRef.propTypes = {
|
|
|
117
142
|
* The column field of the cell that triggered the event.
|
|
118
143
|
*/
|
|
119
144
|
field: _propTypes.default.string.isRequired,
|
|
120
|
-
/**
|
|
121
|
-
* A ref allowing to set imperative focus.
|
|
122
|
-
* It can be passed to the element that should receive focus.
|
|
123
|
-
* @ignore - do not document.
|
|
124
|
-
*/
|
|
125
|
-
focusElementRef: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.shape({
|
|
126
|
-
current: _propTypes.default.shape({
|
|
127
|
-
focus: _propTypes.default.func.isRequired
|
|
128
|
-
})
|
|
129
|
-
})]),
|
|
130
145
|
/**
|
|
131
146
|
* The cell value formatted with the column valueFormatter.
|
|
132
147
|
*/
|