@mui/x-data-grid 8.18.0 → 8.20.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.
Files changed (162) hide show
  1. package/CHANGELOG.md +175 -0
  2. package/DataGrid/useDataGridComponent.js +4 -3
  3. package/components/GridRow.js +5 -2
  4. package/components/GridRowDragAndDropOverlay.d.ts +7 -0
  5. package/components/GridRowDragAndDropOverlay.js +73 -0
  6. package/components/cell/GridActionsCell.d.ts +9 -0
  7. package/components/cell/GridActionsCell.js +54 -34
  8. package/components/cell/GridBooleanCell.js +0 -10
  9. package/components/cell/GridCell.js +4 -10
  10. package/components/columnHeaders/GridColumnHeaderItem.js +2 -2
  11. package/components/columnSelection/GridCellCheckboxRenderer.js +37 -22
  12. package/components/containers/GridRootStyles.js +17 -40
  13. package/components/toolbarV8/Toolbar.js +1 -1
  14. package/components/virtualization/GridVirtualScrollbar.d.ts +1 -0
  15. package/components/virtualization/GridVirtualScrollbar.js +13 -8
  16. package/components/virtualization/GridVirtualScroller.js +2 -1
  17. package/components/virtualization/GridVirtualScrollerRenderZone.js +1 -1
  18. package/constants/dataGridPropsDefaultValues.js +2 -1
  19. package/constants/gridClasses.d.ts +0 -8
  20. package/constants/gridClasses.js +1 -1
  21. package/esm/DataGrid/useDataGridComponent.js +5 -4
  22. package/esm/components/GridRow.js +5 -2
  23. package/esm/components/GridRowDragAndDropOverlay.d.ts +7 -0
  24. package/esm/components/GridRowDragAndDropOverlay.js +66 -0
  25. package/esm/components/cell/GridActionsCell.d.ts +9 -0
  26. package/esm/components/cell/GridActionsCell.js +55 -34
  27. package/esm/components/cell/GridBooleanCell.js +0 -10
  28. package/esm/components/cell/GridCell.js +4 -10
  29. package/esm/components/columnHeaders/GridColumnHeaderItem.js +2 -2
  30. package/esm/components/columnSelection/GridCellCheckboxRenderer.js +37 -22
  31. package/esm/components/containers/GridRootStyles.js +17 -40
  32. package/esm/components/toolbarV8/Toolbar.js +1 -1
  33. package/esm/components/virtualization/GridVirtualScrollbar.d.ts +1 -0
  34. package/esm/components/virtualization/GridVirtualScrollbar.js +12 -7
  35. package/esm/components/virtualization/GridVirtualScroller.js +2 -1
  36. package/esm/components/virtualization/GridVirtualScrollerRenderZone.js +1 -1
  37. package/esm/constants/dataGridPropsDefaultValues.js +2 -1
  38. package/esm/constants/gridClasses.d.ts +0 -8
  39. package/esm/constants/gridClasses.js +1 -1
  40. package/esm/hooks/core/gridPropsSelectors.d.ts +2 -1
  41. package/esm/hooks/core/gridPropsSelectors.js +3 -0
  42. package/esm/hooks/core/pipeProcessing/gridPipeProcessingApi.d.ts +4 -3
  43. package/esm/hooks/core/useGridProps.js +8 -2
  44. package/esm/hooks/core/useGridVirtualizer.d.ts +80 -6
  45. package/esm/hooks/core/useGridVirtualizer.js +27 -12
  46. package/esm/hooks/features/columnGrouping/useGridColumnGrouping.js +6 -1
  47. package/esm/hooks/features/columnMenu/useGridColumnMenu.js +14 -4
  48. package/esm/hooks/features/columns/useGridColumnSpanning.js +9 -4
  49. package/esm/hooks/features/dataSource/useGridDataSourceBase.js +2 -2
  50. package/esm/hooks/features/dimensions/useGridDimensions.js +12 -6
  51. package/esm/hooks/features/editing/useGridCellEditing.js +1 -1
  52. package/esm/hooks/features/editing/useGridRowEditing.js +1 -1
  53. package/esm/hooks/features/export/serializers/csvSerializer.js +2 -4
  54. package/esm/hooks/features/export/useGridPrintExport.js +18 -18
  55. package/esm/hooks/features/filter/gridFilterUtils.js +5 -11
  56. package/esm/hooks/features/filter/index.d.ts +1 -1
  57. package/esm/hooks/features/filter/index.js +1 -1
  58. package/esm/hooks/features/filter/useGridFilter.d.ts +1 -1
  59. package/esm/hooks/features/filter/useGridFilter.js +3 -1
  60. package/esm/hooks/features/focus/useGridFocus.js +0 -1
  61. package/esm/hooks/features/keyboardNavigation/useGridKeyboardNavigation.d.ts +1 -1
  62. package/esm/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +189 -25
  63. package/esm/hooks/features/pagination/useGridPaginationMeta.js +3 -3
  64. package/esm/hooks/features/pagination/useGridPaginationModel.js +7 -4
  65. package/esm/hooks/features/pagination/useGridRowCount.js +31 -15
  66. package/esm/hooks/features/rowReorder/gridRowReorderInterfaces.d.ts +19 -0
  67. package/esm/hooks/features/rowReorder/gridRowReorderSelector.d.ts +20 -1
  68. package/esm/hooks/features/rowReorder/gridRowReorderSelector.js +19 -1
  69. package/esm/hooks/features/rowSelection/useGridRowSelection.js +17 -8
  70. package/esm/hooks/features/rowSelection/utils.d.ts +1 -0
  71. package/esm/hooks/features/rowSelection/utils.js +17 -4
  72. package/esm/hooks/features/rows/useGridRowSpanning.js +23 -60
  73. package/esm/hooks/features/rows/useGridRows.js +3 -1
  74. package/esm/hooks/features/rows/useGridRowsOverridableMethods.d.ts +1 -0
  75. package/esm/hooks/features/rows/useGridRowsOverridableMethods.js +57 -7
  76. package/esm/hooks/features/scroll/useGridScroll.js +2 -3
  77. package/esm/hooks/features/sorting/gridSortingUtils.js +1 -3
  78. package/esm/hooks/features/sorting/useGridSorting.d.ts +1 -1
  79. package/esm/hooks/features/sorting/useGridSorting.js +3 -1
  80. package/esm/hooks/features/virtualization/useGridVirtualization.js +24 -5
  81. package/esm/hooks/utils/useGridEvent.js +6 -2
  82. package/esm/hooks/utils/useGridSelector.js +2 -4
  83. package/esm/hooks/utils/useRunOncePerLoop.d.ts +4 -1
  84. package/esm/hooks/utils/useRunOncePerLoop.js +28 -18
  85. package/esm/index.js +1 -1
  86. package/esm/internals/index.d.ts +5 -4
  87. package/esm/internals/index.js +3 -3
  88. package/esm/material/index.js +1 -4
  89. package/esm/models/api/gridRowApi.d.ts +14 -1
  90. package/esm/models/api/index.d.ts +1 -1
  91. package/esm/models/api/index.js +0 -1
  92. package/esm/models/colDef/gridColDef.d.ts +14 -0
  93. package/esm/models/configuration/gridConfiguration.d.ts +2 -2
  94. package/esm/models/configuration/gridRowConfiguration.d.ts +6 -5
  95. package/esm/models/events/gridEventLookup.d.ts +5 -0
  96. package/esm/models/gridStateCommunity.d.ts +1 -1
  97. package/esm/models/params/gridCellParams.d.ts +0 -10
  98. package/esm/models/props/DataGridProps.d.ts +13 -6
  99. package/esm/utils/keyboardUtils.d.ts +1 -8
  100. package/esm/utils/keyboardUtils.js +0 -7
  101. package/hooks/core/gridPropsSelectors.d.ts +2 -1
  102. package/hooks/core/gridPropsSelectors.js +4 -1
  103. package/hooks/core/pipeProcessing/gridPipeProcessingApi.d.ts +4 -3
  104. package/hooks/core/useGridProps.js +8 -2
  105. package/hooks/core/useGridVirtualizer.d.ts +80 -6
  106. package/hooks/core/useGridVirtualizer.js +26 -11
  107. package/hooks/features/columnGrouping/useGridColumnGrouping.js +6 -1
  108. package/hooks/features/columnMenu/useGridColumnMenu.js +14 -4
  109. package/hooks/features/columns/useGridColumnSpanning.js +9 -4
  110. package/hooks/features/dataSource/useGridDataSourceBase.js +2 -2
  111. package/hooks/features/dimensions/useGridDimensions.js +12 -6
  112. package/hooks/features/editing/useGridCellEditing.js +1 -1
  113. package/hooks/features/editing/useGridRowEditing.js +1 -1
  114. package/hooks/features/export/serializers/csvSerializer.js +2 -4
  115. package/hooks/features/export/useGridPrintExport.js +18 -18
  116. package/hooks/features/filter/gridFilterUtils.js +5 -11
  117. package/hooks/features/filter/index.d.ts +1 -1
  118. package/hooks/features/filter/index.js +6 -0
  119. package/hooks/features/filter/useGridFilter.d.ts +1 -1
  120. package/hooks/features/filter/useGridFilter.js +3 -1
  121. package/hooks/features/focus/useGridFocus.js +0 -1
  122. package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.d.ts +1 -1
  123. package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +189 -25
  124. package/hooks/features/pagination/useGridPaginationMeta.js +2 -2
  125. package/hooks/features/pagination/useGridPaginationModel.js +7 -4
  126. package/hooks/features/pagination/useGridRowCount.js +30 -14
  127. package/hooks/features/rowReorder/gridRowReorderInterfaces.d.ts +19 -0
  128. package/hooks/features/rowReorder/gridRowReorderSelector.d.ts +20 -1
  129. package/hooks/features/rowReorder/gridRowReorderSelector.js +20 -2
  130. package/hooks/features/rowSelection/useGridRowSelection.js +17 -8
  131. package/hooks/features/rowSelection/utils.d.ts +1 -0
  132. package/hooks/features/rowSelection/utils.js +16 -3
  133. package/hooks/features/rows/useGridRowSpanning.js +23 -60
  134. package/hooks/features/rows/useGridRows.js +3 -1
  135. package/hooks/features/rows/useGridRowsOverridableMethods.d.ts +1 -0
  136. package/hooks/features/rows/useGridRowsOverridableMethods.js +57 -7
  137. package/hooks/features/scroll/useGridScroll.js +2 -3
  138. package/hooks/features/sorting/gridSortingUtils.js +1 -3
  139. package/hooks/features/sorting/useGridSorting.d.ts +1 -1
  140. package/hooks/features/sorting/useGridSorting.js +3 -1
  141. package/hooks/features/virtualization/useGridVirtualization.js +24 -5
  142. package/hooks/utils/useGridEvent.js +6 -2
  143. package/hooks/utils/useGridSelector.js +2 -4
  144. package/hooks/utils/useRunOncePerLoop.d.ts +4 -1
  145. package/hooks/utils/useRunOncePerLoop.js +27 -18
  146. package/index.js +1 -1
  147. package/internals/index.d.ts +5 -4
  148. package/internals/index.js +16 -9
  149. package/material/index.js +1 -4
  150. package/models/api/gridRowApi.d.ts +14 -1
  151. package/models/api/index.d.ts +1 -1
  152. package/models/api/index.js +0 -11
  153. package/models/colDef/gridColDef.d.ts +14 -0
  154. package/models/configuration/gridConfiguration.d.ts +2 -2
  155. package/models/configuration/gridRowConfiguration.d.ts +6 -5
  156. package/models/events/gridEventLookup.d.ts +5 -0
  157. package/models/gridStateCommunity.d.ts +1 -1
  158. package/models/params/gridCellParams.d.ts +0 -10
  159. package/models/props/DataGridProps.d.ts +13 -6
  160. package/package.json +3 -3
  161. package/utils/keyboardUtils.d.ts +1 -8
  162. package/utils/keyboardUtils.js +1 -13
