@mui/x-data-grid 7.23.2 → 7.23.4

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 (202) hide show
  1. package/CHANGELOG.md +86 -0
  2. package/DataGrid/DataGrid.js +7 -4
  3. package/README.md +1 -1
  4. package/components/GridColumnHeaders.d.ts +1 -1
  5. package/components/GridColumnHeaders.js +4 -4
  6. package/components/GridFooter.d.ts +2 -1
  7. package/components/GridFooter.js +4 -4
  8. package/components/GridLoadingOverlay.d.ts +1 -1
  9. package/components/GridLoadingOverlay.js +3 -2
  10. package/components/GridNoResultsOverlay.d.ts +2 -1
  11. package/components/GridNoResultsOverlay.js +4 -4
  12. package/components/GridNoRowsOverlay.d.ts +2 -1
  13. package/components/GridNoRowsOverlay.js +4 -4
  14. package/components/GridPagination.d.ts +1 -1
  15. package/components/GridPagination.js +5 -3
  16. package/components/GridRow.d.ts +1 -1
  17. package/components/GridRow.js +15 -3
  18. package/components/GridRowCount.d.ts +1 -1
  19. package/components/GridRowCount.js +3 -2
  20. package/components/GridSelectedRowCount.d.ts +4 -1
  21. package/components/GridSelectedRowCount.js +3 -2
  22. package/components/GridSkeletonLoadingOverlay.d.ts +1 -1
  23. package/components/GridSkeletonLoadingOverlay.js +4 -3
  24. package/components/cell/GridActionsCell.js +8 -1
  25. package/components/cell/GridActionsCellItem.d.ts +1 -1
  26. package/components/cell/GridActionsCellItem.js +3 -2
  27. package/components/cell/GridCell.d.ts +1 -1
  28. package/components/cell/GridCell.js +3 -2
  29. package/components/cell/GridEditInputCell.d.ts +1 -1
  30. package/components/cell/GridEditInputCell.js +72 -3
  31. package/components/columnHeaders/GridBaseColumnHeaders.d.ts +1 -1
  32. package/components/columnHeaders/GridBaseColumnHeaders.js +4 -3
  33. package/components/columnHeaders/GridColumnHeaderTitle.js +5 -3
  34. package/components/columnHeaders/GridGenericColumnHeaderItem.d.ts +1 -1
  35. package/components/columnHeaders/GridGenericColumnHeaderItem.js +3 -2
  36. package/components/columnHeaders/GridIconButtonContainer.d.ts +1 -1
  37. package/components/columnHeaders/GridIconButtonContainer.js +5 -3
  38. package/components/columnSelection/GridCellCheckboxRenderer.d.ts +2 -2
  39. package/components/columnSelection/GridCellCheckboxRenderer.js +6 -4
  40. package/components/columnSelection/GridHeaderCheckbox.d.ts +1 -1
  41. package/components/columnSelection/GridHeaderCheckbox.js +6 -4
  42. package/components/containers/GridFooterContainer.d.ts +1 -1
  43. package/components/containers/GridFooterContainer.js +5 -3
  44. package/components/containers/GridOverlay.d.ts +1 -1
  45. package/components/containers/GridOverlay.js +5 -3
  46. package/components/containers/GridRoot.d.ts +1 -1
  47. package/components/containers/GridRoot.js +5 -3
  48. package/components/containers/GridToolbarContainer.d.ts +1 -1
  49. package/components/containers/GridToolbarContainer.js +3 -2
  50. package/components/menu/columnMenu/GridColumnMenu.d.ts +2 -2
  51. package/components/menu/columnMenu/GridColumnMenu.js +5 -5
  52. package/components/menu/columnMenu/GridColumnMenuContainer.d.ts +1 -1
  53. package/components/menu/columnMenu/GridColumnMenuContainer.js +3 -2
  54. package/components/panel/GridPanel.d.ts +1 -1
  55. package/components/panel/GridPanel.js +3 -2
  56. package/components/panel/GridPanelWrapper.d.ts +1 -1
  57. package/components/panel/GridPanelWrapper.js +5 -3
  58. package/components/panel/filterPanel/GridFilterForm.d.ts +1 -1
  59. package/components/panel/filterPanel/GridFilterForm.js +3 -2
  60. package/components/panel/filterPanel/GridFilterInputValue.js +17 -10
  61. package/components/panel/filterPanel/GridFilterPanel.d.ts +1 -1
  62. package/components/panel/filterPanel/GridFilterPanel.js +4 -4
  63. package/components/toolbar/GridToolbar.d.ts +1 -1
  64. package/components/toolbar/GridToolbar.js +4 -4
  65. package/components/toolbar/GridToolbarColumnsButton.d.ts +1 -1
  66. package/components/toolbar/GridToolbarColumnsButton.js +3 -2
  67. package/components/toolbar/GridToolbarDensitySelector.d.ts +1 -1
  68. package/components/toolbar/GridToolbarDensitySelector.js +3 -2
  69. package/components/toolbar/GridToolbarExport.d.ts +1 -1
  70. package/components/toolbar/GridToolbarExport.js +2 -1
  71. package/components/toolbar/GridToolbarExportContainer.d.ts +1 -1
  72. package/components/toolbar/GridToolbarExportContainer.js +3 -2
  73. package/components/toolbar/GridToolbarFilterButton.d.ts +1 -1
  74. package/components/toolbar/GridToolbarFilterButton.js +3 -2
  75. package/components/virtualization/GridMainContainer.d.ts +3 -1
  76. package/components/virtualization/GridMainContainer.js +4 -3
  77. package/components/virtualization/GridVirtualScrollbar.d.ts +1 -1
  78. package/components/virtualization/GridVirtualScrollbar.js +2 -1
  79. package/components/virtualization/GridVirtualScrollerContent.d.ts +2 -0
  80. package/components/virtualization/GridVirtualScrollerContent.js +5 -5
  81. package/components/virtualization/GridVirtualScrollerRenderZone.d.ts +2 -0
  82. package/components/virtualization/GridVirtualScrollerRenderZone.js +5 -3
  83. package/hooks/features/columnHeaders/useGridColumnHeaders.js +10 -3
  84. package/hooks/features/columnResize/gridColumnResizeApi.d.ts +6 -0
  85. package/hooks/features/columnResize/gridColumnResizeApi.js +2 -1
  86. package/hooks/features/columnResize/useGridColumnResize.d.ts +1 -1
  87. package/hooks/features/columnResize/useGridColumnResize.js +9 -4
  88. package/hooks/features/columns/gridColumnsUtils.d.ts +1 -1
  89. package/hooks/features/columns/gridColumnsUtils.js +2 -1
  90. package/hooks/features/rows/useGridRowSpanning.js +13 -5
  91. package/hooks/features/virtualization/useGridVirtualScroller.js +11 -8
  92. package/index.js +1 -1
  93. package/internals/utils/useProps.js +3 -0
  94. package/locales/koKR.js +36 -39
  95. package/locales/nlNL.js +5 -6
  96. package/models/gridSlotsComponentsProps.d.ts +10 -0
  97. package/models/props/DataGridProps.d.ts +1 -0
  98. package/modern/DataGrid/DataGrid.js +7 -4
  99. package/modern/components/GridColumnHeaders.js +4 -4
  100. package/modern/components/GridFooter.js +4 -4
  101. package/modern/components/GridLoadingOverlay.js +3 -2
  102. package/modern/components/GridNoResultsOverlay.js +4 -4
  103. package/modern/components/GridNoRowsOverlay.js +4 -4
  104. package/modern/components/GridPagination.js +5 -3
  105. package/modern/components/GridRow.js +15 -3
  106. package/modern/components/GridRowCount.js +3 -2
  107. package/modern/components/GridSelectedRowCount.js +3 -2
  108. package/modern/components/GridSkeletonLoadingOverlay.js +4 -3
  109. package/modern/components/cell/GridActionsCell.js +8 -1
  110. package/modern/components/cell/GridActionsCellItem.js +3 -2
  111. package/modern/components/cell/GridCell.js +3 -2
  112. package/modern/components/cell/GridEditInputCell.js +72 -3
  113. package/modern/components/columnHeaders/GridBaseColumnHeaders.js +4 -3
  114. package/modern/components/columnHeaders/GridColumnHeaderTitle.js +5 -3
  115. package/modern/components/columnHeaders/GridGenericColumnHeaderItem.js +3 -2
  116. package/modern/components/columnHeaders/GridIconButtonContainer.js +5 -3
  117. package/modern/components/columnSelection/GridCellCheckboxRenderer.js +6 -4
  118. package/modern/components/columnSelection/GridHeaderCheckbox.js +6 -4
  119. package/modern/components/containers/GridFooterContainer.js +5 -3
  120. package/modern/components/containers/GridOverlay.js +5 -3
  121. package/modern/components/containers/GridRoot.js +5 -3
  122. package/modern/components/containers/GridToolbarContainer.js +3 -2
  123. package/modern/components/menu/columnMenu/GridColumnMenu.js +5 -5
  124. package/modern/components/menu/columnMenu/GridColumnMenuContainer.js +3 -2
  125. package/modern/components/panel/GridPanel.js +3 -2
  126. package/modern/components/panel/GridPanelWrapper.js +5 -3
  127. package/modern/components/panel/filterPanel/GridFilterForm.js +3 -2
  128. package/modern/components/panel/filterPanel/GridFilterInputValue.js +17 -10
  129. package/modern/components/panel/filterPanel/GridFilterPanel.js +4 -4
  130. package/modern/components/toolbar/GridToolbar.js +4 -4
  131. package/modern/components/toolbar/GridToolbarColumnsButton.js +3 -2
  132. package/modern/components/toolbar/GridToolbarDensitySelector.js +3 -2
  133. package/modern/components/toolbar/GridToolbarExport.js +2 -1
  134. package/modern/components/toolbar/GridToolbarExportContainer.js +3 -2
  135. package/modern/components/toolbar/GridToolbarFilterButton.js +3 -2
  136. package/modern/components/virtualization/GridMainContainer.js +4 -3
  137. package/modern/components/virtualization/GridVirtualScrollbar.js +2 -1
  138. package/modern/components/virtualization/GridVirtualScrollerContent.js +5 -5
  139. package/modern/components/virtualization/GridVirtualScrollerRenderZone.js +5 -3
  140. package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +10 -3
  141. package/modern/hooks/features/columnResize/gridColumnResizeApi.js +2 -1
  142. package/modern/hooks/features/columnResize/useGridColumnResize.js +9 -4
  143. package/modern/hooks/features/columns/gridColumnsUtils.js +2 -1
  144. package/modern/hooks/features/rows/useGridRowSpanning.js +13 -5
  145. package/modern/hooks/features/virtualization/useGridVirtualScroller.js +11 -8
  146. package/modern/index.js +1 -1
  147. package/modern/internals/utils/useProps.js +3 -0
  148. package/modern/locales/koKR.js +36 -39
  149. package/modern/locales/nlNL.js +5 -6
  150. package/node/DataGrid/DataGrid.js +7 -4
  151. package/node/components/GridColumnHeaders.js +4 -4
  152. package/node/components/GridFooter.js +4 -4
  153. package/node/components/GridLoadingOverlay.js +3 -2
  154. package/node/components/GridNoResultsOverlay.js +4 -4
  155. package/node/components/GridNoRowsOverlay.js +4 -4
  156. package/node/components/GridPagination.js +5 -3
  157. package/node/components/GridRow.js +15 -3
  158. package/node/components/GridRowCount.js +3 -2
  159. package/node/components/GridSelectedRowCount.js +3 -2
  160. package/node/components/GridSkeletonLoadingOverlay.js +4 -3
  161. package/node/components/cell/GridActionsCell.js +8 -1
  162. package/node/components/cell/GridActionsCellItem.js +3 -2
  163. package/node/components/cell/GridCell.js +3 -2
  164. package/node/components/cell/GridEditInputCell.js +72 -3
  165. package/node/components/columnHeaders/GridBaseColumnHeaders.js +4 -3
  166. package/node/components/columnHeaders/GridColumnHeaderTitle.js +5 -3
  167. package/node/components/columnHeaders/GridGenericColumnHeaderItem.js +3 -2
  168. package/node/components/columnHeaders/GridIconButtonContainer.js +5 -3
  169. package/node/components/columnSelection/GridCellCheckboxRenderer.js +6 -4
  170. package/node/components/columnSelection/GridHeaderCheckbox.js +6 -4
  171. package/node/components/containers/GridFooterContainer.js +5 -3
  172. package/node/components/containers/GridOverlay.js +5 -3
  173. package/node/components/containers/GridRoot.js +5 -3
  174. package/node/components/containers/GridToolbarContainer.js +3 -2
  175. package/node/components/menu/columnMenu/GridColumnMenu.js +5 -5
  176. package/node/components/menu/columnMenu/GridColumnMenuContainer.js +3 -2
  177. package/node/components/panel/GridPanel.js +3 -2
  178. package/node/components/panel/GridPanelWrapper.js +5 -3
  179. package/node/components/panel/filterPanel/GridFilterForm.js +3 -2
  180. package/node/components/panel/filterPanel/GridFilterInputValue.js +17 -10
  181. package/node/components/panel/filterPanel/GridFilterPanel.js +4 -4
  182. package/node/components/toolbar/GridToolbar.js +4 -4
  183. package/node/components/toolbar/GridToolbarColumnsButton.js +3 -2
  184. package/node/components/toolbar/GridToolbarDensitySelector.js +3 -2
  185. package/node/components/toolbar/GridToolbarExport.js +2 -1
  186. package/node/components/toolbar/GridToolbarExportContainer.js +3 -2
  187. package/node/components/toolbar/GridToolbarFilterButton.js +3 -2
  188. package/node/components/virtualization/GridMainContainer.js +4 -3
  189. package/node/components/virtualization/GridVirtualScrollbar.js +2 -1
  190. package/node/components/virtualization/GridVirtualScrollerContent.js +5 -5
  191. package/node/components/virtualization/GridVirtualScrollerRenderZone.js +5 -3
  192. package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +10 -3
  193. package/node/hooks/features/columnResize/gridColumnResizeApi.js +2 -1
  194. package/node/hooks/features/columnResize/useGridColumnResize.js +9 -4
  195. package/node/hooks/features/columns/gridColumnsUtils.js +2 -1
  196. package/node/hooks/features/rows/useGridRowSpanning.js +13 -5
  197. package/node/hooks/features/virtualization/useGridVirtualScroller.js +11 -8
  198. package/node/index.js +1 -1
  199. package/node/internals/utils/useProps.js +3 -0
  200. package/node/locales/koKR.js +36 -39
  201. package/node/locales/nlNL.js +5 -6
  202. package/package.json +1 -1
