Skip to content

Commit 72a0d64

Browse files
moved changes, extend SelectProps with inputProps
1 parent 22112a2 commit 72a0d64

File tree

1 file changed

+9
-15
lines changed

1 file changed

+9
-15
lines changed

packages/mui-material/src/TablePagination/TablePagination.d.ts

+9-15
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export interface TablePaginationOwnProps extends TablePaginationBaseProps {
129129
*
130130
* @default {}
131131
*/
132-
SelectProps?: SelectPropsVariant;
132+
SelectProps?: Partial<SelectProps>;
133133
/**
134134
* If `true`, show the first-page button.
135135
* @default false
@@ -146,7 +146,7 @@ export interface TablePaginationOwnProps extends TablePaginationBaseProps {
146146
*/
147147
slotProps?: {
148148
actions?: TablePaginationActionsProps['slotProps'];
149-
select?: Partial<SelectProps>;
149+
select?: SelectPropsVariant<TablePaginationVariants>;
150150
};
151151
/**
152152
* The system prop that allows defining system overrides as well as additional CSS styles.
@@ -156,19 +156,13 @@ export interface TablePaginationOwnProps extends TablePaginationBaseProps {
156156

157157
type TablePaginationVariants = 'filled' | 'standard' | 'outlined';
158158

159-
type SelectInputProps<Variant extends TablePaginationVariants> = Variant extends 'filled'
160-
? Partial<FilledInputProps>
161-
: Variant extends 'standard'
162-
? Partial<StandardInputProps>
163-
: Partial<OutlinedInputProps>;
164-
165-
export interface SelectPropsVariant<
166-
Variant extends TablePaginationVariants = TablePaginationVariants,
167-
> extends Partial<SelectProps> {
168-
variant?: Variant;
169-
InputProps?: SelectInputProps<Variant>;
170-
// ... (other variant-specific props)
171-
}
159+
// Extend SelectProps based on the variant
160+
type SelectPropsVariant<Variant extends TablePaginationVariants> = Partial<SelectProps> &
161+
(Variant extends 'filled'
162+
? Partial<FilledInputProps>
163+
: Variant extends 'standard'
164+
? Partial<StandardInputProps>
165+
: Partial<OutlinedInputProps>);
172166

173167
export interface TablePaginationTypeMap<AdditionalProps, RootComponent extends React.ElementType> {
174168
props: AdditionalProps & TablePaginationOwnProps;

0 commit comments

Comments
 (0)