import React from 'react'; import { FormProps, FormItemProps, FormInstance } from 'antd/lib/form'; export declare type IWidth = 'half' | 'double' | 'all' | 'halfAll'; export interface IFormItemWrap { children?: React.ReactNode; className?: string; width?: IWidth; } export interface IFormConfigInfo { isRequired?: boolean | number; isChangeable?: boolean | number; isDisplay?: boolean | number; } export interface IFormItem extends FormItemProps { /** * 是否必填 */ isRequired?: boolean; /** * 是否可以修改 */ isChangeable?: boolean; /** * 是否展示 */ isDisplay?: boolean; /** * 前缀 */ preText?: React.ReactNode; /** * 后缀 */ nextText?: React.ReactNode; /** * 子元素渲染 */ render: (itemProps: any, formInstance?: FormInstance) => JSX.Element; /** * @deprecated 不推荐使用这个属性,请使用 isChangeable标识;如果需要禁用动态列配置的取消 可以配置dynamicDisabled */ disabled?: boolean; /** * 是否要边框 */ noBorder?: boolean; /** * 是否显示label */ noLabel?: boolean; /** * 单复选框时显示边框 */ showBoxBorder?: boolean; width?: IWidth; /** * 动态列配置 是否禁止隐藏 */ dynamicDisabled?: boolean; /** * 是否隐藏lable */ hiddenLabel?: boolean; /** * 通过shouldUpdate控制依赖关系的默认处理 */ shouldUpdateNames?: string[]; /** * 依赖关系发生改变是否需要清空 当前item */ shouldUpdateClear?: boolean | string[]; /** * 表单项取配置项的名称 如果没有就取name字段 */ configName?: string; /** * 是否需要外部参数判断是否渲染组件,编写高性能表单时,可能会用到这个配置 * 什么场景下需要开启这个配置: * 当你的 items 配置需要依赖外部state时可开启 * 即 你的items 可能因为某个state的改变而重新生成时,可选择开启 */ shouldUpdateBeOutsideState?: (prevOutsideState: any, nextOutsideState: any) => boolean; /** * 详情子元素渲染 */ detailRender?: (itemProps: IFormItem, formInstance?: FormInstance) => JSX.Element; } export interface IProFormProps extends FormProps { items: IFormItem[]; /** * 容器是否需要下边框 */ noBottom?: boolean; /** * 主容器类名 */ wrapClassName?: string; /** * 左容器类名 */ leftClassName?: string; /** * 是否开启做容器flex布局 */ isFlex?: boolean; isToggle?: boolean; /** 收起时 展示几行 */ toggleNum?: number; /** * 子项类名 */ itemClassName?: string; /** * 是否显示右侧容器 */ rightWrapVisible?: boolean; /** * 右容器 */ rightClassName?: string; /** * 点击重置 */ onResetHandle?: any; /** * 点击查询 */ onSearchHandle?: any; /** * 是否开启动态列配置 */ showDynamic?: boolean; showDynamicKey?: string; /** * 表单配置信息,配置优先 */ configInfo?: { [prop: string]: IFormConfigInfo; }; /** * 表单内部需要的外部参数 */ outsideState?: any; handleRef?: React.MutableRefObject<{ setToggleHandle: (toggle: boolean) => void; } | null>; /** * 详情展示 */ readonly?: boolean; } export interface IFormItemProps { items: IFormItem[]; /** * 子项类名 */ itemClassName?: string; form?: any; /** * 表单配置信息,配置优先 */ configInfo?: { [prop: string]: IFormConfigInfo; }; /** * 表单内部需要的外部参数 */ outsideState?: any; } export interface ISearchLayout { name: string | IFormItem['name']; label?: string | IFormItem['label']; show?: boolean; disabled?: boolean; dynamicDisabled?: any; [props: string]: any; } export interface ISettingProps { showDynamicKey?: string; list: ISearchLayout[]; initList: ISearchLayout[]; setCurrentDynamicList: any; } export interface IFormDetail extends Pick { }