@mui/x-data-grid 7.17.0 → 7.19.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 +208 -5
- package/DataGrid/DataGrid.js +16 -1
- package/DataGrid/useDataGridComponent.js +3 -0
- package/DataGrid/useDataGridProps.js +2 -1
- package/components/GridRow.js +1 -0
- package/components/cell/GridCell.js +33 -9
- package/components/columnHeaders/GridBaseColumnHeaders.js +1 -1
- package/components/columnSelection/GridCellCheckboxRenderer.js +12 -4
- package/components/columnSelection/GridHeaderCheckbox.d.ts +1 -1
- package/components/containers/GridRoot.js +1 -1
- package/components/containers/GridRootStyles.js +32 -23
- package/components/containers/GridToolbarContainer.js +1 -1
- package/components/menu/GridMenu.js +1 -1
- package/components/panel/GridPanel.d.ts +1 -1
- package/components/panel/GridPanel.js +1 -1
- package/components/panel/GridPanelContent.js +1 -1
- package/components/panel/GridPanelFooter.js +1 -1
- package/components/panel/GridPanelHeader.js +1 -1
- package/components/panel/GridPanelWrapper.js +1 -1
- package/components/panel/filterPanel/filterPanelUtils.d.ts +1 -1
- package/components/toolbar/GridToolbarQuickFilter.js +1 -1
- package/components/virtualization/GridBottomContainer.d.ts +1 -1
- package/components/virtualization/GridBottomContainer.js +18 -1
- package/components/virtualization/GridMainContainer.js +3 -1
- package/components/virtualization/GridTopContainer.d.ts +1 -1
- package/components/virtualization/GridTopContainer.js +1 -1
- package/components/virtualization/GridVirtualScrollbar.js +1 -7
- package/components/virtualization/GridVirtualScroller.js +1 -0
- package/components/virtualization/GridVirtualScrollerFiller.js +3 -4
- package/hooks/features/columnGrouping/gridColumnGroupsSelector.d.ts +4 -4
- package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +1 -2
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +11 -11
- package/hooks/features/columnResize/columnResizeSelector.d.ts +1 -1
- package/hooks/features/columnResize/useGridColumnResize.js +6 -6
- package/hooks/features/columns/gridColumnsSelector.d.ts +12 -12
- package/hooks/features/columns/gridColumnsUtils.js +3 -2
- package/hooks/features/density/densitySelector.d.ts +1 -1
- package/hooks/features/dimensions/gridDimensionsApi.d.ts +4 -0
- package/hooks/features/dimensions/useGridDimensions.d.ts +1 -1
- package/hooks/features/dimensions/useGridDimensions.js +4 -1
- package/hooks/features/editing/useGridCellEditing.js +3 -19
- package/hooks/features/editing/useGridRowEditing.js +7 -2
- package/hooks/features/editing/utils.d.ts +2 -0
- package/hooks/features/editing/utils.js +15 -0
- package/hooks/features/export/useGridPrintExport.js +2 -1
- package/hooks/features/filter/gridFilterSelector.d.ts +17 -17
- package/hooks/features/focus/gridFocusStateSelector.d.ts +8 -8
- package/hooks/features/focus/useGridFocus.js +2 -1
- package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.d.ts +3 -3
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +10 -46
- package/hooks/features/keyboardNavigation/utils.d.ts +17 -0
- package/hooks/features/keyboardNavigation/utils.js +58 -0
- package/hooks/features/pagination/gridPaginationSelector.d.ts +9 -9
- package/hooks/features/rowSelection/gridRowSelectionSelector.d.ts +3 -3
- package/hooks/features/rowSelection/useGridRowSelection.d.ts +1 -1
- package/hooks/features/rowSelection/useGridRowSelection.js +105 -29
- package/hooks/features/rowSelection/utils.d.ts +10 -0
- package/hooks/features/rowSelection/utils.js +156 -1
- package/hooks/features/rows/gridRowSpanningSelectors.d.ts +4 -0
- package/hooks/features/rows/gridRowSpanningSelectors.js +5 -0
- package/hooks/features/rows/gridRowSpanningUtils.d.ts +10 -0
- package/hooks/features/rows/gridRowSpanningUtils.js +42 -0
- package/hooks/features/rows/gridRowsSelector.d.ts +14 -14
- package/hooks/features/rows/useGridRowSpanning.d.ts +27 -0
- package/hooks/features/rows/useGridRowSpanning.js +257 -0
- package/hooks/features/rows/useGridRows.d.ts +1 -1
- package/hooks/features/rows/useGridRows.js +7 -1
- package/hooks/features/scroll/useGridScroll.js +19 -19
- package/hooks/features/sorting/gridSortingSelector.d.ts +4 -4
- package/hooks/features/virtualization/gridVirtualizationSelectors.d.ts +5 -5
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +1 -1
- package/hooks/features/virtualization/useGridVirtualScroller.js +17 -7
- package/hooks/utils/useGridApiEventHandler.js +0 -1
- package/hooks/utils/useGridVisibleRows.d.ts +2 -2
- package/index.js +1 -1
- package/internals/index.d.ts +2 -0
- package/internals/index.js +2 -0
- package/locales/bgBG.js +8 -9
- package/locales/deDE.js +4 -4
- package/locales/frFR.js +4 -4
- package/locales/hrHR.d.ts +1 -1
- package/locales/hrHR.js +69 -46
- package/locales/jaJP.js +1 -2
- package/locales/ptPT.d.ts +1 -1
- package/locales/ptPT.js +4 -4
- package/locales/viVN.js +20 -20
- package/locales/zhHK.d.ts +1 -1
- package/models/colDef/gridColDef.d.ts +4 -0
- package/models/gridRowSelectionModel.d.ts +4 -0
- package/models/gridStateCommunity.d.ts +2 -0
- package/models/props/DataGridProps.d.ts +30 -1
- package/modern/DataGrid/DataGrid.js +16 -1
- package/modern/DataGrid/useDataGridComponent.js +3 -0
- package/modern/DataGrid/useDataGridProps.js +2 -1
- package/modern/components/GridRow.js +1 -0
- package/modern/components/cell/GridCell.js +33 -9
- package/modern/components/columnHeaders/GridBaseColumnHeaders.js +1 -1
- package/modern/components/columnSelection/GridCellCheckboxRenderer.js +12 -4
- package/modern/components/containers/GridRoot.js +1 -1
- package/modern/components/containers/GridRootStyles.js +32 -23
- package/modern/components/containers/GridToolbarContainer.js +1 -1
- package/modern/components/menu/GridMenu.js +1 -1
- package/modern/components/panel/GridPanel.js +1 -1
- package/modern/components/panel/GridPanelContent.js +1 -1
- package/modern/components/panel/GridPanelFooter.js +1 -1
- package/modern/components/panel/GridPanelHeader.js +1 -1
- package/modern/components/panel/GridPanelWrapper.js +1 -1
- package/modern/components/toolbar/GridToolbarQuickFilter.js +1 -1
- package/modern/components/virtualization/GridBottomContainer.js +18 -1
- package/modern/components/virtualization/GridMainContainer.js +3 -1
- package/modern/components/virtualization/GridTopContainer.js +1 -1
- package/modern/components/virtualization/GridVirtualScrollbar.js +1 -7
- package/modern/components/virtualization/GridVirtualScroller.js +1 -0
- package/modern/components/virtualization/GridVirtualScrollerFiller.js +3 -4
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +11 -11
- package/modern/hooks/features/columnResize/useGridColumnResize.js +6 -6
- package/modern/hooks/features/columns/gridColumnsUtils.js +3 -2
- package/modern/hooks/features/dimensions/useGridDimensions.js +4 -1
- package/modern/hooks/features/editing/useGridCellEditing.js +3 -19
- package/modern/hooks/features/editing/useGridRowEditing.js +7 -2
- package/modern/hooks/features/editing/utils.js +15 -0
- package/modern/hooks/features/export/useGridPrintExport.js +2 -1
- package/modern/hooks/features/focus/useGridFocus.js +2 -1
- package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +10 -46
- package/modern/hooks/features/keyboardNavigation/utils.js +58 -0
- package/modern/hooks/features/rowSelection/useGridRowSelection.js +105 -29
- package/modern/hooks/features/rowSelection/utils.js +156 -1
- package/modern/hooks/features/rows/gridRowSpanningSelectors.js +5 -0
- package/modern/hooks/features/rows/gridRowSpanningUtils.js +42 -0
- package/modern/hooks/features/rows/useGridRowSpanning.js +257 -0
- package/modern/hooks/features/rows/useGridRows.js +7 -1
- package/modern/hooks/features/scroll/useGridScroll.js +19 -19
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +17 -7
- package/modern/hooks/utils/useGridApiEventHandler.js +0 -1
- package/modern/index.js +1 -1
- package/modern/internals/index.js +2 -0
- package/modern/locales/bgBG.js +8 -9
- package/modern/locales/deDE.js +4 -4
- package/modern/locales/frFR.js +4 -4
- package/modern/locales/hrHR.js +69 -46
- package/modern/locales/jaJP.js +1 -2
- package/modern/locales/ptPT.js +4 -4
- package/modern/locales/viVN.js +20 -20
- package/modern/utils/createSelector.js +6 -0
- package/modern/utils/domUtils.js +12 -12
- package/node/DataGrid/DataGrid.js +16 -1
- package/node/DataGrid/useDataGridComponent.js +3 -0
- package/node/DataGrid/useDataGridProps.js +2 -1
- package/node/components/GridRow.js +1 -0
- package/node/components/cell/GridCell.js +33 -9
- package/node/components/columnHeaders/GridBaseColumnHeaders.js +1 -1
- package/node/components/columnSelection/GridCellCheckboxRenderer.js +12 -4
- package/node/components/containers/GridRoot.js +1 -1
- package/node/components/containers/GridRootStyles.js +32 -23
- package/node/components/containers/GridToolbarContainer.js +1 -1
- package/node/components/menu/GridMenu.js +1 -1
- package/node/components/panel/GridPanel.js +1 -1
- package/node/components/panel/GridPanelContent.js +1 -1
- package/node/components/panel/GridPanelFooter.js +1 -1
- package/node/components/panel/GridPanelHeader.js +1 -1
- package/node/components/panel/GridPanelWrapper.js +1 -1
- package/node/components/toolbar/GridToolbarQuickFilter.js +1 -1
- package/node/components/virtualization/GridBottomContainer.js +18 -1
- package/node/components/virtualization/GridMainContainer.js +3 -1
- package/node/components/virtualization/GridTopContainer.js +1 -1
- package/node/components/virtualization/GridVirtualScrollbar.js +1 -7
- package/node/components/virtualization/GridVirtualScroller.js +1 -0
- package/node/components/virtualization/GridVirtualScrollerFiller.js +3 -4
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +11 -11
- package/node/hooks/features/columnResize/useGridColumnResize.js +6 -6
- package/node/hooks/features/columns/gridColumnsUtils.js +3 -2
- package/node/hooks/features/dimensions/useGridDimensions.js +4 -1
- package/node/hooks/features/editing/useGridCellEditing.js +3 -19
- package/node/hooks/features/editing/useGridRowEditing.js +7 -2
- package/node/hooks/features/editing/utils.js +22 -0
- package/node/hooks/features/export/useGridPrintExport.js +2 -1
- package/node/hooks/features/focus/useGridFocus.js +2 -1
- package/node/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +16 -53
- package/node/hooks/features/keyboardNavigation/utils.js +68 -0
- package/node/hooks/features/rowSelection/useGridRowSelection.js +102 -26
- package/node/hooks/features/rowSelection/utils.js +160 -1
- package/node/hooks/features/rows/gridRowSpanningSelectors.js +11 -0
- package/node/hooks/features/rows/gridRowSpanningUtils.js +52 -0
- package/node/hooks/features/rows/useGridRowSpanning.js +267 -0
- package/node/hooks/features/rows/useGridRows.js +7 -1
- package/node/hooks/features/scroll/useGridScroll.js +19 -19
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +17 -7
- package/node/hooks/utils/useGridApiEventHandler.js +0 -1
- package/node/index.js +1 -1
- package/node/internals/index.js +38 -15
- package/node/locales/bgBG.js +8 -9
- package/node/locales/deDE.js +4 -4
- package/node/locales/frFR.js +4 -4
- package/node/locales/hrHR.js +69 -46
- package/node/locales/jaJP.js +1 -2
- package/node/locales/ptPT.js +4 -4
- package/node/locales/viVN.js +20 -20
- package/node/utils/createSelector.js +6 -0
- package/node/utils/domUtils.js +12 -12
- package/package.json +3 -3
- package/utils/createSelector.js +6 -0
- package/utils/domUtils.d.ts +4 -4
- package/utils/domUtils.js +12 -12
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,209 @@
|
|
|
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.19.0
|
|
7
|
+
|
|
8
|
+
_Oct 4, 2024_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 26 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🔁 Automatic parents and children selection for Data Grid ["tree data"](https://mui.com/x/react-data-grid/tree-data/) and ["row grouping"](https://mui.com/x/react-data-grid/row-grouping/) features
|
|
13
|
+
- 💫 Support `minHeight` and `maxHeight` on flex parent container for the Data Grid component
|
|
14
|
+
- 🎁 Export `publicAPI` from the `useTreeItem2Utils` hook for the Tree View
|
|
15
|
+
- 🌍 Improve Bulgarian (bg-BG), Croatian (hr-HR), French (fr-FR), German (de-DE), Japanese (ja-JP) and Vietnamese (vi-VN) locales and add Portuguese (pt-PT) locale on the Data Grid component
|
|
16
|
+
- 🌏 Improve Czech (cs-CZ) and Portuguese (pt-BR) locales and add Bulgarian (bg-BG), Croatian (hr-HR) and Portuguese (pt-PT) locales on the Pickers components
|
|
17
|
+
- 🐞 Bugfixes
|
|
18
|
+
- 📚 Documentation improvements
|
|
19
|
+
|
|
20
|
+
Special thanks goes out to our community contributors who have helped make this release possible:
|
|
21
|
+
@AWAIS97, @chucamphong, @GMchris, @JakubSveda, @k-rajat19, @k725, @lhilgert9, @ruiaraujo012, @Sanderand, @thomasmoon, @vallereaugabriel.
|
|
22
|
+
Following are all team members who have contributed to this release:
|
|
23
|
+
@alexfauquette, @arminmeh, @arthurbalduini, @cherniavskii, @flaviendelangle, @Janpot, @JCQuintas, @KenanYusuf, @MBilalShafi, @michelengelen, @noraleonte, @oliviertassinari, @romgrk, @sai6855, @samuelsycamore.
|
|
24
|
+
|
|
25
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
26
|
+
|
|
27
|
+
### Data Grid
|
|
28
|
+
|
|
29
|
+
#### `@mui/x-data-grid@7.19.0`
|
|
30
|
+
|
|
31
|
+
- [DataGrid] Fix column definition `undefined` value (#14456) @sai6855
|
|
32
|
+
- [DataGrid] Fix `checkboxSelectionVisibleOnly` reset the selection on filtering (#14677) @MBilalShafi
|
|
33
|
+
- [DataGrid] Fix background colors when `CSSVarsProvider` is used (#12901) @cherniavskii
|
|
34
|
+
- [DataGrid] Fix error when initializing aggregation with row spanning (#14710) @MBilalShafi
|
|
35
|
+
- [DataGrid] Fix scroll to cell logic for keyboard navigating cells and drag selection with pinned columns (#14550) @KenanYusuf
|
|
36
|
+
- [DataGrid] Support `minHeight` and `maxHeight` on flex parent container (#14614) @cherniavskii
|
|
37
|
+
- [l10n] Add missing Portuguese (pt-PT) translations (#14707) @ruiaraujo012
|
|
38
|
+
- [l10n] Improve Bulgarian (bg-BG) locale (#14451) @GMchris
|
|
39
|
+
- [l10n] Improve Croatian (hr-HR) locale (#14794) @arminmeh
|
|
40
|
+
- [l10n] Improve French (fr-FR) locale (#14750) @vallereaugabriel
|
|
41
|
+
- [l10n] Improve German (de-DE) locale (#14755) @lhilgert9
|
|
42
|
+
- [l10n] Improve Japanese (ja-JP) locale (#14381) @k725
|
|
43
|
+
- [l10n] Improve Vietnamese (vi-VN) locale (#14769) @chucamphong
|
|
44
|
+
|
|
45
|
+
#### `@mui/x-data-grid-pro@7.19.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
46
|
+
|
|
47
|
+
Same changes as in `@mui/x-data-grid@7.19.0`, plus:
|
|
48
|
+
|
|
49
|
+
- [DataGridPro] Fix dragging styles removal in column reorder (#14680) @k-rajat19
|
|
50
|
+
- [DataGridPro] Fix row pre-processing running with a stale data source (#14810) @MBilalShafi
|
|
51
|
+
- [DataGridPro] Fix `onRowsScrollEnd` not firing on very fast scrolling (#14171) @arminmeh
|
|
52
|
+
|
|
53
|
+
#### `@mui/x-data-grid-premium@7.19.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
54
|
+
|
|
55
|
+
Same changes as in `@mui/x-data-grid-pro@7.19.0`, plus:
|
|
56
|
+
|
|
57
|
+
- [DataGridPremium] Automatic parents and children selection (#13757) @MBilalShafi
|
|
58
|
+
|
|
59
|
+
### Date and Time Pickers
|
|
60
|
+
|
|
61
|
+
#### `@mui/x-date-pickers@7.19.0`
|
|
62
|
+
|
|
63
|
+
- [pickers] Fix left-right keyboard nav with `yearsOrder="desc"` and `direction="rtl"` (#14682) @thomasmoon
|
|
64
|
+
- [pickers] Improve `PickerValidDate` type (#14771) @flaviendelangle
|
|
65
|
+
- [pickers] Improve typing of the range pickers (#14716) @flaviendelangle
|
|
66
|
+
- [l10n] Add Bulgarian (bg-BG) locale (#14469) @GMchris
|
|
67
|
+
- [l10n] Add Croatian (hr-HR) locale (#14795) @arminmeh
|
|
68
|
+
- [l10n] Add Portuguese (pt-PT) locale (#14722) @ruiaraujo012
|
|
69
|
+
- [l10n] Improve Czech (cs-CZ) locale (#14732) @JakubSveda
|
|
70
|
+
- [l10n] Improve Portuguese (pt-BR) locale (#14725) @arthurbalduini
|
|
71
|
+
|
|
72
|
+
#### `@mui/x-date-pickers-pro@7.19.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
73
|
+
|
|
74
|
+
Same changes as in `@mui/x-date-pickers@7.19.0`.
|
|
75
|
+
|
|
76
|
+
### Charts
|
|
77
|
+
|
|
78
|
+
#### `@mui/x-charts@7.19.0`
|
|
79
|
+
|
|
80
|
+
- [charts] Fix `LineChart` area animation being stuck when resizing container (#14711) @alexfauquette
|
|
81
|
+
- [charts] Improve types and start using `warnOnce` (#14792) @JCQuintas
|
|
82
|
+
|
|
83
|
+
#### `@mui/x-charts-pro@7.0.0-beta.3` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
84
|
+
|
|
85
|
+
Same changes as in `@mui/x-charts@7.19.0`.
|
|
86
|
+
|
|
87
|
+
### Tree View
|
|
88
|
+
|
|
89
|
+
#### `@mui/x-tree-view@7.19.0`
|
|
90
|
+
|
|
91
|
+
- [TreeView] Apply experimental features in `getDefaultizedParams` instead of in the plugin render (#14661) @flaviendelangle
|
|
92
|
+
- [TreeView] Export `publicAPI` form `useTreeItem2Utils` (#14729) @noraleonte
|
|
93
|
+
- [TreeView] Fix cursor navigation interfering with browser shortcut keys (#14798) @sai6855
|
|
94
|
+
- [TreeView] Fix invalid test for items reordering (#14665) @flaviendelangle
|
|
95
|
+
- [TreeView] Remove `instance.getTreeItemIdAttribute` (#14667) @flaviendelangle
|
|
96
|
+
|
|
97
|
+
### Docs
|
|
98
|
+
|
|
99
|
+
- [docs] Added warning callout for Firefox reordering bug (#14516) @michelengelen
|
|
100
|
+
- [docs] Copyedit `pages.ts` navigation (#14782) @samuelsycamore
|
|
101
|
+
- [docs] Fix typo in row spanning doc (#14770) @flaviendelangle
|
|
102
|
+
- [docs] Fix typo in the Tree View migration guide to v7 (#14727) @Sanderand
|
|
103
|
+
- [docs] Fix typo in usage of Moment guide for UTC and timezones (#14780) @AWAIS97
|
|
104
|
+
- [docs] Fix what's new link to use absolute URL (#14543) @oliviertassinari
|
|
105
|
+
|
|
106
|
+
### Core
|
|
107
|
+
|
|
108
|
+
- [core] Fix class name composition order (#14775) @oliviertassinari
|
|
109
|
+
- [core] Replace minWidth, maxWidth with width (#14776) @oliviertassinari
|
|
110
|
+
- [code-infra] Remove custom playwright installation steps (#14728) @Janpot
|
|
111
|
+
- [code-infra] Replace or remove all instances of `e` identifier (#14724) @samuelsycamore
|
|
112
|
+
- [infra] Adds community contribution section to the changelog script (#14799) @michelengelen
|
|
113
|
+
- [infra] Fix line break in Stack Overflow message @oliviertassinari
|
|
114
|
+
- [test] Fix `Escape` event firing event (#14797) @oliviertassinari
|
|
115
|
+
|
|
116
|
+
## 7.18.0
|
|
117
|
+
|
|
118
|
+
_Sep 20, 2024_
|
|
119
|
+
|
|
120
|
+
We'd like to offer a big thanks to the 14 contributors who made this release possible. Here are some highlights ✨:
|
|
121
|
+
|
|
122
|
+
- 💫 Support [Row spanning](https://mui.com/x/react-data-grid/row-spanning/) on the Data Grid that automatically merges the consecutive cells in a column based on the cell value
|
|
123
|
+
|
|
124
|
+
<img width="600" src="https://github.com/user-attachments/assets/d32ec936-d238-4c92-9e1a-af6788d74cdf" alt="data grid row spanning" />
|
|
125
|
+
|
|
126
|
+
- ⏰ Support `date-fns` v4 (#14673) @LukasTy
|
|
127
|
+
- 🎉 Add option for Pickers to change the order of displayed years (#11780) @thomasmoon
|
|
128
|
+
- 🐞 Bugfixes
|
|
129
|
+
- 📚 Documentation improvements
|
|
130
|
+
|
|
131
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
132
|
+
|
|
133
|
+
### Data Grid
|
|
134
|
+
|
|
135
|
+
#### `@mui/x-data-grid@7.18.0`
|
|
136
|
+
|
|
137
|
+
- [DataGrid] Add default reset value in row edit mode (#14050) @michelengelen
|
|
138
|
+
- [DataGrid] Add `columnGroupHeaderHeight` prop for sizing column group headers (#14637) @KenanYusuf
|
|
139
|
+
- [DataGrid] Fix `document` reference when the grid is rendered in a popup window (#14649) @arminmeh
|
|
140
|
+
- [DataGrid] Remove `minFirstColumn` from `GetHeadersParams` interface (#14450) @k-rajat19
|
|
141
|
+
- [DataGrid] Row spanning (#14124) @MBilalShafi
|
|
142
|
+
|
|
143
|
+
#### `@mui/x-data-grid-pro@7.18.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
144
|
+
|
|
145
|
+
Same changes as in `@mui/x-data-grid@7.18.0`, plus:
|
|
146
|
+
|
|
147
|
+
- [DataGridPro] Fix `onRowsScrollEnd` being triggered instantly when bottom pinned row is present (#14602) @arminmeh
|
|
148
|
+
- [DataGridPro] Fix header filters rendering issue for `isEmpty` and `isNotEmpty` filter operators (#14493) @k-rajat19
|
|
149
|
+
- [DataGridPro] Fix pinned columns in RTL mode (#14586) @KenanYusuf
|
|
150
|
+
|
|
151
|
+
#### `@mui/x-data-grid-premium@7.18.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
152
|
+
|
|
153
|
+
Same changes as in `@mui/x-data-grid-pro@7.18.0`.
|
|
154
|
+
|
|
155
|
+
### Date and Time Pickers
|
|
156
|
+
|
|
157
|
+
#### `@mui/x-date-pickers@7.18.0`
|
|
158
|
+
|
|
159
|
+
- [pickers] Add option to change the order of displayed years (#11780) @thomasmoon
|
|
160
|
+
- [pickers] Support `date-fns` v4 (#14673) @LukasTy
|
|
161
|
+
|
|
162
|
+
#### `@mui/x-date-pickers-pro@7.18.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
163
|
+
|
|
164
|
+
Same changes as in `@mui/x-date-pickers@7.18.0`.
|
|
165
|
+
|
|
166
|
+
### Charts
|
|
167
|
+
|
|
168
|
+
#### `@mui/x-charts@7.18.0`
|
|
169
|
+
|
|
170
|
+
- [charts] Add a `PolarProvider` to manage polar axes (#14642) @alexfauquette
|
|
171
|
+
- [charts] Fix `LineChart` animation being stuck with initial drawing area value (#14553) @JCQuintas
|
|
172
|
+
- [charts] Fix legend slot typing (#14657) @alexfauquette
|
|
173
|
+
- [charts] Pass the axis index to extremum getter (#14641) @alexfauquette
|
|
174
|
+
- [charts] Provide hooks to create custom tooltip (#14377) @alexfauquette
|
|
175
|
+
|
|
176
|
+
#### `@mui/x-charts-pro@7.0.0-beta.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
177
|
+
|
|
178
|
+
Same changes as in `@mui/x-charts@7.18.0`.
|
|
179
|
+
|
|
180
|
+
### Tree View
|
|
181
|
+
|
|
182
|
+
#### `@mui/x-tree-view@7.18.0`
|
|
183
|
+
|
|
184
|
+
- [TreeView] Add `"use client"` directive to every public component and hook (#14579) @flaviendelangle
|
|
185
|
+
|
|
186
|
+
### Docs
|
|
187
|
+
|
|
188
|
+
- [docs] Add `groupingValueGetter` callout in column definition docs (#14599) @michelengelen
|
|
189
|
+
- [docs] Clean v6 => v7 migration guide (#14652) @flaviendelangle
|
|
190
|
+
- [docs] Copy `vale-action.yml` from main repo @oliviertassinari
|
|
191
|
+
- [docs] Edit the Pickers Getting started doc (#14555) @samuelsycamore
|
|
192
|
+
- [docs] Fix TypeScript capitalization @oliviertassinari
|
|
193
|
+
- [docs] Fix Vale error @oliviertassinari
|
|
194
|
+
- [docs] Make the migration guide diff a bit easier to read @oliviertassinari
|
|
195
|
+
- [docs] Report Vale at warning level (#14660) @oliviertassinari
|
|
196
|
+
- [docs] Warn about the `valueGetter` and `valueFormatter` signature change (#14613) @cherniavskii
|
|
197
|
+
- [docs] Polish code formatting (#14603) @oliviertassinari
|
|
198
|
+
- [test] Spy on `observe` method to avoid flaky wait for a callback (#14640) @arminmeh
|
|
199
|
+
|
|
200
|
+
### Core
|
|
201
|
+
|
|
202
|
+
- [core] Fix 301 link to Next.js and git diff @oliviertassinari
|
|
203
|
+
- [core] Fix failing CI on `master` (#14644) @cherniavskii
|
|
204
|
+
- [core] Fix `package.json` repository rule @oliviertassinari
|
|
205
|
+
- [core] MUI X repository moved to a new location @oliviertassinari
|
|
206
|
+
- [docs-infra] Strengthen CSP (#14581) @oliviertassinari
|
|
207
|
+
- [license] Finish renaming of LicensingModel (#14615) @oliviertassinari
|
|
208
|
+
|
|
6
209
|
## 7.17.0
|
|
7
210
|
|
|
8
211
|
_Sep 13, 2024_
|
|
@@ -75,7 +278,7 @@ Same changes as in `@mui/x-charts@7.17.0`.
|
|
|
75
278
|
### Docs
|
|
76
279
|
|
|
77
280
|
- [docs] Add missing callout on "Imperative API" tree view sections (#14503) @flaviendelangle
|
|
78
|
-
- [docs] Fix broken redirection to MUI
|
|
281
|
+
- [docs] Fix broken redirection to MUI X v5 @oliviertassinari
|
|
79
282
|
- [docs] Fix multiple `console.error` messages on `charts` docs (#14554) @JCQuintas
|
|
80
283
|
- [docs] Fixed typo in Row Grouping recipes (#14549) @Miodini
|
|
81
284
|
- [docs] Match title with blog posts @oliviertassinari
|
|
@@ -195,7 +398,7 @@ We'd like to offer a big thanks to the 8 contributors who made this release poss
|
|
|
195
398
|
|
|
196
399
|
- 💫 Support Material UI v6 (`@mui/material@6`) peer dependency (#14142) @cherniavskii
|
|
197
400
|
|
|
198
|
-
You can now use MUI
|
|
401
|
+
You can now use MUI X components with either v5 or v6 of `@mui/material` package 🎉
|
|
199
402
|
|
|
200
403
|
- 🐞 Bugfixes
|
|
201
404
|
|
|
@@ -240,7 +443,7 @@ Same changes as in `@mui/x-charts@7.15.0`, plus:
|
|
|
240
443
|
|
|
241
444
|
- [docs] Fix sentence case `h2` @oliviertassinari
|
|
242
445
|
- [docs] Clarify contribution guide references @oliviertassinari
|
|
243
|
-
- [docs] Fix Stack
|
|
446
|
+
- [docs] Fix Stack Overflow issue canned response @oliviertassinari
|
|
244
447
|
- [docs] Fix outdated link to support page @oliviertassinari
|
|
245
448
|
- [docs] Fix use of Material UI @oliviertassinari
|
|
246
449
|
- [docs] Update deprecated props in docs (#14295) @JCQuintas
|
|
@@ -498,7 +701,7 @@ The [Pro plan](https://mui.com/x/introduction/licensing/#pro-plan) is receiving
|
|
|
498
701
|
|
|
499
702
|
As always, every feature released as part of the MIT plan will remain free and MIT licensed forever.
|
|
500
703
|
|
|
501
|
-
This expansion of the Pro plan comes with some adjustments to our pricing strategy. Learn more about those in the [Upcoming changes to MUI
|
|
704
|
+
This expansion of the Pro plan comes with some adjustments to our pricing strategy. Learn more about those in the [Upcoming changes to MUI X pricing in 2024](https://mui.com/blog/mui-x-sep-2024-price-update/) blog post.
|
|
502
705
|
|
|
503
706
|
### Highlights
|
|
504
707
|
|
|
@@ -563,7 +766,7 @@ Same changes as in `@mui/x-date-pickers@7.12.0`.
|
|
|
563
766
|
#### `@mui/x-charts@7.12.0`
|
|
564
767
|
|
|
565
768
|
- [charts] Fix incorrect `axisId` prop being allowed in xAxis/yAxis config. Use `id` instead. (#13986) @JCQuintas
|
|
566
|
-
- [charts] Use vendor to have
|
|
769
|
+
- [charts] Use vendor to have CommonJS bundle working out of the box (#13608) @alexfauquette
|
|
567
770
|
- [charts] Divide the `SeriesProvider` to use in filtering (#14026) @JCQuintas
|
|
568
771
|
|
|
569
772
|
### Tree View
|
package/DataGrid/DataGrid.js
CHANGED
|
@@ -73,6 +73,11 @@ DataGridRaw.propTypes = {
|
|
|
73
73
|
/**
|
|
74
74
|
* If `true`, the Data Grid height is dynamic and follows the number of rows in the Data Grid.
|
|
75
75
|
* @default false
|
|
76
|
+
* @deprecated Use flex parent container instead: https://mui.com/x/react-data-grid/layout/#flex-parent-container
|
|
77
|
+
* @example
|
|
78
|
+
* <div style={{ display: 'flex', flexDirection: 'column' }}>
|
|
79
|
+
* <DataGrid />
|
|
80
|
+
* </div>
|
|
76
81
|
*/
|
|
77
82
|
autoHeight: PropTypes.bool,
|
|
78
83
|
/**
|
|
@@ -118,6 +123,11 @@ DataGridRaw.propTypes = {
|
|
|
118
123
|
* @default 150
|
|
119
124
|
*/
|
|
120
125
|
columnBufferPx: PropTypes.number,
|
|
126
|
+
/**
|
|
127
|
+
* Sets the height in pixels of the column group headers in the Data Grid.
|
|
128
|
+
* Inherits the `columnHeaderHeight` value if not set.
|
|
129
|
+
*/
|
|
130
|
+
columnGroupHeaderHeight: PropTypes.number,
|
|
121
131
|
columnGroupingModel: PropTypes.arrayOf(PropTypes.object),
|
|
122
132
|
/**
|
|
123
133
|
* Sets the height in pixel of the column headers in the Data Grid.
|
|
@@ -743,5 +753,10 @@ DataGridRaw.propTypes = {
|
|
|
743
753
|
/**
|
|
744
754
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
745
755
|
*/
|
|
746
|
-
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
|
756
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
757
|
+
/**
|
|
758
|
+
* If `true`, the Data Grid will auto span the cells over the rows having the same value.
|
|
759
|
+
* @default false
|
|
760
|
+
*/
|
|
761
|
+
unstable_rowSpanning: PropTypes.bool
|
|
747
762
|
};
|
|
@@ -27,6 +27,7 @@ import { useGridColumnSpanning } from "../hooks/features/columns/useGridColumnSp
|
|
|
27
27
|
import { useGridColumnGrouping, columnGroupsStateInitializer } from "../hooks/features/columnGrouping/useGridColumnGrouping.js";
|
|
28
28
|
import { useGridVirtualization, virtualizationStateInitializer } from "../hooks/features/virtualization/index.js";
|
|
29
29
|
import { columnResizeStateInitializer, useGridColumnResize } from "../hooks/features/columnResize/useGridColumnResize.js";
|
|
30
|
+
import { rowSpanningStateInitializer, useGridRowSpanning } from "../hooks/features/rows/useGridRowSpanning.js";
|
|
30
31
|
export const useDataGridComponent = (inputApiRef, props) => {
|
|
31
32
|
const apiRef = useGridInitialization(inputApiRef, props);
|
|
32
33
|
|
|
@@ -48,6 +49,7 @@ export const useDataGridComponent = (inputApiRef, props) => {
|
|
|
48
49
|
useGridInitializeState(sortingStateInitializer, apiRef, props);
|
|
49
50
|
useGridInitializeState(preferencePanelStateInitializer, apiRef, props);
|
|
50
51
|
useGridInitializeState(filterStateInitializer, apiRef, props);
|
|
52
|
+
useGridInitializeState(rowSpanningStateInitializer, apiRef, props);
|
|
51
53
|
useGridInitializeState(densityStateInitializer, apiRef, props);
|
|
52
54
|
useGridInitializeState(columnResizeStateInitializer, apiRef, props);
|
|
53
55
|
useGridInitializeState(paginationStateInitializer, apiRef, props);
|
|
@@ -59,6 +61,7 @@ export const useDataGridComponent = (inputApiRef, props) => {
|
|
|
59
61
|
useGridRowSelection(apiRef, props);
|
|
60
62
|
useGridColumns(apiRef, props);
|
|
61
63
|
useGridRows(apiRef, props);
|
|
64
|
+
useGridRowSpanning(apiRef, props);
|
|
62
65
|
useGridParamsApi(apiRef);
|
|
63
66
|
useGridColumnSpanning(apiRef);
|
|
64
67
|
useGridColumnGrouping(apiRef, props);
|
|
@@ -73,7 +73,8 @@ export const DATA_GRID_PROPS_DEFAULT_VALUES = {
|
|
|
73
73
|
showColumnVerticalBorder: false,
|
|
74
74
|
sortingMode: 'client',
|
|
75
75
|
sortingOrder: ['asc', 'desc', null],
|
|
76
|
-
throttleRowsMs: 0
|
|
76
|
+
throttleRowsMs: 0,
|
|
77
|
+
unstable_rowSpanning: false
|
|
77
78
|
};
|
|
78
79
|
const defaultSlots = DATA_GRID_DEFAULT_SLOTS_COMPONENTS;
|
|
79
80
|
export const useDataGridProps = inProps => {
|
package/components/GridRow.js
CHANGED
|
@@ -338,6 +338,7 @@ process.env.NODE_ENV !== "production" ? GridRow.propTypes = {
|
|
|
338
338
|
height: PropTypes.number.isRequired,
|
|
339
339
|
width: PropTypes.number.isRequired
|
|
340
340
|
}).isRequired,
|
|
341
|
+
groupHeaderHeight: PropTypes.number.isRequired,
|
|
341
342
|
hasScrollX: PropTypes.bool.isRequired,
|
|
342
343
|
hasScrollY: PropTypes.bool.isRequired,
|
|
343
344
|
headerFilterHeight: PropTypes.number.isRequired,
|
|
@@ -7,6 +7,7 @@ import PropTypes from 'prop-types';
|
|
|
7
7
|
import clsx from 'clsx';
|
|
8
8
|
import { unstable_useForkRef as useForkRef, unstable_composeClasses as composeClasses, unstable_ownerDocument as ownerDocument, unstable_capitalize as capitalize } from '@mui/utils';
|
|
9
9
|
import { fastMemo } from '@mui/x-internals/fastMemo';
|
|
10
|
+
import { useRtl } from '@mui/system/RtlProvider';
|
|
10
11
|
import { doesSupportPreventScroll } from "../../utils/doesSupportPreventScroll.js";
|
|
11
12
|
import { getDataGridUtilityClass, gridClasses } from "../../constants/gridClasses.js";
|
|
12
13
|
import { GridCellModes } from "../../models/index.js";
|
|
@@ -17,6 +18,7 @@ import { gridFocusCellSelector } from "../../hooks/features/focus/gridFocusState
|
|
|
17
18
|
import { MissingRowIdError } from "../../hooks/features/rows/useGridParamsApi.js";
|
|
18
19
|
import { shouldCellShowLeftBorder, shouldCellShowRightBorder } from "../../utils/cellBorderUtils.js";
|
|
19
20
|
import { GridPinnedColumnPosition } from "../../hooks/features/columns/gridColumnsInterfaces.js";
|
|
21
|
+
import { gridRowSpanningHiddenCellsSelector, gridRowSpanningSpannedCellsSelector } from "../../hooks/features/rows/gridRowSpanningSelectors.js";
|
|
20
22
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
23
|
export let PinnedPosition = /*#__PURE__*/function (PinnedPosition) {
|
|
22
24
|
PinnedPosition[PinnedPosition["NONE"] = 0] = "NONE";
|
|
@@ -106,6 +108,7 @@ const GridCell = /*#__PURE__*/React.forwardRef(function GridCell(props, ref) {
|
|
|
106
108
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
107
109
|
const apiRef = useGridApiContext();
|
|
108
110
|
const rootProps = useGridRootProps();
|
|
111
|
+
const isRtl = useRtl();
|
|
109
112
|
const field = column.field;
|
|
110
113
|
const cellParams = useGridSelector(apiRef, () => {
|
|
111
114
|
// This is required because `.getCellParams` tries to get the `state.rows.tree` entry
|
|
@@ -115,17 +118,19 @@ const GridCell = /*#__PURE__*/React.forwardRef(function GridCell(props, ref) {
|
|
|
115
118
|
const result = apiRef.current.getCellParams(rowId, field);
|
|
116
119
|
result.api = apiRef.current;
|
|
117
120
|
return result;
|
|
118
|
-
} catch (
|
|
119
|
-
if (
|
|
121
|
+
} catch (error) {
|
|
122
|
+
if (error instanceof MissingRowIdError) {
|
|
120
123
|
return EMPTY_CELL_PARAMS;
|
|
121
124
|
}
|
|
122
|
-
throw
|
|
125
|
+
throw error;
|
|
123
126
|
}
|
|
124
127
|
}, objectShallowCompare);
|
|
125
128
|
const isSelected = useGridSelector(apiRef, () => apiRef.current.unstable_applyPipeProcessors('isCellSelected', false, {
|
|
126
129
|
id: rowId,
|
|
127
130
|
field
|
|
128
131
|
}));
|
|
132
|
+
const hiddenCells = useGridSelector(apiRef, gridRowSpanningHiddenCellsSelector);
|
|
133
|
+
const spannedCells = useGridSelector(apiRef, gridRowSpanningSpannedCellsSelector);
|
|
129
134
|
const {
|
|
130
135
|
cellMode,
|
|
131
136
|
hasFocus,
|
|
@@ -198,6 +203,8 @@ const GridCell = /*#__PURE__*/React.forwardRef(function GridCell(props, ref) {
|
|
|
198
203
|
propHandler(event);
|
|
199
204
|
}
|
|
200
205
|
}, [apiRef, field, rowId]);
|
|
206
|
+
const isCellRowSpanned = hiddenCells[rowId]?.[field] ?? false;
|
|
207
|
+
const rowSpan = spannedCells[rowId]?.[field] ?? 1;
|
|
201
208
|
const style = React.useMemo(() => {
|
|
202
209
|
if (isNotVisible) {
|
|
203
210
|
return {
|
|
@@ -210,14 +217,21 @@ const GridCell = /*#__PURE__*/React.forwardRef(function GridCell(props, ref) {
|
|
|
210
217
|
const cellStyle = _extends({
|
|
211
218
|
'--width': `${width}px`
|
|
212
219
|
}, styleProp);
|
|
213
|
-
|
|
214
|
-
|
|
220
|
+
const isLeftPinned = pinnedPosition === PinnedPosition.LEFT;
|
|
221
|
+
const isRightPinned = pinnedPosition === PinnedPosition.RIGHT;
|
|
222
|
+
if (isLeftPinned || isRightPinned) {
|
|
223
|
+
let side = isLeftPinned ? 'left' : 'right';
|
|
224
|
+
if (isRtl) {
|
|
225
|
+
side = isLeftPinned ? 'right' : 'left';
|
|
226
|
+
}
|
|
227
|
+
cellStyle[side] = pinnedOffset;
|
|
215
228
|
}
|
|
216
|
-
if (
|
|
217
|
-
cellStyle.
|
|
229
|
+
if (rowSpan > 1) {
|
|
230
|
+
cellStyle.height = `calc(var(--height) * ${rowSpan})`;
|
|
231
|
+
cellStyle.zIndex = 5;
|
|
218
232
|
}
|
|
219
233
|
return cellStyle;
|
|
220
|
-
}, [width, isNotVisible, styleProp, pinnedOffset, pinnedPosition]);
|
|
234
|
+
}, [width, isNotVisible, styleProp, pinnedOffset, pinnedPosition, isRtl, rowSpan]);
|
|
221
235
|
React.useEffect(() => {
|
|
222
236
|
if (!hasFocus || cellMode === GridCellModes.Edit) {
|
|
223
237
|
return;
|
|
@@ -237,6 +251,15 @@ const GridCell = /*#__PURE__*/React.forwardRef(function GridCell(props, ref) {
|
|
|
237
251
|
}
|
|
238
252
|
}
|
|
239
253
|
}, [hasFocus, cellMode, apiRef]);
|
|
254
|
+
if (isCellRowSpanned) {
|
|
255
|
+
return /*#__PURE__*/_jsx("div", {
|
|
256
|
+
"data-colindex": colIndex,
|
|
257
|
+
role: "presentation",
|
|
258
|
+
style: _extends({
|
|
259
|
+
width: 'var(--width)'
|
|
260
|
+
}, style)
|
|
261
|
+
});
|
|
262
|
+
}
|
|
240
263
|
if (cellParams === EMPTY_CELL_PARAMS) {
|
|
241
264
|
return null;
|
|
242
265
|
}
|
|
@@ -291,12 +314,13 @@ const GridCell = /*#__PURE__*/React.forwardRef(function GridCell(props, ref) {
|
|
|
291
314
|
};
|
|
292
315
|
return /*#__PURE__*/_jsx("div", _extends({
|
|
293
316
|
ref: handleRef,
|
|
294
|
-
className: clsx(
|
|
317
|
+
className: clsx(classes.root, classNames, className),
|
|
295
318
|
role: "gridcell",
|
|
296
319
|
"data-field": field,
|
|
297
320
|
"data-colindex": colIndex,
|
|
298
321
|
"aria-colindex": colIndex + 1,
|
|
299
322
|
"aria-colspan": colSpan,
|
|
323
|
+
"aria-rowspan": rowSpan,
|
|
300
324
|
style: style,
|
|
301
325
|
title: title,
|
|
302
326
|
tabIndex: tabIndex,
|
|
@@ -36,7 +36,7 @@ export const GridBaseColumnHeaders = /*#__PURE__*/React.forwardRef(function Grid
|
|
|
36
36
|
const classes = useUtilityClasses(rootProps);
|
|
37
37
|
return /*#__PURE__*/_jsx(GridColumnHeadersRoot, _extends({
|
|
38
38
|
ref: ref,
|
|
39
|
-
className: clsx(
|
|
39
|
+
className: clsx(classes.root, className),
|
|
40
40
|
ownerState: rootProps
|
|
41
41
|
}, other, {
|
|
42
42
|
role: "presentation"
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["field", "id", "
|
|
3
|
+
const _excluded = ["field", "id", "formattedValue", "row", "rowNode", "colDef", "isEditable", "cellMode", "hasFocus", "tabIndex", "api"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { unstable_composeClasses as composeClasses, unstable_useForkRef as useForkRef } from '@mui/utils';
|
|
7
7
|
import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
|
|
8
8
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
9
9
|
import { getDataGridUtilityClass } from "../../constants/gridClasses.js";
|
|
10
|
+
import { useGridSelector } from "../../hooks/utils/useGridSelector.js";
|
|
11
|
+
import { getCheckboxPropsSelector } from "../../hooks/features/rowSelection/utils.js";
|
|
10
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
13
|
const useUtilityClasses = ownerState => {
|
|
12
14
|
const {
|
|
@@ -21,7 +23,6 @@ const GridCellCheckboxForwardRef = /*#__PURE__*/React.forwardRef(function GridCe
|
|
|
21
23
|
const {
|
|
22
24
|
field,
|
|
23
25
|
id,
|
|
24
|
-
value: isChecked,
|
|
25
26
|
rowNode,
|
|
26
27
|
hasFocus,
|
|
27
28
|
tabIndex
|
|
@@ -69,21 +70,28 @@ const GridCellCheckboxForwardRef = /*#__PURE__*/React.forwardRef(function GridCe
|
|
|
69
70
|
event.stopPropagation();
|
|
70
71
|
}
|
|
71
72
|
}, []);
|
|
73
|
+
const isSelectable = apiRef.current.isRowSelectable(id);
|
|
74
|
+
const checkboxPropsSelector = getCheckboxPropsSelector(id, rootProps.rowSelectionPropagation?.parents ?? false);
|
|
75
|
+
const {
|
|
76
|
+
isIndeterminate,
|
|
77
|
+
isChecked
|
|
78
|
+
} = useGridSelector(apiRef, checkboxPropsSelector);
|
|
72
79
|
if (rowNode.type === 'footer' || rowNode.type === 'pinnedRow') {
|
|
73
80
|
return null;
|
|
74
81
|
}
|
|
75
|
-
const isSelectable = apiRef.current.isRowSelectable(id);
|
|
76
82
|
const label = apiRef.current.getLocaleText(isChecked ? 'checkboxSelectionUnselectRow' : 'checkboxSelectionSelectRow');
|
|
83
|
+
const checked = rootProps.indeterminateCheckboxAction === 'select' ? isChecked && !isIndeterminate : isChecked;
|
|
77
84
|
return /*#__PURE__*/_jsx(rootProps.slots.baseCheckbox, _extends({
|
|
78
85
|
ref: handleRef,
|
|
79
86
|
tabIndex: tabIndex,
|
|
80
|
-
checked:
|
|
87
|
+
checked: checked,
|
|
81
88
|
onChange: handleChange,
|
|
82
89
|
className: classes.root,
|
|
83
90
|
inputProps: {
|
|
84
91
|
'aria-label': label
|
|
85
92
|
},
|
|
86
93
|
onKeyDown: handleKeyDown,
|
|
94
|
+
indeterminate: isIndeterminate,
|
|
87
95
|
disabled: !isSelectable,
|
|
88
96
|
touchRippleRef: rippleRef /* FIXME: typing error */
|
|
89
97
|
}, rootProps.slotProps?.baseCheckbox, other));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { GridColumnHeaderParams } from '../../models/params/gridColumnHeaderParams';
|
|
3
|
-
declare const GridHeaderCheckbox: React.ForwardRefExoticComponent<GridColumnHeaderParams<import("
|
|
3
|
+
declare const GridHeaderCheckbox: React.ForwardRefExoticComponent<GridColumnHeaderParams<import("../..").GridValidRowModel, any, any> & React.RefAttributes<HTMLButtonElement>>;
|
|
4
4
|
export { GridHeaderCheckbox };
|
|
@@ -46,7 +46,7 @@ const GridRoot = /*#__PURE__*/React.forwardRef(function GridRoot(props, ref) {
|
|
|
46
46
|
}
|
|
47
47
|
return /*#__PURE__*/_jsx(GridRootStyles, _extends({
|
|
48
48
|
ref: handleRef,
|
|
49
|
-
className: clsx(
|
|
49
|
+
className: clsx(classes.root, className),
|
|
50
50
|
ownerState: ownerState
|
|
51
51
|
}, other));
|
|
52
52
|
});
|
|
@@ -170,14 +170,28 @@ export const GridRootStyles = styled('div', {
|
|
|
170
170
|
const hoverOpacity = (t.vars || t).palette.action.hoverOpacity;
|
|
171
171
|
const hoverColor = (t.vars || t).palette.action.hover;
|
|
172
172
|
const selectedOpacity = (t.vars || t).palette.action.selectedOpacity;
|
|
173
|
+
const selectedHoverOpacity = t.vars ? `calc(${hoverOpacity} + ${selectedOpacity})` // TODO: Improve type
|
|
174
|
+
: hoverOpacity + selectedOpacity;
|
|
173
175
|
const selectedBackground = t.vars ? `rgba(${t.vars.palette.primary.mainChannel} / ${selectedOpacity})` : alpha(t.palette.primary.main, selectedOpacity);
|
|
174
|
-
const selectedHoverBackground = t.vars ? `rgba(${t.vars.palette.primary.mainChannel} /
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
176
|
+
const selectedHoverBackground = t.vars ? `rgba(${t.vars.palette.primary.mainChannel} / ${selectedHoverOpacity})` : alpha(t.palette.primary.main, selectedHoverOpacity);
|
|
177
|
+
const blendFn = t.vars ? blendCssVars : blend;
|
|
178
|
+
const getPinnedBackgroundStyles = backgroundColor => ({
|
|
179
|
+
[`& .${c['cell--pinnedLeft']}, & .${c['cell--pinnedRight']}`]: {
|
|
180
|
+
backgroundColor,
|
|
181
|
+
'&.Mui-selected': {
|
|
182
|
+
backgroundColor: blendFn(backgroundColor, selectedBackground, selectedOpacity),
|
|
183
|
+
'&:hover': {
|
|
184
|
+
backgroundColor: blendFn(backgroundColor, selectedBackground, selectedHoverOpacity)
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
const pinnedBackgroundColor = blendFn(pinnedBackground, hoverColor, hoverOpacity);
|
|
190
|
+
const pinnedHoverStyles = getPinnedBackgroundStyles(pinnedBackgroundColor);
|
|
191
|
+
const pinnedSelectedBackgroundColor = blendFn(pinnedBackground, selectedBackground, selectedOpacity);
|
|
192
|
+
const pinnedSelectedStyles = getPinnedBackgroundStyles(pinnedSelectedBackgroundColor);
|
|
193
|
+
const pinnedSelectedHoverBackgroundColor = blendFn(pinnedBackground, selectedHoverBackground, selectedHoverOpacity);
|
|
194
|
+
const pinnedSelectedHoverStyles = getPinnedBackgroundStyles(pinnedSelectedHoverBackgroundColor);
|
|
181
195
|
const selectedStyles = {
|
|
182
196
|
backgroundColor: selectedBackground,
|
|
183
197
|
'&:hover': {
|
|
@@ -617,24 +631,15 @@ export const GridRootStyles = styled('div', {
|
|
|
617
631
|
[`& .${c['cell--pinnedLeft']}, & .${c['cell--pinnedRight']}`]: {
|
|
618
632
|
position: 'sticky',
|
|
619
633
|
zIndex: 3,
|
|
620
|
-
background: 'var(--DataGrid-pinnedBackground)'
|
|
634
|
+
background: 'var(--DataGrid-pinnedBackground)',
|
|
635
|
+
'&.Mui-selected': {
|
|
636
|
+
backgroundColor: pinnedSelectedBackgroundColor
|
|
637
|
+
}
|
|
621
638
|
},
|
|
622
639
|
[`& .${c.virtualScrollerContent} .${c.row}`]: {
|
|
623
|
-
'&:hover':
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
}
|
|
627
|
-
},
|
|
628
|
-
[`&.Mui-selected`]: {
|
|
629
|
-
[`& .${c['cell--pinnedLeft']}, & .${c['cell--pinnedRight']}`]: {
|
|
630
|
-
backgroundColor: pinnedSelectedBackground
|
|
631
|
-
},
|
|
632
|
-
'&:hover': {
|
|
633
|
-
[`& .${c['cell--pinnedLeft']}, & .${c['cell--pinnedRight']}`]: {
|
|
634
|
-
backgroundColor: pinnedSelectedHoverBackground
|
|
635
|
-
}
|
|
636
|
-
}
|
|
637
|
-
}
|
|
640
|
+
'&:hover': pinnedHoverStyles,
|
|
641
|
+
'&.Mui-selected': pinnedSelectedStyles,
|
|
642
|
+
'&.Mui-selected:hover': pinnedSelectedHoverStyles
|
|
638
643
|
},
|
|
639
644
|
[`& .${c.cellOffsetLeft}`]: {
|
|
640
645
|
flex: '0 0 auto',
|
|
@@ -747,4 +752,8 @@ function blend(background, overlay, opacity, gamma = 1) {
|
|
|
747
752
|
type: 'rgb',
|
|
748
753
|
values: rgb
|
|
749
754
|
});
|
|
755
|
+
}
|
|
756
|
+
const removeOpacity = color => `rgb(from ${color} r g b / 1)`;
|
|
757
|
+
function blendCssVars(background, overlay, opacity) {
|
|
758
|
+
return `color-mix(in srgb,${background}, ${removeOpacity(overlay)} calc(${opacity} * 100%))`;
|
|
750
759
|
}
|
|
@@ -44,7 +44,7 @@ const GridToolbarContainer = /*#__PURE__*/React.forwardRef(function GridToolbarC
|
|
|
44
44
|
}
|
|
45
45
|
return /*#__PURE__*/_jsx(GridToolbarContainerRoot, _extends({
|
|
46
46
|
ref: ref,
|
|
47
|
-
className: clsx(
|
|
47
|
+
className: clsx(classes.root, className),
|
|
48
48
|
ownerState: rootProps
|
|
49
49
|
}, other, {
|
|
50
50
|
children: children
|
|
@@ -85,7 +85,7 @@ function GridMenu(props) {
|
|
|
85
85
|
};
|
|
86
86
|
return /*#__PURE__*/_jsx(GridMenuRoot, _extends({
|
|
87
87
|
as: rootProps.slots.basePopper,
|
|
88
|
-
className: clsx(
|
|
88
|
+
className: clsx(classes.root, className),
|
|
89
89
|
ownerState: rootProps,
|
|
90
90
|
open: open,
|
|
91
91
|
anchorEl: target,
|