@mui/x-data-grid-pro 5.6.0 → 5.8.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 +187 -0
- package/DataGridPro/DataGridPro.d.ts +7 -1
- package/DataGridPro/DataGridPro.js +63 -20
- package/DataGridPro/useDataGridProComponent.js +29 -18
- package/DataGridPro/useDataGridProProps.d.ts +2 -1
- package/DataGridPro/useDataGridProProps.js +2 -2
- package/components/DataGridProColumnHeaders.js +10 -10
- package/components/DataGridProVirtualScroller.js +12 -23
- package/components/GridDetailPanelToggleCell.js +4 -3
- package/components/GridGroupingCriteriaCell.d.ts +2 -5
- package/components/GridGroupingCriteriaCell.js +2 -74
- package/components/GridTreeDataGroupingCell.js +4 -3
- package/components/index.d.ts +1 -0
- package/components/index.js +2 -1
- package/hooks/features/columnPinning/useGridColumnPinning.js +6 -6
- package/hooks/features/columnPinning/useGridColumnPinningPreProcessors.js +2 -2
- package/hooks/features/columnReorder/useGridColumnReorder.d.ts +2 -0
- package/hooks/features/columnReorder/useGridColumnReorder.js +7 -8
- package/hooks/features/columnResize/useGridColumnResize.d.ts +2 -0
- package/hooks/features/columnResize/useGridColumnResize.js +7 -7
- package/hooks/features/detailPanel/useGridDetailPanel.d.ts +2 -0
- package/hooks/features/detailPanel/useGridDetailPanel.js +10 -10
- package/hooks/features/detailPanel/useGridDetailPanelPreProcessors.js +2 -2
- package/hooks/features/infiniteLoader/useGridInfiniteLoader.js +2 -2
- package/hooks/features/rowGrouping/gridRowGroupingInterfaces.d.ts +6 -0
- package/hooks/features/rowGrouping/gridRowGroupingUtils.d.ts +5 -2
- package/hooks/features/rowGrouping/gridRowGroupingUtils.js +18 -3
- package/hooks/features/rowGrouping/useGridRowGrouping.js +46 -167
- package/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.d.ts +1 -1
- package/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +131 -4
- package/hooks/features/treeData/gridTreeDataUtils.d.ts +1 -0
- package/hooks/features/treeData/gridTreeDataUtils.js +2 -0
- package/hooks/features/treeData/useGridTreeData.d.ts +1 -5
- package/hooks/features/treeData/useGridTreeData.js +3 -82
- package/hooks/features/treeData/useGridTreeDataPreProcessors.d.ts +1 -1
- package/hooks/features/treeData/useGridTreeDataPreProcessors.js +73 -4
- package/index.d.ts +2 -1
- package/index.js +3 -2
- package/legacy/DataGridPro/DataGridPro.js +63 -20
- package/legacy/DataGridPro/useDataGridProComponent.js +29 -18
- package/legacy/DataGridPro/useDataGridProProps.js +7 -2
- package/legacy/components/DataGridProColumnHeaders.js +10 -10
- package/legacy/components/DataGridProVirtualScroller.js +12 -22
- package/legacy/components/GridDetailPanelToggleCell.js +4 -3
- package/legacy/components/GridGroupingCriteriaCell.js +2 -74
- package/legacy/components/GridTreeDataGroupingCell.js +4 -3
- package/legacy/components/index.js +2 -1
- package/legacy/hooks/features/columnPinning/useGridColumnPinning.js +6 -6
- package/legacy/hooks/features/columnPinning/useGridColumnPinningPreProcessors.js +2 -2
- package/legacy/hooks/features/columnReorder/useGridColumnReorder.js +9 -10
- package/legacy/hooks/features/columnResize/useGridColumnResize.js +9 -9
- package/legacy/hooks/features/detailPanel/useGridDetailPanel.js +10 -10
- package/legacy/hooks/features/detailPanel/useGridDetailPanelPreProcessors.js +2 -2
- package/legacy/hooks/features/infiniteLoader/useGridInfiniteLoader.js +2 -2
- package/legacy/hooks/features/rowGrouping/gridRowGroupingUtils.js +19 -2
- package/legacy/hooks/features/rowGrouping/useGridRowGrouping.js +48 -172
- package/legacy/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +138 -4
- package/legacy/hooks/features/treeData/gridTreeDataUtils.js +2 -0
- package/legacy/hooks/features/treeData/useGridTreeData.js +3 -90
- package/legacy/hooks/features/treeData/useGridTreeDataPreProcessors.js +85 -4
- package/legacy/index.js +3 -2
- package/legacy/utils/releaseInfo.js +15 -0
- package/models/dataGridProProps.d.ts +9 -8
- package/models/gridGroupingColDefOverride.d.ts +2 -2
- package/models/gridGroupingValueGetterParams.d.ts +1 -1
- package/modern/DataGridPro/DataGridPro.js +63 -20
- package/modern/DataGridPro/useDataGridProComponent.js +27 -18
- package/modern/DataGridPro/useDataGridProProps.js +2 -2
- package/modern/components/DataGridProColumnHeaders.js +10 -10
- package/modern/components/DataGridProVirtualScroller.js +12 -23
- package/modern/components/GridDetailPanelToggleCell.js +4 -3
- package/modern/components/GridGroupingCriteriaCell.js +2 -74
- package/modern/components/GridTreeDataGroupingCell.js +4 -3
- package/modern/components/index.js +2 -1
- package/modern/hooks/features/columnPinning/useGridColumnPinning.js +6 -6
- package/modern/hooks/features/columnPinning/useGridColumnPinningPreProcessors.js +2 -2
- package/modern/hooks/features/columnReorder/useGridColumnReorder.js +7 -8
- package/modern/hooks/features/columnResize/useGridColumnResize.js +7 -7
- package/modern/hooks/features/detailPanel/useGridDetailPanel.js +9 -9
- package/modern/hooks/features/detailPanel/useGridDetailPanelPreProcessors.js +2 -2
- package/modern/hooks/features/infiniteLoader/useGridInfiniteLoader.js +2 -2
- package/modern/hooks/features/rowGrouping/gridRowGroupingUtils.js +18 -3
- package/modern/hooks/features/rowGrouping/useGridRowGrouping.js +46 -167
- package/modern/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +131 -4
- package/modern/hooks/features/treeData/gridTreeDataUtils.js +2 -0
- package/modern/hooks/features/treeData/useGridTreeData.js +3 -82
- package/modern/hooks/features/treeData/useGridTreeDataPreProcessors.js +73 -4
- package/modern/index.js +3 -2
- package/modern/utils/releaseInfo.js +15 -0
- package/node/DataGridPro/DataGridPro.js +61 -19
- package/node/DataGridPro/useDataGridProComponent.js +26 -15
- package/node/DataGridPro/useDataGridProProps.js +2 -2
- package/node/components/DataGridProColumnHeaders.js +10 -10
- package/node/components/DataGridProVirtualScroller.js +11 -22
- package/node/components/GridDetailPanelToggleCell.js +4 -3
- package/node/components/GridGroupingCriteriaCell.js +1 -72
- package/node/components/GridTreeDataGroupingCell.js +4 -3
- package/node/components/index.js +13 -0
- package/node/hooks/features/columnPinning/useGridColumnPinning.js +5 -5
- package/node/hooks/features/columnPinning/useGridColumnPinningPreProcessors.js +1 -1
- package/node/hooks/features/columnReorder/useGridColumnReorder.js +10 -9
- package/node/hooks/features/columnResize/useGridColumnResize.js +9 -6
- package/node/hooks/features/detailPanel/useGridDetailPanel.js +13 -10
- package/node/hooks/features/detailPanel/useGridDetailPanelPreProcessors.js +1 -1
- package/node/hooks/features/infiniteLoader/useGridInfiniteLoader.js +1 -1
- package/node/hooks/features/rowGrouping/gridRowGroupingUtils.js +24 -5
- package/node/hooks/features/rowGrouping/useGridRowGrouping.js +42 -165
- package/node/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +134 -1
- package/node/hooks/features/treeData/gridTreeDataUtils.js +5 -2
- package/node/hooks/features/treeData/useGridTreeData.js +2 -91
- package/node/hooks/features/treeData/useGridTreeDataPreProcessors.js +75 -3
- package/node/index.js +23 -9
- package/node/utils/releaseInfo.js +25 -0
- package/package.json +5 -4
- package/typeOverloads/modules.d.ts +6 -6
- package/typeOverloads/reexports.d.ts +1 -1
- package/utils/releaseInfo.d.ts +1 -0
- package/utils/releaseInfo.js +15 -0
- package/utils/tree/buildRowTree.d.ts +3 -3
- package/components/Watermark.d.ts +0 -2
- package/components/Watermark.js +0 -43
- package/legacy/components/Watermark.js +0 -43
- package/modern/components/Watermark.js +0 -43
- package/node/components/Watermark.js +0 -56
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,193 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 5.8.0
|
|
7
|
+
<!-- generated comparing v5.7.0..master -->
|
|
8
|
+
_Apr 4, 2022_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 7 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🚀 Expose new methods to save and restore the grid state (#4028) @flaviendelangle
|
|
13
|
+
|
|
14
|
+
The different methods to save and restore the data-grid state are now [documented](mui.com/components/data-grid/state/#save-and-restore-the-state)
|
|
15
|
+
|
|
16
|
+
- ⌚️ Move date and time picker components from the lab (#3451) @flaviendelangle
|
|
17
|
+
|
|
18
|
+
Date and time picker components have been moved to the MUI-X repo.
|
|
19
|
+
They are now accessible in their own packages: `@mui/x-date-pickers` and `@mui/x-date-pickers-pro`.
|
|
20
|
+
For more information, you can read the [blog article](https://mui.com/blog/lab-pickers-to-mui-x) and the [migration guide](https://mui.com/x/react-date-pickers/migration-lab)
|
|
21
|
+
|
|
22
|
+
- 📝 Add `onProcessRowUpdateError` prop to simplify error management in edit mode (#4267) @m4theushw
|
|
23
|
+
- ✨ Add generic typing to `GridColDef` and derived interfaces (#4064) @flaviendelangle
|
|
24
|
+
|
|
25
|
+
You can now strongly type all the objects related to the row and the cell values.
|
|
26
|
+
Here is an example, you can find out more in the description of #4064.
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
const rows: Movie[] = [];
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<DataGrid
|
|
33
|
+
rows={rows}
|
|
34
|
+
columns={[{
|
|
35
|
+
// typeof params.row => Movie (R)
|
|
36
|
+
valueGetter: params => params.row.year,
|
|
37
|
+
}]}
|
|
38
|
+
/>
|
|
39
|
+
);
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### `@mui/x-data-grid@v5.8.0` / `@mui/x-data-grid-pro@v5.8.0`
|
|
43
|
+
|
|
44
|
+
#### Changes
|
|
45
|
+
|
|
46
|
+
- [DataGrid] Add `onProcessRowUpdateError` prop (#4267) @m4theushw
|
|
47
|
+
- [DataGrid] Add generic typing to `GridColDef` and derived interfaces (#4064) @flaviendelangle
|
|
48
|
+
- [DataGrid] Add missing classes on `gridClasses` and `gridPanelClasses` (#4273) @flaviendelangle
|
|
49
|
+
- [DataGrid] Add `onPreferencePanelClose`/`onPreferencePanelOpen` props (#4265) @kyeongsoosoo
|
|
50
|
+
- [DataGrid] Add slot for filter icon button (#4276) @m4theushw
|
|
51
|
+
- [DataGrid] Add the documentation of the portable state (#4028) @flaviendelangle
|
|
52
|
+
- [DataGrid] Allow to use keyboard navigation even with no rows (#4302) @alexfauquette
|
|
53
|
+
- [DataGrid] Fix inconsistency in the border of the last column (#4224) @alexfauquette
|
|
54
|
+
- [DataGrid] Fix overlay blocking scrollbar when rows is empty (#4281) @m4theushw
|
|
55
|
+
- [DataGrid] Improve selection with keyboard (#4157) @flaviendelangle
|
|
56
|
+
- [DataGrid] Scroll to the top of the page when changing page (#4272) @flaviendelangle
|
|
57
|
+
- [l10n] Improve Danish (da-DK) locale (#4271) @simplenotezy
|
|
58
|
+
|
|
59
|
+
### `@mui/x-date-pickers@v5.0.0-alpha.0` / `@mui/x-date-pickers-pro@v5.0.0-alpha.0`
|
|
60
|
+
|
|
61
|
+
#### Changes
|
|
62
|
+
|
|
63
|
+
- [DatePicker] Import date-picker components from the lab (#3451) @flaviendelangle
|
|
64
|
+
|
|
65
|
+
### Docs
|
|
66
|
+
|
|
67
|
+
- [docs] Create an home page for "Advanced Components" (#4298) @flaviendelangle
|
|
68
|
+
- [docs] Update installation docs (#4259) @cherniavskii
|
|
69
|
+
- [docs] New page for the migration of date and time pickers from the lab (#4327) @flaviendelangle
|
|
70
|
+
|
|
71
|
+
### Core
|
|
72
|
+
|
|
73
|
+
- [core] Fix typo in issue template @oliviertassinari
|
|
74
|
+
- [core] Move last variables outside of the models folder (#4303) @flaviendelangle
|
|
75
|
+
- [core] Remove dead code (#4283) @oliviertassinari
|
|
76
|
+
- [core] Rename the "pre-processing" concept "pipe-processing" (#4261) @flaviendelangle
|
|
77
|
+
- [core] Reuse previous state when updating the columns prop (#4229) @m4theushw
|
|
78
|
+
- [core] Fix Argos flakyness for pickers tests (#4312) @flaviendelangle
|
|
79
|
+
|
|
80
|
+
## 5.7.0
|
|
81
|
+
|
|
82
|
+
_Mar 24, 2022_
|
|
83
|
+
|
|
84
|
+
We'd like to offer a big thanks to the 12 contributors who made this release possible. Here are some highlights ✨:
|
|
85
|
+
|
|
86
|
+
- ✏ Add a new editing API with better support for server-side persistence and validation (#3963, #4060) @m4theushw
|
|
87
|
+
|
|
88
|
+
The new API is stable, but to avoid any breaking changes or conflicts with the old API, you must add the following flag to access it:
|
|
89
|
+
|
|
90
|
+
```tsx
|
|
91
|
+
<DataGrid experimentalFeatures={{ newEditingApi: true }} />
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
⚠ Users relying on the old API (legacy) don't need to worry as it will continue to work until v6.
|
|
95
|
+
|
|
96
|
+
The new API also features brand new documentation with more useful demos and guides explaining how to create custom edit components.
|
|
97
|
+
Visit the new [documentation](https://mui.com/components/data-grid/editing/) for more information.
|
|
98
|
+
|
|
99
|
+
- 📚 Documentation improvements
|
|
100
|
+
- 🐞 Bug and typo fixes
|
|
101
|
+
|
|
102
|
+
### `@mui/x-data-grid@v5.7.0` / `@mui/x-data-grid-pro@v5.7.0`
|
|
103
|
+
|
|
104
|
+
#### Changes
|
|
105
|
+
|
|
106
|
+
- [DataGrid] Add column order and dimensions to the portable state (#3816) @flaviendelangle
|
|
107
|
+
- [DataGrid] Add new editing API (#3963) @m4theushw
|
|
108
|
+
- [DataGrid] Allow to customize `ColumnsPanel` with `componentsProps` prop (#4207) @alexfauquette
|
|
109
|
+
- [DataGrid] Do not unselect row when <kbd>Shift</kbd> + click on the last selected row of a range (#4196) @flaviendelangle
|
|
110
|
+
- [DataGrid] Fix `showCellRightBorder` not working in the last row (#4140) @cherniavskii
|
|
111
|
+
- [DataGrid] Fix error overlay not visible when `autoHeight` is enabled (#4110) @cherniavskii
|
|
112
|
+
- [DataGrid] Fix white blank when scrolling (#4158) @alexfauquette
|
|
113
|
+
- [DataGrid] Adjust type of the `description` prop in `GridColumnHeaderTitle` (#4247) @baahrens
|
|
114
|
+
- [DataGrid] Fix focus after stopping row edit mode (#4252) @m4theushw
|
|
115
|
+
- [DataGridPro] Fix pinned columns edge overflow with custom `borderRadius` (#4188) @socramm9
|
|
116
|
+
- [DataGridPro] Fix tab switching order with pinned columns and `editMode="row"` (#4198) @cherniavskii
|
|
117
|
+
- [l10n] Improve Persian (fa-IR) locale (#4227) @SaeedZhiany
|
|
118
|
+
- [l10n] Improve Polish (pl-PL) locale (#4153) @pbmchc
|
|
119
|
+
- [l10n] Improve Arabic (ar-SD) locale (#4212) @shadigaafar
|
|
120
|
+
- [l10n] Improve Korean (ko-KR) locale (#4245) @kyeongsoosoo
|
|
121
|
+
|
|
122
|
+
### Docs
|
|
123
|
+
|
|
124
|
+
- [docs] Clean demo (#4073) @alexfauquette
|
|
125
|
+
- [docs] Delete restore state demos (#4220) @flaviendelangle
|
|
126
|
+
- [docs] Document Print export `X-Frame-Options` limitation (#4222) @DanailH
|
|
127
|
+
- [docs] Add docs for the new editing API (#4060) @m4theushw
|
|
128
|
+
- [docs] Explain how to use `printOptions.pageStyle` (#4138) @alexfauquette
|
|
129
|
+
- [docs] Fix 301 links (#4165) @oliviertassinari
|
|
130
|
+
- [docs] Fix 404 API links (#4164) @oliviertassinari
|
|
131
|
+
- [docs] Fix broken anchor links (#4162) @alexfauquette
|
|
132
|
+
- [docs] Remove useless `apiRef` from demos (#4221) @flaviendelangle
|
|
133
|
+
- [docs] Sync the headers with core (#4195) @oliviertassinari
|
|
134
|
+
|
|
135
|
+
### Core
|
|
136
|
+
|
|
137
|
+
- [core] Add CLI to decode license key (#4126) @flaviendelangle
|
|
138
|
+
- [core] Fix Lerna package change detection (#4202) @oliviertassinari
|
|
139
|
+
- [core] Implement strategy pattern for pre-processors (#4030) @flaviendelangle
|
|
140
|
+
- [core] Keep same reference to the column visibility model if no column has changed (#4154) @m4theushw
|
|
141
|
+
- [core] Prepare `@mui/x-license-pro` for date pickers (#4123) @flaviendelangle
|
|
142
|
+
- [core] Remove datagen from `@mui/x-data-grid-generator` bundle (#4163) @m4theushw
|
|
143
|
+
- [core] Remove lodash `isDeepEqual` (#4159) @flaviendelangle
|
|
144
|
+
- [core] Use a pipe processor for `GridPreferencePanel` children (#4216) @flaviendelangle
|
|
145
|
+
- [core] Add markdown documentation for contributors (#3447) @alexfauquette
|
|
146
|
+
- [test] Add regression test for `showCellRightBorder` (#4191) @cherniavskii
|
|
147
|
+
- [test] Mock `getComputedStyle` to speed up unit tests (#4142) @m4theushw
|
|
148
|
+
- [test] Upgrade CircleCI convenience image (#4143) @m4theushw
|
|
149
|
+
|
|
150
|
+
## 5.6.1
|
|
151
|
+
|
|
152
|
+
_Mar 10, 2022_
|
|
153
|
+
|
|
154
|
+
We'd like to offer a big thanks to the 8 contributors who made this release possible. Here are some highlights ✨:
|
|
155
|
+
|
|
156
|
+
- ✨ Allow to add margins or borders between rows (#3848) @m4theushw
|
|
157
|
+
|
|
158
|
+
```tsx
|
|
159
|
+
<DataGrid getRowSpacing={() => ({ top: 10, bottom: 10 })} />
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
Check the [documentation](https://mui.com/components/data-grid/rows/#row-spacing) for more information.
|
|
163
|
+
|
|
164
|
+
### `@mui/x-data-grid@v5.6.1` / `@mui/x-data-grid-pro@v5.6.1`
|
|
165
|
+
|
|
166
|
+
#### Changes
|
|
167
|
+
|
|
168
|
+
- [DataGrid] Display column's filter icon if a filter is applied (#4120) @DanailH
|
|
169
|
+
- [DataGrid] Do not loop through rows to compute top level rows count when the tree is flat (#4081) @flaviendelangle
|
|
170
|
+
- [DataGrid] Rename API method (#4148) @m4theushw
|
|
171
|
+
- [DataGrid] Support extending built-in column types (#4114) @cherniavskii
|
|
172
|
+
- [DataGridPro] Re-export the components removed by mistake during bundle split (#4134) @flaviendelangle
|
|
173
|
+
|
|
174
|
+
### Docs
|
|
175
|
+
|
|
176
|
+
- [docs] Fix links to prevent duplicate search result (#4130) @siriwatknp
|
|
177
|
+
- [docs] Fix outdated links to `localeTextConstants.ts` (#4080) @patilvishal755
|
|
178
|
+
- [docs] Neglect e2e tests related to search (#4118) @siriwatknp
|
|
179
|
+
- [docs] Use regex instead of specific url in e2e-website-tests (#4121) @siriwatknp
|
|
180
|
+
|
|
181
|
+
### Core
|
|
182
|
+
|
|
183
|
+
- [core] Enforce `noImplicitAny` (#4084) @cherniavskii
|
|
184
|
+
- [core] Improve the Pro support issue template (#4082) @oliviertassinari
|
|
185
|
+
- [core] Initialize remaining states before feature hooks (#4036) @m4theushw
|
|
186
|
+
- [core] Merge `page` and `pageSize` state initializer into a single `pagination` state initializer (#4087) @flaviendelangle
|
|
187
|
+
- [core] Prepare `yarn docs:api:build` scripts for multi packages support (#4111) @flaviendelangle
|
|
188
|
+
- [core] Upgrade `@mui/monorepo` (#4149) @cherniavskii
|
|
189
|
+
- [core] Use `buildWarning` and `wrapWithWarningOnCall` for deprecated methods and wrong usages (#4056) @flaviendelangle
|
|
190
|
+
- [test] Make focus state out-of-sync warning opt-in (#4129) @m4theushw
|
|
191
|
+
- [test] Only test custom input keyboard event in edit mode (#4075) @alexfauquette
|
|
192
|
+
|
|
6
193
|
## 5.6.0
|
|
7
194
|
|
|
8
195
|
_Mar 4, 2022_
|
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { GridValidRowModel } from '@mui/x-data-grid';
|
|
2
3
|
import { DataGridProProps } from '../models';
|
|
3
|
-
|
|
4
|
+
interface DataGridProComponent {
|
|
5
|
+
<R extends GridValidRowModel = any>(props: DataGridProProps<R> & React.RefAttributes<HTMLDivElement>): JSX.Element;
|
|
6
|
+
propTypes?: any;
|
|
7
|
+
}
|
|
8
|
+
export declare const DataGridPro: DataGridProComponent;
|
|
9
|
+
export {};
|
|
@@ -1,28 +1,20 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import {
|
|
4
|
-
import { chainPropTypes
|
|
3
|
+
import { useLicenseVerifier, Watermark } from '@mui/x-license-pro';
|
|
4
|
+
import { chainPropTypes } from '@mui/utils';
|
|
5
5
|
import { GridBody, GridErrorHandler, GridFooterPlaceholder, GridHeaderPlaceholder, GridRoot, GridContextProvider } from '@mui/x-data-grid';
|
|
6
6
|
import { useDataGridProComponent } from './useDataGridProComponent';
|
|
7
|
-
import { Watermark } from '../components/Watermark';
|
|
8
7
|
import { useDataGridProProps } from './useDataGridProProps';
|
|
9
8
|
import { DataGridProVirtualScroller } from '../components/DataGridProVirtualScroller';
|
|
10
|
-
import { DataGridProColumnHeaders } from '../components/DataGridProColumnHeaders';
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
import { DataGridProColumnHeaders } from '../components/DataGridProColumnHeaders';
|
|
10
|
+
import { getReleaseInfo } from '../utils/releaseInfo';
|
|
13
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
12
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
if (process.env.NODE_ENV !== 'production' && RELEASE_INFO === '__RELEASE' + '_INFO__') {
|
|
18
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
19
|
-
RELEASE_INFO = ponyfillGlobal.__MUI_RELEASE_INFO__;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
LicenseInfo.setReleaseInfo(RELEASE_INFO);
|
|
13
|
+
const releaseInfo = getReleaseInfo();
|
|
23
14
|
const DataGridProRaw = /*#__PURE__*/React.forwardRef(function DataGridPro(inProps, ref) {
|
|
24
15
|
const props = useDataGridProProps(inProps);
|
|
25
16
|
const apiRef = useDataGridProComponent(props.apiRef, props);
|
|
17
|
+
useLicenseVerifier('x-data-grid-pro', releaseInfo);
|
|
26
18
|
return /*#__PURE__*/_jsx(GridContextProvider, {
|
|
27
19
|
apiRef: apiRef,
|
|
28
20
|
props: props,
|
|
@@ -35,7 +27,10 @@ const DataGridProRaw = /*#__PURE__*/React.forwardRef(function DataGridPro(inProp
|
|
|
35
27
|
children: [/*#__PURE__*/_jsx(GridHeaderPlaceholder, {}), /*#__PURE__*/_jsx(GridBody, {
|
|
36
28
|
ColumnHeadersComponent: DataGridProColumnHeaders,
|
|
37
29
|
VirtualScrollerComponent: DataGridProVirtualScroller,
|
|
38
|
-
children: /*#__PURE__*/_jsx(Watermark, {
|
|
30
|
+
children: /*#__PURE__*/_jsx(Watermark, {
|
|
31
|
+
packageName: "x-data-grid-pro",
|
|
32
|
+
releaseInfo: releaseInfo
|
|
33
|
+
})
|
|
39
34
|
}), /*#__PURE__*/_jsx(GridFooterPlaceholder, {})]
|
|
40
35
|
})
|
|
41
36
|
})
|
|
@@ -274,8 +269,10 @@ DataGridProRaw.propTypes = {
|
|
|
274
269
|
* For each feature, if the flag is not explicitly set to `true`, the feature will be fully disabled and any property / method call will not have any effect.
|
|
275
270
|
*/
|
|
276
271
|
experimentalFeatures: PropTypes.shape({
|
|
272
|
+
newEditingApi: PropTypes.bool,
|
|
277
273
|
preventCommitWhileValidating: PropTypes.bool,
|
|
278
|
-
rowGrouping: PropTypes.bool
|
|
274
|
+
rowGrouping: PropTypes.bool,
|
|
275
|
+
warnIfFocusStateIsNotSynced: PropTypes.bool
|
|
279
276
|
}),
|
|
280
277
|
|
|
281
278
|
/**
|
|
@@ -328,7 +325,7 @@ DataGridProRaw.propTypes = {
|
|
|
328
325
|
|
|
329
326
|
/**
|
|
330
327
|
* Function that applies CSS classes dynamically on rows.
|
|
331
|
-
* @param {
|
|
328
|
+
* @param {GridRowClassNameParams} params With all properties from [[GridRowClassNameParams]].
|
|
332
329
|
* @returns {string} The CSS class to apply to the row.
|
|
333
330
|
*/
|
|
334
331
|
getRowClassName: PropTypes.func,
|
|
@@ -345,11 +342,19 @@ DataGridProRaw.propTypes = {
|
|
|
345
342
|
*/
|
|
346
343
|
getRowId: PropTypes.func,
|
|
347
344
|
|
|
345
|
+
/**
|
|
346
|
+
* Function that allows to specify the spacing between rows.
|
|
347
|
+
* @param {GridRowSpacingParams} params With all properties from [[GridRowSpacingParams]].
|
|
348
|
+
* @returns {GridRowSpacing} The row spacing values.
|
|
349
|
+
*/
|
|
350
|
+
getRowSpacing: PropTypes.func,
|
|
351
|
+
|
|
348
352
|
/**
|
|
349
353
|
* Determines the path of a row in the tree data.
|
|
350
354
|
* For instance, a row with the path ["A", "B"] is the child of the row with the path ["A"].
|
|
351
355
|
* Note that all paths must contain at least one element.
|
|
352
|
-
* @
|
|
356
|
+
* @template R
|
|
357
|
+
* @param {R} row The row from which we want the path.
|
|
353
358
|
* @returns {string[]} The path to the row.
|
|
354
359
|
*/
|
|
355
360
|
getTreeDataPath: PropTypes.func,
|
|
@@ -432,7 +437,7 @@ DataGridProRaw.propTypes = {
|
|
|
432
437
|
|
|
433
438
|
/**
|
|
434
439
|
* Set the locale text of the grid.
|
|
435
|
-
* You can find all the translation keys supported in [the source](https://github.com/mui/mui-x/blob/HEAD/packages/grid/x-data-grid/src/
|
|
440
|
+
* You can find all the translation keys supported in [the source](https://github.com/mui/mui-x/blob/HEAD/packages/grid/x-data-grid/src/constants/localeTextConstants.ts) in the GitHub repository.
|
|
436
441
|
*/
|
|
437
442
|
localeText: PropTypes.object,
|
|
438
443
|
|
|
@@ -660,6 +665,28 @@ DataGridProRaw.propTypes = {
|
|
|
660
665
|
*/
|
|
661
666
|
onPinnedColumnsChange: PropTypes.func,
|
|
662
667
|
|
|
668
|
+
/**
|
|
669
|
+
* Callback fired when the preferences panel is closed.
|
|
670
|
+
* @param {GridPreferencePanelParams} params With all properties from [[GridPreferencePanelParams]].
|
|
671
|
+
* @param {MuiEvent<{}>} event The event object.
|
|
672
|
+
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
673
|
+
*/
|
|
674
|
+
onPreferencePanelClose: PropTypes.func,
|
|
675
|
+
|
|
676
|
+
/**
|
|
677
|
+
* Callback fired when the preferences panel is opened.
|
|
678
|
+
* @param {GridPreferencePanelParams} params With all properties from [[GridPreferencePanelParams]].
|
|
679
|
+
* @param {MuiEvent<{}>} event The event object.
|
|
680
|
+
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
681
|
+
*/
|
|
682
|
+
onPreferencePanelOpen: PropTypes.func,
|
|
683
|
+
|
|
684
|
+
/**
|
|
685
|
+
* Callback called when `processRowUpdate` throws an error or rejects.
|
|
686
|
+
* @param {any} error The error thrown.
|
|
687
|
+
*/
|
|
688
|
+
onProcessRowUpdateError: PropTypes.func,
|
|
689
|
+
|
|
663
690
|
/**
|
|
664
691
|
* Callback fired when the grid is resized.
|
|
665
692
|
* @param {ElementSize} containerSize With all properties from [[ElementSize]].
|
|
@@ -779,6 +806,16 @@ DataGridProRaw.propTypes = {
|
|
|
779
806
|
right: PropTypes.arrayOf(PropTypes.string)
|
|
780
807
|
}),
|
|
781
808
|
|
|
809
|
+
/**
|
|
810
|
+
* Callback called before updating a row with new values in the row and cell editing.
|
|
811
|
+
* Only applied if `props.experimentalFeatures.newEditingApi: true`.
|
|
812
|
+
* @template R
|
|
813
|
+
* @param {R} newRow Row object with the new values.
|
|
814
|
+
* @param {R} oldRow Row object with the old values.
|
|
815
|
+
* @returns {Promise<R> | R} The final values to update the row.
|
|
816
|
+
*/
|
|
817
|
+
processRowUpdate: PropTypes.func,
|
|
818
|
+
|
|
782
819
|
/**
|
|
783
820
|
* Number of extra rows to be rendered before/after the visible slice.
|
|
784
821
|
* @default 3
|
|
@@ -812,7 +849,13 @@ DataGridProRaw.propTypes = {
|
|
|
812
849
|
/**
|
|
813
850
|
* Set of rows of type [[GridRowsProp]].
|
|
814
851
|
*/
|
|
815
|
-
rows: PropTypes.
|
|
852
|
+
rows: PropTypes.array.isRequired,
|
|
853
|
+
|
|
854
|
+
/**
|
|
855
|
+
* Sets the type of space between rows added by `getRowSpacing`.
|
|
856
|
+
* @default "margin"
|
|
857
|
+
*/
|
|
858
|
+
rowSpacingType: PropTypes.oneOf(['border', 'margin']),
|
|
816
859
|
|
|
817
860
|
/**
|
|
818
861
|
* Select the pageSize dynamically using the component UI.
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
import { useGridInitialization, useGridInitializeState, useGridClipboard, useGridColumnMenu, useGridColumns, columnsStateInitializer, useGridDensity, useGridCsvExport, useGridPrintExport, useGridFilter, filterStateInitializer, useGridFocus,
|
|
1
|
+
import { useGridInitialization, useGridInitializeState, useGridClipboard, useGridColumnMenu, useGridColumns, columnsStateInitializer, useGridDensity, useGridCsvExport, useGridPrintExport, useGridFilter, filterStateInitializer, useGridFocus, useGridKeyboardNavigation, useGridPagination, paginationStateInitializer, useGridPreferencesPanel, useGridEditing_new, useGridEditing_old, editingStateInitializer_old, editingStateInitializer_new, useGridRows, useGridRowsPreProcessors, rowsStateInitializer, useGridRowsMeta, useGridParamsApi, useGridSelection, useGridSorting, sortingStateInitializer, useGridScroll, useGridEvents, useGridDimensions, useGridStatePersistence, useGridSelectionPreProcessors, columnMenuStateInitializer, densityStateInitializer, focusStateInitializer, preferencePanelStateInitializer, rowsMetaStateInitializer, selectionStateInitializer } from '@mui/x-data-grid/internals';
|
|
2
2
|
// Pro-only features
|
|
3
3
|
import { useGridInfiniteLoader } from '../hooks/features/infiniteLoader/useGridInfiniteLoader';
|
|
4
|
-
import { useGridColumnReorder } from '../hooks/features/columnReorder/useGridColumnReorder';
|
|
5
|
-
import { useGridColumnResize } from '../hooks/features/columnResize/useGridColumnResize';
|
|
4
|
+
import { useGridColumnReorder, columnReorderStateInitializer } from '../hooks/features/columnReorder/useGridColumnReorder';
|
|
5
|
+
import { useGridColumnResize, columnResizeStateInitializer } from '../hooks/features/columnResize/useGridColumnResize';
|
|
6
6
|
import { useGridTreeData } from '../hooks/features/treeData/useGridTreeData';
|
|
7
7
|
import { useGridTreeDataPreProcessors } from '../hooks/features/treeData/useGridTreeDataPreProcessors';
|
|
8
8
|
import { useGridRowGrouping, rowGroupingStateInitializer } from '../hooks/features/rowGrouping/useGridRowGrouping';
|
|
9
9
|
import { useGridRowGroupingPreProcessors } from '../hooks/features/rowGrouping/useGridRowGroupingPreProcessors';
|
|
10
10
|
import { useGridColumnPinning, columnPinningStateInitializer } from '../hooks/features/columnPinning/useGridColumnPinning';
|
|
11
11
|
import { useGridColumnPinningPreProcessors } from '../hooks/features/columnPinning/useGridColumnPinningPreProcessors';
|
|
12
|
-
import { useGridDetailPanel } from '../hooks/features/detailPanel/useGridDetailPanel';
|
|
12
|
+
import { useGridDetailPanel, detailPanelStateInitializer } from '../hooks/features/detailPanel/useGridDetailPanel';
|
|
13
13
|
import { useGridDetailPanelCache } from '../hooks/features/detailPanel/useGridDetailPanelCache';
|
|
14
14
|
import { useGridDetailPanelPreProcessors } from '../hooks/features/detailPanel/useGridDetailPanelPreProcessors';
|
|
15
15
|
export const useDataGridProComponent = (inputApiRef, props) => {
|
|
16
|
+
var _props$experimentalFe, _props$experimentalFe2;
|
|
17
|
+
|
|
16
18
|
const apiRef = useGridInitialization(inputApiRef, props);
|
|
17
19
|
/**
|
|
18
20
|
* Register all pre-processors called during state initialization here.
|
|
@@ -21,25 +23,35 @@ export const useDataGridProComponent = (inputApiRef, props) => {
|
|
|
21
23
|
useGridSelectionPreProcessors(apiRef, props);
|
|
22
24
|
useGridRowGroupingPreProcessors(apiRef, props);
|
|
23
25
|
useGridTreeDataPreProcessors(apiRef, props);
|
|
24
|
-
useGridDetailPanelPreProcessors(apiRef, props);
|
|
25
|
-
|
|
26
|
+
useGridDetailPanelPreProcessors(apiRef, props); // The column pinning `hydrateColumns` pre-processor must be after every other `hydrateColumns` pre-processors
|
|
27
|
+
// Because it changes the order of the columns.
|
|
26
28
|
|
|
29
|
+
useGridColumnPinningPreProcessors(apiRef, props);
|
|
30
|
+
useGridRowsPreProcessors(apiRef);
|
|
27
31
|
/**
|
|
28
32
|
* Register all state initializers here.
|
|
29
33
|
*/
|
|
30
34
|
|
|
31
|
-
useGridInitializeState(filterStateInitializer, apiRef, props);
|
|
32
|
-
useGridInitializeState(pageSizeStateInitializer, apiRef, props);
|
|
33
|
-
useGridInitializeState(pageStateInitializer, apiRef, props);
|
|
34
|
-
useGridInitializeState(sortingStateInitializer, apiRef, props);
|
|
35
|
-
useGridInitializeState(columnPinningStateInitializer, apiRef, props);
|
|
36
35
|
useGridInitializeState(rowGroupingStateInitializer, apiRef, props);
|
|
36
|
+
useGridInitializeState(selectionStateInitializer, apiRef, props);
|
|
37
|
+
useGridInitializeState(detailPanelStateInitializer, apiRef, props);
|
|
38
|
+
useGridInitializeState(columnPinningStateInitializer, apiRef, props);
|
|
37
39
|
useGridInitializeState(columnsStateInitializer, apiRef, props);
|
|
38
|
-
useGridRowGrouping(apiRef, props); // FIXME Needs to be called before the rows state initialization because it registers a rows group builder
|
|
39
|
-
|
|
40
|
-
useGridTreeData(apiRef, props); // FIXME Needs to be called before the rows state initialization because it registers a rows group builder
|
|
41
|
-
|
|
42
40
|
useGridInitializeState(rowsStateInitializer, apiRef, props);
|
|
41
|
+
useGridInitializeState((_props$experimentalFe = props.experimentalFeatures) != null && _props$experimentalFe.newEditingApi ? editingStateInitializer_new : editingStateInitializer_old, apiRef, props);
|
|
42
|
+
useGridInitializeState(focusStateInitializer, apiRef, props);
|
|
43
|
+
useGridInitializeState(sortingStateInitializer, apiRef, props);
|
|
44
|
+
useGridInitializeState(preferencePanelStateInitializer, apiRef, props);
|
|
45
|
+
useGridInitializeState(filterStateInitializer, apiRef, props);
|
|
46
|
+
useGridInitializeState(densityStateInitializer, apiRef, props);
|
|
47
|
+
useGridInitializeState(columnReorderStateInitializer, apiRef, props);
|
|
48
|
+
useGridInitializeState(columnResizeStateInitializer, apiRef, props);
|
|
49
|
+
useGridInitializeState(paginationStateInitializer, apiRef, props);
|
|
50
|
+
useGridInitializeState(rowsMetaStateInitializer, apiRef, props);
|
|
51
|
+
useGridInitializeState(columnMenuStateInitializer, apiRef, props);
|
|
52
|
+
useGridRowGrouping(apiRef, props);
|
|
53
|
+
useGridTreeData(apiRef);
|
|
54
|
+
useGridKeyboardNavigation(apiRef, props);
|
|
43
55
|
useGridSelection(apiRef, props);
|
|
44
56
|
useGridDetailPanel(apiRef, props);
|
|
45
57
|
useGridColumnPinning(apiRef, props);
|
|
@@ -47,10 +59,11 @@ export const useDataGridProComponent = (inputApiRef, props) => {
|
|
|
47
59
|
useGridRows(apiRef, props);
|
|
48
60
|
useGridParamsApi(apiRef);
|
|
49
61
|
useGridDetailPanelCache(apiRef, props);
|
|
62
|
+
const useGridEditing = (_props$experimentalFe2 = props.experimentalFeatures) != null && _props$experimentalFe2.newEditingApi ? useGridEditing_new : useGridEditing_old;
|
|
50
63
|
useGridEditing(apiRef, props);
|
|
51
64
|
useGridFocus(apiRef, props);
|
|
52
65
|
useGridSorting(apiRef, props);
|
|
53
|
-
useGridPreferencesPanel(apiRef
|
|
66
|
+
useGridPreferencesPanel(apiRef);
|
|
54
67
|
useGridFilter(apiRef, props);
|
|
55
68
|
useGridDensity(apiRef, props);
|
|
56
69
|
useGridColumnReorder(apiRef, props);
|
|
@@ -60,8 +73,6 @@ export const useDataGridProComponent = (inputApiRef, props) => {
|
|
|
60
73
|
useGridScroll(apiRef, props);
|
|
61
74
|
useGridInfiniteLoader(apiRef, props);
|
|
62
75
|
useGridColumnMenu(apiRef);
|
|
63
|
-
useGridKeyboard(apiRef);
|
|
64
|
-
useGridKeyboardNavigation(apiRef, props);
|
|
65
76
|
useGridCsvExport(apiRef);
|
|
66
77
|
useGridPrintExport(apiRef, props);
|
|
67
78
|
useGridClipboard(apiRef);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { GridValidRowModel } from '@mui/x-data-grid';
|
|
1
2
|
import { DataGridProProps, DataGridProProcessedProps, DataGridProPropsWithDefaultValue } from '../models/dataGridProProps';
|
|
2
3
|
/**
|
|
3
4
|
* The default values of `DataGridProPropsWithDefaultValue` to inject in the props of DataGridPro.
|
|
4
5
|
*/
|
|
5
6
|
export declare const DATA_GRID_PRO_PROPS_DEFAULT_VALUES: DataGridProPropsWithDefaultValue;
|
|
6
|
-
export declare const useDataGridProProps: (inProps: DataGridProProps) => DataGridProProcessedProps
|
|
7
|
+
export declare const useDataGridProProps: <R extends GridValidRowModel>(inProps: DataGridProProps<R>) => DataGridProProcessedProps<R>;
|
|
@@ -31,8 +31,8 @@ export const useDataGridProProps = inProps => {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
const mergedComponents = {};
|
|
34
|
-
Object.
|
|
35
|
-
mergedComponents[key] = overrides[key] === undefined ?
|
|
34
|
+
Object.entries(DATA_GRID_DEFAULT_SLOTS_COMPONENTS).forEach(([key, defaultComponent]) => {
|
|
35
|
+
mergedComponents[key] = overrides[key] === undefined ? defaultComponent : overrides[key];
|
|
36
36
|
});
|
|
37
37
|
return mergedComponents;
|
|
38
38
|
}, [themedProps.components]);
|
|
@@ -136,7 +136,15 @@ export const DataGridProColumnHeaders = /*#__PURE__*/React.forwardRef(function D
|
|
|
136
136
|
}, {
|
|
137
137
|
disableReorder: true
|
|
138
138
|
})
|
|
139
|
-
}),
|
|
139
|
+
}), /*#__PURE__*/_jsx(GridColumnHeadersInner, _extends({
|
|
140
|
+
isDragging: isDragging
|
|
141
|
+
}, getInnerProps(), {
|
|
142
|
+
children: getColumns({
|
|
143
|
+
renderContext,
|
|
144
|
+
minFirstColumn: leftPinnedColumns.length,
|
|
145
|
+
maxLastColumn: visibleColumnFields.length - rightPinnedColumns.length
|
|
146
|
+
})
|
|
147
|
+
})), rightRenderContext && /*#__PURE__*/_jsx(GridColumnHeadersPinnedColumnHeaders, {
|
|
140
148
|
ownerState: {
|
|
141
149
|
side: GridPinnedPosition.right
|
|
142
150
|
},
|
|
@@ -152,14 +160,6 @@ export const DataGridProColumnHeaders = /*#__PURE__*/React.forwardRef(function D
|
|
|
152
160
|
disableReorder: true,
|
|
153
161
|
separatorSide: GridColumnHeaderSeparatorSides.Left
|
|
154
162
|
})
|
|
155
|
-
})
|
|
156
|
-
isDragging: isDragging
|
|
157
|
-
}, getInnerProps(), {
|
|
158
|
-
children: getColumns({
|
|
159
|
-
renderContext,
|
|
160
|
-
minFirstColumn: leftPinnedColumns.length,
|
|
161
|
-
maxLastColumn: visibleColumnFields.length - rightPinnedColumns.length
|
|
162
|
-
})
|
|
163
|
-
}))]
|
|
163
|
+
})]
|
|
164
164
|
}));
|
|
165
165
|
});
|
|
@@ -6,7 +6,7 @@ import { styled, alpha } from '@mui/material/styles';
|
|
|
6
6
|
import Box from '@mui/material/Box';
|
|
7
7
|
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
8
8
|
import { useGridSelector, getDataGridUtilityClass, gridClasses, gridVisibleColumnFieldsSelector, gridRowsMetaSelector, useGridApiEventHandler, GridEvents } from '@mui/x-data-grid';
|
|
9
|
-
import {
|
|
9
|
+
import { GridVirtualScroller, GridVirtualScrollerContent, GridVirtualScrollerRenderZone, useGridVirtualScroller } from '@mui/x-data-grid/internals';
|
|
10
10
|
import { useGridApiContext } from '../hooks/utils/useGridApiContext';
|
|
11
11
|
import { useGridRootProps } from '../hooks/utils/useGridRootProps';
|
|
12
12
|
import { gridPinnedColumnsSelector, GridPinnedPosition } from '../hooks/features/columnPinning';
|
|
@@ -115,7 +115,6 @@ const DataGridProVirtualScroller = /*#__PURE__*/React.forwardRef(function DataGr
|
|
|
115
115
|
|
|
116
116
|
const apiRef = useGridApiContext();
|
|
117
117
|
const rootProps = useGridRootProps();
|
|
118
|
-
const currentPage = useCurrentPageRows(apiRef, rootProps);
|
|
119
118
|
const visibleColumnFields = useGridSelector(apiRef, gridVisibleColumnFieldsSelector);
|
|
120
119
|
const expandedRowIds = useGridSelector(apiRef, gridDetailPanelExpandedRowIdsSelector);
|
|
121
120
|
const detailPanelsContent = useGridSelector(apiRef, gridDetailPanelExpandedRowsContentCacheSelector);
|
|
@@ -191,18 +190,6 @@ const DataGridProVirtualScroller = /*#__PURE__*/React.forwardRef(function DataGr
|
|
|
191
190
|
const pinnedColumnsStyle = {
|
|
192
191
|
minHeight: contentProps.style.minHeight
|
|
193
192
|
};
|
|
194
|
-
const rowsLookup = React.useMemo(() => {
|
|
195
|
-
if (rootProps.getDetailPanelContent == null) {
|
|
196
|
-
return null;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
return currentPage.rows.reduce((acc, {
|
|
200
|
-
id
|
|
201
|
-
}, index) => {
|
|
202
|
-
acc[id] = index;
|
|
203
|
-
return acc;
|
|
204
|
-
}, {});
|
|
205
|
-
}, [currentPage.rows, rootProps.getDetailPanelContent]);
|
|
206
193
|
|
|
207
194
|
const getDetailPanels = () => {
|
|
208
195
|
const panels = [];
|
|
@@ -218,12 +205,14 @@ const DataGridProVirtualScroller = /*#__PURE__*/React.forwardRef(function DataGr
|
|
|
218
205
|
const id = uniqueExpandedRowIds[i];
|
|
219
206
|
const content = detailPanelsContent[id]; // Check if the id exists in the current page
|
|
220
207
|
|
|
221
|
-
const
|
|
208
|
+
const rowIndex = apiRef.current.getRowIndexRelativeToVisibleRows(id);
|
|
209
|
+
const exists = rowIndex !== undefined;
|
|
222
210
|
|
|
223
211
|
if ( /*#__PURE__*/React.isValidElement(content) && exists) {
|
|
224
212
|
const height = detailPanelsHeights[id];
|
|
225
|
-
const
|
|
226
|
-
const
|
|
213
|
+
const sizes = apiRef.current.unstable_getRowInternalSizes(id);
|
|
214
|
+
const spacingTop = (sizes == null ? void 0 : sizes.spacingTop) || 0;
|
|
215
|
+
const top = rowsMeta.positions[rowIndex] + apiRef.current.unstable_getRowHeight(id) + spacingTop;
|
|
227
216
|
panels.push( /*#__PURE__*/_jsx(VirtualScrollerDetailPanel, {
|
|
228
217
|
style: {
|
|
229
218
|
top,
|
|
@@ -254,7 +243,11 @@ const DataGridProVirtualScroller = /*#__PURE__*/React.forwardRef(function DataGr
|
|
|
254
243
|
maxLastColumn: leftRenderContext.lastColumnIndex,
|
|
255
244
|
availableSpace: 0
|
|
256
245
|
})
|
|
257
|
-
}),
|
|
246
|
+
}), /*#__PURE__*/_jsx(GridVirtualScrollerRenderZone, _extends({}, getRenderZoneProps(), {
|
|
247
|
+
children: getRows({
|
|
248
|
+
renderContext
|
|
249
|
+
})
|
|
250
|
+
})), rightRenderContext && /*#__PURE__*/_jsx(VirtualScrollerPinnedColumns, {
|
|
258
251
|
ref: rightColumns,
|
|
259
252
|
ownerState: {
|
|
260
253
|
side: GridPinnedPosition.right
|
|
@@ -267,11 +260,7 @@ const DataGridProVirtualScroller = /*#__PURE__*/React.forwardRef(function DataGr
|
|
|
267
260
|
maxLastColumn: rightRenderContext.lastColumnIndex,
|
|
268
261
|
availableSpace: 0
|
|
269
262
|
})
|
|
270
|
-
}), /*#__PURE__*/_jsx(
|
|
271
|
-
children: getRows({
|
|
272
|
-
renderContext
|
|
273
|
-
})
|
|
274
|
-
})), detailPanels.length > 0 && /*#__PURE__*/_jsx(VirtualScrollerDetailPanels, {
|
|
263
|
+
}), detailPanels.length > 0 && /*#__PURE__*/_jsx(VirtualScrollerDetailPanels, {
|
|
275
264
|
className: classes.detailPanels,
|
|
276
265
|
children: detailPanels
|
|
277
266
|
})]
|
|
@@ -54,8 +54,9 @@ process.env.NODE_ENV !== "production" ? GridDetailPanelToggleCell.propTypes = {
|
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
56
|
* GridApi that let you manipulate the grid.
|
|
57
|
+
* @deprecated Use the `apiRef` returned by `useGridApiContext` or `useGridApiRef` (only available in `@mui/x-data-grid-pro`)
|
|
57
58
|
*/
|
|
58
|
-
api: PropTypes.
|
|
59
|
+
api: PropTypes.any.isRequired,
|
|
59
60
|
|
|
60
61
|
/**
|
|
61
62
|
* The mode of the cell.
|
|
@@ -81,7 +82,7 @@ process.env.NODE_ENV !== "production" ? GridDetailPanelToggleCell.propTypes = {
|
|
|
81
82
|
* Get the cell value of a row and field.
|
|
82
83
|
* @param {GridRowId} id The row id.
|
|
83
84
|
* @param {string} field The field.
|
|
84
|
-
* @returns {
|
|
85
|
+
* @returns {any} The cell value.
|
|
85
86
|
* @deprecated Use `params.row` to directly access the fields you want instead.
|
|
86
87
|
*/
|
|
87
88
|
getValue: PropTypes.func.isRequired,
|
|
@@ -104,7 +105,7 @@ process.env.NODE_ENV !== "production" ? GridDetailPanelToggleCell.propTypes = {
|
|
|
104
105
|
/**
|
|
105
106
|
* The row model of the row that the current cell belongs to.
|
|
106
107
|
*/
|
|
107
|
-
row: PropTypes.
|
|
108
|
+
row: PropTypes.object.isRequired,
|
|
108
109
|
|
|
109
110
|
/**
|
|
110
111
|
* The node of the row that the current cell belongs to.
|
|
@@ -3,8 +3,5 @@ import { GridRenderCellParams } from '@mui/x-data-grid';
|
|
|
3
3
|
interface GridGroupingCriteriaCellProps extends GridRenderCellParams {
|
|
4
4
|
hideDescendantCount?: boolean;
|
|
5
5
|
}
|
|
6
|
-
declare const GridGroupingCriteriaCell:
|
|
7
|
-
|
|
8
|
-
propTypes: any;
|
|
9
|
-
};
|
|
10
|
-
export { GridGroupingCriteriaCell };
|
|
6
|
+
export declare const GridGroupingCriteriaCell: (props: GridGroupingCriteriaCellProps) => JSX.Element;
|
|
7
|
+
export {};
|