import * as i0 from '@angular/core';
import { TemplateRef, Component, Input, HostBinding, ContentChild, EventEmitter, Directive, Output, Self, Optional, Host, SkipSelf, ContentChildren, ChangeDetectionStrategy, Injectable, NgModule } from '@angular/core';
import * as i1 from '@angular/common';
import { CommonModule } from '@angular/common';
import * as i2 from 'ng-devui/popover';
import { PopoverComponent, PopoverModule } from 'ng-devui/popover';
import * as i1$1 from '@angular/forms';
import { Validators, ReactiveFormsModule, FormsModule } from '@angular/forms';
import { timer, Subject, merge, fromEvent } from 'rxjs';
import { switchMap, map, takeUntil, startWith, filter, take } from 'rxjs/operators';
import * as i2$1 from 'ng-devui/i18n';
import * as i4 from 'ng-devui/overlay-container';

class FormControlComponent {
    constructor(elementRef, renderer, cdr) {
        this.elementRef = elementRef;
        this.cdr = cdr;
        renderer.addClass(elementRef.nativeElement, 'devui-form-controls');
    }
    get extraInfoTemplate() {
        return this.extraInfo instanceof TemplateRef ? this.extraInfo : null;
    }
    get status() {
        return !!this.feedbackStatus;
    }
    get suffix() {
        return !!this.suffixTemplate;
    }
    /**
     * @desc Compatible with z-index of components that include dropdown menu, will be remove.
     *
     */
    get dropdownOpen() {
        return !!this.elementRef.nativeElement.querySelector('.devui-dropdown-origin-open');
    }
    ngOnInit() { }
    updateErrorMessage(message) {
        this.errorMessage = message;
        this.cdr.detectChanges();
    }
    updateFeedbackStatus(status) {
        this.feedbackStatus = status;
        this.cdr.detectChanges();
    }
}
FormControlComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: FormControlComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
FormControlComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: FormControlComponent, selector: "d-form-control", inputs: { extraInfo: "extraInfo", feedbackStatus: "feedbackStatus", suffixTemplate: "suffixTemplate" }, host: { properties: { "class.devui-form-control-has-feedback": "this.status", "class.devui-form-control-has-suffix": "this.suffix", "class.devui-control-has-open-dropdown": "this.dropdownOpen" } }, ngImport: i0, template: "<div class=\"devui-form-control-container\">\n  <ng-content></ng-content>\n  <span *ngIf=\"suffixTemplate\" class=\"devui-form-item-suffix suffix\">\n    <ng-template [ngTemplateOutlet]=\"suffixTemplate\"></ng-template>\n  </span>\n\n  <span [attr.class]=\"'devui-form-item-icon devui-form-item-icon-' + feedbackStatus\" *ngIf=\"feedbackStatus\">\n    <svg *ngIf=\"feedbackStatus === 'error'\" width=\"14px\" height=\"14px\" viewBox=\"0 0 16 16\">\n      <g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n        <circle cx=\"8\" cy=\"8\" r=\"8\"></circle>\n        <polygon\n          points=\"8.07106781 6.65685425 10.8994949 3.82842712 12.3137085 5.24264069 9.48528137 8.07106781 12.3137085 10.8994949 10.8994949 12.3137085 8.07106781 9.48528137 5.24264069 12.3137085 3.82842712 10.8994949 6.65685425 8.07106781 3.82842712 5.24264069 5.24264069 3.82842712\"\n        ></polygon>\n      </g>\n    </svg>\n    <svg *ngIf=\"feedbackStatus === 'success'\" width=\"14px\" height=\"14px\" viewBox=\"0 0 16 16\">\n      <g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n        <circle cx=\"8\" cy=\"8\" r=\"8\"></circle>\n        <polygon\n          points=\"6.53553391 9.77817459 12.1923882 4.12132034 13.6066017 5.53553391 6.53553391 12.6066017 3 9.07106781 4.41421356 7.65685425 6.53553391 9.77817459\"\n        ></polygon>\n      </g>\n    </svg>\n    <svg *ngIf=\"feedbackStatus === 'pending'\" width=\"14px\" height=\"14px\" viewBox=\"0 0 16 16\">\n      <g id=\"loading\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n        <path\n          d=\"M8,0 C12.4,0 16,3.6 16,8 C16,12.4 12.4,16 8,16 C3.6,16 0,12.4 0,8 C0,3.6 3.6,0 8,0 Z M8,1 C4.15,1 1,4.15 1,8 C1,11.85 4.15,15 8,15 C11.85,15 15,11.85 15,8 C15,4.15 11.85,1 8,1 Z\"\n          fill-rule=\"nonzero\"\n        ></path>\n        <path d=\"M8,0 C12.4,0 16,3.6 16,8 L15,8 C15,4.15 11.85,1 8,1 L8,0 Z\" fill-rule=\"nonzero\"></path>\n      </g>\n    </svg>\n  </span>\n</div>\n<div class=\"devui-form-control-inner-content\">\n  <div class=\"devui-form-message\" *ngIf=\"errorMessage\">\n    <span class=\"devui-form-message-text\">\n      <span>\n        {{ errorMessage }}\n      </span>\n    </span>\n  </div>\n  <div *ngIf=\"extraInfo\" class=\"devui-form-control-extra-info\">\n    <ng-template [ngTemplateOutlet]=\"extraInfoTemplate || defaultTemplate\"> </ng-template>\n    <ng-template #defaultTemplate>\n      {{ extraInfo }}\n    </ng-template>\n  </div>\n</div>\n", styles: [".mr-content-spacing{margin-right:4px}.padding-element-spacing{padding:16px!important}.ml-element-spacing{margin-left:16px}.mr-element-spacing{margin-right:16px}.mt-element-spacing{margin-top:16px}.mb-element-spacing{margin-bottom:16px}.mlr-element-spacing{margin-left:16px;margin-right:16px}.mtb-element-spacing{margin-top:16px;margin-bottom:16px}.m-element-spacing{margin:16px}.grid{letter-spacing:-.31em;*letter-spacing: normal;word-spacing:-.43em}.u,.u-1,.u-1-2,.u-1-3,.u-2-3,.u-1-4,.u-3-4,.u-1-5,.u-2-5,.u-3-5,.u-4-5,.u-1-6,.u-5-6,.u-1-8,.u-3-8,.u-5-8,.u-7-8,.u-1-12,.u-5-12,.u-7-12,.u-11-12,.u-1-24,.u-5-24,.u-7-24,.u-11-24,.u-13-24,.u-17-24,.u-19-24,.u-23-24{display:inline-block;*display: inline;zoom:1;letter-spacing:normal;word-spacing:normal;vertical-align:top}.u-1{display:block}.u-1-2{width:49.99999%}.u-1-3{width:33.33333%}.u-2-3{width:66.66666%}.u-1-4{width:24.99999%}.u-3-4{width:74.99999%}.u-1-5{width:19.99999%}.u-2-5{width:39.99999%}.u-3-5{width:59.99999%}.u-4-5{width:79.99999%}.u-1-6{width:16.64999%}.u-5-6{width:83.33333%}.u-1-8{width:12.49999%}.u-3-8{width:37.49999%}.u-5-8{width:62.49999%}.u-7-8{width:87.49999%}.u-1-12{width:8.33333%}.u-5-12{width:41.66666%}.u-7-12{width:58.33333%}.u-11-12{width:91.66666%}.u-1-24{width:4.16666%}.u-5-24{width:20.83333%}.u-7-24{width:29.16666%}.u-11-24{width:45.83333%}.u-13-24{width:54.16666%}.u-17-24{width:70.83333%}.u-19-24{width:79.16666%}.u-23-24{width:95.83333%}.u-content{padding:0 0 10px 10px}.devui-font-size-base{font-size:12px;font-size:var(--devui-font-size, 12px)}.devui-font-base{font-size:12px;font-size:var(--devui-font-size, 12px);font-weight:400;line-height:1.5}.devui-font-size-modal-title{font-size:18px;font-size:var(--devui-font-size-modal-title, 18px)}.devui-font-modal-title{font-size:18px;font-size:var(--devui-font-size-modal-title, 18px);font-weight:700;line-height:1.5}.devui-font-size-page-title{font-size:16px;font-size:var(--devui-font-size-page-title, 16px)}.devui-font-page-title{font-size:16px;font-size:var(--devui-font-size-page-title, 16px);font-weight:700;line-height:1.5}.devui-font-size-secondary-title{font-size:14px;font-size:var(--devui-font-size-card-title, 14px)}.devui-font-secondary-title{font-size:14px;font-size:var(--devui-font-size-card-title, 14px);font-weight:700;line-height:1.5}.devui-form-horizontal :host.devui-form-controls{flex:1 1 auto;margin-left:16px}.devui-form-vertical :host.devui-form-controls{flex:1 1 auto}.devui-form-columns :host.devui-form-controls{flex:1 1 auto;margin-right:24px}.devui-form-control-extra-info{font-size:12px;font-size:var(--devui-font-size, 12px);color:#71757f;color:var(--devui-aide-text, #71757f);min-height:20px;line-height:1.5;text-align:justify}.devui-form-control-inner-content{line-height:1}.devui-form-message{display:inline-block;font-size:12px;font-size:var(--devui-font-size, 12px);min-height:20px;position:relative;left:1px;color:#f66f6a;color:var(--devui-danger, #f66f6a)}.devui-form-message .devui-form-message-text{display:inline-flex;align-items:center;line-height:1.5;border-top:1px solid transparent;border-bottom:1px solid transparent}.devui-form-message .devui-form-message-text .devui-form-message-svg{line-height:1}.devui-form-message .devui-icon.devui-icon-error{margin-right:4px}.devui-form-message .devui-icon.devui-icon-error>g>path{fill:#f66f6a;fill:var(--devui-danger, #f66f6a)}.devui-form-message .devui-icon.devui-icon-error>g>circle{fill:#fff;fill:var(--devui-light-text, #ffffff)}.devui-form-item-icon{position:absolute;top:50%;right:0;z-index:1;width:32px;height:16px;text-align:center;visibility:visible;pointer-events:none;transform:translateY(-50%);display:flex;align-items:center;justify-content:center}.devui-form-item-icon.devui-form-item-icon-error svg circle{fill:#f66f6a;fill:var(--devui-danger, #f66f6a)}.devui-form-item-icon.devui-form-item-icon-error svg polygon{fill:#fff;fill:var(--devui-base-bg, #ffffff)}.devui-form-item-icon.devui-form-item-icon-success svg circle{fill:#50d4ab;fill:var(--devui-success, #50d4ab)}.devui-form-item-icon.devui-form-item-icon-success svg polygon{fill:#fff;fill:var(--devui-base-bg, #ffffff)}.devui-form-item-icon.devui-form-item-icon-pending svg{-webkit-animation:devui-loading-keyframes 1s infinite linear;animation:devui-loading-keyframes 1s infinite linear}.devui-form-item-icon.devui-form-item-icon-pending svg path{fill:#5e7ce0;fill:var(--devui-brand, #5e7ce0)}:host.devui-form-control-has-feedback .devui-form-control-container,:host.devui-form-control-has-suffix .devui-form-control-container{position:relative}:host.devui-form-control-has-suffix .devui-form-item-suffix{position:absolute;top:50%;right:0;z-index:1;width:32px;height:16px;text-align:center;visibility:visible;pointer-events:auto;transform:translateY(-50%);display:flex;align-items:center;justify-content:center}:host.devui-form-control-has-suffix .suffix{cursor:pointer}:host.devui-form-control-has-feedback.devui-form-control-has-suffix .devui-form-item-icon{right:32px}@-webkit-keyframes devui-loading-keyframes{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes devui-loading-keyframes{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: FormControlComponent, decorators: [{
            type: Component,
            args: [{ selector: 'd-form-control', preserveWhitespaces: false, template: "<div class=\"devui-form-control-container\">\n  <ng-content></ng-content>\n  <span *ngIf=\"suffixTemplate\" class=\"devui-form-item-suffix suffix\">\n    <ng-template [ngTemplateOutlet]=\"suffixTemplate\"></ng-template>\n  </span>\n\n  <span [attr.class]=\"'devui-form-item-icon devui-form-item-icon-' + feedbackStatus\" *ngIf=\"feedbackStatus\">\n    <svg *ngIf=\"feedbackStatus === 'error'\" width=\"14px\" height=\"14px\" viewBox=\"0 0 16 16\">\n      <g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n        <circle cx=\"8\" cy=\"8\" r=\"8\"></circle>\n        <polygon\n          points=\"8.07106781 6.65685425 10.8994949 3.82842712 12.3137085 5.24264069 9.48528137 8.07106781 12.3137085 10.8994949 10.8994949 12.3137085 8.07106781 9.48528137 5.24264069 12.3137085 3.82842712 10.8994949 6.65685425 8.07106781 3.82842712 5.24264069 5.24264069 3.82842712\"\n        ></polygon>\n      </g>\n    </svg>\n    <svg *ngIf=\"feedbackStatus === 'success'\" width=\"14px\" height=\"14px\" viewBox=\"0 0 16 16\">\n      <g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n        <circle cx=\"8\" cy=\"8\" r=\"8\"></circle>\n        <polygon\n          points=\"6.53553391 9.77817459 12.1923882 4.12132034 13.6066017 5.53553391 6.53553391 12.6066017 3 9.07106781 4.41421356 7.65685425 6.53553391 9.77817459\"\n        ></polygon>\n      </g>\n    </svg>\n    <svg *ngIf=\"feedbackStatus === 'pending'\" width=\"14px\" height=\"14px\" viewBox=\"0 0 16 16\">\n      <g id=\"loading\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n        <path\n          d=\"M8,0 C12.4,0 16,3.6 16,8 C16,12.4 12.4,16 8,16 C3.6,16 0,12.4 0,8 C0,3.6 3.6,0 8,0 Z M8,1 C4.15,1 1,4.15 1,8 C1,11.85 4.15,15 8,15 C11.85,15 15,11.85 15,8 C15,4.15 11.85,1 8,1 Z\"\n          fill-rule=\"nonzero\"\n        ></path>\n        <path d=\"M8,0 C12.4,0 16,3.6 16,8 L15,8 C15,4.15 11.85,1 8,1 L8,0 Z\" fill-rule=\"nonzero\"></path>\n      </g>\n    </svg>\n  </span>\n</div>\n<div class=\"devui-form-control-inner-content\">\n  <div class=\"devui-form-message\" *ngIf=\"errorMessage\">\n    <span class=\"devui-form-message-text\">\n      <span>\n        {{ errorMessage }}\n      </span>\n    </span>\n  </div>\n  <div *ngIf=\"extraInfo\" class=\"devui-form-control-extra-info\">\n    <ng-template [ngTemplateOutlet]=\"extraInfoTemplate || defaultTemplate\"> </ng-template>\n    <ng-template #defaultTemplate>\n      {{ extraInfo }}\n    </ng-template>\n  </div>\n</div>\n", styles: [".mr-content-spacing{margin-right:4px}.padding-element-spacing{padding:16px!important}.ml-element-spacing{margin-left:16px}.mr-element-spacing{margin-right:16px}.mt-element-spacing{margin-top:16px}.mb-element-spacing{margin-bottom:16px}.mlr-element-spacing{margin-left:16px;margin-right:16px}.mtb-element-spacing{margin-top:16px;margin-bottom:16px}.m-element-spacing{margin:16px}.grid{letter-spacing:-.31em;*letter-spacing: normal;word-spacing:-.43em}.u,.u-1,.u-1-2,.u-1-3,.u-2-3,.u-1-4,.u-3-4,.u-1-5,.u-2-5,.u-3-5,.u-4-5,.u-1-6,.u-5-6,.u-1-8,.u-3-8,.u-5-8,.u-7-8,.u-1-12,.u-5-12,.u-7-12,.u-11-12,.u-1-24,.u-5-24,.u-7-24,.u-11-24,.u-13-24,.u-17-24,.u-19-24,.u-23-24{display:inline-block;*display: inline;zoom:1;letter-spacing:normal;word-spacing:normal;vertical-align:top}.u-1{display:block}.u-1-2{width:49.99999%}.u-1-3{width:33.33333%}.u-2-3{width:66.66666%}.u-1-4{width:24.99999%}.u-3-4{width:74.99999%}.u-1-5{width:19.99999%}.u-2-5{width:39.99999%}.u-3-5{width:59.99999%}.u-4-5{width:79.99999%}.u-1-6{width:16.64999%}.u-5-6{width:83.33333%}.u-1-8{width:12.49999%}.u-3-8{width:37.49999%}.u-5-8{width:62.49999%}.u-7-8{width:87.49999%}.u-1-12{width:8.33333%}.u-5-12{width:41.66666%}.u-7-12{width:58.33333%}.u-11-12{width:91.66666%}.u-1-24{width:4.16666%}.u-5-24{width:20.83333%}.u-7-24{width:29.16666%}.u-11-24{width:45.83333%}.u-13-24{width:54.16666%}.u-17-24{width:70.83333%}.u-19-24{width:79.16666%}.u-23-24{width:95.83333%}.u-content{padding:0 0 10px 10px}.devui-font-size-base{font-size:12px;font-size:var(--devui-font-size, 12px)}.devui-font-base{font-size:12px;font-size:var(--devui-font-size, 12px);font-weight:400;line-height:1.5}.devui-font-size-modal-title{font-size:18px;font-size:var(--devui-font-size-modal-title, 18px)}.devui-font-modal-title{font-size:18px;font-size:var(--devui-font-size-modal-title, 18px);font-weight:700;line-height:1.5}.devui-font-size-page-title{font-size:16px;font-size:var(--devui-font-size-page-title, 16px)}.devui-font-page-title{font-size:16px;font-size:var(--devui-font-size-page-title, 16px);font-weight:700;line-height:1.5}.devui-font-size-secondary-title{font-size:14px;font-size:var(--devui-font-size-card-title, 14px)}.devui-font-secondary-title{font-size:14px;font-size:var(--devui-font-size-card-title, 14px);font-weight:700;line-height:1.5}.devui-form-horizontal :host.devui-form-controls{flex:1 1 auto;margin-left:16px}.devui-form-vertical :host.devui-form-controls{flex:1 1 auto}.devui-form-columns :host.devui-form-controls{flex:1 1 auto;margin-right:24px}.devui-form-control-extra-info{font-size:12px;font-size:var(--devui-font-size, 12px);color:#71757f;color:var(--devui-aide-text, #71757f);min-height:20px;line-height:1.5;text-align:justify}.devui-form-control-inner-content{line-height:1}.devui-form-message{display:inline-block;font-size:12px;font-size:var(--devui-font-size, 12px);min-height:20px;position:relative;left:1px;color:#f66f6a;color:var(--devui-danger, #f66f6a)}.devui-form-message .devui-form-message-text{display:inline-flex;align-items:center;line-height:1.5;border-top:1px solid transparent;border-bottom:1px solid transparent}.devui-form-message .devui-form-message-text .devui-form-message-svg{line-height:1}.devui-form-message .devui-icon.devui-icon-error{margin-right:4px}.devui-form-message .devui-icon.devui-icon-error>g>path{fill:#f66f6a;fill:var(--devui-danger, #f66f6a)}.devui-form-message .devui-icon.devui-icon-error>g>circle{fill:#fff;fill:var(--devui-light-text, #ffffff)}.devui-form-item-icon{position:absolute;top:50%;right:0;z-index:1;width:32px;height:16px;text-align:center;visibility:visible;pointer-events:none;transform:translateY(-50%);display:flex;align-items:center;justify-content:center}.devui-form-item-icon.devui-form-item-icon-error svg circle{fill:#f66f6a;fill:var(--devui-danger, #f66f6a)}.devui-form-item-icon.devui-form-item-icon-error svg polygon{fill:#fff;fill:var(--devui-base-bg, #ffffff)}.devui-form-item-icon.devui-form-item-icon-success svg circle{fill:#50d4ab;fill:var(--devui-success, #50d4ab)}.devui-form-item-icon.devui-form-item-icon-success svg polygon{fill:#fff;fill:var(--devui-base-bg, #ffffff)}.devui-form-item-icon.devui-form-item-icon-pending svg{-webkit-animation:devui-loading-keyframes 1s infinite linear;animation:devui-loading-keyframes 1s infinite linear}.devui-form-item-icon.devui-form-item-icon-pending svg path{fill:#5e7ce0;fill:var(--devui-brand, #5e7ce0)}:host.devui-form-control-has-feedback .devui-form-control-container,:host.devui-form-control-has-suffix .devui-form-control-container{position:relative}:host.devui-form-control-has-suffix .devui-form-item-suffix{position:absolute;top:50%;right:0;z-index:1;width:32px;height:16px;text-align:center;visibility:visible;pointer-events:auto;transform:translateY(-50%);display:flex;align-items:center;justify-content:center}:host.devui-form-control-has-suffix .suffix{cursor:pointer}:host.devui-form-control-has-feedback.devui-form-control-has-suffix .devui-form-item-icon{right:32px}@-webkit-keyframes devui-loading-keyframes{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes devui-loading-keyframes{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"] }]
        }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { extraInfo: [{
                type: Input
            }], feedbackStatus: [{
                type: Input
            }], suffixTemplate: [{
                type: Input
            }], status: [{
                type: HostBinding,
                args: ['class.devui-form-control-has-feedback']
            }], suffix: [{
                type: HostBinding,
                args: ['class.devui-form-control-has-suffix']
            }], dropdownOpen: [{
                type: HostBinding,
                args: ['class.devui-control-has-open-dropdown']
            }] } });

