import { Component, Input, forwardRef } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ComponentMapperComponent } from '../../../_bridge/component-mapper/component-mapper.component';
import * as i0 from "@angular/core";
import * as i1 from "../../../_helpers/utils";
import * as i2 from "@angular/common";
export class MaterialDetailsFieldsComponent {
    constructor(utils) {
        this.utils = utils;
    }
    _getValue(configValue) {
        if (configValue && configValue != '') {
            return configValue;
        }
        return '---';
    }
    _formatDate(dateValue, dateFormat) {
        return this.utils.generateDate(dateValue, dateFormat);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MaterialDetailsFieldsComponent, deps: [{ token: i1.Utils }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: MaterialDetailsFieldsComponent, isStandalone: true, selector: "app-material-details-fields", inputs: { arFields$: "arFields$", arHighlightedFields: "arHighlightedFields" }, ngImport: i0, template: "<div id=\"details-fields-list\">\n  <div *ngFor=\"let field of arFields$\">\n    <div *ngIf=\"field.type === 'group'; else noGroup\">\n      <component-mapper name=\"Group\" [props]=\"{ pConn$: field.pConn }\"></component-mapper>\n    </div>\n    <ng-template #noGroup>\n      <div *ngIf=\"field.type === 'reference'; else showDetails\">\n        <component-mapper name=\"View\" [props]=\"{ pConn$: field.pConn }\"></component-mapper>\n      </div>\n    </ng-template>\n\n    <ng-template #showDetails>\n      <div class=\"psdk-grid-filter\" *ngIf=\"field.config.label\">\n        <div class=\"psdk-details-fields-label\">\n          {{ field.config.label }}\n        </div>\n        <div [ngSwitch]=\"field.type.toLowerCase()\" class=\"psdk-csf-primary-field-value\">\n          <span *ngSwitchCase=\"'textinput'\" class=\"psdk-details-text-style\">{{ _getValue(field.config.value) }}</span>\n          <span *ngSwitchCase=\"'status'\" class=\"psdk-details-status-style\">{{ _getValue(field.config.value) }}</span>\n          <a *ngSwitchCase=\"'phone'\" as=\"a\" href=\"tel: {{ field.config.value }}\">{{ _getValue(field.config.value) }}</a>\n          <a *ngSwitchCase=\"'email'\" href=\"mailto: {{ field.config.value }}\">{{ _getValue(field.config.value) }}</a>\n          <span *ngSwitchCase=\"'date'\" class=\"psdk-details-text-style\">{{ _formatDate(field.config.value, field.type) }}</span>\n          <span *ngSwitchCase=\"'caseoperator'\"></span>\n          <span *ngSwitchDefault>{{ _getValue(field.config.value) }}</span>\n        </div>\n      </div>\n    </ng-template>\n  </div>\n</div>\n", styles: [".psdk-details-fields-label{color:var(--app-label-color);margin:8px 0}span.psdk-details-text-style-hf{font-weight:700}span.psdk-details-status-style-hf{background-color:var(--app-details-status-background);border-radius:.125rem;color:var(--app-details-status-color);display:inline-block;font-size:.75rem;font-weight:700;line-height:1.25rem;height:1.25rem;padding:0 .5rem;text-transform:uppercase}.psdk-grid-filter{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:1rem;row-gap:1rem;align-items:start}.psdk-csf-primary-field-value{margin:8px 0}\n"], dependencies: [{ kind: "ngmodule", type: i0.forwardRef(function () { return CommonModule; }) }, { kind: "directive", type: i0.forwardRef(function () { return i2.NgForOf; }), selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i0.forwardRef(function () { return i2.NgIf; }), selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i0.forwardRef(function () { return i2.NgSwitch; }), selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i0.forwardRef(function () { return i2.NgSwitchCase; }), selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i0.forwardRef(function () { return i2.NgSwitchDefault; }), selector: "[ngSwitchDefault]" }, { kind: "component", type: i0.forwardRef(function () { return ComponentMapperComponent; }), selector: "component-mapper", inputs: ["name", "props", "errorMsg", "outputEvents", "parent"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MaterialDetailsFieldsComponent, decorators: [{
            type: Component,
            args: [{ selector: 'app-material-details-fields', standalone: true, imports: [CommonModule, forwardRef(() => ComponentMapperComponent)], template: "<div id=\"details-fields-list\">\n  <div *ngFor=\"let field of arFields$\">\n    <div *ngIf=\"field.type === 'group'; else noGroup\">\n      <component-mapper name=\"Group\" [props]=\"{ pConn$: field.pConn }\"></component-mapper>\n    </div>\n    <ng-template #noGroup>\n      <div *ngIf=\"field.type === 'reference'; else showDetails\">\n        <component-mapper name=\"View\" [props]=\"{ pConn$: field.pConn }\"></component-mapper>\n      </div>\n    </ng-template>\n\n    <ng-template #showDetails>\n      <div class=\"psdk-grid-filter\" *ngIf=\"field.config.label\">\n        <div class=\"psdk-details-fields-label\">\n          {{ field.config.label }}\n        </div>\n        <div [ngSwitch]=\"field.type.toLowerCase()\" class=\"psdk-csf-primary-field-value\">\n          <span *ngSwitchCase=\"'textinput'\" class=\"psdk-details-text-style\">{{ _getValue(field.config.value) }}</span>\n          <span *ngSwitchCase=\"'status'\" class=\"psdk-details-status-style\">{{ _getValue(field.config.value) }}</span>\n          <a *ngSwitchCase=\"'phone'\" as=\"a\" href=\"tel: {{ field.config.value }}\">{{ _getValue(field.config.value) }}</a>\n          <a *ngSwitchCase=\"'email'\" href=\"mailto: {{ field.config.value }}\">{{ _getValue(field.config.value) }}</a>\n          <span *ngSwitchCase=\"'date'\" class=\"psdk-details-text-style\">{{ _formatDate(field.config.value, field.type) }}</span>\n          <span *ngSwitchCase=\"'caseoperator'\"></span>\n          <span *ngSwitchDefault>{{ _getValue(field.config.value) }}</span>\n        </div>\n      </div>\n    </ng-template>\n  </div>\n</div>\n", styles: [".psdk-details-fields-label{color:var(--app-label-color);margin:8px 0}span.psdk-details-text-style-hf{font-weight:700}span.psdk-details-status-style-hf{background-color:var(--app-details-status-background);border-radius:.125rem;color:var(--app-details-status-color);display:inline-block;font-size:.75rem;font-weight:700;line-height:1.25rem;height:1.25rem;padding:0 .5rem;text-transform:uppercase}.psdk-grid-filter{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:1rem;row-gap:1rem;align-items:start}.psdk-csf-primary-field-value{margin:8px 0}\n"] }]
        }], ctorParameters: function () { return [{ type: i1.Utils }]; }, propDecorators: { arFields$: [{
                type: Input
            }], arHighlightedFields: [{
                type: Input
            }] } });
//# sourceMappingURL=data:application/json;base64, 