import { Observable, Subject } from "rxjs"; import { AbstractCoreControl, ChildCoreControl, ControlLayout } from "./model/base.model"; import 'reflect-metadata'; import { FormControl, FormGroup } from "@angular/forms"; import { FaObject, InitialData } from "./dy-form.interface"; import { EventEmitter } from "@angular/core"; import { FaDyFormCore } from "./dy-form"; export declare abstract class AbstractDyFormRef implements InitialData { private _verticalForm; protected messenger$: Subject; OnInit: EventEmitter; /** * 表单数据变化事件 */ OnValueChanges: EventEmitter; /** * 响应式是否开启 */ responsive: boolean; /** * 是否是垂直表单 * 为true时 响应式自动关闭 */ verticalForm: boolean; column: number; /** * 默认所有控件都按照这个配置进行响应式变化 */ controlLayout: ControlLayout; /** * 默认断点 */ gridBreakpoints: ControlLayout & { unit: string; }; /** * 自定义布局 */ customLayout: boolean; abstract readonly optionMap: Map; /** * 注册模型! * @param model */ abstract registeredModel(model: AbstractCoreControl[] | Function): this; /** * 添加控件 * 支持批量增加 * @param control 配置 * @param indexOrName 指定位置加入 */ abstract addControl(control: AbstractCoreControl | AbstractCoreControl[], indexOrName?: number | string): this; /** * 移除控件 * 支持批量移除 * @param controlName */ abstract removeControl(controlName: string | string[]): this; /** * 移除所有控件 */ abstract removeAllControl(): this; /** * 更新控件 * 支持批量更新 * @param control */ abstract updateControl(control: AbstractCoreControl | AbstractCoreControl[]): this; /** * 获取控件实例 * @param controlName */ abstract getControlByName(controlName: string): FormControl; abstract connect(): Observable; /** * 释放资源 */ abstract disconnect(): void; abstract setValues(value: { [key: string]: any; }, options?: { onlySelf?: boolean; emitEvent?: boolean; }): this; abstract reset(value?: any, options?: { onlySelf?: boolean; emitEvent?: boolean; }): any; /** * 禁用控件 * 支持批量 * @param keys */ abstract disabledByKeys(keys: string[] | string): this; /** * 启用控件 * 支持批量 * @param keys */ abstract enabledByKeys(keys: string[] | string): this; } export declare class FaDyFormRef extends AbstractDyFormRef { private _data; private readonly _renderData; private readonly _optionMap; readonly optionMap: Map; readonly setFormValue$: Subject<{ value: { [key: string]: any; }; options?: { onlySelf?: boolean; emitEvent?: boolean; }; }>; private _unsubscribe$; dyFormCore: FaDyFormCore; dyFormGroup: FormGroup; option: ChildCoreControl[]; private _disabledOrEnabled; disabledByKeys(keys: string[] | string): this; enabledByKeys(keys: string[] | string): this; constructor(models?: AbstractCoreControl[] | Function, initialData?: InitialData); private _registeredModel; registeredModel(model: AbstractCoreControl[] | Function): this; addControl(control: AbstractCoreControl | AbstractCoreControl[], indexOrName?: number | string): this; getControlByName(controlName: string): FormControl; removeControl(controlName: string | string[]): this; updateControl(control: AbstractCoreControl | AbstractCoreControl[]): this; disconnect(): void; connect(): Observable; setValues(value: { [p: string]: any; }, options?: { onlySelf?: boolean; emitEvent?: boolean; }): this; removeAllControl(): this; reset(value?: any, options?: { onlySelf?: boolean; emitEvent?: boolean; }): void; }