import React, { CSSProperties } from 'react'; import { FormItemProps, Rule } from 'antd/es/form'; import { EngineBaseProps } from '@lingxiteam/types'; export interface BaseFormFieldsProps { isFormRootChild: boolean; } export interface FormFieldsProps extends BaseFormFieldsProps { /** * 字段编码 */ fieldName: string; /** * 标题占比 */ labelCol?: string | number; /** * 内容占比 */ wrapperCol?: string | number; /** * 控件名称 */ name?: string; /** * 是否必填 */ required: boolean; /** * 是否禁用 */ disabled: boolean; /** * 是否只读 */ readOnly: boolean; /** * 是否显示 */ visible: boolean; /** * 控件自身列占比 */ selfSpan?: number; /** * 校验规则 */ rules: Rule[]; /** * 默认值 */ defaultValue: any; /** * 控件值 */ value: any; /** * 表单值主动触发变化调用 * @param value * @returns */ handleFormValue?: (value: any) => any; /** * 触发回调 trigger */ trigger?: string; /** * 表单子节点的值的属性 */ valuePropName?: string; /** * 样式 */ style: CSSProperties; /** * 是否隐藏 */ hidden?: boolean; /** * 控件只读模式下根据原始值自定义格式化数据 * @param val * @returns */ render?: (val: any) => any; /** * 忽略只读模式 */ ignoreReadOnlyFlag?: boolean; /** * 控件值主动触发回调 * @param value * @returns */ onValueChange?: (value: any) => void; /** * 值回调变化前格式化onChange数据 * @param value * @returns */ beforeValueChange?: (value: any) => any; /** * 表单触发校验Trigger */ validateTrigger?: string[] | string; children?: any; /** * 隐藏时占位, 当visible是false时候,visibility是true 隐藏时候占位(注意,属性配置的级别最高) * @default false */ visibility?: boolean; /** * 附加到控件classNames上 */ wrapperClassName?: string; label?: any; titleTip?: any; tipIcon?: any; tipLocation?: any; tipContent?: any; tipPlacement?: any; tipSize?: any; tipWidth?: any; tipHeight?: any; getEngineApis?: EngineBaseProps['getEngineApis']; /** * 当前的calssName */ className: string; uid: string; /** * 当改变的值为undefine时默认给的值 */ clearValue?: any; maskData?: { isMask: boolean; defaultMaskValue: any; maskValue: any; getMaskData(value: any): any; init: boolean; }; size?: string; /** * 数组属性名 */ namePath?: (string | number)[]; /** * 隐藏FormItem标题 */ hiddenLabel?: boolean; /** * 移除错误样式标志 */ removeErrorCls?: boolean; } export declare const getFieldsProps: (props: any) => FormFieldsProps; export interface FormFieldsHooks { changeValidateStatus(validateStatus: FormItemProps['validateStatus'], help?: string): void; onChange(...args: any): void; } export declare const FormFields: React.ForwardRefExoticComponent>; export default FormFields;