@mui/x-data-grid 7.22.2 → 8.0.0-alpha.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 (109) hide show
  1. package/CHANGELOG.md +142 -155
  2. package/README.md +2 -2
  3. package/components/GridDetailPanels.js +0 -1
  4. package/components/GridPinnedRows.js +0 -1
  5. package/components/GridRow.d.ts +2 -2
  6. package/components/GridRow.js +3 -28
  7. package/components/base/GridOverlays.js +10 -8
  8. package/components/cell/GridActionsCell.js +1 -2
  9. package/components/cell/GridActionsCellItem.js +1 -2
  10. package/components/cell/GridCell.d.ts +41 -3
  11. package/components/cell/GridCell.js +1 -9
  12. package/components/cell/GridEditInputCell.js +0 -67
  13. package/components/containers/GridRootStyles.js +1 -0
  14. package/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +1 -2
  15. package/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +1 -2
  16. package/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +1 -2
  17. package/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +3 -4
  18. package/components/panel/GridPanel.d.ts +1 -1
  19. package/components/toolbar/GridToolbar.d.ts +2 -2
  20. package/components/toolbar/GridToolbar.js +12 -4
  21. package/components/toolbar/GridToolbarColumnsButton.js +1 -1
  22. package/components/toolbar/GridToolbarDensitySelector.js +2 -4
  23. package/components/toolbar/GridToolbarExport.d.ts +2 -2
  24. package/components/toolbar/GridToolbarExport.js +9 -6
  25. package/components/toolbar/GridToolbarExportContainer.js +1 -2
  26. package/components/toolbar/index.d.ts +1 -1
  27. package/hooks/features/columnResize/useGridColumnResize.js +4 -2
  28. package/hooks/features/export/useGridCsvExport.js +1 -1
  29. package/hooks/features/export/useGridPrintExport.js +1 -1
  30. package/hooks/features/pagination/useGridPaginationModel.js +2 -2
  31. package/hooks/features/rows/gridRowsUtils.d.ts +1 -1
  32. package/hooks/features/rows/gridRowsUtils.js +1 -5
  33. package/hooks/features/virtualization/useGridVirtualScroller.js +4 -4
  34. package/hooks/utils/useGridSelector.d.ts +3 -2
  35. package/hooks/utils/useGridSelector.js +27 -2
  36. package/index.d.ts +0 -1
  37. package/index.js +1 -1
  38. package/locales/plPL.js +25 -28
  39. package/locales/trTR.js +2 -2
  40. package/material/index.js +4 -0
  41. package/models/gridSlotsComponent.d.ts +10 -0
  42. package/models/gridSlotsComponentsProps.d.ts +8 -0
  43. package/models/props/DataGridProps.d.ts +1 -1
  44. package/modern/components/GridDetailPanels.js +0 -1
  45. package/modern/components/GridPinnedRows.js +0 -1
  46. package/modern/components/GridRow.js +3 -28
  47. package/modern/components/base/GridOverlays.js +10 -8
  48. package/modern/components/cell/GridActionsCell.js +1 -2
  49. package/modern/components/cell/GridActionsCellItem.js +1 -2
  50. package/modern/components/cell/GridCell.js +1 -9
  51. package/modern/components/cell/GridEditInputCell.js +0 -67
  52. package/modern/components/containers/GridRootStyles.js +1 -0
  53. package/modern/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +1 -2
  54. package/modern/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +1 -2
  55. package/modern/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +1 -2
  56. package/modern/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +3 -4
  57. package/modern/components/toolbar/GridToolbar.js +12 -4
  58. package/modern/components/toolbar/GridToolbarColumnsButton.js +1 -1
  59. package/modern/components/toolbar/GridToolbarDensitySelector.js +2 -4
  60. package/modern/components/toolbar/GridToolbarExport.js +9 -6
  61. package/modern/components/toolbar/GridToolbarExportContainer.js +1 -2
  62. package/modern/hooks/features/columnResize/useGridColumnResize.js +4 -2
  63. package/modern/hooks/features/export/useGridCsvExport.js +1 -1
  64. package/modern/hooks/features/export/useGridPrintExport.js +1 -1
  65. package/modern/hooks/features/pagination/useGridPaginationModel.js +2 -2
  66. package/modern/hooks/features/rows/gridRowsUtils.js +1 -5
  67. package/modern/hooks/features/virtualization/useGridVirtualScroller.js +4 -4
  68. package/modern/hooks/utils/useGridSelector.js +27 -2
  69. package/modern/index.js +1 -1
  70. package/modern/locales/plPL.js +25 -28
  71. package/modern/locales/trTR.js +2 -2
  72. package/modern/material/index.js +4 -0
  73. package/modern/utils/createSelector.js +11 -1
  74. package/modern/utils/utils.js +1 -3
  75. package/node/components/GridDetailPanels.js +0 -1
  76. package/node/components/GridPinnedRows.js +0 -1
  77. package/node/components/GridRow.js +3 -28
  78. package/node/components/base/GridOverlays.js +10 -8
  79. package/node/components/cell/GridActionsCell.js +1 -2
  80. package/node/components/cell/GridActionsCellItem.js +1 -2
  81. package/node/components/cell/GridCell.js +1 -9
  82. package/node/components/cell/GridEditInputCell.js +0 -67
  83. package/node/components/containers/GridRootStyles.js +1 -0
  84. package/node/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +1 -2
  85. package/node/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +1 -2
  86. package/node/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +1 -2
  87. package/node/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +3 -4
  88. package/node/components/toolbar/GridToolbar.js +12 -4
  89. package/node/components/toolbar/GridToolbarColumnsButton.js +3 -3
  90. package/node/components/toolbar/GridToolbarDensitySelector.js +2 -4
  91. package/node/components/toolbar/GridToolbarExport.js +9 -6
  92. package/node/components/toolbar/GridToolbarExportContainer.js +1 -2
  93. package/node/hooks/features/columnResize/useGridColumnResize.js +4 -2
  94. package/node/hooks/features/export/useGridCsvExport.js +2 -2
  95. package/node/hooks/features/export/useGridPrintExport.js +2 -2
  96. package/node/hooks/features/pagination/useGridPaginationModel.js +2 -2
  97. package/node/hooks/features/rows/gridRowsUtils.js +2 -8
  98. package/node/hooks/features/virtualization/useGridVirtualScroller.js +4 -4
  99. package/node/hooks/utils/useGridSelector.js +29 -3
  100. package/node/index.js +1 -1
  101. package/node/locales/plPL.js +25 -28
  102. package/node/locales/trTR.js +2 -2
  103. package/node/material/index.js +4 -0
  104. package/node/utils/createSelector.js +11 -1
  105. package/node/utils/utils.js +1 -3
  106. package/package.json +3 -3
  107. package/utils/createSelector.d.ts +1 -1
  108. package/utils/createSelector.js +11 -1
  109. package/utils/utils.js +1 -3