class FormLabelComponent {
    constructor(cdr, elementRef, renderer) {
        this.cdr = cdr;
        this.required = false;
        this.hasHelp = false;
        this.helpTips = '';
        this.feedbackStatus = null;
        renderer.addClass(elementRef.nativeElement, 'devui-form-label');
    }
    get status() {
        return this.feedbackStatus !== null;
    }
    updateFeedbackStatus(status) {
        this.feedbackStatus = status;
        this.cdr.detectChanges();
    }
}
FormLabelComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: FormLabelComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
FormLabelComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: FormLabelComponent, selector: "d-form-label", inputs: { required: "required", hasHelp: "hasHelp", helpTips: "helpTips" }, host: { properties: { "class.devui-form-label-has-feedback": "this.status" } }, ngImport: i0, template: "<span class=\"devui-form-span\" [ngClass]=\"{ 'devui-required': required }\">\n  <ng-content></ng-content>\n</span>\n<svg\n  *ngIf=\"hasHelp\"\n  dPopover\n  [content]=\"helpTipsTemplate\"\n  [popType]=\"'info'\"\n  [position]=\"'top'\"\n  [controlled]=\"true\"\n  trigger=\"hover\"\n  class=\"devui-helping\"\n  width=\"16px\"\n  height=\"16px\"\n  viewBox=\"0 0 16 16\"\n>\n  <g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n    <path\n      d=\"M8,1 C9.88227821,1 11.6450792,1.74560326 12.9497351,3.05025198 C14.2543924,4.35492369 15,6.11772556 15,8 C15,9.88227587 14.2543913,11.6450767 12.949734,12.949734 C11.6450767,14.2543913 9.88227587,15 8,15 C6.11772556,15 4.35492369,14.2543924 3.05024866,12.9497318 C1.74560326,11.6450792 1,9.88227821 1,8 C1,6.11772322 1.74560213,4.35492125 3.0502542,3.05024755 C4.35492125,1.74560213 6.11772322,1 8,1 Z M8,11.2634757 C7.47757297,11.2634757 7.05405405,11.6869946 7.05405405,12.2094216 C7.05405405,12.7318486 7.47757297,13.1553676 8,13.1553676 C8.52242703,13.1553676 8.94594595,12.7318486 8.94594595,12.2094216 C8.94594595,11.6869946 8.52242703,11.2634757 8,11.2634757 Z M8,3.12834054 C6.43270866,3.12834054 5.16216216,4.39888703 5.16216216,5.96617838 C5.16216216,6.27963729 5.41627082,6.53374595 5.72972973,6.53374595 C6.04318864,6.53374595 6.2972973,6.27963729 6.2972973,5.96617838 C6.2972973,5.02580486 7.05962648,4.26347568 8,4.26347568 C8.94037352,4.26347568 9.7027027,5.02580486 9.7027027,5.96617838 C9.7027027,6.9065519 8.94037352,7.66888108 8,7.66888108 C7.68654109,7.66888108 7.43243243,7.92298974 7.43243243,8.23644865 L7.43243243,8.23644865 L7.43243243,9.74996216 L7.44157671,9.85198315 C7.48963374,10.1167525 7.72136986,10.3175297 8,10.3175297 L8,10.3175297 L8.10202099,10.3083855 C8.36679036,10.2603284 8.56756757,10.0285923 8.56756757,9.74996216 L8.56756757,9.74996216 L8.56756757,8.74578378 L8.72552115,8.71042694 C9.94134023,8.38984467 10.8378378,7.28270311 10.8378378,5.96617838 C10.8378378,4.39888703 9.56729134,3.12834054 8,3.12834054 Z\"\n      fill-rule=\"nonzero\"\n    ></path>\n  </g>\n</svg>\n<svg *ngIf=\"feedbackStatus === 'error'\" class=\"devui-icon devui-icon-error\" width=\"16px\" height=\"16px\" viewBox=\"0 0 16 16\">\n  <g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n    <circle cx=\"8\" cy=\"8\" r=\"7\"></circle>\n    <path\n      d=\"M8,0 C3.6,0 0,3.6 0,8 C0,12.4 3.6,16 8,16 C12.4,16 16,12.4 16,8 C16,3.6 12.4,0 8,0 Z M9,12.6 L7,12.6 L7,10.6 L9,10.6 L9,12.6 Z M9,9.1 L7,9.1 L6.9,3.1 L9.1,3.1 L9,9.1 Z\"\n      fill-rule=\"nonzero\"\n    ></path>\n  </g>\n</svg>\n<ng-template #helpTipsTemplate>\n  <span class=\"devui-help-tips\">{{ helpTips }}</span>\n</ng-template>\n", styles: [".mr-content-spacing{margin-right:4px}.padding-element-spacing{padding:16px!important}.ml-element-spacing{margin-left:16px}.mr-element-spacing{margin-right:16px}.mt-element-spacing{margin-top:16px}.mb-element-spacing{margin-bottom:16px}.mlr-element-spacing{margin-left:16px;margin-right:16px}.mtb-element-spacing{margin-top:16px;margin-bottom:16px}.m-element-spacing{margin:16px}.grid{letter-spacing:-.31em;*letter-spacing: normal;word-spacing:-.43em}.u,.u-1,.u-1-2,.u-1-3,.u-2-3,.u-1-4,.u-3-4,.u-1-5,.u-2-5,.u-3-5,.u-4-5,.u-1-6,.u-5-6,.u-1-8,.u-3-8,.u-5-8,.u-7-8,.u-1-12,.u-5-12,.u-7-12,.u-11-12,.u-1-24,.u-5-24,.u-7-24,.u-11-24,.u-13-24,.u-17-24,.u-19-24,.u-23-24{display:inline-block;*display: inline;zoom:1;letter-spacing:normal;word-spacing:normal;vertical-align:top}.u-1{display:block}.u-1-2{width:49.99999%}.u-1-3{width:33.33333%}.u-2-3{width:66.66666%}.u-1-4{width:24.99999%}.u-3-4{width:74.99999%}.u-1-5{width:19.99999%}.u-2-5{width:39.99999%}.u-3-5{width:59.99999%}.u-4-5{width:79.99999%}.u-1-6{width:16.64999%}.u-5-6{width:83.33333%}.u-1-8{width:12.49999%}.u-3-8{width:37.49999%}.u-5-8{width:62.49999%}.u-7-8{width:87.49999%}.u-1-12{width:8.33333%}.u-5-12{width:41.66666%}.u-7-12{width:58.33333%}.u-11-12{width:91.66666%}.u-1-24{width:4.16666%}.u-5-24{width:20.83333%}.u-7-24{width:29.16666%}.u-11-24{width:45.83333%}.u-13-24{width:54.16666%}.u-17-24{width:70.83333%}.u-19-24{width:79.16666%}.u-23-24{width:95.83333%}.u-content{padding:0 0 10px 10px}.devui-form-span{position:relative;display:inline-block;vertical-align:middle;color:#252b3a;color:var(--devui-text, #252b3a)}.devui-form-span.devui-required:before{content:\"*\";color:red;display:inline-block;margin-right:4px;margin-left:-8px;vertical-align:middle}:host-context(.devui-form-item:hover) .svg-close{display:inline-block;cursor:pointer}.devui-helping{display:inline-block;vertical-align:middle;margin-left:4px;cursor:pointer}.devui-helping path{fill:#d7d8da;fill:var(--devui-shape-icon-fill, #d7d8da)}.devui-help-tips{display:inline-block;margin-left:20px;max-width:200px}.devui-form-horizontal :host.devui-form-label{flex:0 0 100px;justify-content:flex-end;text-align:left;align-self:flex-start}.devui-form-horizontal :host.devui-form-label .devui-form-span{line-height:28px}.devui-form-lg.devui-form-horizontal :host.devui-form-label{flex:0 0 150px}.devui-form-sm.devui-form-horizontal :host.devui-form-label{flex:0 0 80px}.devui-form-horizontal.devui-form-label-align-center :host.devui-form-label{text-align:center}.devui-form-horizontal.devui-form-label-align-end :host.devui-form-label{text-align:right}.devui-form-vertical :host.devui-form-label{flex:1 1 auto;-moz-box-flex:1;text-align:left;padding-bottom:8px;justify-content:flex-start;align-self:flex-start}.devui-form-columns :host.devui-form-label{flex:1 1 auto;text-align:right;padding-bottom:8px;justify-content:flex-end;align-self:flex-start}.devui-form-lg.devui-form-columns :host.devui-form-label{flex:0 0 150px;justify-content:flex-end;text-align:right;align-self:flex-start}.devui-form-sm.devui-form-columns :host.devui-form-label{flex:0 0 80px;justify-content:flex-end;text-align:right;align-self:flex-start}.devui-icon.devui-icon-error{margin-left:4px;display:inline-block;vertical-align:middle;position:relative;top:-.1em}.devui-icon.devui-icon-error>g>path{fill:#f66f6a;fill:var(--devui-danger, #f66f6a)}.devui-icon.devui-icon-error>g>circle{fill:#fff;fill:var(--devui-light-text, #ffffff)}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.PopoverDirective, selector: "[dPopover]", inputs: ["content", "controlled", "position", "showAnimation", "showAnimate", "scrollElement", "appendToBody", "zIndex", "popType", "popMaxWidth", "trigger", "hoverToContent", "hoverDelayTime", "popoverStyle", "mouseEnterDelay", "mouseLeaveDelay", "visible"], exportAs: ["dPopover"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: FormLabelComponent, decorators: [{
            type: Component,
            args: [{ selector: 'd-form-label', preserveWhitespaces: false, template: "<span class=\"devui-form-span\" [ngClass]=\"{ 'devui-required': required }\">\n  <ng-content></ng-content>\n</span>\n<svg\n  *ngIf=\"hasHelp\"\n  dPopover\n  [content]=\"helpTipsTemplate\"\n  [popType]=\"'info'\"\n  [position]=\"'top'\"\n  [controlled]=\"true\"\n  trigger=\"hover\"\n  class=\"devui-helping\"\n  width=\"16px\"\n  height=\"16px\"\n  viewBox=\"0 0 16 16\"\n>\n  <g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n    <path\n      d=\"M8,1 C9.88227821,1 11.6450792,1.74560326 12.9497351,3.05025198 C14.2543924,4.35492369 15,6.11772556 15,8 C15,9.88227587 14.2543913,11.6450767 12.949734,12.949734 C11.6450767,14.2543913 9.88227587,15 8,15 C6.11772556,15 4.35492369,14.2543924 3.05024866,12.9497318 C1.74560326,11.6450792 1,9.88227821 1,8 C1,6.11772322 1.74560213,4.35492125 3.0502542,3.05024755 C4.35492125,1.74560213 6.11772322,1 8,1 Z M8,11.2634757 C7.47757297,11.2634757 7.05405405,11.6869946 7.05405405,12.2094216 C7.05405405,12.7318486 7.47757297,13.1553676 8,13.1553676 C8.52242703,13.1553676 8.94594595,12.7318486 8.94594595,12.2094216 C8.94594595,11.6869946 8.52242703,11.2634757 8,11.2634757 Z M8,3.12834054 C6.43270866,3.12834054 5.16216216,4.39888703 5.16216216,5.96617838 C5.16216216,6.27963729 5.41627082,6.53374595 5.72972973,6.53374595 C6.04318864,6.53374595 6.2972973,6.27963729 6.2972973,5.96617838 C6.2972973,5.02580486 7.05962648,4.26347568 8,4.26347568 C8.94037352,4.26347568 9.7027027,5.02580486 9.7027027,5.96617838 C9.7027027,6.9065519 8.94037352,7.66888108 8,7.66888108 C7.68654109,7.66888108 7.43243243,7.92298974 7.43243243,8.23644865 L7.43243243,8.23644865 L7.43243243,9.74996216 L7.44157671,9.85198315 C7.48963374,10.1167525 7.72136986,10.3175297 8,10.3175297 L8,10.3175297 L8.10202099,10.3083855 C8.36679036,10.2603284 8.56756757,10.0285923 8.56756757,9.74996216 L8.56756757,9.74996216 L8.56756757,8.74578378 L8.72552115,8.71042694 C9.94134023,8.38984467 10.8378378,7.28270311 10.8378378,5.96617838 C10.8378378,4.39888703 9.56729134,3.12834054 8,3.12834054 Z\"\n      fill-rule=\"nonzero\"\n    ></path>\n  </g>\n</svg>\n<svg *ngIf=\"feedbackStatus === 'error'\" class=\"devui-icon devui-icon-error\" width=\"16px\" height=\"16px\" viewBox=\"0 0 16 16\">\n  <g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n    <circle cx=\"8\" cy=\"8\" r=\"7\"></circle>\n    <path\n      d=\"M8,0 C3.6,0 0,3.6 0,8 C0,12.4 3.6,16 8,16 C12.4,16 16,12.4 16,8 C16,3.6 12.4,0 8,0 Z M9,12.6 L7,12.6 L7,10.6 L9,10.6 L9,12.6 Z M9,9.1 L7,9.1 L6.9,3.1 L9.1,3.1 L9,9.1 Z\"\n      fill-rule=\"nonzero\"\n    ></path>\n  </g>\n</svg>\n<ng-template #helpTipsTemplate>\n  <span class=\"devui-help-tips\">{{ helpTips }}</span>\n</ng-template>\n", styles: [".mr-content-spacing{margin-right:4px}.padding-element-spacing{padding:16px!important}.ml-element-spacing{margin-left:16px}.mr-element-spacing{margin-right:16px}.mt-element-spacing{margin-top:16px}.mb-element-spacing{margin-bottom:16px}.mlr-element-spacing{margin-left:16px;margin-right:16px}.mtb-element-spacing{margin-top:16px;margin-bottom:16px}.m-element-spacing{margin:16px}.grid{letter-spacing:-.31em;*letter-spacing: normal;word-spacing:-.43em}.u,.u-1,.u-1-2,.u-1-3,.u-2-3,.u-1-4,.u-3-4,.u-1-5,.u-2-5,.u-3-5,.u-4-5,.u-1-6,.u-5-6,.u-1-8,.u-3-8,.u-5-8,.u-7-8,.u-1-12,.u-5-12,.u-7-12,.u-11-12,.u-1-24,.u-5-24,.u-7-24,.u-11-24,.u-13-24,.u-17-24,.u-19-24,.u-23-24{display:inline-block;*display: inline;zoom:1;letter-spacing:normal;word-spacing:normal;vertical-align:top}.u-1{display:block}.u-1-2{width:49.99999%}.u-1-3{width:33.33333%}.u-2-3{width:66.66666%}.u-1-4{width:24.99999%}.u-3-4{width:74.99999%}.u-1-5{width:19.99999%}.u-2-5{width:39.99999%}.u-3-5{width:59.99999%}.u-4-5{width:79.99999%}.u-1-6{width:16.64999%}.u-5-6{width:83.33333%}.u-1-8{width:12.49999%}.u-3-8{width:37.49999%}.u-5-8{width:62.49999%}.u-7-8{width:87.49999%}.u-1-12{width:8.33333%}.u-5-12{width:41.66666%}.u-7-12{width:58.33333%}.u-11-12{width:91.66666%}.u-1-24{width:4.16666%}.u-5-24{width:20.83333%}.u-7-24{width:29.16666%}.u-11-24{width:45.83333%}.u-13-24{width:54.16666%}.u-17-24{width:70.83333%}.u-19-24{width:79.16666%}.u-23-24{width:95.83333%}.u-content{padding:0 0 10px 10px}.devui-form-span{position:relative;display:inline-block;vertical-align:middle;color:#252b3a;color:var(--devui-text, #252b3a)}.devui-form-span.devui-required:before{content:\"*\";color:red;display:inline-block;margin-right:4px;margin-left:-8px;vertical-align:middle}:host-context(.devui-form-item:hover) .svg-close{display:inline-block;cursor:pointer}.devui-helping{display:inline-block;vertical-align:middle;margin-left:4px;cursor:pointer}.devui-helping path{fill:#d7d8da;fill:var(--devui-shape-icon-fill, #d7d8da)}.devui-help-tips{display:inline-block;margin-left:20px;max-width:200px}.devui-form-horizontal :host.devui-form-label{flex:0 0 100px;justify-content:flex-end;text-align:left;align-self:flex-start}.devui-form-horizontal :host.devui-form-label .devui-form-span{line-height:28px}.devui-form-lg.devui-form-horizontal :host.devui-form-label{flex:0 0 150px}.devui-form-sm.devui-form-horizontal :host.devui-form-label{flex:0 0 80px}.devui-form-horizontal.devui-form-label-align-center :host.devui-form-label{text-align:center}.devui-form-horizontal.devui-form-label-align-end :host.devui-form-label{text-align:right}.devui-form-vertical :host.devui-form-label{flex:1 1 auto;-moz-box-flex:1;text-align:left;padding-bottom:8px;justify-content:flex-start;align-self:flex-start}.devui-form-columns :host.devui-form-label{flex:1 1 auto;text-align:right;padding-bottom:8px;justify-content:flex-end;align-self:flex-start}.devui-form-lg.devui-form-columns :host.devui-form-label{flex:0 0 150px;justify-content:flex-end;text-align:right;align-self:flex-start}.devui-form-sm.devui-form-columns :host.devui-form-label{flex:0 0 80px;justify-content:flex-end;text-align:right;align-self:flex-start}.devui-icon.devui-icon-error{margin-left:4px;display:inline-block;vertical-align:middle;position:relative;top:-.1em}.devui-icon.devui-icon-error>g>path{fill:#f66f6a;fill:var(--devui-danger, #f66f6a)}.devui-icon.devui-icon-error>g>circle{fill:#fff;fill:var(--devui-light-text, #ffffff)}\n"] }]
        }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { required: [{
                type: Input
            }], hasHelp: [{
                type: Input
            }], helpTips: [{
                type: Input
            }], status: [{
                type: HostBinding,
                args: ['class.devui-form-label-has-feedback']
            }] } });

