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 */ EclFormLabelComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: EclFormLabelComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
/** @nocollapse */ EclFormLabelComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.6", 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", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
__decorate([
    coerceBoolean,
    __metadata("design:type", Object)
], EclFormLabelComponent.prototype, "isOptional", void 0);
__decorate([
    coerceBoolean,
    __metadata("design:type", Object)
], EclFormLabelComponent.prototype, "isInvalid", void 0);
__decorate([
    coerceBoolean,
    __metadata("design:type", Object)
], EclFormLabelComponent.prototype, "isDisabled", void 0);
__decorate([
    coerceBoolean,
    __metadata("design:type", Object)
], EclFormLabelComponent.prototype, "isRequired", void 0);
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", 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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZWNsLWZvcm0tbGFiZWwuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vc3JjL2xpYi9jb21wb25lbnRzL2VjbC1mb3JtLWxhYmVsL2VjbC1mb3JtLWxhYmVsLmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uLy4uL3NyYy9saWIvY29tcG9uZW50cy9lY2wtZm9ybS1sYWJlbC9lY2wtZm9ybS1sYWJlbC5jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsT0FBTyxFQUFFLHVCQUF1QixFQUFFLFNBQVMsRUFBRSxXQUFXLEVBQUUsS0FBSyxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQ3ZGLE9BQU8sRUFBRSxhQUFhLEVBQUUsTUFBTSxXQUFXLENBQUM7QUFDMUMsT0FBTyxFQUFFLGdCQUFnQixFQUFFLE1BQU0sdUJBQXVCLENBQUM7Ozs7QUFP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