@@ -14,7 +14,7 @@ export declare const gridPinnedColumnPositionLookup: {
14
14
  0: undefined;
15
15
  3: undefined;
16
16
  };
17
- export type GridCellProps = {
17
+ export type GridCellProps = React.HTMLAttributes<HTMLDivElement> & {
18
18
  align: GridAlignment;
19
19
  className?: string;
20
20
  colIndex: number;
@@ -32,12 +32,50 @@ export type GridCellProps = {
32
32
  gridHasFiller: boolean;
33
33
  onClick?: React.MouseEventHandler<HTMLDivElement>;
34
34
  onDoubleClick?: React.MouseEventHandler<HTMLDivElement>;
35
+ onMouseEnter?: React.MouseEventHandler<HTMLDivElement>;
35
36
  onMouseDown?: React.MouseEventHandler<HTMLDivElement>;
37
+ onMouseLeave?: React.MouseEventHandler<HTMLDivElement>;
36
38
  onMouseUp?: React.MouseEventHandler<HTMLDivElement>;
39
+ onMouseOver?: React.MouseEventHandler<HTMLDivElement>;
40
+ onKeyUp?: React.KeyboardEventHandler<HTMLDivElement>;
37
41
  onKeyDown?: React.KeyboardEventHandler<HTMLDivElement>;
38
42
  onDragEnter?: React.DragEventHandler<HTMLDivElement>;
39
43
  onDragOver?: React.DragEventHandler<HTMLDivElement>;
40
- [x: string]: any;
44
+ onFocus?: React.FocusEventHandler<Element>;
45
+ children?: React.ReactNode;
46
+ style?: React.CSSProperties;
47
+ [x: `data-${string}`]: string;
41
48
  };
42
- declare const MemoizedGridCell: React.ForwardRefExoticComponent<Omit<GridCellProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
49
+ declare const MemoizedGridCell: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
50
+ [x: `data-${string}`]: string;
51
+ align: GridAlignment;
52
+ className?: string;
53
+ colIndex: number;
54
+ column: GridColDef;
55
+ rowId: GridRowId;
56
+ width: number;
57
+ colSpan?: number;
58
+ disableDragEvents?: boolean;
59
+ isNotVisible: boolean;
60
+ editCellState: GridEditCellProps<any> | null;
61
+ pinnedOffset: number;
62
+ pinnedPosition: PinnedPosition;
63
+ sectionIndex: number;
64
+ sectionLength: number;
65
+ gridHasFiller: boolean;
66
+ onClick?: React.MouseEventHandler<HTMLDivElement>;
67
+ onDoubleClick?: React.MouseEventHandler<HTMLDivElement>;
68
+ onMouseEnter?: React.MouseEventHandler<HTMLDivElement>;
69
+ onMouseDown?: React.MouseEventHandler<HTMLDivElement>;
70
+ onMouseLeave?: React.MouseEventHandler<HTMLDivElement>;
71
+ onMouseUp?: React.MouseEventHandler<HTMLDivElement>;
72
+ onMouseOver?: React.MouseEventHandler<HTMLDivElement>;
73
+ onKeyUp?: React.KeyboardEventHandler<HTMLDivElement>;
74
+ onKeyDown?: React.KeyboardEventHandler<HTMLDivElement>;
75
+ onDragEnter?: React.DragEventHandler<HTMLDivElement>;
76
+ onDragOver?: React.DragEventHandler<HTMLDivElement>;
77
+ onFocus?: React.FocusEventHandler<Element>;
78
+ children?: React.ReactNode;
79
+ style?: React.CSSProperties;
80
+ } & React.RefAttributes<HTMLDivElement>>;
43
81
  export { MemoizedGridCell as GridCell };
@@ -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 = ["column", "rowId", "editCellState", "align", "children", "colIndex", "width", "className", "style", "gridHasScrollX", "colSpan", "disableDragEvents", "isNotVisible", "pinnedOffset", "pinnedPosition", "sectionIndex", "sectionLength", "gridHasFiller", "onClick", "onDoubleClick", "onMouseDown", "onMouseUp", "onMouseOver", "onKeyDown", "onKeyUp", "onDragEnter", "onDragOver"],
3
+ const _excluded = ["column", "rowId", "editCellState", "align", "children", "colIndex", "width", "className", "style", "colSpan", "disableDragEvents", "isNotVisible", "pinnedOffset", "pinnedPosition", "sectionIndex", "sectionLength", "gridHasFiller", "onClick", "onDoubleClick", "onMouseDown", "onMouseUp", "onMouseOver", "onKeyDown", "onKeyUp", "onDragEnter", "onDragOver"],
4
4
  _excluded2 = ["changeReason", "unstable_updateValueOnRender"];
5
5
  import * as React from 'react';
6
6
  import PropTypes from 'prop-types';
@@ -342,7 +342,6 @@ process.env.NODE_ENV !== "production" ? GridCell.propTypes = {
342
342
  // | To update them edit the TypeScript types and run "pnpm proptypes" |
343
343
  // ----------------------------------------------------------------------
344
344
  align: PropTypes.oneOf(['center', 'left', 'right']).isRequired,
345
- className: PropTypes.string,
346
345
  colIndex: PropTypes.number.isRequired,
347
346
  colSpan: PropTypes.number,
348
347
  column: PropTypes.object.isRequired,
@@ -355,13 +354,6 @@ process.env.NODE_ENV !== "production" ? GridCell.propTypes = {
355
354
  }),
356
355
  gridHasFiller: PropTypes.bool.isRequired,
357
356
  isNotVisible: PropTypes.bool.isRequired,
358
- onClick: PropTypes.func,
359
- onDoubleClick: PropTypes.func,
360
- onDragEnter: PropTypes.func,
361
- onDragOver: PropTypes.func,
362
- onKeyDown: PropTypes.func,
363
- onMouseDown: PropTypes.func,
364
- onMouseUp: PropTypes.func,
365
357
  pinnedOffset: PropTypes.number.isRequired,
366
358
  pinnedPosition: PropTypes.oneOf([0, 1, 2, 3]).isRequired,
367
359
  rowId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
@@ -2,7 +2,6 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
3
  const _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "hasFocus", "isValidating", "debounceMs", "isProcessingProps", "onValueChange"];
