UNPKG

ng-zorro-antd

Version:

An enterprise-class UI components based on Ant Design and Angular

137 lines (136 loc) • 3.9 kB
import * as i0 from "@angular/core"; import { Component, Injectable, InjectionToken, ViewEncapsulation, computed, input } from "@angular/core"; import * as i1 from "ng-zorro-antd/icon"; import { NzIconModule } from "ng-zorro-antd/icon"; import { ReplaySubject } from "rxjs"; const iconTypeMap = { error: "close-circle-fill", validating: "loading", success: "check-circle-fill", warning: "exclamation-circle-fill" }; const CLASS_NAME = "ant-form-item-feedback-icon"; var NzFormItemFeedbackIconComponent = class NzFormItemFeedbackIconComponent { status = input("", ...ngDevMode ? [{ debugName: "status" }] : /* istanbul ignore next */ []); iconType = computed(() => { const status = this.status(); return status ? iconTypeMap[status] : null; }, ...ngDevMode ? [{ debugName: "iconType" }] : /* istanbul ignore next */ []); class = computed(() => { const status = this.status(); return { [CLASS_NAME]: true, [`${CLASS_NAME}-error`]: status === "error", [`${CLASS_NAME}-warning`]: status === "warning", [`${CLASS_NAME}-success`]: status === "success", [`${CLASS_NAME}-validating`]: status === "validating" }; }, ...ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []); static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NzFormItemFeedbackIconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.2", type: NzFormItemFeedbackIconComponent, isStandalone: true, selector: "nz-form-item-feedback-icon", inputs: { status: { classPropertyName: "status", publicName: "status", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "class()" } }, exportAs: ["nzFormFeedbackIcon"], ngImport: i0, template: ` @if (iconType(); as type) { <nz-icon [nzType]="type" /> } `, isInline: true, dependencies: [{ kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i1.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: [ "nzType", "nzTheme", "nzTwotoneColor", "nzSpin", "nzRotate", "nzIconfont", "aria-label" ], exportAs: ["nzIcon"] }], encapsulation: i0.ViewEncapsulation.None }); }; i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NzFormItemFeedbackIconComponent, decorators: [{ type: Component, args: [{ selector: "nz-form-item-feedback-icon", exportAs: "nzFormFeedbackIcon", imports: [NzIconModule], encapsulation: ViewEncapsulation.None, template: ` @if (iconType(); as type) { <nz-icon [nzType]="type" /> } `, host: { "[class]": "class()" } }] }], propDecorators: { status: [{ type: i0.Input, args: [{ isSignal: true, alias: "status", required: false }] }] } }); const NZ_FORM_SIZE = new InjectionToken(typeof ngDevMode !== "undefined" && ngDevMode ? "nz-form-size" : ""); var NzFormStatusService = class NzFormStatusService { formStatusChanges = new ReplaySubject(1); static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NzFormStatusService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NzFormStatusService }); }; i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NzFormStatusService, decorators: [{ type: Injectable }] }); const NZ_FORM_VARIANT = new InjectionToken(typeof ngDevMode !== "undefined" && ngDevMode ? "nz-form-variant" : ""); export { NZ_FORM_SIZE, NZ_FORM_VARIANT, NzFormItemFeedbackIconComponent, NzFormStatusService }; //# sourceMappingURL=ng-zorro-antd-core-form.mjs.map