@mui/x-data-grid 6.0.0-alpha.0 → 6.0.0-alpha.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 +209 -0
- package/DataGrid/useDataGridProps.js +4 -4
- package/components/DataGridVirtualScroller.js +5 -3
- package/components/GridPagination.d.ts +43 -1
- package/components/GridPagination.js +1 -2
- package/components/GridRow.d.ts +1 -4
- package/components/GridRow.js +9 -8
- package/components/base/GridBody.js +1 -2
- package/components/base/GridOverlays.js +52 -12
- package/components/cell/GridBooleanCell.js +2 -1
- package/components/columnSelection/GridCellCheckboxRenderer.d.ts +2 -2
- package/components/columnSelection/GridCellCheckboxRenderer.js +1 -6
- package/components/containers/GridOverlay.js +0 -5
- package/components/panel/filterPanel/GridFilterForm.js +2 -1
- package/components/toolbar/GridToolbarFilterButton.js +8 -4
- package/constants/gridClasses.d.ts +8 -0
- package/hooks/core/pipeProcessing/gridPipeProcessingApi.d.ts +1 -1
- package/hooks/core/strategyProcessing/gridStrategyProcessingApi.d.ts +1 -1
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +1 -1
- package/hooks/features/editRows/useGridCellEditing.new.js +18 -9
- package/hooks/features/editRows/useGridEditing.new.js +3 -2
- package/hooks/features/editRows/useGridEditing.old.js +2 -1
- package/hooks/features/editRows/useGridRowEditing.new.js +18 -9
- package/hooks/features/export/useGridPrintExport.js +31 -17
- package/hooks/features/export/utils.js +1 -5
- package/hooks/features/filter/gridFilterSelector.js +2 -2
- package/hooks/features/filter/useGridFilter.js +6 -6
- package/hooks/features/pagination/gridPaginationSelector.js +2 -2
- package/hooks/features/rows/gridRowsInterfaces.d.ts +106 -0
- package/hooks/features/rows/{gridRowsState.js → gridRowsInterfaces.js} +0 -0
- package/hooks/features/rows/gridRowsSelector.d.ts +17 -7
- package/hooks/features/rows/gridRowsSelector.js +38 -6
- package/hooks/features/rows/gridRowsUtils.d.ts +16 -4
- package/hooks/features/rows/gridRowsUtils.js +222 -39
- package/hooks/features/rows/index.d.ts +3 -3
- package/hooks/features/rows/index.js +2 -2
- package/hooks/features/rows/useGridRows.js +161 -124
- package/hooks/features/rows/useGridRowsPreProcessors.js +78 -26
- package/hooks/features/selection/useGridSelection.js +2 -2
- package/hooks/features/sorting/gridSortingSelector.js +9 -4
- package/hooks/features/sorting/gridSortingState.d.ts +2 -2
- package/hooks/features/sorting/useGridSorting.js +9 -33
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +4 -7
- package/hooks/features/virtualization/useGridVirtualScroller.js +11 -17
- package/index.js +1 -1
- package/internals/index.d.ts +2 -1
- package/internals/index.js +1 -0
- package/legacy/DataGrid/useDataGridProps.js +4 -4
- package/legacy/components/DataGridVirtualScroller.js +5 -3
- package/legacy/components/GridPagination.js +1 -2
- package/legacy/components/GridRow.js +9 -8
- package/legacy/components/base/GridBody.js +1 -2
- package/legacy/components/base/GridOverlays.js +54 -12
- package/legacy/components/cell/GridBooleanCell.js +2 -1
- package/legacy/components/columnSelection/GridCellCheckboxRenderer.js +1 -6
- package/legacy/components/containers/GridOverlay.js +0 -5
- package/legacy/components/panel/filterPanel/GridFilterForm.js +2 -1
- package/legacy/components/toolbar/GridToolbarFilterButton.js +3 -1
- package/legacy/hooks/features/columnHeaders/useGridColumnHeaders.js +1 -1
- package/legacy/hooks/features/editRows/useGridCellEditing.new.js +18 -9
- package/legacy/hooks/features/editRows/useGridEditing.new.js +3 -2
- package/legacy/hooks/features/editRows/useGridEditing.old.js +2 -1
- package/legacy/hooks/features/editRows/useGridRowEditing.new.js +18 -9
- package/legacy/hooks/features/export/useGridPrintExport.js +33 -20
- package/legacy/hooks/features/export/utils.js +1 -3
- package/legacy/hooks/features/filter/gridFilterSelector.js +2 -2
- package/legacy/hooks/features/filter/useGridFilter.js +6 -6
- package/legacy/hooks/features/pagination/gridPaginationSelector.js +2 -2
- package/legacy/hooks/features/rows/{gridRowsState.js → gridRowsInterfaces.js} +0 -0
- package/legacy/hooks/features/rows/gridRowsSelector.js +52 -9
- package/legacy/hooks/features/rows/gridRowsUtils.js +238 -46
- package/legacy/hooks/features/rows/index.js +2 -2
- package/legacy/hooks/features/rows/useGridRows.js +163 -134
- package/legacy/hooks/features/rows/useGridRowsPreProcessors.js +81 -26
- package/legacy/hooks/features/selection/useGridSelection.js +2 -2
- package/legacy/hooks/features/sorting/gridSortingSelector.js +5 -2
- package/legacy/hooks/features/sorting/useGridSorting.js +11 -33
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +11 -17
- package/legacy/index.js +1 -1
- package/legacy/internals/index.js +1 -0
- package/legacy/models/gridFeatureMode.js +1 -4
- package/models/api/gridParamsApi.d.ts +2 -2
- package/models/api/gridRowApi.d.ts +7 -5
- package/models/events/gridEventLookup.d.ts +3 -3
- package/models/gridApiCaches.d.ts +1 -1
- package/models/gridFeatureMode.d.ts +0 -4
- package/models/gridFeatureMode.js +1 -4
- package/models/gridRows.d.ts +100 -30
- package/models/gridSortModel.d.ts +2 -2
- package/models/params/gridCellParams.d.ts +7 -11
- package/modern/DataGrid/useDataGridProps.js +4 -4
- package/modern/components/DataGridVirtualScroller.js +5 -3
- package/modern/components/GridPagination.js +1 -2
- package/modern/components/GridRow.js +9 -8
- package/modern/components/base/GridBody.js +1 -2
- package/modern/components/base/GridOverlays.js +52 -12
- package/modern/components/cell/GridBooleanCell.js +2 -1
- package/modern/components/columnSelection/GridCellCheckboxRenderer.js +1 -6
- package/modern/components/containers/GridOverlay.js +0 -5
- package/modern/components/panel/filterPanel/GridFilterForm.js +2 -1
- package/modern/components/toolbar/GridToolbarFilterButton.js +1 -1
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +1 -1
- package/modern/hooks/features/editRows/useGridCellEditing.new.js +18 -9
- package/modern/hooks/features/editRows/useGridEditing.new.js +3 -2
- package/modern/hooks/features/editRows/useGridEditing.old.js +2 -1
- package/modern/hooks/features/editRows/useGridRowEditing.new.js +18 -9
- package/modern/hooks/features/export/useGridPrintExport.js +30 -16
- package/modern/hooks/features/export/utils.js +1 -1
- package/modern/hooks/features/filter/gridFilterSelector.js +2 -2
- package/modern/hooks/features/filter/useGridFilter.js +6 -6
- package/modern/hooks/features/pagination/gridPaginationSelector.js +2 -2
- package/modern/hooks/features/rows/{gridRowsState.js → gridRowsInterfaces.js} +0 -0
- package/modern/hooks/features/rows/gridRowsSelector.js +28 -6
- package/modern/hooks/features/rows/gridRowsUtils.js +220 -37
- package/modern/hooks/features/rows/index.js +2 -2
- package/modern/hooks/features/rows/useGridRows.js +158 -121
- package/modern/hooks/features/rows/useGridRowsPreProcessors.js +78 -26
- package/modern/hooks/features/selection/useGridSelection.js +2 -2
- package/modern/hooks/features/sorting/gridSortingSelector.js +3 -2
- package/modern/hooks/features/sorting/useGridSorting.js +9 -33
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +10 -16
- package/modern/index.js +1 -1
- package/modern/internals/index.js +1 -0
- package/modern/models/gridFeatureMode.js +1 -4
- package/node/DataGrid/useDataGridProps.js +3 -3
- package/node/components/DataGridVirtualScroller.js +5 -3
- package/node/components/GridPagination.js +1 -2
- package/node/components/GridRow.js +9 -7
- package/node/components/base/GridBody.js +1 -3
- package/node/components/base/GridOverlays.js +57 -12
- package/node/components/cell/GridBooleanCell.js +3 -1
- package/node/components/columnSelection/GridCellCheckboxRenderer.js +1 -6
- package/node/components/containers/GridOverlay.js +0 -5
- package/node/components/panel/filterPanel/GridFilterForm.js +2 -1
- package/node/components/toolbar/GridToolbarFilterButton.js +8 -4
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +1 -1
- package/node/hooks/features/editRows/useGridCellEditing.new.js +20 -10
- package/node/hooks/features/editRows/useGridEditing.new.js +4 -2
- package/node/hooks/features/editRows/useGridEditing.old.js +3 -1
- package/node/hooks/features/editRows/useGridRowEditing.new.js +20 -10
- package/node/hooks/features/export/useGridPrintExport.js +31 -17
- package/node/hooks/features/export/utils.js +1 -5
- package/node/hooks/features/filter/gridFilterSelector.js +1 -1
- package/node/hooks/features/filter/useGridFilter.js +5 -6
- package/node/hooks/features/pagination/gridPaginationSelector.js +1 -1
- package/node/hooks/features/rows/{gridRowsState.js → gridRowsInterfaces.js} +0 -0
- package/node/hooks/features/rows/gridRowsSelector.js +43 -10
- package/node/hooks/features/rows/gridRowsUtils.js +239 -40
- package/node/hooks/features/rows/index.js +23 -9
- package/node/hooks/features/rows/useGridRows.js +161 -122
- package/node/hooks/features/rows/useGridRowsPreProcessors.js +81 -26
- package/node/hooks/features/selection/useGridSelection.js +2 -2
- package/node/hooks/features/sorting/gridSortingSelector.js +9 -4
- package/node/hooks/features/sorting/useGridSorting.js +9 -33
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +11 -17
- package/node/index.js +1 -1
- package/node/internals/index.js +14 -2
- package/node/models/gridFeatureMode.js +1 -7
- package/package.json +1 -1
- package/themeAugmentation/props.d.ts +2 -2
- package/hooks/features/rows/gridRowsState.d.ts +0 -60
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,215 @@
|
|
|
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
|
+
## v6.0.0-alpha.2
|
|
7
|
+
|
|
8
|
+
_Oct 7, 2022_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 10 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🚀 Further progress on stabilizing new date field components
|
|
13
|
+
- 🎁 Improve support for theme augmentation in the DataGrid (#6269) @cherniavskii
|
|
14
|
+
- 🌍 Add Japanese (ja-JP) locale to pickers (#6365) @sho918
|
|
15
|
+
- 📚 Documentation improvements
|
|
16
|
+
- 🐞 Bugfixes
|
|
17
|
+
|
|
18
|
+
### `@mui/x-data-grid@v6.0.0-alpha.2` / `@mui/x-data-grid-pro@v6.0.0-alpha.2` / `@mui/x-data-grid-premium@v6.0.0-alpha.2`
|
|
19
|
+
|
|
20
|
+
#### Breaking changes
|
|
21
|
+
|
|
22
|
+
- 🎁 The aggregation is no longer experimental.
|
|
23
|
+
|
|
24
|
+
You can now use the aggregation without the `experimentalFeatures.aggregation` flag enabled.
|
|
25
|
+
|
|
26
|
+
```diff
|
|
27
|
+
<DataGridPremium
|
|
28
|
+
- experimentalFeatures={{ aggregation: true }}
|
|
29
|
+
/>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
The aggregation of the columns through the column menu is now enabled by default on `DataGridPremium`. You can set `disableAggregation={true}` to disable it.
|
|
33
|
+
|
|
34
|
+
#### Changes
|
|
35
|
+
|
|
36
|
+
- [DataGrid] Add filter item ID to `.MuiDataGrid-filterForm` (#6313) @m4theushw
|
|
37
|
+
- [DataGrid] Add missing `valueOptions` (#6401) @DanailH
|
|
38
|
+
- [DataGrid] Don't start edit mode when pressing Shift + Space (#6228) @m4theushw
|
|
39
|
+
- [DataGrid] Fix error when using column grouping with all columns hidden (#6405) @alexfauquette
|
|
40
|
+
- [DataGrid] Pass generics to the components in the theme augmentation (#6269) @cherniavskii
|
|
41
|
+
- [DataGridPremium] Remove the aggregation from the experimental features (#6372) @flaviendelangle
|
|
42
|
+
|
|
43
|
+
### `@mui/x-date-pickers@v6.0.0-alpha.2` / `@mui/x-date-pickers-pro@v6.0.0-alpha.2`
|
|
44
|
+
|
|
45
|
+
#### Breaking changes
|
|
46
|
+
|
|
47
|
+
- The `renderDay` prop has been replaced by a `Day` component slot.
|
|
48
|
+
You can find more information about this pattern in the [MUI Base documentation](https://mui.com/base/getting-started/usage/#shared-props).
|
|
49
|
+
|
|
50
|
+
```diff
|
|
51
|
+
// Same for any other date, date time or date range picker.
|
|
52
|
+
<DatePicker
|
|
53
|
+
- renderDay={(_, dayProps) => <CustomDay {...dayProps} />}
|
|
54
|
+
+ components={{ Day: CustomDay }}
|
|
55
|
+
/>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
#### Changes
|
|
59
|
+
|
|
60
|
+
- [DateRangePicker] Fix the shape of the first selected day when the start date has an hour set (#6403) @flaviendelangle
|
|
61
|
+
- [l10n] Add Japanese (ja-JP) locale to pickers (#6365) @sho918
|
|
62
|
+
- [DateRangePicker] Force focus to stay on inputs (#6324) @alexfauquette
|
|
63
|
+
- [pickers] Improve edition on field components (#6339) @flaviendelangle
|
|
64
|
+
- [pickers] Improve field selection behaviors (#6317) @flaviendelangle
|
|
65
|
+
- [pickers] Replace the `renderDay` prop with a `Day` component slot (#6293) @flaviendelangle
|
|
66
|
+
|
|
67
|
+
### Docs
|
|
68
|
+
|
|
69
|
+
- [docs] Apply style guide to Data Grid Aggregation page (#5781) @samuelsycamore
|
|
70
|
+
- [docs] Fix code examples of editing cells (#6004) @TiagoPortfolio
|
|
71
|
+
- [docs] Fix customized day rendering demo style (#6342) (#6399) @Ambrish-git
|
|
72
|
+
- [docs] Implement Style Guide on "Advanced" Data Grid doc pages (#6331) @samuelsycamore
|
|
73
|
+
- [docs] Use components instead of demos for `SelectorsDocs` (#6103) @flaviendelangle
|
|
74
|
+
- [license] Add new license status 'Out of scope' (#5260) @flaviendelangle
|
|
75
|
+
|
|
76
|
+
### Core
|
|
77
|
+
|
|
78
|
+
- [core] Speedup of yarn install in the CI (#6395) @oliviertassinari
|
|
79
|
+
- [test] Remove redundant test clean-ups (#6377) @oliviertassinari
|
|
80
|
+
- [test] Replace `React.render` with `React.createRoot` in e2e tests (#6393) @m4theushw
|
|
81
|
+
|
|
82
|
+
## 6.0.0-alpha.1
|
|
83
|
+
|
|
84
|
+
_Sep 29, 2022_
|
|
85
|
+
|
|
86
|
+
We'd like to offer a big thanks to the 8 contributors who made this release possible. Here are some highlights ✨:
|
|
87
|
+
|
|
88
|
+
- 🚀 Better support for custom overlays (#5808) @cherniavskii
|
|
89
|
+
- 🖨️ Improve print export (#6273) @oliviertassinari
|
|
90
|
+
- 🎁 Reduce confusion when initializing pickers with a date value (#6170) @flaviendelangle
|
|
91
|
+
- 📚 Documentation improvements
|
|
92
|
+
- 🐞 Bugfixes
|
|
93
|
+
|
|
94
|
+
### `@mui/x-data-grid@v6.0.0-alpha.1` / `@mui/x-data-grid-pro@v6.0.0-alpha.1` / `@mui/x-data-grid-premium@v6.0.0-alpha.1`
|
|
95
|
+
|
|
96
|
+
#### Breaking changes
|
|
97
|
+
|
|
98
|
+
- New internal rows structure for v6 (#4927) @flaviendelangle
|
|
99
|
+
|
|
100
|
+
Some selectors related to the rows have been renamed to better describe the type of rows they are returning:
|
|
101
|
+
|
|
102
|
+
```diff
|
|
103
|
+
-const result = gridRowsIdToIdLookupSelector(apiRef);
|
|
104
|
+
+const result = gridRowsDataRowIdToIdLookupSelector(apiRef);
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
```diff
|
|
108
|
+
-const result = gridRowTreeDepthSelector(apiRef);
|
|
109
|
+
+const result = gridRowMaximumTreeDepthSelector(apiRef);
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
The format of the tree nodes (the element accessible in `params.node` or with the `apiRef.current.getRowNode` method) have changed.
|
|
113
|
+
You have a new `type` property, which can be useful, for example, to apply custom behavior on groups.
|
|
114
|
+
Here is an example of the old and new approach showing how to apply a custom value formatter in groups for the grouping column:
|
|
115
|
+
|
|
116
|
+
```diff
|
|
117
|
+
<DataGridPremium
|
|
118
|
+
groupingColDef={() => ({
|
|
119
|
+
valueFormatter: (params) => {
|
|
120
|
+
if (params.id == null) {
|
|
121
|
+
return params.value;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const rowNode = apiRef.current.getRowNode(params.id!)!;
|
|
125
|
+
- if (rowNode.children?.length) {
|
|
126
|
+
+ if (rowNode.type === 'group') {
|
|
127
|
+
return `by ${rowNode.groupingKey ?? ''}`;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return params.value;
|
|
131
|
+
}
|
|
132
|
+
})}
|
|
133
|
+
/>
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
- The `GridFeatureModeConstant` constant no longer exists (#6077) @DanailH
|
|
137
|
+
|
|
138
|
+
```diff
|
|
139
|
+
-import { GridFeatureModeConstant } from '@mui/x-data-grid';
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
#### Changes
|
|
143
|
+
|
|
144
|
+
- [DataGrid] Fix `GridPagination` props typing (#6238) @cherniavskii
|
|
145
|
+
- [DataGrid] Fix `GridRow` not forwarding `ref` to the root element (#6274) @cherniavskii
|
|
146
|
+
- [DataGrid] Fix `undefined` value being showed in filter button tooltip text (#6259) @cherniavskii
|
|
147
|
+
- [DataGrid] Fix blank space when changing page with dynamic row height (#6049) @m4theushw
|
|
148
|
+
- [DataGrid] New internal rows structure for v6 (#4927) @flaviendelangle
|
|
149
|
+
- [DataGrid] Revert cell/row mode if `processRowUpdate` fails (#6185) @m4theushw
|
|
150
|
+
- [DataGrid] Rework overlays layout (#5808) @cherniavskii
|
|
151
|
+
- [DataGrid] Improve print support (#6273) @oliviertassinari
|
|
152
|
+
- [DataGridPremium] Add missing `themeAugmentation` module (#6270) @cherniavskii
|
|
153
|
+
|
|
154
|
+
### `@mui/x-date-pickers@v6.0.0-alpha.1` / `@mui/x-date-pickers-pro@v6.0.0-alpha.1`
|
|
155
|
+
|
|
156
|
+
#### Breaking changes
|
|
157
|
+
|
|
158
|
+
- [pickers] Do not support unparsed date formats anymore (#6170) @flaviendelangle
|
|
159
|
+
|
|
160
|
+
The `value` prop of the pickers now expects a parsed value.
|
|
161
|
+
Until now, it was possible to provide any format that your date management library was able to parse.
|
|
162
|
+
For instance, you could pass `value={new Date()}` when using `AdapterDayjs`.
|
|
163
|
+
|
|
164
|
+
This brought a lot of confusion so we decided to remove this behavior.
|
|
165
|
+
The format expected by the `value` prop is now the same as for any other prop holding a date.
|
|
166
|
+
Here is the syntax to initialize a date picker at the current date for each adapter:
|
|
167
|
+
|
|
168
|
+
```tsx
|
|
169
|
+
// Date-fns
|
|
170
|
+
<DatePicker value={new Date()} />
|
|
171
|
+
|
|
172
|
+
// Dayjs
|
|
173
|
+
import dayjs from 'dayjs'
|
|
174
|
+
<DatePicker value={dayjs()} />
|
|
175
|
+
|
|
176
|
+
// Moment
|
|
177
|
+
import moment from 'moment'
|
|
178
|
+
<DatePicker value={moment()} />
|
|
179
|
+
|
|
180
|
+
// Luxon
|
|
181
|
+
import { DateTime } from 'luxon'
|
|
182
|
+
<DatePicker value={DateTime.now()} />
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
#### Changes
|
|
186
|
+
|
|
187
|
+
- [DatePicker] Respect `minDate` and `maxDate` when opening a `DatePicker` or `DateTimePicker` (#6309) @alexfauquette
|
|
188
|
+
- [DateTimePicker] Fix validation with `shouldDisableMonth` and `shouldDisableYear` (#6266) @flaviendelangle
|
|
189
|
+
- [TimePicker] Add support for `disablePast` and `disableFuture` validation props (#6226) @LukasTy
|
|
190
|
+
- [CalendarPicker] Prevent getting focus when `autoFocus=false` (#6304) @alexfauquette
|
|
191
|
+
- [DateField] Extend moment adapter to support `expandFormat` and `formatTokenMap` (#6215) @alexfauquette
|
|
192
|
+
- [pickers] Allow to control the selected sections (#6209, #6307) @flaviendelangle
|
|
193
|
+
- [pickers] Do not loose the value of date sections not present in the format in the new field components (#6141) @flaviendelangle
|
|
194
|
+
- [pickers] Do not support unparsed date formats anymore (#6170) @flaviendelangle
|
|
195
|
+
- [pickers] Support slots on the `DateField` component (#6048) @flaviendelangle
|
|
196
|
+
- [pickers] Support Luxon v3 in `AdapterLuxon` (#6069) @alexfauquette
|
|
197
|
+
- [pickers] New components `TimeField` and `DateTimeField` (#6312) @flaviendelangle
|
|
198
|
+
- [pickers] Support basic mobile edition on new field components (#5958) @flaviendelangle
|
|
199
|
+
|
|
200
|
+
### Docs
|
|
201
|
+
|
|
202
|
+
- [docs] Fix issue in DataGrid/DataGridPro row styling demo (#6264) @MBilalShafi
|
|
203
|
+
- [docs] Improve pickers Getting Started examples (#6292) @flaviendelangle
|
|
204
|
+
- [docs] Pass model change callbacks in controlled grid editing demos (#6296) @cherniavskii
|
|
205
|
+
- [docs] Update the CodeSandbox to use the `next` branch (#6275) @oliviertassinari
|
|
206
|
+
|
|
207
|
+
### Core
|
|
208
|
+
|
|
209
|
+
- [core] Fix typing error (#6291) @flaviendelangle
|
|
210
|
+
- [core] Fix typo in the state updater of `useField` (#6311) @flaviendelangle
|
|
211
|
+
- [core] Remove `GridFeatureModeConstant` (#6077) @DanailH
|
|
212
|
+
- [core] Simplify testing architecture (#6043) @flaviendelangle
|
|
213
|
+
- [test] Skip test in Chrome non-headless and Edge (#6318) @m4theushw
|
|
214
|
+
|
|
6
215
|
## 6.0.0-alpha.0
|
|
7
216
|
|
|
8
217
|
_Sep 22, 2022_
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useThemeProps } from '@mui/material/styles';
|
|
4
4
|
import { DATA_GRID_DEFAULT_SLOTS_COMPONENTS, GRID_DEFAULT_LOCALE_TEXT } from '../constants';
|
|
5
|
-
import { GridDensityTypes, GridEditModes
|
|
5
|
+
import { GridDensityTypes, GridEditModes } from '../models';
|
|
6
6
|
const DATA_GRID_FORCED_PROPS = {
|
|
7
7
|
apiRef: undefined,
|
|
8
8
|
disableMultipleColumnsFiltering: true,
|
|
@@ -43,7 +43,7 @@ export const DATA_GRID_PROPS_DEFAULT_VALUES = {
|
|
|
43
43
|
disableVirtualization: false,
|
|
44
44
|
disableIgnoreModificationsIfProcessingProps: false,
|
|
45
45
|
editMode: GridEditModes.Cell,
|
|
46
|
-
filterMode:
|
|
46
|
+
filterMode: 'client',
|
|
47
47
|
headerHeight: 56,
|
|
48
48
|
hideFooter: false,
|
|
49
49
|
hideFooterPagination: false,
|
|
@@ -52,14 +52,14 @@ export const DATA_GRID_PROPS_DEFAULT_VALUES = {
|
|
|
52
52
|
logger: console,
|
|
53
53
|
logLevel: process.env.NODE_ENV === 'production' ? 'error' : 'warn',
|
|
54
54
|
pagination: false,
|
|
55
|
-
paginationMode:
|
|
55
|
+
paginationMode: 'client',
|
|
56
56
|
rowHeight: 52,
|
|
57
57
|
rowsPerPageOptions: [25, 50, 100],
|
|
58
58
|
rowSpacingType: 'margin',
|
|
59
59
|
showCellRightBorder: false,
|
|
60
60
|
showColumnRightBorder: false,
|
|
61
61
|
sortingOrder: ['asc', 'desc', null],
|
|
62
|
-
sortingMode:
|
|
62
|
+
sortingMode: 'client',
|
|
63
63
|
throttleRowsMs: 0,
|
|
64
64
|
disableColumnReorder: false,
|
|
65
65
|
disableColumnResize: false,
|
|
@@ -6,7 +6,9 @@ import { GridVirtualScroller } from './virtualization/GridVirtualScroller';
|
|
|
6
6
|
import { GridVirtualScrollerContent } from './virtualization/GridVirtualScrollerContent';
|
|
7
7
|
import { GridVirtualScrollerRenderZone } from './virtualization/GridVirtualScrollerRenderZone';
|
|
8
8
|
import { useGridVirtualScroller } from '../hooks/features/virtualization/useGridVirtualScroller';
|
|
9
|
+
import { GridOverlays } from './base/GridOverlays';
|
|
9
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
12
|
const DataGridVirtualScroller = /*#__PURE__*/React.forwardRef(function DataGridVirtualScroller(props, ref) {
|
|
11
13
|
const {
|
|
12
14
|
className,
|
|
@@ -23,14 +25,14 @@ const DataGridVirtualScroller = /*#__PURE__*/React.forwardRef(function DataGridV
|
|
|
23
25
|
ref,
|
|
24
26
|
disableVirtualization
|
|
25
27
|
});
|
|
26
|
-
return /*#__PURE__*/
|
|
28
|
+
return /*#__PURE__*/_jsxs(GridVirtualScroller, _extends({
|
|
27
29
|
className: className
|
|
28
30
|
}, getRootProps(other), {
|
|
29
|
-
children: /*#__PURE__*/_jsx(GridVirtualScrollerContent, _extends({}, getContentProps(), {
|
|
31
|
+
children: [/*#__PURE__*/_jsx(GridOverlays, {}), /*#__PURE__*/_jsx(GridVirtualScrollerContent, _extends({}, getContentProps(), {
|
|
30
32
|
children: /*#__PURE__*/_jsx(GridVirtualScrollerRenderZone, _extends({}, getRenderZoneProps(), {
|
|
31
33
|
children: getRows()
|
|
32
34
|
}))
|
|
33
|
-
}))
|
|
35
|
+
}))]
|
|
34
36
|
}));
|
|
35
37
|
});
|
|
36
38
|
export { DataGridVirtualScroller };
|
|
@@ -1,2 +1,44 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
export declare const GridPagination: React.ForwardRefExoticComponent<
|
|
2
|
+
export declare const GridPagination: React.ForwardRefExoticComponent<(Pick<Partial<import("@mui/material/TablePagination").TablePaginationBaseProps & {
|
|
3
|
+
ActionsComponent?: React.ElementType<import("@mui/material/TablePagination/TablePaginationActions").TablePaginationActionsProps> | undefined;
|
|
4
|
+
backIconButtonProps?: Partial<import("@mui/material").IconButtonProps<"button", {}>> | undefined;
|
|
5
|
+
classes?: Partial<import("@mui/material/TablePagination").TablePaginationClasses> | undefined;
|
|
6
|
+
count: number;
|
|
7
|
+
getItemAriaLabel?: ((type: "first" | "last" | "next" | "previous") => string) | undefined;
|
|
8
|
+
labelDisplayedRows?: ((paginationInfo: import("@mui/material/TablePagination").LabelDisplayedRowsArgs) => React.ReactNode) | undefined;
|
|
9
|
+
labelRowsPerPage?: React.ReactNode;
|
|
10
|
+
nextIconButtonProps?: Partial<import("@mui/material").IconButtonProps<"button", {}>> | undefined;
|
|
11
|
+
onPageChange: (event: React.MouseEvent<HTMLButtonElement, MouseEvent> | null, page: number) => void;
|
|
12
|
+
onRowsPerPageChange?: React.ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement> | undefined;
|
|
13
|
+
page: number;
|
|
14
|
+
rowsPerPage: number;
|
|
15
|
+
rowsPerPageOptions?: (number | {
|
|
16
|
+
value: number;
|
|
17
|
+
label: string;
|
|
18
|
+
})[] | undefined;
|
|
19
|
+
SelectProps?: Partial<import("@mui/material").SelectProps<unknown>> | undefined;
|
|
20
|
+
showFirstButton?: boolean | undefined;
|
|
21
|
+
showLastButton?: boolean | undefined;
|
|
22
|
+
sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
|
|
23
|
+
} & import("@mui/material/OverridableComponent").CommonProps & Omit<import("@mui/material/TablePagination").TablePaginationBaseProps, "hidden" | "color" | "page" | "size" | "height" | "translate" | "width" | "padding" | "abbr" | "slot" | "title" | "ref" | "colSpan" | "headers" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "rowSpan" | "scope" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "align" | "valign" | "sx" | keyof import("@mui/material/OverridableComponent").CommonProps | "variant" | "count" | "getItemAriaLabel" | "labelDisplayedRows" | "labelRowsPerPage" | "onPageChange" | "onRowsPerPageChange" | "rowsPerPage" | "rowsPerPageOptions" | "showFirstButton" | "showLastButton" | "backIconButtonProps" | "nextIconButtonProps" | "sortDirection" | "ActionsComponent" | "SelectProps">>, "hidden" | "color" | "page" | "size" | "height" | "translate" | "width" | "padding" | "abbr" | "slot" | "title" | "colSpan" | "headers" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "rowSpan" | "scope" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "align" | "valign" | "sx" | keyof import("@mui/material/OverridableComponent").CommonProps | "variant" | "count" | "getItemAriaLabel" | "labelDisplayedRows" | "labelRowsPerPage" | "onPageChange" | "onRowsPerPageChange" | "rowsPerPage" | "rowsPerPageOptions" | "showFirstButton" | "showLastButton" | "backIconButtonProps" | "nextIconButtonProps" | "sortDirection" | "ActionsComponent" | "SelectProps"> | Pick<Partial<import("@mui/material/TablePagination").TablePaginationBaseProps & {
|
|
24
|
+
ActionsComponent?: React.ElementType<import("@mui/material/TablePagination/TablePaginationActions").TablePaginationActionsProps> | undefined;
|
|
25
|
+
backIconButtonProps?: Partial<import("@mui/material").IconButtonProps<"button", {}>> | undefined;
|
|
26
|
+
classes?: Partial<import("@mui/material/TablePagination").TablePaginationClasses> | undefined;
|
|
27
|
+
count: number;
|
|
28
|
+
getItemAriaLabel?: ((type: "first" | "last" | "next" | "previous") => string) | undefined;
|
|
29
|
+
labelDisplayedRows?: ((paginationInfo: import("@mui/material/TablePagination").LabelDisplayedRowsArgs) => React.ReactNode) | undefined;
|
|
30
|
+
labelRowsPerPage?: React.ReactNode;
|
|
31
|
+
nextIconButtonProps?: Partial<import("@mui/material").IconButtonProps<"button", {}>> | undefined;
|
|
32
|
+
onPageChange: (event: React.MouseEvent<HTMLButtonElement, MouseEvent> | null, page: number) => void;
|
|
33
|
+
onRowsPerPageChange?: React.ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement> | undefined;
|
|
34
|
+
page: number;
|
|
35
|
+
rowsPerPage: number;
|
|
36
|
+
rowsPerPageOptions?: (number | {
|
|
37
|
+
value: number;
|
|
38
|
+
label: string;
|
|
39
|
+
})[] | undefined;
|
|
40
|
+
SelectProps?: Partial<import("@mui/material").SelectProps<unknown>> | undefined;
|
|
41
|
+
showFirstButton?: boolean | undefined;
|
|
42
|
+
showLastButton?: boolean | undefined;
|
|
43
|
+
sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
|
|
44
|
+
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("@mui/material/TablePagination").TablePaginationBaseProps, "hidden" | "color" | "size" | "style" | "height" | "translate" | "width" | "padding" | "abbr" | "slot" | "title" | "colSpan" | "headers" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "rowSpan" | "scope" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "align" | "valign" | "sx" | "variant" | "sortDirection"> & React.RefAttributes<React.Component<any, any, any>>, "hidden" | "color" | "page" | "size" | "height" | "translate" | "width" | "padding" | "abbr" | "slot" | "title" | "ref" | "colSpan" | "headers" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "rowSpan" | "scope" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "align" | "valign" | "sx" | keyof import("@mui/material/OverridableComponent").CommonProps | "variant" | "count" | "getItemAriaLabel" | "labelDisplayedRows" | "labelRowsPerPage" | "onPageChange" | "onRowsPerPageChange" | "rowsPerPage" | "rowsPerPageOptions" | "showFirstButton" | "showLastButton" | "backIconButtonProps" | "nextIconButtonProps" | "sortDirection" | "ActionsComponent" | "SelectProps">>, "hidden" | "color" | "page" | "size" | "height" | "translate" | "width" | "padding" | "abbr" | "slot" | "title" | "key" | "colSpan" | "headers" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "rowSpan" | "scope" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "align" | "valign" | "sx" | keyof import("@mui/material/OverridableComponent").CommonProps | "variant" | "count" | "getItemAriaLabel" | "labelDisplayedRows" | "labelRowsPerPage" | "onPageChange" | "onRowsPerPageChange" | "rowsPerPage" | "rowsPerPageOptions" | "showFirstButton" | "showLastButton" | "backIconButtonProps" | "nextIconButtonProps" | "sortDirection" | "ActionsComponent" | "SelectProps">) & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -53,8 +53,7 @@ export const GridPagination = /*#__PURE__*/React.forwardRef(function GridPaginat
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
return /*#__PURE__*/_jsx(GridPaginationRoot, _extends({
|
|
56
|
-
ref: ref
|
|
57
|
-
,
|
|
56
|
+
ref: ref,
|
|
58
57
|
component: "div",
|
|
59
58
|
count: paginationState.rowCount,
|
|
60
59
|
page: paginationState.page <= lastPage ? paginationState.page : lastPage,
|
package/components/GridRow.d.ts
CHANGED
|
@@ -28,8 +28,5 @@ export interface GridRowProps {
|
|
|
28
28
|
onMouseEnter?: React.MouseEventHandler<HTMLDivElement>;
|
|
29
29
|
onMouseLeave?: React.MouseEventHandler<HTMLDivElement>;
|
|
30
30
|
}
|
|
31
|
-
declare
|
|
32
|
-
declare namespace GridRow {
|
|
33
|
-
var propTypes: any;
|
|
34
|
-
}
|
|
31
|
+
declare const GridRow: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & GridRowProps & React.RefAttributes<HTMLDivElement>>;
|
|
35
32
|
export { GridRow };
|
package/components/GridRow.js
CHANGED
|
@@ -5,7 +5,7 @@ const _excluded = ["selected", "rowId", "row", "index", "style", "position", "ro
|
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import clsx from 'clsx';
|
|
8
|
-
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
8
|
+
import { unstable_composeClasses as composeClasses, useForkRef } from '@mui/material';
|
|
9
9
|
import { GridEditModes, GridRowModes, GridCellModes } from '../models/gridEditRowModel';
|
|
10
10
|
import { useGridApiContext } from '../hooks/utils/useGridApiContext';
|
|
11
11
|
import { getDataGridUtilityClass, gridClasses } from '../constants/gridClasses';
|
|
@@ -18,7 +18,7 @@ import { GRID_CHECKBOX_SELECTION_COL_DEF } from '../colDef/gridCheckboxSelection
|
|
|
18
18
|
import { GRID_ACTIONS_COLUMN_TYPE } from '../colDef/gridActionsColDef';
|
|
19
19
|
import { GRID_DETAIL_PANEL_TOGGLE_FIELD } from '../constants/gridDetailPanelToggleField';
|
|
20
20
|
import { gridSortModelSelector } from '../hooks/features/sorting/gridSortingSelector';
|
|
21
|
-
import {
|
|
21
|
+
import { gridRowMaximumTreeDepthSelector } from '../hooks/features/rows/gridRowsSelector';
|
|
22
22
|
import { gridDensityHeaderGroupingMaxDepthSelector } from '../hooks/features/density/densitySelector';
|
|
23
23
|
import { randomNumberBetween } from '../utils/utils';
|
|
24
24
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -55,7 +55,7 @@ const EmptyCell = ({
|
|
|
55
55
|
}); // TODO change to .MuiDataGrid-emptyCell or .MuiDataGrid-rowFiller
|
|
56
56
|
};
|
|
57
57
|
|
|
58
|
-
function GridRow(props) {
|
|
58
|
+
const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
59
59
|
var _apiRef$current$getRo;
|
|
60
60
|
|
|
61
61
|
const {
|
|
@@ -88,8 +88,9 @@ function GridRow(props) {
|
|
|
88
88
|
const currentPage = useGridVisibleRows(apiRef, rootProps);
|
|
89
89
|
const columnsTotalWidth = useGridSelector(apiRef, gridColumnsTotalWidthSelector);
|
|
90
90
|
const sortModel = useGridSelector(apiRef, gridSortModelSelector);
|
|
91
|
-
const treeDepth = useGridSelector(apiRef,
|
|
91
|
+
const treeDepth = useGridSelector(apiRef, gridRowMaximumTreeDepthSelector);
|
|
92
92
|
const headerGroupingMaxDepth = useGridSelector(apiRef, gridDensityHeaderGroupingMaxDepthSelector);
|
|
93
|
+
const handleRef = useForkRef(ref, refProp);
|
|
93
94
|
const ariaRowIndex = index + headerGroupingMaxDepth + 2; // 1 for the header row and 1 as it's 1-based
|
|
94
95
|
|
|
95
96
|
const {
|
|
@@ -332,6 +333,7 @@ function GridRow(props) {
|
|
|
332
333
|
}
|
|
333
334
|
|
|
334
335
|
const randomNumber = randomNumberBetween(10000, 20, 80);
|
|
336
|
+
const rowType = apiRef.current.getRowNode(rowId).type;
|
|
335
337
|
const cells = [];
|
|
336
338
|
|
|
337
339
|
for (let i = 0; i < renderedColumns.length; i += 1) {
|
|
@@ -343,7 +345,7 @@ function GridRow(props) {
|
|
|
343
345
|
const cellColSpanInfo = apiRef.current.unstable_getCellColSpanInfo(rowId, indexRelativeToAllColumns);
|
|
344
346
|
|
|
345
347
|
if (cellColSpanInfo && !cellColSpanInfo.spannedByColSpan) {
|
|
346
|
-
if (
|
|
348
|
+
if (rowType !== 'skeletonRow') {
|
|
347
349
|
const {
|
|
348
350
|
colSpan,
|
|
349
351
|
width
|
|
@@ -378,7 +380,7 @@ function GridRow(props) {
|
|
|
378
380
|
onMouseLeave: publish('rowMouseLeave', onMouseLeave)
|
|
379
381
|
} : null;
|
|
380
382
|
return /*#__PURE__*/_jsxs("div", _extends({
|
|
381
|
-
ref:
|
|
383
|
+
ref: handleRef,
|
|
382
384
|
"data-id": rowId,
|
|
383
385
|
"data-rowindex": index,
|
|
384
386
|
role: "row",
|
|
@@ -391,8 +393,7 @@ function GridRow(props) {
|
|
|
391
393
|
width: emptyCellWidth
|
|
392
394
|
})]
|
|
393
395
|
}));
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
+
});
|
|
396
397
|
process.env.NODE_ENV !== "production" ? GridRow.propTypes = {
|
|
397
398
|
// ----------------------------- Warning --------------------------------
|
|
398
399
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -3,7 +3,6 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
|
|
4
4
|
import { GridMainContainer } from '../containers/GridMainContainer';
|
|
5
5
|
import { GridAutoSizer } from '../GridAutoSizer';
|
|
6
|
-
import { GridOverlays } from './GridOverlays';
|
|
7
6
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
8
7
|
import { useGridSelector } from '../../hooks/utils/useGridSelector';
|
|
9
8
|
import { gridDensityTotalHeaderHeightSelector } from '../../hooks/features/density/densitySelector';
|
|
@@ -51,7 +50,7 @@ function GridBody(props) {
|
|
|
51
50
|
apiRef.current.publishEvent('resize', size);
|
|
52
51
|
}, [apiRef]);
|
|
53
52
|
return /*#__PURE__*/_jsxs(GridMainContainer, {
|
|
54
|
-
children: [/*#__PURE__*/_jsx(
|
|
53
|
+
children: [/*#__PURE__*/_jsx(ColumnHeadersComponent, {
|
|
55
54
|
ref: columnsContainerRef,
|
|
56
55
|
innerRef: columnHeadersRef
|
|
57
56
|
}), /*#__PURE__*/_jsx(GridAutoSizer, {
|
|
@@ -1,20 +1,55 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/material/utils';
|
|
4
|
+
import { styled } from '@mui/material/styles';
|
|
5
|
+
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
6
|
+
import clsx from 'clsx';
|
|
4
7
|
import { useGridSelector } from '../../hooks/utils/useGridSelector';
|
|
5
8
|
import { gridVisibleRowCountSelector } from '../../hooks/features/filter/gridFilterSelector';
|
|
6
9
|
import { gridRowCountSelector, gridRowsLoadingSelector } from '../../hooks/features/rows/gridRowsSelector';
|
|
7
10
|
import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
|
|
8
11
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
9
|
-
import {
|
|
12
|
+
import { getMinimalContentHeight } from '../../hooks/features/rows/gridRowsUtils';
|
|
13
|
+
import { getDataGridUtilityClass } from '../../constants/gridClasses';
|
|
10
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
+
const GridOverlayWrapperRoot = styled('div', {
|
|
16
|
+
name: 'MuiDataGrid',
|
|
17
|
+
slot: 'OverlayWrapper',
|
|
18
|
+
overridesResolver: (props, styles) => styles.overlayWrapper
|
|
19
|
+
})({
|
|
20
|
+
position: 'sticky',
|
|
21
|
+
// To stay in place while scrolling
|
|
22
|
+
top: 0,
|
|
23
|
+
left: 0,
|
|
24
|
+
width: 0,
|
|
25
|
+
// To stay above the content instead of shifting it down
|
|
26
|
+
height: 0,
|
|
27
|
+
// To stay above the content instead of shifting it down
|
|
28
|
+
zIndex: 4 // Should be above pinned columns, pinned rows and detail panel
|
|
29
|
+
|
|
30
|
+
});
|
|
31
|
+
const GridOverlayWrapperInner = styled('div', {
|
|
32
|
+
name: 'MuiDataGrid',
|
|
33
|
+
slot: 'OverlayWrapperInner',
|
|
34
|
+
overridesResolver: (props, styles) => styles.overlayWrapperInner
|
|
35
|
+
})({});
|
|
36
|
+
|
|
37
|
+
const useUtilityClasses = ownerState => {
|
|
38
|
+
const {
|
|
39
|
+
classes
|
|
40
|
+
} = ownerState;
|
|
41
|
+
const slots = {
|
|
42
|
+
root: ['overlayWrapper'],
|
|
43
|
+
inner: ['overlayWrapperInner']
|
|
44
|
+
};
|
|
45
|
+
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
46
|
+
};
|
|
11
47
|
|
|
12
48
|
function GridOverlayWrapper(props) {
|
|
13
49
|
var _viewportInnerSize$he, _viewportInnerSize$wi;
|
|
14
50
|
|
|
15
51
|
const apiRef = useGridApiContext();
|
|
16
52
|
const rootProps = useGridRootProps();
|
|
17
|
-
const totalHeaderHeight = useGridSelector(apiRef, gridDensityTotalHeaderHeightSelector);
|
|
18
53
|
const [viewportInnerSize, setViewportInnerSize] = React.useState(() => {
|
|
19
54
|
var _apiRef$current$getRo, _apiRef$current$getRo2;
|
|
20
55
|
|
|
@@ -31,22 +66,27 @@ function GridOverlayWrapper(props) {
|
|
|
31
66
|
let height = (_viewportInnerSize$he = viewportInnerSize == null ? void 0 : viewportInnerSize.height) != null ? _viewportInnerSize$he : 0;
|
|
32
67
|
|
|
33
68
|
if (rootProps.autoHeight && height === 0) {
|
|
34
|
-
height =
|
|
69
|
+
height = getMinimalContentHeight(apiRef); // Give room to show the overlay when there no rows.
|
|
35
70
|
}
|
|
36
71
|
|
|
72
|
+
const classes = useUtilityClasses(_extends({}, props, {
|
|
73
|
+
classes: rootProps.classes
|
|
74
|
+
}));
|
|
75
|
+
|
|
37
76
|
if (!viewportInnerSize) {
|
|
38
77
|
return null;
|
|
39
78
|
}
|
|
40
79
|
|
|
41
|
-
return /*#__PURE__*/_jsx(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
80
|
+
return /*#__PURE__*/_jsx(GridOverlayWrapperRoot, {
|
|
81
|
+
className: clsx(classes.root),
|
|
82
|
+
children: /*#__PURE__*/_jsx(GridOverlayWrapperInner, _extends({
|
|
83
|
+
className: clsx(classes.inner),
|
|
84
|
+
style: {
|
|
85
|
+
height,
|
|
86
|
+
width: (_viewportInnerSize$wi = viewportInnerSize == null ? void 0 : viewportInnerSize.width) != null ? _viewportInnerSize$wi : 0
|
|
87
|
+
}
|
|
88
|
+
}, props))
|
|
89
|
+
});
|
|
50
90
|
}
|
|
51
91
|
|
|
52
92
|
export function GridOverlays() {
|
|
@@ -7,6 +7,7 @@ import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
|
7
7
|
import { getDataGridUtilityClass } from '../../constants/gridClasses';
|
|
8
8
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
9
9
|
import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
|
|
10
|
+
import { isAutoGeneratedRow } from '../../hooks/features/rows/gridRowsUtils';
|
|
10
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
12
|
|
|
12
13
|
const useUtilityClasses = ownerState => {
|
|
@@ -131,7 +132,7 @@ process.env.NODE_ENV !== "production" ? GridBooleanCellRaw.propTypes = {
|
|
|
131
132
|
const GridBooleanCell = /*#__PURE__*/React.memo(GridBooleanCellRaw);
|
|
132
133
|
export { GridBooleanCell };
|
|
133
134
|
export const renderBooleanCell = params => {
|
|
134
|
-
if (params.rowNode
|
|
135
|
+
if (isAutoGeneratedRow(params.rowNode)) {
|
|
135
136
|
return '';
|
|
136
137
|
}
|
|
137
138
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { GridRenderCellParams } from '../../models/params/gridCellParams';
|
|
3
|
-
declare const GridCellCheckboxForwardRef: React.ForwardRefExoticComponent<GridRenderCellParams<any, any, any> & React.RefAttributes<HTMLInputElement>>;
|
|
3
|
+
declare const GridCellCheckboxForwardRef: React.ForwardRefExoticComponent<GridRenderCellParams<any, any, any, import("../..").GridTreeNodeWithRender> & React.RefAttributes<HTMLInputElement>>;
|
|
4
4
|
export { GridCellCheckboxForwardRef };
|
|
5
|
-
export declare const GridCellCheckboxRenderer: React.MemoExoticComponent<React.ForwardRefExoticComponent<GridRenderCellParams<any, any, any> & React.RefAttributes<HTMLInputElement>>>;
|
|
5
|
+
export declare const GridCellCheckboxRenderer: React.MemoExoticComponent<React.ForwardRefExoticComponent<GridRenderCellParams<any, any, any, import("../..").GridTreeNodeWithRender> & React.RefAttributes<HTMLInputElement>>>;
|