class FormItemComponent {
    constructor(elementRef, renderer, cdr) {
        // FIXME: 循环依赖，打包后将不可用：FormItemComponent -> FormDirective -> DFormControlRuleDirective -> FormItemComponent
        // @Optional() @Host() @SkipSelf() private _dForm: FormDirective,
        this.cdr = cdr;
        this._hasErrorMsg = false;
        this.dHasFeedback = false;
        renderer.addClass(elementRef.nativeElement, 'devui-form-item');
    }
    ngOnInit() { }
    updateFeedback(status, updateMessage) {
        this._hasErrorMsg = !!updateMessage;
        const feedbackType = this.dFeedbackType;
        if (feedbackType === 'label' && this.labelInstance) {
            this.labelInstance.updateFeedbackStatus(status);
        }
        else if ((feedbackType === 'control' || this.dHasFeedback) && this.controlInstance) {
            this.controlInstance.updateFeedbackStatus(status);
        }
        if (this.controlInstance) {
            this.controlInstance.updateErrorMessage(updateMessage);
        }
        this.cdr.detectChanges();
    }
}
FormItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: FormItemComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
FormItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: FormItemComponent, selector: "d-form-item", inputs: { dFeedbackType: "dFeedbackType", dHasFeedback: "dHasFeedback" }, host: { properties: { "class.devui-form-has-error-msg": "this._hasErrorMsg" } }, queries: [{ propertyName: "controlInstance", first: true, predicate: FormControlComponent, descendants: true }, { propertyName: "labelInstance", first: true, predicate: FormLabelComponent, descendants: true }], ngImport: i0, template: ` <ng-content></ng-content> `, isInline: true, styles: [".mr-content-spacing{margin-right:4px}.padding-element-spacing{padding:16px!important}.ml-element-spacing{margin-left:16px}.mr-element-spacing{margin-right:16px}.mt-element-spacing{margin-top:16px}.mb-element-spacing{margin-bottom:16px}.mlr-element-spacing{margin-left:16px;margin-right:16px}.mtb-element-spacing{margin-top:16px;margin-bottom:16px}.m-element-spacing{margin:16px}.grid{letter-spacing:-.31em;*letter-spacing: normal;word-spacing:-.43em}.u,.u-1,.u-1-2,.u-1-3,.u-2-3,.u-1-4,.u-3-4,.u-1-5,.u-2-5,.u-3-5,.u-4-5,.u-1-6,.u-5-6,.u-1-8,.u-3-8,.u-5-8,.u-7-8,.u-1-12,.u-5-12,.u-7-12,.u-11-12,.u-1-24,.u-5-24,.u-7-24,.u-11-24,.u-13-24,.u-17-24,.u-19-24,.u-23-24{display:inline-block;*display: inline;zoom:1;letter-spacing:normal;word-spacing:normal;vertical-align:top}.u-1{display:block}.u-1-2{width:49.99999%}.u-1-3{width:33.33333%}.u-2-3{width:66.66666%}.u-1-4{width:24.99999%}.u-3-4{width:74.99999%}.u-1-5{width:19.99999%}.u-2-5{width:39.99999%}.u-3-5{width:59.99999%}.u-4-5{width:79.99999%}.u-1-6{width:16.64999%}.u-5-6{width:83.33333%}.u-1-8{width:12.49999%}.u-3-8{width:37.49999%}.u-5-8{width:62.49999%}.u-7-8{width:87.49999%}.u-1-12{width:8.33333%}.u-5-12{width:41.66666%}.u-7-12{width:58.33333%}.u-11-12{width:91.66666%}.u-1-24{width:4.16666%}.u-5-24{width:20.83333%}.u-7-24{width:29.16666%}.u-11-24{width:45.83333%}.u-13-24{width:54.16666%}.u-17-24{width:70.83333%}.u-19-24{width:79.16666%}.u-23-24{width:95.83333%}.u-content{padding:0 0 10px 10px}.devui-form-horizontal :host.devui-form-item{margin-bottom:20px;display:flex;align-items:center}.devui-form-horizontal :host.devui-form-item.devui-form-has-error-msg{margin-bottom:0}.devui-form-vertical :host.devui-form-item{display:flex;margin-bottom:20px;flex-direction:column}.devui-form-vertical :host.devui-form-item.devui-form-has-error-msg{margin-bottom:0}.devui-form-columns :host.devui-form-item{display:flex;flex-direction:column;align-items:flex-start;margin-right:16px;margin-bottom:20px}.devui-form-columns :host.devui-form-item.devui-form-has-error-msg{margin-bottom:0}\n"] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: FormItemComponent, decorators: [{
            type: Component,
            args: [{ selector: 'd-form-item', template: ` <ng-content></ng-content> `, preserveWhitespaces: false, styles: [".mr-content-spacing{margin-right:4px}.padding-element-spacing{padding:16px!important}.ml-element-spacing{margin-left:16px}.mr-element-spacing{margin-right:16px}.mt-element-spacing{margin-top:16px}.mb-element-spacing{margin-bottom:16px}.mlr-element-spacing{margin-left:16px;margin-right:16px}.mtb-element-spacing{margin-top:16px;margin-bottom:16px}.m-element-spacing{margin:16px}.grid{letter-spacing:-.31em;*letter-spacing: normal;word-spacing:-.43em}.u,.u-1,.u-1-2,.u-1-3,.u-2-3,.u-1-4,.u-3-4,.u-1-5,.u-2-5,.u-3-5,.u-4-5,.u-1-6,.u-5-6,.u-1-8,.u-3-8,.u-5-8,.u-7-8,.u-1-12,.u-5-12,.u-7-12,.u-11-12,.u-1-24,.u-5-24,.u-7-24,.u-11-24,.u-13-24,.u-17-24,.u-19-24,.u-23-24{display:inline-block;*display: inline;zoom:1;letter-spacing:normal;word-spacing:normal;vertical-align:top}.u-1{display:block}.u-1-2{width:49.99999%}.u-1-3{width:33.33333%}.u-2-3{width:66.66666%}.u-1-4{width:24.99999%}.u-3-4{width:74.99999%}.u-1-5{width:19.99999%}.u-2-5{width:39.99999%}.u-3-5{width:59.99999%}.u-4-5{width:79.99999%}.u-1-6{width:16.64999%}.u-5-6{width:83.33333%}.u-1-8{width:12.49999%}.u-3-8{width:37.49999%}.u-5-8{width:62.49999%}.u-7-8{width:87.49999%}.u-1-12{width:8.33333%}.u-5-12{width:41.66666%}.u-7-12{width:58.33333%}.u-11-12{width:91.66666%}.u-1-24{width:4.16666%}.u-5-24{width:20.83333%}.u-7-24{width:29.16666%}.u-11-24{width:45.83333%}.u-13-24{width:54.16666%}.u-17-24{width:70.83333%}.u-19-24{width:79.16666%}.u-23-24{width:95.83333%}.u-content{padding:0 0 10px 10px}.devui-form-horizontal :host.devui-form-item{margin-bottom:20px;display:flex;align-items:center}.devui-form-horizontal :host.devui-form-item.devui-form-has-error-msg{margin-bottom:0}.devui-form-vertical :host.devui-form-item{display:flex;margin-bottom:20px;flex-direction:column}.devui-form-vertical :host.devui-form-item.devui-form-has-error-msg{margin-bottom:0}.devui-form-columns :host.devui-form-item{display:flex;flex-direction:column;align-items:flex-start;margin-right:16px;margin-bottom:20px}.devui-form-columns :host.devui-form-item.devui-form-has-error-msg{margin-bottom:0}\n"] }]
        }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { _hasErrorMsg: [{
                type: HostBinding,
                args: ['class.devui-form-has-error-msg']
            }], dFeedbackType: [{
                type: Input
            }], dHasFeedback: [{
                type: Input
            }], controlInstance: [{
                type: ContentChild,
                args: [FormControlComponent]
            }], labelInstance: [{
                type: ContentChild,
                args: [FormLabelComponent]
            }] } });

