import{r as e,c as r,h as a,d as t,a as s}from"./p-PqnYwNKt.js";import{d as i,t as o}from"./p-DcmcuUOA.js";import{i as l}from"./p-Bw2fh5LT.js";const p=':root{--ifx-font-family:"Source Sans 3", "Arial, sans-serif"}: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:none;border:1px solid #0A8276}:host(.wrapper--error) .wrapper__textarea textarea{border:1px solid #CD002F}:host(.wrapper--disabled) .wrapper__textarea textarea{border:1px solid #BFBBBB;background-color:#BFBBBB}: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}';const d=class{constructor(a){e(this,a);this.ifxInput=r(this,"ifxInput",7);if(a.$hostElement$["s-ei"]){this.internals=a.$hostElement$["s-ei"]}else{this.internals=a.$hostElement$.attachInternals();a.$hostElement$["s-ei"]=this.internals}this.inputId=`ifx-textarea-${++h}`;this.disabled=false;this.error=false;this.required=false;this.readOnly=false;this.resize="both";this.wrap="soft";this.fullWidth="false"}async reset(){this.resetTextarea()}handleComponentWidth(){const e=this.el.shadowRoot.querySelector(".wrapper__textarea");const r=this.fullWidth.toLowerCase()==="true";if(r){e.classList.add("fullWidth")}else if(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(!l(this.el)){const e=i();o("ifx-textarea",await e)}}render(){var e,r;return a(t,{key:"055c3e037749474ec903638d4df4597e7de5d970",class:`wrapper--${this.error?"error":""} wrapper--${this.disabled?"disabled":""}`},a("label",{key:"9c114475eae54984bb2108b2760fd99ef7481c7e",class:"wrapper__label",htmlFor:this.inputId},(e=this.label)===null||e===void 0?void 0:e.trim(),this.required&&a("span",{key:"4057ed36b807e29f932f6583536782cc0238a09a",class:`required ${this.error?"error":""}`},"*")),a("div",{key:"9c3e191464fab7d530ba6990ba8c73ff1caf1dff",class:"wrapper__textarea"},a("textarea",{key:"f282d6e8229a0d368829e1c2fe44a4560346fe20","aria-label":"a textarea","aria-value":this.value,"aria-disabled":this.disabled,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,readonly:this.readOnly,placeholder:this.placeholder,value:this.value,onInput:e=>this.handleOnInput(e)})),((r=this.caption)===null||r===void 0?void 0:r.trim())&&a("div",{key:"2fb43deb70bd85271fe74f5007c69e7dc5cda347",class:"wrapper__caption"},this.caption.trim()))}get el(){return s(this)}};let h=0;d.style=p;export{d as ifx_textarea};
//# sourceMappingURL=p-a9185e7f.entry.js.map