Skip to content

Commit 14d691c

Browse files
Merge pull request #1575 from Rajesh-Nagarajan-11/migrate/slotprops-muiv9
Migrate deprecated InputProps, inputProps, and InputLabelProps to slotProps API for MUI v9
2 parents 62089f7 + b81e4dc commit 14d691c

7 files changed

Lines changed: 77 additions & 62 deletions

File tree

src/custom/DashboardWidgets/GettingStartedWidget/TeamSearchField.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,11 @@ const TeamSearchField: React.FC<TeamSearchFieldProps> = ({
146146
error={error}
147147
helperText={error ? 'Team Already Selected' : ''}
148148
fullWidth
149-
InputProps={{
150-
...params.InputProps,
151-
endAdornment: isLoading ? <CircularProgress color="inherit" size={20} /> : null
149+
slotProps={{
150+
input: {
151+
...params.slotProps?.input,
152+
endAdornment: isLoading ? <CircularProgress color="inherit" size={20} /> : null
153+
}
152154
}}
153155
/>
154156
)}

src/custom/InputSearchField/InputSearchField.tsx

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -127,19 +127,21 @@ const InputSearchField: React.FC<InputSearchFieldProps> = ({
127127
error={!!error}
128128
helperText={error}
129129
fullWidth
130-
InputLabelProps={{
131-
style: {
132-
fontFamily: 'inherit'
130+
slotProps={{
131+
inputLabel: {
132+
style: {
133+
fontFamily: 'inherit'
134+
}
135+
},
136+
input: {
137+
...params.slotProps?.input,
138+
endAdornment: (
139+
<React.Fragment>
140+
{isLoading ? <CircularProgress color="inherit" size={20} /> : null}
141+
</React.Fragment>
142+
)
133143
}
134144
}}
135-
InputProps={{
136-
...params.InputProps,
137-
endAdornment: (
138-
<React.Fragment>
139-
{isLoading ? <CircularProgress color="inherit" size={20} /> : null}
140-
</React.Fragment>
141-
)
142-
}}
143145
/>
144146
)}
145147
renderOption={(props, option: Option) => (

src/custom/TransferModal/TransferList/TransferList.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,10 @@ function TransferList({
258258
checked={checked.indexOf(item) !== -1}
259259
tabIndex={-1}
260260
disableRipple
261-
inputProps={{
262-
'aria-labelledby': labelId
261+
slotProps={{
262+
input: {
263+
'aria-labelledby': labelId
264+
}
263265
}}
264266
/>
265267
</ListItem>

src/custom/TypingFilter/index.tsx

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -116,33 +116,35 @@ export function TypingFilter({ filterSchema, handleFilter, autoFilter = false }:
116116
value={filterState.context?.value}
117117
onChange={handleFilterChange}
118118
onFocus={handleFocus}
119-
InputProps={{
120-
startAdornment: (
121-
<InputAdornment position="start">
122-
{' '}
123-
<ContentFilterIcon
124-
/*
125-
fill={(theme) => {
126-
theme.palette.iconMain;
127-
}}
128-
*/
129-
/>{' '}
130-
</InputAdornment>
131-
),
132-
endAdornment: (
133-
<InputAdornment position="end">
134-
<IconButton onClick={handleClear}>
135-
{filterState.state !== FilteringState.IDLE && (
136-
<CrossCircleIcon
137-
/*fill={(theme) => {
138-
theme.palette.iconMain;
139-
}}
140-
*/
141-
/>
142-
)}
143-
</IconButton>
144-
</InputAdornment>
145-
)
119+
slotProps={{
120+
input: {
121+
startAdornment: (
122+
<InputAdornment position="start">
123+
{' '}
124+
<ContentFilterIcon
125+
/*
126+
fill={(theme) => {
127+
theme.palette.iconMain;
128+
}}
129+
*/
130+
/>{' '}
131+
</InputAdornment>
132+
),
133+
endAdornment: (
134+
<InputAdornment position="end">
135+
<IconButton onClick={handleClear}>
136+
{filterState.state !== FilteringState.IDLE && (
137+
<CrossCircleIcon
138+
/*fill={(theme) => {
139+
theme.palette.iconMain;
140+
}}
141+
*/
142+
/>
143+
)}
144+
</IconButton>
145+
</InputAdornment>
146+
)
147+
}
146148
}}
147149
/>
148150
<Popper

src/custom/UniversalFilter.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,10 @@ function UniversalFilter({
109109
width: '20rem',
110110
marginBottom: '1rem'
111111
}}
112-
inputProps={{
113-
'aria-label': 'Without label',
114-
'data-testid': `${testId}-select-${filterColumn}`
112+
slotProps={{
113+
input: {
114+
'aria-label': 'Without label'
115+
}
115116
}}
116117
displayEmpty
117118
>

src/custom/UserSearchField/UserSearchField.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,15 @@ const UserShareSearch: React.FC<UserSearchFieldProps> = ({
155155
paddingBlock: '0.1rem'
156156
}
157157
}}
158-
InputProps={{
159-
...params.InputProps,
160-
endAdornment: (
161-
<>{searchUserLoading ? <CircularProgress color="inherit" size={20} /> : null}</>
162-
)
158+
slotProps={{
159+
input: {
160+
...params.slotProps?.input,
161+
endAdornment: (
162+
<>
163+
{searchUserLoading ? <CircularProgress color="inherit" size={20} /> : null}
164+
</>
165+
)
166+
}
163167
}}
164168
/>
165169
)}

src/custom/UserSearchField/UserSearchFieldInput.tsx

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -182,19 +182,21 @@ const UserSearchField: React.FC<UserSearchFieldProps> = ({
182182
label={label}
183183
error={!!error}
184184
helperText={error}
185-
InputLabelProps={{
186-
style: {
187-
fontFamily: 'inherit'
185+
slotProps={{
186+
inputLabel: {
187+
style: {
188+
fontFamily: 'inherit'
189+
}
190+
},
191+
input: {
192+
...params.slotProps?.input,
193+
endAdornment: (
194+
<React.Fragment>
195+
{isUserSearchLoading ? <CircularProgress color="inherit" size={20} /> : null}
196+
</React.Fragment>
197+
)
188198
}
189199
}}
190-
InputProps={{
191-
...params.InputProps,
192-
endAdornment: (
193-
<React.Fragment>
194-
{isUserSearchLoading ? <CircularProgress color="inherit" size={20} /> : null}
195-
</React.Fragment>
196-
)
197-
}}
198200
/>
199201
)}
200202
renderOption={(props, option: User) => (

0 commit comments

Comments
 (0)