@@ -47,7 +47,7 @@ export const useGridColumnHeaders = props => {
47
47
  const isRtl = useRtl();
48
48
  const rootProps = useGridRootProps();
49
49
  const dimensions = useGridSelector(apiRef, gridDimensionsSelector);
50
- const hasVirtualization = useGridSelector(apiRef, gridVirtualizationColumnEnabledSelector);
50
+ const hasColumnVirtualization = useGridSelector(apiRef, gridVirtualizationColumnEnabledSelector);
51
51
  const columnGroupsModel = useGridSelector(apiRef, gridColumnGroupsUnwrappedModelSelector);
52
52
  const columnPositions = useGridSelector(apiRef, gridColumnPositionsSelector);
53
53
  const renderContext = useGridSelector(apiRef, gridRenderContextColumnsSelector);
@@ -87,8 +87,15 @@ export const useGridColumnHeaders = props => {
87
87
  renderContext: currentContext = renderContext,
88
88
  maxLastColumn = visibleColumns.length
89
89
  } = params || {};
90
- const firstColumnToRender = currentContext.firstColumnIndex;
91
- const lastColumnToRender = !hasVirtualization ? maxLastColumn : currentContext.lastColumnIndex;
90
+ let firstColumnToRender;
91
+ let lastColumnToRender;
92
+ if (!rootProps.disableVirtualization && !hasColumnVirtualization) {
93
+ firstColumnToRender = 0;
94
+ lastColumnToRender = maxLastColumn;
95
+ } else {
96
+ firstColumnToRender = currentContext.firstColumnIndex;
97
+ lastColumnToRender = currentContext.lastColumnIndex;
98
+ }
92
99
  const renderedColumns = visibleColumns.slice(firstColumnToRender, lastColumnToRender);
93
100
  return {
94
101
  renderedColumns,
@@ -4,6 +4,7 @@ export declare const DEFAULT_GRID_AUTOSIZE_OPTIONS: {
4
4
  includeOutliers: boolean;
5
5
  outliersFactor: number;
6
6
  expand: boolean;
7
+ disableColumnVirtualization: boolean;
7
8
  };
8
9
  export type GridAutosizeOptions = {
9
10
  /**
@@ -30,6 +31,11 @@ export type GridAutosizeOptions = {
30
31
  * @default false
31
32
  */
32
33
  expand?: boolean;
34
+ /**
35
+ * If false, column virtualization is not disabled while resizing.
36
+ * @default true
37
+ */
38
+ disableColumnVirtualization?: boolean;
33
39
  };
34
40
  /**
35
41
  * The Resize API interface that is available in the grid `apiRef`.
@@ -2,7 +2,8 @@ export const DEFAULT_GRID_AUTOSIZE_OPTIONS = {
2
2
  includeHeaders: true,
3
3
  includeOutliers: false,
4
4
  outliersFactor: 1.5,
5
- expand: false
5
+ expand: false,
6
+ disableColumnVirtualization: true
6
7
  };
7
8
 
8
9
  /**
@@ -7,4 +7,4 @@ export declare const columnResizeStateInitializer: GridStateInitializer;
7
7
  * @requires useGridColumns (method, event)
8
8
  * TODO: improve experience for last column
9
9
  */
10
- export declare const useGridColumnResize: (apiRef: React.MutableRefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "autosizeOptions" | "autosizeOnMount" | "disableAutosize" | "onColumnResize" | "onColumnWidthChange">) => void;
10
+ export declare const useGridColumnResize: (apiRef: React.MutableRefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "autosizeOptions" | "autosizeOnMount" | "disableAutosize" | "onColumnResize" | "onColumnWidthChange" | "disableVirtualization">) => void;
@@ -458,6 +458,7 @@ export const useGridColumnResize = (apiRef, props) => {
458
458
  return;
459
459
  }
460
460
  apiRef.current.autosizeColumns(_extends({}, props.autosizeOptions, {
461
+ disableColumnVirtualization: false,
461
462
  columns: [column.field]
462
463
  }));
463
464
  });