@@ -12,13 +12,19 @@ export const propsStateInitializer = (state, props) => {
12
12
  });
13
13
  };
14
14
  export const useGridProps = (apiRef, props) => {
15
+ const isFirstRender = React.useRef(true);
15
16
  React.useEffect(() => {
17
+ if (isFirstRender.current) {
18
+ isFirstRender.current = false;
19
+ return;
20
+ }
16
21
  apiRef.current.setState(state => _extends({}, state, {
17
22
  props: {
18
23
  listView: props.listView,
19
24
  getRowId: props.getRowId,
20
- isCellEditable: props.isCellEditable
25
+ isCellEditable: props.isCellEditable,
26
+ isRowSelectable: props.isRowSelectable
21
27
  }
22
28
  }));
23
- }, [apiRef, props.listView, props.getRowId, props.isCellEditable]);
29
+ }, [apiRef, props.listView, props.getRowId, props.isCellEditable, props.isRowSelectable]);
24
30
  };
@@ -1,9 +1,83 @@
1
- import { RefObject } from '@mui/x-internals/types';
2
- import { GridPrivateApiCommunity } from "../../models/api/gridApiCommunity.js";
3
- import { DataGridProcessedProps } from "../../models/props/DataGridProps.js";
4
- type RootProps = DataGridProcessedProps;
1
+ import * as React from 'react';
2
+ import { Dimensions, Virtualization } from '@mui/x-virtualizer';
5
3
  /**
6
4
  * Virtualizer setup
7
5
  */
