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