@mui/x-data-grid 8.5.2 → 8.6.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 (42) hide show
  1. package/CHANGELOG.md +203 -11
  2. package/components/cell/GridActionsCell.js +0 -9
  3. package/components/cell/GridActionsCellItem.d.ts +4 -1
  4. package/components/cell/GridActionsCellItem.js +1 -1
  5. package/components/containers/GridRootStyles.d.ts +1 -1
  6. package/components/menu/GridMenu.d.ts +1 -1
  7. package/components/menu/GridMenu.js +8 -1
  8. package/components/menu/columnMenu/GridColumnMenuContainer.js +8 -0
  9. package/components/toolbar/GridToolbarDensitySelector.js +0 -10
  10. package/components/toolbar/GridToolbarExportContainer.js +0 -10
  11. package/components/toolbarV8/GridToolbar.js +1 -0
  12. package/components/toolbarV8/Toolbar.d.ts +1 -1
  13. package/esm/components/cell/GridActionsCell.js +0 -9
  14. package/esm/components/cell/GridActionsCellItem.d.ts +4 -1
  15. package/esm/components/cell/GridActionsCellItem.js +1 -1
  16. package/esm/components/containers/GridRootStyles.d.ts +1 -1
  17. package/esm/components/menu/GridMenu.d.ts +1 -1
  18. package/esm/components/menu/GridMenu.js +8 -1
  19. package/esm/components/menu/columnMenu/GridColumnMenuContainer.js +8 -0
  20. package/esm/components/toolbar/GridToolbarDensitySelector.js +0 -10
  21. package/esm/components/toolbar/GridToolbarExportContainer.js +0 -10
  22. package/esm/components/toolbarV8/GridToolbar.js +1 -0
  23. package/esm/components/toolbarV8/Toolbar.d.ts +1 -1
  24. package/esm/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +1 -1
  25. package/esm/hooks/features/dataSource/utils.js +1 -1
  26. package/esm/hooks/features/focus/useGridFocus.js +1 -1
  27. package/esm/index.js +1 -1
  28. package/esm/internals/demo/TailwindDemoContainer.d.ts +1 -1
  29. package/esm/locales/daDK.js +4 -4
  30. package/esm/locales/deDE.js +65 -73
  31. package/esm/models/gridBaseSlots.d.ts +1 -0
  32. package/esm/models/params/gridScrollParams.d.ts +4 -0
  33. package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +1 -1
  34. package/hooks/features/dataSource/utils.js +1 -1
  35. package/hooks/features/focus/useGridFocus.js +1 -1
  36. package/index.js +1 -1
  37. package/internals/demo/TailwindDemoContainer.d.ts +1 -1
  38. package/locales/daDK.js +4 -4
  39. package/locales/deDE.js +65 -73
  40. package/models/gridBaseSlots.d.ts +1 -0
  41. package/models/params/gridScrollParams.d.ts +4 -0
  42. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -5,6 +5,208 @@
5
5
  All notable changes to this project will be documented in this file.
6
6
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
7
7
 
