UNPKG

@alauda-fe/common

Version:

Alauda frontend team common codes.

44 lines (43 loc) 2.06 kB
import { NotificationService } from '@alauda/ui'; import { Location } from '@angular/common'; import { Injector, OnInit } from '@angular/core'; import { FormBuilder, FormGroup } from '@angular/forms'; import { Observable } from 'rxjs'; import { InterceptDeactivateService } from '../public-api'; import * as i0 from "@angular/core"; /** * http://confluence.alauda.cn/display/FRON/Issue-Angular+related * 由于formControl存在内存泄漏问题,内部 form 展示-隐藏切换应当采用 hidden 进行控制 */ export declare abstract class BaseFormContainer<T = any> implements OnInit { isUpdate: boolean; initResource: T; initResource$: Observable<T>; hideManagedFields: boolean; private readonly ngForm; codeEditorOptions: import("../../code/code-editor-configs").IEditorConstructionOptions; actionsConfig: import("@alauda/code-editor").CodeEditorActionsConfig; formView: 'UI' | 'YAML'; submitting: boolean; resource: T; yaml: string; originalYaml: string; fb: FormBuilder; interceptDeactivate: InterceptDeactivateService; form: FormGroup; protected notification: NotificationService; protected location: Location; protected fillResource: (resource: T) => T; abstract submit(params?: unknown): void; constructor(injector: Injector); ngOnInit(): void; switchFormView(view: 'YAML' | 'UI'): void; cancel(escape?: boolean): void; protected checkForm(): boolean; protected yamlToResource(yaml: string): T; protected resourceToYaml(resource: T): string; protected updateResource(resource: T): void; protected stringifyResource(resource: T): string; static ɵfac: i0.ɵɵFactoryDeclaration<BaseFormContainer<any>, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<BaseFormContainer<any>, never, never, { "isUpdate": { "alias": "isUpdate"; "required": false; }; "initResource": { "alias": "initResource"; "required": false; }; "hideManagedFields": { "alias": "hideManagedFields"; "required": false; }; }, {}, never, never, false, never>; }