@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
|
@@ -4,7 +4,7 @@ var _excluded = ["className"];
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
7
|
-
import { styled } from '@mui/
|
|
7
|
+
import { styled } from '@mui/system';
|
|
8
8
|
import { getDataGridUtilityClass } from '../../constants/gridClasses';
|
|
9
9
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -21,20 +21,17 @@ var GridColumnHeadersRoot = styled('div', {
|
|
|
21
21
|
overridesResolver: function overridesResolver(props, styles) {
|
|
22
22
|
return styles.columnHeaders;
|
|
23
23
|
}
|
|
24
|
-
})(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
borderTopLeftRadius: theme.shape.borderRadius,
|
|
34
|
-
borderTopRightRadius: theme.shape.borderRadius
|
|
35
|
-
};
|
|
24
|
+
})({
|
|
25
|
+
position: 'relative',
|
|
26
|
+
overflow: 'hidden',
|
|
27
|
+
display: 'flex',
|
|
28
|
+
alignItems: 'center',
|
|
29
|
+
boxSizing: 'border-box',
|
|
30
|
+
borderBottom: '1px solid',
|
|
31
|
+
borderTopLeftRadius: 'var(--unstable_DataGrid-radius)',
|
|
32
|
+
borderTopRightRadius: 'var(--unstable_DataGrid-radius)'
|
|
36
33
|
});
|
|
37
|
-
export var
|
|
34
|
+
export var GridBaseColumnHeaders = /*#__PURE__*/React.forwardRef(function GridColumnHeaders(props, ref) {
|
|
38
35
|
var className = props.className,
|
|
39
36
|
other = _objectWithoutProperties(props, _excluded);
|
|
40
37
|
var rootProps = useGridRootProps();
|
|
@@ -6,7 +6,7 @@ import * as React from 'react';
|
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import clsx from 'clsx';
|
|
8
8
|
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
9
|
-
import { styled } from '@mui/
|
|
9
|
+
import { styled } from '@mui/system';
|
|
10
10
|
import { isOverflown } from '../../utils/domUtils';
|
|
11
11
|
import { getDataGridUtilityClass } from '../../constants/gridClasses';
|
|
12
12
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
@@ -24,14 +24,11 @@ var GridColumnHeaderTitleRoot = styled('div', {
|
|
|
24
24
|
overridesResolver: function overridesResolver(props, styles) {
|
|
25
25
|
return styles.columnHeaderTitle;
|
|
26
26
|
}
|
|
27
|
-
})(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
whiteSpace: 'nowrap',
|
|
33
|
-
fontWeight: theme.typography.fontWeightMedium
|
|
34
|
-
};
|
|
27
|
+
})({
|
|
28
|
+
textOverflow: 'ellipsis',
|
|
29
|
+
overflow: 'hidden',
|
|
30
|
+
whiteSpace: 'nowrap',
|
|
31
|
+
fontWeight: 'var(--unstable_DataGrid-headWeight)'
|
|
35
32
|
});
|
|
36
33
|
var ColumnHeaderInnerTitle = /*#__PURE__*/React.forwardRef(function ColumnHeaderInnerTitle(props, ref) {
|
|
37
34
|
var className = props.className,
|
|
@@ -5,7 +5,7 @@ var _excluded = ["isDragging", "className"];
|
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
8
|
-
import { styled } from '@mui/
|
|
8
|
+
import { styled } from '@mui/system';
|
|
9
9
|
import { gridClasses, getDataGridUtilityClass } from '../../constants/gridClasses';
|
|
10
10
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
11
11
|
import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
|
|
@@ -4,7 +4,7 @@ var _excluded = ["className"];
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
7
|
-
import { styled } from '@mui/
|
|
7
|
+
import { styled } from '@mui/system';
|
|
8
8
|
import { getDataGridUtilityClass } from '../../constants/gridClasses';
|
|
9
9
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -5,7 +5,7 @@ import * as React from 'react';
|
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
8
|
-
import { styled } from '@mui/
|
|
8
|
+
import { styled } from '@mui/system';
|
|
9
9
|
import { getDataGridUtilityClass } from '../../constants/gridClasses';
|
|
10
10
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -22,15 +22,12 @@ var GridFooterContainerRoot = styled('div', {
|
|
|
22
22
|
overridesResolver: function overridesResolver(props, styles) {
|
|
23
23
|
return styles.footerContainer;
|
|
24
24
|
}
|
|
25
|
-
})(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
// Match TablePagination min height
|
|
32
|
-
borderTop: '1px solid'
|
|
33
|
-
};
|
|
25
|
+
})({
|
|
26
|
+
display: 'flex',
|
|
27
|
+
justifyContent: 'space-between',
|
|
28
|
+
alignItems: 'center',
|
|
29
|
+
minHeight: 52,
|
|
30
|
+
borderTop: '1px solid'
|
|
34
31
|
});
|
|
35
32
|
var GridFooterContainer = /*#__PURE__*/React.forwardRef(function GridFooterContainer(props, ref) {
|
|
36
33
|
var className = props.className,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
3
|
-
import { styled } from '@mui/
|
|
3
|
+
import { styled } from '@mui/system';
|
|
4
4
|
import { getDataGridUtilityClass } from '../../constants/gridClasses';
|
|
5
5
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -5,7 +5,7 @@ import * as React from 'react';
|
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
8
|
-
import {
|
|
8
|
+
import { styled } from '@mui/system';
|
|
9
9
|
import { getDataGridUtilityClass } from '../../constants/gridClasses';
|
|
10
10
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -22,17 +22,14 @@ var GridOverlayRoot = styled('div', {
|
|
|
22
22
|
overridesResolver: function overridesResolver(_, styles) {
|
|
23
23
|
return styles.overlay;
|
|
24
24
|
}
|
|
25
|
-
})(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
justifyContent: 'center',
|
|
34
|
-
backgroundColor: theme.vars ? "rgba(".concat(theme.vars.palette.background.defaultChannel, " / ").concat(theme.vars.palette.action.disabledOpacity, ")") : alpha(theme.palette.background.default, theme.palette.action.disabledOpacity)
|
|
35
|
-
};
|
|
25
|
+
})({
|
|
26
|
+
width: '100%',
|
|
27
|
+
height: '100%',
|
|
28
|
+
display: 'flex',
|
|
29
|
+
alignSelf: 'center',
|
|
30
|
+
alignItems: 'center',
|
|
31
|
+
justifyContent: 'center',
|
|
32
|
+
backgroundColor: 'var(--unstable_DataGrid-overlayBackground)'
|
|
36
33
|
});
|
|
37
34
|
var GridOverlay = /*#__PURE__*/React.forwardRef(function GridOverlay(props, ref) {
|
|
38
35
|
var className = props.className,
|
|
@@ -22,14 +22,18 @@ export var GridRootStyles = styled('div', {
|
|
|
22
22
|
var _$concat2, _$concat3, _extends2;
|
|
23
23
|
var theme = _ref57.theme;
|
|
24
24
|
var borderColor = getBorderColor(theme);
|
|
25
|
+
var radius = theme.shape.borderRadius;
|
|
25
26
|
var gridStyle = _extends({
|
|
27
|
+
'--unstable_DataGrid-radius': typeof radius === 'number' ? "".concat(radius, "px") : radius,
|
|
28
|
+
'--unstable_DataGrid-headWeight': theme.typography.fontWeightMedium,
|
|
29
|
+
'--unstable_DataGrid-overlayBackground': theme.vars ? "rgba(".concat(theme.vars.palette.background.defaultChannel, " / ").concat(theme.vars.palette.action.disabledOpacity, ")") : alpha(theme.palette.background.default, theme.palette.action.disabledOpacity),
|
|
26
30
|
flex: 1,
|
|
27
31
|
boxSizing: 'border-box',
|
|
28
32
|
position: 'relative',
|
|
29
33
|
borderWidth: '1px',
|
|
30
34
|
borderStyle: 'solid',
|
|
31
35
|
borderColor: borderColor,
|
|
32
|
-
borderRadius:
|
|
36
|
+
borderRadius: 'var(--unstable_DataGrid-radius)',
|
|
33
37
|
color: (theme.vars || theme).palette.text.primary
|
|
34
38
|
}, theme.typography.body2, (_extends2 = {
|
|
35
39
|
outline: 'none',
|
|
@@ -263,12 +267,12 @@ export var GridRootStyles = styled('div', {
|
|
|
263
267
|
}), _defineProperty(_extends2, "& .".concat(gridClasses['columnHeader--dragging'], ", & .").concat(gridClasses['row--dragging']), {
|
|
264
268
|
background: (theme.vars || theme).palette.background.paper,
|
|
265
269
|
padding: '0 12px',
|
|
266
|
-
borderRadius:
|
|
270
|
+
borderRadius: 'var(--unstable_DataGrid-radius)',
|
|
267
271
|
opacity: (theme.vars || theme).palette.action.disabledOpacity
|
|
268
272
|
}), _defineProperty(_extends2, "& .".concat(gridClasses['row--dragging']), _defineProperty({
|
|
269
273
|
background: (theme.vars || theme).palette.background.paper,
|
|
270
274
|
padding: '0 12px',
|
|
271
|
-
borderRadius:
|
|
275
|
+
borderRadius: 'var(--unstable_DataGrid-radius)',
|
|
272
276
|
opacity: (theme.vars || theme).palette.action.disabledOpacity
|
|
273
277
|
}, "& .".concat(gridClasses.rowReorderCellPlaceholder), {
|
|
274
278
|
display: 'flex'
|
|
@@ -4,7 +4,7 @@ var _excluded = ["className", "children"];
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
|
-
import { styled } from '@mui/
|
|
7
|
+
import { styled } from '@mui/system';
|
|
8
8
|
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
9
9
|
import { getDataGridUtilityClass } from '../../constants/gridClasses';
|
|
10
10
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
@@ -3,7 +3,7 @@ export * from './cell';
|
|
|
3
3
|
export * from './containers';
|
|
4
4
|
export * from './columnHeaders';
|
|
5
5
|
export * from './columnSelection';
|
|
6
|
-
export * from '
|
|
6
|
+
export * from '../material/icons';
|
|
7
7
|
export * from './menu';
|
|
8
8
|
export * from './panel';
|
|
9
9
|
export * from './toolbar';
|
|
@@ -14,7 +14,6 @@ import { styled } from '@mui/material/styles';
|
|
|
14
14
|
import { gridColumnDefinitionsSelector, gridColumnVisibilityModelSelector } from '../../hooks/features/columns/gridColumnsSelector';
|
|
15
15
|
import { useGridSelector } from '../../hooks/utils/useGridSelector';
|
|
16
16
|
import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
|
|
17
|
-
import { GridDragIcon } from '../icons';
|
|
18
17
|
import { GridPanelContent } from './GridPanelContent';
|
|
19
18
|
import { GridPanelFooter } from './GridPanelFooter';
|
|
20
19
|
import { GridPanelHeader } from './GridPanelHeader';
|
|
@@ -184,7 +183,7 @@ function GridColumnsPanel(props) {
|
|
|
184
183
|
title: apiRef.current.getLocaleText('columnsPanelDragIconLabel'),
|
|
185
184
|
size: "small",
|
|
186
185
|
disabled: true,
|
|
187
|
-
children: /*#__PURE__*/_jsx(
|
|
186
|
+
children: /*#__PURE__*/_jsx(rootProps.slots.columnReorderIcon, {})
|
|
188
187
|
})]
|
|
189
188
|
}, column.field);
|
|
190
189
|
})
|
|
@@ -4,7 +4,7 @@ var _excluded = ["className"];
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
|
-
import { styled } from '@mui/
|
|
7
|
+
import { styled } from '@mui/system';
|
|
8
8
|
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
9
9
|
import { getDataGridUtilityClass } from '../../constants/gridClasses';
|
|
10
10
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
@@ -4,7 +4,7 @@ var _excluded = ["className"];
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
|
-
import { styled } from '@mui/
|
|
7
|
+
import { styled } from '@mui/system';
|
|
8
8
|
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
9
9
|
import { getDataGridUtilityClass } from '../../constants/gridClasses';
|
|
10
10
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
@@ -4,7 +4,7 @@ var _excluded = ["className"];
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
|
-
import { styled } from '@mui/
|
|
7
|
+
import { styled } from '@mui/system';
|
|
8
8
|
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
9
9
|
import { getDataGridUtilityClass } from '../../constants/gridClasses';
|
|
10
10
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
@@ -5,9 +5,6 @@ var _excluded = ["item", "hasMultipleFilters", "deleteFilter", "applyFilterChang
|
|
|
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
|
var useUtilityClasses = function useUtilityClasses(ownerState) {
|
|
23
21
|
var classes = ownerState.classes;
|
|
@@ -44,7 +42,7 @@ var GridFilterFormRoot = styled('div', {
|
|
|
44
42
|
padding: theme.spacing(1)
|
|
45
43
|
};
|
|
46
44
|
});
|
|
47
|
-
var FilterFormDeleteIcon = styled(
|
|
45
|
+
var FilterFormDeleteIcon = styled('div', {
|
|
48
46
|
name: 'MuiDataGrid',
|
|
49
47
|
slot: 'FilterFormDeleteIcon',
|
|
50
48
|
overridesResolver: function overridesResolver(_, styles) {
|
|
@@ -59,7 +57,7 @@ var FilterFormDeleteIcon = styled(FormControl, {
|
|
|
59
57
|
marginBottom: theme.spacing(0.2)
|
|
60
58
|
};
|
|
61
59
|
});
|
|
62
|
-
var FilterFormLogicOperatorInput = styled(
|
|
60
|
+
var FilterFormLogicOperatorInput = styled('div', {
|
|
63
61
|
name: 'MuiDataGrid',
|
|
64
62
|
slot: 'FilterFormLogicOperatorInput',
|
|
65
63
|
overridesResolver: function overridesResolver(_, styles) {
|
|
@@ -70,7 +68,7 @@ var FilterFormLogicOperatorInput = styled(FormControl, {
|
|
|
70
68
|
marginRight: 5,
|
|
71
69
|
justifyContent: 'end'
|
|
72
70
|
});
|
|
73
|
-
var FilterFormColumnInput = styled(
|
|
71
|
+
var FilterFormColumnInput = styled('div', {
|
|
74
72
|
name: 'MuiDataGrid',
|
|
75
73
|
slot: 'FilterFormColumnInput',
|
|
76
74
|
overridesResolver: function overridesResolver(_, styles) {
|
|
@@ -79,7 +77,7 @@ var FilterFormColumnInput = styled(FormControl, {
|
|
|
79
77
|
})({
|
|
80
78
|
width: 150
|
|
81
79
|
});
|
|
82
|
-
var FilterFormOperatorInput = styled(
|
|
80
|
+
var FilterFormOperatorInput = styled('div', {
|
|
83
81
|
name: 'MuiDataGrid',
|
|
84
82
|
slot: 'FilterFormOperatorInput',
|
|
85
83
|
overridesResolver: function overridesResolver(_, styles) {
|
|
@@ -88,7 +86,7 @@ var FilterFormOperatorInput = styled(FormControl, {
|
|
|
88
86
|
})({
|
|
89
87
|
width: 120
|
|
90
88
|
});
|
|
91
|
-
var FilterFormValueInput = styled(
|
|
89
|
+
var FilterFormValueInput = styled('div', {
|
|
92
90
|
name: 'MuiDataGrid',
|
|
93
91
|
slot: 'FilterFormValueInput',
|
|
94
92
|
overridesResolver: function overridesResolver(_, styles) {
|
|
@@ -112,7 +110,7 @@ var getColumnLabel = function getColumnLabel(col) {
|
|
|
112
110
|
};
|
|
113
111
|
var collator = new Intl.Collator();
|
|
114
112
|
var GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(props, ref) {
|
|
115
|
-
var _rootProps$slotProps, _rootProps$slotProps2, _baseSelectProps$nati, _rootProps$slotProps3, _rootProps$slotProps4, _rootProps$slotProps5, _rootProps$slotProps6, _currentColumn$filter2;
|
|
113
|
+
var _rootProps$slotProps, _rootProps$slotProps2, _baseSelectProps$nati, _rootProps$slotProps3, _rootProps$slotProps4, _rootProps$slotProps5, _rootProps$slotProps6, _rootProps$slotProps7, _rootProps$slotProps8, _currentColumn$filter2;
|
|
116
114
|
var item = props.item,
|
|
117
115
|
hasMultipleFilters = props.hasMultipleFilters,
|
|
118
116
|
deleteFilter = props.deleteFilter,
|
|
@@ -153,7 +151,8 @@ var GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(props
|
|
|
153
151
|
var baseFormControlProps = ((_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseFormControl) || {};
|
|
154
152
|
var baseSelectProps = ((_rootProps$slotProps2 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps2.baseSelect) || {};
|
|
155
153
|
var isBaseSelectNative = (_baseSelectProps$nati = baseSelectProps.native) != null ? _baseSelectProps$nati : true;
|
|
156
|
-
var
|
|
154
|
+
var baseInputLabelProps = ((_rootProps$slotProps3 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps3.baseInputLabel) || {};
|
|
155
|
+
var baseSelectOptionProps = ((_rootProps$slotProps4 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps4.baseSelectOption) || {};
|
|
157
156
|
var InputComponentProps = valueInputProps.InputComponentProps,
|
|
158
157
|
valueInputPropsOther = _objectWithoutProperties(valueInputProps, _excluded2);
|
|
159
158
|
var filteredColumns = React.useMemo(function () {
|
|
@@ -272,7 +271,7 @@ var GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(props
|
|
|
272
271
|
title: apiRef.current.getLocaleText('filterPanelDeleteIconLabel'),
|
|
273
272
|
onClick: handleDeleteFilter,
|
|
274
273
|
size: "small"
|
|
275
|
-
}, (_rootProps$
|
|
274
|
+
}, (_rootProps$slotProps5 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps5.baseIconButton, {
|
|
276
275
|
children: /*#__PURE__*/_jsx(rootProps.slots.filterPanelDeleteIcon, {
|
|
277
276
|
fontSize: "small"
|
|
278
277
|
})
|
|
@@ -295,12 +294,13 @@ var GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(props
|
|
|
295
294
|
onChange: changeLogicOperator,
|
|
296
295
|
disabled: !!disableMultiFilterOperator || logicOperators.length === 1,
|
|
297
296
|
native: isBaseSelectNative
|
|
298
|
-
}, (_rootProps$
|
|
297
|
+
}, (_rootProps$slotProps6 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps6.baseSelect, {
|
|
299
298
|
children: logicOperators.map(function (logicOperator) {
|
|
300
|
-
return /*#__PURE__*/
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
299
|
+
return /*#__PURE__*/_createElement(rootProps.slots.baseSelectOption, _extends({}, baseSelectOptionProps, {
|
|
300
|
+
native: isBaseSelectNative,
|
|
301
|
+
key: logicOperator.toString(),
|
|
302
|
+
value: logicOperator.toString()
|
|
303
|
+
}), apiRef.current.getLocaleText(getLogicOperatorLocaleKey(logicOperator)));
|
|
304
304
|
})
|
|
305
305
|
}))
|
|
306
306
|
})), /*#__PURE__*/_jsxs(FilterFormColumnInput, _extends({
|
|
@@ -309,23 +309,24 @@ var GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(props
|
|
|
309
309
|
}, baseFormControlProps, columnInputProps, {
|
|
310
310
|
className: clsx(classes.columnInput, baseFormControlProps.className, columnInputProps.className),
|
|
311
311
|
ownerState: rootProps,
|
|
312
|
-
children: [/*#__PURE__*/_jsx(
|
|
312
|
+
children: [/*#__PURE__*/_jsx(rootProps.slots.baseInputLabel, _extends({}, baseInputLabelProps, {
|
|
313
313
|
htmlFor: columnSelectId,
|
|
314
314
|
id: columnSelectLabelId,
|
|
315
315
|
children: apiRef.current.getLocaleText('filterPanelColumns')
|
|
316
|
-
}), /*#__PURE__*/_jsx(rootProps.slots.baseSelect, _extends({
|
|
316
|
+
})), /*#__PURE__*/_jsx(rootProps.slots.baseSelect, _extends({
|
|
317
317
|
labelId: columnSelectLabelId,
|
|
318
318
|
id: columnSelectId,
|
|
319
319
|
label: apiRef.current.getLocaleText('filterPanelColumns'),
|
|
320
320
|
value: item.field || '',
|
|
321
321
|
onChange: changeColumn,
|
|
322
322
|
native: isBaseSelectNative
|
|
323
|
-
}, (_rootProps$
|
|
323
|
+
}, (_rootProps$slotProps7 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps7.baseSelect, {
|
|
324
324
|
children: sortedFilteredColumns.map(function (col) {
|
|
325
|
-
return /*#__PURE__*/
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
325
|
+
return /*#__PURE__*/_createElement(rootProps.slots.baseSelectOption, _extends({}, baseSelectOptionProps, {
|
|
326
|
+
native: isBaseSelectNative,
|
|
327
|
+
key: col.field,
|
|
328
|
+
value: col.field
|
|
329
|
+
}), getColumnLabel(col));
|
|
329
330
|
})
|
|
330
331
|
}))]
|
|
331
332
|
})), /*#__PURE__*/_jsxs(FilterFormOperatorInput, _extends({
|
|
@@ -334,11 +335,11 @@ var GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(props
|
|
|
334
335
|
}, baseFormControlProps, operatorInputProps, {
|
|
335
336
|
className: clsx(classes.operatorInput, baseFormControlProps.className, operatorInputProps.className),
|
|
336
337
|
ownerState: rootProps,
|
|
337
|
-
children: [/*#__PURE__*/_jsx(
|
|
338
|
+
children: [/*#__PURE__*/_jsx(rootProps.slots.baseInputLabel, _extends({}, baseInputLabelProps, {
|
|
338
339
|
htmlFor: operatorSelectId,
|
|
339
340
|
id: operatorSelectLabelId,
|
|
340
341
|
children: apiRef.current.getLocaleText('filterPanelOperator')
|
|
341
|
-
}), /*#__PURE__*/_jsx(rootProps.slots.baseSelect, _extends({
|
|
342
|
+
})), /*#__PURE__*/_jsx(rootProps.slots.baseSelect, _extends({
|
|
342
343
|
labelId: operatorSelectLabelId,
|
|
343
344
|
label: apiRef.current.getLocaleText('filterPanelOperator'),
|
|
344
345
|
id: operatorSelectId,
|
|
@@ -346,12 +347,13 @@ var GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(props
|
|
|
346
347
|
onChange: changeOperator,
|
|
347
348
|
native: isBaseSelectNative,
|
|
348
349
|
inputRef: filterSelectorRef
|
|
349
|
-
}, (_rootProps$
|
|
350
|
+
}, (_rootProps$slotProps8 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps8.baseSelect, {
|
|
350
351
|
children: currentColumn == null ? void 0 : (_currentColumn$filter2 = currentColumn.filterOperators) == null ? void 0 : _currentColumn$filter2.map(function (operator) {
|
|
351
|
-
return /*#__PURE__*/
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
352
|
+
return /*#__PURE__*/_createElement(rootProps.slots.baseSelectOption, _extends({}, baseSelectOptionProps, {
|
|
353
|
+
native: isBaseSelectNative,
|
|
354
|
+
key: operator.value,
|
|
355
|
+
value: operator.value
|
|
356
|
+
}), operator.label || apiRef.current.getLocaleText("filterOperator".concat(capitalize(operator.value))));
|
|
355
357
|
})
|
|
356
358
|
}))]
|
|
357
359
|
})), /*#__PURE__*/_jsx(FilterFormValueInput, _extends({
|
|
@@ -3,12 +3,11 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
4
|
var _excluded = ["item", "applyValue", "apiRef", "focusElementRef"];
|
|
5
5
|
import * as React from 'react';
|
|
6
|
-
import MenuItem from '@mui/material/MenuItem';
|
|
7
6
|
import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
|
|
8
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
8
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
9
|
export function GridFilterInputBoolean(props) {
|
|
11
|
-
var _rootProps$slotProps, _baseSelectProps$nati, _rootProps$slotProps2, _rootProps$slotProps3;
|
|
10
|
+
var _rootProps$slotProps, _baseSelectProps$nati, _rootProps$slotProps2, _rootProps$slotProps3, _rootProps$slotProps4;
|
|
12
11
|
var item = props.item,
|
|
13
12
|
applyValue = props.applyValue,
|
|
14
13
|
apiRef = props.apiRef,
|
|
@@ -21,7 +20,7 @@ export function GridFilterInputBoolean(props) {
|
|
|
21
20
|
var rootProps = useGridRootProps();
|
|
22
21
|
var baseSelectProps = ((_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseSelect) || {};
|
|
23
22
|
var isSelectNative = (_baseSelectProps$nati = baseSelectProps.native) != null ? _baseSelectProps$nati : true;
|
|
24
|
-
var
|
|
23
|
+
var baseSelectOptionProps = ((_rootProps$slotProps2 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps2.baseSelectOption) || {};
|
|
25
24
|
var onFilterChange = React.useCallback(function (event) {
|
|
26
25
|
var value = event.target.value;
|
|
27
26
|
setFilterValueState(value);
|
|
@@ -33,6 +32,7 @@ export function GridFilterInputBoolean(props) {
|
|
|
33
32
|
setFilterValueState(item.value || '');
|
|
34
33
|
}, [item.value]);
|
|
35
34
|
return /*#__PURE__*/_jsxs(rootProps.slots.baseTextField, _extends({
|
|
35
|
+
// TODO: use baseSelect slot
|
|
36
36
|
label: apiRef.current.getLocaleText('filterPanelInputLabel'),
|
|
37
37
|
value: filterValueState,
|
|
38
38
|
onChange: onFilterChange,
|
|
@@ -41,21 +41,24 @@ export function GridFilterInputBoolean(props) {
|
|
|
41
41
|
SelectProps: _extends({
|
|
42
42
|
native: isSelectNative,
|
|
43
43
|
displayEmpty: true
|
|
44
|
-
}, (_rootProps$
|
|
44
|
+
}, (_rootProps$slotProps3 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps3.baseSelect),
|
|
45
45
|
InputLabelProps: {
|
|
46
46
|
shrink: true
|
|
47
47
|
},
|
|
48
48
|
inputRef: focusElementRef
|
|
49
|
-
}, others, (_rootProps$
|
|
50
|
-
children: [/*#__PURE__*/_jsx(
|
|
49
|
+
}, others, (_rootProps$slotProps4 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps4.baseTextField, {
|
|
50
|
+
children: [/*#__PURE__*/_jsx(rootProps.slots.baseSelectOption, _extends({}, baseSelectOptionProps, {
|
|
51
|
+
native: isSelectNative,
|
|
51
52
|
value: "",
|
|
52
53
|
children: apiRef.current.getLocaleText('filterValueAny')
|
|
53
|
-
}), /*#__PURE__*/_jsx(
|
|
54
|
+
})), /*#__PURE__*/_jsx(rootProps.slots.baseSelectOption, _extends({}, baseSelectOptionProps, {
|
|
55
|
+
native: isSelectNative,
|
|
54
56
|
value: "true",
|
|
55
57
|
children: apiRef.current.getLocaleText('filterValueTrue')
|
|
56
|
-
}), /*#__PURE__*/_jsx(
|
|
58
|
+
})), /*#__PURE__*/_jsx(rootProps.slots.baseSelectOption, _extends({}, baseSelectOptionProps, {
|
|
59
|
+
native: isSelectNative,
|
|
57
60
|
value: "false",
|
|
58
61
|
children: apiRef.current.getLocaleText('filterValueFalse')
|
|
59
|
-
})]
|
|
62
|
+
}))]
|
|
60
63
|
}));
|
|
61
64
|
}
|
|
@@ -5,7 +5,6 @@ var _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "Inp
|
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import { unstable_useId as useId } from '@mui/utils';
|
|
8
|
-
import { GridLoadIcon } from '../../icons';
|
|
9
8
|
import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
|
|
10
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
10
|
export var SUBMIT_FILTER_DATE_STROKE_TIME = 500;
|
|
@@ -64,7 +63,7 @@ function GridFilterInputDate(props) {
|
|
|
64
63
|
},
|
|
65
64
|
inputRef: focusElementRef,
|
|
66
65
|
InputProps: _extends({}, applying ? {
|
|
67
|
-
endAdornment: /*#__PURE__*/_jsx(
|
|
66
|
+
endAdornment: /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {})
|
|
68
67
|
} : {}, InputProps, {
|
|
69
68
|
inputProps: _extends({
|
|
70
69
|
max: type === 'datetime-local' ? '9999-12-31T23:59' : '9999-12-31'
|
|
@@ -72,8 +72,8 @@ function GridFilterInputMultipleSingleSelect(props) {
|
|
|
72
72
|
if (resolvedValueOptions !== undefined) {
|
|
73
73
|
var itemValueIndexes = item.value.map(function (element) {
|
|
74
74
|
// Gets the index matching between values and valueOptions
|
|
75
|
-
return resolvedFormattedValueOptions == null ? void 0 : resolvedFormattedValueOptions.findIndex(function (
|
|
76
|
-
return
|
|
75
|
+
return resolvedFormattedValueOptions == null ? void 0 : resolvedFormattedValueOptions.findIndex(function (formattedOption) {
|
|
76
|
+
return formattedOption === element;
|
|
77
77
|
});
|
|
78
78
|
});
|
|
79
79
|
return itemValueIndexes.filter(function (index) {
|
|
@@ -1,32 +1,39 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
5
5
|
var _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "getOptionLabel", "getOptionValue"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import { unstable_useId as useId } from '@mui/utils';
|
|
9
|
-
import MenuItem from '@mui/material/MenuItem';
|
|
10
9
|
import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
|
|
11
10
|
import { getValueFromValueOptions, isSingleSelectColDef } from './filterPanelUtils';
|
|
11
|
+
import { createElement as _createElement } from "react";
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
var renderSingleSelectOptions = function renderSingleSelectOptions(_ref
|
|
14
|
-
var
|
|
15
|
-
|
|
13
|
+
var renderSingleSelectOptions = function renderSingleSelectOptions(_ref) {
|
|
14
|
+
var _ref$column = _ref.column,
|
|
15
|
+
valueOptions = _ref$column.valueOptions,
|
|
16
|
+
field = _ref$column.field,
|
|
17
|
+
OptionComponent = _ref.OptionComponent,
|
|
18
|
+
getOptionLabel = _ref.getOptionLabel,
|
|
19
|
+
getOptionValue = _ref.getOptionValue,
|
|
20
|
+
isSelectNative = _ref.isSelectNative,
|
|
21
|
+
baseSelectOptionProps = _ref.baseSelectOptionProps;
|
|
16
22
|
var iterableColumnValues = typeof valueOptions === 'function' ? [''].concat(_toConsumableArray(valueOptions({
|
|
17
23
|
field: field
|
|
18
24
|
}))) : [''].concat(_toConsumableArray(valueOptions || []));
|
|
19
25
|
return iterableColumnValues.map(function (option) {
|
|
20
26
|
var value = getOptionValue(option);
|
|
21
27
|
var label = getOptionLabel(option);
|
|
22
|
-
return /*#__PURE__*/
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
28
|
+
return /*#__PURE__*/_createElement(OptionComponent, _extends({}, baseSelectOptionProps, {
|
|
29
|
+
native: isSelectNative,
|
|
30
|
+
key: value,
|
|
31
|
+
value: value
|
|
32
|
+
}), label);
|
|
26
33
|
});
|
|
27
34
|
};
|
|
28
35
|
function GridFilterInputSingleSelect(props) {
|
|
29
|
-
var _item$value, _rootProps$slotProps, _baseSelectProps$nati, _resolvedColumn, _resolvedColumn2, _rootProps$
|
|
36
|
+
var _item$value, _rootProps$slotProps, _baseSelectProps$nati, _rootProps$slotProps2, _resolvedColumn, _resolvedColumn2, _rootProps$slotProps3, _rootProps$slotProps4;
|
|
30
37
|
var item = props.item,
|
|
31
38
|
applyValue = props.applyValue,
|
|
32
39
|
type = props.type,
|
|
@@ -43,6 +50,7 @@ function GridFilterInputSingleSelect(props) {
|
|
|
43
50
|
var rootProps = useGridRootProps();
|
|
44
51
|
var baseSelectProps = ((_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseSelect) || {};
|
|
45
52
|
var isSelectNative = (_baseSelectProps$nati = baseSelectProps.native) != null ? _baseSelectProps$nati : true;
|
|
53
|
+
var baseSelectOptionProps = ((_rootProps$slotProps2 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps2.baseSelectOption) || {};
|
|
46
54
|
var resolvedColumn = null;
|
|
47
55
|
if (item.field) {
|
|
48
56
|
var column = apiRef.current.getColumn(item.field);
|
|
@@ -95,6 +103,7 @@ function GridFilterInputSingleSelect(props) {
|
|
|
95
103
|
return null;
|
|
96
104
|
}
|
|
97
105
|
return /*#__PURE__*/_jsx(rootProps.slots.baseTextField, _extends({
|
|
106
|
+
// TODO: use baseSelect slot
|
|
98
107
|
id: id,
|
|
99
108
|
label: apiRef.current.getLocaleText('filterPanelInputLabel'),
|
|
100
109
|
placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
|
|
@@ -109,9 +118,16 @@ function GridFilterInputSingleSelect(props) {
|
|
|
109
118
|
select: true,
|
|
110
119
|
SelectProps: _extends({
|
|
111
120
|
native: isSelectNative
|
|
112
|
-
}, (_rootProps$
|
|
113
|
-
}, others, (_rootProps$
|
|
114
|
-
children: renderSingleSelectOptions(
|
|
121
|
+
}, (_rootProps$slotProps3 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps3.baseSelect)
|
|
122
|
+
}, others, (_rootProps$slotProps4 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps4.baseTextField, {
|
|
123
|
+
children: renderSingleSelectOptions({
|
|
124
|
+
column: resolvedColumn,
|
|
125
|
+
OptionComponent: rootProps.slots.baseSelectOption,
|
|
126
|
+
getOptionLabel: getOptionLabel,
|
|
127
|
+
getOptionValue: getOptionValue,
|
|
128
|
+
isSelectNative: isSelectNative,
|
|
129
|
+
baseSelectOptionProps: baseSelectOptionProps
|
|
130
|
+
})
|
|
115
131
|
}));
|
|
116
132
|
}
|
|
117
133
|
process.env.NODE_ENV !== "production" ? GridFilterInputSingleSelect.propTypes = {
|