@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.
2 lines (1 loc) • 1.35 kB
JavaScript
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),o=require("react"),j=require("semantic-ui-react"),n=require("@devgateway/wp-react-lib"),l=require("@react-spring/parallax"),f=require("../connected-templates/PostContent.js"),P=require("../utils/parseUtils.js"),q=({posts:r,locale:c,configuration:s})=>{const i=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 e.jsx(o.Fragment,{children:r&&r.map((t,a)=>e.jsx(o.Fragment,{children:s&&s[a]&&e.jsx(l.ParallaxLayer,{...i(s[a]),children:e.jsx(f.default,{as:j.Container,fluid:!0,post:t})},"parallax_"+a)}))})},R=r=>{const[c,s]=o.useState(Math.random()*99998+1),{"data-width":i,"data-height":t,"data-type":a,"data-taxonomy":d,"data-categories":u,"data-count":k,"data-horizontal":S=!1,"data-scrolls":p,"data-configuration":h,parent:x,editing:v,component:w,unique:g}=r,m=P.parse(h),y=o.useRef(null);return e.jsx("div",{style:{width:"100%",height:t+"px"},className:"parallax-container",children:e.jsx(l.Parallax,{ref:y,pages:p,children:e.jsx(n.PostProvider,{type:a,taxonomy:d,categories:u,store:"parallax"+x+"_"+g,page:1,perPage:50,children:e.jsx(n.PostConsumer,{children:e.jsx(q,{configuration:m})})})})})};exports.default=R;