8
- export declare function useGridVirtualizer(apiRef: RefObject<GridPrivateApiCommunity>, rootProps: RootProps): void;
9
- export {};
6
+ export declare function useGridVirtualizer(): {
7
+ store: import("@mui/x-internals/store").Store<Dimensions.State & Virtualization.State & import("@mui/x-virtualizer").Colspan.State & import("@mui/x-virtualizer").Rowspan.State>;
8
+ api: {
9
+ updateDimensions: (firstUpdate?: boolean) => void;
10
+ debouncedUpdateDimensions: (((firstUpdate?: boolean) => void) & import("@mui/x-internals/throttle").Cancelable) | undefined;
11
+ rowsMeta: {
12
+ getRowHeight: (rowId: import("@mui/x-virtualizer/models").RowId) => any;
13
+ setLastMeasuredRowIndex: (index: number) => void;
14
+ storeRowHeightMeasurement: (id: import("@mui/x-virtualizer/models").RowId, height: number) => void;
15
+ hydrateRowsMeta: () => void;
16
+ observeRowHeight: (element: Element, rowId: import("@mui/x-virtualizer/models").RowId) => () => void | undefined;
17
+ rowHasAutoHeight: (id: import("@mui/x-virtualizer/models").RowId) => any;
18
+ getRowHeightEntry: (rowId: import("@mui/x-virtualizer/models").RowId) => any;
19
+ getLastMeasuredRowIndex: () => number;
20
+ resetRowHeights: () => void;
21
+ };
22
+ } & {
23
+ getters: {
24
+ setPanels: React.Dispatch<React.SetStateAction<Readonly<Map<any, React.ReactNode>>>>;
25
+ getOffsetTop: () => number;
26
+ getRows: (rowParams?: {
27
+ rows?: import("@mui/x-virtualizer/models").RowEntry[];
28
+ position?: import("@mui/x-virtualizer/models").PinnedRowPosition;
29
+ renderContext?: import("@mui/x-virtualizer/models").RenderContext;
30
+ }, unstable_rowTree?: Record<import("@mui/x-virtualizer/models").RowId, any>) => React.ReactNode[];
31
+ rows: import("@mui/x-virtualizer/models").RowEntry[];
32
+ getContainerProps: () => {
33
+ ref: (node: HTMLDivElement | null) => (() => void | undefined) | undefined;
34
+ };
35
+ getScrollerProps: () => {
36
+ ref: (node: HTMLDivElement | null) => (() => void | undefined) | undefined;
37
+ style: React.CSSProperties;
38
+ role: string;
39
+ tabIndex: number | undefined;
40
+ };
41
+ getContentProps: () => {
42
+ ref: (node: HTMLDivElement | null) => void;
43
+ style: React.CSSProperties;
44
+ role: string;
45
+ };
46
+ getScrollbarVerticalProps: () => {
47
+ ref: (node: HTMLDivElement | null) => void;
48
+ scrollPosition: React.RefObject<{
49
+ top: number;
50
+ left: number;
51
+ }>;
52
+ };
53
+ getScrollbarHorizontalProps: () => {
54
+ ref: (node: HTMLDivElement | null) => void;
55
+ scrollPosition: React.RefObject<{
56
+ top: number;
57
+ left: number;
58
+ }>;
59
+ };
60
+ getScrollAreaProps: () => {
61
+ scrollPosition: React.RefObject<{
62
+ top: number;
63
+ left: number;
64
+ }>;
65
+ };
66
+ };
67
+ useVirtualization: () => import("@mui/x-virtualizer").BaseState;
68
+ setPanels: React.Dispatch<React.SetStateAction<Readonly<Map<any, React.ReactNode>>>>;
69
+ forceUpdateRenderContext: () => void;
70
+ scheduleUpdateRenderContext: () => void;
71
+ getCellColSpanInfo: (rowId: import("@mui/x-virtualizer/models").RowId, columnIndex: import("@mui/x-internals/types").integer) => import("@mui/x-virtualizer/models").CellColSpanInfo;
72
+ calculateColSpan: (rowId: import("@mui/x-virtualizer/models").RowId, minFirstColumn: import("@mui/x-internals/types").integer, maxLastColumn: import("@mui/x-internals/types").integer, columns: import("@mui/x-virtualizer/models").ColumnWithWidth[]) => void;
73
+ getHiddenCellsOrigin: () => Record<import("@mui/x-virtualizer/models").RowId, Record<number, number>>;
74
+ } & {
75
+ resetColSpan: () => void;
76
+ getCellColSpanInfo: (rowId: import("@mui/x-virtualizer/models").RowId, columnIndex: import("@mui/x-internals/types").integer) => import("@mui/x-virtualizer/models").CellColSpanInfo | undefined;
77
+ calculateColSpan: (rowId: import("@mui/x-virtualizer/models").RowId, minFirstColumn: import("@mui/x-internals/types").integer, maxLastColumn: import("@mui/x-internals/types").integer, columns: import("@mui/x-virtualizer/models").ColumnWithWidth[]) => void;
78
+ } & {
79
+ getHiddenCellsOrigin: () => Record<number, Record<number, number>>;
80
+ } & {
81
+ getViewportPageSize: () => number;
82
+ };
83
+ };
@@ -6,7 +6,7 @@ import { useRtl } from '@mui/system/RtlProvider';
6
6
  import { roundToDecimalPlaces } from '@mui/x-internals/math';
7
7
  import { lruMemoize } from '@mui/x-internals/lruMemoize';
8
8
  import { useStoreEffect } from '@mui/x-internals/store';
9
- import { useVirtualizer, Dimensions } from '@mui/x-virtualizer';
9
+ import { useVirtualizer, Dimensions, Virtualization, EMPTY_RENDER_CONTEXT } from '@mui/x-virtualizer';
10
10
  import { useFirstRender } from "../utils/useFirstRender.js";
