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

81 lines (80 loc) 2.97 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 l from "react"; import { ChartWizardCommon as o } from "@progress/kendo-charts"; import { exportVisual as c } from "@progress/kendo-react-charts"; import { exportPDF as u, exportSVG as d, exportImage as g } from "@progress/kendo-drawing"; import { saveAs as i } from "@progress/kendo-file-saver"; const k = (t) => { t.stopPropagation(); }, n = { fileName: "chart", pdf: { paperSize: "A4", margin: "1cm" }, image: { width: 800, height: 600 } }, I = (t = {}) => ({ fileName: t.fileName || n.fileName, pdf: { ...n.pdf, ...t.pdf }, image: { ...n.image, ...t.image } }), E = (t) => { const e = c(t.chart), a = t.exportOptions; e && u(e, a.pdf).then((s) => i(s, a.fileName + ".pdf")); }, C = (t) => { const e = c(t.chart), a = t.exportOptions; e && d(e).then((s) => i(s, a.fileName + ".svg")); }, V = (t) => { const e = t.exportOptions, a = c(t.chart, e.image); a && g(a, e.image).then((s) => i(s, e.fileName + ".png")); }, v = { value: null, text: "" }, F = (t, e) => e.dataItem.style ? l.cloneElement(t, t.props, /* @__PURE__ */ l.createElement("span", { style: e.dataItem.style }, t.props.children)) : t, h = /^\d+$/, A = (t) => { if (t.text === "") return !0; if (t.value === void 0) { if (!h.test(t.text)) return !1; t.value = t.text + "px"; } return r.find((a) => a.value === t.value) || (r.push(t), r.sort((a, s) => parseInt(a.text, 10) - parseInt(s.text, 10))), !0; }, D = { fillMode: "outline", popupSettings: { animate: !1 } }, P = { type: "normal" }, R = { type: "100%" }, w = (t) => { var p, m; const e = typeof ((p = t.series[0]) == null ? void 0 : p.stack) == "object" ? (m = t.series[0]) == null ? void 0 : m.stack : !1, a = e === !1, s = e && e.type === "normal", f = e && e.type === "100%"; return { isStackFalse: a, isStackNormal: s, isStack100: f }; }, r = o.fontSizes, O = o.fontNames, b = o.createInitialState, G = (t, e) => o.createState(t, e), T = o.updateState, W = o.mergeStates, j = o.isCategorical, M = o.parseFont, $ = o.ActionTypes, { getWizardDataFromDataRows: q } = o; export { $ as ActionTypes, b as createInitialState, G as createState, D as dropdownlistCommonProps, A as ensureValue, O as fontNames, r as fontSizes, q as getWizardDataFromDataRows, V as handleImageExport, E as handlePDFExport, C as handleSVGExport, j as isCategorical, F as itemRender, W as mergeStates, v as nullItem, M as parseFont, I as resolveExportOptions, R as stack100, P as stackNormal, w as stackState, k as stopPropagation, T as updateState };