@mui/x-data-grid 7.24.0 → 7.25.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 +148 -0
- package/DataGrid/DataGrid.js +1 -7
- package/DataGrid/useDataGridComponent.d.ts +2 -1
- package/components/GridRow.d.ts +0 -1
- package/components/GridRow.js +25 -19
- package/components/cell/GridCell.d.ts +9 -6
- package/components/cell/GridCell.js +29 -52
- package/components/columnHeaders/GridColumnHeaderFilterIconButton.d.ts +3 -3
- package/components/columnHeaders/GridColumnHeaderFilterIconButton.js +21 -7
- package/components/containers/GridRootStyles.js +135 -37
- package/components/panel/GridPanel.js +2 -1
- package/components/panel/filterPanel/GridFilterInputValueProps.d.ts +2 -1
- package/components/toolbar/GridToolbarColumnsButton.js +8 -2
- package/components/toolbar/GridToolbarDensitySelector.js +2 -2
- package/components/toolbar/GridToolbarExportContainer.js +2 -2
- package/components/toolbar/GridToolbarFilterButton.js +8 -2
- package/components/virtualization/GridMainContainer.d.ts +10 -0
- package/components/virtualization/GridMainContainer.js +10 -2
- package/components/virtualization/GridVirtualScrollbar.d.ts +4 -0
- package/components/virtualization/GridVirtualScrollbar.js +5 -5
- package/components/virtualization/GridVirtualScroller.js +18 -5
- package/components/virtualization/GridVirtualScrollerContent.js +11 -2
- package/context/GridContextProvider.d.ts +2 -1
- package/hooks/core/pipeProcessing/useGridPipeProcessing.d.ts +2 -2
- package/hooks/core/pipeProcessing/useGridRegisterPipeApplier.d.ts +2 -2
- package/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.d.ts +2 -2
- package/hooks/core/strategyProcessing/useGridRegisterStrategyProcessor.d.ts +2 -2
- package/hooks/core/strategyProcessing/useGridStrategyProcessing.d.ts +2 -2
- package/hooks/core/useGridApiInitialization.d.ts +2 -2
- package/hooks/core/useGridInitialization.d.ts +2 -2
- package/hooks/core/useGridIsRtl.d.ts +2 -2
- package/hooks/core/useGridLocaleText.d.ts +2 -2
- package/hooks/core/useGridLoggerFactory.d.ts +2 -2
- package/hooks/core/useGridRefs.d.ts +2 -2
- package/hooks/core/useGridStateInitialization.d.ts +2 -2
- package/hooks/features/clipboard/useGridClipboard.d.ts +2 -2
- package/hooks/features/columnGrouping/useGridColumnGrouping.d.ts +2 -2
- package/hooks/features/columnMenu/useGridColumnMenu.d.ts +2 -2
- package/hooks/features/columnMenu/useGridColumnMenu.js +0 -2
- package/hooks/features/columnResize/useGridColumnResize.d.ts +2 -2
- package/hooks/features/columnResize/useGridColumnResize.js +2 -1
- package/hooks/features/columns/gridColumnsUtils.d.ts +4 -4
- package/hooks/features/columns/useGridColumnSpanning.d.ts +2 -2
- package/hooks/features/columns/useGridColumns.d.ts +2 -2
- package/hooks/features/columns/useGridColumns.js +7 -3
- package/hooks/features/density/useGridDensity.d.ts +2 -2
- package/hooks/features/dimensions/useGridDimensions.d.ts +2 -2
- package/hooks/features/dimensions/useGridDimensions.js +7 -11
- package/hooks/features/editing/gridEditingSelectors.d.ts +6 -0
- package/hooks/features/editing/gridEditingSelectors.js +7 -1
- package/hooks/features/editing/index.d.ts +1 -1
- package/hooks/features/editing/index.js +1 -1
- package/hooks/features/editing/useGridCellEditing.d.ts +2 -2
- package/hooks/features/editing/useGridCellEditing.js +3 -3
- package/hooks/features/editing/useGridEditing.d.ts +2 -2
- package/hooks/features/editing/useGridRowEditing.d.ts +2 -2
- package/hooks/features/editing/useGridRowEditing.js +5 -6
- package/hooks/features/events/useGridEvents.d.ts +2 -2
- package/hooks/features/export/serializers/csvSerializer.d.ts +2 -1
- package/hooks/features/export/useGridCsvExport.d.ts +2 -2
- package/hooks/features/export/useGridPrintExport.d.ts +2 -2
- package/hooks/features/export/utils.d.ts +2 -2
- package/hooks/features/filter/gridFilterUtils.d.ts +7 -7
- package/hooks/features/filter/gridFilterUtils.js +3 -3
- package/hooks/features/filter/useGridFilter.d.ts +2 -2
- package/hooks/features/focus/useGridFocus.d.ts +2 -2
- package/hooks/features/focus/useGridFocus.js +3 -2
- package/hooks/features/headerFiltering/useGridHeaderFiltering.d.ts +2 -2
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.d.ts +2 -2
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +24 -16
- package/hooks/features/keyboardNavigation/utils.d.ts +3 -4
- package/hooks/features/keyboardNavigation/utils.js +0 -5
- package/hooks/features/listView/useGridListView.d.ts +2 -2
- package/hooks/features/listView/useGridListView.js +2 -1
- package/hooks/features/pagination/useGridPagination.d.ts +2 -2
- package/hooks/features/pagination/useGridPaginationMeta.d.ts +2 -2
- package/hooks/features/pagination/useGridPaginationModel.d.ts +2 -2
- package/hooks/features/pagination/useGridRowCount.d.ts +2 -2
- package/hooks/features/preferencesPanel/gridPreferencePanelSelector.d.ts +1 -0
- package/hooks/features/preferencesPanel/gridPreferencePanelSelector.js +8 -1
- package/hooks/features/preferencesPanel/index.d.ts +1 -1
- package/hooks/features/preferencesPanel/index.js +1 -1
- package/hooks/features/preferencesPanel/useGridPreferencesPanel.d.ts +2 -2
- package/hooks/features/preferencesPanel/useGridPreferencesPanel.js +14 -38
- package/hooks/features/rowSelection/useGridRowSelection.d.ts +2 -2
- package/hooks/features/rowSelection/useGridRowSelection.js +3 -3
- package/hooks/features/rowSelection/useGridRowSelectionPreProcessors.d.ts +2 -2
- package/hooks/features/rowSelection/utils.d.ts +3 -2
- package/hooks/features/rows/gridRowSpanningUtils.d.ts +2 -2
- package/hooks/features/rows/gridRowsUtils.d.ts +4 -4
- package/hooks/features/rows/useGridParamsApi.d.ts +2 -2
- package/hooks/features/rows/useGridParamsApi.js +33 -14
- package/hooks/features/rows/useGridRowSpanning.d.ts +2 -2
- package/hooks/features/rows/useGridRowSpanning.js +94 -91
- package/hooks/features/rows/useGridRows.d.ts +2 -2
- package/hooks/features/rows/useGridRows.js +7 -8
- package/hooks/features/rows/useGridRowsMeta.d.ts +2 -2
- package/hooks/features/rows/useGridRowsMeta.js +3 -2
- package/hooks/features/rows/useGridRowsPreProcessors.d.ts +2 -2
- package/hooks/features/scroll/useGridScroll.d.ts +2 -2
- package/hooks/features/sorting/gridSortingUtils.d.ts +3 -3
- package/hooks/features/sorting/gridSortingUtils.js +2 -2
- package/hooks/features/sorting/useGridSorting.d.ts +2 -2
- package/hooks/features/statePersistence/useGridStatePersistence.d.ts +2 -2
- package/hooks/features/virtualization/gridFocusedVirtualCellSelector.js +2 -2
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +9 -1
- package/hooks/features/virtualization/useGridVirtualScroller.js +32 -53
- package/hooks/features/virtualization/useGridVirtualization.d.ts +2 -2
- package/hooks/utils/useGridApiContext.d.ts +2 -2
- package/hooks/utils/useGridApiEventHandler.d.ts +4 -4
- package/hooks/utils/useGridApiMethod.d.ts +2 -2
- package/hooks/utils/useGridApiRef.d.ts +2 -2
- package/hooks/utils/useGridApiRef.js +3 -1
- package/hooks/utils/useGridInitializeState.d.ts +3 -3
- package/hooks/utils/useGridLogger.d.ts +2 -2
- package/hooks/utils/useGridNativeEventListener.d.ts +2 -1
- package/hooks/utils/useGridPrivateApiContext.d.ts +2 -1
- package/hooks/utils/useGridSelector.d.ts +3 -3
- package/hooks/utils/useGridVisibleRows.d.ts +3 -3
- package/index.js +1 -1
- package/locales/faIR.js +5 -6
- package/models/api/gridApiCommon.d.ts +2 -2
- package/models/api/gridParamsApi.d.ts +29 -2
- package/models/api/index.d.ts +1 -1
- package/models/api/index.js +0 -1
- package/models/colDef/gridColDef.d.ts +9 -8
- package/models/gridExport.d.ts +2 -2
- package/models/gridFilterOperator.d.ts +2 -1
- package/models/props/DataGridProps.d.ts +2 -1
- package/modern/DataGrid/DataGrid.js +1 -7
- package/modern/components/GridRow.js +25 -19
- package/modern/components/cell/GridCell.js +29 -52
- package/modern/components/columnHeaders/GridColumnHeaderFilterIconButton.js +21 -7
- package/modern/components/containers/GridRootStyles.js +135 -37
- package/modern/components/panel/GridPanel.js +2 -1
- package/modern/components/toolbar/GridToolbarColumnsButton.js +8 -2
- package/modern/components/toolbar/GridToolbarDensitySelector.js +2 -2
- package/modern/components/toolbar/GridToolbarExportContainer.js +2 -2
- package/modern/components/toolbar/GridToolbarFilterButton.js +8 -2
- package/modern/components/virtualization/GridMainContainer.js +10 -2
- package/modern/components/virtualization/GridVirtualScrollbar.js +5 -5
- package/modern/components/virtualization/GridVirtualScroller.js +18 -5
- package/modern/components/virtualization/GridVirtualScrollerContent.js +11 -2
- package/modern/hooks/features/columnMenu/useGridColumnMenu.js +0 -2
- package/modern/hooks/features/columnResize/useGridColumnResize.js +2 -1
- package/modern/hooks/features/columns/useGridColumns.js +7 -3
- package/modern/hooks/features/dimensions/useGridDimensions.js +7 -11
- package/modern/hooks/features/editing/gridEditingSelectors.js +7 -1
- package/modern/hooks/features/editing/index.js +1 -1
- package/modern/hooks/features/editing/useGridCellEditing.js +3 -3
- package/modern/hooks/features/editing/useGridRowEditing.js +5 -6
- package/modern/hooks/features/filter/gridFilterUtils.js +3 -3
- package/modern/hooks/features/focus/useGridFocus.js +3 -2
- package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +24 -16
- package/modern/hooks/features/keyboardNavigation/utils.js +0 -5
- package/modern/hooks/features/listView/useGridListView.js +2 -1
- package/modern/hooks/features/preferencesPanel/gridPreferencePanelSelector.js +8 -1
- package/modern/hooks/features/preferencesPanel/index.js +1 -1
- package/modern/hooks/features/preferencesPanel/useGridPreferencesPanel.js +14 -38
- package/modern/hooks/features/rowSelection/useGridRowSelection.js +3 -3
- package/modern/hooks/features/rows/useGridParamsApi.js +33 -14
- package/modern/hooks/features/rows/useGridRowSpanning.js +94 -91
- package/modern/hooks/features/rows/useGridRows.js +7 -8
- package/modern/hooks/features/rows/useGridRowsMeta.js +3 -2
- package/modern/hooks/features/sorting/gridSortingUtils.js +2 -2
- package/modern/hooks/features/virtualization/gridFocusedVirtualCellSelector.js +2 -2
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +32 -53
- package/modern/hooks/utils/useGridApiRef.js +3 -1
- package/modern/index.js +1 -1
- package/modern/locales/faIR.js +5 -6
- package/modern/models/api/index.js +0 -1
- package/modern/utils/isJSDOM.js +1 -0
- package/modern/utils/roundToDecimalPlaces.js +3 -0
- package/modern/utils/utils.js +6 -1
- package/node/DataGrid/DataGrid.js +1 -7
- package/node/components/GridRow.js +22 -16
- package/node/components/cell/GridCell.js +27 -50
- package/node/components/columnHeaders/GridColumnHeaderFilterIconButton.js +20 -6
- package/node/components/containers/GridRootStyles.js +135 -37
- package/node/components/panel/GridPanel.js +2 -1
- package/node/components/toolbar/GridToolbarColumnsButton.js +8 -2
- package/node/components/toolbar/GridToolbarDensitySelector.js +2 -2
- package/node/components/toolbar/GridToolbarExportContainer.js +2 -2
- package/node/components/toolbar/GridToolbarFilterButton.js +8 -2
- package/node/components/virtualization/GridMainContainer.js +10 -2
- package/node/components/virtualization/GridVirtualScrollbar.js +5 -5
- package/node/components/virtualization/GridVirtualScroller.js +18 -5
- package/node/components/virtualization/GridVirtualScrollerContent.js +11 -2
- package/node/hooks/features/columnMenu/useGridColumnMenu.js +0 -2
- package/node/hooks/features/columnResize/useGridColumnResize.js +2 -1
- package/node/hooks/features/columns/useGridColumns.js +7 -3
- package/node/hooks/features/dimensions/useGridDimensions.js +9 -13
- package/node/hooks/features/editing/gridEditingSelectors.js +8 -2
- package/node/hooks/features/editing/index.js +7 -11
- package/node/hooks/features/editing/useGridCellEditing.js +2 -2
- package/node/hooks/features/editing/useGridRowEditing.js +3 -4
- package/node/hooks/features/filter/gridFilterUtils.js +3 -3
- package/node/hooks/features/focus/useGridFocus.js +3 -2
- package/node/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +24 -15
- package/node/hooks/features/keyboardNavigation/utils.js +0 -6
- package/node/hooks/features/listView/useGridListView.js +2 -1
- package/node/hooks/features/preferencesPanel/gridPreferencePanelSelector.js +9 -2
- package/node/hooks/features/preferencesPanel/index.js +11 -10
- package/node/hooks/features/preferencesPanel/useGridPreferencesPanel.js +14 -38
- package/node/hooks/features/rowSelection/useGridRowSelection.js +2 -2
- package/node/hooks/features/rows/useGridParamsApi.js +33 -14
- package/node/hooks/features/rows/useGridRowSpanning.js +92 -89
- package/node/hooks/features/rows/useGridRows.js +7 -8
- package/node/hooks/features/rows/useGridRowsMeta.js +5 -4
- package/node/hooks/features/sorting/gridSortingUtils.js +2 -2
- package/node/hooks/features/virtualization/gridFocusedVirtualCellSelector.js +2 -2
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +34 -55
- package/node/hooks/utils/useGridApiRef.js +3 -1
- package/node/index.js +1 -1
- package/node/locales/faIR.js +5 -6
- package/node/models/api/index.js +0 -11
- package/node/utils/isJSDOM.js +7 -0
- package/node/utils/roundToDecimalPlaces.js +9 -0
- package/node/utils/utils.js +8 -1
- package/package.json +2 -2
- package/utils/createSelector.d.ts +3 -3
- package/utils/getPublicApiRef.d.ts +2 -1
- package/utils/isJSDOM.d.ts +1 -0
- package/utils/isJSDOM.js +1 -0
- package/utils/roundToDecimalPlaces.d.ts +1 -0
- package/utils/roundToDecimalPlaces.js +3 -0
- package/utils/utils.d.ts +1 -0
- package/utils/utils.js +6 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,154 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 7.25.0
|
|
7
|
+
|
|
8
|
+
_Jan 31, 2025_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 5 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🐞 Bugfixes
|
|
13
|
+
|
|
14
|
+
Special thanks go out to the community contributors who have helped make this release possible:
|
|
15
|
+
@k-rajat19, @lauri865.
|
|
16
|
+
Following are all team members who have contributed to this release:
|
|
17
|
+
@KenanYusuf, @MBilalShafi, @arminmeh.
|
|
18
|
+
|
|
19
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
20
|
+
|
|
21
|
+
### Data Grid
|
|
22
|
+
|
|
23
|
+
#### `@mui/x-data-grid@7.25.0`
|
|
24
|
+
|
|
25
|
+
- [DataGrid] Fix `renderContext` calculation with scroll bounce / over-scroll (#16368) @lauri865
|
|
26
|
+
- [DataGrid] Refactor row state propagation (#16351) @lauri865
|
|
27
|
+
- [DataGrid] Add missing style overrides (#16272) (#16358) @KenanYusuf
|
|
28
|
+
- [DataGrid] Fix header filters keyboard navigation when there are no rows (#16369) @k-rajat19
|
|
29
|
+
- [DataGrid] Fix order of `onClick` prop on toolbar buttons (#16364) @KenanYusuf
|
|
30
|
+
- [DataGrid] Improve test coverage of server side data source (#15988) @MBilalShafi
|
|
31
|
+
- [DataGrid] Remove outdated warning (#16370) @MBilalShafi
|
|
32
|
+
- [DataGrid] Respect width of `iconContainer` during autosizing (#16409) @michelengelen
|
|
33
|
+
|
|
34
|
+
#### `@mui/x-data-grid-pro@7.25.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
35
|
+
|
|
36
|
+
Same changes as in `@mui/x-data-grid@7.25.0`, plus:
|
|
37
|
+
|
|
38
|
+
- [DataGridPro] Fix the return type of `useGridApiRef` for Pro and Premium packages on React < 19 (#16348) @arminmeh
|
|
39
|
+
- [DataGridPro] Fetch new rows only once when multiple models are changed in one cycle (#16382) @arminmeh
|
|
40
|
+
|
|
41
|
+
#### `@mui/x-data-grid-premium@7.25.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
42
|
+
|
|
43
|
+
Same changes as in `@mui/x-data-grid-pro@7.25.0`.
|
|
44
|
+
|
|
45
|
+
### Date and Time Pickers
|
|
46
|
+
|
|
47
|
+
#### `@mui/x-date-pickers@7.25.0`
|
|
48
|
+
|
|
49
|
+
Internal changes.
|
|
50
|
+
|
|
51
|
+
#### `@mui/x-date-pickers-pro@7.25.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
52
|
+
|
|
53
|
+
Same changes as in `@mui/x-date-pickers@7.25.0`.
|
|
54
|
+
|
|
55
|
+
### Charts
|
|
56
|
+
|
|
57
|
+
#### `@mui/x-charts@7.25.0`
|
|
58
|
+
|
|
59
|
+
Internal changes.
|
|
60
|
+
|
|
61
|
+
#### `@mui/x-charts-pro@7.25.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
62
|
+
|
|
63
|
+
Same changes as in `@mui/x-charts@7.25.0`.
|
|
64
|
+
|
|
65
|
+
### Tree View
|
|
66
|
+
|
|
67
|
+
#### `@mui/x-tree-view@7.25.0`
|
|
68
|
+
|
|
69
|
+
Internal changes.
|
|
70
|
+
|
|
71
|
+
#### `@mui/x-tree-view-pro@7.25.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
72
|
+
|
|
73
|
+
Same changes as in `@mui/x-tree-view@7.25.0`.
|
|
74
|
+
|
|
75
|
+
### Docs
|
|
76
|
+
|
|
77
|
+
- [docs] Improve release documentation (#16322) @MBilalShafi
|
|
78
|
+
|
|
79
|
+
### Core
|
|
80
|
+
|
|
81
|
+
- [test] Fix flaky data source tests in DataGrid (#16382) @lauri865
|
|
82
|
+
|
|
83
|
+
## 7.24.1
|
|
84
|
+
|
|
85
|
+
_Jan 24, 2025_
|
|
86
|
+
|
|
87
|
+
We'd like to offer a big thanks to the 7 contributors who made this release possible. Here are some highlights ✨:
|
|
88
|
+
|
|
89
|
+
- 🐞 Bugfixes
|
|
90
|
+
- 🌍 Improve Persian (fa-IR) locale on the Data Grid
|
|
91
|
+
|
|
92
|
+
Special thanks go out to the community contributors who have helped make this release possible:
|
|
93
|
+
@mostafaRoosta74, @lauri865.
|
|
94
|
+
Following are all team members who have contributed to this release:
|
|
95
|
+
@alexfauquette, @JCQuintas, @cherniavskii, @LukasTy, @arminmeh.
|
|
96
|
+
|
|
97
|
+
### Data Grid
|
|
98
|
+
|
|
99
|
+
#### `@mui/x-data-grid@7.24.1`
|
|
100
|
+
|
|
101
|
+
- [DataGrid] Fix toggling preference panel from toolbar (#16276) @lauri865
|
|
102
|
+
- [DataGrid] Only try to mount filter button if there are filters present (#16269) @lauri865
|
|
103
|
+
- [DataGrid] Revert `apiRef` to be `MutableRefObject` for React versions < 19 (#16320) @arminmeh
|
|
104
|
+
- [l10n] Improve Persian (fa-IR) locale (#15964) @mostafaRoosta74
|
|
105
|
+
|
|
106
|
+
#### `@mui/x-data-grid-pro@7.24.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
107
|
+
|
|
108
|
+
Same changes as in `@mui/x-data-grid@7.24.1`.
|
|
109
|
+
|
|
110
|
+
#### `@mui/x-data-grid-premium@7.24.1` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
111
|
+
|
|
112
|
+
Same changes as in `@mui/x-data-grid-pro@7.24.1`.
|
|
113
|
+
|
|
114
|
+
### Date and Time Pickers
|
|
115
|
+
|
|
116
|
+
#### `@mui/x-date-pickers@7.24.1`
|
|
117
|
+
|
|
118
|
+
- [fields] Reset `all` selected state on section edit (#16232) @LukasTy
|
|
119
|
+
|
|
120
|
+
#### `@mui/x-date-pickers-pro@7.24.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
121
|
+
|
|
122
|
+
Same changes as in `@mui/x-date-pickers@7.24.1`.
|
|
123
|
+
|
|
124
|
+
### Charts
|
|
125
|
+
|
|
126
|
+
#### `@mui/x-charts@7.24.1`
|
|
127
|
+
|
|
128
|
+
- [charts] Handle case where gradient stop `offset` could be `Infinite` (@JCQuintas) (#16309) @JCQuintas
|
|
129
|
+
|
|
130
|
+
#### `@mui/x-charts-pro@7.24.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
131
|
+
|
|
132
|
+
Same changes as in `@mui/x-charts@7.24.1`.
|
|
133
|
+
|
|
134
|
+
### Tree View
|
|
135
|
+
|
|
136
|
+
#### `@mui/x-tree-view@7.24.1`
|
|
137
|
+
|
|
138
|
+
Internal changes.
|
|
139
|
+
|
|
140
|
+
#### `@mui/x-tree-view-pro@7.24.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
141
|
+
|
|
142
|
+
Same changes as in `@mui/x-tree-view@7.24.1`.
|
|
143
|
+
|
|
144
|
+
### Docs
|
|
145
|
+
|
|
146
|
+
- [docs] Fix `domainLimit` definition (#16271) @alexfauquette
|
|
147
|
+
|
|
148
|
+
### Core
|
|
149
|
+
|
|
150
|
+
- [core] Make `@mui/x-internals` a dependency of `@mui/x-license` (#16265) @alexfauquette
|
|
151
|
+
- [test] Fix flaky column pinning tests (#16228) @cherniavskii
|
|
152
|
+
- [test] Fix flaky tests (#16264) @lauri865
|
|
153
|
+
|
|
6
154
|
## 7.24.0
|
|
7
155
|
|
|
8
156
|
_Jan 17, 2025_
|
package/DataGrid/DataGrid.js
CHANGED
|
@@ -18,17 +18,11 @@ const configuration = {
|
|
|
18
18
|
useGridRowAriaAttributes
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
|
-
let propValidators;
|
|
22
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
23
|
-
propValidators = [...propValidatorsDataGrid,
|
|
24
|
-
// Only validate in MIT version
|
|
25
|
-
props => props.columns && props.columns.some(column => column.resizable) && [`MUI X: \`column.resizable = true\` is not a valid prop.`, 'Column resizing is not available in the MIT version.', '', 'You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature.'].join('\n') || undefined];
|
|
26
|
-
}
|
|
27
21
|
const DataGridRaw = forwardRef(function DataGrid(inProps, ref) {
|
|
28
22
|
const props = useDataGridProps(inProps);
|
|
29
23
|
const privateApiRef = useDataGridComponent(props.apiRef, props);
|
|
30
24
|
if (process.env.NODE_ENV !== 'production') {
|
|
31
|
-
validateProps(props,
|
|
25
|
+
validateProps(props, propValidatorsDataGrid);
|
|
32
26
|
}
|
|
33
27
|
return /*#__PURE__*/_jsx(GridContextProvider, {
|
|
34
28
|
privateApiRef: privateApiRef,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
1
2
|
import { DataGridProcessedProps } from '../models/props/DataGridProps';
|
|
2
3
|
import { GridApiCommunity, GridPrivateApiCommunity } from '../models/api/gridApiCommunity';
|
|
3
|
-
export declare const useDataGridComponent: (inputApiRef:
|
|
4
|
+
export declare const useDataGridComponent: (inputApiRef: RefObject<GridApiCommunity> | undefined, props: DataGridProcessedProps) => import("react").RefObject<GridPrivateApiCommunity>;
|
package/components/GridRow.d.ts
CHANGED
package/components/GridRow.js
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
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", "rowHeight", "className", "visibleColumns", "pinnedColumns", "
|
|
3
|
+
const _excluded = ["selected", "rowId", "row", "index", "style", "rowHeight", "className", "visibleColumns", "pinnedColumns", "offsetLeft", "columnsTotalWidth", "firstColumnIndex", "lastColumnIndex", "focusedColumnIndex", "isFirstVisible", "isLastVisible", "isNotVisible", "showBottomBorder", "scrollbarWidth", "gridHasFiller", "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';
|
|
7
7
|
import { unstable_useForkRef as useForkRef } from '@mui/utils';
|
|
8
8
|
import { fastMemo } from '@mui/x-internals/fastMemo';
|
|
9
9
|
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
10
|
-
import {
|
|
10
|
+
import { isObjectEmpty } from '@mui/x-internals/isObjectEmpty';
|
|
11
|
+
import { GridEditModes, GridCellModes } from "../models/gridEditRowModel.js";
|
|
11
12
|
import { gridClasses } from "../constants/gridClasses.js";
|
|
12
13
|
import { composeGridClasses } from "../utils/composeGridClasses.js";
|
|
13
14
|
import { useGridRootProps } from "../hooks/utils/useGridRootProps.js";
|
|
14
15
|
import { shouldCellShowLeftBorder, shouldCellShowRightBorder } from "../utils/cellBorderUtils.js";
|
|
15
16
|
import { gridColumnPositionsSelector } from "../hooks/features/columns/gridColumnsSelector.js";
|
|
16
|
-
import { useGridSelector, objectShallowCompare } from "../hooks/utils/useGridSelector.js";
|
|
17
|
+
import { useGridSelector, objectShallowCompare, useGridSelectorV8 } from "../hooks/utils/useGridSelector.js";
|
|
17
18
|
import { useGridVisibleRows } from "../hooks/utils/useGridVisibleRows.js";
|
|
18
19
|
import { findParentElementFromClassName, isEventTargetInPortal } from "../utils/domUtils.js";
|
|
19
20
|
import { GRID_CHECKBOX_SELECTION_COL_DEF } from "../colDef/gridCheckboxSelectionColDef.js";
|
|
@@ -21,12 +22,20 @@ import { GRID_ACTIONS_COLUMN_TYPE } from "../colDef/gridActionsColDef.js";
|
|
|
21
22
|
import { GRID_DETAIL_PANEL_TOGGLE_FIELD, PinnedColumnPosition } from "../internals/constants.js";
|
|
22
23
|
import { gridSortModelSelector } from "../hooks/features/sorting/gridSortingSelector.js";
|
|
23
24
|
import { gridRowMaximumTreeDepthSelector } from "../hooks/features/rows/gridRowsSelector.js";
|
|
24
|
-
import { gridEditRowsStateSelector } from "../hooks/features/editing/gridEditingSelectors.js";
|
|
25
|
+
import { gridEditRowsStateSelector, gridRowIsEditingSelector } from "../hooks/features/editing/gridEditingSelectors.js";
|
|
25
26
|
import { GridScrollbarFillerCell as ScrollbarFiller } from "./GridScrollbarFillerCell.js";
|
|
26
27
|
import { getPinnedCellOffset } from "../internals/utils/getPinnedCellOffset.js";
|
|
27
28
|
import { useGridConfiguration } from "../hooks/utils/useGridConfiguration.js";
|
|
28
29
|
import { useGridPrivateApiContext } from "../hooks/utils/useGridPrivateApiContext.js";
|
|
30
|
+
import { createSelectorV8 } from "../utils/createSelector.js";
|
|
29
31
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
32
|
+
const isRowReorderingEnabledSelector = createSelectorV8(gridEditRowsStateSelector, (editRows, rowReordering) => {
|
|
33
|
+
if (!rowReordering) {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
const isEditingRows = !isObjectEmpty(editRows);
|
|
37
|
+
return !isEditingRows;
|
|
38
|
+
});
|
|
30
39
|
const GridRow = forwardRef(function GridRow(props, refProp) {
|
|
31
40
|
const {
|
|
32
41
|
selected,
|
|
@@ -65,10 +74,11 @@ const GridRow = forwardRef(function GridRow(props, refProp) {
|
|
|
65
74
|
const sortModel = useGridSelector(apiRef, gridSortModelSelector);
|
|
66
75
|
const treeDepth = useGridSelector(apiRef, gridRowMaximumTreeDepthSelector);
|
|
67
76
|
const columnPositions = useGridSelector(apiRef, gridColumnPositionsSelector);
|
|
68
|
-
const
|
|
77
|
+
const rowReordering = rootProps.rowReordering;
|
|
78
|
+
const isRowReorderingEnabled = useGridSelectorV8(apiRef, isRowReorderingEnabledSelector, rowReordering);
|
|
69
79
|
const handleRef = useForkRef(ref, refProp);
|
|
70
80
|
const rowNode = apiRef.current.getRowNode(rowId);
|
|
71
|
-
const editing = apiRef
|
|
81
|
+
const editing = useGridSelectorV8(apiRef, gridRowIsEditingSelector, rowId);
|
|
72
82
|
const editable = rootProps.editMode === GridEditModes.Row;
|
|
73
83
|
const hasFocusCell = focusedColumnIndex !== undefined;
|
|
74
84
|
const hasVirtualFocusCellLeft = hasFocusCell && focusedColumnIndex >= pinnedColumns.left.length && focusedColumnIndex < firstColumnIndex;
|
|
@@ -145,7 +155,6 @@ const GridRow = forwardRef(function GridRow(props, refProp) {
|
|
|
145
155
|
slotProps,
|
|
146
156
|
disableColumnReorder
|
|
147
157
|
} = rootProps;
|
|
148
|
-
const rowReordering = rootProps.rowReordering;
|
|
149
158
|
const heightEntry = useGridSelector(apiRef, () => _extends({}, apiRef.current.getRowHeightEntry(rowId)), objectShallowCompare);
|
|
150
159
|
const style = React.useMemo(() => {
|
|
151
160
|
if (isNotVisible) {
|
|
@@ -188,6 +197,11 @@ const GridRow = forwardRef(function GridRow(props, refProp) {
|
|
|
188
197
|
});
|
|
189
198
|
rowClassNames.push(rootProps.getRowClassName(rowParams));
|
|
190
199
|
}
|
|
200
|
+
|
|
201
|
+
/* Start of rendering */
|
|
202
|
+
if (!rowNode) {
|
|
203
|
+
return null;
|
|
204
|
+
}
|
|
191
205
|
const getCell = (column, indexInSection, indexRelativeToAllColumns, sectionLength, pinnedPosition = PinnedColumnPosition.NONE) => {
|
|
192
206
|
const cellColSpanInfo = apiRef.current.unstable_getCellColSpanInfo(rowId, indexRelativeToAllColumns);
|
|
193
207
|
if (cellColSpanInfo?.spannedByColSpan) {
|
|
@@ -205,14 +219,12 @@ const GridRow = forwardRef(function GridRow(props, refProp) {
|
|
|
205
219
|
align: column.align
|
|
206
220
|
}, column.field);
|
|
207
221
|
}
|
|
208
|
-
const editCellState = editRowsState[rowId]?.[column.field] ?? null;
|
|
209
222
|
|
|
210
223
|
// when the cell is a reorder cell we are not allowing to reorder the col
|
|
211
224
|
// fixes https://github.com/mui/mui-x/issues/11126
|
|
212
225
|
const isReorderCell = column.field === '__reorder__';
|
|
213
|
-
const isEditingRows = Object.keys(editRowsState).length > 0;
|
|
214
226
|
const canReorderColumn = !(disableColumnReorder || column.disableReorder);
|
|
215
|
-
const canReorderRow =
|
|
227
|
+
const canReorderRow = isRowReorderingEnabled && !sortModel.length && treeDepth <= 1;
|
|
216
228
|
const disableDragEvents = !(canReorderColumn || isReorderCell && canReorderRow);
|
|
217
229
|
const cellIsNotVisible = pinnedPosition === PinnedColumnPosition.VIRTUAL;
|
|
218
230
|
const showLeftBorder = shouldCellShowLeftBorder(pinnedPosition, indexInSection);
|
|
@@ -225,20 +237,15 @@ const GridRow = forwardRef(function GridRow(props, refProp) {
|
|
|
225
237
|
colIndex: indexRelativeToAllColumns,
|
|
226
238
|
colSpan: colSpan,
|
|
227
239
|
disableDragEvents: disableDragEvents,
|
|
228
|
-
editCellState: editCellState,
|
|
229
240
|
isNotVisible: cellIsNotVisible,
|
|
230
241
|
pinnedOffset: pinnedOffset,
|
|
231
242
|
pinnedPosition: pinnedPosition,
|
|
232
243
|
showLeftBorder: showLeftBorder,
|
|
233
|
-
showRightBorder: showRightBorder
|
|
244
|
+
showRightBorder: showRightBorder,
|
|
245
|
+
row: row,
|
|
246
|
+
rowNode: rowNode
|
|
234
247
|
}, slotProps?.cell), column.field);
|
|
235
248
|
};
|
|
236
|
-
|
|
237
|
-
/* Start of rendering */
|
|
238
|
-
|
|
239
|
-
if (!rowNode) {
|
|
240
|
-
return null;
|
|
241
|
-
}
|
|
242
249
|
const leftCells = pinnedColumns.left.map((column, i) => {
|
|
243
250
|
const indexRelativeToAllColumns = i;
|
|
244
251
|
return getCell(column, i, indexRelativeToAllColumns, pinnedColumns.left.length, PinnedColumnPosition.LEFT);
|
|
@@ -316,7 +323,6 @@ process.env.NODE_ENV !== "production" ? GridRow.propTypes = {
|
|
|
316
323
|
isNotVisible: PropTypes.bool.isRequired,
|
|
317
324
|
lastColumnIndex: PropTypes.number.isRequired,
|
|
318
325
|
offsetLeft: PropTypes.number.isRequired,
|
|
319
|
-
offsetTop: PropTypes.number,
|
|
320
326
|
onClick: PropTypes.func,
|
|
321
327
|
onDoubleClick: PropTypes.func,
|
|
322
328
|
onMouseEnter: PropTypes.func,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { GridRowId
|
|
3
|
-
import {
|
|
2
|
+
import { GridRowId } from '../../models';
|
|
3
|
+
import { GridAlignment, GridStateColDef } from '../../models/colDef/gridColDef';
|
|
4
|
+
import { GridRowModel, GridTreeNode } from '../../models/gridRows';
|
|
4
5
|
import { GridPinnedColumnPosition } from '../../hooks/features/columns/gridColumnsInterfaces';
|
|
5
6
|
import { PinnedColumnPosition } from '../../internals/constants';
|
|
6
7
|
export declare const gridPinnedColumnPositionLookup: {
|
|
@@ -13,13 +14,14 @@ export type GridCellProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
|
13
14
|
align: GridAlignment;
|
|
14
15
|
className?: string;
|
|
15
16
|
colIndex: number;
|
|
16
|
-
column:
|
|
17
|
+
column: GridStateColDef;
|
|
18
|
+
row: GridRowModel;
|
|
17
19
|
rowId: GridRowId;
|
|
20
|
+
rowNode: GridTreeNode;
|
|
18
21
|
width: number;
|
|
19
22
|
colSpan?: number;
|
|
20
23
|
disableDragEvents?: boolean;
|
|
21
24
|
isNotVisible: boolean;
|
|
22
|
-
editCellState: GridEditCellProps<any> | null;
|
|
23
25
|
pinnedOffset?: number;
|
|
24
26
|
pinnedPosition: PinnedColumnPosition;
|
|
25
27
|
showRightBorder: boolean;
|
|
@@ -45,13 +47,14 @@ declare const MemoizedGridCell: React.ForwardRefExoticComponent<GridCellProps> |
|
|
|
45
47
|
align: GridAlignment;
|
|
46
48
|
className?: string;
|
|
47
49
|
colIndex: number;
|
|
48
|
-
column:
|
|
50
|
+
column: GridStateColDef;
|
|
51
|
+
row: GridRowModel;
|
|
49
52
|
rowId: GridRowId;
|
|
53
|
+
rowNode: GridTreeNode;
|
|
50
54
|
width: number;
|
|
51
55
|
colSpan?: number;
|
|
52
56
|
disableDragEvents?: boolean;
|
|
53
57
|
isNotVisible: boolean;
|
|
54
|
-
editCellState: GridEditCellProps<any> | null;
|
|
55
58
|
pinnedOffset?: number;
|
|
56
59
|
pinnedPosition: PinnedColumnPosition;
|
|
57
60
|
showRightBorder: boolean;
|
|
@@ -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 = ["column", "rowId", "
|
|
3
|
+
const _excluded = ["column", "row", "rowId", "rowNode", "align", "children", "colIndex", "width", "className", "style", "colSpan", "disableDragEvents", "isNotVisible", "pinnedOffset", "pinnedPosition", "showRightBorder", "showLeftBorder", "onClick", "onDoubleClick", "onMouseDown", "onMouseUp", "onMouseOver", "onKeyDown", "onKeyUp", "onDragEnter", "onDragOver"],
|
|
4
4
|
_excluded2 = ["changeReason", "unstable_updateValueOnRender"];
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
@@ -12,13 +12,14 @@ import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
|
12
12
|
import { doesSupportPreventScroll } from "../../utils/doesSupportPreventScroll.js";
|
|
13
13
|
import { getDataGridUtilityClass, gridClasses } from "../../constants/gridClasses.js";
|
|
14
14
|
import { GridCellModes } from "../../models/index.js";
|
|
15
|
-
import { useGridSelector,
|
|
16
|
-
import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
|
|
15
|
+
import { useGridSelector, useGridSelectorV8 } from "../../hooks/utils/useGridSelector.js";
|
|
17
16
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
18
|
-
import { gridFocusCellSelector } from "../../hooks/features/focus/gridFocusStateSelector.js";
|
|
17
|
+
import { gridFocusCellSelector, gridTabIndexCellSelector } from "../../hooks/features/focus/gridFocusStateSelector.js";
|
|
19
18
|
import { GridPinnedColumnPosition } from "../../hooks/features/columns/gridColumnsInterfaces.js";
|
|
20
19
|
import { PinnedColumnPosition } from "../../internals/constants.js";
|
|
21
20
|
import { gridRowSpanningHiddenCellsSelector, gridRowSpanningSpannedCellsSelector } from "../../hooks/features/rows/gridRowSpanningSelectors.js";
|
|
21
|
+
import { useGridPrivateApiContext } from "../../hooks/utils/useGridPrivateApiContext.js";
|
|
22
|
+
import { gridEditCellStateSelector } from "../../hooks/features/editing/gridEditingSelectors.js";
|
|
22
23
|
import { attachPinnedStyle } from "../../internals/utils/index.js";
|
|
23
24
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
25
|
export const gridPinnedColumnPositionLookup = {
|
|
@@ -27,30 +28,6 @@ export const gridPinnedColumnPositionLookup = {
|
|
|
27
28
|
[PinnedColumnPosition.NONE]: undefined,
|
|
28
29
|
[PinnedColumnPosition.VIRTUAL]: undefined
|
|
29
30
|
};
|
|
30
|
-
const EMPTY_CELL_PARAMS = {
|
|
31
|
-
id: -1,
|
|
32
|
-
field: '__unset__',
|
|
33
|
-
row: {},
|
|
34
|
-
rowNode: {
|
|
35
|
-
id: -1,
|
|
36
|
-
depth: 0,
|
|
37
|
-
type: 'leaf',
|
|
38
|
-
parent: -1,
|
|
39
|
-
groupingKey: null
|
|
40
|
-
},
|
|
41
|
-
colDef: {
|
|
42
|
-
type: 'string',
|
|
43
|
-
field: '__unset__',
|
|
44
|
-
computedWidth: 0
|
|
45
|
-
},
|
|
46
|
-
cellMode: GridCellModes.View,
|
|
47
|
-
hasFocus: false,
|
|
48
|
-
tabIndex: -1,
|
|
49
|
-
value: null,
|
|
50
|
-
formattedValue: '__unset__',
|
|
51
|
-
isEditable: false,
|
|
52
|
-
api: {}
|
|
53
|
-
};
|
|
54
31
|
const useUtilityClasses = ownerState => {
|
|
55
32
|
const {
|
|
56
33
|
align,
|
|
@@ -74,8 +51,9 @@ let warnedOnce = false;
|
|
|
74
51
|
const GridCell = forwardRef(function GridCell(props, ref) {
|
|
75
52
|
const {
|
|
76
53
|
column,
|
|
54
|
+
row,
|
|
77
55
|
rowId,
|
|
78
|
-
|
|
56
|
+
rowNode,
|
|
79
57
|
align,
|
|
80
58
|
colIndex,
|
|
81
59
|
width,
|
|
@@ -99,22 +77,29 @@ const GridCell = forwardRef(function GridCell(props, ref) {
|
|
|
99
77
|
onDragOver
|
|
100
78
|
} = props,
|
|
101
79
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
102
|
-
const apiRef =
|
|
80
|
+
const apiRef = useGridPrivateApiContext();
|
|
103
81
|
const rootProps = useGridRootProps();
|
|
104
82
|
const isRtl = useRtl();
|
|
105
83
|
const field = column.field;
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
84
|
+
const editCellState = useGridSelectorV8(apiRef, gridEditCellStateSelector, {
|
|
85
|
+
rowId,
|
|
86
|
+
field
|
|
87
|
+
});
|
|
88
|
+
const cellMode = editCellState ? GridCellModes.Edit : GridCellModes.View;
|
|
89
|
+
const cellParams = apiRef.current.getCellParamsForRow(rowId, field, row, {
|
|
90
|
+
colDef: column,
|
|
91
|
+
cellMode,
|
|
92
|
+
rowNode: rowNode,
|
|
93
|
+
tabIndex: useGridSelector(apiRef, () => {
|
|
94
|
+
const cellTabIndex = gridTabIndexCellSelector(apiRef);
|
|
95
|
+
return cellTabIndex && cellTabIndex.field === field && cellTabIndex.id === rowId ? 0 : -1;
|
|
96
|
+
}),
|
|
97
|
+
hasFocus: useGridSelector(apiRef, () => {
|
|
98
|
+
const focus = gridFocusCellSelector(apiRef);
|
|
99
|
+
return focus?.id === rowId && focus.field === field;
|
|
100
|
+
})
|
|
101
|
+
});
|
|
102
|
+
cellParams.api = apiRef.current;
|
|
118
103
|
const isSelected = useGridSelector(apiRef, () => apiRef.current.unstable_applyPipeProcessors('isCellSelected', false, {
|
|
119
104
|
id: rowId,
|
|
120
105
|
field
|
|
@@ -122,7 +107,6 @@ const GridCell = forwardRef(function GridCell(props, ref) {
|
|
|
122
107
|
const hiddenCells = useGridSelector(apiRef, gridRowSpanningHiddenCellsSelector);
|
|
123
108
|
const spannedCells = useGridSelector(apiRef, gridRowSpanningSpannedCellsSelector);
|
|
124
109
|
const {
|
|
125
|
-
cellMode,
|
|
126
110
|
hasFocus,
|
|
127
111
|
isEditable = false,
|
|
128
112
|
value
|
|
@@ -244,9 +228,6 @@ const GridCell = forwardRef(function GridCell(props, ref) {
|
|
|
244
228
|
}, style)
|
|
245
229
|
});
|
|
246
230
|
}
|
|
247
|
-
if (cellParams === EMPTY_CELL_PARAMS) {
|
|
248
|
-
return null;
|
|
249
|
-
}
|
|
250
231
|
let handleFocus = other.onFocus;
|
|
251
232
|
if (process.env.NODE_ENV === 'test' && rootProps.experimentalFeatures?.warnIfFocusStateIsNotSynced) {
|
|
252
233
|
handleFocus = event => {
|
|
@@ -330,16 +311,12 @@ process.env.NODE_ENV !== "production" ? GridCell.propTypes = {
|
|
|
330
311
|
colSpan: PropTypes.number,
|
|
331
312
|
column: PropTypes.object.isRequired,
|
|
332
313
|
disableDragEvents: PropTypes.bool,
|
|
333
|
-
editCellState: PropTypes.shape({
|
|
334
|
-
changeReason: PropTypes.oneOf(['debouncedSetEditCellValue', 'setEditCellValue']),
|
|
335
|
-
isProcessingProps: PropTypes.bool,
|
|
336
|
-
isValidating: PropTypes.bool,
|
|
337
|
-
value: PropTypes.any
|
|
338
|
-
}),
|
|
339
314
|
isNotVisible: PropTypes.bool.isRequired,
|
|
340
315
|
pinnedOffset: PropTypes.number,
|
|
341
316
|
pinnedPosition: PropTypes.oneOf([0, 1, 2, 3]).isRequired,
|
|
317
|
+
row: PropTypes.object.isRequired,
|
|
342
318
|
rowId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
319
|
+
rowNode: PropTypes.object.isRequired,
|
|
343
320
|
showLeftBorder: PropTypes.bool.isRequired,
|
|
344
321
|
showRightBorder: PropTypes.bool.isRequired,
|
|
345
322
|
width: PropTypes.number.isRequired
|
|
@@ -5,8 +5,8 @@ export interface ColumnHeaderFilterIconButtonProps {
|
|
|
5
5
|
counter?: number;
|
|
6
6
|
onClick?: (params: GridColumnHeaderParams, event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
7
7
|
}
|
|
8
|
-
declare function
|
|
9
|
-
declare namespace
|
|
8
|
+
declare function GridColumnHeaderFilterIconButtonWrapped(props: ColumnHeaderFilterIconButtonProps): React.JSX.Element | null;
|
|
9
|
+
declare namespace GridColumnHeaderFilterIconButtonWrapped {
|
|
10
10
|
var propTypes: any;
|
|
11
11
|
}
|
|
12
|
-
export { GridColumnHeaderFilterIconButton };
|
|
12
|
+
export { GridColumnHeaderFilterIconButtonWrapped as GridColumnHeaderFilterIconButton };
|
|
@@ -2,8 +2,8 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { unstable_composeClasses as composeClasses, unstable_useId as useId } from '@mui/utils';
|
|
5
|
-
import {
|
|
6
|
-
import { gridPreferencePanelStateSelector } from "../../hooks/features/preferencesPanel/gridPreferencePanelSelector.js";
|
|
5
|
+
import { useGridSelectorV8 } from "../../hooks/utils/useGridSelector.js";
|
|
6
|
+
import { gridPreferencePanelSelectorWithLabel, gridPreferencePanelStateSelector } from "../../hooks/features/preferencesPanel/gridPreferencePanelSelector.js";
|
|
7
7
|
import { GridPreferencePanelsValue } from "../../hooks/features/preferencesPanel/gridPreferencePanelsValue.js";
|
|
8
8
|
import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
|
|
9
9
|
import { getDataGridUtilityClass } from "../../constants/gridClasses.js";
|
|
@@ -19,6 +19,21 @@ const useUtilityClasses = ownerState => {
|
|
|
19
19
|
};
|
|
20
20
|
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
21
21
|
};
|
|
22
|
+
function GridColumnHeaderFilterIconButtonWrapped(props) {
|
|
23
|
+
if (!props.counter) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
return /*#__PURE__*/_jsx(GridColumnHeaderFilterIconButton, _extends({}, props));
|
|
27
|
+
}
|
|
28
|
+
process.env.NODE_ENV !== "production" ? GridColumnHeaderFilterIconButtonWrapped.propTypes = {
|
|
29
|
+
// ----------------------------- Warning --------------------------------
|
|
30
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
31
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
32
|
+
// ----------------------------------------------------------------------
|
|
33
|
+
counter: PropTypes.number,
|
|
34
|
+
field: PropTypes.string.isRequired,
|
|
35
|
+
onClick: PropTypes.func
|
|
36
|
+
} : void 0;
|
|
22
37
|
function GridColumnHeaderFilterIconButton(props) {
|
|
23
38
|
const {
|
|
24
39
|
counter,
|
|
@@ -31,8 +46,8 @@ function GridColumnHeaderFilterIconButton(props) {
|
|
|
31
46
|
classes: rootProps.classes
|
|
32
47
|
});
|
|
33
48
|
const classes = useUtilityClasses(ownerState);
|
|
34
|
-
const preferencePanel = useGridSelector(apiRef, gridPreferencePanelStateSelector);
|
|
35
49
|
const labelId = useId();
|
|
50
|
+
const isOpen = useGridSelectorV8(apiRef, gridPreferencePanelSelectorWithLabel, labelId);
|
|
36
51
|
const panelId = useId();
|
|
37
52
|
const toggleFilter = React.useCallback(event => {
|
|
38
53
|
event.preventDefault();
|
|
@@ -53,7 +68,6 @@ function GridColumnHeaderFilterIconButton(props) {
|
|
|
53
68
|
if (!counter) {
|
|
54
69
|
return null;
|
|
55
70
|
}
|
|
56
|
-
const open = preferencePanel.open && preferencePanel.labelId === labelId;
|
|
57
71
|
const iconButton = /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({
|
|
58
72
|
id: labelId,
|
|
59
73
|
onClick: toggleFilter,
|
|
@@ -62,8 +76,8 @@ function GridColumnHeaderFilterIconButton(props) {
|
|
|
62
76
|
size: "small",
|
|
63
77
|
tabIndex: -1,
|
|
64
78
|
"aria-haspopup": "menu",
|
|
65
|
-
"aria-expanded":
|
|
66
|
-
"aria-controls":
|
|
79
|
+
"aria-expanded": isOpen,
|
|
80
|
+
"aria-controls": isOpen ? panelId : undefined
|
|
67
81
|
}, rootProps.slotProps?.baseIconButton, {
|
|
68
82
|
children: /*#__PURE__*/_jsx(rootProps.slots.columnFilteredIcon, {
|
|
69
83
|
className: classes.icon,
|
|
@@ -92,4 +106,4 @@ process.env.NODE_ENV !== "production" ? GridColumnHeaderFilterIconButton.propTyp
|
|
|
92
106
|
field: PropTypes.string.isRequired,
|
|
93
107
|
onClick: PropTypes.func
|
|
94
108
|
} : void 0;
|
|
95
|
-
export { GridColumnHeaderFilterIconButton };
|
|
109
|
+
export { GridColumnHeaderFilterIconButtonWrapped as GridColumnHeaderFilterIconButton };
|