PageSourceSearch

https://app.vpmsolutions.com/dateRangeFilter.component63916.js

js vpmsolutions.com collected 2026-10-04 02:01:15 UTC 5,315 bytes, 1 lines download raw bytes

1import{d as R,u as q,$ as S,w as V,aH as s,o as m,f as p,g as c,h as f,e as t,G as $,n as _,ax as B,j as o,m as E,t as b,l as k,T as I,k as T,C as M,y as A,r as v}from"./index63916.js";import{_ as F}from"./datePicker.component.vue_vue_type_script_setup_true_lang63916.js";import{r as N}from"./PlusCircleIcon63916.js";import{r as j}from"./ChevronDownIcon63916.js";import"./CalendarDaysIcon63916.js";const z={key:2,class:"flex flex-nowrap items-center whitespace-nowrap"},G={class:"text-xs font-medium text-pink-500"},U={class:"text-xs font-medium text-pink-500"},H={class:"mt-4 space-y-3"},Q={class:"flex flex-col"},J=["disabled","onClick"],Z=R({__name:"dateRangeFilter.component",setup(K){const n=q();let a=v({start:void 0,end:void 0}),l=v(""),i=v(""),g=v(void 0),y=v(void 0);S(()=>{x()}),V(()=>n.currentRoute.value.query,r=>{r.start||Y(),r.end||D(),x()},{deep:!0});const x=()=>{if(n.currentRoute.value.query.start||n.currentRoute.value.query.end){let r=n.currentRoute.value.query.start,e=n.currentRoute.value.query.end;a.value={start:r?new Date(s(r).format("MM-DD-YYYY").toString()):void 0,end:e?new Date(s(e).format("MM-DD-YYYY").toString()):void 0},g.value=new Date(r),y.value=new Date(e)}},h=()=>{let r=new Date(n.currentRoute.value.query.start),e=new Date(n.currentRoute.value.query.end),d=a.value;(d.start!==r||d.end!==e)&&(r||(r=new Date),e||(e=new Date),g.value=r,y.value=e)},Y=async()=>{a.value.start=void 0,g.value=void 0,l.value="",await n.push({query:{...n.currentRoute.value.query,start:void 0}})},D=async()=>{a.value.end=void 0,y.value=void 0,i.value="",await n.push({query:{...n.currentRoute.value.query,end:void 0}})},w=async()=>{a.value={start:void 0,end:void 0},await Y(),await D()},C=async r=>{a.value={start:l.value?s(l.value).toDate():void 0,end:i.value?s(i.value).toDate():s().toDate()},await n.push({query:{...n.currentRoute.value.query,start:l.value?s(l.value).format("MM-DD-YYYY").toString():s().format("MM-DD-YYYY").toString(),end:i.value?s(i.value).format("MM-DD-YYYY").toString():s().format("MM-DD-YYYY").toString()}}),r&&await r()};return(r,e)=>(m(),p(t(A),{as:"div",class:"group relative"},{default:c(()=>[f(t($),{class:_([t(a).start||t(a).end?" border-solid":"border-dashed","flex w-full max-w-max items-center rounded-full border border-gray-300 bg-gray-50 px-2 py-1 transition-all duration-150 ease-in-out hover:border-gray-400 hover:bg-gray-100 hover:text-gray-700 focus:outline-none focus:ring-2 focus:ring-pink-500 focus:ring-offset-2"]),onFocus:e[1]||(e[1]=d=>h())},{default:c(()=>[t(a).start||t(a).end?(m(),p(t(B),{key:0,class:"mr-1 h-4 w-4 text-gray-400 transition-all duration-150 ease-in-out hover:text-pink-500","aria-hidden":"true",onClick:e[0]||(e[0]=d=>w())})):(m(),p(t(N),{key:1,class:"mr-1 h-4 w-4 text-gray-400 transition-all duration-150 ease-in-out group-hover:text-gray-600","aria-hidden":"true"})),e[7]||(e[7]=o("span",{class:"text-xs font-medium text-gray-500"},"Date Range",-1)),t(a).start||t(a).end?(m(),E("div",z,[e[5]||(e[5]=o("span",{class:"mx-1 text-xs text-gray-500"},"|",-1)),o("span",G,b(t(a).start?`${t(s)(t(a).start).format("MM-DD-YYYY").toString()}`:""),1),e[6]||(e[6]=o("span",{class:"mx-1 text-xs text-pink-500"},"-",-1)),o("span",U,b(t(a).end?`${t(s)(t(a).end).format("MM-DD-YYYY").toString()}`:""),1)])):k("",!0),t(a).start||t(a).end?(m(),p(t(j),{key:3,class:"ml-1 h-4 w-4 text-gray-400 transition-all duration-150 ease-in-out group-hover:text-gray-600","aria-hidden":"true"})):k("",!0)]),_:1},8,["class"]),f(I,{enterActiveClass:"transition ease-out duration-100",enterFromClass:"transform opacity-0 scale-95",enterToClass:"transform opacity-100 scale-100",leaveActiveClass:"transition ease-in duration-75",leaveFromClass:"transform opacity-100 scale-100",leaveToClass:"transform opacity-0 scale-95"},{default:c(()=>[f(t(T),{as:"div",class:"absolute left-0 top-8 z-10 mt-1 w-60 min-w-0 origin-top-left rounded-md bg-white px-4 py-2 shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none"},{default:c(({close:d})=>[o("fieldset",null,[e[10]||(e[10]=o("legend",{class:"font-montserrat flex-nowrap whitespace-nowrap text-sm font-semibold text-gray-900"}," Filter by Date Range ",-1)),o("div",H,[o("div",null,[e[8]||(e[8]=o("label",{class:"block truncate text-xs font-medium tracking-wide text-gray-700"}," Start ",-1)),f(t(F),{modelValue:t(l),"onUpdate:modelValue":e[2]||(e[2]=u=>M(l)?l.value=u:l=u),placeholder:"Start Date",returnFormat:"YYYY-MM-DD"},null,8,["modelValue"])]),o("div",null,[e[9]||(e[9]=o("label",{class:"block truncate text-xs font-medium tracking-wide text-gray-700"}," End ",-1)),f(t(F),{modelValue:t(i),"onUpdate:modelValue":e[3]||(e[3]=u=>M(i)?i.value=u:i=u),placeholder:"End Date",returnFormat:"YYYY-MM-DD"},null,8,["modelValue"])])]),o("div",Q,[o("button",{class:"mt-5 w-full rounded-md border border-gray-200 px-4 py-1 text-sm font-medium text-gray-700 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-pink-500 focus:ring-offset-2",onClick:e[4]||(e[4]=u=>w())}," Clear "),o("button",{class:"mt-2 w-full rounded-md bg-pink-500 px-4 py-1 text-sm font-medium text-white hover:bg-pink-600 focus:outline-none focus:ring-2 focus:ring-pink-500 focus:ring-offset-2 disabled:bg-gray-400 disabled:opacity-50",disabled:!t(l)||!t(i),onClick:u=>C(d)}," Apply ",8,J)])])]),_:1})]),_:1})]),_:1}))}});
1export{Z as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.