mui-rff
Version:
Set of modern wrapper components to facilitate using Material UI with React Final Form
26 lines (25 loc) • 1.07 kB
TypeScript
import React, { ReactNode } from 'react';
import { FormControlProps, FormHelperTextProps, InputLabelProps, MenuItemProps, SelectProps as MuiSelectProps } from '@mui/material';
import { ShowErrorFunc } from './Util';
import { FieldProps } from 'react-final-form';
export interface SelectData {
label: string | number | React.ReactElement;
value: string | number | string[] | undefined;
disabled?: boolean;
}
export interface SelectProps extends Partial<Omit<MuiSelectProps, 'onChange'>> {
name: string;
label?: string | number | React.ReactElement;
required?: boolean;
multiple?: boolean;
helperText?: React.ReactNode;
fieldProps?: Partial<FieldProps<any, any>>;
formControlProps?: Partial<FormControlProps>;
inputLabelProps?: Partial<InputLabelProps>;
formHelperTextProps?: Partial<FormHelperTextProps>;
showError?: ShowErrorFunc;
menuItemProps?: Partial<MenuItemProps>;
data?: SelectData[];
children?: ReactNode;
}
export declare function Select(props: SelectProps): JSX.Element;