formik-mui
Version:
143 lines (103 loc) • 6.96 kB
TypeScript
import { AutocompleteProps as AutocompleteProps_2 } from '@mui/material/Autocomplete';
import { AutocompleteRenderInputParams } from '@mui/material/Autocomplete';
import { CheckboxProps as CheckboxProps_2 } from '@mui/material/Checkbox';
import { FieldProps } from 'formik';
import { FormControlLabelProps } from '@mui/material/FormControlLabel';
import { FormControlProps } from '@mui/material/FormControl';
import { FormHelperTextProps } from '@mui/material/FormHelperText';
import { InputBaseProps as InputBaseProps_2 } from '@mui/material/InputBase';
import { InputLabelProps } from '@mui/material/InputLabel';
import { InputProps } from '@mui/material/Input';
import { JSX as JSX_2 } from 'react/jsx-runtime';
import { RadioGroupProps as RadioGroupProps_2 } from '@mui/material/RadioGroup';
import { SelectProps as SelectProps_2 } from '@mui/material/Select';
import { SwitchProps as SwitchProps_2 } from '@mui/material/Switch';
import { TextFieldProps as TextFieldProps_2 } from '@mui/material/TextField';
import { ToggleButtonGroupProps as ToggleButtonGroupProps_2 } from '@mui/material/ToggleButtonGroup';
export declare function Autocomplete<T, Multiple extends boolean | undefined, DisableClearable extends boolean | undefined, FreeSolo extends boolean | undefined>(props: AutocompleteProps<T, Multiple, DisableClearable, FreeSolo>): JSX_2.Element;
export declare namespace Autocomplete {
var displayName: string;
}
export declare interface AutocompleteProps<T, Multiple extends boolean | undefined, DisableClearable extends boolean | undefined, FreeSolo extends boolean | undefined> extends FieldProps, Omit<AutocompleteProps_2<T, Multiple, DisableClearable, FreeSolo>, 'name' | 'value' | 'defaultValue'> {
type?: string;
}
export { AutocompleteRenderInputParams }
export declare function Checkbox(props: CheckboxProps): JSX_2.Element;
export declare namespace Checkbox {
var displayName: string;
}
export declare interface CheckboxProps extends FieldProps, Omit<CheckboxProps_2, 'name' | 'value' | 'error' | 'form' | 'checked' | 'defaultChecked' | 'type'> {
type?: string;
}
export declare function CheckboxWithLabel({ Label, ...props }: CheckboxWithLabelProps): JSX_2.Element;
export declare namespace CheckboxWithLabel {
var displayName: string;
}
/**
* Exclude props that are passed directly to the control
* https://github.com/mui-org/material-ui/blob/v3.1.1/packages/material-ui/src/FormControlLabel/FormControlLabel.js#L71
*/
export declare interface CheckboxWithLabelProps extends FieldProps, CheckboxProps {
Label: Omit<FormControlLabelProps, 'checked' | 'name' | 'value' | 'control'>;
}
export declare function fieldToAutocomplete<T, Multiple extends boolean | undefined, DisableClearable extends boolean | undefined, FreeSolo extends boolean | undefined>({ disabled, field, form: { isSubmitting, setFieldValue }, type, onChange, onBlur, freeSolo, ...props }: AutocompleteProps<T, Multiple, DisableClearable, FreeSolo>): AutocompleteProps_2<T, Multiple, DisableClearable, FreeSolo>;
export declare function fieldToCheckbox({ disabled, field: { onBlur: fieldOnBlur, ...field }, form: { isSubmitting }, type, onBlur, ...props }: CheckboxProps): CheckboxProps_2;
export declare function fieldToInputBase({ disabled, field: { onBlur: fieldOnBlur, ...field }, form: { isSubmitting }, onBlur, ...props }: InputBaseProps): InputBaseProps_2;
export declare function fieldToRadioGroup({ field: { onBlur: fieldOnBlur, ...field }, form, onBlur, ...props }: RadioGroupProps): RadioGroupProps_2;
export declare function fieldToSelect({ disabled, field: { onBlur: _onBlur, onChange: fieldOnChange, ...field }, form: { isSubmitting, touched, errors, setFieldTouched, setFieldValue }, onClose, ...props }: Omit<SelectProps, 'formControl' | 'formHelperText' | 'inputLabel'>): SelectProps_2 & {
formError: any;
};
export declare function fieldToSwitch({ disabled, field: { onBlur: fieldOnBlur, ...field }, form: { isSubmitting }, type, onBlur, ...props }: SwitchProps): SwitchProps_2;
export declare function fieldToTextField({ disabled, field: { onBlur: fieldOnBlur, ...field }, form: { isSubmitting, touched, errors }, onBlur, helperText, ...props }: TextFieldProps): TextFieldProps_2;
export declare function fieldToToggleButtonGroup({ field: { onChange: _onChange, onBlur: fieldOnBlur, ...field }, type, onChange, onBlur, form, ...props }: ToggleButtonGroupProps): ToggleButtonGroupProps_2;
export declare function InputBase(props: InputBaseProps): JSX_2.Element;
export declare namespace InputBase {
var displayName: string;
}
export declare interface InputBaseProps extends FieldProps, Omit<InputBaseProps_2, 'name' | 'value' | 'error'> {
}
export declare function RadioGroup(props: RadioGroupProps): JSX_2.Element;
export declare namespace RadioGroup {
var displayName: string;
}
export declare interface RadioGroupProps extends FieldProps, Omit<RadioGroupProps_2, 'name' | 'value'> {
}
export declare function Select({ formControl, inputLabel, formHelperText, ...selectProps }: SelectProps): JSX_2.Element;
export declare namespace Select {
var displayName: string;
}
export declare interface SelectProps extends FieldProps, Omit<SelectProps_2, 'name' | 'value'> {
formControl?: FormControlProps;
formHelperText?: FormHelperTextProps;
inputLabel?: InputLabelProps;
}
export declare const SimpleFileUpload: ({ field, form: { isSubmitting, touched, errors, setFieldValue }, label, accept, disabled, InputProps: inputProps, InputLabelProps: inputLabelProps, FormControlProps: formControlProps, }: SimpleFileUploadProps) => JSX_2.Element;
export declare interface SimpleFileUploadProps extends FieldProps {
label: string;
accept: string;
disabled?: boolean;
InputProps?: Omit<InputProps, 'name' | 'type' | 'label'>;
InputLabelProps?: InputLabelProps;
FormControlProps?: FormControlProps;
}
export declare function Switch(props: SwitchProps): JSX_2.Element;
export declare namespace Switch {
var displayName: string;
}
export declare interface SwitchProps extends FieldProps, Omit<SwitchProps_2, 'checked' | 'name' | 'value' | 'defaultChecked' | 'form' | 'type'> {
type?: string;
}
export declare function TextField({ children, ...props }: TextFieldProps): JSX_2.Element;
export declare namespace TextField {
var displayName: string;
}
export declare interface TextFieldProps extends FieldProps, Omit<TextFieldProps_2, 'name' | 'value' | 'error'> {
}
export declare function ToggleButtonGroup(props: ToggleButtonGroupProps): JSX_2.Element;
export declare namespace ToggleButtonGroup {
var displayName: string;
}
export declare interface ToggleButtonGroupProps extends FieldProps, Omit<ToggleButtonGroupProps_2, 'name' | 'value' | 'error'> {
type?: string;
}
export { }