@vebgen/mui-rff-autocomplete
Version:
An auto-complete component that you can use in a React-Final-Form.
28 lines (27 loc) • 1.26 kB
TypeScript
import { JSX, ReactNode } from 'react';
import { FieldRenderProps } from 'react-final-form';
import { TextFieldProps as MuiTextFieldProps } from '@mui/material/TextField';
import { AutocompleteProps } from './definitions';
interface AutocompleteInnerProps<T, Multiple extends boolean | undefined, DisableClearable extends boolean | undefined, FreeSolo extends boolean | undefined> extends AutocompleteProps<T, Multiple, DisableClearable, FreeSolo> {
/**
* A node used as the control label.
*/
label: ReactNode;
/**
* Indicate that the ui control should show a required mark.
*/
required?: boolean;
/**
* Options that will be provided to the inner MUI Autocomplete.
*/
textFieldProps?: Partial<MuiTextFieldProps>;
/**
* A function that retrieves the value from an autocomplete option.
*/
getOptionValue?: (option: T) => any;
}
/**
* The inner component which is rendered by RFF field.
*/
export declare function AutocompleteInner<T, Multiple extends boolean | undefined, DisableClearable extends boolean | undefined, FreeSolo extends boolean | undefined>(props: AutocompleteInnerProps<T, Multiple, DisableClearable, FreeSolo> & FieldRenderProps<MuiTextFieldProps>): JSX.Element;
export {};