@@ -484,8 +485,10 @@ export const useGridColumnResize = (apiRef, props) => {
484
485
  options.columns = options.columns.filter(c => state.columnVisibilityModel[c] !== false);
485
486
  const columns = options.columns.map(c => apiRef.current.state.columns.lookup[c]);
486
487
  try {
487
- apiRef.current.unstable_setColumnVirtualization(false);
488
- await columnVirtualizationDisabled();
488
+ if (!props.disableVirtualization && options.disableColumnVirtualization) {
489
+ apiRef.current.unstable_setColumnVirtualization(false);
490
+ await columnVirtualizationDisabled();
491
+ }
489
492
  const widthByField = extractColumnWidths(apiRef, options, columns);
490
493
  const newColumns = columns.map(column => _extends({}, column, {
491
494
  width: widthByField[column.field],
@@ -517,10 +520,12 @@ export const useGridColumnResize = (apiRef, props) => {
517
520
  }
518
521
  });
519
522
  } finally {
520
- apiRef.current.unstable_setColumnVirtualization(true);
523
+ if (!props.disableVirtualization) {
524
+ apiRef.current.unstable_setColumnVirtualization(true);
525
+ }
521
526
  isAutosizingRef.current = false;
522
527
  }
523
- }, [apiRef, columnVirtualizationDisabled]);
528
+ }, [apiRef, columnVirtualizationDisabled, props.disableVirtualization]);
524
529
 
