import { Component, Input, ViewEncapsulation } from '@angular/core';
import { TextBoxInputType } from '../../../../forms/page/common/widget-enums';
import { TextBox } from '../../../../forms/page/widgets/textbox';
import * as i0 from "@angular/core";
import * as i1 from "@angular/material/tooltip";
import * as i2 from "@angular/common";
function FormObjectTextBoxValueComponent_span_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 3);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate(ctx_r0.widgetProperties.unit);
} }
export class FormObjectTextBoxValueComponent {
    constructor() { }
    ngOnInit() {
        this.widgetValue = this.widget.value.toString();
        if (this.widgetProperties.inputType == TextBoxInputType.email && this.widgetProperties.allowMultipleEmails) {
            this.widgetValue = (this.widget.value.toString().split(',').join(', ')).trim();
        }
    }
}
FormObjectTextBoxValueComponent.ɵfac = function FormObjectTextBoxValueComponent_Factory(t) { return new (t || FormObjectTextBoxValueComponent)(); };
FormObjectTextBoxValueComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: FormObjectTextBoxValueComponent, selectors: [["formobject-textbox-value"]], inputs: { widget: "widget", widgetProperties: "widgetProperties" }, decls: 4, vars: 3, consts: [[1, "textBox-container"], [3, "matTooltip"], ["class", "pl-1", 4, "ngIf"], [1, "pl-1"]], template: function FormObjectTextBoxValueComponent_Template(rf, ctx) { if (rf & 1) {
        i0.ɵɵelementStart(0, "div", 0);
        i0.ɵɵelementStart(1, "span", 1);
        i0.ɵɵtext(2);
        i0.ɵɵelementEnd();
        i0.ɵɵtemplate(3, FormObjectTextBoxValueComponent_span_3_Template, 2, 1, "span", 2);
        i0.ɵɵelementEnd();
    } if (rf & 2) {
        i0.ɵɵadvance(1);
        i0.ɵɵproperty("matTooltip", ctx.widgetValue);
        i0.ɵɵadvance(1);
        i0.ɵɵtextInterpolate(ctx.widgetValue);
        i0.ɵɵadvance(1);
        i0.ɵɵproperty("ngIf", ctx.widget.value && (ctx.widget.subType === "numeric" || ctx.widget.subType === "decimal") && ctx.widgetProperties.unit);
    } }, directives: [i1.MatTooltip, i2.NgIf], styles: ["formobject-textbox-value{max-width:18.75rem;min-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:20px;display:block!important}formobject-textbox-value .textBox-container{max-width:18.75rem;min-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:20px;display:block!important}\n"], encapsulation: 2 });
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FormObjectTextBoxValueComponent, [{
        type: Component,
        args: [{ selector: 'formobject-textbox-value', encapsulation: ViewEncapsulation.None, template: "<div class=\"textBox-container\">\n    <span [matTooltip]=\"widgetValue\">{{widgetValue}}</span>\n    <span class=\"pl-1\" *ngIf=\"widget.value && (widget.subType==='numeric' || widget.subType==='decimal') && widgetProperties.unit \">{{widgetProperties.unit}}</span>\n</div>", styles: ["formobject-textbox-value{max-width:18.75rem;min-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:20px;display:block!important}formobject-textbox-value .textBox-container{max-width:18.75rem;min-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:20px;display:block!important}\n"] }]
    }], function () { return []; }, { widget: [{
            type: Input
        }], widgetProperties: [{
            type: Input
        }] }); })();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9ybW9iamVjdC10ZXh0Ym94LXZhbHVlLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3NyYy9heC1jb21tb24tdWktbGliL3NyYy9saWIvZm9ybS1vYmplY3QvZm9ybS1vYmplY3QtbGlzdC9mb3JtT2JqZWN0V2lkZ2V0VmFsdWUvZm9ybW9iamVjdC10ZXh0Ym94LXZhbHVlL2Zvcm1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