@mui/x-data-grid-pro 7.17.0 → 7.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +208 -5
- package/DataGridPro/DataGridPro.js +33 -2
- package/DataGridPro/useDataGridProComponent.js +2 -0
- package/DataGridPro/useDataGridProProps.js +1 -0
- package/components/headerFiltering/GridHeaderFilterCell.js +11 -1
- package/esm/DataGridPro/DataGridPro.js +33 -2
- package/esm/DataGridPro/useDataGridProComponent.js +3 -1
- package/esm/DataGridPro/useDataGridProProps.js +2 -1
- package/esm/components/headerFiltering/GridHeaderFilterCell.js +12 -2
- package/esm/hooks/features/columnHeaders/useGridColumnHeaders.js +0 -3
- package/esm/hooks/features/columnReorder/useGridColumnReorder.js +6 -1
- package/esm/hooks/features/dataSource/useGridDataSource.js +3 -3
- package/esm/hooks/features/infiniteLoader/useGridInfiniteLoader.js +20 -7
- package/esm/utils/releaseInfo.js +1 -1
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +0 -3
- package/hooks/features/columnReorder/useGridColumnReorder.js +6 -1
- package/hooks/features/dataSource/useGridDataSource.js +3 -3
- package/hooks/features/infiniteLoader/useGridInfiniteLoader.js +19 -6
- package/index.js +1 -1
- package/material/index.d.ts +2 -2
- package/modern/DataGridPro/DataGridPro.js +33 -2
- package/modern/DataGridPro/useDataGridProComponent.js +3 -1
- package/modern/DataGridPro/useDataGridProProps.js +2 -1
- package/modern/components/headerFiltering/GridHeaderFilterCell.js +12 -2
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +0 -3
- package/modern/hooks/features/columnReorder/useGridColumnReorder.js +6 -1
- package/modern/hooks/features/dataSource/useGridDataSource.js +3 -3
- package/modern/hooks/features/infiniteLoader/useGridInfiniteLoader.js +20 -7
- package/modern/index.js +1 -1
- package/modern/utils/releaseInfo.js +1 -1
- package/package.json +5 -5
- package/utils/releaseInfo.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,209 @@
|
|
|
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
|
+
## 7.19.0
|
|
7
|
+
|
|
8
|
+
_Oct 4, 2024_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 26 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🔁 Automatic parents and children selection for Data Grid ["tree data"](https://mui.com/x/react-data-grid/tree-data/) and ["row grouping"](https://mui.com/x/react-data-grid/row-grouping/) features
|
|
13
|
+
- 💫 Support `minHeight` and `maxHeight` on flex parent container for the Data Grid component
|
|
14
|
+
- 🎁 Export `publicAPI` from the `useTreeItem2Utils` hook for the Tree View
|
|
15
|
+
- 🌍 Improve Bulgarian (bg-BG), Croatian (hr-HR), French (fr-FR), German (de-DE), Japanese (ja-JP) and Vietnamese (vi-VN) locales and add Portuguese (pt-PT) locale on the Data Grid component
|
|
16
|
+
- 🌏 Improve Czech (cs-CZ) and Portuguese (pt-BR) locales and add Bulgarian (bg-BG), Croatian (hr-HR) and Portuguese (pt-PT) locales on the Pickers components
|
|
17
|
+
- 🐞 Bugfixes
|
|
18
|
+
- 📚 Documentation improvements
|
|
19
|
+
|
|
20
|
+
Special thanks goes out to our community contributors who have helped make this release possible:
|
|
21
|
+
@AWAIS97, @chucamphong, @GMchris, @JakubSveda, @k-rajat19, @k725, @lhilgert9, @ruiaraujo012, @Sanderand, @thomasmoon, @vallereaugabriel.
|
|
22
|
+
Following are all team members who have contributed to this release:
|
|
23
|
+
@alexfauquette, @arminmeh, @arthurbalduini, @cherniavskii, @flaviendelangle, @Janpot, @JCQuintas, @KenanYusuf, @MBilalShafi, @michelengelen, @noraleonte, @oliviertassinari, @romgrk, @sai6855, @samuelsycamore.
|
|
24
|
+
|
|
25
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
26
|
+
|
|
27
|
+
### Data Grid
|
|
28
|
+
|
|
29
|
+
#### `@mui/x-data-grid@7.19.0`
|
|
30
|
+
|
|
31
|
+
- [DataGrid] Fix column definition `undefined` value (#14456) @sai6855
|
|
32
|
+
- [DataGrid] Fix `checkboxSelectionVisibleOnly` reset the selection on filtering (#14677) @MBilalShafi
|
|
33
|
+
- [DataGrid] Fix background colors when `CSSVarsProvider` is used (#12901) @cherniavskii
|
|
34
|
+
- [DataGrid] Fix error when initializing aggregation with row spanning (#14710) @MBilalShafi
|
|
35
|
+
- [DataGrid] Fix scroll to cell logic for keyboard navigating cells and drag selection with pinned columns (#14550) @KenanYusuf
|
|
36
|
+
- [DataGrid] Support `minHeight` and `maxHeight` on flex parent container (#14614) @cherniavskii
|
|
37
|
+
- [l10n] Add missing Portuguese (pt-PT) translations (#14707) @ruiaraujo012
|
|
38
|
+
- [l10n] Improve Bulgarian (bg-BG) locale (#14451) @GMchris
|
|
39
|
+
- [l10n] Improve Croatian (hr-HR) locale (#14794) @arminmeh
|
|
40
|
+
- [l10n] Improve French (fr-FR) locale (#14750) @vallereaugabriel
|
|
41
|
+
- [l10n] Improve German (de-DE) locale (#14755) @lhilgert9
|
|
42
|
+
- [l10n] Improve Japanese (ja-JP) locale (#14381) @k725
|
|
43
|
+
- [l10n] Improve Vietnamese (vi-VN) locale (#14769) @chucamphong
|
|
44
|
+
|
|
45
|
+
#### `@mui/x-data-grid-pro@7.19.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
46
|
+
|
|
47
|
+
Same changes as in `@mui/x-data-grid@7.19.0`, plus:
|
|
48
|
+
|
|
49
|
+
- [DataGridPro] Fix dragging styles removal in column reorder (#14680) @k-rajat19
|
|
50
|
+
- [DataGridPro] Fix row pre-processing running with a stale data source (#14810) @MBilalShafi
|
|
51
|
+
- [DataGridPro] Fix `onRowsScrollEnd` not firing on very fast scrolling (#14171) @arminmeh
|
|
52
|
+
|
|
53
|
+
#### `@mui/x-data-grid-premium@7.19.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
54
|
+
|
|
55
|
+
Same changes as in `@mui/x-data-grid-pro@7.19.0`, plus:
|
|
56
|
+
|
|
57
|
+
- [DataGridPremium] Automatic parents and children selection (#13757) @MBilalShafi
|
|
58
|
+
|
|
59
|
+
### Date and Time Pickers
|
|
60
|
+
|
|
61
|
+
#### `@mui/x-date-pickers@7.19.0`
|
|
62
|
+
|
|
63
|
+
- [pickers] Fix left-right keyboard nav with `yearsOrder="desc"` and `direction="rtl"` (#14682) @thomasmoon
|
|
64
|
+
- [pickers] Improve `PickerValidDate` type (#14771) @flaviendelangle
|
|
65
|
+
- [pickers] Improve typing of the range pickers (#14716) @flaviendelangle
|
|
66
|
+
- [l10n] Add Bulgarian (bg-BG) locale (#14469) @GMchris
|
|
67
|
+
- [l10n] Add Croatian (hr-HR) locale (#14795) @arminmeh
|
|
68
|
+
- [l10n] Add Portuguese (pt-PT) locale (#14722) @ruiaraujo012
|
|
69
|
+
- [l10n] Improve Czech (cs-CZ) locale (#14732) @JakubSveda
|
|
70
|
+
- [l10n] Improve Portuguese (pt-BR) locale (#14725) @arthurbalduini
|
|
71
|
+
|
|
72
|
+
#### `@mui/x-date-pickers-pro@7.19.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
73
|
+
|
|
74
|
+
Same changes as in `@mui/x-date-pickers@7.19.0`.
|
|
75
|
+
|
|
76
|
+
### Charts
|
|
77
|
+
|
|
78
|
+
#### `@mui/x-charts@7.19.0`
|
|
79
|
+
|
|
80
|
+
- [charts] Fix `LineChart` area animation being stuck when resizing container (#14711) @alexfauquette
|
|
81
|
+
- [charts] Improve types and start using `warnOnce` (#14792) @JCQuintas
|
|
82
|
+
|
|
83
|
+
#### `@mui/x-charts-pro@7.0.0-beta.3` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
84
|
+
|
|
85
|
+
Same changes as in `@mui/x-charts@7.19.0`.
|
|
86
|
+
|
|
87
|
+
### Tree View
|
|
88
|
+
|
|
89
|
+
#### `@mui/x-tree-view@7.19.0`
|
|
90
|
+
|
|
91
|
+
- [TreeView] Apply experimental features in `getDefaultizedParams` instead of in the plugin render (#14661) @flaviendelangle
|
|
92
|
+
- [TreeView] Export `publicAPI` form `useTreeItem2Utils` (#14729) @noraleonte
|
|
93
|
+
- [TreeView] Fix cursor navigation interfering with browser shortcut keys (#14798) @sai6855
|
|
94
|
+
- [TreeView] Fix invalid test for items reordering (#14665) @flaviendelangle
|
|
95
|
+
- [TreeView] Remove `instance.getTreeItemIdAttribute` (#14667) @flaviendelangle
|
|
96
|
+
|
|
97
|
+
### Docs
|
|
98
|
+
|
|
99
|
+
- [docs] Added warning callout for Firefox reordering bug (#14516) @michelengelen
|
|
100
|
+
- [docs] Copyedit `pages.ts` navigation (#14782) @samuelsycamore
|
|
101
|
+
- [docs] Fix typo in row spanning doc (#14770) @flaviendelangle
|
|
102
|
+
- [docs] Fix typo in the Tree View migration guide to v7 (#14727) @Sanderand
|
|
103
|
+
- [docs] Fix typo in usage of Moment guide for UTC and timezones (#14780) @AWAIS97
|
|
104
|
+
- [docs] Fix what's new link to use absolute URL (#14543) @oliviertassinari
|
|
105
|
+
|
|
106
|
+
### Core
|
|
107
|
+
|
|
108
|
+
- [core] Fix class name composition order (#14775) @oliviertassinari
|
|
109
|
+
- [core] Replace minWidth, maxWidth with width (#14776) @oliviertassinari
|
|
110
|
+
- [code-infra] Remove custom playwright installation steps (#14728) @Janpot
|
|
111
|
+
- [code-infra] Replace or remove all instances of `e` identifier (#14724) @samuelsycamore
|
|
112
|
+
- [infra] Adds community contribution section to the changelog script (#14799) @michelengelen
|
|
113
|
+
- [infra] Fix line break in Stack Overflow message @oliviertassinari
|
|
114
|
+
- [test] Fix `Escape` event firing event (#14797) @oliviertassinari
|
|
115
|
+
|
|
116
|
+
## 7.18.0
|
|
117
|
+
|
|
118
|
+
_Sep 20, 2024_
|
|
119
|
+
|
|
120
|
+
We'd like to offer a big thanks to the 14 contributors who made this release possible. Here are some highlights ✨:
|
|
121
|
+
|
|
122
|
+
- 💫 Support [Row spanning](https://mui.com/x/react-data-grid/row-spanning/) on the Data Grid that automatically merges the consecutive cells in a column based on the cell value
|
|
123
|
+
|
|
124
|
+
<img width="600" src="https://github.com/user-attachments/assets/d32ec936-d238-4c92-9e1a-af6788d74cdf" alt="data grid row spanning" />
|
|
125
|
+
|
|
126
|
+
- ⏰ Support `date-fns` v4 (#14673) @LukasTy
|
|
127
|
+
- 🎉 Add option for Pickers to change the order of displayed years (#11780) @thomasmoon
|
|
128
|
+
- 🐞 Bugfixes
|
|
129
|
+
- 📚 Documentation improvements
|
|
130
|
+
|
|
131
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
132
|
+
|
|
133
|
+
### Data Grid
|
|
134
|
+
|
|
135
|
+
#### `@mui/x-data-grid@7.18.0`
|
|
136
|
+
|
|
137
|
+
- [DataGrid] Add default reset value in row edit mode (#14050) @michelengelen
|
|
138
|
+
- [DataGrid] Add `columnGroupHeaderHeight` prop for sizing column group headers (#14637) @KenanYusuf
|
|
139
|
+
- [DataGrid] Fix `document` reference when the grid is rendered in a popup window (#14649) @arminmeh
|
|
140
|
+
- [DataGrid] Remove `minFirstColumn` from `GetHeadersParams` interface (#14450) @k-rajat19
|
|
141
|
+
- [DataGrid] Row spanning (#14124) @MBilalShafi
|
|
142
|
+
|
|
143
|
+
#### `@mui/x-data-grid-pro@7.18.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
144
|
+
|
|
145
|
+
Same changes as in `@mui/x-data-grid@7.18.0`, plus:
|
|
146
|
+
|
|
147
|
+
- [DataGridPro] Fix `onRowsScrollEnd` being triggered instantly when bottom pinned row is present (#14602) @arminmeh
|
|
148
|
+
- [DataGridPro] Fix header filters rendering issue for `isEmpty` and `isNotEmpty` filter operators (#14493) @k-rajat19
|
|
149
|
+
- [DataGridPro] Fix pinned columns in RTL mode (#14586) @KenanYusuf
|
|
150
|
+
|
|
151
|
+
#### `@mui/x-data-grid-premium@7.18.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
152
|
+
|
|
153
|
+
Same changes as in `@mui/x-data-grid-pro@7.18.0`.
|
|
154
|
+
|
|
155
|
+
### Date and Time Pickers
|
|
156
|
+
|
|
157
|
+
#### `@mui/x-date-pickers@7.18.0`
|
|
158
|
+
|
|
159
|
+
- [pickers] Add option to change the order of displayed years (#11780) @thomasmoon
|
|
160
|
+
- [pickers] Support `date-fns` v4 (#14673) @LukasTy
|
|
161
|
+
|
|
162
|
+
#### `@mui/x-date-pickers-pro@7.18.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
163
|
+
|
|
164
|
+
Same changes as in `@mui/x-date-pickers@7.18.0`.
|
|
165
|
+
|
|
166
|
+
### Charts
|
|
167
|
+
|
|
168
|
+
#### `@mui/x-charts@7.18.0`
|
|
169
|
+
|
|
170
|
+
- [charts] Add a `PolarProvider` to manage polar axes (#14642) @alexfauquette
|
|
171
|
+
- [charts] Fix `LineChart` animation being stuck with initial drawing area value (#14553) @JCQuintas
|
|
172
|
+
- [charts] Fix legend slot typing (#14657) @alexfauquette
|
|
173
|
+
- [charts] Pass the axis index to extremum getter (#14641) @alexfauquette
|
|
174
|
+
- [charts] Provide hooks to create custom tooltip (#14377) @alexfauquette
|
|
175
|
+
|
|
176
|
+
#### `@mui/x-charts-pro@7.0.0-beta.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
177
|
+
|
|
178
|
+
Same changes as in `@mui/x-charts@7.18.0`.
|
|
179
|
+
|
|
180
|
+
### Tree View
|
|
181
|
+
|
|
182
|
+
#### `@mui/x-tree-view@7.18.0`
|
|
183
|
+
|
|
184
|
+
- [TreeView] Add `"use client"` directive to every public component and hook (#14579) @flaviendelangle
|
|
185
|
+
|
|
186
|
+
### Docs
|
|
187
|
+
|
|
188
|
+
- [docs] Add `groupingValueGetter` callout in column definition docs (#14599) @michelengelen
|
|
189
|
+
- [docs] Clean v6 => v7 migration guide (#14652) @flaviendelangle
|
|
190
|
+
- [docs] Copy `vale-action.yml` from main repo @oliviertassinari
|
|
191
|
+
- [docs] Edit the Pickers Getting started doc (#14555) @samuelsycamore
|
|
192
|
+
- [docs] Fix TypeScript capitalization @oliviertassinari
|
|
193
|
+
- [docs] Fix Vale error @oliviertassinari
|
|
194
|
+
- [docs] Make the migration guide diff a bit easier to read @oliviertassinari
|
|
195
|
+
- [docs] Report Vale at warning level (#14660) @oliviertassinari
|
|
196
|
+
- [docs] Warn about the `valueGetter` and `valueFormatter` signature change (#14613) @cherniavskii
|
|
197
|
+
- [docs] Polish code formatting (#14603) @oliviertassinari
|
|
198
|
+
- [test] Spy on `observe` method to avoid flaky wait for a callback (#14640) @arminmeh
|
|
199
|
+
|
|
200
|
+
### Core
|
|
201
|
+
|
|
202
|
+
- [core] Fix 301 link to Next.js and git diff @oliviertassinari
|
|
203
|
+
- [core] Fix failing CI on `master` (#14644) @cherniavskii
|
|
204
|
+
- [core] Fix `package.json` repository rule @oliviertassinari
|
|
205
|
+
- [core] MUI X repository moved to a new location @oliviertassinari
|
|
206
|
+
- [docs-infra] Strengthen CSP (#14581) @oliviertassinari
|
|
207
|
+
- [license] Finish renaming of LicensingModel (#14615) @oliviertassinari
|
|
208
|
+
|
|
6
209
|
## 7.17.0
|
|
7
210
|
|
|
8
211
|
_Sep 13, 2024_
|
|
@@ -75,7 +278,7 @@ Same changes as in `@mui/x-charts@7.17.0`.
|
|
|
75
278
|
### Docs
|
|
76
279
|
|
|
77
280
|
- [docs] Add missing callout on "Imperative API" tree view sections (#14503) @flaviendelangle
|
|
78
|
-
- [docs] Fix broken redirection to MUI
|
|
281
|
+
- [docs] Fix broken redirection to MUI X v5 @oliviertassinari
|
|
79
282
|
- [docs] Fix multiple `console.error` messages on `charts` docs (#14554) @JCQuintas
|
|
80
283
|
- [docs] Fixed typo in Row Grouping recipes (#14549) @Miodini
|
|
81
284
|
- [docs] Match title with blog posts @oliviertassinari
|
|
@@ -195,7 +398,7 @@ We'd like to offer a big thanks to the 8 contributors who made this release poss
|
|
|
195
398
|
|
|
196
399
|
- 💫 Support Material UI v6 (`@mui/material@6`) peer dependency (#14142) @cherniavskii
|
|
197
400
|
|
|
198
|
-
You can now use MUI
|
|
401
|
+
You can now use MUI X components with either v5 or v6 of `@mui/material` package 🎉
|
|
199
402
|
|
|
200
403
|
- 🐞 Bugfixes
|
|
201
404
|
|
|
@@ -240,7 +443,7 @@ Same changes as in `@mui/x-charts@7.15.0`, plus:
|
|
|
240
443
|
|
|
241
444
|
- [docs] Fix sentence case `h2` @oliviertassinari
|
|
242
445
|
- [docs] Clarify contribution guide references @oliviertassinari
|
|
243
|
-
- [docs] Fix Stack
|
|
446
|
+
- [docs] Fix Stack Overflow issue canned response @oliviertassinari
|
|
244
447
|
- [docs] Fix outdated link to support page @oliviertassinari
|
|
245
448
|
- [docs] Fix use of Material UI @oliviertassinari
|
|
246
449
|
- [docs] Update deprecated props in docs (#14295) @JCQuintas
|
|
@@ -498,7 +701,7 @@ The [Pro plan](https://mui.com/x/introduction/licensing/#pro-plan) is receiving
|
|
|
498
701
|
|
|
499
702
|
As always, every feature released as part of the MIT plan will remain free and MIT licensed forever.
|
|
500
703
|
|
|
501
|
-
This expansion of the Pro plan comes with some adjustments to our pricing strategy. Learn more about those in the [Upcoming changes to MUI
|
|
704
|
+
This expansion of the Pro plan comes with some adjustments to our pricing strategy. Learn more about those in the [Upcoming changes to MUI X pricing in 2024](https://mui.com/blog/mui-x-sep-2024-price-update/) blog post.
|
|
502
705
|
|
|
503
706
|
### Highlights
|
|
504
707
|
|
|
@@ -563,7 +766,7 @@ Same changes as in `@mui/x-date-pickers@7.12.0`.
|
|
|
563
766
|
#### `@mui/x-charts@7.12.0`
|
|
564
767
|
|
|
565
768
|
- [charts] Fix incorrect `axisId` prop being allowed in xAxis/yAxis config. Use `id` instead. (#13986) @JCQuintas
|
|
566
|
-
- [charts] Use vendor to have
|
|
769
|
+
- [charts] Use vendor to have CommonJS bundle working out of the box (#13608) @alexfauquette
|
|
567
770
|
- [charts] Divide the `SeriesProvider` to use in filtering (#14026) @JCQuintas
|
|
568
771
|
|
|
569
772
|
### Tree View
|
|
@@ -83,6 +83,11 @@ DataGridProRaw.propTypes = {
|
|
|
83
83
|
/**
|
|
84
84
|
* If `true`, the Data Grid height is dynamic and follows the number of rows in the Data Grid.
|
|
85
85
|
* @default false
|
|
86
|
+
* @deprecated Use flex parent container instead: https://mui.com/x/react-data-grid/layout/#flex-parent-container
|
|
87
|
+
* @example
|
|
88
|
+
* <div style={{ display: 'flex', flexDirection: 'column' }}>
|
|
89
|
+
* <DataGrid />
|
|
90
|
+
* </div>
|
|
86
91
|
*/
|
|
87
92
|
autoHeight: _propTypes.default.bool,
|
|
88
93
|
/**
|
|
@@ -134,6 +139,11 @@ DataGridProRaw.propTypes = {
|
|
|
134
139
|
* @default 150
|
|
135
140
|
*/
|
|
136
141
|
columnBufferPx: _propTypes.default.number,
|
|
142
|
+
/**
|
|
143
|
+
* Sets the height in pixels of the column group headers in the Data Grid.
|
|
144
|
+
* Inherits the `columnHeaderHeight` value if not set.
|
|
145
|
+
*/
|
|
146
|
+
columnGroupHeaderHeight: _propTypes.default.number,
|
|
137
147
|
columnGroupingModel: _propTypes.default.arrayOf(_propTypes.default.object),
|
|
138
148
|
/**
|
|
139
149
|
* Sets the height in pixel of the column headers in the Data Grid.
|
|
@@ -366,7 +376,7 @@ DataGridProRaw.propTypes = {
|
|
|
366
376
|
*/
|
|
367
377
|
headerFilterHeight: _propTypes.default.number,
|
|
368
378
|
/**
|
|
369
|
-
* If `true`,
|
|
379
|
+
* If `true`, the header filters feature is enabled.
|
|
370
380
|
* @default false
|
|
371
381
|
*/
|
|
372
382
|
headerFilters: _propTypes.default.bool,
|
|
@@ -851,6 +861,22 @@ DataGridProRaw.propTypes = {
|
|
|
851
861
|
* Sets the row selection model of the Data Grid.
|
|
852
862
|
*/
|
|
853
863
|
rowSelectionModel: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired), _propTypes.default.number, _propTypes.default.string]),
|
|
864
|
+
/**
|
|
865
|
+
* When `rowSelectionPropagation.descendants` is set to `true`.
|
|
866
|
+
* - Selecting a parent will auto-select all its filtered descendants.
|
|
867
|
+
* - Deselecting a parent will auto-deselect all its filtered descendants.
|
|
868
|
+
*
|
|
869
|
+
* When `rowSelectionPropagation.parents=true`
|
|
870
|
+
* - Selecting all descendants of a parent would auto-select it.
|
|
871
|
+
* - Deselecting a descendant of a selected parent would deselect the parent.
|
|
872
|
+
*
|
|
873
|
+
* Works with tree data and row grouping on the client-side only.
|
|
874
|
+
* @default { parents: false, descendants: false }
|
|
875
|
+
*/
|
|
876
|
+
rowSelectionPropagation: _propTypes.default.shape({
|
|
877
|
+
descendants: _propTypes.default.bool,
|
|
878
|
+
parents: _propTypes.default.bool
|
|
879
|
+
}),
|
|
854
880
|
/**
|
|
855
881
|
* Loading rows can be processed on the server or client-side.
|
|
856
882
|
* Set it to 'client' if you would like enable infnite loading.
|
|
@@ -935,5 +961,10 @@ DataGridProRaw.propTypes = {
|
|
|
935
961
|
get: _propTypes.default.func.isRequired,
|
|
936
962
|
set: _propTypes.default.func.isRequired
|
|
937
963
|
}),
|
|
938
|
-
unstable_onDataSourceError: _propTypes.default.func
|
|
964
|
+
unstable_onDataSourceError: _propTypes.default.func,
|
|
965
|
+
/**
|
|
966
|
+
* If `true`, the Data Grid will auto span the cells over the rows having the same value.
|
|
967
|
+
* @default false
|
|
968
|
+
*/
|
|
969
|
+
unstable_rowSpanning: _propTypes.default.bool
|
|
939
970
|
};
|
|
@@ -57,6 +57,7 @@ const useDataGridProComponent = (inputApiRef, props) => {
|
|
|
57
57
|
(0, _internals.useGridInitializeState)(_internals.sortingStateInitializer, apiRef, props);
|
|
58
58
|
(0, _internals.useGridInitializeState)(_internals.preferencePanelStateInitializer, apiRef, props);
|
|
59
59
|
(0, _internals.useGridInitializeState)(_internals.filterStateInitializer, apiRef, props);
|
|
60
|
+
(0, _internals.useGridInitializeState)(_internals.rowSpanningStateInitializer, apiRef, props);
|
|
60
61
|
(0, _internals.useGridInitializeState)(_internals.densityStateInitializer, apiRef, props);
|
|
61
62
|
(0, _internals.useGridInitializeState)(_useGridColumnReorder.columnReorderStateInitializer, apiRef, props);
|
|
62
63
|
(0, _internals.useGridInitializeState)(_internals.columnResizeStateInitializer, apiRef, props);
|
|
@@ -74,6 +75,7 @@ const useDataGridProComponent = (inputApiRef, props) => {
|
|
|
74
75
|
(0, _useGridRowPinning.useGridRowPinning)(apiRef, props);
|
|
75
76
|
(0, _internals.useGridColumns)(apiRef, props);
|
|
76
77
|
(0, _internals.useGridRows)(apiRef, props);
|
|
78
|
+
(0, _internals.useGridRowSpanning)(apiRef, props);
|
|
77
79
|
(0, _internals.useGridParamsApi)(apiRef);
|
|
78
80
|
(0, _useGridDetailPanel.useGridDetailPanel)(apiRef, props);
|
|
79
81
|
(0, _internals.useGridColumnSpanning)(apiRef);
|
|
@@ -33,6 +33,7 @@ const DATA_GRID_PRO_PROPS_DEFAULT_VALUES = exports.DATA_GRID_PRO_PROPS_DEFAULT_V
|
|
|
33
33
|
getDetailPanelHeight: () => 500,
|
|
34
34
|
headerFilters: false,
|
|
35
35
|
keepColumnPositionIfDraggedOutside: false,
|
|
36
|
+
rowSelectionPropagation: _internals.ROW_SELECTION_PROPAGATION_DEFAULT,
|
|
36
37
|
rowReordering: false,
|
|
37
38
|
rowsLoadingMode: 'client',
|
|
38
39
|
scrollEndThreshold: 80,
|
|
@@ -38,6 +38,16 @@ const dateSx = {
|
|
|
38
38
|
color: 'transparent'
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
|
+
const defaultInputComponents = {
|
|
42
|
+
string: _xDataGrid.GridFilterInputValue,
|
|
43
|
+
number: _xDataGrid.GridFilterInputValue,
|
|
44
|
+
date: _xDataGrid.GridFilterInputDate,
|
|
45
|
+
dateTime: _xDataGrid.GridFilterInputDate,
|
|
46
|
+
boolean: _xDataGrid.GridFilterInputBoolean,
|
|
47
|
+
singleSelect: _xDataGrid.GridFilterInputSingleSelect,
|
|
48
|
+
actions: null,
|
|
49
|
+
custom: null
|
|
50
|
+
};
|
|
41
51
|
const GridHeaderFilterCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
42
52
|
const {
|
|
43
53
|
colIndex,
|
|
@@ -86,7 +96,7 @@ const GridHeaderFilterCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
86
96
|
return filterModelItem ? !filterableColumnsLookup[filterModelItem.field] : false;
|
|
87
97
|
}, [colDef.field, filterModel, filterableColumnsLookup]);
|
|
88
98
|
const currentOperator = React.useMemo(() => filterOperators.find(operator => operator.value === item.operator) ?? filterOperators[0], [item.operator, filterOperators]);
|
|
89
|
-
const InputComponent = colDef.filterable || isFilterReadOnly ? currentOperator.InputComponent : null;
|
|
99
|
+
const InputComponent = colDef.filterable || isFilterReadOnly ? currentOperator.InputComponent ?? defaultInputComponents[colDef.type] : null;
|
|
90
100
|
const applyFilterChanges = React.useCallback(updatedItem => {
|
|
91
101
|
if (item.value && !updatedItem.value) {
|
|
92
102
|
apiRef.current.deleteFilterItem(updatedItem);
|
|
@@ -76,6 +76,11 @@ DataGridProRaw.propTypes = {
|
|
|
76
76
|
/**
|
|
77
77
|
* If `true`, the Data Grid height is dynamic and follows the number of rows in the Data Grid.
|
|
78
78
|
* @default false
|
|
79
|
+
* @deprecated Use flex parent container instead: https://mui.com/x/react-data-grid/layout/#flex-parent-container
|
|
80
|
+
* @example
|
|
81
|
+
* <div style={{ display: 'flex', flexDirection: 'column' }}>
|
|
82
|
+
* <DataGrid />
|
|
83
|
+
* </div>
|
|
79
84
|
*/
|
|
80
85
|
autoHeight: PropTypes.bool,
|
|
81
86
|
/**
|
|
@@ -127,6 +132,11 @@ DataGridProRaw.propTypes = {
|
|
|
127
132
|
* @default 150
|
|
128
133
|
*/
|
|
129
134
|
columnBufferPx: PropTypes.number,
|
|
135
|
+
/**
|
|
136
|
+
* Sets the height in pixels of the column group headers in the Data Grid.
|
|
137
|
+
* Inherits the `columnHeaderHeight` value if not set.
|
|
138
|
+
*/
|
|
139
|
+
columnGroupHeaderHeight: PropTypes.number,
|
|
130
140
|
columnGroupingModel: PropTypes.arrayOf(PropTypes.object),
|
|
131
141
|
/**
|
|
132
142
|
* Sets the height in pixel of the column headers in the Data Grid.
|
|
@@ -359,7 +369,7 @@ DataGridProRaw.propTypes = {
|
|
|
359
369
|
*/
|
|
360
370
|
headerFilterHeight: PropTypes.number,
|
|
361
371
|
/**
|
|
362
|
-
* If `true`,
|
|
372
|
+
* If `true`, the header filters feature is enabled.
|
|
363
373
|
* @default false
|
|
364
374
|
*/
|
|
365
375
|
headerFilters: PropTypes.bool,
|
|
@@ -844,6 +854,22 @@ DataGridProRaw.propTypes = {
|
|
|
844
854
|
* Sets the row selection model of the Data Grid.
|
|
845
855
|
*/
|
|
846
856
|
rowSelectionModel: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired), PropTypes.number, PropTypes.string]),
|
|
857
|
+
/**
|
|
858
|
+
* When `rowSelectionPropagation.descendants` is set to `true`.
|
|
859
|
+
* - Selecting a parent will auto-select all its filtered descendants.
|
|
860
|
+
* - Deselecting a parent will auto-deselect all its filtered descendants.
|
|
861
|
+
*
|
|
862
|
+
* When `rowSelectionPropagation.parents=true`
|
|
863
|
+
* - Selecting all descendants of a parent would auto-select it.
|
|
864
|
+
* - Deselecting a descendant of a selected parent would deselect the parent.
|
|
865
|
+
*
|
|
866
|
+
* Works with tree data and row grouping on the client-side only.
|
|
867
|
+
* @default { parents: false, descendants: false }
|
|
868
|
+
*/
|
|
869
|
+
rowSelectionPropagation: PropTypes.shape({
|
|
870
|
+
descendants: PropTypes.bool,
|
|
871
|
+
parents: PropTypes.bool
|
|
872
|
+
}),
|
|
847
873
|
/**
|
|
848
874
|
* Loading rows can be processed on the server or client-side.
|
|
849
875
|
* Set it to 'client' if you would like enable infnite loading.
|
|
@@ -928,5 +954,10 @@ DataGridProRaw.propTypes = {
|
|
|
928
954
|
get: PropTypes.func.isRequired,
|
|
929
955
|
set: PropTypes.func.isRequired
|
|
930
956
|
}),
|
|
931
|
-
unstable_onDataSourceError: PropTypes.func
|
|
957
|
+
unstable_onDataSourceError: PropTypes.func,
|
|
958
|
+
/**
|
|
959
|
+
* If `true`, the Data Grid will auto span the cells over the rows having the same value.
|
|
960
|
+
* @default false
|
|
961
|
+
*/
|
|
962
|
+
unstable_rowSpanning: PropTypes.bool
|
|
932
963
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useGridInitialization, useGridInitializeState, useGridClipboard, useGridColumnMenu, useGridColumns, columnsStateInitializer, useGridDensity, useGridCsvExport, useGridPrintExport, useGridFilter, filterStateInitializer, useGridFocus, useGridKeyboardNavigation, useGridPagination, paginationStateInitializer, useGridPreferencesPanel, useGridEditing, editingStateInitializer, useGridRows, useGridRowsPreProcessors, rowsStateInitializer, useGridRowsMeta, useGridParamsApi, useGridRowSelection, useGridSorting, sortingStateInitializer, useGridScroll, useGridEvents, dimensionsStateInitializer, useGridDimensions, useGridStatePersistence, useGridRowSelectionPreProcessors, useGridColumnSpanning, columnMenuStateInitializer, densityStateInitializer, focusStateInitializer, preferencePanelStateInitializer, rowsMetaStateInitializer, rowSelectionStateInitializer, useGridColumnGrouping, columnGroupsStateInitializer, headerFilteringStateInitializer, useGridHeaderFiltering, virtualizationStateInitializer, useGridVirtualization, useGridColumnResize, columnResizeStateInitializer } from '@mui/x-data-grid/internals';
|
|
1
|
+
import { useGridInitialization, useGridInitializeState, useGridClipboard, useGridColumnMenu, useGridColumns, columnsStateInitializer, useGridDensity, useGridCsvExport, useGridPrintExport, useGridFilter, filterStateInitializer, useGridFocus, useGridKeyboardNavigation, useGridPagination, paginationStateInitializer, useGridPreferencesPanel, useGridEditing, editingStateInitializer, useGridRows, useGridRowsPreProcessors, rowsStateInitializer, useGridRowsMeta, useGridParamsApi, useGridRowSelection, useGridSorting, sortingStateInitializer, useGridScroll, useGridEvents, dimensionsStateInitializer, useGridDimensions, useGridStatePersistence, useGridRowSelectionPreProcessors, useGridColumnSpanning, columnMenuStateInitializer, densityStateInitializer, focusStateInitializer, preferencePanelStateInitializer, rowsMetaStateInitializer, rowSelectionStateInitializer, useGridColumnGrouping, columnGroupsStateInitializer, headerFilteringStateInitializer, useGridHeaderFiltering, virtualizationStateInitializer, useGridVirtualization, useGridColumnResize, columnResizeStateInitializer, useGridRowSpanning, rowSpanningStateInitializer } from '@mui/x-data-grid/internals';
|
|
2
2
|
// Pro-only features
|
|
3
3
|
import { useGridInfiniteLoader } from "../hooks/features/infiniteLoader/useGridInfiniteLoader.js";
|
|
4
4
|
import { useGridColumnReorder, columnReorderStateInitializer } from "../hooks/features/columnReorder/useGridColumnReorder.js";
|
|
@@ -50,6 +50,7 @@ export const useDataGridProComponent = (inputApiRef, props) => {
|
|
|
50
50
|
useGridInitializeState(sortingStateInitializer, apiRef, props);
|
|
51
51
|
useGridInitializeState(preferencePanelStateInitializer, apiRef, props);
|
|
52
52
|
useGridInitializeState(filterStateInitializer, apiRef, props);
|
|
53
|
+
useGridInitializeState(rowSpanningStateInitializer, apiRef, props);
|
|
53
54
|
useGridInitializeState(densityStateInitializer, apiRef, props);
|
|
54
55
|
useGridInitializeState(columnReorderStateInitializer, apiRef, props);
|
|
55
56
|
useGridInitializeState(columnResizeStateInitializer, apiRef, props);
|
|
@@ -67,6 +68,7 @@ export const useDataGridProComponent = (inputApiRef, props) => {
|
|
|
67
68
|
useGridRowPinning(apiRef, props);
|
|
68
69
|
useGridColumns(apiRef, props);
|
|
69
70
|
useGridRows(apiRef, props);
|
|
71
|
+
useGridRowSpanning(apiRef, props);
|
|
70
72
|
useGridParamsApi(apiRef);
|
|
71
73
|
useGridDetailPanel(apiRef, props);
|
|
72
74
|
useGridColumnSpanning(apiRef);
|
|
@@ -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 { GRID_DEFAULT_LOCALE_TEXT, DATA_GRID_PROPS_DEFAULT_VALUES } from '@mui/x-data-grid';
|
|
5
|
-
import { computeSlots, useProps } from '@mui/x-data-grid/internals';
|
|
5
|
+
import { computeSlots, useProps, ROW_SELECTION_PROPAGATION_DEFAULT } from '@mui/x-data-grid/internals';
|
|
6
6
|
import { DATA_GRID_PRO_DEFAULT_SLOTS_COMPONENTS } from "../constants/dataGridProDefaultSlotsComponents.js";
|
|
7
7
|
const getDataGridProForcedProps = themedProps => _extends({
|
|
8
8
|
signature: 'DataGridPro'
|
|
@@ -25,6 +25,7 @@ export const DATA_GRID_PRO_PROPS_DEFAULT_VALUES = _extends({}, DATA_GRID_PROPS_D
|
|
|
25
25
|
getDetailPanelHeight: () => 500,
|
|
26
26
|
headerFilters: false,
|
|
27
27
|
keepColumnPositionIfDraggedOutside: false,
|
|
28
|
+
rowSelectionPropagation: ROW_SELECTION_PROPAGATION_DEFAULT,
|
|
28
29
|
rowReordering: false,
|
|
29
30
|
rowsLoadingMode: 'client',
|
|
30
31
|
scrollEndThreshold: 80,
|
|
@@ -6,7 +6,7 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import { unstable_useForkRef as useForkRef, unstable_composeClasses as composeClasses, unstable_capitalize as capitalize } from '@mui/utils';
|
|
8
8
|
import { fastMemo } from '@mui/x-internals/fastMemo';
|
|
9
|
-
import { gridVisibleColumnFieldsSelector, getDataGridUtilityClass, useGridSelector, gridFilterModelSelector, gridFilterableColumnLookupSelector } from '@mui/x-data-grid';
|
|
9
|
+
import { gridVisibleColumnFieldsSelector, getDataGridUtilityClass, useGridSelector, GridFilterInputValue, GridFilterInputDate, GridFilterInputBoolean, GridFilterInputSingleSelect, gridFilterModelSelector, gridFilterableColumnLookupSelector } from '@mui/x-data-grid';
|
|
10
10
|
import { useGridPrivateApiContext, gridHeaderFilteringEditFieldSelector, gridHeaderFilteringMenuSelector, isNavigationKey, shouldCellShowLeftBorder, shouldCellShowRightBorder } from '@mui/x-data-grid/internals';
|
|
11
11
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
12
12
|
import { GridHeaderFilterMenuContainer } from "./GridHeaderFilterMenuContainer.js";
|
|
@@ -30,6 +30,16 @@ const dateSx = {
|
|
|
30
30
|
color: 'transparent'
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
|
+
const defaultInputComponents = {
|
|
34
|
+
string: GridFilterInputValue,
|
|
35
|
+
number: GridFilterInputValue,
|
|
36
|
+
date: GridFilterInputDate,
|
|
37
|
+
dateTime: GridFilterInputDate,
|
|
38
|
+
boolean: GridFilterInputBoolean,
|
|
39
|
+
singleSelect: GridFilterInputSingleSelect,
|
|
40
|
+
actions: null,
|
|
41
|
+
custom: null
|
|
42
|
+
};
|
|
33
43
|
const GridHeaderFilterCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
34
44
|
const {
|
|
35
45
|
colIndex,
|
|
@@ -78,7 +88,7 @@ const GridHeaderFilterCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
78
88
|
return filterModelItem ? !filterableColumnsLookup[filterModelItem.field] : false;
|
|
79
89
|
}, [colDef.field, filterModel, filterableColumnsLookup]);
|
|
80
90
|
const currentOperator = React.useMemo(() => filterOperators.find(operator => operator.value === item.operator) ?? filterOperators[0], [item.operator, filterOperators]);
|
|
81
|
-
const InputComponent = colDef.filterable || isFilterReadOnly ? currentOperator.InputComponent : null;
|
|
91
|
+
const InputComponent = colDef.filterable || isFilterReadOnly ? currentOperator.InputComponent ?? defaultInputComponents[colDef.type] : null;
|
|
82
92
|
const applyFilterChanges = React.useCallback(updatedItem => {
|
|
83
93
|
if (item.value && !updatedItem.value) {
|
|
84
94
|
apiRef.current.deleteFilterItem(updatedItem);
|
|
@@ -124,16 +124,13 @@ export const useGridColumnHeaders = props => {
|
|
|
124
124
|
children: [leftRenderContext && getColumnFilters({
|
|
125
125
|
position: GridPinnedColumnPosition.LEFT,
|
|
126
126
|
renderContext: leftRenderContext,
|
|
127
|
-
minFirstColumn: leftRenderContext.firstColumnIndex,
|
|
128
127
|
maxLastColumn: leftRenderContext.lastColumnIndex
|
|
129
128
|
}), getColumnFilters({
|
|
130
129
|
renderContext,
|
|
131
|
-
minFirstColumn: pinnedColumns.left.length,
|
|
132
130
|
maxLastColumn: visibleColumns.length - pinnedColumns.right.length
|
|
133
131
|
}), rightRenderContext && getColumnFilters({
|
|
134
132
|
position: GridPinnedColumnPosition.RIGHT,
|
|
135
133
|
renderContext: rightRenderContext,
|
|
136
|
-
minFirstColumn: rightRenderContext.firstColumnIndex,
|
|
137
134
|
maxLastColumn: rightRenderContext.lastColumnIndex
|
|
138
135
|
})]
|
|
139
136
|
});
|
|
@@ -206,6 +206,11 @@ export const useGridColumnReorder = (apiRef, props) => {
|
|
|
206
206
|
// For more information check here https://github.com/mui/mui-x/issues/2680.
|
|
207
207
|
event.stopPropagation();
|
|
208
208
|
clearTimeout(removeDnDStylesTimeout.current);
|
|
209
|
+
|
|
210
|
+
// For more information check here https://github.com/mui/mui-x/issues/14678
|
|
211
|
+
if (dragColNode.current.classList.contains(classes.columnHeaderDragging)) {
|
|
212
|
+
dragColNode.current.classList.remove(classes.columnHeaderDragging);
|
|
213
|
+
}
|
|
209
214
|
dragColNode.current = null;
|
|
210
215
|
|
|
211
216
|
// Check if the column was dropped outside the grid.
|
|
@@ -228,7 +233,7 @@ export const useGridColumnReorder = (apiRef, props) => {
|
|
|
228
233
|
})
|
|
229
234
|
}));
|
|
230
235
|
apiRef.current.forceUpdate();
|
|
231
|
-
}, [props.disableColumnReorder, props.keepColumnPositionIfDraggedOutside, logger,
|
|
236
|
+
}, [apiRef, props.disableColumnReorder, props.keepColumnPositionIfDraggedOutside, logger, classes.columnHeaderDragging]);
|
|
232
237
|
useGridApiEventHandler(apiRef, 'columnHeaderDragStart', handleDragStart);
|
|
233
238
|
useGridApiEventHandler(apiRef, 'columnHeaderDragEnter', handleDragEnter);
|
|
234
239
|
useGridApiEventHandler(apiRef, 'columnHeaderDragOver', handleDragOver);
|
|
@@ -128,9 +128,9 @@ export const useGridDataSource = (apiRef, props) => {
|
|
|
128
128
|
apiRef.current.updateServerRows(getRowsResponse.rows, rowNode.path);
|
|
129
129
|
apiRef.current.setRowChildrenExpansion(id, true);
|
|
130
130
|
} catch (error) {
|
|
131
|
-
const
|
|
132
|
-
apiRef.current.unstable_dataSource.setChildrenFetchError(id,
|
|
133
|
-
onError?.(
|
|
131
|
+
const childrenFetchError = error;
|
|
132
|
+
apiRef.current.unstable_dataSource.setChildrenFetchError(id, childrenFetchError);
|
|
133
|
+
onError?.(childrenFetchError, fetchParams);
|
|
134
134
|
} finally {
|
|
135
135
|
apiRef.current.unstable_dataSource.setChildrenLoading(id, false);
|
|
136
136
|
nestedDataManager.setRequestSettled(id);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useGridSelector, useGridApiOptionHandler, gridVisibleColumnDefinitionsSelector, useGridApiMethod, gridDimensionsSelector } from '@mui/x-data-grid';
|
|
3
|
-
import { useGridVisibleRows } from '@mui/x-data-grid/internals';
|
|
3
|
+
import { useGridVisibleRows, useTimeout } from '@mui/x-data-grid/internals';
|
|
4
4
|
import useEventCallback from '@mui/utils/useEventCallback';
|
|
5
5
|
import { styled } from '@mui/system';
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -20,6 +20,7 @@ export const useGridInfiniteLoader = (apiRef, props) => {
|
|
|
20
20
|
const visibleColumns = useGridSelector(apiRef, gridVisibleColumnDefinitionsSelector);
|
|
21
21
|
const currentPage = useGridVisibleRows(apiRef, props);
|
|
22
22
|
const observer = React.useRef();
|
|
23
|
+
const updateTargetTimeout = useTimeout();
|
|
23
24
|
const triggerElement = React.useRef(null);
|
|
24
25
|
const isEnabled = props.rowsLoadingMode === 'client' && !!props.onRowsScrollEnd;
|
|
25
26
|
const handleLoadMoreRows = useEventCallback(([entry]) => {
|
|
@@ -58,11 +59,7 @@ export const useGridInfiniteLoader = (apiRef, props) => {
|
|
|
58
59
|
observer.current.observe(triggerElement.current);
|
|
59
60
|
}
|
|
60
61
|
}, [virtualScroller, handleLoadMoreRows, isEnabled, marginBottom]);
|
|
61
|
-
const
|
|
62
|
-
// Prevent the infite loading working in combination with lazy loading
|
|
63
|
-
if (!isEnabled) {
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
62
|
+
const updateTarget = node => {
|
|
66
63
|
if (triggerElement.current !== node) {
|
|
67
64
|
observer.current?.disconnect();
|
|
68
65
|
triggerElement.current = node;
|
|
@@ -70,7 +67,23 @@ export const useGridInfiniteLoader = (apiRef, props) => {
|
|
|
70
67
|
observer.current?.observe(triggerElement.current);
|
|
71
68
|
}
|
|
72
69
|
}
|
|
73
|
-
}
|
|
70
|
+
};
|
|
71
|
+
const triggerRef = React.useCallback(node => {
|
|
72
|
+
// Prevent the infite loading working in combination with lazy loading
|
|
73
|
+
if (!isEnabled) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// If the user scrolls through the grid too fast it might happen that the observer is connected to the trigger element
|
|
78
|
+
// that will be intersecting the root inside the same render cycle (but not intersecting at the time of the connection).
|
|
79
|
+
// This will cause the observer to not call the callback with `isIntersecting` set to `true`.
|
|
80
|
+
// https://www.w3.org/TR/intersection-observer/#event-loop
|
|
81
|
+
// Delaying the connection to the next cycle helps since the observer will always call the callback the first time it is connected.
|
|
82
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/observe
|
|
83
|
+
// Related to
|
|
84
|
+
// https://github.com/mui/mui-x/issues/14116
|
|
85
|
+
updateTargetTimeout.start(0, () => updateTarget(node));
|
|
86
|
+
}, [isEnabled, updateTargetTimeout]);
|
|
74
87
|
const getInfiniteLoadingTriggerElement = React.useCallback(({
|
|
75
88
|
lastRowId
|
|
76
89
|
}) => {
|
package/esm/utils/releaseInfo.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "
|
|
3
|
+
const releaseInfo = "MTcyNzk4OTIwMDAwMA==";
|
|
4
4
|
if (process.env.NODE_ENV !== 'production') {
|
|
5
5
|
// A simple hack to set the value in the test environment (has no build step).
|
|
6
6
|
// eslint-disable-next-line no-useless-concat
|
|
@@ -132,16 +132,13 @@ const useGridColumnHeaders = props => {
|
|
|
132
132
|
children: [leftRenderContext && getColumnFilters({
|
|
133
133
|
position: _xDataGrid.GridPinnedColumnPosition.LEFT,
|
|
134
134
|
renderContext: leftRenderContext,
|
|
135
|
-
minFirstColumn: leftRenderContext.firstColumnIndex,
|
|
136
135
|
maxLastColumn: leftRenderContext.lastColumnIndex
|
|
137
136
|
}), getColumnFilters({
|
|
138
137
|
renderContext,
|
|
139
|
-
minFirstColumn: pinnedColumns.left.length,
|
|
140
138
|
maxLastColumn: visibleColumns.length - pinnedColumns.right.length
|
|
141
139
|
}), rightRenderContext && getColumnFilters({
|
|
142
140
|
position: _xDataGrid.GridPinnedColumnPosition.RIGHT,
|
|
143
141
|
renderContext: rightRenderContext,
|
|
144
|
-
minFirstColumn: rightRenderContext.firstColumnIndex,
|
|
145
142
|
maxLastColumn: rightRenderContext.lastColumnIndex
|
|
146
143
|
})]
|
|
147
144
|
});
|
|
@@ -215,6 +215,11 @@ const useGridColumnReorder = (apiRef, props) => {
|
|
|
215
215
|
// For more information check here https://github.com/mui/mui-x/issues/2680.
|
|
216
216
|
event.stopPropagation();
|
|
217
217
|
clearTimeout(removeDnDStylesTimeout.current);
|
|
218
|
+
|
|
219
|
+
// For more information check here https://github.com/mui/mui-x/issues/14678
|
|
220
|
+
if (dragColNode.current.classList.contains(classes.columnHeaderDragging)) {
|
|
221
|
+
dragColNode.current.classList.remove(classes.columnHeaderDragging);
|
|
222
|
+
}
|
|
218
223
|
dragColNode.current = null;
|
|
219
224
|
|
|
220
225
|
// Check if the column was dropped outside the grid.
|
|
@@ -237,7 +242,7 @@ const useGridColumnReorder = (apiRef, props) => {
|
|
|
237
242
|
})
|
|
238
243
|
}));
|
|
239
244
|
apiRef.current.forceUpdate();
|
|
240
|
-
}, [props.disableColumnReorder, props.keepColumnPositionIfDraggedOutside, logger,
|
|
245
|
+
}, [apiRef, props.disableColumnReorder, props.keepColumnPositionIfDraggedOutside, logger, classes.columnHeaderDragging]);
|
|
241
246
|
(0, _xDataGrid.useGridApiEventHandler)(apiRef, 'columnHeaderDragStart', handleDragStart);
|
|
242
247
|
(0, _xDataGrid.useGridApiEventHandler)(apiRef, 'columnHeaderDragEnter', handleDragEnter);
|
|
243
248
|
(0, _xDataGrid.useGridApiEventHandler)(apiRef, 'columnHeaderDragOver', handleDragOver);
|
|
@@ -137,9 +137,9 @@ const useGridDataSource = (apiRef, props) => {
|
|
|
137
137
|
apiRef.current.updateServerRows(getRowsResponse.rows, rowNode.path);
|
|
138
138
|
apiRef.current.setRowChildrenExpansion(id, true);
|
|
139
139
|
} catch (error) {
|
|
140
|
-
const
|
|
141
|
-
apiRef.current.unstable_dataSource.setChildrenFetchError(id,
|
|
142
|
-
onError?.(
|
|
140
|
+
const childrenFetchError = error;
|
|
141
|
+
apiRef.current.unstable_dataSource.setChildrenFetchError(id, childrenFetchError);
|
|
142
|
+
onError?.(childrenFetchError, fetchParams);
|
|
143
143
|
} finally {
|
|
144
144
|
apiRef.current.unstable_dataSource.setChildrenLoading(id, false);
|
|
145
145
|
nestedDataManager.setRequestSettled(id);
|
|
@@ -28,6 +28,7 @@ const useGridInfiniteLoader = (apiRef, props) => {
|
|
|
28
28
|
const visibleColumns = (0, _xDataGrid.useGridSelector)(apiRef, _xDataGrid.gridVisibleColumnDefinitionsSelector);
|
|
29
29
|
const currentPage = (0, _internals.useGridVisibleRows)(apiRef, props);
|
|
30
30
|
const observer = React.useRef();
|
|
31
|
+
const updateTargetTimeout = (0, _internals.useTimeout)();
|
|
31
32
|
const triggerElement = React.useRef(null);
|
|
32
33
|
const isEnabled = props.rowsLoadingMode === 'client' && !!props.onRowsScrollEnd;
|
|
33
34
|
const handleLoadMoreRows = (0, _useEventCallback.default)(([entry]) => {
|
|
@@ -66,11 +67,7 @@ const useGridInfiniteLoader = (apiRef, props) => {
|
|
|
66
67
|
observer.current.observe(triggerElement.current);
|
|
67
68
|
}
|
|
68
69
|
}, [virtualScroller, handleLoadMoreRows, isEnabled, marginBottom]);
|
|
69
|
-
const
|
|
70
|
-
// Prevent the infite loading working in combination with lazy loading
|
|
71
|
-
if (!isEnabled) {
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
70
|
+
const updateTarget = node => {
|
|
74
71
|
if (triggerElement.current !== node) {
|
|
75
72
|
observer.current?.disconnect();
|
|
76
73
|
triggerElement.current = node;
|
|
@@ -78,7 +75,23 @@ const useGridInfiniteLoader = (apiRef, props) => {
|
|
|
78
75
|
observer.current?.observe(triggerElement.current);
|
|
79
76
|
}
|
|
80
77
|
}
|
|
81
|
-
}
|
|
78
|
+
};
|
|
79
|
+
const triggerRef = React.useCallback(node => {
|
|
80
|
+
// Prevent the infite loading working in combination with lazy loading
|
|
81
|
+
if (!isEnabled) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// If the user scrolls through the grid too fast it might happen that the observer is connected to the trigger element
|
|
86
|
+
// that will be intersecting the root inside the same render cycle (but not intersecting at the time of the connection).
|
|
87
|
+
// This will cause the observer to not call the callback with `isIntersecting` set to `true`.
|
|
88
|
+
// https://www.w3.org/TR/intersection-observer/#event-loop
|
|
89
|
+
// Delaying the connection to the next cycle helps since the observer will always call the callback the first time it is connected.
|
|
90
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/observe
|
|
91
|
+
// Related to
|
|
92
|
+
// https://github.com/mui/mui-x/issues/14116
|
|
93
|
+
updateTargetTimeout.start(0, () => updateTarget(node));
|
|
94
|
+
}, [isEnabled, updateTargetTimeout]);
|
|
82
95
|
const getInfiniteLoadingTriggerElement = React.useCallback(({
|
|
83
96
|
lastRowId
|
|
84
97
|
}) => {
|
package/index.js
CHANGED
package/material/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare const materialSlots: {
|
|
2
|
-
columnMenuPinLeftIcon:
|
|
3
|
-
columnMenuPinRightIcon:
|
|
2
|
+
columnMenuPinLeftIcon: React.JSXElementConstructor<any>;
|
|
3
|
+
columnMenuPinRightIcon: React.JSXElementConstructor<any>;
|
|
4
4
|
};
|
|
5
5
|
export default materialSlots;
|
|
@@ -76,6 +76,11 @@ DataGridProRaw.propTypes = {
|
|
|
76
76
|
/**
|
|
77
77
|
* If `true`, the Data Grid height is dynamic and follows the number of rows in the Data Grid.
|
|
78
78
|
* @default false
|
|
79
|
+
* @deprecated Use flex parent container instead: https://mui.com/x/react-data-grid/layout/#flex-parent-container
|
|
80
|
+
* @example
|
|
81
|
+
* <div style={{ display: 'flex', flexDirection: 'column' }}>
|
|
82
|
+
* <DataGrid />
|
|
83
|
+
* </div>
|
|
79
84
|
*/
|
|
80
85
|
autoHeight: PropTypes.bool,
|
|
81
86
|
/**
|
|
@@ -127,6 +132,11 @@ DataGridProRaw.propTypes = {
|
|
|
127
132
|
* @default 150
|
|
128
133
|
*/
|
|
129
134
|
columnBufferPx: PropTypes.number,
|
|
135
|
+
/**
|
|
136
|
+
* Sets the height in pixels of the column group headers in the Data Grid.
|
|
137
|
+
* Inherits the `columnHeaderHeight` value if not set.
|
|
138
|
+
*/
|
|
139
|
+
columnGroupHeaderHeight: PropTypes.number,
|
|
130
140
|
columnGroupingModel: PropTypes.arrayOf(PropTypes.object),
|
|
131
141
|
/**
|
|
132
142
|
* Sets the height in pixel of the column headers in the Data Grid.
|
|
@@ -359,7 +369,7 @@ DataGridProRaw.propTypes = {
|
|
|
359
369
|
*/
|
|
360
370
|
headerFilterHeight: PropTypes.number,
|
|
361
371
|
/**
|
|
362
|
-
* If `true`,
|
|
372
|
+
* If `true`, the header filters feature is enabled.
|
|
363
373
|
* @default false
|
|
364
374
|
*/
|
|
365
375
|
headerFilters: PropTypes.bool,
|
|
@@ -844,6 +854,22 @@ DataGridProRaw.propTypes = {
|
|
|
844
854
|
* Sets the row selection model of the Data Grid.
|
|
845
855
|
*/
|
|
846
856
|
rowSelectionModel: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired), PropTypes.number, PropTypes.string]),
|
|
857
|
+
/**
|
|
858
|
+
* When `rowSelectionPropagation.descendants` is set to `true`.
|
|
859
|
+
* - Selecting a parent will auto-select all its filtered descendants.
|
|
860
|
+
* - Deselecting a parent will auto-deselect all its filtered descendants.
|
|
861
|
+
*
|
|
862
|
+
* When `rowSelectionPropagation.parents=true`
|
|
863
|
+
* - Selecting all descendants of a parent would auto-select it.
|
|
864
|
+
* - Deselecting a descendant of a selected parent would deselect the parent.
|
|
865
|
+
*
|
|
866
|
+
* Works with tree data and row grouping on the client-side only.
|
|
867
|
+
* @default { parents: false, descendants: false }
|
|
868
|
+
*/
|
|
869
|
+
rowSelectionPropagation: PropTypes.shape({
|
|
870
|
+
descendants: PropTypes.bool,
|
|
871
|
+
parents: PropTypes.bool
|
|
872
|
+
}),
|
|
847
873
|
/**
|
|
848
874
|
* Loading rows can be processed on the server or client-side.
|
|
849
875
|
* Set it to 'client' if you would like enable infnite loading.
|
|
@@ -928,5 +954,10 @@ DataGridProRaw.propTypes = {
|
|
|
928
954
|
get: PropTypes.func.isRequired,
|
|
929
955
|
set: PropTypes.func.isRequired
|
|
930
956
|
}),
|
|
931
|
-
unstable_onDataSourceError: PropTypes.func
|
|
957
|
+
unstable_onDataSourceError: PropTypes.func,
|
|
958
|
+
/**
|
|
959
|
+
* If `true`, the Data Grid will auto span the cells over the rows having the same value.
|
|
960
|
+
* @default false
|
|
961
|
+
*/
|
|
962
|
+
unstable_rowSpanning: PropTypes.bool
|
|
932
963
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useGridInitialization, useGridInitializeState, useGridClipboard, useGridColumnMenu, useGridColumns, columnsStateInitializer, useGridDensity, useGridCsvExport, useGridPrintExport, useGridFilter, filterStateInitializer, useGridFocus, useGridKeyboardNavigation, useGridPagination, paginationStateInitializer, useGridPreferencesPanel, useGridEditing, editingStateInitializer, useGridRows, useGridRowsPreProcessors, rowsStateInitializer, useGridRowsMeta, useGridParamsApi, useGridRowSelection, useGridSorting, sortingStateInitializer, useGridScroll, useGridEvents, dimensionsStateInitializer, useGridDimensions, useGridStatePersistence, useGridRowSelectionPreProcessors, useGridColumnSpanning, columnMenuStateInitializer, densityStateInitializer, focusStateInitializer, preferencePanelStateInitializer, rowsMetaStateInitializer, rowSelectionStateInitializer, useGridColumnGrouping, columnGroupsStateInitializer, headerFilteringStateInitializer, useGridHeaderFiltering, virtualizationStateInitializer, useGridVirtualization, useGridColumnResize, columnResizeStateInitializer } from '@mui/x-data-grid/internals';
|
|
1
|
+
import { useGridInitialization, useGridInitializeState, useGridClipboard, useGridColumnMenu, useGridColumns, columnsStateInitializer, useGridDensity, useGridCsvExport, useGridPrintExport, useGridFilter, filterStateInitializer, useGridFocus, useGridKeyboardNavigation, useGridPagination, paginationStateInitializer, useGridPreferencesPanel, useGridEditing, editingStateInitializer, useGridRows, useGridRowsPreProcessors, rowsStateInitializer, useGridRowsMeta, useGridParamsApi, useGridRowSelection, useGridSorting, sortingStateInitializer, useGridScroll, useGridEvents, dimensionsStateInitializer, useGridDimensions, useGridStatePersistence, useGridRowSelectionPreProcessors, useGridColumnSpanning, columnMenuStateInitializer, densityStateInitializer, focusStateInitializer, preferencePanelStateInitializer, rowsMetaStateInitializer, rowSelectionStateInitializer, useGridColumnGrouping, columnGroupsStateInitializer, headerFilteringStateInitializer, useGridHeaderFiltering, virtualizationStateInitializer, useGridVirtualization, useGridColumnResize, columnResizeStateInitializer, useGridRowSpanning, rowSpanningStateInitializer } from '@mui/x-data-grid/internals';
|
|
2
2
|
// Pro-only features
|
|
3
3
|
import { useGridInfiniteLoader } from "../hooks/features/infiniteLoader/useGridInfiniteLoader.js";
|
|
4
4
|
import { useGridColumnReorder, columnReorderStateInitializer } from "../hooks/features/columnReorder/useGridColumnReorder.js";
|
|
@@ -50,6 +50,7 @@ export const useDataGridProComponent = (inputApiRef, props) => {
|
|
|
50
50
|
useGridInitializeState(sortingStateInitializer, apiRef, props);
|
|
51
51
|
useGridInitializeState(preferencePanelStateInitializer, apiRef, props);
|
|
52
52
|
useGridInitializeState(filterStateInitializer, apiRef, props);
|
|
53
|
+
useGridInitializeState(rowSpanningStateInitializer, apiRef, props);
|
|
53
54
|
useGridInitializeState(densityStateInitializer, apiRef, props);
|
|
54
55
|
useGridInitializeState(columnReorderStateInitializer, apiRef, props);
|
|
55
56
|
useGridInitializeState(columnResizeStateInitializer, apiRef, props);
|
|
@@ -67,6 +68,7 @@ export const useDataGridProComponent = (inputApiRef, props) => {
|
|
|
67
68
|
useGridRowPinning(apiRef, props);
|
|
68
69
|
useGridColumns(apiRef, props);
|
|
69
70
|
useGridRows(apiRef, props);
|
|
71
|
+
useGridRowSpanning(apiRef, props);
|
|
70
72
|
useGridParamsApi(apiRef);
|
|
71
73
|
useGridDetailPanel(apiRef, props);
|
|
72
74
|
useGridColumnSpanning(apiRef);
|
|
@@ -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 { GRID_DEFAULT_LOCALE_TEXT, DATA_GRID_PROPS_DEFAULT_VALUES } from '@mui/x-data-grid';
|
|
5
|
-
import { computeSlots, useProps } from '@mui/x-data-grid/internals';
|
|
5
|
+
import { computeSlots, useProps, ROW_SELECTION_PROPAGATION_DEFAULT } from '@mui/x-data-grid/internals';
|
|
6
6
|
import { DATA_GRID_PRO_DEFAULT_SLOTS_COMPONENTS } from "../constants/dataGridProDefaultSlotsComponents.js";
|
|
7
7
|
const getDataGridProForcedProps = themedProps => _extends({
|
|
8
8
|
signature: 'DataGridPro'
|
|
@@ -25,6 +25,7 @@ export const DATA_GRID_PRO_PROPS_DEFAULT_VALUES = _extends({}, DATA_GRID_PROPS_D
|
|
|
25
25
|
getDetailPanelHeight: () => 500,
|
|
26
26
|
headerFilters: false,
|
|
27
27
|
keepColumnPositionIfDraggedOutside: false,
|
|
28
|
+
rowSelectionPropagation: ROW_SELECTION_PROPAGATION_DEFAULT,
|
|
28
29
|
rowReordering: false,
|
|
29
30
|
rowsLoadingMode: 'client',
|
|
30
31
|
scrollEndThreshold: 80,
|
|
@@ -6,7 +6,7 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import { unstable_useForkRef as useForkRef, unstable_composeClasses as composeClasses, unstable_capitalize as capitalize } from '@mui/utils';
|
|
8
8
|
import { fastMemo } from '@mui/x-internals/fastMemo';
|
|
9
|
-
import { gridVisibleColumnFieldsSelector, getDataGridUtilityClass, useGridSelector, gridFilterModelSelector, gridFilterableColumnLookupSelector } from '@mui/x-data-grid';
|
|
9
|
+
import { gridVisibleColumnFieldsSelector, getDataGridUtilityClass, useGridSelector, GridFilterInputValue, GridFilterInputDate, GridFilterInputBoolean, GridFilterInputSingleSelect, gridFilterModelSelector, gridFilterableColumnLookupSelector } from '@mui/x-data-grid';
|
|
10
10
|
import { useGridPrivateApiContext, gridHeaderFilteringEditFieldSelector, gridHeaderFilteringMenuSelector, isNavigationKey, shouldCellShowLeftBorder, shouldCellShowRightBorder } from '@mui/x-data-grid/internals';
|
|
11
11
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
12
12
|
import { GridHeaderFilterMenuContainer } from "./GridHeaderFilterMenuContainer.js";
|
|
@@ -30,6 +30,16 @@ const dateSx = {
|
|
|
30
30
|
color: 'transparent'
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
|
+
const defaultInputComponents = {
|
|
34
|
+
string: GridFilterInputValue,
|
|
35
|
+
number: GridFilterInputValue,
|
|
36
|
+
date: GridFilterInputDate,
|
|
37
|
+
dateTime: GridFilterInputDate,
|
|
38
|
+
boolean: GridFilterInputBoolean,
|
|
39
|
+
singleSelect: GridFilterInputSingleSelect,
|
|
40
|
+
actions: null,
|
|
41
|
+
custom: null
|
|
42
|
+
};
|
|
33
43
|
const GridHeaderFilterCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
34
44
|
const {
|
|
35
45
|
colIndex,
|
|
@@ -78,7 +88,7 @@ const GridHeaderFilterCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
78
88
|
return filterModelItem ? !filterableColumnsLookup[filterModelItem.field] : false;
|
|
79
89
|
}, [colDef.field, filterModel, filterableColumnsLookup]);
|
|
80
90
|
const currentOperator = React.useMemo(() => filterOperators.find(operator => operator.value === item.operator) ?? filterOperators[0], [item.operator, filterOperators]);
|
|
81
|
-
const InputComponent = colDef.filterable || isFilterReadOnly ? currentOperator.InputComponent : null;
|
|
91
|
+
const InputComponent = colDef.filterable || isFilterReadOnly ? currentOperator.InputComponent ?? defaultInputComponents[colDef.type] : null;
|
|
82
92
|
const applyFilterChanges = React.useCallback(updatedItem => {
|
|
83
93
|
if (item.value && !updatedItem.value) {
|
|
84
94
|
apiRef.current.deleteFilterItem(updatedItem);
|
|
@@ -124,16 +124,13 @@ export const useGridColumnHeaders = props => {
|
|
|
124
124
|
children: [leftRenderContext && getColumnFilters({
|
|
125
125
|
position: GridPinnedColumnPosition.LEFT,
|
|
126
126
|
renderContext: leftRenderContext,
|
|
127
|
-
minFirstColumn: leftRenderContext.firstColumnIndex,
|
|
128
127
|
maxLastColumn: leftRenderContext.lastColumnIndex
|
|
129
128
|
}), getColumnFilters({
|
|
130
129
|
renderContext,
|
|
131
|
-
minFirstColumn: pinnedColumns.left.length,
|
|
132
130
|
maxLastColumn: visibleColumns.length - pinnedColumns.right.length
|
|
133
131
|
}), rightRenderContext && getColumnFilters({
|
|
134
132
|
position: GridPinnedColumnPosition.RIGHT,
|
|
135
133
|
renderContext: rightRenderContext,
|
|
136
|
-
minFirstColumn: rightRenderContext.firstColumnIndex,
|
|
137
134
|
maxLastColumn: rightRenderContext.lastColumnIndex
|
|
138
135
|
})]
|
|
139
136
|
});
|
|
@@ -206,6 +206,11 @@ export const useGridColumnReorder = (apiRef, props) => {
|
|
|
206
206
|
// For more information check here https://github.com/mui/mui-x/issues/2680.
|
|
207
207
|
event.stopPropagation();
|
|
208
208
|
clearTimeout(removeDnDStylesTimeout.current);
|
|
209
|
+
|
|
210
|
+
// For more information check here https://github.com/mui/mui-x/issues/14678
|
|
211
|
+
if (dragColNode.current.classList.contains(classes.columnHeaderDragging)) {
|
|
212
|
+
dragColNode.current.classList.remove(classes.columnHeaderDragging);
|
|
213
|
+
}
|
|
209
214
|
dragColNode.current = null;
|
|
210
215
|
|
|
211
216
|
// Check if the column was dropped outside the grid.
|
|
@@ -228,7 +233,7 @@ export const useGridColumnReorder = (apiRef, props) => {
|
|
|
228
233
|
})
|
|
229
234
|
}));
|
|
230
235
|
apiRef.current.forceUpdate();
|
|
231
|
-
}, [props.disableColumnReorder, props.keepColumnPositionIfDraggedOutside, logger,
|
|
236
|
+
}, [apiRef, props.disableColumnReorder, props.keepColumnPositionIfDraggedOutside, logger, classes.columnHeaderDragging]);
|
|
232
237
|
useGridApiEventHandler(apiRef, 'columnHeaderDragStart', handleDragStart);
|
|
233
238
|
useGridApiEventHandler(apiRef, 'columnHeaderDragEnter', handleDragEnter);
|
|
234
239
|
useGridApiEventHandler(apiRef, 'columnHeaderDragOver', handleDragOver);
|
|
@@ -128,9 +128,9 @@ export const useGridDataSource = (apiRef, props) => {
|
|
|
128
128
|
apiRef.current.updateServerRows(getRowsResponse.rows, rowNode.path);
|
|
129
129
|
apiRef.current.setRowChildrenExpansion(id, true);
|
|
130
130
|
} catch (error) {
|
|
131
|
-
const
|
|
132
|
-
apiRef.current.unstable_dataSource.setChildrenFetchError(id,
|
|
133
|
-
onError?.(
|
|
131
|
+
const childrenFetchError = error;
|
|
132
|
+
apiRef.current.unstable_dataSource.setChildrenFetchError(id, childrenFetchError);
|
|
133
|
+
onError?.(childrenFetchError, fetchParams);
|
|
134
134
|
} finally {
|
|
135
135
|
apiRef.current.unstable_dataSource.setChildrenLoading(id, false);
|
|
136
136
|
nestedDataManager.setRequestSettled(id);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useGridSelector, useGridApiOptionHandler, gridVisibleColumnDefinitionsSelector, useGridApiMethod, gridDimensionsSelector } from '@mui/x-data-grid';
|
|
3
|
-
import { useGridVisibleRows } from '@mui/x-data-grid/internals';
|
|
3
|
+
import { useGridVisibleRows, useTimeout } from '@mui/x-data-grid/internals';
|
|
4
4
|
import useEventCallback from '@mui/utils/useEventCallback';
|
|
5
5
|
import { styled } from '@mui/system';
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -20,6 +20,7 @@ export const useGridInfiniteLoader = (apiRef, props) => {
|
|
|
20
20
|
const visibleColumns = useGridSelector(apiRef, gridVisibleColumnDefinitionsSelector);
|
|
21
21
|
const currentPage = useGridVisibleRows(apiRef, props);
|
|
22
22
|
const observer = React.useRef();
|
|
23
|
+
const updateTargetTimeout = useTimeout();
|
|
23
24
|
const triggerElement = React.useRef(null);
|
|
24
25
|
const isEnabled = props.rowsLoadingMode === 'client' && !!props.onRowsScrollEnd;
|
|
25
26
|
const handleLoadMoreRows = useEventCallback(([entry]) => {
|
|
@@ -58,11 +59,7 @@ export const useGridInfiniteLoader = (apiRef, props) => {
|
|
|
58
59
|
observer.current.observe(triggerElement.current);
|
|
59
60
|
}
|
|
60
61
|
}, [virtualScroller, handleLoadMoreRows, isEnabled, marginBottom]);
|
|
61
|
-
const
|
|
62
|
-
// Prevent the infite loading working in combination with lazy loading
|
|
63
|
-
if (!isEnabled) {
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
62
|
+
const updateTarget = node => {
|
|
66
63
|
if (triggerElement.current !== node) {
|
|
67
64
|
observer.current?.disconnect();
|
|
68
65
|
triggerElement.current = node;
|
|
@@ -70,7 +67,23 @@ export const useGridInfiniteLoader = (apiRef, props) => {
|
|
|
70
67
|
observer.current?.observe(triggerElement.current);
|
|
71
68
|
}
|
|
72
69
|
}
|
|
73
|
-
}
|
|
70
|
+
};
|
|
71
|
+
const triggerRef = React.useCallback(node => {
|
|
72
|
+
// Prevent the infite loading working in combination with lazy loading
|
|
73
|
+
if (!isEnabled) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// If the user scrolls through the grid too fast it might happen that the observer is connected to the trigger element
|
|
78
|
+
// that will be intersecting the root inside the same render cycle (but not intersecting at the time of the connection).
|
|
79
|
+
// This will cause the observer to not call the callback with `isIntersecting` set to `true`.
|
|
80
|
+
// https://www.w3.org/TR/intersection-observer/#event-loop
|
|
81
|
+
// Delaying the connection to the next cycle helps since the observer will always call the callback the first time it is connected.
|
|
82
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/observe
|
|
83
|
+
// Related to
|
|
84
|
+
// https://github.com/mui/mui-x/issues/14116
|
|
85
|
+
updateTargetTimeout.start(0, () => updateTarget(node));
|
|
86
|
+
}, [isEnabled, updateTargetTimeout]);
|
|
74
87
|
const getInfiniteLoadingTriggerElement = React.useCallback(({
|
|
75
88
|
lastRowId
|
|
76
89
|
}) => {
|
package/modern/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "
|
|
3
|
+
const releaseInfo = "MTcyNzk4OTIwMDAwMA==";
|
|
4
4
|
if (process.env.NODE_ENV !== 'production') {
|
|
5
5
|
// A simple hack to set the value in the test environment (has no build step).
|
|
6
6
|
// eslint-disable-next-line no-useless-concat
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-data-grid-pro",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.19.0",
|
|
4
4
|
"description": "The Pro plan edition of the Data Grid components (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
],
|
|
30
30
|
"repository": {
|
|
31
31
|
"type": "git",
|
|
32
|
-
"url": "https://github.com/mui/mui-x.git",
|
|
32
|
+
"url": "git+https://github.com/mui/mui-x.git",
|
|
33
33
|
"directory": "packages/x-data-grid-pro"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
"clsx": "^2.1.1",
|
|
40
40
|
"prop-types": "^15.8.1",
|
|
41
41
|
"reselect": "^5.1.1",
|
|
42
|
-
"@mui/x-data-grid": "7.
|
|
43
|
-
"@mui/x-
|
|
44
|
-
"@mui/x-
|
|
42
|
+
"@mui/x-data-grid": "7.19.0",
|
|
43
|
+
"@mui/x-internals": "7.18.0",
|
|
44
|
+
"@mui/x-license": "7.18.0"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"@emotion/react": "^11.9.0",
|
package/utils/releaseInfo.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.getReleaseInfo = void 0;
|
|
7
7
|
var _utils = require("@mui/utils");
|
|
8
8
|
const getReleaseInfo = () => {
|
|
9
|
-
const releaseInfo = "
|
|
9
|
+
const releaseInfo = "MTcyNzk4OTIwMDAwMA==";
|
|
10
10
|
if (process.env.NODE_ENV !== 'production') {
|
|
11
11
|
// A simple hack to set the value in the test environment (has no build step).
|
|
12
12
|
// eslint-disable-next-line no-useless-concat
|