525
530
  /**
526
531
  * EFFECTS
@@ -53,4 +53,4 @@ export declare function getFirstNonSpannedColumnToRender({ firstColumnToRender,
53
53
  lastRowToRender: number;
54
54
  visibleRows: GridRowEntry[];
55
55
  }): number;
56
- export declare function getTotalHeaderHeight(apiRef: React.MutableRefObject<GridApiCommunity>, props: Pick<DataGridProcessedProps, 'columnHeaderHeight' | 'headerFilterHeight' | 'unstable_listView'>): number;
56
+ export declare function getTotalHeaderHeight(apiRef: React.MutableRefObject<GridApiCommunity>, props: Pick<DataGridProcessedProps, 'columnHeaderHeight' | 'headerFilterHeight' | 'unstable_listView' | 'columnGroupHeaderHeight'>): number;
@@ -319,6 +319,7 @@ export function getTotalHeaderHeight(apiRef, props) {
319
319
  const maxDepth = gridColumnGroupsHeaderMaxDepthSelector(apiRef);
320
320
  const isHeaderFilteringEnabled = gridHeaderFilteringEnabledSelector(apiRef);
321
321
  const columnHeadersHeight = Math.floor(props.columnHeaderHeight * densityFactor);
322
+ const columnGroupHeadersHeight = Math.floor((props.columnGroupHeaderHeight ?? props.columnHeaderHeight) * densityFactor);
322
323
  const filterHeadersHeight = isHeaderFilteringEnabled ? Math.floor((props.headerFilterHeight ?? props.columnHeaderHeight) * densityFactor) : 0;
323
- return columnHeadersHeight * (1 + (maxDepth ?? 0)) + filterHeadersHeight;
324
+ return columnHeadersHeight + columnGroupHeadersHeight * maxDepth + filterHeadersHeight;
324
325
  }
@@ -6,6 +6,7 @@ import { gridVisibleColumnDefinitionsSelector } from "../columns/gridColumnsSele
6
6
  import { useGridVisibleRows } from "../../utils/useGridVisibleRows.js";
7
7
  import { gridRenderContextSelector } from "../virtualization/gridVirtualizationSelectors.js";
8
8
  import { useGridSelector } from "../../utils/useGridSelector.js";
9
+ import { gridRowTreeSelector } from "./gridRowsSelector.js";
9
10
  import { getUnprocessedRange, isRowRangeUpdated, isRowContextInitialized, getCellValue } from "./gridRowSpanningUtils.js";
10
11
  import { GRID_CHECKBOX_SELECTION_FIELD } from "../../../colDef/gridCheckboxSelectionColDef.js";
11
12
  const EMPTY_STATE = {
@@ -35,7 +36,7 @@ const computeRowSpanningState = (apiRef, colDefs, visibleRows, range, rangeToPro
35
36
  if (skippedFields.has(colDef.field)) {
36
37
  return;
37
38
  }
38
- for (let index = rangeToProcess.firstRowIndex; index <= rangeToProcess.lastRowIndex; index += 1) {
39
+ for (let index = rangeToProcess.firstRowIndex; index < rangeToProcess.lastRowIndex; index += 1) {
39
40
  const row = visibleRows[index];
40
41
  if (hiddenCells[row.id]?.[colDef.field]) {
41
42
  continue;
@@ -142,7 +143,7 @@ export const rowSpanningStateInitializer = (state, props, apiRef) => {
142
143
  }
143
144
  const rangeToProcess = {
144
145
  firstRowIndex: 0,
145
- lastRowIndex: Math.min(DEFAULT_ROWS_TO_PROCESS - 1, Math.max(rowIds.length - 1, 0))
146
+ lastRowIndex: Math.min(DEFAULT_ROWS_TO_PROCESS, Math.max(rowIds.length, 0))
146
147
  };
147
148
  const rows = rowIds.map(id => ({
148
149
  id,
@@ -173,10 +174,11 @@ export const useGridRowSpanning = (apiRef, props) => {
173
174
  } = useGridVisibleRows(apiRef, props);
174
175
  const renderContext = useGridSelector(apiRef, gridRenderContextSelector);
175
176
  const colDefs = useGridSelector(apiRef, gridVisibleColumnDefinitionsSelector);
177
+ const tree = useGridSelector(apiRef, gridRowTreeSelector);
176
178
  const processedRange = useLazyRef(() => {
177
179
  return Object.keys(apiRef.current.state.rowSpanning.spannedCells).length > 0 ? {
178
180
  firstRowIndex: 0,
179
- lastRowIndex: Math.min(DEFAULT_ROWS_TO_PROCESS - 1, Math.max(apiRef.current.state.rows.dataRowIds.length - 1, 0))
181
+ lastRowIndex: Math.min(DEFAULT_ROWS_TO_PROCESS, Math.max(apiRef.current.state.rows.dataRowIds.length, 0))
180
182
  } : EMPTY_RANGE;
181
183
  });
182
184
  const lastRange = React.useRef(EMPTY_RANGE);
@@ -204,7 +206,7 @@ export const useGridRowSpanning = (apiRef, props) => {
204
206
  }
205
207
  const rangeToProcess = getUnprocessedRange({
206
208
  firstRowIndex: renderContext.firstRowIndex,
207
- lastRowIndex: Math.min(renderContext.lastRowIndex - 1, range.lastRowIndex)
209
+ lastRowIndex: Math.min(renderContext.lastRowIndex, range.lastRowIndex + 1)
208
210
  }, processedRange.current);
209
211
  if (rangeToProcess === null) {
210
212
  return;
@@ -237,11 +239,17 @@ export const useGridRowSpanning = (apiRef, props) => {
237
239
  const prevRenderContext = React.useRef(renderContext);
238
240
  const isFirstRender = React.useRef(true);
239
241
  const shouldResetState = React.useRef(false);
242
+ const previousTree = React.useRef(tree);
240
243
  React.useEffect(() => {
241
244
  const firstRender = isFirstRender.current;
242
245
  if (isFirstRender.current) {
243
246
  isFirstRender.current = false;
244
247
  }
248
+ if (tree !== previousTree.current) {
249
+ previousTree.current = tree;
250
+ updateRowSpanningState(true);
251
+ return;
252
+ }
245
253
  if (range && lastRange.current && isRowRangeUpdated(range, lastRange.current)) {
246
254
  lastRange.current = range;
247
255
  shouldResetState.current = true;
@@ -255,5 +263,5 @@ export const useGridRowSpanning = (apiRef, props) => {
255
263
  return;
256
264
  }
257
265
  updateRowSpanningState();
258
- }, [updateRowSpanningState, renderContext, range, lastRange]);
266
+ }, [updateRowSpanningState, renderContext, range, lastRange, tree]);
259
267
  };
@@ -92,10 +92,7 @@ export const useGridVirtualScroller = () => {
92
92
  return undefined;
93
93
  }
94
94
  const initialRect = node.getBoundingClientRect();
95
- let lastSize = {
96
- width: initialRect.width,
97
- height: initialRect.height
98
- };
95
+ let lastSize = roundDimensions(initialRect);
99
96
  apiRef.current.publishEvent('resize', lastSize);
100
97
  if (typeof ResizeObserver === 'undefined') {
101
98
  return undefined;
@@ -105,10 +102,7 @@ export const useGridVirtualScroller = () => {
105
102
  if (!entry) {
106
103
  return;
107
104
  }
108
- const newSize = {
109
- width: entry.contentRect.width,
110
- height: entry.contentRect.height
111
- };
105
+ const newSize = roundDimensions(entry.contentRect);
112
106
  if (newSize.width === lastSize.width && newSize.height === lastSize.height) {
113
107
  return;
114
108
  }
@@ -784,4 +778,13 @@ function bufferForDirection(isRtl, direction, rowBufferPx, columnBufferPx, verti
784
778
  // eslint unable to figure out enum exhaustiveness
785
779
  throw new Error('unreachable');
786
780
  }
781
+ }
782
+
783
+ // Round to avoid issues with subpixel rendering
784
+ // https://github.com/mui/mui-x/issues/15721
785
+ function roundDimensions(dimensions) {
786
+ return {
787
+ width: Math.round(dimensions.width * 10) / 10,
788
+ height: Math.round(dimensions.height * 10) / 10
789
+ };
787
790
  }
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v7.23.2
2
+ * @mui/x-data-grid v7.23.4
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -2,6 +2,9 @@ import * as React from 'react';
2
2
 
3
3
  /** Gathers props for the root element into a single `.forwardedProps` field */
