gf-components 0.1.164 → 0.1.165

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -618,5 +618,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
618
618
  font-weight: 400;
619
619
  color: var(--gf-color-button-primary);
620
620
  transition: color 150ms ease, font-weight 150ms ease;
621
- `,A7e=({items:e,width:t=226,offset:n=0,rootMargin:r=80,containerStyle:i={}})=>{const[o,a]=S.useState(0),s=S.useRef(!1),l=S.useRef(null),c=d=>{s.current=!0,l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{s.current=!1},d)},u=d=>{var m,g;a(d),c(800);const f=(g=(m=e==null?void 0:e[d])==null?void 0:m.href)==null?void 0:g.current;if(!f)return;const h=f.getBoundingClientRect().top+window.pageYOffset-n;window.scrollTo({top:h,behavior:"smooth"})};return S.useEffect(()=>{const d=(e||[]).map((m,g)=>{var v;return{key:g,el:(v=m.href)==null?void 0:v.current}}).filter(m=>m.el);if(!d.length)return;const f=new Map,h=new IntersectionObserver(m=>{if(s.current)return;for(const b of m)f.set(b.target,{is:b.isIntersecting,top:b.boundingClientRect.top,ratio:b.intersectionRatio});const g=[];for(const{key:b,el:y}of d){const x=f.get(y);x!=null&&x.is&&g.push({key:b,el:y,...x})}if(!g.length)return;const v=g.sort((b,y)=>Math.abs(b.top-n)-Math.abs(y.top-n)||y.ratio-b.ratio)[0];v&&v.key!==o&&a(v.key)},{root:null,threshold:[0,.01,.1,.2],rootMargin:`-${n}px 0px -${r}% 0px`});return d.forEach(({el:m})=>h.observe(m)),()=>{h.disconnect(),l.current&&clearTimeout(l.current)}},[e,n,o]),p.jsxs(p.Fragment,{children:[p.jsx(mn,{}),p.jsxs(qt,{align:"stretch",children:[p.jsxs(qt,{gap:8,vertical:!0,align:"flex-start",style:{width:t,height:"fit-content",paddingTop:48,top:n,position:"sticky",paddingRight:8,...i},children:[p.jsx("span",{style:{fontSize:12},children:"Inhoudsopgave".toUpperCase()}),e==null?void 0:e.map((d,f)=>{const h=f===o;return p.jsx("div",{onClick:()=>u(f),style:{width:"100%",boxSizing:"border-box",padding:8,cursor:"pointer",background:h?"#F0F6FF":"transparent",transition:"background 150ms ease"},children:p.jsx(I7e,{children:d==null?void 0:d.name})},f)})]}),p.jsx("div",{style:{borderRight:"1px solid #DAE1ED"}})]})]})};exports.AddressLink=eD;exports.Anchor=A7e;exports.BarChart=E5e;exports.BenchmarkSankey=A2e;exports.ButtonControls=kF;exports.CrmValueChart=V7e;exports.CustomToolTip=Zn;exports.Description=iD;exports.DomRawChart=S5e;exports.DownloadButton=cx;exports.EmailLink=JF;exports.ExpandButton=ux;exports.GFButton=a6;exports.GFCard=Qs;exports.GFMetricsGrid=oD;exports.GoalChart=M7e;exports.ImpactTrend=j7e;exports.Link=Kd;exports.LocationIcon=bx;exports.MailIcon=px;exports.MaterialHeatmap=S7e;exports.Metrics=vx;exports.NavCard=IF;exports.PhoneIcon=mx;exports.PhoneLink=tD;exports.PieChart=Cle;exports.QuickNavCard=WF;exports.RenewableTrend=P7e;exports.Sankey=Ise;exports.ScatterPlot=mde;exports.TabCard=ZF;exports.Title=gx;exports.TreeMap=c2e;exports.Trends=L2e;exports.VisSelectors=P2e;exports.WasteOverview=C5e;
621
+ `,A7e=({items:e,width:t=226,offset:n=0,rootMargin:r=80,containerStyle:i={}})=>{const[o,a]=S.useState(0),s=S.useRef(0);S.useEffect(()=>{s.current=o},[o]);const l=S.useRef(!1),c=S.useRef(null),u=f=>{l.current=!0,c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{l.current=!1},f)},d=f=>{var g,v;a(f),u(800);const h=(v=(g=e==null?void 0:e[f])==null?void 0:g.href)==null?void 0:v.current;if(!h)return;const m=h.getBoundingClientRect().top+window.pageYOffset-n;window.scrollTo({top:m,behavior:"smooth"})};return S.useEffect(()=>{const f=(e||[]).map((g,v)=>{var b;return{key:v,el:(b=g.href)==null?void 0:b.current}}).filter(g=>g.el);if(!f.length)return;const h=new Map,m=new IntersectionObserver(g=>{if(l.current)return;for(const y of g)h.set(y.target,{is:y.isIntersecting,top:y.boundingClientRect.top,ratio:y.intersectionRatio});const v=[];for(const{key:y,el:x}of f){const $=h.get(x);$!=null&&$.is&&v.push({key:y,el:x,...$})}if(!v.length)return;const b=v.sort((y,x)=>Math.abs(y.top-n)-Math.abs(x.top-n)||x.ratio-y.ratio)[0];b&&b.key!==s.current&&a(b.key)},{root:null,threshold:[0,.01,.1,.2],rootMargin:`-${n}px 0px -${r}% 0px`});return f.forEach(({el:g})=>m.observe(g)),()=>{m.disconnect(),c.current&&clearTimeout(c.current)}},[e,n,r]),p.jsxs(p.Fragment,{children:[p.jsx(mn,{}),p.jsxs(qt,{align:"stretch",children:[p.jsxs(qt,{gap:8,vertical:!0,align:"flex-start",style:{width:t,height:"fit-content",paddingTop:48,top:n,position:"sticky",paddingRight:8,...i},children:[p.jsx("span",{style:{fontSize:12},children:"Inhoudsopgave".toUpperCase()}),e==null?void 0:e.map((f,h)=>{const m=h===o;return p.jsx("div",{onClick:()=>d(h),style:{width:"100%",boxSizing:"border-box",padding:8,cursor:"pointer",background:m?"#F0F6FF":"transparent",transition:"background 150ms ease"},children:p.jsx(I7e,{children:f==null?void 0:f.name})},h)})]}),p.jsx("div",{style:{borderRight:"1px solid #DAE1ED"}})]})]})};exports.AddressLink=eD;exports.Anchor=A7e;exports.BarChart=E5e;exports.BenchmarkSankey=A2e;exports.ButtonControls=kF;exports.CrmValueChart=V7e;exports.CustomToolTip=Zn;exports.Description=iD;exports.DomRawChart=S5e;exports.DownloadButton=cx;exports.EmailLink=JF;exports.ExpandButton=ux;exports.GFButton=a6;exports.GFCard=Qs;exports.GFMetricsGrid=oD;exports.GoalChart=M7e;exports.ImpactTrend=j7e;exports.Link=Kd;exports.LocationIcon=bx;exports.MailIcon=px;exports.MaterialHeatmap=S7e;exports.Metrics=vx;exports.NavCard=IF;exports.PhoneIcon=mx;exports.PhoneLink=tD;exports.PieChart=Cle;exports.QuickNavCard=WF;exports.RenewableTrend=P7e;exports.Sankey=Ise;exports.ScatterPlot=mde;exports.TabCard=ZF;exports.Title=gx;exports.TreeMap=c2e;exports.Trends=L2e;exports.VisSelectors=P2e;exports.WasteOverview=C5e;
622
622
  //# sourceMappingURL=index.cjs.js.map