UNPKG

@progress/kendo-react-chart-wizard

Version:

React Chart Wizard lets you create a chart using data from a Grid, another data-bound component, or an external source

9 lines (8 loc) 2.47 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("react"),y=require("@progress/kendo-react-animation"),T=require("@progress/kendo-react-intl"),S=require("@progress/kendo-react-layout"),f=require("../SeriesTypesWrap.js"),i=require("../SeriesTypeButton.js"),t=require("../../utils.js"),c=require("../../messages.js"),l=require("@progress/kendo-svg-icons");function E(a){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const e in a)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(a,e);Object.defineProperty(n,e,s.get?s:{enumerable:!0,get:()=>a[e]})}}return n.default=a,Object.freeze(n)}const r=E(B),q=a=>{const n=T.useLocalization(),e=a.state,s=e.seriesType,{isStackFalse:d,isStackNormal:g,isStack100:b}=t.stackState(e),[u,k]=r.useState(!0),m=r.useCallback(o=>{k(!o.expanded)},[]),p=()=>{a.onStateChange(t.mergeStates(e,t.createState(e.data,"bar")))},h=()=>{const o=t.mergeStates(e,t.createState(e.data,"bar"));a.onStateChange(t.updateState(o,t.ActionTypes.stacked,t.stackNormal))},C=()=>{const o=t.mergeStates(e,t.createState(e.data,"bar"));a.onStateChange(t.updateState(o,t.ActionTypes.stacked,t.stack100))};return r.createElement(S.ExpansionPanel,{style:{maxWidth:"576px"},title:n.toLanguageString(c.barChart,c.messages.barChart),expanded:u,tabIndex:0,onAction:m},r.createElement(y.Reveal,null,u&&r.createElement(S.ExpansionPanelContent,null,r.createElement(f.SeriesTypesWrap,null,r.createElement(i.SeriesTypeButton,{selected:s==="bar"&&d,onClick:p,icon:l.chartBarClusteredIcon,iconName:"chart-bar-clustered"},n.toLanguageString(c.barChartBar,c.messages.barChartBar)),r.createElement(i.SeriesTypeButton,{selected:s==="bar"&&g,onClick:h,icon:l.chartBarStackedIcon,iconName:"chart-bar-stacked"},n.toLanguageString(c.barChartStackedBar,c.messages.barChartStackedBar)),r.createElement(i.SeriesTypeButton,{selected:s==="bar"&&b,onClick:C,icon:l.chartBarStacked100Icon,iconName:"chart-bar-stacked100"},n.toLanguageString(c.barChart100StackedBar,c.messages.barChart100StackedBar))))))};exports.BarChartPanel=q;