Skip to content

Commit

Permalink
[data grid] Update filter panel input variant (mui#15807)
Browse files Browse the repository at this point in the history
  • Loading branch information
KenanYusuf authored and LukasTy committed Dec 19, 2024
1 parent 6e988e3 commit 5b2cf68
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ const GridPanelContentRoot = styled('div', {
name: 'MuiDataGrid',
slot: 'PanelContent',
overridesResolver: (props, styles) => styles.panelContent,
})<{ ownerState: OwnerState }>({
})<{ ownerState: OwnerState }>(({ theme }) => ({
display: 'flex',
flexDirection: 'column',
overflow: 'auto',
flex: '1 1',
maxHeight: 400,
});
padding: theme.spacing(2.5, 1.5, 2, 1),
gap: theme.spacing(2.5),
}));

function GridPanelContent(props: React.HTMLAttributes<HTMLDivElement> & { sx?: SxProps<Theme> }) {
const { className, ...other } = props;
Expand Down
5 changes: 3 additions & 2 deletions packages/x-data-grid/src/components/panel/GridPanelFooter.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import PropTypes from 'prop-types';
import clsx from 'clsx';
import { styled, SxProps, Theme } from '@mui/system';
import { styled, SxProps, Theme } from '@mui/material/styles';
import composeClasses from '@mui/utils/composeClasses';
import type { DataGridProcessedProps } from '../../models/props/DataGridProps';
import { getDataGridUtilityClass } from '../../constants/gridClasses';
Expand All @@ -24,9 +24,10 @@ const GridPanelFooterRoot = styled('div', {
slot: 'PanelFooter',
overridesResolver: (props, styles) => styles.panelFooter,
})<{ ownerState: OwnerState }>(({ theme }) => ({
padding: theme.spacing(0.5),
padding: theme.spacing(1),
display: 'flex',
justifyContent: 'space-between',
borderTop: `1px solid ${theme.palette.divider}`,
}));

function GridPanelFooter(props: React.HTMLAttributes<HTMLDivElement> & { sx?: SxProps<Theme> }) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,27 +146,24 @@ const GridFilterFormRoot = styled('div', {
overridesResolver: (props, styles) => styles.filterForm,
})<{ ownerState: OwnerState }>(({ theme }) => ({
display: 'flex',
padding: theme.spacing(1),
gap: theme.spacing(1.5),
}));

const FilterFormDeleteIcon = styled('div', {
name: 'MuiDataGrid',
slot: 'FilterFormDeleteIcon',
overridesResolver: (_, styles) => styles.filterFormDeleteIcon,
})<{ ownerState: OwnerState }>(({ theme }) => ({
})<{ ownerState: OwnerState }>({
flexShrink: 0,
justifyContent: 'flex-end',
marginRight: theme.spacing(0.5),
marginBottom: theme.spacing(0.2),
}));
justifyContent: 'center',
});

const FilterFormLogicOperatorInput = styled('div', {
name: 'MuiDataGrid',
slot: 'FilterFormLogicOperatorInput',
overridesResolver: (_, styles) => styles.filterFormLogicOperatorInput,
})<{ ownerState: OwnerState }>({
minWidth: 55,
marginRight: 5,
minWidth: 75,
justifyContent: 'end',
});

Expand Down Expand Up @@ -425,7 +422,6 @@ const GridFilterForm = React.forwardRef<HTMLDivElement, GridFilterFormProps>(
{...other}
>
<FilterFormDeleteIcon
variant="standard"
as={rootProps.slots.baseFormControl}
{...baseFormControlProps}
{...deleteIconProps}
Expand All @@ -448,7 +444,8 @@ const GridFilterForm = React.forwardRef<HTMLDivElement, GridFilterFormProps>(
</rootProps.slots.baseIconButton>
</FilterFormDeleteIcon>
<FilterFormLogicOperatorInput
variant="standard"
variant="outlined"
size="small"
as={rootProps.slots.baseFormControl}
{...baseFormControlProps}
{...logicOperatorInputProps}
Expand Down Expand Up @@ -500,7 +497,8 @@ const GridFilterForm = React.forwardRef<HTMLDivElement, GridFilterFormProps>(
</rootProps.slots.baseSelect>
</FilterFormLogicOperatorInput>
<FilterFormColumnInput
variant="standard"
variant="outlined"
size="small"
as={rootProps.slots.baseFormControl}
{...baseFormControlProps}
{...columnInputProps}
Expand Down Expand Up @@ -541,7 +539,8 @@ const GridFilterForm = React.forwardRef<HTMLDivElement, GridFilterFormProps>(
</rootProps.slots.baseSelect>
</FilterFormColumnInput>
<FilterFormOperatorInput
variant="standard"
variant="outlined"
size="small"
as={rootProps.slots.baseFormControl}
{...baseFormControlProps}
{...operatorInputProps}
Expand Down Expand Up @@ -586,7 +585,8 @@ const GridFilterForm = React.forwardRef<HTMLDivElement, GridFilterFormProps>(
</rootProps.slots.baseSelect>
</FilterFormOperatorInput>
<FilterFormValueInput
variant="standard"
variant="outlined"
size="small"
as={rootProps.slots.baseFormControl}
{...baseFormControlProps}
{...valueInputPropsOther}
Expand All @@ -599,6 +599,8 @@ const GridFilterForm = React.forwardRef<HTMLDivElement, GridFilterFormProps>(
>
{currentOperator?.InputComponent ? (
<currentOperator.InputComponent
variant="outlined"
size="small"
apiRef={apiRef}
item={item}
applyValue={applyFilterChanges}
Expand Down

0 comments on commit 5b2cf68

Please sign in to comment.