@mui/x-data-grid 8.10.2 → 8.11.1
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 +214 -13
- package/DataGrid/DataGrid.js +4 -2
- package/DataGrid/useDataGridComponent.d.ts +2 -1
- package/DataGrid/useDataGridComponent.js +2 -2
- package/colDef/gridDateColDef.js +7 -0
- package/components/GridColumnSortButton.js +1 -2
- package/components/GridColumnUnsortedIcon.d.ts +2 -3
- package/components/GridRow.js +11 -5
- package/components/cell/GridActionsCell.js +8 -4
- package/components/cell/GridCell.js +1 -1
- package/components/columnHeaders/GridColumnGroupHeader.js +13 -1
- package/components/columnHeaders/GridColumnHeaderItem.js +12 -3
- package/components/columnHeaders/GridGenericColumnHeaderItem.js +0 -14
- package/components/columnsManagement/GridColumnsManagement.js +7 -2
- package/components/containers/GridRootStyles.js +19 -6
- package/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +3 -2
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.d.ts +1 -1
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +6 -9
- package/components/panel/filterPanel/GridFilterInputSingleSelect.js +4 -10
- package/components/virtualization/GridVirtualScrollerRenderZone.js +3 -10
- package/esm/DataGrid/DataGrid.js +4 -2
- package/esm/DataGrid/useDataGridComponent.d.ts +2 -1
- package/esm/DataGrid/useDataGridComponent.js +2 -2
- package/esm/colDef/gridDateColDef.js +7 -0
- package/esm/components/GridColumnSortButton.js +1 -2
- package/esm/components/GridColumnUnsortedIcon.d.ts +2 -3
- package/esm/components/GridRow.js +12 -6
- package/esm/components/cell/GridActionsCell.js +8 -4
- package/esm/components/cell/GridCell.js +1 -1
- package/esm/components/columnHeaders/GridColumnGroupHeader.js +13 -1
- package/esm/components/columnHeaders/GridColumnHeaderItem.js +12 -3
- package/esm/components/columnHeaders/GridGenericColumnHeaderItem.js +0 -14
- package/esm/components/columnsManagement/GridColumnsManagement.js +6 -1
- package/esm/components/containers/GridRootStyles.js +19 -6
- package/esm/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +3 -2
- package/esm/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.d.ts +1 -1
- package/esm/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +6 -9
- package/esm/components/panel/filterPanel/GridFilterInputSingleSelect.js +4 -10
- package/esm/components/virtualization/GridVirtualScrollerRenderZone.js +3 -10
- package/esm/hooks/core/pipeProcessing/gridPipeProcessingApi.d.ts +15 -0
- package/esm/hooks/features/editing/useGridCellEditing.js +1 -1
- package/esm/hooks/features/editing/useGridRowEditing.js +1 -1
- package/esm/hooks/features/filter/gridFilterSelector.d.ts +9 -1
- package/esm/hooks/features/filter/gridFilterSelector.js +12 -0
- package/esm/hooks/features/pagination/useGridPaginationModel.js +2 -2
- package/esm/hooks/features/rows/useGridRows.d.ts +2 -1
- package/esm/hooks/features/rows/useGridRows.js +6 -34
- package/esm/hooks/features/rows/useGridRowsOverridableMethods.d.ts +6 -0
- package/esm/hooks/features/rows/useGridRowsOverridableMethods.js +43 -0
- package/esm/hooks/features/scroll/useGridScroll.js +1 -1
- package/esm/hooks/utils/useGridConfiguration.d.ts +3 -1
- package/esm/index.js +1 -1
- package/esm/internals/index.d.ts +2 -1
- package/esm/internals/index.js +2 -1
- package/esm/material/index.js +2 -0
- package/esm/models/api/gridParamsApi.d.ts +3 -3
- package/esm/models/colDef/gridColDef.d.ts +4 -2
- package/esm/models/configuration/gridConfiguration.d.ts +6 -4
- package/esm/models/configuration/gridRowConfiguration.d.ts +11 -1
- package/esm/models/gridIconSlotsComponent.d.ts +6 -0
- package/esm/models/props/DataGridProps.d.ts +1 -1
- package/esm/utils/cleanupTracking/FinalizationRegistryBasedCleanupTracking.js +0 -2
- package/hooks/core/pipeProcessing/gridPipeProcessingApi.d.ts +15 -0
- package/hooks/features/editing/useGridCellEditing.js +1 -1
- package/hooks/features/editing/useGridRowEditing.js +1 -1
- package/hooks/features/filter/gridFilterSelector.d.ts +9 -1
- package/hooks/features/filter/gridFilterSelector.js +13 -1
- package/hooks/features/pagination/useGridPaginationModel.js +2 -2
- package/hooks/features/rows/useGridRows.d.ts +2 -1
- package/hooks/features/rows/useGridRows.js +6 -34
- package/hooks/features/rows/useGridRowsOverridableMethods.d.ts +6 -0
- package/hooks/features/rows/useGridRowsOverridableMethods.js +52 -0
- package/hooks/features/scroll/useGridScroll.js +1 -1
- package/hooks/utils/useGridConfiguration.d.ts +3 -1
- package/index.js +1 -1
- package/internals/index.d.ts +2 -1
- package/internals/index.js +15 -0
- package/material/index.js +2 -0
- package/models/api/gridParamsApi.d.ts +3 -3
- package/models/colDef/gridColDef.d.ts +4 -2
- package/models/configuration/gridConfiguration.d.ts +6 -4
- package/models/configuration/gridRowConfiguration.d.ts +11 -1
- package/models/gridIconSlotsComponent.d.ts +6 -0
- package/models/props/DataGridProps.d.ts +1 -1
- package/package.json +6 -6
- package/utils/cleanupTracking/FinalizationRegistryBasedCleanupTracking.js +0 -2
|
@@ -547,6 +547,11 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
|
|
|
547
547
|
opacity: 0.5
|
|
548
548
|
}
|
|
549
549
|
},
|
|
550
|
+
// Hide the column separator when the column has border and it is not resizable
|
|
551
|
+
// In this case, this column separator may block interaction with the separator from the adjacent column that is resizable
|
|
552
|
+
[`& .${_gridClasses.gridClasses['columnHeader--withLeftBorder']} .${_gridClasses.gridClasses['columnSeparator--sideLeft']}:not(.${_gridClasses.gridClasses['columnSeparator--resizable']}), & .${_gridClasses.gridClasses['columnHeader--withRightBorder']} .${_gridClasses.gridClasses['columnSeparator--sideRight']}:not(.${_gridClasses.gridClasses['columnSeparator--resizable']})`]: {
|
|
553
|
+
display: 'none'
|
|
554
|
+
},
|
|
550
555
|
[`& .${_gridClasses.gridClasses['columnSeparator--sideLeft']}`]: {
|
|
551
556
|
left: columnSeparatorOffset
|
|
552
557
|
},
|
|
@@ -796,7 +801,7 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
|
|
|
796
801
|
[`& .${_gridClasses.gridClasses.rowReorderCellPlaceholder}`]: {
|
|
797
802
|
display: 'none'
|
|
798
803
|
},
|
|
799
|
-
[`& .${_gridClasses.gridClasses['columnHeader--dragging']}
|
|
804
|
+
[`& .${_gridClasses.gridClasses['columnHeader--dragging']}`]: {
|
|
800
805
|
background: _cssVariables.vars.colors.background.overlay,
|
|
801
806
|
padding: '0 12px',
|
|
802
807
|
borderRadius: 'var(--unstable_DataGrid-radius)',
|
|
@@ -806,8 +811,11 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
|
|
|
806
811
|
background: _cssVariables.vars.colors.background.overlay,
|
|
807
812
|
padding: '0 12px',
|
|
808
813
|
borderRadius: 'var(--unstable_DataGrid-radius)',
|
|
809
|
-
|
|
814
|
+
border: '1px solid var(--DataGrid-rowBorderColor)',
|
|
815
|
+
color: _cssVariables.vars.colors.foreground.base,
|
|
816
|
+
transform: 'translateZ(0)',
|
|
810
817
|
[`& .${_gridClasses.gridClasses.rowReorderCellPlaceholder}`]: {
|
|
818
|
+
padding: '0 6px',
|
|
811
819
|
display: 'flex'
|
|
812
820
|
}
|
|
813
821
|
},
|
|
@@ -883,6 +891,7 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
|
|
|
883
891
|
[`& .${_gridClasses.gridClasses['row--dropAbove']}`]: {
|
|
884
892
|
position: 'relative',
|
|
885
893
|
'&::before': {
|
|
894
|
+
pointerEvents: 'none',
|
|
886
895
|
content: '""',
|
|
887
896
|
position: 'absolute',
|
|
888
897
|
top: 0,
|
|
@@ -894,7 +903,9 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
|
|
|
894
903
|
},
|
|
895
904
|
[`& .${_gridClasses.gridClasses['row--dropBelow']}`]: {
|
|
896
905
|
position: 'relative',
|
|
897
|
-
'&::
|
|
906
|
+
'&::after': {
|
|
907
|
+
zIndex: 100,
|
|
908
|
+
pointerEvents: 'none',
|
|
898
909
|
content: '""',
|
|
899
910
|
position: 'absolute',
|
|
900
911
|
bottom: '-2px',
|
|
@@ -904,14 +915,16 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
|
|
|
904
915
|
backgroundColor: _cssVariables.vars.colors.interactive.selected
|
|
905
916
|
},
|
|
906
917
|
[`&.${_gridClasses.gridClasses['row--lastVisible']}`]: {
|
|
907
|
-
'&::
|
|
918
|
+
'&::after': {
|
|
908
919
|
bottom: 'calc(var(--DataGrid-hasScrollY) * 0px + (1 - var(--DataGrid-hasScrollY)) * -2px)'
|
|
909
920
|
}
|
|
910
921
|
}
|
|
911
922
|
},
|
|
912
923
|
[`& .${_gridClasses.gridClasses['row--beingDragged']}`]: {
|
|
913
|
-
|
|
914
|
-
|
|
924
|
+
color: _cssVariables.vars.colors.foreground.disabled,
|
|
925
|
+
'&:hover': {
|
|
926
|
+
backgroundColor: 'transparent'
|
|
927
|
+
}
|
|
915
928
|
}
|
|
916
929
|
};
|
|
917
930
|
return gridStyle;
|
|
@@ -32,8 +32,9 @@ function GridColumnMenuSortItem(props) {
|
|
|
32
32
|
const onSortMenuItemClick = React.useCallback(event => {
|
|
33
33
|
onClick(event);
|
|
34
34
|
const direction = event.currentTarget.getAttribute('data-value') || null;
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
const allowMultipleSorting = rootProps.multipleColumnsSortingMode === 'always';
|
|
36
|
+
apiRef.current.sortColumn(colDef.field, direction === sortDirection ? null : direction, allowMultipleSorting);
|
|
37
|
+
}, [apiRef, colDef, onClick, sortDirection, rootProps.multipleColumnsSortingMode]);
|
|
37
38
|
if (rootProps.disableColumnSorting || !colDef || !colDef.sortable || !sortingOrder.some(item => !!item)) {
|
|
38
39
|
return null;
|
|
39
40
|
}
|
|
@@ -5,7 +5,7 @@ import type { ValueOptions } from "../../../models/colDef/gridColDef.js";
|
|
|
5
5
|
export type GridFilterInputMultipleSingleSelectProps = GridFilterInputValueProps<Omit<AutocompleteProps<ValueOptions, true, false, true>, 'options'>> & {
|
|
6
6
|
type?: 'singleSelect';
|
|
7
7
|
};
|
|
8
|
-
declare function GridFilterInputMultipleSingleSelect(props: GridFilterInputMultipleSingleSelectProps): React.JSX.Element;
|
|
8
|
+
declare function GridFilterInputMultipleSingleSelect(props: GridFilterInputMultipleSingleSelectProps): React.JSX.Element | null;
|
|
9
9
|
declare namespace GridFilterInputMultipleSingleSelect {
|
|
10
10
|
var propTypes: any;
|
|
11
11
|
}
|
|
@@ -27,15 +27,9 @@ function GridFilterInputMultipleSingleSelect(props) {
|
|
|
27
27
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
28
28
|
const id = (0, _useId.default)();
|
|
29
29
|
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
if ((0, _filterPanelUtils.isSingleSelectColDef)(column)) {
|
|
34
|
-
resolvedColumn = column;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
const getOptionValue = resolvedColumn?.getOptionValue;
|
|
38
|
-
const getOptionLabel = resolvedColumn?.getOptionLabel;
|
|
30
|
+
const resolvedColumn = apiRef.current.getColumn(item.field);
|
|
31
|
+
const getOptionValue = resolvedColumn.getOptionValue;
|
|
32
|
+
const getOptionLabel = resolvedColumn.getOptionLabel;
|
|
39
33
|
const isOptionEqualToValue = React.useCallback((option, value) => getOptionValue(option) === getOptionValue(value), [getOptionValue]);
|
|
40
34
|
const resolvedValueOptions = React.useMemo(() => {
|
|
41
35
|
return (0, _filterPanelUtils.getValueOptions)(resolvedColumn) || [];
|
|
@@ -60,6 +54,9 @@ function GridFilterInputMultipleSingleSelect(props) {
|
|
|
60
54
|
value: value.map(getOptionValue)
|
|
61
55
|
}));
|
|
62
56
|
}, [applyValue, item, getOptionValue]);
|
|
57
|
+
if (!resolvedColumn || !(0, _filterPanelUtils.isSingleSelectColDef)(resolvedColumn)) {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
63
60
|
const BaseAutocomplete = rootProps.slots.baseAutocomplete;
|
|
64
61
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(BaseAutocomplete, (0, _extends2.default)({
|
|
65
62
|
multiple: true,
|
|
@@ -56,15 +56,9 @@ function GridFilterInputSingleSelect(props) {
|
|
|
56
56
|
const labelId = (0, _useId.default)();
|
|
57
57
|
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
58
58
|
const isSelectNative = rootProps.slotProps?.baseSelect?.native ?? false;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
if ((0, _filterPanelUtils.isSingleSelectColDef)(column)) {
|
|
63
|
-
resolvedColumn = column;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
const getOptionValue = resolvedColumn?.getOptionValue;
|
|
67
|
-
const getOptionLabel = resolvedColumn?.getOptionLabel;
|
|
59
|
+
const resolvedColumn = apiRef.current.getColumn(item.field);
|
|
60
|
+
const getOptionValue = resolvedColumn.getOptionValue;
|
|
61
|
+
const getOptionLabel = resolvedColumn.getOptionLabel;
|
|
68
62
|
const currentValueOptions = React.useMemo(() => {
|
|
69
63
|
return (0, _filterPanelUtils.getValueOptions)(resolvedColumn);
|
|
70
64
|
}, [resolvedColumn]);
|
|
@@ -77,7 +71,7 @@ function GridFilterInputSingleSelect(props) {
|
|
|
77
71
|
value
|
|
78
72
|
}));
|
|
79
73
|
}, [currentValueOptions, getOptionValue, applyValue, item]);
|
|
80
|
-
if (!(0, _filterPanelUtils.isSingleSelectColDef)(resolvedColumn)) {
|
|
74
|
+
if (!resolvedColumn || !(0, _filterPanelUtils.isSingleSelectColDef)(resolvedColumn)) {
|
|
81
75
|
return null;
|
|
82
76
|
}
|
|
83
77
|
const label = slotProps?.root.label ?? apiRef.current.getLocaleText('filterPanelInputLabel');
|
|
@@ -13,10 +13,7 @@ var _clsx = _interopRequireDefault(require("clsx"));
|
|
|
13
13
|
var _system = require("@mui/system");
|
|
14
14
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
15
15
|
var _forwardRef = require("@mui/x-internals/forwardRef");
|
|
16
|
-
var
|
|
17
|
-
var _useGridSelector = require("../../hooks/utils/useGridSelector");
|
|
18
|
-
var _rows = require("../../hooks/features/rows");
|
|
19
|
-
var _virtualization = require("../../hooks/features/virtualization");
|
|
16
|
+
var _useGridPrivateApiContext = require("../../hooks/utils/useGridPrivateApiContext");
|
|
20
17
|
var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
|
|
21
18
|
var _gridClasses = require("../../constants/gridClasses");
|
|
22
19
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -44,14 +41,10 @@ const GridVirtualScrollerRenderZone = exports.GridVirtualScrollerRenderZone = (0
|
|
|
44
41
|
className
|
|
45
42
|
} = props,
|
|
46
43
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
47
|
-
const apiRef = (0,
|
|
44
|
+
const apiRef = (0, _useGridPrivateApiContext.useGridPrivateApiContext)();
|
|
48
45
|
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
49
46
|
const classes = useUtilityClasses(rootProps);
|
|
50
|
-
const offsetTop = (
|
|
51
|
-
const renderContext = (0, _virtualization.gridRenderContextSelector)(apiRef);
|
|
52
|
-
const rowsMeta = (0, _rows.gridRowsMetaSelector)(apiRef);
|
|
53
|
-
return rowsMeta.positions[renderContext.firstRowIndex] ?? 0;
|
|
54
|
-
});
|
|
47
|
+
const offsetTop = apiRef.current.virtualizer.api.useVirtualization().getters.getOffsetTop();
|
|
55
48
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(VirtualScrollerRenderZoneRoot, (0, _extends2.default)({
|
|
56
49
|
className: (0, _clsx.default)(classes.root, className),
|
|
57
50
|
ownerState: rootProps,
|
package/esm/DataGrid/DataGrid.js
CHANGED
|
@@ -7,6 +7,7 @@ import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
|
7
7
|
import { GridRoot } from "../components/index.js";
|
|
8
8
|
import { useGridAriaAttributes } from "../hooks/utils/useGridAriaAttributes.js";
|
|
9
9
|
import { useGridRowAriaAttributes } from "../hooks/features/rows/useGridRowAriaAttributes.js";
|
|
10
|
+
import { useGridRowsOverridableMethods } from "../hooks/features/rows/useGridRowsOverridableMethods.js";
|
|
10
11
|
import { GridContextProvider } from "../context/GridContextProvider.js";
|
|
11
12
|
import { useDataGridComponent } from "./useDataGridComponent.js";
|
|
12
13
|
import { useDataGridProps } from "./useDataGridProps.js";
|
|
@@ -19,13 +20,14 @@ const configuration = {
|
|
|
19
20
|
useCSSVariables: useMaterialCSSVariables,
|
|
20
21
|
useGridAriaAttributes,
|
|
21
22
|
useGridRowAriaAttributes,
|
|
23
|
+
useGridRowsOverridableMethods,
|
|
22
24
|
useCellAggregationResult: () => null
|
|
23
25
|
}
|
|
24
26
|
};
|
|
25
27
|
const DataGridRaw = function DataGrid(inProps, ref) {
|
|
26
28
|
const props = useDataGridProps(inProps);
|
|
27
29
|
const privateApiRef = useGridApiInitialization(props.apiRef, props);
|
|
28
|
-
useDataGridComponent(privateApiRef, props);
|
|
30
|
+
useDataGridComponent(privateApiRef, props, configuration);
|
|
29
31
|
if (process.env.NODE_ENV !== 'production') {
|
|
30
32
|
validateProps(props, propValidatorsDataGrid);
|
|
31
33
|
}
|
|
@@ -580,7 +582,7 @@ DataGridRaw.propTypes = {
|
|
|
580
582
|
*/
|
|
581
583
|
onPreferencePanelOpen: PropTypes.func,
|
|
582
584
|
/**
|
|
583
|
-
* Callback called when `processRowUpdate` throws an error or rejects.
|
|
585
|
+
* Callback called when `processRowUpdate()` throws an error or rejects.
|
|
584
586
|
* @param {any} error The error thrown.
|
|
585
587
|
*/
|
|
586
588
|
onProcessRowUpdateError: PropTypes.func,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { DataGridProcessedProps } from "../models/props/DataGridProps.js";
|
|
3
3
|
import { GridPrivateApiCommunity } from "../models/api/gridApiCommunity.js";
|
|
4
|
-
|
|
4
|
+
import { GridConfiguration } from "../models/configuration/gridConfiguration.js";
|
|
5
|
+
export declare const useDataGridComponent: (apiRef: RefObject<GridPrivateApiCommunity>, props: DataGridProcessedProps, configuration: GridConfiguration) => void;
|
|
@@ -35,7 +35,7 @@ import { rowSpanningStateInitializer, useGridRowSpanning } from "../hooks/featur
|
|
|
35
35
|
import { listViewStateInitializer, useGridListView } from "../hooks/features/listView/useGridListView.js";
|
|
36
36
|
import { propsStateInitializer } from "../hooks/core/useGridProps.js";
|
|
37
37
|
import { useGridDataSource } from "../hooks/features/dataSource/useGridDataSource.js";
|
|
38
|
-
export const useDataGridComponent = (apiRef, props) => {
|
|
38
|
+
export const useDataGridComponent = (apiRef, props, configuration) => {
|
|
39
39
|
useGridInitialization(apiRef, props);
|
|
40
40
|
|
|
41
41
|
/**
|
|
@@ -70,7 +70,7 @@ export const useDataGridComponent = (apiRef, props) => {
|
|
|
70
70
|
useGridKeyboardNavigation(apiRef, props);
|
|
71
71
|
useGridRowSelection(apiRef, props);
|
|
72
72
|
useGridColumns(apiRef, props);
|
|
73
|
-
useGridRows(apiRef, props);
|
|
73
|
+
useGridRows(apiRef, props, configuration);
|
|
74
74
|
useGridRowSpanning(apiRef, props);
|
|
75
75
|
useGridParamsApi(apiRef, props);
|
|
76
76
|
useGridColumnSpanning(apiRef);
|
|
@@ -4,6 +4,7 @@ import { getGridDateOperators } from "./gridDateOperators.js";
|
|
|
4
4
|
import { GRID_STRING_COL_DEF } from "./gridStringColDef.js";
|
|
5
5
|
import { renderEditDateCell } from "../components/cell/GridEditDateCell.js";
|
|
6
6
|
import { gridRowIdSelector } from "../hooks/core/gridPropsSelectors.js";
|
|
7
|
+
import { isAutogeneratedRow } from "../hooks/features/rows/gridRowsUtils.js";
|
|
7
8
|
function throwIfNotDateObject({
|
|
8
9
|
value,
|
|
9
10
|
columnType,
|
|
@@ -19,6 +20,9 @@ export const gridDateFormatter = (value, row, column, apiRef) => {
|
|
|
19
20
|
return '';
|
|
20
21
|
}
|
|
21
22
|
const rowId = gridRowIdSelector(apiRef, row);
|
|
23
|
+
if (isAutogeneratedRow(row) && !(value instanceof Date)) {
|
|
24
|
+
return value;
|
|
25
|
+
}
|
|
22
26
|
throwIfNotDateObject({
|
|
23
27
|
value,
|
|
24
28
|
columnType: 'date',
|
|
@@ -32,6 +36,9 @@ export const gridDateTimeFormatter = (value, row, column, apiRef) => {
|
|
|
32
36
|
return '';
|
|
33
37
|
}
|
|
34
38
|
const rowId = gridRowIdSelector(apiRef, row);
|
|
39
|
+
if (isAutogeneratedRow(row) && !(value instanceof Date)) {
|
|
40
|
+
return value;
|
|
41
|
+
}
|
|
35
42
|
throwIfNotDateObject({
|
|
36
43
|
value,
|
|
37
44
|
columnType: 'dateTime',
|
|
@@ -10,7 +10,6 @@ import { useGridApiContext } from "../hooks/utils/useGridApiContext.js";
|
|
|
10
10
|
import { getDataGridUtilityClass } from "../constants/gridClasses.js";
|
|
11
11
|
import { useGridRootProps } from "../hooks/utils/useGridRootProps.js";
|
|
12
12
|
import { vars } from "../constants/cssVariables.js";
|
|
13
|
-
import { GridColumnUnsortedIcon } from "./GridColumnUnsortedIcon.js";
|
|
14
13
|
import { NotRendered } from "../utils/assert.js";
|
|
15
14
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
15
|
const useUtilityClasses = ownerState => {
|
|
@@ -40,7 +39,7 @@ function getIcon(icons, direction, className, sortingOrder) {
|
|
|
40
39
|
} else if (direction === 'desc') {
|
|
41
40
|
Icon = icons.columnSortedDescendingIcon;
|
|
42
41
|
} else {
|
|
43
|
-
Icon =
|
|
42
|
+
Icon = icons.columnUnsortedIcon;
|
|
44
43
|
iconProps.sortingOrder = sortingOrder;
|
|
45
44
|
}
|
|
46
45
|
return Icon ? /*#__PURE__*/_jsx(Icon, _extends({
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { GridBaseIconProps } from "../models/gridSlotsComponentsProps.js";
|
|
3
3
|
import { GridSortDirection } from "../models/gridSortModel.js";
|
|
4
|
-
interface GridColumnUnsortedIconProps extends GridBaseIconProps {
|
|
4
|
+
export interface GridColumnUnsortedIconProps extends GridBaseIconProps {
|
|
5
5
|
sortingOrder: GridSortDirection[];
|
|
6
6
|
}
|
|
7
|
-
export declare const GridColumnUnsortedIcon: React.NamedExoticComponent<GridColumnUnsortedIconProps>;
|
|
8
|
-
export {};
|
|
7
|
+
export declare const GridColumnUnsortedIcon: React.NamedExoticComponent<GridColumnUnsortedIconProps>;
|
|
@@ -23,7 +23,7 @@ import { GRID_CHECKBOX_SELECTION_COL_DEF } from "../colDef/gridCheckboxSelection
|
|
|
23
23
|
import { GRID_ACTIONS_COLUMN_TYPE } from "../colDef/gridActionsColDef.js";
|
|
24
24
|
import { GRID_DETAIL_PANEL_TOGGLE_FIELD, PinnedColumnPosition } from "../internals/constants.js";
|
|
25
25
|
import { gridSortModelSelector } from "../hooks/features/sorting/gridSortingSelector.js";
|
|
26
|
-
import {
|
|
26
|
+
import { gridRowNodeSelector } from "../hooks/features/rows/gridRowsSelector.js";
|
|
27
27
|
import { gridEditRowsStateSelector, gridRowIsEditingSelector } from "../hooks/features/editing/gridEditingSelectors.js";
|
|
28
28
|
import { gridIsRowDragActiveSelector } from "../hooks/features/rowReorder/gridRowReorderSelector.js";
|
|
29
29
|
import { GridScrollbarFillerCell as ScrollbarFiller } from "./GridScrollbarFillerCell.js";
|
|
@@ -32,8 +32,11 @@ import { useGridConfiguration } from "../hooks/utils/useGridConfiguration.js";
|
|
|
32
32
|
import { useGridPrivateApiContext } from "../hooks/utils/useGridPrivateApiContext.js";
|
|
33
33
|
import { createSelector } from "../utils/createSelector.js";
|
|
34
34
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
35
|
-
const isRowReorderingEnabledSelector = createSelector(gridEditRowsStateSelector, (editRows,
|
|
36
|
-
|
|
35
|
+
const isRowReorderingEnabledSelector = createSelector(gridEditRowsStateSelector, (editRows, {
|
|
36
|
+
rowReordering,
|
|
37
|
+
treeData
|
|
38
|
+
}) => {
|
|
39
|
+
if (!rowReordering || treeData) {
|
|
37
40
|
return false;
|
|
38
41
|
}
|
|
39
42
|
const isEditingRows = !isObjectEmpty(editRows);
|
|
@@ -75,10 +78,13 @@ const GridRow = forwardRef(function GridRow(props, refProp) {
|
|
|
75
78
|
const rootProps = useGridRootProps();
|
|
76
79
|
const currentPage = useGridVisibleRows(apiRef, rootProps);
|
|
77
80
|
const sortModel = useGridSelector(apiRef, gridSortModelSelector);
|
|
78
|
-
const treeDepth = useGridSelector(apiRef, gridRowMaximumTreeDepthSelector);
|
|
79
81
|
const columnPositions = useGridSelector(apiRef, gridColumnPositionsSelector);
|
|
80
82
|
const rowReordering = rootProps.rowReordering;
|
|
81
|
-
const
|
|
83
|
+
const treeData = rootProps.treeData;
|
|
84
|
+
const isRowReorderingEnabled = useGridSelector(apiRef, isRowReorderingEnabledSelector, {
|
|
85
|
+
rowReordering,
|
|
86
|
+
treeData
|
|
87
|
+
});
|
|
82
88
|
const isRowDragActive = useGridSelector(apiRef, gridIsRowDragActiveSelector);
|
|
83
89
|
const handleRef = useForkRef(ref, refProp);
|
|
84
90
|
const rowNode = gridRowNodeSelector(apiRef, rowId);
|
|
@@ -231,7 +237,7 @@ const GridRow = forwardRef(function GridRow(props, refProp) {
|
|
|
231
237
|
// fixes https://github.com/mui/mui-x/issues/11126
|
|
232
238
|
const isReorderCell = column.field === '__reorder__';
|
|
233
239
|
const canReorderColumn = !(disableColumnReorder || column.disableReorder);
|
|
234
|
-
const canReorderRow = isRowReorderingEnabled && !sortModel.length
|
|
240
|
+
const canReorderRow = isRowReorderingEnabled && !sortModel.length;
|
|
235
241
|
const disableDragEvents = !(canReorderColumn || isReorderCell && canReorderRow || isRowDragActive);
|
|
236
242
|
const cellIsNotVisible = pinnedPosition === PinnedColumnPosition.VIRTUAL;
|
|
237
243
|
const showLeftBorder = shouldCellShowLeftBorder(pinnedPosition, indexInSection);
|
|
@@ -141,13 +141,17 @@ function GridActionsCell(props) {
|
|
|
141
141
|
setFocusedButtonIndex(newIndex);
|
|
142
142
|
}
|
|
143
143
|
};
|
|
144
|
+
|
|
145
|
+
// role="menu" requires at least one child element
|
|
146
|
+
const attributes = numberOfButtons > 0 ? {
|
|
147
|
+
role: 'menu',
|
|
148
|
+
onKeyDown: handleRootKeyDown
|
|
149
|
+
} : undefined;
|
|
144
150
|
return /*#__PURE__*/_jsxs("div", _extends({
|
|
145
|
-
role: "menu",
|
|
146
151
|
ref: rootRef,
|
|
147
152
|
tabIndex: -1,
|
|
148
|
-
className: gridClasses.actionsCell
|
|
149
|
-
|
|
150
|
-
}, other, {
|
|
153
|
+
className: gridClasses.actionsCell
|
|
154
|
+
}, attributes, other, {
|
|
151
155
|
children: [iconButtons.map((button, index) => /*#__PURE__*/React.cloneElement(button, {
|
|
152
156
|
key: index,
|
|
153
157
|
touchRippleRef: handleTouchRippleRef(index),
|
|
@@ -125,7 +125,7 @@ const GridCell = forwardRef(function GridCell(props, ref) {
|
|
|
125
125
|
isEditable = false,
|
|
126
126
|
value
|
|
127
127
|
} = cellParams;
|
|
128
|
-
const canManageOwnFocus = column.type === 'actions' && column.getActions
|
|
128
|
+
const canManageOwnFocus = column.type === 'actions' && 'getActions' in column && typeof column.getActions === 'function' && column.getActions(apiRef.current.getRowParams(rowId)).some(action => !action.props.disabled);
|
|
129
129
|
const tabIndex = (cellMode === 'view' || !isEditable) && !canManageOwnFocus ? cellParams.tabIndex : -1;
|
|
130
130
|
const {
|
|
131
131
|
classes: rootClasses,
|
|
@@ -5,6 +5,7 @@ import * as React from 'react';
|
|
|
5
5
|
import useId from '@mui/utils/useId';
|
|
6
6
|
import composeClasses from '@mui/utils/composeClasses';
|
|
7
7
|
import { useRtl } from '@mui/system/RtlProvider';
|
|
8
|
+
import { doesSupportPreventScroll } from "../../utils/doesSupportPreventScroll.js";
|
|
8
9
|
import { getDataGridUtilityClass } from "../../constants/gridClasses.js";
|
|
9
10
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
10
11
|
import { gridColumnGroupsLookupSelector } from "../../hooks/features/columnGrouping/gridColumnGroupsSelector.js";
|
|
@@ -89,7 +90,18 @@ function GridColumnGroupHeader(props) {
|
|
|
89
90
|
if (hasFocus) {
|
|
90
91
|
const focusableElement = headerCellRef.current.querySelector('[tabindex="0"]');
|
|
91
92
|
const elementToFocus = focusableElement || headerCellRef.current;
|
|
92
|
-
elementToFocus
|
|
93
|
+
if (!elementToFocus) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
if (doesSupportPreventScroll()) {
|
|
97
|
+
elementToFocus.focus({
|
|
98
|
+
preventScroll: true
|
|
99
|
+
});
|
|
100
|
+
} else {
|
|
101
|
+
const scrollPosition = apiRef.current.getScrollPosition();
|
|
102
|
+
elementToFocus.focus();
|
|
103
|
+
apiRef.current.scroll(scrollPosition);
|
|
104
|
+
}
|
|
93
105
|
}
|
|
94
106
|
}, [apiRef, hasFocus]);
|
|
95
107
|
const publish = React.useCallback(eventName => event => {
|
|
@@ -8,6 +8,7 @@ import composeClasses from '@mui/utils/composeClasses';
|
|
|
8
8
|
import useId from '@mui/utils/useId';
|
|
9
9
|
import { fastMemo } from '@mui/x-internals/fastMemo';
|
|
10
10
|
import { useRtl } from '@mui/system/RtlProvider';
|
|
11
|
+
import { doesSupportPreventScroll } from "../../utils/doesSupportPreventScroll.js";
|
|
11
12
|
import { useGridPrivateApiContext } from "../../hooks/utils/useGridPrivateApiContext.js";
|
|
12
13
|
import { ColumnHeaderMenuIcon } from "./ColumnHeaderMenuIcon.js";
|
|
13
14
|
import { GridColumnHeaderMenu } from "../menu/columnMenu/GridColumnHeaderMenu.js";
|
|
@@ -167,9 +168,17 @@ function GridColumnHeaderItem(props) {
|
|
|
167
168
|
if (hasFocus && !columnMenuState.open) {
|
|
168
169
|
const focusableElement = headerCellRef.current.querySelector('[tabindex="0"]');
|
|
169
170
|
const elementToFocus = focusableElement || headerCellRef.current;
|
|
170
|
-
elementToFocus
|
|
171
|
-
|
|
172
|
-
|
|
171
|
+
if (!elementToFocus) {
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
if (doesSupportPreventScroll()) {
|
|
175
|
+
elementToFocus.focus({
|
|
176
|
+
preventScroll: true
|
|
177
|
+
});
|
|
178
|
+
} else {
|
|
179
|
+
const scrollPosition = apiRef.current.getScrollPosition();
|
|
180
|
+
elementToFocus.focus();
|
|
181
|
+
apiRef.current.scroll(scrollPosition);
|
|
173
182
|
}
|
|
174
183
|
}
|
|
175
184
|
}, [apiRef, hasFocus]);
|
|
@@ -7,7 +7,6 @@ import * as React from 'react';
|
|
|
7
7
|
import clsx from 'clsx';
|
|
8
8
|
import useForkRef from '@mui/utils/useForkRef';
|
|
9
9
|
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
10
|
-
import { useGridPrivateApiContext } from "../../hooks/utils/useGridPrivateApiContext.js";
|
|
11
10
|
import { GridColumnHeaderTitle } from "./GridColumnHeaderTitle.js";
|
|
12
11
|
import { GridColumnHeaderSeparator } from "./GridColumnHeaderSeparator.js";
|
|
13
12
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
@@ -19,7 +18,6 @@ const GridGenericColumnHeaderItem = forwardRef(function GridGenericColumnHeaderI
|
|
|
19
18
|
height,
|
|
20
19
|
isResizing,
|
|
21
20
|
sortDirection,
|
|
22
|
-
hasFocus,
|
|
23
21
|
tabIndex,
|
|
24
22
|
separatorSide,
|
|
25
23
|
isDraggable,
|
|
@@ -37,7 +35,6 @@ const GridGenericColumnHeaderItem = forwardRef(function GridGenericColumnHeaderI
|
|
|
37
35
|
style
|
|
38
36
|
} = props,
|
|
39
37
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
40
|
-
const apiRef = useGridPrivateApiContext();
|
|
41
38
|
const rootProps = useGridRootProps();
|
|
42
39
|
const headerCellRef = React.useRef(null);
|
|
43
40
|
const handleRef = useForkRef(headerCellRef, ref);
|
|
@@ -45,17 +42,6 @@ const GridGenericColumnHeaderItem = forwardRef(function GridGenericColumnHeaderI
|
|
|
45
42
|
if (sortDirection != null) {
|
|
46
43
|
ariaSort = sortDirection === 'asc' ? 'ascending' : 'descending';
|
|
47
44
|
}
|
|
48
|
-
React.useLayoutEffect(() => {
|
|
49
|
-
const columnMenuState = apiRef.current.state.columnMenu;
|
|
50
|
-
if (hasFocus && !columnMenuState.open) {
|
|
51
|
-
const focusableElement = headerCellRef.current.querySelector('[tabindex="0"]');
|
|
52
|
-
const elementToFocus = focusableElement || headerCellRef.current;
|
|
53
|
-
elementToFocus?.focus();
|
|
54
|
-
if (apiRef.current.columnHeadersContainerRef?.current) {
|
|
55
|
-
apiRef.current.columnHeadersContainerRef.current.scrollLeft = 0;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}, [apiRef, hasFocus]);
|
|
59
45
|
return /*#__PURE__*/_jsxs("div", _extends({
|
|
60
46
|
className: clsx(classes.root, headerClassName),
|
|
61
47
|
style: _extends({}, style, {
|
|
@@ -178,7 +178,8 @@ function GridColumnsManagement(props) {
|
|
|
178
178
|
children: /*#__PURE__*/_jsxs(GridColumnsManagementBody, {
|
|
179
179
|
className: classes.root,
|
|
180
180
|
ownerState: rootProps,
|
|
181
|
-
children: [currentColumns.map(column => /*#__PURE__*/_jsx(
|
|
181
|
+
children: [currentColumns.map(column => /*#__PURE__*/_jsx(GridColumnsManagementRow, _extends({
|
|
182
|
+
as: rootProps.slots.baseCheckbox,
|
|
182
183
|
className: classes.row,
|
|
183
184
|
disabled: column.hideable === false || pivotActive,
|
|
184
185
|
checked: columnVisibilityModel[column.field] !== false,
|
|
@@ -309,4 +310,8 @@ const GridColumnsManagementEmptyText = styled('div', {
|
|
|
309
310
|
alignSelf: 'center',
|
|
310
311
|
font: vars.typography.font.body
|
|
311
312
|
});
|
|
313
|
+
const GridColumnsManagementRow = styled(NotRendered, {
|
|
314
|
+
name: 'MuiDataGrid',
|
|
315
|
+
slot: 'ColumnsManagementRow'
|
|
316
|
+
})();
|
|
312
317
|
export { GridColumnsManagement };
|
|
@@ -541,6 +541,11 @@ export const GridRootStyles = styled('div', {
|
|
|
541
541
|
opacity: 0.5
|
|
542
542
|
}
|
|
543
543
|
},
|
|
544
|
+
// Hide the column separator when the column has border and it is not resizable
|
|
545
|
+
// In this case, this column separator may block interaction with the separator from the adjacent column that is resizable
|
|
546
|
+
[`& .${c['columnHeader--withLeftBorder']} .${c['columnSeparator--sideLeft']}:not(.${c['columnSeparator--resizable']}), & .${c['columnHeader--withRightBorder']} .${c['columnSeparator--sideRight']}:not(.${c['columnSeparator--resizable']})`]: {
|
|
547
|
+
display: 'none'
|
|
548
|
+
},
|
|
544
549
|
[`& .${c['columnSeparator--sideLeft']}`]: {
|
|
545
550
|
left: columnSeparatorOffset
|
|
546
551
|
},
|
|
@@ -790,7 +795,7 @@ export const GridRootStyles = styled('div', {
|
|
|
790
795
|
[`& .${c.rowReorderCellPlaceholder}`]: {
|
|
791
796
|
display: 'none'
|
|
792
797
|
},
|
|
793
|
-
[`& .${c['columnHeader--dragging']}
|
|
798
|
+
[`& .${c['columnHeader--dragging']}`]: {
|
|
794
799
|
background: vars.colors.background.overlay,
|
|
795
800
|
padding: '0 12px',
|
|
796
801
|
borderRadius: 'var(--unstable_DataGrid-radius)',
|
|
@@ -800,8 +805,11 @@ export const GridRootStyles = styled('div', {
|
|
|
800
805
|
background: vars.colors.background.overlay,
|
|
801
806
|
padding: '0 12px',
|
|
802
807
|
borderRadius: 'var(--unstable_DataGrid-radius)',
|
|
803
|
-
|
|
808
|
+
border: '1px solid var(--DataGrid-rowBorderColor)',
|
|
809
|
+
color: vars.colors.foreground.base,
|
|
810
|
+
transform: 'translateZ(0)',
|
|
804
811
|
[`& .${c.rowReorderCellPlaceholder}`]: {
|
|
812
|
+
padding: '0 6px',
|
|
805
813
|
display: 'flex'
|
|
806
814
|
}
|
|
807
815
|
},
|
|
@@ -877,6 +885,7 @@ export const GridRootStyles = styled('div', {
|
|
|
877
885
|
[`& .${c['row--dropAbove']}`]: {
|
|
878
886
|
position: 'relative',
|
|
879
887
|
'&::before': {
|
|
888
|
+
pointerEvents: 'none',
|
|
880
889
|
content: '""',
|
|
881
890
|
position: 'absolute',
|
|
882
891
|
top: 0,
|
|
@@ -888,7 +897,9 @@ export const GridRootStyles = styled('div', {
|
|
|
888
897
|
},
|
|
889
898
|
[`& .${c['row--dropBelow']}`]: {
|
|
890
899
|
position: 'relative',
|
|
891
|
-
'&::
|
|
900
|
+
'&::after': {
|
|
901
|
+
zIndex: 100,
|
|
902
|
+
pointerEvents: 'none',
|
|
892
903
|
content: '""',
|
|
893
904
|
position: 'absolute',
|
|
894
905
|
bottom: '-2px',
|
|
@@ -898,14 +909,16 @@ export const GridRootStyles = styled('div', {
|
|
|
898
909
|
backgroundColor: vars.colors.interactive.selected
|
|
899
910
|
},
|
|
900
911
|
[`&.${c['row--lastVisible']}`]: {
|
|
901
|
-
'&::
|
|
912
|
+
'&::after': {
|
|
902
913
|
bottom: 'calc(var(--DataGrid-hasScrollY) * 0px + (1 - var(--DataGrid-hasScrollY)) * -2px)'
|
|
903
914
|
}
|
|
904
915
|
}
|
|
905
916
|
},
|
|
906
917
|
[`& .${c['row--beingDragged']}`]: {
|
|
907
|
-
|
|
908
|
-
|
|
918
|
+
color: vars.colors.foreground.disabled,
|
|
919
|
+
'&:hover': {
|
|
920
|
+
backgroundColor: 'transparent'
|
|
921
|
+
}
|
|
909
922
|
}
|
|
910
923
|
};
|
|
911
924
|
return gridStyle;
|
|
@@ -24,8 +24,9 @@ function GridColumnMenuSortItem(props) {
|
|
|
24
24
|
const onSortMenuItemClick = React.useCallback(event => {
|
|
25
25
|
onClick(event);
|
|
26
26
|
const direction = event.currentTarget.getAttribute('data-value') || null;
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
const allowMultipleSorting = rootProps.multipleColumnsSortingMode === 'always';
|
|
28
|
+
apiRef.current.sortColumn(colDef.field, direction === sortDirection ? null : direction, allowMultipleSorting);
|
|
29
|
+
}, [apiRef, colDef, onClick, sortDirection, rootProps.multipleColumnsSortingMode]);
|
|
29
30
|
if (rootProps.disableColumnSorting || !colDef || !colDef.sortable || !sortingOrder.some(item => !!item)) {
|
|
30
31
|
return null;
|
|
31
32
|
}
|
|
@@ -5,7 +5,7 @@ import type { ValueOptions } from "../../../models/colDef/gridColDef.js";
|
|
|
5
5
|
export type GridFilterInputMultipleSingleSelectProps = GridFilterInputValueProps<Omit<AutocompleteProps<ValueOptions, true, false, true>, 'options'>> & {
|
|
6
6
|
type?: 'singleSelect';
|
|
7
7
|
};
|
|
8
|
-
declare function GridFilterInputMultipleSingleSelect(props: GridFilterInputMultipleSingleSelectProps): React.JSX.Element;
|
|
8
|
+
declare function GridFilterInputMultipleSingleSelect(props: GridFilterInputMultipleSingleSelectProps): React.JSX.Element | null;
|
|
9
9
|
declare namespace GridFilterInputMultipleSingleSelect {
|
|
10
10
|
var propTypes: any;
|
|
11
11
|
}
|
|
@@ -19,15 +19,9 @@ function GridFilterInputMultipleSingleSelect(props) {
|
|
|
19
19
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
20
20
|
const id = useId();
|
|
21
21
|
const rootProps = useGridRootProps();
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
if (isSingleSelectColDef(column)) {
|
|
26
|
-
resolvedColumn = column;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
const getOptionValue = resolvedColumn?.getOptionValue;
|
|
30
|
-
const getOptionLabel = resolvedColumn?.getOptionLabel;
|
|
22
|
+
const resolvedColumn = apiRef.current.getColumn(item.field);
|
|
23
|
+
const getOptionValue = resolvedColumn.getOptionValue;
|
|
24
|
+
const getOptionLabel = resolvedColumn.getOptionLabel;
|
|
31
25
|
const isOptionEqualToValue = React.useCallback((option, value) => getOptionValue(option) === getOptionValue(value), [getOptionValue]);
|
|
32
26
|
const resolvedValueOptions = React.useMemo(() => {
|
|
33
27
|
return getValueOptions(resolvedColumn) || [];
|
|
@@ -52,6 +46,9 @@ function GridFilterInputMultipleSingleSelect(props) {
|
|
|
52
46
|
value: value.map(getOptionValue)
|
|
53
47
|
}));
|
|
54
48
|
}, [applyValue, item, getOptionValue]);
|
|
49
|
+
if (!resolvedColumn || !isSingleSelectColDef(resolvedColumn)) {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
55
52
|
const BaseAutocomplete = rootProps.slots.baseAutocomplete;
|
|
56
53
|
return /*#__PURE__*/_jsx(BaseAutocomplete, _extends({
|
|
57
54
|
multiple: true,
|