@mui/x-data-grid 8.5.3 → 8.7.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 (146) hide show
  1. package/CHANGELOG.md +210 -0
  2. package/components/cell/GridActionsCell.js +1 -9
  3. package/components/cell/GridActionsCellItem.d.ts +4 -1
  4. package/components/cell/GridActionsCellItem.js +1 -1
  5. package/components/cell/GridCell.js +1 -0
  6. package/components/cell/GridEditBooleanCell.js +1 -0
  7. package/components/cell/GridEditDateCell.js +1 -0
  8. package/components/cell/GridEditInputCell.js +1 -0
  9. package/components/cell/GridEditSingleSelectCell.js +1 -0
  10. package/components/columnHeaders/GridColumnGroupHeader.js +1 -0
  11. package/components/columnHeaders/GridColumnHeaderItem.js +1 -0
  12. package/components/columnHeaders/GridColumnHeaderTitle.js +1 -0
  13. package/components/columnHeaders/GridGenericColumnHeaderItem.js +1 -0
  14. package/components/columnSelection/GridCellCheckboxRenderer.js +1 -0
  15. package/components/columnSelection/GridHeaderCheckbox.js +1 -0
  16. package/components/columnsManagement/GridColumnsManagement.js +2 -2
  17. package/components/containers/GridRootStyles.js +0 -5
  18. package/components/menu/GridMenu.d.ts +1 -1
  19. package/components/menu/GridMenu.js +9 -1
  20. package/components/panel/GridPanel.js +1 -0
  21. package/components/panel/GridPanelContext.js +1 -0
  22. package/components/panel/filterPanel/GridFilterInputBoolean.js +1 -0
  23. package/components/panel/filterPanel/GridFilterInputDate.js +1 -0
  24. package/components/panel/filterPanel/GridFilterInputMultipleValue.js +1 -0
  25. package/components/panel/filterPanel/GridFilterInputValue.js +1 -0
  26. package/components/panel/filterPanel/GridFilterPanel.js +1 -0
  27. package/components/quickFilter/QuickFilter.js +1 -0
  28. package/components/quickFilter/QuickFilterContext.js +1 -0
  29. package/components/toolbar/GridToolbarDensitySelector.js +1 -10
  30. package/components/toolbar/GridToolbarExportContainer.js +1 -10
  31. package/components/toolbarV8/GridToolbar.js +1 -0
  32. package/components/toolbarV8/Toolbar.js +1 -0
  33. package/components/toolbarV8/ToolbarButton.js +1 -0
  34. package/components/toolbarV8/ToolbarContext.js +1 -0
  35. package/components/virtualization/GridVirtualScrollbar.js +1 -0
  36. package/esm/components/cell/GridActionsCell.js +2 -9
  37. package/esm/components/cell/GridActionsCellItem.d.ts +4 -1
  38. package/esm/components/cell/GridActionsCellItem.js +1 -1
  39. package/esm/components/cell/GridCell.js +2 -0
  40. package/esm/components/cell/GridEditBooleanCell.js +2 -0
  41. package/esm/components/cell/GridEditDateCell.js +2 -0
  42. package/esm/components/cell/GridEditInputCell.js +2 -0
  43. package/esm/components/cell/GridEditSingleSelectCell.js +2 -0
  44. package/esm/components/columnHeaders/GridColumnGroupHeader.js +2 -0
  45. package/esm/components/columnHeaders/GridColumnHeaderItem.js +2 -0
  46. package/esm/components/columnHeaders/GridColumnHeaderTitle.js +2 -0
  47. package/esm/components/columnHeaders/GridGenericColumnHeaderItem.js +2 -0
  48. package/esm/components/columnSelection/GridCellCheckboxRenderer.js +2 -0
  49. package/esm/components/columnSelection/GridHeaderCheckbox.js +2 -0
  50. package/esm/components/columnsManagement/GridColumnsManagement.js +3 -1
  51. package/esm/components/containers/GridRootStyles.js +0 -5
  52. package/esm/components/menu/GridMenu.d.ts +1 -1
  53. package/esm/components/menu/GridMenu.js +10 -1
  54. package/esm/components/panel/GridPanel.js +2 -0
  55. package/esm/components/panel/GridPanelContext.js +2 -0
  56. package/esm/components/panel/filterPanel/GridFilterInputBoolean.js +2 -0
  57. package/esm/components/panel/filterPanel/GridFilterInputDate.js +2 -0
  58. package/esm/components/panel/filterPanel/GridFilterInputMultipleValue.js +2 -0
  59. package/esm/components/panel/filterPanel/GridFilterInputValue.js +2 -0
  60. package/esm/components/panel/filterPanel/GridFilterPanel.js +2 -0
  61. package/esm/components/quickFilter/QuickFilter.js +2 -0
  62. package/esm/components/quickFilter/QuickFilterContext.js +2 -0
  63. package/esm/components/toolbar/GridToolbarDensitySelector.js +2 -10
  64. package/esm/components/toolbar/GridToolbarExportContainer.js +2 -10
  65. package/esm/components/toolbarV8/GridToolbar.js +2 -0
  66. package/esm/components/toolbarV8/Toolbar.js +2 -0
  67. package/esm/components/toolbarV8/ToolbarButton.js +2 -0
  68. package/esm/components/toolbarV8/ToolbarContext.js +2 -0
  69. package/esm/components/virtualization/GridVirtualScrollbar.js +2 -0
  70. package/esm/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +2 -0
  71. package/esm/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +2 -0
  72. package/esm/hooks/core/strategyProcessing/useGridRegisterStrategyProcessor.js +2 -0
  73. package/esm/hooks/core/useGridApiInitialization.js +2 -0
  74. package/esm/hooks/core/useGridIsRtl.js +2 -0
  75. package/esm/hooks/core/useGridProps.js +2 -0
  76. package/esm/hooks/features/columnGrouping/useGridColumnGrouping.js +2 -0
  77. package/esm/hooks/features/columnHeaders/useGridColumnHeaders.js +2 -0
  78. package/esm/hooks/features/columnResize/useGridColumnResize.js +2 -0
  79. package/esm/hooks/features/columns/useGridColumns.js +23 -3
  80. package/esm/hooks/features/dataSource/useGridDataSource.js +2 -0
  81. package/esm/hooks/features/dataSource/useGridDataSourceBase.js +2 -0
  82. package/esm/hooks/features/density/useGridDensity.js +2 -0
  83. package/esm/hooks/features/dimensions/useGridDimensions.js +2 -0
  84. package/esm/hooks/features/editing/useGridCellEditing.js +2 -0
  85. package/esm/hooks/features/editing/useGridEditing.js +2 -0
  86. package/esm/hooks/features/editing/useGridRowEditing.js +2 -0
  87. package/esm/hooks/features/export/useGridPrintExport.js +2 -0
  88. package/esm/hooks/features/focus/useGridFocus.js +3 -1
  89. package/esm/hooks/features/headerFiltering/useGridHeaderFiltering.js +2 -0
  90. package/esm/hooks/features/listView/useGridListView.js +2 -0
  91. package/esm/hooks/features/pagination/useGridPaginationMeta.js +2 -0
  92. package/esm/hooks/features/pagination/useGridPaginationModel.js +2 -0
  93. package/esm/hooks/features/pagination/useGridRowCount.js +2 -0
  94. package/esm/hooks/features/rowSelection/useGridRowSelection.js +2 -0
  95. package/esm/hooks/features/rows/useGridRowSpanning.js +2 -0
  96. package/esm/hooks/features/rows/useGridRows.js +2 -0
  97. package/esm/hooks/features/virtualization/useGridVirtualScroller.js +2 -0
  98. package/esm/hooks/features/virtualization/useGridVirtualization.js +2 -0
  99. package/esm/hooks/utils/useGridEvent.js +2 -0
  100. package/esm/hooks/utils/useGridPrivateApiContext.js +2 -0
  101. package/esm/hooks/utils/useGridSelector.js +2 -0
  102. package/esm/index.js +1 -1
  103. package/esm/internals/demo/TailwindDemoContainer.js +2 -0
  104. package/esm/locales/daDK.js +5 -5
  105. package/esm/locales/deDE.js +65 -73
  106. package/esm/models/params/gridScrollParams.d.ts +4 -0
  107. package/esm/utils/css/context.js +2 -0
  108. package/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +1 -0
  109. package/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +1 -0
  110. package/hooks/core/strategyProcessing/useGridRegisterStrategyProcessor.js +1 -0
  111. package/hooks/core/useGridApiInitialization.js +1 -0
  112. package/hooks/core/useGridIsRtl.js +1 -0
  113. package/hooks/core/useGridProps.js +1 -0
  114. package/hooks/features/columnGrouping/useGridColumnGrouping.js +1 -0
  115. package/hooks/features/columnHeaders/useGridColumnHeaders.js +1 -0
  116. package/hooks/features/columnResize/useGridColumnResize.js +1 -0
  117. package/hooks/features/columns/useGridColumns.js +22 -3
  118. package/hooks/features/dataSource/useGridDataSource.js +1 -0
  119. package/hooks/features/dataSource/useGridDataSourceBase.js +1 -0
  120. package/hooks/features/density/useGridDensity.js +1 -0
  121. package/hooks/features/dimensions/useGridDimensions.js +1 -0
  122. package/hooks/features/editing/useGridCellEditing.js +1 -0
  123. package/hooks/features/editing/useGridEditing.js +1 -0
  124. package/hooks/features/editing/useGridRowEditing.js +1 -0
  125. package/hooks/features/export/useGridPrintExport.js +1 -0
  126. package/hooks/features/focus/useGridFocus.js +2 -1
  127. package/hooks/features/headerFiltering/useGridHeaderFiltering.js +1 -0
  128. package/hooks/features/listView/useGridListView.js +1 -0
  129. package/hooks/features/pagination/useGridPaginationMeta.js +1 -0
  130. package/hooks/features/pagination/useGridPaginationModel.js +1 -0
  131. package/hooks/features/pagination/useGridRowCount.js +1 -0
  132. package/hooks/features/rowSelection/useGridRowSelection.js +1 -0
  133. package/hooks/features/rows/useGridRowSpanning.js +1 -0
  134. package/hooks/features/rows/useGridRows.js +1 -0
  135. package/hooks/features/virtualization/useGridVirtualScroller.js +1 -0
  136. package/hooks/features/virtualization/useGridVirtualization.js +1 -0
  137. package/hooks/utils/useGridEvent.js +1 -0
  138. package/hooks/utils/useGridPrivateApiContext.js +1 -0
  139. package/hooks/utils/useGridSelector.js +1 -0
  140. package/index.js +1 -1
  141. package/internals/demo/TailwindDemoContainer.js +1 -0
  142. package/locales/daDK.js +5 -5
  143. package/locales/deDE.js +65 -73
  144. package/models/params/gridScrollParams.d.ts +4 -0
  145. package/package.json +2 -2
  146. package/utils/css/context.js +1 -0