// @dynamic
class DValidators {
    static isEmptyInput(value) {
        return value === null || value.length === 0;
    }
    /* Failed if only has whitespace */
    static whiteSpace(control) {
        let res = null;
        if (typeof control.value === 'string' && control.value.length !== 0 && control.value.trim().length === 0) {
            res = { whitespace: true };
        }
        return res;
    }
    /**
     * 校验是否包含
     * @param contain
     * @returns
     */
    static contains(contain) {
        return (control) => {
            if (DValidators.isEmptyInput(control.value) || DValidators.isEmptyInput(contain)) {
                return null;
            }
            return control.value.indexOf(contain) === -1 ? { contains: { requiredContains: contain, actualValue: control.value } } : null;
        };
    }
    /**
     * 校验是否不包含
     * @param contain
     * @returns
     */
    static notContains(contain) {
        return (control) => {
            if (DValidators.isEmptyInput(control.value) || DValidators.isEmptyInput(contain)) {
                return null;
            }
            return control.value.indexOf(contain) !== -1 ? { notContains: { requiredNotContains: contain, actualValue: control.value } } : null;
        };
    }
    /**
     * 校验是否相等
     * @param equal
     * @returns
     */
    static equal(equal) {
        return (control) => {
            if (DValidators.isEmptyInput(control.value) || DValidators.isEmptyInput(equal)) {
                return null;
            }
            return control.value !== equal ? { equal: { requiredEqual: equal, actualValue: control.value } } : null;
        };
    }
    /**
     * 校验是否不相等
     * @param equal
     * @returns
     */
    static notEqual(equal) {
        return (control) => {
            if (DValidators.isEmptyInput(control.value) || DValidators.isEmptyInput(equal)) {
                return null;
            }
            return control.value === equal ? { notEqual: { requiredNotEqual: equal, actualValue: control.value } } : null;
        };
    }
    /**
     * 校验端口号
     * @param control
     * @returns
     */
    static port(control) {
        if (DValidators.isEmptyInput(control.value)) {
            return null;
        }
        return DValidators.DigitPattern.test(control.value) &&
            control.value >= DValidators.PortRange[0] &&
            control.value <= DValidators.PortRange[1]
            ? null
            : { port: { min: DValidators.PortRange[0], max: DValidators.PortRange[1] } };
    }
    /**
     * 校验日期是否合法
     * @param control
     * @returns
     */
    static date(control) {
        if (DValidators.isEmptyInput(control.value)) {
            return null; // don't validate empty values to allow optional controls
        }
        return !/Invalid|NaN/.test(new Date(control.value).toString()) ? null : { date: true };
    }
    /**
     * 校验 url 是否合法
     * @param control
     * @returns
     */
    static url(control) {
        if (DValidators.isEmptyInput(control.value)) {
            return null; // don't validate empty values to allow optional controls
        }
        return DValidators.UrlPattern.test(control.value) ? null : { url: true };
    }
    /**
     * 校验整数
     * @param control
     * @returns
     */
    static integer(control) {
        if (DValidators.isEmptyInput(control.value)) {
            return null; // don't validate empty values to allow optional controls
        }
        return DValidators.IntegerPattern.test(control.value) ? null : { integer: true };
    }
    /**
     * 校验是否是数字
     * @param control
     * @returns
     */
    static digits(control) {
        if (DValidators.isEmptyInput(control.value)) {
            return null; // don't validate empty values to allow optional controls
        }
        return DValidators.DigitPattern.test(control.value) ? null : { digits: true };
    }
    /**
     * 校验数字，支持科学计数法
     * @param control
     * @returns
     */
    static number(control) {
        if (DValidators.isEmptyInput(control.value)) {
            return null; // don't validate empty values to allow optional controls
        }
        return DValidators.NumberPattern.test(control.value) ? null : { number: true };
    }
    /**
     * 校验是否是字母
     * @param control
     * @returns
     */
    static alphabet(control) {
        if (DValidators.isEmptyInput(control.value)) {
            return null;
        }
        return DValidators.AlphabetPattern.test(control.value) ? null : { alphabet: true };
    }
    /**
     * 校验是 script 标签
     * @param control
     * @returns
     */
    static notScript(control) {
        if (DValidators.isEmptyInput(control.value)) {
            return null;
        }
        return DValidators.ScriptPattern.test(control.value) ? { notScript: true } : null;
    }
    /**
     * 校验 ipv4
     * @param control
     * @returns
     */
    static ipv4(control) {
        if (DValidators.isEmptyInput(control.value)) {
            return null;
        }
        return DValidators.Ipv4Pattern.test(control.value) ? null : { ipv4: true };
    }
    /**
     * 校验 ipv6
     * @param control
     * @returns
     */
    static ipv6(control) {
        if (DValidators.isEmptyInput(control.value)) {
            return null;
        }
        return DValidators.Ipv6Pattern.test(control.value) ? null : { ipv6: true };
    }
}
// eslint-disable-next-line max-len
DValidators.ScriptPattern = /<+\/?[Ss][Cc][Rr][Ii][Pp][Tt] *.*>*/;
// eslint-disable-next-line max-len
DValidators.UrlPattern = /^(https?|s?ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((((1?[1-9]?\d)|(10\d)|(2[0-4]\d)|(25[0-5]))\.){3}((1?[1-9]?\d)|(10\d)|(2[0-4]\d)|(25[0-5])))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i;
DValidators.Ipv4Pattern = /^(((1?[1-9]?\d)|(10\d)|(2[0-4]\d)|(25[0-5]))\.){3}((1?[1-9]?\d)|(10\d)|(2[0-4]\d)|(25[0-5]))$/i;
// eslint-disable-next-line max-len
DValidators.Ipv6Pattern = /^(((([\da-f]{1,4}):){7}([\da-f]{1,4}))|(((([\da-f]{1,4}):){1,7}:)|((([\da-f]{1,4}):){6}:([\da-f]{1,4}))|((([\da-f]{1,4}):){5}:(([\da-f]{1,4}):)?([\da-f]{1,4}))|((([\da-f]{1,4}):){4}:(([\da-f]{1,4}):){0,2}([\da-f]{1,4}))|((([\da-f]{1,4}):){3}:(([\da-f]{1,4}):){0,3}([\da-f]{1,4}))|((([\da-f]{1,4}):){2}:(([\da-f]{1,4}):){0,4}([\da-f]{1,4}))|((([\da-f]{1,4}):){1}:(([\da-f]{1,4}):){0,5}([\da-f]{1,4}))|(::(([\da-f]{1,4}):){0,6}([\da-f]{1,4}))|(::([\da-f]{1,4})?))|(((([\da-f]{1,4}):){6}(((1?[1-9]?\d)|(10\d)|(2[0-4]\d)|(25[0-5]))\.){3}((1?[1-9]?\d)|(10\d)|(2[0-4]\d)|(25[0-5])))|((([\da-f]{1,4}):){5}:(((1?[1-9]?\d)|(10\d)|(2[0-4]\d)|(25[0-5]))\.){3}((1?[1-9]?\d)|(10\d)|(2[0-4]\d)|(25[0-5])))|((([\da-f]{1,4}):){4}:(([\da-f]{1,4}):)?(((1?[1-9]?\d)|(10\d)|(2[0-4]\d)|(25[0-5]))\.){3}((1?[1-9]?\d)|(10\d)|(2[0-4]\d)|(25[0-5])))|((([\da-f]{1,4}):){3}:(([\da-f]{1,4}):){0,2}(((1?[1-9]?\d)|(10\d)|(2[0-4]\d)|(25[0-5]))\.){3}((1?[1-9]?\d)|(10\d)|(2[0-4]\d)|(25[0-5])))|((([\da-f]{1,4}):){2}:(([\da-f]{1,4}):){0,3}(((1?[1-9]?\d)|(10\d)|(2[0-4]\d)|(25[0-5]))\.){3}((1?[1-9]?\d)|(10\d)|(2[0-4]\d)|(25[0-5])))|(([\da-f]{1,4})::(([\da-f]{1,4}):){0,4}(((1?[1-9]?\d)|(10\d)|(2[0-4]\d)|(25[0-5]))\.){3}((1?[1-9]?\d)|(10\d)|(2[0-4]\d)|(25[0-5])))|(::(([\da-f]{1,4}):){0,5}(((1?[1-9]?\d)|(10\d)|(2[0-4]\d)|(25[0-5]))\.){3}((1?[1-9]?\d)|(10\d)|(2[0-4]\d)|(25[0-5])))))$/i;
DValidators.AlphabetPattern = /^[a-zA-Z]+(\s+[a-zA-Z]+)*$/;
DValidators.DigitPattern = /^\d+$/;
DValidators.IntegerPattern = /^-?\d+$/;
DValidators.NumberPattern = /^(?:-?\d+|[+-]?[\d]+([\.][\d]+)?([Ee][+-]?[\d]+)?|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/; // 支持科学计数法
DValidators.PortRange = [0, 65535];

/* TODO: 这里是否需要导出 */
const ruleReservedWords = [
    'id',
    'validator',
    'message',
    'errorStrategy',
    'priority',
    'isNgValidator',
    'popPosition',
    'asyncDebounceTime',
];
// 这里要考虑如果可全局添加默认
const dDefaultValidators = {
    required: Validators.required,
    minlength: Validators.minLength,
    maxlength: Validators.maxLength,
    min: Validators.min,
    max: Validators.max,
    requiredTrue: Validators.requiredTrue,
    email: Validators.email,
    pattern: Validators.pattern,
    whitespace: DValidators.whiteSpace,
};

class DAbstractControlRuleDirective {
    constructor(cd, parent) {
        /* 统一设置错误抛出策略 */
        this._errorStrategy = 'dirty'; // 统一设置错误抛出策略
        /* 是否已经注册监听 */
        this._registered = false;
        this._errorMessage = null;
        this.dRulesStatusChange = new EventEmitter();
        this._cd = cd;
        this._parent = parent;
    }
    set locale(key) {
        this._locale = key;
        this._parseErrors(this._cd.control.errors);
        this.updateStatusAndMessageToView(this._cd.control.status);
    }
    get locale() {
        return this._locale;
    }
    get errorMessage() {
        return this._cd && this._cd.control.invalid
            ? this._errorMessage || (this._rules && this._rules.message)
            : null;
    }
    set errorMessage(msg) {
        if (this._cd && this._cd.control.invalid) {
            this._errorMessage = msg;
        }
        else {
            this._errorMessage = null;
        }
    }
    get isReady() {
        return this._cd.control ? !(this._cd.control.invalid || this._cd.control.pending) : true;
    }
    get pending() {
        return this._cd.control ? this._cd.control.pending : true;
    }
    /* 包含继承自父级的rule */
    get fullRules() {
        const keysCanInherit = ['messageShowType', 'errorStrategy', 'messageToView', 'popPosition', 'asyncDebounceTime'];
        const resRules = { ...this._rules };
        keysCanInherit.forEach((key) => {
            if (this._parent && this._parent.fullRules) {
                resRules[key] = resRules[key] !== undefined ? resRules[key] : this._parent.fullRules[key];
            }
        });
        return resRules;
    }
    get asyncValidatorDebounceTime() {
        const time = this.fullRules.asyncDebounceTime;
        return time === undefined ? 300 : time;
    }
    ngOnChanges(changes) {
        if ('rules' in changes && !this._rules) {
            // TODO：提供外部调用可手动更新rule方法
            this._rules = { ...this._originRules, ...this._translateRulesToObject(changes['rules'].currentValue) };
            this.setupOrUpdateRules();
        }
        if (!this._registered) {
            this._registerOnStatusChange();
        }
    }
    updateRules(rules) {
        this._rules = { ...this._originRules, ...this._translateRulesToObject(rules) };
        this.setupOrUpdateRules();
    }
    setOriginRules(rules) {
        this._originRules = this._translateRulesToObject(rules);
    }
    setupOrUpdateRules() {
        // TODO：校验rules规则是否合法
        this._transformRulesAndUpdateToModel();
        this._setUpdateStrategy();
    }
    _transformRulesAndUpdateToModel() {
        this._messageOpts = {};
        if (!Array.isArray(this._rules)) {
            if (this._rules.validators) {
                const validators = this._transformValidatorsToFnArray(this._rules.validators);
                this._updateValidators(validators);
            }
            if (this._rules.asyncValidators) {
                const asyncValidators = this._transformValidatorsToFnArray(this._rules.asyncValidators, true);
                this._updateAsyncValidators(asyncValidators);
            }
        }
        else {
            const validators = this._transformValidatorsToFnArray(this._rules);
            this._updateValidators(validators);
        }
        this._updateValueAndValidity();
    }
    _transformValidatorsToFnArray(validators, async = false) {
        const resultFns = [];
        validators.forEach((validatorRule) => {
            // TODO: 提供可全局统一注册方法
            const validatorId = this._autoGetIdFromRule(validatorRule);
            let validator = null;
            if (!validatorId) {
                // TODO：抛出错误
            }
            if (validatorId in dDefaultValidators) {
                validator = this._generateValidatorFnFromDefault(validatorId, validatorRule[validatorId]);
            }
            else {
                if (typeof validatorRule[validatorId] === 'string') {
                    validator = validatorRule.validator;
                }
                else {
                    validator = validatorRule[validatorId];
                }
                if (!validatorRule.isNgValidator) {
                    if (!async) {
                        validator = this._transformRuleToNgValidator(validatorId, validator, validatorRule.message);
                    }
                    else {
                        validator = this._transformRuleToNgAsyncValidator(validatorId, validator, validatorRule.message);
                    }
                }
            }
            if (validator) {
                if (async && this.asyncValidatorDebounceTime) {
                    const oldValidator = validator;
                    validator = (control) => {
                        return timer(this.asyncValidatorDebounceTime).pipe(switchMap(() => {
                            return oldValidator(control);
                        }));
                    };
                }
                resultFns.push(validator);
                this._messageOpts[validatorId] = validatorRule;
            }
            // else {
            //   // TODO: 抛出错误
            // }
        });
        return resultFns;
    }
    _translateRulesToObject(rules) {
        if (Array.isArray(rules)) {
            return {
                validators: rules,
            };
        }
        return rules;
    }
    _findNgValidatorInDefault(validatorRule) {
        for (const key in dDefaultValidators) {
            if (Object.prototype.hasOwnProperty.call(validatorRule, key)) {
                return { id: key, ngValidator: this._generateValidatorFnFromDefault(key, validatorRule[key]) };
            }
        }
        return null;
    }
    _generateValidatorFnFromDefault(key, value) {
        if (typeof value === 'boolean' && value) {
            // boolean无需再执行函数进行传值
            return dDefaultValidators[key];
        }
        else if (typeof value !== 'boolean') {
            return dDefaultValidators[key](value);
        }
        return null;
    }
    _transformRuleToNgValidator(id, validatorFn, message) {
        return (control) => {
            const res = validatorFn(control.value);
            return this._transValidatorResultToNgError(id, res, message);
        };
    }
    _transformRuleToNgAsyncValidator(id, validator, message) {
        return (control) => {
            return validator(control.value).pipe(map((res) => {
                return this._transValidatorResultToNgError(id, res, message);
            }));
        };
    }
    _transValidatorResultToNgError(id, res, message) {
        let error = null;
        if (typeof res === 'boolean' && !res) {
            error = {};
            error[id] = message;
        }
        else if (typeof res === 'string' || (res && typeof res === 'object')) {
            // 兼容国际化词条
            error = {};
            error[id] = res;
        }
        return error;
    }
    _autoGetIdFromRule(rule) {
        for (const key in rule) {
            if (!(key in ruleReservedWords)) {
                return key;
            }
        }
        return rule.id || null;
    }
    // TODO: 考虑自定义函数返回多种key场景
    get dClassError() {
        if (this._errorStrategy === 'dirty') {
            return this._cd.control ? this._cd.control.invalid && this._cd.control.dirty : false;
        }
        else {
            return this._cd.control ? this._cd.control.invalid : false;
        }
    }
    get showError() {
        return this.dClassError;
    }
    get showStatus() {
        if (this._errorStrategy === 'dirty') {
            return this._cd.control ? this._cd.control.dirty : false;
        }
        else {
            return true;
        }
    }
    get dClassSuccess() {
        // COMMENT: 暂不默认提供
        if (this._rules['errorStrategy'] === 'dirty') {
            return this._cd.control ? this._cd.control.valid && this._cd.control.dirty : false;
        }
        else if (!this._rules['errorStrategy']) {
            return false;
        }
        else {
            return this._cd.control ? this._cd.control.valid : false;
        }
    }
    get dClassWarning() {
        return this._warning ? true : false;
    }
    get invalid() {
        return this._cd.control ? this._cd.control.invalid : false;
    }
    _registerOnStatusChange() {
        if (this._cd && this._cd.control) {
            this._cd.control.statusChanges.subscribe((status) => {
                this._parseErrors(this._cd.control.errors);
                this._updateParent(); // update error message to parent directive
                this.updateStatusAndMessageToView(status);
            });
            this._registered = true;
        }
    }
    _parseErrors(errors) {
        if (!errors) {
            this._errorMessage = null;
        }
        else {
            /* if a rule did not have a message, we will try to get a message from errors by id */
            const { resId, resRule } = this._getARuleByErrors(errors);
            this._errorStrategy = this._getErrorStrategy(resRule);
            this._errorMessage =
                resRule &&
                    (resRule.message ||
                        this._getMessageFormErrorsById(errors, resId) ||
                        this._getDefaultErrorMessage(resRule, resId) ||
                        this._rules.message);
        }
        this.dRulesStatusChange.emit({
            showError: this.showError,
            errorMessage: this._errorMessage,
            errors: errors,
        });
    }
    _getDefaultErrorMessage(rule, id) {
        return rule && rule[id] && this.i18nFormText[id] && this.i18nFormText[id](rule[id]);
    }
    _getErrorStrategy(rule) {
        return (rule && rule.errorStrategy) || this._rules['errorStrategy'] || 'dirty';
    }
    _getMessageFormErrorsById(errors, id) {
        if (errors[id] && typeof errors[id] === 'string') {
            return errors[id];
        }
        else if (errors[id] && typeof errors[id] === 'object' && (errors[id][this.locale] || errors[id]['default'])) {
            return errors[id];
        }
        else {
            return null;
        }
    }
    _getARuleByErrors(errors) {
        // TODO：处理errors为null
        let resId;
        let resRule = null;
        for (const key of Object.keys(errors)) {
            if (this._messageOpts[key]) {
                if (resRule) {
                    const priority = resRule.priority || 0;
                    if (this._messageOpts[key].priority && this._messageOpts[key].priority > priority) {
                        resId = key;
                        resRule = this._messageOpts[key];
                    }
                }
                else {
                    resId = key;
                    resRule = this._messageOpts[key];
                }
            }
        }
        return { resId: resId, resRule: resRule };
    }
    _updateParent() {
        if (this._parent) {
            // TODO
        }
    }
    _setUpdateStrategy() {
        if (!Array.isArray(this._rules) && typeof this._rules === 'object' && this._rules.updateOn) {
            this._cd.control._updateOn = this._rules.updateOn;
        }
    }
    _updateValueAndValidity() {
        if (this._cd && this._cd.control) {
            this._cd.control.updateValueAndValidity();
        }
    }
    _updateValidators(newValidator) {
        if (this._cd && this._cd.control) {
            this._cd.control.setValidators(newValidator);
        }
    }
    _updateAsyncValidators(newValidator) {
        if (this._cd && this._cd.control) {
            this._cd.control.setAsyncValidators(newValidator);
        }
    }
}
DAbstractControlRuleDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: DAbstractControlRuleDirective, deps: [{ token: i1$1.AbstractControlDirective }, { token: DAbstractControlRuleDirective }], target: i0.ɵɵFactoryTarget.Directive });
DAbstractControlRuleDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.0", type: DAbstractControlRuleDirective, outputs: { dRulesStatusChange: "dRulesStatusChange" }, usesOnChanges: true, ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: DAbstractControlRuleDirective, decorators: [{
            type: Directive
        }], ctorParameters: function () { return [{ type: i1$1.AbstractControlDirective }, { type: DAbstractControlRuleDirective }]; }, propDecorators: { dRulesStatusChange: [{
                type: Output
            }] } });