4
4
  function groupForwardedProps(props) {
5
+ if (props.slotProps?.root) {
6
+ return props;
7
+ }
5
8
  const keys = Object.keys(props);
6
9
  if (!keys.some(key => key.startsWith('aria-') || key.startsWith('data-'))) {
7
10
  return props;
package/locales/koKR.js CHANGED
@@ -30,15 +30,14 @@ const koKRGrid = {
30
30
  toolbarExportPrint: '프린트',
31
31
  toolbarExportExcel: 'Excel로 내보내기',
32
32
  // Columns management text
33
- // columnsManagementSearchTitle: 'Search',
34
- // columnsManagementNoColumns: 'No columns',
35
- // columnsManagementShowHideAllText: 'Show/Hide All',
36
- // columnsManagementReset: 'Reset',
37
- // columnsManagementDeleteIconLabel: 'Clear',
38
-
33
+ columnsManagementSearchTitle: '검색',
34
+ columnsManagementNoColumns: '열이 없습니다.',
35
+ columnsManagementShowHideAllText: '모두 보기/숨기기',
36
+ columnsManagementReset: '초기화',
37
+ columnsManagementDeleteIconLabel: '제거',
39
38
  // Filter panel text
40
39
  filterPanelAddFilter: '필터 추가',
41
- // filterPanelRemoveAll: 'Remove all',
40
+ filterPanelRemoveAll: '모두 삭제',
42
41
  filterPanelDeleteIconLabel: '삭제',
43
42
  filterPanelLogicOperator: '논리 연산자',
44
43
  filterPanelOperator: '연산자',
@@ -49,9 +48,9 @@ const koKRGrid = {
49
48
  filterPanelInputPlaceholder: '값 입력',
50
49
  // Filter operators text
51
50
  filterOperatorContains: '포함하는',
52
- // filterOperatorDoesNotContain: 'does not contain',
51
+ filterOperatorDoesNotContain: '포함하지 않는',
53
52
  filterOperatorEquals: '값이 같은',
54
- // filterOperatorDoesNotEqual: 'does not equal',
53
+ filterOperatorDoesNotEqual: '값이 다른',
55
54
  filterOperatorStartsWith: '시작하는',
56
55
  filterOperatorEndsWith: '끝나는',
57
56
  filterOperatorIs: '~인',
@@ -63,36 +62,34 @@ const koKRGrid = {
63
62
  filterOperatorIsEmpty: '값이 없는',
64
63
  filterOperatorIsNotEmpty: '값이 있는',
65
64
  filterOperatorIsAnyOf: '값 중 하나인',
66
- // 'filterOperator=': '=',
67
- // 'filterOperator!=': '!=',
68
- // 'filterOperator>': '>',
69
- // 'filterOperator>=': '>=',
70
- // 'filterOperator<': '<',
71
- // 'filterOperator<=': '<=',
72
-
65
+ 'filterOperator=': '=',
66
+ 'filterOperator!=': '!=',
67
+ 'filterOperator>': '>',
68
+ 'filterOperator>=': '>=',
69
+ 'filterOperator<': '<',
70
+ 'filterOperator<=': '<=',
73
71
  // Header filter operators text
74
- // headerFilterOperatorContains: 'Contains',
75
- // headerFilterOperatorDoesNotContain: 'Does not contain',
76
- // headerFilterOperatorEquals: 'Equals',
77
- // headerFilterOperatorDoesNotEqual: 'Does not equal',
78
- // headerFilterOperatorStartsWith: 'Starts with',
79
- // headerFilterOperatorEndsWith: 'Ends with',
80
- // headerFilterOperatorIs: 'Is',
81
- // headerFilterOperatorNot: 'Is not',
82
- // headerFilterOperatorAfter: 'Is after',
83
- // headerFilterOperatorOnOrAfter: 'Is on or after',
84
- // headerFilterOperatorBefore: 'Is before',
85
- // headerFilterOperatorOnOrBefore: 'Is on or before',
86
- // headerFilterOperatorIsEmpty: 'Is empty',
87
- // headerFilterOperatorIsNotEmpty: 'Is not empty',
88
- // headerFilterOperatorIsAnyOf: 'Is any of',
89
- // 'headerFilterOperator=': 'Equals',
90
- // 'headerFilterOperator!=': 'Not equals',
91
- // 'headerFilterOperator>': 'Greater than',
92
- // 'headerFilterOperator>=': 'Greater than or equal to',
93
- // 'headerFilterOperator<': 'Less than',
94
- // 'headerFilterOperator<=': 'Less than or equal to',
95
-
72
+ headerFilterOperatorContains: '포함하는',
73
+ headerFilterOperatorDoesNotContain: '포함하지 않는',
74
+ headerFilterOperatorEquals: '값이 같은',
75
+ headerFilterOperatorDoesNotEqual: '값이 다른',
76
+ headerFilterOperatorStartsWith: '시작하는',
77
+ headerFilterOperatorEndsWith: '끝나는',
78
+ headerFilterOperatorIs: '~인',
79
+ headerFilterOperatorNot: '~아닌',
80
+ headerFilterOperatorAfter: ' 이후',
81
+ headerFilterOperatorOnOrAfter: '이후',
82
+ headerFilterOperatorBefore: ' 이전',
83
+ headerFilterOperatorOnOrBefore: '이전',
84
+ headerFilterOperatorIsEmpty: '값이 없는',
85
+ headerFilterOperatorIsNotEmpty: '값이 있는',
86
+ headerFilterOperatorIsAnyOf: ' 하나인',
87
+ 'headerFilterOperator=': '값이 같은',
88
+ 'headerFilterOperator!=': '값이 다른',
89
+ 'headerFilterOperator>': ' ',
90
+ 'headerFilterOperator>=': '같거나 ',
91
+ 'headerFilterOperator<': ' 작은',
92
+ 'headerFilterOperator<=': '같거나 작은',
96
93
  // Filter values text
97
94
  filterValueAny: '아무값',
98
95
  filterValueTrue: '참',
@@ -100,7 +97,7 @@ const koKRGrid = {
100
97
  // Column menu text
101
98
  columnMenuLabel: '메뉴',
102
99
  columnMenuShowColumns: '열 표시',
103
- // columnMenuManageColumns: 'Manage columns',
100
+ columnMenuManageColumns: ' 관리',
104
101
  columnMenuFilter: '필터',
105
102
  columnMenuHideColumn: '열 숨기기',
106
103
  columnMenuUnsort: '정렬 해제',
package/locales/nlNL.js CHANGED
@@ -34,8 +34,7 @@ const nlNLGrid = {
34
34
  columnsManagementNoColumns: 'Geen kolommen',
35
35
  columnsManagementShowHideAllText: 'Toon/Verberg Alle',
36
36
  columnsManagementReset: 'Reset',
37
- // columnsManagementDeleteIconLabel: 'Clear',
38
-
37
+ columnsManagementDeleteIconLabel: 'Verwijderen',
39
38
  // Filter panel text
40
39
  filterPanelAddFilter: 'Filter toevoegen',
41
40
  filterPanelRemoveAll: 'Alles verwijderen',
@@ -49,9 +48,9 @@ const nlNLGrid = {
49
48
  filterPanelInputPlaceholder: 'Filter waarde',
50
49
  // Filter operators text
51
50
  filterOperatorContains: 'bevat',
52
- // filterOperatorDoesNotContain: 'does not contain',
51
+ filterOperatorDoesNotContain: 'bevat niet',
53
52
  filterOperatorEquals: 'gelijk aan',
54
- // filterOperatorDoesNotEqual: 'does not equal',
53
+ filterOperatorDoesNotEqual: 'niet gelijk aan',
55
54
  filterOperatorStartsWith: 'begint met',
56
55
  filterOperatorEndsWith: 'eindigt met',
57
56
  filterOperatorIs: 'is',
@@ -71,9 +70,9 @@ const nlNLGrid = {
71
70
  'filterOperator<=': '<=',
72
71
  // Header filter operators text
73
72
  headerFilterOperatorContains: 'Bevat',
74
- // headerFilterOperatorDoesNotContain: 'Does not contain',
73
+ headerFilterOperatorDoesNotContain: 'Bevat niet',
75
74
  headerFilterOperatorEquals: 'Gelijk aan',
76
- // headerFilterOperatorDoesNotEqual: 'Does not equal',
75
+ headerFilterOperatorDoesNotEqual: 'Niet gelijk aan',
77
76
  headerFilterOperatorStartsWith: 'Begint met',
78
77
  headerFilterOperatorEndsWith: 'Eindigt met',
79
78
  headerFilterOperatorIs: 'Is',
@@ -32,6 +32,8 @@ import type { GridLoadingOverlayProps } from '../components/GridLoadingOverlay';
32
32
  import type { GridRowCountProps } from '../components/GridRowCount';
33
33
  import type { GridColumnHeaderSortIconProps } from '../components/columnHeaders/GridColumnHeaderSortIcon';
34
34
  type DividerProps = {};
35
+ type RootProps = React.HTMLAttributes<HTMLDivElement> & Record<`data-${string}`, string>;
36
+ type MainProps = React.HTMLAttributes<HTMLDivElement> & Record<`data-${string}`, string>;
35
37
  export interface BaseBadgePropsOverrides {
36
38
  }
37
39
  export interface BaseCheckboxPropsOverrides {
@@ -140,6 +142,14 @@ export interface GridSlotProps {
140
142
  row: GridRowProps & RowPropsOverrides;
141
143
  skeletonCell: GridSkeletonCellProps & SkeletonCellPropsOverrides;
142
144
  toolbar: GridToolbarProps & ToolbarPropsOverrides;
145
+ /**
146
+ * Props passed to the `.main` (role="grid") element
147
+ */
148
+ main: MainProps;
149
+ /**
150
+ * Props passed to the `.root` element
151
+ */
152
+ root: RootProps;
143
153
  }
144
154
  /**
145
155
  * Overridable components props dynamically passed to the component at rendering.
@@ -229,6 +229,7 @@ export interface DataGridPropsWithDefaultValues<R extends GridValidRowModel = an
229
229
  * If `deselect`, it will deselect all the rows under it.
230
230
  * Works only if `checkboxSelection` is enabled.
231
231
  * @default "deselect"
232
+ * @deprecated `select` will be the default behavior from v8 onwards
232
233
  */
233
234
  indeterminateCheckboxAction: 'select' | 'deselect';
234
235
  /**
@@ -3,6 +3,7 @@
3
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
+ import { forwardRef } from '@mui/x-internals/forwardRef';
6
7
  import { GridBody, GridFooterPlaceholder, GridHeader, GridRoot } from "../components/index.js";
7
8
  import { useGridAriaAttributes } from "../hooks/utils/useGridAriaAttributes.js";
8
9
  import { useGridRowAriaAttributes } from "../hooks/features/rows/useGridRowAriaAttributes.js";
@@ -23,7 +24,7 @@ if (process.env.NODE_ENV !== 'production') {
23
24
  // Only validate in MIT version
24
25
  props => props.columns && props.columns.some(column => column.resizable) && [`MUI X: \`column.resizable = true\` is not a valid prop.`, 'Column resizing is not available in the MIT version.', '', 'You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature.'].join('\n') || undefined];
25
26
  }
26
- const DataGridRaw = /*#__PURE__*/React.forwardRef(function DataGrid(inProps, ref) {
27
+ const DataGridRaw = forwardRef(function DataGrid(inProps, ref) {
27
28
  const props = useDataGridProps(inProps);
28
29
  const privateApiRef = useDataGridComponent(props.apiRef, props);
29
30
  if (process.env.NODE_ENV !== 'production') {
@@ -36,9 +37,9 @@ const DataGridRaw = /*#__PURE__*/React.forwardRef(function DataGrid(inProps, ref
36
37
  children: /*#__PURE__*/_jsxs(GridRoot, _extends({
37
38
  className: props.className,
38
39
  style: props.style,
39
- sx: props.sx,
40
- ref: ref
41
- }, props.forwardedProps, {
40
+ sx: props.sx
41
+ }, props.forwardedProps, props.slotProps?.root, {
42
+ ref: ref,
42
43
  children: [/*#__PURE__*/_jsx(GridHeader, {}), /*#__PURE__*/_jsx(GridBody, {}), /*#__PURE__*/_jsx(GridFooterPlaceholder, {})]
43
44
  }))
44
45
  });
@@ -95,6 +96,7 @@ DataGridRaw.propTypes = {
95
96
  */
96
97
  autosizeOptions: PropTypes.shape({
97
98
  columns: PropTypes.arrayOf(PropTypes.string),
99
+ disableColumnVirtualization: PropTypes.bool,
98
100
  expand: PropTypes.bool,
99
101
  includeHeaders: PropTypes.bool,
100
102
  includeOutliers: PropTypes.bool,
@@ -331,6 +333,7 @@ DataGridRaw.propTypes = {
331
333
  * If `deselect`, it will deselect all the rows under it.
332
334
  * Works only if `checkboxSelection` is enabled.
333
335
  * @default "deselect"
336
+ * @deprecated `select` will be the default behavior from v8 onwards
334
337
  */
335
338
  indeterminateCheckboxAction: PropTypes.oneOf(['deselect', 'select']),
336
339
  /**
@@ -4,10 +4,11 @@ const _excluded = ["className", "visibleColumns", "sortColumnLookup", "filterCol
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import { fastMemo } from '@mui/x-internals/fastMemo';
7
+ import { forwardRef } from '@mui/x-internals/forwardRef';
7
8
  import { useGridColumnHeaders } from "../hooks/features/columnHeaders/useGridColumnHeaders.js";
8
9
  import { GridBaseColumnHeaders } from "./columnHeaders/GridBaseColumnHeaders.js";
9
10
  import { jsxs as _jsxs } from "react/jsx-runtime";
10
- const GridColumnHeaders = /*#__PURE__*/React.forwardRef(function GridColumnHeaders(props, ref) {
11
+ const GridColumnHeaders = forwardRef(function GridColumnHeaders(props, ref) {
11
12
  const {
12
13
  visibleColumns,
13
14
  sortColumnLookup,
@@ -41,9 +42,8 @@ const GridColumnHeaders = /*#__PURE__*/React.forwardRef(function GridColumnHeade
41
42
  columnGroupsHeaderStructure,
42
43
  hasOtherElementInTabSequence
43
44
  });
44
- return /*#__PURE__*/_jsxs(GridBaseColumnHeaders, _extends({
45
- ref: ref
46
- }, other, getInnerProps(), {
45
+ return /*#__PURE__*/_jsxs(GridBaseColumnHeaders, _extends({}, other, getInnerProps(), {
46
+ ref: ref,
47
47
  children: [getColumnGroupHeadersRows(), getColumnHeadersRow()]
48
48
  }));
49
49
  });
@@ -1,6 +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 { forwardRef } from '@mui/x-internals/forwardRef';
4
5
  import { useGridSelector } from "../hooks/utils/useGridSelector.js";
5
6
  import { gridTopLevelRowCountSelector } from "../hooks/features/rows/gridRowsSelector.js";
6
7
  import { selectedGridRowsCountSelector } from "../hooks/features/rowSelection/gridRowSelectionSelector.js";
@@ -10,7 +11,7 @@ import { GridSelectedRowCount } from "./GridSelectedRowCount.js";
10
11
  import { GridFooterContainer } from "./containers/GridFooterContainer.js";
11
12
  import { useGridRootProps } from "../hooks/utils/useGridRootProps.js";
12
13
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
- const GridFooter = /*#__PURE__*/React.forwardRef(function GridFooter(props, ref) {
14
+ const GridFooter = forwardRef(function GridFooter(props, ref) {
14
15
  const apiRef = useGridApiContext();
15
16
  const rootProps = useGridRootProps();
16
17
  const totalTopLevelRowCount = useGridSelector(apiRef, gridTopLevelRowCountSelector);
@@ -24,9 +25,8 @@ const GridFooter = /*#__PURE__*/React.forwardRef(function GridFooter(props, ref)
24
25
  visibleRowCount: visibleTopLevelRowCount
25
26
  })) : null;
26
27
  const paginationElement = rootProps.pagination && !rootProps.hideFooterPagination && rootProps.slots.pagination && /*#__PURE__*/_jsx(rootProps.slots.pagination, _extends({}, rootProps.slotProps?.pagination));
27
- return /*#__PURE__*/_jsxs(GridFooterContainer, _extends({
28
- ref: ref
29
- }, props, {
28
+ return /*#__PURE__*/_jsxs(GridFooterContainer, _extends({}, props, {
29
+ ref: ref,
30
30
  children: [selectedRowCountElement, rowCountElement, paginationElement]
31
31
  }));
32
32
  });
@@ -5,6 +5,7 @@ import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import LinearProgress from '@mui/material/LinearProgress';
7
7
  import CircularProgress from '@mui/material/CircularProgress';
8
+ import { forwardRef } from '@mui/x-internals/forwardRef';
8
9
  import { GridOverlay } from "./containers/GridOverlay.js";
9
10
  import { GridSkeletonLoadingOverlay } from "./GridSkeletonLoadingOverlay.js";
10
11
  import { useGridApiContext } from "../hooks/utils/useGridApiContext.js";
@@ -28,7 +29,7 @@ const LOADING_VARIANTS = {
28
29
  }
29
30
  }
30
31
  };
31
- const GridLoadingOverlay = /*#__PURE__*/React.forwardRef(function GridLoadingOverlay(props, ref) {
32
+ const GridLoadingOverlay = forwardRef(function GridLoadingOverlay(props, ref) {
32
33
  const {
33
34
  variant = 'circular-progress',
34
35
  noRowsVariant = 'circular-progress',
@@ -39,9 +40,9 @@ const GridLoadingOverlay = /*#__PURE__*/React.forwardRef(function GridLoadingOve
39
40
  const rowsCount = useGridSelector(apiRef, gridRowCountSelector);
40
41
  const activeVariant = LOADING_VARIANTS[rowsCount === 0 ? noRowsVariant : variant];
41
42
  return /*#__PURE__*/_jsx(GridOverlay, _extends({
42
- ref: ref,
43
43
  style: _extends({}, activeVariant.style, style)
44
44
  }, other, {
45
+ ref: ref,
45
46
  children: /*#__PURE__*/_jsx(activeVariant.component, {})
46
47
  }));
47
48
  });
@@ -1,14 +1,14 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
+ import { forwardRef } from '@mui/x-internals/forwardRef';
3
4
  import { useGridApiContext } from "../hooks/utils/useGridApiContext.js";
4
5
  import { GridOverlay } from "./containers/GridOverlay.js";
5
6
  import { jsx as _jsx } from "react/jsx-runtime";
6
- export const GridNoResultsOverlay = /*#__PURE__*/React.forwardRef(function GridNoResultsOverlay(props, ref) {
7
+ export const GridNoResultsOverlay = forwardRef(function GridNoResultsOverlay(props, ref) {
7
8
  const apiRef = useGridApiContext();
8
9
  const noResultsOverlayLabel = apiRef.current.getLocaleText('noResultsOverlayLabel');
9
- return /*#__PURE__*/_jsx(GridOverlay, _extends({
10
- ref: ref
11
- }, props, {
10
+ return /*#__PURE__*/_jsx(GridOverlay, _extends({}, props, {
11
+ ref: ref,
12
12
  children: noResultsOverlayLabel
13
13
  }));
14
14
  });
@@ -1,15 +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 { forwardRef } from '@mui/x-internals/forwardRef';
4
5
  import { useGridApiContext } from "../hooks/utils/useGridApiContext.js";
5
6
  import { GridOverlay } from "./containers/GridOverlay.js";
6
7
  import { jsx as _jsx } from "react/jsx-runtime";
7
- const GridNoRowsOverlay = /*#__PURE__*/React.forwardRef(function GridNoRowsOverlay(props, ref) {
8
+ const GridNoRowsOverlay = forwardRef(function GridNoRowsOverlay(props, ref) {
8
9
  const apiRef = useGridApiContext();
9
10
  const noRowsLabel = apiRef.current.getLocaleText('noRowsLabel');
10
- return /*#__PURE__*/_jsx(GridOverlay, _extends({
11
- ref: ref
12
- }, props, {
11
+ return /*#__PURE__*/_jsx(GridOverlay, _extends({}, props, {
12
+ ref: ref,
13
13
  children: noRowsLabel
14
14
  }));
15
15
  });
@@ -3,6 +3,7 @@ import * as React from 'react';
3
3
  import { styled } from '@mui/material/styles';
4
4
  import PropTypes from 'prop-types';
5
5
  import TablePagination, { tablePaginationClasses } from '@mui/material/TablePagination';
6
+ import { forwardRef } from '@mui/x-internals/forwardRef';
6
7
  import { useGridSelector } from "../hooks/utils/useGridSelector.js";
7
8
  import { useGridApiContext } from "../hooks/utils/useGridApiContext.js";
8
9
  import { useGridRootProps } from "../hooks/utils/useGridRootProps.js";
@@ -55,7 +56,7 @@ const defaultLabelDisplayedRows = ({
55
56
 
56
57
  // A mutable version of a readonly array.
57
58
 
58
- const GridPagination = /*#__PURE__*/React.forwardRef(function GridPagination(props, ref) {
59
+ const GridPagination = forwardRef(function GridPagination(props, ref) {
59
60
  const apiRef = useGridApiContext();
60
61
  const rootProps = useGridRootProps();
61
62
  const paginationModel = useGridSelector(apiRef, gridPaginationModelSelector);
@@ -119,7 +120,6 @@ const GridPagination = /*#__PURE__*/React.forwardRef(function GridPagination(pro
119
120
  const locales = apiRef.current.getLocaleText('MuiTablePagination');
120
121
  const wrappedLabelDisplayedRows = wrapLabelDisplayedRows(locales.labelDisplayedRows || defaultLabelDisplayedRows, estimatedRowCount);
121
122
  return /*#__PURE__*/_jsx(GridPaginationRoot, _extends({
122
- ref: ref,
123
123
  component: "div",
124
124
  count: rowCount,
125
125
  page: computedPage
@@ -133,7 +133,9 @@ const GridPagination = /*#__PURE__*/React.forwardRef(function GridPagination(pro
133
133
  onRowsPerPageChange: handlePageSizeChange
134
134
  }, computedProps, locales, {
135
135
  labelDisplayedRows: wrappedLabelDisplayedRows
136
- }, props));
136
+ }, props, {
137
+ ref: ref
138
+ }));
137
139
  });
138
140
  process.env.NODE_ENV !== "production" ? GridPagination.propTypes = {
139
141
  // ----------------------------- Warning --------------------------------