@@ -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;
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["column", "row", "rowId", "rowNode", "align", "children", "colIndex", "width", "className", "style", "colSpan", "disableDragEvents", "isNotVisible", "pinnedOffset", "pinnedPosition", "showRightBorder", "showLeftBorder", "onClick", "onDoubleClick", "onMouseDown", "onMouseUp", "onMouseOver", "onKeyDown", "onKeyUp", "onDragEnter", "onDragOver"],
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "className", "hasFocus", "isValidating", "isProcessingProps", "error", "onValueChange"];
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "hasFocus", "inputProps", "isValidating", "isProcessingProps", "onValueChange", "slotProps"];
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "hasFocus", "isValidating", "debounceMs", "isProcessingProps", "onValueChange", "slotProps"];
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "className", "hasFocus", "isValidating", "isProcessingProps", "error", "onValueChange", "initialOpen", "slotProps"];
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import useId from '@mui/utils/useId';
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import PropTypes from 'prop-types';
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["className", "aria-label"];
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["classes", "columnMenuOpen", "colIndex", "height", "isResizing", "sortDirection", "hasFocus", "tabIndex", "separatorSide", "isDraggable", "headerComponent", "description", "elementId", "width", "columnMenuIconButton", "columnMenu", "columnTitleIconButtons", "headerClassName", "label", "resizable", "draggableContainerProps", "columnHeaderSeparatorProps", "style"];
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["field", "id", "formattedValue", "row", "rowNode", "colDef", "isEditable", "cellMode", "hasFocus", "tabIndex", "api"];
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["field", "colDef"];
@@ -1,5 +1,7 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
1
  /* eslint-disable @typescript-eslint/no-use-before-define */
