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.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +36 -37
- package/dist/index.es.js.map +1 -1
- package/dist/src/components/anchor/Anchor.d.ts +2 -3
- package/package.json +1 -1
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
|
-
|
|
41264
|
-
|
|
41265
|
-
containerStyle: i = {}
|
|
41263
|
+
offset: n = 0,
|
|
41264
|
+
containerStyle: r = {}
|
|
41266
41265
|
}) => {
|
|
41267
|
-
const [
|
|
41268
|
-
|
|
41269
|
-
|
|
41270
|
-
},
|
|
41271
|
-
},
|
|
41272
|
-
var
|
|
41273
|
-
|
|
41274
|
-
const
|
|
41275
|
-
if (!
|
|
41276
|
-
const
|
|
41277
|
-
window.scrollTo({ top:
|
|
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
|
|
41281
|
-
var
|
|
41282
|
-
return { key:
|
|
41283
|
-
}).filter((
|
|
41284
|
-
if (!
|
|
41285
|
-
const
|
|
41286
|
-
(
|
|
41287
|
-
if (
|
|
41288
|
-
const
|
|
41289
|
-
if (!
|
|
41290
|
-
const
|
|
41291
|
-
|
|
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: `-${
|
|
41295
|
+
rootMargin: `-${n}px 0px -80% 0px`
|
|
41297
41296
|
}
|
|
41298
41297
|
);
|
|
41299
|
-
return
|
|
41300
|
-
|
|
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:
|
|
41314
|
+
top: n,
|
|
41316
41315
|
position: "sticky",
|
|
41317
41316
|
paddingRight: 8,
|
|
41318
|
-
...
|
|
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((
|
|
41323
|
-
const
|
|
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
|
|
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:
|
|
41332
|
+
background: f ? "#F0F6FF" : "transparent",
|
|
41334
41333
|
transition: "background 150ms ease"
|
|
41335
41334
|
},
|
|
41336
|
-
children: /* @__PURE__ */ m.jsx(P7e, { children:
|
|
41335
|
+
children: /* @__PURE__ */ m.jsx(P7e, { children: u == null ? void 0 : u.name })
|
|
41337
41336
|
},
|
|
41338
|
-
|
|
41337
|
+
d
|
|
41339
41338
|
);
|
|
41340
41339
|
})
|
|
41341
41340
|
]
|