@mui/x-data-grid 8.0.0-alpha.13 → 8.0.0-alpha.14

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 (198) hide show
  1. package/CHANGELOG.md +131 -0
  2. package/colDef/gridActionsColDef.js +1 -1
  3. package/colDef/gridBooleanColDef.js +1 -1
  4. package/colDef/gridCheckboxSelectionColDef.js +1 -1
  5. package/components/columnsManagement/GridColumnsManagement.js +1 -0
  6. package/components/columnsPanel/ColumnsPanelTrigger.d.ts +33 -0
  7. package/components/columnsPanel/ColumnsPanelTrigger.js +209 -0
  8. package/components/columnsPanel/index.d.ts +1 -0
  9. package/components/columnsPanel/index.js +16 -0
  10. package/components/export/ExportCsv.d.ts +30 -0
  11. package/components/export/ExportCsv.js +196 -0
  12. package/components/export/ExportPrint.d.ts +30 -0
  13. package/components/export/ExportPrint.js +196 -0
  14. package/components/export/index.d.ts +2 -0
  15. package/components/export/index.js +27 -0
  16. package/components/filterPanel/FilterPanelTrigger.d.ts +37 -0
  17. package/components/filterPanel/FilterPanelTrigger.js +212 -0
  18. package/components/filterPanel/index.d.ts +1 -0
  19. package/components/filterPanel/index.js +16 -0
  20. package/components/index.d.ts +6 -1
  21. package/components/index.js +60 -0
  22. package/components/quickFilter/QuickFilter.d.ts +41 -0
  23. package/components/quickFilter/QuickFilter.js +110 -0
  24. package/components/quickFilter/QuickFilterClear.d.ts +28 -0
  25. package/components/quickFilter/QuickFilterClear.js +161 -0
  26. package/components/quickFilter/QuickFilterContext.d.ts +13 -0
  27. package/components/quickFilter/QuickFilterContext.js +17 -0
  28. package/components/quickFilter/QuickFilterControl.d.ts +28 -0
  29. package/components/quickFilter/QuickFilterControl.js +104 -0
  30. package/components/quickFilter/index.d.ts +3 -0
  31. package/components/quickFilter/index.js +38 -0
  32. package/components/toolbar/GridToolbar.d.ts +1 -1
  33. package/components/toolbar/GridToolbar.js +2 -2
  34. package/components/toolbar/GridToolbarQuickFilter.js +54 -87
  35. package/components/toolbarV8/GridToolbar.d.ts +11 -0
  36. package/components/toolbarV8/GridToolbar.js +142 -0
  37. package/components/toolbarV8/Toolbar.d.ts +32 -0
  38. package/components/toolbarV8/Toolbar.js +132 -0
  39. package/components/toolbarV8/ToolbarButton.d.ts +23 -0
  40. package/components/toolbarV8/ToolbarButton.js +179 -0
  41. package/components/toolbarV8/ToolbarContext.d.ts +9 -0
  42. package/components/toolbarV8/ToolbarContext.js +17 -0
  43. package/components/toolbarV8/index.d.ts +2 -0
  44. package/components/toolbarV8/index.js +27 -0
  45. package/components/virtualization/GridVirtualScrollbar.js +7 -1
  46. package/constants/defaultGridSlotsComponents.js +2 -1
  47. package/constants/gridClasses.d.ts +4 -0
  48. package/esm/colDef/gridActionsColDef.js +1 -1
  49. package/esm/colDef/gridBooleanColDef.js +1 -1
  50. package/esm/colDef/gridCheckboxSelectionColDef.js +1 -1
  51. package/esm/components/columnsManagement/GridColumnsManagement.js +1 -0
  52. package/esm/components/columnsPanel/ColumnsPanelTrigger.d.ts +33 -0
  53. package/esm/components/columnsPanel/ColumnsPanelTrigger.js +202 -0
  54. package/esm/components/columnsPanel/index.d.ts +1 -0
  55. package/esm/components/columnsPanel/index.js +1 -0
  56. package/esm/components/export/ExportCsv.d.ts +30 -0
  57. package/esm/components/export/ExportCsv.js +189 -0
  58. package/esm/components/export/ExportPrint.d.ts +30 -0
  59. package/esm/components/export/ExportPrint.js +189 -0
  60. package/esm/components/export/index.d.ts +2 -0
  61. package/esm/components/export/index.js +2 -0
  62. package/esm/components/filterPanel/FilterPanelTrigger.d.ts +37 -0
  63. package/esm/components/filterPanel/FilterPanelTrigger.js +205 -0
  64. package/esm/components/filterPanel/index.d.ts +1 -0
  65. package/esm/components/filterPanel/index.js +1 -0
  66. package/esm/components/index.d.ts +6 -1
  67. package/esm/components/index.js +6 -1
  68. package/esm/components/quickFilter/QuickFilter.d.ts +41 -0
  69. package/esm/components/quickFilter/QuickFilter.js +103 -0
  70. package/esm/components/quickFilter/QuickFilterClear.d.ts +28 -0
  71. package/esm/components/quickFilter/QuickFilterClear.js +154 -0
  72. package/esm/components/quickFilter/QuickFilterContext.d.ts +13 -0
  73. package/esm/components/quickFilter/QuickFilterContext.js +9 -0
  74. package/esm/components/quickFilter/QuickFilterControl.d.ts +28 -0
  75. package/esm/components/quickFilter/QuickFilterControl.js +97 -0
  76. package/esm/components/quickFilter/index.d.ts +3 -0
  77. package/esm/components/quickFilter/index.js +3 -0
  78. package/esm/components/toolbar/GridToolbar.d.ts +1 -1
  79. package/esm/components/toolbar/GridToolbar.js +2 -2
  80. package/esm/components/toolbar/GridToolbarQuickFilter.js +56 -87
  81. package/esm/components/toolbarV8/GridToolbar.d.ts +11 -0
  82. package/esm/components/toolbarV8/GridToolbar.js +135 -0
  83. package/esm/components/toolbarV8/Toolbar.d.ts +32 -0
  84. package/esm/components/toolbarV8/Toolbar.js +125 -0
  85. package/esm/components/toolbarV8/ToolbarButton.d.ts +23 -0
  86. package/esm/components/toolbarV8/ToolbarButton.js +172 -0
  87. package/esm/components/toolbarV8/ToolbarContext.d.ts +9 -0
  88. package/esm/components/toolbarV8/ToolbarContext.js +9 -0
  89. package/esm/components/toolbarV8/index.d.ts +2 -0
  90. package/esm/components/toolbarV8/index.js +2 -0
  91. package/esm/components/virtualization/GridVirtualScrollbar.js +7 -1
  92. package/esm/constants/defaultGridSlotsComponents.js +2 -1
  93. package/esm/constants/gridClasses.d.ts +4 -0
  94. package/esm/hooks/features/rows/useGridRowsMeta.js +8 -0
  95. package/esm/hooks/features/virtualization/useGridVirtualScroller.d.ts +0 -2
  96. package/esm/hooks/features/virtualization/useGridVirtualScroller.js +0 -2
  97. package/esm/hooks/utils/index.d.ts +2 -1
  98. package/esm/hooks/utils/useGridComponentRenderer.d.ts +12 -0
  99. package/esm/hooks/utils/useGridComponentRenderer.js +36 -0
  100. package/esm/index.js +1 -1
  101. package/esm/internals/demo/TailwindDemoContainer.d.ts +11 -0
  102. package/esm/internals/demo/TailwindDemoContainer.js +55 -0
  103. package/esm/internals/demo/index.d.ts +1 -0
  104. package/esm/internals/demo/index.js +1 -0
  105. package/esm/internals/index.d.ts +4 -0
  106. package/esm/internals/index.js +3 -0
  107. package/esm/material/icons/index.d.ts +3 -3
  108. package/esm/material/icons/index.js +6 -6
  109. package/esm/material/index.js +3 -3
  110. package/esm/models/gridBaseSlots.d.ts +5 -1
  111. package/esm/models/gridIconSlotsComponent.d.ts +1 -1
  112. package/esm/models/gridSlotsComponent.d.ts +1 -2
  113. package/hooks/features/rows/useGridRowsMeta.js +8 -0
  114. package/hooks/features/virtualization/useGridVirtualScroller.d.ts +0 -2
  115. package/hooks/features/virtualization/useGridVirtualScroller.js +0 -2
  116. package/hooks/utils/index.d.ts +2 -1
  117. package/hooks/utils/useGridComponentRenderer.d.ts +12 -0
  118. package/hooks/utils/useGridComponentRenderer.js +44 -0
  119. package/index.js +1 -1
  120. package/internals/demo/TailwindDemoContainer.d.ts +11 -0
  121. package/internals/demo/TailwindDemoContainer.js +63 -0
  122. package/internals/demo/index.d.ts +1 -0
  123. package/internals/demo/index.js +12 -0
  124. package/internals/index.d.ts +4 -0
  125. package/internals/index.js +28 -0
  126. package/material/icons/index.d.ts +3 -3
  127. package/material/icons/index.js +7 -7
  128. package/material/index.js +2 -2
  129. package/models/gridBaseSlots.d.ts +5 -1
  130. package/models/gridIconSlotsComponent.d.ts +1 -1
  131. package/models/gridSlotsComponent.d.ts +1 -2
  132. package/modern/colDef/gridActionsColDef.js +1 -1
  133. package/modern/colDef/gridBooleanColDef.js +1 -1
  134. package/modern/colDef/gridCheckboxSelectionColDef.js +1 -1
  135. package/modern/components/columnsManagement/GridColumnsManagement.js +1 -0
  136. package/modern/components/columnsPanel/ColumnsPanelTrigger.d.ts +33 -0
  137. package/modern/components/columnsPanel/ColumnsPanelTrigger.js +202 -0
  138. package/modern/components/columnsPanel/index.d.ts +1 -0
  139. package/modern/components/columnsPanel/index.js +1 -0
  140. package/modern/components/export/ExportCsv.d.ts +30 -0
  141. package/modern/components/export/ExportCsv.js +189 -0
  142. package/modern/components/export/ExportPrint.d.ts +30 -0
  143. package/modern/components/export/ExportPrint.js +189 -0
  144. package/modern/components/export/index.d.ts +2 -0
  145. package/modern/components/export/index.js +2 -0
  146. package/modern/components/filterPanel/FilterPanelTrigger.d.ts +37 -0
  147. package/modern/components/filterPanel/FilterPanelTrigger.js +205 -0
  148. package/modern/components/filterPanel/index.d.ts +1 -0
  149. package/modern/components/filterPanel/index.js +1 -0
  150. package/modern/components/index.d.ts +6 -1
  151. package/modern/components/index.js +6 -1
  152. package/modern/components/quickFilter/QuickFilter.d.ts +41 -0
  153. package/modern/components/quickFilter/QuickFilter.js +103 -0
  154. package/modern/components/quickFilter/QuickFilterClear.d.ts +28 -0
  155. package/modern/components/quickFilter/QuickFilterClear.js +154 -0
  156. package/modern/components/quickFilter/QuickFilterContext.d.ts +13 -0
  157. package/modern/components/quickFilter/QuickFilterContext.js +9 -0
  158. package/modern/components/quickFilter/QuickFilterControl.d.ts +28 -0
  159. package/modern/components/quickFilter/QuickFilterControl.js +97 -0
  160. package/modern/components/quickFilter/index.d.ts +3 -0
  161. package/modern/components/quickFilter/index.js +3 -0
  162. package/modern/components/toolbar/GridToolbar.d.ts +1 -1
  163. package/modern/components/toolbar/GridToolbar.js +2 -2
  164. package/modern/components/toolbar/GridToolbarQuickFilter.js +56 -87
  165. package/modern/components/toolbarV8/GridToolbar.d.ts +11 -0
  166. package/modern/components/toolbarV8/GridToolbar.js +135 -0
  167. package/modern/components/toolbarV8/Toolbar.d.ts +32 -0
  168. package/modern/components/toolbarV8/Toolbar.js +125 -0
  169. package/modern/components/toolbarV8/ToolbarButton.d.ts +23 -0
  170. package/modern/components/toolbarV8/ToolbarButton.js +172 -0
  171. package/modern/components/toolbarV8/ToolbarContext.d.ts +9 -0
  172. package/modern/components/toolbarV8/ToolbarContext.js +9 -0
  173. package/modern/components/toolbarV8/index.d.ts +2 -0
  174. package/modern/components/toolbarV8/index.js +2 -0
  175. package/modern/components/virtualization/GridVirtualScrollbar.js +7 -1
  176. package/modern/constants/defaultGridSlotsComponents.js +2 -1
  177. package/modern/constants/gridClasses.d.ts +4 -0
  178. package/modern/hooks/features/rows/useGridRowsMeta.js +8 -0
  179. package/modern/hooks/features/virtualization/useGridVirtualScroller.d.ts +0 -2
  180. package/modern/hooks/features/virtualization/useGridVirtualScroller.js +0 -2
  181. package/modern/hooks/utils/index.d.ts +2 -1
  182. package/modern/hooks/utils/useGridComponentRenderer.d.ts +12 -0
  183. package/modern/hooks/utils/useGridComponentRenderer.js +36 -0
  184. package/modern/index.js +1 -1
  185. package/modern/internals/demo/TailwindDemoContainer.d.ts +11 -0
  186. package/modern/internals/demo/TailwindDemoContainer.js +55 -0
  187. package/modern/internals/demo/index.d.ts +1 -0
  188. package/modern/internals/demo/index.js +1 -0
  189. package/modern/internals/index.d.ts +4 -0
  190. package/modern/internals/index.js +3 -0
  191. package/modern/material/icons/index.d.ts +3 -3
  192. package/modern/material/icons/index.js +6 -6
  193. package/modern/material/index.js +3 -3
  194. package/modern/models/gridBaseSlots.d.ts +5 -1
  195. package/modern/models/gridIconSlotsComponent.d.ts +1 -1
  196. package/modern/models/gridSlotsComponent.d.ts +1 -2
  197. package/package.json +1 -1
  198. package/tsconfig.build.tsbuildinfo +1 -1