2
+ 'use client';
3
+
4
+ import _extends from "@babel/runtime/helpers/esm/extends";
3
5
  import * as React from 'react';
4
6
  import PropTypes from 'prop-types';
5
7
  import composeClasses from '@mui/utils/composeClasses';
@@ -623,11 +623,6 @@ export const GridRootStyles = styled('div', {
623
623
  },
624
624
  '&.Mui-selected': selectedStyles
625
625
  },
626
- [`& .${c['container--top']}, & .${c['container--bottom']}`]: {
627
- '[role=row]': {
628
- background: vars.colors.background.base
629
- }
630
- },
631
626
  /* Cell styles */
632
627
  [`& .${c.cell}`]: {
633
628
  flex: '0 0 auto',
@@ -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
  }
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["open", "target", "onClose", "children", "position", "className", "onExited"];
@@ -8,6 +10,7 @@ import composeClasses from '@mui/utils/composeClasses';
8
10
  import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
9
11
  import HTMLElementType from '@mui/utils/HTMLElementType';
10
12
  import { styled } from '@mui/material/styles';
13
+ import { isHideMenuKey } from "../../utils/keyboardUtils.js";
11
14
  import { vars } from "../../constants/cssVariables.js";
12
15
  import { useCSSVariablesClass } from "../../utils/css/context.js";
