gf-components 0.1.160 → 0.1.161

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.es.js CHANGED
@@ -41260,44 +41260,43 @@ const za = 12, d1 = 14, Rs = Bt.tspan`
41260
41260
  `, fhe = ({
41261
41261
  items: e,
41262
41262
  width: t = 226,
41263
- headerOffset: n = 80,
41264
- bannerOffset: r = 55,
41265
- containerStyle: i = {}
41263
+ offset: n = 0,
41264
+ containerStyle: r = {}
41266
41265
  }) => {
41267
- const [o, a] = Ne.useState(0), s = n + r, l = Ne.useRef(!1), c = Ne.useRef(null), u = (f) => {
41268
- l.current = !0, c.current && clearTimeout(c.current), c.current = setTimeout(() => {
41269
- l.current = !1;
41270
- }, f);
41271
- }, d = (f) => {
41272
- var g, v;
41273
- a(f), u(800);
41274
- const h = (v = (g = e == null ? void 0 : e[f]) == null ? void 0 : g.href) == null ? void 0 : v.current;
41275
- if (!h) return;
41276
- const p = h.getBoundingClientRect().top + window.pageYOffset - n;
41277
- window.scrollTo({ top: p, behavior: "smooth" });
41266
+ const [i, o] = Ne.useState(0), a = Ne.useRef(!1), s = Ne.useRef(null), l = (u) => {
41267
+ a.current = !0, s.current && clearTimeout(s.current), s.current = setTimeout(() => {
41268
+ a.current = !1;
41269
+ }, u);
41270
+ }, c = (u) => {
41271
+ var h, p;
41272
+ o(u), l(800);
41273
+ const d = (p = (h = e == null ? void 0 : e[u]) == null ? void 0 : h.href) == null ? void 0 : p.current;
41274
+ if (!d) return;
41275
+ const f = d.getBoundingClientRect().top + window.pageYOffset - n;
41276
+ window.scrollTo({ top: f, behavior: "smooth" });
41278
41277
  };
41279
41278
  return Ne.useEffect(() => {
41280
- const f = (e || []).map((p, g) => {
41281
- var v;
41282
- return { key: g, el: (v = p.href) == null ? void 0 : v.current };
41283
- }).filter((p) => p.el);
41284
- if (!f.length) return;
41285
- const h = new IntersectionObserver(
41286
- (p) => {
41287
- if (l.current) return;
41288
- const g = p.filter((b) => b.isIntersecting).sort((b, y) => b.boundingClientRect.top - y.boundingClientRect.top)[0];
41289
- if (!g) return;
41290
- const v = f.find((b) => b.el === g.target);
41291
- v && v.key !== void 0 && a(v.key);
41279
+ const u = (e || []).map((f, h) => {
41280
+ var p;
41281
+ return { key: h, el: (p = f.href) == null ? void 0 : p.current };
41282
+ }).filter((f) => f.el);
41283
+ if (!u.length) return;
41284
+ const d = new IntersectionObserver(
41285
+ (f) => {
41286
+ if (a.current) return;
41287
+ const h = f.filter((g) => g.isIntersecting).sort((g, v) => g.boundingClientRect.top - v.boundingClientRect.top)[0];
41288
+ if (!h) return;
41289
+ const p = u.find((g) => g.el === h.target);
41290
+ p && p.key !== void 0 && o(p.key);
41292
41291
  },
41293
41292
  {
41294
41293
  root: null,
41295
41294
  threshold: [0.1, 0.2, 0.3],
41296
- rootMargin: `-${s}px 0px -80% 0px`
41295
+ rootMargin: `-${n}px 0px -80% 0px`
41297
41296
  }
41298
41297
  );
41299
- return f.forEach(({ el: p }) => h.observe(p)), () => {
41300
- h.disconnect(), c.current && clearTimeout(c.current);
41298
+ return u.forEach(({ el: f }) => d.observe(f)), () => {
41299
+ d.disconnect(), s.current && clearTimeout(s.current);
41301
41300
  };
41302
41301
  }, [e]), /* @__PURE__ */ m.jsxs(m.Fragment, { children: [
41303
41302
  /* @__PURE__ */ m.jsx($n, {}),
@@ -41312,30 +41311,30 @@ const za = 12, d1 = 14, Rs = Bt.tspan`
41312
41311
  width: t,
41313
41312
  height: "fit-content",
41314
41313
  paddingTop: 48,
41315
- top: s,
41314
+ top: n,
41316
41315
  position: "sticky",
41317
41316
  paddingRight: 8,
41318
- ...i
41317
+ ...r
41319
41318
  },
41320
41319
  children: [
41321
41320
  /* @__PURE__ */ m.jsx("span", { style: { fontSize: 12 }, children: "Inhoudsopgave".toUpperCase() }),
41322
- e == null ? void 0 : e.map((f, h) => {
41323
- const p = h === o;
41321
+ e == null ? void 0 : e.map((u, d) => {
41322
+ const f = d === i;
41324
41323
  return /* @__PURE__ */ m.jsx(
41325
41324
  "div",
41326
41325
  {
41327
- onClick: () => d(h),
41326
+ onClick: () => c(d),
41328
41327
  style: {
41329
41328
  width: "100%",
41330
41329
  boxSizing: "border-box",
41331
41330
  padding: 8,
41332
41331
  cursor: "pointer",
41333
- background: p ? "#F0F6FF" : "transparent",
41332
+ background: f ? "#F0F6FF" : "transparent",
41334
41333
  transition: "background 150ms ease"
41335
41334
  },
41336
- children: /* @__PURE__ */ m.jsx(P7e, { children: f == null ? void 0 : f.name })
41335
+ children: /* @__PURE__ */ m.jsx(P7e, { children: u == null ? void 0 : u.name })
41337
41336
  },
41338
- h
41337
+ d
41339
41338
  );
41340
41339
  })
41341
41340
  ]