import { Component, Input } from '@angular/core';
import { TextBox } from '../../../../forms/page/widgets/textbox';
import { TextBoxInputType } from '../../../../forms/page/common/widget-enums';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@angular/material/icon";
function TextBoxWidgetViewComponent_ng_container_1_mat_icon_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "mat-icon", 15);
} }
function TextBoxWidgetViewComponent_ng_container_1_mat_icon_4_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "mat-icon", 16);
} }
function TextBoxWidgetViewComponent_ng_container_1_mat_icon_5_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "mat-icon", 17);
} }
function TextBoxWidgetViewComponent_ng_container_1_mat_icon_6_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "mat-icon", 18);
} }
function TextBoxWidgetViewComponent_ng_container_1_mat_icon_7_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "mat-icon", 19);
} }
function TextBoxWidgetViewComponent_ng_container_1_mat_icon_8_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "mat-icon", 20);
} }
function TextBoxWidgetViewComponent_ng_container_1_mat_icon_9_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "mat-icon", 15);
} }
function TextBoxWidgetViewComponent_ng_container_1_span_10_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span");
    i0.ɵɵtext(1);
    i0.ɵɵelementStart(2, "span", 21);
    i0.ɵɵtext(3, ":");
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r10 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate(ctx_r10.widget.prompt);
} }
function TextBoxWidgetViewComponent_ng_container_1_span_13_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 22);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r11 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate(ctx_r11.widget.unit);
} }
function TextBoxWidgetViewComponent_ng_container_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelementStart(1, "div", 3);
    i0.ɵɵelementContainerStart(2, 4);
    i0.ɵɵtemplate(3, TextBoxWidgetViewComponent_ng_container_1_mat_icon_3_Template, 1, 0, "mat-icon", 5);
    i0.ɵɵtemplate(4, TextBoxWidgetViewComponent_ng_container_1_mat_icon_4_Template, 1, 0, "mat-icon", 6);
    i0.ɵɵtemplate(5, TextBoxWidgetViewComponent_ng_container_1_mat_icon_5_Template, 1, 0, "mat-icon", 7);
    i0.ɵɵtemplate(6, TextBoxWidgetViewComponent_ng_container_1_mat_icon_6_Template, 1, 0, "mat-icon", 8);
    i0.ɵɵtemplate(7, TextBoxWidgetViewComponent_ng_container_1_mat_icon_7_Template, 1, 0, "mat-icon", 9);
    i0.ɵɵtemplate(8, TextBoxWidgetViewComponent_ng_container_1_mat_icon_8_Template, 1, 0, "mat-icon", 10);
    i0.ɵɵtemplate(9, TextBoxWidgetViewComponent_ng_container_1_mat_icon_9_Template, 1, 0, "mat-icon", 11);
    i0.ɵɵelementContainerEnd();
    i0.ɵɵtemplate(10, TextBoxWidgetViewComponent_ng_container_1_span_10_Template, 4, 1, "span", 12);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(11, "div", 13);
    i0.ɵɵtext(12);
    i0.ɵɵtemplate(13, TextBoxWidgetViewComponent_ng_container_1_span_13_Template, 2, 1, "span", 14);
    i0.ɵɵelementEnd();
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngSwitch", ctx_r0.widget.inputType);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngSwitchCase", ctx_r0.inputType.text);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngSwitchCase", ctx_r0.inputType.number);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngSwitchCase", ctx_r0.inputType.decimal);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngSwitchCase", ctx_r0.inputType.email);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngSwitchCase", ctx_r0.inputType.address);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngSwitchCase", ctx_r0.inputType.phone);
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngIf", ctx_r0.section.showPrompt);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate1(" ", ctx_r0.widgetValue, " ");
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", (ctx_r0.widget.subType === "numeric" || ctx_r0.widget.subType === "decimal") && ctx_r0.widget.unit);
} }
function TextBoxWidgetViewComponent_ng_template_2_span_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span");
    i0.ɵɵtext(1);
    i0.ɵɵelementStart(2, "span", 21);
    i0.ɵɵtext(3, ":");
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r12 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate(ctx_r12.widget.prompt);
} }
function TextBoxWidgetViewComponent_ng_template_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 3);
    i0.ɵɵelement(1, "mat-icon", 15);
    i0.ɵɵtemplate(2, TextBoxWidgetViewComponent_ng_template_2_span_2_Template, 4, 1, "span", 12);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(3, "span", 23);
    i0.ɵɵtext(4, "-");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r2 = i0.ɵɵnextContext();
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngIf", ctx_r2.section.showPrompt);
} }
export class TextBoxWidgetViewComponent {
    constructor() {
        this.inputType = Object.assign({}, TextBoxInputType);
    }
    ngOnInit() {
        this.widgetValue = this.widget.value.toString();
        if (this.widget.inputType == TextBoxInputType.email && this.widget.allowMultipleEmails) {
            this.widgetValue = (this.widget.value.toString().split(',').join(', ')).trim();
        }
    }
}
TextBoxWidgetViewComponent.ɵfac = function TextBoxWidgetViewComponent_Factory(t) { return new (t || TextBoxWidgetViewComponent)(); };
TextBoxWidgetViewComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: TextBoxWidgetViewComponent, selectors: [["lib-text-box-widget-view"]], inputs: { widget: "widget" }, decls: 4, vars: 2, consts: [[1, "data-detail-info"], [4, "ngIf", "ngIfElse"], ["isWidgetValueEmpty", ""], [1, "data-detail-title", "flex", "text-sm"], [3, "ngSwitch"], ["class", "add-text", "svgIcon", "axo_text", 4, "ngSwitchCase"], ["class", "add-text", "svgIcon", "axo_number", 4, "ngSwitchCase"], ["class", "add-text", "svgIcon", "axo_decimal", 4, "ngSwitchCase"], ["class", "add-text", "svgIcon", "axo_email", 4, "ngSwitchCase"], ["class", "add-text", "svgIcon", "axo_address", 4, "ngSwitchCase"], ["class", "add-text", "svgIcon", "axo_phone", 4, "ngSwitchCase"], ["class", "add-text", "svgIcon", "axo_text", 4, "ngSwitchDefault"], [4, "ngIf"], [1, "data-detail-text", "text-sm"], ["class", "pl-1", 4, "ngIf"], ["svgIcon", "axo_text", 1, "add-text"], ["svgIcon", "axo_number", 1, "add-text"], ["svgIcon", "axo_decimal", 1, "add-text"], ["svgIcon", "axo_email", 1, "add-text"], ["svgIcon", "axo_address", 1, "add-text"], ["svgIcon", "axo_phone", 1, "add-text"], [1, "colon"], [1, "pl-1"], [1, "flex", "justify-start"]], template: function TextBoxWidgetViewComponent_Template(rf, ctx) { if (rf & 1) {
        i0.ɵɵelementStart(0, "div", 0);
        i0.ɵɵtemplate(1, TextBoxWidgetViewComponent_ng_container_1_Template, 14, 10, "ng-container", 1);
        i0.ɵɵtemplate(2, TextBoxWidgetViewComponent_ng_template_2_Template, 5, 1, "ng-template", null, 2, i0.ɵɵtemplateRefExtractor);
        i0.ɵɵelementEnd();
    } if (rf & 2) {
        const _r1 = i0.ɵɵreference(3);
        i0.ɵɵadvance(1);
        i0.ɵɵproperty("ngIf", ctx.widget.value)("ngIfElse", _r1);
    } }, directives: [i1.NgIf, i1.NgSwitch, i1.NgSwitchCase, i1.NgSwitchDefault, i2.MatIcon], styles: [""] });
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TextBoxWidgetViewComponent, [{
        type: Component,
        args: [{ selector: 'lib-text-box-widget-view', template: "\n    <div class=\"data-detail-info\">\n        <ng-container *ngIf=\"widget.value; else isWidgetValueEmpty\" >\n            <div class=\"data-detail-title flex text-sm\">\n                <ng-container [ngSwitch]=\"widget.inputType\">\n                    <mat-icon  *ngSwitchCase=inputType.text class=\"add-text\" svgIcon=\"axo_text\"></mat-icon>\n                    <mat-icon  *ngSwitchCase=inputType.number class=\"add-text\" svgIcon=\"axo_number\"></mat-icon>  \n                    <mat-icon  *ngSwitchCase=inputType.decimal class=\"add-text\" svgIcon=\"axo_decimal\"></mat-icon>\n                    <mat-icon  *ngSwitchCase=inputType.email class=\"add-text\" svgIcon=\"axo_email\"></mat-icon>  \n                    <mat-icon  *ngSwitchCase=inputType.address class=\"add-text\" svgIcon=\"axo_address\"></mat-icon>\n                    <mat-icon  *ngSwitchCase=inputType.phone class=\"add-text\" svgIcon=\"axo_phone\"></mat-icon>  \n                    <mat-icon *ngSwitchDefault class=\"add-text\" svgIcon=\"axo_text\"></mat-icon> \n                </ng-container><span *ngIf=\"section.showPrompt\">{{widget.prompt}}<span class=\"colon\">:</span></span>\n            </div>\n            <div class=\"data-detail-text text-sm\"> {{widgetValue}}\n                <span class=\"pl-1\" *ngIf=\" (widget.subType==='numeric' || widget.subType==='decimal') && widget.unit\">{{widget.unit}}</span>\n            </div>\n            \n        </ng-container>\n        <ng-template #isWidgetValueEmpty>\n            <div class=\"data-detail-title flex text-sm\">\n                <mat-icon class=\"add-text\" svgIcon=\"axo_text\"></mat-icon> \n                <span *ngIf=\"section.showPrompt\">{{widget.prompt}}<span class=\"colon\">:</span></span>\n            </div>\n            <span class=\"flex justify-start\">-</span>\n\n        </ng-template>\n    </div>\n\n", styles: [""] }]
    }], function () { return []; }, { widget: [{
            type: Input
        }] }); })();
//# sourceMappingURL=data:application/json;base64, 