@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.11 kB
JavaScript
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),u=require("@devgateway/wp-react-lib"),p=require("semantic-ui-react"),r=require("pure-react-carousel"),x=s=>{let o=0;const{posts:t,height:i,interval:l,autoSwitch:a}=s;return e.jsxs(r.CarouselProvider,{interval:l,isPlaying:a,totalSlides:t.length,naturalSlideHeight:i,children:[e.jsx(r.Slider,{style:{height:`${i}px`},trayTag:"ul",children:t.map(n=>e.jsx(r.Slide,{index:o++,tag:"li",children:e.jsx(u.PostIntro,{post:n,fluid:!0})}))}),e.jsx(r.DotGroup,{})]})},j=s=>{const{"data-type":o,"data-taxonomy":t,"data-categories":i,"data-items":l,"data-height":a,"data-auto-switch":n="false","data-interval":c=1e4,editing:d,parent:h,unique:g}=s;return e.jsx(p.Container,{style:{height:`${a}px`},className:`viz post carousel ${d?"editing":""}`,fluid:!0,children:e.jsx(u.PostProvider,{type:o,taxonomy:t,categories:i,store:"carousel_"+h+"_"+g,page:1,perPage:l,children:e.jsx(u.PostConsumer,{children:e.jsx(x,{height:a,interval:c,autoSwitch:n=="true"})})})})};exports.default=j;