PageSourceSearch

https://www.granngarden.se/dist/Component.ScrollPointer.732e451f.js

js granngarden.se collected 2026-09-24 18:17:41 UTC 2,381 bytes, 1 lines download raw bytes

1"use strict";(self.fkaWebpackJsonp=self.fkaWebpackJsonp||[]).push([[4456],{9898:(l,e,t)=>{t.r(e),t.d(e,{default:()=>a});var o=t(641);const n={class:"scroll-pointer__root-hidden-reference",ref:"rootEl"};var r=t(5052),c=t(953);const s=(0,o.pM)({name:"ScrollPointer",components:{Icon:r.A},props:{productCount:{type:Number,default:0}},setup(l){const e=(0,c.KR)(!1),t=(0,c.KR)(!1),n=(0,c.KR)(null);let r=null;const s=(0,c.KR)(null),a=(0,o.EW)((()=>s.value?s.value:null)),u=(0,o.EW)((()=>a.value?.getElementsByClassName("product-card")[0]?.getBoundingClientRect().width??0)),i=(0,o.EW)((()=>{if(!a.value||!u.value||l.productCount<=1)return 0;const e=u.value*l.productCount;return(a.value.scrollWidth-e)/(l.productCount-1)})),v=()=>{if(!a.value)return;const l=a.value;e.value=l.scrollLeft>0,t.value=l.scrollLeft+l.clientWidth<l.scrollWidth};return(0,o.sV)((async()=>{await(0,o.dY)(),s.value=n.value?.closest("[data-scroll-pointer]")||null,a.value?.addEventListener("scroll",v),v(),a.value&&(r=new ResizeObserver((()=>{v()})),r.observe(a.value))})),(0,o.hi)((()=>{a.value?.removeEventListener("scroll",v),r&&a.value&&(r.unobserve(a.value),r.disconnect())})),{cardWidth:u,cardGap:i,scrollContainer:a,handleScrollDirection:l=>{if(!a.value)return;const e=u.value+i.value;a.value.scrollBy({left:"right"===l?e:-e,behavior:"smooth"})},canScroll:()=>!!a.value&&a.value.scrollWidth>a.value.clientWidth,showRight:t,showLeft:e,rootEl:n}}});const a=(0,t(6262).A)(s,[["render",function(l,e,t,r,c,s){const a=(0,o.g2)("icon");return(0,o.uX)(),(0,o.CE)(o.FK,null,[(0,o.Lk)("div",n,null,512),l.canScroll()&&l.showRight?((0,o.uX)(),(0,o.CE)("button",{key:0,class:"scroll-pointer__button scroll-pointer--right",type:"button","data-right-pointer-tracking":"",onClick:e[0]||(e[0]=e=>l.handleScrollDirection("right"))},[e[2]||(e[2]=(0,o.Lk)("span",{class:"sr-only"},"Scrolla till höger",-1)),(0,o.bF)(a,{icon:"chevron-down",width:"20",height:"20",class:"scroll-pointer__icon"})])):(0,o.Q3)("",!0),l.canScroll()&&l.showLeft?((0,o.uX)(),(0,o.CE)("button",{key:1,class:"scroll-pointer__button scroll-pointer--left",type:"button","data-left-pointer-tracking":"",onClick:e[1]||(e[1]=e=>l.handleScrollDirection("left"))},[e[3]||(e[3]=(0,o.Lk)("span",{class:"sr-only"},"Scrolla till vänster",-1)),(0,o.bF)(a,{icon:"chevron-down",width:"20",height:"20",class:"scroll-pointer__icon"})])):(0,o.Q3)("",!0)],64)}]])}}]);

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.