8
+ ## 8.6.0
9
+
10
+ _Jun 27, 2025_
11
+
12
+ We'd like to extend a big thank you to the 12 contributors who made this release possible. Here are some highlights ✨:
13
+
14
+ - 📊 Add export menu to charts toolbar
15
+ - 📅 Add `usePickerAdapter` hook to access the date adapter.
16
+
17
+ You can use the adapter in your custom components if you need them to work with multiple date libraries — [Learn more](https://mui.com/x/react-date-pickers/custom-components/#access-date-adapter).
18
+ - 🌎 Improve Danish (da-DK) locale
19
+ - 🌎 Improve German (de-DE) locale
20
+
21
+ Special thanks go out to the community members for their valuable contributions:
22
+ @ShahrazH, @vadimka123
23
+
24
+ The following are all team members who have contributed to this release:
25
+ @arminmeh, @bernardobelchior, @JCQuintas, @KenanYusuf, @LukasTy, @MBilalShafi, @michelengelen, @noraleonte, @rita-codes, @sai6855
26
+
27
+ ### Data Grid
28
+
29
+ #### `@mui/x-data-grid@8.6.0`
30
+
31
+ - [DataGrid] Fix `label` type in `GridActionsCellItem` type (#18175) @sai6855
32
+ - [DataGrid] Fix grid menu not closing when pressing escape/tab (#18300) @KenanYusuf
33
+ - [l10n] Improve Danish (da-DK) locale (#18428) @ShahrazH
34
+ - [l10n] Improve German (de-DE) locale (#18388) @omalyutin
35
+
36
+ #### `@mui/x-data-grid-pro@8.6.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link "Pro plan")
37
+
38
+ Same changes as in `@mui/x-data-grid@8.6.0`, plus:
39
+
40
+ - [DataGridPro] Fix lazy loading params calculated from rendering context (#18460) @arminmeh
41
+
42
+ #### `@mui/x-data-grid-premium@8.6.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link "Premium plan")
43
+
44
+ Same changes as in `@mui/x-data-grid-pro@8.6.0`.
45
+
46
+ ### Date and Time Pickers
47
+
48
+ #### `@mui/x-date-pickers@8.6.0`
49
+
50
+ - [pickers] Add `usePickerAdapter` hook (#18457) @LukasTy
51
+ - [pickers] Fix to use latest `value` when updating `lastCommittedValue` in internal state (#18518) @LukasTy
52
+ - [pickers] Use `usePickerAdapter` hook internally instead of `useUtils` (#18465) @LukasTy
53
+
54
+ #### `@mui/x-date-pickers-pro@8.6.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link "Pro plan")
55
+
56
+ Same changes as in `@mui/x-date-pickers@8.6.0`.
57
+
58
+ ### Charts
59
+
60
+ #### `@mui/x-charts@8.6.0`
61
+
62
+ - [charts] Add `data-series` to charts legend item (#18414) @bernardobelchior
63
+ - [charts] Add `data-series` to bar charts (#18413) @bernardobelchior
64
+ - [charts] Add `data-series` to elements of line chart (#18409) @bernardobelchior
65
+ - [charts] Add `data-series` to pie charts (#18432) @bernardobelchior
66
+ - [charts] Fix missing key in bar plot (#18502) @bernardobelchior
67
+ - [charts] Split axis utils from main file (#18517) @JCQuintas
68
+ - [charts] Improve touch behavior for polar axis (#18531) @JCQuintas
69
+ - [charts] Add `isElementInside` helper (#18530) @JCQuintas
70
+
71
+ #### `@mui/x-charts-pro@8.6.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link "Pro plan")
72
+
73
+ Same changes as in `@mui/x-charts@8.6.0`, plus:
74
+
75
+ - [charts-pro] Add export menu to charts toolbar (#18210) @bernardobelchior
76
+ - [charts-pro] Fix export docs mentioning tooltip instead of toolbar (#18490) @bernardobelchior
77
+ - [charts-pro] Fix iframe not being removed after print export (#18500) @bernardobelchior
78
+
79
+ ### Tree View
80
+
81
+ #### `@mui/x-tree-view@8.6.0`
82
+
83
+ Internal changes.
84
+
85
+ #### `@mui/x-tree-view-pro@8.6.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link "Pro plan")
86
+
87
+ Same changes as in `@mui/x-tree-view@8.6.0`, plus:
88
+
89
+ - [tree view pro] Fix theme augmentation (#18437) @LukasTy
90
+
91
+ ### Codemod
92
+
93
+ #### `@mui/x-codemod@8.6.0`
94
+
95
+ Internal changes.
96
+
97
+ ### Docs
98
+
99
+ - [docs] Document `GridRenderContext` (#18492) @arminmeh
100
+ - [docs] Prevent stale rows to appear on sort and filter change in the lazy loading demo (#18461) @arminmeh
101
+ - [docs][pickers] Update action bar demo to use the `nextOrAccept` action (#18505) @LukasTy
102
+ - [docs] Update indeterminate checkbox section in migration guide (#18229) @michelengelen
103
+ - [docs] Data source nested pagination recipe (#14777) @MBilalShafi
104
+
105
+ ### Core
106
+
107
+ - [core] Avoid json stringify whole window object (#18512) @vadimka123
108
+
109
+ ### Miscellaneous
110
+
111
+ - [code-infra] Dynamically get pickers adapters dependencies versions (#18446) @JCQuintas
112
+ - [infra] Adjust inquirer version and usage (#18495) @michelengelen
113
+ - [infra] Use `String.raw` for creating the remote regex (#18462) @michelengelen
114
+
115
+ ## 8.5.3
116
+
117
+ _Jun 19, 2025_
118
+
119
+ We'd like to extend a big thank you to the 10 contributors who made this release possible. Here are some highlights ✨:
120
+
121
+ - 📚 Documentation improvements
122
+ - 🐞 Bugfixes
123
+
124
+ Special thanks go out to the community members for their valuable contributions:
125
+ @alisasanib, @arminmeh, @sai6855
126
+
127
+ The following are all team members who have contributed to this release:
128
+ @alexfauquette, @bernardobelchior, @flaviendelangle, @JCQuintas, @LukasTy, @MBilalShafi, @oliviertassinari
129
+
130
+ ### Data Grid
131
+
132
+ #### `@mui/x-data-grid@8.5.3`
133
+
134
+ - [DataGrid] Fix export menu button tooltip being interactive when menu is open (#18327) @bernardobelchior
135
+ - [DataGrid] Fix column menu scroll close (#18065) @alisasanib
136
+ - [DataGrid] Fix page size issue with data source (#18419) @MBilalShafi
137
+
138
+ #### `@mui/x-data-grid-pro@8.5.3` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
139
+
140
+ Same changes as in `@mui/x-data-grid@8.5.3`, plus:
141
+
142
+ - [DataGridPro] Ignore missing `rowCount` response when new children are fetched with the data source (#17711) @arminmeh
143
+
144
+ #### `@mui/x-data-grid-premium@8.5.3` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
145
+
146
+ Same changes as in `@mui/x-data-grid-pro@8.5.3`.
147
+
148
+ ### Date and Time Pickers
149
+
150
+ #### `@mui/x-date-pickers@8.5.3`
151
+
152
+ - [pickers] Add `inputSizeSmall` to classes interface (#18242) @sai6855
153
+
154
+ #### `@mui/x-date-pickers-pro@8.5.3` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
155
+
156
+ Same changes as in `@mui/x-date-pickers@8.5.3`.
157
+
158
+ ### Charts
159
+
160
+ #### `@mui/x-charts@8.5.3`
161
+
162
+ - [charts] Add item class to list item around each series in legend (#18411) @bernardobelchior
163
+ - [charts] Allow `tabIndex` in surface and legend (#18344) @JCQuintas
164
+ - [charts] Explore selector typing (#18362) @alexfauquette
165
+ - [charts] Fix highlight with number ids (#18423) @alexfauquette
166
+ - [charts] Make scatter chart use data attributes (#18048) @alexfauquette
167
+
168
+ #### `@mui/x-charts-pro@8.5.3` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
169
+
170
+ Same changes as in `@mui/x-charts@8.5.3`, plus:
171
+
172
+ - [charts-pro] Add data-series to elements of funnel chart (#18067) @JCQuintas
173
+ - [charts-pro] Hide values outside minStart and maxEnd in zoom slider (#18336) @bernardobelchior
174
+ - [charts-pro] Fix `FunnelChart` label positioning with different curves (#18354) @JCQuintas
175
+
176
+ ### Tree View
177
+
178
+ #### `@mui/x-tree-view@8.5.3`
179
+
180
+ Internal changes.
181
+
182
+ #### `@mui/x-tree-view-pro@8.5.3` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
183
+
184
+ Same changes as in `@mui/x-tree-view@8.5.3`.
185
+
186
+ ### Codemod
187
+
188
+ #### `@mui/x-codemod@8.5.3`
189
+
190
+ Internal changes.
191
+
192
+ ### Docs
193
+
194
+ - [docs] Fix 404 in charts docs (#18440) @alexfauquette
195
+ - [docs][pickers] Fix adapter version resolving when opening demo to edit (#18363) @LukasTy
196
+
197
+ ### Core
198
+
199
+ - [core] Fix pnpm valelint error (#18420) @oliviertassinari
200
+
201
+ ### Miscellaneous
202
+
203
+ - [code-infra] Add back a `Playwright` renovate group (#18397) @LukasTy
204
+ - [code-infra] Setup `CODEOWNERS` for charts repositories (#18418) @JCQuintas
205
+ - [code-infra] Strengthen `URL` usage for test config (#18444) @LukasTy
206
+ - [code-infra] Use `vitest` bundled types (#17758) @JCQuintas
207
+ - [infra] Stabilise tests by removing babel and plugins from vitest (#18341) @JCQuintas
208
+ - [infra] Add automated release PR creation script (#18345) @michelengelen
209
+
8
210
  ## 8.5.2
9
211
 
10
212
  _Jun 12, 2025_
@@ -94,7 +296,7 @@ Same changes as in `@mui/x-tree-view@8.5.2`.
94
296
  - [code-infra] Revert `React` to `19.0.0` (#18265) @LukasTy
95
297
  - [code-infra] Use `catalog` for reused dependencies (#18302) @LukasTy
96
298
  - [infra] Remove unused karma/mocha deps and files (#18340) @JCQuintas
97
- - [infra] Update github label references to use 'scope' instead of 'component' (#18260) @michelengelen
299
+ - [infra] Update GitHub label references to use 'scope' instead of 'component' (#18260) @michelengelen
98
300
  - [infra] Use a single browser server in CI (#18230) @JCQuintas
99
301
 
100
302
  ## 8.5.1
@@ -189,15 +391,6 @@ Same changes as in `@mui/x-tree-view@8.5.1`.
189
391
 
190
392
  ### Core
191
393
 
192
- - chore(deps): bump @next/eslint-plugin-next to 15.3.3 (#18155) @renovate[bot]
193
- - chore(deps): bump @types/lodash to ^4.17.17 (#17990) @renovate[bot]
194
- - chore(deps): bump babel (#18157) @renovate[bot]
195
- - chore(deps): bump eslint to ^9.28.0 (#17352) @renovate[bot]
196
- - chore(deps): bump material ui (#17802) @renovate[bot]
197
- - chore(deps): bump next to ^15.3.3 (#18159) @renovate[bot]
198
- - chore(deps): bump ossf/scorecard-action action to v2.4.2 (#18160) @renovate[bot]
199
- - chore(deps): bump react-router to ^7.6.1 (#18162) @renovate[bot]
200
- - chore(deps): bump yargs to ^18.0.0 (#18169) @renovate[bot]
201
394
  - [code-infra] Different approach to console testing for `processRowUpdate` (#18213) @JCQuintas
202
395
  - [code-infra] Fix act warnings in DataGrid/toolbar (#18207) @JCQuintas
203
396
  - [code-infra] Remove `istanbul` references (#18194) @JCQuintas
@@ -4641,7 +4834,6 @@ No changes since `@mui/x-charts@7.22.2`.
4641
4834
  - [docs] Add `next` version links (#15423) @LukasTy
4642
4835
  - [docs] Use the `loading` state in the demos (#15538) @cherniavskii
4643
4836
  - [docs] Add data caching to lazy loaded detail panel demo (#15506) @cherniavskii
4644
-
4645
4837
  - [code-infra] Tentative fix for Argos flaky screenshot tests (#15399) @JCQuintas
4646
4838
  - [docs-infra] Transpile `.ts` demo files (#15421) @KenanYusuf
4647
4839
  - [core] Clarify release version bump strategy (#15536) @cherniavskii
@@ -148,14 +148,6 @@ function GridActionsCell(props) {
148
148
  setFocusedButtonIndex(newIndex);
149
149
  }
150
150
  };
151
- const handleListKeyDown = event => {
152
- if (event.key === 'Tab') {
153
- event.preventDefault();
154
- }
155
- if (['Tab', 'Escape'].includes(event.key)) {
156
- hideMenu();
157
- }
158
- };
159
151
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", (0, _extends2.default)({
160
152
  role: "menu",
161
153
  ref: rootRef,
@@ -192,7 +184,6 @@ function GridActionsCell(props) {
192
184
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseMenuList, {
193
185
  id: menuId,
194
186
  className: _gridClasses.gridClasses.menuList,
195
- onKeyDown: handleListKeyDown,
196
187
  "aria-labelledby": buttonId,
197
188
  autoFocusItem: true,
198
189
  children: menuButtons.map((button, index) => /*#__PURE__*/React.cloneElement(button, {
@@ -1,7 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { GridSlotProps, GridBaseIconProps } from "../../models/gridSlotsComponentsProps.js";
3
3
  interface GridActionsCellItemCommonProps {
4
- label: string;
5
4
  icon?: React.JSXElementConstructor<GridBaseIconProps> | React.ReactNode;
6
5
  /** from https://mui.com/material-ui/api/button-base/#ButtonBase-prop-component */
7
6
  component?: React.ElementType;
@@ -9,6 +8,7 @@ interface GridActionsCellItemCommonProps {
9
8
  export type GridActionsCellItemProps = GridActionsCellItemCommonProps & (({
10
9
  showInMenu?: false;
11
10
  icon: React.ReactElement<any>;
11
+ label: string;
12
12
  } & Omit<GridSlotProps['baseIconButton'], 'component'>) | ({
13
13
  showInMenu: true;
14
14
  /**
@@ -17,6 +17,7 @@ export type GridActionsCellItemProps = GridActionsCellItemCommonProps & (({
17
17
  */
18
18
  closeMenuOnClick?: boolean;
19
19
  closeMenu?: () => void;
20
+ label: React.ReactNode;
20
21
  } & Omit<GridSlotProps['baseMenuItem'], 'component'>));
21
22
  declare const GridActionsCellItem: React.ForwardRefExoticComponent<GridActionsCellItemProps> | React.ForwardRefExoticComponent<((GridActionsCellItemCommonProps & {
22
23
  showInMenu: true;
@@ -26,6 +27,7 @@ declare const GridActionsCellItem: React.ForwardRefExoticComponent<GridActionsCe
26
27
  */
27
28
  closeMenuOnClick?: boolean;
28
29
  closeMenu?: () => void;
30
+ label: React.ReactNode;
29
31
  } & Omit<React.DOMAttributes<HTMLElement> & {
30
32
  [k: `aria-${string}`]: any;
31
33
  [k: `data-${string}`]: any;
@@ -44,6 +46,7 @@ declare const GridActionsCellItem: React.ForwardRefExoticComponent<GridActionsCe
44
46
  } & import("@mui/x-data-grid").BaseMenuItemPropsOverrides, "component">) | Omit<GridActionsCellItemCommonProps & {
45
47
  showInMenu?: false;
46
48
  icon: React.ReactElement<any>;
49
+ label: string;
47
50
  } & Omit<Omit<import("../../models/gridBaseSlots.js").ButtonProps, "startIcon"> & {
48
51
  label?: string;
49
52
  color?: "default" | "inherit" | "primary";
@@ -75,7 +75,7 @@ process.env.NODE_ENV !== "production" ? GridActionsCellItem.propTypes = {
75
75
  component: _propTypes.default.elementType,
76
76
  disabled: _propTypes.default.bool,
77
77
  icon: _propTypes.default /* @typescript-to-proptypes-ignore */.oneOfType([_propTypes.default.element, _propTypes.default.func, _propTypes.default.number, _propTypes.default.object, _propTypes.default.string, _propTypes.default.bool]),
78
- label: _propTypes.default.string.isRequired,
78
+ label: _propTypes.default.node,
79
79
  showInMenu: _propTypes.default.bool,
80
80
  style: _propTypes.default.object
81
81
  } : void 0;
@@ -2,4 +2,4 @@ import { DataGridProcessedProps } from "../../models/props/DataGridProps.js";
2
2
  export type OwnerState = DataGridProcessedProps;
3
3
  export declare const GridRootStyles: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
4
4
  ownerState: OwnerState;
5
- }, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("react").ClassAttributes<HTMLDivElement> | keyof import("react").HTMLAttributes<HTMLDivElement>>, {}>;
5
+ }, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("react").HTMLAttributes<HTMLDivElement> | keyof import("react").ClassAttributes<HTMLDivElement>>, {}>;
@@ -4,7 +4,7 @@ type MenuPosition = 'bottom-end' | 'bottom-start' | 'bottom' | 'left-end' | 'lef
4
4
  export interface GridMenuProps extends Pick<PopperProps, 'className' | 'onExited'> {
5
5
  open: boolean;
6
6
  target: HTMLElement | null;
7
- onClose: (event?: Event) => void;
7
+ onClose: (event?: React.KeyboardEvent | MouseEvent | TouchEvent) => void;
8
8
  position?: MenuPosition;
9
9
  children: React.ReactNode;
10
10
  }
@@ -15,6 +15,7 @@ var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"
15
15
  var _useEnhancedEffect = _interopRequireDefault(require("@mui/utils/useEnhancedEffect"));
16
16
  var _HTMLElementType = _interopRequireDefault(require("@mui/utils/HTMLElementType"));
17
17
  var _styles = require("@mui/material/styles");
18
+ var _keyboardUtils = require("../../utils/keyboardUtils");
18
19
  var _cssVariables = require("../../constants/cssVariables");
19
20
  var _context = require("../../utils/css/context");
20
21
  var _gridClasses = require("../../constants/gridClasses");
@@ -78,6 +79,11 @@ function GridMenu(props) {
78
79
  }
79
80
  onClose(event);
80
81
  };
82
+ const handleKeyDown = event => {
83
+ if ((0, _keyboardUtils.isHideMenuKey)(event.key)) {
84
+ onClose(event);
85
+ }
86
+ };
81
87
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(GridMenuRoot, (0, _extends2.default)({
82
88
  as: rootProps.slots.basePopper,
83
89
  className: (0, _clsx.default)(classes.root, className, variablesClass),
@@ -88,7 +94,8 @@ function GridMenu(props) {
88
94
  placement: position,
89
95
  onClickAway: handleClickAway,
90
96
  onExited: onExited,
91
- clickAwayMouseEvent: "onMouseDown"
97
+ clickAwayMouseEvent: "onMouseDown",
98
+ onKeyDown: handleKeyDown
92
99
  }, other, rootProps.slotProps?.basePopper, {
93
100
  children: children
94
101
  }));
@@ -22,6 +22,12 @@ const _excluded = ["hideMenu", "colDef", "id", "labelledby", "className", "child
22
22
  const StyledMenuList = (0, _styles.styled)(_assert.NotRendered)(() => ({
23
23
  minWidth: 248
24
24
  }));
25
+ function handleMenuScrollCapture(event) {
26
+ if (!event.currentTarget.contains(event.target)) {
27
+ return;
28
+ }
29
+ event.stopPropagation();
30
+ }
25
31
  const GridColumnMenuContainer = exports.GridColumnMenuContainer = (0, _forwardRef.forwardRef)(function GridColumnMenuContainer(props, ref) {
26
32
  const {
27
33
  hideMenu,
@@ -47,6 +53,8 @@ const GridColumnMenuContainer = exports.GridColumnMenuContainer = (0, _forwardRe
47
53
  className: (0, _clsx.default)(_gridClasses.gridClasses.menuList, className),
48
54
  "aria-labelledby": labelledby,
49
55
  onKeyDown: handleListKeyDown,
56
+ onWheel: handleMenuScrollCapture,
57
+ onTouchMove: handleMenuScrollCapture,
50
58
  autoFocus: open
51
59
  }, other, {
52
60
  ref: ref,
@@ -13,7 +13,6 @@ var _useId = _interopRequireDefault(require("@mui/utils/useId"));
13
13
  var _useForkRef = _interopRequireDefault(require("@mui/utils/useForkRef"));
14
14
  var _forwardRef = require("@mui/x-internals/forwardRef");
15
15
  var _densitySelector = require("../../hooks/features/density/densitySelector");
16
- var _keyboardUtils = require("../../utils/keyboardUtils");
17
16
  var _useGridApiContext = require("../../hooks/utils/useGridApiContext");
18
17
  var _useGridSelector = require("../../hooks/utils/useGridSelector");
19
18
  var _GridMenu = require("../menu/GridMenu");
@@ -71,14 +70,6 @@ const GridToolbarDensitySelector = exports.GridToolbarDensitySelector = (0, _for
71
70
  apiRef.current.setDensity(newDensity);
72
71
  setOpen(false);
73
72
  };
74
- const handleListKeyDown = event => {
75
- if (event.key === 'Tab') {
76
- event.preventDefault();
77
- }
78
- if ((0, _keyboardUtils.isHideMenuKey)(event.key)) {
79
- setOpen(false);
80
- }
81
- };
82
73
 
83
74
  // Disable the button if the corresponding is disabled
84
75
  if (rootProps.disableDensitySelector) {
@@ -117,7 +108,6 @@ const GridToolbarDensitySelector = exports.GridToolbarDensitySelector = (0, _for
117
108
  id: densityMenuId,
118
109
  className: _gridClasses.gridClasses.menuList,
119
110
  "aria-labelledby": densityButtonId,
120
- onKeyDown: handleListKeyDown,
121
111
  autoFocusItem: open,
122
112
  children: densityElements
123
113
  })
@@ -12,7 +12,6 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
12
12
  var _useId = _interopRequireDefault(require("@mui/utils/useId"));
13
13
  var _useForkRef = _interopRequireDefault(require("@mui/utils/useForkRef"));
14
14
  var _forwardRef = require("@mui/x-internals/forwardRef");
15
- var _keyboardUtils = require("../../utils/keyboardUtils");
16
15
  var _useGridApiContext = require("../../hooks/utils/useGridApiContext");
17
16
  var _GridMenu = require("../menu/GridMenu");
18
17
  var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
@@ -37,14 +36,6 @@ const GridToolbarExportContainer = exports.GridToolbarExportContainer = (0, _for
37
36
  buttonProps.onClick?.(event);
38
37
  };
39
38
  const handleMenuClose = () => setOpen(false);
40
- const handleListKeyDown = event => {
41
- if (event.key === 'Tab') {
42
- event.preventDefault();
43
- }
44
- if ((0, _keyboardUtils.isHideMenuKey)(event.key)) {
45
- handleMenuClose();
46
- }
47
- };
48
39
  if (children == null) {
49
40
  return null;
50
41
  }
@@ -75,7 +66,6 @@ const GridToolbarExportContainer = exports.GridToolbarExportContainer = (0, _for
75
66
  id: exportMenuId,
76
67
  className: _gridClasses.gridClasses.menuList,
77
68
  "aria-labelledby": exportButtonId,
78
- onKeyDown: handleListKeyDown,
79
69
  autoFocusItem: open,
80
70
  children: React.Children.map(children, child => {
81
71
  if (! /*#__PURE__*/React.isValidElement(child)) {
@@ -131,6 +131,7 @@ function GridToolbar(props) {
131
131
  }), additionalItems, showExportMenu && (!rootProps.disableColumnFilter || !rootProps.disableColumnSelector) && /*#__PURE__*/(0, _jsxRuntime.jsx)(GridToolbarDivider, {}), showExportMenu && /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
132
132
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseTooltip, {
133
133
  title: apiRef.current.getLocaleText('toolbarExport'),
134
+ disableInteractive: exportMenuOpen,
134
135
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ToolbarButton.ToolbarButton, {
135
136
  ref: exportMenuTriggerRef,
136
137
  id: exportMenuTriggerId,
@@ -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/system").Theme>, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.HTMLAttributes<HTMLDivElement> | keyof React.ClassAttributes<HTMLDivElement>>, {}>;
10
10
  /**
11
11
  * The top level Toolbar component that provides context to child components.
12
12
  * It renders a styled `<div />` element.
@@ -139,14 +139,6 @@ function GridActionsCell(props) {
139
139
  setFocusedButtonIndex(newIndex);
140
140
  }
141
141
  };
142
- const handleListKeyDown = event => {
143
- if (event.key === 'Tab') {
144
- event.preventDefault();
145
- }
146
- if (['Tab', 'Escape'].includes(event.key)) {
147
- hideMenu();
148
- }
149
- };
150
142
  return /*#__PURE__*/_jsxs("div", _extends({
151
143
  role: "menu",
152
144
  ref: rootRef,
@@ -183,7 +175,6 @@ function GridActionsCell(props) {
183
175
  children: /*#__PURE__*/_jsx(rootProps.slots.baseMenuList, {
184
176
  id: menuId,
185
177
  className: gridClasses.menuList,
186
- onKeyDown: handleListKeyDown,
187
178
  "aria-labelledby": buttonId,
188
179
  autoFocusItem: true,
189
180
  children: menuButtons.map((button, index) => /*#__PURE__*/React.cloneElement(button, {
@@ -1,7 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { GridSlotProps, GridBaseIconProps } from "../../models/gridSlotsComponentsProps.js";
3
3
  interface GridActionsCellItemCommonProps {
4
- label: string;
5
4
  icon?: React.JSXElementConstructor<GridBaseIconProps> | React.ReactNode;
6
5
  /** from https://mui.com/material-ui/api/button-base/#ButtonBase-prop-component */
7
6
  component?: React.ElementType;
@@ -9,6 +8,7 @@ interface GridActionsCellItemCommonProps {
9
8
  export type GridActionsCellItemProps = GridActionsCellItemCommonProps & (({
10
9
  showInMenu?: false;
11
10
  icon: React.ReactElement<any>;
11
+ label: string;
12
12
  } & Omit<GridSlotProps['baseIconButton'], 'component'>) | ({
13
13
  showInMenu: true;
14
14
  /**
@@ -17,6 +17,7 @@ export type GridActionsCellItemProps = GridActionsCellItemCommonProps & (({
17
17
  */
18
18
  closeMenuOnClick?: boolean;
19
19
  closeMenu?: () => void;
20
+ label: React.ReactNode;
20
21
  } & Omit<GridSlotProps['baseMenuItem'], 'component'>));
21
22
  declare const GridActionsCellItem: React.ForwardRefExoticComponent<GridActionsCellItemProps> | React.ForwardRefExoticComponent<((GridActionsCellItemCommonProps & {
22
23
  showInMenu: true;
@@ -26,6 +27,7 @@ declare const GridActionsCellItem: React.ForwardRefExoticComponent<GridActionsCe
26
27
  */
27
28
  closeMenuOnClick?: boolean;
28
29
  closeMenu?: () => void;
30
+ label: React.ReactNode;
29
31
  } & Omit<React.DOMAttributes<HTMLElement> & {
30
32
  [k: `aria-${string}`]: any;
31
33
  [k: `data-${string}`]: any;
@@ -44,6 +46,7 @@ declare const GridActionsCellItem: React.ForwardRefExoticComponent<GridActionsCe
44
46
  } & import("@mui/x-data-grid").BaseMenuItemPropsOverrides, "component">) | Omit<GridActionsCellItemCommonProps & {
45
47
  showInMenu?: false;
46
48
  icon: React.ReactElement<any>;
49
+ label: string;
47
50
  } & Omit<Omit<import("../../models/gridBaseSlots.js").ButtonProps, "startIcon"> & {
48
51
  label?: string;
49
52
  color?: "default" | "inherit" | "primary";
@@ -67,7 +67,7 @@ process.env.NODE_ENV !== "production" ? GridActionsCellItem.propTypes = {
67
67
  component: PropTypes.elementType,
68
68
  disabled: PropTypes.bool,
69
69
  icon: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.element, PropTypes.func, PropTypes.number, PropTypes.object, PropTypes.string, PropTypes.bool]),
70
- label: PropTypes.string.isRequired,
70
+ label: PropTypes.node,
71
71
  showInMenu: PropTypes.bool,
72
72
  style: PropTypes.object
73
73
  } : void 0;
@@ -2,4 +2,4 @@ import { DataGridProcessedProps } from "../../models/props/DataGridProps.js";
2
2
  export type OwnerState = DataGridProcessedProps;
3
3
  export declare const GridRootStyles: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
4
4
  ownerState: OwnerState;
5
- }, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("react").ClassAttributes<HTMLDivElement> | keyof import("react").HTMLAttributes<HTMLDivElement>>, {}>;
5
+ }, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("react").HTMLAttributes<HTMLDivElement> | keyof import("react").ClassAttributes<HTMLDivElement>>, {}>;
@@ -4,7 +4,7 @@ type MenuPosition = 'bottom-end' | 'bottom-start' | 'bottom' | 'left-end' | 'lef
4
4
  export interface GridMenuProps extends Pick<PopperProps, 'className' | 'onExited'> {
5
5
  open: boolean;
6
6
  target: HTMLElement | null;
7
- onClose: (event?: Event) => void;
7
+ onClose: (event?: React.KeyboardEvent | MouseEvent | TouchEvent) => void;
8
8
  position?: MenuPosition;
9
9
  children: React.ReactNode;
10
10
  }
@@ -8,6 +8,7 @@ import composeClasses from '@mui/utils/composeClasses';
8
8
  import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
9
9
  import HTMLElementType from '@mui/utils/HTMLElementType';
10
10
  import { styled } from '@mui/material/styles';
11
+ import { isHideMenuKey } from "../../utils/keyboardUtils.js";
11
12
  import { vars } from "../../constants/cssVariables.js";
12
13
  import { useCSSVariablesClass } from "../../utils/css/context.js";
13
14
  import { getDataGridUtilityClass, gridClasses } from "../../constants/gridClasses.js";
@@ -70,6 +71,11 @@ function GridMenu(props) {
70
71
  }
71
72
  onClose(event);
72
73
  };
74
+ const handleKeyDown = event => {
75
+ if (isHideMenuKey(event.key)) {
76
+ onClose(event);
77
+ }
78
+ };
73
79
  return /*#__PURE__*/_jsx(GridMenuRoot, _extends({
74
80
  as: rootProps.slots.basePopper,
75
81
  className: clsx(classes.root, className, variablesClass),
@@ -80,7 +86,8 @@ function GridMenu(props) {
80
86
  placement: position,
81
87
  onClickAway: handleClickAway,
82
88
  onExited: onExited,
83
- clickAwayMouseEvent: "onMouseDown"
89
+ clickAwayMouseEvent: "onMouseDown",
90
+ onKeyDown: handleKeyDown
84
91
  }, other, rootProps.slotProps?.basePopper, {
85
92
  children: children
86
93
  }));
@@ -14,6 +14,12 @@ import { jsx as _jsx } from "react/jsx-runtime";
14
14
  const StyledMenuList = styled(NotRendered)(() => ({
15
15
  minWidth: 248
16
16
  }));
17
+ function handleMenuScrollCapture(event) {
18
+ if (!event.currentTarget.contains(event.target)) {
19
+ return;
20
+ }
21
+ event.stopPropagation();
22
+ }
17
23
  const GridColumnMenuContainer = forwardRef(function GridColumnMenuContainer(props, ref) {
18
24
  const {
19
25
  hideMenu,
@@ -39,6 +45,8 @@ const GridColumnMenuContainer = forwardRef(function GridColumnMenuContainer(prop
39
45
  className: clsx(gridClasses.menuList, className),
40
46
  "aria-labelledby": labelledby,
41
47
  onKeyDown: handleListKeyDown,
48
+ onWheel: handleMenuScrollCapture,
49
+ onTouchMove: handleMenuScrollCapture,
42
50
  autoFocus: open
43
51
  }, other, {
44
52
  ref: ref,
@@ -5,7 +5,6 @@ import useId from '@mui/utils/useId';
5
5
  import useForkRef from '@mui/utils/useForkRef';
6
6
  import { forwardRef } from '@mui/x-internals/forwardRef';
7
7
  import { gridDensitySelector } from "../../hooks/features/density/densitySelector.js";
8
- import { isHideMenuKey } from "../../utils/keyboardUtils.js";
9
8
  import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
10
9
  import { useGridSelector } from "../../hooks/utils/useGridSelector.js";
11
10
  import { GridMenu } from "../menu/GridMenu.js";
@@ -63,14 +62,6 @@ const GridToolbarDensitySelector = forwardRef(function GridToolbarDensitySelecto
63
62
  apiRef.current.setDensity(newDensity);
64
63
  setOpen(false);
65
64
  };
66
- const handleListKeyDown = event => {
67
- if (event.key === 'Tab') {
68
- event.preventDefault();
69
- }
70
- if (isHideMenuKey(event.key)) {
71
- setOpen(false);
72
- }
73
- };
74
65
 
75
66
  // Disable the button if the corresponding is disabled
76
67
  if (rootProps.disableDensitySelector) {
@@ -109,7 +100,6 @@ const GridToolbarDensitySelector = forwardRef(function GridToolbarDensitySelecto
109
100
  id: densityMenuId,
110
101
  className: gridClasses.menuList,
111
102
  "aria-labelledby": densityButtonId,
112
- onKeyDown: handleListKeyDown,
113
103
  autoFocusItem: open,
114
104
  children: densityElements
115
105
  })