import type { IListener, IResource, IDataset } from './common'; export interface IBaseComponent { /** * 选填, 当前页面内的唯一 ID */ id?: string; /** * 可选, 数据字段名, 作为向后台传值的名称约定, 如 "user_name" */ name?: string; /** * 可选, 对用户可读的名称, 如 "用户名" */ label?: string; /** * 所属组件库 */ module?: string; /** * 必填, 组件名, 一般首字母大写的大驼峰形式, 如 Image */ component?: string; /** * 选填, 组件类型 */ type?: string; /** * 可选, 组件取值, 具体类型依赖 validity.format 决定 */ value?: any; /** * 可选, 组件控制属性 */ attributes?: IAttributes; /** * 可选, 组件事件信息 */ events?: IEvents; /** * 可选, 组件的数据有效性校验 */ validity?: IValidity; /** * 可选, 扩展字段, 尽量避免用 */ extra?: any; /** * 可选, 可递归结构, 子级对应 */ items?: IBaseComponent[]; /** * 可选, 应用的资源集合 * * 例如, 代码片段、组件库、静态资源 */ resources?: IResource[]; /** * 可选, 组件绑定的监听器 */ listeners?: IListener[]; /** * 可选, 变量集合 */ dataset?: IDataset; /** * 可选,动态绑定 class,字符串表达式 * '["1", "2"]' */ ':class'?: string; /** * 可选,动态绑定 style, 与静态合并,字符表达式 * '{width: 17}' */ ':style'?: string; /** 可选,组件局部样式 */ scopedStyle?: string; /** * 选填,指令属性 */ directives?: { /** * 选填,动态 if 指令 * boolean 或 字符串表达式 * @default true */ ':if'?: boolean | string; /** * 选填,动态 display 指令 * boolean 或 字符串表达式 * @default true */ ':display'?: boolean | string; /** * 选填,动态 for 指令 * 字符串表达式 (item, index) in list */ ':for'?: string; /** * 选填,静态 for key * 字符串,表示 for item 的 key */ key?: string; }; } export interface IAttributes { /** * 可选, 样式名 */ class?: string; /** * 可选, 标准 CSS 属性, 由于过多不宜下钻定义 */ style?: object; /** * 可选, 是否隐藏 */ hide?: boolean; [key: string]: any; } export interface IValidity { /** * 可选, 组件值是否必填 */ required?: boolean; /** * 可选, 组件值的数据类型 */ format?: string; /** * 可选, 最小值/最小长度 */ min?: number; /** * 可选, 最大值/最大长度 */ max?: number; /** * 可选, 需要符合的正则表达式 */ pattern?: string; } export interface IEvents { /** * 可选, 点击事件名 * * @default "click" */ clickEventName?: string; /** * 可选, 双击事件名 * * @default "dbClick" */ dblClickEventName?: string; /** * 可选, 鼠标移入事件名 * * @default "mouseEnter" */ mouseEnterEventName?: string; /** * 可选, 鼠标移出事件名 * * @default "mouseLeave" */ mouseLeaveEventName?: string; /** * 可选, 值变化事件名 * * @default "change" */ changeEventName?: string; /** * 可选, 开始拖拽事件名 * * @default "dragStart" */ dragStartEventName?: string; /** * 可选, 拖拽事件名 * * @default "drag" */ dragEventName?: string; /** * 可选, 结束拖拽事件名 * * @default "dragEnd" */ dragEndEventName?: string; /** * 可选, 自定义事件名 */ customEventName?: string; /** * 可选, 生命周期 - connected 事件名 */ lifecycleConnectedEventName?: string; /** * 可选, 生命周期 - disconnected 事件名 */ lifecycleDisconnectedEventName?: string; /** * 可选, 生命周期 - adopted 事件名 */ lifecycleAdoptedEventName?: string; /** * 可选, 生命周期 - attributeChanged 事件名 */ lifecycleAttributeChangedEventName?: string; } //# sourceMappingURL=component.d.ts.map