@mui/x-data-grid-pro 7.0.0-beta.7 â 7.0.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 +195 -12
- package/DataGridPro/DataGridPro.js +13 -17
- package/README.md +1 -1
- package/components/headerFiltering/GridHeaderFilterCell.js +2 -3
- package/esm/DataGridPro/DataGridPro.js +13 -17
- package/esm/components/GridDetailPanelToggleCell.js +1 -2
- package/esm/components/GridTreeDataGroupingCell.js +2 -3
- package/esm/components/headerFiltering/GridHeaderFilterCell.js +13 -18
- package/esm/components/headerFiltering/GridHeaderFilterClearButton.js +1 -2
- package/esm/components/headerFiltering/GridHeaderFilterMenu.js +1 -2
- package/esm/components/headerFiltering/GridHeaderFilterMenuContainer.js +1 -2
- package/esm/hooks/features/columnHeaders/useGridColumnHeaders.js +5 -6
- package/esm/hooks/features/columnPinning/useGridColumnPinning.js +7 -10
- package/esm/hooks/features/columnReorder/useGridColumnReorder.js +2 -4
- package/esm/hooks/features/detailPanel/useGridDetailPanel.js +5 -10
- package/esm/hooks/features/detailPanel/useGridDetailPanelCache.js +1 -2
- package/esm/hooks/features/infiniteLoader/useGridInfiniteLoader.js +4 -8
- package/esm/hooks/features/lazyLoader/useGridLazyLoader.js +2 -3
- package/esm/hooks/features/rowPinning/useGridRowPinning.js +3 -5
- package/esm/hooks/features/rowPinning/useGridRowPinningPreProcessors.js +5 -7
- package/esm/hooks/features/treeData/gridTreeDataGroupColDef.js +1 -1
- package/esm/hooks/features/treeData/gridTreeDataUtils.js +1 -2
- package/esm/hooks/features/treeData/useGridTreeDataPreProcessors.js +1 -2
- package/esm/utils/releaseInfo.js +1 -1
- package/esm/utils/tree/insertDataRowInTree.js +8 -9
- package/esm/utils/tree/removeDataRowFromTree.js +3 -3
- package/esm/utils/tree/sortRowTree.js +1 -1
- package/esm/utils/tree/updateRowTree.js +1 -1
- package/esm/utils/tree/utils.js +6 -9
- package/hooks/features/columnPinning/useGridColumnPinning.js +3 -3
- package/hooks/features/detailPanel/useGridDetailPanel.js +1 -1
- package/hooks/features/lazyLoader/useGridLazyLoader.d.ts +1 -1
- package/index.js +1 -1
- package/models/dataGridProProps.d.ts +3 -3
- package/models/dataSource.d.ts +1 -1
- package/models/gridApiPro.d.ts +1 -2
- package/modern/DataGridPro/DataGridPro.js +13 -17
- package/modern/components/headerFiltering/GridHeaderFilterCell.js +1 -2
- package/modern/hooks/features/columnPinning/useGridColumnPinning.js +3 -3
- package/modern/hooks/features/detailPanel/useGridDetailPanel.js +1 -1
- package/modern/index.js +1 -1
- package/modern/utils/releaseInfo.js +1 -1
- package/package.json +6 -6
- package/utils/releaseInfo.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,189 @@
|
|
|
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
|
+
## v7.0.0
|
|
7
|
+
|
|
8
|
+
_Mar 22, 2024_
|
|
9
|
+
|
|
10
|
+
We're excited to [announce the first v7 stable release](https://mui.com/blog/mui-x-v7/)! đđ
|
|
11
|
+
|
|
12
|
+
This is now the officially supported major version, where we'll keep rolling out new features, bug fixes, and improvements.
|
|
13
|
+
Migration guides are available with a complete list of the breaking changes:
|
|
14
|
+
|
|
15
|
+
- [Data Grid](https://mui.com/x/migration/migration-data-grid-v6/)
|
|
16
|
+
- [Date and Time Pickers](https://mui.com/x/migration/migration-pickers-v6/)
|
|
17
|
+
- [Tree View](https://mui.com/x/migration/migration-tree-view-v6/)
|
|
18
|
+
- [Charts](https://mui.com/x/migration/migration-charts-v6/)
|
|
19
|
+
|
|
20
|
+
We'd like to offer a big thanks to the 12 contributors who made this release possible. Here are some highlights â¨:
|
|
21
|
+
|
|
22
|
+
- đ Improve the usage of custom `viewRenderers` on `DateTimePicker` (#12441) @LukasTy
|
|
23
|
+
- ⨠Set focus on the focused Tree Item instead of the Tree View (#12226) @flaviendelangle
|
|
24
|
+
- đšī¸ Support controlled `density` for the Data Grid (#12332) @MBilalShafi
|
|
25
|
+
- đ Dynamic virtualization range for the Data Grid (#12353) @romgrk
|
|
26
|
+
- đ Bugfixes
|
|
27
|
+
- đ Documentation improvements
|
|
28
|
+
|
|
29
|
+
### Data Grid
|
|
30
|
+
|
|
31
|
+
#### Breaking changes
|
|
32
|
+
|
|
33
|
+
- The `density` is a [controlled prop](https://mui.com/x/react-data-grid/accessibility/#set-the-density-programmatically) now, if you were previously passing the `density` prop to the Data Grid, you will need to do one of the following:
|
|
34
|
+
|
|
35
|
+
1. Move it to the `initialState.density` to initialize it.
|
|
36
|
+
|
|
37
|
+
```diff
|
|
38
|
+
<DataGrid
|
|
39
|
+
- density="compact"
|
|
40
|
+
+ initialState={{ density: "compact" }}
|
|
41
|
+
/>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
2. Move it to the state and use `onDensityChange` callback to update the `density` prop accordingly for it to work as expected.
|
|
45
|
+
|
|
46
|
+
```diff
|
|
47
|
+
+ const [density, setDensity] = React.useState<GridDensity>('compact');
|
|
48
|
+
<DataGrid
|
|
49
|
+
- density="compact"
|
|
50
|
+
+ density={density}
|
|
51
|
+
+ onDensityChange={(newDensity) => setDensity(newDensity)}
|
|
52
|
+
/>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
- The selector `gridDensityValueSelector` was removed, use the `gridDensitySelector` instead.
|
|
56
|
+
|
|
57
|
+
- The props `rowBuffer` and `columnBuffer` were renamed to `rowBufferPx` and `columnBufferPx`.
|
|
58
|
+
Their value is now a pixel value rather than a number of items. Their default value is now `150`.
|
|
59
|
+
|
|
60
|
+
- The props `rowThreshold` and `columnThreshold` have been removed.
|
|
61
|
+
If you had the `rowThreshold` prop set to `0` to force new rows to be rendered more often â this is no longer necessary.
|
|
62
|
+
|
|
63
|
+
#### `@mui/x-data-grid@7.0.0`
|
|
64
|
+
|
|
65
|
+
- [DataGrid] Allow to control the grid density (#12332) @MBilalShafi
|
|
66
|
+
- [DataGrid] Dynamic virtualization range (#12353) @romgrk
|
|
67
|
+
- [DataGrid] Fix `ElementType` usage (#12479) @cherniavskii
|
|
68
|
+
- [DataGrid] Fix cell value formatting on copy (#12357) @sai6855
|
|
69
|
+
- [DataGrid] Fix checkbox selection is keeping selection when filtering (#11751) @g1mishra
|
|
70
|
+
- [DataGrid] Make `rows` an optional prop (#12478) @MBilalShafi
|
|
71
|
+
|
|
72
|
+
#### `@mui/x-data-grid-pro@7.0.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
73
|
+
|
|
74
|
+
Same changes as in `@mui/x-data-grid@7.0.0`.
|
|
75
|
+
|
|
76
|
+
#### `@mui/x-data-grid-premium@7.0.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
77
|
+
|
|
78
|
+
Same changes as in `@mui/x-data-grid-pro@7.0.0`, plus:
|
|
79
|
+
|
|
80
|
+
- [DataGridPremium] Add support for confirmation before clipboard paste (#12225) @cherniavskii
|
|
81
|
+
- [DataGridPremium] Fix single grouping column sorting (#9679) @cherniavskii
|
|
82
|
+
- [DataGridPremium] Fix boolean cell not rendered in group rows (#12492) @sai6855
|
|
83
|
+
|
|
84
|
+
### Date and Time Pickers
|
|
85
|
+
|
|
86
|
+
#### Breaking changes
|
|
87
|
+
|
|
88
|
+
- The `DesktopDateTimePicker` view rendering has been optimized by using the same technique as for `DesktopDateTimeRangePicker`.
|
|
89
|
+
- The `dateTimeViewRenderers` have been removed in favor of reusing existing time view renderers (`renderTimeViewClock`, `renderDigitalClockTimeView` and `renderMultiSectionDigitalClockTimeView`) and date view renderer (`renderDateViewCalendar`).
|
|
90
|
+
- Passing `renderTimeViewClock` to time view renderers will no longer revert to the old behavior of rendering only date or time view.
|
|
91
|
+
|
|
92
|
+
#### `@mui/x-date-pickers@7.0.0`
|
|
93
|
+
|
|
94
|
+
- [fields] Allow to override the separator between the start and the end date in all range fields (#12174) @flaviendelangle
|
|
95
|
+
- [fields] Support format without separator (#12489) @flaviendelangle
|
|
96
|
+
- [pickers] Use renderer interceptor on `DesktopDateTimePicker` (#12441) @LukasTy
|
|
97
|
+
|
|
98
|
+
#### `@mui/x-date-pickers-pro@7.0.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
99
|
+
|
|
100
|
+
Same changes as in `@mui/x-date-pickers@7.0.0`, plus:
|
|
101
|
+
|
|
102
|
+
- [DateTimeRangePicker] Add component `JSDoc` (#12518) @LukasTy
|
|
103
|
+
- [DateTimeRangePicker] Fix views behavior regression (#12529) @LukasTy
|
|
104
|
+
|
|
105
|
+
### Charts
|
|
106
|
+
|
|
107
|
+
#### `@mui/x-charts@7.0.0`
|
|
108
|
+
|
|
109
|
+
- [charts] Fix small typo in `CartesianContextProvider` (#12461) @Janpot
|
|
110
|
+
|
|
111
|
+
### Tree View
|
|
112
|
+
|
|
113
|
+
#### Breaking changes
|
|
114
|
+
|
|
115
|
+
- The required `nodeId` prop used by the `TreeItem` has been renamed to `itemId` for consistency:
|
|
116
|
+
|
|
117
|
+
```diff
|
|
118
|
+
<TreeView>
|
|
119
|
+
- <TreeItem label="Item 1" nodeId="one">
|
|
120
|
+
+ <TreeItem label="Item 1" itemId="one">
|
|
121
|
+
</TreeView>
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
- The focus is now applied to the Tree Item root element instead of the Tree View root element.
|
|
125
|
+
|
|
126
|
+
This change will allow new features that require the focus to be on the Tree Item,
|
|
127
|
+
like the drag and drop reordering of items.
|
|
128
|
+
It also solves several issues with focus management,
|
|
129
|
+
like the inability to scroll to the focused item when a lot of items are rendered.
|
|
130
|
+
|
|
131
|
+
This will mostly impact how you write tests to interact with the Tree View:
|
|
132
|
+
|
|
133
|
+
For example, if you were writing a test with `react-testing-library`, here is what the changes could look like:
|
|
134
|
+
|
|
135
|
+
```diff
|
|
136
|
+
it('test example on first item', () => {
|
|
137
|
+
- const { getByRole } = render(
|
|
138
|
+
+ const { getAllByRole } = render(
|
|
139
|
+
<SimpleTreeView>
|
|
140
|
+
<TreeItem nodeId="one" />
|
|
141
|
+
<TreeItem nodeId="two" />
|
|
142
|
+
</SimpleTreeView>
|
|
143
|
+
);
|
|
144
|
+
|
|
145
|
+
- const tree = getByRole('tree');
|
|
146
|
+
+ const firstTreeItem = getAllByRole('treeitem')[0];
|
|
147
|
+
act(() => {
|
|
148
|
+
- tree.focus();
|
|
149
|
+
+ firstTreeItem.focus();
|
|
150
|
+
});
|
|
151
|
+
- fireEvent.keyDown(tree, { key: 'ArrowDown' });
|
|
152
|
+
+ fireEvent.keyDown(firstTreeItem, { key: 'ArrowDown' });
|
|
153
|
+
})
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
#### `@mui/x-tree-view@7.0.0`
|
|
157
|
+
|
|
158
|
+
- [TreeView] Rename `nodeId` to `itemId` (#12418) @noraleonte
|
|
159
|
+
- [TreeView] Set focus on the focused Tree Item instead of the Tree View (#12226) @flaviendelangle
|
|
160
|
+
- [TreeView] Update JSDoc of the `ContentComponent` prop to avoid using the word "node" (#12476) @flaviendelangle
|
|
161
|
+
|
|
162
|
+
### `@mui/x-codemod@7.0.0`
|
|
163
|
+
|
|
164
|
+
- [codemod] Add a codemod and update the grid migration guide (#12488) @MBilalShafi
|
|
165
|
+
|
|
166
|
+
### Docs
|
|
167
|
+
|
|
168
|
+
- [docs] Finalize migration guide (#12501) @noraleonte
|
|
169
|
+
- [docs] Fix nested cells alignment in the popular features demo (#12450) @cherniavskii
|
|
170
|
+
- [docs] Fix some Vale errors (#12469) @oliviertassinari
|
|
171
|
+
- [docs] Remove mentions of pre release (#12513) @noraleonte
|
|
172
|
+
- [docs] Update branch name and tags (#12498) @cherniavskii
|
|
173
|
+
- [docs] Update links to v6 (#12496) @cherniavskii
|
|
174
|
+
- [docs] Update links to v7 docs (#12500) @noraleonte
|
|
175
|
+
- [docs] Update supported versions (#12508) @joserodolfofreitas
|
|
176
|
+
- [docs] Update "What's new in MUI X" page #12527 @cherniavskii
|
|
177
|
+
|
|
178
|
+
### Core
|
|
179
|
+
|
|
180
|
+
- [core] Bump `@mui/material` peer dependency for all packages (#12516) @LukasTy
|
|
181
|
+
- [core] Fix `no-restricted-imports` ESLint rule not working for Data Grid packages (#12477) @cherniavskii
|
|
182
|
+
- [core] Lower the frequency of `no-response` action runs (#12491) @michaldudak
|
|
183
|
+
- [core] Remove leftover `legacy` `browserlistrc` entry (#12415) @LukasTy
|
|
184
|
+
- [core] Update NPM tag (#12511) @cherniavskii
|
|
185
|
+
- [core] Update supported browsers (browserlistrc) (#12521) @LukasTy
|
|
186
|
+
- [core] Use Circle CI context @oliviertassinari
|
|
187
|
+
- [license] Fix grammar on expired license error message (#12460) @joserodolfofreitas
|
|
188
|
+
|
|
6
189
|
## 7.0.0-beta.7
|
|
7
190
|
|
|
8
191
|
_Mar 14, 2024_
|
|
@@ -90,7 +273,7 @@ The `onNodeFocus` callback has been renamed to `onItemFocus` for consistency:
|
|
|
90
273
|
- [docs] Add `legacy` bundle drop mention in migration pages (#12424) @LukasTy
|
|
91
274
|
- [docs] Add missing luxon `Info` import (#12427) @LukasTy
|
|
92
275
|
- [docs] Improve slots definitions for charts (#12408) @alexfauquette
|
|
93
|
-
- [docs] Polish What's new in MUI
|
|
276
|
+
- [docs] Polish What's new in MUIÂ X blog titles (#12309) @oliviertassinari
|
|
94
277
|
- [docs] Replace `rel="noreferrer"` by `rel="noopener"` @oliviertassinari
|
|
95
278
|
- [docs] Update `date-fns` `weekStarsOn` overriding example (#12416) @LukasTy
|
|
96
279
|
|
|
@@ -252,7 +435,7 @@ Same changes as in `@mui/x-date-pickers@7.0.0-beta.5`.
|
|
|
252
435
|
### Docs
|
|
253
436
|
|
|
254
437
|
- [docs] Fix image layout shift when loading @oliviertassinari
|
|
255
|
-
- [docs] Match Material
|
|
438
|
+
- [docs] Match Material UI repo comment for redirections @oliviertassinari
|
|
256
439
|
- [docs] Non breaking spaces @oliviertassinari
|
|
257
440
|
- [docs] Polish the Date Picker playground (#11869) @zanivan
|
|
258
441
|
- [docs] Standardize WAI-ARIA references @oliviertassinari
|
|
@@ -263,9 +446,9 @@ Same changes as in `@mui/x-date-pickers@7.0.0-beta.5`.
|
|
|
263
446
|
- [core] Remove grid folder from `getComponentInfo` RegExp (#12241) @flaviendelangle
|
|
264
447
|
- [core] Remove `window.` reference for common globals @oliviertassinari
|
|
265
448
|
- [core] Use runtime agnostic setTimeout type @oliviertassinari
|
|
266
|
-
- [docs-infra] Fix Stack
|
|
449
|
+
- [docs-infra] Fix Stack Overflow breaking space @oliviertassinari
|
|
267
450
|
- [docs-infra] Fix missing non breaking spaces @oliviertassinari
|
|
268
|
-
- [
|
|
451
|
+
- [infra] Update `no-response` workflow (#12193) @MBilalShafi
|
|
269
452
|
- [infra] Fix missing permission reset @oliviertassinari
|
|
270
453
|
|
|
271
454
|
## 7.0.0-beta.4
|
|
@@ -282,7 +465,7 @@ We'd like to offer a big thanks to the 10 contributors who made this release pos
|
|
|
282
465
|
|
|
283
466
|
### Breaking changes
|
|
284
467
|
|
|
285
|
-
- The support for IE11 has been removed from all MUI
|
|
468
|
+
- The support for IE11 has been removed from all MUIÂ X packages. The `legacy` bundle that used to support old browsers like IE11 is no longer included.
|
|
286
469
|
|
|
287
470
|
### Data Grid
|
|
288
471
|
|
|
@@ -324,7 +507,7 @@ Same changes as in `@mui/x-data-grid-pro@7.0.0-beta.4`.
|
|
|
324
507
|
- The headless field hooks (e.g.: `useDateField`) now returns a new prop called `enableAccessibleFieldDOMStructure`.
|
|
325
508
|
This property is utilized to determine whether the anticipated UI is constructed using an accessible DOM structure. Learn more about this new [accessible DOM structure](/x/react-date-pickers/fields/#accessible-dom-structure).
|
|
326
509
|
|
|
327
|
-
|
|
510
|
+
When building a custom UI, you are most-likely only supporting one DOM structure, so you can remove `enableAccessibleFieldDOMStructure` before it is passed to the DOM:
|
|
328
511
|
|
|
329
512
|
```diff
|
|
330
513
|
function MyCustomTextField(props) {
|
|
@@ -392,7 +575,7 @@ These components are no longer exported from `@mui/x-charts`:
|
|
|
392
575
|
### Docs
|
|
393
576
|
|
|
394
577
|
- [docs] Add recipe for hiding separator on non-resizable columns (#12134) @michelengelen
|
|
395
|
-
- [docs] Add small improvements to the Gauge
|
|
578
|
+
- [docs] Add small improvements to the Gauge page (#12076) @danilo-leal
|
|
396
579
|
- [docs] Add the 'point' scaleType to the axis documentation (#12179) @alexfauquette
|
|
397
580
|
- [docs] Clarify Pickers 'Component composition' section (#12097) @LukasTy
|
|
398
581
|
- [docs] Fix "Licensing" page link (#12156) @LukasTy
|
|
@@ -975,7 +1158,7 @@ Same changes as in `@mui/x-date-pickers@7.0.0-alpha.9`.
|
|
|
975
1158
|
|
|
976
1159
|
- [charts] Do not propagate `innerRadius` and `outerRadius` to the DOM (#11689) @alexfauquette
|
|
977
1160
|
- [charts] Fix default `stackOffset` for `LineChart` (#11647) @alexfauquette
|
|
978
|
-
- [charts] Remove a
|
|
1161
|
+
- [charts] Remove a TypeScript ignore (#11688) @alexfauquette
|
|
979
1162
|
|
|
980
1163
|
### Tree View
|
|
981
1164
|
|
|
@@ -1404,7 +1587,7 @@ Same changes as in `@mui/x-date-pickers@7.0.0-alpha.7`.
|
|
|
1404
1587
|
- [core] Fix release changelog (#11496) @romgrk
|
|
1405
1588
|
- [core] Fix use of ::before & ::after (#11515) @oliviertassinari
|
|
1406
1589
|
- [core] Localize the issue template to MUIÂ X (#11511) @oliviertassinari
|
|
1407
|
-
- [core]
|
|
1590
|
+
- [core] Regenerate API files (#11542) @flaviendelangle
|
|
1408
1591
|
- [core] Remove issue emoji @oliviertassinari
|
|
1409
1592
|
- [core] Sync the release instructions with MUIÂ Core @oliviertassinari
|
|
1410
1593
|
- [core] Yaml format match most common convention @oliviertassinari
|
|
@@ -1447,7 +1630,7 @@ We'd like to offer a big thanks to the 6 contributors who made this release poss
|
|
|
1447
1630
|
|
|
1448
1631
|
- The `filterModel` now supports `Date` objects as values for `date` and `dateTime` column types.
|
|
1449
1632
|
The `filterModel` still accepts strings as values for `date` and `dateTime` column types,
|
|
1450
|
-
but all updates to the `filterModel` coming from the UI (
|
|
1633
|
+
but all updates to the `filterModel` coming from the UI (for example filter panel) will set the value as a `Date` object.
|
|
1451
1634
|
|
|
1452
1635
|
#### `@mui/x-data-grid@7.0.0-alpha.6`
|
|
1453
1636
|
|
|
@@ -1658,7 +1841,7 @@ Same changes as in `@mui/x-date-pickers@7.0.0-alpha.5`, plus:
|
|
|
1658
1841
|
### Core
|
|
1659
1842
|
|
|
1660
1843
|
- [core] Automate cherry-pick of PRs from `next` -> `master` (#11382) @MBilalShafi
|
|
1661
|
-
- [
|
|
1844
|
+
- [infra] Update `no-response` workflow (#11369) @MBilalShafi
|
|
1662
1845
|
- [test] Fix flaky screenshots (#11388) @cherniavskii
|
|
1663
1846
|
|
|
1664
1847
|
## 7.0.0-alpha.4
|
|
@@ -1896,7 +2079,7 @@ Same changes as in `@mui/x-date-pickers@7.0.0-alpha.3`.
|
|
|
1896
2079
|
|
|
1897
2080
|
- [charts] Adjusted `defaultizeValueFormatter` util to accept an optional `series.valueFormatter` value (#11144) @michelengelen
|
|
1898
2081
|
- [charts] Apply `labelStyle` and `tickLabelStyle` props on `<ChartsYAxis />` (#11180) @akamfoad
|
|
1899
|
-
- [charts] Fix
|
|
2082
|
+
- [charts] Fix TypeScript config (#11259) @alexfauquette
|
|
1900
2083
|
- [charts] Fix error with empty dataset (#11063) @alexfauquette
|
|
1901
2084
|
- [charts] Fix export strategy (#11235) @alexfauquette
|
|
1902
2085
|
- [charts] Remove outdated prop-types (#11045) @alexfauquette
|
|
@@ -120,10 +120,10 @@ DataGridProRaw.propTypes = {
|
|
|
120
120
|
*/
|
|
121
121
|
clipboardCopyCellDelimiter: _propTypes.default.string,
|
|
122
122
|
/**
|
|
123
|
-
*
|
|
124
|
-
* @default
|
|
123
|
+
* Column region in pixels to render before/after the viewport
|
|
124
|
+
* @default 150
|
|
125
125
|
*/
|
|
126
|
-
|
|
126
|
+
columnBufferPx: _propTypes.default.number,
|
|
127
127
|
columnGroupingModel: _propTypes.default.arrayOf(_propTypes.default.object),
|
|
128
128
|
/**
|
|
129
129
|
* Sets the height in pixel of the column headers in the Data Grid.
|
|
@@ -134,11 +134,6 @@ DataGridProRaw.propTypes = {
|
|
|
134
134
|
* Set of columns of type [[GridColDef]][].
|
|
135
135
|
*/
|
|
136
136
|
columns: _propTypes.default.arrayOf(_propTypes.default.object).isRequired,
|
|
137
|
-
/**
|
|
138
|
-
* Number of rows from the `columnBuffer` that can be visible before a new slice is rendered.
|
|
139
|
-
* @default 3
|
|
140
|
-
*/
|
|
141
|
-
columnThreshold: _propTypes.default.number,
|
|
142
137
|
/**
|
|
143
138
|
* Set the column visibility model of the Data Grid.
|
|
144
139
|
* If defined, the Data Grid will ignore the `hide` property in [[GridColDef]].
|
|
@@ -570,6 +565,11 @@ DataGridProRaw.propTypes = {
|
|
|
570
565
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
571
566
|
*/
|
|
572
567
|
onColumnWidthChange: _propTypes.default.func,
|
|
568
|
+
/**
|
|
569
|
+
* Callback fired when the density changes.
|
|
570
|
+
* @param {GridDensity} density New density value.
|
|
571
|
+
*/
|
|
572
|
+
onDensityChange: _propTypes.default.func,
|
|
573
573
|
/**
|
|
574
574
|
* Callback fired when the detail panel of a row is opened or closed.
|
|
575
575
|
* @param {GridRowId[]} ids The ids of the rows which have the detail panel open.
|
|
@@ -760,10 +760,10 @@ DataGridProRaw.propTypes = {
|
|
|
760
760
|
*/
|
|
761
761
|
processRowUpdate: _propTypes.default.func,
|
|
762
762
|
/**
|
|
763
|
-
*
|
|
764
|
-
* @default
|
|
763
|
+
* Row region in pixels to render before/after the viewport
|
|
764
|
+
* @default 150
|
|
765
765
|
*/
|
|
766
|
-
|
|
766
|
+
rowBufferPx: _propTypes.default.number,
|
|
767
767
|
/**
|
|
768
768
|
* Set the total number of rows, if it is different from the length of the value `rows` prop.
|
|
769
769
|
* If some rows have children (for instance in the tree data), this number represents the amount of top level rows.
|
|
@@ -792,8 +792,9 @@ DataGridProRaw.propTypes = {
|
|
|
792
792
|
rowReordering: _propTypes.default.bool,
|
|
793
793
|
/**
|
|
794
794
|
* Set of rows of type [[GridRowsProp]].
|
|
795
|
+
* @default []
|
|
795
796
|
*/
|
|
796
|
-
rows: _propTypes.default.arrayOf(_propTypes.default.object)
|
|
797
|
+
rows: _propTypes.default.arrayOf(_propTypes.default.object),
|
|
797
798
|
/**
|
|
798
799
|
* If `false`, the row selection mode is disabled.
|
|
799
800
|
* @default true
|
|
@@ -815,11 +816,6 @@ DataGridProRaw.propTypes = {
|
|
|
815
816
|
* @default "margin"
|
|
816
817
|
*/
|
|
817
818
|
rowSpacingType: _propTypes.default.oneOf(['border', 'margin']),
|
|
818
|
-
/**
|
|
819
|
-
* Number of rows from the `rowBuffer` that can be visible before a new slice is rendered.
|
|
820
|
-
* @default 3
|
|
821
|
-
*/
|
|
822
|
-
rowThreshold: _propTypes.default.number,
|
|
823
819
|
/**
|
|
824
820
|
* Override the height/width of the Data Grid inner scrollbar.
|
|
825
821
|
*/
|
package/README.md
CHANGED
|
@@ -13,7 +13,6 @@ var _clsx = _interopRequireDefault(require("clsx"));
|
|
|
13
13
|
var _utils = require("@mui/utils");
|
|
14
14
|
var _xDataGrid = require("@mui/x-data-grid");
|
|
15
15
|
var _internals = require("@mui/x-data-grid/internals");
|
|
16
|
-
var _cellBorderUtils = require("@mui/x-data-grid/utils/cellBorderUtils");
|
|
17
16
|
var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
|
|
18
17
|
var _GridHeaderFilterMenuContainer = require("./GridHeaderFilterMenuContainer");
|
|
19
18
|
var _GridHeaderFilterClearButton = require("./GridHeaderFilterClearButton");
|
|
@@ -172,8 +171,8 @@ const GridHeaderFilterCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
172
171
|
onMouseDown: publish('headerFilterMouseDown', onMouseDown),
|
|
173
172
|
onBlur: publish('headerFilterBlur')
|
|
174
173
|
}), [onMouseDown, onKeyDown, publish]);
|
|
175
|
-
const showLeftBorder = (0,
|
|
176
|
-
const showRightBorder = (0,
|
|
174
|
+
const showLeftBorder = (0, _internals.shouldCellShowLeftBorder)(pinnedPosition, indexInSection);
|
|
175
|
+
const showRightBorder = (0, _internals.shouldCellShowRightBorder)(pinnedPosition, indexInSection, sectionLength, rootProps.showCellVerticalBorder);
|
|
177
176
|
const ownerState = (0, _extends2.default)({}, rootProps, {
|
|
178
177
|
pinnedPosition,
|
|
179
178
|
colDef,
|
|
@@ -113,10 +113,10 @@ DataGridProRaw.propTypes = {
|
|
|
113
113
|
*/
|
|
114
114
|
clipboardCopyCellDelimiter: PropTypes.string,
|
|
115
115
|
/**
|
|
116
|
-
*
|
|
117
|
-
* @default
|
|
116
|
+
* Column region in pixels to render before/after the viewport
|
|
117
|
+
* @default 150
|
|
118
118
|
*/
|
|
119
|
-
|
|
119
|
+
columnBufferPx: PropTypes.number,
|
|
120
120
|
columnGroupingModel: PropTypes.arrayOf(PropTypes.object),
|
|
121
121
|
/**
|
|
122
122
|
* Sets the height in pixel of the column headers in the Data Grid.
|
|
@@ -127,11 +127,6 @@ DataGridProRaw.propTypes = {
|
|
|
127
127
|
* Set of columns of type [[GridColDef]][].
|
|
128
128
|
*/
|
|
129
129
|
columns: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
130
|
-
/**
|
|
131
|
-
* Number of rows from the `columnBuffer` that can be visible before a new slice is rendered.
|
|
132
|
-
* @default 3
|
|
133
|
-
*/
|
|
134
|
-
columnThreshold: PropTypes.number,
|
|
135
130
|
/**
|
|
136
131
|
* Set the column visibility model of the Data Grid.
|
|
137
132
|
* If defined, the Data Grid will ignore the `hide` property in [[GridColDef]].
|
|
@@ -563,6 +558,11 @@ DataGridProRaw.propTypes = {
|
|
|
563
558
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
564
559
|
*/
|
|
565
560
|
onColumnWidthChange: PropTypes.func,
|
|
561
|
+
/**
|
|
562
|
+
* Callback fired when the density changes.
|
|
563
|
+
* @param {GridDensity} density New density value.
|
|
564
|
+
*/
|
|
565
|
+
onDensityChange: PropTypes.func,
|
|
566
566
|
/**
|
|
567
567
|
* Callback fired when the detail panel of a row is opened or closed.
|
|
568
568
|
* @param {GridRowId[]} ids The ids of the rows which have the detail panel open.
|
|
@@ -753,10 +753,10 @@ DataGridProRaw.propTypes = {
|
|
|
753
753
|
*/
|
|
754
754
|
processRowUpdate: PropTypes.func,
|
|
755
755
|
/**
|
|
756
|
-
*
|
|
757
|
-
* @default
|
|
756
|
+
* Row region in pixels to render before/after the viewport
|
|
757
|
+
* @default 150
|
|
758
758
|
*/
|
|
759
|
-
|
|
759
|
+
rowBufferPx: PropTypes.number,
|
|
760
760
|
/**
|
|
761
761
|
* Set the total number of rows, if it is different from the length of the value `rows` prop.
|
|
762
762
|
* If some rows have children (for instance in the tree data), this number represents the amount of top level rows.
|
|
@@ -785,8 +785,9 @@ DataGridProRaw.propTypes = {
|
|
|
785
785
|
rowReordering: PropTypes.bool,
|
|
786
786
|
/**
|
|
787
787
|
* Set of rows of type [[GridRowsProp]].
|
|
788
|
+
* @default []
|
|
788
789
|
*/
|
|
789
|
-
rows: PropTypes.arrayOf(PropTypes.object)
|
|
790
|
+
rows: PropTypes.arrayOf(PropTypes.object),
|
|
790
791
|
/**
|
|
791
792
|
* If `false`, the row selection mode is disabled.
|
|
792
793
|
* @default true
|
|
@@ -808,11 +809,6 @@ DataGridProRaw.propTypes = {
|
|
|
808
809
|
* @default "margin"
|
|
809
810
|
*/
|
|
810
811
|
rowSpacingType: PropTypes.oneOf(['border', 'margin']),
|
|
811
|
-
/**
|
|
812
|
-
* Number of rows from the `rowBuffer` that can be visible before a new slice is rendered.
|
|
813
|
-
* @default 3
|
|
814
|
-
*/
|
|
815
|
-
rowThreshold: PropTypes.number,
|
|
816
812
|
/**
|
|
817
813
|
* Override the height/width of the Data Grid inner scrollbar.
|
|
818
814
|
*/
|
|
@@ -18,7 +18,6 @@ const useUtilityClasses = ownerState => {
|
|
|
18
18
|
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
19
19
|
};
|
|
20
20
|
function GridDetailPanelToggleCell(props) {
|
|
21
|
-
var _rootProps$slotProps;
|
|
22
21
|
const {
|
|
23
22
|
id,
|
|
24
23
|
value: isExpanded
|
|
@@ -39,7 +38,7 @@ function GridDetailPanelToggleCell(props) {
|
|
|
39
38
|
disabled: !hasContent,
|
|
40
39
|
className: classes.root,
|
|
41
40
|
"aria-label": isExpanded ? apiRef.current.getLocaleText('collapseDetailPanel') : apiRef.current.getLocaleText('expandDetailPanel')
|
|
42
|
-
},
|
|
41
|
+
}, rootProps.slotProps?.baseIconButton, {
|
|
43
42
|
children: /*#__PURE__*/_jsx(Icon, {
|
|
44
43
|
fontSize: "inherit"
|
|
45
44
|
})
|
|
@@ -19,7 +19,6 @@ const useUtilityClasses = ownerState => {
|
|
|
19
19
|
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
20
20
|
};
|
|
21
21
|
function GridTreeDataGroupingCell(props) {
|
|
22
|
-
var _filteredDescendantCo, _rootProps$slotProps;
|
|
23
22
|
const {
|
|
24
23
|
id,
|
|
25
24
|
field,
|
|
@@ -35,7 +34,7 @@ function GridTreeDataGroupingCell(props) {
|
|
|
35
34
|
};
|
|
36
35
|
const classes = useUtilityClasses(ownerState);
|
|
37
36
|
const filteredDescendantCountLookup = useGridSelector(apiRef, gridFilteredDescendantCountLookupSelector);
|
|
38
|
-
const filteredDescendantCount =
|
|
37
|
+
const filteredDescendantCount = filteredDescendantCountLookup[rowNode.id] ?? 0;
|
|
39
38
|
const Icon = rowNode.childrenExpanded ? rootProps.slots.treeDataCollapseIcon : rootProps.slots.treeDataExpandIcon;
|
|
40
39
|
const handleClick = event => {
|
|
41
40
|
apiRef.current.setRowChildrenExpansion(id, !rowNode.childrenExpanded);
|
|
@@ -54,7 +53,7 @@ function GridTreeDataGroupingCell(props) {
|
|
|
54
53
|
onClick: handleClick,
|
|
55
54
|
tabIndex: -1,
|
|
56
55
|
"aria-label": rowNode.childrenExpanded ? apiRef.current.getLocaleText('treeDataCollapse') : apiRef.current.getLocaleText('treeDataExpand')
|
|
57
|
-
}, rootProps
|
|
56
|
+
}, rootProps?.slotProps?.baseIconButton, {
|
|
58
57
|
children: /*#__PURE__*/_jsx(Icon, {
|
|
59
58
|
fontSize: "inherit"
|
|
60
59
|
})
|
|
@@ -6,8 +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 { gridVisibleColumnFieldsSelector, getDataGridUtilityClass, useGridSelector, gridFilterModelSelector, gridFilterableColumnLookupSelector } from '@mui/x-data-grid';
|
|
9
|
-
import { fastMemo, useGridPrivateApiContext, gridHeaderFilteringEditFieldSelector, gridHeaderFilteringMenuSelector, isNavigationKey } from '@mui/x-data-grid/internals';
|
|
10
|
-
import { shouldCellShowLeftBorder, shouldCellShowRightBorder } from '@mui/x-data-grid/utils/cellBorderUtils';
|
|
9
|
+
import { fastMemo, useGridPrivateApiContext, gridHeaderFilteringEditFieldSelector, gridHeaderFilteringMenuSelector, isNavigationKey, shouldCellShowLeftBorder, shouldCellShowRightBorder } from '@mui/x-data-grid/internals';
|
|
11
10
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
12
11
|
import { GridHeaderFilterMenuContainer } from './GridHeaderFilterMenuContainer';
|
|
13
12
|
import { GridHeaderFilterClearButton } from './GridHeaderFilterClearButton';
|
|
@@ -32,7 +31,6 @@ const dateSx = {
|
|
|
32
31
|
}
|
|
33
32
|
};
|
|
34
33
|
const GridHeaderFilterCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
35
|
-
var _colDef$filterOperato, _colDef$filterOperato2, _filterOperators$find, _currentOperator$head, _colDef$headerName;
|
|
36
34
|
const {
|
|
37
35
|
colIndex,
|
|
38
36
|
height,
|
|
@@ -63,11 +61,11 @@ const GridHeaderFilterCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
63
61
|
const isMenuOpen = menuOpenField === colDef.field;
|
|
64
62
|
|
|
65
63
|
// TODO: Support for `isAnyOf` operator
|
|
66
|
-
const filterOperators =
|
|
64
|
+
const filterOperators = colDef.filterOperators?.filter(operator => operator.value !== 'isAnyOf') ?? [];
|
|
67
65
|
const filterModel = useGridSelector(apiRef, gridFilterModelSelector);
|
|
68
66
|
const filterableColumnsLookup = useGridSelector(apiRef, gridFilterableColumnLookupSelector);
|
|
69
67
|
const isFilterReadOnly = React.useMemo(() => {
|
|
70
|
-
if (!
|
|
68
|
+
if (!filterModel?.items.length) {
|
|
71
69
|
return false;
|
|
72
70
|
}
|
|
73
71
|
const filterModelItem = filterModel.items.find(it => it.field === colDef.field);
|
|
@@ -98,7 +96,7 @@ const GridHeaderFilterCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
98
96
|
focusableElement = inputRef.current;
|
|
99
97
|
}
|
|
100
98
|
const elementToFocus = focusableElement || cellRef.current;
|
|
101
|
-
elementToFocus
|
|
99
|
+
elementToFocus?.focus();
|
|
102
100
|
apiRef.current.columnHeadersContainerRef.current.scrollLeft = 0;
|
|
103
101
|
}
|
|
104
102
|
}, [InputComponent, apiRef, hasFocus, isEditing, isMenuOpen]);
|
|
@@ -129,8 +127,7 @@ const GridHeaderFilterCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
129
127
|
case 'Tab':
|
|
130
128
|
{
|
|
131
129
|
if (isEditing) {
|
|
132
|
-
|
|
133
|
-
const fieldToFocus = (_columnFields = columnFields[colIndex + (event.shiftKey ? -1 : 1)]) != null ? _columnFields : null;
|
|
130
|
+
const fieldToFocus = columnFields[colIndex + (event.shiftKey ? -1 : 1)] ?? null;
|
|
134
131
|
if (fieldToFocus) {
|
|
135
132
|
apiRef.current.startHeaderFilterEditMode(fieldToFocus);
|
|
136
133
|
apiRef.current.setColumnHeaderFilterFocus(fieldToFocus, event);
|
|
@@ -154,8 +151,7 @@ const GridHeaderFilterCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
154
151
|
}, [apiRef, colDef.field]);
|
|
155
152
|
const onMouseDown = React.useCallback(event => {
|
|
156
153
|
if (!hasFocus) {
|
|
157
|
-
|
|
158
|
-
if ((_inputRef$current = inputRef.current) != null && (_inputRef$current$con = _inputRef$current.contains) != null && _inputRef$current$con.call(_inputRef$current, event.target)) {
|
|
154
|
+
if (inputRef.current?.contains?.(event.target)) {
|
|
159
155
|
inputRef.current.focus();
|
|
160
156
|
}
|
|
161
157
|
apiRef.current.setColumnHeaderFilterFocus(colDef.field, event);
|
|
@@ -176,11 +172,11 @@ const GridHeaderFilterCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
176
172
|
showRightBorder
|
|
177
173
|
});
|
|
178
174
|
const classes = useUtilityClasses(ownerState);
|
|
179
|
-
const isNoInputOperator =
|
|
175
|
+
const isNoInputOperator = filterOperators?.find(({
|
|
180
176
|
value
|
|
181
|
-
}) => item.operator === value)
|
|
182
|
-
const isApplied = Boolean(item
|
|
183
|
-
const label =
|
|
177
|
+
}) => item.operator === value)?.requiresFilterValue === false;
|
|
178
|
+
const isApplied = Boolean(item?.value) || isNoInputOperator;
|
|
179
|
+
const label = currentOperator.headerLabel ?? apiRef.current.getLocaleText(`headerFilterOperator${capitalize(item.operator)}`);
|
|
184
180
|
const isFilterActive = isApplied || hasFocus;
|
|
185
181
|
return /*#__PURE__*/_jsxs("div", _extends({
|
|
186
182
|
className: clsx(classes.root, headerClassName),
|
|
@@ -193,7 +189,7 @@ const GridHeaderFilterCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
193
189
|
}, styleProp),
|
|
194
190
|
role: "columnheader",
|
|
195
191
|
"aria-colindex": colIndex + 1,
|
|
196
|
-
"aria-label": headerFilterComponent == null ?
|
|
192
|
+
"aria-label": headerFilterComponent == null ? colDef.headerName ?? colDef.field : undefined
|
|
197
193
|
}, other, mouseEventsHandlers, {
|
|
198
194
|
children: [headerFilterComponent, InputComponent && headerFilterComponent === undefined ? /*#__PURE__*/_jsxs(React.Fragment, {
|
|
199
195
|
children: [/*#__PURE__*/_jsx(InputComponent, _extends({
|
|
@@ -203,10 +199,9 @@ const GridHeaderFilterCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
203
199
|
applyValue: applyFilterChanges,
|
|
204
200
|
onFocus: () => apiRef.current.startHeaderFilterEditMode(colDef.field),
|
|
205
201
|
onBlur: event => {
|
|
206
|
-
var _event$relatedTarget;
|
|
207
202
|
apiRef.current.stopHeaderFilterEditMode();
|
|
208
203
|
// Blurring an input element should reset focus state only if `relatedTarget` is not the header filter cell
|
|
209
|
-
if (!
|
|
204
|
+
if (!event.relatedTarget?.className.includes('columnHeader')) {
|
|
210
205
|
apiRef.current.setState(state => _extends({}, state, {
|
|
211
206
|
focus: {
|
|
212
207
|
cell: null,
|
|
@@ -230,7 +225,7 @@ const GridHeaderFilterCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
230
225
|
sx: colDef.type === 'date' || colDef.type === 'dateTime' ? dateSx : undefined
|
|
231
226
|
}, isNoInputOperator ? {
|
|
232
227
|
value: ''
|
|
233
|
-
} : {}, currentOperator
|
|
228
|
+
} : {}, currentOperator?.InputComponentProps, InputComponentProps)), /*#__PURE__*/_jsx(GridHeaderFilterMenuContainer, {
|
|
234
229
|
operators: filterOperators,
|
|
235
230
|
item: item,
|
|
236
231
|
field: colDef.field,
|
|
@@ -6,14 +6,13 @@ const sx = {
|
|
|
6
6
|
padding: '2px'
|
|
7
7
|
};
|
|
8
8
|
function GridHeaderFilterClearButton(props) {
|
|
9
|
-
var _rootProps$slotProps;
|
|
10
9
|
const rootProps = useGridRootProps();
|
|
11
10
|
return /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({
|
|
12
11
|
tabIndex: -1,
|
|
13
12
|
"aria-label": "Clear filter",
|
|
14
13
|
size: "small",
|
|
15
14
|
sx: sx
|
|
16
|
-
}, props,
|
|
15
|
+
}, props, rootProps.slotProps?.baseIconButton, {
|
|
17
16
|
children: /*#__PURE__*/_jsx(rootProps.slots.columnMenuClearIcon, {
|
|
18
17
|
fontSize: "inherit"
|
|
19
18
|
})
|
|
@@ -41,8 +41,7 @@ function GridHeaderFilterMenu({
|
|
|
41
41
|
id: id,
|
|
42
42
|
onKeyDown: handleListKeyDown,
|
|
43
43
|
children: operators.map((op, i) => {
|
|
44
|
-
|
|
45
|
-
const label = (_op$headerLabel = op == null ? void 0 : op.headerLabel) != null ? _op$headerLabel : apiRef.current.getLocaleText(`headerFilterOperator${capitalize(op.value)}`);
|
|
44
|
+
const label = op?.headerLabel ?? apiRef.current.getLocaleText(`headerFilterOperator${capitalize(op.value)}`);
|
|
46
45
|
return /*#__PURE__*/_jsx(MenuItem, {
|
|
47
46
|
onClick: () => {
|
|
48
47
|
applyFilterChanges(_extends({}, item, {
|
|
@@ -15,7 +15,6 @@ const sx = {
|
|
|
15
15
|
margin: 'auto 0 10px 5px'
|
|
16
16
|
};
|
|
17
17
|
function GridHeaderFilterMenuContainer(props) {
|
|
18
|
-
var _rootProps$slotProps;
|
|
19
18
|
const {
|
|
20
19
|
operators,
|
|
21
20
|
item,
|
|
@@ -54,7 +53,7 @@ function GridHeaderFilterMenuContainer(props) {
|
|
|
54
53
|
onClick: handleClick,
|
|
55
54
|
sx: sx,
|
|
56
55
|
disabled: disabled
|
|
57
|
-
},
|
|
56
|
+
}, rootProps.slotProps?.baseIconButton, {
|
|
58
57
|
children: /*#__PURE__*/_jsx(rootProps.slots.openFilterButtonIcon, {
|
|
59
58
|
fontSize: "small"
|
|
60
59
|
})
|