const dControlErrorStatusHost = {
    '[class.devui-error]': 'dClassError',
    '[class.devui-success]': 'dClassSuccess',
    '[class.devui-warning]': 'dClassWarning',
};
class DFormGroupRuleDirective extends DAbstractControlRuleDirective {
    constructor(cd, parentDir, i18n) {
        super(cd, parentDir);
        this.i18n = i18n;
        this.dRulesStatusChange = new EventEmitter();
        this.destroy$ = new Subject();
    }
    ngOnInit() {
        this.i18nFormText = this.i18n.getI18nText().form;
        this.locale = this.i18n.getI18nText().locale;
        this.i18n
            .langChange()
            .pipe(takeUntil(this.destroy$))
            .subscribe((data) => {
            this.i18nFormText = data.form;
            this.locale = data.locale;
        });
    }
    ngOnDestroy() {
        this.destroy$.next();
        this.destroy$.complete();
    }
    setErrorMessageByChild(msg) {
        if (!this.errorMessage) {
            this.errorMessage = msg;
        }
    }
    updateStatusAndMessageToView(status) {
        // do nothing
    }
}
DFormGroupRuleDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: DFormGroupRuleDirective, deps: [{ token: i1$1.ControlContainer, self: true }, { token: DFormGroupRuleDirective, host: true, optional: true, skipSelf: true }, { token: i2$1.I18nService }], target: i0.ɵɵFactoryTarget.Directive });
DFormGroupRuleDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.0", type: DFormGroupRuleDirective, selector: "[dValidateRules][formGroupName],[dValidateRules][formArrayName],[dValidateRules][ngModelGroup],\n          [dValidateRules][formGroup],[dValidateRules]form:not([ngNoForm]),[dValidateRules][ngForm]", inputs: { rules: ["dValidateRules", "rules"] }, outputs: { dRulesStatusChange: "dRulesStatusChange" }, host: { properties: { "class.devui-error": "dClassError", "class.devui-success": "dClassSuccess", "class.devui-warning": "dClassWarning" } }, exportAs: ["dValidateRules"], usesInheritance: true, ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: DFormGroupRuleDirective, decorators: [{
            type: Directive,
            args: [{
                    selector: `[dValidateRules][formGroupName],[dValidateRules][formArrayName],[dValidateRules][ngModelGroup],
          [dValidateRules][formGroup],[dValidateRules]form:not([ngNoForm]),[dValidateRules][ngForm]`,
                    /* eslint-disable-next-line @angular-eslint/no-host-metadata-property*/
                    host: dControlErrorStatusHost,
                    exportAs: 'dValidateRules',
                }]
        }], ctorParameters: function () { return [{ type: i1$1.ControlContainer, decorators: [{
                    type: Self
                }] }, { type: DFormGroupRuleDirective, decorators: [{
                    type: Optional
                }, {
                    type: Host
                }, {
                    type: SkipSelf
                }] }, { type: i2$1.I18nService }]; }, propDecorators: { rules: [{
                type: Input,
                args: ['dValidateRules']
            }], dRulesStatusChange: [{
                type: Output
            }] } });
