import{p as e,H as r,c as t,h as a,d as s,t as i}from"./p-CHfEnK-2.js";import{i as o,d as l,t as p}from"./p-94ZtGp9D.js";const d=e(class extends r{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.ifxInput=t(this,"ifxInput",7),this.internals=this.attachInternals()}inputId="ifx-textarea-"+ ++h;internals;ifxInput;get el(){return this}caption;cols;disabled=!1;error=!1;label;maxlength;name;placeholder;required=!1;readOnly=!1;resize="both";rows;value;wrap="soft";fullWidth="false";async reset(){this.resetTextarea()}handleComponentWidth(){const e=this.el.shadowRoot.querySelector(".wrapper__textarea");"true"===this.fullWidth.toLowerCase()?e.classList.add("fullWidth"):e.classList.contains("fullWidth")&&e.classList.remove("fullWidth")}componentDidRender(){this.handleComponentWidth()}formResetCallback(){this.resetTextarea()}handleOnInput(e){this.value=e.target.value,this.ifxInput.emit(this.value)}resetTextarea(){this.value=""}async componentDidLoad(){if(!o(this.el)){const e=l();p("ifx-textarea",await e)}}render(){return a(s,{key:"bb5760e994c83d00aed582063c6f36ad8250f68c",class:`wrapper--${this.error?"error":""} wrapper--${this.disabled&&!this.error?"disabled":""}`},a("label",{key:"acf8813be71b292fa6510ca911638021c4a6fa6c",class:"wrapper__label",htmlFor:this.inputId},this.label?.trim(),this.required&&a("span",{key:"1841f106b4c766842c4682d164885e1b3d6919cb",class:"required "+(this.error?"error":"")},"*")),a("div",{key:"55fce236fb5a6fa432dfe236c2a1143bf1802232",class:"wrapper__textarea"},a("textarea",{key:"cb54b8271a488ae10bd1ef93537d3c5cf306f155","aria-label":"a textarea","aria-value":this.value,"aria-disabled":this.disabled&&!this.error,id:this.inputId,style:{resize:this.resize},name:this.name?this.name:this.inputId,cols:this.cols,rows:this.rows,maxlength:this.maxlength,wrap:this.wrap,disabled:this.disabled&&!this.error,readonly:this.readOnly,placeholder:this.placeholder,value:this.value,onInput:e=>this.handleOnInput(e)})),this.caption?.trim()&&a("div",{key:"e5ea69d8f3406c53c19f5277817cd74a3475c376",class:"wrapper__caption"},this.caption.trim()))}static get style(){return':host{display:flex;flex-direction:column;width:100%}.wrapper__label{color:#1D1D1D;font:400 1rem/1.5rem "Source Sans 3"}.wrapper__label .required{margin-left:4px}.wrapper__label .required.error{color:#CD002F}:host(.wrapper--disabled) .wrapper__label{color:#BFBBBB}.wrapper__textarea{width:100%}.wrapper__textarea.fullWidth{width:100%}.wrapper__textarea.fullWidth textarea{width:100%;box-sizing:border-box}.wrapper__textarea textarea{border:1px solid #8D8786;border-radius:1px;padding:8px 16px;background-color:#FFFFFF;color:#1D1D1D;font:400 1rem/1.5rem "Source Sans 3";transition:all 100ms ease;transition-property:border-color}.wrapper__textarea textarea:hover{border:1px solid #575352}.wrapper__textarea textarea:focus-within{outline:2px solid #0A8276;outline-offset:0}:host(.wrapper--error) .wrapper__textarea textarea{border:1px solid #CD002F}:host(.wrapper--disabled) .wrapper__textarea textarea{border:1px solid #BFBBBB;background-color:#BFBBBB;color:#FFFFFF}:host(.wrapper--disabled) .wrapper__textarea textarea::placeholder{color:#FFFFFF}.wrapper__caption{color:#1D1D1D;font:400 0.75rem/1rem "Source Sans 3"}:host(.wrapper--error) .wrapper__caption{color:#CD002F}:host(.wrapper--disabled) .wrapper__caption{color:#BFBBBB}'}},[513,"ifx-textarea",{caption:[1],cols:[2],disabled:[4],error:[4],label:[1],maxlength:[2],name:[1],placeholder:[1],required:[4],readOnly:[4,"read-only"],resize:[1],rows:[2],value:[1025],wrap:[1],fullWidth:[513,"full-width"],reset:[64]}]);let h=0;const c=d,n=function(){"undefined"!=typeof customElements&&["ifx-textarea"].forEach((e=>{"ifx-textarea"===e&&(customElements.get(i(e))||customElements.define(i(e),d))}))};export{c as IfxTextarea,n as defineCustomElement}