///
import { UseFormReturn, UseControllerReturn } from 'react-hook-form';
import { FieldType } from './constants/fields';
import { GridProps } from '@material-ui/core';
export declare type Field = {
type: FieldType | string;
name?: string;
label?: string;
assistiveText?: string;
conditional?: 'check' | 'option';
displayCondition?: string;
required?: boolean;
disabled?: boolean;
validation?: any[][];
defaultValue?: any;
gridCols?: GridProps['xs'];
disablePadding?: boolean;
[key: string]: any;
};
export declare type Fields = Field[];
export interface IFieldComponentProps extends UseControllerReturn {
index: number;
name: string;
useFormMethods: UseFormReturn;
label: string;
errorMessage?: string;
assistiveText?: string;
required?: boolean;
disabled?: boolean;
[key: string]: any;
}
export declare type CustomComponent
= React.ComponentType
| React.LazyExoticComponent>;
export declare type CustomComponents = {
[type: string]: {
component: CustomComponent
;
defaultValue?: any;
validation?: any[][];
};
};
export interface IFieldConfig {
type: string;
name: string;
group: 'input' | 'content';
icon: React.ReactNode;
dataType: string;
defaultValue: any;
component: CustomComponent;
settings: Fields;
validation: (config: Record) => any[][];
}