import { UiElement } from "./ui-element";

export class TextAreaInput extends UiElement {
    constructor(
        private label: string,
        private elementId: string,
        private value: any,
        private containerId: string,
        private disabled: string,
        private hidden: string,
        private required: string) {
        super(elementId, containerId, '');
        this.createElement(this.getTemplate());

    }

    public getTemplate() {
        let requiredClass: string = "";
        if (this.required == 'Y')
            requiredClass = "requiredClass"
        if (this.disabled == "N") { this.disabled = "disabled" } else { this.disabled = "" }
        if (this.hidden == "N") { this.hidden = "display:none;" } else { this.hidden = "" }
        const template =
            // "<div class='custom-text-area-element' style='" + this.hidden + "' >" +
            // "<label   class='daynamicForm-Label " + requiredClass + "' id='title' >" + this.label + "</label>" +
            // "<textarea class='daynamicForm-Input' id='" + this.elementId + "' " + this.disabled + " >" + this.value + "</textarea>" +
            // "</div> ";

            "<ion-item style='" + this.hidden + "' >" +
            "<ion-label style='font-size: medium !important;' id='title' >" + this.label + "</ion-label>" +
            "<ion-textarea id='" + this.elementId + "' " + this.disabled + " >" + this.value + "</ion-textarea>" +
            "</ion-item>";

        return template;
    }

}