@mui/x-data-grid 9.13.0 → 9.15.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 +325 -0
- package/DataGrid/DataGrid.js +8 -0
- package/DataGrid/DataGrid.mjs +9 -1
- package/DataGrid/useDataGridComponent.js +2 -2
- package/DataGrid/useDataGridComponent.mjs +2 -2
- package/DataGrid/useDataGridProps.mjs +1 -1
- package/colDef/gridActionsColDef.mjs +1 -1
- package/colDef/gridBooleanColDef.mjs +1 -1
- package/colDef/gridCheckboxSelectionColDef.mjs +1 -1
- package/colDef/gridDateColDef.mjs +1 -1
- package/colDef/gridDefaultColumnTypes.mjs +1 -1
- package/colDef/gridLongTextColDef.mjs +1 -1
- package/colDef/gridNumericColDef.mjs +1 -1
- package/colDef/gridSingleSelectColDef.mjs +1 -1
- package/components/GridColumnHeaders.mjs +2 -2
- package/components/GridColumnSortButton.mjs +2 -2
- package/components/GridColumnUnsortedIcon.mjs +2 -2
- package/components/GridFooter.mjs +1 -1
- package/components/GridHeader.mjs +1 -1
- package/components/GridHeaders.mjs +1 -1
- package/components/GridLoadingOverlay.mjs +2 -2
- package/components/GridNoColumnsOverlay.mjs +1 -1
- package/components/GridNoResultsOverlay.mjs +1 -1
- package/components/GridNoRowsOverlay.mjs +1 -1
- package/components/GridPagination.js +9 -1
- package/components/GridPagination.mjs +10 -2
- package/components/GridRow.mjs +2 -2
- package/components/GridRowCount.mjs +2 -2
- package/components/GridRowDragAndDropOverlay.mjs +1 -1
- package/components/GridScrollArea.js +20 -7
- package/components/GridScrollArea.mjs +22 -9
- package/components/GridSelectedRowCount.mjs +2 -2
- package/components/GridShadowScrollArea.mjs +2 -2
- package/components/GridSkeletonLoadingOverlay.mjs +2 -2
- package/components/base/GridFooterPlaceholder.mjs +1 -1
- package/components/base/GridOverlays.js +6 -5
- package/components/base/GridOverlays.mjs +7 -6
- package/components/cell/GridActionsCell.js +55 -52
- package/components/cell/GridActionsCell.mjs +58 -55
- package/components/cell/GridActionsCellItem.d.mts +20 -6
- package/components/cell/GridActionsCellItem.d.ts +20 -6
- package/components/cell/GridActionsCellItem.js +30 -8
- package/components/cell/GridActionsCellItem.mjs +32 -10
- package/components/cell/GridBooleanCell.mjs +2 -2
- package/components/cell/GridCell.js +9 -1
- package/components/cell/GridCell.mjs +11 -3
- package/components/cell/GridEditBooleanCell.mjs +2 -2
- package/components/cell/GridEditDateCell.mjs +2 -2
- package/components/cell/GridEditInputCell.mjs +2 -2
- package/components/cell/GridEditLongTextCell.mjs +1 -1
- package/components/cell/GridEditSingleSelectCell.mjs +2 -2
- package/components/cell/GridFooterCell.mjs +2 -2
- package/components/cell/GridLongTextCell.mjs +1 -1
- package/components/cell/GridSkeletonCell.mjs +2 -2
- package/components/columnHeaders/ColumnHeaderMenuIcon.mjs +1 -1
- package/components/columnHeaders/GridBaseColumnHeaders.mjs +2 -2
- package/components/columnHeaders/GridColumnGroupHeader.mjs +1 -1
- package/components/columnHeaders/GridColumnHeaderFilterIconButton.mjs +1 -1
- package/components/columnHeaders/GridColumnHeaderItem.mjs +1 -1
- package/components/columnHeaders/GridColumnHeaderSeparator.d.mts +1 -1
- package/components/columnHeaders/GridColumnHeaderSeparator.d.ts +1 -1
- package/components/columnHeaders/GridColumnHeaderSeparator.mjs +2 -2
- package/components/columnHeaders/GridColumnHeaderSortIcon.js +17 -0
- package/components/columnHeaders/GridColumnHeaderSortIcon.mjs +18 -1
- package/components/columnHeaders/GridColumnHeaderTitle.mjs +2 -2
- package/components/columnHeaders/GridGenericColumnHeaderItem.mjs +2 -2
- package/components/columnHeaders/GridIconButtonContainer.mjs +2 -2
- package/components/columnSelection/GridCellCheckboxRenderer.mjs +2 -2
- package/components/columnSelection/GridHeaderCheckbox.mjs +2 -2
- package/components/columnSelection/GridRowCheckbox.js +1 -3
- package/components/columnSelection/GridRowCheckbox.mjs +3 -5
- package/components/columnsManagement/GridColumnsManagement.mjs +1 -1
- package/components/columnsPanel/ColumnsPanelTrigger.mjs +2 -2
- package/components/containers/GridFooterContainer.mjs +2 -2
- package/components/containers/GridOverlay.mjs +2 -2
- package/components/containers/GridRoot.mjs +2 -2
- package/components/containers/GridRootStyles.js +22 -10
- package/components/containers/GridRootStyles.mjs +22 -10
- package/components/containers/GridToolbarContainer.mjs +2 -2
- package/components/export/ExportCsv.mjs +2 -2
- package/components/export/ExportPrint.js +4 -1
- package/components/export/ExportPrint.mjs +6 -3
- package/components/filterPanel/FilterPanelTrigger.mjs +2 -2
- package/components/menu/GridMenu.mjs +2 -2
- package/components/menu/columnMenu/GridColumnHeaderMenu.mjs +1 -1
- package/components/menu/columnMenu/GridColumnMenu.mjs +2 -2
- package/components/menu/columnMenu/GridColumnMenuContainer.mjs +2 -2
- package/components/menu/columnMenu/menuItems/GridColumnMenuColumnsItem.mjs +1 -1
- package/components/panel/GridColumnsPanel.mjs +1 -1
- package/components/panel/GridPanel.mjs +2 -2
- package/components/panel/GridPanelContent.mjs +2 -2
- package/components/panel/GridPanelContext.mjs +1 -1
- package/components/panel/GridPanelFooter.mjs +2 -2
- package/components/panel/GridPanelHeader.mjs +2 -2
- package/components/panel/GridPanelWrapper.mjs +2 -2
- package/components/panel/GridPreferencesPanel.mjs +1 -1
- package/components/panel/filterPanel/GridFilterForm.mjs +1 -1
- package/components/panel/filterPanel/GridFilterFormBase.mjs +2 -2
- package/components/panel/filterPanel/GridFilterInputBoolean.js +1 -12
- package/components/panel/filterPanel/GridFilterInputBoolean.mjs +3 -14
- package/components/panel/filterPanel/GridFilterInputDate.mjs +2 -2
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.mjs +2 -2
- package/components/panel/filterPanel/GridFilterInputMultipleValue.mjs +2 -2
- package/components/panel/filterPanel/GridFilterInputSingleSelect.js +1 -12
- package/components/panel/filterPanel/GridFilterInputSingleSelect.mjs +3 -14
- package/components/panel/filterPanel/GridFilterInputValue.mjs +2 -2
- package/components/panel/filterPanel/GridFilterPanel.mjs +1 -1
- package/components/panel/filterPanel/GridFilterPanelBase.mjs +2 -2
- package/components/panel/filterPanel/filterPanelUtils.mjs +1 -1
- package/components/quickFilter/QuickFilter.js +7 -2
- package/components/quickFilter/QuickFilter.mjs +9 -4
- package/components/quickFilter/QuickFilterClear.js +17 -0
- package/components/quickFilter/QuickFilterClear.mjs +19 -2
- package/components/quickFilter/QuickFilterControl.mjs +2 -2
- package/components/quickFilter/QuickFilterTrigger.mjs +2 -2
- package/components/toolbar/GridToolbar.mjs +2 -2
- package/components/toolbar/GridToolbarColumnsButton.mjs +1 -1
- package/components/toolbar/GridToolbarDensitySelector.mjs +1 -1
- package/components/toolbar/GridToolbarExport.js +4 -1
- package/components/toolbar/GridToolbarExport.mjs +6 -3
- package/components/toolbar/GridToolbarExportContainer.mjs +1 -1
- package/components/toolbar/GridToolbarFilterButton.mjs +1 -1
- package/components/toolbar/GridToolbarQuickFilter.mjs +2 -2
- package/components/toolbarV8/GridToolbar.mjs +2 -2
- package/components/toolbarV8/Toolbar.mjs +2 -2
- package/components/toolbarV8/ToolbarButton.js +17 -0
- package/components/toolbarV8/ToolbarButton.mjs +19 -2
- package/components/virtualization/GridBottomContainer.mjs +1 -1
- package/components/virtualization/GridMainContainer.mjs +1 -1
- package/components/virtualization/GridTopContainer.mjs +1 -1
- package/components/virtualization/GridVirtualScrollbar.js +2 -2
- package/components/virtualization/GridVirtualScrollbar.mjs +2 -2
- package/components/virtualization/GridVirtualScroller.js +5 -2
- package/components/virtualization/GridVirtualScroller.mjs +6 -3
- package/components/virtualization/GridVirtualScrollerContent.mjs +1 -1
- package/components/virtualization/GridVirtualScrollerRenderZone.mjs +1 -1
- package/constants/cssVariables.mjs +1 -1
- package/constants/defaultGridSlotsComponents.mjs +1 -1
- package/constants/signature.d.mts +1 -1
- package/constants/signature.d.ts +1 -1
- package/hooks/core/pipeProcessing/useGridPipeProcessing.mjs +2 -2
- package/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +2 -2
- package/hooks/core/pipeProcessing/useGridRegisterPipeApplier.mjs +2 -2
- package/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +2 -2
- package/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.mjs +2 -2
- package/hooks/core/strategyProcessing/gridStrategyProcessingApi.d.mts +1 -1
- package/hooks/core/strategyProcessing/gridStrategyProcessingApi.d.ts +1 -1
- package/hooks/core/strategyProcessing/useGridRegisterStrategyProcessor.js +2 -2
- package/hooks/core/strategyProcessing/useGridRegisterStrategyProcessor.mjs +2 -2
- package/hooks/core/strategyProcessing/useGridStrategyProcessing.mjs +2 -2
- package/hooks/core/useGridApiInitialization.js +1 -1
- package/hooks/core/useGridApiInitialization.mjs +1 -1
- package/hooks/core/useGridIsRtl.mjs +1 -1
- package/hooks/core/useGridProps.mjs +1 -1
- package/hooks/core/useGridStateInitialization.mjs +1 -1
- package/hooks/core/useGridVirtualizer.d.mts +2 -2
- package/hooks/core/useGridVirtualizer.d.ts +2 -2
- package/hooks/core/useGridVirtualizer.js +6 -6
- package/hooks/core/useGridVirtualizer.mjs +4 -4
- package/hooks/features/columnGrouping/gridColumnGroupsUtils.mjs +2 -2
- package/hooks/features/columnGrouping/useGridColumnGrouping.mjs +1 -1
- package/hooks/features/columnHeaders/useGridColumnHeaders.mjs +1 -1
- package/hooks/features/columnMenu/getColumnMenuItemKeys.mjs +1 -1
- package/hooks/features/columnMenu/useGridColumnMenu.mjs +1 -1
- package/hooks/features/columnMenu/useGridColumnMenuSlots.mjs +2 -2
- package/hooks/features/columnResize/useGridColumnResize.js +4 -1
- package/hooks/features/columnResize/useGridColumnResize.mjs +5 -2
- package/hooks/features/columns/gridColumnsInterfaces.d.mts +1 -1
- package/hooks/features/columns/gridColumnsInterfaces.d.ts +1 -1
- package/hooks/features/columns/gridColumnsUtils.d.mts +1 -1
- package/hooks/features/columns/gridColumnsUtils.d.ts +1 -1
- package/hooks/features/columns/gridColumnsUtils.mjs +1 -1
- package/hooks/features/columns/useGridColumns.js +1 -1
- package/hooks/features/columns/useGridColumns.mjs +2 -2
- package/hooks/features/dataSource/cache.js +1 -1
- package/hooks/features/dataSource/cache.mjs +1 -1
- package/hooks/features/dataSource/useGridDataSourceBase.js +14 -29
- package/hooks/features/dataSource/useGridDataSourceBase.mjs +17 -32
- package/hooks/features/dataSource/useGridDataSourcePolling.d.mts +29 -0
- package/hooks/features/dataSource/useGridDataSourcePolling.d.ts +29 -0
- package/hooks/features/dataSource/useGridDataSourcePolling.js +62 -0
- package/hooks/features/dataSource/useGridDataSourcePolling.mjs +54 -0
- package/hooks/features/dataSource/utils.d.mts +1 -1
- package/hooks/features/dataSource/utils.d.ts +1 -1
- package/hooks/features/dataSource/utils.mjs +1 -1
- package/hooks/features/density/useGridDensity.mjs +1 -1
- package/hooks/features/dimensions/useGridDimensions.d.mts +1 -1
- package/hooks/features/dimensions/useGridDimensions.d.ts +1 -1
- package/hooks/features/dimensions/useGridDimensions.js +3 -3
- package/hooks/features/dimensions/useGridDimensions.mjs +3 -3
- package/hooks/features/editing/useGridCellEditing.js +1 -1
- package/hooks/features/editing/useGridCellEditing.mjs +5 -5
- package/hooks/features/editing/useGridEditing.mjs +1 -1
- package/hooks/features/editing/useGridRowEditing.js +1 -1
- package/hooks/features/editing/useGridRowEditing.mjs +5 -5
- package/hooks/features/export/serializers/csvSerializer.js +5 -5
- package/hooks/features/export/serializers/csvSerializer.mjs +5 -5
- package/hooks/features/export/useGridPrintExport.js +44 -20
- package/hooks/features/export/useGridPrintExport.mjs +45 -21
- package/hooks/features/filter/gridFilterUtils.js +3 -3
- package/hooks/features/filter/gridFilterUtils.mjs +5 -5
- package/hooks/features/filter/useGridFilter.js +2 -2
- package/hooks/features/filter/useGridFilter.mjs +3 -3
- package/hooks/features/focus/useGridFocus.mjs +1 -1
- package/hooks/features/headerFiltering/useGridHeaderFiltering.mjs +1 -1
- package/hooks/features/listView/useGridListView.d.mts +2 -2
- package/hooks/features/listView/useGridListView.d.ts +2 -2
- package/hooks/features/listView/useGridListView.js +1 -1
- package/hooks/features/listView/useGridListView.mjs +2 -2
- package/hooks/features/pagination/useGridPagination.mjs +1 -1
- package/hooks/features/pagination/useGridPaginationMeta.mjs +1 -1
- package/hooks/features/pagination/useGridPaginationModel.mjs +1 -1
- package/hooks/features/pagination/useGridRowCount.js +2 -2
- package/hooks/features/pagination/useGridRowCount.mjs +2 -2
- package/hooks/features/preferencesPanel/gridPreferencePanelsValue.d.mts +1 -1
- package/hooks/features/preferencesPanel/gridPreferencePanelsValue.d.ts +1 -1
- package/hooks/features/preferencesPanel/useGridPreferencesPanel.mjs +1 -1
- package/hooks/features/rowSelection/useGridRowSelection.d.mts +1 -1
- package/hooks/features/rowSelection/useGridRowSelection.d.ts +1 -1
- package/hooks/features/rowSelection/useGridRowSelection.js +50 -9
- package/hooks/features/rowSelection/useGridRowSelection.mjs +52 -11
- package/hooks/features/rowSelection/useGridRowSelectionPreProcessors.mjs +1 -1
- package/hooks/features/rowSelection/utils.js +5 -0
- package/hooks/features/rowSelection/utils.mjs +5 -0
- package/hooks/features/rows/gridRowsUtils.js +2 -2
- package/hooks/features/rows/gridRowsUtils.mjs +3 -3
- package/hooks/features/rows/useGridRowSpanning.mjs +1 -1
- package/hooks/features/rows/useGridRows.mjs +1 -1
- package/hooks/features/rows/useGridRowsMeta.mjs +1 -1
- package/hooks/features/rows/useGridRowsOverridableMethods.mjs +1 -1
- package/hooks/features/rows/useGridRowsPreProcessors.mjs +1 -1
- package/hooks/features/sorting/gridSortingUtils.js +1 -1
- package/hooks/features/sorting/gridSortingUtils.mjs +3 -3
- package/hooks/features/sorting/useGridSorting.js +2 -2
- package/hooks/features/sorting/useGridSorting.mjs +3 -3
- package/hooks/features/virtualization/gridFocusedVirtualCellSelector.mjs +1 -1
- package/hooks/features/virtualization/useGridVirtualization.mjs +1 -1
- package/hooks/utils/index.d.mts +1 -1
- package/hooks/utils/index.d.ts +1 -1
- package/hooks/utils/index.js +8 -12
- package/hooks/utils/index.mjs +2 -1
- package/hooks/utils/useGridSelector.js +2 -2
- package/hooks/utils/useGridSelector.mjs +2 -2
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/internals/constants.d.mts +1 -1
- package/internals/constants.d.ts +1 -1
- package/internals/index.d.mts +1 -0
- package/internals/index.d.ts +1 -0
- package/internals/index.js +8 -0
- package/internals/index.mjs +1 -0
- package/internals/utils/cache.d.mts +0 -1
- package/internals/utils/cache.d.ts +0 -1
- package/internals/utils/cache.js +1 -3
- package/internals/utils/cache.mjs +1 -3
- package/internals/utils/computeSlots.mjs +1 -1
- package/internals/utils/propValidation.js +2 -2
- package/internals/utils/propValidation.mjs +3 -3
- package/material/index.mjs +2 -2
- package/models/api/gridCoreApi.d.mts +1 -1
- package/models/api/gridCoreApi.d.ts +1 -1
- package/models/api/gridEditingApi.d.mts +6 -6
- package/models/api/gridEditingApi.d.ts +6 -6
- package/models/api/gridPrintExportApi.d.mts +2 -1
- package/models/api/gridPrintExportApi.d.ts +2 -1
- package/models/events/gridEventLookup.d.mts +5 -5
- package/models/events/gridEventLookup.d.ts +5 -5
- package/models/gridBaseSlots.d.mts +18 -1
- package/models/gridBaseSlots.d.ts +18 -1
- package/models/gridEditRowModel.d.mts +3 -3
- package/models/gridEditRowModel.d.ts +3 -3
- package/models/gridExport.d.mts +13 -0
- package/models/gridExport.d.ts +13 -0
- package/models/gridFilterItem.d.mts +2 -2
- package/models/gridFilterItem.d.ts +2 -2
- package/models/index.d.mts +2 -1
- package/models/index.d.ts +2 -1
- package/models/params/gridEditCellParams.d.mts +2 -2
- package/models/params/gridEditCellParams.d.ts +2 -2
- package/models/params/gridRowParams.d.mts +2 -2
- package/models/params/gridRowParams.d.ts +2 -2
- package/models/props/DataGridProps.d.mts +8 -0
- package/models/props/DataGridProps.d.ts +8 -0
- package/package.json +6 -6
- package/utils/createSelector.d.mts +1 -1
- package/utils/createSelector.d.ts +1 -1
- package/utils/createSelector.js +1 -1
- package/utils/createSelector.mjs +1 -1
- package/hooks/utils/useFirstRender.d.mts +0 -1
- package/hooks/utils/useFirstRender.d.ts +0 -1
- package/hooks/utils/useFirstRender.js +0 -16
- package/hooks/utils/useFirstRender.mjs +0 -1
|
@@ -27,6 +27,7 @@ var _useTimeout = require("../hooks/utils/useTimeout");
|
|
|
27
27
|
var _gridColumnsUtils = require("../hooks/features/columns/gridColumnsUtils");
|
|
28
28
|
var _createSelector = require("../utils/createSelector");
|
|
29
29
|
var _gridRowsMetaSelector = require("../hooks/features/rows/gridRowsMetaSelector");
|
|
30
|
+
var _gridRowReorderSelector = require("../hooks/features/rowReorder/gridRowReorderSelector");
|
|
30
31
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
31
32
|
const CLIFF = 1;
|
|
32
33
|
const SLOP = 1.5;
|
|
@@ -89,15 +90,27 @@ const offsetSelector = (0, _createSelector.createSelector)(_gridDimensionsSelect
|
|
|
89
90
|
// For vertical scroll areas, we don't need horizontal offset
|
|
90
91
|
return 0;
|
|
91
92
|
});
|
|
93
|
+
|
|
94
|
+
// The `columnReorder` state is only initialized by the Pro package,
|
|
95
|
+
// so it is read defensively here.
|
|
96
|
+
const gridColumnReorderDragColSelector = (0, _createSelector.createRootSelector)(state => state.columnReorder?.dragCol);
|
|
97
|
+
|
|
98
|
+
// The drag direction is derived from the reorder state instead of the drag events.
|
|
99
|
+
// An event handler subscribed during render can fire for a render pass that never mounts.
|
|
100
|
+
// A `setState` call from such a handler triggers a React warning.
|
|
101
|
+
// See https://github.com/mui/mui-x/issues/23469.
|
|
102
|
+
const gridDragDirectionSelector = (0, _createSelector.createSelector)(gridColumnReorderDragColSelector, _gridRowReorderSelector.gridIsRowDragActiveSelector, (dragCol, isRowDragActive) => {
|
|
103
|
+
if (dragCol) {
|
|
104
|
+
return 'horizontal';
|
|
105
|
+
}
|
|
106
|
+
if (isRowDragActive) {
|
|
107
|
+
return 'vertical';
|
|
108
|
+
}
|
|
109
|
+
return 'none';
|
|
110
|
+
});
|
|
92
111
|
function GridScrollAreaWrapper(props) {
|
|
93
112
|
const apiRef = (0, _useGridApiContext.useGridApiContext)();
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
// Listen for both column and row drag events
|
|
97
|
-
(0, _useGridEvent.useGridEvent)(apiRef, 'columnHeaderDragStart', () => setDragDirection('horizontal'));
|
|
98
|
-
(0, _useGridEvent.useGridEvent)(apiRef, 'columnHeaderDragEnd', () => setDragDirection('none'));
|
|
99
|
-
(0, _useGridEvent.useGridEvent)(apiRef, 'rowDragStart', () => setDragDirection('vertical'));
|
|
100
|
-
(0, _useGridEvent.useGridEvent)(apiRef, 'rowDragEnd', () => setDragDirection('none'));
|
|
113
|
+
const dragDirection = (0, _useGridSelector.useGridSelector)(apiRef, gridDragDirectionSelector);
|
|
101
114
|
if (dragDirection === 'none') {
|
|
102
115
|
return null;
|
|
103
116
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
/* eslint-disable @typescript-eslint/no-use-before-define */
|
|
4
4
|
import _formatErrorMessage from "@mui/x-internals/formatErrorMessage";
|
|
5
|
-
import _extends from "@babel/runtime/helpers/
|
|
5
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import useEventCallback from '@mui/utils/useEventCallback';
|
|
8
8
|
import composeClasses from '@mui/utils/composeClasses';
|
|
@@ -18,8 +18,9 @@ import { gridDimensionsSelector, gridColumnsTotalWidthSelector } from "../hooks/
|
|
|
18
18
|
import { gridDensityFactorSelector } from "../hooks/features/density/densitySelector.mjs";
|
|
19
19
|
import { useTimeout } from "../hooks/utils/useTimeout.mjs";
|
|
20
20
|
import { getTotalHeaderHeight } from "../hooks/features/columns/gridColumnsUtils.mjs";
|
|
21
|
-
import { createSelector } from "../utils/createSelector.mjs";
|
|
21
|
+
import { createRootSelector, createSelector } from "../utils/createSelector.mjs";
|
|
22
22
|
import { gridRowsMetaSelector } from "../hooks/features/rows/gridRowsMetaSelector.mjs";
|
|
23
|
+
import { gridIsRowDragActiveSelector } from "../hooks/features/rowReorder/gridRowReorderSelector.mjs";
|
|
23
24
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
25
|
const CLIFF = 1;
|
|
25
26
|
const SLOP = 1.5;
|
|
@@ -82,15 +83,27 @@ const offsetSelector = createSelector(gridDimensionsSelector, (dimensions, direc
|
|
|
82
83
|
// For vertical scroll areas, we don't need horizontal offset
|
|
83
84
|
return 0;
|
|
84
85
|
});
|
|
86
|
+
|
|
87
|
+
// The `columnReorder` state is only initialized by the Pro package,
|
|
88
|
+
// so it is read defensively here.
|
|
89
|
+
const gridColumnReorderDragColSelector = createRootSelector(state => state.columnReorder?.dragCol);
|
|
90
|
+
|
|
91
|
+
// The drag direction is derived from the reorder state instead of the drag events.
|
|
92
|
+
// An event handler subscribed during render can fire for a render pass that never mounts.
|
|
93
|
+
// A `setState` call from such a handler triggers a React warning.
|
|
94
|
+
// See https://github.com/mui/mui-x/issues/23469.
|
|
95
|
+
const gridDragDirectionSelector = createSelector(gridColumnReorderDragColSelector, gridIsRowDragActiveSelector, (dragCol, isRowDragActive) => {
|
|
96
|
+
if (dragCol) {
|
|
97
|
+
return 'horizontal';
|
|
98
|
+
}
|
|
99
|
+
if (isRowDragActive) {
|
|
100
|
+
return 'vertical';
|
|
101
|
+
}
|
|
102
|
+
return 'none';
|
|
103
|
+
});
|
|
85
104
|
function GridScrollAreaWrapper(props) {
|
|
86
105
|
const apiRef = useGridApiContext();
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
// Listen for both column and row drag events
|
|
90
|
-
useGridEvent(apiRef, 'columnHeaderDragStart', () => setDragDirection('horizontal'));
|
|
91
|
-
useGridEvent(apiRef, 'columnHeaderDragEnd', () => setDragDirection('none'));
|
|
92
|
-
useGridEvent(apiRef, 'rowDragStart', () => setDragDirection('vertical'));
|
|
93
|
-
useGridEvent(apiRef, 'rowDragEnd', () => setDragDirection('none'));
|
|
106
|
+
const dragDirection = useGridSelector(apiRef, gridDragDirectionSelector);
|
|
94
107
|
if (dragDirection === 'none') {
|
|
95
108
|
return null;
|
|
96
109
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import _extends from "@babel/runtime/helpers/
|
|
4
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/
|
|
3
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
4
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
5
5
|
const _excluded = ["className", "selectedRowCount"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import _extends from "@babel/runtime/helpers/
|
|
4
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/
|
|
3
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
4
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
5
5
|
const _excluded = ["children"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import _formatErrorMessage from "@mui/x-internals/formatErrorMessage";
|
|
4
|
-
import _extends from "@babel/runtime/helpers/
|
|
5
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/
|
|
4
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
5
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
6
6
|
const _excluded = ["skeletonRowsCount", "visibleColumns", "showFirstRowBorder"];
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
import clsx from 'clsx';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.mjs";
|
|
3
3
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
4
|
export function GridFooterPlaceholder() {
|
|
@@ -21,19 +21,21 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
21
21
|
const GridOverlayWrapperRoot = (0, _styles.styled)('div', {
|
|
22
22
|
name: 'MuiDataGrid',
|
|
23
23
|
slot: 'OverlayWrapper',
|
|
24
|
-
shouldForwardProp: prop => prop !== 'overlayType' && prop !== 'loadingOverlayVariant'
|
|
24
|
+
shouldForwardProp: prop => prop !== 'overlayType' && prop !== 'loadingOverlayVariant'
|
|
25
25
|
})(({
|
|
26
26
|
overlayType,
|
|
27
|
-
loadingOverlayVariant
|
|
28
|
-
right
|
|
27
|
+
loadingOverlayVariant
|
|
29
28
|
}) =>
|
|
30
29
|
// Skeleton overlay should flow with the scroll container and not be sticky
|
|
31
30
|
loadingOverlayVariant !== 'skeleton' ? {
|
|
32
31
|
position: 'sticky',
|
|
33
32
|
// To stay in place while scrolling
|
|
34
33
|
top: 'var(--DataGrid-topContainerHeight)',
|
|
34
|
+
// Both 0-insets keep the overlay in the viewport in LTR and RTL alike. Sticky insets
|
|
35
|
+
// are independent constraints, and a width: 0 box satisfies both at once, so it
|
|
36
|
+
// clamps at whichever edge the scroll pushes it past.
|
|
35
37
|
left: 0,
|
|
36
|
-
right:
|
|
38
|
+
right: 0,
|
|
37
39
|
width: 0,
|
|
38
40
|
// To stay above the content instead of shifting it down
|
|
39
41
|
height: 0,
|
|
@@ -70,7 +72,6 @@ function GridOverlayWrapper(props) {
|
|
|
70
72
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(GridOverlayWrapperRoot, (0, _extends2.default)({
|
|
71
73
|
className: classes.root
|
|
72
74
|
}, props, {
|
|
73
|
-
right: dimensions.columnsTotalWidth - dimensions.viewportOuterSize.width,
|
|
74
75
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(GridOverlayWrapperInner, (0, _extends2.default)({
|
|
75
76
|
className: classes.inner,
|
|
76
77
|
style: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { styled } from '@mui/material/styles';
|
|
@@ -13,19 +13,21 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
13
13
|
const GridOverlayWrapperRoot = styled('div', {
|
|
14
14
|
name: 'MuiDataGrid',
|
|
15
15
|
slot: 'OverlayWrapper',
|
|
16
|
-
shouldForwardProp: prop => prop !== 'overlayType' && prop !== 'loadingOverlayVariant'
|
|
16
|
+
shouldForwardProp: prop => prop !== 'overlayType' && prop !== 'loadingOverlayVariant'
|
|
17
17
|
})(({
|
|
18
18
|
overlayType,
|
|
19
|
-
loadingOverlayVariant
|
|
20
|
-
right
|
|
19
|
+
loadingOverlayVariant
|
|
21
20
|
}) =>
|
|
22
21
|
// Skeleton overlay should flow with the scroll container and not be sticky
|
|
23
22
|
loadingOverlayVariant !== 'skeleton' ? {
|
|
24
23
|
position: 'sticky',
|
|
25
24
|
// To stay in place while scrolling
|
|
26
25
|
top: 'var(--DataGrid-topContainerHeight)',
|
|
26
|
+
// Both 0-insets keep the overlay in the viewport in LTR and RTL alike. Sticky insets
|
|
27
|
+
// are independent constraints, and a width: 0 box satisfies both at once, so it
|
|
28
|
+
// clamps at whichever edge the scroll pushes it past.
|
|
27
29
|
left: 0,
|
|
28
|
-
right:
|
|
30
|
+
right: 0,
|
|
29
31
|
width: 0,
|
|
30
32
|
// To stay above the content instead of shifting it down
|
|
31
33
|
height: 0,
|
|
@@ -62,7 +64,6 @@ export function GridOverlayWrapper(props) {
|
|
|
62
64
|
return /*#__PURE__*/_jsx(GridOverlayWrapperRoot, _extends({
|
|
63
65
|
className: classes.root
|
|
64
66
|
}, props, {
|
|
65
|
-
right: dimensions.columnsTotalWidth - dimensions.viewportOuterSize.width,
|
|
66
67
|
children: /*#__PURE__*/_jsx(GridOverlayWrapperInner, _extends({
|
|
67
68
|
className: classes.inner,
|
|
68
69
|
style: {
|
|
@@ -20,6 +20,7 @@ var _gridClasses = require("../../constants/gridClasses");
|
|
|
20
20
|
var _GridMenu = require("../menu/GridMenu");
|
|
21
21
|
var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
|
|
22
22
|
var _useGridApiContext = require("../../hooks/utils/useGridApiContext");
|
|
23
|
+
var _domUtils = require("../../utils/domUtils");
|
|
23
24
|
var _GridActionsCellItem = require("./GridActionsCellItem");
|
|
24
25
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
25
26
|
const _excluded = ["api", "colDef", "id", "hasFocus", "isEditable", "field", "value", "formattedValue", "row", "rowNode", "cellMode", "tabIndex", "position", "onMenuOpen", "onMenuClose", "children", "suppressChildrenValidation"];
|
|
@@ -62,8 +63,8 @@ function GridActionsCell(props) {
|
|
|
62
63
|
actions.push(child);
|
|
63
64
|
} else if (process.env.NODE_ENV !== 'production') {
|
|
64
65
|
const childType = typeof child.type === 'function' ? child.type.name : child.type;
|
|
65
|
-
(0, _warning.
|
|
66
|
-
If this is intentional, you can suppress this warning by passing the \`suppressChildrenValidation\` prop to \`GridActionsCell
|
|
66
|
+
(0, _warning.errorOnce)(`MUI X: Invalid child type in \`GridActionsCell\`. Expected \`GridActionsCellItem\` or \`React.Fragment\`, got \`${childType}\`.
|
|
67
|
+
If this is intentional, you can suppress this warning by passing the \`suppressChildrenValidation\` prop to \`GridActionsCell\`.`);
|
|
67
68
|
}
|
|
68
69
|
}
|
|
69
70
|
});
|
|
@@ -140,7 +141,9 @@ If this is intentional, you can suppress this warning by passing the \`suppressC
|
|
|
140
141
|
}
|
|
141
142
|
};
|
|
142
143
|
const handleRootKeyDown = event => {
|
|
143
|
-
|
|
144
|
+
// The menu renders in a portal, but its key events still bubble through the React tree.
|
|
145
|
+
// They must not move the roving focus between the buttons behind the open menu.
|
|
146
|
+
if (numberOfButtons <= 1 || (0, _domUtils.isEventTargetInPortal)(event)) {
|
|
144
147
|
return;
|
|
145
148
|
}
|
|
146
149
|
const getNewIndex = (index, direction) => {
|
|
@@ -170,55 +173,55 @@ If this is intentional, you can suppress this warning by passing the \`suppressC
|
|
|
170
173
|
setFocusedButtonIndex(newIndex);
|
|
171
174
|
}
|
|
172
175
|
};
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
})
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
})
|
|
219
|
-
})
|
|
220
|
-
})
|
|
221
|
-
|
|
176
|
+
return (
|
|
177
|
+
/*#__PURE__*/
|
|
178
|
+
// The wrapper carries no role on purpose: the buttons are plain buttons inside the
|
|
179
|
+
// `gridcell`. It only relays the key events bubbling from them.
|
|
180
|
+
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
181
|
+
(0, _jsxRuntime.jsxs)("div", (0, _extends2.default)({
|
|
182
|
+
ref: rootRef,
|
|
183
|
+
tabIndex: -1,
|
|
184
|
+
className: _gridClasses.gridClasses.actionsCell,
|
|
185
|
+
onKeyDown: handleRootKeyDown
|
|
186
|
+
}, other, {
|
|
187
|
+
children: [iconButtons.map((button, index) => /*#__PURE__*/React.cloneElement(button, {
|
|
188
|
+
key: index,
|
|
189
|
+
touchRippleRef: handleTouchRippleRef(index),
|
|
190
|
+
onClick: handleButtonClick(index, button.props.onClick),
|
|
191
|
+
tabIndex: focusedButtonIndex === index ? tabIndex : -1
|
|
192
|
+
})), menuButtons.length > 0 && buttonId && /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseIconButton, (0, _extends2.default)({
|
|
193
|
+
ref: buttonRef,
|
|
194
|
+
id: buttonId,
|
|
195
|
+
"aria-label": apiRef.current.getLocaleText('actionsCellMore'),
|
|
196
|
+
"aria-haspopup": "menu",
|
|
197
|
+
"aria-expanded": open,
|
|
198
|
+
"aria-controls": open ? menuId : undefined,
|
|
199
|
+
size: "small",
|
|
200
|
+
onClick: toggleMenu,
|
|
201
|
+
touchRippleRef: handleTouchRippleRef(buttonId),
|
|
202
|
+
tabIndex: focusedButtonIndex === iconButtons.length ? tabIndex : -1
|
|
203
|
+
}, rootProps.slotProps?.baseIconButton, {
|
|
204
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.moreActionsIcon, {
|
|
205
|
+
fontSize: "small"
|
|
206
|
+
})
|
|
207
|
+
})), menuButtons.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridMenu.GridMenu, {
|
|
208
|
+
open: open,
|
|
209
|
+
target: buttonRef.current,
|
|
210
|
+
position: position,
|
|
211
|
+
onClose: hideMenu,
|
|
212
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseMenuList, {
|
|
213
|
+
id: menuId,
|
|
214
|
+
className: _gridClasses.gridClasses.menuList,
|
|
215
|
+
"aria-labelledby": buttonId,
|
|
216
|
+
autoFocusItem: true,
|
|
217
|
+
children: menuButtons.map((button, index) => /*#__PURE__*/React.cloneElement(button, {
|
|
218
|
+
key: index,
|
|
219
|
+
closeMenu: hideMenu
|
|
220
|
+
}))
|
|
221
|
+
})
|
|
222
|
+
})]
|
|
223
|
+
}))
|
|
224
|
+
);
|
|
222
225
|
}
|
|
223
226
|
process.env.NODE_ENV !== "production" ? GridActionsCell.propTypes /* remove-proptypes */ = {
|
|
224
227
|
// ----------------------------- Warning --------------------------------
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import _formatErrorMessage from "@mui/x-internals/formatErrorMessage";
|
|
4
|
-
import _extends from "@babel/runtime/helpers/
|
|
5
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/
|
|
4
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
5
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
6
6
|
const _excluded = ["api", "colDef", "id", "hasFocus", "isEditable", "field", "value", "formattedValue", "row", "rowNode", "cellMode", "tabIndex", "position", "onMenuOpen", "onMenuClose", "children", "suppressChildrenValidation"];
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
9
|
import { useRtl } from '@mui/system/RtlProvider';
|
|
10
10
|
import useId from '@mui/utils/useId';
|
|
11
|
-
import {
|
|
11
|
+
import { errorOnce } from '@mui/x-internals/warning';
|
|
12
12
|
import { gridClasses } from "../../constants/gridClasses.mjs";
|
|
13
13
|
import { GridMenu } from "../menu/GridMenu.mjs";
|
|
14
14
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.mjs";
|
|
15
15
|
import { useGridApiContext } from "../../hooks/utils/useGridApiContext.mjs";
|
|
16
|
+
import { isEventTargetInPortal } from "../../utils/domUtils.mjs";
|
|
16
17
|
import { GridActionsCellItem } from "./GridActionsCellItem.mjs";
|
|
17
18
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
19
|
const hasActions = colDef => typeof colDef.getActions === 'function';
|
|
@@ -54,8 +55,8 @@ function GridActionsCell(props) {
|
|
|
54
55
|
actions.push(child);
|
|
55
56
|
} else if (process.env.NODE_ENV !== 'production') {
|
|
56
57
|
const childType = typeof child.type === 'function' ? child.type.name : child.type;
|
|
57
|
-
|
|
58
|
-
If this is intentional, you can suppress this warning by passing the \`suppressChildrenValidation\` prop to \`GridActionsCell
|
|
58
|
+
errorOnce(`MUI X: Invalid child type in \`GridActionsCell\`. Expected \`GridActionsCellItem\` or \`React.Fragment\`, got \`${childType}\`.
|
|
59
|
+
If this is intentional, you can suppress this warning by passing the \`suppressChildrenValidation\` prop to \`GridActionsCell\`.`);
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
62
|
});
|
|
@@ -132,7 +133,9 @@ If this is intentional, you can suppress this warning by passing the \`suppressC
|
|
|
132
133
|
}
|
|
133
134
|
};
|
|
134
135
|
const handleRootKeyDown = event => {
|
|
135
|
-
|
|
136
|
+
// The menu renders in a portal, but its key events still bubble through the React tree.
|
|
137
|
+
// They must not move the roving focus between the buttons behind the open menu.
|
|
138
|
+
if (numberOfButtons <= 1 || isEventTargetInPortal(event)) {
|
|
136
139
|
return;
|
|
137
140
|
}
|
|
138
141
|
const getNewIndex = (index, direction) => {
|
|
@@ -162,55 +165,55 @@ If this is intentional, you can suppress this warning by passing the \`suppressC
|
|
|
162
165
|
setFocusedButtonIndex(newIndex);
|
|
163
166
|
}
|
|
164
167
|
};
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
})
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
})
|
|
211
|
-
})
|
|
212
|
-
})
|
|
213
|
-
|
|
168
|
+
return (
|
|
169
|
+
/*#__PURE__*/
|
|
170
|
+
// The wrapper carries no role on purpose: the buttons are plain buttons inside the
|
|
171
|
+
// `gridcell`. It only relays the key events bubbling from them.
|
|
172
|
+
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
173
|
+
_jsxs("div", _extends({
|
|
174
|
+
ref: rootRef,
|
|
175
|
+
tabIndex: -1,
|
|
176
|
+
className: gridClasses.actionsCell,
|
|
177
|
+
onKeyDown: handleRootKeyDown
|
|
178
|
+
}, other, {
|
|
179
|
+
children: [iconButtons.map((button, index) => /*#__PURE__*/React.cloneElement(button, {
|
|
180
|
+
key: index,
|
|
181
|
+
touchRippleRef: handleTouchRippleRef(index),
|
|
182
|
+
onClick: handleButtonClick(index, button.props.onClick),
|
|
183
|
+
tabIndex: focusedButtonIndex === index ? tabIndex : -1
|
|
184
|
+
})), menuButtons.length > 0 && buttonId && /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({
|
|
185
|
+
ref: buttonRef,
|
|
186
|
+
id: buttonId,
|
|
187
|
+
"aria-label": apiRef.current.getLocaleText('actionsCellMore'),
|
|
188
|
+
"aria-haspopup": "menu",
|
|
189
|
+
"aria-expanded": open,
|
|
190
|
+
"aria-controls": open ? menuId : undefined,
|
|
191
|
+
size: "small",
|
|
192
|
+
onClick: toggleMenu,
|
|
193
|
+
touchRippleRef: handleTouchRippleRef(buttonId),
|
|
194
|
+
tabIndex: focusedButtonIndex === iconButtons.length ? tabIndex : -1
|
|
195
|
+
}, rootProps.slotProps?.baseIconButton, {
|
|
196
|
+
children: /*#__PURE__*/_jsx(rootProps.slots.moreActionsIcon, {
|
|
197
|
+
fontSize: "small"
|
|
198
|
+
})
|
|
199
|
+
})), menuButtons.length > 0 && /*#__PURE__*/_jsx(GridMenu, {
|
|
200
|
+
open: open,
|
|
201
|
+
target: buttonRef.current,
|
|
202
|
+
position: position,
|
|
203
|
+
onClose: hideMenu,
|
|
204
|
+
children: /*#__PURE__*/_jsx(rootProps.slots.baseMenuList, {
|
|
205
|
+
id: menuId,
|
|
206
|
+
className: gridClasses.menuList,
|
|
207
|
+
"aria-labelledby": buttonId,
|
|
208
|
+
autoFocusItem: true,
|
|
209
|
+
children: menuButtons.map((button, index) => /*#__PURE__*/React.cloneElement(button, {
|
|
210
|
+
key: index,
|
|
211
|
+
closeMenu: hideMenu
|
|
212
|
+
}))
|
|
213
|
+
})
|
|
214
|
+
})]
|
|
215
|
+
}))
|
|
216
|
+
);
|
|
214
217
|
}
|
|
215
218
|
process.env.NODE_ENV !== "production" ? GridActionsCell.propTypes /* remove-proptypes */ = {
|
|
216
219
|
// ----------------------------- Warning --------------------------------
|
|
@@ -2,14 +2,18 @@ import * as React from 'react';
|
|
|
2
2
|
import type { GridSlotProps, GridBaseIconProps } from "../../models/gridSlotsComponentsProps.mjs";
|
|
3
3
|
interface GridActionsCellItemCommonProps {
|
|
4
4
|
icon?: React.JSXElementConstructor<GridBaseIconProps> | React.ReactNode;
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* The component used for the root node.
|
|
7
|
+
* If not set, and `href` is set, the item renders as an anchor tag.
|
|
8
|
+
* from https://mui.com/material-ui/api/button-base/#ButtonBase-prop-component
|
|
9
|
+
*/
|
|
6
10
|
component?: React.ElementType;
|
|
7
11
|
}
|
|
8
|
-
export type GridActionsCellItemProps = GridActionsCellItemCommonProps & (
|
|
12
|
+
export type GridActionsCellItemProps = GridActionsCellItemCommonProps & ({
|
|
9
13
|
showInMenu?: false;
|
|
10
14
|
icon: React.ReactElement<any>;
|
|
11
15
|
label: string;
|
|
12
|
-
} & Omit<GridSlotProps['baseIconButton'], 'component'>
|
|
16
|
+
} & Omit<GridSlotProps['baseIconButton'], 'component'> | {
|
|
13
17
|
showInMenu: true;
|
|
14
18
|
/**
|
|
15
19
|
* If false, the menu will not close when this item is clicked.
|
|
@@ -18,7 +22,7 @@ export type GridActionsCellItemProps = GridActionsCellItemCommonProps & (({
|
|
|
18
22
|
closeMenuOnClick?: boolean;
|
|
19
23
|
closeMenu?: () => void;
|
|
20
24
|
label: React.ReactNode;
|
|
21
|
-
} & Omit<GridSlotProps['baseMenuItem'], 'component'>)
|
|
25
|
+
} & Omit<GridSlotProps['baseMenuItem'], 'component'>);
|
|
22
26
|
declare const GridActionsCellItem: React.ForwardRefExoticComponent<GridActionsCellItemProps> | React.ForwardRefExoticComponent<(Omit<GridActionsCellItemCommonProps & {
|
|
23
27
|
showInMenu?: false;
|
|
24
28
|
icon: React.ReactElement<any>;
|
|
@@ -27,7 +31,12 @@ declare const GridActionsCellItem: React.ForwardRefExoticComponent<GridActionsCe
|
|
|
27
31
|
label?: string;
|
|
28
32
|
color?: 'default' | 'inherit' | 'primary';
|
|
29
33
|
edge?: 'start' | 'end' | false;
|
|
30
|
-
} &
|
|
34
|
+
} & {
|
|
35
|
+
component?: React.ElementType;
|
|
36
|
+
href?: string;
|
|
37
|
+
target?: React.HTMLAttributeAnchorTarget;
|
|
38
|
+
rel?: string;
|
|
39
|
+
} & import("@mui/x-data-grid").BaseIconButtonPropsOverrides, "component">, "ref"> | GridActionsCellItemCommonProps & {
|
|
31
40
|
showInMenu: true;
|
|
32
41
|
/**
|
|
33
42
|
* If false, the menu will not close when this item is clicked.
|
|
@@ -51,5 +60,10 @@ declare const GridActionsCellItem: React.ForwardRefExoticComponent<GridActionsCe
|
|
|
51
60
|
selected?: boolean;
|
|
52
61
|
value?: number | string | readonly string[];
|
|
53
62
|
style?: React.CSSProperties;
|
|
54
|
-
} &
|
|
63
|
+
} & {
|
|
64
|
+
component?: React.ElementType;
|
|
65
|
+
href?: string;
|
|
66
|
+
target?: React.HTMLAttributeAnchorTarget;
|
|
67
|
+
rel?: string;
|
|
68
|
+
} & import("@mui/x-data-grid").BaseMenuItemPropsOverrides, "component">) & React.RefAttributes<HTMLElement>>;
|
|
55
69
|
export { GridActionsCellItem };
|
|
@@ -2,14 +2,18 @@ import * as React from 'react';
|
|
|
2
2
|
import type { GridSlotProps, GridBaseIconProps } from "../../models/gridSlotsComponentsProps.js";
|
|
3
3
|
interface GridActionsCellItemCommonProps {
|
|
4
4
|
icon?: React.JSXElementConstructor<GridBaseIconProps> | React.ReactNode;
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* The component used for the root node.
|
|
7
|
+
* If not set, and `href` is set, the item renders as an anchor tag.
|
|
8
|
+
* from https://mui.com/material-ui/api/button-base/#ButtonBase-prop-component
|
|
9
|
+
*/
|
|
6
10
|
component?: React.ElementType;
|
|
7
11
|
}
|
|
8
|
-
export type GridActionsCellItemProps = GridActionsCellItemCommonProps & (
|
|
12
|
+
export type GridActionsCellItemProps = GridActionsCellItemCommonProps & ({
|
|
9
13
|
showInMenu?: false;
|
|
10
14
|
icon: React.ReactElement<any>;
|
|
11
15
|
label: string;
|
|
12
|
-
} & Omit<GridSlotProps['baseIconButton'], 'component'>
|
|
16
|
+
} & Omit<GridSlotProps['baseIconButton'], 'component'> | {
|
|
13
17
|
showInMenu: true;
|
|
14
18
|
/**
|
|
15
19
|
* If false, the menu will not close when this item is clicked.
|
|
@@ -18,7 +22,7 @@ export type GridActionsCellItemProps = GridActionsCellItemCommonProps & (({
|
|
|
18
22
|
closeMenuOnClick?: boolean;
|
|
19
23
|
closeMenu?: () => void;
|
|
20
24
|
label: React.ReactNode;
|
|
21
|
-
} & Omit<GridSlotProps['baseMenuItem'], 'component'>)
|
|
25
|
+
} & Omit<GridSlotProps['baseMenuItem'], 'component'>);
|
|
22
26
|
declare const GridActionsCellItem: React.ForwardRefExoticComponent<GridActionsCellItemProps> | React.ForwardRefExoticComponent<(Omit<GridActionsCellItemCommonProps & {
|
|
23
27
|
showInMenu?: false;
|
|
24
28
|
icon: React.ReactElement<any>;
|
|
@@ -27,7 +31,12 @@ declare const GridActionsCellItem: React.ForwardRefExoticComponent<GridActionsCe
|
|
|
27
31
|
label?: string;
|
|
28
32
|
color?: 'default' | 'inherit' | 'primary';
|
|
29
33
|
edge?: 'start' | 'end' | false;
|
|
30
|
-
} &
|
|
34
|
+
} & {
|
|
35
|
+
component?: React.ElementType;
|
|
36
|
+
href?: string;
|
|
37
|
+
target?: React.HTMLAttributeAnchorTarget;
|
|
38
|
+
rel?: string;
|
|
39
|
+
} & import("@mui/x-data-grid").BaseIconButtonPropsOverrides, "component">, "ref"> | GridActionsCellItemCommonProps & {
|
|
31
40
|
showInMenu: true;
|
|
32
41
|
/**
|
|
33
42
|
* If false, the menu will not close when this item is clicked.
|
|
@@ -51,5 +60,10 @@ declare const GridActionsCellItem: React.ForwardRefExoticComponent<GridActionsCe
|
|
|
51
60
|
selected?: boolean;
|
|
52
61
|
value?: number | string | readonly string[];
|
|
53
62
|
style?: React.CSSProperties;
|
|
54
|
-
} &
|
|
63
|
+
} & {
|
|
64
|
+
component?: React.ElementType;
|
|
65
|
+
href?: string;
|
|
66
|
+
target?: React.HTMLAttributeAnchorTarget;
|
|
67
|
+
rel?: string;
|
|
68
|
+
} & import("@mui/x-data-grid").BaseMenuItemPropsOverrides, "component">) & React.RefAttributes<HTMLElement>>;
|
|
55
69
|
export { GridActionsCellItem };
|