@@ -0,0 +1,172 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
+ const _excluded = ["render"];
4
+ import * as React from 'react';
5
+ import PropTypes from 'prop-types';
6
+ import { unstable_useForkRef as useForkRef } from '@mui/utils';
7
+ import useId from '@mui/utils/useId';
8
+ import { forwardRef } from '@mui/x-internals/forwardRef';
9
+ import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
10
+ import { useGridComponentRenderer } from "../../hooks/utils/useGridComponentRenderer.js";
11
+ import { useToolbarContext } from "./ToolbarContext.js";
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ /**
14
+ * A button for performing actions from the toolbar.
15
+ * It renders the `baseIconButton` slot.
16
+ *
17
+ * Demos:
18
+ *
19
+ * - [Toolbar](https://mui.com/x/react-data-grid/components/toolbar/)
20
+ *
21
+ * API:
22
+ *
23
+ * - [ToolbarButton API](https://mui.com/x/api/data-grid/toolbar-button/)
24
+ */
25
+ const ToolbarButton = forwardRef(function ToolbarButton(props, ref) {
26
+ const {
27
+ render
28
+ } = props,
29
+ other = _objectWithoutPropertiesLoose(props, _excluded);
30
+ const id = useId();
31
+ const rootProps = useGridRootProps();
32
+ const buttonRef = React.useRef(null);
33
+ const handleRef = useForkRef(buttonRef, ref);
34
+ const {
35
+ focusableItemId,
36
+ registerItem,
37
+ unregisterItem,
38
+ onItemKeyDown
39
+ } = useToolbarContext();
40
+ React.useEffect(() => {
41
+ registerItem(id);
42
+ return () => unregisterItem(id);
43
+ // eslint-disable-next-line react-hooks/exhaustive-deps
44
+ }, []);
45
+ const isInitialFocus = React.useRef(true);
46
+ React.useEffect(() => {
47
+ // Do not focus the item on initial render
48
+ if (focusableItemId && isInitialFocus.current) {
49
+ isInitialFocus.current = false;
50
+ return;
51
+ }
52
+ if (focusableItemId === id) {
53
+ buttonRef.current?.focus();
54
+ }
55
+ }, [focusableItemId, id]);
56
+ const element = useGridComponentRenderer(rootProps.slots.baseIconButton, render, _extends({}, rootProps.slotProps?.baseIconButton, {
57
+ tabIndex: focusableItemId === id ? 0 : -1,
58
+ onKeyDown: onItemKeyDown
59
+ }, other, {
60
+ ref: handleRef
61
+ }));
62
+ return /*#__PURE__*/_jsx(React.Fragment, {
63
+ children: element
64
+ });
65
+ });
66
+ process.env.NODE_ENV !== "production" ? ToolbarButton.propTypes = {
67
+ // ----------------------------- Warning --------------------------------
68
+ // | These PropTypes are generated from the TypeScript type definitions |
69
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
70
+ // ----------------------------------------------------------------------
71
+ /**
72
+ * A ref for imperative actions.
73
+ * It currently only supports `focusVisible()` action.
74
+ */
75
+ action: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
76
+ current: PropTypes.shape({
77
+ focusVisible: PropTypes.func.isRequired
78
+ })
79
+ })]),
80
+ /**
81
+ * If `true`, the ripples are centered.
82
+ * They won't start at the cursor interaction position.
83
+ * @default false
84
+ */
85
+ centerRipple: PropTypes.bool,
86
+ className: PropTypes.string,
87
+ /**
88
+ * The color of the component.
89
+ * It supports both default and custom theme colors, which can be added as shown in the
90
+ * [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
91
+ */
92
+ color: PropTypes.oneOf(['default', 'inherit', 'primary']),
93
+ component: PropTypes.elementType,
94
+ /**
95
+ * If `true`, the component is disabled.
96
+ */
97
+ disabled: PropTypes.bool,
98
+ /**
99
+ * If `true`, the keyboard focus ripple is disabled.
100
+ * @default false
101
+ */
102
+ disableFocusRipple: PropTypes.bool,
103
+ /**
104
+ * If `true`, the ripple effect is disabled.
105
+ *
106
+ * ⚠️ Without a ripple there is no styling for :focus-visible by default. Be sure
107
+ * to highlight the element by applying separate styles with the `.Mui-focusVisible` class.
108
+ * @default false
109
+ */
110
+ disableRipple: PropTypes.bool,
111
+ /**
112
+ * If `true`, the touch ripple effect is disabled.
113
+ * @default false
114
+ */
115
+ disableTouchRipple: PropTypes.bool,
116
+ /**
117
+ * If given, uses a negative margin to counteract the padding on one
118
+ * side (this is often helpful for aligning the left or right
119
+ * side of the icon with content above or below, without ruining the border
120
+ * size and shape).
121
+ */
122
+ edge: PropTypes.oneOf(['end', 'start', false]),
123
+ /**
124
+ * If `true`, the base button will have a keyboard focus ripple.
125
+ * @default false
126
+ */
127
+ focusRipple: PropTypes.bool,
128
+ /**
129
+ * This prop can help identify which element has keyboard focus.
130
+ * The class name will be applied when the element gains the focus through keyboard interaction.
131
+ * It's a polyfill for the [CSS :focus-visible selector](https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo).
132
+ * The rationale for using this feature [is explained here](https://github.com/WICG/focus-visible/blob/HEAD/explainer.md).
133
+ * A [polyfill can be used](https://github.com/WICG/focus-visible) to apply a `focus-visible` class to other components
134
+ * if needed.
135
+ */
136
+ focusVisibleClassName: PropTypes.string,
137
+ label: PropTypes.string,
138
+ /**
139
+ * The component used to render a link when the `href` prop is provided.
140
+ * @default 'a'
141
+ */
142
+ LinkComponent: PropTypes.elementType,
143
+ /**
144
+ * Callback fired when the component is focused with a keyboard.
145
+ * We trigger a `onFocus` callback too.
146
+ */
147
+ onFocusVisible: PropTypes.func,
148
+ /**
149
+ * A function to customize rendering of the component.
150
+ */
151
+ render: PropTypes.oneOfType([PropTypes.element, PropTypes.func]),
152
+ /**
153
+ * The size of the component.
154
+ * `small` is equivalent to the dense button styling.
155
+ */
156
+ size: PropTypes.oneOf(['large', 'medium', 'small']),
157
+ style: PropTypes.object,
158
+ /**
159
+ * The system prop that allows defining system overrides as well as additional CSS styles.
160
+ */
161
+ sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
162
+ tabIndex: PropTypes.number,
163
+ /**
164
+ * Props applied to the `TouchRipple` element.
165
+ */
166
+ TouchRippleProps: PropTypes.object,
167
+ /**
168
+ * A ref that points to the `TouchRipple` element.
169
+ */
170
+ touchRippleRef: PropTypes.any
171
+ } : void 0;
172
+ export { ToolbarButton };
@@ -0,0 +1,9 @@
1
+ import * as React from 'react';
2
+ export interface ToolbarContextValue {
3
+ focusableItemId: string | null;
4
+ registerItem: (itemId: string) => void;
5
+ unregisterItem: (itemId: string) => void;
6
+ onItemKeyDown: (event: React.KeyboardEvent<HTMLButtonElement>) => void;
7
+ }
8
+ export declare const ToolbarContext: React.Context<ToolbarContextValue | undefined>;
9
+ export declare function useToolbarContext(): ToolbarContextValue;
@@ -0,0 +1,9 @@
1
+ import * as React from 'react';
2
+ export const ToolbarContext = /*#__PURE__*/React.createContext(undefined);
3
+ export function useToolbarContext() {
4
+ const context = React.useContext(ToolbarContext);
5
+ if (context === undefined) {
6
+ throw new Error('MUI X: Missing context. Toolbar subcomponents must be placed within a <Toolbar /> component.');
7
+ }
8
+ return context;
9
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./Toolbar.js";
2
+ export * from "./ToolbarButton.js";
@@ -0,0 +1,2 @@
1
+ export * from "./Toolbar.js";
2
+ export * from "./ToolbarButton.js";
@@ -132,7 +132,13 @@ const GridVirtualScrollbar = forwardRef(function GridVirtualScrollbar(props, ref
132
132
  top: 0
133
133
  } : undefined,
134
134
  tabIndex: -1,
135
- "aria-hidden": "true",
135
+ "aria-hidden": "true"
136
+ // tabIndex does not prevent focus with a mouse click, throwing a console error
137
+ // https://github.com/mui/mui-x/issues/16706
138
+ ,
139
+ onFocus: event => {
140
+ event.target.blur();
141
+ },
136
142
  children: /*#__PURE__*/_jsx("div", {
137
143
  ref: contentRef,
138
144
  className: classes.content
@@ -1,5 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
- import { GridSkeletonCell, GridColumnsPanel, GridFilterPanel, GridFooter, GridLoadingOverlay, GridNoRowsOverlay, GridPagination, GridPanel, GridRow, GridColumnHeaderFilterIconButton, GridRowCount, GridColumnsManagement, GridColumnHeaderSortIcon, GridNoColumnsOverlay, GridToolbar } from "../components/index.js";
2
+ import { GridSkeletonCell, GridColumnsPanel, GridFilterPanel, GridFooter, GridLoadingOverlay, GridNoRowsOverlay, GridPagination, GridPanel, GridRow, GridColumnHeaderFilterIconButton, GridRowCount, GridColumnsManagement, GridColumnHeaderSortIcon, GridNoColumnsOverlay } from "../components/index.js";
3
3
  import { GridCell } from "../components/cell/GridCell.js";
4
4
  import { GridColumnHeaders } from "../components/GridColumnHeaders.js";
5
5
  import { GridColumnMenu } from "../components/menu/columnMenu/GridColumnMenu.js";
@@ -8,6 +8,7 @@ import { GridPinnedRows } from "../components/GridPinnedRows.js";
8
8
  import { GridNoResultsOverlay } from "../components/GridNoResultsOverlay.js";
9
9
  import materialSlots from "../material/index.js";
10
10
  import { GridBottomContainer } from "../components/virtualization/GridBottomContainer.js";
11
+ import { GridToolbar } from "../components/toolbarV8/GridToolbar.js";
11
12
 
12
13
  // TODO: camelCase these key. It's a private helper now.
13
14
  // Remove then need to call `uncapitalizeObjectKeys`.
@@ -594,6 +594,10 @@ export interface GridClasses {
594
594
  * Styles applied to the sort icon element.
595
595
  */
596
596
  sortIcon: string;
597
+ /**
598
+ * Styles applied to the toolbar root element.
599
+ */
600
+ toolbar: string;
597
601
  /**
598
602
  * Styles applied to the shadow scroll area element.
599
603
  * @ignore - do not document.
@@ -13,6 +13,7 @@ import { useGridRegisterPipeApplier } from "../../core/pipeProcessing/index.js";
13
13
  import { gridPinnedRowsSelector, gridRowCountSelector } from "./gridRowsSelector.js";
14
14
  import { gridDimensionsSelector, gridRowHeightSelector } from "../dimensions/gridDimensionsSelectors.js";
15
15
  import { getValidRowHeight, getRowHeightWarning } from "./gridRowsUtils.js";
16
+ import { gridFocusedVirtualCellSelector } from "../virtualization/gridFocusedVirtualCellSelector.js";
16
17
  /* eslint-disable no-underscore-dangle */
17
18
 
18
19
  export const rowsMetaStateInitializer = (state, props, apiRef) => {
@@ -183,6 +184,13 @@ export const useGridRowsMeta = (apiRef, props) => {
183
184
  const entry = entries[i];
184
185
  const height = entry.borderBoxSize && entry.borderBoxSize.length > 0 ? entry.borderBoxSize[0].blockSize : entry.contentRect.height;
185
186
  const rowId = entry.target.__mui_id;
187
+ const focusedVirtualRowId = gridFocusedVirtualCellSelector(apiRef)?.id;
188
+ if (focusedVirtualRowId === rowId && height === 0) {
189
+ // Focused virtual row has 0 height.
190
+ // We don't want to store it to avoid scroll jumping.
191
+ // https://github.com/mui/mui-x/issues/14726
192
+ return;
193
+ }
186
194
  apiRef.current.unstable_storeRowHeightMeasurement(rowId, height);
187
195
  }
188
196
  if (!isHeightMetaValid.current) {
@@ -33,7 +33,6 @@ export declare const useGridVirtualScroller: () => {
33
33
  };
34
34
  getScrollbarVerticalProps: () => {
35
35
  ref: React.RefObject<HTMLDivElement | null>;
36
- role: string;
37
36
  scrollPosition: React.RefObject<{
38
37
  top: number;
39
38
  left: number;
@@ -41,7 +40,6 @@ export declare const useGridVirtualScroller: () => {
41
40
  };
42
41
  getScrollbarHorizontalProps: () => {
43
42
  ref: React.RefObject<HTMLDivElement | null>;
44
- role: string;
45
43
  scrollPosition: React.RefObject<{
46
44
  top: number;
47
45
  left: number;
@@ -520,12 +520,10 @@ export const useGridVirtualScroller = () => {
520
520
  }),
521
521
  getScrollbarVerticalProps: () => ({
522
522
  ref: scrollbarVerticalRef,
523
- role: 'presentation',
524
523
  scrollPosition
525
524
  }),
526
525
  getScrollbarHorizontalProps: () => ({
527
526
  ref: scrollbarHorizontalRef,
528
- role: 'presentation',
529
527
  scrollPosition
530
528
  }),
531
529
  getScrollAreaProps: () => ({
@@ -5,4 +5,5 @@ export { useGridSelector } from "./useGridSelector.js";
5
5
  export * from "./useGridNativeEventListener.js";
6
6
  export * from "./useFirstRender.js";
7
7
  export * from "./useOnMount.js";
8
- export * from "./useRunOnce.js";
8
+ export * from "./useRunOnce.js";
9
+ export type { RenderProp } from './useGridComponentRenderer';
@@ -0,0 +1,12 @@
1
+ import * as React from 'react';
2
+ export type RenderProp<Props, State = {}> = ((props: Props, state: State) => React.ReactElement<unknown>) | React.ReactElement<Props>;
3
+ /**
4
+ * Resolves the rendering logic for a component.
5
+ * Handles three scenarios:
6
+ * 1. A render function that receives props and state
7
+ * 2. A React element
8
+ * 3. A default element
9
+ *
10
+ * @ignore - internal hook.
11
+ */
12
+ export declare function useGridComponentRenderer<Props extends React.HTMLAttributes<any>, State extends Record<string, any>>(defaultElement: keyof React.JSX.IntrinsicElements | React.ComponentType<Props>, render: RenderProp<Props, State> | undefined, props: Props, state?: State): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
@@ -0,0 +1,36 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import * as React from 'react';
3
+ import clsx from 'clsx';
4
+ /**
5
+ * Resolves the rendering logic for a component.
6
+ * Handles three scenarios:
7
+ * 1. A render function that receives props and state
8
+ * 2. A React element
9
+ * 3. A default element
10
+ *
11
+ * @ignore - internal hook.
12
+ */
13
+ export function useGridComponentRenderer(defaultElement, render, props, state = {}) {
14
+ if (typeof render === 'function') {
15
+ return render(props, state);
16
+ }
17
+ if (render) {
18
+ if (render.props.className) {
19
+ props.className = clsx(render.props.className, props.className);
20
+ }
21
+ if (render.props.style || props.style) {
22
+ props.style = _extends({}, props.style, render.props.style);
23
+ }
24
+ if (render.props.sx || props.sx) {
25
+ props.sx = mergeSx(props.sx, render.props.sx);
26
+ }
27
+ return /*#__PURE__*/React.cloneElement(render, props);
28
+ }
29
+ return /*#__PURE__*/React.createElement(defaultElement, props);
30
+ }
31
+ function mergeSx(sx1, sx2) {
32
+ if (!sx1 || !sx2) {
33
+ return sx1 || sx2;
34
+ }
35
+ return (Array.isArray(sx1) ? sx1 : [sx1]).concat(Array.isArray(sx2) ? sx2 : [sx2]);
36
+ }
package/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v8.0.0-alpha.13
2
+ * @mui/x-data-grid v8.0.0-alpha.14
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -0,0 +1,11 @@
1
+ import * as React from 'react';
2
+ interface TailwindDemoContainerProps {
3
+ children: React.ReactNode;
4
+ documentBody?: HTMLElement;
5
+ }
6
+ /**
7
+ * WARNING: This is an internal component used in documentation to inject the Tailwind script.
8
+ * Please do not use it in your application.
9
+ */
10
+ export declare function TailwindDemoContainer(props: TailwindDemoContainerProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | React.ReactPortal | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
11
+ export {};
@@ -0,0 +1,55 @@
1
+ import * as React from 'react';
2
+ import Box from '@mui/material/Box';
3
+ import CircularProgress from '@mui/material/CircularProgress';
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ /**
6
+ * WARNING: This is an internal component used in documentation to inject the Tailwind script.
7
+ * Please do not use it in your application.
8
+ */
9
+ export function TailwindDemoContainer(props) {
10
+ const {
11
+ children,
12
+ documentBody
13
+ } = props;
14
+ const [isLoaded, setIsLoaded] = React.useState(false);
15
+ React.useEffect(() => {
16
+ const body = documentBody ?? document.body;
17
+ const script = document.createElement('script');
18
+ script.src = 'https://unpkg.com/@tailwindcss/browser@4';
19
+ let mounted = true;
20
+ const cleanup = () => {
21
+ mounted = false;
22
+ script.remove();
23
+ const head = body?.ownerDocument?.head;
24
+ if (!head) {
25
+ return;
26
+ }
27
+ const styles = head.querySelectorAll('style:not([data-emotion])');
28
+ styles.forEach(style => {
29
+ const styleText = style.textContent?.substring(0, 100);
30
+ const isTailwindStylesheet = styleText?.includes('tailwind');
31
+ if (isTailwindStylesheet) {
32
+ style.remove();
33
+ }
34
+ });
35
+ };
36
+ script.onload = () => {
37
+ if (!mounted) {
38
+ cleanup();
39
+ return;
40
+ }
41
+ setIsLoaded(true);
42
+ };
43
+ body.appendChild(script);
44
+ return cleanup;
45
+ }, [documentBody]);
46
+ return isLoaded ? children : /*#__PURE__*/_jsx(Box, {
47
+ sx: {
48
+ display: 'flex',
49
+ justifyContent: 'center',
50
+ alignItems: 'center',
51
+ height: '100%'
52
+ },
53
+ children: /*#__PURE__*/_jsx(CircularProgress, {})
54
+ });
55
+ }
@@ -0,0 +1 @@
1
+ export { TailwindDemoContainer } from "./TailwindDemoContainer.js";
@@ -0,0 +1 @@
1
+ export { TailwindDemoContainer } from "./TailwindDemoContainer.js";
@@ -5,6 +5,8 @@ export { GridVirtualScrollerRenderZone } from "../components/virtualization/Grid
5
5
  export type { GridDetailPanelsProps } from '../components/GridDetailPanels';
6
6
  export type { GridPinnedRowsProps } from '../components/GridPinnedRows';
7
7
  export { GridHeaders } from "../components/GridHeaders.js";
8
+ export { GridToolbar } from "../components/toolbarV8/GridToolbar.js";
9
+ export type { GridToolbarProps } from '../components/toolbarV8/GridToolbar';
8
10
  export { GridBaseColumnHeaders } from "../components/columnHeaders/GridBaseColumnHeaders.js";
9
11
  export { DATA_GRID_DEFAULT_SLOTS_COMPONENTS } from "../constants/defaultGridSlotsComponents.js";
10
12
  export * from "../constants/signature.js";
@@ -74,6 +76,7 @@ export * from "../hooks/features/virtualization/index.js";
74
76
  export { useGridColumnResize, columnResizeStateInitializer } from "../hooks/features/columnResize/useGridColumnResize.js";
75
77
  export { ROW_SELECTION_PROPAGATION_DEFAULT } from "../hooks/features/rowSelection/utils.js";
76
78
  export { useGridListView, listViewStateInitializer } from "../hooks/features/listView/useGridListView.js";
79
+ export { useGridComponentRenderer } from "../hooks/utils/useGridComponentRenderer.js";
77
80
  export { useTimeout } from "../hooks/utils/useTimeout.js";
78
81
  export { useGridVisibleRows, getVisibleRows } from "../hooks/utils/useGridVisibleRows.js";
79
82
  export { useGridInitializeState } from "../hooks/utils/useGridInitializeState.js";
@@ -105,4 +108,5 @@ export { serializeCellValue } from "../hooks/features/export/serializers/csvSeri
105
108
  export * from "./utils/index.js";
106
109
  export * from "./constants.js";
107
110
  export type { Localization } from '../utils/getGridLocalization';
111
+ export * from "./demo/index.js";
108
112
  export { GridSkeletonLoadingOverlayInner } from "../components/GridSkeletonLoadingOverlay.js";
@@ -2,6 +2,7 @@ export { GridVirtualScroller } from "../components/virtualization/GridVirtualScr
2
2
  export { GridVirtualScrollerContent } from "../components/virtualization/GridVirtualScrollerContent.js";
3
3
  export { GridVirtualScrollerRenderZone } from "../components/virtualization/GridVirtualScrollerRenderZone.js";
4
4
  export { GridHeaders } from "../components/GridHeaders.js";
5
+ export { GridToolbar } from "../components/toolbarV8/GridToolbar.js";
5
6
  export { GridBaseColumnHeaders } from "../components/columnHeaders/GridBaseColumnHeaders.js";
6
7
  export { DATA_GRID_DEFAULT_SLOTS_COMPONENTS } from "../constants/defaultGridSlotsComponents.js";
7
8
  export * from "../constants/signature.js";
@@ -61,6 +62,7 @@ export * from "../hooks/features/virtualization/index.js";
61
62
  export { useGridColumnResize, columnResizeStateInitializer } from "../hooks/features/columnResize/useGridColumnResize.js";
62
63
  export { ROW_SELECTION_PROPAGATION_DEFAULT } from "../hooks/features/rowSelection/utils.js";
63
64
  export { useGridListView, listViewStateInitializer } from "../hooks/features/listView/useGridListView.js";
65
+ export { useGridComponentRenderer } from "../hooks/utils/useGridComponentRenderer.js";
64
66
  export { useTimeout } from "../hooks/utils/useTimeout.js";
65
67
  export { useGridVisibleRows, getVisibleRows } from "../hooks/utils/useGridVisibleRows.js";
66
68
  export { useGridInitializeState } from "../hooks/utils/useGridInitializeState.js";
@@ -84,4 +86,5 @@ export * from "../hooks/utils/index.js";
84
86
  export { serializeCellValue } from "../hooks/features/export/serializers/csvSerializer.js";
85
87
  export * from "./utils/index.js";
86
88
  export * from "./constants.js";
89
+ export * from "./demo/index.js";
87
90
  export { GridSkeletonLoadingOverlayInner } from "../components/GridSkeletonLoadingOverlay.js";
@@ -58,9 +58,6 @@ export declare const GridLoadIcon: import("@mui/material/OverridableComponent").
58
58
  export declare const GridDragIcon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
59
59
  muiName: string;
60
60
  };
61
- export declare const GridSaveAltIcon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
62
- muiName: string;
63
- };
64
61
  export declare const GridCheckIcon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
65
62
  muiName: string;
66
63
  };
@@ -81,4 +78,7 @@ export declare const GridDeleteIcon: import("@mui/material/OverridableComponent"
81
78
  };
82
79
  export declare const GridDeleteForeverIcon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
83
80
  muiName: string;
81
+ };
82
+ export declare const GridDownloadIcon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
83
+ muiName: string;
84
84
  };
@@ -29,7 +29,7 @@ export const GridCheckCircleIcon = createSvgIcon(/*#__PURE__*/_jsx("path", {
29
29
  d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"
30
30
  }), 'CheckCircle');
31
31
  export const GridColumnIcon = createSvgIcon(/*#__PURE__*/_jsx("path", {
32
- d: "M6 5H3c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h3c.55 0 1-.45 1-1V6c0-.55-.45-1-1-1zm14 0h-3c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h3c.55 0 1-.45 1-1V6c0-.55-.45-1-1-1zm-7 0h-3c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h3c.55 0 1-.45 1-1V6c0-.55-.45-1-1-1z"
32
+ d: "M14.67 5v14H9.33V5zm1 14H21V5h-5.33zm-7.34 0V5H3v14z"
33
33
  }), 'ColumnIcon');
34
34
  export const GridSeparatorIcon = createSvgIcon(/*#__PURE__*/_jsx("rect", {
35
35
  width: "1",
@@ -64,9 +64,6 @@ export const GridLoadIcon = createSvgIcon(/*#__PURE__*/_jsx("path", {
64
64
  export const GridDragIcon = createSvgIcon(/*#__PURE__*/_jsx("path", {
65
65
  d: "M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2zm-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"
66
66
  }), 'Drag');
67
- export const GridSaveAltIcon = createSvgIcon(/*#__PURE__*/_jsx("path", {
68
- d: "M19 12v7H5v-7H3v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zm-6 .67l2.59-2.58L17 11.5l-5 5-5-5 1.41-1.41L11 12.67V3h2z"
69
- }), 'SaveAlt');
70
67
  export const GridCheckIcon = createSvgIcon(/*#__PURE__*/_jsx("path", {
71
68
  d: "M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"
72
69
  }), 'Check');
@@ -82,11 +79,14 @@ export const GridViewColumnIcon = createSvgIcon(/*#__PURE__*/_jsx("g", {
82
79
  })
83
80
  }), 'ViewColumn');
84
81
  export const GridClearIcon = createSvgIcon(/*#__PURE__*/_jsx("path", {
85
- d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
82
+ d: "M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12z"
86
83
  }), 'Clear');
87
84
  export const GridDeleteIcon = createSvgIcon(/*#__PURE__*/_jsx("path", {
88
85
  d: "M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"
89
86
  }), 'Delete');
90
87
  export const GridDeleteForeverIcon = createSvgIcon(/*#__PURE__*/_jsx("path", {
91
88
  d: "M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zm2.46-7.12l1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12zM15.5 4l-1-1h-5l-1 1H5v2h14V4z"
92
- }), 'Delete');
89
+ }), 'Delete');
90
+ export const GridDownloadIcon = createSvgIcon(/*#__PURE__*/_jsx("path", {
91
+ d: "M5 20h14v-2H5zM19 9h-4V3H9v6H5l7 7z"
92
+ }), 'Download');
@@ -42,7 +42,7 @@ import MUIInputLabel from '@mui/material/InputLabel';
42
42
  import MUISkeleton from '@mui/material/Skeleton';
43
43
  import { forwardRef } from '@mui/x-internals/forwardRef';
44
44
  import { GridColumnUnsortedIcon } from "./icons/GridColumnUnsortedIcon.js";
45
- import { GridAddIcon, GridArrowDownwardIcon, GridArrowUpwardIcon, GridCheckIcon, GridCloseIcon, GridColumnIcon, GridDragIcon, GridExpandMoreIcon, GridFilterAltIcon, GridFilterListIcon, GridKeyboardArrowRight, GridMoreVertIcon, GridRemoveIcon, GridSaveAltIcon, GridSearchIcon, GridSeparatorIcon, GridTableRowsIcon, GridTripleDotsVerticalIcon, GridViewHeadlineIcon, GridViewStreamIcon, GridVisibilityOffIcon, GridViewColumnIcon, GridClearIcon, GridLoadIcon, GridDeleteForeverIcon } from "./icons/index.js";
45
+ import { GridAddIcon, GridArrowDownwardIcon, GridArrowUpwardIcon, GridCheckIcon, GridCloseIcon, GridColumnIcon, GridDragIcon, GridExpandMoreIcon, GridFilterAltIcon, GridFilterListIcon, GridKeyboardArrowRight, GridMoreVertIcon, GridRemoveIcon, GridSearchIcon, GridSeparatorIcon, GridTableRowsIcon, GridTripleDotsVerticalIcon, GridViewHeadlineIcon, GridViewStreamIcon, GridVisibilityOffIcon, GridViewColumnIcon, GridClearIcon, GridLoadIcon, GridDeleteForeverIcon, GridDownloadIcon } from "./icons/index.js";
46
46
  import { useGridRootProps } from "../hooks/utils/useGridRootProps.js";
47
47
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
48
48
  export { useMaterialCSSVariables } from "./variables.js";
@@ -155,7 +155,7 @@ const iconSlots = {
155
155
  densityCompactIcon: GridViewHeadlineIcon,
156
156
  densityStandardIcon: GridTableRowsIcon,
157
157
  densityComfortableIcon: GridViewStreamIcon,
158
- exportIcon: GridSaveAltIcon,
158
+ exportIcon: GridDownloadIcon,
159
159
  moreActionsIcon: GridMoreVertIcon,
160
160
  treeDataCollapseIcon: GridExpandMoreIcon,
161
161
  treeDataExpandIcon: GridKeyboardArrowRight,
@@ -165,7 +165,7 @@ const iconSlots = {
165
165
  detailPanelCollapseIcon: GridRemoveIcon,
166
166
  rowReorderIcon: GridDragIcon,
167
167
  quickFilterIcon: GridSearchIcon,
168
- quickFilterClearIcon: GridCloseIcon,
168
+ quickFilterClearIcon: GridClearIcon,
169
169
  columnMenuHideIcon: GridVisibilityOffIcon,
170
170
  columnMenuSortAscendingIcon: GridArrowUpwardIcon,
171
171
  columnMenuSortDescendingIcon: GridArrowDownwardIcon,
@@ -108,7 +108,9 @@ export type IconButtonProps = Omit<ButtonProps, 'startIcon'> & {
108
108
  color?: 'default' | 'inherit' | 'primary';
109
109
  edge?: 'start' | 'end' | false;
110
110
  };
111
- export type DividerProps = {};
111
+ export type DividerProps = {
112
+ orientation?: 'horizontal' | 'vertical';
113
+ };
112
114
  export type MenuListProps = {
113
115
  ref?: Ref<HTMLUListElement>;
114
116
  id?: string;
@@ -223,6 +225,7 @@ export type SwitchProps = {
223
225
  size?: 'small' | 'medium';
224
226
  };
225
227
  export type TextFieldProps = {
228
+ role?: string;
226
229
  autoComplete?: string;
227
230
  className?: string;
228
231
  color?: 'primary' | 'error';
@@ -246,6 +249,7 @@ export type TextFieldProps = {
246
249
  tabIndex?: number;
247
250
  type?: React.HTMLInputTypeAttribute;
248
251
  value?: string;
252
+ ref?: Ref<HTMLInputElement>;
249
253
  };
250
254
  export type TooltipProps = {
251
255
  children: React.ReactElement<any, any>;
@@ -70,7 +70,7 @@ export interface GridIconSlotsComponent {
70
70
  densityComfortableIcon: React.JSXElementConstructor<any>;
71
71
  /**
72
72
  * Icon displayed on the open export button present in the toolbar by default.
73
- * @default GridSaveAltIcon
73
+ * @default GridDownloadIcon
74
74
  */
75
75
  exportIcon: React.JSXElementConstructor<any>;
76
76
  /**
@@ -149,8 +149,7 @@ export interface GridSlotsComponent extends GridBaseSlots, GridIconSlotsComponen
149
149
  */
150
150
  footerRowCount: React.JSXElementConstructor<GridSlotProps['footerRowCount']>;
151
151
  /**
152
- * Toolbar component rendered inside the Header component.
153
- * @default GridToolbar
152
+ * Toolbar component rendered in the grid header.
154
153
  */
155
154
  toolbar: React.JSXElementConstructor<GridSlotProps['toolbar']>;
156
155
  /**
@@ -21,6 +21,7 @@ var _pipeProcessing = require("../../core/pipeProcessing");
21
21
  var _gridRowsSelector = require("./gridRowsSelector");
22
22
  var _gridDimensionsSelectors = require("../dimensions/gridDimensionsSelectors");
23
23
  var _gridRowsUtils = require("./gridRowsUtils");
24
+ var _gridFocusedVirtualCellSelector = require("../virtualization/gridFocusedVirtualCellSelector");
24
25
  /* eslint-disable no-underscore-dangle */
25
26
 
26
27
  const rowsMetaStateInitializer = (state, props, apiRef) => {
@@ -192,6 +193,13 @@ const useGridRowsMeta = (apiRef, props) => {
192
193
  const entry = entries[i];
193
194
  const height = entry.borderBoxSize && entry.borderBoxSize.length > 0 ? entry.borderBoxSize[0].blockSize : entry.contentRect.height;
194
195
  const rowId = entry.target.__mui_id;
196
+ const focusedVirtualRowId = (0, _gridFocusedVirtualCellSelector.gridFocusedVirtualCellSelector)(apiRef)?.id;
197
+ if (focusedVirtualRowId === rowId && height === 0) {
198
+ // Focused virtual row has 0 height.
199
+ // We don't want to store it to avoid scroll jumping.
200
+ // https://github.com/mui/mui-x/issues/14726
201
+ return;
202
+ }
195
203
  apiRef.current.unstable_storeRowHeightMeasurement(rowId, height);
196
204
  }
197
205
  if (!isHeightMetaValid.current) {