Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
k-rajat19 committed Nov 14, 2024
1 parent 48b9e7f commit b1ccc35
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import composeClasses from '@mui/utils/composeClasses';
import FormControlLabel from '@mui/material/FormControlLabel';
import { styled } from '@mui/material/styles';
import TextField, { TextFieldProps } from '@mui/material/TextField';
import { inputBaseClasses } from '@mui/material/InputBase';
import {
gridColumnDefinitionsSelector,
gridColumnVisibilityModelSelector,
Expand Down Expand Up @@ -68,6 +69,7 @@ const useUtilityClasses = (ownerState: OwnerState) => {
const slots = {
root: ['columnsManagement'],
header: ['columnsManagementHeader'],
searchInput: ['columnsManagementSearchInput'],
footer: ['columnsManagementFooter'],
row: ['columnsManagementRow'],
};
Expand Down Expand Up @@ -389,8 +391,12 @@ const GridColumnsManagementHeader = styled('div', {
padding: theme.spacing(1.5, 3),
}));

const SearchInput = styled(TextField)<{ ownerState: OwnerState }>(({ theme }) => ({
'& .MuiInputBase-root': {
const SearchInput = styled(TextField, {
name: 'MuiDataGrid',
slot: 'ColumnsManagementSearchInput',
overridesResolver: (props, styles) => styles.columnsManagementSearchInput,
})<{ ownerState: OwnerState }>(({ theme }) => ({
[`& .${inputBaseClasses.root}`]: {
paddingLeft: theme.spacing(1.5),
},
[`& input[type="search"]::-webkit-search-decoration,
Expand Down
5 changes: 5 additions & 0 deletions packages/x-data-grid/src/constants/gridClasses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@ export interface GridClasses {
* Styles applied to the columns management header element.
*/
columnsManagementHeader: string;
/**
* Styles applied to the columns management search input element.
*/
columnsManagementSearchInput: string;
/**
* Styles applied to the columns management footer element.
*/
Expand Down Expand Up @@ -720,6 +724,7 @@ export const gridClasses = generateUtilityClasses<GridClassKey>('MuiDataGrid', [
'columnsManagement',
'columnsManagementRow',
'columnsManagementHeader',
'columnsManagementSearchInput',
'columnsManagementFooter',
'container--top',
'container--bottom',
Expand Down

0 comments on commit b1ccc35

Please sign in to comment.