@mui/x-data-grid 5.11.0 → 5.12.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 +237 -16
- package/DataGrid/DataGrid.js +26 -1
- package/README.md +3 -4
- package/components/GridRow.d.ts +1 -1
- package/components/GridRow.js +51 -12
- package/components/base/GridOverlays.js +1 -1
- package/components/cell/GridActionsCellItem.d.ts +1 -1
- package/components/cell/GridCell.d.ts +2 -1
- package/components/cell/GridCell.js +12 -7
- package/components/columnHeaders/GridColumnHeaderItem.js +4 -3
- package/components/containers/GridRoot.js +25 -5
- package/components/containers/GridRootStyles.js +7 -2
- package/components/menu/GridMenu.js +9 -2
- package/components/panel/GridColumnsPanel.js +10 -2
- package/components/panel/GridPanelWrapper.d.ts +1 -1
- package/components/panel/GridPanelWrapper.js +3 -3
- package/components/panel/filterPanel/GridFilterForm.d.ts +61 -4
- package/components/panel/filterPanel/GridFilterForm.js +88 -8
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +0 -1
- package/components/panel/filterPanel/GridFilterPanel.d.ts +8 -5
- package/components/panel/filterPanel/GridFilterPanel.js +25 -9
- package/components/toolbar/GridToolbarFilterButton.d.ts +1 -1
- package/components/toolbar/GridToolbarQuickFilter.d.ts +7 -0
- package/components/toolbar/GridToolbarQuickFilter.js +58 -6
- package/constants/defaultGridSlotsComponents.js +4 -2
- package/constants/gridClasses.d.ts +16 -0
- package/constants/gridClasses.js +1 -1
- package/hooks/core/pipeProcessing/gridPipeProcessingApi.d.ts +4 -0
- package/hooks/core/pipeProcessing/useGridPipeProcessing.js +10 -9
- package/hooks/core/useGridStateInitialization.js +19 -6
- package/hooks/features/columnMenu/useGridColumnMenu.js +22 -0
- package/hooks/features/columns/gridColumnsInterfaces.d.ts +3 -0
- package/hooks/features/columns/useGridColumns.js +13 -15
- package/hooks/features/editRows/useGridCellEditing.new.js +11 -4
- package/hooks/features/editRows/useGridEditing.old.js +1 -1
- package/hooks/features/editRows/useGridRowEditing.new.js +10 -4
- package/hooks/features/events/useGridEvents.d.ts +1 -1
- package/hooks/features/events/useGridEvents.js +2 -0
- package/hooks/features/filter/gridFilterSelector.d.ts +5 -0
- package/hooks/features/filter/gridFilterSelector.js +6 -0
- package/hooks/features/filter/gridFilterUtils.d.ts +10 -2
- package/hooks/features/filter/gridFilterUtils.js +3 -6
- package/hooks/features/filter/useGridFilter.js +29 -12
- package/hooks/features/pagination/useGridPage.js +1 -1
- package/hooks/features/pagination/useGridPageSize.js +1 -1
- package/hooks/features/rows/gridRowsState.d.ts +14 -5
- package/hooks/features/rows/gridRowsUtils.d.ts +13 -1
- package/hooks/features/rows/gridRowsUtils.js +54 -0
- package/hooks/features/rows/useGridRows.js +63 -102
- package/hooks/features/rows/useGridRowsMeta.d.ts +1 -1
- package/hooks/features/rows/useGridRowsMeta.js +107 -43
- package/hooks/features/selection/useGridSelection.js +1 -1
- package/hooks/features/sorting/useGridSorting.js +1 -1
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +1 -0
- package/hooks/features/virtualization/useGridVirtualScroller.js +27 -7
- package/index.js +1 -1
- package/internals/index.d.ts +1 -0
- package/legacy/DataGrid/DataGrid.js +26 -1
- package/legacy/components/GridRow.js +56 -12
- package/legacy/components/base/GridOverlays.js +1 -1
- package/legacy/components/cell/GridCell.js +12 -7
- package/legacy/components/columnHeaders/GridColumnHeaderItem.js +6 -3
- package/legacy/components/containers/GridRoot.js +23 -5
- package/legacy/components/containers/GridRootStyles.js +9 -6
- package/legacy/components/menu/GridMenu.js +9 -2
- package/legacy/components/panel/GridColumnsPanel.js +12 -2
- package/legacy/components/panel/GridPanelWrapper.js +3 -3
- package/legacy/components/panel/filterPanel/GridFilterForm.js +89 -8
- package/legacy/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +0 -1
- package/legacy/components/panel/filterPanel/GridFilterPanel.js +27 -10
- package/legacy/components/toolbar/GridToolbarQuickFilter.js +68 -8
- package/legacy/constants/defaultGridSlotsComponents.js +4 -2
- package/legacy/constants/gridClasses.js +1 -1
- package/legacy/hooks/core/pipeProcessing/useGridPipeProcessing.js +10 -10
- package/legacy/hooks/core/useGridStateInitialization.js +18 -6
- package/legacy/hooks/features/columnMenu/useGridColumnMenu.js +22 -0
- package/legacy/hooks/features/columns/useGridColumns.js +13 -15
- package/legacy/hooks/features/editRows/useGridCellEditing.new.js +14 -7
- package/legacy/hooks/features/editRows/useGridEditing.old.js +1 -1
- package/legacy/hooks/features/editRows/useGridRowEditing.new.js +10 -4
- package/legacy/hooks/features/events/useGridEvents.js +2 -0
- package/legacy/hooks/features/filter/gridFilterSelector.js +8 -0
- package/legacy/hooks/features/filter/gridFilterUtils.js +4 -7
- package/legacy/hooks/features/filter/useGridFilter.js +33 -12
- package/legacy/hooks/features/pagination/useGridPage.js +1 -1
- package/legacy/hooks/features/pagination/useGridPageSize.js +1 -1
- package/legacy/hooks/features/rows/gridRowsUtils.js +55 -0
- package/legacy/hooks/features/rows/useGridRows.js +75 -111
- package/legacy/hooks/features/rows/useGridRowsMeta.js +104 -41
- package/legacy/hooks/features/selection/useGridSelection.js +1 -1
- package/legacy/hooks/features/sorting/useGridSorting.js +1 -1
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +46 -22
- package/legacy/index.js +1 -1
- package/legacy/locales/heIL.js +9 -9
- package/legacy/locales/jaJP.js +28 -24
- package/legacy/locales/nbNO.js +127 -0
- package/legacy/locales/ruRU.js +9 -9
- package/legacy/locales/trTR.js +7 -7
- package/legacy/models/events/gridEvents.js +2 -0
- package/legacy/models/gridApiCaches.js +1 -0
- package/legacy/models/params/gridMenuParams.js +1 -0
- package/legacy/models/params/index.js +2 -1
- package/locales/heIL.js +9 -9
- package/locales/jaJP.js +24 -24
- package/locales/nbNO.d.ts +2 -0
- package/locales/nbNO.js +115 -0
- package/locales/ruRU.js +9 -9
- package/locales/trTR.js +7 -7
- package/models/api/gridCallbackDetails.d.ts +6 -1
- package/models/api/gridCoreApi.d.ts +2 -6
- package/models/api/gridFilterApi.d.ts +8 -1
- package/models/api/gridRowsMetaApi.d.ts +24 -0
- package/models/api/gridStateApi.d.ts +14 -3
- package/models/colDef/gridColDef.d.ts +3 -3
- package/models/events/gridEventLookup.d.ts +16 -1
- package/models/events/gridEvents.d.ts +3 -1
- package/models/events/gridEvents.js +2 -0
- package/models/gridApiCaches.d.ts +6 -0
- package/models/gridApiCaches.js +1 -0
- package/models/gridIconSlotsComponent.d.ts +10 -0
- package/models/params/gridMenuParams.d.ts +7 -0
- package/models/params/gridMenuParams.js +1 -0
- package/models/params/gridRowParams.d.ts +1 -1
- package/models/params/index.d.ts +1 -0
- package/models/params/index.js +2 -1
- package/models/props/DataGridProps.d.ts +24 -2
- package/modern/DataGrid/DataGrid.js +26 -1
- package/modern/components/GridRow.js +51 -12
- package/modern/components/base/GridOverlays.js +1 -1
- package/modern/components/cell/GridCell.js +12 -7
- package/modern/components/columnHeaders/GridColumnHeaderItem.js +4 -3
- package/modern/components/containers/GridRoot.js +25 -3
- package/modern/components/containers/GridRootStyles.js +7 -2
- package/modern/components/menu/GridMenu.js +9 -2
- package/modern/components/panel/GridColumnsPanel.js +10 -2
- package/modern/components/panel/GridPanelWrapper.js +3 -3
- package/modern/components/panel/filterPanel/GridFilterForm.js +88 -8
- package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +0 -1
- package/modern/components/panel/filterPanel/GridFilterPanel.js +25 -9
- package/modern/components/toolbar/GridToolbarQuickFilter.js +58 -6
- package/modern/constants/defaultGridSlotsComponents.js +4 -2
- package/modern/constants/gridClasses.js +1 -1
- package/modern/hooks/core/pipeProcessing/useGridPipeProcessing.js +10 -9
- package/modern/hooks/core/useGridStateInitialization.js +19 -6
- package/modern/hooks/features/columnMenu/useGridColumnMenu.js +22 -0
- package/modern/hooks/features/columns/useGridColumns.js +12 -14
- package/modern/hooks/features/editRows/useGridCellEditing.new.js +10 -3
- package/modern/hooks/features/editRows/useGridEditing.old.js +1 -1
- package/modern/hooks/features/editRows/useGridRowEditing.new.js +9 -3
- package/modern/hooks/features/events/useGridEvents.js +2 -0
- package/modern/hooks/features/filter/gridFilterSelector.js +6 -0
- package/modern/hooks/features/filter/gridFilterUtils.js +3 -6
- package/modern/hooks/features/filter/useGridFilter.js +29 -12
- package/modern/hooks/features/pagination/useGridPage.js +1 -1
- package/modern/hooks/features/pagination/useGridPageSize.js +1 -1
- package/modern/hooks/features/rows/gridRowsUtils.js +54 -0
- package/modern/hooks/features/rows/useGridRows.js +63 -102
- package/modern/hooks/features/rows/useGridRowsMeta.js +105 -37
- package/modern/hooks/features/selection/useGridSelection.js +1 -1
- package/modern/hooks/features/sorting/useGridSorting.js +1 -1
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +27 -7
- package/modern/index.js +1 -1
- package/modern/locales/heIL.js +9 -9
- package/modern/locales/jaJP.js +24 -24
- package/modern/locales/nbNO.js +115 -0
- package/modern/locales/ruRU.js +9 -9
- package/modern/locales/trTR.js +7 -7
- package/modern/models/events/gridEvents.js +2 -0
- package/modern/models/gridApiCaches.js +1 -0
- package/modern/models/params/gridMenuParams.js +1 -0
- package/modern/models/params/index.js +2 -1
- package/node/DataGrid/DataGrid.js +26 -1
- package/node/components/GridRow.js +53 -12
- package/node/components/base/GridOverlays.js +1 -1
- package/node/components/cell/GridCell.js +12 -7
- package/node/components/columnHeaders/GridColumnHeaderItem.js +4 -3
- package/node/components/containers/GridRoot.js +24 -3
- package/node/components/containers/GridRootStyles.js +7 -2
- package/node/components/menu/GridMenu.js +10 -2
- package/node/components/panel/GridColumnsPanel.js +10 -2
- package/node/components/panel/GridPanelWrapper.js +5 -3
- package/node/components/panel/filterPanel/GridFilterForm.js +91 -9
- package/node/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +0 -1
- package/node/components/panel/filterPanel/GridFilterPanel.js +27 -9
- package/node/components/toolbar/GridToolbarQuickFilter.js +61 -6
- package/node/constants/defaultGridSlotsComponents.js +3 -1
- package/node/constants/gridClasses.js +1 -1
- package/node/hooks/core/pipeProcessing/useGridPipeProcessing.js +10 -8
- package/node/hooks/core/useGridStateInitialization.js +19 -6
- package/node/hooks/features/columnMenu/useGridColumnMenu.js +23 -0
- package/node/hooks/features/columns/useGridColumns.js +13 -15
- package/node/hooks/features/editRows/useGridCellEditing.new.js +11 -4
- package/node/hooks/features/editRows/useGridEditing.old.js +1 -1
- package/node/hooks/features/editRows/useGridRowEditing.new.js +10 -4
- package/node/hooks/features/events/useGridEvents.js +2 -0
- package/node/hooks/features/filter/gridFilterSelector.js +9 -2
- package/node/hooks/features/filter/gridFilterUtils.js +4 -5
- package/node/hooks/features/filter/useGridFilter.js +28 -11
- package/node/hooks/features/pagination/useGridPage.js +1 -1
- package/node/hooks/features/pagination/useGridPageSize.js +1 -1
- package/node/hooks/features/rows/gridRowsUtils.js +67 -1
- package/node/hooks/features/rows/useGridRows.js +63 -99
- package/node/hooks/features/rows/useGridRowsMeta.js +107 -43
- package/node/hooks/features/selection/useGridSelection.js +1 -1
- package/node/hooks/features/sorting/useGridSorting.js +1 -1
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +27 -7
- package/node/index.js +1 -1
- package/node/locales/heIL.js +9 -9
- package/node/locales/jaJP.js +24 -24
- package/node/locales/nbNO.js +125 -0
- package/node/locales/ruRU.js +9 -9
- package/node/locales/trTR.js +7 -7
- package/node/models/events/gridEvents.js +2 -0
- package/node/models/gridApiCaches.js +5 -0
- package/node/models/params/gridMenuParams.js +5 -0
- package/node/models/params/index.js +13 -0
- package/package.json +7 -5
|
@@ -70,6 +70,7 @@ function GridColumnHeaderItem(props) {
|
|
|
70
70
|
hasScrollX: false,
|
|
71
71
|
hasScrollY: false
|
|
72
72
|
};
|
|
73
|
+
const isDraggable = React.useMemo(() => !rootProps.disableColumnReorder && !disableReorder && !column.disableReorder, [rootProps.disableColumnReorder, disableReorder, column.disableReorder]);
|
|
73
74
|
let headerComponent = null;
|
|
74
75
|
|
|
75
76
|
if (column.renderHeader) {
|
|
@@ -100,12 +101,12 @@ function GridColumnHeaderItem(props) {
|
|
|
100
101
|
onFocus: publish('columnHeaderFocus'),
|
|
101
102
|
onBlur: publish('columnHeaderBlur')
|
|
102
103
|
};
|
|
103
|
-
const draggableEventHandlers = {
|
|
104
|
+
const draggableEventHandlers = isDraggable ? {
|
|
104
105
|
onDragStart: publish('columnHeaderDragStart'),
|
|
105
106
|
onDragEnter: publish('columnHeaderDragEnter'),
|
|
106
107
|
onDragOver: publish('columnHeaderDragOver'),
|
|
107
108
|
onDragEnd: publish('columnHeaderDragEnd')
|
|
108
|
-
};
|
|
109
|
+
} : null;
|
|
109
110
|
const removeLastBorderRight = isLastColumn && hasScrollX && !hasScrollY;
|
|
110
111
|
const showRightBorder = !isLastColumn ? rootProps.showColumnRightBorder : !removeLastBorderRight && !extendRowFullWidth;
|
|
111
112
|
|
|
@@ -182,7 +183,7 @@ function GridColumnHeaderItem(props) {
|
|
|
182
183
|
}, mouseEventsHandlers, {
|
|
183
184
|
children: [/*#__PURE__*/_jsxs("div", _extends({
|
|
184
185
|
className: classes.draggableContainer,
|
|
185
|
-
draggable:
|
|
186
|
+
draggable: isDraggable
|
|
186
187
|
}, draggableEventHandlers, {
|
|
187
188
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
188
189
|
className: classes.titleContainer,
|
|
@@ -4,18 +4,31 @@ const _excluded = ["children", "className"];
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
|
-
import { useForkRef, unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/material/utils';
|
|
7
|
+
import { useForkRef, unstable_useEnhancedEffect as useEnhancedEffect, capitalize } from '@mui/material/utils';
|
|
8
|
+
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
8
9
|
import { GridRootStyles } from './GridRootStyles';
|
|
9
10
|
import { gridVisibleColumnDefinitionsSelector } from '../../hooks/features/columns/gridColumnsSelector';
|
|
10
11
|
import { useGridSelector } from '../../hooks/utils/useGridSelector';
|
|
11
12
|
import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
|
|
12
13
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
13
|
-
import {
|
|
14
|
+
import { getDataGridUtilityClass } from '../../constants/gridClasses';
|
|
14
15
|
import { gridRowCountSelector } from '../../hooks/features/rows/gridRowsSelector';
|
|
16
|
+
import { gridDensityValueSelector } from '../../hooks/features/density/densitySelector';
|
|
15
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
-
const GridRoot = /*#__PURE__*/React.forwardRef(function GridRoot(props, ref) {
|
|
17
|
-
var _rootProps$classes;
|
|
18
18
|
|
|
19
|
+
const useUtilityClasses = ownerState => {
|
|
20
|
+
const {
|
|
21
|
+
autoHeight,
|
|
22
|
+
density,
|
|
23
|
+
classes
|
|
24
|
+
} = ownerState;
|
|
25
|
+
const slots = {
|
|
26
|
+
root: ['root', autoHeight && 'autoHeight', `root--density${capitalize(density)}`]
|
|
27
|
+
};
|
|
28
|
+
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const GridRoot = /*#__PURE__*/React.forwardRef(function GridRoot(props, ref) {
|
|
19
32
|
const rootProps = useGridRootProps();
|
|
20
33
|
|
|
21
34
|
const {
|
|
@@ -27,8 +40,15 @@ const GridRoot = /*#__PURE__*/React.forwardRef(function GridRoot(props, ref) {
|
|
|
27
40
|
const apiRef = useGridApiContext();
|
|
28
41
|
const visibleColumns = useGridSelector(apiRef, gridVisibleColumnDefinitionsSelector);
|
|
29
42
|
const totalRowCount = useGridSelector(apiRef, gridRowCountSelector);
|
|
43
|
+
const densityValue = useGridSelector(apiRef, gridDensityValueSelector);
|
|
30
44
|
const rootContainerRef = React.useRef(null);
|
|
31
45
|
const handleRef = useForkRef(rootContainerRef, ref);
|
|
46
|
+
const ownerState = {
|
|
47
|
+
density: densityValue,
|
|
48
|
+
classes: rootProps.classes,
|
|
49
|
+
autoHeight: rootProps.autoHeight
|
|
50
|
+
};
|
|
51
|
+
const classes = useUtilityClasses(ownerState);
|
|
32
52
|
apiRef.current.rootElementRef = rootContainerRef; // Our implementation of <NoSsr />
|
|
33
53
|
|
|
34
54
|
const [mountedState, setMountedState] = React.useState(false);
|
|
@@ -47,7 +67,7 @@ const GridRoot = /*#__PURE__*/React.forwardRef(function GridRoot(props, ref) {
|
|
|
47
67
|
|
|
48
68
|
return /*#__PURE__*/_jsx(GridRootStyles, _extends({
|
|
49
69
|
ref: handleRef,
|
|
50
|
-
className: clsx(className,
|
|
70
|
+
className: clsx(className, classes.root),
|
|
51
71
|
role: "grid",
|
|
52
72
|
"aria-colcount": visibleColumns.length,
|
|
53
73
|
"aria-rowcount": totalRowCount,
|
|
@@ -221,6 +221,9 @@ export const GridRootStyles = styled('div', {
|
|
|
221
221
|
},
|
|
222
222
|
[`&.${gridClasses['columnSeparator--resizing']}`]: {
|
|
223
223
|
color: theme.palette.text.primary
|
|
224
|
+
},
|
|
225
|
+
'& svg': {
|
|
226
|
+
pointerEvents: 'none'
|
|
224
227
|
}
|
|
225
228
|
},
|
|
226
229
|
[`& .${gridClasses.iconSeparator}`]: {
|
|
@@ -274,10 +277,12 @@ export const GridRootStyles = styled('div', {
|
|
|
274
277
|
[`& .${gridClasses.cell}`]: {
|
|
275
278
|
display: 'flex',
|
|
276
279
|
alignItems: 'center',
|
|
277
|
-
overflow: 'hidden',
|
|
278
|
-
whiteSpace: 'nowrap',
|
|
279
280
|
borderBottom: `1px solid ${borderColor}`
|
|
280
281
|
},
|
|
282
|
+
[`& .${gridClasses.row}:not(.${gridClasses['row--dynamicHeight']}) > .${gridClasses.cell}`]: {
|
|
283
|
+
overflow: 'hidden',
|
|
284
|
+
whiteSpace: 'nowrap'
|
|
285
|
+
},
|
|
281
286
|
[`& .${gridClasses.cellContent}`]: {
|
|
282
287
|
overflow: 'hidden',
|
|
283
288
|
textOverflow: 'ellipsis'
|
|
@@ -13,6 +13,7 @@ import { styled } from '@mui/material/styles';
|
|
|
13
13
|
import { HTMLElementType } from '@mui/utils';
|
|
14
14
|
import { getDataGridUtilityClass, gridClasses } from '../../constants/gridClasses';
|
|
15
15
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
16
|
+
import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
|
|
16
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
18
|
|
|
18
19
|
const useUtilityClasses = ownerState => {
|
|
@@ -56,6 +57,7 @@ const GridMenu = props => {
|
|
|
56
57
|
} = props,
|
|
57
58
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
58
59
|
|
|
60
|
+
const apiRef = useGridApiContext();
|
|
59
61
|
const prevTarget = React.useRef(target);
|
|
60
62
|
const prevOpen = React.useRef(open);
|
|
61
63
|
const rootProps = useGridRootProps();
|
|
@@ -66,11 +68,16 @@ const GridMenu = props => {
|
|
|
66
68
|
React.useEffect(() => {
|
|
67
69
|
if (prevOpen.current && prevTarget.current) {
|
|
68
70
|
prevTarget.current.focus();
|
|
69
|
-
}
|
|
71
|
+
} // Emit menuOpen or menuClose events
|
|
72
|
+
|
|
70
73
|
|
|
74
|
+
const eventName = open ? 'menuOpen' : 'menuClose';
|
|
75
|
+
apiRef.current.publishEvent(eventName, {
|
|
76
|
+
target
|
|
77
|
+
});
|
|
71
78
|
prevOpen.current = open;
|
|
72
79
|
prevTarget.current = target;
|
|
73
|
-
}, [open, target]);
|
|
80
|
+
}, [apiRef, open, target]);
|
|
74
81
|
|
|
75
82
|
const handleExited = popperOnExited => node => {
|
|
76
83
|
if (popperOnExited) {
|
|
@@ -76,8 +76,16 @@ export function GridColumnsPanel(props) {
|
|
|
76
76
|
};
|
|
77
77
|
|
|
78
78
|
const toggleAllColumns = React.useCallback(isVisible => {
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
if (apiRef.current.unstable_caches.columns.isUsingColumnVisibilityModel) {
|
|
80
|
+
if (isVisible) {
|
|
81
|
+
return apiRef.current.setColumnVisibilityModel({});
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return apiRef.current.setColumnVisibilityModel(Object.fromEntries(columns.map(col => [col.field, false])));
|
|
85
|
+
} // TODO v6: Remove
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
return apiRef.current.updateColumns(columns.map(col => {
|
|
81
89
|
if (col.hideable !== false) {
|
|
82
90
|
return {
|
|
83
91
|
field: col.field,
|
|
@@ -3,5 +3,5 @@ import { Theme } from '@mui/material/styles';
|
|
|
3
3
|
import { MUIStyledCommonProps } from '@mui/system';
|
|
4
4
|
export interface GridPanelWrapperProps extends React.PropsWithChildren<React.HTMLAttributes<HTMLDivElement>>, MUIStyledCommonProps<Theme> {
|
|
5
5
|
}
|
|
6
|
-
declare
|
|
6
|
+
declare const GridPanelWrapper: React.ForwardRefExoticComponent<GridPanelWrapperProps & React.RefAttributes<HTMLDivElement>>;
|
|
7
7
|
export { GridPanelWrapper };
|
|
@@ -35,7 +35,7 @@ const GridPanelWrapperRoot = styled('div', {
|
|
|
35
35
|
|
|
36
36
|
const isEnabled = () => true;
|
|
37
37
|
|
|
38
|
-
function GridPanelWrapper(props) {
|
|
38
|
+
const GridPanelWrapper = /*#__PURE__*/React.forwardRef(function GridPanelWrapper(props, ref) {
|
|
39
39
|
const {
|
|
40
40
|
className
|
|
41
41
|
} = props,
|
|
@@ -51,10 +51,10 @@ function GridPanelWrapper(props) {
|
|
|
51
51
|
disableEnforceFocus: true,
|
|
52
52
|
isEnabled: isEnabled,
|
|
53
53
|
children: /*#__PURE__*/_jsx(GridPanelWrapperRoot, _extends({
|
|
54
|
+
ref: ref,
|
|
54
55
|
tabIndex: -1,
|
|
55
56
|
className: clsx(className, classes.root)
|
|
56
57
|
}, other))
|
|
57
58
|
});
|
|
58
|
-
}
|
|
59
|
-
|
|
59
|
+
});
|
|
60
60
|
export { GridPanelWrapper };
|
|
@@ -1,25 +1,82 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { GridFilterItem, GridLinkOperator } from '../../../models/gridFilterItem';
|
|
3
3
|
export interface GridFilterFormProps {
|
|
4
|
+
/**
|
|
5
|
+
* The [[GridFilterItem]] representing this form.
|
|
6
|
+
*/
|
|
4
7
|
item: GridFilterItem;
|
|
8
|
+
/**
|
|
9
|
+
* If `true`, the logic operator field is rendered.
|
|
10
|
+
* The field will be invisible if `showMultiFilterOperators` is also `true`.
|
|
11
|
+
*/
|
|
5
12
|
hasMultipleFilters: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* If `true`, the logic operator field is visible.
|
|
15
|
+
*/
|
|
6
16
|
showMultiFilterOperators?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* The current logic operator applied.
|
|
19
|
+
*/
|
|
7
20
|
multiFilterOperator?: GridLinkOperator;
|
|
21
|
+
/**
|
|
22
|
+
* If `true`, disables the logic operator field but still renders it.
|
|
23
|
+
*/
|
|
8
24
|
disableMultiFilterOperator?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* A ref allowing to set imperative focus.
|
|
27
|
+
* It can be passed to the el
|
|
28
|
+
*/
|
|
9
29
|
focusElementRef?: React.Ref<any>;
|
|
30
|
+
/**
|
|
31
|
+
* Callback called when the operator, column field or value is changed.
|
|
32
|
+
* @param {GridFilterItem} item The updated [[GridFilterItem]].
|
|
33
|
+
*/
|
|
10
34
|
applyFilterChanges: (item: GridFilterItem) => void;
|
|
35
|
+
/**
|
|
36
|
+
* Callback called when the logic operator is changed.
|
|
37
|
+
* @param {GridLinkOperator} operator The new logic operator.
|
|
38
|
+
*/
|
|
11
39
|
applyMultiFilterOperatorChanges: (operator: GridLinkOperator) => void;
|
|
40
|
+
/**
|
|
41
|
+
* Callback called when the delete button is clicked.
|
|
42
|
+
* @param {GridFilterItem} item The deleted [[GridFilterItem]].
|
|
43
|
+
*/
|
|
12
44
|
deleteFilter: (item: GridFilterItem) => void;
|
|
45
|
+
/**
|
|
46
|
+
* Sets the available logic operators.
|
|
47
|
+
* @default [GridLinkOperator.And, GridLinkOperator.Or]
|
|
48
|
+
*/
|
|
13
49
|
linkOperators?: GridLinkOperator[];
|
|
50
|
+
/**
|
|
51
|
+
* Changes how the options in the columns selector should be ordered.
|
|
52
|
+
* If not specified, the order is derived from the `columns` prop.
|
|
53
|
+
*/
|
|
14
54
|
columnsSort?: 'asc' | 'desc';
|
|
55
|
+
/**
|
|
56
|
+
* Props passed to the delete icon.
|
|
57
|
+
* @default {}
|
|
58
|
+
*/
|
|
15
59
|
deleteIconProps?: any;
|
|
60
|
+
/**
|
|
61
|
+
* Props passed to the logic operator input component.
|
|
62
|
+
* @default {}
|
|
63
|
+
*/
|
|
16
64
|
linkOperatorInputProps?: any;
|
|
65
|
+
/**
|
|
66
|
+
* Props passed to the operator input component.
|
|
67
|
+
* @default {}
|
|
68
|
+
*/
|
|
17
69
|
operatorInputProps?: any;
|
|
70
|
+
/**
|
|
71
|
+
* Props passed to the column input component.
|
|
72
|
+
* @default {}
|
|
73
|
+
*/
|
|
18
74
|
columnInputProps?: any;
|
|
75
|
+
/**
|
|
76
|
+
* Props passed to the value input component.
|
|
77
|
+
* @default {}
|
|
78
|
+
*/
|
|
19
79
|
valueInputProps?: any;
|
|
20
80
|
}
|
|
21
|
-
declare
|
|
22
|
-
declare namespace GridFilterForm {
|
|
23
|
-
var propTypes: any;
|
|
24
|
-
}
|
|
81
|
+
declare const GridFilterForm: React.ForwardRefExoticComponent<GridFilterFormProps & React.RefAttributes<HTMLDivElement>>;
|
|
25
82
|
export { GridFilterForm };
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
const _excluded = ["item", "hasMultipleFilters", "deleteFilter", "applyFilterChanges", "multiFilterOperator", "showMultiFilterOperators", "disableMultiFilterOperator", "applyMultiFilterOperatorChanges", "focusElementRef", "linkOperators", "columnsSort", "deleteIconProps", "linkOperatorInputProps", "operatorInputProps", "columnInputProps", "valueInputProps", "children"];
|
|
2
4
|
import * as React from 'react';
|
|
3
5
|
import PropTypes from 'prop-types';
|
|
4
6
|
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
@@ -102,8 +104,7 @@ const getLinkOperatorLocaleKey = linkOperator => {
|
|
|
102
104
|
const getColumnLabel = col => col.headerName || col.field;
|
|
103
105
|
|
|
104
106
|
const collator = new Intl.Collator();
|
|
105
|
-
|
|
106
|
-
function GridFilterForm(props) {
|
|
107
|
+
const GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(props, ref) {
|
|
107
108
|
var _rootProps$components, _rootProps$components2, _baseSelectProps$nati, _rootProps$components3, _rootProps$components4, _rootProps$components5, _currentColumn$filter2;
|
|
108
109
|
|
|
109
110
|
const {
|
|
@@ -123,7 +124,9 @@ function GridFilterForm(props) {
|
|
|
123
124
|
operatorInputProps = {},
|
|
124
125
|
columnInputProps = {},
|
|
125
126
|
valueInputProps = {}
|
|
126
|
-
} = props
|
|
127
|
+
} = props,
|
|
128
|
+
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
129
|
+
|
|
127
130
|
const apiRef = useGridApiContext();
|
|
128
131
|
const filterableColumns = useGridSelector(apiRef, gridFilterableColumnDefinitionsSelector);
|
|
129
132
|
const columnSelectId = useId();
|
|
@@ -223,8 +226,10 @@ function GridFilterForm(props) {
|
|
|
223
226
|
}
|
|
224
227
|
}
|
|
225
228
|
}), [currentOperator]);
|
|
226
|
-
return /*#__PURE__*/_jsxs(GridFilterFormRoot, {
|
|
227
|
-
|
|
229
|
+
return /*#__PURE__*/_jsxs(GridFilterFormRoot, _extends({
|
|
230
|
+
ref: ref,
|
|
231
|
+
className: classes.root
|
|
232
|
+
}, other, {
|
|
228
233
|
children: [/*#__PURE__*/_jsx(FilterFormDeleteIcon, _extends({
|
|
229
234
|
variant: "standard",
|
|
230
235
|
as: rootProps.components.BaseFormControl
|
|
@@ -319,36 +324,111 @@ function GridFilterForm(props) {
|
|
|
319
324
|
focusElementRef: valueRef
|
|
320
325
|
}, currentOperator.InputComponentProps)) : null
|
|
321
326
|
}))]
|
|
322
|
-
});
|
|
323
|
-
}
|
|
324
|
-
|
|
327
|
+
}));
|
|
328
|
+
});
|
|
325
329
|
process.env.NODE_ENV !== "production" ? GridFilterForm.propTypes = {
|
|
326
330
|
// ----------------------------- Warning --------------------------------
|
|
327
331
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
328
332
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
329
333
|
// ----------------------------------------------------------------------
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* Callback called when the operator, column field or value is changed.
|
|
337
|
+
* @param {GridFilterItem} item The updated [[GridFilterItem]].
|
|
338
|
+
*/
|
|
330
339
|
applyFilterChanges: PropTypes.func.isRequired,
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* Callback called when the logic operator is changed.
|
|
343
|
+
* @param {GridLinkOperator} operator The new logic operator.
|
|
344
|
+
*/
|
|
331
345
|
applyMultiFilterOperatorChanges: PropTypes.func.isRequired,
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* Props passed to the column input component.
|
|
349
|
+
* @default {}
|
|
350
|
+
*/
|
|
332
351
|
columnInputProps: PropTypes.any,
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* Changes how the options in the columns selector should be ordered.
|
|
355
|
+
* If not specified, the order is derived from the `columns` prop.
|
|
356
|
+
*/
|
|
333
357
|
columnsSort: PropTypes.oneOf(['asc', 'desc']),
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* Callback called when the delete button is clicked.
|
|
361
|
+
* @param {GridFilterItem} item The deleted [[GridFilterItem]].
|
|
362
|
+
*/
|
|
334
363
|
deleteFilter: PropTypes.func.isRequired,
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* Props passed to the delete icon.
|
|
367
|
+
* @default {}
|
|
368
|
+
*/
|
|
335
369
|
deleteIconProps: PropTypes.any,
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* If `true`, disables the logic operator field but still renders it.
|
|
373
|
+
*/
|
|
336
374
|
disableMultiFilterOperator: PropTypes.bool,
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* A ref allowing to set imperative focus.
|
|
378
|
+
* It can be passed to the el
|
|
379
|
+
*/
|
|
337
380
|
focusElementRef: PropTypes
|
|
338
381
|
/* @typescript-to-proptypes-ignore */
|
|
339
382
|
.oneOfType([PropTypes.func, PropTypes.object]),
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* If `true`, the logic operator field is rendered.
|
|
386
|
+
* The field will be invisible if `showMultiFilterOperators` is also `true`.
|
|
387
|
+
*/
|
|
340
388
|
hasMultipleFilters: PropTypes.bool.isRequired,
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* The [[GridFilterItem]] representing this form.
|
|
392
|
+
*/
|
|
341
393
|
item: PropTypes.shape({
|
|
342
394
|
columnField: PropTypes.string.isRequired,
|
|
343
395
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
344
396
|
operatorValue: PropTypes.string,
|
|
345
397
|
value: PropTypes.any
|
|
346
398
|
}).isRequired,
|
|
399
|
+
|
|
400
|
+
/**
|
|
401
|
+
* Props passed to the logic operator input component.
|
|
402
|
+
* @default {}
|
|
403
|
+
*/
|
|
347
404
|
linkOperatorInputProps: PropTypes.any,
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* Sets the available logic operators.
|
|
408
|
+
* @default [GridLinkOperator.And, GridLinkOperator.Or]
|
|
409
|
+
*/
|
|
348
410
|
linkOperators: PropTypes.arrayOf(PropTypes.oneOf(['and', 'or']).isRequired),
|
|
411
|
+
|
|
412
|
+
/**
|
|
413
|
+
* The current logic operator applied.
|
|
414
|
+
*/
|
|
349
415
|
multiFilterOperator: PropTypes.oneOf(['and', 'or']),
|
|
416
|
+
|
|
417
|
+
/**
|
|
418
|
+
* Props passed to the operator input component.
|
|
419
|
+
* @default {}
|
|
420
|
+
*/
|
|
350
421
|
operatorInputProps: PropTypes.any,
|
|
422
|
+
|
|
423
|
+
/**
|
|
424
|
+
* If `true`, the logic operator field is visible.
|
|
425
|
+
*/
|
|
351
426
|
showMultiFilterOperators: PropTypes.bool,
|
|
427
|
+
|
|
428
|
+
/**
|
|
429
|
+
* Props passed to the value input component.
|
|
430
|
+
* @default {}
|
|
431
|
+
*/
|
|
352
432
|
valueInputProps: PropTypes.any
|
|
353
433
|
} : void 0;
|
|
354
434
|
export { GridFilterForm };
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { SxProps, Theme } from '@mui/material/styles';
|
|
3
3
|
import { GridFilterFormProps } from './GridFilterForm';
|
|
4
4
|
export interface GridFilterPanelProps extends Pick<GridFilterFormProps, 'linkOperators' | 'columnsSort'> {
|
|
5
|
+
/**
|
|
6
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
7
|
+
*/
|
|
5
8
|
sx?: SxProps<Theme>;
|
|
9
|
+
/**
|
|
10
|
+
* Props passed to each filter form.
|
|
11
|
+
*/
|
|
6
12
|
filterFormProps?: Pick<GridFilterFormProps, 'columnsSort' | 'deleteIconProps' | 'linkOperatorInputProps' | 'operatorInputProps' | 'columnInputProps' | 'valueInputProps'>;
|
|
7
13
|
}
|
|
8
|
-
declare
|
|
9
|
-
declare namespace GridFilterPanel {
|
|
10
|
-
var propTypes: any;
|
|
11
|
-
}
|
|
14
|
+
declare const GridFilterPanel: React.ForwardRefExoticComponent<GridFilterPanelProps & React.RefAttributes<HTMLDivElement>>;
|
|
12
15
|
export { GridFilterPanel };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["linkOperators", "columnsSort", "filterFormProps"];
|
|
3
|
+
const _excluded = ["linkOperators", "columnsSort", "filterFormProps", "children"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { GridLinkOperator } from '../../../models/gridFilterItem';
|
|
@@ -16,8 +16,7 @@ import { gridFilterModelSelector } from '../../../hooks/features/filter/gridFilt
|
|
|
16
16
|
import { gridFilterableColumnDefinitionsSelector } from '../../../hooks/features/columns/gridColumnsSelector';
|
|
17
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
18
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
|
-
|
|
20
|
-
function GridFilterPanel(props) {
|
|
19
|
+
const GridFilterPanel = /*#__PURE__*/React.forwardRef(function GridFilterPanel(props, ref) {
|
|
21
20
|
var _rootProps$components;
|
|
22
21
|
|
|
23
22
|
const apiRef = useGridApiContext();
|
|
@@ -73,9 +72,7 @@ function GridFilterPanel(props) {
|
|
|
73
72
|
return;
|
|
74
73
|
}
|
|
75
74
|
|
|
76
|
-
apiRef.current.
|
|
77
|
-
items: [...items, defaultItem]
|
|
78
|
-
}));
|
|
75
|
+
apiRef.current.upsertFilterItems([...items, defaultItem]);
|
|
79
76
|
};
|
|
80
77
|
|
|
81
78
|
const deleteFilter = React.useCallback(item => {
|
|
@@ -96,7 +93,9 @@ function GridFilterPanel(props) {
|
|
|
96
93
|
lastFilterRef.current.focus();
|
|
97
94
|
}
|
|
98
95
|
}, [items.length]);
|
|
99
|
-
return /*#__PURE__*/_jsxs(GridPanelWrapper, _extends({
|
|
96
|
+
return /*#__PURE__*/_jsxs(GridPanelWrapper, _extends({
|
|
97
|
+
ref: ref
|
|
98
|
+
}, other, {
|
|
100
99
|
children: [/*#__PURE__*/_jsx(GridPanelContent, {
|
|
101
100
|
children: items.map((item, index) => /*#__PURE__*/_jsx(GridFilterForm, _extends({
|
|
102
101
|
item: item,
|
|
@@ -121,14 +120,22 @@ function GridFilterPanel(props) {
|
|
|
121
120
|
}))
|
|
122
121
|
})]
|
|
123
122
|
}));
|
|
124
|
-
}
|
|
125
|
-
|
|
123
|
+
});
|
|
126
124
|
process.env.NODE_ENV !== "production" ? GridFilterPanel.propTypes = {
|
|
127
125
|
// ----------------------------- Warning --------------------------------
|
|
128
126
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
129
127
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
130
128
|
// ----------------------------------------------------------------------
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Changes how the options in the columns selector should be ordered.
|
|
132
|
+
* If not specified, the order is derived from the `columns` prop.
|
|
133
|
+
*/
|
|
131
134
|
columnsSort: PropTypes.oneOf(['asc', 'desc']),
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Props passed to each filter form.
|
|
138
|
+
*/
|
|
132
139
|
filterFormProps: PropTypes.shape({
|
|
133
140
|
columnInputProps: PropTypes.any,
|
|
134
141
|
columnsSort: PropTypes.oneOf(['asc', 'desc']),
|
|
@@ -137,7 +144,16 @@ process.env.NODE_ENV !== "production" ? GridFilterPanel.propTypes = {
|
|
|
137
144
|
operatorInputProps: PropTypes.any,
|
|
138
145
|
valueInputProps: PropTypes.any
|
|
139
146
|
}),
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Sets the available logic operators.
|
|
150
|
+
* @default [GridLinkOperator.And, GridLinkOperator.Or]
|
|
151
|
+
*/
|
|
140
152
|
linkOperators: PropTypes.arrayOf(PropTypes.oneOf(['and', 'or']).isRequired),
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
156
|
+
*/
|
|
141
157
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
|
142
158
|
} : void 0;
|
|
143
159
|
export { GridFilterPanel };
|
|
@@ -10,5 +10,5 @@ export interface GridToolbarFilterButtonProps extends Omit<TooltipProps, 'title'
|
|
|
10
10
|
button?: ButtonProps;
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
|
-
declare const GridToolbarFilterButton: React.ForwardRefExoticComponent<Pick<GridToolbarFilterButtonProps, "hidden" | "color" | "style" | "open" | "translate" | "slot" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "
|
|
13
|
+
declare const GridToolbarFilterButton: React.ForwardRefExoticComponent<Pick<GridToolbarFilterButtonProps, "hidden" | "color" | "style" | "open" | "translate" | "slot" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "onClose" | "sx" | "classes" | "components" | "componentsProps" | "TransitionComponent" | "TransitionProps" | "onOpen" | "placement" | "arrow" | "describeChild" | "disableFocusListener" | "disableHoverListener" | "disableInteractive" | "disableTouchListener" | "enterDelay" | "enterNextDelay" | "enterTouchDelay" | "followCursor" | "leaveDelay" | "leaveTouchDelay" | "PopperComponent" | "PopperProps"> & React.RefAttributes<HTMLButtonElement>>;
|
|
14
14
|
export { GridToolbarFilterButton };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { TextFieldProps } from '@mui/material/TextField';
|
|
3
|
+
import { GridFilterModel } from '../../models/gridFilterModel';
|
|
3
4
|
export declare type GridToolbarQuickFilterProps = TextFieldProps & {
|
|
4
5
|
/**
|
|
5
6
|
* Function responsible for parsing text input in an array of independent values for quick filtering.
|
|
@@ -7,6 +8,12 @@ export declare type GridToolbarQuickFilterProps = TextFieldProps & {
|
|
|
7
8
|
* @returns {any[]} The array of value on which quick filter is applied
|
|
8
9
|
*/
|
|
9
10
|
quickFilterParser?: (input: string) => any[];
|
|
11
|
+
/**
|
|
12
|
+
* Function responsible for formatting values of quick filter in a string when the model is modified
|
|
13
|
+
* @param {any[]} values The new values passed to the quick filter model
|
|
14
|
+
* @returns {string} The string to display in the text field
|
|
15
|
+
*/
|
|
16
|
+
quickFilterFormatter?: (values: GridFilterModel['quickFilterValues']) => string;
|
|
10
17
|
/**
|
|
11
18
|
* The debounce time in milliseconds.
|
|
12
19
|
* @default 500
|