@mui/x-data-grid 8.0.0-alpha.5 → 8.0.0-alpha.7
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 +206 -1
- package/DataGrid/DataGrid.js +4 -3
- package/DataGrid/useDataGridComponent.d.ts +1 -1
- package/components/GridColumnHeaders.d.ts +1 -1
- package/components/GridColumnHeaders.js +4 -4
- package/components/GridFooter.d.ts +2 -1
- package/components/GridFooter.js +4 -4
- package/components/GridLoadingOverlay.d.ts +1 -1
- package/components/GridLoadingOverlay.js +10 -8
- package/components/GridNoResultsOverlay.d.ts +2 -1
- package/components/GridNoResultsOverlay.js +4 -4
- package/components/GridNoRowsOverlay.d.ts +2 -1
- package/components/GridNoRowsOverlay.js +4 -4
- package/components/GridPagination.d.ts +1 -1
- package/components/GridPagination.js +5 -3
- package/components/GridRow.d.ts +1 -1
- package/components/GridRow.js +3 -2
- package/components/GridRowCount.d.ts +1 -1
- package/components/GridRowCount.js +3 -2
- package/components/GridSelectedRowCount.d.ts +4 -1
- package/components/GridSelectedRowCount.js +3 -2
- package/components/GridSkeletonLoadingOverlay.d.ts +1 -1
- package/components/GridSkeletonLoadingOverlay.js +4 -3
- package/components/cell/GridActionsCellItem.d.ts +17 -10
- package/components/cell/GridActionsCellItem.js +5 -2
- package/components/cell/GridCell.d.ts +1 -1
- package/components/cell/GridCell.js +3 -2
- package/components/cell/GridEditDateCell.js +1 -1
- package/components/cell/GridEditInputCell.d.ts +1 -1
- package/components/cell/GridEditInputCell.js +73 -4
- package/components/cell/GridEditSingleSelectCell.js +2 -2
- package/components/cell/GridSkeletonCell.js +1 -2
- package/components/columnHeaders/ColumnHeaderMenuIcon.d.ts +1 -1
- package/components/columnHeaders/GridBaseColumnHeaders.d.ts +1 -1
- package/components/columnHeaders/GridBaseColumnHeaders.js +4 -3
- package/components/columnHeaders/GridColumnHeaderFilterIconButton.js +0 -1
- package/components/columnHeaders/GridColumnHeaderTitle.js +5 -3
- package/components/columnHeaders/GridGenericColumnHeaderItem.d.ts +1 -1
- package/components/columnHeaders/GridGenericColumnHeaderItem.js +3 -2
- package/components/columnHeaders/GridIconButtonContainer.d.ts +1 -1
- package/components/columnHeaders/GridIconButtonContainer.js +5 -3
- package/components/columnSelection/GridCellCheckboxRenderer.d.ts +2 -2
- package/components/columnSelection/GridCellCheckboxRenderer.js +7 -4
- package/components/columnSelection/GridHeaderCheckbox.d.ts +1 -1
- package/components/columnSelection/GridHeaderCheckbox.js +11 -5
- package/components/columnsManagement/GridColumnsManagement.js +2 -2
- package/components/containers/GridFooterContainer.d.ts +1 -1
- package/components/containers/GridFooterContainer.js +5 -3
- package/components/containers/GridOverlay.d.ts +1 -1
- package/components/containers/GridOverlay.js +5 -3
- package/components/containers/GridRoot.d.ts +1 -1
- package/components/containers/GridRoot.js +5 -3
- package/components/containers/GridToolbarContainer.d.ts +1 -1
- package/components/containers/GridToolbarContainer.js +3 -2
- package/components/menu/columnMenu/GridColumnMenu.d.ts +2 -2
- package/components/menu/columnMenu/GridColumnMenu.js +5 -5
- package/components/menu/columnMenu/GridColumnMenuContainer.d.ts +1 -1
- package/components/menu/columnMenu/GridColumnMenuContainer.js +3 -2
- package/components/panel/GridPanel.d.ts +2 -2
- package/components/panel/GridPanel.js +3 -2
- package/components/panel/GridPanelWrapper.d.ts +1 -1
- package/components/panel/GridPanelWrapper.js +5 -3
- package/components/panel/filterPanel/GridFilterForm.d.ts +1 -1
- package/components/panel/filterPanel/GridFilterForm.js +3 -2
- package/components/panel/filterPanel/GridFilterInputBoolean.d.ts +1 -1
- package/components/panel/filterPanel/GridFilterInputBoolean.js +9 -9
- package/components/panel/filterPanel/GridFilterInputValue.js +13 -9
- package/components/panel/filterPanel/GridFilterPanel.d.ts +1 -1
- package/components/panel/filterPanel/GridFilterPanel.js +4 -4
- package/components/panel/filterPanel/index.d.ts +2 -1
- package/components/panel/filterPanel/index.js +1 -1
- package/components/toolbar/GridToolbar.d.ts +1 -1
- package/components/toolbar/GridToolbar.js +4 -4
- package/components/toolbar/GridToolbarColumnsButton.d.ts +1 -1
- package/components/toolbar/GridToolbarColumnsButton.js +3 -2
- package/components/toolbar/GridToolbarDensitySelector.d.ts +1 -1
- package/components/toolbar/GridToolbarDensitySelector.js +3 -2
- package/components/toolbar/GridToolbarExport.d.ts +1 -1
- package/components/toolbar/GridToolbarExport.js +2 -1
- package/components/toolbar/GridToolbarExportContainer.d.ts +1 -1
- package/components/toolbar/GridToolbarExportContainer.js +3 -2
- package/components/toolbar/GridToolbarFilterButton.d.ts +1 -1
- package/components/toolbar/GridToolbarFilterButton.js +3 -2
- package/components/toolbar/GridToolbarQuickFilter.js +2 -2
- package/components/virtualization/GridMainContainer.d.ts +3 -1
- package/components/virtualization/GridMainContainer.js +3 -2
- package/components/virtualization/GridVirtualScrollbar.d.ts +1 -1
- package/components/virtualization/GridVirtualScrollbar.js +2 -1
- package/components/virtualization/GridVirtualScrollerContent.d.ts +2 -0
- package/components/virtualization/GridVirtualScrollerContent.js +5 -5
- package/components/virtualization/GridVirtualScrollerRenderZone.d.ts +2 -0
- package/components/virtualization/GridVirtualScrollerRenderZone.js +5 -3
- package/hooks/core/pipeProcessing/gridPipeProcessingApi.d.ts +9 -2
- package/hooks/core/pipeProcessing/useGridPipeProcessing.d.ts +1 -1
- package/hooks/core/pipeProcessing/useGridRegisterPipeApplier.d.ts +1 -1
- package/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +1 -1
- package/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.d.ts +1 -1
- package/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +1 -1
- package/hooks/core/strategyProcessing/useGridRegisterStrategyProcessor.d.ts +1 -1
- package/hooks/core/strategyProcessing/useGridStrategyProcessing.d.ts +1 -1
- package/hooks/core/useGridApiInitialization.d.ts +1 -1
- package/hooks/core/useGridApiInitialization.js +2 -2
- package/hooks/core/useGridInitialization.d.ts +1 -1
- package/hooks/core/useGridIsRtl.d.ts +1 -1
- package/hooks/core/useGridLocaleText.d.ts +1 -1
- package/hooks/core/useGridLoggerFactory.d.ts +1 -1
- package/hooks/core/useGridRefs.d.ts +1 -1
- package/hooks/core/useGridStateInitialization.d.ts +1 -1
- package/hooks/features/columnResize/useGridColumnResize.d.ts +1 -1
- package/hooks/features/columnResize/useGridColumnResize.js +4 -4
- package/hooks/features/editing/useGridRowEditing.js +1 -1
- package/hooks/features/export/useGridPrintExport.js +1 -1
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.d.ts +1 -1
- package/hooks/features/preferencesPanel/useGridPreferencesPanel.js +2 -2
- package/hooks/features/rowSelection/useGridRowSelectionPreProcessors.d.ts +1 -1
- package/hooks/features/rows/useGridRowSpanning.js +76 -87
- package/hooks/features/rows/useGridRowsPreProcessors.d.ts +1 -1
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +3 -3
- package/hooks/features/virtualization/useGridVirtualScroller.js +5 -1
- package/hooks/utils/useGridApiEventHandler.js +1 -1
- package/hooks/utils/useGridApiMethod.d.ts +1 -1
- package/hooks/utils/useGridApiRef.d.ts +1 -1
- package/hooks/utils/useGridInitializeState.d.ts +2 -2
- package/hooks/utils/useGridLogger.d.ts +1 -1
- package/hooks/utils/useGridVisibleRows.d.ts +2 -2
- package/index.js +1 -1
- package/internals/index.d.ts +1 -1
- package/locales/nlNL.js +5 -6
- package/material/index.js +6 -0
- package/models/api/gridCoreApi.d.ts +7 -7
- package/models/api/gridDensityApi.d.ts +1 -1
- package/models/gridBaseSlots.d.ts +47 -2
- package/models/gridSlotsComponent.d.ts +16 -1
- package/models/gridSlotsComponentsProps.d.ts +24 -7
- package/models/props/DataGridProps.d.ts +1 -1
- package/modern/DataGrid/DataGrid.js +4 -3
- package/modern/components/GridColumnHeaders.js +4 -4
- package/modern/components/GridFooter.js +4 -4
- package/modern/components/GridLoadingOverlay.js +10 -8
- package/modern/components/GridNoResultsOverlay.js +4 -4
- package/modern/components/GridNoRowsOverlay.js +4 -4
- package/modern/components/GridPagination.js +5 -3
- package/modern/components/GridRow.js +3 -2
- package/modern/components/GridRowCount.js +3 -2
- package/modern/components/GridSelectedRowCount.js +3 -2
- package/modern/components/GridSkeletonLoadingOverlay.js +4 -3
- package/modern/components/cell/GridActionsCellItem.js +5 -2
- package/modern/components/cell/GridCell.js +3 -2
- package/modern/components/cell/GridEditDateCell.js +1 -1
- package/modern/components/cell/GridEditInputCell.js +73 -4
- package/modern/components/cell/GridEditSingleSelectCell.js +2 -2
- package/modern/components/cell/GridSkeletonCell.js +1 -2
- package/modern/components/columnHeaders/GridBaseColumnHeaders.js +4 -3
- package/modern/components/columnHeaders/GridColumnHeaderFilterIconButton.js +0 -1
- package/modern/components/columnHeaders/GridColumnHeaderTitle.js +5 -3
- package/modern/components/columnHeaders/GridGenericColumnHeaderItem.js +3 -2
- package/modern/components/columnHeaders/GridIconButtonContainer.js +5 -3
- package/modern/components/columnSelection/GridCellCheckboxRenderer.js +7 -4
- package/modern/components/columnSelection/GridHeaderCheckbox.js +11 -5
- package/modern/components/columnsManagement/GridColumnsManagement.js +2 -2
- package/modern/components/containers/GridFooterContainer.js +5 -3
- package/modern/components/containers/GridOverlay.js +5 -3
- package/modern/components/containers/GridRoot.js +5 -3
- package/modern/components/containers/GridToolbarContainer.js +3 -2
- package/modern/components/menu/columnMenu/GridColumnMenu.js +5 -5
- package/modern/components/menu/columnMenu/GridColumnMenuContainer.js +3 -2
- package/modern/components/panel/GridPanel.js +3 -2
- package/modern/components/panel/GridPanelWrapper.js +5 -3
- package/modern/components/panel/filterPanel/GridFilterForm.js +3 -2
- package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +9 -9
- package/modern/components/panel/filterPanel/GridFilterInputValue.js +13 -9
- package/modern/components/panel/filterPanel/GridFilterPanel.js +4 -4
- package/modern/components/panel/filterPanel/index.js +1 -1
- package/modern/components/toolbar/GridToolbar.js +4 -4
- package/modern/components/toolbar/GridToolbarColumnsButton.js +3 -2
- package/modern/components/toolbar/GridToolbarDensitySelector.js +3 -2
- package/modern/components/toolbar/GridToolbarExport.js +2 -1
- package/modern/components/toolbar/GridToolbarExportContainer.js +3 -2
- package/modern/components/toolbar/GridToolbarFilterButton.js +3 -2
- package/modern/components/toolbar/GridToolbarQuickFilter.js +2 -2
- package/modern/components/virtualization/GridMainContainer.js +3 -2
- package/modern/components/virtualization/GridVirtualScrollbar.js +2 -1
- package/modern/components/virtualization/GridVirtualScrollerContent.js +5 -5
- package/modern/components/virtualization/GridVirtualScrollerRenderZone.js +5 -3
- package/modern/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +1 -1
- package/modern/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +1 -1
- package/modern/hooks/core/useGridApiInitialization.js +2 -2
- package/modern/hooks/features/columnResize/useGridColumnResize.js +4 -4
- package/modern/hooks/features/editing/useGridRowEditing.js +1 -1
- package/modern/hooks/features/export/useGridPrintExport.js +1 -1
- package/modern/hooks/features/preferencesPanel/useGridPreferencesPanel.js +2 -2
- package/modern/hooks/features/rows/useGridRowSpanning.js +76 -87
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +5 -1
- package/modern/hooks/utils/useGridApiEventHandler.js +1 -1
- package/modern/index.js +1 -1
- package/modern/locales/nlNL.js +5 -6
- package/modern/material/index.js +6 -0
- package/modern/utils/utils.js +6 -1
- package/node/DataGrid/DataGrid.js +4 -3
- package/node/components/GridColumnHeaders.js +4 -4
- package/node/components/GridFooter.js +4 -4
- package/node/components/GridLoadingOverlay.js +10 -8
- package/node/components/GridNoResultsOverlay.js +4 -4
- package/node/components/GridNoRowsOverlay.js +4 -4
- package/node/components/GridPagination.js +5 -3
- package/node/components/GridRow.js +3 -2
- package/node/components/GridRowCount.js +3 -2
- package/node/components/GridSelectedRowCount.js +3 -2
- package/node/components/GridSkeletonLoadingOverlay.js +4 -3
- package/node/components/cell/GridActionsCellItem.js +4 -3
- package/node/components/cell/GridCell.js +3 -2
- package/node/components/cell/GridEditDateCell.js +1 -1
- package/node/components/cell/GridEditInputCell.js +73 -4
- package/node/components/cell/GridEditSingleSelectCell.js +2 -2
- package/node/components/cell/GridSkeletonCell.js +1 -2
- package/node/components/columnHeaders/GridBaseColumnHeaders.js +4 -3
- package/node/components/columnHeaders/GridColumnHeaderFilterIconButton.js +0 -1
- package/node/components/columnHeaders/GridColumnHeaderTitle.js +5 -3
- package/node/components/columnHeaders/GridGenericColumnHeaderItem.js +3 -2
- package/node/components/columnHeaders/GridIconButtonContainer.js +5 -3
- package/node/components/columnSelection/GridCellCheckboxRenderer.js +7 -4
- package/node/components/columnSelection/GridHeaderCheckbox.js +11 -5
- package/node/components/columnsManagement/GridColumnsManagement.js +2 -2
- package/node/components/containers/GridFooterContainer.js +5 -3
- package/node/components/containers/GridOverlay.js +5 -3
- package/node/components/containers/GridRoot.js +5 -3
- package/node/components/containers/GridToolbarContainer.js +3 -2
- package/node/components/menu/columnMenu/GridColumnMenu.js +5 -5
- package/node/components/menu/columnMenu/GridColumnMenuContainer.js +3 -2
- package/node/components/panel/GridPanel.js +3 -2
- package/node/components/panel/GridPanelWrapper.js +5 -3
- package/node/components/panel/filterPanel/GridFilterForm.js +3 -2
- package/node/components/panel/filterPanel/GridFilterInputBoolean.js +10 -11
- package/node/components/panel/filterPanel/GridFilterInputValue.js +13 -9
- package/node/components/panel/filterPanel/GridFilterPanel.js +4 -4
- package/node/components/panel/filterPanel/index.js +7 -11
- package/node/components/toolbar/GridToolbar.js +4 -4
- package/node/components/toolbar/GridToolbarColumnsButton.js +3 -2
- package/node/components/toolbar/GridToolbarDensitySelector.js +3 -2
- package/node/components/toolbar/GridToolbarExport.js +2 -1
- package/node/components/toolbar/GridToolbarExportContainer.js +3 -2
- package/node/components/toolbar/GridToolbarFilterButton.js +3 -2
- package/node/components/toolbar/GridToolbarQuickFilter.js +2 -2
- package/node/components/virtualization/GridMainContainer.js +3 -2
- package/node/components/virtualization/GridVirtualScrollbar.js +2 -1
- package/node/components/virtualization/GridVirtualScrollerContent.js +5 -5
- package/node/components/virtualization/GridVirtualScrollerRenderZone.js +5 -3
- package/node/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +1 -1
- package/node/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +1 -1
- package/node/hooks/core/useGridApiInitialization.js +2 -2
- package/node/hooks/features/columnResize/useGridColumnResize.js +4 -4
- package/node/hooks/features/editing/useGridRowEditing.js +1 -1
- package/node/hooks/features/export/useGridPrintExport.js +1 -1
- package/node/hooks/features/preferencesPanel/useGridPreferencesPanel.js +2 -2
- package/node/hooks/features/rows/useGridRowSpanning.js +74 -85
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +5 -1
- package/node/hooks/utils/useGridApiEventHandler.js +1 -1
- package/node/index.js +1 -1
- package/node/locales/nlNL.js +5 -6
- package/node/material/index.js +6 -0
- package/node/utils/utils.js +8 -1
- package/package.json +2 -2
- package/utils/utils.d.ts +1 -0
- package/utils/utils.js +6 -1
|
@@ -4,6 +4,7 @@ import clsx from 'clsx';
|
|
|
4
4
|
import { styled } from '@mui/system';
|
|
5
5
|
import useForkRef from '@mui/utils/useForkRef';
|
|
6
6
|
import composeClasses from '@mui/utils/composeClasses';
|
|
7
|
+
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
7
8
|
import { useGridApiContext } from "../hooks/utils/useGridApiContext.js";
|
|
8
9
|
import { useGridRootProps } from "../hooks/utils/useGridRootProps.js";
|
|
9
10
|
import { GridPinnedColumnPosition, gridColumnPositionsSelector, gridColumnsTotalWidthSelector, gridDimensionsSelector, gridVisibleColumnDefinitionsSelector, gridVisiblePinnedColumnDefinitionsSelector, useGridApiEventHandler, useGridSelector } from "../hooks/index.js";
|
|
@@ -34,7 +35,7 @@ const useUtilityClasses = ownerState => {
|
|
|
34
35
|
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
35
36
|
};
|
|
36
37
|
const getColIndex = el => parseInt(el.getAttribute('data-colindex'), 10);
|
|
37
|
-
const GridSkeletonLoadingOverlay =
|
|
38
|
+
const GridSkeletonLoadingOverlay = forwardRef(function GridSkeletonLoadingOverlay(props, forwardedRef) {
|
|
38
39
|
const rootProps = useGridRootProps();
|
|
39
40
|
const {
|
|
40
41
|
slots
|
|
@@ -172,9 +173,9 @@ const GridSkeletonLoadingOverlay = /*#__PURE__*/React.forwardRef(function GridSk
|
|
|
172
173
|
};
|
|
173
174
|
useGridApiEventHandler(apiRef, 'columnResize', handleColumnResize);
|
|
174
175
|
return /*#__PURE__*/_jsx(SkeletonOverlay, _extends({
|
|
175
|
-
className: classes.root
|
|
176
|
-
ref: handleRef
|
|
176
|
+
className: classes.root
|
|
177
177
|
}, props, {
|
|
178
|
+
ref: handleRef,
|
|
178
179
|
children: children
|
|
179
180
|
}));
|
|
180
181
|
});
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { MenuItemProps } from '@mui/material/MenuItem';
|
|
2
|
+
import { GridSlotProps } from '../../models/gridSlotsComponentsProps';
|
|
4
3
|
interface GridActionsCellItemCommonProps {
|
|
5
4
|
label: string;
|
|
6
|
-
icon?: React.ReactElement
|
|
5
|
+
icon?: React.ReactElement<any>;
|
|
7
6
|
/** from https://mui.com/material-ui/api/button-base/#ButtonBase-prop-component */
|
|
8
7
|
component?: React.ElementType;
|
|
9
8
|
}
|
|
10
9
|
export type GridActionsCellItemProps = GridActionsCellItemCommonProps & (({
|
|
11
10
|
showInMenu?: false;
|
|
12
|
-
icon: React.ReactElement
|
|
13
|
-
} & Omit<
|
|
11
|
+
icon: React.ReactElement<any>;
|
|
12
|
+
} & Omit<GridSlotProps['baseIconButton'], 'component'>) | ({
|
|
14
13
|
showInMenu: true;
|
|
15
14
|
/**
|
|
16
15
|
* If false, the menu will not close when this item is clicked.
|
|
@@ -18,11 +17,17 @@ export type GridActionsCellItemProps = GridActionsCellItemCommonProps & (({
|
|
|
18
17
|
*/
|
|
19
18
|
closeMenuOnClick?: boolean;
|
|
20
19
|
closeMenu?: () => void;
|
|
21
|
-
} & Omit<
|
|
22
|
-
declare const GridActionsCellItem: React.ForwardRefExoticComponent<(Omit<GridActionsCellItemCommonProps & {
|
|
20
|
+
} & Omit<GridSlotProps['baseMenuItem'], 'component'>));
|
|
21
|
+
declare const GridActionsCellItem: React.ForwardRefExoticComponent<GridActionsCellItemProps> | React.ForwardRefExoticComponent<(Omit<GridActionsCellItemCommonProps & {
|
|
23
22
|
showInMenu?: false;
|
|
24
|
-
icon: React.ReactElement
|
|
25
|
-
} & Omit<
|
|
23
|
+
icon: React.ReactElement<any>;
|
|
24
|
+
} & Omit<Omit<import("../../models/gridBaseSlots").ButtonProps, "startIcon"> & {
|
|
25
|
+
label?: string;
|
|
26
|
+
color?: "default" | "inherit" | "primary";
|
|
27
|
+
edge?: "start" | "end" | false;
|
|
28
|
+
} & import("../..").BaseIconButtonPropsOverrides & import("@mui/material").IconButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "children" | "tabIndex" | "className" | "style" | "classes" | "color" | "sx" | "disabled" | "size" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "edge"> & {
|
|
29
|
+
component?: React.ElementType;
|
|
30
|
+
}, "component">, "ref"> | Omit<GridActionsCellItemCommonProps & {
|
|
26
31
|
showInMenu: true;
|
|
27
32
|
/**
|
|
28
33
|
* If false, the menu will not close when this item is clicked.
|
|
@@ -30,5 +35,7 @@ declare const GridActionsCellItem: React.ForwardRefExoticComponent<(Omit<GridAct
|
|
|
30
35
|
*/
|
|
31
36
|
closeMenuOnClick?: boolean;
|
|
32
37
|
closeMenu?: () => void;
|
|
33
|
-
} & Omit<MenuItemProps, "
|
|
38
|
+
} & Omit<import("../../models/gridBaseSlots").MenuItemProps & import("../..").BaseMenuItemPropsOverrides & import("@mui/material").MenuItemOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "children" | "tabIndex" | "className" | "style" | "classes" | "sx" | "autoFocus" | "disabled" | "dense" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableGutters" | "divider" | "selected"> & {
|
|
39
|
+
component?: React.ElementType;
|
|
40
|
+
}, "component">, "ref">) & React.RefAttributes<HTMLElement>>;
|
|
34
41
|
export { GridActionsCellItem };
|
|
@@ -4,9 +4,12 @@ const _excluded = ["label", "icon", "showInMenu", "onClick"],
|
|
|
4
4
|
_excluded2 = ["label", "icon", "showInMenu", "onClick", "closeMenuOnClick", "closeMenu"];
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
|
+
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
7
8
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
9
|
+
|
|
10
|
+
// FIXME(v8:romgrk): Make parametric
|
|
8
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
-
const GridActionsCellItem =
|
|
12
|
+
const GridActionsCellItem = forwardRef((props, ref) => {
|
|
10
13
|
const rootProps = useGridRootProps();
|
|
11
14
|
if (!props.showInMenu) {
|
|
12
15
|
const {
|
|
@@ -19,13 +22,13 @@ const GridActionsCellItem = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
19
22
|
onClick?.(event);
|
|
20
23
|
};
|
|
21
24
|
return /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({
|
|
22
|
-
ref: ref,
|
|
23
25
|
size: "small",
|
|
24
26
|
role: "menuitem",
|
|
25
27
|
"aria-label": label
|
|
26
28
|
}, other, {
|
|
27
29
|
onClick: handleClick
|
|
28
30
|
}, rootProps.slotProps?.baseIconButton, {
|
|
31
|
+
ref: ref,
|
|
29
32
|
children: /*#__PURE__*/React.cloneElement(icon, {
|
|
30
33
|
fontSize: 'small'
|
|
31
34
|
})
|
|
@@ -46,7 +46,7 @@ export type GridCellProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
|
46
46
|
style?: React.CSSProperties;
|
|
47
47
|
[x: `data-${string}`]: string;
|
|
48
48
|
};
|
|
49
|
-
declare const MemoizedGridCell: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
49
|
+
declare const MemoizedGridCell: React.ForwardRefExoticComponent<GridCellProps> | React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
50
50
|
[x: `data-${string}`]: string;
|
|
51
51
|
align: GridAlignment;
|
|
52
52
|
className?: string;
|
|
@@ -8,6 +8,7 @@ import clsx from 'clsx';
|
|
|
8
8
|
import { unstable_useForkRef as useForkRef, unstable_composeClasses as composeClasses, unstable_ownerDocument as ownerDocument, unstable_capitalize as capitalize } from '@mui/utils';
|
|
9
9
|
import { fastMemo } from '@mui/x-internals/fastMemo';
|
|
10
10
|
import { useRtl } from '@mui/system/RtlProvider';
|
|
11
|
+
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
11
12
|
import { doesSupportPreventScroll } from "../../utils/doesSupportPreventScroll.js";
|
|
12
13
|
import { getDataGridUtilityClass, gridClasses } from "../../constants/gridClasses.js";
|
|
13
14
|
import { GridCellModes } from "../../models/index.js";
|
|
@@ -76,7 +77,7 @@ let warnedOnce = false;
|
|
|
76
77
|
|
|
77
78
|
// TODO(v7): Removing the wrapper will break the docs performance visualization demo.
|
|
78
79
|
|
|
79
|
-
const GridCell =
|
|
80
|
+
const GridCell = forwardRef(function GridCell(props, ref) {
|
|
80
81
|
const {
|
|
81
82
|
column,
|
|
82
83
|
rowId,
|
|
@@ -313,7 +314,6 @@ const GridCell = /*#__PURE__*/React.forwardRef(function GridCell(props, ref) {
|
|
|
313
314
|
onDragOver: publish('cellDragOver', onDragOver)
|
|
314
315
|
};
|
|
315
316
|
return /*#__PURE__*/_jsx("div", _extends({
|
|
316
|
-
ref: handleRef,
|
|
317
317
|
className: clsx(classes.root, classNames, className),
|
|
318
318
|
role: "gridcell",
|
|
319
319
|
"data-field": field,
|
|
@@ -333,6 +333,7 @@ const GridCell = /*#__PURE__*/React.forwardRef(function GridCell(props, ref) {
|
|
|
333
333
|
onKeyUp: publish('cellKeyUp', onKeyUp)
|
|
334
334
|
}, draggableEventHandlers, other, {
|
|
335
335
|
onFocus: handleFocus,
|
|
336
|
+
ref: handleRef,
|
|
336
337
|
children: children
|
|
337
338
|
}));
|
|
338
339
|
});
|
|
@@ -35,7 +35,7 @@ function GridEditDateCell(props) {
|
|
|
35
35
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
36
36
|
const isDateTime = colDef.type === 'dateTime';
|
|
37
37
|
const apiRef = useGridApiContext();
|
|
38
|
-
const inputRef = React.useRef();
|
|
38
|
+
const inputRef = React.useRef(null);
|
|
39
39
|
const valueTransformed = React.useMemo(() => {
|
|
40
40
|
let parsedDate;
|
|
41
41
|
if (valueProp == null) {
|
|
@@ -11,6 +11,6 @@ export interface GridEditInputCellProps extends GridRenderEditCellParams, Omit<I
|
|
|
11
11
|
*/
|
|
12
12
|
onValueChange?: (event: React.ChangeEvent<HTMLInputElement>, newValue: string) => Promise<void> | void;
|
|
13
13
|
}
|
|
14
|
-
declare const GridEditInputCell: React.ForwardRefExoticComponent<Omit<GridEditInputCellProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
14
|
+
declare const GridEditInputCell: React.ForwardRefExoticComponent<GridEditInputCellProps> | React.ForwardRefExoticComponent<Omit<GridEditInputCellProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
15
15
|
export { GridEditInputCell };
|
|
16
16
|
export declare const renderEditInputCell: (params: GridEditInputCellProps) => React.JSX.Element;
|
|
@@ -2,9 +2,11 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
3
|
const _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "hasFocus", "isValidating", "debounceMs", "isProcessingProps", "onValueChange"];
|
|
4
4
|
import * as React from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
5
6
|
import { unstable_composeClasses as composeClasses, unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';
|
|
6
7
|
import { styled } from '@mui/material/styles';
|
|
7
8
|
import InputBase from '@mui/material/InputBase';
|
|
9
|
+
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
8
10
|
import { getDataGridUtilityClass } from "../../constants/gridClasses.js";
|
|
9
11
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
10
12
|
import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
|
|
@@ -31,7 +33,7 @@ const GridEditInputCellRoot = styled(InputBase, {
|
|
|
31
33
|
height: '100%'
|
|
32
34
|
}
|
|
33
35
|
}));
|
|
34
|
-
const GridEditInputCell =
|
|
36
|
+
const GridEditInputCell = forwardRef((props, ref) => {
|
|
35
37
|
const rootProps = useGridRootProps();
|
|
36
38
|
const {
|
|
37
39
|
id,
|
|
@@ -45,7 +47,7 @@ const GridEditInputCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
45
47
|
} = props,
|
|
46
48
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
47
49
|
const apiRef = useGridApiContext();
|
|
48
|
-
const inputRef = React.useRef();
|
|
50
|
+
const inputRef = React.useRef(null);
|
|
49
51
|
const [valueState, setValueState] = React.useState(value);
|
|
50
52
|
const classes = useUtilityClasses(rootProps);
|
|
51
53
|
const handleChange = React.useCallback(async event => {
|
|
@@ -79,7 +81,6 @@ const GridEditInputCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
79
81
|
}
|
|
80
82
|
}, [hasFocus]);
|
|
81
83
|
return /*#__PURE__*/_jsx(GridEditInputCellRoot, _extends({
|
|
82
|
-
ref: ref,
|
|
83
84
|
inputRef: inputRef,
|
|
84
85
|
className: classes.root,
|
|
85
86
|
ownerState: rootProps,
|
|
@@ -91,7 +92,75 @@ const GridEditInputCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
91
92
|
fontSize: "small",
|
|
92
93
|
color: "action"
|
|
93
94
|
}) : undefined
|
|
94
|
-
}, other
|
|
95
|
+
}, other, {
|
|
96
|
+
ref: ref
|
|
97
|
+
}));
|
|
95
98
|
});
|
|
99
|
+
process.env.NODE_ENV !== "production" ? GridEditInputCell.propTypes = {
|
|
100
|
+
// ----------------------------- Warning --------------------------------
|
|
101
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
102
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
103
|
+
// ----------------------------------------------------------------------
|
|
104
|
+
/**
|
|
105
|
+
* GridApi that let you manipulate the grid.
|
|
106
|
+
*/
|
|
107
|
+
api: PropTypes.object.isRequired,
|
|
108
|
+
/**
|
|
109
|
+
* The mode of the cell.
|
|
110
|
+
*/
|
|
111
|
+
cellMode: PropTypes.oneOf(['edit', 'view']).isRequired,
|
|
112
|
+
changeReason: PropTypes.oneOf(['debouncedSetEditCellValue', 'setEditCellValue']),
|
|
113
|
+
/**
|
|
114
|
+
* The column of the row that the current cell belongs to.
|
|
115
|
+
*/
|
|
116
|
+
colDef: PropTypes.object.isRequired,
|
|
117
|
+
debounceMs: PropTypes.number,
|
|
118
|
+
/**
|
|
119
|
+
* The column field of the cell that triggered the event.
|
|
120
|
+
*/
|
|
121
|
+
field: PropTypes.string.isRequired,
|
|
122
|
+
/**
|
|
123
|
+
* The cell value formatted with the column valueFormatter.
|
|
124
|
+
*/
|
|
125
|
+
formattedValue: PropTypes.any,
|
|
126
|
+
/**
|
|
127
|
+
* If true, the cell is the active element.
|
|
128
|
+
*/
|
|
129
|
+
hasFocus: PropTypes.bool.isRequired,
|
|
130
|
+
/**
|
|
131
|
+
* The grid row id.
|
|
132
|
+
*/
|
|
133
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
134
|
+
/**
|
|
135
|
+
* If true, the cell is editable.
|
|
136
|
+
*/
|
|
137
|
+
isEditable: PropTypes.bool,
|
|
138
|
+
isProcessingProps: PropTypes.bool,
|
|
139
|
+
isValidating: PropTypes.bool,
|
|
140
|
+
/**
|
|
141
|
+
* Callback called when the value is changed by the user.
|
|
142
|
+
* @param {React.ChangeEvent<HTMLInputElement>} event The event source of the callback.
|
|
143
|
+
* @param {Date | null} newValue The value that is going to be passed to `apiRef.current.setEditCellValue`.
|
|
144
|
+
* @returns {Promise<void> | void} A promise to be awaited before calling `apiRef.current.setEditCellValue`
|
|
145
|
+
*/
|
|
146
|
+
onValueChange: PropTypes.func,
|
|
147
|
+
/**
|
|
148
|
+
* The row model of the row that the current cell belongs to.
|
|
149
|
+
*/
|
|
150
|
+
row: PropTypes.any.isRequired,
|
|
151
|
+
/**
|
|
152
|
+
* The node of the row that the current cell belongs to.
|
|
153
|
+
*/
|
|
154
|
+
rowNode: PropTypes.object.isRequired,
|
|
155
|
+
/**
|
|
156
|
+
* the tabIndex value.
|
|
157
|
+
*/
|
|
158
|
+
tabIndex: PropTypes.oneOf([-1, 0]).isRequired,
|
|
159
|
+
/**
|
|
160
|
+
* The cell value.
|
|
161
|
+
* If the column has `valueGetter`, use `params.row` to directly access the fields.
|
|
162
|
+
*/
|
|
163
|
+
value: PropTypes.any
|
|
164
|
+
} : void 0;
|
|
96
165
|
export { GridEditInputCell };
|
|
97
166
|
export const renderEditInputCell = params => /*#__PURE__*/_jsx(GridEditInputCell, _extends({}, params));
|
|
@@ -30,8 +30,8 @@ function GridEditSingleSelectCell(props) {
|
|
|
30
30
|
} = props,
|
|
31
31
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
32
32
|
const apiRef = useGridApiContext();
|
|
33
|
-
const ref = React.useRef();
|
|
34
|
-
const inputRef = React.useRef();
|
|
33
|
+
const ref = React.useRef(null);
|
|
34
|
+
const inputRef = React.useRef(null);
|
|
35
35
|
const [open, setOpen] = React.useState(initialOpen);
|
|
36
36
|
const baseSelectProps = rootProps.slotProps?.baseSelect || {};
|
|
37
37
|
const isSelectNative = baseSelectProps.native ?? false;
|
|
@@ -4,7 +4,6 @@ const _excluded = ["field", "type", "align", "width", "height", "empty", "style"
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
|
-
import Skeleton from '@mui/material/Skeleton';
|
|
8
7
|
import { unstable_composeClasses as composeClasses, unstable_capitalize as capitalize } from '@mui/utils';
|
|
9
8
|
import { fastMemo } from '@mui/x-internals/fastMemo';
|
|
10
9
|
import { createRandomNumberGenerator } from "../../utils/utils.js";
|
|
@@ -82,7 +81,7 @@ function GridSkeletonCell(props) {
|
|
|
82
81
|
minWidth: width
|
|
83
82
|
}, style)
|
|
84
83
|
}, other, {
|
|
85
|
-
children: !empty && /*#__PURE__*/_jsx(
|
|
84
|
+
children: !empty && /*#__PURE__*/_jsx(rootProps.slots.baseSkeleton, _extends({}, skeletonProps))
|
|
86
85
|
}));
|
|
87
86
|
}
|
|
88
87
|
process.env.NODE_ENV !== "production" ? GridSkeletonCell.propTypes = {
|
|
@@ -5,6 +5,6 @@ export interface ColumnHeaderMenuIconProps {
|
|
|
5
5
|
columnMenuId: string;
|
|
6
6
|
columnMenuButtonId: string;
|
|
7
7
|
open: boolean;
|
|
8
|
-
iconButtonRef: React.RefObject<HTMLButtonElement>;
|
|
8
|
+
iconButtonRef: React.RefObject<HTMLButtonElement | null>;
|
|
9
9
|
}
|
|
10
10
|
export declare const ColumnHeaderMenuIcon: React.MemoExoticComponent<(props: ColumnHeaderMenuIconProps) => React.JSX.Element>;
|
|
@@ -3,5 +3,5 @@ import { SxProps, Theme } from '@mui/system';
|
|
|
3
3
|
interface GridBaseColumnHeadersProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
sx?: SxProps<Theme>;
|
|
5
5
|
}
|
|
6
|
-
export declare const GridBaseColumnHeaders: React.ForwardRefExoticComponent<GridBaseColumnHeadersProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
export declare const GridBaseColumnHeaders: React.ForwardRefExoticComponent<GridBaseColumnHeadersProps> | React.ForwardRefExoticComponent<GridBaseColumnHeadersProps & React.RefAttributes<HTMLDivElement>>;
|
|
7
7
|
export {};
|
|
@@ -5,6 +5,7 @@ import * as React from 'react';
|
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import composeClasses from '@mui/utils/composeClasses';
|
|
7
7
|
import { styled } from '@mui/system';
|
|
8
|
+
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
8
9
|
import { getDataGridUtilityClass } from "../../constants/gridClasses.js";
|
|
9
10
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
10
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -27,7 +28,7 @@ const GridColumnHeadersRoot = styled('div', {
|
|
|
27
28
|
borderTopLeftRadius: 'var(--unstable_DataGrid-radius)',
|
|
28
29
|
borderTopRightRadius: 'var(--unstable_DataGrid-radius)'
|
|
29
30
|
});
|
|
30
|
-
export const GridBaseColumnHeaders =
|
|
31
|
+
export const GridBaseColumnHeaders = forwardRef(function GridColumnHeaders(props, ref) {
|
|
31
32
|
const {
|
|
32
33
|
className
|
|
33
34
|
} = props,
|
|
@@ -35,10 +36,10 @@ export const GridBaseColumnHeaders = /*#__PURE__*/React.forwardRef(function Grid
|
|
|
35
36
|
const rootProps = useGridRootProps();
|
|
36
37
|
const classes = useUtilityClasses(rootProps);
|
|
37
38
|
return /*#__PURE__*/_jsx(GridColumnHeadersRoot, _extends({
|
|
38
|
-
ref: ref,
|
|
39
39
|
className: clsx(classes.root, className),
|
|
40
40
|
ownerState: rootProps
|
|
41
41
|
}, other, {
|
|
42
|
-
role: "presentation"
|
|
42
|
+
role: "presentation",
|
|
43
|
+
ref: ref
|
|
43
44
|
}));
|
|
44
45
|
});
|
|
@@ -57,7 +57,6 @@ function GridColumnHeaderFilterIconButton(props) {
|
|
|
57
57
|
const iconButton = /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({
|
|
58
58
|
id: labelId,
|
|
59
59
|
onClick: toggleFilter,
|
|
60
|
-
color: "default",
|
|
61
60
|
"aria-label": apiRef.current.getLocaleText('columnHeaderFiltersLabel'),
|
|
62
61
|
size: "small",
|
|
63
62
|
tabIndex: -1,
|
|
@@ -6,6 +6,7 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import composeClasses from '@mui/utils/composeClasses';
|
|
8
8
|
import { styled } from '@mui/system';
|
|
9
|
+
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
9
10
|
import { isOverflown } from "../../utils/domUtils.js";
|
|
10
11
|
import { getDataGridUtilityClass } from "../../constants/gridClasses.js";
|
|
11
12
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
@@ -30,7 +31,7 @@ const GridColumnHeaderTitleRoot = styled('div', {
|
|
|
30
31
|
fontWeight: 'var(--unstable_DataGrid-headWeight)',
|
|
31
32
|
lineHeight: 'normal'
|
|
32
33
|
});
|
|
33
|
-
const ColumnHeaderInnerTitle =
|
|
34
|
+
const ColumnHeaderInnerTitle = forwardRef(function ColumnHeaderInnerTitle(props, ref) {
|
|
34
35
|
// Tooltip adds aria-label to the props, which is not needed since the children prop is a string
|
|
35
36
|
// See https://github.com/mui/mui-x/pull/14482
|
|
36
37
|
const {
|
|
@@ -40,10 +41,11 @@ const ColumnHeaderInnerTitle = /*#__PURE__*/React.forwardRef(function ColumnHead
|
|
|
40
41
|
const rootProps = useGridRootProps();
|
|
41
42
|
const classes = useUtilityClasses(rootProps);
|
|
42
43
|
return /*#__PURE__*/_jsx(GridColumnHeaderTitleRoot, _extends({
|
|
43
|
-
ref: ref,
|
|
44
44
|
className: clsx(classes.root, className),
|
|
45
45
|
ownerState: rootProps
|
|
46
|
-
}, other
|
|
46
|
+
}, other, {
|
|
47
|
+
ref: ref
|
|
48
|
+
}));
|
|
47
49
|
});
|
|
48
50
|
// No React.memo here as if we display the sort icon, we need to recalculate the isOver
|
|
49
51
|
function GridColumnHeaderTitle(props) {
|
|
@@ -28,5 +28,5 @@ interface GridGenericColumnHeaderItemProps extends Pick<GridStateColDef, 'header
|
|
|
28
28
|
columnHeaderSeparatorProps?: Partial<GridColumnHeaderSeparatorProps>;
|
|
29
29
|
style?: React.CSSProperties;
|
|
30
30
|
}
|
|
31
|
-
declare const GridGenericColumnHeaderItem: React.ForwardRefExoticComponent<GridGenericColumnHeaderItemProps & React.RefAttributes<
|
|
31
|
+
declare const GridGenericColumnHeaderItem: React.ForwardRefExoticComponent<GridGenericColumnHeaderItemProps> | React.ForwardRefExoticComponent<GridGenericColumnHeaderItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
32
32
|
export { GridGenericColumnHeaderItem };
|
|
@@ -4,12 +4,13 @@ const _excluded = ["classes", "columnMenuOpen", "colIndex", "height", "isResizin
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import { unstable_useForkRef as useForkRef } from '@mui/utils';
|
|
7
|
+
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
7
8
|
import { useGridPrivateApiContext } from "../../hooks/utils/useGridPrivateApiContext.js";
|
|
8
9
|
import { GridColumnHeaderTitle } from "./GridColumnHeaderTitle.js";
|
|
9
10
|
import { GridColumnHeaderSeparator } from "./GridColumnHeaderSeparator.js";
|
|
10
11
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
11
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
-
const GridGenericColumnHeaderItem =
|
|
13
|
+
const GridGenericColumnHeaderItem = forwardRef(function GridGenericColumnHeaderItem(props, ref) {
|
|
13
14
|
const {
|
|
14
15
|
classes,
|
|
15
16
|
colIndex,
|
|
@@ -54,7 +55,6 @@ const GridGenericColumnHeaderItem = /*#__PURE__*/React.forwardRef(function GridG
|
|
|
54
55
|
}
|
|
55
56
|
}, [apiRef, hasFocus]);
|
|
56
57
|
return /*#__PURE__*/_jsxs("div", _extends({
|
|
57
|
-
ref: handleRef,
|
|
58
58
|
className: clsx(classes.root, headerClassName),
|
|
59
59
|
style: _extends({}, style, {
|
|
60
60
|
height,
|
|
@@ -65,6 +65,7 @@ const GridGenericColumnHeaderItem = /*#__PURE__*/React.forwardRef(function GridG
|
|
|
65
65
|
"aria-colindex": colIndex + 1,
|
|
66
66
|
"aria-sort": ariaSort
|
|
67
67
|
}, other, {
|
|
68
|
+
ref: handleRef,
|
|
68
69
|
children: [/*#__PURE__*/_jsxs("div", _extends({
|
|
69
70
|
className: classes.draggableContainer,
|
|
70
71
|
draggable: isDraggable,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export type GridIconButtonContainerProps = React.HTMLAttributes<HTMLDivElement>;
|
|
3
|
-
export declare const GridIconButtonContainer: React.ForwardRefExoticComponent<GridIconButtonContainerProps & React.RefAttributes<HTMLDivElement>>;
|
|
3
|
+
export declare const GridIconButtonContainer: React.ForwardRefExoticComponent<GridIconButtonContainerProps> | React.ForwardRefExoticComponent<GridIconButtonContainerProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -5,6 +5,7 @@ import * as React from 'react';
|
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import composeClasses from '@mui/utils/composeClasses';
|
|
7
7
|
import { styled } from '@mui/system';
|
|
8
|
+
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
8
9
|
import { getDataGridUtilityClass } from "../../constants/gridClasses.js";
|
|
9
10
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
10
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -26,7 +27,7 @@ const GridIconButtonContainerRoot = styled('div', {
|
|
|
26
27
|
visibility: 'hidden',
|
|
27
28
|
width: 0
|
|
28
29
|
}));
|
|
29
|
-
export const GridIconButtonContainer =
|
|
30
|
+
export const GridIconButtonContainer = forwardRef(function GridIconButtonContainer(props, ref) {
|
|
30
31
|
const {
|
|
31
32
|
className
|
|
32
33
|
} = props,
|
|
@@ -34,8 +35,9 @@ export const GridIconButtonContainer = /*#__PURE__*/React.forwardRef(function Gr
|
|
|
34
35
|
const rootProps = useGridRootProps();
|
|
35
36
|
const classes = useUtilityClasses(rootProps);
|
|
36
37
|
return /*#__PURE__*/_jsx(GridIconButtonContainerRoot, _extends({
|
|
37
|
-
ref: ref,
|
|
38
38
|
className: clsx(classes.root, className),
|
|
39
39
|
ownerState: rootProps
|
|
40
|
-
}, other
|
|
40
|
+
}, other, {
|
|
41
|
+
ref: ref
|
|
42
|
+
}));
|
|
41
43
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { GridRenderCellParams } from '../../models/params/gridCellParams';
|
|
3
|
-
declare const GridCellCheckboxForwardRef: React.ForwardRefExoticComponent<GridRenderCellParams<any, any, any, import("../..").GridTreeNodeWithRender> & React.RefAttributes<HTMLInputElement>>;
|
|
3
|
+
declare const GridCellCheckboxForwardRef: React.ForwardRefExoticComponent<GridRenderCellParams<any, any, any, import("../..").GridTreeNodeWithRender>> | React.ForwardRefExoticComponent<GridRenderCellParams<any, any, any, import("../..").GridTreeNodeWithRender> & React.RefAttributes<HTMLInputElement>>;
|
|
4
4
|
export { GridCellCheckboxForwardRef };
|
|
5
|
-
export declare const GridCellCheckboxRenderer: React.ForwardRefExoticComponent<GridRenderCellParams<any, any, any, import("../..").GridTreeNodeWithRender> & React.RefAttributes<HTMLInputElement>>;
|
|
5
|
+
export declare const GridCellCheckboxRenderer: React.ForwardRefExoticComponent<GridRenderCellParams<any, any, any, import("../..").GridTreeNodeWithRender>> | React.ForwardRefExoticComponent<GridRenderCellParams<any, any, any, import("../..").GridTreeNodeWithRender> & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -4,6 +4,7 @@ const _excluded = ["field", "id", "formattedValue", "row", "rowNode", "colDef",
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { unstable_composeClasses as composeClasses, unstable_useForkRef as useForkRef } from '@mui/utils';
|
|
7
|
+
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
7
8
|
import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
|
|
8
9
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
9
10
|
import { getDataGridUtilityClass } from "../../constants/gridClasses.js";
|
|
@@ -19,7 +20,7 @@ const useUtilityClasses = ownerState => {
|
|
|
19
20
|
};
|
|
20
21
|
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
21
22
|
};
|
|
22
|
-
const GridCellCheckboxForwardRef =
|
|
23
|
+
const GridCellCheckboxForwardRef = forwardRef(function GridCellCheckboxRenderer(props, ref) {
|
|
23
24
|
const {
|
|
24
25
|
field,
|
|
25
26
|
id,
|
|
@@ -81,19 +82,21 @@ const GridCellCheckboxForwardRef = /*#__PURE__*/React.forwardRef(function GridCe
|
|
|
81
82
|
}
|
|
82
83
|
const label = apiRef.current.getLocaleText(isChecked && !isIndeterminate ? 'checkboxSelectionUnselectRow' : 'checkboxSelectionSelectRow');
|
|
83
84
|
return /*#__PURE__*/_jsx(rootProps.slots.baseCheckbox, _extends({
|
|
84
|
-
ref: handleRef,
|
|
85
85
|
tabIndex: tabIndex,
|
|
86
86
|
checked: isChecked && !isIndeterminate,
|
|
87
87
|
onChange: handleChange,
|
|
88
88
|
className: classes.root,
|
|
89
89
|
inputProps: {
|
|
90
|
-
'aria-label': label
|
|
90
|
+
'aria-label': label,
|
|
91
|
+
name: 'select_row'
|
|
91
92
|
},
|
|
92
93
|
onKeyDown: handleKeyDown,
|
|
93
94
|
indeterminate: isIndeterminate,
|
|
94
95
|
disabled: !isSelectable,
|
|
95
96
|
touchRippleRef: rippleRef /* FIXME: typing error */
|
|
96
|
-
}, rootProps.slotProps?.baseCheckbox, other
|
|
97
|
+
}, rootProps.slotProps?.baseCheckbox, other, {
|
|
98
|
+
ref: handleRef
|
|
99
|
+
}));
|
|
97
100
|
});
|
|
98
101
|
process.env.NODE_ENV !== "production" ? GridCellCheckboxForwardRef.propTypes = {
|
|
99
102
|
// ----------------------------- Warning --------------------------------
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { GridColumnHeaderParams } from '../../models/params/gridColumnHeaderParams';
|
|
3
|
-
declare const GridHeaderCheckbox: React.ForwardRefExoticComponent<GridColumnHeaderParams<import("../..").GridValidRowModel, any, any> & React.RefAttributes<HTMLButtonElement>>;
|
|
3
|
+
declare const GridHeaderCheckbox: React.ForwardRefExoticComponent<GridColumnHeaderParams<import("../..").GridValidRowModel, any, any>> | React.ForwardRefExoticComponent<GridColumnHeaderParams<import("../..").GridValidRowModel, any, any> & React.RefAttributes<HTMLButtonElement>>;
|
|
4
4
|
export { GridHeaderCheckbox };
|
|
@@ -4,6 +4,7 @@ const _excluded = ["field", "colDef"];
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import composeClasses from '@mui/utils/composeClasses';
|
|
7
|
+
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
7
8
|
import { isMultipleRowSelectionEnabled } from "../../hooks/features/rowSelection/utils.js";
|
|
8
9
|
import { useGridSelector } from "../../hooks/utils/useGridSelector.js";
|
|
9
10
|
import { gridTabIndexColumnHeaderSelector } from "../../hooks/features/focus/gridFocusStateSelector.js";
|
|
@@ -23,7 +24,7 @@ const useUtilityClasses = ownerState => {
|
|
|
23
24
|
};
|
|
24
25
|
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
25
26
|
};
|
|
26
|
-
const GridHeaderCheckbox =
|
|
27
|
+
const GridHeaderCheckbox = forwardRef(function GridHeaderCheckbox(props, ref) {
|
|
27
28
|
const other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
28
29
|
const [, forceUpdate] = React.useState(false);
|
|
29
30
|
const apiRef = useGridApiContext();
|
|
@@ -41,13 +42,16 @@ const GridHeaderCheckbox = /*#__PURE__*/React.forwardRef(function GridHeaderChec
|
|
|
41
42
|
return selection;
|
|
42
43
|
}
|
|
43
44
|
return selection.filter(id => {
|
|
45
|
+
if (rootProps.keepNonExistentRowsSelected) {
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
44
48
|
// The row might have been deleted
|
|
45
49
|
if (!apiRef.current.getRow(id)) {
|
|
46
50
|
return false;
|
|
47
51
|
}
|
|
48
52
|
return rootProps.isRowSelectable(apiRef.current.getRowParams(id));
|
|
49
53
|
});
|
|
50
|
-
}, [apiRef, rootProps.isRowSelectable, selection]);
|
|
54
|
+
}, [apiRef, rootProps.isRowSelectable, selection, rootProps.keepNonExistentRowsSelected]);
|
|
51
55
|
|
|
52
56
|
// All the rows that could be selected / unselected by toggling this checkbox
|
|
53
57
|
const selectionCandidates = React.useMemo(() => {
|
|
@@ -97,18 +101,20 @@ const GridHeaderCheckbox = /*#__PURE__*/React.forwardRef(function GridHeaderChec
|
|
|
97
101
|
}, [apiRef, handleSelectionChange]);
|
|
98
102
|
const label = apiRef.current.getLocaleText(isChecked && !isIndeterminate ? 'checkboxSelectionUnselectAllRows' : 'checkboxSelectionSelectAllRows');
|
|
99
103
|
return /*#__PURE__*/_jsx(rootProps.slots.baseCheckbox, _extends({
|
|
100
|
-
ref: ref,
|
|
101
104
|
indeterminate: isIndeterminate,
|
|
102
105
|
checked: isChecked && !isIndeterminate,
|
|
103
106
|
onChange: handleChange,
|
|
104
107
|
className: classes.root,
|
|
105
108
|
inputProps: {
|
|
106
|
-
'aria-label': label
|
|
109
|
+
'aria-label': label,
|
|
110
|
+
name: 'select_all_rows'
|
|
107
111
|
},
|
|
108
112
|
tabIndex: tabIndex,
|
|
109
113
|
onKeyDown: handleKeyDown,
|
|
110
114
|
disabled: !isMultipleRowSelectionEnabled(rootProps)
|
|
111
|
-
}, rootProps.slotProps?.baseCheckbox, other
|
|
115
|
+
}, rootProps.slotProps?.baseCheckbox, other, {
|
|
116
|
+
ref: ref
|
|
117
|
+
}));
|
|
112
118
|
});
|
|
113
119
|
process.env.NODE_ENV !== "production" ? GridHeaderCheckbox.propTypes = {
|
|
114
120
|
// ----------------------------- Warning --------------------------------
|
|
@@ -140,11 +140,11 @@ function GridColumnsManagement(props) {
|
|
|
140
140
|
endAdornment: /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({
|
|
141
141
|
"aria-label": apiRef.current.getLocaleText('columnsManagementDeleteIconLabel'),
|
|
142
142
|
size: "small",
|
|
143
|
-
|
|
143
|
+
style: searchValue ? {
|
|
144
144
|
visibility: 'visible'
|
|
145
145
|
} : {
|
|
146
146
|
visibility: 'hidden'
|
|
147
|
-
}
|
|
147
|
+
},
|
|
148
148
|
tabIndex: -1,
|
|
149
149
|
onClick: handleSearchReset
|
|
150
150
|
}, rootProps.slotProps?.baseIconButton, {
|
|
@@ -3,7 +3,7 @@ import { SxProps, Theme } from '@mui/system';
|
|
|
3
3
|
export type GridFooterContainerProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
4
4
|
sx?: SxProps<Theme>;
|
|
5
5
|
};
|
|
6
|
-
declare const GridFooterContainer: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
6
|
+
declare const GridFooterContainer: React.ForwardRefExoticComponent<GridFooterContainerProps> | React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
7
7
|
sx?: SxProps<Theme>;
|
|
8
8
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
9
9
|
export { GridFooterContainer };
|