13
16
  import { getDataGridUtilityClass, gridClasses } from "../../constants/gridClasses.js";
@@ -70,6 +73,11 @@ function GridMenu(props) {
70
73
  }
71
74
  onClose(event);
72
75
  };
76
+ const handleKeyDown = event => {
77
+ if (isHideMenuKey(event.key)) {
78
+ onClose(event);
79
+ }
80
+ };
73
81
  return /*#__PURE__*/_jsx(GridMenuRoot, _extends({
74
82
  as: rootProps.slots.basePopper,
75
83
  className: clsx(classes.root, className, variablesClass),
@@ -80,7 +88,8 @@ function GridMenu(props) {
80
88
  placement: position,
81
89
  onClickAway: handleClickAway,
82
90
  onExited: onExited,
83
- clickAwayMouseEvent: "onMouseDown"
91
+ clickAwayMouseEvent: "onMouseDown",
92
+ onKeyDown: handleKeyDown
84
93
  }, other, rootProps.slotProps?.basePopper, {
85
94
  children: children
86
95
  }));
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["children", "className", "classes", "onClose"];
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  import { jsx as _jsx } from "react/jsx-runtime";
3
5
  export const GridPanelContext = /*#__PURE__*/React.createContext(undefined);
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["item", "applyValue", "apiRef", "focusElementRef", "isFilterActive", "headerFilterMenu", "clearButton", "tabIndex", "slotProps"];
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "slotProps", "isFilterActive", "headerFilterMenu", "clearButton", "tabIndex", "disabled"];
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import PropTypes from 'prop-types';
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "tabIndex", "disabled", "isFilterActive", "slotProps", "clearButton", "headerFilterMenu"];
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["logicOperators", "columnsSort", "filterFormProps", "getColumnForNewFilter", "children", "disableAddFilterButton", "disableRemoveAllButton"];
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["render", "className", "parser", "formatter", "debounceMs", "defaultExpanded", "expanded", "onExpandedChange"];
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  export const QuickFilterContext = /*#__PURE__*/React.createContext(undefined);
3
5
  if (process.env.NODE_ENV !== "production") QuickFilterContext.displayName = "QuickFilterContext";
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import PropTypes from 'prop-types';
@@ -5,7 +7,6 @@ import useId from '@mui/utils/useId';
5
7
  import useForkRef from '@mui/utils/useForkRef';
6
8
  import { forwardRef } from '@mui/x-internals/forwardRef';
