@cmk/fe_utils
Version:
frontend utility library
39 lines (37 loc) • 1.87 kB
TypeScript
import { ChangeEvent, Ref } from 'react';
import { FormControlProps, FormHelperTextProps, MenuItemProps, TypographyProps, SelectProps } from '@mui/material';
import { BoxProps } from '@mui/material/Box';
import { GenericInputFieldProps } from './types';
import { CTextFieldProps } from './TextField';
export type CustomSelectProps = {
variant?: SelectProps['variant'];
disableTopPadding?: boolean;
value?: string | number | boolean | null;
options?: {
value: string | number | boolean;
label: string;
}[];
disableHelperText?: boolean;
disableLabel?: boolean;
labelSx?: BoxProps['sx'];
onChange?: ((newValue: string, e: ChangeEvent<HTMLInputElement>) => void) | ((newValue: number, e: ChangeEvent<HTMLInputElement>) => void) | ((newValue: boolean, e: ChangeEvent<HTMLInputElement>) => void);
locked?: boolean;
size?: string;
slotProps?: SelectProps['slotProps'] & {
rootContainer?: FormControlProps;
inputCombobox?: SelectProps['inputProps'];
inputContainer?: SelectProps['SelectDisplayProps'];
input?: SelectProps['inputProps'];
selectDisplay?: SelectProps['SelectDisplayProps'];
menu?: SelectProps['MenuProps'];
formHelperText?: FormHelperTextProps;
label?: TypographyProps;
menuItem?: MenuItemProps;
};
};
export type SpecificMuiTextFieldProps = Omit<CTextFieldProps, keyof CustomSelectProps>;
export type SpecificMuiSelectProps = Omit<SelectProps, keyof CTextFieldProps | keyof GenericInputFieldProps<'select'> | keyof CustomSelectProps>;
export type CSelectProps = Omit<GenericInputFieldProps<'select'>, 'value'> & SpecificMuiTextFieldProps & SpecificMuiSelectProps & CustomSelectProps & {
ref?: Ref<HTMLInputElement>;
};
export declare const Select: (props: CSelectProps) => import("react/jsx-runtime").JSX.Element;