4
4
  import * as React from 'react';
5
- import PropTypes from 'prop-types';
6
5
  import { unstable_composeClasses as composeClasses, unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';
7
6
  import { styled } from '@mui/material/styles';
8
7
  import InputBase from '@mui/material/InputBase';
@@ -94,71 +93,5 @@ const GridEditInputCell = /*#__PURE__*/React.forwardRef((props, ref) => {
94
93
  }) : undefined
95
94
  }, other));
96
95
  });
97
- process.env.NODE_ENV !== "production" ? GridEditInputCell.propTypes = {
98
- // ----------------------------- Warning --------------------------------
99
- // | These PropTypes are generated from the TypeScript type definitions |
100
- // | To update them edit the TypeScript types and run "pnpm proptypes" |
101
- // ----------------------------------------------------------------------
102
- /**
103
- * GridApi that let you manipulate the grid.
104
- */
105
- api: PropTypes.object.isRequired,
106
- /**
107
- * The mode of the cell.
108
- */
109
- cellMode: PropTypes.oneOf(['edit', 'view']).isRequired,
110
- changeReason: PropTypes.oneOf(['debouncedSetEditCellValue', 'setEditCellValue']),
111
- /**
112
- * The column of the row that the current cell belongs to.
113
- */
114
- colDef: PropTypes.object.isRequired,
115
- debounceMs: PropTypes.number,
116
- /**
117
- * The column field of the cell that triggered the event.
118
- */
119
- field: PropTypes.string.isRequired,
120
- /**
121
- * The cell value formatted with the column valueFormatter.
122
- */
123
- formattedValue: PropTypes.any,
124
- /**
125
- * If true, the cell is the active element.
126
- */
127
- hasFocus: PropTypes.bool.isRequired,
128
- /**
129
- * The grid row id.
130
- */
131
- id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
132
- /**
133
- * If true, the cell is editable.
134
- */
135
- isEditable: PropTypes.bool,
136
- isProcessingProps: PropTypes.bool,
137
- isValidating: PropTypes.bool,
138
- /**
139
- * Callback called when the value is changed by the user.
140
- * @param {React.ChangeEvent<HTMLInputElement>} event The event source of the callback.
141
- * @param {Date | null} newValue The value that is going to be passed to `apiRef.current.setEditCellValue`.
142
- * @returns {Promise<void> | void} A promise to be awaited before calling `apiRef.current.setEditCellValue`
143
- */
144
- onValueChange: PropTypes.func,
145
- /**
146
- * The row model of the row that the current cell belongs to.
147
- */
148
- row: PropTypes.any.isRequired,
149
- /**
150
- * The node of the row that the current cell belongs to.
151
- */
152
- rowNode: PropTypes.object.isRequired,
153
- /**
154
- * the tabIndex value.
155
- */
156
- tabIndex: PropTypes.oneOf([-1, 0]).isRequired,
157
- /**
158
- * The cell value.
159
- * If the column has `valueGetter`, use `params.row` to directly access the fields.
160
- */
161
- value: PropTypes.any
162
- } : void 0;
163
96
  export { GridEditInputCell };
