@mui/x-data-grid 5.15.3 → 5.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +56 -0
- package/DataGrid/DataGrid.js +2 -0
- package/DataGrid/useDataGridComponent.js +5 -0
- package/components/DataGridColumnHeaders.js +4 -3
- package/components/GridRow.js +5 -3
- package/components/base/GridBody.js +8 -5
- package/components/base/GridOverlays.js +3 -3
- package/components/columnHeaders/GridColumnGroupHeader.d.ts +14 -0
- package/components/columnHeaders/GridColumnGroupHeader.js +122 -0
- package/components/columnHeaders/GridColumnHeaderItem.js +55 -71
- package/components/columnHeaders/GridColumnHeadersInner.js +2 -1
- package/components/columnHeaders/GridGenericColumnHeaderItem.d.ts +32 -0
- package/components/columnHeaders/GridGenericColumnHeaderItem.js +104 -0
- package/components/containers/GridRoot.js +3 -3
- package/components/containers/GridRootStyles.js +14 -2
- package/components/panel/GridPanel.d.ts +1 -1
- package/constants/gridClasses.d.ts +16 -0
- package/constants/gridClasses.js +1 -1
- package/hooks/features/columnGrouping/gridColumnGroupsInterfaces.d.ts +7 -0
- package/hooks/features/columnGrouping/gridColumnGroupsInterfaces.js +1 -0
- package/hooks/features/columnGrouping/gridColumnGroupsSelector.d.ts +7 -0
- package/hooks/features/columnGrouping/gridColumnGroupsSelector.js +8 -0
- package/hooks/features/columnGrouping/index.d.ts +2 -0
- package/hooks/features/columnGrouping/index.js +2 -0
- package/hooks/features/columnGrouping/useGridColumnGrouping.d.ts +24 -0
- package/hooks/features/columnGrouping/useGridColumnGrouping.js +153 -0
- package/hooks/features/columnGrouping/useGridColumnGroupingPreProcessors.d.ts +4 -0
- package/hooks/features/columnGrouping/useGridColumnGroupingPreProcessors.js +35 -0
- package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +7 -6
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +204 -9
- package/hooks/features/density/densitySelector.d.ts +2 -0
- package/hooks/features/density/densitySelector.js +3 -1
- package/hooks/features/density/densityState.d.ts +1 -0
- package/hooks/features/density/useGridDensity.d.ts +1 -1
- package/hooks/features/density/useGridDensity.js +45 -9
- package/hooks/features/dimensions/useGridDimensions.js +4 -4
- package/hooks/features/export/useGridPrintExport.js +3 -3
- package/hooks/features/filter/gridFilterSelector.d.ts +3 -3
- package/hooks/features/index.d.ts +1 -0
- package/hooks/features/index.js +1 -0
- package/hooks/features/pagination/gridPaginationSelector.d.ts +1 -1
- package/hooks/features/rows/gridRowsSelector.d.ts +1 -1
- package/hooks/features/selection/gridSelectionSelector.d.ts +1 -1
- package/hooks/features/sorting/gridSortingSelector.d.ts +1 -1
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +1 -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/legacy/DataGrid/DataGrid.js +2 -0
- package/legacy/DataGrid/useDataGridComponent.js +5 -0
- package/legacy/components/DataGridColumnHeaders.js +4 -3
- package/legacy/components/GridRow.js +4 -3
- package/legacy/components/base/GridBody.js +8 -5
- package/legacy/components/base/GridOverlays.js +3 -3
- package/legacy/components/columnHeaders/GridColumnGroupHeader.js +120 -0
- package/legacy/components/columnHeaders/GridColumnHeaderItem.js +78 -88
- package/legacy/components/columnHeaders/GridColumnHeadersInner.js +2 -1
- package/legacy/components/columnHeaders/GridGenericColumnHeaderItem.js +112 -0
- package/legacy/components/containers/GridRoot.js +3 -3
- package/legacy/components/containers/GridRootStyles.js +11 -2
- package/legacy/constants/gridClasses.js +1 -1
- package/legacy/hooks/features/columnGrouping/gridColumnGroupsInterfaces.js +1 -0
- package/legacy/hooks/features/columnGrouping/gridColumnGroupsSelector.js +12 -0
- package/legacy/hooks/features/columnGrouping/index.js +2 -0
- package/legacy/hooks/features/columnGrouping/useGridColumnGrouping.js +151 -0
- package/legacy/hooks/features/columnGrouping/useGridColumnGroupingPreProcessors.js +35 -0
- package/legacy/hooks/features/columnHeaders/useGridColumnHeaders.js +213 -12
- package/legacy/hooks/features/density/densitySelector.js +6 -0
- package/legacy/hooks/features/density/useGridDensity.js +44 -6
- package/legacy/hooks/features/dimensions/useGridDimensions.js +4 -4
- package/legacy/hooks/features/export/useGridPrintExport.js +3 -3
- package/legacy/hooks/features/index.js +1 -0
- package/legacy/index.js +1 -1
- package/legacy/internals/index.js +2 -0
- package/legacy/models/api/gridColumnGroupingApi.js +1 -0
- package/legacy/models/gridColumnGrouping.js +6 -0
- package/legacy/models/index.js +2 -1
- package/models/api/gridApiCommon.d.ts +2 -1
- package/models/api/gridColumnGroupingApi.d.ts +19 -0
- package/models/api/gridColumnGroupingApi.js +1 -0
- package/models/api/gridDensityApi.d.ts +2 -1
- package/models/colDef/gridColDef.d.ts +15 -1
- package/models/gridColumnGrouping.d.ts +67 -0
- package/models/gridColumnGrouping.js +6 -0
- package/models/gridRows.d.ts +5 -5
- package/models/gridStateCommunity.d.ts +2 -1
- package/models/index.d.ts +1 -0
- package/models/index.js +2 -1
- package/models/props/DataGridProps.d.ts +6 -0
- package/modern/DataGrid/DataGrid.js +2 -0
- package/modern/DataGrid/useDataGridComponent.js +5 -0
- package/modern/components/DataGridColumnHeaders.js +4 -3
- package/modern/components/GridRow.js +5 -3
- package/modern/components/base/GridBody.js +8 -5
- package/modern/components/base/GridOverlays.js +3 -3
- package/modern/components/columnHeaders/GridColumnGroupHeader.js +120 -0
- package/modern/components/columnHeaders/GridColumnHeaderItem.js +53 -69
- package/modern/components/columnHeaders/GridColumnHeadersInner.js +2 -1
- package/modern/components/columnHeaders/GridGenericColumnHeaderItem.js +104 -0
- package/modern/components/containers/GridRoot.js +3 -3
- package/modern/components/containers/GridRootStyles.js +14 -2
- package/modern/constants/gridClasses.js +1 -1
- package/modern/hooks/features/columnGrouping/gridColumnGroupsInterfaces.js +1 -0
- package/modern/hooks/features/columnGrouping/gridColumnGroupsSelector.js +8 -0
- package/modern/hooks/features/columnGrouping/index.js +2 -0
- package/modern/hooks/features/columnGrouping/useGridColumnGrouping.js +145 -0
- package/modern/hooks/features/columnGrouping/useGridColumnGroupingPreProcessors.js +29 -0
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +186 -9
- package/modern/hooks/features/density/densitySelector.js +3 -1
- package/modern/hooks/features/density/useGridDensity.js +37 -9
- package/modern/hooks/features/dimensions/useGridDimensions.js +4 -4
- package/modern/hooks/features/export/useGridPrintExport.js +3 -3
- package/modern/hooks/features/index.js +1 -0
- package/modern/index.js +1 -1
- package/modern/internals/index.js +2 -0
- package/modern/models/api/gridColumnGroupingApi.js +1 -0
- package/modern/models/gridColumnGrouping.js +6 -0
- package/modern/models/index.js +2 -1
- package/node/DataGrid/DataGrid.js +2 -0
- package/node/DataGrid/useDataGridComponent.js +7 -0
- package/node/components/DataGridColumnHeaders.js +4 -3
- package/node/components/GridRow.js +6 -3
- package/node/components/base/GridBody.js +7 -4
- package/node/components/base/GridOverlays.js +2 -2
- package/node/components/columnHeaders/GridColumnGroupHeader.js +141 -0
- package/node/components/columnHeaders/GridColumnHeaderItem.js +53 -72
- package/node/components/columnHeaders/GridColumnHeadersInner.js +2 -1
- package/node/components/columnHeaders/GridGenericColumnHeaderItem.js +126 -0
- package/node/components/containers/GridRoot.js +4 -4
- package/node/components/containers/GridRootStyles.js +14 -2
- package/node/constants/gridClasses.js +1 -1
- package/node/hooks/features/columnGrouping/gridColumnGroupsInterfaces.js +5 -0
- package/node/hooks/features/columnGrouping/gridColumnGroupsSelector.js +18 -0
- package/node/hooks/features/columnGrouping/index.js +18 -0
- package/node/hooks/features/columnGrouping/useGridColumnGrouping.js +182 -0
- package/node/hooks/features/columnGrouping/useGridColumnGroupingPreProcessors.js +55 -0
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +207 -8
- package/node/hooks/features/density/densitySelector.js +6 -2
- package/node/hooks/features/density/useGridDensity.js +48 -9
- package/node/hooks/features/dimensions/useGridDimensions.js +3 -3
- package/node/hooks/features/export/useGridPrintExport.js +2 -2
- package/node/hooks/features/index.js +13 -0
- package/node/index.js +1 -1
- package/node/internals/index.js +22 -0
- package/node/models/api/gridColumnGroupingApi.js +5 -0
- package/node/models/gridColumnGrouping.js +13 -0
- package/node/models/index.js +13 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,62 @@
|
|
|
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
|
+
## 5.16.0
|
|
7
|
+
|
|
8
|
+
_Aug 25, 2022_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 11 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🎁 Introduce column grouping for data grid (#5133) @alexfauquette
|
|
13
|
+
|
|
14
|
+
You can now group columns using the `columnGroupingModel` prop. This lets you to display more structured data.
|
|
15
|
+
|
|
16
|
+
<img src="https://user-images.githubusercontent.com/45398769/186178366-4fba66b2-bf90-4c7a-9d83-940a7fc78704.png" width="800" />
|
|
17
|
+
|
|
18
|
+
To enable this feature, add `experimentalFeatures={{ columnGrouping: true }}`.
|
|
19
|
+
The grouping header can be fully customized.
|
|
20
|
+
See the [documentation](https://mui.com/x/react-data-grid/column-groups/) to explore everything it has to offer.
|
|
21
|
+
|
|
22
|
+
- 🐞 Bugfixes
|
|
23
|
+
- 🌏 New locales for pickers thanks to @tesseractjh and @drastus
|
|
24
|
+
|
|
25
|
+
### `@mui/x-data-grid@v5.16.0` / `@mui/x-data-grid-pro@v5.16.0` / `@mui/x-data-grid-premium@v5.16.0`
|
|
26
|
+
|
|
27
|
+
#### Changes
|
|
28
|
+
|
|
29
|
+
- [DataGrid] Implement column grouping (#5133) @alexfauquette
|
|
30
|
+
- [DataGrid] Handle `disableVirtualization` prop change (#5889) @cherniavskii
|
|
31
|
+
- [DataGrid] Improve `GridRowModel` typing (#5734) @cherniavskii
|
|
32
|
+
- [DataGrid] Update deprecation note for `GridColDef` `hide` property (#5886) @cherniavskii
|
|
33
|
+
|
|
34
|
+
### `@mui/x-date-pickers@v5.0.0-beta.7` / `@mui/x-date-pickers-pro@v5.0.0-beta.7`
|
|
35
|
+
|
|
36
|
+
#### Changes
|
|
37
|
+
|
|
38
|
+
- [DatePicker] Fix to pass down `className` prop provided on DatePicker to `renderInput` (#5471) @CruseCtrl
|
|
39
|
+
- [DatePicker] Improve `a11y` support (#5809) @LukasTy
|
|
40
|
+
- [pickers] Add `PaperContent` component slot (#5801) @LukasTy
|
|
41
|
+
- [pickers] Add a breaking change section in the migration guide (#5805) @alexfauquette
|
|
42
|
+
- [pickers] Add new translations to `localeText` (#5143) @alexfauquette
|
|
43
|
+
- [pickers] Document components slots (#4657) @flaviendelangle
|
|
44
|
+
- [pickers] Add new unstable field components (#5504) @flaviendelangle
|
|
45
|
+
- [pickers] Fallback to default `minDate` / `maxDate` when `null` value is passed (#5397) @flaviendelangle
|
|
46
|
+
- [l10n] Add Korean (ko-KR) locale (#5854) @tesseractjh
|
|
47
|
+
- [l10n] Add Polish (pl-PL) locale (#5833) @drastus
|
|
48
|
+
|
|
49
|
+
### Docs
|
|
50
|
+
|
|
51
|
+
- [docs] Fix typo in `migration from lab` (#5277) @chuckwired
|
|
52
|
+
- [docs] Use `dayjs` instead of `date-fns` in doc examples (#5481) @flaviendelangle
|
|
53
|
+
|
|
54
|
+
### Core
|
|
55
|
+
|
|
56
|
+
- [core] Clarify the scope of the license key used for tests and documentation (#5824) @oliviertassinari
|
|
57
|
+
- [core] Fix Typescript error on field hooks (#5892) @flaviendelangle
|
|
58
|
+
- [core] Memoize `columns` in `useDemoData` hook (#5848) @cherniavskii
|
|
59
|
+
- [core] Remove Firefox from the BrowserStack list (#5874) @DanailH
|
|
60
|
+
- [core] Small changes to the release script (#5840) @m4theushw
|
|
61
|
+
|
|
6
62
|
## 5.15.3
|
|
7
63
|
|
|
8
64
|
_Aug 18, 2022_
|
package/DataGrid/DataGrid.js
CHANGED
|
@@ -79,6 +79,7 @@ DataGridRaw.propTypes = {
|
|
|
79
79
|
* @default 3
|
|
80
80
|
*/
|
|
81
81
|
columnBuffer: PropTypes.number,
|
|
82
|
+
columnGroupingModel: PropTypes.arrayOf(PropTypes.object),
|
|
82
83
|
|
|
83
84
|
/**
|
|
84
85
|
* Set of columns of type [[GridColumns]].
|
|
@@ -194,6 +195,7 @@ DataGridRaw.propTypes = {
|
|
|
194
195
|
* For each feature, if the flag is not explicitly set to `true`, the feature will be fully disabled and any property / method call will not have any effect.
|
|
195
196
|
*/
|
|
196
197
|
experimentalFeatures: PropTypes.shape({
|
|
198
|
+
columnGrouping: PropTypes.bool,
|
|
197
199
|
newEditingApi: PropTypes.bool,
|
|
198
200
|
preventCommitWhileValidating: PropTypes.bool,
|
|
199
201
|
warnIfFocusStateIsNotSynced: PropTypes.bool
|
|
@@ -25,6 +25,8 @@ import { useGridDimensions } from '../hooks/features/dimensions/useGridDimension
|
|
|
25
25
|
import { rowsMetaStateInitializer, useGridRowsMeta } from '../hooks/features/rows/useGridRowsMeta';
|
|
26
26
|
import { useGridStatePersistence } from '../hooks/features/statePersistence/useGridStatePersistence';
|
|
27
27
|
import { useGridColumnSpanning } from '../hooks/features/columns/useGridColumnSpanning';
|
|
28
|
+
import { useGridColumnGrouping, columnGroupsStateInitializer } from '../hooks/features/columnGrouping/useGridColumnGrouping';
|
|
29
|
+
import { useGridColumnGroupingPreProcessors } from '../hooks/features/columnGrouping/useGridColumnGroupingPreProcessors';
|
|
28
30
|
export const useDataGridComponent = props => {
|
|
29
31
|
var _props$experimentalFe, _props$experimentalFe2;
|
|
30
32
|
|
|
@@ -33,6 +35,7 @@ export const useDataGridComponent = props => {
|
|
|
33
35
|
* Register all pre-processors called during state initialization here.
|
|
34
36
|
*/
|
|
35
37
|
|
|
38
|
+
useGridColumnGroupingPreProcessors(apiRef, props);
|
|
36
39
|
useGridSelectionPreProcessors(apiRef, props);
|
|
37
40
|
useGridRowsPreProcessors(apiRef);
|
|
38
41
|
/**
|
|
@@ -41,6 +44,7 @@ export const useDataGridComponent = props => {
|
|
|
41
44
|
|
|
42
45
|
useGridInitializeState(selectionStateInitializer, apiRef, props);
|
|
43
46
|
useGridInitializeState(columnsStateInitializer, apiRef, props);
|
|
47
|
+
useGridInitializeState(columnGroupsStateInitializer, apiRef, props);
|
|
44
48
|
useGridInitializeState(rowsStateInitializer, apiRef, props);
|
|
45
49
|
useGridInitializeState((_props$experimentalFe = props.experimentalFeatures) != null && _props$experimentalFe.newEditingApi ? editingStateInitializer_new : editingStateInitializer_old, apiRef, props);
|
|
46
50
|
useGridInitializeState(focusStateInitializer, apiRef, props);
|
|
@@ -57,6 +61,7 @@ export const useDataGridComponent = props => {
|
|
|
57
61
|
useGridRows(apiRef, props);
|
|
58
62
|
useGridParamsApi(apiRef);
|
|
59
63
|
useGridColumnSpanning(apiRef);
|
|
64
|
+
useGridColumnGrouping(apiRef, props);
|
|
60
65
|
const useGridEditing = (_props$experimentalFe2 = props.experimentalFeatures) != null && _props$experimentalFe2.newEditingApi ? useGridEditing_new : useGridEditing_old;
|
|
61
66
|
useGridEditing(apiRef, props);
|
|
62
67
|
useGridFocus(apiRef, props);
|
|
@@ -18,7 +18,8 @@ export const DataGridColumnHeaders = /*#__PURE__*/React.forwardRef(function Grid
|
|
|
18
18
|
isDragging,
|
|
19
19
|
getRootProps,
|
|
20
20
|
getInnerProps,
|
|
21
|
-
|
|
21
|
+
getColumnHeaders,
|
|
22
|
+
getColumnGroupHeaders
|
|
22
23
|
} = useGridColumnHeaders({
|
|
23
24
|
innerRef
|
|
24
25
|
});
|
|
@@ -27,10 +28,10 @@ export const DataGridColumnHeaders = /*#__PURE__*/React.forwardRef(function Grid
|
|
|
27
28
|
}, getRootProps(other), {
|
|
28
29
|
children: [/*#__PURE__*/_jsx(GridScrollArea, {
|
|
29
30
|
scrollDirection: "left"
|
|
30
|
-
}), /*#__PURE__*/
|
|
31
|
+
}), /*#__PURE__*/_jsxs(GridColumnHeadersInner, _extends({
|
|
31
32
|
isDragging: isDragging
|
|
32
33
|
}, getInnerProps(), {
|
|
33
|
-
children:
|
|
34
|
+
children: [getColumnGroupHeaders(), getColumnHeaders()]
|
|
34
35
|
})), /*#__PURE__*/_jsx(GridScrollArea, {
|
|
35
36
|
scrollDirection: "right"
|
|
36
37
|
})]
|
package/components/GridRow.js
CHANGED
|
@@ -22,6 +22,7 @@ import { GRID_ACTIONS_COLUMN_TYPE } from '../colDef/gridActionsColDef';
|
|
|
22
22
|
import { GRID_DETAIL_PANEL_TOGGLE_FIELD } from '../constants/gridDetailPanelToggleField';
|
|
23
23
|
import { gridSortModelSelector } from '../hooks/features/sorting/gridSortingSelector';
|
|
24
24
|
import { gridRowTreeDepthSelector } from '../hooks/features/rows/gridRowsSelector';
|
|
25
|
+
import { gridDensityHeaderGroupingMaxDepthSelector } from '../hooks/features/density/densitySelector';
|
|
25
26
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
26
27
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
27
28
|
|
|
@@ -82,8 +83,6 @@ function GridRow(props) {
|
|
|
82
83
|
} = props,
|
|
83
84
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
84
85
|
|
|
85
|
-
const ariaRowIndex = index + 2; // 1 for the header row and 1 as it's 1-based
|
|
86
|
-
|
|
87
86
|
const apiRef = useGridApiContext();
|
|
88
87
|
const ref = React.useRef(null);
|
|
89
88
|
const rootProps = useGridRootProps();
|
|
@@ -91,6 +90,9 @@ function GridRow(props) {
|
|
|
91
90
|
const columnsTotalWidth = useGridSelector(apiRef, gridColumnsTotalWidthSelector);
|
|
92
91
|
const sortModel = useGridSelector(apiRef, gridSortModelSelector);
|
|
93
92
|
const treeDepth = useGridSelector(apiRef, gridRowTreeDepthSelector);
|
|
93
|
+
const headerGroupingMaxDepth = useGridSelector(apiRef, gridDensityHeaderGroupingMaxDepthSelector);
|
|
94
|
+
const ariaRowIndex = index + headerGroupingMaxDepth + 2; // 1 for the header row and 1 as it's 1-based
|
|
95
|
+
|
|
94
96
|
const {
|
|
95
97
|
hasScrollX,
|
|
96
98
|
hasScrollY
|
|
@@ -359,7 +361,7 @@ process.env.NODE_ENV !== "production" ? GridRow.propTypes = {
|
|
|
359
361
|
isLastVisible: PropTypes.bool,
|
|
360
362
|
lastColumnToRender: PropTypes.number.isRequired,
|
|
361
363
|
renderedColumns: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
362
|
-
row: PropTypes.
|
|
364
|
+
row: PropTypes.object.isRequired,
|
|
363
365
|
rowHeight: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number]).isRequired,
|
|
364
366
|
rowId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
365
367
|
selected: PropTypes.bool.isRequired,
|
|
@@ -6,7 +6,7 @@ import { GridAutoSizer } from '../GridAutoSizer';
|
|
|
6
6
|
import { GridOverlays } from './GridOverlays';
|
|
7
7
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
8
8
|
import { useGridSelector } from '../../hooks/utils/useGridSelector';
|
|
9
|
-
import {
|
|
9
|
+
import { gridDensityTotalHeaderHeightSelector } from '../../hooks/features/density/densitySelector';
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
11
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
12
|
|
|
@@ -18,14 +18,17 @@ function GridBody(props) {
|
|
|
18
18
|
} = props;
|
|
19
19
|
const apiRef = useGridApiContext();
|
|
20
20
|
const rootProps = useGridRootProps();
|
|
21
|
-
const
|
|
21
|
+
const totalHeaderHeight = useGridSelector(apiRef, gridDensityTotalHeaderHeightSelector);
|
|
22
22
|
const [isVirtualizationDisabled, setIsVirtualizationDisabled] = React.useState(rootProps.disableVirtualization);
|
|
23
23
|
const disableVirtualization = React.useCallback(() => {
|
|
24
24
|
setIsVirtualizationDisabled(true);
|
|
25
25
|
}, []);
|
|
26
26
|
const enableVirtualization = React.useCallback(() => {
|
|
27
27
|
setIsVirtualizationDisabled(false);
|
|
28
|
-
}, []);
|
|
28
|
+
}, []);
|
|
29
|
+
React.useEffect(() => {
|
|
30
|
+
setIsVirtualizationDisabled(rootProps.disableVirtualization);
|
|
31
|
+
}, [rootProps.disableVirtualization]); // The `useGridApiMethod` hook can't be used here, because it only installs the
|
|
29
32
|
// method if it doesn't exist yet. Once installed, it's never updated again.
|
|
30
33
|
// This break the methods above, since their closure comes from the first time
|
|
31
34
|
// they were installed. Which means that calling `setIsVirtualizationDisabled`
|
|
@@ -60,8 +63,8 @@ function GridBody(props) {
|
|
|
60
63
|
width: size.width,
|
|
61
64
|
// If `autoHeight` is on, there will be no height value.
|
|
62
65
|
// In this case, let the container to grow whatever it needs.
|
|
63
|
-
height: size.height ? size.height -
|
|
64
|
-
marginTop:
|
|
66
|
+
height: size.height ? size.height - totalHeaderHeight : 'auto',
|
|
67
|
+
marginTop: totalHeaderHeight
|
|
65
68
|
};
|
|
66
69
|
return /*#__PURE__*/_jsx(VirtualScrollerComponent, {
|
|
67
70
|
ref: windowRef,
|
|
@@ -6,7 +6,7 @@ import { gridVisibleRowCountSelector } from '../../hooks/features/filter/gridFil
|
|
|
6
6
|
import { gridRowCountSelector, gridRowsLoadingSelector } from '../../hooks/features/rows/gridRowsSelector';
|
|
7
7
|
import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
|
|
8
8
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
9
|
-
import {
|
|
9
|
+
import { gridDensityTotalHeaderHeightSelector } from '../../hooks/features/density/densitySelector';
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
11
|
|
|
12
12
|
function GridOverlayWrapper(props) {
|
|
@@ -14,7 +14,7 @@ function GridOverlayWrapper(props) {
|
|
|
14
14
|
|
|
15
15
|
const apiRef = useGridApiContext();
|
|
16
16
|
const rootProps = useGridRootProps();
|
|
17
|
-
const
|
|
17
|
+
const totalHeaderHeight = useGridSelector(apiRef, gridDensityTotalHeaderHeightSelector);
|
|
18
18
|
const [viewportInnerSize, setViewportInnerSize] = React.useState(() => {
|
|
19
19
|
var _apiRef$current$getRo, _apiRef$current$getRo2;
|
|
20
20
|
|
|
@@ -43,7 +43,7 @@ function GridOverlayWrapper(props) {
|
|
|
43
43
|
height,
|
|
44
44
|
width: (_viewportInnerSize$wi = viewportInnerSize == null ? void 0 : viewportInnerSize.width) != null ? _viewportInnerSize$wi : 0,
|
|
45
45
|
position: 'absolute',
|
|
46
|
-
top:
|
|
46
|
+
top: totalHeaderHeight,
|
|
47
47
|
bottom: height === 'auto' ? 0 : undefined
|
|
48
48
|
}
|
|
49
49
|
}, props));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface GridColumnGroupHeaderProps {
|
|
3
|
+
groupId: string | null;
|
|
4
|
+
width: number;
|
|
5
|
+
fields: string[];
|
|
6
|
+
colIndex: number;
|
|
7
|
+
isLastColumn: boolean;
|
|
8
|
+
extendRowFullWidth: boolean;
|
|
9
|
+
depth: number;
|
|
10
|
+
maxDepth: number;
|
|
11
|
+
height: number;
|
|
12
|
+
}
|
|
13
|
+
declare function GridColumnGroupHeader(props: GridColumnGroupHeaderProps): JSX.Element;
|
|
14
|
+
export { GridColumnGroupHeader };
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { unstable_useId as useId } from '@mui/utils';
|
|
4
|
+
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
5
|
+
import { getDataGridUtilityClass } from '../../constants/gridClasses';
|
|
6
|
+
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
7
|
+
import { gridColumnGroupsLookupSelector } from '../../hooks/features/columnGrouping/gridColumnGroupsSelector';
|
|
8
|
+
import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
|
|
9
|
+
import { useGridSelector } from '../../hooks/utils/useGridSelector';
|
|
10
|
+
import { GridGenericColumnHeaderItem } from './GridGenericColumnHeaderItem';
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
|
|
13
|
+
const useUtilityClasses = ownerState => {
|
|
14
|
+
const {
|
|
15
|
+
classes,
|
|
16
|
+
headerAlign,
|
|
17
|
+
isDragging,
|
|
18
|
+
showRightBorder,
|
|
19
|
+
showColumnBorder,
|
|
20
|
+
groupId
|
|
21
|
+
} = ownerState;
|
|
22
|
+
const slots = {
|
|
23
|
+
root: ['columnHeader', headerAlign === 'left' && 'columnHeader--alignLeft', headerAlign === 'center' && 'columnHeader--alignCenter', headerAlign === 'right' && 'columnHeader--alignRight', isDragging && 'columnHeader--moving', showRightBorder && 'withBorder', showColumnBorder && 'columnHeader--showColumnBorder', groupId === null ? 'columnHeader--emptyGroup' : 'columnHeader--filledGroup'],
|
|
24
|
+
draggableContainer: ['columnHeaderDraggableContainer'],
|
|
25
|
+
titleContainer: ['columnHeaderTitleContainer'],
|
|
26
|
+
titleContainerContent: ['columnHeaderTitleContainerContent']
|
|
27
|
+
};
|
|
28
|
+
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
function GridColumnGroupHeader(props) {
|
|
32
|
+
var _apiRef$current$getRo, _columnGroupsLookup$g;
|
|
33
|
+
|
|
34
|
+
const {
|
|
35
|
+
groupId,
|
|
36
|
+
width,
|
|
37
|
+
depth,
|
|
38
|
+
maxDepth,
|
|
39
|
+
fields,
|
|
40
|
+
height,
|
|
41
|
+
colIndex,
|
|
42
|
+
isLastColumn,
|
|
43
|
+
extendRowFullWidth
|
|
44
|
+
} = props;
|
|
45
|
+
const rootProps = useGridRootProps();
|
|
46
|
+
const apiRef = useGridApiContext();
|
|
47
|
+
const columnGroupsLookup = useGridSelector(apiRef, gridColumnGroupsLookupSelector);
|
|
48
|
+
const {
|
|
49
|
+
hasScrollX,
|
|
50
|
+
hasScrollY
|
|
51
|
+
} = (_apiRef$current$getRo = apiRef.current.getRootDimensions()) != null ? _apiRef$current$getRo : {
|
|
52
|
+
hasScrollX: false,
|
|
53
|
+
hasScrollY: false
|
|
54
|
+
};
|
|
55
|
+
const group = groupId ? columnGroupsLookup[groupId] : {};
|
|
56
|
+
const {
|
|
57
|
+
headerName = groupId != null ? groupId : '',
|
|
58
|
+
description = '',
|
|
59
|
+
headerAlign = undefined
|
|
60
|
+
} = group;
|
|
61
|
+
let headerComponent;
|
|
62
|
+
const render = groupId && ((_columnGroupsLookup$g = columnGroupsLookup[groupId]) == null ? void 0 : _columnGroupsLookup$g.renderHeaderGroup);
|
|
63
|
+
const renderParams = {
|
|
64
|
+
groupId,
|
|
65
|
+
headerName,
|
|
66
|
+
description,
|
|
67
|
+
depth,
|
|
68
|
+
maxDepth,
|
|
69
|
+
fields,
|
|
70
|
+
colIndex,
|
|
71
|
+
isLastColumn
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
if (groupId && render) {
|
|
75
|
+
headerComponent = render(renderParams);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const removeLastBorderRight = isLastColumn && hasScrollX && !hasScrollY;
|
|
79
|
+
const showRightBorder = !isLastColumn ? rootProps.showColumnRightBorder : !removeLastBorderRight && !extendRowFullWidth;
|
|
80
|
+
const showColumnBorder = rootProps.showColumnRightBorder;
|
|
81
|
+
|
|
82
|
+
const ownerState = _extends({}, props, {
|
|
83
|
+
classes: rootProps.classes,
|
|
84
|
+
showRightBorder,
|
|
85
|
+
showColumnBorder,
|
|
86
|
+
headerAlign,
|
|
87
|
+
depth,
|
|
88
|
+
isDragging: false
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
const label = headerName != null ? headerName : groupId;
|
|
92
|
+
const id = useId();
|
|
93
|
+
const elementId = groupId === null ? `empty-group-cell-${id}` : groupId;
|
|
94
|
+
const classes = useUtilityClasses(ownerState);
|
|
95
|
+
const headerClassName = typeof group.headerClassName === 'function' ? group.headerClassName(renderParams) : group.headerClassName;
|
|
96
|
+
return /*#__PURE__*/_jsx(GridGenericColumnHeaderItem, {
|
|
97
|
+
classes: classes,
|
|
98
|
+
columnMenuOpen: false,
|
|
99
|
+
colIndex: colIndex,
|
|
100
|
+
height: height,
|
|
101
|
+
isResizing: false,
|
|
102
|
+
sortDirection: null,
|
|
103
|
+
hasFocus: false,
|
|
104
|
+
tabIndex: -1,
|
|
105
|
+
isDraggable: false,
|
|
106
|
+
headerComponent: headerComponent,
|
|
107
|
+
headerClassName: headerClassName,
|
|
108
|
+
description: description,
|
|
109
|
+
elementId: elementId,
|
|
110
|
+
width: width,
|
|
111
|
+
columnMenuIconButton: null,
|
|
112
|
+
columnTitleIconButtons: null,
|
|
113
|
+
resizable: false,
|
|
114
|
+
label: label,
|
|
115
|
+
"aria-colspan": fields.length // The fields are wrapped between |-...-| to avoid confusion between fields "id" and "id2" when using selector data-fields~=
|
|
116
|
+
,
|
|
117
|
+
"data-fields": `|-${fields.join('-|-')}-|`,
|
|
118
|
+
disableHeaderSeparator: true
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export { GridColumnGroupHeader };
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
-
import clsx from 'clsx';
|
|
5
4
|
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
6
5
|
import { unstable_useId as useId } from '@mui/material/utils';
|
|
7
6
|
import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
|
|
8
7
|
import { GridColumnHeaderSortIcon } from './GridColumnHeaderSortIcon';
|
|
9
|
-
import { GridColumnHeaderTitle } from './GridColumnHeaderTitle';
|
|
10
|
-
import { GridColumnHeaderSeparator } from './GridColumnHeaderSeparator';
|
|
11
8
|
import { ColumnHeaderMenuIcon } from './ColumnHeaderMenuIcon';
|
|
12
9
|
import { GridColumnHeaderMenu } from '../menu/columnMenu/GridColumnHeaderMenu';
|
|
13
10
|
import { getDataGridUtilityClass } from '../../constants/gridClasses';
|
|
14
11
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
12
|
+
import { GridGenericColumnHeaderItem } from './GridGenericColumnHeaderItem';
|
|
15
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
14
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
15
|
|
|
@@ -38,7 +36,7 @@ const useUtilityClasses = ownerState => {
|
|
|
38
36
|
};
|
|
39
37
|
|
|
40
38
|
function GridColumnHeaderItem(props) {
|
|
41
|
-
var _apiRef$current$getRo, _column$sortingOrder, _rootProps$
|
|
39
|
+
var _apiRef$current$getRo, _rootProps$components, _column$sortingOrder, _rootProps$components2, _column$headerName;
|
|
42
40
|
|
|
43
41
|
const {
|
|
44
42
|
column,
|
|
@@ -71,12 +69,21 @@ function GridColumnHeaderItem(props) {
|
|
|
71
69
|
hasScrollY: false
|
|
72
70
|
};
|
|
73
71
|
const isDraggable = React.useMemo(() => !rootProps.disableColumnReorder && !disableReorder && !column.disableReorder, [rootProps.disableColumnReorder, disableReorder, column.disableReorder]);
|
|
74
|
-
let headerComponent
|
|
72
|
+
let headerComponent;
|
|
75
73
|
|
|
76
74
|
if (column.renderHeader) {
|
|
77
75
|
headerComponent = column.renderHeader(apiRef.current.getColumnHeaderParams(column.field));
|
|
78
76
|
}
|
|
79
77
|
|
|
78
|
+
const removeLastBorderRight = isLastColumn && hasScrollX && !hasScrollY;
|
|
79
|
+
const showRightBorder = !isLastColumn ? rootProps.showColumnRightBorder : !removeLastBorderRight && !extendRowFullWidth;
|
|
80
|
+
|
|
81
|
+
const ownerState = _extends({}, props, {
|
|
82
|
+
classes: rootProps.classes,
|
|
83
|
+
showRightBorder
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
const classes = useUtilityClasses(ownerState);
|
|
80
87
|
const publish = React.useCallback(eventName => event => {
|
|
81
88
|
// Ignore portal
|
|
82
89
|
// See https://github.com/mui/mui-x/issues/1721
|
|
@@ -86,7 +93,7 @@ function GridColumnHeaderItem(props) {
|
|
|
86
93
|
|
|
87
94
|
apiRef.current.publishEvent(eventName, apiRef.current.getColumnHeaderParams(column.field), event);
|
|
88
95
|
}, [apiRef, column.field]);
|
|
89
|
-
const mouseEventsHandlers = {
|
|
96
|
+
const mouseEventsHandlers = React.useMemo(() => ({
|
|
90
97
|
onClick: publish('columnHeaderClick'),
|
|
91
98
|
onDoubleClick: publish('columnHeaderDoubleClick'),
|
|
92
99
|
onMouseOver: publish('columnHeaderOver'),
|
|
@@ -100,29 +107,16 @@ function GridColumnHeaderItem(props) {
|
|
|
100
107
|
onKeyDown: publish('columnHeaderKeyDown'),
|
|
101
108
|
onFocus: publish('columnHeaderFocus'),
|
|
102
109
|
onBlur: publish('columnHeaderBlur')
|
|
103
|
-
};
|
|
104
|
-
const draggableEventHandlers = isDraggable ? {
|
|
110
|
+
}), [publish]);
|
|
111
|
+
const draggableEventHandlers = React.useMemo(() => isDraggable ? {
|
|
105
112
|
onDragStart: publish('columnHeaderDragStart'),
|
|
106
113
|
onDragEnter: publish('columnHeaderDragEnter'),
|
|
107
114
|
onDragOver: publish('columnHeaderDragOver'),
|
|
108
115
|
onDragEnd: publish('columnHeaderDragEnd')
|
|
109
|
-
} :
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
const ownerState = _extends({}, props, {
|
|
114
|
-
classes: rootProps.classes,
|
|
115
|
-
showRightBorder
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
const classes = useUtilityClasses(ownerState);
|
|
119
|
-
const width = column.computedWidth;
|
|
120
|
-
let ariaSort = 'none';
|
|
121
|
-
|
|
122
|
-
if (sortDirection != null) {
|
|
123
|
-
ariaSort = sortDirection === 'asc' ? 'ascending' : 'descending';
|
|
124
|
-
}
|
|
125
|
-
|
|
116
|
+
} : {}, [isDraggable, publish]);
|
|
117
|
+
const columnHeaderSeparatorProps = React.useMemo(() => ({
|
|
118
|
+
onMouseDown: publish('columnSeparatorMouseDown')
|
|
119
|
+
}), [publish]);
|
|
126
120
|
React.useEffect(() => {
|
|
127
121
|
if (!showColumnMenuIcon) {
|
|
128
122
|
setShowColumnMenuIcon(columnMenuOpen);
|
|
@@ -140,13 +134,24 @@ function GridColumnHeaderItem(props) {
|
|
|
140
134
|
iconButtonRef: iconButtonRef
|
|
141
135
|
});
|
|
142
136
|
|
|
137
|
+
const columnMenu = /*#__PURE__*/_jsx(GridColumnHeaderMenu, {
|
|
138
|
+
columnMenuId: columnMenuId,
|
|
139
|
+
columnMenuButtonId: columnMenuButtonId,
|
|
140
|
+
field: column.field,
|
|
141
|
+
open: columnMenuOpen,
|
|
142
|
+
target: iconButtonRef.current,
|
|
143
|
+
ContentComponent: rootProps.components.ColumnMenu,
|
|
144
|
+
contentComponentProps: (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.columnMenu,
|
|
145
|
+
onExited: handleExited
|
|
146
|
+
});
|
|
147
|
+
|
|
143
148
|
const sortingOrder = (_column$sortingOrder = column.sortingOrder) != null ? _column$sortingOrder : rootProps.sortingOrder;
|
|
144
149
|
|
|
145
150
|
const columnTitleIconButtons = /*#__PURE__*/_jsxs(React.Fragment, {
|
|
146
151
|
children: [!rootProps.disableColumnFilter && /*#__PURE__*/_jsx(rootProps.components.ColumnHeaderFilterIconButton, _extends({
|
|
147
152
|
field: column.field,
|
|
148
153
|
counter: filterItemsCounter
|
|
149
|
-
}, (_rootProps$
|
|
154
|
+
}, (_rootProps$components2 = rootProps.componentsProps) == null ? void 0 : _rootProps$components2.columnHeaderFilterIconButton)), column.sortable && !column.hideSortIcons && /*#__PURE__*/_jsx(GridColumnHeaderSortIcon, {
|
|
150
155
|
direction: sortDirection,
|
|
151
156
|
index: sortIndex,
|
|
152
157
|
sortingOrder: sortingOrder
|
|
@@ -168,53 +173,32 @@ function GridColumnHeaderItem(props) {
|
|
|
168
173
|
colDef: column
|
|
169
174
|
}) : column.headerClassName;
|
|
170
175
|
const label = (_column$headerName = column.headerName) != null ? _column$headerName : column.field;
|
|
171
|
-
return /*#__PURE__*/
|
|
176
|
+
return /*#__PURE__*/_jsx(GridGenericColumnHeaderItem, _extends({
|
|
172
177
|
ref: headerCellRef,
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
role: "columnheader",
|
|
178
|
+
classes: classes,
|
|
179
|
+
columnMenuOpen: columnMenuOpen,
|
|
180
|
+
colIndex: colIndex,
|
|
181
|
+
height: headerHeight,
|
|
182
|
+
isResizing: isResizing,
|
|
183
|
+
sortDirection: sortDirection,
|
|
184
|
+
hasFocus: hasFocus,
|
|
181
185
|
tabIndex: tabIndex,
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
})
|
|
199
|
-
}), columnTitleIconButtons]
|
|
200
|
-
}), columnMenuIconButton]
|
|
201
|
-
})), /*#__PURE__*/_jsx(GridColumnHeaderSeparator, {
|
|
202
|
-
resizable: !rootProps.disableColumnResize && !!column.resizable,
|
|
203
|
-
resizing: isResizing,
|
|
204
|
-
height: headerHeight,
|
|
205
|
-
onMouseDown: publish('columnSeparatorMouseDown'),
|
|
206
|
-
side: separatorSide
|
|
207
|
-
}), /*#__PURE__*/_jsx(GridColumnHeaderMenu, {
|
|
208
|
-
columnMenuId: columnMenuId,
|
|
209
|
-
columnMenuButtonId: columnMenuButtonId,
|
|
210
|
-
field: column.field,
|
|
211
|
-
open: columnMenuOpen,
|
|
212
|
-
target: iconButtonRef.current,
|
|
213
|
-
ContentComponent: rootProps.components.ColumnMenu,
|
|
214
|
-
contentComponentProps: (_rootProps$components2 = rootProps.componentsProps) == null ? void 0 : _rootProps$components2.columnMenu,
|
|
215
|
-
onExited: handleExited
|
|
216
|
-
})]
|
|
217
|
-
}));
|
|
186
|
+
separatorSide: separatorSide,
|
|
187
|
+
isDraggable: isDraggable,
|
|
188
|
+
headerComponent: headerComponent,
|
|
189
|
+
description: column.description,
|
|
190
|
+
elementId: column.field,
|
|
191
|
+
width: column.computedWidth,
|
|
192
|
+
columnMenuIconButton: columnMenuIconButton,
|
|
193
|
+
columnTitleIconButtons: columnTitleIconButtons,
|
|
194
|
+
headerClassName: headerClassName,
|
|
195
|
+
label: label,
|
|
196
|
+
resizable: !rootProps.disableColumnResize && !!column.resizable,
|
|
197
|
+
"data-field": column.field,
|
|
198
|
+
columnMenu: columnMenu,
|
|
199
|
+
draggableContainerProps: draggableEventHandlers,
|
|
200
|
+
columnHeaderSeparatorProps: columnHeaderSeparatorProps
|
|
201
|
+
}, mouseEventsHandlers));
|
|
218
202
|
}
|
|
219
203
|
|
|
220
204
|
process.env.NODE_ENV !== "production" ? GridColumnHeaderItem.propTypes = {
|
|
@@ -30,7 +30,8 @@ const GridColumnHeadersInnerRoot = styled('div', {
|
|
|
30
30
|
}, styles.columnHeadersInner]
|
|
31
31
|
})(() => ({
|
|
32
32
|
display: 'flex',
|
|
33
|
-
alignItems: '
|
|
33
|
+
alignItems: 'flex-start',
|
|
34
|
+
flexDirection: 'column',
|
|
34
35
|
[`&.${gridClasses.columnHeaderDropZone} .${gridClasses.columnHeaderDraggableContainer}`]: {
|
|
35
36
|
cursor: 'move'
|
|
36
37
|
},
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { GridStateColDef } from '../../models/colDef/gridColDef';
|
|
3
|
+
import { GridSortDirection } from '../../models/gridSortModel';
|
|
4
|
+
import { GridColumnHeaderSeparatorProps } from './GridColumnHeaderSeparator';
|
|
5
|
+
import { GridColumnGroup } from '../../models/gridColumnGrouping';
|
|
6
|
+
interface GridGenericColumnHeaderItemProps extends Pick<GridStateColDef, 'headerClassName' | 'description' | 'resizable'> {
|
|
7
|
+
classes: Record<'root' | 'draggableContainer' | 'titleContainer' | 'titleContainerContent', string>;
|
|
8
|
+
colIndex: number;
|
|
9
|
+
columnMenuOpen: boolean;
|
|
10
|
+
height: number;
|
|
11
|
+
isResizing: boolean;
|
|
12
|
+
sortDirection: GridSortDirection;
|
|
13
|
+
sortIndex?: number;
|
|
14
|
+
filterItemsCounter?: number;
|
|
15
|
+
hasFocus?: boolean;
|
|
16
|
+
tabIndex: 0 | -1;
|
|
17
|
+
disableReorder?: boolean;
|
|
18
|
+
separatorSide?: GridColumnHeaderSeparatorProps['side'];
|
|
19
|
+
headerComponent?: React.ReactNode;
|
|
20
|
+
elementId: GridStateColDef['field'] | GridColumnGroup['groupId'];
|
|
21
|
+
isDraggable: boolean;
|
|
22
|
+
width: number;
|
|
23
|
+
columnMenuIconButton?: React.ReactNode;
|
|
24
|
+
columnMenu?: React.ReactNode;
|
|
25
|
+
columnTitleIconButtons?: React.ReactNode;
|
|
26
|
+
label: string;
|
|
27
|
+
draggableContainerProps?: Partial<React.HTMLProps<HTMLDivElement>>;
|
|
28
|
+
columnHeaderSeparatorProps?: Partial<GridColumnHeaderSeparatorProps>;
|
|
29
|
+
disableHeaderSeparator?: boolean;
|
|
30
|
+
}
|
|
31
|
+
declare const GridGenericColumnHeaderItem: React.ForwardRefExoticComponent<GridGenericColumnHeaderItemProps & React.RefAttributes<unknown>>;
|
|
32
|
+
export { GridGenericColumnHeaderItem };
|