@mui/x-data-grid 6.14.0 → 6.16.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 +167 -0
- package/DataGrid/useDataGridComponent.js +43 -40
- package/components/DataGridVirtualScroller.d.ts +1 -4
- package/components/DataGridVirtualScroller.js +3 -5
- package/components/GridRow.js +4 -2
- package/components/base/GridBody.d.ts +0 -1
- package/components/base/GridBody.js +2 -22
- package/components/cell/GridActionsCell.js +2 -2
- package/components/cell/GridActionsCellItem.d.ts +6 -0
- package/components/cell/GridCell.js +4 -2
- package/components/columnHeaders/GridColumnHeaderItem.js +2 -1
- package/components/menu/GridMenu.d.ts +1 -2
- package/components/menu/GridMenu.js +21 -5
- package/components/menu/columnMenu/GridColumnHeaderMenu.js +11 -8
- package/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/components/panel/filterPanel/GridFilterInputSingleSelect.js +1 -1
- package/components/toolbar/GridToolbarDensitySelector.js +2 -7
- package/components/toolbar/GridToolbarExportContainer.js +1 -9
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +6 -3
- package/hooks/features/export/useGridPrintExport.js +37 -7
- package/hooks/features/filter/gridFilterUtils.js +10 -6
- package/hooks/features/focus/useGridFocus.js +0 -1
- package/hooks/features/index.d.ts +1 -0
- package/hooks/features/index.js +2 -1
- package/hooks/features/virtualization/gridVirtualizationSelectors.d.ts +16 -0
- package/hooks/features/virtualization/gridVirtualizationSelectors.js +18 -0
- package/hooks/features/virtualization/index.d.ts +2 -0
- package/hooks/features/virtualization/index.js +2 -0
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +0 -1
- package/hooks/features/virtualization/useGridVirtualScroller.js +53 -36
- package/hooks/features/virtualization/useGridVirtualization.d.ts +12 -0
- package/hooks/features/virtualization/useGridVirtualization.js +47 -0
- package/index.js +1 -1
- package/internals/index.d.ts +4 -0
- package/internals/index.js +4 -0
- package/legacy/DataGrid/useDataGridComponent.js +43 -40
- package/legacy/components/DataGridVirtualScroller.js +2 -4
- package/legacy/components/GridRow.js +4 -2
- package/legacy/components/base/GridBody.js +2 -26
- package/legacy/components/cell/GridActionsCell.js +2 -2
- package/legacy/components/cell/GridCell.js +4 -2
- package/legacy/components/columnHeaders/GridColumnHeaderItem.js +2 -1
- package/legacy/components/menu/GridMenu.js +21 -5
- package/legacy/components/menu/columnMenu/GridColumnHeaderMenu.js +11 -8
- package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +2 -1
- package/legacy/components/panel/filterPanel/GridFilterInputSingleSelect.js +2 -1
- package/legacy/components/toolbar/GridToolbarDensitySelector.js +2 -7
- package/legacy/components/toolbar/GridToolbarExportContainer.js +1 -9
- package/legacy/hooks/features/columnHeaders/useGridColumnHeaders.js +6 -3
- package/legacy/hooks/features/export/useGridPrintExport.js +44 -12
- package/legacy/hooks/features/filter/gridFilterUtils.js +10 -6
- package/legacy/hooks/features/focus/useGridFocus.js +0 -1
- package/legacy/hooks/features/index.js +2 -1
- package/legacy/hooks/features/virtualization/gridVirtualizationSelectors.js +24 -0
- package/legacy/hooks/features/virtualization/index.js +2 -0
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +61 -39
- package/legacy/hooks/features/virtualization/useGridVirtualization.js +51 -0
- package/legacy/index.js +1 -1
- package/legacy/internals/index.js +4 -0
- package/legacy/locales/ruRU.js +26 -28
- package/legacy/models/api/index.js +1 -2
- package/legacy/utils/createControllablePromise.js +11 -0
- package/locales/ruRU.js +26 -28
- package/models/api/gridApiCommon.d.ts +3 -4
- package/models/api/gridVirtualizationApi.d.ts +20 -0
- package/models/api/index.d.ts +1 -2
- package/models/api/index.js +1 -2
- package/models/events/gridEventLookup.d.ts +8 -0
- package/models/gridExport.d.ts +17 -4
- package/models/gridStateCommunity.d.ts +2 -1
- package/models/index.d.ts +1 -1
- package/modern/DataGrid/useDataGridComponent.js +43 -40
- package/modern/components/DataGridVirtualScroller.js +3 -5
- package/modern/components/GridRow.js +4 -2
- package/modern/components/base/GridBody.js +2 -22
- package/modern/components/cell/GridActionsCell.js +2 -2
- package/modern/components/cell/GridCell.js +4 -2
- package/modern/components/columnHeaders/GridColumnHeaderItem.js +2 -1
- package/modern/components/menu/GridMenu.js +20 -5
- package/modern/components/menu/columnMenu/GridColumnHeaderMenu.js +11 -8
- package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +1 -1
- package/modern/components/toolbar/GridToolbarDensitySelector.js +2 -7
- package/modern/components/toolbar/GridToolbarExportContainer.js +1 -9
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +6 -3
- package/modern/hooks/features/export/useGridPrintExport.js +37 -7
- package/modern/hooks/features/filter/gridFilterUtils.js +10 -6
- package/modern/hooks/features/focus/useGridFocus.js +0 -1
- package/modern/hooks/features/index.js +2 -1
- package/modern/hooks/features/virtualization/gridVirtualizationSelectors.js +18 -0
- package/modern/hooks/features/virtualization/index.js +2 -0
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +52 -36
- package/modern/hooks/features/virtualization/useGridVirtualization.js +47 -0
- package/modern/index.js +1 -1
- package/modern/internals/index.js +4 -0
- package/modern/locales/ruRU.js +26 -28
- package/modern/models/api/index.js +1 -2
- package/modern/utils/createControllablePromise.js +11 -0
- package/node/DataGrid/useDataGridComponent.js +43 -40
- package/node/components/DataGridVirtualScroller.js +3 -5
- package/node/components/GridRow.js +4 -2
- package/node/components/base/GridBody.js +2 -22
- package/node/components/cell/GridActionsCell.js +2 -2
- package/node/components/cell/GridCell.js +4 -2
- package/node/components/columnHeaders/GridColumnHeaderItem.js +2 -1
- package/node/components/menu/GridMenu.js +19 -4
- package/node/components/menu/columnMenu/GridColumnHeaderMenu.js +10 -7
- package/node/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +1 -1
- package/node/components/toolbar/GridToolbarDensitySelector.js +2 -7
- package/node/components/toolbar/GridToolbarExportContainer.js +1 -9
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +8 -5
- package/node/hooks/features/export/useGridPrintExport.js +37 -7
- package/node/hooks/features/filter/gridFilterUtils.js +9 -6
- package/node/hooks/features/focus/useGridFocus.js +0 -1
- package/node/hooks/features/index.js +11 -0
- package/node/hooks/features/virtualization/gridVirtualizationSelectors.js +27 -0
- package/node/hooks/features/virtualization/index.js +27 -0
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +51 -37
- package/node/hooks/features/virtualization/useGridVirtualization.js +58 -0
- package/node/index.js +1 -1
- package/node/internals/index.js +44 -0
- package/node/locales/ruRU.js +26 -28
- package/node/models/api/index.js +4 -15
- package/node/utils/createControllablePromise.js +17 -0
- package/package.json +1 -1
- package/utils/createControllablePromise.d.ts +5 -0
- package/utils/createControllablePromise.js +11 -0
- package/models/api/gridDisableVirtualizationApi.d.ts +0 -15
- package/models/api/gridVirtualScrollerApi.d.ts +0 -8
- package/models/api/gridVirtualScrollerApi.js +0 -1
- package/modern/models/api/gridDisableVirtualizationApi.js +0 -1
- package/modern/models/api/gridVirtualScrollerApi.js +0 -1
- package/node/models/api/gridVirtualScrollerApi.js +0 -5
- /package/legacy/models/api/{gridDisableVirtualizationApi.js → gridVirtualizationApi.js} +0 -0
- /package/{legacy/models/api/gridVirtualScrollerApi.js → models/api/gridVirtualizationApi.js} +0 -0
- /package/{models/api/gridDisableVirtualizationApi.js → modern/models/api/gridVirtualizationApi.js} +0 -0
- /package/node/models/api/{gridDisableVirtualizationApi.js → gridVirtualizationApi.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,173 @@
|
|
|
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.16.0
|
|
7
|
+
|
|
8
|
+
_Sep 29, 2023_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 9 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🎁 Add a clearable behavior to all the single input pickers and fields (#9095) @noraleonte
|
|
13
|
+
|
|
14
|
+
The pickers and fields now have an out-of-the box implementation for clearing the field value. You can see the documentation for this behavior on the [Date Picker documentation](https://mui.com/x/react-date-pickers/date-picker/#clearing-the-value).
|
|
15
|
+
|
|
16
|
+
<img width="380" alt="Clearable behavior" src="https://github.com/mui/mui-x/assets/72460825/e4a66169-83b5-4579-b9f6-6e15bb528411">
|
|
17
|
+
|
|
18
|
+
- 💫 Add Date Picker customization playground (#9581) @noraleonte
|
|
19
|
+
|
|
20
|
+
You can play around with style customization options on the [Date Picker documentation](https://mui.com/x/react-date-pickers/date-picker/#customization).
|
|
21
|
+
|
|
22
|
+
We are thrilled to hear your feedback about this functionality!
|
|
23
|
+
|
|
24
|
+
- 🚀 Fix header filters menu auto closing on render (#10483) @MBilalShafi
|
|
25
|
+
- 🎯 Fix column headers scroll when theme scoping is used (#10437) @cherniavskii
|
|
26
|
+
- 🌍 Improve Russian (ru-RU) locale on the data grid
|
|
27
|
+
- 🐞 Bugfixes
|
|
28
|
+
- 📚 Documentation improvements
|
|
29
|
+
|
|
30
|
+
### Data Grid
|
|
31
|
+
|
|
32
|
+
#### `@mui/x-data-grid@6.16.0`
|
|
33
|
+
|
|
34
|
+
- [DataGrid] Fix column headers scroll when theme scoping is used (#10437) @cherniavskii
|
|
35
|
+
- [DataGrid] Rename `global` to `globalScope` due to Jest issue (#10470) @romgrk
|
|
36
|
+
- [l10n] Improve Russian (ru-RU) locale (#10464 and #10407) @NKodos
|
|
37
|
+
|
|
38
|
+
#### `@mui/x-data-grid-pro@6.16.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
39
|
+
|
|
40
|
+
Same changes as in `@mui/x-data-grid@6.16.0`, plus:
|
|
41
|
+
|
|
42
|
+
- [DataGridPro] Fix header filters menu auto closing on render (#10483) @MBilalShafi
|
|
43
|
+
|
|
44
|
+
#### `@mui/x-data-grid-premium@6.16.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
45
|
+
|
|
46
|
+
Same changes as in `@mui/x-data-grid-pro@6.16.0`.
|
|
47
|
+
|
|
48
|
+
### Date Pickers
|
|
49
|
+
|
|
50
|
+
#### `@mui/x-date-pickers@6.16.0`
|
|
51
|
+
|
|
52
|
+
- [pickers] Add warning to `shouldDisableDate` validation (#10502) @michelengelen
|
|
53
|
+
- [pickers] Implement `clearable` field behavior (#9095) @noraleonte
|
|
54
|
+
- [pickers] Refactor `dayOfWeekFormatter` (#10345) @michelengelen
|
|
55
|
+
|
|
56
|
+
#### `@mui/x-date-pickers-pro@6.16.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
57
|
+
|
|
58
|
+
Same changes as in `@mui/x-date-pickers@6.16.0`.
|
|
59
|
+
|
|
60
|
+
### Charts / `@mui/x-charts@6.0.0-alpha.13`
|
|
61
|
+
|
|
62
|
+
- [charts] Share upfront future Pro features (#10465) @oliviertassinari
|
|
63
|
+
|
|
64
|
+
### Tree View / `@mui/x-tree-view@6.0.0-beta.0`
|
|
65
|
+
|
|
66
|
+
- [TreeView] Do not try to focus a collapsed node when re-focusing the TreeView (#10422) @flaviendelangle
|
|
67
|
+
- [TreeView] Fix the typing of the `Multiple` generic (#10478) @flaviendelangle
|
|
68
|
+
|
|
69
|
+
### Docs
|
|
70
|
+
|
|
71
|
+
- [docs] Correct the typo in data grid api docs (#10477) @MBilalShafi
|
|
72
|
+
- [docs] Add customization playground (#9581) @noraleonte
|
|
73
|
+
- [docs] Fix Tree View product ID (#10428) @oliviertassinari
|
|
74
|
+
- [docs] Fix demo crashing when all rows are deleted (#10438) @cherniavskii
|
|
75
|
+
- [docs] Fix mobile scrollbar column resize (#10455) @oliviertassinari
|
|
76
|
+
- [docs] Fix usage of `GridRenderCellParams` interface (#10435) @cherniavskii
|
|
77
|
+
|
|
78
|
+
### Core
|
|
79
|
+
|
|
80
|
+
- [core] Fix typo in header data grid quick filter @oliviertassinari
|
|
81
|
+
- [core] Group D3 renovate PRs (#10480) @flaviendelangle
|
|
82
|
+
- [core] Link the priority support page (#10495) @michelengelen
|
|
83
|
+
- [core] Move the pickers describes to the test utils folder (#10490) @flaviendelangle
|
|
84
|
+
- [core] Priority Support casing normalization @oliviertassinari
|
|
85
|
+
- [core] Remove automated DataGrid performance tests (#10414) @romgrk
|
|
86
|
+
- [core] Sync `prism-okaidia.css` with docs-infra @oliviertassinari
|
|
87
|
+
- [core] Update issue actions & templates (#10375) @romgrk
|
|
88
|
+
- [core] Update release guide (#10468) @DanailH
|
|
89
|
+
|
|
90
|
+
## 6.15.0
|
|
91
|
+
|
|
92
|
+
_Sep 22, 2023_
|
|
93
|
+
|
|
94
|
+
We'd like to offer a big thanks to the 9 contributors who made this release possible. Here are some highlights ✨:
|
|
95
|
+
|
|
96
|
+
- 🚀 Implement columns auto-sizing (#10180) @romgrk
|
|
97
|
+
- 🎁 Add support for `getRowsToExport` option to print export on the data grid (#10084) @zreecespieces
|
|
98
|
+
- 🌍 Improve Finnish (fi-FI) locale
|
|
99
|
+
- 🐞 Bugfixes
|
|
100
|
+
- 📚 Documentation improvements
|
|
101
|
+
|
|
102
|
+
### Data Grid
|
|
103
|
+
|
|
104
|
+
#### `@mui/x-data-grid@6.15.0`
|
|
105
|
+
|
|
106
|
+
- [DataGrid] Add support for `getRowsToExport` option to print export (#10084) @zreecespieces
|
|
107
|
+
- [DataGrid] Fix dev warning about `InputLabelProps` (#10413) @romgrk
|
|
108
|
+
- [DataGrid] Refactor `GridMenu` prop `onClickAway` to `onClose` (#10411) @romgrk
|
|
109
|
+
- [DataGrid] Restore focus after `GridMenu` closes (#10412) @romgrk
|
|
110
|
+
- [DataGrid] Fix typing of `GridActionsCellItem` (#10344) @romgrk
|
|
111
|
+
- [DataGrid] Hide `eval` from bundlers (#10329) @romgrk
|
|
112
|
+
- [DataGrid] Add `border: 0` to unmounted focused cell to avoid layout shifts in that row (#10318) @lauri865
|
|
113
|
+
|
|
114
|
+
#### `@mui/x-data-grid-pro@6.15.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
115
|
+
|
|
116
|
+
Same changes as in `@mui/x-data-grid@6.15.0`, plus:
|
|
117
|
+
|
|
118
|
+
- [DataGridPro] Implement columns auto-sizing (#10180) @romgrk
|
|
119
|
+
- [DataGridPro] Fix keyboard navigation issue in header filters (#10358) @MBilalShafi
|
|
120
|
+
- [DataGridPro] Add missing row hover styles (#10252) @cherniavskii
|
|
121
|
+
- [DataGridPro] Make default filter items have stable references in header filters (#10338) @MBilalShafi
|
|
122
|
+
|
|
123
|
+
#### `@mui/x-data-grid-premium@6.15.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
124
|
+
|
|
125
|
+
Same changes as in `@mui/x-data-grid-pro@6.15.0`.
|
|
126
|
+
|
|
127
|
+
### Date Pickers
|
|
128
|
+
|
|
129
|
+
#### `@mui/x-date-pickers@6.15.0`
|
|
130
|
+
|
|
131
|
+
- [pickers] Support tokens without spaces (#10185) @alexfauquette
|
|
132
|
+
- [l10n] Improve Finnish (fi-FI) locale (#10346) @samijouppila
|
|
133
|
+
|
|
134
|
+
#### `@mui/x-date-pickers-pro@6.15.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
135
|
+
|
|
136
|
+
Same changes as in `@mui/x-date-pickers@6.15.0`.
|
|
137
|
+
|
|
138
|
+
### Charts / `@mui/x-charts@6.0.0-alpha.12`
|
|
139
|
+
|
|
140
|
+
- [charts] Fix sparkline scale and rendering (#10402) @alexfauquette
|
|
141
|
+
- [charts] Remove components from `@mui/material` (#10115) @alexfauquette
|
|
142
|
+
|
|
143
|
+
### Tree View / `@mui/x-tree-view@6.0.0-alpha.4`
|
|
144
|
+
|
|
145
|
+
- [TreeView] Split features into plugins to prepare for Pro version (#10123) @flaviendelangle
|
|
146
|
+
|
|
147
|
+
### Docs
|
|
148
|
+
|
|
149
|
+
- [docs] Add charts documentation pages to complete pricing table (#10394) @alexfauquette
|
|
150
|
+
- [docs] Add missing MIT packages on the Licensing page (#10348) @flaviendelangle
|
|
151
|
+
- [docs] Clearer component pattern @oliviertassinari
|
|
152
|
+
- [docs] Easier to understand demo (#10370) @oliviertassinari
|
|
153
|
+
- [docs] Fix `301` to Material UI @oliviertassinari
|
|
154
|
+
- [docs] Improve the column visibility section (#10327) @MBilalShafi
|
|
155
|
+
- [docs] Improve the documentation section `rowIdentifier` (#10326) @MBilalShafi
|
|
156
|
+
- [docs] Improve pickers localization documentation (#10202) @flaviendelangle
|
|
157
|
+
- [docs] Polish typescript ref usage (#10359) @oliviertassinari
|
|
158
|
+
- [docs] Improve charts tooltip wording (#10406) @alexfauquette
|
|
159
|
+
|
|
160
|
+
### Core
|
|
161
|
+
|
|
162
|
+
- [core] Cleanup GitHub issues template (#10372) @romgrk
|
|
163
|
+
- [core] Fix Circle CI OOM (#10385) @romgrk
|
|
164
|
+
- [core] Improve sleep test helper @oliviertassinari
|
|
165
|
+
- [core] Remove unwanted prefixes @oliviertassinari
|
|
166
|
+
- [core] Remove duplicate label @oliviertassinari
|
|
167
|
+
- [core] Simplify source @oliviertassinari
|
|
168
|
+
- [core] Upgrade monorepo (#10425) @cherniavskii
|
|
169
|
+
- [core] Upgrade monorepo to have the new typescript-to-proptype (#10224) @flaviendelangle
|
|
170
|
+
- [test] Do not use deprecated adapter methods (#10416) @flaviendelangle
|
|
171
|
+
- [test] Name test suites according to sentence case (#10429) @alexfauquette
|
|
172
|
+
|
|
6
173
|
## 6.14.0
|
|
7
174
|
|
|
8
175
|
_Sep 14, 2023_
|
|
@@ -25,53 +25,56 @@ import { rowsMetaStateInitializer, useGridRowsMeta } from '../hooks/features/row
|
|
|
25
25
|
import { useGridStatePersistence } from '../hooks/features/statePersistence/useGridStatePersistence';
|
|
26
26
|
import { useGridColumnSpanning } from '../hooks/features/columns/useGridColumnSpanning';
|
|
27
27
|
import { useGridColumnGrouping, columnGroupsStateInitializer } from '../hooks/features/columnGrouping/useGridColumnGrouping';
|
|
28
|
+
import { useGridVirtualization, virtualizationStateInitializer } from '../hooks/features/virtualization';
|
|
28
29
|
export const useDataGridComponent = (inputApiRef, props) => {
|
|
29
|
-
const
|
|
30
|
+
const apiRef = useGridInitialization(inputApiRef, props);
|
|
30
31
|
|
|
31
32
|
/**
|
|
32
33
|
* Register all pre-processors called during state initialization here.
|
|
33
34
|
*/
|
|
34
|
-
useGridRowSelectionPreProcessors(
|
|
35
|
-
useGridRowsPreProcessors(
|
|
35
|
+
useGridRowSelectionPreProcessors(apiRef, props);
|
|
36
|
+
useGridRowsPreProcessors(apiRef);
|
|
36
37
|
|
|
37
38
|
/**
|
|
38
39
|
* Register all state initializers here.
|
|
39
40
|
*/
|
|
40
|
-
useGridInitializeState(rowSelectionStateInitializer,
|
|
41
|
-
useGridInitializeState(columnsStateInitializer,
|
|
42
|
-
useGridInitializeState(rowsStateInitializer,
|
|
43
|
-
useGridInitializeState(editingStateInitializer,
|
|
44
|
-
useGridInitializeState(focusStateInitializer,
|
|
45
|
-
useGridInitializeState(sortingStateInitializer,
|
|
46
|
-
useGridInitializeState(preferencePanelStateInitializer,
|
|
47
|
-
useGridInitializeState(filterStateInitializer,
|
|
48
|
-
useGridInitializeState(densityStateInitializer,
|
|
49
|
-
useGridInitializeState(paginationStateInitializer,
|
|
50
|
-
useGridInitializeState(rowsMetaStateInitializer,
|
|
51
|
-
useGridInitializeState(columnMenuStateInitializer,
|
|
52
|
-
useGridInitializeState(columnGroupsStateInitializer,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
41
|
+
useGridInitializeState(rowSelectionStateInitializer, apiRef, props);
|
|
42
|
+
useGridInitializeState(columnsStateInitializer, apiRef, props);
|
|
43
|
+
useGridInitializeState(rowsStateInitializer, apiRef, props);
|
|
44
|
+
useGridInitializeState(editingStateInitializer, apiRef, props);
|
|
45
|
+
useGridInitializeState(focusStateInitializer, apiRef, props);
|
|
46
|
+
useGridInitializeState(sortingStateInitializer, apiRef, props);
|
|
47
|
+
useGridInitializeState(preferencePanelStateInitializer, apiRef, props);
|
|
48
|
+
useGridInitializeState(filterStateInitializer, apiRef, props);
|
|
49
|
+
useGridInitializeState(densityStateInitializer, apiRef, props);
|
|
50
|
+
useGridInitializeState(paginationStateInitializer, apiRef, props);
|
|
51
|
+
useGridInitializeState(rowsMetaStateInitializer, apiRef, props);
|
|
52
|
+
useGridInitializeState(columnMenuStateInitializer, apiRef, props);
|
|
53
|
+
useGridInitializeState(columnGroupsStateInitializer, apiRef, props);
|
|
54
|
+
useGridInitializeState(virtualizationStateInitializer, apiRef, props);
|
|
55
|
+
useGridKeyboardNavigation(apiRef, props);
|
|
56
|
+
useGridRowSelection(apiRef, props);
|
|
57
|
+
useGridColumns(apiRef, props);
|
|
58
|
+
useGridRows(apiRef, props);
|
|
59
|
+
useGridParamsApi(apiRef, props);
|
|
60
|
+
useGridColumnSpanning(apiRef);
|
|
61
|
+
useGridColumnGrouping(apiRef, props);
|
|
62
|
+
useGridEditing(apiRef, props);
|
|
63
|
+
useGridFocus(apiRef, props);
|
|
64
|
+
useGridPreferencesPanel(apiRef, props);
|
|
65
|
+
useGridFilter(apiRef, props);
|
|
66
|
+
useGridSorting(apiRef, props);
|
|
67
|
+
useGridDensity(apiRef, props);
|
|
68
|
+
useGridPagination(apiRef, props);
|
|
69
|
+
useGridRowsMeta(apiRef, props);
|
|
70
|
+
useGridScroll(apiRef, props);
|
|
71
|
+
useGridColumnMenu(apiRef);
|
|
72
|
+
useGridCsvExport(apiRef, props);
|
|
73
|
+
useGridPrintExport(apiRef, props);
|
|
74
|
+
useGridClipboard(apiRef, props);
|
|
75
|
+
useGridDimensions(apiRef, props);
|
|
76
|
+
useGridEvents(apiRef, props);
|
|
77
|
+
useGridStatePersistence(apiRef);
|
|
78
|
+
useGridVirtualization(apiRef, props);
|
|
79
|
+
return apiRef;
|
|
77
80
|
};
|
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
disableVirtualization?: boolean;
|
|
4
|
-
}
|
|
5
|
-
declare const DataGridVirtualScroller: React.ForwardRefExoticComponent<DataGridVirtualScrollerProps & React.RefAttributes<HTMLDivElement>>;
|
|
2
|
+
declare const DataGridVirtualScroller: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
6
3
|
export { DataGridVirtualScroller };
|
|
@@ -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 = ["className"
|
|
3
|
+
const _excluded = ["className"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { GridVirtualScroller } from './virtualization/GridVirtualScroller';
|
|
6
6
|
import { GridVirtualScrollerContent } from './virtualization/GridVirtualScrollerContent';
|
|
@@ -11,8 +11,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
11
11
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
12
|
const DataGridVirtualScroller = /*#__PURE__*/React.forwardRef(function DataGridVirtualScroller(props, ref) {
|
|
13
13
|
const {
|
|
14
|
-
className
|
|
15
|
-
disableVirtualization
|
|
14
|
+
className
|
|
16
15
|
} = props,
|
|
17
16
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
18
17
|
const {
|
|
@@ -21,8 +20,7 @@ const DataGridVirtualScroller = /*#__PURE__*/React.forwardRef(function DataGridV
|
|
|
21
20
|
getRenderZoneProps,
|
|
22
21
|
getRows
|
|
23
22
|
} = useGridVirtualScroller({
|
|
24
|
-
ref
|
|
25
|
-
disableVirtualization
|
|
23
|
+
ref
|
|
26
24
|
});
|
|
27
25
|
return /*#__PURE__*/_jsxs(GridVirtualScroller, _extends({
|
|
28
26
|
className: className
|
package/components/GridRow.js
CHANGED
|
@@ -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 = ["selected", "rowId", "row", "index", "style", "position", "rowHeight", "className", "visibleColumns", "renderedColumns", "containerWidth", "firstColumnToRender", "lastColumnToRender", "isLastVisible", "focusedCellColumnIndexNotInRange", "isNotVisible", "focusedCell", "tabbableCell", "onClick", "onDoubleClick", "onMouseEnter", "onMouseLeave"];
|
|
3
|
+
const _excluded = ["selected", "hovered", "rowId", "row", "index", "style", "position", "rowHeight", "className", "visibleColumns", "renderedColumns", "containerWidth", "firstColumnToRender", "lastColumnToRender", "isLastVisible", "focusedCellColumnIndexNotInRange", "isNotVisible", "focusedCell", "tabbableCell", "onClick", "onDoubleClick", "onMouseEnter", "onMouseLeave"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
@@ -57,6 +57,7 @@ function EmptyCell({
|
|
|
57
57
|
const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
58
58
|
const {
|
|
59
59
|
selected,
|
|
60
|
+
hovered,
|
|
60
61
|
rowId,
|
|
61
62
|
row,
|
|
62
63
|
index,
|
|
@@ -92,6 +93,7 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
92
93
|
|
|
93
94
|
const ownerState = {
|
|
94
95
|
selected,
|
|
96
|
+
hovered,
|
|
95
97
|
isLastVisible,
|
|
96
98
|
classes: rootProps.classes,
|
|
97
99
|
editing: apiRef.current.getRowMode(rowId) === GridRowModes.Edit,
|
|
@@ -328,7 +330,7 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
328
330
|
"data-id": rowId,
|
|
329
331
|
"data-rowindex": index,
|
|
330
332
|
role: "row",
|
|
331
|
-
className: clsx(...rowClassNames, classes.root, className),
|
|
333
|
+
className: clsx(...rowClassNames, classes.root, className, hovered && 'Mui-hovered'),
|
|
332
334
|
"aria-rowindex": ariaRowIndex,
|
|
333
335
|
"aria-selected": selected,
|
|
334
336
|
style: style
|
|
@@ -4,7 +4,6 @@ interface GridBodyProps {
|
|
|
4
4
|
ColumnHeadersProps?: Record<string, any>;
|
|
5
5
|
VirtualScrollerComponent: React.JSXElementConstructor<React.HTMLAttributes<HTMLDivElement> & {
|
|
6
6
|
ref: React.Ref<HTMLDivElement>;
|
|
7
|
-
disableVirtualization: boolean;
|
|
8
7
|
}>;
|
|
9
8
|
}
|
|
10
9
|
declare function GridBody(props: GridBodyProps): React.JSX.Element;
|
|
@@ -39,7 +39,6 @@ function GridBody(props) {
|
|
|
39
39
|
const columnVisibility = useGridSelector(apiRef, gridColumnVisibilityModelSelector);
|
|
40
40
|
const columnGroupsHeaderStructure = useGridSelector(apiRef, gridColumnGroupsHeaderStructureSelector);
|
|
41
41
|
const hasOtherElementInTabSequence = !(columnGroupHeaderTabIndexState === null && columnHeaderTabIndexState === null && cellTabIndexState === null);
|
|
42
|
-
const [isVirtualizationDisabled, setIsVirtualizationDisabled] = React.useState(rootProps.disableVirtualization);
|
|
43
42
|
useEnhancedEffect(() => {
|
|
44
43
|
apiRef.current.computeSizeAndPublishResizeEvent();
|
|
45
44
|
const elementToObserve = rootRef.current;
|
|
@@ -49,7 +48,7 @@ function GridBody(props) {
|
|
|
49
48
|
let animationFrame;
|
|
50
49
|
const observer = new ResizeObserver(() => {
|
|
51
50
|
// See https://github.com/mui/mui-x/issues/8733
|
|
52
|
-
animationFrame =
|
|
51
|
+
animationFrame = requestAnimationFrame(() => {
|
|
53
52
|
apiRef.current.computeSizeAndPublishResizeEvent();
|
|
54
53
|
});
|
|
55
54
|
});
|
|
@@ -65,24 +64,6 @@ function GridBody(props) {
|
|
|
65
64
|
}
|
|
66
65
|
};
|
|
67
66
|
}, [apiRef]);
|
|
68
|
-
const disableVirtualization = React.useCallback(() => {
|
|
69
|
-
setIsVirtualizationDisabled(true);
|
|
70
|
-
}, []);
|
|
71
|
-
const enableVirtualization = React.useCallback(() => {
|
|
72
|
-
setIsVirtualizationDisabled(false);
|
|
73
|
-
}, []);
|
|
74
|
-
React.useEffect(() => {
|
|
75
|
-
setIsVirtualizationDisabled(rootProps.disableVirtualization);
|
|
76
|
-
}, [rootProps.disableVirtualization]);
|
|
77
|
-
|
|
78
|
-
// The `useGridApiMethod` hook can't be used here, because it only installs the
|
|
79
|
-
// method if it doesn't exist yet. Once installed, it's never updated again.
|
|
80
|
-
// This break the methods above, since their closure comes from the first time
|
|
81
|
-
// they were installed. Which means that calling `setIsVirtualizationDisabled`
|
|
82
|
-
// will trigger a re-render, but it won't update the state. That can be solved
|
|
83
|
-
// by migrating the virtualization status to the global state.
|
|
84
|
-
apiRef.current.unstable_disableVirtualization = disableVirtualization;
|
|
85
|
-
apiRef.current.unstable_enableVirtualization = enableVirtualization;
|
|
86
67
|
const columnHeadersRef = React.useRef(null);
|
|
87
68
|
const columnsContainerRef = React.useRef(null);
|
|
88
69
|
const virtualScrollerRef = React.useRef(null);
|
|
@@ -119,8 +100,7 @@ function GridBody(props) {
|
|
|
119
100
|
// If this event is published while dimensions haven't been computed,
|
|
120
101
|
// the `onFetchRows` prop won't be called during mount.
|
|
121
102
|
, {
|
|
122
|
-
ref: virtualScrollerRef
|
|
123
|
-
disableVirtualization: isVirtualizationDisabled
|
|
103
|
+
ref: virtualScrollerRef
|
|
124
104
|
}), children]
|
|
125
105
|
});
|
|
126
106
|
}
|
|
@@ -165,11 +165,11 @@ function GridActionsCell(props) {
|
|
|
165
165
|
fontSize: "small"
|
|
166
166
|
})
|
|
167
167
|
})), menuButtons.length > 0 && /*#__PURE__*/_jsx(GridMenu, {
|
|
168
|
-
onClickAway: hideMenu,
|
|
169
|
-
onClick: hideMenu,
|
|
170
168
|
open: open,
|
|
171
169
|
target: buttonRef.current,
|
|
172
170
|
position: position,
|
|
171
|
+
onClose: hideMenu,
|
|
172
|
+
onClick: hideMenu,
|
|
173
173
|
children: /*#__PURE__*/_jsx(MenuList, {
|
|
174
174
|
id: menuId,
|
|
175
175
|
className: gridClasses.menuList,
|
|
@@ -4,6 +4,8 @@ import { MenuItemProps } from '@mui/material/MenuItem';
|
|
|
4
4
|
export type GridActionsCellItemProps = {
|
|
5
5
|
label: string;
|
|
6
6
|
icon?: React.ReactElement;
|
|
7
|
+
/** from https://mui.com/material-ui/api/button-base/#ButtonBase-prop-component */
|
|
8
|
+
component?: React.ElementType;
|
|
7
9
|
} & (({
|
|
8
10
|
showInMenu?: false;
|
|
9
11
|
icon: React.ReactElement;
|
|
@@ -13,6 +15,8 @@ export type GridActionsCellItemProps = {
|
|
|
13
15
|
declare const GridActionsCellItem: React.ForwardRefExoticComponent<(Omit<{
|
|
14
16
|
label: string;
|
|
15
17
|
icon?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
|
|
18
|
+
/** from https://mui.com/material-ui/api/button-base/#ButtonBase-prop-component */
|
|
19
|
+
component?: React.ElementType<any> | undefined;
|
|
16
20
|
} & {
|
|
17
21
|
showInMenu?: false | undefined;
|
|
18
22
|
icon: React.ReactElement;
|
|
@@ -23,6 +27,8 @@ declare const GridActionsCellItem: React.ForwardRefExoticComponent<(Omit<{
|
|
|
23
27
|
}, "ref"> | Omit<{
|
|
24
28
|
label: string;
|
|
25
29
|
icon?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
|
|
30
|
+
/** from https://mui.com/material-ui/api/button-base/#ButtonBase-prop-component */
|
|
31
|
+
component?: React.ElementType<any> | undefined;
|
|
26
32
|
} & {
|
|
27
33
|
showInMenu: true;
|
|
28
34
|
} & import("@mui/material/MenuItem").MenuItemOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & {
|
|
@@ -232,7 +232,8 @@ const GridCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
232
232
|
return {
|
|
233
233
|
padding: 0,
|
|
234
234
|
opacity: 0,
|
|
235
|
-
width: 0
|
|
235
|
+
width: 0,
|
|
236
|
+
border: 0
|
|
236
237
|
};
|
|
237
238
|
}
|
|
238
239
|
const cellStyle = {
|
|
@@ -497,7 +498,8 @@ const GridCellV7 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
497
498
|
return {
|
|
498
499
|
padding: 0,
|
|
499
500
|
opacity: 0,
|
|
500
|
-
width: 0
|
|
501
|
+
width: 0,
|
|
502
|
+
border: 0
|
|
501
503
|
};
|
|
502
504
|
}
|
|
503
505
|
const cellStyle = {
|
|
@@ -95,7 +95,8 @@ function GridColumnHeaderItem(props) {
|
|
|
95
95
|
onDragEnd: publish('columnHeaderDragEnd')
|
|
96
96
|
} : {}, [isDraggable, publish]);
|
|
97
97
|
const columnHeaderSeparatorProps = React.useMemo(() => ({
|
|
98
|
-
onMouseDown: publish('columnSeparatorMouseDown')
|
|
98
|
+
onMouseDown: publish('columnSeparatorMouseDown'),
|
|
99
|
+
onDoubleClick: publish('columnSeparatorDoubleClick')
|
|
99
100
|
}), [publish]);
|
|
100
101
|
React.useEffect(() => {
|
|
101
102
|
if (!showColumnMenuIcon) {
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { ClickAwayListenerProps } from '@mui/material/ClickAwayListener';
|
|
3
2
|
import { GrowProps } from '@mui/material/Grow';
|
|
4
3
|
import { PopperProps } from '@mui/material/Popper';
|
|
5
4
|
type MenuPosition = 'bottom-end' | 'bottom-start' | 'bottom' | 'left-end' | 'left-start' | 'left' | 'right-end' | 'right-start' | 'right' | 'top-end' | 'top-start' | 'top' | undefined;
|
|
6
5
|
export interface GridMenuProps extends Omit<PopperProps, 'onKeyDown' | 'children'> {
|
|
7
6
|
open: boolean;
|
|
8
7
|
target: HTMLElement | null;
|
|
9
|
-
|
|
8
|
+
onClose: (event?: Event) => void;
|
|
10
9
|
position?: MenuPosition;
|
|
11
10
|
onExited?: GrowProps['onExited'];
|
|
12
11
|
children: React.ReactNode;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["open", "target", "
|
|
3
|
+
const _excluded = ["open", "target", "onClose", "children", "position", "className", "onExited"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import ClickAwayListener from '@mui/material/ClickAwayListener';
|
|
8
|
-
import { unstable_composeClasses as composeClasses, HTMLElementType } from '@mui/utils';
|
|
8
|
+
import { unstable_composeClasses as composeClasses, unstable_useEnhancedEffect as useEnhancedEffect, HTMLElementType } from '@mui/utils';
|
|
9
9
|
import Grow from '@mui/material/Grow';
|
|
10
10
|
import Paper from '@mui/material/Paper';
|
|
11
11
|
import Popper from '@mui/material/Popper';
|
|
@@ -44,7 +44,7 @@ function GridMenu(props) {
|
|
|
44
44
|
const {
|
|
45
45
|
open,
|
|
46
46
|
target,
|
|
47
|
-
|
|
47
|
+
onClose,
|
|
48
48
|
children,
|
|
49
49
|
position,
|
|
50
50
|
className,
|
|
@@ -54,6 +54,16 @@ function GridMenu(props) {
|
|
|
54
54
|
const apiRef = useGridApiContext();
|
|
55
55
|
const rootProps = useGridRootProps();
|
|
56
56
|
const classes = useUtilityClasses(rootProps);
|
|
57
|
+
const savedFocusRef = React.useRef(null);
|
|
58
|
+
useEnhancedEffect(() => {
|
|
59
|
+
if (open) {
|
|
60
|
+
savedFocusRef.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
61
|
+
} else {
|
|
62
|
+
var _savedFocusRef$curren, _savedFocusRef$curren2;
|
|
63
|
+
(_savedFocusRef$curren = savedFocusRef.current) == null || (_savedFocusRef$curren2 = _savedFocusRef$curren.focus) == null || _savedFocusRef$curren2.call(_savedFocusRef$curren);
|
|
64
|
+
savedFocusRef.current = null;
|
|
65
|
+
}
|
|
66
|
+
}, [open]);
|
|
57
67
|
React.useEffect(() => {
|
|
58
68
|
// Emit menuOpen or menuClose events
|
|
59
69
|
const eventName = open ? 'menuOpen' : 'menuClose';
|
|
@@ -69,6 +79,12 @@ function GridMenu(props) {
|
|
|
69
79
|
onExited(node);
|
|
70
80
|
}
|
|
71
81
|
};
|
|
82
|
+
const handleClickAway = event => {
|
|
83
|
+
if (event.target && (target === event.target || target != null && target.contains(event.target))) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
onClose(event);
|
|
87
|
+
};
|
|
72
88
|
return /*#__PURE__*/_jsx(GridMenuRoot, _extends({
|
|
73
89
|
as: rootProps.slots.basePopper,
|
|
74
90
|
className: clsx(className, classes.root),
|
|
@@ -82,7 +98,7 @@ function GridMenu(props) {
|
|
|
82
98
|
TransitionProps,
|
|
83
99
|
placement
|
|
84
100
|
}) => /*#__PURE__*/_jsx(ClickAwayListener, {
|
|
85
|
-
onClickAway:
|
|
101
|
+
onClickAway: handleClickAway,
|
|
86
102
|
mouseEvent: "onMouseDown",
|
|
87
103
|
children: /*#__PURE__*/_jsx(Grow, _extends({}, TransitionProps, {
|
|
88
104
|
style: {
|
|
@@ -102,7 +118,7 @@ process.env.NODE_ENV !== "production" ? GridMenu.propTypes = {
|
|
|
102
118
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
103
119
|
// ----------------------------------------------------------------------
|
|
104
120
|
children: PropTypes.node,
|
|
105
|
-
|
|
121
|
+
onClose: PropTypes.func.isRequired,
|
|
106
122
|
onExited: PropTypes.func,
|
|
107
123
|
/**
|
|
108
124
|
* If `true`, the component is shown.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
-
import { HTMLElementType } from '@mui/utils';
|
|
4
|
+
import { unstable_useEventCallback as useEventCallback, HTMLElementType } from '@mui/utils';
|
|
5
5
|
import { useGridApiContext } from '../../../hooks/utils/useGridApiContext';
|
|
6
6
|
import { GridMenu } from '../GridMenu';
|
|
7
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -17,13 +17,16 @@ function GridColumnHeaderMenu({
|
|
|
17
17
|
}) {
|
|
18
18
|
const apiRef = useGridApiContext();
|
|
19
19
|
const colDef = apiRef.current.getColumn(field);
|
|
20
|
-
const hideMenu =
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
const hideMenu = useEventCallback(event => {
|
|
21
|
+
if (event) {
|
|
22
|
+
// Prevent triggering the sorting
|
|
23
|
+
event.stopPropagation();
|
|
24
|
+
if (target != null && target.contains(event.target)) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
25
27
|
}
|
|
26
|
-
|
|
28
|
+
apiRef.current.hideColumnMenu();
|
|
29
|
+
});
|
|
27
30
|
if (!target || !colDef) {
|
|
28
31
|
return null;
|
|
29
32
|
}
|
|
@@ -31,7 +34,7 @@ function GridColumnHeaderMenu({
|
|
|
31
34
|
placement: `bottom-${colDef.align === 'right' ? 'start' : 'end'}`,
|
|
32
35
|
open: open,
|
|
33
36
|
target: target,
|
|
34
|
-
|
|
37
|
+
onClose: hideMenu,
|
|
35
38
|
onExited: onExited,
|
|
36
39
|
children: /*#__PURE__*/_jsx(ContentComponent, _extends({
|
|
37
40
|
colDef: colDef,
|
|
@@ -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 = ["item", "applyValue", "apiRef", "focusElementRef", "isFilterActive", "clearButton", "tabIndex", "label"];
|
|
3
|
+
const _excluded = ["item", "applyValue", "apiRef", "focusElementRef", "isFilterActive", "clearButton", "tabIndex", "label", "InputLabelProps"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { refType, unstable_useId as useId } from '@mui/utils';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "getOptionLabel", "getOptionValue", "placeholder", "tabIndex", "label", "isFilterActive", "clearButton"];
|
|
3
|
+
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "getOptionLabel", "getOptionValue", "placeholder", "tabIndex", "label", "isFilterActive", "clearButton", "InputLabelProps"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { unstable_useId as useId } from '@mui/utils';
|
|
@@ -56,12 +56,7 @@ export const GridToolbarDensitySelector = /*#__PURE__*/React.forwardRef(function
|
|
|
56
56
|
setOpen(prevOpen => !prevOpen);
|
|
57
57
|
onClick == null || onClick(event);
|
|
58
58
|
};
|
|
59
|
-
const
|
|
60
|
-
var _buttonRef$current;
|
|
61
|
-
if (buttonRef.current === event.target || // if user clicked on the icon
|
|
62
|
-
(_buttonRef$current = buttonRef.current) != null && _buttonRef$current.contains(event.target)) {
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
59
|
+
const handleDensitySelectorClose = () => {
|
|
65
60
|
setOpen(false);
|
|
66
61
|
};
|
|
67
62
|
const handleDensityUpdate = newDensity => {
|
|
@@ -105,7 +100,7 @@ export const GridToolbarDensitySelector = /*#__PURE__*/React.forwardRef(function
|
|
|
105
100
|
})), /*#__PURE__*/_jsx(GridMenu, {
|
|
106
101
|
open: open,
|
|
107
102
|
target: buttonRef.current,
|
|
108
|
-
|
|
103
|
+
onClose: handleDensitySelectorClose,
|
|
109
104
|
position: "bottom-start",
|
|
110
105
|
children: /*#__PURE__*/_jsx(MenuList, {
|
|
111
106
|
id: densityMenuId,
|