import{d as c,h as s,o as a,a9 as m,C as t,i as l,E as b,t as i,s as y,q as p,v as f,V as g,m as h}from"./Cvzsf6pb.js";const v=["for"],k={key:0,class:"tapp-input__label"},B={key:0},V={key:0,"data-testid":"tapp-input-required"},T={key:1},I={class:"tapp-input__wrapper"},M=["id","value","type","disabled"],$=["data-testid"],q={key:2,class:"tapp-input__helper-text"},z=["text","email","tel","number","password","date"],C=c({inheritAttrs:!1,__name:"TappInput",props:{id:{},type:{default:z[0]},label:{default:""},errorMessage:{default:void 0},helperText:{default:""},valid:{type:Boolean},loading:{type:Boolean},required:{type:Boolean},disabled:{type:Boolean},modelValue:{default:""}},emits:["update:modelValue","input","focus","blur"],setup(N,{emit:r}){const o=r;function d(e){return o("update:modelValue",e.target.value),o("input",e.target.value)}function u(){return o("focus")}function _(){return o("blur")}return(e,w)=>{const n=g;return a(),s("label",{class:m(["tapp-input",{valid:e.valid,invalid:!!e.errorMessage,disabled:e.disabled,loading:e.loading}]),for:e.id},[e.label||e.$slots.label?(a(),s("span",k,[e.label?(a(),s("span",B,[b(i(e.label),1),e.required?(a(),s("span",V,"*")):t("",!0)])):t("",!0),e.$slots.label?(a(),s("span",T,[y(e.$slots,"label",{},void 0,!0)])):t("",!0)])):t("",!0),l("span",I,[l("input",f(e.$attrs,{id:e.id,class:"tapp-input__element",value:e.modelValue,type:e.type,disabled:e.disabled,onInput:d,onFocus:u,onBlur:_}),null,16,M),e.valid&&!e.loading?(a(),p(n,{key:0,icon:"check",class:"tapp-input__icon tapp-input__icon--valid",size:24,"data-testid":"tapp-icon-valid"})):t("",!0),!e.valid&&e.errorMessage?(a(),p(n,{key:1,icon:"alert-triangle",class:"tapp-input__icon tapp-input__icon--invalid","data-testid":"tapp-icon-invalid",size:24})):t("",!0),e.loading?(a(),p(n,{key:2,icon:"loader",class:"tapp-input__icon tapp-input__icon--loading","data-testid":"tapp-icon-loading",size:24})):t("",!0)]),e.errorMessage?(a(),s("span",{key:1,class:"tapp-input__error tapp-form__has-error","data-testid":`input_error_${e.id}`},i(e.errorMessage),9,$)):t("",!0),e.helperText?(a(),s("span",q,i(e.helperText),1)):t("",!0)],10,v)}}}),S=Object.assign(h(C,[["__scopeId","data-v-253e8c7a"]]),{__name:"TappInput"});export{S as _}; //# sourceMappingURL=C1GjbExY.js.map