import{c as V}from"./component-0WedTVCo.js";import{_ as v}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{r as g,f as B,m as d,H as k,c as r,o as s,h as o,a as i,e as N,t as f,b as S,v as h,n as c}from"./index-CmCGXBst.js";const w={key:0,class:"form-field__label"},x={key:0},M={key:0,class:"form-field-input__error-message"},P={__name:"BasicInput",props:{modelValue:[String,Number],label:{type:String,default:""},vertical:{type:Boolean,default:!1},name:{type:String,default:""},placeholder:{type:String,default:""},isPassword:{type:Boolean,default:!1},isNumber:{type:Boolean,default:!1},necessarily:{type:Boolean,default:!1},errorMessage:{type:String,default:null},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","input"],setup(e,{emit:p}){const a=e,u=p,l=g(null);function m(){let t=l.value;(a.name==="Name"||a.name==="Sourname"||a.name==="Lastname")&&(t=t.replace(/\s/g,""),t=t.charAt(0).toUpperCase()+t.slice(1)),u("update:modelValue",t),u("input",t)}const b=B(()=>a.name==="BornDate"||a.name==="PasportDate"?"00.00.0000":a.name==="Kpp"?"0000000000":a.name==="Index"||a.name==="PasportNum"?"000000":a.name==="Bik"?"000000000":a.name==="BankAccount"?"00000000000000000000":a.name==="PasportLine"?"0000":a.name==="phoneNumberSMS"?"70000000000":null);return d(()=>a.modelValue,t=>{l.value=t},{immediate:!0}),d(l,()=>{m()}),k(()=>{l.value=a.modelValue}),(t,n)=>(s(),r("div",{class:c([{"form-field__column":e.vertical},"form-field"])},[e.label!==null&&e.label!==""?(s(),r("div",w,[N(f(e.label)+" ",1),e.necessarily?(s(),r("span",x,n[1]||(n[1]=[i("span",null,"*",-1)]))):o("",!0)])):o("",!0),i("div",{class:c(["form-field-input__wrapper",e.disabled?"form-field-input__wrapper_disabled":""])},[S(h(V),{modelValue:l.value,"onUpdate:modelValue":n[0]||(n[0]=y=>l.value=y),disabled:e.disabled,mask:b.value,name:e.name,placeholder:e.placeholder,type:e.isPassword?"password":e.isNumber?"number":"text",onInput:m},null,8,["modelValue","disabled","mask","name","placeholder","type"]),e.errorMessage?(s(),r("div",M,f(e.errorMessage),1)):o("",!0)],2)],2))}},_=v(P,[["__scopeId","data-v-d061b062"]]);export{_};
