@mui/x-data-grid 8.27.0 → 8.27.3

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 (84) hide show
  1. package/CHANGELOG.md +158 -0
  2. package/DataGrid/DataGrid.js +7 -0
  3. package/DataGrid/index.js +0 -1
  4. package/components/GridColumnSortButton.js +2 -2
  5. package/components/GridScrollArea.js +2 -2
  6. package/components/GridScrollShadows.js +2 -2
  7. package/components/GridSkeletonLoadingOverlay.js +2 -2
  8. package/components/base/GridOverlays.js +3 -3
  9. package/components/columnHeaders/GridColumnHeaderItem.js +31 -1
  10. package/components/columnHeaders/GridColumnHeaderTitle.js +2 -2
  11. package/components/columnHeaders/GridIconButtonContainer.js +2 -2
  12. package/components/containers/GridRootStyles.js +23 -217
  13. package/components/menu/columnMenu/GridColumnMenu.d.ts +2 -2
  14. package/components/menu/columnMenu/GridColumnMenu.js +2 -0
  15. package/components/menu/columnMenu/GridColumnMenuProps.d.ts +9 -1
  16. package/components/menu/columnMenu/index.d.ts +1 -1
  17. package/components/menu/columnMenu/index.js +0 -12
  18. package/components/toolbar/GridToolbarQuickFilter.js +4 -4
  19. package/components/toolbarV8/GridToolbar.js +3 -3
  20. package/components/toolbarV8/Toolbar.d.ts +1 -1
  21. package/components/toolbarV8/Toolbar.js +2 -2
  22. package/components/virtualization/GridBottomContainer.js +2 -2
  23. package/components/virtualization/GridMainContainer.js +3 -3
  24. package/components/virtualization/GridTopContainer.js +2 -2
  25. package/components/virtualization/GridVirtualScrollbar.d.ts +1 -1
  26. package/components/virtualization/GridVirtualScrollbar.js +5 -5
  27. package/components/virtualization/GridVirtualScroller.js +2 -2
  28. package/components/virtualization/GridVirtualScrollerFiller.js +6 -6
  29. package/constants/dataGridPropsDefaultValues.js +1 -0
  30. package/esm/DataGrid/DataGrid.js +7 -0
  31. package/esm/DataGrid/index.js +0 -1
  32. package/esm/components/GridColumnSortButton.js +1 -1
  33. package/esm/components/GridScrollArea.js +1 -1
  34. package/esm/components/GridScrollShadows.js +1 -1
  35. package/esm/components/GridSkeletonLoadingOverlay.js +1 -1
  36. package/esm/components/base/GridOverlays.js +1 -1
  37. package/esm/components/columnHeaders/GridColumnHeaderItem.js +31 -1
  38. package/esm/components/columnHeaders/GridColumnHeaderTitle.js +1 -1
  39. package/esm/components/columnHeaders/GridIconButtonContainer.js +1 -1
  40. package/esm/components/containers/GridRootStyles.js +23 -217
  41. package/esm/components/menu/columnMenu/GridColumnMenu.d.ts +2 -2
  42. package/esm/components/menu/columnMenu/GridColumnMenu.js +2 -0
  43. package/esm/components/menu/columnMenu/GridColumnMenuProps.d.ts +9 -1
  44. package/esm/components/menu/columnMenu/index.d.ts +1 -1
  45. package/esm/components/menu/columnMenu/index.js +0 -1
  46. package/esm/components/toolbar/GridToolbarQuickFilter.js +1 -1
  47. package/esm/components/toolbarV8/GridToolbar.js +1 -1
  48. package/esm/components/toolbarV8/Toolbar.d.ts +1 -1
  49. package/esm/components/toolbarV8/Toolbar.js +1 -1
  50. package/esm/components/virtualization/GridBottomContainer.js +1 -1
  51. package/esm/components/virtualization/GridMainContainer.js +1 -1
  52. package/esm/components/virtualization/GridTopContainer.js +1 -1
  53. package/esm/components/virtualization/GridVirtualScrollbar.d.ts +1 -1
  54. package/esm/components/virtualization/GridVirtualScrollbar.js +1 -1
  55. package/esm/components/virtualization/GridVirtualScroller.js +1 -1
  56. package/esm/components/virtualization/GridVirtualScrollerFiller.js +1 -1
  57. package/esm/constants/dataGridPropsDefaultValues.js +1 -0
  58. package/esm/hooks/features/columnMenu/getColumnMenuItemKeys.d.ts +17 -0
  59. package/esm/hooks/features/columnMenu/getColumnMenuItemKeys.js +36 -0
  60. package/esm/hooks/features/columnMenu/useGridColumnMenuSlots.js +11 -16
  61. package/esm/hooks/features/dataSource/models.d.ts +4 -1
  62. package/esm/hooks/features/dataSource/useGridDataSourceBase.d.ts +5 -2
  63. package/esm/hooks/features/dataSource/useGridDataSourceBase.js +93 -6
  64. package/esm/hooks/features/editing/useGridRowEditing.js +14 -4
  65. package/esm/index.js +1 -1
  66. package/esm/internals/index.d.ts +1 -0
  67. package/esm/models/api/gridEditingApi.d.ts +0 -1
  68. package/esm/models/params/gridRowParams.d.ts +0 -1
  69. package/esm/models/props/DataGridProps.d.ts +7 -0
  70. package/hooks/features/columnMenu/getColumnMenuItemKeys.d.ts +17 -0
  71. package/hooks/features/columnMenu/getColumnMenuItemKeys.js +43 -0
  72. package/hooks/features/columnMenu/useGridColumnMenuSlots.js +11 -16
  73. package/hooks/features/dataSource/models.d.ts +4 -1
  74. package/hooks/features/dataSource/useGridDataSourceBase.d.ts +5 -2
  75. package/hooks/features/dataSource/useGridDataSourceBase.js +92 -5
  76. package/hooks/features/editing/useGridRowEditing.js +14 -4
  77. package/index.js +1 -1
  78. package/internals/index.d.ts +1 -0
  79. package/models/api/gridEditingApi.d.ts +0 -1
  80. package/models/params/gridRowParams.d.ts +0 -1
  81. package/models/props/DataGridProps.d.ts +7 -0
  82. package/package.json +1 -1
  83. package/esm/index.css +0 -5
  84. package/index.css +0 -5
