import{r as v,aa as l,ac as k,n as S}from"./index.ef672c15.js";import{d as x,u as g,c as E,h as w,o as s,a as u,f as V,e as d,b as B,w as A,m as $,r as j,g as f,l as q}from"./index.477073af.js";const D={key:0,class:"flex justify-between text-input-label-size"},M={class:"text"},N=["for","textContent"],T=["textContent"],z={class:"input-area"},H={inheritAttrs:!1},_=x({...H,__name:"ElInput",props:{modelValue:{type:[String,Object,Array,Number,Date,Boolean],default:void 0},label:{type:String,default:""},description:{type:String,default:""},input:{type:[String,Object],default:void 0}},emits:["update:modelValue"],setup(t,{emit:b}){const n=t,c=g(),{class:I,...h}=c,m=v(),i=v(),p=E(()=>n.input&&typeof n.input=="string"?q[n.input]:n.input||""),y=async()=>{var a,o;const e=(a=m.value)==null?void 0:a.$el;if(e){if((e instanceof HTMLInputElement||e instanceof HTMLSelectElement)&&e.checkValidity)i.value=e.checkValidity();else if(e.querySelector){const r=(o=e.querySelector("input"))!=null?o:e.querySelector("select");r&&r.checkValidity?i.value=r.checkValidity():i.value=!0}}},C=async e=>{await y(),b("update:modelValue",e)};return w(()=>{setTimeout(async()=>{await y()},300)}),(e,a)=>(s(),u("div",{key:t.label,class:S(["f-el-input space-y-1.5",[l(i)?"valid":"not-valid",l(c).class]])},[t.label||t.description?(s(),u("div",D,[V("div",M,[t.label?(s(),u("label",{key:0,class:"font-medium",for:l(c).for,textContent:k(t.label)},null,8,N)):d("v-if",!0),t.description?(s(),u("div",{key:1,class:"text-sm text-slate-400",textContent:k(t.description)},null,8,T)):d("v-if",!0)])])):d("v-if",!0),V("div",z,[l(p)?(s(),B(j(l(p)),$({key:0,ref_key:"inputEl",ref:m,"model-value":t.modelValue},h,{"onUpdate:modelValue":a[0]||(a[0]=o=>C(o))}),{default:A(()=>[f(e.$slots,"default")]),_:3},16,["model-value"])):f(e.$slots,"default",{key:1}),f(e.$slots,"after")])],2))}});export{_ as default};