7
9
  import { gridDensitySelector } from "../../hooks/features/density/densitySelector.js";
8
- import { isHideMenuKey } from "../../utils/keyboardUtils.js";
9
10
  import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
10
11
  import { useGridSelector } from "../../hooks/utils/useGridSelector.js";
11
12
  import { GridMenu } from "../menu/GridMenu.js";
@@ -63,14 +64,6 @@ const GridToolbarDensitySelector = forwardRef(function GridToolbarDensitySelecto
63
64
  apiRef.current.setDensity(newDensity);
64
65
  setOpen(false);
65
66
  };
66
- const handleListKeyDown = event => {
67
- if (event.key === 'Tab') {
68
- event.preventDefault();
69
- }
70
- if (isHideMenuKey(event.key)) {
71
- setOpen(false);
72
- }
73
- };
74
67
 
75
68
  // Disable the button if the corresponding is disabled
76
69
  if (rootProps.disableDensitySelector) {
@@ -109,7 +102,6 @@ const GridToolbarDensitySelector = forwardRef(function GridToolbarDensitySelecto
109
102
  id: densityMenuId,
110
103
  className: gridClasses.menuList,
111
104
  "aria-labelledby": densityButtonId,
112
- onKeyDown: handleListKeyDown,
113
105
  autoFocusItem: open,
114
106
  children: densityElements
115
107
  })
@@ -1,10 +1,11 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import PropTypes from 'prop-types';
4
6
  import useId from '@mui/utils/useId';
5
7
  import useForkRef from '@mui/utils/useForkRef';
6
8
  import { forwardRef } from '@mui/x-internals/forwardRef';
7
- import { isHideMenuKey } from "../../utils/keyboardUtils.js";
8
9
  import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
9
10
  import { GridMenu } from "../menu/GridMenu.js";
10
11
  import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
@@ -29,14 +30,6 @@ const GridToolbarExportContainer = forwardRef(function GridToolbarExportContaine
29
30
  buttonProps.onClick?.(event);
30
31
  };
31
32
  const handleMenuClose = () => setOpen(false);
32
- const handleListKeyDown = event => {
33
- if (event.key === 'Tab') {
34
- event.preventDefault();
35
- }
36
- if (isHideMenuKey(event.key)) {
37
- handleMenuClose();
38
- }
39
- };
40
33
  if (children == null) {
41
34
  return null;
42
35
  }
