import{V as f,f as y}from"./VDatePicker-DHBX-k2T.js";import{V as v}from"./VTextField-DxEUpn3-.js";import{V as k}from"./VMenu-CT0Fri-T.js";import{d as b,r as m,w as g,f as B,h as u,i as s,c as d,O as w,D as x,C,G as D,y as M}from"./index-C5GbdPxY.js";const h={key:0,class:"text-error"},U=b({__name:"DatePicker",props:{modelValue:{},label:{},error:{type:Boolean},clearable:{type:Boolean},errorMessages:{},min:{},max:{},required:{type:Boolean}},emits:["update:modelValue"],setup(i,{emit:p}){const l=i,n=p,t=m(!1),r=m(l.modelValue);g(()=>l.modelValue,e=>{r.value=e});const c=e=>{if(e){const a=y(new Date(e),"yyyy-MM-dd");n("update:modelValue",a),t.value=!1}},V=()=>{r.value=null,n("update:modelValue","")};return(e,a)=>(u(),B(k,{modelValue:t.value,"onUpdate:modelValue":a[1]||(a[1]=o=>t.value=o),"close-on-content-click":!1,"offset-y":"",transition:"scale-transition"},{activator:s(({props:o})=>[d(v,w({clearable:"",error:e.error,"error-messages":e.errorMessages,"model-value":l.modelValue,"prepend-inner-icon":"tabler-calendar",readonly:""},o,{"onClick:clear":V}),{label:s(()=>[x(M(l.label)+" ",1),e.required?(u(),C("span",h,"*")):D("",!0)]),_:2},1040,["error","error-messages","model-value"])]),default:s(()=>[d(f,{modelValue:r.value,"onUpdate:modelValue":[a[0]||(a[0]=o=>r.value=o),c],color:"primary",max:e.max,min:e.min,"show-adjacent-months":""},null,8,["modelValue","max","min"])]),_:1},8,["modelValue"]))}});export{U as _};
