import * as i0 from '@angular/core';
import { Injectable, Component, ViewEncapsulation, ChangeDetectionStrategy, Input, NgModule } from '@angular/core';
import { ReplaySubject, BehaviorSubject } from 'rxjs';
import * as i1 from '@angular/common';
import { CommonModule } from '@angular/common';
import * as i2 from 'ng-zorro-antd/icon';
import { NzIconModule } from 'ng-zorro-antd/icon';

/**
 * 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
 */
class NzFormStatusService {
    constructor() {
        this.formStatusChanges = new ReplaySubject(1);
    }
}
NzFormStatusService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NzFormStatusService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
NzFormStatusService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NzFormStatusService });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NzFormStatusService, decorators: [{
            type: Injectable
        }] });

/**
 * 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
 */
// Used in input-group/input-number-group to make sure components in addon work well
class NzFormNoStatusService {
    constructor() {
        this.noFormStatus = new BehaviorSubject(false);
    }
}
NzFormNoStatusService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NzFormNoStatusService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
NzFormNoStatusService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NzFormNoStatusService });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NzFormNoStatusService, decorators: [{
            type: Injectable
        }] });

/**
 * 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
 */
const iconTypeMap = {
    error: 'close-circle-fill',
    validating: 'loading',
    success: 'check-circle-fill',
    warning: 'exclamation-circle-fill'
};
class NzFormItemFeedbackIconComponent {
    constructor(cdr) {
        this.cdr = cdr;
        this.status = '';
        this.iconType = null;
    }
    ngOnChanges(_changes) {
        this.updateIcon();
    }
    updateIcon() {
        this.iconType = this.status ? iconTypeMap[this.status] : null;
        this.cdr.markForCheck();
    }
}
NzFormItemFeedbackIconComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NzFormItemFeedbackIconComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
NzFormItemFeedbackIconComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.3", type: NzFormItemFeedbackIconComponent, selector: "nz-form-item-feedback-icon", inputs: { status: "status" }, host: { properties: { "class.ant-form-item-feedback-icon-error": "status===\"error\"", "class.ant-form-item-feedback-icon-warning": "status===\"warning\"", "class.ant-form-item-feedback-icon-success": "status===\"success\"", "class.ant-form-item-feedback-icon-validating": "status===\"validating\"" }, classAttribute: "ant-form-item-feedback-icon" }, exportAs: ["nzFormFeedbackIcon"], usesOnChanges: true, ngImport: i0, template: ` <span *ngIf="iconType" nz-icon [nzType]="iconType"></span> `, isInline: true, dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NzFormItemFeedbackIconComponent, decorators: [{
            type: Component,
            args: [{
                    selector: 'nz-form-item-feedback-icon',
                    exportAs: 'nzFormFeedbackIcon',
                    preserveWhitespaces: false,
                    encapsulation: ViewEncapsulation.None,
                    changeDetection: ChangeDetectionStrategy.OnPush,
                    template: ` <span *ngIf="iconType" nz-icon [nzType]="iconType"></span> `,
                    host: {
                        class: 'ant-form-item-feedback-icon',
                        '[class.ant-form-item-feedback-icon-error]': 'status==="error"',
                        '[class.ant-form-item-feedback-icon-warning]': 'status==="warning"',
                        '[class.ant-form-item-feedback-icon-success]': 'status==="success"',
                        '[class.ant-form-item-feedback-icon-validating]': 'status==="validating"'
                    }
                }]
        }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { status: [{
                type: Input
            }] } });

/**
 * 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
 */
class NzFormPatchModule {
}
NzFormPatchModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NzFormPatchModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
NzFormPatchModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.3", ngImport: i0, type: NzFormPatchModule, declarations: [NzFormItemFeedbackIconComponent], imports: [CommonModule, NzIconModule], exports: [NzFormItemFeedbackIconComponent] });
NzFormPatchModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NzFormPatchModule, imports: [CommonModule, NzIconModule] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NzFormPatchModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [CommonModule, NzIconModule],
                    exports: [NzFormItemFeedbackIconComponent],
                    declarations: [NzFormItemFeedbackIconComponent]
                }]
        }] });

/**
 * 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
 */

/**
 * Generated bundle index. Do not edit.
 */

export { NzFormItemFeedbackIconComponent, NzFormNoStatusService, NzFormPatchModule, NzFormStatusService };
//# sourceMappingURL=ng-zorro-antd-core-form.mjs.map
