import{d as m,r as _,w as v,ai as x,o as g,M as V,aa as y,O as s,S as u,T as i}from"./vue.adf17aba.js";import{_ as S}from"./_plugin-vue_export-helper.c27b6911.js";const b=m({__name:"index",props:{modelValue:{type:String},precision:{type:Number},prefix:{type:String,default:""},suffix:{type:String,default:""}},emits:["update:modelValue","blur"],setup(l,{emit:p}){const a=l,e=_(a.modelValue),n=p,r=o=>{e.value=o.replace(/[^\d.]/g,"").replace(/\.{2,}/g,".").replace(".","$#$").replace(/\./g,"").replace("$#$",".").replace(/^\./g,"");const t=e.value.indexOf(".");t>0&&e.value.length-t-1>a.precision&&(e.value=o.substring(0,t+a.precision+1)),n("update:modelValue",e.value)},d=()=>{e.value!==""&&(e.value=Number(e.value).toFixed(a.precision),n("update:modelValue",e.value),n("blur"))};return v(()=>a.modelValue,()=>e.value=a.modelValue),(o,t)=>{const c=x("el-input");return g(),V(c,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=f=>e.value=f),onInput:r,onBlur:d,class:"asj-input-float",style:{width:"100%"}},y({_:2},[l.prefix.length>0?{name:"prepend",fn:s(()=>[u(i(a.prefix),1)]),key:"0"}:void 0,l.suffix.length>0?{name:"append",fn:s(()=>[u(i(a.suffix),1)]),key:"1"}:void 0]),1032,["modelValue"])}}});const w=S(b,[["__scopeId","data-v-94f51fd2"]]);export{w as I};
