/** * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE */ import { FocusMonitor } from '@angular/cdk/a11y'; import { AfterViewInit, ChangeDetectorRef, DoCheck, OnDestroy, OnInit } from '@angular/core'; import { ControlValueAccessor } from '@angular/forms'; import { NzConfigService } from 'ng-zorro-antd/core/config'; import { Subject } from 'rxjs'; import * as i0 from "@angular/core"; export declare abstract class MagFormField2 implements ControlValueAccessor, OnInit, AfterViewInit, DoCheck, OnDestroy { nzConfigService: NzConfigService; protected cdr: ChangeDetectorRef; protected focusMonitor: FocusMonitor; protected _unsubscribeAll: Subject; componentId: string; stateChanges: Subject; /** * output 모델과 동일 */ value: T; onChange: (value: T) => void; onTouched: () => void; nzLoading: boolean; nzDisabled: boolean; nzControl: boolean; constructor(nzConfigService: NzConfigService, cdr: ChangeDetectorRef, focusMonitor: FocusMonitor); ngOnInit(): void; ngAfterViewInit(): void; ngOnDestroy(): void; hostClick(e: MouseEvent): void; /** * 외부로부터 값을 주입받는다. * 본 메서드는 반드시 변경 이벤트를 발행하지 않고, 내부 값을 업데이트해야한다. * MagFormField 에서는 다음과 같은 기본 로직만 수행한다. * - value 설정 * - 화면 렌더링 트리거 * * Note. 기본 기능(value 설정 및 화면 렌더링 트리거) 외에 변경이 필요한 경우 본 메서드를 오버라이드해서 직접 구현해야한다. * @param value */ writeValue(value: T): void; /** * 외부로 값을 출력하고, 내부 값을 갱신한다. * * 메소드 구현 주의사항: 내부 값 변경시에만 output 이벤트를 발행하고 ChangeDetector 를 트리거해야한다. * * MagFormField 에서는 다음과 같은 기본 로직만 수행한다. * - 전달된 value 가 저장된 value 와 동일한지(deep check) 체크 후, 다른 경우에 value 값을 설정 * - 값이 변경된 경우 변경 이벤트(onChange) 발행 * - 화면 렌더링 트리거 * * Note. 기본 기능(value 변경 여부 확인 및 설정 후 필요시 변경 이벤트 발행 및 화면 렌더링 트리거) 외에 변경이 필요한 경우 본 메서드를 오버라이드해서 직접 구현해야한다. * @param value */ protected updateValue(value: T): void; focus(): void; blur(): void; /** * @description * Registers a callback function that is called when the control's value * changes in the UI. * * This method is called by the forms API on initialization to update the form * model when values propagate from the view to the model. * * When implementing the `registerOnChange` method in your own value accessor, * save the given function so your class calls it at the appropriate time. * * @usageNotes * ### Store the change function * * The following example stores the provided function as an internal method. * @param fn */ registerOnChange(fn: (v: T) => void): void; registerOnTouched(fn: () => void): void; setDisabledState(isDisabled: boolean): void; ngDoCheck(): void; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵdir: i0.ɵɵDirectiveDeclaration, never, never, { "nzLoading": "nzLoading"; "nzDisabled": "nzDisabled"; "nzControl": "nzControl"; }, {}, never, never, false>; }