ng-zorro-antd
Version:
An enterprise-class UI components based on Ant Design and Angular
170 lines (159 loc) • 8.76 kB
TypeScript
import * as i0 from '@angular/core';
import { OnChanges, SimpleChange, SimpleChanges, OnInit, AfterContentInit, TemplateRef } from '@angular/core';
import { Direction } from '@angular/cdk/bidi';
import { Observable } from 'rxjs';
import { ThemeType } from '@ant-design/icons-angular';
import { NzConfigKey } from 'ng-zorro-antd/core/config';
import { InputObservable, NzTSType } from 'ng-zorro-antd/core/types';
import { AbstractControl, NgModel, FormControlName, FormControlDirective } from '@angular/forms';
import { NzI18nService } from 'ng-zorro-antd/i18n';
import * as i7 from 'ng-zorro-antd/grid';
/**
* 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
*/
type NzFormLayoutType = 'horizontal' | 'vertical' | 'inline';
type NzLabelAlignType = 'left' | 'right';
declare const DefaultTooltipIcon: {
readonly type: "question-circle";
readonly theme: "outline";
};
declare class NzFormDirective implements OnChanges, InputObservable {
private destroyRef;
private directionality;
readonly _nzModuleName: NzConfigKey;
nzLayout: NzFormLayoutType;
nzNoColon: boolean;
nzAutoTips: Record<string, Record<string, string>>;
nzDisableAutoTips: boolean;
nzTooltipIcon: string | {
type: string;
theme: ThemeType;
};
nzLabelAlign: NzLabelAlignType;
nzLabelWrap: boolean;
dir: Direction;
private inputChanges$;
getInputObservable<K extends keyof this>(changeType: K): Observable<SimpleChange>;
constructor();
ngOnChanges(changes: SimpleChanges): void;
static ɵfac: i0.ɵɵFactoryDeclaration<NzFormDirective, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<NzFormDirective, "[nz-form]", ["nzForm"], { "nzLayout": { "alias": "nzLayout"; "required": false; }; "nzNoColon": { "alias": "nzNoColon"; "required": false; }; "nzAutoTips": { "alias": "nzAutoTips"; "required": false; }; "nzDisableAutoTips": { "alias": "nzDisableAutoTips"; "required": false; }; "nzTooltipIcon": { "alias": "nzTooltipIcon"; "required": false; }; "nzLabelAlign": { "alias": "nzLabelAlign"; "required": false; }; "nzLabelWrap": { "alias": "nzLabelWrap"; "required": false; }; }, {}, never, never, true, never>;
static ngAcceptInputType_nzNoColon: unknown;
static ngAcceptInputType_nzDisableAutoTips: unknown;
static ngAcceptInputType_nzLabelWrap: unknown;
}
type NzFormControlStatusType = 'success' | 'error' | 'warning' | 'validating' | '';
/** should add nz-row directive to host, track https://github.com/angular/angular/issues/8785 **/
declare class NzFormItemComponent {
private cdr;
status: NzFormControlStatusType;
hasFeedback: boolean;
withHelpClass: boolean;
setWithHelpViaTips(value: boolean): void;
setStatus(status: NzFormControlStatusType): void;
setHasFeedback(hasFeedback: boolean): void;
static ɵfac: i0.ɵɵFactoryDeclaration<NzFormItemComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<NzFormItemComponent, "nz-form-item", ["nzFormItem"], {}, {}, never, ["*"], true, never>;
}
interface NzFormTooltipIcon {
type: NzTSType;
theme: ThemeType;
}
declare class NzFormLabelComponent {
private cdr;
nzFor?: string;
nzRequired: boolean;
set nzNoColon(value: boolean);
get nzNoColon(): boolean;
private noColon;
nzTooltipTitle?: NzTSType;
set nzTooltipIcon(value: string | NzFormTooltipIcon);
get tooltipIcon(): NzFormTooltipIcon;
private _tooltipIcon;
set nzLabelAlign(value: NzLabelAlignType);
get nzLabelAlign(): NzLabelAlignType;
private labelAlign;
set nzLabelWrap(value: boolean);
get nzLabelWrap(): boolean;
private labelWrap;
private nzFormDirective;
constructor();
static ɵfac: i0.ɵɵFactoryDeclaration<NzFormLabelComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<NzFormLabelComponent, "nz-form-label", ["nzFormLabel"], { "nzFor": { "alias": "nzFor"; "required": false; }; "nzRequired": { "alias": "nzRequired"; "required": false; }; "nzNoColon": { "alias": "nzNoColon"; "required": false; }; "nzTooltipTitle": { "alias": "nzTooltipTitle"; "required": false; }; "nzTooltipIcon": { "alias": "nzTooltipIcon"; "required": false; }; "nzLabelAlign": { "alias": "nzLabelAlign"; "required": false; }; "nzLabelWrap": { "alias": "nzLabelWrap"; "required": false; }; }, {}, never, ["*"], true, never>;
static ngAcceptInputType_nzRequired: unknown;
static ngAcceptInputType_nzNoColon: unknown;
static ngAcceptInputType_nzLabelWrap: unknown;
}
/**
* 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
*/
declare class NzFormControlComponent implements OnChanges, OnInit, AfterContentInit {
private cdr;
i18n: NzI18nService;
private nzFormStatusService;
private destroyRef;
private _hasFeedback;
private validateChanges;
private validateString;
private localeId;
private autoErrorTip?;
private get disableAutoTips();
status: NzFormControlStatusType;
validateControl: AbstractControl | NgModel | null;
innerTip: string | TemplateRef<{
$implicit: AbstractControl | NgModel;
}> | null;
defaultValidateControl?: FormControlName | FormControlDirective;
nzSuccessTip?: string | TemplateRef<{
$implicit: AbstractControl | NgModel;
}>;
nzWarningTip?: string | TemplateRef<{
$implicit: AbstractControl | NgModel;
}>;
nzErrorTip?: string | TemplateRef<{
$implicit: AbstractControl | NgModel;
}>;
nzValidatingTip?: string | TemplateRef<{
$implicit: AbstractControl | NgModel;
}>;
nzExtra?: string | TemplateRef<void>;
nzAutoTips: Record<string, Record<string, string>>;
nzDisableAutoTips?: boolean;
set nzHasFeedback(value: boolean);
get nzHasFeedback(): boolean;
set nzValidateStatus(value: string | AbstractControl | FormControlName | NgModel);
private watchControl;
private setStatus;
private getControlStatus;
private validateControlStatus;
private getInnerTip;
private updateAutoErrorTip;
private subscribeAutoTips;
private nzFormItemComponent;
private nzFormDirective;
constructor();
ngOnChanges(changes: SimpleChanges): void;
ngOnInit(): void;
ngAfterContentInit(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<NzFormControlComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<NzFormControlComponent, "nz-form-control", ["nzFormControl"], { "nzSuccessTip": { "alias": "nzSuccessTip"; "required": false; }; "nzWarningTip": { "alias": "nzWarningTip"; "required": false; }; "nzErrorTip": { "alias": "nzErrorTip"; "required": false; }; "nzValidatingTip": { "alias": "nzValidatingTip"; "required": false; }; "nzExtra": { "alias": "nzExtra"; "required": false; }; "nzAutoTips": { "alias": "nzAutoTips"; "required": false; }; "nzDisableAutoTips": { "alias": "nzDisableAutoTips"; "required": false; }; "nzHasFeedback": { "alias": "nzHasFeedback"; "required": false; }; "nzValidateStatus": { "alias": "nzValidateStatus"; "required": false; }; }, {}, ["defaultValidateControl"], ["*"], true, never>;
static ngAcceptInputType_nzDisableAutoTips: unknown;
static ngAcceptInputType_nzHasFeedback: unknown;
}
declare class NzFormTextComponent {
static ɵfac: i0.ɵɵFactoryDeclaration<NzFormTextComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<NzFormTextComponent, "nz-form-text", ["nzFormText"], {}, {}, never, ["*"], true, never>;
}
declare class NzFormSplitComponent {
static ɵfac: i0.ɵɵFactoryDeclaration<NzFormSplitComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<NzFormSplitComponent, "nz-form-split", ["nzFormSplit"], {}, {}, never, ["*"], true, never>;
}
declare class NzFormModule {
static ɵfac: i0.ɵɵFactoryDeclaration<NzFormModule, never>;
static ɵmod: i0.ɵɵNgModuleDeclaration<NzFormModule, never, [typeof NzFormDirective, typeof NzFormItemComponent, typeof NzFormLabelComponent, typeof NzFormControlComponent, typeof NzFormTextComponent, typeof NzFormSplitComponent], [typeof i7.NzGridModule, typeof NzFormDirective, typeof NzFormItemComponent, typeof NzFormLabelComponent, typeof NzFormControlComponent, typeof NzFormTextComponent, typeof NzFormSplitComponent]>;
static ɵinj: i0.ɵɵInjectorDeclaration<NzFormModule>;
}
export { DefaultTooltipIcon, NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent, NzFormModule, NzFormSplitComponent, NzFormTextComponent };
export type { NzFormControlStatusType, NzFormLayoutType, NzFormTooltipIcon, NzLabelAlignType };