@@ -16,226 +16,32 @@ const separatorIconDragStyles = {
16
16
  // https://github.com/emotion-js/emotion/issues/1105#issuecomment-1722524968
17
17
  const ignoreSsrWarning = '/* emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason */';
18
18
  const shouldShowBorderTopRightRadiusSelector = apiRef => !apiRef.current.state.dimensions.isReady ? apiRef.current.state.dimensions.scrollbarSize === 0 : apiRef.current.state.dimensions.hasScrollX && (!apiRef.current.state.dimensions.hasScrollY || apiRef.current.state.dimensions.scrollbarSize === 0);
19
+ const elementOverrides = {
20
+ root: ['autoHeight', 'autosizing', 'root--densityStandard', 'root--densityComfortable', 'root--densityCompact', 'root--disableUserSelection', 'root--noToolbar', 'withVerticalBorder'],
21
+ children: ['actionsCell', 'booleanCell', 'cell', 'cell--editable', 'cell--editing', 'cell--flex', 'cell--pinnedLeft', 'cell--pinnedRight', 'cell--rangeBottom', 'cell--rangeLeft', 'cell--rangeRight', 'cell--rangeTop', 'cell--selectionMode', 'cell--textCenter', 'cell--textLeft', 'cell--textRight', 'cell--withLeftBorder', 'cell--withRightBorder', 'cellCheckbox', 'cellEmpty', 'cellOffsetLeft', 'cellSkeleton', 'checkboxInput', 'columnHeader', 'columnHeader--alignCenter', 'columnHeader--alignLeft', 'columnHeader--alignRight', 'columnHeader--dragging', 'columnHeader--emptyGroup', 'columnHeader--filledGroup', 'columnHeader--filtered', 'columnHeader--last', 'columnHeader--moving', 'columnHeader--numeric', 'columnHeader--pinnedLeft', 'columnHeader--pinnedRight', 'columnHeader--siblingFocused', 'columnHeader--sortable', 'columnHeader--sorted', 'columnHeader--withLeftBorder', 'columnHeader--withRightBorder', 'columnHeaderCheckbox', 'columnHeaderDraggableContainer', 'columnHeaderTitleContainer', 'columnHeaderTitleContainerContent', 'columnSeparator', 'columnSeparator--resizable', 'columnSeparator--resizing', 'columnSeparator--sideLeft', 'columnSeparator--sideRight', 'container--bottom', 'container--top', 'detailPanelToggleCell', 'detailPanelToggleCell--expanded', 'editBooleanCell', 'filterIcon', 'filler--borderBottom', 'filler--pinnedLeft', 'filler--pinnedRight', 'groupingCriteriaCell', 'groupingCriteriaCellLoadingContainer', 'groupingCriteriaCellToggle', 'headerFilterRow', 'iconSeparator', 'menuIcon', 'menuIconButton', 'menuList', 'menuOpen', 'overlayWrapperInner', 'pinnedRows', 'pinnedRows--bottom', 'pinnedRows--top', 'row', 'row--borderBottom', 'row--detailPanelExpanded', 'row--dragging', 'row--dynamicHeight', 'row--editable', 'row--editing', 'row--firstVisible', 'row--lastVisible', 'rowReorderCell', 'rowReorderCell--draggable', 'rowReorderCellContainer', 'rowReorderCellPlaceholder', 'rowSkeleton', 'scrollbar', 'scrollbar--horizontal', 'scrollbar--vertical', 'scrollbarFiller', 'scrollbarFiller--pinnedRight', 'sortIcon', 'treeDataGroupingCell', 'treeDataGroupingCellLoadingContainer', 'treeDataGroupingCellToggle', 'withBorderColor', 'row--beingDragged']
22
+ };
19
23
  export const GridRootStyles = styled('div', {
20
24
  name: 'MuiDataGrid',
21
25
  slot: 'Root',
22
- overridesResolver: (props, styles) => [
23
- // Root overrides
24
- styles.root, {
25
- [`&.${c.autoHeight}`]: styles.autoHeight
26
- }, {
27
- [`&.${c.autosizing}`]: styles.autosizing
28
- }, {
29
- [`&.${c['root--densityStandard']}`]: styles['root--densityStandard']
30
- }, {
31
- [`&.${c['root--densityComfortable']}`]: styles['root--densityComfortable']
32
- }, {
33
- [`&.${c['root--densityCompact']}`]: styles['root--densityCompact']
34
- }, {
35
- [`&.${c['root--disableUserSelection']}`]: styles['root--disableUserSelection']
36
- }, {
37
- [`&.${c['root--noToolbar']}`]: styles['root--noToolbar']
38
- }, {
39
- [`&.${c.withVerticalBorder}`]: styles.withVerticalBorder
40
- },
41
- // Child element overrides
42
- // - Only declare overrides here for class names that are not applied to `styled` components.
43
- // - For `styled` components, declare overrides in the component itself.
44
- {
45
- [`& .${c.actionsCell}`]: styles.actionsCell
46
- }, {
47
- [`& .${c.booleanCell}`]: styles.booleanCell
48
- }, {
49
- [`& .${c.cell}`]: styles.cell
50
- }, {
51
- [`& .${c['cell--editable']}`]: styles['cell--editable']
52
- }, {
53
- [`& .${c['cell--editing']}`]: styles['cell--editing']
54
- }, {
55
- [`& .${c['cell--flex']}`]: styles['cell--flex']
56
- }, {
57
- [`& .${c['cell--pinnedLeft']}`]: styles['cell--pinnedLeft']
58
- }, {
59
- [`& .${c['cell--pinnedRight']}`]: styles['cell--pinnedRight']
60
- }, {
61
- [`& .${c['cell--rangeBottom']}`]: styles['cell--rangeBottom']
62
- }, {
63
- [`& .${c['cell--rangeLeft']}`]: styles['cell--rangeLeft']
64
- }, {
65
- [`& .${c['cell--rangeRight']}`]: styles['cell--rangeRight']
66
- }, {
67
- [`& .${c['cell--rangeTop']}`]: styles['cell--rangeTop']
68
- }, {
69
- [`& .${c['cell--selectionMode']}`]: styles['cell--selectionMode']
70
- }, {
71
- [`& .${c['cell--textCenter']}`]: styles['cell--textCenter']
72
- }, {
73
- [`& .${c['cell--textLeft']}`]: styles['cell--textLeft']
74
- }, {
75
- [`& .${c['cell--textRight']}`]: styles['cell--textRight']
76
- }, {
77
- [`& .${c['cell--withLeftBorder']}`]: styles['cell--withLeftBorder']
78
- }, {
79
- [`& .${c['cell--withRightBorder']}`]: styles['cell--withRightBorder']
80
- }, {
81
- [`& .${c.cellCheckbox}`]: styles.cellCheckbox
82
- }, {
83
- [`& .${c.cellEmpty}`]: styles.cellEmpty
84
- }, {
85
- [`& .${c.cellOffsetLeft}`]: styles.cellOffsetLeft
86
- }, {
87
- [`& .${c.cellSkeleton}`]: styles.cellSkeleton
88
- }, {
89
- [`& .${c.checkboxInput}`]: styles.checkboxInput
90
- }, {
91
- [`& .${c.columnHeader}`]: styles.columnHeader
92
- }, {
93
- [`& .${c['columnHeader--alignCenter']}`]: styles['columnHeader--alignCenter']
94
- }, {
95
- [`& .${c['columnHeader--alignLeft']}`]: styles['columnHeader--alignLeft']
96
- }, {
97
- [`& .${c['columnHeader--alignRight']}`]: styles['columnHeader--alignRight']
98
- }, {
99
- [`& .${c['columnHeader--dragging']}`]: styles['columnHeader--dragging']
100
- }, {
101
- [`& .${c['columnHeader--emptyGroup']}`]: styles['columnHeader--emptyGroup']
102
- }, {
103
- [`& .${c['columnHeader--filledGroup']}`]: styles['columnHeader--filledGroup']
104
- }, {
105
- [`& .${c['columnHeader--filtered']}`]: styles['columnHeader--filtered']
106
- }, {
107
- [`& .${c['columnHeader--last']}`]: styles['columnHeader--last']
108
- }, {
109
- [`& .${c['columnHeader--moving']}`]: styles['columnHeader--moving']
110
- }, {
111
- [`& .${c['columnHeader--numeric']}`]: styles['columnHeader--numeric']
112
- }, {
113
- [`& .${c['columnHeader--pinnedLeft']}`]: styles['columnHeader--pinnedLeft']
114
- }, {
115
- [`& .${c['columnHeader--pinnedRight']}`]: styles['columnHeader--pinnedRight']
116
- }, {
117
- [`& .${c['columnHeader--siblingFocused']}`]: styles['columnHeader--siblingFocused']
118
- }, {
119
- [`& .${c['columnHeader--sortable']}`]: styles['columnHeader--sortable']
120
- }, {
121
- [`& .${c['columnHeader--sorted']}`]: styles['columnHeader--sorted']
122
- }, {
123
- [`& .${c['columnHeader--withLeftBorder']}`]: styles['columnHeader--withLeftBorder']
124
- }, {
125
- [`& .${c['columnHeader--withRightBorder']}`]: styles['columnHeader--withRightBorder']
126
- }, {
127
- [`& .${c.columnHeaderCheckbox}`]: styles.columnHeaderCheckbox
128
- }, {
129
- [`& .${c.columnHeaderDraggableContainer}`]: styles.columnHeaderDraggableContainer
130
- }, {
131
- [`& .${c.columnHeaderTitleContainer}`]: styles.columnHeaderTitleContainer
132
- }, {
133
- [`& .${c.columnHeaderTitleContainerContent}`]: styles.columnHeaderTitleContainerContent
134
- }, {
135
- [`& .${c.columnSeparator}`]: styles.columnSeparator
136
- }, {
137
- [`& .${c['columnSeparator--resizable']}`]: styles['columnSeparator--resizable']
138
- }, {
139
- [`& .${c['columnSeparator--resizing']}`]: styles['columnSeparator--resizing']
140
- }, {
141
- [`& .${c['columnSeparator--sideLeft']}`]: styles['columnSeparator--sideLeft']
142
- }, {
143
- [`& .${c['columnSeparator--sideRight']}`]: styles['columnSeparator--sideRight']
144
- }, {
145
- [`& .${c['container--bottom']}`]: styles['container--bottom']
146
- }, {
147
- [`& .${c['container--top']}`]: styles['container--top']
148
- }, {
149
- [`& .${c.detailPanelToggleCell}`]: styles.detailPanelToggleCell
150
- }, {
151
- [`& .${c['detailPanelToggleCell--expanded']}`]: styles['detailPanelToggleCell--expanded']
152
- }, {
153
- [`& .${c.editBooleanCell}`]: styles.editBooleanCell
154
- }, {
155
- [`& .${c.filterIcon}`]: styles.filterIcon
156
- }, {
157
- [`& .${c['filler--borderBottom']}`]: styles['filler--borderBottom']
158
- }, {
159
- [`& .${c['filler--pinnedLeft']}`]: styles['filler--pinnedLeft']
160
- }, {
161
- [`& .${c['filler--pinnedRight']}`]: styles['filler--pinnedRight']
162
- }, {
163
- [`& .${c.groupingCriteriaCell}`]: styles.groupingCriteriaCell
164
- }, {
165
- [`& .${c.groupingCriteriaCellLoadingContainer}`]: styles.groupingCriteriaCellLoadingContainer
166
- }, {
167
- [`& .${c.groupingCriteriaCellToggle}`]: styles.groupingCriteriaCellToggle
168
- }, {
169
- [`& .${c.headerFilterRow}`]: styles.headerFilterRow
170
- }, {
171
- [`& .${c.iconSeparator}`]: styles.iconSeparator
172
- }, {
173
- [`& .${c.menuIcon}`]: styles.menuIcon
174
- }, {
175
- [`& .${c.menuIconButton}`]: styles.menuIconButton
176
- }, {
177
- [`& .${c.menuList}`]: styles.menuList
178
- }, {
179
- [`& .${c.menuOpen}`]: styles.menuOpen
180
- }, {
181
- [`& .${c.overlayWrapperInner}`]: styles.overlayWrapperInner
182
- }, {
183
- [`& .${c.pinnedRows}`]: styles.pinnedRows
184
- }, {
185
- [`& .${c['pinnedRows--bottom']}`]: styles['pinnedRows--bottom']
186
- }, {
187
- [`& .${c['pinnedRows--top']}`]: styles['pinnedRows--top']
188
- }, {
189
- [`& .${c.row}`]: styles.row
190
- }, {
191
- [`& .${c['row--borderBottom']}`]: styles['row--borderBottom']
192
- }, {
193
- [`& .${c['row--detailPanelExpanded']}`]: styles['row--detailPanelExpanded']
194
- }, {
195
- [`& .${c['row--dragging']}`]: styles['row--dragging']
196
- }, {
197
- [`& .${c['row--dynamicHeight']}`]: styles['row--dynamicHeight']
198
- }, {
199
- [`& .${c['row--editable']}`]: styles['row--editable']
200
- }, {
201
- [`& .${c['row--editing']}`]: styles['row--editing']
202
- }, {
203
- [`& .${c['row--firstVisible']}`]: styles['row--firstVisible']
204
- }, {
205
- [`& .${c['row--lastVisible']}`]: styles['row--lastVisible']
206
- }, {
207
- [`& .${c.rowReorderCell}`]: styles.rowReorderCell
208
- }, {
209
- [`& .${c['rowReorderCell--draggable']}`]: styles['rowReorderCell--draggable']
210
- }, {
211
- [`& .${c.rowReorderCellContainer}`]: styles.rowReorderCellContainer
212
- }, {
213
- [`& .${c.rowReorderCellPlaceholder}`]: styles.rowReorderCellPlaceholder
214
- }, {
215
- [`& .${c.rowSkeleton}`]: styles.rowSkeleton
216
- }, {
217
- [`& .${c.scrollbar}`]: styles.scrollbar
218
- }, {
219
- [`& .${c['scrollbar--horizontal']}`]: styles['scrollbar--horizontal']
220
- }, {
221
- [`& .${c['scrollbar--vertical']}`]: styles['scrollbar--vertical']
222
- }, {
223
- [`& .${c.scrollbarFiller}`]: styles.scrollbarFiller
224
- }, {
225
- [`& .${c['scrollbarFiller--pinnedRight']}`]: styles['scrollbarFiller--pinnedRight']
226
- }, {
227
- [`& .${c.sortIcon}`]: styles.sortIcon
228
- }, {
229
- [`& .${c.treeDataGroupingCell}`]: styles.treeDataGroupingCell
230
- }, {
231
- [`& .${c.treeDataGroupingCellLoadingContainer}`]: styles.treeDataGroupingCellLoadingContainer
232
- }, {
233
- [`& .${c.treeDataGroupingCellToggle}`]: styles.treeDataGroupingCellToggle
234
- }, {
235
- [`& .${c.withBorderColor}`]: styles.withBorderColor
236
- }, {
237
- [`& .${c['row--beingDragged']}`]: styles['row--beingDragged']
238
- }]
26
+ overridesResolver: (props, styles) => {
27
+ // Root overrides
28
+ const overrides = [styles.root];
29
+ elementOverrides.root.forEach(key => {
30
+ overrides.push({
31
+ [`&.${c[key]}`]: styles[key]
32
+ });
33
+ });
34
+
35
+ // Child element overrides
36
+ // - Only declare overrides here for class names that are not applied to `styled` components.
37
+ // - For `styled` components, declare overrides in the component itself.
38
+ elementOverrides.children.forEach(key => {
39
+ overrides.push({
40
+ [`& .${c[key]}`]: styles[key]
41
+ });
42
+ });
43
+ return overrides;
44
+ }
239
45
  })(() => {
240
46
  const apiRef = useGridPrivateApiContext();
241
47
  const shouldShowBorderTopRightRadius = useGridSelector(apiRef, shouldShowBorderTopRightRadiusSelector);
@@ -1,7 +1,7 @@
1
1
  import { GridColumnMenuColumnsItem } from "./menuItems/GridColumnMenuColumnsItem.js";
2
2
  import { GridColumnMenuFilterItem } from "./menuItems/GridColumnMenuFilterItem.js";
3
3
  import { GridColumnMenuSortItem } from "./menuItems/GridColumnMenuSortItem.js";
4
- import type { GridColumnMenuProps, GridGenericColumnMenuProps } from "./GridColumnMenuProps.js";
4
+ import type { GridGenericColumnMenuProps, GridColumnMenuComponent } from "./GridColumnMenuProps.js";
5
5
  export declare const GRID_COLUMN_MENU_SLOTS: {
6
6
  columnMenuSortItem: typeof GridColumnMenuSortItem;
7
7
  columnMenuFilterItem: typeof GridColumnMenuFilterItem;
@@ -19,5 +19,5 @@ export declare const GRID_COLUMN_MENU_SLOT_PROPS: {
19
19
  };
20
20
  };
21
21
  declare const GridGenericColumnMenu: import("react").ForwardRefExoticComponent<GridGenericColumnMenuProps> | import("react").ForwardRefExoticComponent<GridGenericColumnMenuProps & import("react").RefAttributes<HTMLUListElement>>;
22
- declare const GridColumnMenu: import("react").ForwardRefExoticComponent<GridColumnMenuProps> | import("react").ForwardRefExoticComponent<GridColumnMenuProps & import("react").RefAttributes<HTMLUListElement>>;
22
+ declare const GridColumnMenu: GridColumnMenuComponent;
23
23
  export { GridColumnMenu, GridGenericColumnMenu };
@@ -87,6 +87,8 @@ const GridColumnMenu = forwardRef(function GridColumnMenu(props, ref) {
87
87
  }));
88
88
  });
