import { Component, Input } from '@angular/core';
import { TimeStamp } from '../../../../forms/page/widgets/timestamp';
import { AxoUtils } from '../../../../../lib/axo-utils/axo-utils';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@angular/material/icon";
function TimeStampWidgetViewComponent_ng_container_1_span_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span");
    i0.ɵɵtext(1);
    i0.ɵɵelementStart(2, "span", 7);
    i0.ɵɵtext(3, ":");
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r3 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate(ctx_r3.widget.prompt);
} }
function TimeStampWidgetViewComponent_ng_container_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelementStart(1, "div", 3);
    i0.ɵɵelement(2, "mat-icon", 4);
    i0.ɵɵtemplate(3, TimeStampWidgetViewComponent_ng_container_1_span_3_Template, 4, 1, "span", 5);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(4, "div", 6);
    i0.ɵɵtext(5);
    i0.ɵɵelementEnd();
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance(3);
    i0.ɵɵproperty("ngIf", ctx_r0.section.showPrompt);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate1(" ", ctx_r0.widgetValue, "");
} }
function TimeStampWidgetViewComponent_ng_template_2_span_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span");
    i0.ɵɵtext(1);
    i0.ɵɵelementStart(2, "span", 7);
    i0.ɵɵtext(3, ":");
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r4 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate(ctx_r4.widget.prompt);
} }
function TimeStampWidgetViewComponent_ng_template_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 3);
    i0.ɵɵelement(1, "mat-icon", 4);
    i0.ɵɵtemplate(2, TimeStampWidgetViewComponent_ng_template_2_span_2_Template, 4, 1, "span", 5);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(3, "span", 8);
    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 TimeStampWidgetViewComponent {
    constructor() { }
    ngOnInit() {
        this.widgetValue = this.widget.value;
        this.CheckFormatAndChangeValue();
    }
    CheckFormatAndChangeValue() {
        if (this.widget.displayDateFormat != "") {
            this.widgetValue = AxoUtils.formatDateToCustomDateFormat(this.widget.value, this.widgetProperties.displayDateFormat);
        }
        else {
            this.widgetValue = this.widget.value;
        }
    }
}
TimeStampWidgetViewComponent.ɵfac = function TimeStampWidgetViewComponent_Factory(t) { return new (t || TimeStampWidgetViewComponent)(); };
TimeStampWidgetViewComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: TimeStampWidgetViewComponent, selectors: [["lib-time-stamp-widget-view"]], inputs: { widget: "widget", widgetProperties: "widgetProperties" }, decls: 4, vars: 2, consts: [[1, "data-detail-info"], [4, "ngIf", "ngIfElse"], ["isWidgetValueEmpty", ""], [1, "data-detail-title", "flex", "text-sm"], ["svgIcon", "axo_datetime", 1, "add-text"], [4, "ngIf"], [1, "data-detail-text", "text-sm"], [1, "colon"], [1, "flex", "justify-start"]], template: function TimeStampWidgetViewComponent_Template(rf, ctx) { if (rf & 1) {
        i0.ɵɵelementStart(0, "div", 0);
        i0.ɵɵtemplate(1, TimeStampWidgetViewComponent_ng_container_1_Template, 6, 2, "ng-container", 1);
        i0.ɵɵtemplate(2, TimeStampWidgetViewComponent_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, i2.MatIcon], styles: [""] });
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TimeStampWidgetViewComponent, [{
        type: Component,
        args: [{ selector: 'lib-time-stamp-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\"><mat-icon class=\"add-text\" svgIcon=\"axo_datetime\"></mat-icon> <span *ngIf=\"section.showPrompt\">{{widget.prompt}}<span class=\"colon\">:</span></span>\n      </div>\n      <div class=\"data-detail-text text-sm\" > {{widgetValue}}</div>\n    </ng-container>\n    <ng-template #isWidgetValueEmpty>\n        <div class=\"data-detail-title flex text-sm\">\n            <mat-icon class=\"add-text\" svgIcon=\"axo_datetime\"></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
        }], widgetProperties: [{
            type: Input
        }] }); })();
//# sourceMappingURL=data:application/json;base64, 