import { Rule } from 'async-validator'; import { HTMLAttributes, MutableRefObject, ReactNode } from 'react'; import { IKuFnSuffixProps } from '../components/KuFmExtension'; import { TFieldOptions } from '../plugins/fieldPlugins'; import { IKuFmCommonProps } from './form'; import { CommonObject, IFieldKuFmDependency, IOptions, NamePath } from './types'; /** field 关联配置(显隐 禁用 数据源 值) */ export declare type IFieldDependencyOptionType = { visible: boolean; disabled?: boolean; options?: IOptions[]; dependencyProps?: CommonObject; }; export declare type IKuFmFiledRef = { onDependsValuesChange?: (values: any[]) => void; }; export declare type IKuFmField = { /** 组件类型 */ field?: string; /** Field别名 */ name?: NamePath; props?: CommonObject; /** 去除样式 */ noStyle?: boolean; propsInterceptor?: (props?: Record) => Record; dependency?: IFieldKuFmDependency[]; children?: ReactNode | ((props: IFieldProps) => ReactNode); /** 标题 */ label?: ReactNode; /** 是否必填 */ required?: boolean | ((store: CommonObject) => boolean); /** 校验规则 */ rules?: Rule[]; /** 纯组件渲染 */ renderItem?: (form: CommonObject) => ReactNode; /** 不清空不在options中的值 */ disClearValueNotInOptions?: boolean; ref?: IKuFmFiledRef; /** 自定义校验className */ variableClassName?: string; } & IKuFmCommonProps & Pick & TFieldOptions & Pick, 'style' | 'className'> & T; export declare type IFieldProps = { onChange: (data: any) => void; value?: any; [key: string]: any; data: Pick; } & Omit; export declare type IFieldCtx = { options: MutableRefObject; variables: MutableRefObject; fieldProps: IKuFmField & { groupNames?: NamePath[]; }; setOptions: (options: IFieldDependencyOptionType) => void; forcedUpdate: () => void; };