@mui/x-data-grid 6.16.0 → 6.16.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +165 -1
- package/DataGrid/DataGrid.d.ts +7 -0
- package/DataGrid/DataGrid.js +8 -1
- package/colDef/gridDateColDef.js +0 -4
- package/components/GridRow.js +7 -3
- package/components/cell/GridCell.js +7 -3
- package/components/containers/GridRootStyles.js +13 -0
- package/components/panel/filterPanel/GridFilterForm.d.ts +7 -0
- package/components/panel/filterPanel/GridFilterForm.js +8 -0
- package/components/panel/filterPanel/GridFilterPanel.d.ts +7 -0
- package/components/panel/filterPanel/GridFilterPanel.js +8 -0
- package/components/toolbar/GridToolbarQuickFilter.d.ts +8 -0
- package/components/toolbar/GridToolbarQuickFilter.js +9 -0
- package/components/virtualization/GridVirtualScroller.js +3 -1
- package/constants/gridClasses.d.ts +8 -0
- package/constants/gridClasses.js +1 -1
- package/hooks/features/columnGrouping/gridColumnGroupsUtils.d.ts +4 -1
- package/hooks/features/columnGrouping/gridColumnGroupsUtils.js +13 -2
- package/hooks/features/columnGrouping/useGridColumnGrouping.js +12 -6
- package/hooks/features/columns/gridColumnsInterfaces.d.ts +1 -2
- package/hooks/features/columns/gridColumnsUtils.js +0 -1
- package/hooks/features/filter/gridFilterUtils.js +4 -4
- package/hooks/features/virtualization/useGridVirtualScroller.js +8 -2
- package/index.js +1 -1
- package/legacy/DataGrid/DataGrid.js +8 -1
- package/legacy/colDef/gridDateColDef.js +0 -4
- package/legacy/components/GridRow.js +6 -2
- package/legacy/components/cell/GridCell.js +7 -3
- package/legacy/components/containers/GridRootStyles.js +15 -9
- package/legacy/components/panel/filterPanel/GridFilterForm.js +8 -0
- package/legacy/components/panel/filterPanel/GridFilterPanel.js +8 -0
- package/legacy/components/toolbar/GridToolbarQuickFilter.js +9 -0
- package/legacy/components/virtualization/GridVirtualScroller.js +3 -1
- package/legacy/constants/gridClasses.js +1 -1
- package/legacy/hooks/features/columnGrouping/gridColumnGroupsUtils.js +13 -2
- package/legacy/hooks/features/columnGrouping/useGridColumnGrouping.js +12 -6
- package/legacy/hooks/features/columns/gridColumnsUtils.js +0 -1
- package/legacy/hooks/features/filter/gridFilterUtils.js +4 -4
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +8 -2
- package/legacy/index.js +1 -1
- package/legacy/locales/arSD.js +26 -28
- package/legacy/locales/roRO.js +1 -1
- package/locales/arSD.js +26 -28
- package/locales/roRO.js +1 -1
- package/models/events/gridEventLookup.d.ts +14 -0
- package/models/props/DataGridProps.d.ts +1 -1
- package/modern/DataGrid/DataGrid.js +8 -1
- package/modern/colDef/gridDateColDef.js +0 -4
- package/modern/components/GridRow.js +7 -3
- package/modern/components/cell/GridCell.js +6 -2
- package/modern/components/containers/GridRootStyles.js +13 -0
- package/modern/components/panel/filterPanel/GridFilterForm.js +8 -0
- package/modern/components/panel/filterPanel/GridFilterPanel.js +8 -0
- package/modern/components/toolbar/GridToolbarQuickFilter.js +9 -0
- package/modern/components/virtualization/GridVirtualScroller.js +3 -1
- package/modern/constants/gridClasses.js +1 -1
- package/modern/hooks/features/columnGrouping/gridColumnGroupsUtils.js +13 -2
- package/modern/hooks/features/columnGrouping/useGridColumnGrouping.js +10 -3
- package/modern/hooks/features/columns/gridColumnsUtils.js +0 -1
- package/modern/hooks/features/filter/gridFilterUtils.js +4 -4
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +8 -2
- package/modern/index.js +1 -1
- package/modern/locales/arSD.js +26 -28
- package/modern/locales/roRO.js +1 -1
- package/node/DataGrid/DataGrid.js +11 -7
- package/node/DataGrid/useDataGridProps.js +1 -2
- package/node/colDef/gridActionsColDef.js +3 -5
- package/node/colDef/gridBooleanColDef.js +2 -3
- package/node/colDef/gridCheckboxSelectionColDef.js +3 -5
- package/node/colDef/gridDateColDef.js +3 -9
- package/node/colDef/gridDefaultColumnTypes.js +1 -2
- package/node/colDef/gridNumericColDef.js +2 -3
- package/node/colDef/gridNumericOperators.js +1 -2
- package/node/colDef/gridSingleSelectColDef.js +2 -3
- package/node/colDef/gridStringColDef.js +2 -3
- package/node/colDef/gridStringOperators.js +1 -2
- package/node/colDef/utils.js +1 -2
- package/node/components/DataGridVirtualScroller.js +2 -3
- package/node/components/GridApiContext.js +1 -2
- package/node/components/GridColumnHeaders.js +1 -2
- package/node/components/GridFooter.js +1 -2
- package/node/components/GridLoadingOverlay.js +1 -2
- package/node/components/GridNoResultsOverlay.js +2 -3
- package/node/components/GridNoRowsOverlay.js +1 -2
- package/node/components/GridPagination.js +2 -3
- package/node/components/GridRow.js +8 -5
- package/node/components/GridRowCount.js +1 -2
- package/node/components/GridSelectedRowCount.js +1 -2
- package/node/components/cell/GridActionsCellItem.js +1 -2
- package/node/components/cell/GridBooleanCell.js +1 -2
- package/node/components/cell/GridCell.js +9 -8
- package/node/components/cell/GridEditInputCell.js +1 -2
- package/node/components/cell/GridEditSingleSelectCell.js +3 -2
- package/node/components/columnHeaders/ColumnHeaderMenuIcon.js +2 -3
- package/node/components/columnHeaders/GridBaseColumnHeaders.js +2 -3
- package/node/components/columnHeaders/GridColumnHeaderSeparator.js +2 -4
- package/node/components/columnHeaders/GridColumnHeaderSortIcon.js +1 -2
- package/node/components/columnHeaders/GridColumnHeadersInner.js +2 -3
- package/node/components/columnHeaders/GridGenericColumnHeaderItem.js +2 -3
- package/node/components/columnHeaders/GridIconButtonContainer.js +2 -3
- package/node/components/columnSelection/GridCellCheckboxRenderer.js +2 -4
- package/node/components/columnSelection/GridHeaderCheckbox.js +1 -2
- package/node/components/containers/GridFooterContainer.js +1 -2
- package/node/components/containers/GridMainContainer.js +2 -3
- package/node/components/containers/GridOverlay.js +1 -2
- package/node/components/containers/GridRoot.js +1 -2
- package/node/components/containers/GridRootStyles.js +15 -3
- package/node/components/containers/GridToolbarContainer.js +1 -2
- package/node/components/menu/columnMenu/GridColumnMenu.js +4 -8
- package/node/components/menu/columnMenu/GridColumnMenuContainer.js +1 -2
- package/node/components/panel/GridPanel.js +2 -4
- package/node/components/panel/GridPanelWrapper.js +1 -2
- package/node/components/panel/GridPreferencesPanel.js +2 -3
- package/node/components/panel/filterPanel/GridFilterForm.js +15 -7
- package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +3 -2
- package/node/components/panel/filterPanel/GridFilterPanel.js +10 -3
- package/node/components/toolbar/GridToolbar.js +1 -2
- package/node/components/toolbar/GridToolbarColumnsButton.js +2 -3
- package/node/components/toolbar/GridToolbarDensitySelector.js +2 -3
- package/node/components/toolbar/GridToolbarExport.js +1 -2
- package/node/components/toolbar/GridToolbarExportContainer.js +2 -3
- package/node/components/toolbar/GridToolbarFilterButton.js +1 -2
- package/node/components/toolbar/GridToolbarQuickFilter.js +10 -1
- package/node/components/virtualization/GridVirtualScroller.js +5 -4
- package/node/components/virtualization/GridVirtualScrollerContent.js +2 -3
- package/node/components/virtualization/GridVirtualScrollerRenderZone.js +2 -3
- package/node/constants/defaultGridSlotsComponents.js +2 -3
- package/node/constants/envConstants.js +1 -2
- package/node/constants/gridClasses.js +1 -2
- package/node/constants/gridDetailPanelToggleField.js +1 -2
- package/node/constants/localeTextConstants.js +2 -3
- package/node/context/GridRootPropsContext.js +1 -2
- package/node/hooks/core/strategyProcessing/useGridStrategyProcessing.js +2 -4
- package/node/hooks/features/columnGrouping/gridColumnGroupsSelector.js +4 -8
- package/node/hooks/features/columnGrouping/gridColumnGroupsUtils.js +13 -2
- package/node/hooks/features/columnGrouping/useGridColumnGrouping.js +10 -3
- package/node/hooks/features/columns/gridColumnsSelector.js +11 -21
- package/node/hooks/features/columns/gridColumnsUtils.js +1 -3
- package/node/hooks/features/density/densitySelector.js +2 -4
- package/node/hooks/features/density/useGridDensity.js +2 -4
- package/node/hooks/features/filter/gridFilterSelector.js +14 -27
- package/node/hooks/features/filter/gridFilterUtils.js +4 -4
- package/node/hooks/features/focus/gridFocusStateSelector.js +8 -16
- package/node/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +2 -4
- package/node/hooks/features/pagination/gridPaginationSelector.js +8 -15
- package/node/hooks/features/pagination/gridPaginationUtils.js +1 -2
- package/node/hooks/features/preferencesPanel/gridPreferencePanelsValue.js +2 -3
- package/node/hooks/features/rowSelection/gridRowSelectionSelector.js +4 -7
- package/node/hooks/features/rows/gridRowsSelector.js +14 -27
- package/node/hooks/features/rows/gridRowsUtils.js +2 -4
- package/node/hooks/features/sorting/gridSortingSelector.js +5 -9
- package/node/hooks/features/virtualization/gridVirtualizationSelectors.js +2 -4
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +8 -2
- package/node/hooks/utils/useGridApiEventHandler.js +2 -4
- package/node/hooks/utils/useGridPrivateApiContext.js +1 -2
- package/node/hooks/utils/useGridSelector.js +1 -2
- package/node/index.js +1 -1
- package/node/joy/icons.js +30 -60
- package/node/joy/joySlots.js +1 -2
- package/node/locales/arSD.js +27 -30
- package/node/locales/beBY.js +1 -2
- package/node/locales/bgBG.js +1 -2
- package/node/locales/coreLocales.js +3 -5
- package/node/locales/csCZ.js +1 -2
- package/node/locales/daDK.js +1 -2
- package/node/locales/deDE.js +1 -2
- package/node/locales/elGR.js +1 -2
- package/node/locales/enUS.js +1 -2
- package/node/locales/esES.js +1 -2
- package/node/locales/faIR.js +1 -2
- package/node/locales/fiFI.js +1 -2
- package/node/locales/frFR.js +1 -2
- package/node/locales/heIL.js +1 -2
- package/node/locales/huHU.js +1 -2
- package/node/locales/itIT.js +1 -2
- package/node/locales/jaJP.js +1 -2
- package/node/locales/koKR.js +1 -2
- package/node/locales/nbNO.js +1 -2
- package/node/locales/nlNL.js +1 -2
- package/node/locales/plPL.js +1 -2
- package/node/locales/ptBR.js +1 -2
- package/node/locales/roRO.js +2 -3
- package/node/locales/ruRU.js +1 -2
- package/node/locales/skSK.js +1 -2
- package/node/locales/svSE.js +1 -2
- package/node/locales/trTR.js +1 -2
- package/node/locales/ukUA.js +1 -2
- package/node/locales/urPK.js +1 -2
- package/node/locales/viVN.js +1 -2
- package/node/locales/zhCN.js +1 -2
- package/node/locales/zhTW.js +1 -2
- package/node/material/icons/GridColumnUnsortedIcon.js +2 -3
- package/node/material/icons/index.js +29 -57
- package/node/material/index.js +1 -2
- package/node/models/gridEditRowModel.js +4 -7
- package/node/models/gridFilterItem.js +2 -3
- package/node/models/params/gridEditCellParams.js +3 -5
- package/node/models/params/gridRowParams.js +3 -5
- package/node/utils/keyboardUtils.js +3 -6
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,170 @@
|
|
|
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.2
|
|
7
|
+
|
|
8
|
+
_Oct 12, 2023_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 12 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 📊 Chart's legend text management has been reworked and contains breaking changes (#10138) @alexfauquette
|
|
13
|
+
- 📝 Add [Bulk editing](https://mui.com/x/react-data-grid/recipes-editing/#bulk-editing) demo (#10333) @cherniavskii
|
|
14
|
+
- 🚀 Column grouping now works smoothly with column pinning (#10518) @MBilalShafi
|
|
15
|
+
- 🌍 Improve Arabic (ar-SD) and Spanish (es-ES) locales
|
|
16
|
+
- 🐞 Bugfixes
|
|
17
|
+
- 📚 Documentation improvements
|
|
18
|
+
|
|
19
|
+
### Data Grid
|
|
20
|
+
|
|
21
|
+
#### `@mui/x-data-grid@6.16.2`
|
|
22
|
+
|
|
23
|
+
- [DataGrid] Fix `LazyLoading` demo crash (#10621) @MBilalShafi
|
|
24
|
+
- [DataGrid] Fix cells overlapping the scrollbar in iOS Safari (#10633) @cherniavskii
|
|
25
|
+
- [DataGrid] Fix `getRowId is not defined` error (#10613) @romgrk
|
|
26
|
+
- [DataGrid] Get quick filter to work OOTB with `date` and `dateTime` fields (#10636) @MBilalShafi
|
|
27
|
+
- [DataGrid] Make cursor for selectable cells to be `default` unless editable (#9997) @gitstart
|
|
28
|
+
- [DataGrid] Remove unnecessary syntax in JSDoc (#10567) @Lev-Shapiro
|
|
29
|
+
- [DataGrid] Update row hover behavior to match native hover (#10623) @cherniavskii
|
|
30
|
+
- [l10n] Improve Arabic (ar-SD) locale (#10625) @alabenyahia
|
|
31
|
+
|
|
32
|
+
#### `@mui/x-data-grid-pro@6.16.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
33
|
+
|
|
34
|
+
Same changes as in `@mui/x-data-grid@6.16.2`, plus:
|
|
35
|
+
|
|
36
|
+
- [DataGridPro] Improve column grouping and column pinning friendship (#10518) @MBilalShafi
|
|
37
|
+
|
|
38
|
+
#### `@mui/x-data-grid-premium@6.16.2` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
39
|
+
|
|
40
|
+
Same changes as in `@mui/x-data-grid-pro@6.16.2`.
|
|
41
|
+
|
|
42
|
+
### Date Pickers
|
|
43
|
+
|
|
44
|
+
#### `@mui/x-date-pickers@6.16.2`
|
|
45
|
+
|
|
46
|
+
- [DateTimePicker] Add support for `DigitalClock` view renderer (#10624) @LukasTy
|
|
47
|
+
- [fields] Bootstrap the multi-HTML input component (#10638) @flaviendelangle
|
|
48
|
+
- [pickers] Fix timezone `UTC` false positive (#10586) @alexfauquette
|
|
49
|
+
- [l10n] Improve Spanish (es-ES) locale (#10588) @eduardodallmann
|
|
50
|
+
|
|
51
|
+
#### `@mui/x-date-pickers-pro@6.16.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
52
|
+
|
|
53
|
+
Same changes as in `@mui/x-date-pickers@6.16.2`.
|
|
54
|
+
|
|
55
|
+
### Charts / `@mui/x-charts@6.0.0-alpha.15`
|
|
56
|
+
|
|
57
|
+
#### Breaking changes
|
|
58
|
+
|
|
59
|
+
The charts have a new text display mechanism.
|
|
60
|
+
It adds line break support and avoids overlapping text in the legend.
|
|
61
|
+
This comes with some breaking changes.
|
|
62
|
+
|
|
63
|
+
- The DOM structure is modified. An intermediary `<tspan />` element has been added. This can impact how your style is applied.
|
|
64
|
+
```diff
|
|
65
|
+
- <text>The label</text>
|
|
66
|
+
+ <text><tspan>The label</tspan></text>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
- The top margin has been reduced from 100 to 50 to benefit from the denser legend.
|
|
70
|
+
|
|
71
|
+
- To accurately compute the text size and then place it, styling should be provided as a JS object. For example, to set the legend font size, you should do:
|
|
72
|
+
```jsx
|
|
73
|
+
<PieChart
|
|
74
|
+
{/** ... */}
|
|
75
|
+
slotProps={{
|
|
76
|
+
legend: {
|
|
77
|
+
labelStyle: {
|
|
78
|
+
fontSize: 16,
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
}}
|
|
82
|
+
/>
|
|
83
|
+
```
|
|
84
|
+
Support for other text elements (axis labels and tick labels) will be implemented in follow-up PR.
|
|
85
|
+
|
|
86
|
+
#### Changes
|
|
87
|
+
|
|
88
|
+
- [charts] Fix typo between internal/external variable (#10640) @alexfauquette
|
|
89
|
+
- [charts] Improve the management of the text (#10138) @alexfauquette
|
|
90
|
+
|
|
91
|
+
### Docs
|
|
92
|
+
|
|
93
|
+
- [docs] Add bulk editing demo (#10333) @cherniavskii
|
|
94
|
+
- [docs] Add reference links to DateRangePicker components (#10629) @michelengelen
|
|
95
|
+
- [docs] Add reference links to DateTimePicker components (#10628) @michelengelen
|
|
96
|
+
- [docs] Add reference links to picker field components (#10631) @michelengelen
|
|
97
|
+
- [docs] Added reference links to TimePicker components (#10627) @michelengelen
|
|
98
|
+
- [docs] Avoid Pickers playground error due to empty views (#10654) @LukasTy
|
|
99
|
+
- [docs] Fix DataGrid[Pro/Premium] reference links (#10620) @michelengelen
|
|
100
|
+
|
|
101
|
+
### Core
|
|
102
|
+
|
|
103
|
+
- [core] Bump monorepo (#10619) @alexfauquette
|
|
104
|
+
- [core] Update `no-response` workflow (#10491) @MBilalShafi
|
|
105
|
+
- [core] Update the issue templates to reflect the new support workflow (#10651) @MBilalShafi
|
|
106
|
+
- [test] Fix `testEval` not invoking test assertions (#10587) @cherniavskii
|
|
107
|
+
- [test] Fix dev mode warning (#10610) @oliviertassinari
|
|
108
|
+
- [test] Set UUID chance seed in visual tests (#10609) @oliviertassinari
|
|
109
|
+
|
|
110
|
+
## 6.16.1
|
|
111
|
+
|
|
112
|
+
_Oct 6, 2023_
|
|
113
|
+
|
|
114
|
+
We'd like to offer a big thanks to the 10 contributors who made this release possible. Here are some highlights ✨:
|
|
115
|
+
|
|
116
|
+
- 🥧 Support interaction with pie chart
|
|
117
|
+
- 🐞 Bugfixes
|
|
118
|
+
- 📚 Documentation improvements
|
|
119
|
+
|
|
120
|
+
### Data Grid
|
|
121
|
+
|
|
122
|
+
#### `@mui/x-data-grid@6.16.1`
|
|
123
|
+
|
|
124
|
+
- [DataGrid] Add a new demo with sparklines (#9228) @flaviendelangle
|
|
125
|
+
- [DataGrid] Fix autosize missing a few pixels (#10471) @romgrk
|
|
126
|
+
- [DataGrid] Make `disableColumnSelector` demo idempotent (#10548) @MBilalShafi
|
|
127
|
+
|
|
128
|
+
#### `@mui/x-data-grid-pro@6.16.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
129
|
+
|
|
130
|
+
Same changes as in `@mui/x-data-grid@6.16.1`.
|
|
131
|
+
|
|
132
|
+
#### `@mui/x-data-grid-premium@6.16.1` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
133
|
+
|
|
134
|
+
Same changes as in `@mui/x-data-grid-pro@6.16.1`.
|
|
135
|
+
|
|
136
|
+
### Date Pickers
|
|
137
|
+
|
|
138
|
+
#### `@mui/x-date-pickers@6.16.1`
|
|
139
|
+
|
|
140
|
+
- [pickers] Avoid calendar layout shifting when changing views (#10541) @LukasTy
|
|
141
|
+
- [pickers] Fix clearable behavior when disabled (#10542) @noraleonte
|
|
142
|
+
- [pickers] Improve customization playground examples (#10544) @noraleonte
|
|
143
|
+
|
|
144
|
+
#### `@mui/x-date-pickers-pro@6.16.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
145
|
+
|
|
146
|
+
Same changes as in `@mui/x-date-pickers@6.16.1`, plus:
|
|
147
|
+
|
|
148
|
+
- [DateRangePicker] Fix `InputProps` propagation in multi input (#10564) @alexfauquette
|
|
149
|
+
|
|
150
|
+
### Charts / `@mui/x-charts@6.0.0-alpha.14`
|
|
151
|
+
|
|
152
|
+
- [charts] Display cursor pointer for pie chart only if `onClick` is provided (#10551) @giladappsforce
|
|
153
|
+
- [charts] Add `onClick` prop to PieChart (#10506) @giladappsforce
|
|
154
|
+
- [charts] Support `slots`/`slotProps` for the tooltip (#10515) @alexfauquette
|
|
155
|
+
|
|
156
|
+
### Docs
|
|
157
|
+
|
|
158
|
+
- [docs] Add `DateRangePicker` example with a `Button` trigger (#10485) @LukasTy
|
|
159
|
+
- [docs] Add section about disabling columns panel (#10328) @MBilalShafi
|
|
160
|
+
- [docs] Add section about overriding slots to base concepts (#10421) @noraleonte
|
|
161
|
+
- [docs] Add "What's new" page listing all release announcements (#9727) @joserodolfofreitas
|
|
162
|
+
- [docs] Update RTL Support section of the grid localization docs (#10561) @MBilalShafi
|
|
163
|
+
|
|
164
|
+
### Core
|
|
165
|
+
|
|
166
|
+
- [core] Fix casing consistency with legal and marketing content @oliviertassinari
|
|
167
|
+
- [core] Revert the link in the priority support ticket description (#10517) @michelengelen
|
|
168
|
+
- [CHANGELOG] Polish image @oliviertassinari
|
|
169
|
+
|
|
6
170
|
## 6.16.0
|
|
7
171
|
|
|
8
172
|
_Sep 29, 2023_
|
|
@@ -13,7 +177,7 @@ We'd like to offer a big thanks to the 9 contributors who made this release poss
|
|
|
13
177
|
|
|
14
178
|
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
179
|
|
|
16
|
-
<img width="
|
|
180
|
+
<img width="337" height="139" alt="Clearable behavior" src="https://github.com/mui/mui-x/assets/3165635/a5407cb6-0b8a-443c-b4b9-1f81ceb4d087">
|
|
17
181
|
|
|
18
182
|
- 💫 Add Date Picker customization playground (#9581) @noraleonte
|
|
19
183
|
|
package/DataGrid/DataGrid.d.ts
CHANGED
|
@@ -5,6 +5,13 @@ interface DataGridComponent {
|
|
|
5
5
|
<R extends GridValidRowModel = any>(props: DataGridProps<R> & React.RefAttributes<HTMLDivElement>): React.JSX.Element;
|
|
6
6
|
propTypes?: any;
|
|
7
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* Demos:
|
|
10
|
+
* - [DataGrid](https://mui.com/x/react-data-grid/demo/)
|
|
11
|
+
*
|
|
12
|
+
* API:
|
|
13
|
+
* - [DataGrid API](https://mui.com/x/api/data-grid/data-grid/)
|
|
14
|
+
*/
|
|
8
15
|
export declare const DataGrid: DataGridComponent;
|
|
9
16
|
/**
|
|
10
17
|
* Remove at v7
|
package/DataGrid/DataGrid.js
CHANGED
|
@@ -27,6 +27,13 @@ const DataGridRaw = /*#__PURE__*/React.forwardRef(function DataGrid(inProps, ref
|
|
|
27
27
|
}))
|
|
28
28
|
});
|
|
29
29
|
});
|
|
30
|
+
/**
|
|
31
|
+
* Demos:
|
|
32
|
+
* - [DataGrid](https://mui.com/x/react-data-grid/demo/)
|
|
33
|
+
*
|
|
34
|
+
* API:
|
|
35
|
+
* - [DataGrid API](https://mui.com/x/api/data-grid/data-grid/)
|
|
36
|
+
*/
|
|
30
37
|
export const DataGrid = /*#__PURE__*/React.memo(DataGridRaw);
|
|
31
38
|
|
|
32
39
|
/**
|
|
@@ -660,7 +667,7 @@ DataGridRaw.propTypes = {
|
|
|
660
667
|
/**
|
|
661
668
|
* If `true`, the grid will not use `valueFormatter` when exporting to CSV or copying to clipboard.
|
|
662
669
|
* If an object is provided, you can choose to ignore the `valueFormatter` for CSV export or clipboard export.
|
|
663
|
-
* @default
|
|
670
|
+
* @default false
|
|
664
671
|
*/
|
|
665
672
|
unstable_ignoreValueFormatterDuringExport: PropTypes.oneOfType([PropTypes.shape({
|
|
666
673
|
clipboardExport: PropTypes.bool,
|
package/colDef/gridDateColDef.js
CHANGED
|
@@ -51,8 +51,6 @@ export const GRID_DATE_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
|
|
|
51
51
|
valueFormatter: gridDateFormatter,
|
|
52
52
|
filterOperators: getGridDateOperators(),
|
|
53
53
|
renderEditCell: renderEditDateCell,
|
|
54
|
-
getApplyQuickFilterFn: undefined,
|
|
55
|
-
getApplyQuickFilterFnV7: undefined,
|
|
56
54
|
// @ts-ignore
|
|
57
55
|
pastedValueParser: value => new Date(value)
|
|
58
56
|
});
|
|
@@ -62,8 +60,6 @@ export const GRID_DATETIME_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
|
|
|
62
60
|
valueFormatter: gridDateTimeFormatter,
|
|
63
61
|
filterOperators: getGridDateOperators(true),
|
|
64
62
|
renderEditCell: renderEditDateCell,
|
|
65
|
-
getApplyQuickFilterFn: undefined,
|
|
66
|
-
getApplyQuickFilterFnV7: undefined,
|
|
67
63
|
// @ts-ignore
|
|
68
64
|
pastedValueParser: value => new Date(value)
|
|
69
65
|
});
|
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", "hovered", "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", "onMouseOut", "onMouseOver"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
@@ -76,7 +76,9 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
76
76
|
onClick,
|
|
77
77
|
onDoubleClick,
|
|
78
78
|
onMouseEnter,
|
|
79
|
-
onMouseLeave
|
|
79
|
+
onMouseLeave,
|
|
80
|
+
onMouseOut,
|
|
81
|
+
onMouseOver
|
|
80
82
|
} = props,
|
|
81
83
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
82
84
|
const apiRef = useGridApiContext();
|
|
@@ -323,7 +325,9 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
323
325
|
onClick: publishClick,
|
|
324
326
|
onDoubleClick: publish('rowDoubleClick', onDoubleClick),
|
|
325
327
|
onMouseEnter: publish('rowMouseEnter', onMouseEnter),
|
|
326
|
-
onMouseLeave: publish('rowMouseLeave', onMouseLeave)
|
|
328
|
+
onMouseLeave: publish('rowMouseLeave', onMouseLeave),
|
|
329
|
+
onMouseOut: publish('rowMouseOut', onMouseOut),
|
|
330
|
+
onMouseOver: publish('rowMouseOver', onMouseOver)
|
|
327
331
|
} : null;
|
|
328
332
|
return /*#__PURE__*/_jsxs("div", _extends({
|
|
329
333
|
ref: handleRef,
|
|
@@ -48,10 +48,11 @@ const useUtilityClasses = ownerState => {
|
|
|
48
48
|
showRightBorder,
|
|
49
49
|
isEditable,
|
|
50
50
|
isSelected,
|
|
51
|
+
isSelectionMode,
|
|
51
52
|
classes
|
|
52
53
|
} = ownerState;
|
|
53
54
|
const slots = {
|
|
54
|
-
root: ['cell', `cell--text${capitalize(align)}`, isEditable && 'cell--editable', isSelected && 'selected', showRightBorder && 'cell--withRightBorder', 'withBorderColor'],
|
|
55
|
+
root: ['cell', `cell--text${capitalize(align)}`, isEditable && 'cell--editable', isSelected && 'selected', showRightBorder && 'cell--withRightBorder', isSelectionMode && !isEditable && 'cell--selectionMode', 'withBorderColor'],
|
|
55
56
|
content: ['cellContent']
|
|
56
57
|
};
|
|
57
58
|
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
@@ -385,7 +386,7 @@ process.env.NODE_ENV !== "production" ? GridCell.propTypes = {
|
|
|
385
386
|
} : void 0;
|
|
386
387
|
export { MemoizedCellWrapper as GridCellWrapper, GridCell };
|
|
387
388
|
const GridCellV7 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
388
|
-
var _rootProps$experiment3, _rootProps$experiment4;
|
|
389
|
+
var _rootProps$unstable_c, _rootProps$experiment3, _rootProps$experiment4;
|
|
389
390
|
const {
|
|
390
391
|
column,
|
|
391
392
|
rowId,
|
|
@@ -460,12 +461,15 @@ const GridCellV7 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
460
461
|
const cellRef = React.useRef(null);
|
|
461
462
|
const handleRef = useForkRef(ref, cellRef);
|
|
462
463
|
const focusElementRef = React.useRef(null);
|
|
464
|
+
// @ts-expect-error To access `unstable_cellSelection` flag as it's a `premium` feature
|
|
465
|
+
const isSelectionMode = (_rootProps$unstable_c = rootProps.unstable_cellSelection) != null ? _rootProps$unstable_c : false;
|
|
463
466
|
const ownerState = {
|
|
464
467
|
align,
|
|
465
468
|
showRightBorder,
|
|
466
469
|
isEditable,
|
|
467
470
|
classes: rootProps.classes,
|
|
468
|
-
isSelected
|
|
471
|
+
isSelected,
|
|
472
|
+
isSelectionMode
|
|
469
473
|
};
|
|
470
474
|
const classes = useUtilityClasses(ownerState);
|
|
471
475
|
const publishMouseUp = React.useCallback(eventName => event => {
|
|
@@ -43,6 +43,8 @@ export const GridRootStyles = styled('div', {
|
|
|
43
43
|
[`&.${gridClasses.aggregationColumnHeaderLabel}`]: styles.aggregationColumnHeaderLabel
|
|
44
44
|
}, {
|
|
45
45
|
[`&.${gridClasses['root--disableUserSelection']} .${gridClasses.cell}`]: styles['root--disableUserSelection']
|
|
46
|
+
}, {
|
|
47
|
+
[`&.${gridClasses.autosizing}`]: styles.autosizing
|
|
46
48
|
}, {
|
|
47
49
|
[`& .${gridClasses.editBooleanCell}`]: styles.editBooleanCell
|
|
48
50
|
}, {
|
|
@@ -184,6 +186,14 @@ export const GridRootStyles = styled('div', {
|
|
|
184
186
|
borderBottomColor: 'transparent'
|
|
185
187
|
}
|
|
186
188
|
},
|
|
189
|
+
[`&.${gridClasses.autosizing}`]: {
|
|
190
|
+
[`& .${gridClasses.columnHeaderTitleContainerContent} > *`]: {
|
|
191
|
+
overflow: 'visible !important'
|
|
192
|
+
},
|
|
193
|
+
[`& .${gridClasses.cell} > *`]: {
|
|
194
|
+
overflow: 'visible !important'
|
|
195
|
+
}
|
|
196
|
+
},
|
|
187
197
|
[`& .${gridClasses['virtualScrollerContent--overflowed']} .${gridClasses['row--lastVisible']} .${gridClasses.cell}`]: {
|
|
188
198
|
borderBottomColor: 'transparent'
|
|
189
199
|
},
|
|
@@ -385,6 +395,9 @@ export const GridRootStyles = styled('div', {
|
|
|
385
395
|
overflow: 'hidden',
|
|
386
396
|
textOverflow: 'ellipsis'
|
|
387
397
|
},
|
|
398
|
+
[`& .${gridClasses.cell}.${gridClasses['cell--selectionMode']}`]: {
|
|
399
|
+
cursor: 'default'
|
|
400
|
+
},
|
|
388
401
|
[`& .${gridClasses.cell}.${gridClasses['cell--editing']}`]: {
|
|
389
402
|
padding: 1,
|
|
390
403
|
display: 'flex',
|
|
@@ -95,4 +95,11 @@ export interface GridFilterFormProps {
|
|
|
95
95
|
children?: React.ReactNode;
|
|
96
96
|
}
|
|
97
97
|
declare const GridFilterForm: React.ForwardRefExoticComponent<GridFilterFormProps & React.RefAttributes<HTMLDivElement>>;
|
|
98
|
+
/**
|
|
99
|
+
* Demos:
|
|
100
|
+
* - [Filtering - overview](https://mui.com/x/react-data-grid/filtering/)
|
|
101
|
+
*
|
|
102
|
+
* API:
|
|
103
|
+
* - [GridFilterForm API](https://mui.com/x/api/data-grid/grid-filter-form/)
|
|
104
|
+
*/
|
|
98
105
|
export { GridFilterForm };
|
|
@@ -431,4 +431,12 @@ process.env.NODE_ENV !== "production" ? GridFilterForm.propTypes = {
|
|
|
431
431
|
*/
|
|
432
432
|
valueInputProps: PropTypes.any
|
|
433
433
|
} : void 0;
|
|
434
|
+
|
|
435
|
+
/**
|
|
436
|
+
* Demos:
|
|
437
|
+
* - [Filtering - overview](https://mui.com/x/react-data-grid/filtering/)
|
|
438
|
+
*
|
|
439
|
+
* API:
|
|
440
|
+
* - [GridFilterForm API](https://mui.com/x/api/data-grid/grid-filter-form/)
|
|
441
|
+
*/
|
|
434
442
|
export { GridFilterForm };
|
|
@@ -39,4 +39,11 @@ export interface GridFilterPanelProps extends Pick<GridFilterFormProps, 'logicOp
|
|
|
39
39
|
}
|
|
40
40
|
declare const getGridFilter: (col: GridStateColDef) => GridFilterItem;
|
|
41
41
|
declare const GridFilterPanel: React.ForwardRefExoticComponent<GridFilterPanelProps & React.RefAttributes<HTMLDivElement>>;
|
|
42
|
+
/**
|
|
43
|
+
* Demos:
|
|
44
|
+
* - [Filtering - overview](https://mui.com/x/react-data-grid/filtering/)
|
|
45
|
+
*
|
|
46
|
+
* API:
|
|
47
|
+
* - [GridFilterPanel API](https://mui.com/x/api/data-grid/grid-filter-panel/)
|
|
48
|
+
*/
|
|
42
49
|
export { GridFilterPanel, getGridFilter };
|
|
@@ -215,4 +215,12 @@ process.env.NODE_ENV !== "production" ? GridFilterPanel.propTypes = {
|
|
|
215
215
|
*/
|
|
216
216
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
|
217
217
|
} : void 0;
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Demos:
|
|
221
|
+
* - [Filtering - overview](https://mui.com/x/react-data-grid/filtering/)
|
|
222
|
+
*
|
|
223
|
+
* API:
|
|
224
|
+
* - [GridFilterPanel API](https://mui.com/x/api/data-grid/grid-filter-panel/)
|
|
225
|
+
*/
|
|
218
226
|
export { GridFilterPanel, getGridFilter };
|
|
@@ -24,4 +24,12 @@ declare function GridToolbarQuickFilter(props: GridToolbarQuickFilterProps): Rea
|
|
|
24
24
|
declare namespace GridToolbarQuickFilter {
|
|
25
25
|
var propTypes: any;
|
|
26
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Demos:
|
|
29
|
+
* - [Filtering - overview](https://mui.com/x/react-data-grid/filtering/)
|
|
30
|
+
* - [Filtering - quick filter](https://mui.com/x/react-data-grid/filtering/quick-filter/)
|
|
31
|
+
*
|
|
32
|
+
* API:
|
|
33
|
+
* - [GridToolbarQuickFilter API](https://mui.com/x/api/data-grid/grid-toolbar-quick-filter/)
|
|
34
|
+
*/
|
|
27
35
|
export { GridToolbarQuickFilter };
|
|
@@ -133,4 +133,13 @@ process.env.NODE_ENV !== "production" ? GridToolbarQuickFilter.propTypes = {
|
|
|
133
133
|
*/
|
|
134
134
|
quickFilterParser: PropTypes.func
|
|
135
135
|
} : void 0;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Demos:
|
|
139
|
+
* - [Filtering - overview](https://mui.com/x/react-data-grid/filtering/)
|
|
140
|
+
* - [Filtering - quick filter](https://mui.com/x/react-data-grid/filtering/quick-filter/)
|
|
141
|
+
*
|
|
142
|
+
* API:
|
|
143
|
+
* - [GridToolbarQuickFilter API](https://mui.com/x/api/data-grid/grid-toolbar-quick-filter/)
|
|
144
|
+
*/
|
|
136
145
|
export { GridToolbarQuickFilter };
|
|
@@ -26,8 +26,10 @@ const VirtualScrollerRoot = styled('div', {
|
|
|
26
26
|
position: 'relative',
|
|
27
27
|
'@media print': {
|
|
28
28
|
overflow: 'hidden'
|
|
29
|
-
}
|
|
29
|
+
},
|
|
30
|
+
zIndex: 0 // See https://github.com/mui/mui-x/issues/10547
|
|
30
31
|
});
|
|
32
|
+
|
|
31
33
|
const GridVirtualScroller = /*#__PURE__*/React.forwardRef(function GridVirtualScroller(props, ref) {
|
|
32
34
|
const rootProps = useGridRootProps();
|
|
33
35
|
const classes = useUtilityClasses(rootProps);
|
|
@@ -27,6 +27,10 @@ export interface GridClasses {
|
|
|
27
27
|
* Styles applied to the root element if `autoHeight={true}`.
|
|
28
28
|
*/
|
|
29
29
|
autoHeight: string;
|
|
30
|
+
/**
|
|
31
|
+
* Styles applied to the root element while it is being autosized.
|
|
32
|
+
*/
|
|
33
|
+
autosizing: string;
|
|
30
34
|
/**
|
|
31
35
|
* Styles applied to the icon of the boolean cell.
|
|
32
36
|
*/
|
|
@@ -71,6 +75,10 @@ export interface GridClasses {
|
|
|
71
75
|
* Styles applied to the cell element if it is at the right edge of a cell selection range.
|
|
72
76
|
*/
|
|
73
77
|
'cell--rangeRight': string;
|
|
78
|
+
/**
|
|
79
|
+
* Styles applied to the cell element if it is in a cell selection range.
|
|
80
|
+
*/
|
|
81
|
+
'cell--selectionMode': string;
|
|
74
82
|
/**
|
|
75
83
|
* Styles applied to the cell element.
|
|
76
84
|
*/
|
package/constants/gridClasses.js
CHANGED
|
@@ -2,4 +2,4 @@ import { unstable_generateUtilityClasses as generateUtilityClasses, unstable_gen
|
|
|
2
2
|
export function getDataGridUtilityClass(slot) {
|
|
3
3
|
return generateUtilityClass('MuiDataGrid', slot);
|
|
4
4
|
}
|
|
5
|
-
export const gridClasses = generateUtilityClasses('MuiDataGrid', ['actionsCell', 'aggregationColumnHeader', 'aggregationColumnHeader--alignLeft', 'aggregationColumnHeader--alignCenter', 'aggregationColumnHeader--alignRight', 'aggregationColumnHeaderLabel', 'autoHeight', 'booleanCell', 'cell--editable', 'cell--editing', 'cell--textCenter', 'cell--textLeft', 'cell--textRight', 'cell--withRenderer', 'cell--rangeTop', 'cell--rangeBottom', 'cell--rangeLeft', 'cell--rangeRight', 'cell', 'cellContent', 'cellCheckbox', 'cellSkeleton', 'checkboxInput', 'columnHeader--alignCenter', 'columnHeader--alignLeft', 'columnHeader--alignRight', 'columnHeader--dragging', 'columnHeader--moving', 'columnHeader--numeric', 'columnHeader--sortable', 'columnHeader--sorted', 'columnHeader--filtered', 'columnHeader', 'columnHeaderCheckbox', 'columnHeaderDraggableContainer', 'columnHeaderDropZone', 'columnHeaderTitle', 'columnHeaderTitleContainer', 'columnHeaderTitleContainerContent', 'columnGroupHeader', 'columnHeader--filledGroup', 'columnHeader--emptyGroup', 'columnHeader--showColumnBorder', 'columnHeaders', 'columnHeadersInner', 'columnHeadersInner--scrollable', 'columnSeparator--resizable', 'columnSeparator--resizing', 'columnSeparator--sideLeft', 'columnSeparator--sideRight', 'columnSeparator', 'columnsPanel', 'columnsPanelRow', 'detailPanel', 'detailPanels', 'detailPanelToggleCell', 'detailPanelToggleCell--expanded', 'footerCell', 'panel', 'panelHeader', 'panelWrapper', 'panelContent', 'panelFooter', 'paper', 'editBooleanCell', 'editInputCell', 'filterForm', 'filterFormDeleteIcon', 'filterFormLogicOperatorInput', 'filterFormColumnInput', 'filterFormOperatorInput', 'filterFormValueInput', 'filterIcon', 'footerContainer', 'headerFilterRow', 'iconButtonContainer', 'iconSeparator', 'main', 'menu', 'menuIcon', 'menuIconButton', 'menuOpen', 'menuList', 'overlay', 'overlayWrapper', 'overlayWrapperInner', 'root', 'root--densityStandard', 'root--densityComfortable', 'root--densityCompact', 'root--disableUserSelection', 'row', 'row--editable', 'row--editing', 'row--lastVisible', 'row--dragging', 'row--dynamicHeight', 'row--detailPanelExpanded', 'rowReorderCellPlaceholder', 'rowCount', 'rowReorderCellContainer', 'rowReorderCell', 'rowReorderCell--draggable', 'scrollArea--left', 'scrollArea--right', 'scrollArea', 'selectedRowCount', 'sortIcon', 'toolbarContainer', 'toolbarFilterList', 'virtualScroller', 'virtualScrollerContent', 'virtualScrollerContent--overflowed', 'virtualScrollerRenderZone', 'pinnedColumns', 'pinnedColumns--left', 'pinnedColumns--right', 'pinnedColumnHeaders', 'pinnedColumnHeaders--left', 'pinnedColumnHeaders--right', 'withBorderColor', 'cell--withRightBorder', 'columnHeader--withRightBorder', 'treeDataGroupingCell', 'treeDataGroupingCellToggle', 'groupingCriteriaCell', 'groupingCriteriaCellToggle', 'pinnedRows', 'pinnedRows--top', 'pinnedRows--bottom', 'pinnedRowsRenderZone']);
|
|
5
|
+
export const gridClasses = generateUtilityClasses('MuiDataGrid', ['actionsCell', 'aggregationColumnHeader', 'aggregationColumnHeader--alignLeft', 'aggregationColumnHeader--alignCenter', 'aggregationColumnHeader--alignRight', 'aggregationColumnHeaderLabel', 'autoHeight', 'autosizing', 'booleanCell', 'cell--editable', 'cell--editing', 'cell--textCenter', 'cell--textLeft', 'cell--textRight', 'cell--withRenderer', 'cell--rangeTop', 'cell--rangeBottom', 'cell--rangeLeft', 'cell--rangeRight', 'cell--selectionMode', 'cell', 'cellContent', 'cellCheckbox', 'cellSkeleton', 'checkboxInput', 'columnHeader--alignCenter', 'columnHeader--alignLeft', 'columnHeader--alignRight', 'columnHeader--dragging', 'columnHeader--moving', 'columnHeader--numeric', 'columnHeader--sortable', 'columnHeader--sorted', 'columnHeader--filtered', 'columnHeader', 'columnHeaderCheckbox', 'columnHeaderDraggableContainer', 'columnHeaderDropZone', 'columnHeaderTitle', 'columnHeaderTitleContainer', 'columnHeaderTitleContainerContent', 'columnGroupHeader', 'columnHeader--filledGroup', 'columnHeader--emptyGroup', 'columnHeader--showColumnBorder', 'columnHeaders', 'columnHeadersInner', 'columnHeadersInner--scrollable', 'columnSeparator--resizable', 'columnSeparator--resizing', 'columnSeparator--sideLeft', 'columnSeparator--sideRight', 'columnSeparator', 'columnsPanel', 'columnsPanelRow', 'detailPanel', 'detailPanels', 'detailPanelToggleCell', 'detailPanelToggleCell--expanded', 'footerCell', 'panel', 'panelHeader', 'panelWrapper', 'panelContent', 'panelFooter', 'paper', 'editBooleanCell', 'editInputCell', 'filterForm', 'filterFormDeleteIcon', 'filterFormLogicOperatorInput', 'filterFormColumnInput', 'filterFormOperatorInput', 'filterFormValueInput', 'filterIcon', 'footerContainer', 'headerFilterRow', 'iconButtonContainer', 'iconSeparator', 'main', 'menu', 'menuIcon', 'menuIconButton', 'menuOpen', 'menuList', 'overlay', 'overlayWrapper', 'overlayWrapperInner', 'root', 'root--densityStandard', 'root--densityComfortable', 'root--densityCompact', 'root--disableUserSelection', 'row', 'row--editable', 'row--editing', 'row--lastVisible', 'row--dragging', 'row--dynamicHeight', 'row--detailPanelExpanded', 'rowReorderCellPlaceholder', 'rowCount', 'rowReorderCellContainer', 'rowReorderCell', 'rowReorderCell--draggable', 'scrollArea--left', 'scrollArea--right', 'scrollArea', 'selectedRowCount', 'sortIcon', 'toolbarContainer', 'toolbarFilterList', 'virtualScroller', 'virtualScrollerContent', 'virtualScrollerContent--overflowed', 'virtualScrollerRenderZone', 'pinnedColumns', 'pinnedColumns--left', 'pinnedColumns--right', 'pinnedColumnHeaders', 'pinnedColumnHeaders--left', 'pinnedColumnHeaders--right', 'withBorderColor', 'cell--withRightBorder', 'columnHeader--withRightBorder', 'treeDataGroupingCell', 'treeDataGroupingCellToggle', 'groupingCriteriaCell', 'groupingCriteriaCellToggle', 'pinnedRows', 'pinnedRows--top', 'pinnedRows--bottom', 'pinnedRowsRenderZone']);
|
|
@@ -11,5 +11,8 @@ type UnwrappedGroupingModel = {
|
|
|
11
11
|
* @returns An object `{[field]: groupIds}` where `groupIds` is the parents of the column `field`
|
|
12
12
|
*/
|
|
13
13
|
export declare const unwrapGroupingColumnModel: (columnGroupingModel?: GridColumnGroupingModel) => UnwrappedGroupingModel;
|
|
14
|
-
export declare const getColumnGroupsHeaderStructure: (orderedColumns: string[], unwrappedGroupingModel: UnwrappedGroupingModel
|
|
14
|
+
export declare const getColumnGroupsHeaderStructure: (orderedColumns: string[], unwrappedGroupingModel: UnwrappedGroupingModel, pinnedFields: {
|
|
15
|
+
right?: string[];
|
|
16
|
+
left?: string[];
|
|
17
|
+
}) => GridGroupingStructure[][];
|
|
15
18
|
export {};
|
|
@@ -34,7 +34,7 @@ export const unwrapGroupingColumnModel = columnGroupingModel => {
|
|
|
34
34
|
});
|
|
35
35
|
return unwrappedSubTree;
|
|
36
36
|
};
|
|
37
|
-
export const getColumnGroupsHeaderStructure = (orderedColumns, unwrappedGroupingModel) => {
|
|
37
|
+
export const getColumnGroupsHeaderStructure = (orderedColumns, unwrappedGroupingModel, pinnedFields) => {
|
|
38
38
|
const getParents = field => {
|
|
39
39
|
var _unwrappedGroupingMod;
|
|
40
40
|
return (_unwrappedGroupingMod = unwrappedGroupingModel[field]) != null ? _unwrappedGroupingMod : [];
|
|
@@ -42,6 +42,15 @@ export const getColumnGroupsHeaderStructure = (orderedColumns, unwrappedGrouping
|
|
|
42
42
|
const groupingHeaderStructure = [];
|
|
43
43
|
const maxDepth = Math.max(...orderedColumns.map(field => getParents(field).length));
|
|
44
44
|
const haveSameParents = (field1, field2, depth) => isDeepEqual(getParents(field1).slice(0, depth + 1), getParents(field2).slice(0, depth + 1));
|
|
45
|
+
const haveDifferentContainers = (field1, field2) => {
|
|
46
|
+
if (pinnedFields != null && pinnedFields.left && pinnedFields.left.includes(field1) && !pinnedFields.left.includes(field2)) {
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
if (pinnedFields != null && pinnedFields.right && !pinnedFields.right.includes(field1) && pinnedFields.right.includes(field2)) {
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
return false;
|
|
53
|
+
};
|
|
45
54
|
for (let depth = 0; depth < maxDepth; depth += 1) {
|
|
46
55
|
const depthStructure = orderedColumns.reduce((structure, newField) => {
|
|
47
56
|
var _getParents$depth;
|
|
@@ -55,7 +64,9 @@ export const getColumnGroupsHeaderStructure = (orderedColumns, unwrappedGrouping
|
|
|
55
64
|
const lastGroup = structure[structure.length - 1];
|
|
56
65
|
const prevField = lastGroup.columnFields[lastGroup.columnFields.length - 1];
|
|
57
66
|
const prevGroupId = lastGroup.groupId;
|
|
58
|
-
if (prevGroupId !== groupId || !haveSameParents(prevField, newField, depth)
|
|
67
|
+
if (prevGroupId !== groupId || !haveSameParents(prevField, newField, depth) ||
|
|
68
|
+
// Fix for https://github.com/mui/mui-x/issues/7041
|
|
69
|
+
haveDifferentContainers(prevField, newField)) {
|
|
59
70
|
// It's a new group
|
|
60
71
|
return [...structure, {
|
|
61
72
|
columnFields: [newField],
|
|
@@ -39,7 +39,7 @@ const createGroupLookup = columnGroupingModel => {
|
|
|
39
39
|
return _extends({}, groupLookup);
|
|
40
40
|
};
|
|
41
41
|
export const columnGroupsStateInitializer = (state, props, apiRef) => {
|
|
42
|
-
var _props$experimentalFe, _props$columnGrouping, _props$columnGrouping2;
|
|
42
|
+
var _props$experimentalFe, _props$columnGrouping, _props$columnGrouping2, _apiRef$current$state;
|
|
43
43
|
if (!((_props$experimentalFe = props.experimentalFeatures) != null && _props$experimentalFe.columnGrouping)) {
|
|
44
44
|
return state;
|
|
45
45
|
}
|
|
@@ -47,7 +47,8 @@ export const columnGroupsStateInitializer = (state, props, apiRef) => {
|
|
|
47
47
|
const visibleColumnFields = gridVisibleColumnFieldsSelector(apiRef);
|
|
48
48
|
const groupLookup = createGroupLookup((_props$columnGrouping = props.columnGroupingModel) != null ? _props$columnGrouping : []);
|
|
49
49
|
const unwrappedGroupingModel = unwrapGroupingColumnModel((_props$columnGrouping2 = props.columnGroupingModel) != null ? _props$columnGrouping2 : []);
|
|
50
|
-
const columnGroupsHeaderStructure = getColumnGroupsHeaderStructure(columnFields, unwrappedGroupingModel
|
|
50
|
+
const columnGroupsHeaderStructure = getColumnGroupsHeaderStructure(columnFields, unwrappedGroupingModel, // @ts-expect-error Move this part to `Pro` package
|
|
51
|
+
(_apiRef$current$state = apiRef.current.state.pinnedColumns) != null ? _apiRef$current$state : {});
|
|
51
52
|
const maxDepth = visibleColumnFields.length === 0 ? 0 : Math.max(...visibleColumnFields.map(field => {
|
|
52
53
|
var _unwrappedGroupingMod, _unwrappedGroupingMod2;
|
|
53
54
|
return (_unwrappedGroupingMod = (_unwrappedGroupingMod2 = unwrappedGroupingModel[field]) == null ? void 0 : _unwrappedGroupingMod2.length) != null ? _unwrappedGroupingMod : 0;
|
|
@@ -89,9 +90,12 @@ export const useGridColumnGrouping = (apiRef, props) => {
|
|
|
89
90
|
var _props$columnGrouping3;
|
|
90
91
|
const unwrappedGroupingModel = unwrapGroupingColumnModel((_props$columnGrouping3 = props.columnGroupingModel) != null ? _props$columnGrouping3 : []);
|
|
91
92
|
apiRef.current.setState(state => {
|
|
92
|
-
var _state$columns$ordere, _state$columns;
|
|
93
|
+
var _state$columns$ordere, _state$columns, _state$pinnedColumns;
|
|
93
94
|
const orderedFields = (_state$columns$ordere = (_state$columns = state.columns) == null ? void 0 : _state$columns.orderedFields) != null ? _state$columns$ordere : [];
|
|
94
|
-
|
|
95
|
+
|
|
96
|
+
// @ts-expect-error Move this logic to `Pro` package
|
|
97
|
+
const pinnedColumns = (_state$pinnedColumns = state.pinnedColumns) != null ? _state$pinnedColumns : {};
|
|
98
|
+
const columnGroupsHeaderStructure = getColumnGroupsHeaderStructure(orderedFields, unwrappedGroupingModel, pinnedColumns);
|
|
95
99
|
return _extends({}, state, {
|
|
96
100
|
columnGrouping: _extends({}, state.columnGrouping, {
|
|
97
101
|
headerStructure: columnGroupsHeaderStructure
|
|
@@ -100,15 +104,17 @@ export const useGridColumnGrouping = (apiRef, props) => {
|
|
|
100
104
|
});
|
|
101
105
|
}, [apiRef, props.columnGroupingModel]);
|
|
102
106
|
const updateColumnGroupingState = React.useCallback(columnGroupingModel => {
|
|
103
|
-
var _props$experimentalFe2;
|
|
107
|
+
var _props$experimentalFe2, _apiRef$current$getPi, _apiRef$current$getPi2, _apiRef$current;
|
|
104
108
|
if (!((_props$experimentalFe2 = props.experimentalFeatures) != null && _props$experimentalFe2.columnGrouping)) {
|
|
105
109
|
return;
|
|
106
110
|
}
|
|
111
|
+
// @ts-expect-error Move this logic to `Pro` package
|
|
112
|
+
const pinnedColumns = (_apiRef$current$getPi = (_apiRef$current$getPi2 = (_apiRef$current = apiRef.current).getPinnedColumns) == null ? void 0 : _apiRef$current$getPi2.call(_apiRef$current)) != null ? _apiRef$current$getPi : {};
|
|
107
113
|
const columnFields = gridColumnFieldsSelector(apiRef);
|
|
108
114
|
const visibleColumnFields = gridVisibleColumnFieldsSelector(apiRef);
|
|
109
115
|
const groupLookup = createGroupLookup(columnGroupingModel != null ? columnGroupingModel : []);
|
|
110
116
|
const unwrappedGroupingModel = unwrapGroupingColumnModel(columnGroupingModel != null ? columnGroupingModel : []);
|
|
111
|
-
const columnGroupsHeaderStructure = getColumnGroupsHeaderStructure(columnFields, unwrappedGroupingModel);
|
|
117
|
+
const columnGroupsHeaderStructure = getColumnGroupsHeaderStructure(columnFields, unwrappedGroupingModel, pinnedColumns);
|
|
112
118
|
const maxDepth = visibleColumnFields.length === 0 ? 0 : Math.max(...visibleColumnFields.map(field => {
|
|
113
119
|
var _unwrappedGroupingMod4, _unwrappedGroupingMod5;
|
|
114
120
|
return (_unwrappedGroupingMod4 = (_unwrappedGroupingMod5 = unwrappedGroupingModel[field]) == null ? void 0 : _unwrappedGroupingMod5.length) != null ? _unwrappedGroupingMod4 : 0;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { GridRowId } from '../../../models';
|
|
2
1
|
import { GridColDef, GridStateColDef } from '../../../models/colDef/gridColDef';
|
|
3
2
|
import type { GridColumnDimensionProperties } from './gridColumnsUtils';
|
|
4
3
|
export type GridColumnLookup = {
|
|
@@ -24,4 +23,4 @@ export type GridColumnsRawState = Omit<GridColumnsState, 'lookup'> & {
|
|
|
24
23
|
lookup: GridColumnRawLookup;
|
|
25
24
|
};
|
|
26
25
|
export type GridHydrateColumnsValue = GridColumnsRawState;
|
|
27
|
-
export type GridColumnVisibilityModel = Record<
|
|
26
|
+
export type GridColumnVisibilityModel = Record<GridColDef['field'], boolean>;
|
|
@@ -50,7 +50,6 @@ export function computeFlexColumnsWidth({
|
|
|
50
50
|
for (let i = 0; i < flexColumns.length; i += 1) {
|
|
51
51
|
const column = flexColumns[i];
|
|
52
52
|
if (flexColumnsLookup.all[column.field] && flexColumnsLookup.all[column.field].frozen === true) {
|
|
53
|
-
// eslint-disable-next-line no-continue
|
|
54
53
|
continue;
|
|
55
54
|
}
|
|
56
55
|
|
|
@@ -161,7 +161,7 @@ export const buildAggregatedFilterItemsApplier = (getRowId, filterModel, apiRef,
|
|
|
161
161
|
|
|
162
162
|
// We generate a new function with `eval()` to avoid expensive patterns for JS engines
|
|
163
163
|
// such as a dynamic object assignment, e.g. `{ [dynamicKey]: value }`.
|
|
164
|
-
const filterItemTemplate = `(function filterItem$$(appliers, row, shouldApplyFilter) {
|
|
164
|
+
const filterItemTemplate = `(function filterItem$$(getRowId, appliers, row, shouldApplyFilter) {
|
|
165
165
|
${appliers.map((applier, i) => `const shouldApply${i} = !shouldApplyFilter || shouldApplyFilter(${JSON.stringify(applier.item.field)});`).join('\n')}
|
|
166
166
|
|
|
167
167
|
const result$$ = {
|
|
@@ -175,7 +175,7 @@ export const buildAggregatedFilterItemsApplier = (getRowId, filterModel, apiRef,
|
|
|
175
175
|
})`;
|
|
176
176
|
const filterItemCore = evalCode(filterItemTemplate.replaceAll('$$', String(filterItemsApplierId)));
|
|
177
177
|
const filterItem = (row, shouldApplyItem) => {
|
|
178
|
-
return filterItemCore(appliers, row, shouldApplyItem);
|
|
178
|
+
return filterItemCore(getRowId, appliers, row, shouldApplyItem);
|
|
179
179
|
};
|
|
180
180
|
filterItemsApplierId += 1;
|
|
181
181
|
return filterItem;
|
|
@@ -225,7 +225,7 @@ export const buildAggregatedQuickFilterApplier = (getRowId, filterModel, apiRef)
|
|
|
225
225
|
const result = {};
|
|
226
226
|
const usedCellParams = {};
|
|
227
227
|
|
|
228
|
-
/* eslint-disable no-restricted-syntax, no-labels
|
|
228
|
+
/* eslint-disable no-restricted-syntax, no-labels */
|
|
229
229
|
outer: for (let v = 0; v < quickFilterValues.length; v += 1) {
|
|
230
230
|
const filterValue = quickFilterValues[v];
|
|
231
231
|
for (let i = 0; i < appliersPerField.length; i += 1) {
|
|
@@ -263,7 +263,7 @@ export const buildAggregatedQuickFilterApplier = (getRowId, filterModel, apiRef)
|
|
|
263
263
|
}
|
|
264
264
|
result[filterValue] = false;
|
|
265
265
|
}
|
|
266
|
-
/* eslint-enable no-restricted-syntax, no-labels
|
|
266
|
+
/* eslint-enable no-restricted-syntax, no-labels */
|
|
267
267
|
|
|
268
268
|
return result;
|
|
269
269
|
};
|