import { __decorate, __metadata } from "tslib";
import { ChangeDetectionStrategy, Component, HostBinding, Input } from '@angular/core';
import { coerceBoolean } from '@eui/base';
import { ECLBaseDirective } from '../ecl-base.directive';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@ngx-translate/core";
export class EclFormLabelComponent extends ECLBaseDirective {
    constructor() {
        super(...arguments);
        this.isOptional = false;
        this.isInvalid = false;
        this.isDisabled = false;
        this.isRequired = false;
    }
    get cssClasses() {
        return [
            super.getCssClasses('ecl-form-label'),
            this.isInvalid ? 'ecl-form-label--invalid' : '',
            this.isDisabled ? 'ecl-form-label--disabled' : '',
        ].join(' ').trim();
    }
}
/** @nocollapse */ /** @nocollapse */ EclFormLabelComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.0", ngImport: i0, type: EclFormLabelComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
/** @nocollapse */ /** @nocollapse */ EclFormLabelComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.0", type: EclFormLabelComponent, selector: "[eclFormLabel]", inputs: { isOptional: "isOptional", isInvalid: "isInvalid", isDisabled: "isDisabled", isRequired: "isRequired" }, host: { properties: { "class": "this.cssClasses" } }, usesInheritance: true, ngImport: i0, template: "<ng-content></ng-content>\n<span *ngIf=\"isOptional\" class=\"ecl-form-label__optional\"> ({{ 'ecl.form-label.OPTIONAL' | translate }})</span>\n<span *ngIf=\"isRequired\" class=\"ecl-form-label__required\">*</span>\n", directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "translate": i2.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
__decorate([
    coerceBoolean,
    __metadata("design:type", Boolean)
], EclFormLabelComponent.prototype, "isOptional", void 0);
__decorate([
    coerceBoolean,
    __metadata("design:type", Boolean)
], EclFormLabelComponent.prototype, "isInvalid", void 0);
__decorate([
    coerceBoolean,
    __metadata("design:type", Boolean)
], EclFormLabelComponent.prototype, "isDisabled", void 0);
__decorate([
    coerceBoolean,
    __metadata("design:type", Boolean)
], EclFormLabelComponent.prototype, "isRequired", void 0);
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0", ngImport: i0, type: EclFormLabelComponent, decorators: [{
            type: Component,
            args: [{ selector: '[eclFormLabel]', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>\n<span *ngIf=\"isOptional\" class=\"ecl-form-label__optional\"> ({{ 'ecl.form-label.OPTIONAL' | translate }})</span>\n<span *ngIf=\"isRequired\" class=\"ecl-form-label__required\">*</span>\n" }]
        }], propDecorators: { isOptional: [{
                type: Input
            }], isInvalid: [{
                type: Input
            }], isDisabled: [{
                type: Input
            }], isRequired: [{
                type: Input
            }], cssClasses: [{
                type: HostBinding,
                args: ['class']
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZWNsLWZvcm0tbGFiZWwuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vc3JjL2xpYi9jb21wb25lbnRzL2VjbC1mb3JtLWxhYmVsL2VjbC1mb3JtLWxhYmVsLmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uLy4uL3NyYy9saWIvY29tcG9uZW50cy9lY2wtZm9ybS1sYWJlbC9lY2wtZm9ybS1sYWJlbC5jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsT0FBTyxFQUFFLHVCQUF1QixFQUFFLFNBQVMsRUFBRSxXQUFXLEVBQUUsS0FBSyxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQ3ZGLE9BQU8sRUFBRSxhQUFhLEVBQUUsTUFBTSxXQUFXLENBQUM7QUFDMUMsT0FBTyxFQUFFLGdCQUFnQixFQUFFLE1BQU0sdUJBQXVCLENBQUM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