89
89
  if (process.env.NODE_ENV !== "production") GridColumnMenu.displayName = "GridColumnMenu";
90
+ GridColumnMenu.defaultSlots = GRID_COLUMN_MENU_SLOTS;
91
+ GridColumnMenu.defaultSlotProps = GRID_COLUMN_MENU_SLOT_PROPS;
90
92
  process.env.NODE_ENV !== "production" ? GridColumnMenu.propTypes = {
91
93
  // ----------------------------- Warning --------------------------------
92
94
  // | These PropTypes are generated from the TypeScript type definitions |
@@ -9,4 +9,12 @@ export interface GridColumnMenuContainerProps extends React.HTMLAttributes<HTMLU
9
9
  labelledby?: string;
10
10
  }
11
11
  export interface GridGenericColumnMenuProps extends GridColumnMenuRootProps, GridColumnMenuContainerProps {}
12
- export interface GridColumnMenuProps extends Omit<GridGenericColumnMenuProps, 'defaultSlots' | 'defaultSlotProps'> {}
12
+ export interface GridColumnMenuProps extends Omit<GridGenericColumnMenuProps, 'defaultSlots' | 'defaultSlotProps'> {}
13
+ /**
14
+ * Type for column menu components with static defaultSlots and defaultSlotProps.
15
+ * Used by GridColumnMenu, GridProColumnMenu, and GridPremiumColumnMenu.
16
+ */
17
+ export type GridColumnMenuComponent = React.ForwardRefExoticComponent<GridColumnMenuProps & React.RefAttributes<HTMLUListElement>> & {
18
+ defaultSlots: GridColumnMenuRootProps['defaultSlots'];
19
+ defaultSlotProps: GridColumnMenuRootProps['defaultSlotProps'];
20
+ };
@@ -1,5 +1,5 @@
1
1
  export * from "./GridColumnHeaderMenu.js";