11
11
  import { createSelector } from "../../utils/createSelector.js";
12
12
  import { useGridSelector } from "../utils/useGridSelector.js";
@@ -22,10 +22,11 @@ import { DATA_GRID_PROPS_DEFAULT_VALUES } from "../../constants/dataGridPropsDef
22
22
  import { getValidRowHeight, minimalContentHeight, rowHeightWarning } from "../features/rows/gridRowsUtils.js";
23
23
  import { getTotalHeaderHeight } from "../features/columns/gridColumnsUtils.js";
24
24
  import { useGridOverlays } from "../features/overlays/useGridOverlays.js";
25
+ import { useGridRootProps } from "../utils/useGridRootProps.js";
26
+ import { useGridPrivateApiContext } from "../utils/useGridPrivateApiContext.js";
27
+ import { useGridRowsMeta } from "../features/rows/useGridRowsMeta.js";
28
+ import { eslintUseValue } from "../../utils/utils.js";
25
29
  import { jsx as _jsx } from "react/jsx-runtime";
26
- function identity(x) {
27
- return x;
28
- }
29
30
  const columnsTotalWidthSelector = createSelector(gridVisibleColumnDefinitionsSelector, gridColumnPositionsSelector, (visibleColumns, positions) => {
30
31
  const colCount = visibleColumns.length;
31
32
  if (colCount === 0) {
@@ -49,8 +50,10 @@ const addGridDimensionsCreator = () => lruMemoize((dimensions, headerHeight, gro
49
50
  /**
50
51
  * Virtualizer setup
51
52
  */
52
- export function useGridVirtualizer(apiRef, rootProps) {
53
+ export function useGridVirtualizer() {
53
54
  const isRtl = useRtl();
55
+ const rootProps = useGridRootProps();
56
+ const apiRef = useGridPrivateApiContext();
54
57
  const {
55
58
  listView
56
59
  } = rootProps;
@@ -105,9 +108,11 @@ export function useGridVirtualizer(apiRef, rootProps) {
105
108
  } = rootProps;
106
109
  // </ROWS_META>
107
110
 
108
- const focusedVirtualCell = useGridSelector(apiRef, gridFocusedVirtualCellSelector);
109
111
  const RowSlot = rootProps.slots.row;
110
112
  const rowSlotProps = rootProps.slotProps?.row;
113
+ const focusedVirtualCell = useGridSelector(apiRef, gridFocusedVirtualCellSelector);
114
+ // We need it to trigger a new render, but rowsMeta needs access to the latest value, hence we cannot pass it to the focusedVirtualCell callback in the virtualizer params
115
+ eslintUseValue(focusedVirtualCell);
111
116
  const virtualizer = useVirtualizer({
112
117
  refs: {
113
118
  container: apiRef.current.mainElementRef,
@@ -171,7 +176,7 @@ export function useGridVirtualizer(apiRef, rootProps) {
171
176
  } : undefined, [apiRef, getRowSpacing, currentPage.rows, currentPage.rowIdToIndexMap]),
172
177
  applyRowHeight: useEventCallback((entry, row) => apiRef.current.unstable_applyPipeProcessors('rowHeight', entry, row)),
173
178
  virtualizeColumnsWithAutoRowHeight: rootProps.virtualizeColumnsWithAutoRowHeight,
174
- focusedVirtualCell: useEventCallback(() => focusedVirtualCell),
179
+ focusedVirtualCell: useEventCallback(() => gridFocusedVirtualCellSelector(apiRef)),
175
180
  resizeThrottleMs: rootProps.resizeThrottleMs,
176
181
  onResize: useEventCallback(size => apiRef.current.publishEvent('resize', size)),
177
182
  onWheel: useEventCallback(event => {
@@ -227,23 +232,33 @@ export function useGridVirtualizer(apiRef, rootProps) {
227
232
  apiRef.current.store.state.virtualization = virtualizer.store.state.virtualization;
228
233
  });
229
234
  useStoreEffect(virtualizer.store, Dimensions.selectors.dimensions, (_, dimensions) => {
235
+ if (!dimensions.isReady) {
236
+ return;
237
+ }
230
238
  apiRef.current.setState(gridState => _extends({}, gridState, {
231
239
  dimensions: addGridDimensions(dimensions, headerHeight, groupHeaderHeight, headerFilterHeight, headersTotalHeight)
232
240
  }));
233
241
  });
234
- useStoreEffect(virtualizer.store, identity, (_, state) => {
235
- if (state.rowsMeta !== apiRef.current.state.rowsMeta) {
242
+ useStoreEffect(virtualizer.store, Dimensions.selectors.rowsMeta, (_, rowsMeta) => {
243
+ if (rowsMeta !== apiRef.current.state.rowsMeta) {
236
244
  apiRef.current.setState(gridState => _extends({}, gridState, {
237
- rowsMeta: state.rowsMeta
245
+ rowsMeta
238
246
  }));
239
247
  }
240
- if (state.virtualization !== apiRef.current.state.virtualization) {
248
+ });
249
+ useStoreEffect(virtualizer.store, Virtualization.selectors.store, (_, virtualization) => {
250
+ if (virtualization.renderContext === EMPTY_RENDER_CONTEXT) {
251
+ return;
252
+ }
253
+ if (virtualization !== apiRef.current.state.virtualization) {
241
254
  apiRef.current.setState(gridState => _extends({}, gridState, {
242
- virtualization: state.virtualization
255
+ virtualization
243
256
  }));
244
257
  }
245
258
  });
246
259
  apiRef.current.register('private', {
247
260
  virtualizer
248
261
  });
262
+ useGridRowsMeta(apiRef, rootProps);
263
+ return virtualizer;
249
264
  }
@@ -12,7 +12,9 @@ export const columnGroupsStateInitializer = (state, props, apiRef) => {
12
12
  lastColumnGroupingModel: props.columnGroupingModel
13
13
  };
14
14
  if (!props.columnGroupingModel) {
15
- return state;
15
+ return _extends({}, state, {
16
+ columnGrouping: undefined
17
+ });
16
18
  }
17
19
  const columnFields = gridColumnFieldsSelector(apiRef);
18
20
  const visibleColumnFields = gridVisibleColumnFieldsSelector(apiRef);
@@ -65,6 +67,9 @@ export const useGridColumnGrouping = (apiRef, props) => {
65
67
  });
66
68
  }, [apiRef, props.columnGroupingModel]);
67
69
  const updateColumnGroupingState = React.useCallback(columnGroupingModel => {
70
+ if (!columnGroupingModel && !apiRef.current.caches.columnGrouping.lastColumnGroupingModel) {
71
+ return;
72
+ }
68
73
  apiRef.current.caches.columnGrouping.lastColumnGroupingModel = columnGroupingModel;
69
74
  // @ts-expect-error Move this logic to `Pro` package
70
75
  const pinnedColumns = apiRef.current.getPinnedColumns?.() ?? {};
@@ -15,6 +15,16 @@ export const columnMenuStateInitializer = state => _extends({}, state, {
15
15
  */
16
16
  export const useGridColumnMenu = apiRef => {
17
17
  const logger = useGridLogger(apiRef, 'useGridColumnMenu');
18
+ const subscriptionRefs = React.useRef({});
19
+ const unsubscribeFromScrollChange = React.useCallback(() => {
20
+ subscriptionRefs.current.wheel?.();
21
+ subscriptionRefs.current.touchMove?.();
22
+ }, []);
23
+ const subscribeToScrollChange = React.useCallback(() => {
24
+ unsubscribeFromScrollChange();
25
+ subscriptionRefs.current.wheel = apiRef.current.subscribeEvent('virtualScrollerWheel', apiRef.current.hideColumnMenu);
26
+ subscriptionRefs.current.touchMove = apiRef.current.subscribeEvent('virtualScrollerTouchMove', apiRef.current.hideColumnMenu);
27
+ }, [apiRef, unsubscribeFromScrollChange]);
18
28
 
19
29
  /**
20
30
  * API METHODS
@@ -32,6 +42,7 @@ export const useGridColumnMenu = apiRef => {
32
42
  return state;
33
43
  }
34
44
  logger.debug('Opening Column Menu');
45
+ subscribeToScrollChange();
35
46
  return _extends({}, state, {
36
47
  columnMenu: {
37
48
  open: true,
@@ -41,7 +52,7 @@ export const useGridColumnMenu = apiRef => {
41
52
  });
42
53
  apiRef.current.hidePreferences();
43
54
  }
44
- }, [apiRef, logger]);
55
+ }, [apiRef, logger, subscribeToScrollChange]);
45
56
  const hideColumnMenu = React.useCallback(() => {
46
57
  const columnMenuState = gridColumnMenuSelector(apiRef);
47
58
  if (columnMenuState.field) {
@@ -77,12 +88,13 @@ export const useGridColumnMenu = apiRef => {
77
88
  if (shouldUpdate) {
78
89
  apiRef.current.setState(state => {
79
90
  logger.debug('Hiding Column Menu');
91
+ unsubscribeFromScrollChange();
80
92
  return _extends({}, state, {
81
93
  columnMenu: newState
82
94
  });
83
95
  });
84
96
  }
85
- }, [apiRef, logger]);
97
+ }, [apiRef, logger, unsubscribeFromScrollChange]);
86
98
  const toggleColumnMenu = React.useCallback(field => {
87
99
  logger.debug('Toggle Column Menu');
88
100
  const columnMenu = gridColumnMenuSelector(apiRef);
@@ -99,6 +111,4 @@ export const useGridColumnMenu = apiRef => {
99
111
  };
100
112
  useGridApiMethod(apiRef, columnMenuApi, 'public');
101
113
  useGridEvent(apiRef, 'columnResizeStart', hideColumnMenu);
102
- useGridEvent(apiRef, 'virtualScrollerWheel', apiRef.current.hideColumnMenu);
103
- useGridEvent(apiRef, 'virtualScrollerTouchMove', apiRef.current.hideColumnMenu);
104
114
  };
@@ -5,10 +5,15 @@ import { useGridEvent } from "../../utils/useGridEvent.js";
5
5
  * @requires useGridParamsApi (method)
6
6
  */
7
7
  export const useGridColumnSpanning = apiRef => {
8
- const virtualizer = apiRef.current.virtualizer;
9
- const resetColSpan = virtualizer.api.resetColSpan;
10
- const getCellColSpanInfo = virtualizer.api.getCellColSpanInfo;
11
- const calculateColSpan = virtualizer.api.calculateColSpan;
8
+ const resetColSpan = () => {
9
+ return apiRef.current.virtualizer.api.resetColSpan();
10
+ };
11
+ const getCellColSpanInfo = (...params) => {
12
+ return apiRef.current.virtualizer.api.getCellColSpanInfo(...params);
13
+ };
14
+ const calculateColSpan = (...params) => {
15
+ apiRef.current.virtualizer.api.calculateColSpan(...params);
16
+ };
12
17
  const columnSpanningPublicApi = {
13
18
  unstable_getCellColSpanInfo: getCellColSpanInfo
14
19
  };
@@ -115,7 +115,7 @@ export const useGridDataSourceBase = (apiRef, props, options = {}) => {
115
115
  params: fetchParams,
116
116
  cause: originalError
117
117
  }));
118
- } else if (process.env.NODE_ENV !== 'production') {
118
+ } else {
119
119
  warnOnce(['MUI X: A call to `dataSource.getRows()` threw an error which was not handled because `onDataSourceError()` is missing.', 'To handle the error pass a callback to the `onDataSourceError` prop, for example `<DataGrid onDataSourceError={(error) => ...} />`.', 'For more detail, see https://mui.com/x/react-data-grid/server-side-data/#error-handling.'], 'error');
120
120
  }
121
121
  }
@@ -170,7 +170,7 @@ export const useGridDataSourceBase = (apiRef, props, options = {}) => {
170
170
  params,
171
171
  cause: errorThrown
172
172
  }));
173
- } else if (process.env.NODE_ENV !== 'production') {
173
+ } else {
174
174
  warnOnce(['MUI X: A call to `dataSource.updateRow()` threw an error which was not handled because `onDataSourceError()` is missing.', 'To handle the error pass a callback to the `onDataSourceError` prop, for example `<DataGrid onDataSourceError={(error) => ...} />`.', 'For more detail, see https://mui.com/x/react-data-grid/server-side-data/#error-handling.'], 'error');
175
175
  }
176
176
  throw errorThrown; // Let the caller handle the error further
@@ -44,8 +44,10 @@ const EMPTY_DIMENSIONS = {
44
44
  export const dimensionsStateInitializer = (state, props, apiRef) => {
45
45
  const dimensions = EMPTY_DIMENSIONS;
46
46
  const density = gridDensityFactorSelector(apiRef);
47
+ const dimensionsWithStatic = _extends({}, dimensions, getStaticDimensions(props, apiRef, density, gridVisiblePinnedColumnDefinitionsSelector(apiRef)));
48
+ apiRef.current.store.state.dimensions = dimensionsWithStatic;
47
49
  return _extends({}, state, {
48
- dimensions: _extends({}, dimensions, getStaticDimensions(props, apiRef, density, gridVisiblePinnedColumnDefinitionsSelector(apiRef)))
50
+ dimensions: dimensionsWithStatic
49
51
  });
50
52
  };
51
53
  const columnsTotalWidthSelector = createSelector(gridVisibleColumnDefinitionsSelector, gridColumnPositionsSelector, (visibleColumns, positions) => {
@@ -56,16 +58,17 @@ const columnsTotalWidthSelector = createSelector(gridVisibleColumnDefinitionsSel
56
58
  return roundToDecimalPlaces(positions[colCount - 1] + visibleColumns[colCount - 1].computedWidth, 1);
57
59
  });
58
60
  export function useGridDimensions(apiRef, props) {
59
- const virtualizer = apiRef.current.virtualizer;
60
- const updateDimensions = virtualizer.api.updateDimensions;
61
- const getViewportPageSize = virtualizer.api.getViewportPageSize;
62
61
  const getRootDimensions = React.useCallback(() => gridDimensionsSelector(apiRef), [apiRef]);
63
62
  const apiPublic = {
64
63
  getRootDimensions
65
64
  };
66
65
  const apiPrivate = {
67
- updateDimensions,
68
- getViewportPageSize
66
+ updateDimensions: () => {
67
+ return apiRef.current.virtualizer.api.updateDimensions();
68
+ },
69
+ getViewportPageSize: () => {
70
+ return apiRef.current.virtualizer.api.getViewportPageSize();
71
+ }
69
72
  };
70
73
  useGridApiMethod(apiRef, apiPublic, 'public');
71
74
  useGridApiMethod(apiRef, apiPrivate, 'private');
@@ -94,6 +97,9 @@ export function useGridDimensions(apiRef, props) {
94
97
  /* eslint-enable react-hooks/rules-of-hooks */
95
98
  }
96
99
  useStoreEffect(apiRef.current.store, s => s.dimensions, (previous, next) => {
100
+ if (!next.isReady) {
101
+ return;
102
+ }
97
103
  if (apiRef.current.rootElementRef.current) {
98
104
  setCSSVariables(apiRef.current.rootElementRef.current, next);
99
105
  }
@@ -364,7 +364,7 @@ export const useGridCellEditing = (apiRef, props) => {
364
364
  });
365
365
  if (onProcessRowUpdateError) {
366
366
  onProcessRowUpdateError(errorThrown);
367
- } else if (process.env.NODE_ENV !== 'production') {
367
+ } else {
368
368
  warnOnce(['MUI X: A call to `processRowUpdate()` threw an error which was not handled because `onProcessRowUpdateError()` is missing.', 'To handle the error pass a callback to the `onProcessRowUpdateError()` prop, for example `<DataGrid onProcessRowUpdateError={(error) => ...} />`.', 'For more detail, see https://mui.com/x/react-data-grid/editing/persistence/.'], 'error');
369
369
  }
370
370
  };
@@ -448,7 +448,7 @@ export const useGridRowEditing = (apiRef, props) => {
448
448
  }
449
449
  if (onProcessRowUpdateError) {
450
450
  onProcessRowUpdateError(errorThrown);
451
- } else if (process.env.NODE_ENV !== 'production') {
451
+ } else {
452
452
  warnOnce(['MUI X: A call to `processRowUpdate()` threw an error which was not handled because `onProcessRowUpdateError()` is missing.', 'To handle the error pass a callback to the `onProcessRowUpdateError()` prop, for example `<DataGrid onProcessRowUpdateError={(error) => ...} />`.', 'For more detail, see https://mui.com/x/react-data-grid/editing/persistence/.'], 'error');
453
453
  }
454
454
  };
@@ -76,10 +76,8 @@ const serializeRow = ({
76
76
  });
77
77
  columns.forEach(column => {
78
78
  const cellParams = getCellParams(id, column.field);
79
- if (process.env.NODE_ENV !== 'production') {
80
- if (String(cellParams.formattedValue) === '[object Object]') {
81
- warnOnce(['MUI X: When the value of a field is an object or a `renderCell` is provided, the CSV export might not display the value correctly.', 'You can provide a `valueFormatter` with a string representation to be used.']);
82
- }
79
+ if (String(cellParams.formattedValue) === '[object Object]') {
80
+ warnOnce(['MUI X: When the value of a field is an object or a `renderCell` is provided, the CSV export might not display the value correctly.', 'You can provide a `valueFormatter` with a string representation to be used.']);
83
81
  }
84
82
  row.addValue(serializeCellValue(cellParams, {
85
83
  ignoreValueFormatter,
@@ -9,15 +9,15 @@ import { gridExpandedRowCountSelector } from "../filter/gridFilterSelector.js";
9
9
  import { gridColumnDefinitionsSelector, gridColumnVisibilityModelSelector } from "../columns/gridColumnsSelector.js";
10
10
  import { gridClasses } from "../../../constants/gridClasses.js";
11
11
  import { useGridApiMethod } from "../../utils/useGridApiMethod.js";
12
- import { gridRowsMetaSelector } from "../rows/gridRowsMetaSelector.js";
13
12
  import { GRID_ID_AUTOGENERATED } from "../rows/gridRowsUtils.js";
14
13
  import { defaultGetRowsToExport, getColumnsToExport } from "./utils.js";
15
14
  import { getDerivedPaginationModel } from "../pagination/useGridPaginationModel.js";
16
15
  import { useGridRegisterPipeProcessor } from "../../core/pipeProcessing/index.js";
17
16
  import { GridPrintExportMenuItem } from "../../../components/toolbar/index.js";
18
- import { getTotalHeaderHeight } from "../columns/gridColumnsUtils.js";
19
17
  import { GRID_CHECKBOX_SELECTION_COL_DEF } from "../../../colDef/gridCheckboxSelectionColDef.js";
18
+ import { scrollbarSizeCssExpression } from "../../../components/virtualization/GridVirtualScrollbar.js";
20
19
  import { jsx as _jsx } from "react/jsx-runtime";
20
+ const DEBUG_MODE = false;
21
21
  function raf() {
22
22
  return new Promise(resolve => {
23
23
  requestAnimationFrame(() => {
@@ -30,6 +30,10 @@ function buildPrintWindow(title) {
30
30
  iframeEl.style.position = 'absolute';
31
31
  iframeEl.style.width = '0px';
32
32
  iframeEl.style.height = '0px';
33
+ if (DEBUG_MODE) {
34
+ iframeEl.style.width = '100%';
35
+ iframeEl.style.height = '10000px';
36
+ }
33
37
  iframeEl.title = title || document.title;
34
38
  return iframeEl;
35
39
  }
@@ -97,40 +101,36 @@ export const useGridPrintExport = (apiRef, props) => {
97
101
  if (!printDoc) {
98
102
  return;
99
103
  }
100
- const rowsMeta = gridRowsMetaSelector(apiRef);
101
104
  const gridRootElement = apiRef.current.rootElementRef.current;
102
105
  const gridClone = gridRootElement.cloneNode(true);
106
+ const virtualScrollerContent = gridClone.querySelector(`.${gridClasses.virtualScrollerContent}`);
103
107
 
104
108
  // Allow to overflow to not hide the border of the last row
105
109
  const gridMain = gridClone.querySelector(`.${gridClasses.main}`);
106
110
  gridMain.style.overflow = 'visible';
107
-
108
- // See https://support.google.com/chrome/thread/191619088?hl=en&msgid=193009642
109
- gridClone.style.contain = 'size';
110
- let gridToolbarElementHeight = gridRootElement.querySelector(`.${gridClasses.toolbar}`)?.offsetHeight || 0;
111
- let gridFooterElementHeight = gridRootElement.querySelector(`.${gridClasses.footerContainer}`)?.offsetHeight || 0;
111
+ gridClone.querySelector(`.${gridClasses.virtualScrollerRenderZone}`).style.position = 'static';
112
+ virtualScrollerContent.style.flexBasis = 'auto';
113
+ gridClone.querySelector(`.${gridClasses['scrollbar--vertical']}`)?.remove();
114
+ if (!(virtualScrollerContent.nextSibling instanceof HTMLElement && virtualScrollerContent.nextSibling.classList.contains(gridClasses.filler))) {
115
+ const filler = document.createElement('div');
116
+ filler.style.height = scrollbarSizeCssExpression;
117
+ virtualScrollerContent.insertAdjacentElement('afterend', filler);
118
+ }
112
119
  const gridFooterElement = gridClone.querySelector(`.${gridClasses.footerContainer}`);
113
120
  if (normalizeOptions.hideToolbar) {
114
121
  gridClone.querySelector(`.${gridClasses.toolbar}`)?.remove();
115
- gridToolbarElementHeight = 0;
116
122
  }
117
123
  if (normalizeOptions.hideFooter && gridFooterElement) {
118
124
  gridFooterElement.remove();
119
- gridFooterElementHeight = 0;
120
125
  }
121
-
122
- // Expand container height to accommodate all rows
123
- const computedTotalHeight = rowsMeta.currentPageTotalHeight + getTotalHeaderHeight(apiRef, props) + gridToolbarElementHeight + gridFooterElementHeight;
124
- gridClone.style.height = `${computedTotalHeight}px`;
126
+ gridClone.style.height = 'auto';
125
127
  // The height above does not include grid border width, so we need to exclude it
126
128
  gridClone.style.boxSizing = 'content-box';
127
129
  if (!normalizeOptions.hideFooter && gridFooterElement) {
128
130
  // the footer is always being placed at the bottom of the page as if all rows are exported
129
131
  // so if getRowsToExport is being used to only export a subset of rows then we need to
130
132
  // adjust the footer position to be correctly placed at the bottom of the grid
131
- gridFooterElement.style.position = 'absolute';
132
133
  gridFooterElement.style.width = '100%';
133
- gridFooterElement.style.top = `${computedTotalHeight - gridFooterElementHeight}px`;
134
134
  }
135
135
 
136
136
  // printDoc.body.appendChild(gridClone); should be enough but a clone isolation bug in Safari
@@ -158,13 +158,13 @@ export const useGridPrintExport = (apiRef, props) => {
158
158
  }
159
159
 
160
160
  // Trigger print
161
- if (process.env.NODE_ENV !== 'test') {
161
+ if (process.env.NODE_ENV !== 'test' && !DEBUG_MODE) {
162
162
  // wait for remote stylesheets to load
163
163
  Promise.all(stylesheetLoadPromises).then(() => {
164
164
  printWindow.contentWindow.print();
165
165
  });
166
166
  }
167
- }, [apiRef, doc, props]);
167
+ }, [apiRef, doc]);
168
168
  const handlePrintWindowAfterPrint = React.useCallback(printWindow => {
169
169
  // Remove the print iframe
170
170
  doc.current.body.removeChild(printWindow);
@@ -41,24 +41,18 @@ export const sanitizeFilterModel = (model, disableMultipleColumnsFiltering, apiR
41
41
  const hasSeveralItems = model.items.length > 1;
42
42
  let items;
43
43
  if (hasSeveralItems && disableMultipleColumnsFiltering) {
44
- if (process.env.NODE_ENV !== 'production') {
45
- warnOnce(['MUI X: The `filterModel` can only contain a single item when the `disableMultipleColumnsFiltering` prop is set to `true`.', 'If you are using the community version of the Data Grid, this prop is always `true`.'], 'error');
46
- }
44
+ warnOnce(['MUI X: The `filterModel` can only contain a single item when the `disableMultipleColumnsFiltering` prop is set to `true`.', 'If you are using the community version of the Data Grid, this prop is always `true`.'], 'error');
47
45
  items = [model.items[0]];
48
46
  } else {
49
47
  items = model.items;
50
48
  }
51
49
  const hasItemsWithoutIds = hasSeveralItems && items.some(item => item.id == null);
52
50
  const hasItemWithoutOperator = items.some(item => item.operator == null);
53
- if (process.env.NODE_ENV !== 'production') {
54
- if (hasItemsWithoutIds) {
55
- warnOnce('MUI X: The `id` field is required on `filterModel.items` when you use multiple filters.', 'error');
56
- }
51
+ if (hasItemsWithoutIds) {
52
+ warnOnce('MUI X: The `id` field is required on `filterModel.items` when you use multiple filters.', 'error');
57
53
  }
58
- if (process.env.NODE_ENV !== 'production') {
59
- if (hasItemWithoutOperator) {
60
- warnOnce('MUI X: The `operator` field is required on `filterModel.items`, one or more of your filtering item has no `operator` provided.', 'error');
61
- }
54
+ if (hasItemWithoutOperator) {
55
+ warnOnce('MUI X: The `operator` field is required on `filterModel.items`, one or more of your filtering item has no `operator` provided.', 'error');
62
56
  }
63
57
  if (hasItemWithoutOperator || hasItemsWithoutIds) {
64
58
  return _extends({}, model, {
@@ -1,4 +1,4 @@
1
1
  export type { GridFilterState, GridFilterInitialState } from "./gridFilterState.js";
2
2
  export { getDefaultGridFilterModel } from "./gridFilterState.js";
3
- export { gridFilterModelSelector, gridQuickFilterValuesSelector, gridVisibleRowsLookupSelector, gridFilteredRowsLookupSelector, gridFilteredDescendantCountLookupSelector, gridExpandedSortedRowEntriesSelector, gridExpandedSortedRowIdsSelector, gridFilteredSortedRowEntriesSelector, gridFilteredSortedRowIdsSelector, gridFilteredSortedTopLevelRowEntriesSelector, gridExpandedRowCountSelector, gridFilteredTopLevelRowCountSelector, gridFilteredRowCountSelector, gridFilteredDescendantRowCountSelector, gridFilterActiveItemsSelector, gridFilterActiveItemsLookupSelector } from "./gridFilterSelector.js";
3
+ export { gridFilterModelSelector, gridQuickFilterValuesSelector, gridVisibleRowsLookupSelector, gridFilteredRowsLookupSelector, gridFilteredDescendantCountLookupSelector, gridExpandedSortedRowEntriesSelector, gridExpandedSortedRowIdsSelector, gridFilteredSortedRowEntriesSelector, gridFilteredSortedRowIdsSelector, gridFilteredSortedTopLevelRowEntriesSelector, gridExpandedRowCountSelector, gridFilteredTopLevelRowCountSelector, gridFilteredRowCountSelector, gridFilteredDescendantRowCountSelector, gridFilterActiveItemsSelector, gridFilterActiveItemsLookupSelector, gridExpandedSortedRowIndexLookupSelector } from "./gridFilterSelector.js";
4
4
  export type { GridFilterActiveItemsLookup } from "./gridFilterSelector.js";
@@ -1,2 +1,2 @@
1
1
  export { getDefaultGridFilterModel } from "./gridFilterState.js";
2
- export { gridFilterModelSelector, gridQuickFilterValuesSelector, gridVisibleRowsLookupSelector, gridFilteredRowsLookupSelector, gridFilteredDescendantCountLookupSelector, gridExpandedSortedRowEntriesSelector, gridExpandedSortedRowIdsSelector, gridFilteredSortedRowEntriesSelector, gridFilteredSortedRowIdsSelector, gridFilteredSortedTopLevelRowEntriesSelector, gridExpandedRowCountSelector, gridFilteredTopLevelRowCountSelector, gridFilteredRowCountSelector, gridFilteredDescendantRowCountSelector, gridFilterActiveItemsSelector, gridFilterActiveItemsLookupSelector } from "./gridFilterSelector.js";
2
+ export { gridFilterModelSelector, gridQuickFilterValuesSelector, gridVisibleRowsLookupSelector, gridFilteredRowsLookupSelector, gridFilteredDescendantCountLookupSelector, gridExpandedSortedRowEntriesSelector, gridExpandedSortedRowIdsSelector, gridFilteredSortedRowEntriesSelector, gridFilteredSortedRowIdsSelector, gridFilteredSortedTopLevelRowEntriesSelector, gridExpandedRowCountSelector, gridFilteredTopLevelRowCountSelector, gridFilteredRowCountSelector, gridFilteredDescendantRowCountSelector, gridFilterActiveItemsSelector, gridFilterActiveItemsLookupSelector, gridExpandedSortedRowIndexLookupSelector } from "./gridFilterSelector.js";
@@ -9,4 +9,4 @@ export declare const filterStateInitializer: GridStateInitializer<Pick<DataGridP
9
9
  * @requires useGridParamsApi (method)
10
10
  * @requires useGridRows (event)
11
11
  */
12
- export declare const useGridFilter: (apiRef: RefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "rows" | "initialState" | "filterModel" | "getRowId" | "onFilterModelChange" | "filterMode" | "disableMultipleColumnsFiltering" | "slots" | "slotProps" | "disableColumnFilter" | "disableEval" | "ignoreDiacritics">, configuration: GridConfiguration) => void;
12
+ export declare const useGridFilter: (apiRef: RefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "rows" | "initialState" | "filterModel" | "getRowId" | "onFilterModelChange" | "filterMode" | "disableMultipleColumnsFiltering" | "slots" | "slotProps" | "disableColumnFilter" | "disableEval" | "ignoreDiacritics" | "signature">, configuration: GridConfiguration) => void;
@@ -354,7 +354,9 @@ export const useGridFilter = (apiRef, props, configuration) => {
354
354
  * 1ST RENDER
355
355
  */
356
356
  useFirstRender(() => {
357
- updateFilteredRows();
357
+ if (props.signature === 'DataGrid') {
358
+ updateFilteredRows();
359
+ }
358
360
  });
359
361
 
360
362
  /**
@@ -224,7 +224,6 @@ export const useGridFocus = (apiRef, props) => {
224
224
  apiRef.current.setCellFocus(id, field);
225
225
  }, [apiRef]);
226
226
  const handleCellKeyDown = React.useCallback((params, event) => {
227
- // GRID_CELL_NAVIGATION_KEY_DOWN handles the focus on Enter, Tab and navigation keys
228
227
  if (event.key === 'Enter' || event.key === 'Tab' || event.key === 'Shift' || isNavigationKey(event.key)) {
229
228
  return;
230
229
  }
@@ -10,4 +10,4 @@ import { DataGridProcessedProps } from "../../../models/props/DataGridProps.js";
10
10
  * @requires useGridScroll (method) - can be after
11
11
  * @requires useGridColumnSpanning (method) - can be after
12
12
  */
13
- export declare const useGridKeyboardNavigation: (apiRef: RefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "pagination" | "paginationMode" | "getRowId" | "signature" | "headerFilters">) => void;
13
+ export declare const useGridKeyboardNavigation: (apiRef: RefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "pagination" | "paginationMode" | "getRowId" | "signature" | "headerFilters" | "tabNavigation">) => void;