UNPKG

@devgateway/dvz-ui-react

Version:

A modular, embeddable React component library for data visualization and UI, built with TypeScript. Provides reusable components for charts, maps, dashboards, and more, with built-in support for internationalization and Redux integration.

53 lines (52 loc) 1.7 kB
import { jsx as e } from "react/jsx-runtime"; import i, { useState as u, useRef as y } from "react"; import { Container as g } from "semantic-ui-react"; import { PostProvider as x, PostConsumer as P } from "@devgateway/wp-react-lib"; import { Parallax as k, ParallaxLayer as R } from "@react-spring/parallax"; import C from "../connected-templates/PostContent.js"; import { parse as S } from "../utils/parseUtils.js"; const v = ({ posts: a, configuration: o }) => { const s = (t) => t.sticky ? { sticky: { start: t.sticky ? t.stickyStart : t.offset, end: t.sticky ? t.stickyEnd : t.offset } } : { offset: t.offset, speed: t.speed }; return /* @__PURE__ */ e(i.Fragment, { children: a && a.map((t, r) => /* @__PURE__ */ e(i.Fragment, { children: o && o[r] && /* @__PURE__ */ e( R, { ...s(o[r]), children: /* @__PURE__ */ e(C, { as: g, fluid: !0, post: t }) }, "parallax_" + r ) })) }); }, M = (a) => { const [o, s] = u(Math.random() * 99998 + 1), { "data-height": t, "data-type": r, "data-taxonomy": l, "data-categories": n, "data-scrolls": m, "data-configuration": p, parent: d, unique: c } = a, h = S(p), f = y(null); return /* @__PURE__ */ e("div", { style: { width: "100%", height: t + "px" }, className: "parallax-container", children: /* @__PURE__ */ e(k, { ref: f, pages: m, children: /* @__PURE__ */ e( x, { type: r, taxonomy: l, categories: n, store: "parallax" + d + "_" + c, page: 1, perPage: 50, children: /* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(v, { configuration: h }) }) } ) }) }); }; export { M as default };