import{r as t,c as e,h as s,H as a,g as i}from"./p-CV0Pyo1O.js";import{w as o,x as h,q as r,u as l,v as c}from"./p-CPKMvyV_.js";import{F as f}from"./p-Ce_W43gc.js";import"./p-CZfYo5-1.js";const n=class{constructor(s){t(this,s),this.formControlInput=e(this,"formControlInput",7),this.formControlBlur=e(this,"formControlBlur",7),this.isFocused=!1,this.handleFormControlInput=t=>{const e=t.target,s=e.getAttribute("name");this.inputHandler(s,e.value),this.formControlInput.emit(e.value)},this.updateInput=t=>{this.selectElement.value=t}}handleDefaultValueChange(t){this.updateInput(t)}componentDidLoad(){this.updateInput(this.defaultValue)}get part(){let t=o;return this.errorText&&(t=r),this.disabled&&(t=l),this.isFocused&&(t=c),t}render(){var t;return s(a,{key:"bf6556107b1f272aa6bc4f89cb0f2a889f8b9d1d"},s("div",{key:"be1644d78987676c9af452831e25c3effc31a67c",class:"form-group d-flex flex-column"},s("div",{key:"62eaea4bdbee959d6e785c00c4f41f642c0a16af",class:"d-flex align-items-start gap-2"},s("label",{key:"641ada798c78ca0c649ec76029c157069636838b",part:h,class:"form-label",htmlFor:this.name},this.label),s("form-control-tooltip",{key:"3a04fe21799a54e402e8afead34b60898c804af4",helpText:this.helpText})),s("select",{key:"54188864be36aed540647275cd84eae738eb633f",ref:t=>this.selectElement=t,id:this.name,name:this.name,onFocus:()=>this.isFocused=!0,onBlur:()=>{this.isFocused=!1,this.formControlBlur.emit()},onInput:this.handleFormControlInput,part:this.part,class:this.errorText?"form-select is-invalid":"form-select",disabled:this.disabled},null===(t=this.options)||void 0===t?void 0:t.map((t=>s("option",{value:t.value},t.label)))),s(f,{key:"387753bf79494f44a91858175af74d48a9e9c051",errorText:this.errorText,name:this.name})))}static get watchers(){return{defaultValue:["handleDefaultValueChange"]}}},d=class{constructor(s){t(this,s),this.formControlInput=e(this,"formControlInput",7),this.formControlBlur=e(this,"formControlBlur",7),this.isFocused=!1,this.handleFormControlInput=t=>{const e=t.target,s=e.getAttribute("name");this.inputHandler(s,e.value),this.formControlInput.emit({name:s,value:e.value})},this.updateInput=t=>{const e=this.el.querySelector("input");e&&(e.value=t||"")}}handleDefaultValueChange(t){this.updateInput(t)}componentDidLoad(){this.updateInput(this.defaultValue)}get part(){return this.errorText?r:this.disabled?l:this.isFocused?c:o}render(){return s(a,{key:"5732a2a92dd945b8520e277bf10e22ea296b0949"},s("div",{key:"9f58456015584c0cd945686e8bc7d629f46a39a2",class:"form-group d-flex flex-column"},s("div",{key:"1dccca5e3f97a41e895e7572f24f0e21d2b912c1",class:"d-flex align-items-start gap-2"},s("label",{key:"54d52a444a22f460579911ecf869633b041bcab9",part:h,class:"form-label",htmlFor:this.name},this.label),s("form-control-tooltip",{key:"65f9c29cb659be24d88697c72dac422c70431209",helpText:this.helpText})),s("input",{key:"ba4b46b0e3e66112ed90e64425de6fd9c97559d2",id:this.name,name:this.name,onFocus:()=>this.isFocused=!0,onBlur:()=>{this.isFocused=!1,this.formControlBlur.emit()},onInput:this.handleFormControlInput,onKeyDown:this.keyDownHandler,onPaste:this.keyDownHandler,maxLength:this.maxLength,part:this.part,class:this.errorText?"form-control is-invalid":"form-control",type:"text",disabled:this.disabled}),s(f,{key:"f7bf2c8f5f1c30cfdc4e6c2927434a50f7f58add",errorText:this.errorText,name:this.name})))}get el(){return i(this)}static get watchers(){return{defaultValue:["handleDefaultValueChange"]}}};export{n as form_control_select,d as form_control_text}