import { AfterContentInit, AfterViewInit, ChangeDetectorRef, DoCheck, ElementRef, EmbeddedViewRef, InjectionToken, IterableChangeRecord, IterableDiffers, OnDestroy, OnInit, QueryList, Renderer2, TemplateRef } from '@angular/core'; import { JdDyForm } from './dy-form'; import { FormFocusDirective } from './form-focus.directive'; import { AbstractControl, FormBuilder, FormGroup } from '@angular/forms'; import { FocusKeyManager } from '@angular/cdk/a11y'; import { Breakpoint, ColumnObj, JdDyFormOptionItem, JdDyFormSubmitOrRest } from './dy-form.interface'; import { CustomControlContext } from './custom-control.directive'; import { getFormVaildError } from './dy-form-util'; import { CustomLabelContext } from './custom-label.directive'; export declare const DY_FORM_DEFAULT_CONFIG: InjectionToken<{}>; export declare class JdDyFormComponent implements OnInit, AfterViewInit, AfterContentInit, OnDestroy, DoCheck { private fb; private cd; private _config; private renderer; private _differs; a: string; private _isOnInit; private _unsubscribe$; private _dyConfig; formArea: FormGroup; formGroupDyForm: { [key: string]: JdDyForm; }; private _cacheSetValues; private _controlItemAtt; private buttonMarginRight$; size: 'large' | 'default' | 'small'; private _formOptions; private _formOptionsDiffer; private _customItemDiffer; private _customChange$; private _formOptionsDirty; private _resizeEvent; private _dyForm; private _invalidItem; private _customItem; controlArray: JdDyFormOptionItem[]; isLoading: { [key: string]: boolean; }; readonly controlMap: Map; suffix_button: TemplateRef; prefix_button: TemplateRef; private _customControl; private _customLabel; private _customControlOutlet; private _customLabelOutlet; private readonly _customControls; private readonly _customLabels; private readonly _customControlOutlets; private readonly _customLabelOutlets; labelElement: ElementRef; column: any; isInline: boolean; isGroup: boolean; loading: boolean; loadingTip: string; buttonMarginRight: number; breakpointOptions: Breakpoint; controlBreakpointOptions: ColumnObj; private readonly _columnDefaultConfig; keyManager: FocusKeyManager; surveyInputs: QueryList; submitButton: JdDyFormSubmitOrRest; restButton: JdDyFormSubmitOrRest; isShowButton: boolean; isByDepWidthDoResponsive: boolean; isVertical: boolean; getFormError: typeof getFormVaildError; formOptions: JdDyFormOptionItem[]; dyForm: JdDyForm; /** * 回车事件 */ _ENTER(key: string, event: KeyboardEvent): void; _onKeyDown($event: KeyboardEvent): void; openChange(isOpen: boolean, name: string): void; _clickSuffixAction(name: string, $event: any): void; watchDyHelp(): void; private _setFormKey; _markValid(): void; _inputBlur(name: string): void; private _clear; addField(fi: JdDyFormOptionItem, keyOrIndex?: string | number): void; private _updateCustomItem; removeField(nameOrIndex: string | number, isDelInvalid?: boolean): void; OnNotSearchResult($event: { isNeedLoading: boolean; value: string; }, name: any): void; removeAll(): void; /** * 表单重置 * @param $event */ rest($event?: MouseEvent): void; /** * 表单提交 * @param formArea * @param $event */ submit(formArea: FormGroup, $event?: KeyboardEvent): void; _tableSelectChange($event: any): void; getFormControl(name: string): AbstractControl; private _validSetValues; /** * 设置值 * @param value */ setValue(value?: { [p: string]: any; }): void; reset(value?: any, options?: { onlySelf?: boolean; emitEvent?: boolean; }): void; _autoFillSelectContent(value: { [p: string]: any; }): void; private _isExist; _onSearch($event: any, key: any): void; constructor(fb: FormBuilder, cd: ChangeDetectorRef, _config: any, renderer: Renderer2, _differs: IterableDiffers); /** * 初始化自定义控件 通用 * @param type 自定义类型 'label' | 'control' */ private _initCustom; /** * 初始化自定义控件label */ private _initCustomLabel; /** * 初始化自定义控件control */ private _initCustomControl; /** * 获取自定义模板的通用方法 * @param type 自定义类型 'label' | 'control' * @param key 控件名称 根据控件名称获取对应的自定义模板 * @return 返回对应的模板 或者 undefined */ private _getCustomTemp; /** * 获取自定义label模板 * @param key 控件名称 * @return 返回对应的模板 或者 undefined */ private _getCustomLabelTemp; /** * 获取自定义控件模板 * @param key 控件名称 * @return 返回对应的模板 或者 undefined */ private _getCustomControlTemp; private _perViewChange; private _perLabelViewChange; private _renderCustom; renderCustomLabel(value: IterableChangeRecord): void; renderCustomControl(value: IterableChangeRecord): void; ngAfterContentInit(): void; ngOnInit(): void; ngAfterViewInit(): void; watchFormChange(): void; /** * 释放资源 */ ngOnDestroy(): void; ngDoCheck(): void; private _applyCustomChanges; private _applyChanges; removeOptions(keyOrIndex: string | number | string[] | number[]): void; private _getIndexByName; updateOptions(...item: JdDyFormOptionItem[]): void; addOptions(keyOrIndex?: string | number, ...item: JdDyFormOptionItem[]): number; move(previousIndex: number | null, currentIndex: number | null): void; private trackByFn; } export declare function getTypeNameForDebugging(type: any): string; export declare class CustomControlRecordViewTuple { record: IterableChangeRecord; view: EmbeddedViewRef; constructor(record: IterableChangeRecord, view: EmbeddedViewRef); } export declare class CustomLabelRecordViewTuple { record: IterableChangeRecord; view: EmbeddedViewRef; constructor(record: IterableChangeRecord, view: EmbeddedViewRef); }