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