2
- export * from "./GridColumnMenuProps.js";
2
+ export type { GridColumnMenuContainerProps, GridGenericColumnMenuProps, GridColumnMenuProps } from "./GridColumnMenuProps.js";
3
3
  export * from "./GridColumnMenuItemProps.js";
4
4
  export * from "./GridColumnMenuContainer.js";
5
5
  export { GridGenericColumnMenu } from "./GridColumnMenu.js";
@@ -1,6 +1,5 @@
1
1
  // shared modules
2
2
  export * from "./GridColumnHeaderMenu.js";
3
- export * from "./GridColumnMenuProps.js";
4
3
  export * from "./GridColumnMenuItemProps.js";
5
4
  export * from "./GridColumnMenuContainer.js";
6
5
  export { GridGenericColumnMenu } from "./GridColumnMenu.js";
@@ -4,7 +4,7 @@ const _excluded = ["quickFilterParser", "quickFilterFormatter", "debounceMs", "c
4
4
  _excluded2 = ["ref", "slotProps"];
5
5
  import PropTypes from 'prop-types';
6
6
  import composeClasses from '@mui/utils/composeClasses';
7
- import { styled } from '@mui/system';
7
+ import { styled } from '@mui/material/styles';
8
8
  import clsx from 'clsx';
9
9
  import { getDataGridUtilityClass } from "../../constants/index.js";
10
10
  import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
@@ -8,7 +8,7 @@ const _excluded = ["className"],
8
8
  import * as React from 'react';
9
9
  import PropTypes from 'prop-types';
10
10
  import useId from '@mui/utils/useId';
11
- import { styled } from '@mui/system';
11
+ import { styled } from '@mui/material/styles';
12
12
  import composeClasses from '@mui/utils/composeClasses';
13
13
  import { GridMenu } from "../menu/GridMenu.js";
14
14
  import { Toolbar } from "./Toolbar.js";
@@ -6,7 +6,7 @@ export type ToolbarProps = React.HTMLAttributes<HTMLDivElement> & {
6
6
  */
7
7
  render?: RenderProp<React.ComponentProps<typeof ToolbarRoot>>;
8
8
  };
9
- declare const ToolbarRoot: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/system").Theme>, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.ClassAttributes<HTMLDivElement> | keyof React.HTMLAttributes<HTMLDivElement>>, {}>;
9
+ declare const ToolbarRoot: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.ClassAttributes<HTMLDivElement> | keyof React.HTMLAttributes<HTMLDivElement>>, {}>;
10
10
  /**
11
11
  * The top level Toolbar component that provides context to child components.
12
12
  * It renders a styled `<div />` element.
@@ -5,7 +5,7 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
5
5
  const _excluded = ["render", "className"];
6
6
  import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
8
- import { styled } from '@mui/system';
8
+ import { styled } from '@mui/material/styles';
9
9
  import composeClasses from '@mui/utils/composeClasses';
10
10
  import clsx from 'clsx';
11
11
  import { forwardRef } from '@mui/x-internals/forwardRef';
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
3
  import clsx from 'clsx';
4
- import { styled } from '@mui/system';
4
+ import { styled } from '@mui/material/styles';
5
5
  import composeClasses from '@mui/utils/composeClasses';
6
6
  import { gridClasses, getDataGridUtilityClass } from "../../constants/gridClasses.js";
7
7
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -2,7 +2,7 @@
2
2
 
3
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
4
  import * as React from 'react';
5
- import { styled } from '@mui/system';
5
+ import { styled } from '@mui/material/styles';
6
6
  import { forwardRef } from '@mui/x-internals/forwardRef';
7
7
  import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
8
8
  import { useGridConfiguration } from "../../hooks/utils/useGridConfiguration.js";
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
3
  import clsx from 'clsx';
4
- import { styled } from '@mui/system';
4
+ import { styled } from '@mui/material/styles';
5
5
  import composeClasses from '@mui/utils/composeClasses';
6
6
  import { gridClasses, getDataGridUtilityClass } from "../../constants/gridClasses.js";
7
7
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -8,6 +8,6 @@ type GridVirtualScrollbarProps = {
8
8
  }>;
9
9
  };
10
10
  export declare const scrollbarSizeCssExpression = "calc(max(var(--DataGrid-scrollbarSize), 14px))";
11
- export declare const ScrollbarCorner: import("@emotion/styled").StyledComponent<Pick<import("@mui/system").MUIStyledCommonProps<import("@mui/system").Theme> & Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.ClassAttributes<HTMLDivElement> | keyof React.HTMLAttributes<HTMLDivElement>>, keyof React.ClassAttributes<HTMLDivElement> | keyof React.HTMLAttributes<HTMLDivElement> | keyof import("@mui/system").MUIStyledCommonProps<import("@mui/system").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/system").Theme>, {}, {}>;
11
+ export declare const ScrollbarCorner: import("@emotion/styled").StyledComponent<Pick<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.ClassAttributes<HTMLDivElement> | keyof React.HTMLAttributes<HTMLDivElement>>, keyof React.ClassAttributes<HTMLDivElement> | keyof React.HTMLAttributes<HTMLDivElement> | keyof import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
12
12
  declare const GridVirtualScrollbar: React.ForwardRefExoticComponent<GridVirtualScrollbarProps> | React.ForwardRefExoticComponent<GridVirtualScrollbarProps & React.RefAttributes<HTMLDivElement>>;
13
13
  export { GridVirtualScrollbar };
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
 
3
3
  import * as React from 'react';
4
- import { styled } from '@mui/system';
4
+ import { styled } from '@mui/material/styles';
5
5
  import useEventCallback from '@mui/utils/useEventCallback';
6
6
  import useForkRef from '@mui/utils/useForkRef';
7
7
  import composeClasses from '@mui/utils/composeClasses';
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
- import { styled } from '@mui/system';
3
+ import { styled } from '@mui/material/styles';
4
4
  import composeClasses from '@mui/utils/composeClasses';
5
5
  import { gridHasBottomFillerSelector, gridHasScrollXSelector, gridHasScrollYSelector } from "../../hooks/features/dimensions/gridDimensionsSelectors.js";
6
6
  import { gridRowTreeSelector } from "../../hooks/features/rows/index.js";
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { styled } from '@mui/system';
2
+ import { styled } from '@mui/material/styles';
3
3
  import { fastMemo } from '@mui/x-internals/fastMemo';
4
4
  import { vars } from "../../constants/cssVariables.js";
5
5
  import { useGridSelector } from "../../hooks/utils/useGridSelector.js";
@@ -24,6 +24,7 @@ export const DATA_GRID_PROPS_DEFAULT_VALUES = {
24
24
  disableMultipleColumnsFiltering: false,
25
25
  disableMultipleColumnsSorting: false,
26
26
  disableMultipleRowSelection: false,
27
+ dataSourceRevalidateMs: 0,
27
28
  disableRowSelectionOnClick: false,
28
29
  disableRowSelectionExcludeModel: false,
29
30
  disableVirtualization: false,
@@ -0,0 +1,17 @@
1
+ import type { RefObject } from '@mui/x-internals/types';
2
+ import type { GridPrivateApiCommunity } from "../../../models/api/gridApiCommunity.js";
3
+ import type { GridColDef } from "../../../models/colDef/gridColDef.js";
4
+ import type { GridColumnMenuSlotProps } from "./columnMenuInterfaces.js";
5
+ export interface GetColumnMenuItemKeysParams {
6
+ apiRef: RefObject<GridPrivateApiCommunity>;
7
+ colDef: GridColDef;
8
+ defaultSlots: Record<string, any>;
9
+ defaultSlotProps: Record<string, GridColumnMenuSlotProps>;
10
+ slots?: Record<string, any>;
11
+ slotProps?: Record<string, GridColumnMenuSlotProps>;
12
+ }
13
+ /**
14
+ * Returns the list of column menu item keys (sorted by `displayOrder`) that should be rendered for a given column.
15
+ * This is shared between the column header (to know if menu is empty) and the menu itself (to render items).
16
+ */
17
+ export declare function getColumnMenuItemKeys(params: GetColumnMenuItemKeysParams): string[];
@@ -0,0 +1,36 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ /**
3
+ * Returns the list of column menu item keys (sorted by `displayOrder`) that should be rendered for a given column.
4
+ * This is shared between the column header (to know if menu is empty) and the menu itself (to render items).
5
+ */
6
+ export function getColumnMenuItemKeys(params) {
7
+ const {
8
+ apiRef,
9
+ colDef,
10
+ defaultSlots,
11
+ defaultSlotProps,
12
+ slots = {},
13
+ slotProps = {}
14
+ } = params;
15
+ const processedComponents = _extends({}, defaultSlots, slots);
16
+ let processedSlotProps = defaultSlotProps;
17
+ if (slotProps && Object.keys(slotProps).length > 0) {
18
+ const mergedProps = _extends({}, slotProps);
19
+ Object.entries(defaultSlotProps).forEach(([key, currentSlotProps]) => {
20
+ mergedProps[key] = _extends({}, currentSlotProps, slotProps[key] || {});
21
+ });
22
+ processedSlotProps = mergedProps;
23
+ }
24
+ const defaultItems = apiRef.current.unstable_applyPipeProcessors('columnMenu', [], colDef);
25
+ const defaultComponentKeys = Object.keys(defaultSlots);
26
+ const userItems = Object.keys(slots).filter(key => !defaultComponentKeys.includes(key));
27
+ const uniqueItems = Array.from(new Set([...defaultItems, ...userItems]));
28
+ const cleansedItems = uniqueItems.filter(key => processedComponents[key] != null);
29
+ return cleansedItems.sort((a, b) => {
30
+ const leftItemProps = processedSlotProps[a];
31
+ const rightItemProps = processedSlotProps[b];
32
+ const leftDisplayOrder = Number.isFinite(leftItemProps?.displayOrder) ? leftItemProps.displayOrder : 100;
33
+ const rightDisplayOrder = Number.isFinite(rightItemProps?.displayOrder) ? rightItemProps.displayOrder : 100;
34
+ return leftDisplayOrder - rightDisplayOrder;
35
+ });
36
+ }
@@ -4,6 +4,7 @@ const _excluded = ["displayOrder"];
4
4
  import * as React from 'react';
5
5
  import { useGridRootProps } from "../../utils/useGridRootProps.js";
6
6
  import { useGridPrivateApiContext } from "../../utils/useGridPrivateApiContext.js";
7
+ import { getColumnMenuItemKeys } from "./getColumnMenuItemKeys.js";
7
8
  const useGridColumnMenuSlots = props => {
8
9
  const apiRef = useGridPrivateApiContext();
9
10
  const rootProps = useGridRootProps();
@@ -27,22 +28,16 @@ const useGridColumnMenuSlots = props => {
27
28
  });
28
29
  return mergedProps;
29
30
  }, [defaultSlotProps, slotProps]);
