import{r as t,c as s,h as i,H as e,g as h}from"./p-afb110dc.js";const r=class{constructor(i){t(this,i),this.balInput=s(this,"balInput",7),this.balBlur=s(this,"balBlur",7),this.balClick=s(this,"balClick",7),this.balKeyPress=s(this,"balKeyPress",7),this.balFocus=s(this,"balFocus",7),this.inputId="bal-in-"+a++,this.name=this.inputId,this.type="text",this.placeholder="",this.balTabindex=0,this.maxLength=void 0,this.minLength=void 0,this.inverted=!1,this.readonly=!1,this.disabled=!1,this.clickable=!1,this.autoComplete=!1,this.numberKeyboard=!1,this.onlyNumbers=!1,this.value="",this.onInput=t=>{var s;let i=t.target&&(null===(s=t.target)||void 0===s?void 0:s.value);this.onlyNumbers&&(i=this.filterNumbers(i)),this.value!==i?(this.value=i,this.balInput.emit(this.value)):this.updateInputValue()}}valueChanged(){this.updateInputValue()}async setFocus(){this.inputEl.focus()}render(){return i(e,null,i("input",{class:{input:!0,"is-inverted":this.inverted,clickable:this.clickable},autoComplete:this.autoComplete?"on":"off",id:this.inputId,type:this.type,placeholder:this.placeholder,name:this.name,value:this.value,tabindex:this.balTabindex,disabled:this.disabled,readonly:this.readonly,pattern:this.numberKeyboard?"[0-9]*":"",maxLength:this.maxLength,minLength:this.minLength,onInput:t=>this.onInput(t),onBlur:t=>this.balBlur.emit(t),onClick:t=>this.balClick.emit(t),onKeyPress:t=>this.balKeyPress.emit(t),onFocus:t=>this.balFocus.emit(t),ref:t=>this.inputEl=t}))}updateInputValue(){this.inputEl.value!==this.value&&(this.inputEl.value=this.value)}filterNumbers(t){return t&&"string"==typeof t&&(t=t.replace(/[^\d]/g,"")),t}get el(){return h(this)}static get watchers(){return{value:["valueChanged"]}}};let a=0;r.style="@-webkit-keyframes spinAround{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes spinAround{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.sc-bal-input-h{display:block}";export{r as bal_input}