@mui/x-data-grid 6.14.0 → 6.15.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 +83 -0
- package/DataGrid/useDataGridComponent.js +43 -40
- package/components/DataGridVirtualScroller.d.ts +1 -4
- package/components/DataGridVirtualScroller.js +3 -5
- package/components/GridRow.js +4 -2
- package/components/base/GridBody.d.ts +0 -1
- package/components/base/GridBody.js +2 -22
- package/components/cell/GridActionsCell.js +2 -2
- package/components/cell/GridActionsCellItem.d.ts +6 -0
- package/components/cell/GridCell.js +4 -2
- package/components/columnHeaders/GridColumnHeaderItem.js +2 -1
- package/components/menu/GridMenu.d.ts +1 -2
- package/components/menu/GridMenu.js +21 -5
- package/components/menu/columnMenu/GridColumnHeaderMenu.js +11 -8
- package/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/components/panel/filterPanel/GridFilterInputSingleSelect.js +1 -1
- package/components/toolbar/GridToolbarDensitySelector.js +2 -7
- package/components/toolbar/GridToolbarExportContainer.js +1 -9
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +5 -2
- package/hooks/features/export/useGridPrintExport.js +37 -7
- package/hooks/features/filter/gridFilterUtils.js +10 -6
- package/hooks/features/focus/useGridFocus.js +0 -1
- package/hooks/features/index.d.ts +1 -0
- package/hooks/features/index.js +2 -1
- package/hooks/features/virtualization/gridVirtualizationSelectors.d.ts +16 -0
- package/hooks/features/virtualization/gridVirtualizationSelectors.js +18 -0
- package/hooks/features/virtualization/index.d.ts +2 -0
- package/hooks/features/virtualization/index.js +2 -0
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +0 -1
- package/hooks/features/virtualization/useGridVirtualScroller.js +53 -36
- package/hooks/features/virtualization/useGridVirtualization.d.ts +12 -0
- package/hooks/features/virtualization/useGridVirtualization.js +47 -0
- package/index.js +1 -1
- package/internals/index.d.ts +4 -0
- package/internals/index.js +4 -0
- package/legacy/DataGrid/useDataGridComponent.js +43 -40
- package/legacy/components/DataGridVirtualScroller.js +2 -4
- package/legacy/components/GridRow.js +4 -2
- package/legacy/components/base/GridBody.js +2 -26
- package/legacy/components/cell/GridActionsCell.js +2 -2
- package/legacy/components/cell/GridCell.js +4 -2
- package/legacy/components/columnHeaders/GridColumnHeaderItem.js +2 -1
- package/legacy/components/menu/GridMenu.js +21 -5
- package/legacy/components/menu/columnMenu/GridColumnHeaderMenu.js +11 -8
- package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +2 -1
- package/legacy/components/panel/filterPanel/GridFilterInputSingleSelect.js +2 -1
- package/legacy/components/toolbar/GridToolbarDensitySelector.js +2 -7
- package/legacy/components/toolbar/GridToolbarExportContainer.js +1 -9
- package/legacy/hooks/features/columnHeaders/useGridColumnHeaders.js +5 -2
- package/legacy/hooks/features/export/useGridPrintExport.js +44 -12
- package/legacy/hooks/features/filter/gridFilterUtils.js +10 -6
- package/legacy/hooks/features/focus/useGridFocus.js +0 -1
- package/legacy/hooks/features/index.js +2 -1
- package/legacy/hooks/features/virtualization/gridVirtualizationSelectors.js +24 -0
- package/legacy/hooks/features/virtualization/index.js +2 -0
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +61 -39
- package/legacy/hooks/features/virtualization/useGridVirtualization.js +51 -0
- package/legacy/index.js +1 -1
- package/legacy/internals/index.js +4 -0
- package/legacy/models/api/index.js +1 -2
- package/legacy/utils/createControllablePromise.js +11 -0
- package/models/api/gridApiCommon.d.ts +3 -4
- package/models/api/gridVirtualizationApi.d.ts +20 -0
- package/models/api/index.d.ts +1 -2
- package/models/api/index.js +1 -2
- package/models/events/gridEventLookup.d.ts +8 -0
- package/models/gridExport.d.ts +17 -4
- package/models/gridStateCommunity.d.ts +2 -1
- package/models/index.d.ts +1 -1
- package/modern/DataGrid/useDataGridComponent.js +43 -40
- package/modern/components/DataGridVirtualScroller.js +3 -5
- package/modern/components/GridRow.js +4 -2
- package/modern/components/base/GridBody.js +2 -22
- package/modern/components/cell/GridActionsCell.js +2 -2
- package/modern/components/cell/GridCell.js +4 -2
- package/modern/components/columnHeaders/GridColumnHeaderItem.js +2 -1
- package/modern/components/menu/GridMenu.js +20 -5
- package/modern/components/menu/columnMenu/GridColumnHeaderMenu.js +11 -8
- package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +1 -1
- package/modern/components/toolbar/GridToolbarDensitySelector.js +2 -7
- package/modern/components/toolbar/GridToolbarExportContainer.js +1 -9
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +5 -2
- package/modern/hooks/features/export/useGridPrintExport.js +37 -7
- package/modern/hooks/features/filter/gridFilterUtils.js +10 -6
- package/modern/hooks/features/focus/useGridFocus.js +0 -1
- package/modern/hooks/features/index.js +2 -1
- package/modern/hooks/features/virtualization/gridVirtualizationSelectors.js +18 -0
- package/modern/hooks/features/virtualization/index.js +2 -0
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +52 -36
- package/modern/hooks/features/virtualization/useGridVirtualization.js +47 -0
- package/modern/index.js +1 -1
- package/modern/internals/index.js +4 -0
- package/modern/models/api/index.js +1 -2
- package/modern/utils/createControllablePromise.js +11 -0
- package/node/DataGrid/useDataGridComponent.js +43 -40
- package/node/components/DataGridVirtualScroller.js +3 -5
- package/node/components/GridRow.js +4 -2
- package/node/components/base/GridBody.js +2 -22
- package/node/components/cell/GridActionsCell.js +2 -2
- package/node/components/cell/GridCell.js +4 -2
- package/node/components/columnHeaders/GridColumnHeaderItem.js +2 -1
- package/node/components/menu/GridMenu.js +19 -4
- package/node/components/menu/columnMenu/GridColumnHeaderMenu.js +10 -7
- package/node/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +1 -1
- package/node/components/toolbar/GridToolbarDensitySelector.js +2 -7
- package/node/components/toolbar/GridToolbarExportContainer.js +1 -9
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +5 -2
- package/node/hooks/features/export/useGridPrintExport.js +37 -7
- package/node/hooks/features/filter/gridFilterUtils.js +9 -6
- package/node/hooks/features/focus/useGridFocus.js +0 -1
- package/node/hooks/features/index.js +11 -0
- package/node/hooks/features/virtualization/gridVirtualizationSelectors.js +27 -0
- package/node/hooks/features/virtualization/index.js +27 -0
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +51 -37
- package/node/hooks/features/virtualization/useGridVirtualization.js +58 -0
- package/node/index.js +1 -1
- package/node/internals/index.js +44 -0
- package/node/models/api/index.js +4 -15
- package/node/utils/createControllablePromise.js +17 -0
- package/package.json +1 -1
- package/utils/createControllablePromise.d.ts +5 -0
- package/utils/createControllablePromise.js +11 -0
- package/models/api/gridDisableVirtualizationApi.d.ts +0 -15
- package/models/api/gridVirtualScrollerApi.d.ts +0 -8
- package/models/api/gridVirtualScrollerApi.js +0 -1
- package/modern/models/api/gridDisableVirtualizationApi.js +0 -1
- package/modern/models/api/gridVirtualScrollerApi.js +0 -1
- package/node/models/api/gridVirtualScrollerApi.js +0 -5
- /package/legacy/models/api/{gridDisableVirtualizationApi.js → gridVirtualizationApi.js} +0 -0
- /package/{legacy/models/api/gridVirtualScrollerApi.js → models/api/gridVirtualizationApi.js} +0 -0
- /package/{models/api/gridDisableVirtualizationApi.js → modern/models/api/gridVirtualizationApi.js} +0 -0
- /package/node/models/api/{gridDisableVirtualizationApi.js → gridVirtualizationApi.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,89 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 6.15.0
|
|
7
|
+
|
|
8
|
+
_Sep 22, 2023_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 9 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🚀 Implement columns auto-sizing (#10180) @romgrk
|
|
13
|
+
- 🎁 Add support for `getRowsToExport` option to print export on the data grid (#10084) @zreecespieces
|
|
14
|
+
- 🌍 Improve Finnish (fi-FI) locale
|
|
15
|
+
- 🐞 Bugfixes
|
|
16
|
+
- 📚 Documentation improvements
|
|
17
|
+
|
|
18
|
+
### Data Grid
|
|
19
|
+
|
|
20
|
+
#### `@mui/x-data-grid@6.15.0`
|
|
21
|
+
|
|
22
|
+
- [DataGrid] Add support for `getRowsToExport` option to print export (#10084) @zreecespieces
|
|
23
|
+
- [DataGrid] Fix dev warning about `InputLabelProps` (#10413) @romgrk
|
|
24
|
+
- [DataGrid] Refactor `GridMenu` prop `onClickAway` to `onClose` (#10411) @romgrk
|
|
25
|
+
- [DataGrid] Restore focus after `GridMenu` closes (#10412) @romgrk
|
|
26
|
+
- [DataGrid] Fix typing of `GridActionsCellItem` (#10344) @romgrk
|
|
27
|
+
- [DataGrid] Hide `eval` from bundlers (#10329) @romgrk
|
|
28
|
+
- [DataGrid] Add `border: 0` to unmounted focused cell to avoid layout shifts in that row (#10318) @lauri865
|
|
29
|
+
|
|
30
|
+
#### `@mui/x-data-grid-pro@6.15.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
31
|
+
|
|
32
|
+
Same changes as in `@mui/x-data-grid@6.15.0`, plus:
|
|
33
|
+
|
|
34
|
+
- [DataGridPro] Implement columns auto-sizing (#10180) @romgrk
|
|
35
|
+
- [DataGridPro] Fix keyboard navigation issue in header filters (#10358) @MBilalShafi
|
|
36
|
+
- [DataGridPro] Add missing row hover styles (#10252) @cherniavskii
|
|
37
|
+
- [DataGridPro] Make default filter items have stable references in header filters (#10338) @MBilalShafi
|
|
38
|
+
|
|
39
|
+
#### `@mui/x-data-grid-premium@6.15.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
40
|
+
|
|
41
|
+
Same changes as in `@mui/x-data-grid-pro@6.15.0`.
|
|
42
|
+
|
|
43
|
+
### Date Pickers
|
|
44
|
+
|
|
45
|
+
#### `@mui/x-date-pickers@6.15.0`
|
|
46
|
+
|
|
47
|
+
- [pickers] Support tokens without spaces (#10185) @alexfauquette
|
|
48
|
+
- [l10n] Improve Finnish (fi-FI) locale (#10346) @samijouppila
|
|
49
|
+
|
|
50
|
+
#### `@mui/x-date-pickers-pro@6.15.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
51
|
+
|
|
52
|
+
Same changes as in `@mui/x-date-pickers@6.15.0`.
|
|
53
|
+
|
|
54
|
+
### Charts / `@mui/x-charts@6.0.0-alpha.12`
|
|
55
|
+
|
|
56
|
+
- [charts] Fix sparkline scale and rendering (#10402) @alexfauquette
|
|
57
|
+
- [charts] Remove components from `@mui/material` (#10115) @alexfauquette
|
|
58
|
+
|
|
59
|
+
### Tree View / `@mui/x-tree-view@6.0.0-alpha.4`
|
|
60
|
+
|
|
61
|
+
- [TreeView] Split features into plugins to prepare for Pro version (#10123) @flaviendelangle
|
|
62
|
+
|
|
63
|
+
### Docs
|
|
64
|
+
|
|
65
|
+
- [docs] Add charts documentation pages to complete pricing table (#10394) @alexfauquette
|
|
66
|
+
- [docs] Add missing MIT packages on the Licensing page (#10348) @flaviendelangle
|
|
67
|
+
- [docs] Clearer component pattern @oliviertassinari
|
|
68
|
+
- [docs] Easier to understand demo (#10370) @oliviertassinari
|
|
69
|
+
- [docs] Fix `301` to Material UI @oliviertassinari
|
|
70
|
+
- [docs] Improve the column visibility section (#10327) @MBilalShafi
|
|
71
|
+
- [docs] Improve the documentation section `rowIdentifier` (#10326) @MBilalShafi
|
|
72
|
+
- [docs] Improve pickers localization documentation (#10202) @flaviendelangle
|
|
73
|
+
- [docs] Polish typescript ref usage (#10359) @oliviertassinari
|
|
74
|
+
- [docs] Improve charts tooltip wording (#10406) @alexfauquette
|
|
75
|
+
|
|
76
|
+
### Core
|
|
77
|
+
|
|
78
|
+
- [core] Cleanup GitHub issues template (#10372) @romgrk
|
|
79
|
+
- [core] Fix Circle CI OOM (#10385) @romgrk
|
|
80
|
+
- [core] Improve sleep test helper @oliviertassinari
|
|
81
|
+
- [core] Remove unwanted prefixes @oliviertassinari
|
|
82
|
+
- [core] Remove duplicate label @oliviertassinari
|
|
83
|
+
- [core] Simplify source @oliviertassinari
|
|
84
|
+
- [core] Upgrade monorepo (#10425) @cherniavskii
|
|
85
|
+
- [core] Upgrade monorepo to have the new typescript-to-proptype (#10224) @flaviendelangle
|
|
86
|
+
- [test] Do not use deprecated adapter methods (#10416) @flaviendelangle
|
|
87
|
+
- [test] Name test suites according to sentence case (#10429) @alexfauquette
|
|
88
|
+
|
|
6
89
|
## 6.14.0
|
|
7
90
|
|
|
8
91
|
_Sep 14, 2023_
|
|
@@ -25,53 +25,56 @@ import { rowsMetaStateInitializer, useGridRowsMeta } from '../hooks/features/row
|
|
|
25
25
|
import { useGridStatePersistence } from '../hooks/features/statePersistence/useGridStatePersistence';
|
|
26
26
|
import { useGridColumnSpanning } from '../hooks/features/columns/useGridColumnSpanning';
|
|
27
27
|
import { useGridColumnGrouping, columnGroupsStateInitializer } from '../hooks/features/columnGrouping/useGridColumnGrouping';
|
|
28
|
+
import { useGridVirtualization, virtualizationStateInitializer } from '../hooks/features/virtualization';
|
|
28
29
|
export const useDataGridComponent = (inputApiRef, props) => {
|
|
29
|
-
const
|
|
30
|
+
const apiRef = useGridInitialization(inputApiRef, props);
|
|
30
31
|
|
|
31
32
|
/**
|
|
32
33
|
* Register all pre-processors called during state initialization here.
|
|
33
34
|
*/
|
|
34
|
-
useGridRowSelectionPreProcessors(
|
|
35
|
-
useGridRowsPreProcessors(
|
|
35
|
+
useGridRowSelectionPreProcessors(apiRef, props);
|
|
36
|
+
useGridRowsPreProcessors(apiRef);
|
|
36
37
|
|
|
37
38
|
/**
|
|
38
39
|
* Register all state initializers here.
|
|
39
40
|
*/
|
|
40
|
-
useGridInitializeState(rowSelectionStateInitializer,
|
|
41
|
-
useGridInitializeState(columnsStateInitializer,
|
|
42
|
-
useGridInitializeState(rowsStateInitializer,
|
|
43
|
-
useGridInitializeState(editingStateInitializer,
|
|
44
|
-
useGridInitializeState(focusStateInitializer,
|
|
45
|
-
useGridInitializeState(sortingStateInitializer,
|
|
46
|
-
useGridInitializeState(preferencePanelStateInitializer,
|
|
47
|
-
useGridInitializeState(filterStateInitializer,
|
|
48
|
-
useGridInitializeState(densityStateInitializer,
|
|
49
|
-
useGridInitializeState(paginationStateInitializer,
|
|
50
|
-
useGridInitializeState(rowsMetaStateInitializer,
|
|
51
|
-
useGridInitializeState(columnMenuStateInitializer,
|
|
52
|
-
useGridInitializeState(columnGroupsStateInitializer,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
41
|
+
useGridInitializeState(rowSelectionStateInitializer, apiRef, props);
|
|
42
|
+
useGridInitializeState(columnsStateInitializer, apiRef, props);
|
|
43
|
+
useGridInitializeState(rowsStateInitializer, apiRef, props);
|
|
44
|
+
useGridInitializeState(editingStateInitializer, apiRef, props);
|
|
45
|
+
useGridInitializeState(focusStateInitializer, apiRef, props);
|
|
46
|
+
useGridInitializeState(sortingStateInitializer, apiRef, props);
|
|
47
|
+
useGridInitializeState(preferencePanelStateInitializer, apiRef, props);
|
|
48
|
+
useGridInitializeState(filterStateInitializer, apiRef, props);
|
|
49
|
+
useGridInitializeState(densityStateInitializer, apiRef, props);
|
|
50
|
+
useGridInitializeState(paginationStateInitializer, apiRef, props);
|
|
51
|
+
useGridInitializeState(rowsMetaStateInitializer, apiRef, props);
|
|
52
|
+
useGridInitializeState(columnMenuStateInitializer, apiRef, props);
|
|
53
|
+
useGridInitializeState(columnGroupsStateInitializer, apiRef, props);
|
|
54
|
+
useGridInitializeState(virtualizationStateInitializer, apiRef, props);
|
|
55
|
+
useGridKeyboardNavigation(apiRef, props);
|
|
56
|
+
useGridRowSelection(apiRef, props);
|
|
57
|
+
useGridColumns(apiRef, props);
|
|
58
|
+
useGridRows(apiRef, props);
|
|
59
|
+
useGridParamsApi(apiRef, props);
|
|
60
|
+
useGridColumnSpanning(apiRef);
|
|
61
|
+
useGridColumnGrouping(apiRef, props);
|
|
62
|
+
useGridEditing(apiRef, props);
|
|
63
|
+
useGridFocus(apiRef, props);
|
|
64
|
+
useGridPreferencesPanel(apiRef, props);
|
|
65
|
+
useGridFilter(apiRef, props);
|
|
66
|
+
useGridSorting(apiRef, props);
|
|
67
|
+
useGridDensity(apiRef, props);
|
|
68
|
+
useGridPagination(apiRef, props);
|
|
69
|
+
useGridRowsMeta(apiRef, props);
|
|
70
|
+
useGridScroll(apiRef, props);
|
|
71
|
+
useGridColumnMenu(apiRef);
|
|
72
|
+
useGridCsvExport(apiRef, props);
|
|
73
|
+
useGridPrintExport(apiRef, props);
|
|
74
|
+
useGridClipboard(apiRef, props);
|
|
75
|
+
useGridDimensions(apiRef, props);
|
|
76
|
+
useGridEvents(apiRef, props);
|
|
77
|
+
useGridStatePersistence(apiRef);
|
|
78
|
+
useGridVirtualization(apiRef, props);
|
|
79
|
+
return apiRef;
|
|
77
80
|
};
|
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
disableVirtualization?: boolean;
|
|
4
|
-
}
|
|
5
|
-
declare const DataGridVirtualScroller: React.ForwardRefExoticComponent<DataGridVirtualScrollerProps & React.RefAttributes<HTMLDivElement>>;
|
|
2
|
+
declare const DataGridVirtualScroller: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
6
3
|
export { DataGridVirtualScroller };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["className"
|
|
3
|
+
const _excluded = ["className"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { GridVirtualScroller } from './virtualization/GridVirtualScroller';
|
|
6
6
|
import { GridVirtualScrollerContent } from './virtualization/GridVirtualScrollerContent';
|
|
@@ -11,8 +11,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
11
11
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
12
|
const DataGridVirtualScroller = /*#__PURE__*/React.forwardRef(function DataGridVirtualScroller(props, ref) {
|
|
13
13
|
const {
|
|
14
|
-
className
|
|
15
|
-
disableVirtualization
|
|
14
|
+
className
|
|
16
15
|
} = props,
|
|
17
16
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
18
17
|
const {
|
|
@@ -21,8 +20,7 @@ const DataGridVirtualScroller = /*#__PURE__*/React.forwardRef(function DataGridV
|
|
|
21
20
|
getRenderZoneProps,
|
|
22
21
|
getRows
|
|
23
22
|
} = useGridVirtualScroller({
|
|
24
|
-
ref
|
|
25
|
-
disableVirtualization
|
|
23
|
+
ref
|
|
26
24
|
});
|
|
27
25
|
return /*#__PURE__*/_jsxs(GridVirtualScroller, _extends({
|
|
28
26
|
className: className
|
package/components/GridRow.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["selected", "rowId", "row", "index", "style", "position", "rowHeight", "className", "visibleColumns", "renderedColumns", "containerWidth", "firstColumnToRender", "lastColumnToRender", "isLastVisible", "focusedCellColumnIndexNotInRange", "isNotVisible", "focusedCell", "tabbableCell", "onClick", "onDoubleClick", "onMouseEnter", "onMouseLeave"];
|
|
3
|
+
const _excluded = ["selected", "hovered", "rowId", "row", "index", "style", "position", "rowHeight", "className", "visibleColumns", "renderedColumns", "containerWidth", "firstColumnToRender", "lastColumnToRender", "isLastVisible", "focusedCellColumnIndexNotInRange", "isNotVisible", "focusedCell", "tabbableCell", "onClick", "onDoubleClick", "onMouseEnter", "onMouseLeave"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
@@ -57,6 +57,7 @@ function EmptyCell({
|
|
|
57
57
|
const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
58
58
|
const {
|
|
59
59
|
selected,
|
|
60
|
+
hovered,
|
|
60
61
|
rowId,
|
|
61
62
|
row,
|
|
62
63
|
index,
|
|
@@ -92,6 +93,7 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
92
93
|
|
|
93
94
|
const ownerState = {
|
|
94
95
|
selected,
|
|
96
|
+
hovered,
|
|
95
97
|
isLastVisible,
|
|
96
98
|
classes: rootProps.classes,
|
|
97
99
|
editing: apiRef.current.getRowMode(rowId) === GridRowModes.Edit,
|
|
@@ -328,7 +330,7 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
328
330
|
"data-id": rowId,
|
|
329
331
|
"data-rowindex": index,
|
|
330
332
|
role: "row",
|
|
331
|
-
className: clsx(...rowClassNames, classes.root, className),
|
|
333
|
+
className: clsx(...rowClassNames, classes.root, className, hovered && 'Mui-hovered'),
|
|
332
334
|
"aria-rowindex": ariaRowIndex,
|
|
333
335
|
"aria-selected": selected,
|
|
334
336
|
style: style
|
|
@@ -4,7 +4,6 @@ interface GridBodyProps {
|
|
|
4
4
|
ColumnHeadersProps?: Record<string, any>;
|
|
5
5
|
VirtualScrollerComponent: React.JSXElementConstructor<React.HTMLAttributes<HTMLDivElement> & {
|
|
6
6
|
ref: React.Ref<HTMLDivElement>;
|
|
7
|
-
disableVirtualization: boolean;
|
|
8
7
|
}>;
|
|
9
8
|
}
|
|
10
9
|
declare function GridBody(props: GridBodyProps): React.JSX.Element;
|
|
@@ -39,7 +39,6 @@ function GridBody(props) {
|
|
|
39
39
|
const columnVisibility = useGridSelector(apiRef, gridColumnVisibilityModelSelector);
|
|
40
40
|
const columnGroupsHeaderStructure = useGridSelector(apiRef, gridColumnGroupsHeaderStructureSelector);
|
|
41
41
|
const hasOtherElementInTabSequence = !(columnGroupHeaderTabIndexState === null && columnHeaderTabIndexState === null && cellTabIndexState === null);
|
|
42
|
-
const [isVirtualizationDisabled, setIsVirtualizationDisabled] = React.useState(rootProps.disableVirtualization);
|
|
43
42
|
useEnhancedEffect(() => {
|
|
44
43
|
apiRef.current.computeSizeAndPublishResizeEvent();
|
|
45
44
|
const elementToObserve = rootRef.current;
|
|
@@ -49,7 +48,7 @@ function GridBody(props) {
|
|
|
49
48
|
let animationFrame;
|
|
50
49
|
const observer = new ResizeObserver(() => {
|
|
51
50
|
// See https://github.com/mui/mui-x/issues/8733
|
|
52
|
-
animationFrame =
|
|
51
|
+
animationFrame = requestAnimationFrame(() => {
|
|
53
52
|
apiRef.current.computeSizeAndPublishResizeEvent();
|
|
54
53
|
});
|
|
55
54
|
});
|
|
@@ -65,24 +64,6 @@ function GridBody(props) {
|
|
|
65
64
|
}
|
|
66
65
|
};
|
|
67
66
|
}, [apiRef]);
|
|
68
|
-
const disableVirtualization = React.useCallback(() => {
|
|
69
|
-
setIsVirtualizationDisabled(true);
|
|
70
|
-
}, []);
|
|
71
|
-
const enableVirtualization = React.useCallback(() => {
|
|
72
|
-
setIsVirtualizationDisabled(false);
|
|
73
|
-
}, []);
|
|
74
|
-
React.useEffect(() => {
|
|
75
|
-
setIsVirtualizationDisabled(rootProps.disableVirtualization);
|
|
76
|
-
}, [rootProps.disableVirtualization]);
|
|
77
|
-
|
|
78
|
-
// The `useGridApiMethod` hook can't be used here, because it only installs the
|
|
79
|
-
// method if it doesn't exist yet. Once installed, it's never updated again.
|
|
80
|
-
// This break the methods above, since their closure comes from the first time
|
|
81
|
-
// they were installed. Which means that calling `setIsVirtualizationDisabled`
|
|
82
|
-
// will trigger a re-render, but it won't update the state. That can be solved
|
|
83
|
-
// by migrating the virtualization status to the global state.
|
|
84
|
-
apiRef.current.unstable_disableVirtualization = disableVirtualization;
|
|
85
|
-
apiRef.current.unstable_enableVirtualization = enableVirtualization;
|
|
86
67
|
const columnHeadersRef = React.useRef(null);
|
|
87
68
|
const columnsContainerRef = React.useRef(null);
|
|
88
69
|
const virtualScrollerRef = React.useRef(null);
|
|
@@ -119,8 +100,7 @@ function GridBody(props) {
|
|
|
119
100
|
// If this event is published while dimensions haven't been computed,
|
|
120
101
|
// the `onFetchRows` prop won't be called during mount.
|
|
121
102
|
, {
|
|
122
|
-
ref: virtualScrollerRef
|
|
123
|
-
disableVirtualization: isVirtualizationDisabled
|
|
103
|
+
ref: virtualScrollerRef
|
|
124
104
|
}), children]
|
|
125
105
|
});
|
|
126
106
|
}
|
|
@@ -165,11 +165,11 @@ function GridActionsCell(props) {
|
|
|
165
165
|
fontSize: "small"
|
|
166
166
|
})
|
|
167
167
|
})), menuButtons.length > 0 && /*#__PURE__*/_jsx(GridMenu, {
|
|
168
|
-
onClickAway: hideMenu,
|
|
169
|
-
onClick: hideMenu,
|
|
170
168
|
open: open,
|
|
171
169
|
target: buttonRef.current,
|
|
172
170
|
position: position,
|
|
171
|
+
onClose: hideMenu,
|
|
172
|
+
onClick: hideMenu,
|
|
173
173
|
children: /*#__PURE__*/_jsx(MenuList, {
|
|
174
174
|
id: menuId,
|
|
175
175
|
className: gridClasses.menuList,
|
|
@@ -4,6 +4,8 @@ import { MenuItemProps } from '@mui/material/MenuItem';
|
|
|
4
4
|
export type GridActionsCellItemProps = {
|
|
5
5
|
label: string;
|
|
6
6
|
icon?: React.ReactElement;
|
|
7
|
+
/** from https://mui.com/material-ui/api/button-base/#ButtonBase-prop-component */
|
|
8
|
+
component?: React.ElementType;
|
|
7
9
|
} & (({
|
|
8
10
|
showInMenu?: false;
|
|
9
11
|
icon: React.ReactElement;
|
|
@@ -13,6 +15,8 @@ export type GridActionsCellItemProps = {
|
|
|
13
15
|
declare const GridActionsCellItem: React.ForwardRefExoticComponent<(Omit<{
|
|
14
16
|
label: string;
|
|
15
17
|
icon?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
|
|
18
|
+
/** from https://mui.com/material-ui/api/button-base/#ButtonBase-prop-component */
|
|
19
|
+
component?: React.ElementType<any> | undefined;
|
|
16
20
|
} & {
|
|
17
21
|
showInMenu?: false | undefined;
|
|
18
22
|
icon: React.ReactElement;
|
|
@@ -23,6 +27,8 @@ declare const GridActionsCellItem: React.ForwardRefExoticComponent<(Omit<{
|
|
|
23
27
|
}, "ref"> | Omit<{
|
|
24
28
|
label: string;
|
|
25
29
|
icon?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
|
|
30
|
+
/** from https://mui.com/material-ui/api/button-base/#ButtonBase-prop-component */
|
|
31
|
+
component?: React.ElementType<any> | undefined;
|
|
26
32
|
} & {
|
|
27
33
|
showInMenu: true;
|
|
28
34
|
} & import("@mui/material/MenuItem").MenuItemOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & {
|
|
@@ -232,7 +232,8 @@ const GridCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
232
232
|
return {
|
|
233
233
|
padding: 0,
|
|
234
234
|
opacity: 0,
|
|
235
|
-
width: 0
|
|
235
|
+
width: 0,
|
|
236
|
+
border: 0
|
|
236
237
|
};
|
|
237
238
|
}
|
|
238
239
|
const cellStyle = {
|
|
@@ -497,7 +498,8 @@ const GridCellV7 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
497
498
|
return {
|
|
498
499
|
padding: 0,
|
|
499
500
|
opacity: 0,
|
|
500
|
-
width: 0
|
|
501
|
+
width: 0,
|
|
502
|
+
border: 0
|
|
501
503
|
};
|
|
502
504
|
}
|
|
503
505
|
const cellStyle = {
|
|
@@ -95,7 +95,8 @@ function GridColumnHeaderItem(props) {
|
|
|
95
95
|
onDragEnd: publish('columnHeaderDragEnd')
|
|
96
96
|
} : {}, [isDraggable, publish]);
|
|
97
97
|
const columnHeaderSeparatorProps = React.useMemo(() => ({
|
|
98
|
-
onMouseDown: publish('columnSeparatorMouseDown')
|
|
98
|
+
onMouseDown: publish('columnSeparatorMouseDown'),
|
|
99
|
+
onDoubleClick: publish('columnSeparatorDoubleClick')
|
|
99
100
|
}), [publish]);
|
|
100
101
|
React.useEffect(() => {
|
|
101
102
|
if (!showColumnMenuIcon) {
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { ClickAwayListenerProps } from '@mui/material/ClickAwayListener';
|
|
3
2
|
import { GrowProps } from '@mui/material/Grow';
|
|
4
3
|
import { PopperProps } from '@mui/material/Popper';
|
|
5
4
|
type MenuPosition = 'bottom-end' | 'bottom-start' | 'bottom' | 'left-end' | 'left-start' | 'left' | 'right-end' | 'right-start' | 'right' | 'top-end' | 'top-start' | 'top' | undefined;
|
|
6
5
|
export interface GridMenuProps extends Omit<PopperProps, 'onKeyDown' | 'children'> {
|
|
7
6
|
open: boolean;
|
|
8
7
|
target: HTMLElement | null;
|
|
9
|
-
|
|
8
|
+
onClose: (event?: Event) => void;
|
|
10
9
|
position?: MenuPosition;
|
|
11
10
|
onExited?: GrowProps['onExited'];
|
|
12
11
|
children: React.ReactNode;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["open", "target", "
|
|
3
|
+
const _excluded = ["open", "target", "onClose", "children", "position", "className", "onExited"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import ClickAwayListener from '@mui/material/ClickAwayListener';
|
|
8
|
-
import { unstable_composeClasses as composeClasses, HTMLElementType } from '@mui/utils';
|
|
8
|
+
import { unstable_composeClasses as composeClasses, unstable_useEnhancedEffect as useEnhancedEffect, HTMLElementType } from '@mui/utils';
|
|
9
9
|
import Grow from '@mui/material/Grow';
|
|
10
10
|
import Paper from '@mui/material/Paper';
|
|
11
11
|
import Popper from '@mui/material/Popper';
|
|
@@ -44,7 +44,7 @@ function GridMenu(props) {
|
|
|
44
44
|
const {
|
|
45
45
|
open,
|
|
46
46
|
target,
|
|
47
|
-
|
|
47
|
+
onClose,
|
|
48
48
|
children,
|
|
49
49
|
position,
|
|
50
50
|
className,
|
|
@@ -54,6 +54,16 @@ function GridMenu(props) {
|
|
|
54
54
|
const apiRef = useGridApiContext();
|
|
55
55
|
const rootProps = useGridRootProps();
|
|
56
56
|
const classes = useUtilityClasses(rootProps);
|
|
57
|
+
const savedFocusRef = React.useRef(null);
|
|
58
|
+
useEnhancedEffect(() => {
|
|
59
|
+
if (open) {
|
|
60
|
+
savedFocusRef.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
61
|
+
} else {
|
|
62
|
+
var _savedFocusRef$curren, _savedFocusRef$curren2;
|
|
63
|
+
(_savedFocusRef$curren = savedFocusRef.current) == null || (_savedFocusRef$curren2 = _savedFocusRef$curren.focus) == null || _savedFocusRef$curren2.call(_savedFocusRef$curren);
|
|
64
|
+
savedFocusRef.current = null;
|
|
65
|
+
}
|
|
66
|
+
}, [open]);
|
|
57
67
|
React.useEffect(() => {
|
|
58
68
|
// Emit menuOpen or menuClose events
|
|
59
69
|
const eventName = open ? 'menuOpen' : 'menuClose';
|
|
@@ -69,6 +79,12 @@ function GridMenu(props) {
|
|
|
69
79
|
onExited(node);
|
|
70
80
|
}
|
|
71
81
|
};
|
|
82
|
+
const handleClickAway = event => {
|
|
83
|
+
if (event.target && (target === event.target || target != null && target.contains(event.target))) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
onClose(event);
|
|
87
|
+
};
|
|
72
88
|
return /*#__PURE__*/_jsx(GridMenuRoot, _extends({
|
|
73
89
|
as: rootProps.slots.basePopper,
|
|
74
90
|
className: clsx(className, classes.root),
|
|
@@ -82,7 +98,7 @@ function GridMenu(props) {
|
|
|
82
98
|
TransitionProps,
|
|
83
99
|
placement
|
|
84
100
|
}) => /*#__PURE__*/_jsx(ClickAwayListener, {
|
|
85
|
-
onClickAway:
|
|
101
|
+
onClickAway: handleClickAway,
|
|
86
102
|
mouseEvent: "onMouseDown",
|
|
87
103
|
children: /*#__PURE__*/_jsx(Grow, _extends({}, TransitionProps, {
|
|
88
104
|
style: {
|
|
@@ -102,7 +118,7 @@ process.env.NODE_ENV !== "production" ? GridMenu.propTypes = {
|
|
|
102
118
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
103
119
|
// ----------------------------------------------------------------------
|
|
104
120
|
children: PropTypes.node,
|
|
105
|
-
|
|
121
|
+
onClose: PropTypes.func.isRequired,
|
|
106
122
|
onExited: PropTypes.func,
|
|
107
123
|
/**
|
|
108
124
|
* If `true`, the component is shown.
|
|
@@ -1,7 +1,7 @@
|
|
|
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 { HTMLElementType } from '@mui/utils';
|
|
4
|
+
import { unstable_useEventCallback as useEventCallback, HTMLElementType } from '@mui/utils';
|
|
5
5
|
import { useGridApiContext } from '../../../hooks/utils/useGridApiContext';
|
|
6
6
|
import { GridMenu } from '../GridMenu';
|
|
7
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -17,13 +17,16 @@ function GridColumnHeaderMenu({
|
|
|
17
17
|
}) {
|
|
18
18
|
const apiRef = useGridApiContext();
|
|
19
19
|
const colDef = apiRef.current.getColumn(field);
|
|
20
|
-
const hideMenu =
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
const hideMenu = useEventCallback(event => {
|
|
21
|
+
if (event) {
|
|
22
|
+
// Prevent triggering the sorting
|
|
23
|
+
event.stopPropagation();
|
|
24
|
+
if (target != null && target.contains(event.target)) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
25
27
|
}
|
|
26
|
-
|
|
28
|
+
apiRef.current.hideColumnMenu();
|
|
29
|
+
});
|
|
27
30
|
if (!target || !colDef) {
|
|
28
31
|
return null;
|
|
29
32
|
}
|
|
@@ -31,7 +34,7 @@ function GridColumnHeaderMenu({
|
|
|
31
34
|
placement: `bottom-${colDef.align === 'right' ? 'start' : 'end'}`,
|
|
32
35
|
open: open,
|
|
33
36
|
target: target,
|
|
34
|
-
|
|
37
|
+
onClose: hideMenu,
|
|
35
38
|
onExited: onExited,
|
|
36
39
|
children: /*#__PURE__*/_jsx(ContentComponent, _extends({
|
|
37
40
|
colDef: colDef,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["item", "applyValue", "apiRef", "focusElementRef", "isFilterActive", "clearButton", "tabIndex", "label"];
|
|
3
|
+
const _excluded = ["item", "applyValue", "apiRef", "focusElementRef", "isFilterActive", "clearButton", "tabIndex", "label", "InputLabelProps"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { refType, unstable_useId as useId } from '@mui/utils';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "getOptionLabel", "getOptionValue", "placeholder", "tabIndex", "label", "isFilterActive", "clearButton"];
|
|
3
|
+
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "getOptionLabel", "getOptionValue", "placeholder", "tabIndex", "label", "isFilterActive", "clearButton", "InputLabelProps"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { unstable_useId as useId } from '@mui/utils';
|
|
@@ -56,12 +56,7 @@ export const GridToolbarDensitySelector = /*#__PURE__*/React.forwardRef(function
|
|
|
56
56
|
setOpen(prevOpen => !prevOpen);
|
|
57
57
|
onClick == null || onClick(event);
|
|
58
58
|
};
|
|
59
|
-
const
|
|
60
|
-
var _buttonRef$current;
|
|
61
|
-
if (buttonRef.current === event.target || // if user clicked on the icon
|
|
62
|
-
(_buttonRef$current = buttonRef.current) != null && _buttonRef$current.contains(event.target)) {
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
59
|
+
const handleDensitySelectorClose = () => {
|
|
65
60
|
setOpen(false);
|
|
66
61
|
};
|
|
67
62
|
const handleDensityUpdate = newDensity => {
|
|
@@ -105,7 +100,7 @@ export const GridToolbarDensitySelector = /*#__PURE__*/React.forwardRef(function
|
|
|
105
100
|
})), /*#__PURE__*/_jsx(GridMenu, {
|
|
106
101
|
open: open,
|
|
107
102
|
target: buttonRef.current,
|
|
108
|
-
|
|
103
|
+
onClose: handleDensitySelectorClose,
|
|
109
104
|
position: "bottom-start",
|
|
110
105
|
children: /*#__PURE__*/_jsx(MenuList, {
|
|
111
106
|
id: densityMenuId,
|
|
@@ -38,14 +38,6 @@ export const GridToolbarExportContainer = /*#__PURE__*/React.forwardRef(function
|
|
|
38
38
|
handleMenuClose();
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
|
-
const handleMenuClickAway = event => {
|
|
42
|
-
var _buttonRef$current;
|
|
43
|
-
if (buttonRef.current === event.target || // if user clicked on the icon
|
|
44
|
-
(_buttonRef$current = buttonRef.current) != null && _buttonRef$current.contains(event.target)) {
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
setOpen(false);
|
|
48
|
-
};
|
|
49
41
|
if (children == null) {
|
|
50
42
|
return null;
|
|
51
43
|
}
|
|
@@ -66,7 +58,7 @@ export const GridToolbarExportContainer = /*#__PURE__*/React.forwardRef(function
|
|
|
66
58
|
})), /*#__PURE__*/_jsx(GridMenu, {
|
|
67
59
|
open: open,
|
|
68
60
|
target: buttonRef.current,
|
|
69
|
-
|
|
61
|
+
onClose: handleMenuClose,
|
|
70
62
|
position: "bottom-start",
|
|
71
63
|
children: /*#__PURE__*/_jsx(MenuList, {
|
|
72
64
|
id: exportMenuId,
|
|
@@ -4,6 +4,7 @@ import * as ReactDOM from 'react-dom';
|
|
|
4
4
|
import { unstable_useForkRef as useForkRef } from '@mui/utils';
|
|
5
5
|
import { styled, useTheme } from '@mui/system';
|
|
6
6
|
import { defaultMemoize } from 'reselect';
|
|
7
|
+
import { useGridSelector } from '../../utils';
|
|
7
8
|
import { useGridPrivateApiContext } from '../../utils/useGridPrivateApiContext';
|
|
8
9
|
import { useGridRootProps } from '../../utils/useGridRootProps';
|
|
9
10
|
import { useGridApiEventHandler } from '../../utils/useGridApiEventHandler';
|
|
@@ -11,6 +12,7 @@ import { GridColumnHeaderItem } from '../../../components/columnHeaders/GridColu
|
|
|
11
12
|
import { getFirstColumnIndexToRender, getTotalHeaderHeight } from '../columns/gridColumnsUtils';
|
|
12
13
|
import { useGridVisibleRows } from '../../utils/useGridVisibleRows';
|
|
13
14
|
import { areRenderContextsEqual, getRenderableIndexes } from '../virtualization/useGridVirtualScroller';
|
|
15
|
+
import { gridVirtualizationColumnEnabledSelector } from '../virtualization';
|
|
14
16
|
import { GridColumnGroupHeader } from '../../../components/columnHeaders/GridColumnGroupHeader';
|
|
15
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
18
|
const GridColumnHeaderRow = styled('div', {
|
|
@@ -46,6 +48,7 @@ export const useGridColumnHeaders = props => {
|
|
|
46
48
|
const [dragCol, setDragCol] = React.useState('');
|
|
47
49
|
const [resizeCol, setResizeCol] = React.useState('');
|
|
48
50
|
const apiRef = useGridPrivateApiContext();
|
|
51
|
+
const hasVirtualization = useGridSelector(apiRef, gridVirtualizationColumnEnabledSelector);
|
|
49
52
|
const rootProps = useGridRootProps();
|
|
50
53
|
const innerRef = React.useRef(null);
|
|
51
54
|
const handleInnerRef = useForkRef(innerRefProp, innerRef);
|
|
@@ -164,7 +167,7 @@ export const useGridColumnHeaders = props => {
|
|
|
164
167
|
maxLastIndex: currentPage.rows.length,
|
|
165
168
|
buffer: rootProps.rowBuffer
|
|
166
169
|
});
|
|
167
|
-
const firstColumnToRender = getFirstColumnIndexToRenderRef.current({
|
|
170
|
+
const firstColumnToRender = !hasVirtualization ? 0 : getFirstColumnIndexToRenderRef.current({
|
|
168
171
|
firstColumnIndex: nextRenderContext.firstColumnIndex,
|
|
169
172
|
minColumnIndex: minFirstColumn,
|
|
170
173
|
columnBuffer: rootProps.columnBuffer,
|
|
@@ -173,7 +176,7 @@ export const useGridColumnHeaders = props => {
|
|
|
173
176
|
lastRowToRender,
|
|
174
177
|
visibleRows: currentPage.rows
|
|
175
178
|
});
|
|
176
|
-
const lastColumnToRender = Math.min(nextRenderContext.lastColumnIndex + rootProps.columnBuffer, maxLastColumn);
|
|
179
|
+
const lastColumnToRender = !hasVirtualization ? maxLastColumn : Math.min(nextRenderContext.lastColumnIndex + rootProps.columnBuffer, maxLastColumn);
|
|
177
180
|
const renderedColumns = visibleColumns.slice(firstColumnToRender, lastColumnToRender);
|
|
178
181
|
return {
|
|
179
182
|
renderedColumns,
|