class DFormControlRuleDirective extends DAbstractControlRuleDirective {
    constructor(cd, dFormItem, parentDir, i18n, triggerElementRef, overlayContainerRef, componentFactoryResolver) {
        super(cd, parentDir);
        this.dFormItem = dFormItem;
        this.i18n = i18n;
        this.triggerElementRef = triggerElementRef;
        this.overlayContainerRef = overlayContainerRef;
        this.componentFactoryResolver = componentFactoryResolver;
        this.dRulesStatusChange = new EventEmitter();
        this.destroy$ = new Subject();
    }
    get showType() {
        return this.fullRules.messageShowType || 'popover';
    }
    get popPosition() {
        return this.fullRules.popPosition || ['right', 'bottom'];
    }
    ngOnInit() {
        this.setI18nText();
        this._registerFocusChange();
    }
    setI18nText() {
        this.i18nFormText = this.i18n.getI18nText().form;
        this.locale = this.i18n.getI18nText().locale;
        this.i18n
            .langChange()
            .pipe(takeUntil(this.destroy$))
            .subscribe((data) => {
            this.i18nFormText = data.form;
            this.locale = data.locale;
        });
    }
    _registerFocusChange() {
        merge(fromEvent(this.triggerElementRef.nativeElement, 'focusin'), fromEvent(this.triggerElementRef.nativeElement, 'focusout'))
            .pipe(takeUntil(this.destroy$))
            .subscribe((event) => {
            if (event.type === 'focusin') {
                this.showPopMessage();
            }
            if (event.type === 'focusout') {
                this.hidePopMessage();
            }
        });
    }
    _updateFormContainer(status, message) {
        if (this.dFormItem) {
            this.dFormItem.updateFeedback(status, message);
        }
    }
    _updatePopMessage(status, message) {
        this.popMessage = status === 'error' ? message : null; // 暂不提供除errorMessage外提示
        if (this.popoverComponentRef) {
            this.hidePopMessage();
            this.showPopMessage();
        }
    }
    updateStatusAndMessageToView(status) {
        let controlStatus = null;
        let message = null;
        if (this.showStatus) {
            [controlStatus, message] = this.getFormControlStatusAndMessage(status);
        }
        /* 国际化适配 */
        if (message && typeof message === 'object') {
            message = message[this.locale] || message['default'] || null;
        }
        if (this.showType === 'popover') {
            this._updatePopMessage(controlStatus, message);
            this._updateFormContainer(controlStatus, null);
        }
        else if (this.showType === 'text') {
            this._updateFormContainer(controlStatus, message);
        }
    }
    getFormControlStatusAndMessage(ngStatus) {
        let status = null;
        let message = null;
        if (ngStatus === 'INVALID') {
            status = 'error';
            message = this.errorMessage;
        }
        else if (ngStatus === 'PENDING') {
            status = 'pending';
        }
        else if (ngStatus === 'VALID') {
            status = 'success';
        }
        return [status, message];
    }
    createPopover(type, content) {
        this.popoverComponentRef = this.overlayContainerRef.createComponent(this.componentFactoryResolver.resolveComponentFactory(PopoverComponent));
        Object.assign(this.popoverComponentRef.instance, {
            content: content,
            triggerElementRef: this.triggerElementRef,
            position: this.popPosition,
            popType: type,
            popMaxWidth: this.popConfig?.popMaxWidth || 200,
            appendToBody: true,
            zIndex: this.popConfig?.zIndex || 1060,
        });
    }
    showPopMessage() {
        this.showPop('error', this.popMessage);
        if (this.popMessage) {
            this._updateFormContainer(null, null);
        }
    }
    hidePopMessage() {
        this.hidePop();
        if (this.popMessage) {
            this._updateFormContainer(this.showError ? 'error' : null, null);
        }
    }
    showPop(type, message) {
        this.hidePop();
        this.createPopover(type, message);
    }
    hidePop() {
        if (this.popoverComponentRef) {
            this.destroyPop();
        }
    }
    destroyPop() {
        if (this.popoverComponentRef) {
            this.popoverComponentRef.destroy();
            this.popoverComponentRef = null;
        }
    }
    ngOnDestroy() {
        this.destroyPop();
        this.destroy$.next();
        this.destroy$.complete();
    }
}
DFormControlRuleDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: DFormControlRuleDirective, deps: [{ token: i1$1.NgControl, self: true }, { token: FormItemComponent, host: true, optional: true }, { token: DFormGroupRuleDirective, host: true, optional: true, skipSelf: true }, { token: i2$1.I18nService }, { token: i0.ElementRef }, { token: i4.OverlayContainerRef }, { token: i0.ComponentFactoryResolver }], target: i0.ɵɵFactoryTarget.Directive });
DFormControlRuleDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.0", type: DFormControlRuleDirective, selector: "[dValidateRules][formControlName],[dValidateRules][ngModel],[dValidateRules][formControl]", inputs: { rules: ["dValidateRules", "rules"], popConfig: ["dValidatePopConfig", "popConfig"] }, outputs: { dRulesStatusChange: "dRulesStatusChange" }, host: { properties: { "class.devui-error": "dClassError", "class.devui-success": "dClassSuccess", "class.devui-warning": "dClassWarning" } }, exportAs: ["dValidateRules"], usesInheritance: true, ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: DFormControlRuleDirective, decorators: [{
            type: Directive,
            args: [{
                    selector: '[dValidateRules][formControlName],[dValidateRules][ngModel],[dValidateRules][formControl]',
                    /* eslint-disable-next-line @angular-eslint/no-host-metadata-property*/
                    host: dControlErrorStatusHost,
                    exportAs: 'dValidateRules',
                }]
        }], ctorParameters: function () { return [{ type: i1$1.NgControl, decorators: [{
                    type: Self
                }] }, { type: FormItemComponent, decorators: [{
                    type: Optional
                }, {
                    type: Host
                }] }, { type: DFormGroupRuleDirective, decorators: [{
                    type: Optional
                }, {
                    type: Host
                }, {
                    type: SkipSelf
                }] }, { type: i2$1.I18nService }, { type: i0.ElementRef }, { type: i4.OverlayContainerRef }, { type: i0.ComponentFactoryResolver }]; }, propDecorators: { rules: [{
                type: Input,
                args: ['dValidateRules']
            }], dRulesStatusChange: [{
                type: Output
            }], popConfig: [{
                type: Input,
                args: ['dValidatePopConfig']
            }] } });

