@mui/x-data-grid-pro 6.6.0 → 6.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +147 -13
- package/components/headerFiltering/GridHeaderFilterCell.d.ts +0 -1
- package/components/headerFiltering/GridHeaderFilterCell.js +36 -23
- package/components/headerFiltering/GridHeaderFilterClearButton.js +1 -1
- package/components/headerFiltering/GridHeaderFilterMenu.d.ts +5 -2
- package/components/headerFiltering/GridHeaderFilterMenu.js +36 -15
- package/components/headerFiltering/{GridHeaderFilterAdornment.d.ts → GridHeaderFilterMenuContainer.d.ts} +3 -3
- package/{modern/components/headerFiltering/GridHeaderFilterAdornment.js → components/headerFiltering/GridHeaderFilterMenuContainer.js} +23 -24
- package/components/headerFiltering/index.d.ts +2 -1
- package/components/headerFiltering/index.js +3 -2
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +16 -8
- package/hooks/features/lazyLoader/useGridLazyLoaderPreProcessors.js +2 -2
- package/hooks/features/rowPinning/useGridRowPinningPreProcessors.js +1 -6
- package/hooks/features/rowReorder/useGridRowReorder.js +26 -1
- package/hooks/features/treeData/gridTreeDataUtils.js +2 -1
- package/index.js +1 -1
- package/legacy/components/headerFiltering/GridHeaderFilterCell.js +39 -27
- package/legacy/components/headerFiltering/GridHeaderFilterClearButton.js +1 -1
- package/legacy/components/headerFiltering/GridHeaderFilterMenu.js +36 -15
- package/legacy/components/headerFiltering/{GridHeaderFilterAdornment.js → GridHeaderFilterMenuContainer.js} +23 -25
- package/legacy/components/headerFiltering/index.js +3 -2
- package/legacy/hooks/features/columnHeaders/useGridColumnHeaders.js +14 -8
- package/legacy/hooks/features/lazyLoader/useGridLazyLoaderPreProcessors.js +2 -2
- package/legacy/hooks/features/rowPinning/useGridRowPinningPreProcessors.js +1 -6
- package/legacy/hooks/features/rowReorder/useGridRowReorder.js +26 -1
- package/legacy/hooks/features/treeData/gridTreeDataUtils.js +2 -1
- package/legacy/index.js +1 -1
- package/legacy/material/icons.js +1 -4
- package/legacy/material/index.js +2 -3
- package/legacy/utils/releaseInfo.js +1 -1
- package/legacy/utils/tree/insertDataRowInTree.js +8 -24
- package/legacy/utils/tree/sortRowTree.js +78 -18
- package/legacy/utils/tree/utils.js +27 -40
- package/material/icons.d.ts +0 -3
- package/material/icons.js +1 -4
- package/material/index.d.ts +0 -1
- package/material/index.js +2 -3
- package/models/gridProIconSlotsComponent.d.ts +0 -5
- package/modern/components/headerFiltering/GridHeaderFilterCell.js +36 -23
- package/modern/components/headerFiltering/GridHeaderFilterClearButton.js +1 -1
- package/modern/components/headerFiltering/GridHeaderFilterMenu.js +36 -15
- package/{components/headerFiltering/GridHeaderFilterAdornment.js → modern/components/headerFiltering/GridHeaderFilterMenuContainer.js} +22 -25
- package/modern/components/headerFiltering/index.js +3 -2
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +16 -8
- package/modern/hooks/features/lazyLoader/useGridLazyLoaderPreProcessors.js +2 -2
- package/modern/hooks/features/rowPinning/useGridRowPinningPreProcessors.js +1 -6
- package/modern/hooks/features/rowReorder/useGridRowReorder.js +26 -1
- package/modern/hooks/features/treeData/gridTreeDataUtils.js +2 -1
- package/modern/index.js +1 -1
- package/modern/material/icons.js +1 -4
- package/modern/material/index.js +2 -3
- package/modern/utils/releaseInfo.js +1 -1
- package/modern/utils/tree/insertDataRowInTree.js +8 -24
- package/modern/utils/tree/sortRowTree.js +64 -18
- package/modern/utils/tree/utils.js +10 -25
- package/node/components/headerFiltering/GridHeaderFilterCell.js +36 -23
- package/node/components/headerFiltering/GridHeaderFilterClearButton.js +1 -1
- package/node/components/headerFiltering/GridHeaderFilterMenu.js +36 -14
- package/node/components/headerFiltering/{GridHeaderFilterAdornment.js → GridHeaderFilterMenuContainer.js} +22 -24
- package/node/components/headerFiltering/index.js +15 -4
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +15 -7
- package/node/hooks/features/lazyLoader/useGridLazyLoaderPreProcessors.js +2 -2
- package/node/hooks/features/rowPinning/useGridRowPinningPreProcessors.js +1 -6
- package/node/hooks/features/rowReorder/useGridRowReorder.js +26 -1
- package/node/hooks/features/treeData/gridTreeDataUtils.js +2 -1
- package/node/index.js +1 -1
- package/node/material/icons.js +2 -6
- package/node/material/index.js +1 -2
- package/node/utils/releaseInfo.js +1 -1
- package/node/utils/tree/insertDataRowInTree.js +7 -23
- package/node/utils/tree/sortRowTree.js +64 -18
- package/node/utils/tree/utils.js +12 -27
- package/package.json +2 -2
- package/themeAugmentation/overrides.d.ts +1 -1
- package/typeOverloads/modules.d.ts +6 -6
- package/utils/releaseInfo.js +1 -1
- package/utils/tree/insertDataRowInTree.js +8 -24
- package/utils/tree/sortRowTree.js +64 -18
- package/utils/tree/utils.d.ts +3 -38
- package/utils/tree/utils.js +10 -25
- package/components/headerFiltering/constants.d.ts +0 -3
- package/components/headerFiltering/constants.js +0 -30
- package/legacy/components/headerFiltering/constants.js +0 -30
- package/modern/components/headerFiltering/constants.js +0 -30
- package/node/components/headerFiltering/constants.js +0 -37
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,140 @@
|
|
|
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
|
+
## 6.8.0
|
|
7
|
+
|
|
8
|
+
_Jun 16, 2023_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 13 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🌍 Add Greek (el-GR) locale on Pickers and improve on Data Grid
|
|
13
|
+
- 🚅 Performance improvements
|
|
14
|
+
- 🐞 Bugfixes
|
|
15
|
+
- 📚 Documentation improvements
|
|
16
|
+
|
|
17
|
+
### `@mui/x-data-grid@6.8.0` / `@mui/x-data-grid-pro@6.8.0` / `@mui/x-data-grid-premium@6.8.0`
|
|
18
|
+
|
|
19
|
+
#### Changes
|
|
20
|
+
|
|
21
|
+
- [DataGrid] Add missing styles to `overridesResolver` (#9248) @mrmuhammadali
|
|
22
|
+
- [DataGrid] Keep column header menu icon always visible on touch devices (#9076) @cherniavskii
|
|
23
|
+
- [DataGrid] Correct the type for single digit edited number value (#9282) @MBilalShafi
|
|
24
|
+
- [DataGrid] Correct the type for single digit edited number for row edit (#9348) @MBilalShafi
|
|
25
|
+
- [DataGrid] Filtering performance: cache values (#9284) @romgrk
|
|
26
|
+
- [DataGrid] Fix tabbing between `actions` cells in edit mode (#9321) @md250721
|
|
27
|
+
- [DataGrid] Make autocompletion work for `GridColDef['type']` (#9320) @cherniavskii
|
|
28
|
+
- [DataGrid] Polish shortcut logic (#9220) @oliviertassinari
|
|
29
|
+
- [DataGrid] Row reordering fix for different row heights (#7006) @yaredtsy
|
|
30
|
+
- [DataGrid] Scroll performance improvements (#9037) @romgrk
|
|
31
|
+
- [l10n] Improve Greek (el-GR) locale (#9292) @clytras
|
|
32
|
+
|
|
33
|
+
### `@mui/x-date-pickers@6.8.0` / `@mui/x-date-pickers-pro@6.8.0`
|
|
34
|
+
|
|
35
|
+
#### Changes
|
|
36
|
+
|
|
37
|
+
- [l10n] Add Greek (el-GR) locale (#9293) @clytras
|
|
38
|
+
- [pickers] Add a `referenceDate` prop on `DateCalendar`, `MonthCalendar` and `YearCalendar` (#9260) @flaviendelangle
|
|
39
|
+
- [pickers] Close the calendar when a shortcut is selected (#9080) @flaviendelangle
|
|
40
|
+
- [pickers] Fix disabling for digital clock (#9300) @alexfauquette
|
|
41
|
+
|
|
42
|
+
### Docs
|
|
43
|
+
|
|
44
|
+
- [docs] Add header filters to the popular features demo (#9069) @MBilalShafi
|
|
45
|
+
- [docs] Fix `Date Calendar` dynamic data demo (#9290) @benzler
|
|
46
|
+
- [docs] Fix Data Grid header filter link (#9225) @oliviertassinari
|
|
47
|
+
- [docs] Fix missing docs version warning (#9221) @oliviertassinari
|
|
48
|
+
- [docs] Improve Chart overview (#9333) @oliviertassinari
|
|
49
|
+
- [docs] Improve Next.js license installation guide (#8975) @oliviertassinari
|
|
50
|
+
- [docs] Link pagination documentation to the migration guide (#9296) @MBilalShafi
|
|
51
|
+
- [docs] One step toward components -> slots (#9251) @oliviertassinari
|
|
52
|
+
- [docs] Improve and reorganize sections on editing page (#8431) @joserodolfofreitas
|
|
53
|
+
- [docs] Add clipboard paste to popular features demo (#9029) @cherniavskii
|
|
54
|
+
|
|
55
|
+
### Core
|
|
56
|
+
|
|
57
|
+
- [core] Polish event name (#9336) @oliviertassinari
|
|
58
|
+
- [core] Re-enable `Argos` CI step (#9301) @LukasTy
|
|
59
|
+
- [core] Upgrade Node.js to v18 on CircleCI, CodeSandbox and Netlify (#9319) @ZeeshanTamboli
|
|
60
|
+
- [core] Upgrade Node.js v18 for l10n GitHub CI (#9355) @ZeeshanTamboli
|
|
61
|
+
- [charts] Add demonstration pages based on Recharts demo (#9175) @alexfauquette
|
|
62
|
+
- [charts] Add legend (#9024) @alexfauquette
|
|
63
|
+
- [charts] Complete the docs to introduce charts (#9153) @alexfauquette
|
|
64
|
+
- [charts] Manage elements highlights (#9242) @alexfauquette
|
|
65
|
+
- [charts] Prefix subcomponents with `Charts` (#9314) @alexfauquette
|
|
66
|
+
- [license] Improve annual license expiration message (#9135) @oliviertassinari
|
|
67
|
+
|
|
68
|
+
## 6.7.0
|
|
69
|
+
|
|
70
|
+
_Jun 9, 2023_
|
|
71
|
+
|
|
72
|
+
We'd like to offer a big thanks to the 12 contributors who made this release possible. Here are some highlights ✨:
|
|
73
|
+
|
|
74
|
+
- 🎁 Improve the default `format` prop value on the pickers.
|
|
75
|
+
|
|
76
|
+
Here are a few examples:
|
|
77
|
+
|
|
78
|
+
```tsx
|
|
79
|
+
<TimePicker views={['hours', 'minutes', 'seconds']} ampm />
|
|
80
|
+
// Format before v6.7.0: `hh:mm aa`
|
|
81
|
+
// Format after v6.7.0: `hh:mm:ss aa`
|
|
82
|
+
|
|
83
|
+
<DatePicker views={['year']} />
|
|
84
|
+
// Format before v6.7.0: `MM/DD/YYYY`
|
|
85
|
+
// Format after v6.7.0: `YYYY`
|
|
86
|
+
|
|
87
|
+
<DateTimePicker views={['day', 'hours', 'minutes']} ampm />
|
|
88
|
+
// Format before v6.7.0: `MM/DD/YYYY hh:mm aa`
|
|
89
|
+
// Format after v6.7.0: `DD hh:mm aa`
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
- 🌍 Add Romanian (ro-RO) locale on the pickers
|
|
93
|
+
- 🌍 Improve German (de-DE) locale on the pickers
|
|
94
|
+
- 🌍 Improve Czech (cs-CZ), German (de-DE) and Turkish (tr-TR) locales on the data grid
|
|
95
|
+
- 🚀 Performance improvements
|
|
96
|
+
- 🐞 Bugfixes
|
|
97
|
+
- 📚 Documentation improvements
|
|
98
|
+
|
|
99
|
+
### `@mui/x-data-grid@v6.7.0` / `@mui/x-data-grid-pro@v6.7.0` / `@mui/x-data-grid-premium@v6.7.0`
|
|
100
|
+
|
|
101
|
+
#### Changes
|
|
102
|
+
|
|
103
|
+
- [DataGrid] Allow overflowing grid root element (#9179) @cherniavskii
|
|
104
|
+
- [DataGrid] Fix module augmentation error when using `@mui/lab` (#9235) @cherniavskii
|
|
105
|
+
- [DataGrid] Fix row with ids matching `Object` prototype (#9265) @romgrk
|
|
106
|
+
- [DataGrid] Fix `sortModel` and `filterModel` resetting when columns change (#9239) @alexgonch
|
|
107
|
+
- [DataGrid] Improve grouping performance for large datasets (#9200) @romgrk
|
|
108
|
+
- [DataGrid] Increase threshold to trigger memory leak warning (#9263) @m4theushw
|
|
109
|
+
- [DataGrid] Update data grid migration guide to include updated type (#9272) @MBilalShafi
|
|
110
|
+
- [DataGridPro] Improve header filter menu visuals (#9181) @MBilalShafi
|
|
111
|
+
- [DataGridPremium] Remove last line break on clipboard paste (#9163) @cherniavskii
|
|
112
|
+
- [l10n] Improve Czech (cs-CZ) locale (#9266) @MartinSkarpa
|
|
113
|
+
- [l10n] Improve German (de-DE) locale (#9259) @ximex
|
|
114
|
+
- [l10n] Improve Turkish (tr-TR) locale (#9237) @MCErtan
|
|
115
|
+
|
|
116
|
+
### `@mui/x-date-pickers@v6.7.0` / `@mui/x-date-pickers-pro@v6.7.0`
|
|
117
|
+
|
|
118
|
+
#### Changes
|
|
119
|
+
|
|
120
|
+
- [l10n] Add Romanian (ro-RO) locale (#9257) @ximex
|
|
121
|
+
- [l10n] Improve German (de-DE) locale (#9258) @ximex
|
|
122
|
+
- [pickers] Apply dynamic default format depending on views for all desktop and mobile pickers (#9126) @flaviendelangle
|
|
123
|
+
- [pickers] Update `DateRangePickerDay` props JSDoc (#9191) @stevus
|
|
124
|
+
|
|
125
|
+
### Docs
|
|
126
|
+
|
|
127
|
+
- [docs] Fix missing props on the `GridFilterPanel` API page (#9180) @cherniavskii
|
|
128
|
+
- [docs] Fix overview page typo (#9230) @LukasTy
|
|
129
|
+
- [docs] Fix version redirect (#9273) @alexfauquette
|
|
130
|
+
|
|
131
|
+
### Core
|
|
132
|
+
|
|
133
|
+
- [core] Temporarily remove the Argos upload on the regression testing (#9267) @flaviendelangle
|
|
134
|
+
- [charts] Add clip-path to avoid charts overflow (#9012) @alexfauquette
|
|
135
|
+
- [charts] Add style customization on bar (#8935) @alexfauquette
|
|
136
|
+
- [charts] Enforce axis `min`/`max` over the `nice()` method (#9189) @alexfauquette
|
|
137
|
+
- [charts] Improve axis label and ticks label alignements (#9190) @alexfauquette
|
|
138
|
+
- [charts] Simplify the switch between responsive and fix dimensions (#9151) @alexfauquette
|
|
139
|
+
|
|
6
140
|
## 6.6.0
|
|
7
141
|
|
|
8
142
|
_Jun 1, 2023_
|
|
@@ -11,7 +145,7 @@ We'd like to offer a big thanks to the 15 contributors who made this release pos
|
|
|
11
145
|
|
|
12
146
|
- 🚀 New date time picking UI on [`DesktopDateTimePicker`](https://mui.com/x/react-date-pickers/date-time-picker/)
|
|
13
147
|
|
|
14
|
-
<img src="https://
|
|
148
|
+
<img src="https://github.com/mui/mui-x/assets/3165635/4e1fe9f9-03eb-4f23-99dd-80212b21fb23" width="840" height="506" />
|
|
15
149
|
|
|
16
150
|
- 🚀 Performance improvements
|
|
17
151
|
- 🐞 Bugfixes
|
|
@@ -79,7 +213,7 @@ We'd like to offer a big thanks to the 15 contributors who made this release pos
|
|
|
79
213
|
- [charts] Manage series stacking (#8888) @alexfauquette
|
|
80
214
|
- [license] List side effects in the license package (#9092) @cherniavskii
|
|
81
215
|
|
|
82
|
-
##
|
|
216
|
+
## 6.5.0
|
|
83
217
|
|
|
84
218
|
_May 19, 2023_
|
|
85
219
|
|
|
@@ -87,9 +221,9 @@ We'd like to offer a big thanks to the 10 contributors who made this release pos
|
|
|
87
221
|
|
|
88
222
|
- 💫 Introduce filtering on column headers for `DataGridPro` and `DataGridPremium`:
|
|
89
223
|
|
|
90
|
-
https://github.com/mui/mui-x/
|
|
224
|
+
<img src="https://github.com/mui/mui-x/releases/download/v6.5.0/recording.gif" width="840" height="506" />
|
|
91
225
|
|
|
92
|
-
See [the documentation](https://mui.com/x/react-data-grid/filtering
|
|
226
|
+
See [the documentation](https://mui.com/x/react-data-grid/filtering/header-filters/) for more information
|
|
93
227
|
|
|
94
228
|
- 🌍 Improve Hebrew (he-IL) and Czech (cs-CZ) locales
|
|
95
229
|
- 📝 Support for editing on pinned rows
|
|
@@ -135,7 +269,7 @@ We'd like to offer a big thanks to the 10 contributors who made this release pos
|
|
|
135
269
|
- [DataGrid] Memoize root props for better performance (#8942) @romgrk
|
|
136
270
|
- [test] Skip flaky unit tests in JSDOM (#8994) @cherniavskii
|
|
137
271
|
|
|
138
|
-
##
|
|
272
|
+
## 6.4.0
|
|
139
273
|
|
|
140
274
|
_May 12, 2023_
|
|
141
275
|
|
|
@@ -4168,7 +4302,7 @@ We'd like to offer a big thanks to the 10 contributors who made this release pos
|
|
|
4168
4302
|
- [docs] Revise and split up "Overview" page into "Introduction" (#4692) @samuelsycamore
|
|
4169
4303
|
- [docs] Use `useKeepGroupedColumnsHiddren` from the grid package on remaining demo (#5382) @flaviendelangle
|
|
4170
4304
|
|
|
4171
|
-
##
|
|
4305
|
+
## 5.12.3
|
|
4172
4306
|
|
|
4173
4307
|
_Jun 23, 2022_
|
|
4174
4308
|
|
|
@@ -4219,7 +4353,7 @@ We'd like to offer a big thanks to the 8 contributors who made this release poss
|
|
|
4219
4353
|
- [test] Throw if date adapter is not found (#5289) @cherniavskii
|
|
4220
4354
|
- [test] Use mock for `ResizeObserver` (#5215) @m4theushw
|
|
4221
4355
|
|
|
4222
|
-
##
|
|
4356
|
+
## 5.12.2
|
|
4223
4357
|
|
|
4224
4358
|
_Jun 16, 2022_
|
|
4225
4359
|
|
|
@@ -4262,7 +4396,7 @@ We'd like to offer a big thanks to the 7 contributors who made this release poss
|
|
|
4262
4396
|
- [core] Fix `GridColTypeDef` usage in demo (#5197) @cherniavskii
|
|
4263
4397
|
- [test] Add `waitFor` before asserting height (#5203) @m4theushw
|
|
4264
4398
|
|
|
4265
|
-
##
|
|
4399
|
+
## 5.12.1
|
|
4266
4400
|
|
|
4267
4401
|
_Jun 9, 2022_
|
|
4268
4402
|
|
|
@@ -4319,7 +4453,7 @@ We'd like to offer a big thanks to the 10 contributors who made this release pos
|
|
|
4319
4453
|
- [test] Fix dynamic row height test failing on Chrome (#5147) @m4theushw
|
|
4320
4454
|
- [test] Remove delay on server demo for regression tests (#5131) @alexfauquette
|
|
4321
4455
|
|
|
4322
|
-
##
|
|
4456
|
+
## 5.12.0
|
|
4323
4457
|
|
|
4324
4458
|
_May 31, 2022_
|
|
4325
4459
|
|
|
@@ -4400,7 +4534,7 @@ We'd like to offer a big thanks to the 15 contributors who made this release pos
|
|
|
4400
4534
|
- [test] Skip Safari and Firefox on broken tests (#4994) @alexfauquette
|
|
4401
4535
|
- [test] Make argos screenshots stable (#5061) @m4theushw
|
|
4402
4536
|
|
|
4403
|
-
##
|
|
4537
|
+
## 5.11.1
|
|
4404
4538
|
|
|
4405
4539
|
_May 20, 2022_
|
|
4406
4540
|
|
|
@@ -4492,7 +4626,7 @@ We'd like to offer a big thanks to the 6 contributors who made this release poss
|
|
|
4492
4626
|
- [core] Simplify rows cache management (#4933) @flaviendelangle
|
|
4493
4627
|
- [core] Use internal icons for quick filter (#4912) @alexfauquette
|
|
4494
4628
|
|
|
4495
|
-
##
|
|
4629
|
+
## 5.11.0
|
|
4496
4630
|
|
|
4497
4631
|
_May 13, 2022_
|
|
4498
4632
|
|
|
@@ -4636,7 +4770,7 @@ We'd like to offer a big thanks to the 15 contributors who made this release pos
|
|
|
4636
4770
|
- [test] Reset cleanup tracking on Karma tests (#4679) @m4theushw
|
|
4637
4771
|
- [test] Restore `sinon` sandbox after each `karma` test (#4689) @m4theushw
|
|
4638
4772
|
|
|
4639
|
-
##
|
|
4773
|
+
## 5.10.0
|
|
4640
4774
|
|
|
4641
4775
|
_Apr 25, 2022_
|
|
4642
4776
|
|
|
@@ -4672,7 +4806,7 @@ We'd like to offer a big thanks to the 6 contributors who made this release poss
|
|
|
4672
4806
|
- [core] Fix the README of the X packages (#4590) @flaviendelangle
|
|
4673
4807
|
- [test] Fix test to not depend on screen resolution (#4587) @m4theushw
|
|
4674
4808
|
|
|
4675
|
-
##
|
|
4809
|
+
## 5.9.0
|
|
4676
4810
|
|
|
4677
4811
|
_Apr 14, 2022_
|
|
4678
4812
|
|
|
@@ -7,7 +7,6 @@ export interface GridHeaderFilterCellProps extends Pick<GridStateColDef, 'header
|
|
|
7
7
|
sortIndex?: number;
|
|
8
8
|
hasFocus?: boolean;
|
|
9
9
|
tabIndex: 0 | -1;
|
|
10
|
-
headerFilterComponent?: React.ReactNode;
|
|
11
10
|
filterOperators?: GridFilterOperator[];
|
|
12
11
|
width: number;
|
|
13
12
|
colDef: GridColDef;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["colIndex", "height", "hasFocus", "
|
|
3
|
+
const _excluded = ["colIndex", "height", "hasFocus", "filterOperators", "width", "headerClassName", "colDef", "item", "headerFilterMenuRef", "InputComponentProps", "showClearIcon"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
@@ -8,7 +8,7 @@ import { unstable_useForkRef as useForkRef, unstable_composeClasses as composeCl
|
|
|
8
8
|
import { gridVisibleColumnFieldsSelector, getDataGridUtilityClass } from '@mui/x-data-grid';
|
|
9
9
|
import { useGridPrivateApiContext, unstable_gridHeaderFilteringEditFieldSelector, unstable_gridHeaderFilteringMenuSelector, isNavigationKey } from '@mui/x-data-grid/internals';
|
|
10
10
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
11
|
-
import {
|
|
11
|
+
import { GridHeaderFilterMenuContainer } from './GridHeaderFilterMenuContainer';
|
|
12
12
|
import { GridHeaderFilterClearButton } from './GridHeaderFilterClearButton';
|
|
13
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
14
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -23,13 +23,17 @@ const useUtilityClasses = ownerState => {
|
|
|
23
23
|
};
|
|
24
24
|
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
25
25
|
};
|
|
26
|
+
const dateSx = {
|
|
27
|
+
[`& input[value=""]:not(:focus)`]: {
|
|
28
|
+
color: 'transparent'
|
|
29
|
+
}
|
|
30
|
+
};
|
|
26
31
|
const GridHeaderFilterCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
27
32
|
var _filterOperators$find, _currentOperator$head, _colDef$headerName;
|
|
28
33
|
const {
|
|
29
34
|
colIndex,
|
|
30
35
|
height,
|
|
31
36
|
hasFocus,
|
|
32
|
-
headerFilterComponent,
|
|
33
37
|
filterOperators,
|
|
34
38
|
width,
|
|
35
39
|
headerClassName,
|
|
@@ -61,6 +65,10 @@ const GridHeaderFilterCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
61
65
|
const clearFilterItem = React.useCallback(() => {
|
|
62
66
|
apiRef.current.deleteFilterItem(item);
|
|
63
67
|
}, [apiRef, item]);
|
|
68
|
+
let headerFilterComponent;
|
|
69
|
+
if (colDef.renderHeaderFilter) {
|
|
70
|
+
headerFilterComponent = colDef.renderHeaderFilter(props);
|
|
71
|
+
}
|
|
64
72
|
React.useLayoutEffect(() => {
|
|
65
73
|
if (hasFocus && !isMenuOpen) {
|
|
66
74
|
let focusableElement = cellRef.current.querySelector('[tabindex="0"]');
|
|
@@ -131,7 +139,8 @@ const GridHeaderFilterCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
131
139
|
const mouseEventsHandlers = React.useMemo(() => ({
|
|
132
140
|
onKeyDown: publish('headerFilterKeyDown', onKeyDown),
|
|
133
141
|
onClick: publish('headerFilterClick'),
|
|
134
|
-
onMouseDown: publish('headerFilterMouseDown', onMouseDown)
|
|
142
|
+
onMouseDown: publish('headerFilterMouseDown', onMouseDown),
|
|
143
|
+
onBlur: publish('headerFilterBlur')
|
|
135
144
|
}), [onMouseDown, onKeyDown, publish]);
|
|
136
145
|
const ownerState = _extends({}, rootProps, {
|
|
137
146
|
colDef
|
|
@@ -156,30 +165,35 @@ const GridHeaderFilterCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
156
165
|
"aria-colindex": colIndex + 1,
|
|
157
166
|
"aria-label": headerFilterComponent == null ? (_colDef$headerName = colDef.headerName) != null ? _colDef$headerName : colDef.field : undefined
|
|
158
167
|
}, other, mouseEventsHandlers, {
|
|
159
|
-
children: [headerFilterComponent, InputComponent && headerFilterComponent === undefined ? /*#__PURE__*/
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
168
|
+
children: [headerFilterComponent, InputComponent && headerFilterComponent === undefined ? /*#__PURE__*/_jsxs(React.Fragment, {
|
|
169
|
+
children: [/*#__PURE__*/_jsx(InputComponent, _extends({
|
|
170
|
+
apiRef: apiRef,
|
|
171
|
+
item: item,
|
|
172
|
+
inputRef: inputRef,
|
|
173
|
+
applyValue: applyFilterChanges,
|
|
174
|
+
onFocus: () => apiRef.current.startHeaderFilterEditMode(colDef.field),
|
|
175
|
+
onBlur: () => apiRef.current.stopHeaderFilterEditMode(),
|
|
176
|
+
label: capitalize(label),
|
|
177
|
+
placeholder: "",
|
|
178
|
+
isFilterActive: isFilterActive,
|
|
179
|
+
clearButton: showClearIcon && isApplied ? /*#__PURE__*/_jsx(GridHeaderFilterClearButton, {
|
|
180
|
+
onClick: clearFilterItem
|
|
181
|
+
}) : null,
|
|
182
|
+
disabled: isNoInputOperator,
|
|
183
|
+
tabIndex: -1,
|
|
184
|
+
InputLabelProps: null,
|
|
185
|
+
sx: colDef.type === 'date' || colDef.type === 'dateTime' ? dateSx : undefined
|
|
186
|
+
}, isNoInputOperator ? {
|
|
187
|
+
value: ''
|
|
188
|
+
} : {}, currentOperator == null ? void 0 : currentOperator.InputComponentProps, InputComponentProps)), /*#__PURE__*/_jsx(GridHeaderFilterMenuContainer, {
|
|
170
189
|
operators: filterOperators,
|
|
171
190
|
item: item,
|
|
172
191
|
field: colDef.field,
|
|
173
192
|
applyFilterChanges: applyFilterChanges,
|
|
174
193
|
headerFilterMenuRef: headerFilterMenuRef,
|
|
175
194
|
buttonRef: buttonRef
|
|
176
|
-
})
|
|
177
|
-
|
|
178
|
-
onClick: clearFilterItem
|
|
179
|
-
}) : null,
|
|
180
|
-
disabled: isNoInputOperator,
|
|
181
|
-
tabIndex: -1
|
|
182
|
-
}, currentOperator == null ? void 0 : currentOperator.InputComponentProps, InputComponentProps)) : null]
|
|
195
|
+
})]
|
|
196
|
+
}) : null]
|
|
183
197
|
}));
|
|
184
198
|
});
|
|
185
199
|
process.env.NODE_ENV !== "production" ? GridHeaderFilterCell.propTypes = {
|
|
@@ -204,7 +218,6 @@ process.env.NODE_ENV !== "production" ? GridHeaderFilterCell.propTypes = {
|
|
|
204
218
|
* Class name that will be added in the column header cell.
|
|
205
219
|
*/
|
|
206
220
|
headerClassName: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
|
|
207
|
-
headerFilterComponent: PropTypes.node,
|
|
208
221
|
headerFilterMenuRef: PropTypes.shape({
|
|
209
222
|
current: PropTypes.object
|
|
210
223
|
}).isRequired,
|
|
@@ -17,7 +17,7 @@ function GridHeaderFilterClearButton({
|
|
|
17
17
|
onClick: onClick,
|
|
18
18
|
sx: sx
|
|
19
19
|
}, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseIconButton, {
|
|
20
|
-
children: /*#__PURE__*/_jsx(rootProps.slots.
|
|
20
|
+
children: /*#__PURE__*/_jsx(rootProps.slots.columnMenuClearIcon, {
|
|
21
21
|
fontSize: "inherit"
|
|
22
22
|
})
|
|
23
23
|
}));
|
|
@@ -8,7 +8,10 @@ interface GridHeaderFilterMenuProps {
|
|
|
8
8
|
open: boolean;
|
|
9
9
|
id: string;
|
|
10
10
|
labelledBy: string;
|
|
11
|
-
|
|
11
|
+
target: HTMLElement | null;
|
|
12
|
+
}
|
|
13
|
+
declare function GridHeaderFilterMenu({ open, field, target, applyFilterChanges, operators, item, id, labelledBy, }: GridHeaderFilterMenuProps): React.JSX.Element | null;
|
|
14
|
+
declare namespace GridHeaderFilterMenu {
|
|
15
|
+
var propTypes: any;
|
|
12
16
|
}
|
|
13
|
-
declare function GridHeaderFilterMenu({ open, field, targetRef, applyFilterChanges, operators, item, id, labelledBy, }: GridHeaderFilterMenuProps): React.JSX.Element | null;
|
|
14
17
|
export { GridHeaderFilterMenu };
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
3
4
|
import MenuList from '@mui/material/MenuList';
|
|
4
5
|
import MenuItem from '@mui/material/MenuItem';
|
|
5
|
-
import
|
|
6
|
-
import ListItemText from '@mui/material/ListItemText';
|
|
7
|
-
import { unstable_capitalize as capitalize } from '@mui/utils';
|
|
6
|
+
import { unstable_capitalize as capitalize, HTMLElementType } from '@mui/utils';
|
|
8
7
|
import { useGridApiContext, GridMenu } from '@mui/x-data-grid';
|
|
9
|
-
import { OPERATOR_SYMBOL_MAPPING } from './constants';
|
|
10
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
9
|
function GridHeaderFilterMenu({
|
|
13
10
|
open,
|
|
14
11
|
field,
|
|
15
|
-
|
|
12
|
+
target,
|
|
16
13
|
applyFilterChanges,
|
|
17
14
|
operators,
|
|
18
15
|
item,
|
|
@@ -31,13 +28,13 @@ function GridHeaderFilterMenu({
|
|
|
31
28
|
hideMenu();
|
|
32
29
|
}
|
|
33
30
|
}, [hideMenu]);
|
|
34
|
-
if (!
|
|
31
|
+
if (!target) {
|
|
35
32
|
return null;
|
|
36
33
|
}
|
|
37
34
|
return /*#__PURE__*/_jsx(GridMenu, {
|
|
38
|
-
placement: "bottom-
|
|
35
|
+
placement: "bottom-end",
|
|
39
36
|
open: open,
|
|
40
|
-
target:
|
|
37
|
+
target: target,
|
|
41
38
|
onClickAway: hideMenu,
|
|
42
39
|
onExited: hideMenu,
|
|
43
40
|
children: /*#__PURE__*/_jsx(MenuList, {
|
|
@@ -47,7 +44,7 @@ function GridHeaderFilterMenu({
|
|
|
47
44
|
children: operators.map((op, i) => {
|
|
48
45
|
var _op$headerLabel;
|
|
49
46
|
const label = (_op$headerLabel = op == null ? void 0 : op.headerLabel) != null ? _op$headerLabel : apiRef.current.getLocaleText(`headerFilterOperator${capitalize(op.value)}`);
|
|
50
|
-
return /*#__PURE__*/
|
|
47
|
+
return /*#__PURE__*/_jsx(MenuItem, {
|
|
51
48
|
onClick: () => {
|
|
52
49
|
applyFilterChanges(_extends({}, item, {
|
|
53
50
|
operator: op.value
|
|
@@ -56,14 +53,38 @@ function GridHeaderFilterMenu({
|
|
|
56
53
|
},
|
|
57
54
|
autoFocus: i === 0 ? open : false,
|
|
58
55
|
selected: op.value === item.operator,
|
|
59
|
-
children:
|
|
60
|
-
children: OPERATOR_SYMBOL_MAPPING[op.value]
|
|
61
|
-
}), /*#__PURE__*/_jsx(ListItemText, {
|
|
62
|
-
children: label
|
|
63
|
-
})]
|
|
56
|
+
children: label
|
|
64
57
|
}, `${field}-${op.value}`);
|
|
65
58
|
})
|
|
66
59
|
})
|
|
67
60
|
});
|
|
68
61
|
}
|
|
62
|
+
process.env.NODE_ENV !== "production" ? GridHeaderFilterMenu.propTypes = {
|
|
63
|
+
// ----------------------------- Warning --------------------------------
|
|
64
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
65
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
66
|
+
// ----------------------------------------------------------------------
|
|
67
|
+
applyFilterChanges: PropTypes.func.isRequired,
|
|
68
|
+
field: PropTypes.string.isRequired,
|
|
69
|
+
id: PropTypes.string.isRequired,
|
|
70
|
+
item: PropTypes.shape({
|
|
71
|
+
field: PropTypes.string.isRequired,
|
|
72
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
73
|
+
operator: PropTypes.string.isRequired,
|
|
74
|
+
value: PropTypes.any
|
|
75
|
+
}).isRequired,
|
|
76
|
+
labelledBy: PropTypes.string.isRequired,
|
|
77
|
+
open: PropTypes.bool.isRequired,
|
|
78
|
+
operators: PropTypes.arrayOf(PropTypes.shape({
|
|
79
|
+
getApplyFilterFn: PropTypes.func.isRequired,
|
|
80
|
+
getValueAsString: PropTypes.func,
|
|
81
|
+
headerLabel: PropTypes.string,
|
|
82
|
+
InputComponent: PropTypes.elementType,
|
|
83
|
+
InputComponentProps: PropTypes.object,
|
|
84
|
+
label: PropTypes.string,
|
|
85
|
+
requiresFilterValue: PropTypes.bool,
|
|
86
|
+
value: PropTypes.string.isRequired
|
|
87
|
+
})).isRequired,
|
|
88
|
+
target: HTMLElementType
|
|
89
|
+
} : void 0;
|
|
69
90
|
export { GridHeaderFilterMenu };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { GridFilterItem, GridFilterOperator, GridColDef } from '@mui/x-data-grid';
|
|
3
|
-
declare function
|
|
3
|
+
declare function GridHeaderFilterMenuContainer(props: {
|
|
4
4
|
operators: GridFilterOperator<any, any, any>[];
|
|
5
5
|
field: GridColDef['field'];
|
|
6
6
|
item: GridFilterItem;
|
|
@@ -8,7 +8,7 @@ declare function GridHeaderFilterAdornment(props: {
|
|
|
8
8
|
headerFilterMenuRef: React.MutableRefObject<HTMLButtonElement | null>;
|
|
9
9
|
buttonRef: React.Ref<HTMLButtonElement>;
|
|
10
10
|
}): React.JSX.Element | null;
|
|
11
|
-
declare namespace
|
|
11
|
+
declare namespace GridHeaderFilterMenuContainer {
|
|
12
12
|
var propTypes: any;
|
|
13
13
|
}
|
|
14
|
-
export {
|
|
14
|
+
export { GridHeaderFilterMenuContainer };
|
|
@@ -7,15 +7,15 @@ import { useGridApiContext } from '@mui/x-data-grid';
|
|
|
7
7
|
import { unstable_useId as useId } from '@mui/utils';
|
|
8
8
|
import { unstable_gridHeaderFilteringMenuSelector } from '@mui/x-data-grid/internals';
|
|
9
9
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
10
|
-
import { OPERATOR_SYMBOL_MAPPING } from './constants';
|
|
11
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
11
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
12
|
const sx = {
|
|
14
13
|
width: 22,
|
|
15
14
|
height: 22,
|
|
16
|
-
|
|
15
|
+
margin: 'auto 0 10px 5px'
|
|
17
16
|
};
|
|
18
|
-
function
|
|
17
|
+
function GridHeaderFilterMenuContainer(props) {
|
|
18
|
+
var _rootProps$slotProps;
|
|
19
19
|
const {
|
|
20
20
|
operators,
|
|
21
21
|
item,
|
|
@@ -37,35 +37,34 @@ function GridHeaderFilterAdornment(props) {
|
|
|
37
37
|
return null;
|
|
38
38
|
}
|
|
39
39
|
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
40
|
-
children: [/*#__PURE__*/_jsx(rootProps.slots.
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}), /*#__PURE__*/_jsx(rootProps.slots.headerFilterMenu, _extends({
|
|
40
|
+
children: [/*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({
|
|
41
|
+
id: buttonId,
|
|
42
|
+
ref: buttonRef,
|
|
43
|
+
"aria-label": apiRef.current.getLocaleText('filterPanelOperator'),
|
|
44
|
+
title: apiRef.current.getLocaleText('filterPanelOperator'),
|
|
45
|
+
"aria-controls": menuId,
|
|
46
|
+
"aria-expanded": open ? 'true' : undefined,
|
|
47
|
+
"aria-haspopup": "true",
|
|
48
|
+
tabIndex: -1,
|
|
49
|
+
size: "small",
|
|
50
|
+
onClick: handleClick,
|
|
51
|
+
sx: sx
|
|
52
|
+
}, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseIconButton, {
|
|
53
|
+
children: /*#__PURE__*/_jsx(rootProps.slots.openFilterButtonIcon, {
|
|
54
|
+
fontSize: "small"
|
|
55
|
+
})
|
|
56
|
+
})), /*#__PURE__*/_jsx(rootProps.slots.headerFilterMenu, _extends({
|
|
58
57
|
field: field,
|
|
59
58
|
open: open,
|
|
60
59
|
item: item,
|
|
61
|
-
|
|
60
|
+
target: headerFilterMenuRef.current,
|
|
62
61
|
operators: operators,
|
|
63
62
|
labelledBy: buttonId,
|
|
64
63
|
id: menuId
|
|
65
64
|
}, others))]
|
|
66
65
|
});
|
|
67
66
|
}
|
|
68
|
-
process.env.NODE_ENV !== "production" ?
|
|
67
|
+
process.env.NODE_ENV !== "production" ? GridHeaderFilterMenuContainer.propTypes = {
|
|
69
68
|
// ----------------------------- Warning --------------------------------
|
|
70
69
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
71
70
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
@@ -95,4 +94,4 @@ process.env.NODE_ENV !== "production" ? GridHeaderFilterAdornment.propTypes = {
|
|
|
95
94
|
value: PropTypes.string.isRequired
|
|
96
95
|
})).isRequired
|
|
97
96
|
} : void 0;
|
|
98
|
-
export {
|
|
97
|
+
export { GridHeaderFilterMenuContainer };
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './GridHeaderFilterCell';
|
|
1
|
+
export * from './GridHeaderFilterMenuContainer';
|
|
2
|
+
export * from './GridHeaderFilterCell';
|
|
3
|
+
export * from './GridHeaderFilterMenu';
|