@mui/x-data-grid-pro 5.16.0 → 5.17.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 +138 -1
- package/DataGridPro/DataGridPro.js +17 -0
- package/DataGridPro/useDataGridProComponent.js +4 -0
- package/DataGridPro/useDataGridProProps.js +2 -1
- package/components/DataGridProVirtualScroller.js +18 -15
- package/components/GridDetailPanelToggleCell.js +2 -1
- package/components/GridTreeDataGroupingCell.js +2 -1
- package/hooks/features/detailPanel/useGridDetailPanelPreProcessors.js +15 -0
- package/hooks/features/infiniteLoader/useGridInfiniteLoader.d.ts +1 -1
- package/hooks/features/infiniteLoader/useGridInfiniteLoader.js +4 -4
- package/hooks/features/lazyLoader/useGridLazyLoader.d.ts +10 -0
- package/hooks/features/lazyLoader/useGridLazyLoader.js +178 -0
- package/hooks/features/lazyLoader/useGridLazyLoaderPreProcessors.d.ts +5 -0
- package/hooks/features/lazyLoader/useGridLazyLoaderPreProcessors.js +32 -0
- package/hooks/features/treeData/gridTreeDataUtils.d.ts +3 -1
- package/hooks/features/treeData/gridTreeDataUtils.js +1 -1
- package/hooks/features/treeData/useGridTreeDataPreProcessors.js +2 -1
- package/index.js +1 -1
- package/legacy/DataGridPro/DataGridPro.js +17 -0
- package/legacy/DataGridPro/useDataGridProComponent.js +4 -0
- package/legacy/DataGridPro/useDataGridProProps.js +2 -1
- package/legacy/components/DataGridProVirtualScroller.js +18 -15
- package/legacy/components/GridDetailPanelToggleCell.js +2 -1
- package/legacy/components/GridTreeDataGroupingCell.js +2 -1
- package/legacy/hooks/features/detailPanel/useGridDetailPanelPreProcessors.js +15 -0
- package/legacy/hooks/features/infiniteLoader/useGridInfiniteLoader.js +4 -4
- package/legacy/hooks/features/lazyLoader/useGridLazyLoader.js +185 -0
- package/legacy/hooks/features/lazyLoader/useGridLazyLoaderPreProcessors.js +35 -0
- package/legacy/hooks/features/treeData/gridTreeDataUtils.js +1 -1
- package/legacy/hooks/features/treeData/useGridTreeDataPreProcessors.js +2 -1
- package/legacy/index.js +1 -1
- package/legacy/models/gridFetchRowsParams.js +1 -0
- package/legacy/models/index.js +2 -1
- package/legacy/utils/releaseInfo.js +1 -1
- package/models/dataGridProProps.d.ts +22 -1
- package/models/gridFetchRowsParams.d.ts +22 -0
- package/models/gridFetchRowsParams.js +1 -0
- package/models/index.d.ts +1 -0
- package/models/index.js +2 -1
- package/modern/DataGridPro/DataGridPro.js +17 -0
- package/modern/DataGridPro/useDataGridProComponent.js +4 -0
- package/modern/DataGridPro/useDataGridProProps.js +2 -1
- package/modern/components/DataGridProVirtualScroller.js +18 -15
- package/modern/components/GridDetailPanelToggleCell.js +2 -1
- package/modern/components/GridTreeDataGroupingCell.js +2 -1
- package/modern/hooks/features/detailPanel/useGridDetailPanelPreProcessors.js +15 -0
- package/modern/hooks/features/infiniteLoader/useGridInfiniteLoader.js +4 -4
- package/modern/hooks/features/lazyLoader/useGridLazyLoader.js +176 -0
- package/modern/hooks/features/lazyLoader/useGridLazyLoaderPreProcessors.js +30 -0
- package/modern/hooks/features/treeData/gridTreeDataUtils.js +1 -1
- package/modern/hooks/features/treeData/useGridTreeDataPreProcessors.js +2 -1
- package/modern/index.js +1 -1
- package/modern/models/gridFetchRowsParams.js +1 -0
- package/modern/models/index.js +2 -1
- package/modern/utils/releaseInfo.js +1 -1
- package/node/DataGridPro/DataGridPro.js +17 -0
- package/node/DataGridPro/useDataGridProComponent.js +6 -0
- package/node/DataGridPro/useDataGridProProps.js +1 -0
- package/node/components/DataGridProVirtualScroller.js +18 -15
- package/node/components/GridDetailPanelToggleCell.js +2 -1
- package/node/components/GridTreeDataGroupingCell.js +2 -1
- package/node/hooks/features/detailPanel/useGridDetailPanelPreProcessors.js +16 -0
- package/node/hooks/features/infiniteLoader/useGridInfiniteLoader.js +3 -3
- package/node/hooks/features/lazyLoader/useGridLazyLoader.js +193 -0
- package/node/hooks/features/lazyLoader/useGridLazyLoaderPreProcessors.js +52 -0
- package/node/hooks/features/treeData/gridTreeDataUtils.js +1 -1
- package/node/hooks/features/treeData/useGridTreeDataPreProcessors.js +2 -1
- package/node/index.js +1 -1
- package/node/models/gridFetchRowsParams.js +5 -0
- package/node/models/index.js +13 -0
- package/node/utils/releaseInfo.js +1 -1
- package/package.json +3 -3
- package/typeOverloads/modules.d.ts +7 -1
- package/utils/releaseInfo.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,143 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 5.17.2
|
|
7
|
+
|
|
8
|
+
_Sep 9, 2022_
|
|
9
|
+
|
|
10
|
+
This release will the last regular release for our `v5` packages.
|
|
11
|
+
From now on, we'll be focusing on developing MUI X v6.
|
|
12
|
+
You can check the [roadmap](https://github.com/mui/mui-x/projects/1) for more details on what's coming next.
|
|
13
|
+
|
|
14
|
+
And if you'd like to help, please consider volunteering to give us a [user interview](https://docs.google.com/forms/d/11L_zxL7oD_B-ZrZDuSyIkUzJLzOTUU2M4vHXxMVtWhU/edit).
|
|
15
|
+
We'd love to know more about your use cases, pain points and expectations for the future.
|
|
16
|
+
|
|
17
|
+
The `v5` packages will only get new versions to patch critical bug fixes.
|
|
18
|
+
|
|
19
|
+
We'd like to offer a big thanks to the 6 contributors who made this release possible. Here are some highlights ✨:
|
|
20
|
+
|
|
21
|
+
- 📃 Add support for column grouping when exporting to Excel (#5895) @alexfauquette
|
|
22
|
+
- 🐞 Bugfixes
|
|
23
|
+
|
|
24
|
+
### `@mui/x-data-grid@v5.17.2` / `@mui/x-data-grid-pro@v5.17.2` / `@mui/x-data-grid-premium@v5.17.2`
|
|
25
|
+
|
|
26
|
+
#### Changes
|
|
27
|
+
|
|
28
|
+
- [DataGrid] Revert mode if cell/row couldn't be saved due to validation error (#5897) @m4theushw
|
|
29
|
+
- [DataGridPremium] Export column grouping in Excel (#5895) @alexfauquette
|
|
30
|
+
|
|
31
|
+
### `@mui/x-date-pickers@v5.0.1` / `@mui/x-date-pickers-pro@v5.0.1`
|
|
32
|
+
|
|
33
|
+
#### Changes
|
|
34
|
+
|
|
35
|
+
- [DateTimePicker] Remove circular import (#6087) @flaviendelangle
|
|
36
|
+
- [pickers] Add `sx` prop to the equality check of `PickersDay` (#6030) @TheUnlocked
|
|
37
|
+
- [pickers] Add warning when `openTo` is invalid based on available `views` (#6042) @LukasTy
|
|
38
|
+
- [pickers] Allow keyboard navigation to ignore disabled date for left / right arrow (#6082) @alexfauquette
|
|
39
|
+
- [pickers] Fix mobile picker not opening on label click (#6074) @LukasTy
|
|
40
|
+
|
|
41
|
+
### Docs
|
|
42
|
+
|
|
43
|
+
- [docs] Add Recipes section
|
|
44
|
+
|
|
45
|
+
### Core
|
|
46
|
+
|
|
47
|
+
- [core] Add `yarn release:tag` script (#5169) @DanailH
|
|
48
|
+
- [core] Upgrade monorepo (#6072) @m4theushw
|
|
49
|
+
|
|
50
|
+
## 5.17.1
|
|
51
|
+
|
|
52
|
+
_Sep 5, 2022_
|
|
53
|
+
|
|
54
|
+
We'd like to offer a big thanks to the 3 contributors who made this release possible. Here are some highlights ✨:
|
|
55
|
+
|
|
56
|
+
- 🐞 Bugfixes
|
|
57
|
+
|
|
58
|
+
### `@mui/x-data-grid@v5.17.1` / `@mui/x-data-grid-pro@v5.17.1` / `@mui/x-data-grid-premium@v5.17.1`
|
|
59
|
+
|
|
60
|
+
#### Changes
|
|
61
|
+
|
|
62
|
+
- [DataGrid] Fix cells being focused on mouseUp (#5980) @cherniavskii
|
|
63
|
+
- [DataGrid] Fix focused cell if column is spanned and new editing API is used (#5962) @m4theushw
|
|
64
|
+
- [DataGridPro] Fix import in lazy-loading causing a bundling error (#6031) @flaviendelangle
|
|
65
|
+
|
|
66
|
+
## 5.17.0
|
|
67
|
+
|
|
68
|
+
_Sep 2, 2022_
|
|
69
|
+
|
|
70
|
+
🎉 We are excited to finally introduce a stable release (v5.0.0) for the `@mui/x-date-pickers` and `@mui/x-date-pickers-pro` packages!
|
|
71
|
+
|
|
72
|
+
If you are still using picker components from the `lab`, take a look at the [migration guide](https://mui.com/x/react-date-pickers/migration-lab/).
|
|
73
|
+
|
|
74
|
+
We'd like to offer a big thanks to the 9 contributors who made this release possible. Here are some highlights ✨:
|
|
75
|
+
|
|
76
|
+
- 🎁 Implement Lazy loading (#5214) @DanailH
|
|
77
|
+
|
|
78
|
+
Pro users now can try the experimental lazy loading feature.
|
|
79
|
+
In a few steps, you can load your data on demand, as the rows are displayed.
|
|
80
|
+
|
|
81
|
+
To enable this feature, add `experimentalFeatures={{ lazyLoading: true }}`.
|
|
82
|
+
Lazy Loading requires a few other settings.
|
|
83
|
+
See the [documentation](https://mui.com/x/react-data-grid/row-updates/#lazy-loading) to explore the example in detail.
|
|
84
|
+
|
|
85
|
+
- 🚀 Improve `pickers` focus management (#5820) @alexfauquette
|
|
86
|
+
- 🎉 Enable disabling `day` on date range picker depending on `position` (#5773) @alexfauquette
|
|
87
|
+
- ✨ Various improvements
|
|
88
|
+
- 📚 Documentation improvements
|
|
89
|
+
- 🐞 Bugfixes
|
|
90
|
+
|
|
91
|
+
### `@mui/x-data-grid@v5.17.0` / `@mui/x-data-grid-pro@v5.17.0` / `@mui/x-data-grid-premium@v5.17.0`
|
|
92
|
+
|
|
93
|
+
#### Changes
|
|
94
|
+
|
|
95
|
+
- [DataGrid] Add `sort` prop to columns panel slot (#5888) @gavbrennan
|
|
96
|
+
- [DataGrid] Do not throw if `fieldToFocus` cannot be found (#5871) @cherniavskii
|
|
97
|
+
- [DataGrid] Support `getRowId` in the `replaceRows` method (#5988) @flaviendelangle
|
|
98
|
+
- [DataGridPro] Add class name to row with open detail panel (#5924) @m4theushw
|
|
99
|
+
- [DataGridPro] Fix crash when using `pinnedRows` + `getRowClassName` props and `rows=[]` (#5851) @cherniavskii
|
|
100
|
+
- [DataGridPro] Fix filtering with inactive filter items (#5993) @alexfauquette
|
|
101
|
+
- [DataGridPro] Implement Lazy loading (#5214) @DanailH
|
|
102
|
+
- [DataGridPro] Support pinned columns and dynamic row height (#5782) @m4theushw
|
|
103
|
+
- [DataGridPremium] Add state initializer for column groups (#5963) @alexfauquette
|
|
104
|
+
- [DataGridPremium] Update grouping when `groupingValueGetter` changes (#5919) @flaviendelangle
|
|
105
|
+
- [DataGridPremium] Use the aggregated value on tree data real groups (#5953) @flaviendelangle
|
|
106
|
+
|
|
107
|
+
### `@mui/x-date-pickers@v5.0.0` / `@mui/x-date-pickers-pro@v5.0.0`
|
|
108
|
+
|
|
109
|
+
#### Changes
|
|
110
|
+
|
|
111
|
+
- [DatePicker] Improve focus management (#5820) @alexfauquette
|
|
112
|
+
- [DateRangePicker] Enable disabling `day` depending on `position` (#5773) @alexfauquette
|
|
113
|
+
- [DateTimePicker] Create a new `tabs` component slot (#5972) @LukasTy
|
|
114
|
+
- [pickers] Do not forward validation props to the DOM on field components (#5971) @flaviendelangle
|
|
115
|
+
- [pickers] Do not hardcode `date-fns` elements in field components (#5975) @flaviendelangle
|
|
116
|
+
- [pickers] Do not require `date-fns` in `@mui/x-date-pickers-pro` (#5941) @flaviendelangle
|
|
117
|
+
- [pickers] Fix mobile picker not opening on label click (#5651) @LukasTy
|
|
118
|
+
- [pickers] Improve DOM event management on `useField` (#5901) @flaviendelangle
|
|
119
|
+
- [pickers] Include `community` package `themeAugmentation` in `pro` package types (#5969) @LukasTy
|
|
120
|
+
- [pickers] Rename `DateRangeField` into `SingleInputDateRangeField` (#5961) @flaviendelangle
|
|
121
|
+
- [pickers] Support `isSameError` on field components (#5984) @flaviendelangle
|
|
122
|
+
|
|
123
|
+
### Docs
|
|
124
|
+
|
|
125
|
+
- [docs] Add `description` and `default` to pickers slots (#5893) @alexfauquette
|
|
126
|
+
- [docs] Fix typo (#5945) @wettopa
|
|
127
|
+
- [docs] Fix typo `onYearPicker` to `onYearChange` (#5954) @alexfauquette
|
|
128
|
+
- [docs] Update `GridCellParams`'s `value` description (#5849) @cherniavskii
|
|
129
|
+
- [docs] Update `README.md` to match Introduction section of the docs (#5754) @samuelsycamore
|
|
130
|
+
|
|
131
|
+
### Core
|
|
132
|
+
|
|
133
|
+
- [core] Fix typo (#5990) @flaviendelangle
|
|
134
|
+
- [core] Remove old babel resolve rule (#5939) @oliviertassinari
|
|
135
|
+
- [core] Remove outdated TODO (#5956) @flaviendelangle
|
|
136
|
+
- [core] Upgrade monorepo (#5960) @cherniavskii
|
|
137
|
+
- [core] Fix statics (#5986) @DanailH
|
|
138
|
+
- [core] Remove unused dependencies (#5937) @oliviertassinari
|
|
139
|
+
- [license] Remove CLI (#5757) @flaviendelangle
|
|
140
|
+
- [test] Fix time zone sensitive test (#5955) @LukasTy
|
|
141
|
+
- [test] Use `userEvent.mousePress` instead of `fireClickEvent` (#5920) @cherniavskii
|
|
142
|
+
|
|
6
143
|
## 5.16.0
|
|
7
144
|
|
|
8
145
|
_Aug 25, 2022_
|
|
@@ -585,7 +722,7 @@ We'd like to offer a big thanks to the 15 contributors who made this release pos
|
|
|
585
722
|
|
|
586
723
|
**MonthPicker**: The prop `onMonthChange` has been removed, you can use `onChange` instead since every change is a month change
|
|
587
724
|
|
|
588
|
-
**YearPicker**: The prop `
|
|
725
|
+
**YearPicker**: The prop `onYearChange` has been removed, you can use `onChange` instead since every change is a year change
|
|
589
726
|
|
|
590
727
|
**DayPicker**: The prop `isDateDisabled` has been removed, you can now use the same validation props as for the other components (`maxDate`, `minDate`, `shouldDisableDate`, `disableFuture` and `disablePast`)
|
|
591
728
|
|
|
@@ -276,6 +276,7 @@ DataGridProRaw.propTypes = {
|
|
|
276
276
|
*/
|
|
277
277
|
experimentalFeatures: PropTypes.shape({
|
|
278
278
|
columnGrouping: PropTypes.bool,
|
|
279
|
+
lazyLoading: PropTypes.bool,
|
|
279
280
|
newEditingApi: PropTypes.bool,
|
|
280
281
|
preventCommitWhileValidating: PropTypes.bool,
|
|
281
282
|
rowPinning: PropTypes.bool,
|
|
@@ -670,6 +671,14 @@ DataGridProRaw.propTypes = {
|
|
|
670
671
|
*/
|
|
671
672
|
onError: PropTypes.func,
|
|
672
673
|
|
|
674
|
+
/**
|
|
675
|
+
* Callback fired when rowCount is set and the next batch of virtualized rows is rendered.
|
|
676
|
+
* @param {GridFetchRowsParams} params With all properties from [[GridFetchRowsParams]].
|
|
677
|
+
* @param {MuiEvent<{}>} event The event object.
|
|
678
|
+
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
679
|
+
*/
|
|
680
|
+
onFetchRows: PropTypes.func,
|
|
681
|
+
|
|
673
682
|
/**
|
|
674
683
|
* Callback fired when the Filter model changes before the filters are applied.
|
|
675
684
|
* @param {GridFilterModel} model With all properties from [[GridFilterModel]].
|
|
@@ -915,6 +924,14 @@ DataGridProRaw.propTypes = {
|
|
|
915
924
|
*/
|
|
916
925
|
rows: PropTypes.array.isRequired,
|
|
917
926
|
|
|
927
|
+
/**
|
|
928
|
+
* Loading rows can be processed on the server or client-side.
|
|
929
|
+
* Set it to 'client' if you would like enable infnite loading.
|
|
930
|
+
* Set it to 'server' if you would like to enable lazy loading.
|
|
931
|
+
* * @default "client"
|
|
932
|
+
*/
|
|
933
|
+
rowsLoadingMode: PropTypes.oneOf(['client', 'server']),
|
|
934
|
+
|
|
918
935
|
/**
|
|
919
936
|
* Sets the type of space between rows added by `getRowSpacing`.
|
|
920
937
|
* @default "margin"
|
|
@@ -11,6 +11,8 @@ import { useGridDetailPanel, detailPanelStateInitializer } from '../hooks/featur
|
|
|
11
11
|
import { useGridDetailPanelPreProcessors } from '../hooks/features/detailPanel/useGridDetailPanelPreProcessors';
|
|
12
12
|
import { useGridRowReorder } from '../hooks/features/rowReorder/useGridRowReorder';
|
|
13
13
|
import { useGridRowReorderPreProcessors } from '../hooks/features/rowReorder/useGridRowReorderPreProcessors';
|
|
14
|
+
import { useGridLazyLoader } from '../hooks/features/lazyLoader/useGridLazyLoader';
|
|
15
|
+
import { useGridLazyLoaderPreProcessors } from '../hooks/features/lazyLoader/useGridLazyLoaderPreProcessors';
|
|
14
16
|
import { useGridRowPinning, rowPinningStateInitializer } from '../hooks/features/rowPinning/useGridRowPinning';
|
|
15
17
|
import { useGridRowPinningPreProcessors } from '../hooks/features/rowPinning/useGridRowPinningPreProcessors';
|
|
16
18
|
export const useDataGridProComponent = (inputApiRef, props) => {
|
|
@@ -25,6 +27,7 @@ export const useDataGridProComponent = (inputApiRef, props) => {
|
|
|
25
27
|
useGridSelectionPreProcessors(apiRef, props);
|
|
26
28
|
useGridRowReorderPreProcessors(apiRef, props);
|
|
27
29
|
useGridTreeDataPreProcessors(apiRef, props);
|
|
30
|
+
useGridLazyLoaderPreProcessors(apiRef, props);
|
|
28
31
|
useGridRowPinningPreProcessors(apiRef);
|
|
29
32
|
useGridDetailPanelPreProcessors(apiRef, props); // The column pinning `hydrateColumns` pre-processor must be after every other `hydrateColumns` pre-processors
|
|
30
33
|
// Because it changes the order of the columns.
|
|
@@ -78,6 +81,7 @@ export const useDataGridProComponent = (inputApiRef, props) => {
|
|
|
78
81
|
useGridRowReorder(apiRef, props);
|
|
79
82
|
useGridScroll(apiRef, props);
|
|
80
83
|
useGridInfiniteLoader(apiRef, props);
|
|
84
|
+
useGridLazyLoader(apiRef, props);
|
|
81
85
|
useGridColumnMenu(apiRef);
|
|
82
86
|
useGridCsvExport(apiRef);
|
|
83
87
|
useGridPrintExport(apiRef, props);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useThemeProps } from '@mui/material/styles';
|
|
4
|
-
import { DATA_GRID_DEFAULT_SLOTS_COMPONENTS, GRID_DEFAULT_LOCALE_TEXT, DATA_GRID_PROPS_DEFAULT_VALUES } from '@mui/x-data-grid';
|
|
4
|
+
import { DATA_GRID_DEFAULT_SLOTS_COMPONENTS, GRID_DEFAULT_LOCALE_TEXT, DATA_GRID_PROPS_DEFAULT_VALUES, GridFeatureModeConstant } from '@mui/x-data-grid';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* The default values of `DataGridProPropsWithDefaultValue` to inject in the props of DataGridPro.
|
|
@@ -14,6 +14,7 @@ export const DATA_GRID_PRO_PROPS_DEFAULT_VALUES = _extends({}, DATA_GRID_PROPS_D
|
|
|
14
14
|
disableChildrenFiltering: false,
|
|
15
15
|
disableChildrenSorting: false,
|
|
16
16
|
rowReordering: false,
|
|
17
|
+
rowsLoadingMode: GridFeatureModeConstant.client,
|
|
17
18
|
getDetailPanelHeight: () => 500
|
|
18
19
|
});
|
|
19
20
|
export const useDataGridProProps = inProps => {
|
|
@@ -274,17 +274,20 @@ const DataGridProVirtualScroller = /*#__PURE__*/React.forwardRef(function DataGr
|
|
|
274
274
|
const detailPanels = getDetailPanels();
|
|
275
275
|
const topPinnedRows = getRows({
|
|
276
276
|
renderContext,
|
|
277
|
-
rows: topPinnedRowsData
|
|
277
|
+
rows: topPinnedRowsData,
|
|
278
|
+
position: 'center'
|
|
278
279
|
});
|
|
279
280
|
const pinnedRowsHeight = calculatePinnedRowsHeight(apiRef);
|
|
280
281
|
const mainRows = getRows({
|
|
281
282
|
renderContext,
|
|
282
|
-
rowIndexOffset: topPinnedRowsData.length
|
|
283
|
+
rowIndexOffset: topPinnedRowsData.length,
|
|
284
|
+
position: 'center'
|
|
283
285
|
});
|
|
284
286
|
const bottomPinnedRows = getRows({
|
|
285
287
|
renderContext,
|
|
286
288
|
rows: bottomPinnedRowsData,
|
|
287
|
-
rowIndexOffset: topPinnedRowsData.length + (mainRows ? mainRows.length : 0)
|
|
289
|
+
rowIndexOffset: topPinnedRowsData.length + (mainRows ? mainRows.length : 0),
|
|
290
|
+
position: 'center'
|
|
288
291
|
});
|
|
289
292
|
const contentProps = getContentProps();
|
|
290
293
|
const pinnedColumnsStyle = {
|
|
@@ -316,8 +319,8 @@ const DataGridProVirtualScroller = /*#__PURE__*/React.forwardRef(function DataGr
|
|
|
316
319
|
minFirstColumn: leftRenderContext.firstColumnIndex,
|
|
317
320
|
maxLastColumn: leftRenderContext.lastColumnIndex,
|
|
318
321
|
availableSpace: 0,
|
|
319
|
-
|
|
320
|
-
|
|
322
|
+
rows: topPinnedRowsData,
|
|
323
|
+
position: 'left'
|
|
321
324
|
})
|
|
322
325
|
}), /*#__PURE__*/_jsx(VirtualScrollerPinnedRowsRenderZone, {
|
|
323
326
|
className: classes.pinnedRowsRenderZone,
|
|
@@ -333,9 +336,9 @@ const DataGridProVirtualScroller = /*#__PURE__*/React.forwardRef(function DataGr
|
|
|
333
336
|
renderContext: rightRenderContext,
|
|
334
337
|
minFirstColumn: rightRenderContext.firstColumnIndex,
|
|
335
338
|
maxLastColumn: rightRenderContext.lastColumnIndex,
|
|
336
|
-
ignoreAutoHeight: true,
|
|
337
339
|
availableSpace: 0,
|
|
338
|
-
rows: topPinnedRowsData
|
|
340
|
+
rows: topPinnedRowsData,
|
|
341
|
+
position: 'right'
|
|
339
342
|
})
|
|
340
343
|
})]
|
|
341
344
|
}) : null, /*#__PURE__*/_jsxs(GridVirtualScrollerContent, _extends({}, contentProps, {
|
|
@@ -351,8 +354,8 @@ const DataGridProVirtualScroller = /*#__PURE__*/React.forwardRef(function DataGr
|
|
|
351
354
|
minFirstColumn: leftRenderContext.firstColumnIndex,
|
|
352
355
|
maxLastColumn: leftRenderContext.lastColumnIndex,
|
|
353
356
|
availableSpace: 0,
|
|
354
|
-
|
|
355
|
-
|
|
357
|
+
rowIndexOffset: topPinnedRowsData.length,
|
|
358
|
+
position: 'left'
|
|
356
359
|
})
|
|
357
360
|
}), /*#__PURE__*/_jsx(GridVirtualScrollerRenderZone, _extends({}, getRenderZoneProps(), {
|
|
358
361
|
children: mainRows
|
|
@@ -368,8 +371,8 @@ const DataGridProVirtualScroller = /*#__PURE__*/React.forwardRef(function DataGr
|
|
|
368
371
|
minFirstColumn: rightRenderContext.firstColumnIndex,
|
|
369
372
|
maxLastColumn: rightRenderContext.lastColumnIndex,
|
|
370
373
|
availableSpace: 0,
|
|
371
|
-
|
|
372
|
-
|
|
374
|
+
rowIndexOffset: topPinnedRowsData.length,
|
|
375
|
+
position: 'right'
|
|
373
376
|
})
|
|
374
377
|
}), detailPanels.length > 0 && /*#__PURE__*/_jsx(VirtualScrollerDetailPanels, {
|
|
375
378
|
className: classes.detailPanels,
|
|
@@ -395,9 +398,9 @@ const DataGridProVirtualScroller = /*#__PURE__*/React.forwardRef(function DataGr
|
|
|
395
398
|
minFirstColumn: leftRenderContext.firstColumnIndex,
|
|
396
399
|
maxLastColumn: leftRenderContext.lastColumnIndex,
|
|
397
400
|
availableSpace: 0,
|
|
398
|
-
ignoreAutoHeight: true,
|
|
399
401
|
rows: bottomPinnedRowsData,
|
|
400
|
-
rowIndexOffset: topPinnedRowsData.length + (mainRows ? mainRows.length : 0)
|
|
402
|
+
rowIndexOffset: topPinnedRowsData.length + (mainRows ? mainRows.length : 0),
|
|
403
|
+
position: 'left'
|
|
401
404
|
})
|
|
402
405
|
}), /*#__PURE__*/_jsx(VirtualScrollerPinnedRowsRenderZone, {
|
|
403
406
|
className: classes.pinnedRowsRenderZone,
|
|
@@ -414,9 +417,9 @@ const DataGridProVirtualScroller = /*#__PURE__*/React.forwardRef(function DataGr
|
|
|
414
417
|
minFirstColumn: rightRenderContext.firstColumnIndex,
|
|
415
418
|
maxLastColumn: rightRenderContext.lastColumnIndex,
|
|
416
419
|
availableSpace: 0,
|
|
417
|
-
ignoreAutoHeight: true,
|
|
418
420
|
rows: bottomPinnedRowsData,
|
|
419
|
-
rowIndexOffset: topPinnedRowsData.length + (mainRows ? mainRows.length : 0)
|
|
421
|
+
rowIndexOffset: topPinnedRowsData.length + (mainRows ? mainRows.length : 0),
|
|
422
|
+
position: 'right'
|
|
420
423
|
})
|
|
421
424
|
})]
|
|
422
425
|
}) : null]
|
|
@@ -129,7 +129,8 @@ process.env.NODE_ENV !== "production" ? GridDetailPanelToggleCell.propTypes = {
|
|
|
129
129
|
tabIndex: PropTypes.oneOf([-1, 0]).isRequired,
|
|
130
130
|
|
|
131
131
|
/**
|
|
132
|
-
* The cell value
|
|
132
|
+
* The cell value.
|
|
133
|
+
* If the column has `valueGetter`, use `params.row` to directly access the fields.
|
|
133
134
|
*/
|
|
134
135
|
value: PropTypes.any
|
|
135
136
|
} : void 0;
|
|
@@ -164,7 +164,8 @@ process.env.NODE_ENV !== "production" ? GridTreeDataGroupingCell.propTypes = {
|
|
|
164
164
|
tabIndex: PropTypes.oneOf([-1, 0]).isRequired,
|
|
165
165
|
|
|
166
166
|
/**
|
|
167
|
-
* The cell value
|
|
167
|
+
* The cell value.
|
|
168
|
+
* If the column has `valueGetter`, use `params.row` to directly access the fields.
|
|
168
169
|
*/
|
|
169
170
|
value: PropTypes.any
|
|
170
171
|
} : void 0;
|
|
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useGridRegisterPipeProcessor } from '@mui/x-data-grid/internals';
|
|
4
4
|
import { GRID_DETAIL_PANEL_TOGGLE_FIELD, GRID_DETAIL_PANEL_TOGGLE_COL_DEF } from './gridDetailPanelToggleColDef';
|
|
5
|
+
import { gridDetailPanelExpandedRowIdsSelector } from './gridDetailPanelSelector';
|
|
5
6
|
export const useGridDetailPanelPreProcessors = (apiRef, props) => {
|
|
6
7
|
const addToggleColumn = React.useCallback(columnsState => {
|
|
7
8
|
if (props.getDetailPanelContent == null) {
|
|
@@ -27,5 +28,19 @@ export const useGridDetailPanelPreProcessors = (apiRef, props) => {
|
|
|
27
28
|
});
|
|
28
29
|
return columnsState;
|
|
29
30
|
}, [apiRef, props.getDetailPanelContent]);
|
|
31
|
+
const addExpandedClassToRow = React.useCallback((classes, id) => {
|
|
32
|
+
if (props.getDetailPanelContent == null) {
|
|
33
|
+
return classes;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const expandedRowIds = gridDetailPanelExpandedRowIdsSelector(apiRef.current.state);
|
|
37
|
+
|
|
38
|
+
if (!expandedRowIds.includes(id)) {
|
|
39
|
+
return classes;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return [...classes, 'MuiDataGrid-row--detailPanelExpanded'];
|
|
43
|
+
}, [apiRef, props.getDetailPanelContent]);
|
|
30
44
|
useGridRegisterPipeProcessor(apiRef, 'hydrateColumns', addToggleColumn);
|
|
45
|
+
useGridRegisterPipeProcessor(apiRef, 'rowClassName', addExpandedClassToRow);
|
|
31
46
|
};
|
|
@@ -6,4 +6,4 @@ import { DataGridProProcessedProps } from '../../../models/dataGridProProps';
|
|
|
6
6
|
* @requires useGridDimensions (method) - can be after
|
|
7
7
|
* @requires useGridScroll (method
|
|
8
8
|
*/
|
|
9
|
-
export declare const useGridInfiniteLoader: (apiRef: React.MutableRefObject<GridApiPro>, props: Pick<DataGridProProcessedProps, 'onRowsScrollEnd' | 'scrollEndThreshold' | 'pagination' | 'paginationMode'>) => void;
|
|
9
|
+
export declare const useGridInfiniteLoader: (apiRef: React.MutableRefObject<GridApiPro>, props: Pick<DataGridProProcessedProps, 'onRowsScrollEnd' | 'scrollEndThreshold' | 'pagination' | 'paginationMode' | 'rowsLoadingMode'>) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { useGridSelector, useGridApiEventHandler, useGridApiOptionHandler, gridVisibleColumnDefinitionsSelector, gridRowsMetaSelector } from '@mui/x-data-grid';
|
|
2
|
+
import { useGridSelector, useGridApiEventHandler, useGridApiOptionHandler, gridVisibleColumnDefinitionsSelector, gridRowsMetaSelector, GridFeatureModeConstant } from '@mui/x-data-grid';
|
|
3
3
|
import { useGridVisibleRows } from '@mui/x-data-grid/internals';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -14,9 +14,9 @@ export const useGridInfiniteLoader = (apiRef, props) => {
|
|
|
14
14
|
const contentHeight = Math.max(rowsMeta.currentPageTotalHeight, 1);
|
|
15
15
|
const isInScrollBottomArea = React.useRef(false);
|
|
16
16
|
const handleRowsScrollEnd = React.useCallback(scrollPosition => {
|
|
17
|
-
const dimensions = apiRef.current.getRootDimensions();
|
|
17
|
+
const dimensions = apiRef.current.getRootDimensions(); // Prevent the infite loading working in combination with lazy loading
|
|
18
18
|
|
|
19
|
-
if (!dimensions) {
|
|
19
|
+
if (!dimensions || props.rowsLoadingMode !== GridFeatureModeConstant.client) {
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
22
|
|
|
@@ -36,7 +36,7 @@ export const useGridInfiniteLoader = (apiRef, props) => {
|
|
|
36
36
|
apiRef.current.publishEvent('rowsScrollEnd', rowScrollEndParam);
|
|
37
37
|
isInScrollBottomArea.current = true;
|
|
38
38
|
}
|
|
39
|
-
}, [contentHeight, props.scrollEndThreshold, visibleColumns, apiRef, currentPage.rows.length]);
|
|
39
|
+
}, [contentHeight, props.scrollEndThreshold, props.rowsLoadingMode, visibleColumns, apiRef, currentPage.rows.length]);
|
|
40
40
|
const handleGridScroll = React.useCallback(({
|
|
41
41
|
left,
|
|
42
42
|
top
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { GridApiPro } from '../../../models/gridApiPro';
|
|
3
|
+
import { DataGridProProcessedProps } from '../../../models/dataGridProProps';
|
|
4
|
+
/**
|
|
5
|
+
* @requires useGridRows (state)
|
|
6
|
+
* @requires useGridPagination (state)
|
|
7
|
+
* @requires useGridDimensions (method) - can be after
|
|
8
|
+
* @requires useGridScroll (method
|
|
9
|
+
*/
|
|
10
|
+
export declare const useGridLazyLoader: (apiRef: React.MutableRefObject<GridApiPro>, props: Pick<DataGridProProcessedProps, 'onFetchRows' | 'rowsLoadingMode' | 'pagination' | 'paginationMode' | 'rowBuffer' | 'experimentalFeatures'>) => void;
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useGridApiEventHandler, GridFeatureModeConstant, useGridSelector, gridSortModelSelector, gridFilterModelSelector, useGridApiOptionHandler } from '@mui/x-data-grid';
|
|
3
|
+
import { useGridVisibleRows, getRenderableIndexes } from '@mui/x-data-grid/internals';
|
|
4
|
+
|
|
5
|
+
function findSkeletonRowsSection(visibleRows, range) {
|
|
6
|
+
let {
|
|
7
|
+
firstRowIndex,
|
|
8
|
+
lastRowIndex
|
|
9
|
+
} = range;
|
|
10
|
+
const visibleRowsSection = visibleRows.slice(range.firstRowIndex, range.lastRowIndex);
|
|
11
|
+
let startIndex = 0;
|
|
12
|
+
let endIndex = visibleRowsSection.length - 1;
|
|
13
|
+
let isSkeletonSectionFound = false;
|
|
14
|
+
|
|
15
|
+
while (!isSkeletonSectionFound && firstRowIndex < lastRowIndex) {
|
|
16
|
+
if (!visibleRowsSection[startIndex].model && !visibleRowsSection[endIndex].model) {
|
|
17
|
+
isSkeletonSectionFound = true;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (visibleRowsSection[startIndex].model) {
|
|
21
|
+
startIndex += 1;
|
|
22
|
+
firstRowIndex += 1;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (visibleRowsSection[endIndex].model) {
|
|
26
|
+
endIndex -= 1;
|
|
27
|
+
lastRowIndex -= 1;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return isSkeletonSectionFound ? {
|
|
32
|
+
firstRowIndex,
|
|
33
|
+
lastRowIndex
|
|
34
|
+
} : undefined;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function isLazyLoadingDisabled({
|
|
38
|
+
lazyLoadingFeatureFlag,
|
|
39
|
+
rowsLoadingMode,
|
|
40
|
+
gridDimensions
|
|
41
|
+
}) {
|
|
42
|
+
if (!lazyLoadingFeatureFlag || !gridDimensions) {
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (rowsLoadingMode !== GridFeatureModeConstant.server) {
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* @requires useGridRows (state)
|
|
54
|
+
* @requires useGridPagination (state)
|
|
55
|
+
* @requires useGridDimensions (method) - can be after
|
|
56
|
+
* @requires useGridScroll (method
|
|
57
|
+
*/
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
export const useGridLazyLoader = (apiRef, props) => {
|
|
61
|
+
var _props$experimentalFe;
|
|
62
|
+
|
|
63
|
+
const visibleRows = useGridVisibleRows(apiRef, props);
|
|
64
|
+
const sortModel = useGridSelector(apiRef, gridSortModelSelector);
|
|
65
|
+
const filterModel = useGridSelector(apiRef, gridFilterModelSelector);
|
|
66
|
+
const renderedRowsIntervalCache = React.useRef({
|
|
67
|
+
firstRowToRender: 0,
|
|
68
|
+
lastRowToRender: 0
|
|
69
|
+
});
|
|
70
|
+
const {
|
|
71
|
+
lazyLoading
|
|
72
|
+
} = (_props$experimentalFe = props.experimentalFeatures) != null ? _props$experimentalFe : {};
|
|
73
|
+
const getCurrentIntervalToRender = React.useCallback(() => {
|
|
74
|
+
const currentRenderContext = apiRef.current.unstable_getRenderContext();
|
|
75
|
+
const [firstRowToRender, lastRowToRender] = getRenderableIndexes({
|
|
76
|
+
firstIndex: currentRenderContext.firstRowIndex,
|
|
77
|
+
lastIndex: currentRenderContext.lastRowIndex,
|
|
78
|
+
minFirstIndex: 0,
|
|
79
|
+
maxLastIndex: visibleRows.rows.length,
|
|
80
|
+
buffer: props.rowBuffer
|
|
81
|
+
});
|
|
82
|
+
return {
|
|
83
|
+
firstRowToRender,
|
|
84
|
+
lastRowToRender
|
|
85
|
+
};
|
|
86
|
+
}, [apiRef, props.rowBuffer, visibleRows.rows.length]);
|
|
87
|
+
const handleRenderedRowsIntervalChange = React.useCallback(params => {
|
|
88
|
+
const dimensions = apiRef.current.getRootDimensions();
|
|
89
|
+
|
|
90
|
+
if (isLazyLoadingDisabled({
|
|
91
|
+
lazyLoadingFeatureFlag: lazyLoading,
|
|
92
|
+
rowsLoadingMode: props.rowsLoadingMode,
|
|
93
|
+
gridDimensions: dimensions
|
|
94
|
+
})) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const fetchRowsParams = {
|
|
99
|
+
firstRowToRender: params.firstRowToRender,
|
|
100
|
+
lastRowToRender: params.lastRowToRender,
|
|
101
|
+
sortModel,
|
|
102
|
+
filterModel
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
if (renderedRowsIntervalCache.current.firstRowToRender === params.firstRowToRender && renderedRowsIntervalCache.current.lastRowToRender === params.lastRowToRender) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (sortModel.length === 0 && filterModel.items.length === 0) {
|
|
110
|
+
const skeletonRowsSection = findSkeletonRowsSection(visibleRows.rows, {
|
|
111
|
+
firstRowIndex: params.firstRowToRender,
|
|
112
|
+
lastRowIndex: params.lastRowToRender
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
if (!skeletonRowsSection) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
fetchRowsParams.firstRowToRender = skeletonRowsSection.firstRowIndex;
|
|
120
|
+
fetchRowsParams.lastRowToRender = skeletonRowsSection.lastRowIndex;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
renderedRowsIntervalCache.current = params;
|
|
124
|
+
apiRef.current.publishEvent('fetchRows', fetchRowsParams);
|
|
125
|
+
}, [apiRef, props.rowsLoadingMode, sortModel, filterModel, visibleRows.rows, lazyLoading]);
|
|
126
|
+
const handleGridSortModelChange = React.useCallback(newSortModel => {
|
|
127
|
+
const dimensions = apiRef.current.getRootDimensions();
|
|
128
|
+
|
|
129
|
+
if (isLazyLoadingDisabled({
|
|
130
|
+
lazyLoadingFeatureFlag: lazyLoading,
|
|
131
|
+
rowsLoadingMode: props.rowsLoadingMode,
|
|
132
|
+
gridDimensions: dimensions
|
|
133
|
+
})) {
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
apiRef.current.unstable_requestPipeProcessorsApplication('hydrateRows');
|
|
138
|
+
const {
|
|
139
|
+
firstRowToRender,
|
|
140
|
+
lastRowToRender
|
|
141
|
+
} = getCurrentIntervalToRender();
|
|
142
|
+
const fetchRowsParams = {
|
|
143
|
+
firstRowToRender,
|
|
144
|
+
lastRowToRender,
|
|
145
|
+
sortModel: newSortModel,
|
|
146
|
+
filterModel
|
|
147
|
+
};
|
|
148
|
+
apiRef.current.publishEvent('fetchRows', fetchRowsParams);
|
|
149
|
+
}, [apiRef, props.rowsLoadingMode, filterModel, lazyLoading, getCurrentIntervalToRender]);
|
|
150
|
+
const handleGridFilterModelChange = React.useCallback(newFilterModel => {
|
|
151
|
+
const dimensions = apiRef.current.getRootDimensions();
|
|
152
|
+
|
|
153
|
+
if (isLazyLoadingDisabled({
|
|
154
|
+
lazyLoadingFeatureFlag: lazyLoading,
|
|
155
|
+
rowsLoadingMode: props.rowsLoadingMode,
|
|
156
|
+
gridDimensions: dimensions
|
|
157
|
+
})) {
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
apiRef.current.unstable_requestPipeProcessorsApplication('hydrateRows');
|
|
162
|
+
const {
|
|
163
|
+
firstRowToRender,
|
|
164
|
+
lastRowToRender
|
|
165
|
+
} = getCurrentIntervalToRender();
|
|
166
|
+
const fetchRowsParams = {
|
|
167
|
+
firstRowToRender,
|
|
168
|
+
lastRowToRender,
|
|
169
|
+
sortModel,
|
|
170
|
+
filterModel: newFilterModel
|
|
171
|
+
};
|
|
172
|
+
apiRef.current.publishEvent('fetchRows', fetchRowsParams);
|
|
173
|
+
}, [apiRef, props.rowsLoadingMode, sortModel, lazyLoading, getCurrentIntervalToRender]);
|
|
174
|
+
useGridApiEventHandler(apiRef, 'renderedRowsIntervalChange', handleRenderedRowsIntervalChange);
|
|
175
|
+
useGridApiEventHandler(apiRef, 'sortModelChange', handleGridSortModelChange);
|
|
176
|
+
useGridApiEventHandler(apiRef, 'filterModelChange', handleGridFilterModelChange);
|
|
177
|
+
useGridApiOptionHandler(apiRef, 'fetchRows', props.onFetchRows);
|
|
178
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { DataGridProProcessedProps } from '../../../models/dataGridProProps';
|
|
3
|
+
import { GridApiPro } from '../../../models/gridApiPro';
|
|
4
|
+
export declare const GRID_SKELETON_ROW_ROOT_ID = "auto-generated-skeleton-row-root";
|
|
5
|
+
export declare const useGridLazyLoaderPreProcessors: (apiRef: React.MutableRefObject<GridApiPro>, props: Pick<DataGridProProcessedProps, 'rowCount' | 'rowsLoadingMode' | 'experimentalFeatures'>) => void;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useGridRegisterPipeProcessor } from '@mui/x-data-grid/internals';
|
|
4
|
+
import { GridFeatureModeConstant } from '@mui/x-data-grid';
|
|
5
|
+
export const GRID_SKELETON_ROW_ROOT_ID = 'auto-generated-skeleton-row-root';
|
|
6
|
+
|
|
7
|
+
const getSkeletonRowId = index => `${GRID_SKELETON_ROW_ROOT_ID}-${index}`;
|
|
8
|
+
|
|
9
|
+
export const useGridLazyLoaderPreProcessors = (apiRef, props) => {
|
|
10
|
+
var _props$experimentalFe;
|
|
11
|
+
|
|
12
|
+
const {
|
|
13
|
+
lazyLoading
|
|
14
|
+
} = (_props$experimentalFe = props.experimentalFeatures) != null ? _props$experimentalFe : {};
|
|
15
|
+
const addSkeletonRows = React.useCallback(groupingParams => {
|
|
16
|
+
if (!lazyLoading || props.rowsLoadingMode !== GridFeatureModeConstant.server || !props.rowCount || groupingParams.ids.length >= props.rowCount) {
|
|
17
|
+
return groupingParams;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const newRowsIds = [...groupingParams.ids];
|
|
21
|
+
|
|
22
|
+
for (let i = 0; i < props.rowCount - groupingParams.ids.length; i += 1) {
|
|
23
|
+
const skeletonId = getSkeletonRowId(i);
|
|
24
|
+
newRowsIds.push(skeletonId);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return _extends({}, groupingParams, {
|
|
28
|
+
ids: newRowsIds
|
|
29
|
+
});
|
|
30
|
+
}, [props.rowCount, props.rowsLoadingMode, lazyLoading]);
|
|
31
|
+
useGridRegisterPipeProcessor(apiRef, 'hydrateRows', addSkeletonRows);
|
|
32
|
+
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { GridRowTreeConfig, GridFilterState, GridFilterModel } from '@mui/x-data-grid';
|
|
2
|
-
import { GridAggregatedFilterItemApplier } from '@mui/x-data-grid/internals';
|
|
3
|
+
import { GridAggregatedFilterItemApplier, GridApiCommunity } from '@mui/x-data-grid/internals';
|
|
3
4
|
interface FilterRowTreeFromTreeDataParams {
|
|
4
5
|
rowTree: GridRowTreeConfig;
|
|
5
6
|
disableChildrenFiltering: boolean;
|
|
6
7
|
isRowMatchingFilters: GridAggregatedFilterItemApplier | null;
|
|
7
8
|
filterModel: GridFilterModel;
|
|
9
|
+
apiRef: React.MutableRefObject<GridApiCommunity>;
|
|
8
10
|
}
|
|
9
11
|
export declare const TREE_DATA_STRATEGY = "tree-data";
|
|
10
12
|
/**
|
|
@@ -31,7 +31,7 @@ export const filterRowTreeFromTreeData = params => {
|
|
|
31
31
|
passingFilterItems,
|
|
32
32
|
passingQuickFilterValues
|
|
33
33
|
} = isRowMatchingFilters(node.id);
|
|
34
|
-
isMatchingFilters = passFilterLogic([passingFilterItems], [passingQuickFilterValues], params.filterModel);
|
|
34
|
+
isMatchingFilters = passFilterLogic([passingFilterItems], [passingQuickFilterValues], params.filterModel, params.apiRef);
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
let filteredDescendantCount = 0;
|