UNPKG

mui-rff

Version:

Set of modern wrapper components to facilitate using Material UI with React Final Form

28 lines (27 loc) 1.48 kB
/// <reference types="react" /> import { TextFieldProps as MuiTextFieldProps } from '@mui/material'; import { FieldProps, FieldRenderProps } from 'react-final-form'; import { ShowErrorFunc } from './Util'; export declare const TYPE_PASSWORD = "password"; export declare const TYPE_TEXT = "text"; export declare const TYPE_EMAIL = "email"; export declare const TYPE_NUMBER = "number"; export declare const TYPE_URL = "url"; export declare const TYPE_TELEPHONE = "tel"; export declare const TYPE_DATE = "date"; export declare const TYPE_DATETIME_LOCAL = "datetime-local"; export declare const TYPE_MONTH = "month"; export declare const TYPE_TIME = "time"; export declare const TYPE_WEEK = "week"; export declare const TYPE_COLOR = "color"; export type TEXT_FIELD_TYPE = typeof TYPE_PASSWORD | typeof TYPE_TEXT | typeof TYPE_EMAIL | typeof TYPE_NUMBER | typeof TYPE_URL | typeof TYPE_TELEPHONE | typeof TYPE_DATE | typeof TYPE_DATETIME_LOCAL | typeof TYPE_MONTH | typeof TYPE_TIME | typeof TYPE_WEEK | typeof TYPE_COLOR; export type TextFieldProps = Partial<Omit<MuiTextFieldProps, 'type' | 'onChange'>> & { name: string; type?: TEXT_FIELD_TYPE; fieldProps?: Partial<FieldProps<any, any>>; showError?: ShowErrorFunc; }; export declare function TextField(props: TextFieldProps): JSX.Element; type TextWrapperProps = FieldRenderProps<MuiTextFieldProps>; export declare function TextFieldWrapper(props: TextWrapperProps): JSX.Element; export {};