var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
import { Component, Input } from '@angular/core';
import { CaseField } from '../../../domain/definition/case-field.model';
var FieldReadLabelComponent = /** @class */ (function () {
    function FieldReadLabelComponent() {
    }
    FieldReadLabelComponent.prototype.isLabel = function () {
        return this.caseField.field_type && this.caseField.field_type.type === 'Label';
    };
    FieldReadLabelComponent.prototype.isComplex = function () {
        return this.caseField.field_type && this.caseField.field_type.type === 'Complex';
    };
    FieldReadLabelComponent.prototype.isCaseLink = function () {
        return this.isComplex()
            && this.caseField.field_type.id === 'CaseLink'
            && this.caseField.field_type.complex_fields.some(function (cf) { return cf.id === 'CaseReference'; });
    };
    __decorate([
        Input(),
        __metadata("design:type", CaseField)
    ], FieldReadLabelComponent.prototype, "caseField", void 0);
    __decorate([
        Input(),
        __metadata("design:type", Boolean)
    ], FieldReadLabelComponent.prototype, "withLabel", void 0);
    FieldReadLabelComponent = __decorate([
        Component({
            selector: 'ccd-field-read-label',
            template: "\n    <dl class=\"case-field\" *ngIf=\"withLabel && !isLabel() && (!isComplex() || isCaseLink()); else caseFieldValue\">\n      <dt class=\"case-field__label\">{{caseField.label}}</dt>\n      <dd class=\"case-field__value\">\n        <ng-container *ngTemplateOutlet=\"caseFieldValue\"></ng-container>\n      </dd>\n    </dl>\n    <ng-template #caseFieldValue><ng-content></ng-content></ng-template>\n  ",
            styles: ["\n    .case-field:after{content:\"\";display:block;clear:both}.case-field{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin-bottom:15px}@media (min-width: 641px){.case-field{margin-bottom:30px}}.case-field .case-field__label{display:block;color:#0b0c0c;padding-bottom:2px;font-family:\"nta\",Arial,sans-serif;font-weight:700;text-transform:none;font-size:16px;line-height:1.25}@media (min-width: 641px){.case-field .case-field__label{font-size:19px;line-height:1.31579}}.case-field .case-field__value{font-family:\"nta\",Arial,sans-serif;font-weight:400;text-transform:none;font-size:16px;line-height:1.25}@media (min-width: 641px){.case-field .case-field__value{font-size:19px;line-height:1.31579}}\n  "]
        })
    ], FieldReadLabelComponent);
    return FieldReadLabelComponent;
}());
export { FieldReadLabelComponent };
//# sourceMappingURL=field-read-label.component.js.map