import { PropType, VNode } from 'vue'; import { ComponentPropsType, BaseSize, UnReadOnly } from '../shared'; import { ElTooltipProps, FormItemProps } from 'element-plus'; import { BuiltinFieldEditor, BuiltinFieldEditorType, builtinFieldEditors } from './builtin'; import { FormModel } from '../../'; export { type BuiltinFieldEditor, type BuiltinFieldEditorType, builtinFieldEditors }; export interface FieldEditorProps { placeholder?: string; disabled?: boolean; readonly?: boolean; options?: FieldOption[]; modelValue?: any; onFocus?: () => void; onBlur?: () => void; onChange?: (v: any, data?: any) => void; 'onUpdate:modelValue'?: (v: any) => void; [key: string]: any; } export interface FieldOption { label: string; value: any; disabled?: boolean; children?: FieldOption[]; data?: any; } export type FieldOptionsLoader = (model?: FormModel) => FieldOption[] | Promise; export type FieldVisibleCondition = boolean | Record | ((model: FormModel) => boolean); export declare const fieldProps: { /** * 字段名称 */ name: { type: StringConstructor; }; /** * 字段标题文本 */ label: { type: StringConstructor; }; /** * 编辑器组件 */ editor: { type: PropType>; default: string; }; /** * 编辑器组件参数 */ props: { type: PropType>; }; /** * 字段值 */ modelValue: { type: PropType; default(context: any): any; }; /** * 输入框尺寸 */ size: { type: PropType; }; width: { type: PropType; }; /** * 是否在tooltip显示校验信息 */ tooltipMessage: { type: PropType>; default: boolean; }; /** * tooltip信息显示相对输入框的位置 */ tooltipPosition: { type: PropType<"inner" | "outer" | number>; default: string; }; /** * null 不显示 placeholder */ placeholder: { type: PropType; }; /** * 禁用 */ disabled: { type: PropType; }; /** * 只读 */ readonly: { type: PropType; }; /** * 选项数据 */ options: { type: PropType; }; /** * 是否显示控制 */ visible: { type: (BooleanConstructor | ObjectConstructor | FunctionConstructor)[]; default: boolean; }; /** * 级联字段,根据字段值变化刷新options */ cascader: { type: PropType; }; /** * 校验错误信息 */ error: { type: StringConstructor; }; /** * 提示文本 */ tip: { type: StringConstructor; }; /** * 表单项内容采用inline布局 */ inline: { type: BooleanConstructor; }; /** * 隐藏域 */ hidden: { type: BooleanConstructor; }; /** * 默认值 */ defaultValue: { type: (BooleanConstructor | NumberConstructor | StringConstructor | ObjectConstructor | ArrayConstructor)[]; default: undefined; }; }; export type FieldProps = ComponentPropsType & Partial>; export type FieldEmits = { 'update:modelValue': [value: any]; change: [value: any, data?: any]; focus: []; blur: []; };