Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DataGrid] Header filter design improvements #15991

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function CustomHeaderFilter(props) {
<Stack
sx={[
{
borderTop: `1px solid var(--DataGrid-rowBorderColor)`,
borderBottom: `1px solid var(--DataGrid-rowBorderColor)`,
},
hasFocus
? {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function CustomHeaderFilter(props: GridHeaderFilterCellProps) {
<Stack
sx={[
{
borderTop: `1px solid var(--DataGrid-rowBorderColor)`,
borderBottom: `1px solid var(--DataGrid-rowBorderColor)`,
},
hasFocus
? {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,17 @@ function RatingInputValue(props) {
};

return (
<React.Fragment>
<Box sx={{ display: 'flex', justifyContent: 'flex-end', width: '100%' }}>
<Rating
name="custom-rating-filter-operator"
value={Number(item.value)}
onChange={handleFilterChange}
precision={0.5}
ref={ratingRef}
/>
{headerFilterMenu}
<Box
sx={{
display: 'inline-flex',
flexDirection: 'row',
alignItems: 'center',
height: '100%',
pl: '10px',
bl: '1px solid lightgrey',
}}
>
<Rating
name="custom-rating-filter-operator"
value={Number(item.value)}
onChange={handleFilterChange}
precision={0.5}
ref={ratingRef}
/>
</Box>
{clearButton}
</React.Fragment>
</Box>
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,28 +32,17 @@ function RatingInputValue(
};

return (
<React.Fragment>
<Box sx={{ display: 'flex', justifyContent: 'flex-end', width: '100%' }}>
<Rating
name="custom-rating-filter-operator"
value={Number(item.value)}
onChange={handleFilterChange}
precision={0.5}
ref={ratingRef}
/>
{headerFilterMenu}
<Box
sx={{
display: 'inline-flex',
flexDirection: 'row',
alignItems: 'center',
height: '100%',
pl: '10px',
bl: '1px solid lightgrey',
}}
>
<Rating
name="custom-rating-filter-operator"
value={Number(item.value)}
onChange={handleFilterChange}
precision={0.5}
ref={ratingRef}
/>
</Box>
{clearButton}
</React.Fragment>
</Box>
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,15 @@ function AdminFilter(props) {
const label = !value ? 'Filter' : 'Is admin';

return (
<FormControl variant="standard" sx={{ m: 1, minWidth: 120 }} fullWidth>
<FormControl variant="outlined" size="small" fullWidth>
<InputLabel id="select-is-admin-label">{label}</InputLabel>
<Select
labelId="select-is-admin-label"
id="select-is-admin"
value={value}
onChange={handleChange}
label={label}
inputProps={{ sx: { fontSize: 14 } }}
>
<MenuItem value="">
<em>None</em>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,15 @@ function AdminFilter(props: GridRenderHeaderFilterProps) {
const label = !value ? 'Filter' : 'Is admin';

return (
<FormControl variant="standard" sx={{ m: 1, minWidth: 120 }} fullWidth>
<FormControl variant="outlined" size="small" fullWidth>
<InputLabel id="select-is-admin-label">{label}</InputLabel>
<Select
labelId="select-is-admin-label"
id="select-is-admin"
value={value}
onChange={handleChange}
label={label}
inputProps={{ sx: { fontSize: 14 } }}
>
<MenuItem value="">
<em>None</em>
Expand Down
Loading
Loading