@@ -67,7 +60,6 @@ const GridToolbarExportContainer = forwardRef(function GridToolbarExportContaine
67
60
  id: exportMenuId,
68
61
  className: gridClasses.menuList,
69
62
  "aria-labelledby": exportButtonId,
70
- onKeyDown: handleListKeyDown,
71
63
  autoFocusItem: open,
72
64
  children: React.Children.map(children, child => {
73
65
  if (! /*#__PURE__*/React.isValidElement(child)) {
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["className"],
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["render", "className"];
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["render", "onKeyDown", "onFocus", "disabled", "aria-disabled"];
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  export const ToolbarContext = /*#__PURE__*/React.createContext(undefined);
3
5
  if (process.env.NODE_ENV !== "production") ToolbarContext.displayName = "ToolbarContext";
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  import { styled } from '@mui/system';
3
5
  import useEventCallback from '@mui/utils/useEventCallback';
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  import { useFirstRender } from "../../utils/useFirstRender.js";
3
5
  export const useGridRegisterPipeApplier = (apiRef, group, callback) => {
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  import { useFirstRender } from "../../utils/useFirstRender.js";
3
5
  export const useGridRegisterPipeProcessor = (apiRef, group, callback, enabled = true) => {
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  import { useFirstRender } from "../../utils/useFirstRender.js";
3
5
  export const useGridRegisterStrategyProcessor = (apiRef, strategyName, group, processor) => {
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  import { EventManager } from '@mui/x-internals/EventManager';
3
5
  import { Store } from '@mui/x-internals/store';
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import { useRtl } from '@mui/system/RtlProvider';
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  export const propsStateInitializer = (state, props) => {
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["groupId", "children"];
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import clsx from 'clsx';
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import useEventCallback from '@mui/utils/useEventCallback';
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import { useGridApiMethod } from "../../utils/useGridApiMethod.js";
@@ -205,9 +207,9 @@ export function useGridColumns(apiRef, props) {
205
207
  });
206
208
  }, [apiRef, props.columnVisibilityModel, props.initialState?.columns]);
207
209
  const stateRestorePreProcessing = React.useCallback((params, context) => {
208
- const columnVisibilityModelToImport = context.stateToRestore.columns?.columnVisibilityModel;
209
210
  const initialState = context.stateToRestore.columns;
210
- if (columnVisibilityModelToImport == null && initialState == null) {
211
+ const columnVisibilityModelToImport = initialState?.columnVisibilityModel;
212
+ if (initialState == null) {
211
213
  return params;
212
214
  }
213
215
  const columnsState = createColumnsState({
@@ -217,7 +219,25 @@ export function useGridColumns(apiRef, props) {
217
219
  columnVisibilityModel: columnVisibilityModelToImport,
218
220
  keepOnlyColumnsToUpsert: false
219
221
  });
220
- apiRef.current.setState(mergeColumnsState(columnsState));
222
+ if (initialState != null) {
223
+ apiRef.current.setState(prevState => _extends({}, prevState, {
224
+ columns: _extends({}, prevState.columns, {
225
+ lookup: columnsState.lookup,
226
+ orderedFields: columnsState.orderedFields,
227
+ initialColumnVisibilityModel: columnsState.initialColumnVisibilityModel
228
+ })
229
+ }));
230
+ }
231
+
232
+ // separate column visibility model state update as it can be controlled
233
+ // https://github.com/mui/mui-x/issues/17681#issuecomment-3012528602
234
+ if (columnVisibilityModelToImport != null) {
235
+ apiRef.current.setState(prevState => _extends({}, prevState, {
236
+ columns: _extends({}, prevState.columns, {
237
+ columnVisibilityModel: columnVisibilityModelToImport
238
+ })
239
+ }));
240
+ }
221
241
  if (initialState != null) {
222
242
  apiRef.current.publishEvent('columnsChange', columnsState.orderedFields);
223
243
  }
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  import { useGridApiMethod } from "../../utils/useGridApiMethod.js";
3
5
  import { useGridRegisterStrategyProcessor } from "../../core/strategyProcessing/useGridRegisterStrategyProcessor.js";
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import useLazyRef from '@mui/utils/useLazyRef';
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import useEventCallback from '@mui/utils/useEventCallback';
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import useEventCallback from '@mui/utils/useEventCallback';
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
4
  import _toPropertyKey from "@babel/runtime/helpers/esm/toPropertyKey";
3
5
  import _extends from "@babel/runtime/helpers/esm/extends";
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import { useGridApiMethod } from "../../utils/useGridApiMethod.js";
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _toPropertyKey from "@babel/runtime/helpers/esm/toPropertyKey";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  import _extends from "@babel/runtime/helpers/esm/extends";
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import ownerDocument from '@mui/utils/ownerDocument';
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import useEventCallback from '@mui/utils/useEventCallback';
@@ -357,7 +359,7 @@ export const useGridFocus = (apiRef, props) => {
357
359
  paginationMode: props.paginationMode
358
360
  });
359
361
  const rowIsInCurrentPage = currentPage.rows.find(row => row.id === currentFocusedCell.id);
360
- if (rowIsInCurrentPage) {
362
+ if (rowIsInCurrentPage || currentPage.rows.length === 0) {
361
363
  return;
362
364
  }
363
365
  const visibleColumns = gridVisibleColumnDefinitionsSelector(apiRef);
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import { useGridApiMethod } from "../../utils/useGridApiMethod.js";
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import { useGridLogger, useGridSelector, useGridApiMethod } from "../../utils/index.js";
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import { isDeepEqual } from '@mui/x-internals/isDeepEqual';
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import useLazyRef from '@mui/utils/useLazyRef';
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import useEventCallback from '@mui/utils/useEventCallback';
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import useLazyRef from '@mui/utils/useLazyRef';
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import useLazyRef from '@mui/utils/useLazyRef';
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import * as ReactDOM from 'react-dom';