@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.
- package/CHANGELOG.md +210 -0
- package/components/cell/GridActionsCell.js +1 -9
- package/components/cell/GridActionsCellItem.d.ts +4 -1
- package/components/cell/GridActionsCellItem.js +1 -1
- package/components/cell/GridCell.js +1 -0
- package/components/cell/GridEditBooleanCell.js +1 -0
- package/components/cell/GridEditDateCell.js +1 -0
- package/components/cell/GridEditInputCell.js +1 -0
- package/components/cell/GridEditSingleSelectCell.js +1 -0
- package/components/columnHeaders/GridColumnGroupHeader.js +1 -0
- package/components/columnHeaders/GridColumnHeaderItem.js +1 -0
- package/components/columnHeaders/GridColumnHeaderTitle.js +1 -0
- package/components/columnHeaders/GridGenericColumnHeaderItem.js +1 -0
- package/components/columnSelection/GridCellCheckboxRenderer.js +1 -0
- package/components/columnSelection/GridHeaderCheckbox.js +1 -0
- package/components/columnsManagement/GridColumnsManagement.js +2 -2
- package/components/containers/GridRootStyles.js +0 -5
- package/components/menu/GridMenu.d.ts +1 -1
- package/components/menu/GridMenu.js +9 -1
- package/components/panel/GridPanel.js +1 -0
- package/components/panel/GridPanelContext.js +1 -0
- package/components/panel/filterPanel/GridFilterInputBoolean.js +1 -0
- package/components/panel/filterPanel/GridFilterInputDate.js +1 -0
- package/components/panel/filterPanel/GridFilterInputMultipleValue.js +1 -0
- package/components/panel/filterPanel/GridFilterInputValue.js +1 -0
- package/components/panel/filterPanel/GridFilterPanel.js +1 -0
- package/components/quickFilter/QuickFilter.js +1 -0
- package/components/quickFilter/QuickFilterContext.js +1 -0
- package/components/toolbar/GridToolbarDensitySelector.js +1 -10
- package/components/toolbar/GridToolbarExportContainer.js +1 -10
- package/components/toolbarV8/GridToolbar.js +1 -0
- package/components/toolbarV8/Toolbar.js +1 -0
- package/components/toolbarV8/ToolbarButton.js +1 -0
- package/components/toolbarV8/ToolbarContext.js +1 -0
- package/components/virtualization/GridVirtualScrollbar.js +1 -0
- package/esm/components/cell/GridActionsCell.js +2 -9
- package/esm/components/cell/GridActionsCellItem.d.ts +4 -1
- package/esm/components/cell/GridActionsCellItem.js +1 -1
- package/esm/components/cell/GridCell.js +2 -0
- package/esm/components/cell/GridEditBooleanCell.js +2 -0
- package/esm/components/cell/GridEditDateCell.js +2 -0
- package/esm/components/cell/GridEditInputCell.js +2 -0
- package/esm/components/cell/GridEditSingleSelectCell.js +2 -0
- package/esm/components/columnHeaders/GridColumnGroupHeader.js +2 -0
- package/esm/components/columnHeaders/GridColumnHeaderItem.js +2 -0
- package/esm/components/columnHeaders/GridColumnHeaderTitle.js +2 -0
- package/esm/components/columnHeaders/GridGenericColumnHeaderItem.js +2 -0
- package/esm/components/columnSelection/GridCellCheckboxRenderer.js +2 -0
- package/esm/components/columnSelection/GridHeaderCheckbox.js +2 -0
- package/esm/components/columnsManagement/GridColumnsManagement.js +3 -1
- package/esm/components/containers/GridRootStyles.js +0 -5
- package/esm/components/menu/GridMenu.d.ts +1 -1
- package/esm/components/menu/GridMenu.js +10 -1
- package/esm/components/panel/GridPanel.js +2 -0
- package/esm/components/panel/GridPanelContext.js +2 -0
- package/esm/components/panel/filterPanel/GridFilterInputBoolean.js +2 -0
- package/esm/components/panel/filterPanel/GridFilterInputDate.js +2 -0
- package/esm/components/panel/filterPanel/GridFilterInputMultipleValue.js +2 -0
- package/esm/components/panel/filterPanel/GridFilterInputValue.js +2 -0
- package/esm/components/panel/filterPanel/GridFilterPanel.js +2 -0
- package/esm/components/quickFilter/QuickFilter.js +2 -0
- package/esm/components/quickFilter/QuickFilterContext.js +2 -0
- package/esm/components/toolbar/GridToolbarDensitySelector.js +2 -10
- package/esm/components/toolbar/GridToolbarExportContainer.js +2 -10
- package/esm/components/toolbarV8/GridToolbar.js +2 -0
- package/esm/components/toolbarV8/Toolbar.js +2 -0
- package/esm/components/toolbarV8/ToolbarButton.js +2 -0
- package/esm/components/toolbarV8/ToolbarContext.js +2 -0
- package/esm/components/virtualization/GridVirtualScrollbar.js +2 -0
- package/esm/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +2 -0
- package/esm/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +2 -0
- package/esm/hooks/core/strategyProcessing/useGridRegisterStrategyProcessor.js +2 -0
- package/esm/hooks/core/useGridApiInitialization.js +2 -0
- package/esm/hooks/core/useGridIsRtl.js +2 -0
- package/esm/hooks/core/useGridProps.js +2 -0
- package/esm/hooks/features/columnGrouping/useGridColumnGrouping.js +2 -0
- package/esm/hooks/features/columnHeaders/useGridColumnHeaders.js +2 -0
- package/esm/hooks/features/columnResize/useGridColumnResize.js +2 -0
- package/esm/hooks/features/columns/useGridColumns.js +23 -3
- package/esm/hooks/features/dataSource/useGridDataSource.js +2 -0
- package/esm/hooks/features/dataSource/useGridDataSourceBase.js +2 -0
- package/esm/hooks/features/density/useGridDensity.js +2 -0
- package/esm/hooks/features/dimensions/useGridDimensions.js +2 -0
- package/esm/hooks/features/editing/useGridCellEditing.js +2 -0
- package/esm/hooks/features/editing/useGridEditing.js +2 -0
- package/esm/hooks/features/editing/useGridRowEditing.js +2 -0
- package/esm/hooks/features/export/useGridPrintExport.js +2 -0
- package/esm/hooks/features/focus/useGridFocus.js +3 -1
- package/esm/hooks/features/headerFiltering/useGridHeaderFiltering.js +2 -0
- package/esm/hooks/features/listView/useGridListView.js +2 -0
- package/esm/hooks/features/pagination/useGridPaginationMeta.js +2 -0
- package/esm/hooks/features/pagination/useGridPaginationModel.js +2 -0
- package/esm/hooks/features/pagination/useGridRowCount.js +2 -0
- package/esm/hooks/features/rowSelection/useGridRowSelection.js +2 -0
- package/esm/hooks/features/rows/useGridRowSpanning.js +2 -0
- package/esm/hooks/features/rows/useGridRows.js +2 -0
- package/esm/hooks/features/virtualization/useGridVirtualScroller.js +2 -0
- package/esm/hooks/features/virtualization/useGridVirtualization.js +2 -0
- package/esm/hooks/utils/useGridEvent.js +2 -0
- package/esm/hooks/utils/useGridPrivateApiContext.js +2 -0
- package/esm/hooks/utils/useGridSelector.js +2 -0
- package/esm/index.js +1 -1
- package/esm/internals/demo/TailwindDemoContainer.js +2 -0
- package/esm/locales/daDK.js +5 -5
- package/esm/locales/deDE.js +65 -73
- package/esm/models/params/gridScrollParams.d.ts +4 -0
- package/esm/utils/css/context.js +2 -0
- package/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +1 -0
- package/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +1 -0
- package/hooks/core/strategyProcessing/useGridRegisterStrategyProcessor.js +1 -0
- package/hooks/core/useGridApiInitialization.js +1 -0
- package/hooks/core/useGridIsRtl.js +1 -0
- package/hooks/core/useGridProps.js +1 -0
- package/hooks/features/columnGrouping/useGridColumnGrouping.js +1 -0
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +1 -0
- package/hooks/features/columnResize/useGridColumnResize.js +1 -0
- package/hooks/features/columns/useGridColumns.js +22 -3
- package/hooks/features/dataSource/useGridDataSource.js +1 -0
- package/hooks/features/dataSource/useGridDataSourceBase.js +1 -0
- package/hooks/features/density/useGridDensity.js +1 -0
- package/hooks/features/dimensions/useGridDimensions.js +1 -0
- package/hooks/features/editing/useGridCellEditing.js +1 -0
- package/hooks/features/editing/useGridEditing.js +1 -0
- package/hooks/features/editing/useGridRowEditing.js +1 -0
- package/hooks/features/export/useGridPrintExport.js +1 -0
- package/hooks/features/focus/useGridFocus.js +2 -1
- package/hooks/features/headerFiltering/useGridHeaderFiltering.js +1 -0
- package/hooks/features/listView/useGridListView.js +1 -0
- package/hooks/features/pagination/useGridPaginationMeta.js +1 -0
- package/hooks/features/pagination/useGridPaginationModel.js +1 -0
- package/hooks/features/pagination/useGridRowCount.js +1 -0
- package/hooks/features/rowSelection/useGridRowSelection.js +1 -0
- package/hooks/features/rows/useGridRowSpanning.js +1 -0
- package/hooks/features/rows/useGridRows.js +1 -0
- package/hooks/features/virtualization/useGridVirtualScroller.js +1 -0
- package/hooks/features/virtualization/useGridVirtualization.js +1 -0
- package/hooks/utils/useGridEvent.js +1 -0
- package/hooks/utils/useGridPrivateApiContext.js +1 -0
- package/hooks/utils/useGridSelector.js +1 -0
- package/index.js +1 -1
- package/internals/demo/TailwindDemoContainer.js +1 -0
- package/locales/daDK.js +5 -5
- package/locales/deDE.js +65 -73
- package/models/params/gridScrollParams.d.ts +4 -0
- package/package.json +2 -2
- 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.
|
|
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 _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,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?:
|
|
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 = ["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 _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 _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 * 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
|
-
|
|
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
|
-
|
|
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 _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);
|