import{L as d,Q as m,o as f,E as v,l as u,S as Y}from"./post-2433f428.js";import{E as _}from"./date-picker-1de719c3.js";import"./select-b70937af.js";import{u as i,a as p,s as D}from"./formvibes-4c4994e4.js";const q={__name:"date-picker",setup(h){const n=i(),{dates:e,preset:l,generalStates:t}=d(n);m([e],()=>{const a=p.filter(r=>{const[o,s]=r.value();return o.format("YYYY-MM-DD")===e.value[0]&&s.format("YYYY-MM-DD")===e.value[1]})[0];a?l.value=a.text.replaceAll(" ","_"):l.value="Custom",t.value={...t.value,queryParams:{...t.value.queryParams,query_type:l.value,page_num:1}},D("fv-date-range",{toDate:e.value[1]||"",fromDate:e.value[0]||"",queryType:t.value.queryParams.query_type})});const c=a=>{console.log("fetch data ",a)};return(a,r)=>{const o=_;return f(),v(o,{modelValue:u(e),"onUpdate:modelValue":r[0]||(r[0]=s=>Y(e)?e.value=s:null),type:"daterange","unlink-panels":"","range-separator":"To","start-placeholder":a.start_placeholder,"end-placeholder":"End date","popper-class":"wml-date-picker-popup",size:"default",shortcuts:u(p),format:"DD/MM/YYYY","value-format":"YYYY-MM-DD","default-value":a.default_dates,onChange:c,clearable:!1},null,8,["modelValue","start-placeholder","shortcuts","default-value"])}}};export{q as _};
//# sourceMappingURL=date-picker-25a0adc5.js.map
