@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
71 lines (70 loc) • 2.7 kB
JavaScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
import * as a from "react";
import { Reveal as x } from "@progress/kendo-react-animation";
import { useLocalization as E } from "@progress/kendo-react-intl";
import { ExpansionPanel as f, ExpansionPanelContent as y } from "@progress/kendo-react-layout";
import { SeriesTypesWrap as T } from "../SeriesTypesWrap.mjs";
import { SeriesTypeButton as s } from "../SeriesTypeButton.mjs";
import { stackState as L, mergeStates as i, createState as l, updateState as d, ActionTypes as S, stackNormal as N, stack100 as I } from "../../utils.mjs";
import { barChart as A, messages as c, barChartBar as P, barChartStackedBar as w, barChart100StackedBar as z } from "../../messages.mjs";
import { chartBarClusteredIcon as R, chartBarStackedIcon as W, chartBarStacked100Icon as v } from "@progress/kendo-svg-icons";
const M = (r) => {
const n = E(), t = r.state, o = t.seriesType, { isStackFalse: h, isStackNormal: k, isStack100: p } = L(t), [m, C] = a.useState(!0), b = a.useCallback((e) => {
C(!e.expanded);
}, []), g = () => {
r.onStateChange(i(t, l(t.data, "bar")));
}, B = () => {
const e = i(t, l(t.data, "bar"));
r.onStateChange(d(e, S.stacked, N));
}, u = () => {
const e = i(t, l(t.data, "bar"));
r.onStateChange(d(e, S.stacked, I));
};
return /* @__PURE__ */ a.createElement(
f,
{
style: { maxWidth: "576px" },
title: n.toLanguageString(A, c.barChart),
expanded: m,
tabIndex: 0,
onAction: b
},
/* @__PURE__ */ a.createElement(x, null, m && /* @__PURE__ */ a.createElement(y, null, /* @__PURE__ */ a.createElement(T, null, /* @__PURE__ */ a.createElement(
s,
{
selected: o === "bar" && h,
onClick: g,
icon: R,
iconName: "chart-bar-clustered"
},
n.toLanguageString(P, c.barChartBar)
), /* @__PURE__ */ a.createElement(
s,
{
selected: o === "bar" && k,
onClick: B,
icon: W,
iconName: "chart-bar-stacked"
},
n.toLanguageString(w, c.barChartStackedBar)
), /* @__PURE__ */ a.createElement(
s,
{
selected: o === "bar" && p,
onClick: u,
icon: v,
iconName: "chart-bar-stacked100"
},
n.toLanguageString(z, c.barChart100StackedBar)
))))
);
};
export {
M as BarChartPanel
};