var FormLayout;
(function (FormLayout) {
    FormLayout["Horizontal"] = "horizontal";
    FormLayout["Vertical"] = "vertical";
    FormLayout["Columns"] = "columns";
})(FormLayout || (FormLayout = {}));
class FormDirective {
    constructor(cd, dValidateRuleDir) {
        this.layout = FormLayout.Horizontal;
        this.labelSize = '';
        this.labelAlign = 'start';
        this.dHasFeedback = false;
        this.dSubmit = new EventEmitter();
        this._cd = cd;
        this._dValidateRuleDir = dValidateRuleDir;
    }
    get layoutHorizontal() {
        return this.layout === FormLayout.Horizontal;
    }
    get layoutVertical() {
        return this.layout === FormLayout.Vertical;
    }
    get layoutColumns() {
        return this.layout === FormLayout.Columns;
    }
    get labelSizeLg() {
        return this.labelSize === 'lg';
    }
    get labelSizeSm() {
        return this.labelSize === 'sm';
    }
    get labelAlignStart() {
        return this.labelAlign === 'start';
    }
    get labelAlignCenter() {
        return this.labelAlign === 'center';
    }
    get labelAlignEnd() {
        return this.labelAlign === 'end';
    }
    updateOnSubmit($event, data) {
        this._operateAllControl(this._cd.control, (cd) => {
            cd.markAsDirty();
            cd.updateValueAndValidity();
        });
        /* emit event should after validate */
        this._cd.control.statusChanges
            .pipe(startWith(this._cd.control.status), filter((status) => {
            return status !== 'PENDING';
        }), take(1))
            .subscribe(() => {
            if (this._cd) {
                this._cd.onSubmit($event); // TODO: 需触发原生form表单的submit方法
                if (this._dValidateRuleDir) {
                    this.dSubmit.emit({
                        valid: this._dValidateRuleDir.isReady,
                        directive: this._dValidateRuleDir,
                        data: data,
                        errors: this._getAllErrors(this._cd.control)
                    });
                }
                else {
                    this.dSubmit.emit({
                        valid: this._cd.valid,
                        directive: this._cd,
                        data: data,
                        errors: this._getAllErrors(this._cd.control)
                    });
                }
            }
            if (this.childrenCtrDirs) {
                for (const validateDir of this.childrenCtrDirs) {
                    if (validateDir.invalid && validateDir.showType === 'popover') {
                        validateDir.showPopMessage(); // TODO: 表单类组件需要实现focus方法，若无focus，将无法正常blur
                        break;
                    }
                }
            }
        });
    }
    updateOnReset() {
        if (this._cd) {
            this._cd.onReset(); // TODO: 需触发原生form表单的reset方法
        }
        this._operateAllControl(this._cd.control, (cd) => {
            cd.markAsPristine();
            cd.updateValueAndValidity();
        });
    }
    _operateAllControl(control, operatorFn) {
        if (control) {
            operatorFn(control);
            const controls = control.controls;
            if (controls) {
                for (const key of Object.keys(controls)) {
                    this._operateAllControl(controls[key], operatorFn);
                }
            }
        }
    }
    _getAllErrors(control) {
        const res = {};
        if (control) {
            res.errors = control.errors;
            const controls = control.controls;
            if (controls) {
                for (const key of Object.keys(controls)) {
                    res[key] = this._getAllErrors(controls[key]);
                }
            }
        }
        return res;
    }
}
FormDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: FormDirective, deps: [{ token: i1$1.ControlContainer, optional: true, self: true }, { token: DFormGroupRuleDirective, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Directive });
FormDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.0", type: FormDirective, selector: "[dForm]", inputs: { layout: "layout", labelSize: "labelSize", labelAlign: "labelAlign", dFeedbackType: "dFeedbackType", dHasFeedback: "dHasFeedback" }, outputs: { dSubmit: "dSubmit" }, host: { properties: { "class.devui-form-horizontal": "this.layoutHorizontal", "class.devui-form-vertical": "this.layoutVertical", "class.devui-form-columns": "this.layoutColumns", "class.devui-form-lg": "this.labelSizeLg", "class.devui-form-sm": "this.labelSizeSm", "class.devui-form-label-align-start": "this.labelAlignStart", "class.devui-form-label-align-center": "this.labelAlignCenter", "class.devui-form-label-align-end": "this.labelAlignEnd" } }, queries: [{ propertyName: "childrenCtrDirs", predicate: DFormControlRuleDirective, descendants: true }], exportAs: ["dForm"], ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: FormDirective, decorators: [{
            type: Directive,
            args: [{
                    selector: '[dForm]',
                    exportAs: 'dForm',
                }]
        }], ctorParameters: function () { return [{ type: i1$1.ControlContainer, decorators: [{
                    type: Optional
                }, {
                    type: Self
                }] }, { type: DFormGroupRuleDirective, decorators: [{
                    type: Optional
                }, {
                    type: Self
                }] }]; }, propDecorators: { layout: [{
                type: Input
            }], labelSize: [{
                type: Input
            }], labelAlign: [{
                type: Input
            }], dFeedbackType: [{
                type: Input
            }], dHasFeedback: [{
                type: Input
            }], dSubmit: [{
                type: Output
            }], childrenCtrDirs: [{
                type: ContentChildren,
                args: [DFormControlRuleDirective, { descendants: true }]
            }], layoutHorizontal: [{
                type: HostBinding,
                args: ['class.devui-form-horizontal']
            }], layoutVertical: [{
                type: HostBinding,
                args: ['class.devui-form-vertical']
            }], layoutColumns: [{
                type: HostBinding,
                args: ['class.devui-form-columns']
            }], labelSizeLg: [{
                type: HostBinding,
                args: ['class.devui-form-lg']
            }], labelSizeSm: [{
                type: HostBinding,
                args: ['class.devui-form-sm']
            }], labelAlignStart: [{
                type: HostBinding,
                args: ['class.devui-form-label-align-start']
            }], labelAlignCenter: [{
                type: HostBinding,
                args: ['class.devui-form-label-align-center']
            }], labelAlignEnd: [{
                type: HostBinding,
                args: ['class.devui-form-label-align-end']
            }] } });

