PageSourceSearch

https://thewhitelady.co.nz/build/assets/Index-8e6e4c40.js

js thewhitelady.co.nz collected 2026-10-07 02:58:56 UTC 6,769 bytes, 1 lines download raw bytes

1import{r as k,H as Y,I as T,l as M,T as U,j as z,o,d as r,b as p,u as n,w as m,F as f,Z as A,a as t,i as x,f as g,h as S,c as a,e as v,g as F,n as h,k as L,v as O,t as c}from"./app-1adac181.js";import{_ as R}from"./AppLayout-264868f8.js";import{d as E}from"./dayjs.min-68dc8c7f.js";import{r as H}from"./ClipboardDocumentListIcon-08fda83f.js";import{r as V}from"./ExclamationTriangleIcon-36de67b7.js";import{r as Z,a as q}from"./DocumentIcon-667283bf.js";import{r as G}from"./CheckCircleIcon-932e38c5.js";import"./dialog-8ba66f72.js";import"./_plugin-vue_export-helper-c27b6911.js";const J={class:"flex items-center justify-between"},K={class:"py-6"},P={class:"max-w-7xl mx-auto sm:px-6 lg:px-8"},Q={key:0,class:"rounded-md bg-orange-500 text-white p-4"},W={class:"flex items-center"},X={class:"flex-shrink-0"},ee={key:1,class:"px-6 lg:px-8 bg-white rounded-md"},te={class:"flow-root"},se={class:"-my-2 -mx-6 overflow-x-auto lg:-mx-8"},oe={class:"inline-block min-w-full py-2 align-middle sm:px-6 lg:px-6"},ie={class:"min-w-full"},le={class:"border-b border-gray-400"},ne={scope:"col",class:"w-8 py-3.5 pl-4 md:pl-0 pr-3 text-left text-sm font-semibold text-gray-900"},re={scope:"col",class:"text-right py-3.5 pl-3 text-xs sm:text-sm font-semibold text-gray-500"},ae={class:"group"},de={class:"py-4 whitespace-nowrap pl-4 md:pl-0 pr-3 text-sm font-medium text-gray-900 flex items-center gap-2"},me=["onUpdate:modelValue"],ce={class:"py-4 text-left whitespace-nowrap px-3 text-sm text-gray-500"},pe={class:"py-4 text-left whitespace-nowrap px-3 text-sm text-gray-500"},ue={class:"py-4 text-left whitespace-nowrap px-3 text-sm text-gray-700 font-bold"},fe={class:"py-4 relative whitespace-nowrap pl-3 pr-4 md:pr-0 text-right text-sm font-medium sm:pr-0"},xe={class:"sr-only"},ge={class:"sr-only"},he={class:"pb-4 px-3 text-sm font-medium text-gray-500",colspan:5},ye={class:"bg-yellow-200"},ve={key:0},be={key:1},je={__name:"Index",props:{stocktakes:Array,total:Number,has_more:Boolean},setup(C){const b=C,u=k(!0),w=(l,e)=>E(l).format(e),i=Y({items:[...b.stocktakes],hasMore:b.has_more,loading:!1}),N=async()=>{if(!(!i.hasMore||i.loading)){i.loading=!0;try{const e=await(await fetch(route("stocktakes.index.more",{offset:i.items.length}))).json();i.items.push(...e.stocktakes),i.hasMore=e.has_more}finally{i.loading=!1}}},y=k(null);let d=null;const $=()=>{d&&d.disconnect(),d=new IntersectionObserver(l=>{var e;(e=l[0])!=null&&e.isIntersecting&&N()},{rootMargin:"200px"}),M(()=>{y.value&&d.observe(y.value)})};T(()=>{d&&d.disconnect()}),M($);const j=U({stocktakes:[]}),_=z(()=>i.items.filter(l=>l.selected)),D=()=>{j.transform(l=>({stocktakes:_.value.map(e=>e.id)})).post(route("reports.stocktakes.multiple.view"))};return(l,e)=>(o(),r(f,null,[p(n(A),{title:"Stocktakes"}),p(R,{title:"Stocktakes"},{header:m(()=>[t("div",J,[e[3]||(e[3]=t("h2",{class:"font-semibold text-xl text-gray-800 leading-tight"}," Stocktakes ",-1)),p(n(x),{href:l.route("stocktakes.create"),class:"-my-2 inline-flex rounded-md bg-indigo-600 py-2 px-4 text-white hover:bg-indigo-500 focus:outline-none focus:ring-2 focus:ring-indigo-600 focus:ring-offset-2 focus:ring-offset-indigo-50"},{default:m(()=>[p(n(H),{class:"h-5 w-5 mr-2","aria-hidden":"true"}),e[2]||(e[2]=g(" Record Stocktake "))]),_:1},8,["href"])])]),default:m(()=>[t("div",K,[t("div",P,[i.items.length==0?(o(),r("div",Q,[t("div",W,[t("div",X,[p(n(V),{class:"h-5 w-5","aria-hidden":"true"})]),e[4]||(e[4]=t("div",{class:"ml-3"},[t("p",{class:"text-lg font-medium"}," No stocktakes recorded. ")],-1))])])):(o(),r("div",ee,[t("div",te,[t("div",se,[t("div",oe,[t("table",ie,[t("thead",null,[t("tr",le,[t("th",ne,[t("a",{href:"#",class:"flex items-center justify-start group",onClick:e[0]||(e[0]=S(s=>u.value=!u.value,["prevent"]))},[u.value?(o(),a(n(Z),{key:0,class:"h-4 w-4 mr-1 group-hover:text-gray-500"})):(o(),a(n(q),{key:1,class:"h-4 w-4 mr-1 group-hover:text-gray-500"}))])]),e[6]||(e[6]=t("th",{scope:"col",class:"w-1/6 text-left py-3.5 px-3 text-xs sm:text-sm font-semibold text-gray-500"}," Dated ",-1)),e[7]||(e[7]=t("th",{scope:"col",class:"w-1/6 text-left py-3.5 px-3 text-xs sm:text-sm font-semibold text-gray-500"}," Site ",-1)),e[8]||(e[8]=t("th",{scope:"col",class:"w-1/6 text-left py-3.5 px-3 text-xs sm:text-sm font-bold text-gray-900"}," Completed ",-1)),t("th",re,[_.value.length>1?(o(),a(n(x),{key:0,href:"#",onClick:e[1]||(e[1]=S(s=>D(),["prevent"])),class:"rounded bg-indigo-600 px-2 py-1 text-xs font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600 mr-4 sm:mr-0"},{default:m(()=>e[5]||(e[5]=[g("View All")])),_:1})):v("",!0)])])]),t("tbody",null,[(o(!0),r(f,null,F(i.items,(s,B)=>(o(),r(f,null,[t("tr",ae,[t("td",de,[s.completed_at?(o(),a(n(G),{key:0,class:h(["w-5 text-green-600",{"sm:group-hover:hidden":!s.selected,"sm:hidden":s.selected}])},null,8,["class"])):(o(),a(n(V),{key:1,class:h(["w-5 text-yellow-600",{"sm:group-hover:hidden":!s.selected,"sm:hidden":s.selected}])},null,8,["class"])),L(t("input",{"onUpdate:modelValue":I=>s.selected=I,type:"checkbox",class:h(["sm:group-hover:inline-block size-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600",{"sm:hidden":!s.selected}])},null,10,me),[[O,s.selected]])]),t("td",ce,c(w(s.dated_at,"ddd, D MMM YYYY")),1),t("td",pe,c(s.site.name),1),t("td",ue,c(s.completed_at?w(s.completed_at,"D MMM h:mma"):"Incomplete"),1),t("td",fe,[s.completed_at?(o(),a(n(x),{key:0,href:l.route("stocktakes.view",{stocktake:s}),class:"rounded bg-indigo-600 px-2 py-1 text-xs font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"},{default:m(()=>[e[9]||(e[9]=g("View")),t("span",xe,", "+c(s.dated_at),1)]),_:2},1032,["href"])):(o(),a(n(x),{key:1,href:l.route("stocktakes.items",{stocktake:s}),class:"rounded bg-indigo-600 px-2 py-1 text-xs font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"},{default:m(()=>
1[e[10]||(e[10]=g("Resume")),t("span",ge,", "+c(s.dated_at),1)]),_:2},1032,["href"]))])]),t("tr",{class:h([B<i.items.length-1?"border-b border-gray-200":null])},[s.notes&&u.value?(o(),r(f,{key:0},[e[11]||(e[11]=t("td",{class:"whitespace-nowrap pb-4 px-3 text-sm font-medium text-gray-500"},"   ",-1)),t("td",he,[t("span",ye,c(s.notes),1)])],64)):v("",!0)],2)],64))),256))])]),i.hasMore?(o(),r("div",{key:0,ref_key:"sentinel",ref:y,class:"py-6 text-center text-sm text-gray-400"},[i.loading?(o(),r("span",ve,"Loading more…")):(o(),r("span",be," "))],512)):v("",!0)])])])]))])])]),_:1})],64))}};export{je 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.