164
97
  export const renderEditInputCell = params => /*#__PURE__*/_jsx(GridEditInputCell, _extends({}, params));
@@ -544,6 +544,7 @@ export const GridRootStyles = styled('div', {
544
544
  lineHeight: 'inherit'
545
545
  },
546
546
  [`& .${c.cellEmpty}`]: {
547
+ flex: 1,
547
548
  padding: 0,
548
549
  height: 'unset'
549
550
  },
@@ -1,6 +1,5 @@
1
1
  import * as React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import MenuItem from '@mui/material/MenuItem';
4
3
  import ListItemIcon from '@mui/material/ListItemIcon';
5
4
  import ListItemText from '@mui/material/ListItemText';
6
5
  import { useGridApiContext } from "../../../../hooks/utils/useGridApiContext.js";
@@ -20,7 +19,7 @@ function GridColumnMenuFilterItem(props) {
20
19
  if (rootProps.disableColumnFilter || !colDef.filterable) {
21
20
  return null;
22
21
  }
23
- return /*#__PURE__*/_jsxs(MenuItem, {
22
+ return /*#__PURE__*/_jsxs(rootProps.slots.baseMenuItem, {
24
23
  onClick: showFilter,
25
24
  children: [/*#__PURE__*/_jsx(ListItemIcon, {
26
25
  children: /*#__PURE__*/_jsx(rootProps.slots.columnMenuFilterIcon, {
@@ -1,6 +1,5 @@
1
1
  import * as React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import MenuItem from '@mui/material/MenuItem';
4
3
  import ListItemIcon from '@mui/material/ListItemIcon';
5
4
  import ListItemText from '@mui/material/ListItemText';
6
5
  import { useGridApiContext } from "../../../../hooks/utils/useGridApiContext.js";
@@ -36,7 +35,7 @@ function GridColumnMenuHideItem(props) {
36
35
  if (colDef.hideable === false) {
37
36
  return null;
38
37
  }
39
- return /*#__PURE__*/_jsxs(MenuItem, {
38
+ return /*#__PURE__*/_jsxs(rootProps.slots.baseMenuItem, {
40
39
  onClick: toggleColumn,
41
40
  disabled: disabled,
42
41
  children: [/*#__PURE__*/_jsx(ListItemIcon, {
@@ -1,6 +1,5 @@
1
1
  import * as React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import MenuItem from '@mui/material/MenuItem';
4
3
  import ListItemIcon from '@mui/material/ListItemIcon';
5
4
  import ListItemText from '@mui/material/ListItemText';
6
5
  import { GridPreferencePanelsValue } from "../../../../hooks/features/preferencesPanel/gridPreferencePanelsValue.js";
@@ -20,7 +19,7 @@ function GridColumnMenuManageItem(props) {
20
19
  if (rootProps.disableColumnSelector) {
21
20
  return null;
22
21
  }
23
- return /*#__PURE__*/_jsxs(MenuItem, {
22
+ return /*#__PURE__*/_jsxs(rootProps.slots.baseMenuItem, {
24
23
  onClick: showColumns,
25
24
  children: [/*#__PURE__*/_jsx(ListItemIcon, {
26
25
  children: /*#__PURE__*/_jsx(rootProps.slots.columnMenuManageColumnsIcon, {
@@ -1,6 +1,5 @@
1
1
  import * as React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import MenuItem from '@mui/material/MenuItem';
4
3
  import ListItemIcon from '@mui/material/ListItemIcon';
5
4
  import ListItemText from '@mui/material/ListItemText';
6
5
  import { useGridSelector } from "../../../../hooks/utils/useGridSelector.js";
@@ -37,7 +36,7 @@ function GridColumnMenuSortItem(props) {
37
36
  return typeof label === 'function' ? label(colDef) : label;
38
37
  };
39
38
  return /*#__PURE__*/_jsxs(React.Fragment, {
40
- children: [sortingOrder.includes('asc') && sortDirection !== 'asc' ? /*#__PURE__*/_jsxs(MenuItem, {
39
+ children: [sortingOrder.includes('asc') && sortDirection !== 'asc' ? /*#__PURE__*/_jsxs(rootProps.slots.baseMenuItem, {
41
40
  onClick: onSortMenuItemClick,
42
41
  "data-value": "asc",
43
42
  children: [/*#__PURE__*/_jsx(ListItemIcon, {
@@ -47,7 +46,7 @@ function GridColumnMenuSortItem(props) {
47
46
  }), /*#__PURE__*/_jsx(ListItemText, {
48
47
  children: getLabel('columnMenuSortAsc')
49
48
  })]
50
- }) : null, sortingOrder.includes('desc') && sortDirection !== 'desc' ? /*#__PURE__*/_jsxs(MenuItem, {
49
+ }) : null, sortingOrder.includes('desc') && sortDirection !== 'desc' ? /*#__PURE__*/_jsxs(rootProps.slots.baseMenuItem, {
51
50
  onClick: onSortMenuItemClick,
52
51
  "data-value": "desc",
53
52
  children: [/*#__PURE__*/_jsx(ListItemIcon, {
@@ -57,7 +56,7 @@ function GridColumnMenuSortItem(props) {
57
56
  }), /*#__PURE__*/_jsx(ListItemText, {
58
57
  children: getLabel('columnMenuSortDesc')
59
58
  })]
60
- }) : null, sortingOrder.includes(null) && sortDirection != null ? /*#__PURE__*/_jsxs(MenuItem, {
59
+ }) : null, sortingOrder.includes(null) && sortDirection != null ? /*#__PURE__*/_jsxs(rootProps.slots.baseMenuItem, {
61
60
  onClick: onSortMenuItemClick,
62
61
  children: [/*#__PURE__*/_jsx(ListItemIcon, {}), /*#__PURE__*/_jsx(ListItemText, {
63
62
  children: apiRef.current.getLocaleText('columnMenuUnsort')
@@ -16,7 +16,7 @@ export interface GridPanelProps extends Partial<React.ComponentProps<typeof Grid
16
16
  open: boolean;
17
17
  }
18
18
  export declare const gridPanelClasses: Record<keyof GridPanelClasses, string>;
19
- declare const GridPanelRoot: import("@emotion/styled").StyledComponent<Pick<import("@mui/material").PopperProps & React.RefAttributes<HTMLDivElement>, "hidden" | "color" | "content" | "style" | "open" | "translate" | "container" | "transition" | "slot" | "title" | "ref" | "suppressHydrationWarning" | "className" | "id" | "lang" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "accessKey" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "nonce" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "component" | "sx" | "components" | "componentsProps" | "placement" | "disablePortal" | "modifiers" | "anchorEl" | "keepMounted" | "popperOptions" | "popperRef" | "slotProps" | "slots"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
19
+ declare const GridPanelRoot: import("@emotion/styled").StyledComponent<Pick<import("@mui/material").PopperProps & React.RefAttributes<HTMLDivElement>, "hidden" | "color" | "content" | "style" | "open" | "translate" | "container" | "transition" | "slot" | "title" | "ref" | "suppressHydrationWarning" | "className" | "id" | "lang" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "nonce" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "component" | "sx" | "components" | "componentsProps" | "placement" | "disablePortal" | "modifiers" | "anchorEl" | "keepMounted" | "popperOptions" | "popperRef" | "slotProps" | "slots"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
20
20
  ownerState: OwnerState;
21
21
  }, {}, {}>;
22
22
  declare const GridPanel: React.ForwardRefExoticComponent<Omit<GridPanelProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import { GridToolbarContainerProps } from '../containers/GridToolbarContainer';
3
3
  import { GridToolbarExportProps } from './GridToolbarExport';
4
4
  import { GridToolbarQuickFilterProps } from './GridToolbarQuickFilter';
5
- export interface GridToolbarProps extends GridToolbarContainerProps, Omit<GridToolbarExportProps, 'color'> {
5
+ export interface GridToolbarProps extends GridToolbarContainerProps, GridToolbarExportProps {
6
6
  /**
7
7
  * Show the quick filter component.
8
8
  * @default false
@@ -13,5 +13,5 @@ export interface GridToolbarProps extends GridToolbarContainerProps, Omit<GridTo
13
13
  */
14
14
  quickFilterProps?: GridToolbarQuickFilterProps;
15
15
  }
16
- declare const GridToolbar: React.ForwardRefExoticComponent<Omit<GridToolbarProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
16
+ declare const GridToolbar: React.ForwardRefExoticComponent<GridToolbarProps & React.RefAttributes<HTMLDivElement>>;
17
17
  export { GridToolbar };
@@ -14,14 +14,15 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
14
  const GridToolbar = /*#__PURE__*/React.forwardRef(function GridToolbar(props, ref) {
15
15
  // TODO v7: think about where export option should be passed.
16
16
  // from slotProps={{ toolbarExport: { ...exportOption } }} seems to be more appropriate
17
- const {
17
+ const _ref = props,
18
+ {
18
19
  csvOptions,
19
20
  printOptions,
20
21
  excelOptions,
21
22
  showQuickFilter = false,
22
23
  quickFilterProps = {}
23
- } = props,
24
- other = _objectWithoutPropertiesLoose(props, _excluded);
24
+ } = _ref,
25
+ other = _objectWithoutPropertiesLoose(_ref, _excluded);
25
26
  const rootProps = useGridRootProps();
26
27
  if (rootProps.disableColumnFilter && rootProps.disableColumnSelector && rootProps.disableDensitySelector && !showQuickFilter) {
27
28
  return null;
@@ -32,7 +33,7 @@ const GridToolbar = /*#__PURE__*/React.forwardRef(function GridToolbar(props, re
32
33
  children: [/*#__PURE__*/_jsx(GridToolbarColumnsButton, {}), /*#__PURE__*/_jsx(GridToolbarFilterButton, {}), /*#__PURE__*/_jsx(GridToolbarDensitySelector, {}), /*#__PURE__*/_jsx(GridToolbarExport, {
33
34
  csvOptions: csvOptions,
34
35
  printOptions: printOptions
35
- // TODO: remove the reference to excelOptions in community package
36
+ // @ts-ignore
36
37
  ,
37
38
  excelOptions: excelOptions
38
39
  }), /*#__PURE__*/_jsx("div", {
@@ -47,6 +48,8 @@ process.env.NODE_ENV !== "production" ? GridToolbar.propTypes = {
47
48
  // | These PropTypes are generated from the TypeScript type definitions |
48
49
  // | To update them edit the TypeScript types and run "pnpm proptypes" |
49
50
  // ----------------------------------------------------------------------
51
+ csvOptions: PropTypes.object,
52
+ printOptions: PropTypes.object,
50
53
  /**
51
54
  * Props passed to the quick filter component.
52
55
  */
@@ -56,6 +59,11 @@ process.env.NODE_ENV !== "production" ? GridToolbar.propTypes = {
56
59
  * @default false
57
60
  */
58
61
  showQuickFilter: PropTypes.bool,
62
+ /**
63
+ * The props used for each slot inside.
64
+ * @default {}
65
+ */
66
+ slotProps: PropTypes.object,
59
67
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
60
68
  } : void 0;
61
69
  export { GridToolbar };
@@ -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 { unstable_useId as useId } from '@mui/material/utils';
4
+ import useId from '@mui/utils/useId';
5
5
  import { useGridSelector } from "../../hooks/utils/useGridSelector.js";
6
6
  import { gridPreferencePanelStateSelector } from "../../hooks/features/preferencesPanel/gridPreferencePanelSelector.js";
7
7
  import { GridPreferencePanelsValue } from "../../hooks/features/preferencesPanel/gridPreferencePanelsValue.js";
@@ -2,8 +2,6 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import { unstable_useId as useId, unstable_useForkRef as useForkRef } from '@mui/utils';
5
- import MenuList from '@mui/material/MenuList';
6
- import MenuItem from '@mui/material/MenuItem';
7
5
  import ListItemIcon from '@mui/material/ListItemIcon';
8
6
  import { gridDensitySelector } from "../../hooks/features/density/densitySelector.js";
9
7
  import { isHideMenuKey } from "../../utils/keyboardUtils.js";
@@ -74,7 +72,7 @@ const GridToolbarDensitySelector = /*#__PURE__*/React.forwardRef(function GridTo
74
72
  if (rootProps.disableDensitySelector) {
75
73
  return null;
76
74
  }
77
- const densityElements = densityOptions.map((option, index) => /*#__PURE__*/_jsxs(MenuItem, {
75
+ const densityElements = densityOptions.map((option, index) => /*#__PURE__*/_jsxs(rootProps.slots.baseMenuItem, {
78
76
  onClick: () => handleDensityUpdate(option.value),
79
77
  selected: option.value === density,
80
78
  children: [/*#__PURE__*/_jsx(ListItemIcon, {
@@ -105,7 +103,7 @@ const GridToolbarDensitySelector = /*#__PURE__*/React.forwardRef(function GridTo
105
103
  target: buttonRef.current,
106
104
  onClose: handleDensitySelectorClose,
107
105
  position: "bottom-start",
108
- children: /*#__PURE__*/_jsx(MenuList, {
106
+ children: /*#__PURE__*/_jsx(rootProps.slots.baseMenuList, {
109
107
  id: densityMenuId,
110
108
  className: gridClasses.menuList,
111
109
  "aria-labelledby": densityButtonId,
@@ -26,7 +26,7 @@ export interface GridToolbarExportProps {
26
26
  button?: Partial<ButtonProps>;
27
27
  tooltip?: Partial<TooltipProps>;
28
28
  };
29
- [key: string]: any;
29
+ [x: `data-${string}`]: string;
30
30
  }
31
31
  declare function GridCsvExportMenuItem(props: GridCsvExportMenuItemProps): React.JSX.Element;
32
32
  declare namespace GridCsvExportMenuItem {
@@ -36,5 +36,5 @@ declare function GridPrintExportMenuItem(props: GridPrintExportMenuItemProps): R
36
36
  declare namespace GridPrintExportMenuItem {
37
37
  var propTypes: any;
38
38
  }
39
- declare const GridToolbarExport: React.ForwardRefExoticComponent<Omit<GridToolbarExportProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
39
+ declare const GridToolbarExport: React.ForwardRefExoticComponent<GridToolbarExportProps & React.RefAttributes<HTMLButtonElement>>;
40
40
  export { GridToolbarExport, GridCsvExportMenuItem, GridPrintExportMenuItem };
@@ -5,18 +5,19 @@ const _excluded = ["hideMenu", "options"],
5
5
  _excluded3 = ["csvOptions", "printOptions", "excelOptions"];
6
6
  import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
8
- import MenuItem from '@mui/material/MenuItem';
8
+ import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
9
9
  import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
10
10
  import { GridToolbarExportContainer } from "./GridToolbarExportContainer.js";
11
11
  import { jsx as _jsx } from "react/jsx-runtime";
12
12
  function GridCsvExportMenuItem(props) {
13
13
  const apiRef = useGridApiContext();
14
+ const rootProps = useGridRootProps();
14
15
  const {
15
16
  hideMenu,
16
17
  options
17
18
  } = props,
18
19
  other = _objectWithoutPropertiesLoose(props, _excluded);
19
- return /*#__PURE__*/_jsx(MenuItem, _extends({
20
+ return /*#__PURE__*/_jsx(rootProps.slots.baseMenuItem, _extends({
20
21
  onClick: () => {
21
22
  apiRef.current.exportDataAsCsv(options);
22
23
  hideMenu?.();
@@ -47,12 +48,13 @@ process.env.NODE_ENV !== "production" ? GridCsvExportMenuItem.propTypes = {
47
48
  } : void 0;
48
49
  function GridPrintExportMenuItem(props) {
49
50
  const apiRef = useGridApiContext();
51
+ const rootProps = useGridRootProps();
50
52
  const {
51
53
  hideMenu,
52
54
  options
53
55
  } = props,
54
56
  other = _objectWithoutPropertiesLoose(props, _excluded2);
55
- return /*#__PURE__*/_jsx(MenuItem, _extends({
57
+ return /*#__PURE__*/_jsx(rootProps.slots.baseMenuItem, _extends({
56
58
  onClick: () => {
57
59
  apiRef.current.exportDataAsPrint(options);
58
60
  hideMenu?.();
@@ -82,12 +84,13 @@ process.env.NODE_ENV !== "production" ? GridPrintExportMenuItem.propTypes = {
82
84
  })
83
85
  } : void 0;
84
86
  const GridToolbarExport = /*#__PURE__*/React.forwardRef(function GridToolbarExport(props, ref) {
85
- const {
87
+ const _ref = props,
88
+ {
86
89
  csvOptions = {},
87
90
  printOptions = {},
88
91
  excelOptions
89
- } = props,
90
- other = _objectWithoutPropertiesLoose(props, _excluded3);
92
+ } = _ref,
93
+ other = _objectWithoutPropertiesLoose(_ref, _excluded3);
91
94
  const apiRef = useGridApiContext();
92
95
  const preProcessedButtons = apiRef.current.unstable_applyPipeProcessors('exportMenu', [], {
93
96
  excelOptions,
@@ -2,7 +2,6 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import { unstable_useId as useId, unstable_useForkRef as useForkRef } from '@mui/utils';
5
- import MenuList from '@mui/material/MenuList';
6
5
  import { isHideMenuKey } from "../../utils/keyboardUtils.js";
7
6
  import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
8
7
  import { GridMenu } from "../menu/GridMenu.js";
@@ -63,7 +62,7 @@ const GridToolbarExportContainer = /*#__PURE__*/React.forwardRef(function GridTo
63
62
  target: buttonRef.current,
64
63
  onClose: handleMenuClose,
65
64
  position: "bottom-start",
66
- children: /*#__PURE__*/_jsx(MenuList, {
65
+ children: /*#__PURE__*/_jsx(rootProps.slots.baseMenuList, {
67
66
  id: exportMenuId,
68
67
  className: gridClasses.menuList,
69
68
  "aria-labelledby": exportButtonId,
@@ -1,7 +1,7 @@
1
1
  export * from './GridToolbar';
2
2
  export * from './GridToolbarColumnsButton';
3
3
  export * from './GridToolbarDensitySelector';
4
- export type { GridExportDisplayOptions, GridExportMenuItemProps, GridCsvExportMenuItemProps, GridPrintExportMenuItemProps, } from './GridToolbarExport';
4
+ export type { GridExportDisplayOptions, GridExportMenuItemProps, GridCsvExportMenuItemProps, GridPrintExportMenuItemProps, GridToolbarExportProps, } from './GridToolbarExport';
5
5
  export { GridCsvExportMenuItem, GridPrintExportMenuItem, GridToolbarExport, } from './GridToolbarExport';
6
6
  export * from './GridToolbarFilterButton';
7
7
  export * from './GridToolbarExportContainer';
@@ -193,8 +193,10 @@ export const useGridColumnResize = (apiRef, props) => {
193
193
  const prevWidth = refs.columnHeaderElement.offsetWidth;
194
194
  const widthDiff = newWidth - prevWidth;
195
195
  const columnWidthDiff = newWidth - refs.initialColWidth;
196
- const newTotalWidth = refs.initialTotalWidth + columnWidthDiff;
197
- apiRef.current.rootElementRef?.current?.style.setProperty('--DataGrid-rowWidth', `${newTotalWidth}px`);
196
+ if (columnWidthDiff > 0) {
197
+ const newTotalWidth = refs.initialTotalWidth + columnWidthDiff;
198
+ apiRef.current.rootElementRef?.current?.style.setProperty('--DataGrid-rowWidth', `${newTotalWidth}px`);
199
+ }
198
200
  refs.colDef.computedWidth = newWidth;
199
201
  refs.colDef.width = newWidth;
200
202
  refs.colDef.flex = 0;
@@ -5,7 +5,7 @@ import { exportAs } from "../../../utils/exportAs.js";
5
5
  import { buildCSV } from "./serializers/csvSerializer.js";
6
6
  import { getColumnsToExport, defaultGetRowsToExport } from "./utils.js";
7
7
  import { useGridRegisterPipeProcessor } from "../../core/pipeProcessing/index.js";
8
- import { GridCsvExportMenuItem } from "../../../components/toolbar/GridToolbarExport.js";
8
+ import { GridCsvExportMenuItem } from "../../../components/toolbar/index.js";
9
9
  import { jsx as _jsx } from "react/jsx-runtime";
10
10
  /**
11
11
  * @requires useGridColumns (state)
@@ -11,7 +11,7 @@ import { GRID_ID_AUTOGENERATED } from "../rows/gridRowsUtils.js";
11
11
  import { defaultGetRowsToExport, getColumnsToExport } from "./utils.js";
12
12
  import { getDerivedPaginationModel } from "../pagination/useGridPaginationModel.js";
13
13
  import { useGridRegisterPipeProcessor } from "../../core/pipeProcessing/index.js";
14
- import { GridPrintExportMenuItem } from "../../../components/toolbar/GridToolbarExport.js";
14
+ import { GridPrintExportMenuItem } from "../../../components/toolbar/index.js";
15
15
  import { getTotalHeaderHeight } from "../columns/gridColumnsUtils.js";
16
16
  import { GRID_CHECKBOX_SELECTION_COL_DEF } from "../../../colDef/gridCheckboxSelectionColDef.js";
17
17
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -75,7 +75,7 @@ export const useGridPaginationModel = (apiRef, props) => {
75
75
  pagination: _extends({}, state.pagination, {
76
76
  paginationModel: getDerivedPaginationModel(state.pagination, props.signature, paginationModel)
77
77
  })
78
- }));
78
+ }), 'setPaginationModel');
79
79
  }, [apiRef, logger, props.signature]);
80
80
  const paginationModelApi = {
81
81
  setPage,
@@ -113,7 +113,7 @@ export const useGridPaginationModel = (apiRef, props) => {
113
113
  pagination: _extends({}, state.pagination, {
114
114
  paginationModel: getDerivedPaginationModel(state.pagination, props.signature, paginationModel)
115
115
  })
116
- }));
116
+ }), 'stateRestorePreProcessing');
117
117
  return params;
118
118
  }, [apiRef, props.autoPageSize, props.signature]);
119
119
  useGridRegisterPipeProcessor(apiRef, 'exportState', stateExportPreProcessing);
@@ -37,7 +37,7 @@ export declare function calculatePinnedRowsHeight(apiRef: React.MutableRefObject
37
37
  top: number;
38
38
  bottom: number;
39
39
  };
40
- export declare function getMinimalContentHeight(apiRef: React.MutableRefObject<GridApiCommunity>): string;
40
+ export declare const minimalContentHeight = "var(--DataGrid-overlayHeight, calc(var(--height) * 2))";
41
41
  export declare function computeRowsUpdates(apiRef: React.MutableRefObject<GridApiCommunity>, updates: GridRowModelUpdate[], getRowId: DataGridProcessedProps['getRowId']): GridRowModelUpdate[];
42
42
  export declare const getValidRowHeight: (rowHeightProp: any, defaultRowHeight: number, warningMessage: string) => number;
43
43
  export declare const rowHeightWarning: string;
@@ -1,6 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import { gridPinnedRowsSelector } from "./gridRowsSelector.js";
3
- import { gridDimensionsSelector } from "../dimensions/gridDimensionsSelectors.js";
4
3
  export const GRID_ROOT_GROUP_ID = `auto-generated-group-node-root`;
5
4
  export const GRID_ID_AUTOGENERATED = Symbol('mui.id_autogenerated');
6
5
  export const buildRootGroup = () => ({
@@ -285,10 +284,7 @@ export function calculatePinnedRowsHeight(apiRef) {
285
284
  bottom: bottomPinnedRowsHeight
286
285
  };
287
286
  }
288
- export function getMinimalContentHeight(apiRef) {
289
- const dimensions = gridDimensionsSelector(apiRef.current.state);
290
- return `var(--DataGrid-overlayHeight, ${2 * dimensions.rowHeight}px)`;
291
- }
287
+ export const minimalContentHeight = 'var(--DataGrid-overlayHeight, calc(var(--height) * 2))';
292
288
  export function computeRowsUpdates(apiRef, updates, getRowId) {
293
289
  const nonPinnedRowsUpdates = [];
294
290
  updates.forEach(update => {
@@ -21,11 +21,11 @@ import { clamp, range } from "../../../utils/utils.js";
21
21
  import { selectedIdsLookupSelector } from "../rowSelection/gridRowSelectionSelector.js";
22
22
  import { gridRowsMetaSelector } from "../rows/gridRowsMetaSelector.js";
23
23
  import { getFirstNonSpannedColumnToRender } from "../columns/gridColumnsUtils.js";
24
- import { getMinimalContentHeight } from "../rows/gridRowsUtils.js";
25
24
  import { gridRenderContextSelector, gridVirtualizationRowEnabledSelector, gridVirtualizationColumnEnabledSelector } from "./gridVirtualizationSelectors.js";
26
25
  import { EMPTY_RENDER_CONTEXT } from "./useGridVirtualization.js";
27
26
  import { gridRowSpanningHiddenCellsOriginMapSelector } from "../rows/gridRowSpanningSelectors.js";
28
27
  import { gridListColumnSelector } from "../listView/gridListViewSelectors.js";
28
+ import { minimalContentHeight } from "../rows/gridRowsUtils.js";
29
29
  import { jsx as _jsx } from "react/jsx-runtime";
30
30
  const MINIMUM_COLUMN_WIDTH = 50;
31
31
  var ScrollDirection = /*#__PURE__*/function (ScrollDirection) {
@@ -381,11 +381,11 @@ export const useGridVirtualScroller = () => {
381
381
  flexBasis: contentHeight,
382
382
  flexShrink: 0
383
383
  };
384
- if (rootProps.autoHeight && currentPage.rows.length === 0) {
385
- size.flexBasis = getMinimalContentHeight(apiRef); // Give room to show the overlay when there no rows.
384
+ if (size.flexBasis === 0) {
385
+ size.flexBasis = minimalContentHeight; // Give room to show the overlay when there no rows.
386
386
  }
387
387
  return size;
388
- }, [apiRef, columnsTotalWidth, contentHeight, needsHorizontalScrollbar, rootProps.autoHeight, currentPage.rows.length]);
388
+ }, [columnsTotalWidth, contentHeight, needsHorizontalScrollbar]);
389
389
  React.useEffect(() => {
390
390
  apiRef.current.publishEvent('virtualScrollerContentSizeChange');
391
391
  }, [apiRef, contentSize]);