class FormOperationComponent {
    constructor(elementRef, renderer) {
        renderer.addClass(elementRef.nativeElement, 'devui-form-operation');
    }
    ngOnInit() { }
}
FormOperationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: FormOperationComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
FormOperationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: FormOperationComponent, selector: "d-form-operation", ngImport: i0, template: '<ng-content></ng-content>', isInline: true, styles: [".devui-form-horizontal :host.devui-form-operation{display:block;margin-left:96px}.devui-form-vertical :host.devui-form-operation{display:block}.devui-form-columns :host.devui-form-operation{display:block;padding:8px 0}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: FormOperationComponent, decorators: [{
            type: Component,
            args: [{ selector: 'd-form-operation', template: '<ng-content></ng-content>', changeDetection: ChangeDetectionStrategy.OnPush, preserveWhitespaces: false, styles: [".devui-form-horizontal :host.devui-form-operation{display:block;margin-left:96px}.devui-form-vertical :host.devui-form-operation{display:block}.devui-form-columns :host.devui-form-operation{display:block;padding:8px 0}\n"] }]
        }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }]; } });
class DFormSubmitDirective {
    // TODO：这里是否需要接管如果所关联的表单校验不通过，切换到disabled状态
    constructor(elementRef, _dForm) {
        this.elementRef = elementRef;
        this._dForm = _dForm;
        this.default = true;
        this._eventName = 'click';
        this.destroy$ = new Subject();
    }
    set eventName(eventName) {
        if (eventName) {
            this._eventName = eventName;
            this.registerEvent();
        }
    }
    ngAfterViewInit() {
        this.registerEvent();
    }
    ngOnDestroy() {
        this.destroy$.next();
        this.destroy$.complete();
    }
    registerEvent() {
        this.destroy$.next();
        fromEvent(this.elementRef.nativeElement, this._eventName)
            .pipe(takeUntil(this.destroy$))
            .subscribe(($event) => {
            if (this._dForm) {
                this._dForm.updateOnSubmit($event, this.data);
            }
        });
    }
}
DFormSubmitDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: DFormSubmitDirective, deps: [{ token: i0.ElementRef }, { token: FormDirective, host: true, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
DFormSubmitDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.0", type: DFormSubmitDirective, selector: "[dFormSubmit]", inputs: { eventName: ["dFormSubmit", "eventName"], data: ["dFormSubmitData", "data"] }, host: { properties: { "class.devui-form-submit": "this.default" } }, ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: DFormSubmitDirective, decorators: [{
            type: Directive,
            args: [{
                    selector: '[dFormSubmit]',
                }]
        }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: FormDirective, decorators: [{
                    type: Optional
                }, {
                    type: Host
                }] }]; }, propDecorators: { default: [{
                type: HostBinding,
                args: ['class.devui-form-submit']
            }], eventName: [{
                type: Input,
                args: ['dFormSubmit']
            }], data: [{
                type: Input,
                args: ['dFormSubmitData']
            }] } });
class DFormResetDirective {
    constructor(elementRef, _dForm) {
        this.elementRef = elementRef;
        this._dForm = _dForm;
        this.default = true;
        // TODO: emit now form
        // TODO: Abstract a parent class
        this._eventName = 'click';
        this.destroy$ = new Subject();
    }
    set eventName(eventName) {
        if (eventName) {
            this._eventName = eventName;
            this.registerEvent();
        }
    }
    ngAfterViewInit() {
        this.registerEvent();
    }
    ngOnDestroy() {
        this.destroy$.next();
        this.destroy$.complete();
    }
    registerEvent() {
        this.destroy$.next();
        fromEvent(this.elementRef.nativeElement, this._eventName)
            .pipe(takeUntil(this.destroy$))
            .subscribe(() => {
            if (this._dForm) {
                this._dForm.updateOnReset();
            }
        });
    }
}
DFormResetDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: DFormResetDirective, deps: [{ token: i0.ElementRef }, { token: FormDirective, host: true, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
DFormResetDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.0", type: DFormResetDirective, selector: "[dFormReset]", inputs: { eventName: ["dFormReset", "eventName"] }, host: { properties: { "class.devui-form-reset": "this.default" } }, ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: DFormResetDirective, decorators: [{
            type: Directive,
            args: [{
                    selector: '[dFormReset]',
                }]
        }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: FormDirective, decorators: [{
                    type: Optional
                }, {
                    type: Host
                }] }]; }, propDecorators: { default: [{
                type: HostBinding,
                args: ['class.devui-form-reset']
            }], eventName: [{
                type: Input,
                args: ['dFormReset']
            }] } });

function resolvedPromiseFunc() { return Promise.resolve(null); }
const resolvedPromise = resolvedPromiseFunc();
class DValidateSyncService {
    constructor() {
        this.controlsMap = new Map();
        this.controlsSubMap = new Map();
    }
    addControl(key, cd) {
        if (!this.controlsMap.get(key)) {
            this.controlsMap.set(key, []);
        }
        this.controlsMap.get(key).push(cd);
        this._addControlSubscription(key, cd);
    }
    removeControl(key, cd) {
        if (this.controlsMap.get(key)) {
            const controls = this.controlsMap.get(key);
            const index = controls.indexOf(cd);
            if (index !== -1) {
                controls.splice(index, 1);
            }
        }
        this._removeControlSubscription(cd);
    }
    validateControlsSync(key, cd) {
        const controls = this.controlsMap.get(key);
        if (controls) {
            controls.forEach(control => {
                this._removeControlSubscription(control);
            });
            controls.forEach(control => {
                if (control !== cd) {
                    resolvedPromise.then(() => {
                        control.updateValueAndValidity();
                    });
                }
            });
            controls.forEach(control => {
                resolvedPromise.then(() => {
                    this._addControlSubscription(key, control);
                });
            });
        }
    }
    _addControlSubscription(key, cd) {
        this._removeControlSubscription(cd);
        const sub = cd.valueChanges.subscribe(() => {
            this.validateControlsSync(key, cd);
        });
        this.controlsSubMap.set(cd, sub);
    }
    _removeControlSubscription(cd) {
        if (this.controlsSubMap.get(cd)) {
            this.controlsSubMap.get(cd).unsubscribe();
            this.controlsSubMap.delete(cd);
        }
    }
}
DValidateSyncService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: DValidateSyncService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
DValidateSyncService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: DValidateSyncService, providedIn: 'root' });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: DValidateSyncService, decorators: [{
            type: Injectable,
            args: [{ providedIn: 'root' }]
        }], ctorParameters: function () { return []; } });

class DValidateSyncDirective {
    constructor(_cd, syncService) {
        this._cd = _cd;
        this.syncService = syncService;
        this._added = false;
    }
    ngOnChanges() {
        if (this.key && this._cd.control && !this._added) {
            this.syncService.addControl(this.key, this._cd.control);
            this._added = true;
        }
    }
    ngOnDestroy() {
        if (this.key && this._cd.control) {
            this.syncService.removeControl(this.key, this._cd.control);
        }
    }
}
DValidateSyncDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: DValidateSyncDirective, deps: [{ token: i1$1.NgControl, self: true }, { token: DValidateSyncService }], target: i0.ɵɵFactoryTarget.Directive });
DValidateSyncDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.0", type: DValidateSyncDirective, selector: "[dValidateSyncKey][formControlName],[dValidateSyncKey][ngModel],[dValidateSyncKey][formControl],\n    [dValidateSyncKey][formGroupName],[dValidateSyncKey][formArrayName],[dValidateSyncKey][ngModelGroup],\n    [dValidateSyncKey][formGroup],[dValidateSyncKey]form:not([ngNoForm]),[dValidateSyncKey][ngForm]\n  ", inputs: { key: ["dValidateSyncKey", "key"] }, exportAs: ["dValidateSync"], usesOnChanges: true, ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: DValidateSyncDirective, decorators: [{
            type: Directive,
            args: [{
                    selector: `[dValidateSyncKey][formControlName],[dValidateSyncKey][ngModel],[dValidateSyncKey][formControl],
    [dValidateSyncKey][formGroupName],[dValidateSyncKey][formArrayName],[dValidateSyncKey][ngModelGroup],
    [dValidateSyncKey][formGroup],[dValidateSyncKey]form:not([ngNoForm]),[dValidateSyncKey][ngForm]
  `,
                    exportAs: 'dValidateSync'
                }]
        }], ctorParameters: function () { return [{ type: i1$1.NgControl, decorators: [{
                    type: Self
                }] }, { type: DValidateSyncService }]; }, propDecorators: { key: [{
                type: Input,
                args: ['dValidateSyncKey']
            }] } });

class FormModule {
}
FormModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: FormModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
FormModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.0", ngImport: i0, type: FormModule, declarations: [FormItemComponent,
        FormLabelComponent,
        FormControlComponent,
        FormOperationComponent,
        FormDirective,
        DFormGroupRuleDirective,
        DFormControlRuleDirective,
        DFormSubmitDirective,
        DFormResetDirective,
        DValidateSyncDirective], imports: [CommonModule, ReactiveFormsModule, FormsModule, PopoverModule], exports: [FormItemComponent,
        FormLabelComponent,
        FormControlComponent,
        FormOperationComponent,
        FormDirective,
        DFormGroupRuleDirective,
        DFormControlRuleDirective,
        DFormSubmitDirective,
        DFormResetDirective,
        DValidateSyncDirective] });
FormModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: FormModule, imports: [CommonModule, ReactiveFormsModule, FormsModule, PopoverModule] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: FormModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [CommonModule, ReactiveFormsModule, FormsModule, PopoverModule],
                    exports: [
                        FormItemComponent,
                        FormLabelComponent,
                        FormControlComponent,
                        FormOperationComponent,
                        FormDirective,
                        DFormGroupRuleDirective,
                        DFormControlRuleDirective,
                        DFormSubmitDirective,
                        DFormResetDirective,
                        DValidateSyncDirective
                    ],
                    declarations: [
                        FormItemComponent,
                        FormLabelComponent,
                        FormControlComponent,
                        FormOperationComponent,
                        FormDirective,
                        DFormGroupRuleDirective,
                        DFormControlRuleDirective,
                        DFormSubmitDirective,
                        DFormResetDirective,
                        DValidateSyncDirective
                    ],
                    providers: [],
                }]
        }] });

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

export { DAbstractControlRuleDirective, DFormControlRuleDirective, DFormGroupRuleDirective, DFormResetDirective, DFormSubmitDirective, DValidateSyncDirective, DValidateSyncService, DValidators, FormControlComponent, FormDirective, FormItemComponent, FormLabelComponent, FormLayout, FormModule, FormOperationComponent, dDefaultValidators, ruleReservedWords };
//# sourceMappingURL=ng-devui-form.mjs.map
