@mui/x-data-grid 7.21.0 → 7.22.1
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 +142 -0
- package/components/GridRow.js +1 -1
- package/components/cell/GridBooleanCell.d.ts +3 -3
- package/components/cell/GridBooleanCell.js +13 -2
- package/components/columnHeaders/GridColumnHeaderFilterIconButton.js +1 -2
- package/components/columnHeaders/GridColumnHeaderSortIcon.js +1 -2
- package/components/containers/GridRootStyles.js +4 -2
- package/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/components/panel/filterPanel/GridFilterInputMultipleValue.js +2 -2
- package/components/panel/filterPanel/GridFilterInputValue.js +2 -2
- package/components/toolbar/GridToolbar.js +2 -3
- package/components/toolbar/GridToolbarExport.js +1 -13
- package/components/toolbar/GridToolbarFilterButton.js +1 -2
- package/components/virtualization/GridBottomContainer.js +0 -17
- package/components/virtualization/GridMainContainer.js +2 -1
- package/components/virtualization/GridVirtualScrollbar.js +1 -1
- package/components/virtualization/GridVirtualScroller.js +2 -0
- package/constants/gridClasses.d.ts +5 -0
- package/constants/gridClasses.js +1 -1
- package/hooks/core/pipeProcessing/gridPipeProcessingApi.d.ts +4 -0
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +1 -2
- package/hooks/features/columnMenu/useGridColumnMenuSlots.js +4 -3
- package/hooks/features/focus/useGridFocus.js +18 -3
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +3 -4
- package/hooks/features/listView/useGridListView.d.ts +1 -1
- package/hooks/features/listView/useGridListView.js +8 -2
- package/hooks/features/pagination/gridPaginationSelector.js +2 -1
- package/hooks/features/rowSelection/useGridRowSelection.js +1 -1
- package/hooks/features/rows/useGridRowSpanning.js +3 -1
- package/hooks/features/scroll/useGridScroll.js +3 -7
- package/hooks/features/virtualization/useGridVirtualScroller.js +3 -2
- package/index.js +1 -1
- package/internals/constants.d.ts +3 -0
- package/internals/constants.js +3 -0
- package/internals/index.d.ts +1 -0
- package/internals/index.js +2 -1
- package/internals/utils/gridRowGroupingUtils.d.ts +2 -0
- package/internals/utils/gridRowGroupingUtils.js +9 -0
- package/internals/utils/index.d.ts +1 -0
- package/internals/utils/index.js +2 -1
- package/joy/joySlots.js +45 -27
- package/locales/daDK.js +5 -6
- package/locales/itIT.js +27 -28
- package/locales/ptBR.js +4 -4
- package/material/index.js +4 -0
- package/models/gridExport.d.ts +1 -1
- package/models/gridSlotsComponent.d.ts +10 -0
- package/models/gridSlotsComponentsProps.d.ts +9 -0
- package/modern/components/GridRow.js +1 -1
- package/modern/components/cell/GridBooleanCell.js +13 -2
- package/modern/components/columnHeaders/GridColumnHeaderFilterIconButton.js +1 -2
- package/modern/components/columnHeaders/GridColumnHeaderSortIcon.js +1 -2
- package/modern/components/containers/GridRootStyles.js +4 -2
- package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/modern/components/panel/filterPanel/GridFilterInputMultipleValue.js +2 -2
- package/modern/components/panel/filterPanel/GridFilterInputValue.js +2 -2
- package/modern/components/toolbar/GridToolbar.js +2 -3
- package/modern/components/toolbar/GridToolbarExport.js +1 -13
- package/modern/components/toolbar/GridToolbarFilterButton.js +1 -2
- package/modern/components/virtualization/GridBottomContainer.js +0 -17
- package/modern/components/virtualization/GridMainContainer.js +2 -1
- package/modern/components/virtualization/GridVirtualScrollbar.js +1 -1
- package/modern/components/virtualization/GridVirtualScroller.js +2 -0
- package/modern/constants/gridClasses.js +1 -1
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +1 -2
- package/modern/hooks/features/columnMenu/useGridColumnMenuSlots.js +4 -3
- package/modern/hooks/features/focus/useGridFocus.js +18 -3
- package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +3 -4
- package/modern/hooks/features/listView/useGridListView.js +8 -2
- package/modern/hooks/features/pagination/gridPaginationSelector.js +2 -1
- package/modern/hooks/features/rowSelection/useGridRowSelection.js +1 -1
- package/modern/hooks/features/rows/useGridRowSpanning.js +3 -1
- package/modern/hooks/features/scroll/useGridScroll.js +3 -7
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +3 -2
- package/modern/index.js +1 -1
- package/modern/internals/constants.js +3 -0
- package/modern/internals/index.js +2 -1
- package/modern/internals/utils/gridRowGroupingUtils.js +9 -0
- package/modern/internals/utils/index.js +2 -1
- package/modern/joy/joySlots.js +45 -27
- package/modern/locales/daDK.js +5 -6
- package/modern/locales/itIT.js +27 -28
- package/modern/locales/ptBR.js +4 -4
- package/modern/material/index.js +4 -0
- package/node/components/GridRow.js +2 -2
- package/node/components/cell/GridBooleanCell.js +13 -2
- package/node/components/columnHeaders/GridColumnHeaderFilterIconButton.js +1 -2
- package/node/components/columnHeaders/GridColumnHeaderSortIcon.js +1 -2
- package/node/components/containers/GridRootStyles.js +4 -2
- package/node/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/node/components/panel/filterPanel/GridFilterInputMultipleValue.js +2 -2
- package/node/components/panel/filterPanel/GridFilterInputValue.js +2 -2
- package/node/components/toolbar/GridToolbar.js +2 -3
- package/node/components/toolbar/GridToolbarExport.js +1 -13
- package/node/components/toolbar/GridToolbarFilterButton.js +1 -2
- package/node/components/virtualization/GridBottomContainer.js +0 -17
- package/node/components/virtualization/GridMainContainer.js +2 -1
- package/node/components/virtualization/GridVirtualScrollbar.js +1 -1
- package/node/components/virtualization/GridVirtualScroller.js +2 -0
- package/node/constants/gridClasses.js +1 -1
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +1 -2
- package/node/hooks/features/columnMenu/useGridColumnMenuSlots.js +4 -3
- package/node/hooks/features/focus/useGridFocus.js +18 -3
- package/node/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +4 -5
- package/node/hooks/features/listView/useGridListView.js +8 -2
- package/node/hooks/features/pagination/gridPaginationSelector.js +3 -1
- package/node/hooks/features/rowSelection/useGridRowSelection.js +2 -2
- package/node/hooks/features/rows/useGridRowSpanning.js +3 -1
- package/node/hooks/features/scroll/useGridScroll.js +3 -7
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +3 -2
- package/node/index.js +1 -1
- package/node/internals/constants.js +9 -0
- package/node/internals/index.js +12 -0
- package/node/internals/utils/gridRowGroupingUtils.js +17 -0
- package/node/internals/utils/index.js +11 -0
- package/node/joy/joySlots.js +45 -27
- package/node/locales/daDK.js +5 -6
- package/node/locales/itIT.js +27 -28
- package/node/locales/ptBR.js +4 -4
- package/node/material/index.js +4 -0
- package/package.json +1 -1
- package/constants/gridDetailPanelToggleField.d.ts +0 -1
- package/constants/gridDetailPanelToggleField.js +0 -2
- package/modern/constants/gridDetailPanelToggleField.js +0 -2
- package/node/constants/gridDetailPanelToggleField.js +0 -8
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,148 @@
|
|
|
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.22.1
|
|
7
|
+
|
|
8
|
+
_Nov 1, 2024_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 7 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🐞 Bugfixes
|
|
13
|
+
- 📚 Documentation improvements
|
|
14
|
+
- 🌍 Improve Polish (pl-PL) locale on the Date Pickers
|
|
15
|
+
|
|
16
|
+
Special thanks go out to the community contributors who have helped make this release possible:
|
|
17
|
+
@wojtkolos, @dpak-maurya, @k-rajat19.
|
|
18
|
+
Following are all team members who have contributed to this release:
|
|
19
|
+
@LukasTy, @arminmeh, @MBilalShafi, @KenanYusuf, @flaviendelangle.
|
|
20
|
+
|
|
21
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
22
|
+
|
|
23
|
+
### Data Grid
|
|
24
|
+
|
|
25
|
+
#### `@mui/x-data-grid@7.22.1`
|
|
26
|
+
|
|
27
|
+
- [DataGrid] Fix right column group header border (#15152) @KenanYusuf
|
|
28
|
+
- [DataGrid] Fix scroll jump when holding down arrow keys (#15167) @arminmeh
|
|
29
|
+
- [DataGrid] Move `rowGroupingModelChange` handler to respective hook (#15127) @MBilalShafi
|
|
30
|
+
- [DataGrid] Prevent error when deleting the last row (#15153) @dpak-maurya
|
|
31
|
+
- [DataGrid] Fix overlay height in autoHeight mode (#15205) @cherniavskii
|
|
32
|
+
|
|
33
|
+
#### `@mui/x-data-grid-pro@7.22.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
34
|
+
|
|
35
|
+
Same changes as in `@mui/x-data-grid@7.22.1`, plus:
|
|
36
|
+
|
|
37
|
+
- [DataGridPro] Add list view tests (#15166) @KenanYusuf
|
|
38
|
+
|
|
39
|
+
#### `@mui/x-data-grid-premium@7.22.1` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
40
|
+
|
|
41
|
+
- [DataGridPremium] Keep focus on the grouping cell on space bar press #15155 @k-rajat19
|
|
42
|
+
|
|
43
|
+
### Date and Time Pickers
|
|
44
|
+
|
|
45
|
+
#### `@mui/x-date-pickers@7.22.1`
|
|
46
|
+
|
|
47
|
+
- [l10n] Improve Polish (pl-PL) locale (#15177) @wojtkolos
|
|
48
|
+
|
|
49
|
+
#### `@mui/x-date-pickers-pro@7.22.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
50
|
+
|
|
51
|
+
Same changes as in `@mui/x-date-pickers@7.22.1`.
|
|
52
|
+
|
|
53
|
+
### Tree View
|
|
54
|
+
|
|
55
|
+
#### `@mui/x-tree-view@7.22.1`
|
|
56
|
+
|
|
57
|
+
- [TreeView] Export `TreeItem2DragAndDropOverlay` and `TreeItem2LabelInput` from the root of each package (#15208) @flaviendelangle
|
|
58
|
+
- [TreeView] Fix drag and drop color usage (#15149) @LukasTy
|
|
59
|
+
|
|
60
|
+
#### `@mui/x-tree-view-pro@7.22.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
61
|
+
|
|
62
|
+
Same changes as in `@mui/x-tree-view@7.22.1`.
|
|
63
|
+
|
|
64
|
+
### Docs
|
|
65
|
+
|
|
66
|
+
- [docs] Add section explaining how to keep the selection while filtering in Data grid docs (#15199) @arminmeh
|
|
67
|
+
|
|
68
|
+
## 7.22.0
|
|
69
|
+
|
|
70
|
+
_Oct 25, 2024_
|
|
71
|
+
|
|
72
|
+
We'd like to offer a big thanks to the 11 contributors who made this release possible. Here are some highlights ✨:
|
|
73
|
+
|
|
74
|
+
- 🛰 Introduce [server-side support for Data Grid row grouping](https://mui.com/x/react-data-grid/server-side-data/row-grouping/)
|
|
75
|
+
- 🐞 Bugfixes
|
|
76
|
+
- 📚 Documentation improvements
|
|
77
|
+
- 🌍 Improve Portuguese (pt-BR) locale on the Data Grid component
|
|
78
|
+
|
|
79
|
+
Special thanks go out to the community contributors who have helped make this release possible:
|
|
80
|
+
@clins1994, @GITPHLAP, @k-rajat19, @kalyan90, @merotosc, @yash49.
|
|
81
|
+
Following are all team members who have contributed to this release:
|
|
82
|
+
@cherniavskii, @flaviendelangle, @LukasTy, @MBilalShafi, @romgrk.
|
|
83
|
+
|
|
84
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
85
|
+
|
|
86
|
+
### Data Grid
|
|
87
|
+
|
|
88
|
+
#### `@mui/x-data-grid@7.22.0`
|
|
89
|
+
|
|
90
|
+
- [DataGrid] Fix `GridPanelAnchor` positioning (#15022) @k-rajat19
|
|
91
|
+
- [DataGrid] Fix ugly prop-types for the `pageStyle` prop of the `GridPrintExportMenuItem` component (#15015) @flaviendelangle
|
|
92
|
+
- [DataGrid] Fix value type in filter model for number and boolean column type (#14733) @k-rajat19
|
|
93
|
+
- [DataGrid] Focus next row when the focused row is deleted (#15067) @cherniavskii
|
|
94
|
+
- [DataGrid] Remove some usages of `<Box />` and `<Badge />` (#15013) @romgrk
|
|
95
|
+
- [DataGrid] Fix number of rows to display for page size options with negative value (#14890) @kalyan90
|
|
96
|
+
- [l10n] Improve Portuguese (pt-BR) locale (#15021) @k-rajat19
|
|
97
|
+
|
|
98
|
+
#### `@mui/x-data-grid-pro@7.22.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
99
|
+
|
|
100
|
+
Same changes as in `@mui/x-data-grid@7.22.0`, plus:
|
|
101
|
+
|
|
102
|
+
- [DataGridPro] Fix column pinning layout (#15073) @cherniavskii
|
|
103
|
+
|
|
104
|
+
#### `@mui/x-data-grid-premium@7.22.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
105
|
+
|
|
106
|
+
Same changes as in `@mui/x-data-grid-pro@7.22.0`, plus:
|
|
107
|
+
|
|
108
|
+
- [DataGridPremium] Server-side data source with row grouping (#15109) @MBilalShafi
|
|
109
|
+
|
|
110
|
+
### Date and Time Pickers
|
|
111
|
+
|
|
112
|
+
#### `@mui/x-date-pickers@7.22.0`
|
|
113
|
+
|
|
114
|
+
- [pickers] Fix `DateCalendar` timezone management (#15119) @LukasTy
|
|
115
|
+
- [pickers] Fix `DigitalClock` time options on a `DST` switch day (#15092) @LukasTy
|
|
116
|
+
|
|
117
|
+
#### `@mui/x-date-pickers-pro@7.22.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
118
|
+
|
|
119
|
+
Same changes as in `@mui/x-date-pickers@7.22.0`.
|
|
120
|
+
|
|
121
|
+
### Charts
|
|
122
|
+
|
|
123
|
+
#### `@mui/x-charts@7.22.0`
|
|
124
|
+
|
|
125
|
+
- [charts] Export data type in `onAxisClick(_, data)` callback (#15038) @clins1994
|
|
126
|
+
|
|
127
|
+
#### `@mui/x-charts-pro@7.0.0-beta.6` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
128
|
+
|
|
129
|
+
Same changes as in `@mui/x-charts@7.22.0`.
|
|
130
|
+
|
|
131
|
+
### Tree View
|
|
132
|
+
|
|
133
|
+
#### `@mui/x-tree-view@7.22.0`
|
|
134
|
+
|
|
135
|
+
- [TreeView] Make the cancellable event types public (#14992) @flaviendelangle
|
|
136
|
+
|
|
137
|
+
### Docs
|
|
138
|
+
|
|
139
|
+
- [docs] Fix typo in Tree View docs (#15047) @yash49
|
|
140
|
+
|
|
141
|
+
### Core
|
|
142
|
+
|
|
143
|
+
- [core] Adjust cherry-pick GH actions (#15101) @LukasTy
|
|
144
|
+
- [core] Update prettier target branch (#15100) @MBilalShafi
|
|
145
|
+
- [core] Update some `default-branch-switch` instances for `v7.x` (#15085) @MBilalShafi
|
|
146
|
+
- [test] Revert to using `fireEvent` instead of `userEvent` (#14927) @LukasTy
|
|
147
|
+
|
|
6
148
|
## 7.21.0
|
|
7
149
|
|
|
8
150
|
_Oct 17, 2024_
|
package/components/GridRow.js
CHANGED
|
@@ -16,7 +16,7 @@ import { useGridVisibleRows } from "../hooks/utils/useGridVisibleRows.js";
|
|
|
16
16
|
import { findParentElementFromClassName, isEventTargetInPortal } from "../utils/domUtils.js";
|
|
17
17
|
import { GRID_CHECKBOX_SELECTION_COL_DEF } from "../colDef/gridCheckboxSelectionColDef.js";
|
|
18
18
|
import { GRID_ACTIONS_COLUMN_TYPE } from "../colDef/gridActionsColDef.js";
|
|
19
|
-
import { GRID_DETAIL_PANEL_TOGGLE_FIELD } from "../constants
|
|
19
|
+
import { GRID_DETAIL_PANEL_TOGGLE_FIELD } from "../internals/constants.js";
|
|
20
20
|
import { gridSortModelSelector } from "../hooks/features/sorting/gridSortingSelector.js";
|
|
21
21
|
import { gridRowMaximumTreeDepthSelector } from "../hooks/features/rows/gridRowsSelector.js";
|
|
22
22
|
import { gridEditRowsStateSelector } from "../hooks/features/editing/gridEditingSelectors.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { SvgIconProps } from '@mui/material/SvgIcon';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import type { GridColDef } from '../../models/colDef/gridColDef';
|
|
4
|
+
import type { GridRenderCellParams } from '../../models/params/gridCellParams';
|
|
5
5
|
interface GridBooleanCellProps extends GridRenderCellParams, Omit<SvgIconProps, 'tabIndex' | 'id'> {
|
|
6
6
|
hideDescendantCount?: boolean;
|
|
7
7
|
}
|
|
8
|
-
declare function GridBooleanCellRaw(props: GridBooleanCellProps): React.JSX.Element;
|
|
8
|
+
declare function GridBooleanCellRaw(props: GridBooleanCellProps): React.JSX.Element | null;
|
|
9
9
|
declare namespace GridBooleanCellRaw {
|
|
10
10
|
var propTypes: any;
|
|
11
11
|
}
|
|
@@ -4,10 +4,13 @@ const _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowN
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import composeClasses from '@mui/utils/composeClasses';
|
|
7
|
+
import { useGridSelector } from "../../hooks/utils/useGridSelector.js";
|
|
8
|
+
import { gridRowMaximumTreeDepthSelector } from "../../hooks/features/rows/gridRowsSelector.js";
|
|
7
9
|
import { getDataGridUtilityClass } from "../../constants/gridClasses.js";
|
|
8
10
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
9
11
|
import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
|
|
10
12
|
import { isAutogeneratedRowNode } from "../../hooks/features/rows/gridRowsUtils.js";
|
|
13
|
+
import { GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD } from "../../internals/constants.js";
|
|
11
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
15
|
const useUtilityClasses = ownerState => {
|
|
13
16
|
const {
|
|
@@ -20,7 +23,8 @@ const useUtilityClasses = ownerState => {
|
|
|
20
23
|
};
|
|
21
24
|
function GridBooleanCellRaw(props) {
|
|
22
25
|
const {
|
|
23
|
-
value
|
|
26
|
+
value,
|
|
27
|
+
rowNode
|
|
24
28
|
} = props,
|
|
25
29
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
26
30
|
const apiRef = useGridApiContext();
|
|
@@ -29,7 +33,14 @@ function GridBooleanCellRaw(props) {
|
|
|
29
33
|
classes: rootProps.classes
|
|
30
34
|
};
|
|
31
35
|
const classes = useUtilityClasses(ownerState);
|
|
36
|
+
const maxDepth = useGridSelector(apiRef, gridRowMaximumTreeDepthSelector);
|
|
37
|
+
const isServerSideRowGroupingRow =
|
|
38
|
+
// @ts-expect-error - Access tree data prop
|
|
39
|
+
maxDepth > 0 && rowNode.type === 'group' && rootProps.treeData === false;
|
|
32
40
|
const Icon = React.useMemo(() => value ? rootProps.slots.booleanCellTrueIcon : rootProps.slots.booleanCellFalseIcon, [rootProps.slots.booleanCellFalseIcon, rootProps.slots.booleanCellTrueIcon, value]);
|
|
41
|
+
if (isServerSideRowGroupingRow && value === undefined) {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
33
44
|
return /*#__PURE__*/_jsx(Icon, _extends({
|
|
34
45
|
fontSize: "small",
|
|
35
46
|
className: classes.root,
|
|
@@ -106,7 +117,7 @@ process.env.NODE_ENV !== "production" ? GridBooleanCellRaw.propTypes = {
|
|
|
106
117
|
const GridBooleanCell = /*#__PURE__*/React.memo(GridBooleanCellRaw);
|
|
107
118
|
export { GridBooleanCell };
|
|
108
119
|
export const renderBooleanCell = params => {
|
|
109
|
-
if (params.field !==
|
|
120
|
+
if (params.field !== GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD && isAutogeneratedRowNode(params.rowNode)) {
|
|
110
121
|
return '';
|
|
111
122
|
}
|
|
112
123
|
return /*#__PURE__*/_jsx(GridBooleanCell, _extends({}, params));
|
|
@@ -2,7 +2,6 @@ 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 Badge from '@mui/material/Badge';
|
|
6
5
|
import { useGridSelector } from "../../hooks/index.js";
|
|
7
6
|
import { gridPreferencePanelStateSelector } from "../../hooks/features/preferencesPanel/gridPreferencePanelSelector.js";
|
|
8
7
|
import { GridPreferencePanelsValue } from "../../hooks/features/preferencesPanel/gridPreferencePanelsValue.js";
|
|
@@ -76,7 +75,7 @@ function GridColumnHeaderFilterIconButton(props) {
|
|
|
76
75
|
enterDelay: 1000
|
|
77
76
|
}, rootProps.slotProps?.baseTooltip, {
|
|
78
77
|
children: /*#__PURE__*/_jsxs(GridIconButtonContainer, {
|
|
79
|
-
children: [counter > 1 && /*#__PURE__*/_jsx(
|
|
78
|
+
children: [counter > 1 && /*#__PURE__*/_jsx(rootProps.slots.baseBadge, {
|
|
80
79
|
badgeContent: counter,
|
|
81
80
|
color: "default",
|
|
82
81
|
children: iconButton
|
|
@@ -4,7 +4,6 @@ const _excluded = ["direction", "index", "sortingOrder", "disabled"];
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import composeClasses from '@mui/utils/composeClasses';
|
|
7
|
-
import Badge from '@mui/material/Badge';
|
|
8
7
|
import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
|
|
9
8
|
import { getDataGridUtilityClass } from "../../constants/gridClasses.js";
|
|
10
9
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
@@ -63,7 +62,7 @@ function GridColumnHeaderSortIconRaw(props) {
|
|
|
63
62
|
children: iconElement
|
|
64
63
|
}));
|
|
65
64
|
return /*#__PURE__*/_jsxs(GridIconButtonContainer, {
|
|
66
|
-
children: [index != null && /*#__PURE__*/_jsx(
|
|
65
|
+
children: [index != null && /*#__PURE__*/_jsx(rootProps.slots.baseBadge, {
|
|
67
66
|
badgeContent: index,
|
|
68
67
|
color: "default",
|
|
69
68
|
overlap: "circular",
|
|
@@ -152,6 +152,8 @@ export const GridRootStyles = styled('div', {
|
|
|
152
152
|
[`& .${c.treeDataGroupingCellToggle}`]: styles.treeDataGroupingCellToggle
|
|
153
153
|
}, {
|
|
154
154
|
[`& .${c.treeDataGroupingCellLoadingContainer}`]: styles.treeDataGroupingCellLoadingContainer
|
|
155
|
+
}, {
|
|
156
|
+
[`& .${c.groupingCriteriaCellLoadingContainer}`]: styles.groupingCriteriaCellLoadingContainer
|
|
155
157
|
}, {
|
|
156
158
|
[`& .${c.detailPanelToggleCell}`]: styles.detailPanelToggleCell
|
|
157
159
|
}, {
|
|
@@ -685,7 +687,7 @@ export const GridRootStyles = styled('div', {
|
|
|
685
687
|
alignSelf: 'stretch',
|
|
686
688
|
marginRight: t.spacing(2)
|
|
687
689
|
},
|
|
688
|
-
[`& .${c.treeDataGroupingCellLoadingContainer}`]: {
|
|
690
|
+
[`& .${c.treeDataGroupingCellLoadingContainer}, .${c.groupingCriteriaCellLoadingContainer}`]: {
|
|
689
691
|
display: 'flex',
|
|
690
692
|
alignItems: 'center',
|
|
691
693
|
justifyContent: 'center',
|
|
@@ -718,7 +720,7 @@ export const GridRootStyles = styled('div', {
|
|
|
718
720
|
}
|
|
719
721
|
},
|
|
720
722
|
[`& .${c.filler}`]: {
|
|
721
|
-
flex: 1
|
|
723
|
+
flex: '1 0 auto'
|
|
722
724
|
},
|
|
723
725
|
[`& .${c['filler--borderBottom']}`]: {
|
|
724
726
|
borderBottom: '1px solid var(--DataGrid-rowBorderColor)'
|
|
@@ -39,9 +39,9 @@ function GridFilterInputMultipleValue(props) {
|
|
|
39
39
|
const handleChange = React.useCallback((event, value) => {
|
|
40
40
|
setFilterValueState(value.map(String));
|
|
41
41
|
applyValue(_extends({}, item, {
|
|
42
|
-
value: [...value]
|
|
42
|
+
value: [...value.map(filterItemValue => type === 'number' ? Number(filterItemValue) : filterItemValue)]
|
|
43
43
|
}));
|
|
44
|
-
}, [applyValue, item]);
|
|
44
|
+
}, [applyValue, item, type]);
|
|
45
45
|
return /*#__PURE__*/_jsx(Autocomplete, _extends({
|
|
46
46
|
multiple: true,
|
|
47
47
|
freeSolo: true,
|
|
@@ -34,13 +34,13 @@ function GridFilterInputValue(props) {
|
|
|
34
34
|
setIsApplying(true);
|
|
35
35
|
filterTimeout.start(rootProps.filterDebounceMs, () => {
|
|
36
36
|
const newItem = _extends({}, item, {
|
|
37
|
-
value,
|
|
37
|
+
value: type === 'number' ? Number(value) : value,
|
|
38
38
|
fromInput: id
|
|
39
39
|
});
|
|
40
40
|
applyValue(newItem);
|
|
41
41
|
setIsApplying(false);
|
|
42
42
|
});
|
|
43
|
-
}, [
|
|
43
|
+
}, [filterTimeout, rootProps.filterDebounceMs, item, type, id, applyValue]);
|
|
44
44
|
React.useEffect(() => {
|
|
45
45
|
const itemPlusTag = item;
|
|
46
46
|
if (itemPlusTag.fromInput !== id || item.value === undefined) {
|
|
@@ -3,7 +3,6 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
3
3
|
const _excluded = ["className", "csvOptions", "printOptions", "excelOptions", "showQuickFilter", "quickFilterProps"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
-
import Box from '@mui/material/Box';
|
|
7
6
|
import { GridToolbarContainer } from "../containers/GridToolbarContainer.js";
|
|
8
7
|
import { GridToolbarColumnsButton } from "./GridToolbarColumnsButton.js";
|
|
9
8
|
import { GridToolbarDensitySelector } from "./GridToolbarDensitySelector.js";
|
|
@@ -36,8 +35,8 @@ const GridToolbar = /*#__PURE__*/React.forwardRef(function GridToolbar(props, re
|
|
|
36
35
|
// TODO: remove the reference to excelOptions in community package
|
|
37
36
|
,
|
|
38
37
|
excelOptions: excelOptions
|
|
39
|
-
}), /*#__PURE__*/_jsx(
|
|
40
|
-
|
|
38
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
39
|
+
style: {
|
|
41
40
|
flex: 1
|
|
42
41
|
}
|
|
43
42
|
}), showQuickFilter && /*#__PURE__*/_jsx(GridToolbarQuickFilter, _extends({}, quickFilterProps))]
|
|
@@ -78,19 +78,7 @@ process.env.NODE_ENV !== "production" ? GridPrintExportMenuItem.propTypes = {
|
|
|
78
78
|
hideFooter: PropTypes.bool,
|
|
79
79
|
hideToolbar: PropTypes.bool,
|
|
80
80
|
includeCheckboxes: PropTypes.bool,
|
|
81
|
-
pageStyle: PropTypes.oneOfType([PropTypes.
|
|
82
|
-
'__@hasInstance@646': PropTypes.func.isRequired,
|
|
83
|
-
'__@metadata@648': PropTypes.any,
|
|
84
|
-
apply: PropTypes.func.isRequired,
|
|
85
|
-
arguments: PropTypes.any.isRequired,
|
|
86
|
-
bind: PropTypes.func.isRequired,
|
|
87
|
-
call: PropTypes.func.isRequired,
|
|
88
|
-
caller: PropTypes.object.isRequired,
|
|
89
|
-
length: PropTypes.number.isRequired,
|
|
90
|
-
name: PropTypes.string.isRequired,
|
|
91
|
-
prototype: PropTypes.any.isRequired,
|
|
92
|
-
toString: PropTypes.func.isRequired
|
|
93
|
-
}), PropTypes.string])
|
|
81
|
+
pageStyle: PropTypes.oneOfType([PropTypes.func, PropTypes.string])
|
|
94
82
|
})
|
|
95
83
|
} : void 0;
|
|
96
84
|
const GridToolbarExport = /*#__PURE__*/React.forwardRef(function GridToolbarExport(props, ref) {
|
|
@@ -3,7 +3,6 @@ import * as React from 'react';
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { styled } from '@mui/material/styles';
|
|
5
5
|
import { unstable_composeClasses as composeClasses, unstable_capitalize as capitalize, unstable_useId as useId } from '@mui/utils';
|
|
6
|
-
import Badge from '@mui/material/Badge';
|
|
7
6
|
import { gridColumnLookupSelector } from "../../hooks/features/columns/gridColumnsSelector.js";
|
|
8
7
|
import { useGridSelector } from "../../hooks/utils/useGridSelector.js";
|
|
9
8
|
import { gridFilterActiveItemsSelector } from "../../hooks/features/filter/gridFilterSelector.js";
|
|
@@ -104,7 +103,7 @@ const GridToolbarFilterButton = /*#__PURE__*/React.forwardRef(function GridToolb
|
|
|
104
103
|
"aria-controls": isOpen ? filterPanelId : undefined,
|
|
105
104
|
"aria-expanded": isOpen,
|
|
106
105
|
"aria-haspopup": true,
|
|
107
|
-
startIcon: /*#__PURE__*/_jsx(
|
|
106
|
+
startIcon: /*#__PURE__*/_jsx(rootProps.slots.baseBadge, {
|
|
108
107
|
badgeContent: activeFilters.length,
|
|
109
108
|
color: "primary",
|
|
110
109
|
children: /*#__PURE__*/_jsx(rootProps.slots.openFilterButtonIcon, {})
|
|
@@ -4,9 +4,6 @@ import clsx from 'clsx';
|
|
|
4
4
|
import { styled } from '@mui/system';
|
|
5
5
|
import composeClasses from '@mui/utils/composeClasses';
|
|
6
6
|
import { gridClasses, getDataGridUtilityClass } from "../../constants/gridClasses.js";
|
|
7
|
-
import { gridDimensionsSelector } from "../../hooks/features/dimensions/gridDimensionsSelectors.js";
|
|
8
|
-
import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
|
|
9
|
-
import { useGridSelector } from "../../hooks/utils/useGridSelector.js";
|
|
10
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
8
|
const useUtilityClasses = () => {
|
|
12
9
|
const slots = {
|
|
@@ -21,22 +18,8 @@ const Element = styled('div')({
|
|
|
21
18
|
});
|
|
22
19
|
export function GridBottomContainer(props) {
|
|
23
20
|
const classes = useUtilityClasses();
|
|
24
|
-
const apiRef = useGridApiContext();
|
|
25
|
-
const {
|
|
26
|
-
viewportOuterSize,
|
|
27
|
-
minimumSize,
|
|
28
|
-
hasScrollX,
|
|
29
|
-
scrollbarSize
|
|
30
|
-
} = useGridSelector(apiRef, gridDimensionsSelector);
|
|
31
|
-
const scrollHeight = hasScrollX ? scrollbarSize : 0;
|
|
32
|
-
const offset = Math.max(viewportOuterSize.height - minimumSize.height -
|
|
33
|
-
// Subtract scroll height twice to account for GridVirtualScrollerFiller and horizontal scrollbar
|
|
34
|
-
2 * scrollHeight, 0);
|
|
35
21
|
return /*#__PURE__*/_jsx(Element, _extends({}, props, {
|
|
36
22
|
className: clsx(classes.root, gridClasses['container--bottom']),
|
|
37
|
-
style: {
|
|
38
|
-
transform: `translateY(${offset}px)`
|
|
39
|
-
},
|
|
40
23
|
role: "presentation"
|
|
41
24
|
}));
|
|
42
25
|
}
|
|
@@ -7,7 +7,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
7
7
|
const GridPanelAnchor = styled('div')({
|
|
8
8
|
position: 'absolute',
|
|
9
9
|
top: `var(--DataGrid-headersTotalHeight)`,
|
|
10
|
-
left: 0
|
|
10
|
+
left: 0,
|
|
11
|
+
width: 'calc(100% - (var(--DataGrid-hasScrollY) * var(--DataGrid-scrollbarSize)))'
|
|
11
12
|
});
|
|
12
13
|
const Element = styled('div', {
|
|
13
14
|
name: 'MuiDataGrid',
|
|
@@ -73,6 +73,7 @@ const GridVirtualScrollbar = /*#__PURE__*/React.forwardRef(function GridVirtualS
|
|
|
73
73
|
if (scroller[propertyScroll] === lastPosition.current) {
|
|
74
74
|
return;
|
|
75
75
|
}
|
|
76
|
+
lastPosition.current = scroller[propertyScroll];
|
|
76
77
|
if (isLocked.current) {
|
|
77
78
|
isLocked.current = false;
|
|
78
79
|
return;
|
|
@@ -80,7 +81,6 @@ const GridVirtualScrollbar = /*#__PURE__*/React.forwardRef(function GridVirtualS
|
|
|
80
81
|
isLocked.current = true;
|
|
81
82
|
const value = scroller[propertyScroll] / contentSize;
|
|
82
83
|
scrollbar[propertyScroll] = value * scrollbarInnerSize;
|
|
83
|
-
lastPosition.current = scroller[propertyScroll];
|
|
84
84
|
});
|
|
85
85
|
const onScrollbarScroll = useEventCallback(() => {
|
|
86
86
|
const scroller = apiRef.current.virtualScrollerRef.current;
|
|
@@ -625,6 +625,11 @@ export interface GridClasses {
|
|
|
625
625
|
* Styles applied to the toggle of the grouping criteria cell
|
|
626
626
|
*/
|
|
627
627
|
groupingCriteriaCellToggle: string;
|
|
628
|
+
/**
|
|
629
|
+
* Styles applied to the loading container of the grouping cell of the tree data.
|
|
630
|
+
* @ignore - do not document.
|
|
631
|
+
*/
|
|
632
|
+
groupingCriteriaCellLoadingContainer: string;
|
|
628
633
|
/**
|
|
629
634
|
* Styles applied to the pinned rows container.
|
|
630
635
|
*/
|
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', 'autosizing', 'booleanCell', 'cell--editable', 'cell--editing', 'cell--flex', 'cell--textCenter', 'cell--textLeft', 'cell--textRight', 'cell--rangeTop', 'cell--rangeBottom', 'cell--rangeLeft', 'cell--rangeRight', 'cell--pinnedLeft', 'cell--pinnedRight', 'cell--selectionMode', 'cell', 'cellCheckbox', 'cellEmpty', 'cellSkeleton', 'cellOffsetLeft', 'checkboxInput', 'columnHeader', 'columnHeader--alignCenter', 'columnHeader--alignLeft', 'columnHeader--alignRight', 'columnHeader--dragging', 'columnHeader--moving', 'columnHeader--numeric', 'columnHeader--sortable', 'columnHeader--sorted', 'columnHeader--filtered', 'columnHeader--pinnedLeft', 'columnHeader--pinnedRight', 'columnHeader--last', 'columnHeader--lastUnpinned', 'columnHeader--siblingFocused', 'columnHeaderCheckbox', 'columnHeaderDraggableContainer', 'columnHeaderTitle', 'columnHeaderTitleContainer', 'columnHeaderTitleContainerContent', 'columnHeader--filledGroup', 'columnHeader--emptyGroup', 'columnHeaders', 'columnSeparator--resizable', 'columnSeparator--resizing', 'columnSeparator--sideLeft', 'columnSeparator--sideRight', 'columnSeparator', 'columnsManagement', 'columnsManagementRow', 'columnsManagementHeader', 'columnsManagementFooter', 'container--top', 'container--bottom', 'detailPanel', 'detailPanels', 'detailPanelToggleCell', 'detailPanelToggleCell--expanded', 'footerCell', 'panel', 'panelHeader', 'panelWrapper', 'panelContent', 'panelFooter', 'paper', 'editBooleanCell', 'editInputCell', 'filler', 'filler--borderBottom', 'filler--pinnedLeft', 'filler--pinnedRight', 'filterForm', 'filterFormDeleteIcon', 'filterFormLogicOperatorInput', 'filterFormColumnInput', 'filterFormOperatorInput', 'filterFormValueInput', 'filterIcon', 'footerContainer', 'headerFilterRow', 'iconButtonContainer', 'iconSeparator', 'main', 'main--hasPinnedRight', 'main--hasSkeletonLoadingOverlay', 'menu', 'menuIcon', 'menuIconButton', 'menuOpen', 'menuList', 'overlay', 'overlayWrapper', 'overlayWrapperInner', 'root', 'root--densityStandard', 'root--densityComfortable', 'root--densityCompact', 'root--disableUserSelection', 'root--noToolbar', 'row', 'row--editable', 'row--editing', 'row--firstVisible', 'row--lastVisible', 'row--dragging', 'row--dynamicHeight', 'row--detailPanelExpanded', 'row--borderBottom', 'rowReorderCellPlaceholder', 'rowCount', 'rowReorderCellContainer', 'rowReorderCell', 'rowReorderCell--draggable', 'rowSkeleton', 'scrollArea--left', 'scrollArea--right', 'scrollArea', 'scrollbar', 'scrollbar--vertical', 'scrollbar--horizontal', 'scrollbarFiller', 'scrollbarFiller--header', 'scrollbarFiller--borderTop', 'scrollbarFiller--borderBottom', 'scrollbarFiller--pinnedRight', 'selectedRowCount', 'sortIcon', 'toolbarContainer', 'toolbarFilterList', 'virtualScroller', 'virtualScroller--hasScrollX', 'virtualScrollerContent', 'virtualScrollerContent--overflowed', 'virtualScrollerRenderZone', 'pinnedColumns', 'withVerticalBorder', 'withBorderColor', 'cell--withRightBorder', 'cell--withLeftBorder', 'columnHeader--withRightBorder', 'columnHeader--withLeftBorder', 'treeDataGroupingCell', 'treeDataGroupingCellToggle', 'treeDataGroupingCellLoadingContainer', '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--flex', 'cell--textCenter', 'cell--textLeft', 'cell--textRight', 'cell--rangeTop', 'cell--rangeBottom', 'cell--rangeLeft', 'cell--rangeRight', 'cell--pinnedLeft', 'cell--pinnedRight', 'cell--selectionMode', 'cell', 'cellCheckbox', 'cellEmpty', 'cellSkeleton', 'cellOffsetLeft', 'checkboxInput', 'columnHeader', 'columnHeader--alignCenter', 'columnHeader--alignLeft', 'columnHeader--alignRight', 'columnHeader--dragging', 'columnHeader--moving', 'columnHeader--numeric', 'columnHeader--sortable', 'columnHeader--sorted', 'columnHeader--filtered', 'columnHeader--pinnedLeft', 'columnHeader--pinnedRight', 'columnHeader--last', 'columnHeader--lastUnpinned', 'columnHeader--siblingFocused', 'columnHeaderCheckbox', 'columnHeaderDraggableContainer', 'columnHeaderTitle', 'columnHeaderTitleContainer', 'columnHeaderTitleContainerContent', 'columnHeader--filledGroup', 'columnHeader--emptyGroup', 'columnHeaders', 'columnSeparator--resizable', 'columnSeparator--resizing', 'columnSeparator--sideLeft', 'columnSeparator--sideRight', 'columnSeparator', 'columnsManagement', 'columnsManagementRow', 'columnsManagementHeader', 'columnsManagementFooter', 'container--top', 'container--bottom', 'detailPanel', 'detailPanels', 'detailPanelToggleCell', 'detailPanelToggleCell--expanded', 'footerCell', 'panel', 'panelHeader', 'panelWrapper', 'panelContent', 'panelFooter', 'paper', 'editBooleanCell', 'editInputCell', 'filler', 'filler--borderBottom', 'filler--pinnedLeft', 'filler--pinnedRight', 'filterForm', 'filterFormDeleteIcon', 'filterFormLogicOperatorInput', 'filterFormColumnInput', 'filterFormOperatorInput', 'filterFormValueInput', 'filterIcon', 'footerContainer', 'headerFilterRow', 'iconButtonContainer', 'iconSeparator', 'main', 'main--hasPinnedRight', 'main--hasSkeletonLoadingOverlay', 'menu', 'menuIcon', 'menuIconButton', 'menuOpen', 'menuList', 'overlay', 'overlayWrapper', 'overlayWrapperInner', 'root', 'root--densityStandard', 'root--densityComfortable', 'root--densityCompact', 'root--disableUserSelection', 'root--noToolbar', 'row', 'row--editable', 'row--editing', 'row--firstVisible', 'row--lastVisible', 'row--dragging', 'row--dynamicHeight', 'row--detailPanelExpanded', 'row--borderBottom', 'rowReorderCellPlaceholder', 'rowCount', 'rowReorderCellContainer', 'rowReorderCell', 'rowReorderCell--draggable', 'rowSkeleton', 'scrollArea--left', 'scrollArea--right', 'scrollArea', 'scrollbar', 'scrollbar--vertical', 'scrollbar--horizontal', 'scrollbarFiller', 'scrollbarFiller--header', 'scrollbarFiller--borderTop', 'scrollbarFiller--borderBottom', 'scrollbarFiller--pinnedRight', 'selectedRowCount', 'sortIcon', 'toolbarContainer', 'toolbarFilterList', 'virtualScroller', 'virtualScroller--hasScrollX', 'virtualScrollerContent', 'virtualScrollerContent--overflowed', 'virtualScrollerRenderZone', 'pinnedColumns', 'withVerticalBorder', 'withBorderColor', 'cell--withRightBorder', 'cell--withLeftBorder', 'columnHeader--withRightBorder', 'columnHeader--withLeftBorder', 'treeDataGroupingCell', 'treeDataGroupingCellToggle', 'treeDataGroupingCellLoadingContainer', 'groupingCriteriaCell', 'groupingCriteriaCellToggle', 'groupingCriteriaCellLoadingContainer', 'pinnedRows', 'pinnedRows--top', 'pinnedRows--bottom', 'pinnedRowsRenderZone']);
|
|
@@ -6,6 +6,7 @@ import { GridHydrateColumnsValue, GridPinnedColumnPosition } from '../../feature
|
|
|
6
6
|
import { GridRowEntry, GridRowId } from '../../../models/gridRows';
|
|
7
7
|
import { GridHydrateRowsValue } from '../../features/rows/gridRowsInterfaces';
|
|
8
8
|
import { GridPreferencePanelsValue } from '../../features/preferencesPanel';
|
|
9
|
+
import { GridGetRowsParams } from '../../../models/gridDataSource';
|
|
9
10
|
import { HeightEntry } from '../../features/rows/gridRowsMetaInterfaces';
|
|
10
11
|
export type GridPipeProcessorGroup = keyof GridPipeProcessingLookup;
|
|
11
12
|
export interface GridPipeProcessingLookup {
|
|
@@ -17,6 +18,9 @@ export interface GridPipeProcessingLookup {
|
|
|
17
18
|
value: GridInitialStateCommunity;
|
|
18
19
|
context: GridExportStateParams;
|
|
19
20
|
};
|
|
21
|
+
getRowsParams: {
|
|
22
|
+
value: Partial<GridGetRowsParams>;
|
|
23
|
+
};
|
|
20
24
|
hydrateColumns: {
|
|
21
25
|
value: GridHydrateColumnsValue;
|
|
22
26
|
};
|
|
@@ -223,7 +223,6 @@ export const useGridColumnHeaders = props => {
|
|
|
223
223
|
return null;
|
|
224
224
|
}
|
|
225
225
|
const {
|
|
226
|
-
renderedColumns,
|
|
227
226
|
firstColumnToRender,
|
|
228
227
|
lastColumnToRender
|
|
229
228
|
} = columnsToRender;
|
|
@@ -292,7 +291,7 @@ export const useGridColumnHeaders = props => {
|
|
|
292
291
|
pinnedPosition: pinnedPosition,
|
|
293
292
|
style: style,
|
|
294
293
|
indexInSection: indexInSection,
|
|
295
|
-
sectionLength:
|
|
294
|
+
sectionLength: rowStructure.length,
|
|
296
295
|
gridHasFiller: gridHasFiller
|
|
297
296
|
}, index);
|
|
298
297
|
});
|
|
@@ -2,10 +2,11 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
3
|
const _excluded = ["displayOrder"];
|
|
4
4
|
import * as React from 'react';
|
|
5
|
-
import
|
|
5
|
+
import { useGridRootProps } from "../../utils/useGridRootProps.js";
|
|
6
6
|
import { useGridPrivateApiContext } from "../../utils/useGridPrivateApiContext.js";
|
|
7
7
|
const useGridColumnMenuSlots = props => {
|
|
8
8
|
const apiRef = useGridPrivateApiContext();
|
|
9
|
+
const rootProps = useGridRootProps();
|
|
9
10
|
const {
|
|
10
11
|
defaultSlots,
|
|
11
12
|
defaultSlotProps,
|
|
@@ -51,8 +52,8 @@ const useGridColumnMenuSlots = props => {
|
|
|
51
52
|
const customProps = _objectWithoutPropertiesLoose(processedComponentProps, _excluded);
|
|
52
53
|
itemProps = _extends({}, itemProps, customProps);
|
|
53
54
|
}
|
|
54
|
-
return addDividers && index !== sorted.length - 1 ? [...acc, [processedComponents[key], itemProps], [
|
|
55
|
+
return addDividers && index !== sorted.length - 1 ? [...acc, [processedComponents[key], itemProps], [rootProps.slots.baseDivider, {}]] : [...acc, [processedComponents[key], itemProps]];
|
|
55
56
|
}, []);
|
|
56
|
-
}, [addDividers, colDef, defaultItems, hideMenu, processedComponents, processedSlotProps, userItems]);
|
|
57
|
+
}, [addDividers, colDef, defaultItems, hideMenu, processedComponents, processedSlotProps, userItems, rootProps.slots.baseDivider]);
|
|
57
58
|
};
|
|
58
59
|
export { useGridColumnMenuSlots };
|
|
@@ -323,18 +323,33 @@ export const useGridFocus = (apiRef, props) => {
|
|
|
323
323
|
const handleRowSet = React.useCallback(() => {
|
|
324
324
|
const cell = gridFocusCellSelector(apiRef);
|
|
325
325
|
|
|
326
|
-
// If the focused cell is in a row which does not exist anymore,
|
|
326
|
+
// If the focused cell is in a row which does not exist anymore,
|
|
327
|
+
// focus previous row or remove the focus
|
|
327
328
|
if (cell && !apiRef.current.getRow(cell.id)) {
|
|
329
|
+
const lastFocusedRowId = gridFocusCellSelector(apiRef)?.id;
|
|
330
|
+
let nextRowId = null;
|
|
331
|
+
if (typeof lastFocusedRowId !== 'undefined') {
|
|
332
|
+
const lastFocusedRowIndex = apiRef.current.getRowIndexRelativeToVisibleRows(lastFocusedRowId);
|
|
333
|
+
const currentPage = getVisibleRows(apiRef, {
|
|
334
|
+
pagination: props.pagination,
|
|
335
|
+
paginationMode: props.paginationMode
|
|
336
|
+
});
|
|
337
|
+
const nextRow = currentPage.rows[clamp(lastFocusedRowIndex, 0, currentPage.rows.length - 1)];
|
|
338
|
+
nextRowId = nextRow?.id ?? null;
|
|
339
|
+
}
|
|
328
340
|
apiRef.current.setState(state => _extends({}, state, {
|
|
329
341
|
focus: {
|
|
330
|
-
cell: null
|
|
342
|
+
cell: nextRowId === null ? null : {
|
|
343
|
+
id: nextRowId,
|
|
344
|
+
field: cell.field
|
|
345
|
+
},
|
|
331
346
|
columnHeader: null,
|
|
332
347
|
columnHeaderFilter: null,
|
|
333
348
|
columnGroupHeader: null
|
|
334
349
|
}
|
|
335
350
|
}));
|
|
336
351
|
}
|
|
337
|
-
}, [apiRef]);
|
|
352
|
+
}, [apiRef, props.pagination, props.paginationMode]);
|
|
338
353
|
const handlePaginationModelChange = useEventcallback(() => {
|
|
339
354
|
const currentFocusedCell = gridFocusCellSelector(apiRef);
|
|
340
355
|
if (!currentFocusedCell) {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useRtl } from '@mui/system/RtlProvider';
|
|
3
|
+
import { GRID_TREE_DATA_GROUPING_FIELD, GRID_DETAIL_PANEL_TOGGLE_FIELD } from "../../../internals/constants.js";
|
|
4
|
+
import { isGroupingColumn } from "../../../internals/utils/gridRowGroupingUtils.js";
|
|
3
5
|
import { gridVisibleColumnDefinitionsSelector, gridVisibleColumnFieldsSelector } from "../columns/gridColumnsSelector.js";
|
|
4
6
|
import { useGridLogger } from "../../utils/useGridLogger.js";
|
|
5
7
|
import { useGridApiEventHandler } from "../../utils/useGridApiEventHandler.js";
|
|
@@ -9,7 +11,6 @@ import { GRID_CHECKBOX_SELECTION_COL_DEF } from "../../../colDef/gridCheckboxSel
|
|
|
9
11
|
import { gridClasses } from "../../../constants/gridClasses.js";
|
|
10
12
|
import { GridCellModes } from "../../../models/gridEditRowModel.js";
|
|
11
13
|
import { isNavigationKey } from "../../../utils/keyboardUtils.js";
|
|
12
|
-
import { GRID_DETAIL_PANEL_TOGGLE_FIELD } from "../../../constants/gridDetailPanelToggleField.js";
|
|
13
14
|
import { gridFocusColumnGroupHeaderSelector } from "../focus/index.js";
|
|
14
15
|
import { gridColumnGroupsHeaderMaxDepthSelector } from "../columnGrouping/gridColumnGroupsSelector.js";
|
|
15
16
|
import { gridHeaderFilteringEditFieldSelector, gridHeaderFilteringMenuSelector } from "../headerFiltering/gridHeaderFilteringSelectors.js";
|
|
@@ -458,9 +459,7 @@ export const useGridKeyboardNavigation = (apiRef, props) => {
|
|
|
458
459
|
break;
|
|
459
460
|
}
|
|
460
461
|
const colDef = params.colDef;
|
|
461
|
-
if (colDef &&
|
|
462
|
-
// `GRID_TREE_DATA_GROUPING_FIELD` from the Pro package
|
|
463
|
-
colDef.field === '__tree_data_group__') {
|
|
462
|
+
if (colDef && (colDef.field === GRID_TREE_DATA_GROUPING_FIELD || isGroupingColumn(colDef.field))) {
|
|
464
463
|
break;
|
|
465
464
|
}
|
|
466
465
|
if (!event.shiftKey && rowIndexBefore < lastRowIndexInPage) {
|
|
@@ -7,4 +7,4 @@ export type GridListViewState = (GridListColDef & {
|
|
|
7
7
|
computedWidth: number;
|
|
8
8
|
}) | undefined;
|
|
9
9
|
export declare const listViewStateInitializer: GridStateInitializer<Pick<DataGridProcessedProps, 'unstable_listColumn'>>;
|
|
10
|
-
export declare function useGridListView(apiRef: React.MutableRefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, 'unstable_listColumn'>): void;
|
|
10
|
+
export declare function useGridListView(apiRef: React.MutableRefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, 'unstable_listView' | 'unstable_listColumn'>): void;
|