30
- const defaultItems = apiRef.current.unstable_applyPipeProcessors('columnMenu', [], props.colDef);
31
- const userItems = React.useMemo(() => {
32
- const defaultComponentKeys = Object.keys(defaultSlots);
33
- return Object.keys(slots).filter(key => !defaultComponentKeys.includes(key));
34
- }, [slots, defaultSlots]);
35
31
  return React.useMemo(() => {
36
- const uniqueItems = Array.from(new Set([...defaultItems, ...userItems]));
37
- const cleansedItems = uniqueItems.filter(key => processedComponents[key] != null);
38
- const sorted = cleansedItems.sort((a, b) => {
39
- const leftItemProps = processedSlotProps[a];
40
- const rightItemProps = processedSlotProps[b];
41
- const leftDisplayOrder = Number.isFinite(leftItemProps?.displayOrder) ? leftItemProps.displayOrder : 100;
42
- const rightDisplayOrder = Number.isFinite(rightItemProps?.displayOrder) ? rightItemProps.displayOrder : 100;
43
- return leftDisplayOrder - rightDisplayOrder;
32
+ const sortedKeys = getColumnMenuItemKeys({
33
+ apiRef,
34
+ colDef,
35
+ defaultSlots,
36
+ defaultSlotProps,
37
+ slots,
38
+ slotProps
44
39
  });
45
- return sorted.reduce((acc, key, index) => {
40
+ return sortedKeys.reduce((acc, key, index) => {
46
41
  let itemProps = {
47
42
  colDef,
48
43
  onClick: hideMenu
@@ -52,8 +47,8 @@ const useGridColumnMenuSlots = props => {
52
47
  const customProps = _objectWithoutPropertiesLoose(processedComponentProps, _excluded);
53
48
  itemProps = _extends({}, itemProps, customProps);
54
49
  }
55
- return addDividers && index !== sorted.length - 1 ? [...acc, [processedComponents[key], itemProps], [rootProps.slots.baseDivider, {}]] : [...acc, [processedComponents[key], itemProps]];
50
+ return addDividers && index !== sortedKeys.length - 1 ? [...acc, [processedComponents[key], itemProps], [rootProps.slots.baseDivider, {}]] : [...acc, [processedComponents[key], itemProps]];
56
51
  }, []);
57
- }, [addDividers, colDef, defaultItems, hideMenu, processedComponents, processedSlotProps, userItems, rootProps.slots.baseDivider]);
52
+ }, [addDividers, apiRef, colDef, defaultSlotProps, defaultSlots, hideMenu, processedComponents, processedSlotProps, slotProps, slots, rootProps.slots.baseDivider]);
58
53
  };
59
54
  export { useGridColumnMenuSlots };
@@ -5,6 +5,9 @@ import type { GridDataSourceCacheDefaultConfig } from "./cache.js";
5
5
  * The parameters for the `fetchRows` method.
6
6
  */
7
7
  export type GridDataSourceFetchRowsParams<T> = Partial<T> & GridGetRowsOptions;
8
+ export interface GridDataSourceFetchRowChildrenOptions {
9
+ showChildrenLoading?: boolean;
10
+ }
8
11
  export interface GridDataSourceApi {
9
12
  /**
10
13
  * The data source API.
@@ -38,7 +41,7 @@ export interface GridDataSourceApiBase {
38
41
  }
39
42
  export interface GridDataSourceBaseOptions {
40
43
  cacheOptions?: GridDataSourceCacheDefaultConfig;
41
- fetchRowChildren?: (parents: GridRowId[]) => void;
44
+ fetchRowChildren?: (parents: GridRowId[], options?: GridDataSourceFetchRowChildrenOptions) => void;
42
45
  clearDataSourceState?: () => void;
43
46
  handleEditRow?: (params: GridUpdateRowParams, updatedRow: GridRowModel) => void;
44
47
  }
@@ -6,17 +6,20 @@ import type { GridPrivateApiCommunity } from "../../../models/api/gridApiCommuni
6
6
  import type { DataGridProcessedProps } from "../../../models/props/DataGridProps.js";
7
7
  import type { GridStrategyProcessor } from "../../core/strategyProcessing/index.js";
8
8
  import type { GridEventListener } from "../../../models/events/index.js";
9
- export declare const useGridDataSourceBase: <Api extends GridPrivateApiCommunity>(apiRef: RefObject<Api>, props: Pick<DataGridProcessedProps, "dataSource" | "dataSourceCache" | "onDataSourceError" | "pageSizeOptions" | "pagination" | "signature">, options?: GridDataSourceBaseOptions) => {
9
+ import type { GridRowId } from "../../../models/gridRows.js";
10
+ export declare const useGridDataSourceBase: <Api extends GridPrivateApiCommunity>(apiRef: RefObject<Api>, props: Pick<DataGridProcessedProps, "dataSource" | "dataSourceCache" | "onDataSourceError" | "pageSizeOptions" | "pagination" | "signature" | "dataSourceRevalidateMs">, options?: GridDataSourceBaseOptions) => {
10
11
  api: {
11
12
  public: GridDataSourceApi;
12
13
  };
13
- debouncedFetchRows: ((parentId?: import("@mui/x-data-grid").GridRowId, params?: import("./models.js").GridDataSourceFetchRowsParams<import("@mui/x-data-grid").GridGetRowsParams>) => Promise<void>) & import("@mui/utils/debounce").Cancelable;
14
+ debouncedFetchRows: ((parentId?: GridRowId, params?: import("./models.js").GridDataSourceFetchRowsParams<import("@mui/x-data-grid").GridGetRowsParams>) => Promise<void>) & import("@mui/utils/debounce").Cancelable;
14
15
  strategyProcessor: {
15
16
  strategyName: DataSourceRowsUpdateStrategy;
16
17
  group: "dataSourceRowsUpdate";
17
18
  processor: GridStrategyProcessor<"dataSourceRowsUpdate">;
18
19
  };
19
20
  setStrategyAvailability: () => void;
21
+ startPolling: () => void;
22
+ stopPolling: () => void;
20
23
  cacheChunkManager: CacheChunkManager;
21
24
  cache: GridDataSourceCache;
22
25
  events: {