@mui/x-data-grid 6.0.0-beta.5 → 6.0.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 +175 -36
- package/DataGrid/DataGrid.js +6 -8
- package/components/GridColumnHeaders.d.ts +7 -0
- package/components/GridColumnHeaders.js +108 -0
- package/components/GridFooter.d.ts +1 -1
- package/components/GridLoadingOverlay.d.ts +1 -1
- package/components/GridNoResultsOverlay.d.ts +1 -1
- package/components/GridNoRowsOverlay.d.ts +1 -1
- package/components/GridRow.d.ts +13 -7
- package/components/GridRow.js +48 -30
- package/components/GridRowCount.d.ts +1 -1
- package/components/GridRowCount.js +1 -1
- package/components/GridScrollArea.js +1 -1
- package/components/GridSelectedRowCount.d.ts +1 -1
- package/components/GridSelectedRowCount.js +1 -1
- package/components/base/GridBody.d.ts +1 -4
- package/components/base/GridBody.js +43 -5
- package/components/base/GridOverlays.js +1 -1
- package/components/cell/GridCell.d.ts +2 -5
- package/components/cell/GridCell.js +14 -12
- package/components/cell/GridEditInputCell.js +1 -2
- package/components/cell/GridEditSingleSelectCell.js +17 -10
- package/components/columnHeaders/GridBaseColumnHeaders.d.ts +7 -0
- package/{modern/components/columnHeaders/GridColumnHeaders.js → components/columnHeaders/GridBaseColumnHeaders.js} +11 -15
- package/components/columnHeaders/GridColumnHeaderTitle.js +4 -6
- package/components/columnHeaders/GridColumnHeadersInner.d.ts +1 -1
- package/components/columnHeaders/GridColumnHeadersInner.js +1 -1
- package/components/columnHeaders/GridIconButtonContainer.js +1 -1
- package/components/containers/GridFooterContainer.d.ts +1 -1
- package/components/containers/GridFooterContainer.js +7 -10
- package/components/containers/GridMainContainer.js +1 -1
- package/components/containers/GridOverlay.d.ts +1 -2
- package/components/containers/GridOverlay.js +4 -6
- package/components/containers/GridRootStyles.js +7 -3
- package/components/containers/GridToolbarContainer.d.ts +1 -1
- package/components/containers/GridToolbarContainer.js +1 -1
- package/components/index.d.ts +1 -1
- package/components/index.js +1 -1
- package/components/panel/GridColumnsPanel.js +1 -2
- package/components/panel/GridPanel.d.ts +1 -1
- package/components/panel/GridPanelContent.d.ts +1 -1
- package/components/panel/GridPanelContent.js +1 -1
- package/components/panel/GridPanelFooter.d.ts +1 -1
- package/components/panel/GridPanelFooter.js +1 -1
- package/components/panel/GridPanelHeader.d.ts +1 -1
- package/components/panel/GridPanelHeader.js +1 -1
- package/components/panel/filterPanel/GridFilterForm.js +32 -30
- package/components/panel/filterPanel/GridFilterInputBoolean.js +12 -9
- package/components/panel/filterPanel/GridFilterInputDate.js +1 -2
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +1 -1
- package/components/panel/filterPanel/GridFilterInputSingleSelect.js +30 -13
- package/components/panel/filterPanel/GridFilterInputValue.js +1 -2
- package/components/panel/filterPanel/GridFilterPanel.d.ts +3 -3
- package/components/panel/filterPanel/GridFilterPanel.js +8 -1
- package/components/virtualization/GridVirtualScroller.d.ts +1 -1
- package/components/virtualization/GridVirtualScroller.js +1 -1
- package/components/virtualization/GridVirtualScrollerContent.d.ts +1 -1
- package/components/virtualization/GridVirtualScrollerContent.js +1 -1
- package/components/virtualization/GridVirtualScrollerRenderZone.d.ts +1 -1
- package/components/virtualization/GridVirtualScrollerRenderZone.js +1 -1
- package/constants/defaultGridSlotsComponents.js +5 -56
- package/constants/gridClasses.d.ts +1 -1
- package/hooks/core/useGridLocaleText.js +2 -4
- package/hooks/features/columnGrouping/gridColumnGroupsUtils.js +5 -5
- package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +22 -1
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +17 -26
- package/hooks/features/columnMenu/columnMenuInterfaces.d.ts +2 -2
- package/hooks/features/editing/useGridCellEditing.js +1 -1
- package/hooks/features/editing/useGridEditing.js +1 -1
- package/hooks/features/editing/useGridRowEditing.js +1 -1
- package/hooks/features/export/useGridPrintExport.js +10 -11
- package/hooks/features/statePersistence/gridStatePersistenceInterface.d.ts +2 -0
- package/hooks/features/virtualization/useGridVirtualScroller.js +35 -18
- package/index.d.ts +3 -0
- package/index.js +5 -1
- package/internals/index.d.ts +2 -1
- package/internals/index.js +1 -1
- package/legacy/DataGrid/DataGrid.js +6 -8
- package/legacy/components/GridColumnHeaders.js +106 -0
- package/legacy/components/GridRow.js +46 -30
- package/legacy/components/GridRowCount.js +1 -1
- package/legacy/components/GridScrollArea.js +1 -1
- package/legacy/components/GridSelectedRowCount.js +1 -1
- package/legacy/components/base/GridBody.js +43 -5
- package/legacy/components/base/GridOverlays.js +1 -1
- package/legacy/components/cell/GridCell.js +14 -12
- package/legacy/components/cell/GridEditInputCell.js +1 -2
- package/legacy/components/cell/GridEditSingleSelectCell.js +17 -12
- package/legacy/components/columnHeaders/{GridColumnHeaders.js → GridBaseColumnHeaders.js} +11 -14
- package/legacy/components/columnHeaders/GridColumnHeaderTitle.js +6 -9
- package/legacy/components/columnHeaders/GridColumnHeadersInner.js +1 -1
- package/legacy/components/columnHeaders/GridIconButtonContainer.js +1 -1
- package/legacy/components/containers/GridFooterContainer.js +7 -10
- package/legacy/components/containers/GridMainContainer.js +1 -1
- package/legacy/components/containers/GridOverlay.js +9 -12
- package/legacy/components/containers/GridRootStyles.js +7 -3
- package/legacy/components/containers/GridToolbarContainer.js +1 -1
- package/legacy/components/index.js +1 -1
- package/legacy/components/panel/GridColumnsPanel.js +1 -2
- package/legacy/components/panel/GridPanelContent.js +1 -1
- package/legacy/components/panel/GridPanelFooter.js +1 -1
- package/legacy/components/panel/GridPanelHeader.js +1 -1
- package/legacy/components/panel/filterPanel/GridFilterForm.js +32 -30
- package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +12 -9
- package/legacy/components/panel/filterPanel/GridFilterInputDate.js +1 -2
- package/legacy/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +2 -2
- package/legacy/components/panel/filterPanel/GridFilterInputSingleSelect.js +29 -13
- package/legacy/components/panel/filterPanel/GridFilterInputValue.js +1 -2
- package/legacy/components/panel/filterPanel/GridFilterPanel.js +8 -1
- package/legacy/components/virtualization/GridVirtualScroller.js +1 -1
- package/legacy/components/virtualization/GridVirtualScrollerContent.js +1 -1
- package/legacy/components/virtualization/GridVirtualScrollerRenderZone.js +1 -1
- package/legacy/constants/defaultGridSlotsComponents.js +5 -56
- package/legacy/hooks/core/useGridLocaleText.js +2 -4
- package/legacy/hooks/features/columnGrouping/gridColumnGroupsUtils.js +5 -5
- package/legacy/hooks/features/columnHeaders/useGridColumnHeaders.js +17 -26
- package/legacy/hooks/features/editing/useGridCellEditing.js +1 -1
- package/legacy/hooks/features/editing/useGridEditing.js +1 -1
- package/legacy/hooks/features/editing/useGridRowEditing.js +1 -1
- package/legacy/hooks/features/export/useGridPrintExport.js +10 -11
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +33 -16
- package/legacy/index.js +5 -1
- package/legacy/internals/index.js +1 -1
- package/legacy/locales/arSD.js +14 -19
- package/legacy/locales/csCZ.js +25 -33
- package/legacy/locales/esES.js +1 -1
- package/legacy/material/components/MUISelectOption.js +14 -0
- package/legacy/material/index.js +65 -0
- package/legacy/models/gridFilterItem.js +2 -0
- package/legacy/models/params/gridRowParams.js +4 -0
- package/locales/arSD.js +14 -19
- package/locales/csCZ.js +24 -32
- package/locales/esES.js +1 -1
- package/material/components/MUISelectOption.d.ts +3 -0
- package/material/components/MUISelectOption.js +16 -0
- package/material/index.d.ts +57 -0
- package/material/index.js +65 -0
- package/material/package.json +6 -0
- package/models/api/gridEditingApi.d.ts +1 -1
- package/models/colDef/gridColDef.d.ts +6 -0
- package/models/gridExport.d.ts +4 -0
- package/models/gridFilterItem.d.ts +2 -0
- package/models/gridFilterItem.js +2 -0
- package/models/gridFilterModel.d.ts +2 -0
- package/models/gridFilterOperator.d.ts +2 -0
- package/models/gridIconSlotsComponent.d.ts +10 -0
- package/models/gridSlotsComponent.d.ts +15 -0
- package/models/gridSlotsComponentsProps.d.ts +104 -24
- package/models/params/gridRowParams.d.ts +6 -0
- package/models/params/gridRowParams.js +4 -0
- package/models/props/DataGridProps.d.ts +6 -6
- package/modern/DataGrid/DataGrid.js +6 -8
- package/modern/components/GridColumnHeaders.js +108 -0
- package/modern/components/GridRow.js +48 -27
- package/modern/components/GridRowCount.js +1 -1
- package/modern/components/GridScrollArea.js +1 -1
- package/modern/components/GridSelectedRowCount.js +1 -1
- package/modern/components/base/GridBody.js +43 -5
- package/modern/components/base/GridOverlays.js +1 -1
- package/modern/components/cell/GridCell.js +14 -12
- package/modern/components/cell/GridEditInputCell.js +1 -2
- package/modern/components/cell/GridEditSingleSelectCell.js +16 -10
- package/{components/columnHeaders/GridColumnHeaders.js → modern/components/columnHeaders/GridBaseColumnHeaders.js} +11 -15
- package/modern/components/columnHeaders/GridColumnHeaderTitle.js +4 -6
- package/modern/components/columnHeaders/GridColumnHeadersInner.js +1 -1
- package/modern/components/columnHeaders/GridIconButtonContainer.js +1 -1
- package/modern/components/containers/GridFooterContainer.js +7 -10
- package/modern/components/containers/GridMainContainer.js +1 -1
- package/modern/components/containers/GridOverlay.js +4 -6
- package/modern/components/containers/GridRootStyles.js +7 -3
- package/modern/components/containers/GridToolbarContainer.js +1 -1
- package/modern/components/index.js +1 -1
- package/modern/components/panel/GridColumnsPanel.js +1 -2
- package/modern/components/panel/GridPanelContent.js +1 -1
- package/modern/components/panel/GridPanelFooter.js +1 -1
- package/modern/components/panel/GridPanelHeader.js +1 -1
- package/modern/components/panel/filterPanel/GridFilterForm.js +27 -25
- package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +9 -6
- package/modern/components/panel/filterPanel/GridFilterInputDate.js +1 -2
- package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +1 -1
- package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +27 -10
- package/modern/components/panel/filterPanel/GridFilterInputValue.js +1 -2
- package/modern/components/panel/filterPanel/GridFilterPanel.js +8 -1
- package/modern/components/virtualization/GridVirtualScroller.js +1 -1
- package/modern/components/virtualization/GridVirtualScrollerContent.js +1 -1
- package/modern/components/virtualization/GridVirtualScrollerRenderZone.js +1 -1
- package/modern/constants/defaultGridSlotsComponents.js +5 -56
- package/modern/hooks/core/useGridLocaleText.js +2 -4
- package/modern/hooks/features/columnGrouping/gridColumnGroupsUtils.js +5 -5
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +17 -26
- package/modern/hooks/features/editing/useGridCellEditing.js +1 -1
- package/modern/hooks/features/editing/useGridEditing.js +1 -1
- package/modern/hooks/features/editing/useGridRowEditing.js +1 -1
- package/modern/hooks/features/export/useGridPrintExport.js +10 -11
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +33 -17
- package/modern/index.js +5 -1
- package/modern/internals/index.js +1 -1
- package/modern/locales/arSD.js +14 -19
- package/modern/locales/csCZ.js +24 -32
- package/modern/locales/esES.js +1 -1
- package/modern/material/components/MUISelectOption.js +16 -0
- package/modern/material/index.js +65 -0
- package/modern/models/gridFilterItem.js +2 -0
- package/modern/models/params/gridRowParams.js +4 -0
- package/node/DataGrid/DataGrid.js +6 -8
- package/node/components/GridColumnHeaders.js +116 -0
- package/node/components/GridRow.js +48 -27
- package/node/components/GridRowCount.js +2 -2
- package/node/components/GridScrollArea.js +2 -2
- package/node/components/GridSelectedRowCount.js +2 -2
- package/node/components/base/GridBody.js +43 -5
- package/node/components/base/GridOverlays.js +3 -3
- package/node/components/cell/GridCell.js +14 -11
- package/node/components/cell/GridEditInputCell.js +1 -2
- package/node/components/cell/GridEditSingleSelectCell.js +15 -10
- package/node/components/columnHeaders/{GridColumnHeaders.js → GridBaseColumnHeaders.js} +14 -18
- package/node/components/columnHeaders/GridColumnHeaderTitle.js +5 -7
- package/node/components/columnHeaders/GridColumnHeadersInner.js +2 -2
- package/node/components/columnHeaders/GridIconButtonContainer.js +2 -2
- package/node/components/containers/GridFooterContainer.js +8 -11
- package/node/components/containers/GridMainContainer.js +2 -2
- package/node/components/containers/GridOverlay.js +5 -7
- package/node/components/containers/GridRootStyles.js +7 -3
- package/node/components/containers/GridToolbarContainer.js +2 -2
- package/node/components/index.js +1 -1
- package/node/components/panel/GridColumnsPanel.js +1 -2
- package/node/components/panel/GridPanelContent.js +2 -2
- package/node/components/panel/GridPanelFooter.js +2 -2
- package/node/components/panel/GridPanelHeader.js +2 -2
- package/node/components/panel/filterPanel/GridFilterForm.js +26 -25
- package/node/components/panel/filterPanel/GridFilterInputBoolean.js +9 -6
- package/node/components/panel/filterPanel/GridFilterInputDate.js +1 -2
- package/node/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +1 -1
- package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +26 -10
- package/node/components/panel/filterPanel/GridFilterInputValue.js +1 -2
- package/node/components/panel/filterPanel/GridFilterPanel.js +8 -1
- package/node/components/virtualization/GridVirtualScroller.js +2 -2
- package/node/components/virtualization/GridVirtualScrollerContent.js +2 -2
- package/node/components/virtualization/GridVirtualScrollerRenderZone.js +2 -2
- package/node/constants/defaultGridSlotsComponents.js +4 -55
- package/node/hooks/core/useGridLocaleText.js +2 -4
- package/node/hooks/features/columnGrouping/gridColumnGroupsUtils.js +5 -5
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +19 -28
- package/node/hooks/features/editing/useGridCellEditing.js +1 -1
- package/node/hooks/features/editing/useGridEditing.js +1 -1
- package/node/hooks/features/editing/useGridRowEditing.js +1 -1
- package/node/hooks/features/export/useGridPrintExport.js +10 -11
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +32 -15
- package/node/index.js +9 -1
- package/node/internals/index.js +4 -4
- package/node/locales/arSD.js +14 -19
- package/node/locales/csCZ.js +24 -32
- package/node/locales/esES.js +1 -1
- package/node/{components/DataGridColumnHeaders.js → material/components/MUISelectOption.js} +13 -35
- package/node/material/index.js +73 -0
- package/node/models/gridFilterItem.js +2 -0
- package/node/models/params/gridRowParams.js +4 -0
- package/package.json +1 -1
- package/components/DataGridColumnHeaders.d.ts +0 -6
- package/components/DataGridColumnHeaders.js +0 -38
- package/components/columnHeaders/GridColumnHeaders.d.ts +0 -7
- package/legacy/components/DataGridColumnHeaders.js +0 -36
- package/modern/components/DataGridColumnHeaders.js +0 -38
- /package/legacy/{components/columnHeaders → material/icons}/GridColumnUnsortedIcon.js +0 -0
- /package/legacy/{components → material}/icons/index.js +0 -0
- /package/{components/columnHeaders → material/icons}/GridColumnUnsortedIcon.d.ts +0 -0
- /package/{components/columnHeaders → material/icons}/GridColumnUnsortedIcon.js +0 -0
- /package/{components → material}/icons/index.d.ts +0 -0
- /package/{components → material}/icons/index.js +0 -0
- /package/modern/{components/columnHeaders → material/icons}/GridColumnUnsortedIcon.js +0 -0
- /package/modern/{components → material}/icons/index.js +0 -0
- /package/node/{components/columnHeaders → material/icons}/GridColumnUnsortedIcon.js +0 -0
- /package/node/{components → material}/icons/index.js +0 -0
|
@@ -5,9 +5,6 @@ const _excluded = ["item", "hasMultipleFilters", "deleteFilter", "applyFilterCha
|
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import { unstable_composeClasses as composeClasses, unstable_useId as useId, unstable_capitalize as capitalize } from '@mui/utils';
|
|
8
|
-
import MenuItem from '@mui/material/MenuItem';
|
|
9
|
-
import InputLabel from '@mui/material/InputLabel';
|
|
10
|
-
import FormControl from '@mui/material/FormControl';
|
|
11
8
|
import { styled } from '@mui/material/styles';
|
|
12
9
|
import clsx from 'clsx';
|
|
13
10
|
import { gridFilterableColumnDefinitionsSelector } from '../../../hooks/features/columns/gridColumnsSelector';
|
|
@@ -18,6 +15,7 @@ import { useGridApiContext } from '../../../hooks/utils/useGridApiContext';
|
|
|
18
15
|
import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
|
|
19
16
|
import { getDataGridUtilityClass } from '../../../constants/gridClasses';
|
|
20
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
|
+
import { createElement as _createElement } from "react";
|
|
21
19
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
20
|
const useUtilityClasses = ownerState => {
|
|
23
21
|
const {
|
|
@@ -43,7 +41,7 @@ const GridFilterFormRoot = styled('div', {
|
|
|
43
41
|
display: 'flex',
|
|
44
42
|
padding: theme.spacing(1)
|
|
45
43
|
}));
|
|
46
|
-
const FilterFormDeleteIcon = styled(
|
|
44
|
+
const FilterFormDeleteIcon = styled('div', {
|
|
47
45
|
name: 'MuiDataGrid',
|
|
48
46
|
slot: 'FilterFormDeleteIcon',
|
|
49
47
|
overridesResolver: (_, styles) => styles.filterFormDeleteIcon
|
|
@@ -55,7 +53,7 @@ const FilterFormDeleteIcon = styled(FormControl, {
|
|
|
55
53
|
marginRight: theme.spacing(0.5),
|
|
56
54
|
marginBottom: theme.spacing(0.2)
|
|
57
55
|
}));
|
|
58
|
-
const FilterFormLogicOperatorInput = styled(
|
|
56
|
+
const FilterFormLogicOperatorInput = styled('div', {
|
|
59
57
|
name: 'MuiDataGrid',
|
|
60
58
|
slot: 'FilterFormLogicOperatorInput',
|
|
61
59
|
overridesResolver: (_, styles) => styles.filterFormLogicOperatorInput
|
|
@@ -64,21 +62,21 @@ const FilterFormLogicOperatorInput = styled(FormControl, {
|
|
|
64
62
|
marginRight: 5,
|
|
65
63
|
justifyContent: 'end'
|
|
66
64
|
});
|
|
67
|
-
const FilterFormColumnInput = styled(
|
|
65
|
+
const FilterFormColumnInput = styled('div', {
|
|
68
66
|
name: 'MuiDataGrid',
|
|
69
67
|
slot: 'FilterFormColumnInput',
|
|
70
68
|
overridesResolver: (_, styles) => styles.filterFormColumnInput
|
|
71
69
|
})({
|
|
72
70
|
width: 150
|
|
73
71
|
});
|
|
74
|
-
const FilterFormOperatorInput = styled(
|
|
72
|
+
const FilterFormOperatorInput = styled('div', {
|
|
75
73
|
name: 'MuiDataGrid',
|
|
76
74
|
slot: 'FilterFormOperatorInput',
|
|
77
75
|
overridesResolver: (_, styles) => styles.filterFormOperatorInput
|
|
78
76
|
})({
|
|
79
77
|
width: 120
|
|
80
78
|
});
|
|
81
|
-
const FilterFormValueInput = styled(
|
|
79
|
+
const FilterFormValueInput = styled('div', {
|
|
82
80
|
name: 'MuiDataGrid',
|
|
83
81
|
slot: 'FilterFormValueInput',
|
|
84
82
|
overridesResolver: (_, styles) => styles.filterFormValueInput
|
|
@@ -133,7 +131,8 @@ const GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(pro
|
|
|
133
131
|
const baseFormControlProps = rootProps.slotProps?.baseFormControl || {};
|
|
134
132
|
const baseSelectProps = rootProps.slotProps?.baseSelect || {};
|
|
135
133
|
const isBaseSelectNative = baseSelectProps.native ?? true;
|
|
136
|
-
const
|
|
134
|
+
const baseInputLabelProps = rootProps.slotProps?.baseInputLabel || {};
|
|
135
|
+
const baseSelectOptionProps = rootProps.slotProps?.baseSelectOption || {};
|
|
137
136
|
const {
|
|
138
137
|
InputComponentProps
|
|
139
138
|
} = valueInputProps,
|
|
@@ -262,10 +261,11 @@ const GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(pro
|
|
|
262
261
|
disabled: !!disableMultiFilterOperator || logicOperators.length === 1,
|
|
263
262
|
native: isBaseSelectNative
|
|
264
263
|
}, rootProps.slotProps?.baseSelect, {
|
|
265
|
-
children: logicOperators.map(logicOperator => /*#__PURE__*/
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
264
|
+
children: logicOperators.map(logicOperator => /*#__PURE__*/_createElement(rootProps.slots.baseSelectOption, _extends({}, baseSelectOptionProps, {
|
|
265
|
+
native: isBaseSelectNative,
|
|
266
|
+
key: logicOperator.toString(),
|
|
267
|
+
value: logicOperator.toString()
|
|
268
|
+
}), apiRef.current.getLocaleText(getLogicOperatorLocaleKey(logicOperator))))
|
|
269
269
|
}))
|
|
270
270
|
})), /*#__PURE__*/_jsxs(FilterFormColumnInput, _extends({
|
|
271
271
|
variant: "standard",
|
|
@@ -273,11 +273,11 @@ const GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(pro
|
|
|
273
273
|
}, baseFormControlProps, columnInputProps, {
|
|
274
274
|
className: clsx(classes.columnInput, baseFormControlProps.className, columnInputProps.className),
|
|
275
275
|
ownerState: rootProps,
|
|
276
|
-
children: [/*#__PURE__*/_jsx(
|
|
276
|
+
children: [/*#__PURE__*/_jsx(rootProps.slots.baseInputLabel, _extends({}, baseInputLabelProps, {
|
|
277
277
|
htmlFor: columnSelectId,
|
|
278
278
|
id: columnSelectLabelId,
|
|
279
279
|
children: apiRef.current.getLocaleText('filterPanelColumns')
|
|
280
|
-
}), /*#__PURE__*/_jsx(rootProps.slots.baseSelect, _extends({
|
|
280
|
+
})), /*#__PURE__*/_jsx(rootProps.slots.baseSelect, _extends({
|
|
281
281
|
labelId: columnSelectLabelId,
|
|
282
282
|
id: columnSelectId,
|
|
283
283
|
label: apiRef.current.getLocaleText('filterPanelColumns'),
|
|
@@ -285,10 +285,11 @@ const GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(pro
|
|
|
285
285
|
onChange: changeColumn,
|
|
286
286
|
native: isBaseSelectNative
|
|
287
287
|
}, rootProps.slotProps?.baseSelect, {
|
|
288
|
-
children: sortedFilteredColumns.map(col => /*#__PURE__*/
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
288
|
+
children: sortedFilteredColumns.map(col => /*#__PURE__*/_createElement(rootProps.slots.baseSelectOption, _extends({}, baseSelectOptionProps, {
|
|
289
|
+
native: isBaseSelectNative,
|
|
290
|
+
key: col.field,
|
|
291
|
+
value: col.field
|
|
292
|
+
}), getColumnLabel(col)))
|
|
292
293
|
}))]
|
|
293
294
|
})), /*#__PURE__*/_jsxs(FilterFormOperatorInput, _extends({
|
|
294
295
|
variant: "standard",
|
|
@@ -296,11 +297,11 @@ const GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(pro
|
|
|
296
297
|
}, baseFormControlProps, operatorInputProps, {
|
|
297
298
|
className: clsx(classes.operatorInput, baseFormControlProps.className, operatorInputProps.className),
|
|
298
299
|
ownerState: rootProps,
|
|
299
|
-
children: [/*#__PURE__*/_jsx(
|
|
300
|
+
children: [/*#__PURE__*/_jsx(rootProps.slots.baseInputLabel, _extends({}, baseInputLabelProps, {
|
|
300
301
|
htmlFor: operatorSelectId,
|
|
301
302
|
id: operatorSelectLabelId,
|
|
302
303
|
children: apiRef.current.getLocaleText('filterPanelOperator')
|
|
303
|
-
}), /*#__PURE__*/_jsx(rootProps.slots.baseSelect, _extends({
|
|
304
|
+
})), /*#__PURE__*/_jsx(rootProps.slots.baseSelect, _extends({
|
|
304
305
|
labelId: operatorSelectLabelId,
|
|
305
306
|
label: apiRef.current.getLocaleText('filterPanelOperator'),
|
|
306
307
|
id: operatorSelectId,
|
|
@@ -309,10 +310,11 @@ const GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(pro
|
|
|
309
310
|
native: isBaseSelectNative,
|
|
310
311
|
inputRef: filterSelectorRef
|
|
311
312
|
}, rootProps.slotProps?.baseSelect, {
|
|
312
|
-
children: currentColumn?.filterOperators?.map(operator => /*#__PURE__*/
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
313
|
+
children: currentColumn?.filterOperators?.map(operator => /*#__PURE__*/_createElement(rootProps.slots.baseSelectOption, _extends({}, baseSelectOptionProps, {
|
|
314
|
+
native: isBaseSelectNative,
|
|
315
|
+
key: operator.value,
|
|
316
|
+
value: operator.value
|
|
317
|
+
}), operator.label || apiRef.current.getLocaleText(`filterOperator${capitalize(operator.value)}`)))
|
|
316
318
|
}))]
|
|
317
319
|
})), /*#__PURE__*/_jsx(FilterFormValueInput, _extends({
|
|
318
320
|
variant: "standard",
|
|
@@ -2,7 +2,6 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
3
|
const _excluded = ["item", "applyValue", "apiRef", "focusElementRef"];
|
|
4
4
|
import * as React from 'react';
|
|
5
|
-
import MenuItem from '@mui/material/MenuItem';
|
|
6
5
|
import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
|
|
7
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
7
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -18,7 +17,7 @@ export function GridFilterInputBoolean(props) {
|
|
|
18
17
|
const rootProps = useGridRootProps();
|
|
19
18
|
const baseSelectProps = rootProps.slotProps?.baseSelect || {};
|
|
20
19
|
const isSelectNative = baseSelectProps.native ?? true;
|
|
21
|
-
const
|
|
20
|
+
const baseSelectOptionProps = rootProps.slotProps?.baseSelectOption || {};
|
|
22
21
|
const onFilterChange = React.useCallback(event => {
|
|
23
22
|
const value = event.target.value;
|
|
24
23
|
setFilterValueState(value);
|
|
@@ -30,6 +29,7 @@ export function GridFilterInputBoolean(props) {
|
|
|
30
29
|
setFilterValueState(item.value || '');
|
|
31
30
|
}, [item.value]);
|
|
32
31
|
return /*#__PURE__*/_jsxs(rootProps.slots.baseTextField, _extends({
|
|
32
|
+
// TODO: use baseSelect slot
|
|
33
33
|
label: apiRef.current.getLocaleText('filterPanelInputLabel'),
|
|
34
34
|
value: filterValueState,
|
|
35
35
|
onChange: onFilterChange,
|
|
@@ -44,15 +44,18 @@ export function GridFilterInputBoolean(props) {
|
|
|
44
44
|
},
|
|
45
45
|
inputRef: focusElementRef
|
|
46
46
|
}, others, rootProps.slotProps?.baseTextField, {
|
|
47
|
-
children: [/*#__PURE__*/_jsx(
|
|
47
|
+
children: [/*#__PURE__*/_jsx(rootProps.slots.baseSelectOption, _extends({}, baseSelectOptionProps, {
|
|
48
|
+
native: isSelectNative,
|
|
48
49
|
value: "",
|
|
49
50
|
children: apiRef.current.getLocaleText('filterValueAny')
|
|
50
|
-
}), /*#__PURE__*/_jsx(
|
|
51
|
+
})), /*#__PURE__*/_jsx(rootProps.slots.baseSelectOption, _extends({}, baseSelectOptionProps, {
|
|
52
|
+
native: isSelectNative,
|
|
51
53
|
value: "true",
|
|
52
54
|
children: apiRef.current.getLocaleText('filterValueTrue')
|
|
53
|
-
}), /*#__PURE__*/_jsx(
|
|
55
|
+
})), /*#__PURE__*/_jsx(rootProps.slots.baseSelectOption, _extends({}, baseSelectOptionProps, {
|
|
56
|
+
native: isSelectNative,
|
|
54
57
|
value: "false",
|
|
55
58
|
children: apiRef.current.getLocaleText('filterValueFalse')
|
|
56
|
-
})]
|
|
59
|
+
}))]
|
|
57
60
|
}));
|
|
58
61
|
}
|
|
@@ -4,7 +4,6 @@ const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "I
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { unstable_useId as useId } from '@mui/utils';
|
|
7
|
-
import { GridLoadIcon } from '../../icons';
|
|
8
7
|
import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
|
|
9
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
9
|
export const SUBMIT_FILTER_DATE_STROKE_TIME = 500;
|
|
@@ -57,7 +56,7 @@ function GridFilterInputDate(props) {
|
|
|
57
56
|
},
|
|
58
57
|
inputRef: focusElementRef,
|
|
59
58
|
InputProps: _extends({}, applying ? {
|
|
60
|
-
endAdornment: /*#__PURE__*/_jsx(
|
|
59
|
+
endAdornment: /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {})
|
|
61
60
|
} : {}, InputProps, {
|
|
62
61
|
inputProps: _extends({
|
|
63
62
|
max: type === 'datetime-local' ? '9999-12-31T23:59' : '9999-12-31'
|
|
@@ -68,7 +68,7 @@ function GridFilterInputMultipleSingleSelect(props) {
|
|
|
68
68
|
if (resolvedValueOptions !== undefined) {
|
|
69
69
|
const itemValueIndexes = item.value.map(element => {
|
|
70
70
|
// Gets the index matching between values and valueOptions
|
|
71
|
-
return resolvedFormattedValueOptions?.findIndex(
|
|
71
|
+
return resolvedFormattedValueOptions?.findIndex(formattedOption => formattedOption === element);
|
|
72
72
|
});
|
|
73
73
|
return itemValueIndexes.filter(index => index >= 0).map(index => resolvedValueOptions[index]);
|
|
74
74
|
}
|
|
@@ -1,27 +1,35 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
3
|
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "getOptionLabel", "getOptionValue"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { unstable_useId as useId } from '@mui/utils';
|
|
7
|
-
import MenuItem from '@mui/material/MenuItem';
|
|
8
7
|
import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
|
|
9
8
|
import { getValueFromValueOptions, isSingleSelectColDef } from './filterPanelUtils';
|
|
9
|
+
import { createElement as _createElement } from "react";
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
11
|
const renderSingleSelectOptions = ({
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
column: {
|
|
13
|
+
valueOptions,
|
|
14
|
+
field
|
|
15
|
+
},
|
|
16
|
+
OptionComponent,
|
|
17
|
+
getOptionLabel,
|
|
18
|
+
getOptionValue,
|
|
19
|
+
isSelectNative,
|
|
20
|
+
baseSelectOptionProps
|
|
21
|
+
}) => {
|
|
15
22
|
const iterableColumnValues = typeof valueOptions === 'function' ? ['', ...valueOptions({
|
|
16
23
|
field
|
|
17
24
|
})] : ['', ...(valueOptions || [])];
|
|
18
25
|
return iterableColumnValues.map(option => {
|
|
19
26
|
const value = getOptionValue(option);
|
|
20
27
|
const label = getOptionLabel(option);
|
|
21
|
-
return /*#__PURE__*/
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
28
|
+
return /*#__PURE__*/_createElement(OptionComponent, _extends({}, baseSelectOptionProps, {
|
|
29
|
+
native: isSelectNative,
|
|
30
|
+
key: value,
|
|
31
|
+
value: value
|
|
32
|
+
}), label);
|
|
25
33
|
});
|
|
26
34
|
};
|
|
27
35
|
function GridFilterInputSingleSelect(props) {
|
|
@@ -40,6 +48,7 @@ function GridFilterInputSingleSelect(props) {
|
|
|
40
48
|
const rootProps = useGridRootProps();
|
|
41
49
|
const baseSelectProps = rootProps.slotProps?.baseSelect || {};
|
|
42
50
|
const isSelectNative = baseSelectProps.native ?? true;
|
|
51
|
+
const baseSelectOptionProps = rootProps.slotProps?.baseSelectOption || {};
|
|
43
52
|
let resolvedColumn = null;
|
|
44
53
|
if (item.field) {
|
|
45
54
|
const column = apiRef.current.getColumn(item.field);
|
|
@@ -91,6 +100,7 @@ function GridFilterInputSingleSelect(props) {
|
|
|
91
100
|
return null;
|
|
92
101
|
}
|
|
93
102
|
return /*#__PURE__*/_jsx(rootProps.slots.baseTextField, _extends({
|
|
103
|
+
// TODO: use baseSelect slot
|
|
94
104
|
id: id,
|
|
95
105
|
label: apiRef.current.getLocaleText('filterPanelInputLabel'),
|
|
96
106
|
placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
|
|
@@ -107,7 +117,14 @@ function GridFilterInputSingleSelect(props) {
|
|
|
107
117
|
native: isSelectNative
|
|
108
118
|
}, rootProps.slotProps?.baseSelect)
|
|
109
119
|
}, others, rootProps.slotProps?.baseTextField, {
|
|
110
|
-
children: renderSingleSelectOptions(
|
|
120
|
+
children: renderSingleSelectOptions({
|
|
121
|
+
column: resolvedColumn,
|
|
122
|
+
OptionComponent: rootProps.slots.baseSelectOption,
|
|
123
|
+
getOptionLabel,
|
|
124
|
+
getOptionValue,
|
|
125
|
+
isSelectNative,
|
|
126
|
+
baseSelectOptionProps
|
|
127
|
+
})
|
|
111
128
|
}));
|
|
112
129
|
}
|
|
113
130
|
process.env.NODE_ENV !== "production" ? GridFilterInputSingleSelect.propTypes = {
|
|
@@ -4,7 +4,6 @@ const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef"];
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { unstable_useId as useId } from '@mui/utils';
|
|
7
|
-
import { GridLoadIcon } from '../../icons';
|
|
8
7
|
import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
|
|
9
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
9
|
export const SUBMIT_FILTER_STROKE_TIME = 500;
|
|
@@ -46,7 +45,7 @@ function GridFilterInputValue(props) {
|
|
|
46
45
|
setFilterValueState(String(itemValue));
|
|
47
46
|
}, [item.value]);
|
|
48
47
|
const InputProps = applying ? {
|
|
49
|
-
endAdornment: /*#__PURE__*/_jsx(
|
|
48
|
+
endAdornment: /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {})
|
|
50
49
|
} : others.InputProps;
|
|
51
50
|
return /*#__PURE__*/_jsx(rootProps.slots.baseTextField, _extends({
|
|
52
51
|
id: id,
|
|
@@ -49,6 +49,9 @@ const GridFilterPanel = /*#__PURE__*/React.forwardRef(function GridFilterPanel(p
|
|
|
49
49
|
currentFilters: filterModel?.items || [],
|
|
50
50
|
columns: filterableColumns
|
|
51
51
|
});
|
|
52
|
+
if (nextFieldName === null) {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
52
55
|
nextColumnWithOperator = filterableColumns.find(({
|
|
53
56
|
field
|
|
54
57
|
}) => field === nextFieldName);
|
|
@@ -71,6 +74,9 @@ const GridFilterPanel = /*#__PURE__*/React.forwardRef(function GridFilterPanel(p
|
|
|
71
74
|
currentFilters: currentFilters,
|
|
72
75
|
columns: filterableColumns
|
|
73
76
|
});
|
|
77
|
+
if (nextColumnFieldName === null) {
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
74
80
|
const nextColumnWithOperator = filterableColumns.find(({
|
|
75
81
|
field
|
|
76
82
|
}) => field === nextColumnFieldName);
|
|
@@ -175,6 +181,7 @@ process.env.NODE_ENV !== "production" ? GridFilterPanel.propTypes = {
|
|
|
175
181
|
columnInputProps: PropTypes.any,
|
|
176
182
|
columnsSort: PropTypes.oneOf(['asc', 'desc']),
|
|
177
183
|
deleteIconProps: PropTypes.any,
|
|
184
|
+
filterColumns: PropTypes.func,
|
|
178
185
|
logicOperatorInputProps: PropTypes.any,
|
|
179
186
|
operatorInputProps: PropTypes.any,
|
|
180
187
|
valueInputProps: PropTypes.any
|
|
@@ -182,7 +189,7 @@ process.env.NODE_ENV !== "production" ? GridFilterPanel.propTypes = {
|
|
|
182
189
|
/**
|
|
183
190
|
* Function that returns the next filter item to be picked as default filter.
|
|
184
191
|
* @param {GetColumnForNewFilterArgs} args Currently configured filters and columns.
|
|
185
|
-
* @returns {GridColDef['field']} The field to be used for the next filter.
|
|
192
|
+
* @returns {GridColDef['field']} The field to be used for the next filter or `null` to prevent adding a filter.
|
|
186
193
|
*/
|
|
187
194
|
getColumnForNewFilter: PropTypes.func,
|
|
188
195
|
/**
|
|
@@ -3,7 +3,7 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
3
3
|
const _excluded = ["className"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
|
-
import { styled } from '@mui/
|
|
6
|
+
import { styled } from '@mui/system';
|
|
7
7
|
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
8
8
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
9
9
|
import { getDataGridUtilityClass } from '../../constants/gridClasses';
|
|
@@ -3,7 +3,7 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
3
3
|
const _excluded = ["className", "style"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
|
-
import { styled } from '@mui/
|
|
6
|
+
import { styled } from '@mui/system';
|
|
7
7
|
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
8
8
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
9
9
|
import { getDataGridUtilityClass } from '../../constants/gridClasses';
|
|
@@ -3,7 +3,7 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
3
3
|
const _excluded = ["className"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
|
-
import { styled } from '@mui/
|
|
6
|
+
import { styled } from '@mui/system';
|
|
7
7
|
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
8
8
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
9
9
|
import { getDataGridUtilityClass } from '../../constants/gridClasses';
|
|
@@ -1,66 +1,15 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import MUIFormControl from '@mui/material/FormControl';
|
|
5
|
-
import MUISelect from '@mui/material/Select';
|
|
6
|
-
import MUISwitch from '@mui/material/Switch';
|
|
7
|
-
import MUIButton from '@mui/material/Button';
|
|
8
|
-
import MUIIconButton from '@mui/material/IconButton';
|
|
9
|
-
import MUITooltip from '@mui/material/Tooltip';
|
|
10
|
-
import MUIPopper from '@mui/material/Popper';
|
|
11
|
-
import { GridArrowDownwardIcon, GridArrowUpwardIcon, GridCell, GridSkeletonCell, GridCheckIcon, GridCloseIcon, GridColumnIcon, GridColumnsPanel, GridFilterAltIcon, GridFilterListIcon, GridFilterPanel, GridFooter, GridLoadingOverlay, GridNoRowsOverlay, GridPagination, GridPanel, GridPreferencesPanel, GridRow, GridSaveAltIcon, GridSeparatorIcon, GridTableRowsIcon, GridTripleDotsVerticalIcon, GridViewHeadlineIcon, GridViewStreamIcon, GridMoreVertIcon, GridExpandMoreIcon, GridKeyboardArrowRight, GridAddIcon, GridRemoveIcon, GridDragIcon, GridColumnHeaderFilterIconButton, GridSearchIcon, GridVisibilityOffIcon, GridViewColumnIcon, GridClearIcon, GridDeleteIcon, GridDeleteForeverIcon } from '../components';
|
|
2
|
+
import { GridCell, GridSkeletonCell, GridColumnsPanel, GridFilterPanel, GridFooter, GridLoadingOverlay, GridNoRowsOverlay, GridPagination, GridPanel, GridPreferencesPanel, GridRow, GridColumnHeaderFilterIconButton } from '../components';
|
|
3
|
+
import { GridColumnHeaders } from '../components/GridColumnHeaders';
|
|
12
4
|
import { GridColumnMenu } from '../components/menu/columnMenu/GridColumnMenu';
|
|
13
|
-
import { GridColumnUnsortedIcon } from '../components/columnHeaders/GridColumnUnsortedIcon';
|
|
14
5
|
import { GridNoResultsOverlay } from '../components/GridNoResultsOverlay';
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
BooleanCellFalseIcon: GridCloseIcon,
|
|
18
|
-
ColumnMenuIcon: GridTripleDotsVerticalIcon,
|
|
19
|
-
OpenFilterButtonIcon: GridFilterListIcon,
|
|
20
|
-
FilterPanelAddIcon: GridAddIcon,
|
|
21
|
-
FilterPanelDeleteIcon: GridDeleteIcon,
|
|
22
|
-
FilterPanelRemoveAllIcon: GridDeleteForeverIcon,
|
|
23
|
-
ColumnFilteredIcon: GridFilterAltIcon,
|
|
24
|
-
ColumnSelectorIcon: GridColumnIcon,
|
|
25
|
-
ColumnUnsortedIcon: GridColumnUnsortedIcon,
|
|
26
|
-
ColumnSortedAscendingIcon: GridArrowUpwardIcon,
|
|
27
|
-
ColumnSortedDescendingIcon: GridArrowDownwardIcon,
|
|
28
|
-
ColumnResizeIcon: GridSeparatorIcon,
|
|
29
|
-
DensityCompactIcon: GridViewHeadlineIcon,
|
|
30
|
-
DensityStandardIcon: GridTableRowsIcon,
|
|
31
|
-
DensityComfortableIcon: GridViewStreamIcon,
|
|
32
|
-
ExportIcon: GridSaveAltIcon,
|
|
33
|
-
MoreActionsIcon: GridMoreVertIcon,
|
|
34
|
-
TreeDataCollapseIcon: GridExpandMoreIcon,
|
|
35
|
-
TreeDataExpandIcon: GridKeyboardArrowRight,
|
|
36
|
-
GroupingCriteriaCollapseIcon: GridExpandMoreIcon,
|
|
37
|
-
GroupingCriteriaExpandIcon: GridKeyboardArrowRight,
|
|
38
|
-
DetailPanelExpandIcon: GridAddIcon,
|
|
39
|
-
DetailPanelCollapseIcon: GridRemoveIcon,
|
|
40
|
-
RowReorderIcon: GridDragIcon,
|
|
41
|
-
QuickFilterIcon: GridSearchIcon,
|
|
42
|
-
QuickFilterClearIcon: GridCloseIcon,
|
|
43
|
-
ColumnMenuHideIcon: GridVisibilityOffIcon,
|
|
44
|
-
ColumnMenuSortAscendingIcon: GridArrowUpwardIcon,
|
|
45
|
-
ColumnMenuSortDescendingIcon: GridArrowDownwardIcon,
|
|
46
|
-
ColumnMenuFilterIcon: GridFilterAltIcon,
|
|
47
|
-
ColumnMenuManageColumnsIcon: GridViewColumnIcon,
|
|
48
|
-
ColumnMenuClearIcon: GridClearIcon
|
|
49
|
-
};
|
|
50
|
-
export const DATA_GRID_DEFAULT_SLOTS_COMPONENTS = _extends({}, DEFAULT_GRID_ICON_SLOTS_COMPONENTS, {
|
|
51
|
-
BaseCheckbox: MUICheckbox,
|
|
52
|
-
BaseTextField: MUITextField,
|
|
53
|
-
BaseFormControl: MUIFormControl,
|
|
54
|
-
BaseSelect: MUISelect,
|
|
55
|
-
BaseSwitch: MUISwitch,
|
|
56
|
-
BaseButton: MUIButton,
|
|
57
|
-
BaseIconButton: MUIIconButton,
|
|
58
|
-
BaseTooltip: MUITooltip,
|
|
59
|
-
BasePopper: MUIPopper,
|
|
6
|
+
import materialSlots from '../material';
|
|
7
|
+
export const DATA_GRID_DEFAULT_SLOTS_COMPONENTS = _extends({}, materialSlots, {
|
|
60
8
|
Cell: GridCell,
|
|
61
9
|
SkeletonCell: GridSkeletonCell,
|
|
62
10
|
ColumnHeaderFilterIconButton: GridColumnHeaderFilterIconButton,
|
|
63
11
|
ColumnMenu: GridColumnMenu,
|
|
12
|
+
ColumnHeaders: GridColumnHeaders,
|
|
64
13
|
Footer: GridFooter,
|
|
65
14
|
Toolbar: null,
|
|
66
15
|
PreferencesPanel: GridPreferencesPanel,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { useGridApiMethod } from '../utils/useGridApiMethod';
|
|
3
2
|
export const useGridLocaleText = (apiRef, props) => {
|
|
4
3
|
const getLocaleText = React.useCallback(key => {
|
|
5
4
|
if (props.localeText[key] == null) {
|
|
@@ -7,8 +6,7 @@ export const useGridLocaleText = (apiRef, props) => {
|
|
|
7
6
|
}
|
|
8
7
|
return props.localeText[key];
|
|
9
8
|
}, [props.localeText]);
|
|
10
|
-
|
|
9
|
+
apiRef.current.register('public', {
|
|
11
10
|
getLocaleText
|
|
12
|
-
};
|
|
13
|
-
useGridApiMethod(apiRef, localeTextApi, 'public');
|
|
11
|
+
});
|
|
14
12
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { isLeaf } from '../../../models/gridColumnGrouping';
|
|
2
2
|
import { isDeepEqual } from '../../../utils/utils';
|
|
3
3
|
// This is the recurrence function that help writing `unwrapGroupingColumnModel()`
|
|
4
|
-
const recurrentUnwrapGroupingColumnModel = (columnGroupNode, parents,
|
|
4
|
+
const recurrentUnwrapGroupingColumnModel = (columnGroupNode, parents, unwrappedGroupingModelToComplete) => {
|
|
5
5
|
if (isLeaf(columnGroupNode)) {
|
|
6
|
-
if (
|
|
7
|
-
throw new Error([`MUI: columnGroupingModel contains duplicated field`, `column field ${columnGroupNode.field}
|
|
6
|
+
if (unwrappedGroupingModelToComplete[columnGroupNode.field] !== undefined) {
|
|
7
|
+
throw new Error([`MUI: columnGroupingModel contains duplicated field`, `column field ${columnGroupNode.field} occurs two times in the grouping model:`, `- ${unwrappedGroupingModelToComplete[columnGroupNode.field].join(' > ')}`, `- ${parents.join(' > ')}`].join('\n'));
|
|
8
8
|
}
|
|
9
|
-
|
|
9
|
+
unwrappedGroupingModelToComplete[columnGroupNode.field] = parents;
|
|
10
10
|
return;
|
|
11
11
|
}
|
|
12
12
|
const {
|
|
@@ -14,7 +14,7 @@ const recurrentUnwrapGroupingColumnModel = (columnGroupNode, parents, unwrappedG
|
|
|
14
14
|
children
|
|
15
15
|
} = columnGroupNode;
|
|
16
16
|
children.forEach(child => {
|
|
17
|
-
recurrentUnwrapGroupingColumnModel(child, [...parents, groupId],
|
|
17
|
+
recurrentUnwrapGroupingColumnModel(child, [...parents, groupId], unwrappedGroupingModelToComplete);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -2,16 +2,9 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import * as ReactDOM from 'react-dom';
|
|
4
4
|
import { unstable_useForkRef as useForkRef } from '@mui/utils';
|
|
5
|
-
import { styled, useTheme } from '@mui/
|
|
5
|
+
import { styled, useTheme } from '@mui/system';
|
|
6
6
|
import { defaultMemoize } from 'reselect';
|
|
7
7
|
import { useGridPrivateApiContext } from '../../utils/useGridPrivateApiContext';
|
|
8
|
-
import { useGridSelector } from '../../utils/useGridSelector';
|
|
9
|
-
import { gridVisibleColumnDefinitionsSelector, gridColumnPositionsSelector, gridColumnVisibilityModelSelector } from '../columns/gridColumnsSelector';
|
|
10
|
-
import { gridTabIndexColumnHeaderSelector, gridTabIndexCellSelector, gridFocusColumnHeaderSelector, unstable_gridFocusColumnGroupHeaderSelector, unstable_gridTabIndexColumnGroupHeaderSelector } from '../focus/gridFocusStateSelector';
|
|
11
|
-
import { gridDensityFactorSelector } from '../density/densitySelector';
|
|
12
|
-
import { gridFilterActiveItemsLookupSelector } from '../filter/gridFilterSelector';
|
|
13
|
-
import { gridSortColumnLookupSelector } from '../sorting/gridSortingSelector';
|
|
14
|
-
import { gridColumnMenuSelector } from '../columnMenu/columnMenuSelector';
|
|
15
8
|
import { useGridRootProps } from '../../utils/useGridRootProps';
|
|
16
9
|
import { useGridApiEventHandler } from '../../utils/useGridApiEventHandler';
|
|
17
10
|
import { GridColumnHeaderItem } from '../../../components/columnHeaders/GridColumnHeaderItem';
|
|
@@ -19,7 +12,6 @@ import { getFirstColumnIndexToRender, getTotalHeaderHeight } from '../columns/gr
|
|
|
19
12
|
import { useGridVisibleRows } from '../../utils/useGridVisibleRows';
|
|
20
13
|
import { getRenderableIndexes } from '../virtualization/useGridVirtualScroller';
|
|
21
14
|
import { GridColumnGroupHeader } from '../../../components/columnHeaders/GridColumnGroupHeader';
|
|
22
|
-
import { gridColumnGroupsHeaderMaxDepthSelector, gridColumnGroupsHeaderStructureSelector } from '../columnGrouping/gridColumnGroupsSelector';
|
|
23
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
16
|
const GridColumnHeaderRow = styled('div', {
|
|
25
17
|
name: 'MuiDataGrid',
|
|
@@ -34,26 +26,26 @@ function isUIEvent(event) {
|
|
|
34
26
|
export const useGridColumnHeaders = props => {
|
|
35
27
|
const {
|
|
36
28
|
innerRef: innerRefProp,
|
|
37
|
-
minColumnIndex = 0
|
|
29
|
+
minColumnIndex = 0,
|
|
30
|
+
visibleColumns,
|
|
31
|
+
sortColumnLookup,
|
|
32
|
+
filterColumnLookup,
|
|
33
|
+
columnPositions,
|
|
34
|
+
columnHeaderTabIndexState,
|
|
35
|
+
columnGroupHeaderTabIndexState,
|
|
36
|
+
columnHeaderFocus,
|
|
37
|
+
columnGroupHeaderFocus,
|
|
38
|
+
densityFactor,
|
|
39
|
+
headerGroupingMaxDepth,
|
|
40
|
+
columnMenuState,
|
|
41
|
+
columnVisibility,
|
|
42
|
+
columnGroupsHeaderStructure,
|
|
43
|
+
hasOtherElementInTabSequence
|
|
38
44
|
} = props;
|
|
39
45
|
const theme = useTheme();
|
|
40
46
|
const [dragCol, setDragCol] = React.useState('');
|
|
41
47
|
const [resizeCol, setResizeCol] = React.useState('');
|
|
42
48
|
const apiRef = useGridPrivateApiContext();
|
|
43
|
-
const visibleColumns = useGridSelector(apiRef, gridVisibleColumnDefinitionsSelector);
|
|
44
|
-
const columnPositions = useGridSelector(apiRef, gridColumnPositionsSelector);
|
|
45
|
-
const columnHeaderTabIndexState = useGridSelector(apiRef, gridTabIndexColumnHeaderSelector);
|
|
46
|
-
const cellTabIndexState = useGridSelector(apiRef, gridTabIndexCellSelector);
|
|
47
|
-
const columnGroupHeaderTabIndexState = useGridSelector(apiRef, unstable_gridTabIndexColumnGroupHeaderSelector);
|
|
48
|
-
const columnHeaderFocus = useGridSelector(apiRef, gridFocusColumnHeaderSelector);
|
|
49
|
-
const columnGroupHeaderFocus = useGridSelector(apiRef, unstable_gridFocusColumnGroupHeaderSelector);
|
|
50
|
-
const densityFactor = useGridSelector(apiRef, gridDensityFactorSelector);
|
|
51
|
-
const headerGroupingMaxDepth = useGridSelector(apiRef, gridColumnGroupsHeaderMaxDepthSelector);
|
|
52
|
-
const filterColumnLookup = useGridSelector(apiRef, gridFilterActiveItemsLookupSelector);
|
|
53
|
-
const sortColumnLookup = useGridSelector(apiRef, gridSortColumnLookupSelector);
|
|
54
|
-
const columnMenuState = useGridSelector(apiRef, gridColumnMenuSelector);
|
|
55
|
-
const columnVisibility = useGridSelector(apiRef, gridColumnVisibilityModelSelector);
|
|
56
|
-
const columnGroupsHeaderStructure = useGridSelector(apiRef, gridColumnGroupsHeaderStructureSelector);
|
|
57
49
|
const rootProps = useGridRootProps();
|
|
58
50
|
const innerRef = React.useRef(null);
|
|
59
51
|
const handleInnerRef = useForkRef(innerRefProp, innerRef);
|
|
@@ -198,8 +190,7 @@ export const useGridColumnHeaders = props => {
|
|
|
198
190
|
const colDef = renderedColumns[i];
|
|
199
191
|
const columnIndex = firstColumnToRender + i;
|
|
200
192
|
const isFirstColumn = columnIndex === 0;
|
|
201
|
-
const
|
|
202
|
-
const tabIndex = columnHeaderTabIndexState !== null && columnHeaderTabIndexState.field === colDef.field || isFirstColumn && !hasTabbableElement ? 0 : -1;
|
|
193
|
+
const tabIndex = columnHeaderTabIndexState !== null && columnHeaderTabIndexState.field === colDef.field || isFirstColumn && !hasOtherElementInTabSequence ? 0 : -1;
|
|
203
194
|
const hasFocus = columnHeaderFocus !== null && columnHeaderFocus.field === colDef.field;
|
|
204
195
|
const open = columnMenuState.open && columnMenuState.field === colDef.field;
|
|
205
196
|
columns.push( /*#__PURE__*/_jsx(GridColumnHeaderItem, _extends({}, sortColumnLookup[colDef.field], {
|
|
@@ -68,7 +68,7 @@ export const useGridCellEditing = (apiRef, props) => {
|
|
|
68
68
|
const handleCellKeyDown = React.useCallback((params, event) => {
|
|
69
69
|
if (params.cellMode === GridCellModes.Edit) {
|
|
70
70
|
// Wait until IME is settled for Asian languages like Japanese and Chinese
|
|
71
|
-
// TODO: `event.which` is
|
|
71
|
+
// TODO: `event.which` is deprecated but this is a temporary workaround
|
|
72
72
|
if (event.which === 229) {
|
|
73
73
|
return;
|
|
74
74
|
}
|
|
@@ -47,7 +47,7 @@ export const useGridEditing = (apiRef, props) => {
|
|
|
47
47
|
clearTimeout(timeout);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
// To run the callback
|
|
50
|
+
// To run the callback immediately without waiting the timeout
|
|
51
51
|
const runImmediately = () => {
|
|
52
52
|
const [timeout] = debounceMap.current[id][field];
|
|
53
53
|
clearTimeout(timeout);
|
|
@@ -103,7 +103,7 @@ export const useGridRowEditing = (apiRef, props) => {
|
|
|
103
103
|
const handleCellKeyDown = React.useCallback((params, event) => {
|
|
104
104
|
if (params.cellMode === GridRowModes.Edit) {
|
|
105
105
|
// Wait until IME is settled for Asian languages like Japanese and Chinese
|
|
106
|
-
// TODO: `event.which` is
|
|
106
|
+
// TODO: `event.which` is deprecated but this is a temporary workaround
|
|
107
107
|
if (event.which === 229) {
|
|
108
108
|
return;
|
|
109
109
|
}
|