/** * 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 { ChangeDetectorRef, OnDestroy, OnInit } from '@angular/core'; import { ControlValueAccessor, FormArray, FormBuilder, FormGroup } from '@angular/forms'; import { MagInitConfig } from 'ng-stalk/core/model'; import { MagCodeCacheService, MagConfigService } from 'ng-stalk/core/service'; import { CodeAndName } from 'ng-stalk/core/types'; import { NzConfigService } from 'ng-zorro-antd/core/config'; import { FieldItem } from './field-item'; import { LangFieldFormModel } from './lang-field-form-model'; import * as i0 from "@angular/core"; export declare type FieldModelType = string | string[]; export declare class MagLangFieldComponent implements ControlValueAccessor, OnInit, OnDestroy { nzConfigService: NzConfigService; private cdr; private formBuilder; private magCodeCacheService; private magConfigService; /** * output 모델과 동일 */ value: FieldModelType; onChange: (value: FieldModelType) => void; onTouched: () => void; nzLoading: boolean; nzDisabled: boolean; nzControl: boolean; /** * 동작 방식 및 응담 형태 * single : 1개의 미디어만 선택됨. output model 은 media id * multiple : 다수개의 미디어가 선택됨. output model 은 media id 배열 */ mode: 'single' | 'multiple'; /** * 등록 가능한 최대 미디어 수 * - mode 가 single 일 경우에는 1개로 고정된다. * - mode 가 multiple 인 경우, 정수값만큼 등록가능하다. 0이하인 경우 무제한 */ maxItems: number; /** * 선택 가능한 언어 목록 * 값이 없을 경우, MagFrame 에서 지원하는 supportLanguages 가 사용된다. * deprecated. use langs */ supportLanguages: string[]; langs: string[]; languages: CodeAndName[]; hostClick(e: MouseEvent): void; /** * 외부로 값을 출력하고, 내부 값을 갱신한다. * * 메소드 구현 주의사항: 내부 값 변경시에만 output 이벤트를 발행하고 ChangeDetector 를 트리거해야한다. * @param value */ private updateValue; focus(): void; blur(): void; constructor(nzConfigService: NzConfigService, cdr: ChangeDetectorRef, formBuilder: FormBuilder, magCodeCacheService: MagCodeCacheService, magConfigService: MagConfigService); ngOnInit(): void; ngOnDestroy(): void; /** * 외부로부터 값을 주입받는다. * 이벤트를 발행하지 않고, 내부 값을 업데이트해야한다. * @param value */ writeValue(value: FieldModelType): 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: (_: FieldModelType) => void): void; registerOnTouched(fn: () => void): void; setDisabledState(isDisabled: boolean): void; modelForm: FormGroup; private _unsubscribeAll; componentId: string; draw(): void; createForm(formModel: LangFieldFormModel): FormGroup; makeI18nFormControl(item: FieldItem): FormGroup; fitControls(formModel: LangFieldFormModel): void; initForm(formModel: LangFieldFormModel): void; get formControls(): FormArray; removeEntryAt(index: number): void; addEntry(item: FieldItem): void; get isMultiple(): boolean; private extractValueFromFormModel; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; }