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

74 lines (73 loc) 2.73 kB
/** * @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 e from "react"; import { Reveal as E } from "@progress/kendo-react-animation"; import { useLocalization as f } from "@progress/kendo-react-intl"; import { ExpansionPanel as y, ExpansionPanelContent as T } from "@progress/kendo-react-layout"; import { stackState as N, mergeStates as r, createState as s, updateState as S, ActionTypes as d, stackNormal as I, stack100 as A } from "../../utils.mjs"; import { lineChart as P, messages as c, lineChartLine as b, lineChartStackedLine as w, lineChart100StackedLine as z } from "../../messages.mjs"; import { SeriesTypesWrap as R } from "../SeriesTypesWrap.mjs"; import { SeriesTypeButton as l } from "../SeriesTypeButton.mjs"; import { chartLineIcon as W, chartLineStackedIcon as v, chartLineStacked100Icon as B } from "@progress/kendo-svg-icons"; const M = (a) => { const i = f(), t = a.state, o = t.seriesType, { isStackFalse: h, isStackNormal: k, isStack100: p } = N(t), [m, L] = e.useState(!0), C = e.useCallback((n) => { L(!n.expanded); }, []), g = () => { a.onStateChange(r(t, s(t.data, "line"))); }, u = () => { const n = r(t, s(t.data, "line")); a.onStateChange(S(n, d.stacked, I)); }, x = () => { const n = r(t, s(t.data, "line")); a.onStateChange(S(n, d.stacked, A)); }; return /* @__PURE__ */ e.createElement( y, { style: { maxWidth: "576px" }, title: i.toLanguageString(P, c.lineChart), expanded: m, tabIndex: 0, onAction: C }, /* @__PURE__ */ e.createElement(E, null, m && /* @__PURE__ */ e.createElement(T, null, /* @__PURE__ */ e.createElement(R, null, /* @__PURE__ */ e.createElement( l, { selected: o === "line" && h, onClick: g, icon: W, iconName: "chart-line" }, i.toLanguageString(b, c.lineChartLine) ), /* @__PURE__ */ e.createElement( l, { selected: o === "line" && k, onClick: u, icon: v, iconName: "chart-line-stacked" }, i.toLanguageString(w, c.lineChartStackedLine) ), /* @__PURE__ */ e.createElement( l, { selected: o === "line" && p, onClick: x, icon: B, iconName: "chart-line-stacked100" }, i.toLanguageString( z, c.lineChart100StackedLine ) )))) ); }; export { M as LineChartPanel };