vue-data-ui 2.4.30 → 2.4.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Arrow-C1JInH5c.cjs → Arrow-CXG3oU5I.cjs} +1 -1
- package/dist/{Arrow-CD2z9Tg-.js → Arrow-QIMHxUlF.js} +1 -1
- package/dist/{BaseIcon-DhtLFdWL.js → BaseIcon-CrzGahaK.js} +1 -1
- package/dist/{BaseIcon-mllLG7DC.cjs → BaseIcon-DuQm27GL.cjs} +1 -1
- package/dist/{DataTable-D2HIFrne.js → DataTable-Ci7Hxwni.js} +2 -2
- package/dist/{DataTable-CFqyTcn8.cjs → DataTable-DOjri-Qa.cjs} +1 -1
- package/dist/{Legend-avxhO8XI.js → Legend-D2OrVhyH.js} +1 -1
- package/dist/{Legend-pgTgfe5J.cjs → Legend-DLz6uwmt.cjs} +1 -1
- package/dist/{PackageVersion-B9X8pKiF.cjs → PackageVersion-DtCIEusI.cjs} +1 -1
- package/dist/{PackageVersion-Dyd8i_Pz.js → PackageVersion-jcUUbnGR.js} +1 -1
- package/dist/{PenAndPaper-oAikdUUx.cjs → PenAndPaper-ManFh1Ds.cjs} +1 -1
- package/dist/{PenAndPaper-C8wp4vgv.js → PenAndPaper-R8H8qKoM.js} +3 -3
- package/dist/{Shape-85jCQ5i0.js → Shape-CRnc_lrZ.js} +1 -1
- package/dist/{Shape-DbpDY-Pa.cjs → Shape-D-7juIxK.cjs} +1 -1
- package/dist/{Slicer-Cat5TU9p.cjs → Slicer-phJkSRGC.cjs} +1 -1
- package/dist/{Slicer-CyNERdvt.js → Slicer-vyHfQqB0.js} +2 -2
- package/dist/{Title-DvefE4KM.cjs → Title-ClPXaj_S.cjs} +1 -1
- package/dist/{Title-Cj4gbeoE.js → Title-kiBjyWrd.js} +1 -1
- package/dist/{Tooltip-T84O8ozr.js → Tooltip-3XuY4gCn.js} +1 -1
- package/dist/{Tooltip-BSs2B4GJ.cjs → Tooltip-BMKpn2T1.cjs} +1 -1
- package/dist/{index-CA5O1q_K.js → index-CvGoB7HV.js} +6 -2
- package/dist/index-pevhrKCt.cjs +9 -0
- package/dist/style.css +1 -1
- package/dist/types/vue-data-ui.d.cts +4 -0
- package/dist/types/vue-data-ui.d.ts +4 -0
- package/dist/{useNestedProp-1Z2CRcD3.js → useNestedProp-CX0uXnyy.js} +1 -1
- package/dist/{useNestedProp-Dv37rqyp.cjs → useNestedProp-W1Kamknp.cjs} +1 -1
- package/dist/{usePrinter-BegBRA7j.js → usePrinter-B0E13IH3.js} +1 -1
- package/dist/{usePrinter-B9bLOCNs.cjs → usePrinter-CWosF8e1.cjs} +1 -1
- package/dist/{vue-data-ui-iUN-EQg5.cjs → vue-data-ui-DQ5n-X7_.cjs} +1 -1
- package/dist/{vue-data-ui-CAQKItKc.js → vue-data-ui-DuqOAkYZ.js} +60 -60
- package/dist/vue-data-ui.cjs +1 -1
- package/dist/vue-data-ui.js +1 -1
- package/dist/{vue-ui-3d-bar-COfvjBJt.cjs → vue-ui-3d-bar--Sq-9DBy.cjs} +1 -1
- package/dist/{vue-ui-3d-bar-C0ijUHyE.js → vue-ui-3d-bar-UJ22SecW.js} +9 -9
- package/dist/{vue-ui-accordion-B7npnyxi.js → vue-ui-accordion-BUQB7L1N.js} +3 -3
- package/dist/{vue-ui-accordion-C2Jw7_0r.cjs → vue-ui-accordion-lQ9g-y51.cjs} +1 -1
- package/dist/{vue-ui-age-pyramid-B5yXBmZT.js → vue-ui-age-pyramid-D9I4gQq6.js} +10 -10
- package/dist/{vue-ui-age-pyramid-BDTNgsVs.cjs → vue-ui-age-pyramid-DTY8e2J2.cjs} +1 -1
- package/dist/{vue-ui-annotator-DjHdhDHb.cjs → vue-ui-annotator-2fV5QUzK.cjs} +1 -1
- package/dist/{vue-ui-annotator-Ci0cJcgH.js → vue-ui-annotator-3ObkNYnS.js} +1 -1
- package/dist/{vue-ui-bullet-Dvbuu8O_.cjs → vue-ui-bullet-BPti0Lko.cjs} +1 -1
- package/dist/{vue-ui-bullet-c-8QCDuz.js → vue-ui-bullet-DK647q4U.js} +8 -8
- package/dist/{vue-ui-candlestick-R1-xDGG-.cjs → vue-ui-candlestick-Cktgtv5I.cjs} +1 -1
- package/dist/{vue-ui-candlestick-D7N9jN_g.js → vue-ui-candlestick-VUfVtrRS.js} +11 -11
- package/dist/{vue-ui-carousel-table-B0fuhevg.js → vue-ui-carousel-table-BmuVAsMK.js} +4 -4
- package/dist/{vue-ui-carousel-table-DOog0eOZ.cjs → vue-ui-carousel-table-DK_RUZTR.cjs} +1 -1
- package/dist/{vue-ui-chestnut-DHnrTpBO.js → vue-ui-chestnut-Cefh_esF.js} +8 -8
- package/dist/{vue-ui-chestnut-92CmPZQu.cjs → vue-ui-chestnut-Chzo4p8d.cjs} +1 -1
- package/dist/{vue-ui-cursor-Dmz0Oe6_.cjs → vue-ui-cursor-CRWJsbUH.cjs} +1 -1
- package/dist/{vue-ui-cursor-DsXhTl5Y.js → vue-ui-cursor-CfVU0XLg.js} +2 -2
- package/dist/{vue-ui-dashboard-Daajlgkj.js → vue-ui-dashboard-D4nAhLs2.js} +2 -2
- package/dist/{vue-ui-dashboard-C4uwjBox.cjs → vue-ui-dashboard-ersmE94F.cjs} +1 -1
- package/dist/{vue-ui-digits-a6xrjQ-9.js → vue-ui-digits-AUkousb8.js} +2 -2
- package/dist/{vue-ui-digits-BmMjjI2C.cjs → vue-ui-digits-CfXEtJrD.cjs} +1 -1
- package/dist/{vue-ui-donut-Dgo6346x.cjs → vue-ui-donut-2Ny1SUMJ.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-DDfYhRHm.js → vue-ui-donut-evolution-6zjC9jx2.js} +11 -11
- package/dist/{vue-ui-donut-evolution-DGnSMwsW.cjs → vue-ui-donut-evolution-DAH_Ft4g.cjs} +1 -1
- package/dist/{vue-ui-donut-CN-Hvmzq.js → vue-ui-donut-zj-ed72I.js} +11 -11
- package/dist/{vue-ui-dumbbell-_3XlWdxd.cjs → vue-ui-dumbbell-BnSZATTl.cjs} +1 -1
- package/dist/{vue-ui-dumbbell-Con4ggQx.js → vue-ui-dumbbell-fXulafsh.js} +10 -10
- package/dist/{vue-ui-flow-wxlspXc8.js → vue-ui-flow-BSyuU8i2.js} +9 -9
- package/dist/{vue-ui-flow-KY0HZ4Gy.cjs → vue-ui-flow-Dl7Er9Fg.cjs} +1 -1
- package/dist/{vue-ui-funnel-DIumLTLK.cjs → vue-ui-funnel-DTr5hAbC.cjs} +1 -1
- package/dist/{vue-ui-funnel-Bx0jkqtl.js → vue-ui-funnel-U2u7f4nF.js} +8 -8
- package/dist/{vue-ui-galaxy-rjvwQX41.js → vue-ui-galaxy-95zf-0pu.js} +11 -11
- package/dist/{vue-ui-galaxy-BfL44IiF.cjs → vue-ui-galaxy-Clf7Thxm.cjs} +1 -1
- package/dist/{vue-ui-gauge-lTlx6O9_.js → vue-ui-gauge-B1LuU1TF.js} +7 -7
- package/dist/{vue-ui-gauge-V3LNWOSj.cjs → vue-ui-gauge-Bc_6z8MM.cjs} +1 -1
- package/dist/{vue-ui-gizmo-DXeWCiC7.cjs → vue-ui-gizmo-BKcH6y9h.cjs} +1 -1
- package/dist/{vue-ui-gizmo-D5FeSwxI.js → vue-ui-gizmo-BbnhLO7v.js} +3 -3
- package/dist/{vue-ui-heatmap-Dpys2OIy.js → vue-ui-heatmap-B8D6rFuo.js} +10 -10
- package/dist/{vue-ui-heatmap-BCdiFGA3.cjs → vue-ui-heatmap-wThrbp2y.cjs} +1 -1
- package/dist/{vue-ui-history-plot-BkNgHWMo.js → vue-ui-history-plot-DHqPPsby.js} +11 -11
- package/dist/{vue-ui-history-plot-BfAFVNMu.cjs → vue-ui-history-plot-Du6BpPO8.cjs} +1 -1
- package/dist/{vue-ui-kpi-BcZ3e-UJ.cjs → vue-ui-kpi-DkRaElAh.cjs} +1 -1
- package/dist/{vue-ui-kpi-Cu_DFE58.js → vue-ui-kpi-RUTc1zZ1.js} +3 -3
- package/dist/{vue-ui-mini-loader-DX9eBQLd.cjs → vue-ui-mini-loader-D5Hv9AE1.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-Bc1mEZRk.js → vue-ui-mini-loader-DQGdzjoh.js} +2 -2
- package/dist/{vue-ui-molecule-DizIwNsN.cjs → vue-ui-molecule-Advjrpkd.cjs} +1 -1
- package/dist/{vue-ui-molecule-RQ7DnbBA.js → vue-ui-molecule-CCkCgYiQ.js} +11 -11
- package/dist/{vue-ui-mood-radar-vXQjUb2N.js → vue-ui-mood-radar-A1HX-fO6.js} +11 -11
- package/dist/{vue-ui-mood-radar-DmpE1OcB.cjs → vue-ui-mood-radar-UqW_FkR1.cjs} +1 -1
- package/dist/{vue-ui-nested-donuts-DkWeSi8F.cjs → vue-ui-nested-donuts-DU1zQQ2I.cjs} +1 -1
- package/dist/{vue-ui-nested-donuts-3V05WHfb.js → vue-ui-nested-donuts-DpiN4bE2.js} +11 -11
- package/dist/{vue-ui-onion-DLRhdjGT.cjs → vue-ui-onion-DZEZD7Ou.cjs} +1 -1
- package/dist/{vue-ui-onion-B5cCbDcm.js → vue-ui-onion-GkXZAubG.js} +11 -11
- package/dist/{vue-ui-parallel-coordinate-plot-DH7inXdV.js → vue-ui-parallel-coordinate-plot-CyfYvoFb.js} +12 -12
- package/dist/{vue-ui-parallel-coordinate-plot-CLI4Ks8L.cjs → vue-ui-parallel-coordinate-plot-DRyp43eB.cjs} +1 -1
- package/dist/{vue-ui-quadrant-B8ip8oOh.cjs → vue-ui-quadrant-C0mMqlYO.cjs} +1 -1
- package/dist/{vue-ui-quadrant-CCymaN8B.js → vue-ui-quadrant-CBizJei-.js} +12 -12
- package/dist/{vue-ui-quick-chart-JUOHXrfR.js → vue-ui-quick-chart-BQUIJ-b8.js} +9 -9
- package/dist/{vue-ui-quick-chart-Bb1aEgcM.cjs → vue-ui-quick-chart-DWkNGQxK.cjs} +1 -1
- package/dist/{vue-ui-radar-CuvI1qIA.cjs → vue-ui-radar-CnRyhlCV.cjs} +1 -1
- package/dist/{vue-ui-radar-BfHGqfki.js → vue-ui-radar-Cppyq799.js} +12 -12
- package/dist/{vue-ui-rating-BfH3_PCv.js → vue-ui-rating-CZO8q8zK.js} +2 -2
- package/dist/{vue-ui-rating-DInI13cU.cjs → vue-ui-rating-D9W5Iwav.cjs} +1 -1
- package/dist/{vue-ui-relation-circle-CIr8Hrbf.js → vue-ui-relation-circle-BPxV0AjU.js} +7 -7
- package/dist/{vue-ui-relation-circle-CdgXvm2W.cjs → vue-ui-relation-circle-D0d5o7RM.cjs} +1 -1
- package/dist/{vue-ui-rings-DRDSLp_E.cjs → vue-ui-rings-Cy4xmVtI.cjs} +1 -1
- package/dist/{vue-ui-rings-RmS4dIPv.js → vue-ui-rings-DXkKLDDs.js} +11 -11
- package/dist/{vue-ui-scatter-B_EFf4Il.cjs → vue-ui-scatter-CPiTGVQs.cjs} +1 -1
- package/dist/{vue-ui-scatter-B7tHbxzv.js → vue-ui-scatter-D0RmI4xI.js} +12 -12
- package/dist/{vue-ui-screenshot-BZ3WpyIB.cjs → vue-ui-screenshot-BkpjzCgh.cjs} +1 -1
- package/dist/{vue-ui-screenshot-Bc04rNOg.js → vue-ui-screenshot-HzRUu6hy.js} +1 -1
- package/dist/{vue-ui-skeleton-B7J2yMKB.js → vue-ui-skeleton-CL1iMZq4.js} +3 -3
- package/dist/{vue-ui-skeleton-CoYx8g2U.cjs → vue-ui-skeleton-ClN7paFX.cjs} +1 -1
- package/dist/{vue-ui-smiley-D4im-772.cjs → vue-ui-smiley-4k4qrQsY.cjs} +1 -1
- package/dist/{vue-ui-smiley-CcopqUrY.js → vue-ui-smiley-CtbDdNn-.js} +2 -2
- package/dist/{vue-ui-spark-trend-Cm8i1ssl.cjs → vue-ui-spark-trend-DdknPxBq.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-DyVlu_rp.js → vue-ui-spark-trend-JrvQqvUR.js} +5 -5
- package/dist/{vue-ui-sparkbar-DOHPgJ-s.cjs → vue-ui-sparkbar-BRVM6ogQ.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-9i-tTNlo.js → vue-ui-sparkbar-CITRjO-b.js} +4 -4
- package/dist/{vue-ui-sparkgauge-Dgd30yg2.js → vue-ui-sparkgauge-CaX5fEh-.js} +4 -4
- package/dist/{vue-ui-sparkgauge-DaIZDKVf.cjs → vue-ui-sparkgauge-znX-i3u6.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram-DyieYAjK.cjs → vue-ui-sparkhistogram-CoaGHRAt.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram-DQ7IZGcl.js → vue-ui-sparkhistogram-n-m0glrd.js} +5 -5
- package/dist/{vue-ui-sparkline-DFZXBUiw.cjs → vue-ui-sparkline-BvODdDld.cjs} +1 -1
- package/dist/{vue-ui-sparkline-IQqmF2b3.js → vue-ui-sparkline-CefMHPwy.js} +4 -4
- package/dist/{vue-ui-sparkstackbar-DRkogPx7.cjs → vue-ui-sparkstackbar-DR8PrY0T.cjs} +1 -1
- package/dist/{vue-ui-sparkstackbar-DI6Q6LLs.js → vue-ui-sparkstackbar-EZj68Hb2.js} +5 -5
- package/dist/{vue-ui-stackbar-C9jaa3sx.cjs → vue-ui-stackbar-B1BXQsQx.cjs} +1 -1
- package/dist/{vue-ui-stackbar-DuMWMIsb.js → vue-ui-stackbar-EQTJgOkI.js} +12 -12
- package/dist/{vue-ui-strip-plot-hN_eWAYk.js → vue-ui-strip-plot-B7MAnSSN.js} +11 -11
- package/dist/{vue-ui-strip-plot-CX6E9-SH.cjs → vue-ui-strip-plot-CJX3Lky5.cjs} +1 -1
- package/dist/{vue-ui-table-gjhYkFgu.js → vue-ui-table-1UQmypwh.js} +1 -1
- package/dist/{vue-ui-table-cJs41gfD.cjs → vue-ui-table-BxvsPQ1X.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-CLqstt5Y.js → vue-ui-table-heatmap-BtDlTgZR.js} +4 -4
- package/dist/{vue-ui-table-heatmap-C4pnujLB.cjs → vue-ui-table-heatmap-DiyNazej.cjs} +1 -1
- package/dist/vue-ui-table-sparkline-1xCAvzwF.cjs +1 -0
- package/dist/{vue-ui-table-sparkline-CCldQeDk.js → vue-ui-table-sparkline-C-1xEsY5.js} +46 -46
- package/dist/{vue-ui-thermometer-WqkK_Qwq.js → vue-ui-thermometer-QjJqj3md.js} +7 -7
- package/dist/{vue-ui-thermometer-CB6bQuHD.cjs → vue-ui-thermometer-w-gA0fYI.cjs} +1 -1
- package/dist/{vue-ui-timer-BdznIcsH.cjs → vue-ui-timer-Cr7VOKJn.cjs} +1 -1
- package/dist/{vue-ui-timer-DDrYwcMr.js → vue-ui-timer-qeu0VkSe.js} +5 -5
- package/dist/{vue-ui-tiremarks-B3uR2KMW.cjs → vue-ui-tiremarks-BwLJ02Xt.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-B3RR46OP.js → vue-ui-tiremarks-DPYtCy43.js} +7 -7
- package/dist/{vue-ui-treemap-AHeZLovv.js → vue-ui-treemap-Cx6lxW9f.js} +11 -11
- package/dist/{vue-ui-treemap-P5o4X0mH.cjs → vue-ui-treemap-hXResC3U.cjs} +1 -1
- package/dist/{vue-ui-vertical-bar-CrkE4hdH.cjs → vue-ui-vertical-bar-BKQ-LJsl.cjs} +1 -1
- package/dist/{vue-ui-vertical-bar-BsW4y0V9.js → vue-ui-vertical-bar-CKvNvX0w.js} +11 -11
- package/dist/{vue-ui-waffle-CZmPj6Q2.js → vue-ui-waffle-BN6ypt3s.js} +11 -11
- package/dist/{vue-ui-waffle-DdFvlJGb.cjs → vue-ui-waffle-DbNVAJem.cjs} +1 -1
- package/dist/{vue-ui-wheel-C6kSNE6g.js → vue-ui-wheel-BeUDvHlO.js} +7 -7
- package/dist/{vue-ui-wheel-dj1Arz4A.cjs → vue-ui-wheel-C7-sxKMS.cjs} +1 -1
- package/dist/{vue-ui-word-cloud-CM7AobHC.js → vue-ui-word-cloud-B38L-Gln.js} +10 -10
- package/dist/{vue-ui-word-cloud-DntzuEYb.cjs → vue-ui-word-cloud-DjurUQNC.cjs} +1 -1
- package/dist/{vue-ui-xy-C9UifOn1.cjs → vue-ui-xy-BRKK0rPh.cjs} +1 -1
- package/dist/{vue-ui-xy-Xe2hRyTU.js → vue-ui-xy-Bz6b1fhr.js} +14 -14
- package/dist/{vue-ui-xy-canvas-DQtAkK_R.cjs → vue-ui-xy-canvas-BMivim9w.cjs} +1 -1
- package/dist/{vue-ui-xy-canvas-ptIXUQE7.js → vue-ui-xy-canvas-BnWZcVXD.js} +11 -11
- package/package.json +1 -1
- package/dist/index-C8hC7bb2.cjs +0 -9
- package/dist/vue-ui-table-sparkline--Z8aMfMT.cjs +0 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { computed as _, ref as d, onMounted as tt, onBeforeUnmount as lt, watch as Be, openBlock as o, createElementBlock as s, normalizeClass as ce, normalizeStyle as Y, createBlock as V, createCommentVNode as i, renderSlot as m, unref as n, createSlots as at, withCtx as P, normalizeProps as U, guardReactiveProps as E, createVNode as Me, createElementVNode as h, Fragment as w, renderList as X, toDisplayString as x, createTextVNode as Ge, nextTick as ot, pushScopeId as ut, popScopeId as st } from "vue";
|
|
2
|
-
import { u as nt, o as rt, e as Ve, g as it, c as vt, b as ct, d as je, p as j, m as dt, G as ht, f as L, X as yt, s as ee, w as ft, j as pt, H as F, i as A, k as b, n as te, t as gt, a as bt, x as mt, q as wt, r as kt } from "./index-
|
|
2
|
+
import { u as nt, o as rt, e as Ve, g as it, c as vt, b as ct, d as je, p as j, m as dt, G as ht, f as L, X as yt, s as ee, w as ft, j as pt, H as F, i as A, k as b, n as te, t as gt, a as bt, x as mt, q as wt, r as kt } from "./index-CvGoB7HV.js";
|
|
3
3
|
import { t as _t, u as xt } from "./useResponsive-CoxXLe23.js";
|
|
4
|
-
import { _ as Ct } from "./Title-
|
|
5
|
-
import { u as $t, U as Pt } from "./usePrinter-
|
|
6
|
-
import { D as St } from "./DataTable-
|
|
7
|
-
import { _ as Lt } from "./Tooltip-
|
|
8
|
-
import { L as Ft } from "./Legend-
|
|
9
|
-
import Tt from "./vue-ui-skeleton-
|
|
10
|
-
import zt from "./vue-ui-accordion-
|
|
11
|
-
import { u as He } from "./useNestedProp-
|
|
12
|
-
import { _ as Yt } from "./PackageVersion-
|
|
13
|
-
import { P as At } from "./PenAndPaper-
|
|
4
|
+
import { _ as Ct } from "./Title-kiBjyWrd.js";
|
|
5
|
+
import { u as $t, U as Pt } from "./usePrinter-B0E13IH3.js";
|
|
6
|
+
import { D as St } from "./DataTable-Ci7Hxwni.js";
|
|
7
|
+
import { _ as Lt } from "./Tooltip-3XuY4gCn.js";
|
|
8
|
+
import { L as Ft } from "./Legend-D2OrVhyH.js";
|
|
9
|
+
import Tt from "./vue-ui-skeleton-CL1iMZq4.js";
|
|
10
|
+
import zt from "./vue-ui-accordion-BUQB7L1N.js";
|
|
11
|
+
import { u as He } from "./useNestedProp-CX0uXnyy.js";
|
|
12
|
+
import { _ as Yt } from "./PackageVersion-jcUUbnGR.js";
|
|
13
|
+
import { P as At } from "./PenAndPaper-R8H8qKoM.js";
|
|
14
14
|
import { _ as Nt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
15
15
|
const Ot = (W) => (ut("data-v-897a9187"), W = W(), st(), W), Xt = ["id"], It = ["xmlns", "viewBox"], Dt = { key: 0 }, Bt = ["id"], Mt = ["stop-color"], Gt = ["offset", "stop-color"], Vt = ["offset", "stop-color"], jt = ["stop-color"], Ht = { key: 1 }, Rt = ["id", "cx", "cy"], Ut = ["stop-color", "stop-opacity"], Et = ["stop-color"], Wt = ["id"], qt = ["id"], Jt = /* @__PURE__ */ Ot(() => /* @__PURE__ */ h("feColorMatrix", {
|
|
16
16
|
type: "saturate",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-C8hC7bb2.cjs"),Y=require("./useResponsive-BJ7DTGpm.cjs"),ne=require("./Title-DvefE4KM.cjs"),Z=require("./usePrinter-B9bLOCNs.cjs"),ue=require("./DataTable-CFqyTcn8.cjs"),ce=require("./vue-ui-skeleton-CoYx8g2U.cjs"),ie=require("./Legend-pgTgfe5J.cjs"),de=require("./vue-ui-accordion-C2Jw7_0r.cjs"),J=require("./useNestedProp-Dv37rqyp.cjs"),ve=require("./PackageVersion-B9X8pKiF.cjs"),he=require("./PenAndPaper-oAikdUUx.cjs"),ye=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),fe=["id"],me=["xmlns","viewBox"],be={key:0},pe=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],ge={key:1},ke=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],_e=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],xe={key:2},Ce=["x","y","font-size","fill","font-weight"],we=["x","y","font-size","fill"],Be={key:3},Ne=["x","y","font-size","fill","font-weight"],Ee=["id"],$e=["stop-color"],Le=["stop-color"],Ve=["stop-color"],Se=["id"],ze=["stop-color"],Ae=["stop-color"],Pe=["stop-color"],Te=["id"],Xe=["stop-color"],De=["stop-color"],Fe=["id"],Me=["stop-color"],Ge=["stop-color"],Ie={key:0},Oe=["d","fill"],qe={key:1},He=["x","y","height","width","fill"],Re=["cx","cy","r","fill","stroke","stroke-width"],We=["cx","cy","r","fill","stroke","stroke-width"],Ue={key:2},je=["x","y","fill","font-size"],Ye={key:3},Ze=["x","y","fill","font-size"],Je={key:5,class:"vue-data-ui-watermark"},Ke=["xmlns","height","width"],Qe=["fill"],et=["innerHTML"],tt={__name:"vue-ui-dumbbell",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(K,{expose:Q,emit:at}){const y=K,{vue_ui_dumbbell:ee}=s.useConfig(),b=e.computed({get(){return!!y.dataset&&y.dataset.length},set(a){return a}}),d=e.ref(s.createUid()),V=e.ref(0),p=e.ref(null),S=e.ref(null),z=e.ref(null),A=e.ref(null),P=e.ref(null),T=e.ref(0),X=e.ref(0),D=e.ref(0),t=e.computed({get:()=>F(),set:a=>a});function F(){const a=J.useNestedProp({userConfig:y.config,defaultConfig:ee});return a.theme?{...J.useNestedProp({userConfig:s.themes.vue_ui_dumbbell[a.theme]||y.config,defaultConfig:a})}:a}e.watch(()=>y.config,a=>{t.value=F(),M(),T.value+=1,X.value+=1,D.value+=1,i.value=t.value.style.chart.rowHeight,g.value=t.value.style.chart.width},{deep:!0}),e.watch(()=>y.dataset,a=>{R()},{deep:!0});const _=e.ref(null);e.onMounted(()=>{M()});function M(){if(s.objectIsEmpty(y.dataset)?s.error({componentName:"VueUiDumbbell",type:"dataset"}):y.dataset.forEach((a,n)=>{s.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["name","start","end"]}).forEach(l=>{b.value=!1,s.error({componentName:"VueUiDumbbell",type:"datasetSerieAttribute",property:l,index:n})})}),t.value.responsive){const a=Y.throttle(()=>{const{width:n,height:l}=Y.useResponsive({chart:p.value,title:t.value.style.chart.title.text?S.value:null,legend:t.value.style.chart.legend.show?z.value:null,source:A.value,noTitle:P.value});g.value=n,i.value=l/y.dataset.length,v.value=C()});_.value=new ResizeObserver(a),_.value.observe(p.value.parentNode)}}e.onBeforeUnmount(()=>{_.value&&_.value.disconnect()});const{isPrinting:G,isImaging:I,generatePdf:O,generateImage:q}=Z.usePrinter({elementId:`dumbbell_${d.value}`,fileName:t.value.style.chart.title.text||"vue-ui-dumbbell"}),te=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),x=e.ref({showTable:t.value.table.show}),f=e.computed(()=>y.dataset.map((a,n)=>({...a,start:s.checkNaN(a.start),end:s.checkNaN(a.end),id:s.createUid()}))),E=e.computed(()=>({max:Math.max(...f.value.flatMap(a=>[a.start,a.end])),min:Math.min(...f.value.flatMap(a=>[a.start,a.end]))})),c=e.computed(()=>s.calculateNiceScale(E.value.min<0?E.value.min:0,E.value.max,t.value.style.chart.grid.scaleSteps)),i=e.ref(t.value.style.chart.rowHeight),g=e.ref(t.value.style.chart.width),r=e.computed(()=>{const a=i.value,n=t.value.style.chart.padding.left+t.value.style.chart.padding.right+g.value,l=t.value.style.chart.padding.top+t.value.style.chart.padding.bottom+a*y.dataset.length,o=c.value.ticks.length*(g.value/c.value.ticks.length);return{left:t.value.style.chart.padding.left,right:n-t.value.style.chart.padding.right,top:t.value.style.chart.padding.top,bottom:l-t.value.style.chart.padding.bottom,width:g.value,height:a*y.dataset.length,rowHeight:a,absoluteHeight:l,absoluteWidth:n,widthPlotReference:o}});function C(){return f.value.map((a,n)=>{const l=r.value.left+(a.start+Math.abs(c.value.min))/(c.value.max+Math.abs(c.value.min))*r.value.widthPlotReference,o=r.value.left+(a.end+Math.abs(c.value.min))/(c.value.max+Math.abs(c.value.min))*r.value.widthPlotReference,u=l+(o-l)/2;return{...a,startX:l,endX:o,centerX:u,y:r.value.top+n*i.value+i.value/2,endVal:a.start}})}const v=e.ref([]),H=e.ref(null),le=e.computed(()=>f.value.map(a=>a.end).reduce((a,n)=>a+n,0));e.onMounted(()=>{R()});function R(){v.value=C();let a=v.value.map(l=>l.start).reduce((l,o)=>l+o,0);function n(){const l=f.value.map(o=>o.end-o.start);a>=le.value?(cancelAnimationFrame(H.value),v.value=C()):(v.value=v.value.map((o,u)=>{o.endVal+=l[u]*(t.value.animationSpeed/100);const h=r.value.left+(o.start+Math.abs(c.value.min))/(c.value.max+Math.abs(c.value.min))*r.value.widthPlotReference,N=r.value.left+(o.endVal+Math.abs(c.value.min))/(c.value.max+Math.abs(c.value.min))*r.value.widthPlotReference,L=h+(N-h)/2;return{...o,startX:h,endX:N,centerX:L,y:r.value.top+u*i.value+i.value/2,endVal:o.endVal}}),a=v.value.map(o=>o.endVal).reduce((o,u)=>o+u,0),H.value=requestAnimationFrame(n))}t.value.useAnimation?n():v.value=C()}const W=e.computed(()=>[{name:t.value.style.chart.legend.labelStart,color:t.value.style.chart.plots.gradient.show?`url(#start_grad_${d.value})`:t.value.style.chart.plots.startColor},{name:t.value.style.chart.legend.labelEnd,color:t.value.style.chart.plots.gradient.show?`url(#end_grad_${d.value})`:t.value.style.chart.plots.endColor}]),ae=e.computed(()=>({cy:"donut-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,paddingTop:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),m=e.computed(()=>{const a=v.value.map(l=>({name:l.name})),n=v.value.map(l=>({start:l.start,end:l.end}));return{head:a,body:n}}),w=e.computed(()=>{const a=[t.value.table.columnNames.series,t.value.table.columnNames.start,t.value.table.columnNames.end,t.value.table.columnNames.progression],n=m.value.head.map((u,h)=>{const N=s.dataLabel({p:t.value.style.chart.labels.prefix,v:m.value.body[h].start,s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue}),L=s.dataLabel({p:t.value.style.chart.labels.prefix,v:m.value.body[h].end,s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue}),se=s.dataLabel({v:100*(m.value.body[h].end/m.value.body[h].start-1),s:"%",r:t.value.table.td.roundingPercentage});return[{name:u.name},N,L,se]}),l={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.start,t.value.table.columnNames.end,t.value.table.columnNames.progression],head:a,body:n,config:l}});function U(){e.nextTick(()=>{const a=m.value.head.map((o,u)=>[[o.name],[m.value.body[u].start],[m.value.body[u].end]]),n=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.series],[t.value.table.columnNames.start],[t.value.table.columnNames.end]]].concat(a),l=s.createCsvContent(n);s.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-dumbbell"})})}const k=e.ref(!1);function oe(a){k.value=a,V.value+=1}function re(){return v.value}function j(){x.value.showTable=!x.value.showTable}const B=e.ref(!1);function $(){B.value=!B.value}return Q({getData:re,generatePdf:O,generateCsv:U,generateImage:q,toggleTable:j,toggleAnnotator:$}),(a,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"dumbbellChart",ref:p,class:e.normalizeClass(`vue-ui-dumbbell ${k.value?"vue-data-ui-wrapper-fullscreen":""}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height:100%":""}`),id:`dumbbell_${d.value}`},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(he.PenAndPaper,{key:0,parent:p.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:B.value,onClose:$},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),te.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:P,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:S,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(ne._sfc_main,{key:`title_${T.value}`,config:{title:{cy:"donut-div-title",...t.value.style.chart.title},subtitle:{cy:"donut-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&b.value?(e.openBlock(),e.createBlock(Z.UserOptions,{ref:"details",key:`user_option_${V.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(G),isImaging:e.unref(I),uid:d.value,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:k.value,titles:{...t.value.userOptions.buttonTitles},chartElement:p.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:B.value,onToggleFullscreen:oe,onGeneratePdf:e.unref(O),onGenerateCsv:U,onGenerateImage:e.unref(q),onToggleTable:j,onToggleAnnotator:$},e.createSlots({_:2},[a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,a.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:o})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:o})),void 0,!0)]),key:"4"}:void 0,a.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:o})=>[e.renderSlot(a.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:o})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(s.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":k.value,"vue-data-ui-fulscreen--off":!k.value}),viewBox:`0 0 ${r.value.absoluteWidth<=0?10:r.value.absoluteWidth} ${r.value.absoluteHeight<=0?10:r.value.absoluteHeight}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(ve._sfc_main),t.value.style.chart.grid.verticalGrid.show?(e.openBlock(),e.createElementBlock("g",be,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value.ticks,(l,o)=>(e.openBlock(),e.createElementBlock("line",{x1:r.value.left+o*r.value.width/(c.value.ticks.length-1),x2:r.value.left+o*r.value.width/(c.value.ticks.length-1),y1:r.value.top,y2:r.value.bottom,stroke:t.value.style.chart.grid.verticalGrid.stroke,"stroke-width":t.value.style.chart.grid.verticalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.verticalGrid.strokeDasharray},null,8,pe))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.horizontalGrid.show?(e.openBlock(),e.createElementBlock("g",ge,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(l,o)=>(e.openBlock(),e.createElementBlock("line",{x1:r.value.left,x2:r.value.right,y1:r.value.top+o*i.value,y2:r.value.top+o*i.value,stroke:t.value.style.chart.grid.horizontalGrid.stroke,"stroke-width":t.value.style.chart.grid.horizontalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.horizontalGrid.strokeDasharray},null,8,ke))),256)),e.createElementVNode("line",{x1:r.value.left,x2:r.value.right,y1:r.value.bottom,y2:r.value.bottom,stroke:t.value.style.chart.grid.horizontalGrid.stroke,"stroke-width":t.value.style.chart.grid.horizontalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.horizontalGrid.strokeDasharray},null,8,_e)])):e.createCommentVNode("",!0),t.value.style.chart.labels.yAxisLabels.show?(e.openBlock(),e.createElementBlock("g",xe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(l,o)=>(e.openBlock(),e.createElementBlock("text",{x:r.value.left-6+t.value.style.chart.labels.yAxisLabels.offsetX,y:r.value.top+o*i.value+(t.value.style.chart.labels.yAxisLabels.showProgression?i.value/3:i.value/2)+t.value.style.chart.labels.yAxisLabels.fontSize/3,"font-size":t.value.style.chart.labels.yAxisLabels.fontSize,fill:t.value.style.chart.labels.yAxisLabels.color,"font-weight":t.value.style.chart.labels.yAxisLabels.bold?"bold":"normal","text-anchor":"end"},e.toDisplayString(l.name),9,Ce))),256)),t.value.style.chart.labels.yAxisLabels.showProgression?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(f.value,(l,o)=>(e.openBlock(),e.createElementBlock("text",{x:r.value.left-6+t.value.style.chart.labels.yAxisLabels.offsetX,y:r.value.top+o*i.value+i.value/1.3+t.value.style.chart.labels.yAxisLabels.fontSize/3,"font-size":t.value.style.chart.labels.yAxisLabels.fontSize,fill:t.value.style.chart.labels.yAxisLabels.color,"text-anchor":"end"},e.toDisplayString(e.unref(s.dataLabel)({v:100*(l.end/l.start-1),s:"%",r:t.value.style.chart.labels.yAxisLabels.rounding})),9,we))),256)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.style.chart.labels.xAxisLabels.show?(e.openBlock(),e.createElementBlock("g",Be,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value.ticks,(l,o)=>(e.openBlock(),e.createElementBlock("text",{x:r.value.left+o*(r.value.width/(c.value.ticks.length-1)),y:r.value.bottom+t.value.style.chart.labels.xAxisLabels.fontSize+t.value.style.chart.labels.xAxisLabels.offsetY,"font-size":t.value.style.chart.labels.xAxisLabels.fontSize,fill:t.value.style.chart.labels.xAxisLabels.color,"font-weight":t.value.style.chart.labels.xAxisLabels.bold?"bold":"normal","text-anchor":"middle"},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.chart.labels.formatter,l,e.unref(s.dataLabel)({p:t.value.style.chart.labels.prefix,v:l,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.labels.xAxisLabels.rounding}),{datapoint:l,seriesIndex:o})),9,Ne))),256))])):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{id:`start_grad_${d.value}`,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(s.lightenHexColor)(t.value.style.chart.plots.startColor,t.value.style.chart.plots.gradient.intensity/100)},null,8,$e),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(s.darkenHexColor)(t.value.style.chart.plots.startColor,.1)},null,8,Le),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.startColor},null,8,Ve)],8,Ee),e.createElementVNode("radialGradient",{id:`end_grad_${d.value}`,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(s.lightenHexColor)(t.value.style.chart.plots.endColor,t.value.style.chart.plots.gradient.intensity/100)},null,8,ze),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(s.darkenHexColor)(t.value.style.chart.plots.endColor,.1)},null,8,Ae),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.endColor},null,8,Pe)],8,Se)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(l,o)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`grad_positive_${d.value}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.chart.plots.startColor},null,8,Xe),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.endColor},null,8,De)],8,Te),e.createElementVNode("linearGradient",{id:`grad_negative_${d.value}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.chart.plots.endColor},null,8,Me),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.startColor},null,8,Ge)],8,Fe)]),t.value.style.chart.plots.link.type==="curved"?(e.openBlock(),e.createElementBlock("g",Ie,[e.createElementVNode("path",{d:`M
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-pevhrKCt.cjs"),Y=require("./useResponsive-BJ7DTGpm.cjs"),ne=require("./Title-ClPXaj_S.cjs"),Z=require("./usePrinter-CWosF8e1.cjs"),ue=require("./DataTable-DOjri-Qa.cjs"),ce=require("./vue-ui-skeleton-ClN7paFX.cjs"),ie=require("./Legend-DLz6uwmt.cjs"),de=require("./vue-ui-accordion-lQ9g-y51.cjs"),J=require("./useNestedProp-W1Kamknp.cjs"),ve=require("./PackageVersion-DtCIEusI.cjs"),he=require("./PenAndPaper-ManFh1Ds.cjs"),ye=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),fe=["id"],me=["xmlns","viewBox"],be={key:0},pe=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],ge={key:1},ke=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],_e=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],xe={key:2},Ce=["x","y","font-size","fill","font-weight"],we=["x","y","font-size","fill"],Be={key:3},Ne=["x","y","font-size","fill","font-weight"],Ee=["id"],$e=["stop-color"],Le=["stop-color"],Ve=["stop-color"],Se=["id"],ze=["stop-color"],Ae=["stop-color"],Pe=["stop-color"],Te=["id"],Xe=["stop-color"],De=["stop-color"],Fe=["id"],Me=["stop-color"],Ge=["stop-color"],Ie={key:0},Oe=["d","fill"],qe={key:1},He=["x","y","height","width","fill"],Re=["cx","cy","r","fill","stroke","stroke-width"],We=["cx","cy","r","fill","stroke","stroke-width"],Ue={key:2},je=["x","y","fill","font-size"],Ye={key:3},Ze=["x","y","fill","font-size"],Je={key:5,class:"vue-data-ui-watermark"},Ke=["xmlns","height","width"],Qe=["fill"],et=["innerHTML"],tt={__name:"vue-ui-dumbbell",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(K,{expose:Q,emit:at}){const y=K,{vue_ui_dumbbell:ee}=s.useConfig(),b=e.computed({get(){return!!y.dataset&&y.dataset.length},set(a){return a}}),d=e.ref(s.createUid()),V=e.ref(0),p=e.ref(null),S=e.ref(null),z=e.ref(null),A=e.ref(null),P=e.ref(null),T=e.ref(0),X=e.ref(0),D=e.ref(0),t=e.computed({get:()=>F(),set:a=>a});function F(){const a=J.useNestedProp({userConfig:y.config,defaultConfig:ee});return a.theme?{...J.useNestedProp({userConfig:s.themes.vue_ui_dumbbell[a.theme]||y.config,defaultConfig:a})}:a}e.watch(()=>y.config,a=>{t.value=F(),M(),T.value+=1,X.value+=1,D.value+=1,i.value=t.value.style.chart.rowHeight,g.value=t.value.style.chart.width},{deep:!0}),e.watch(()=>y.dataset,a=>{R()},{deep:!0});const _=e.ref(null);e.onMounted(()=>{M()});function M(){if(s.objectIsEmpty(y.dataset)?s.error({componentName:"VueUiDumbbell",type:"dataset"}):y.dataset.forEach((a,n)=>{s.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["name","start","end"]}).forEach(l=>{b.value=!1,s.error({componentName:"VueUiDumbbell",type:"datasetSerieAttribute",property:l,index:n})})}),t.value.responsive){const a=Y.throttle(()=>{const{width:n,height:l}=Y.useResponsive({chart:p.value,title:t.value.style.chart.title.text?S.value:null,legend:t.value.style.chart.legend.show?z.value:null,source:A.value,noTitle:P.value});g.value=n,i.value=l/y.dataset.length,v.value=C()});_.value=new ResizeObserver(a),_.value.observe(p.value.parentNode)}}e.onBeforeUnmount(()=>{_.value&&_.value.disconnect()});const{isPrinting:G,isImaging:I,generatePdf:O,generateImage:q}=Z.usePrinter({elementId:`dumbbell_${d.value}`,fileName:t.value.style.chart.title.text||"vue-ui-dumbbell"}),te=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),x=e.ref({showTable:t.value.table.show}),f=e.computed(()=>y.dataset.map((a,n)=>({...a,start:s.checkNaN(a.start),end:s.checkNaN(a.end),id:s.createUid()}))),E=e.computed(()=>({max:Math.max(...f.value.flatMap(a=>[a.start,a.end])),min:Math.min(...f.value.flatMap(a=>[a.start,a.end]))})),c=e.computed(()=>s.calculateNiceScale(E.value.min<0?E.value.min:0,E.value.max,t.value.style.chart.grid.scaleSteps)),i=e.ref(t.value.style.chart.rowHeight),g=e.ref(t.value.style.chart.width),r=e.computed(()=>{const a=i.value,n=t.value.style.chart.padding.left+t.value.style.chart.padding.right+g.value,l=t.value.style.chart.padding.top+t.value.style.chart.padding.bottom+a*y.dataset.length,o=c.value.ticks.length*(g.value/c.value.ticks.length);return{left:t.value.style.chart.padding.left,right:n-t.value.style.chart.padding.right,top:t.value.style.chart.padding.top,bottom:l-t.value.style.chart.padding.bottom,width:g.value,height:a*y.dataset.length,rowHeight:a,absoluteHeight:l,absoluteWidth:n,widthPlotReference:o}});function C(){return f.value.map((a,n)=>{const l=r.value.left+(a.start+Math.abs(c.value.min))/(c.value.max+Math.abs(c.value.min))*r.value.widthPlotReference,o=r.value.left+(a.end+Math.abs(c.value.min))/(c.value.max+Math.abs(c.value.min))*r.value.widthPlotReference,u=l+(o-l)/2;return{...a,startX:l,endX:o,centerX:u,y:r.value.top+n*i.value+i.value/2,endVal:a.start}})}const v=e.ref([]),H=e.ref(null),le=e.computed(()=>f.value.map(a=>a.end).reduce((a,n)=>a+n,0));e.onMounted(()=>{R()});function R(){v.value=C();let a=v.value.map(l=>l.start).reduce((l,o)=>l+o,0);function n(){const l=f.value.map(o=>o.end-o.start);a>=le.value?(cancelAnimationFrame(H.value),v.value=C()):(v.value=v.value.map((o,u)=>{o.endVal+=l[u]*(t.value.animationSpeed/100);const h=r.value.left+(o.start+Math.abs(c.value.min))/(c.value.max+Math.abs(c.value.min))*r.value.widthPlotReference,N=r.value.left+(o.endVal+Math.abs(c.value.min))/(c.value.max+Math.abs(c.value.min))*r.value.widthPlotReference,L=h+(N-h)/2;return{...o,startX:h,endX:N,centerX:L,y:r.value.top+u*i.value+i.value/2,endVal:o.endVal}}),a=v.value.map(o=>o.endVal).reduce((o,u)=>o+u,0),H.value=requestAnimationFrame(n))}t.value.useAnimation?n():v.value=C()}const W=e.computed(()=>[{name:t.value.style.chart.legend.labelStart,color:t.value.style.chart.plots.gradient.show?`url(#start_grad_${d.value})`:t.value.style.chart.plots.startColor},{name:t.value.style.chart.legend.labelEnd,color:t.value.style.chart.plots.gradient.show?`url(#end_grad_${d.value})`:t.value.style.chart.plots.endColor}]),ae=e.computed(()=>({cy:"donut-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,paddingTop:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),m=e.computed(()=>{const a=v.value.map(l=>({name:l.name})),n=v.value.map(l=>({start:l.start,end:l.end}));return{head:a,body:n}}),w=e.computed(()=>{const a=[t.value.table.columnNames.series,t.value.table.columnNames.start,t.value.table.columnNames.end,t.value.table.columnNames.progression],n=m.value.head.map((u,h)=>{const N=s.dataLabel({p:t.value.style.chart.labels.prefix,v:m.value.body[h].start,s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue}),L=s.dataLabel({p:t.value.style.chart.labels.prefix,v:m.value.body[h].end,s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue}),se=s.dataLabel({v:100*(m.value.body[h].end/m.value.body[h].start-1),s:"%",r:t.value.table.td.roundingPercentage});return[{name:u.name},N,L,se]}),l={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.start,t.value.table.columnNames.end,t.value.table.columnNames.progression],head:a,body:n,config:l}});function U(){e.nextTick(()=>{const a=m.value.head.map((o,u)=>[[o.name],[m.value.body[u].start],[m.value.body[u].end]]),n=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.series],[t.value.table.columnNames.start],[t.value.table.columnNames.end]]].concat(a),l=s.createCsvContent(n);s.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-dumbbell"})})}const k=e.ref(!1);function oe(a){k.value=a,V.value+=1}function re(){return v.value}function j(){x.value.showTable=!x.value.showTable}const B=e.ref(!1);function $(){B.value=!B.value}return Q({getData:re,generatePdf:O,generateCsv:U,generateImage:q,toggleTable:j,toggleAnnotator:$}),(a,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"dumbbellChart",ref:p,class:e.normalizeClass(`vue-ui-dumbbell ${k.value?"vue-data-ui-wrapper-fullscreen":""}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height:100%":""}`),id:`dumbbell_${d.value}`},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(he.PenAndPaper,{key:0,parent:p.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:B.value,onClose:$},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),te.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:P,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:S,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(ne._sfc_main,{key:`title_${T.value}`,config:{title:{cy:"donut-div-title",...t.value.style.chart.title},subtitle:{cy:"donut-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&b.value?(e.openBlock(),e.createBlock(Z.UserOptions,{ref:"details",key:`user_option_${V.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(G),isImaging:e.unref(I),uid:d.value,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:k.value,titles:{...t.value.userOptions.buttonTitles},chartElement:p.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:B.value,onToggleFullscreen:oe,onGeneratePdf:e.unref(O),onGenerateCsv:U,onGenerateImage:e.unref(q),onToggleTable:j,onToggleAnnotator:$},e.createSlots({_:2},[a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,a.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:o})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:o})),void 0,!0)]),key:"4"}:void 0,a.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:o})=>[e.renderSlot(a.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:o})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(s.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":k.value,"vue-data-ui-fulscreen--off":!k.value}),viewBox:`0 0 ${r.value.absoluteWidth<=0?10:r.value.absoluteWidth} ${r.value.absoluteHeight<=0?10:r.value.absoluteHeight}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(ve._sfc_main),t.value.style.chart.grid.verticalGrid.show?(e.openBlock(),e.createElementBlock("g",be,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value.ticks,(l,o)=>(e.openBlock(),e.createElementBlock("line",{x1:r.value.left+o*r.value.width/(c.value.ticks.length-1),x2:r.value.left+o*r.value.width/(c.value.ticks.length-1),y1:r.value.top,y2:r.value.bottom,stroke:t.value.style.chart.grid.verticalGrid.stroke,"stroke-width":t.value.style.chart.grid.verticalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.verticalGrid.strokeDasharray},null,8,pe))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.horizontalGrid.show?(e.openBlock(),e.createElementBlock("g",ge,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(l,o)=>(e.openBlock(),e.createElementBlock("line",{x1:r.value.left,x2:r.value.right,y1:r.value.top+o*i.value,y2:r.value.top+o*i.value,stroke:t.value.style.chart.grid.horizontalGrid.stroke,"stroke-width":t.value.style.chart.grid.horizontalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.horizontalGrid.strokeDasharray},null,8,ke))),256)),e.createElementVNode("line",{x1:r.value.left,x2:r.value.right,y1:r.value.bottom,y2:r.value.bottom,stroke:t.value.style.chart.grid.horizontalGrid.stroke,"stroke-width":t.value.style.chart.grid.horizontalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.horizontalGrid.strokeDasharray},null,8,_e)])):e.createCommentVNode("",!0),t.value.style.chart.labels.yAxisLabels.show?(e.openBlock(),e.createElementBlock("g",xe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(l,o)=>(e.openBlock(),e.createElementBlock("text",{x:r.value.left-6+t.value.style.chart.labels.yAxisLabels.offsetX,y:r.value.top+o*i.value+(t.value.style.chart.labels.yAxisLabels.showProgression?i.value/3:i.value/2)+t.value.style.chart.labels.yAxisLabels.fontSize/3,"font-size":t.value.style.chart.labels.yAxisLabels.fontSize,fill:t.value.style.chart.labels.yAxisLabels.color,"font-weight":t.value.style.chart.labels.yAxisLabels.bold?"bold":"normal","text-anchor":"end"},e.toDisplayString(l.name),9,Ce))),256)),t.value.style.chart.labels.yAxisLabels.showProgression?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(f.value,(l,o)=>(e.openBlock(),e.createElementBlock("text",{x:r.value.left-6+t.value.style.chart.labels.yAxisLabels.offsetX,y:r.value.top+o*i.value+i.value/1.3+t.value.style.chart.labels.yAxisLabels.fontSize/3,"font-size":t.value.style.chart.labels.yAxisLabels.fontSize,fill:t.value.style.chart.labels.yAxisLabels.color,"text-anchor":"end"},e.toDisplayString(e.unref(s.dataLabel)({v:100*(l.end/l.start-1),s:"%",r:t.value.style.chart.labels.yAxisLabels.rounding})),9,we))),256)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.style.chart.labels.xAxisLabels.show?(e.openBlock(),e.createElementBlock("g",Be,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value.ticks,(l,o)=>(e.openBlock(),e.createElementBlock("text",{x:r.value.left+o*(r.value.width/(c.value.ticks.length-1)),y:r.value.bottom+t.value.style.chart.labels.xAxisLabels.fontSize+t.value.style.chart.labels.xAxisLabels.offsetY,"font-size":t.value.style.chart.labels.xAxisLabels.fontSize,fill:t.value.style.chart.labels.xAxisLabels.color,"font-weight":t.value.style.chart.labels.xAxisLabels.bold?"bold":"normal","text-anchor":"middle"},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.chart.labels.formatter,l,e.unref(s.dataLabel)({p:t.value.style.chart.labels.prefix,v:l,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.labels.xAxisLabels.rounding}),{datapoint:l,seriesIndex:o})),9,Ne))),256))])):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{id:`start_grad_${d.value}`,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(s.lightenHexColor)(t.value.style.chart.plots.startColor,t.value.style.chart.plots.gradient.intensity/100)},null,8,$e),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(s.darkenHexColor)(t.value.style.chart.plots.startColor,.1)},null,8,Le),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.startColor},null,8,Ve)],8,Ee),e.createElementVNode("radialGradient",{id:`end_grad_${d.value}`,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(s.lightenHexColor)(t.value.style.chart.plots.endColor,t.value.style.chart.plots.gradient.intensity/100)},null,8,ze),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(s.darkenHexColor)(t.value.style.chart.plots.endColor,.1)},null,8,Ae),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.endColor},null,8,Pe)],8,Se)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(l,o)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`grad_positive_${d.value}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.chart.plots.startColor},null,8,Xe),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.endColor},null,8,De)],8,Te),e.createElementVNode("linearGradient",{id:`grad_negative_${d.value}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.chart.plots.endColor},null,8,Me),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.startColor},null,8,Ge)],8,Fe)]),t.value.style.chart.plots.link.type==="curved"?(e.openBlock(),e.createElementBlock("g",Ie,[e.createElementVNode("path",{d:`M
|
|
2
2
|
${l.startX},${l.y+t.value.style.chart.plots.radius/2}
|
|
3
3
|
C ${l.centerX},${l.y} ${l.centerX},${l.y}
|
|
4
4
|
${l.endX},${l.y+t.value.style.chart.plots.radius/2}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { computed as m, ref as v, watch as de, onMounted as ve, onBeforeUnmount as Ne, openBlock as o, createElementBlock as r, normalizeClass as he, normalizeStyle as H, createBlock as L, createCommentVNode as y, unref as d, createSlots as Te, withCtx as _, renderSlot as k, normalizeProps as W, guardReactiveProps as R, createVNode as Pe, Fragment as w, renderList as $, createElementVNode as n, toDisplayString as A, createTextVNode as ye, nextTick as Ge } from "vue";
|
|
2
|
-
import { u as De, c as fe, t as Ie, o as Me, e as be, g as Oe, v as ge, C as Fe, f as z, X as pe, i as B, l as me, h as _e, q as Ve, r as Ee } from "./index-
|
|
2
|
+
import { u as De, c as fe, t as Ie, o as Me, e as be, g as Oe, v as ge, C as Fe, f as z, X as pe, i as B, l as me, h as _e, q as Ve, r as Ee } from "./index-CvGoB7HV.js";
|
|
3
3
|
import { t as He, u as We } from "./useResponsive-CoxXLe23.js";
|
|
4
|
-
import { _ as Re } from "./Title-
|
|
5
|
-
import { u as Be, U as Ue } from "./usePrinter-
|
|
6
|
-
import { D as je } from "./DataTable-
|
|
7
|
-
import qe from "./vue-ui-skeleton-
|
|
8
|
-
import { L as Ye } from "./Legend-
|
|
9
|
-
import Ze from "./vue-ui-accordion-
|
|
10
|
-
import { u as ke } from "./useNestedProp-
|
|
11
|
-
import { _ as Je } from "./PackageVersion-
|
|
12
|
-
import { P as Ke } from "./PenAndPaper-
|
|
4
|
+
import { _ as Re } from "./Title-kiBjyWrd.js";
|
|
5
|
+
import { u as Be, U as Ue } from "./usePrinter-B0E13IH3.js";
|
|
6
|
+
import { D as je } from "./DataTable-Ci7Hxwni.js";
|
|
7
|
+
import qe from "./vue-ui-skeleton-CL1iMZq4.js";
|
|
8
|
+
import { L as Ye } from "./Legend-D2OrVhyH.js";
|
|
9
|
+
import Ze from "./vue-ui-accordion-BUQB7L1N.js";
|
|
10
|
+
import { u as ke } from "./useNestedProp-CX0uXnyy.js";
|
|
11
|
+
import { _ as Je } from "./PackageVersion-jcUUbnGR.js";
|
|
12
|
+
import { P as Ke } from "./PenAndPaper-R8H8qKoM.js";
|
|
13
13
|
import { _ as Qe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
14
14
|
const et = ["id"], tt = ["xmlns", "viewBox"], lt = { key: 0 }, at = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], st = { key: 1 }, ot = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], rt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], nt = { key: 2 }, ut = ["x", "y", "font-size", "fill", "font-weight"], it = ["x", "y", "font-size", "fill"], ct = { key: 3 }, dt = ["x", "y", "font-size", "fill", "font-weight"], vt = ["id"], ht = ["stop-color"], yt = ["stop-color"], ft = ["stop-color"], bt = ["id"], gt = ["stop-color"], pt = ["stop-color"], mt = ["stop-color"], _t = ["id"], kt = ["stop-color"], xt = ["stop-color"], Ct = ["id"], wt = ["stop-color"], $t = ["stop-color"], Lt = { key: 0 }, At = ["d", "fill"], zt = { key: 1 }, Xt = ["x", "y", "height", "width", "fill"], St = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], Nt = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], Tt = { key: 2 }, Pt = ["x", "y", "fill", "font-size"], Gt = { key: 3 }, Dt = ["x", "y", "fill", "font-size"], It = {
|
|
15
15
|
key: 5,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { computed as m, onMounted as Ee, ref as b, watch as Se, openBlock as u, createElementBlock as i, normalizeClass as he, normalizeStyle as N, createBlock as P, createCommentVNode as C, unref as c, createSlots as Me, withCtx as y, renderSlot as k, normalizeProps as X, guardReactiveProps as W, createVNode as me, createElementVNode as S, Fragment as F, renderList as O, toDisplayString as q, createTextVNode as ze, nextTick as Ye } from "vue";
|
|
2
|
-
import { u as De, o as Ge, e as Be, c as ge, t as Ue, a as Ve, p as K, b as je, v as f, f as pe, X as Xe, F as be, K as We, i as qe, q as Ke, r as Re } from "./index-
|
|
3
|
-
import { _ as Ze } from "./Title-
|
|
4
|
-
import { u as Je, U as Qe } from "./usePrinter-
|
|
5
|
-
import { D as et } from "./DataTable-
|
|
6
|
-
import tt from "./vue-ui-accordion-
|
|
7
|
-
import ot from "./vue-ui-skeleton-
|
|
8
|
-
import { u as ye } from "./useNestedProp-
|
|
9
|
-
import { _ as lt } from "./PackageVersion-
|
|
10
|
-
import { P as at } from "./PenAndPaper-
|
|
2
|
+
import { u as De, o as Ge, e as Be, c as ge, t as Ue, a as Ve, p as K, b as je, v as f, f as pe, X as Xe, F as be, K as We, i as qe, q as Ke, r as Re } from "./index-CvGoB7HV.js";
|
|
3
|
+
import { _ as Ze } from "./Title-kiBjyWrd.js";
|
|
4
|
+
import { u as Je, U as Qe } from "./usePrinter-B0E13IH3.js";
|
|
5
|
+
import { D as et } from "./DataTable-Ci7Hxwni.js";
|
|
6
|
+
import tt from "./vue-ui-accordion-BUQB7L1N.js";
|
|
7
|
+
import ot from "./vue-ui-skeleton-CL1iMZq4.js";
|
|
8
|
+
import { u as ye } from "./useNestedProp-CX0uXnyy.js";
|
|
9
|
+
import { _ as lt } from "./PackageVersion-jcUUbnGR.js";
|
|
10
|
+
import { P as at } from "./PenAndPaper-R8H8qKoM.js";
|
|
11
11
|
import { _ as nt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
12
12
|
const st = ["id"], rt = {
|
|
13
13
|
key: 1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-C8hC7bb2.cjs"),me=require("./Title-DvefE4KM.cjs"),K=require("./usePrinter-B9bLOCNs.cjs"),pe=require("./DataTable-CFqyTcn8.cjs"),ge=require("./vue-ui-accordion-C2Jw7_0r.cjs"),ke=require("./vue-ui-skeleton-CoYx8g2U.cjs"),Q=require("./useNestedProp-Dv37rqyp.cjs"),ye=require("./PackageVersion-B9X8pKiF.cjs"),be=require("./PenAndPaper-oAikdUUx.cjs"),Ce=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),we=["id"],Ne={key:1,ref:"noTitle",class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},xe={key:2,style:"width:100%;background:transparent;padding-bottom:24px"},Be=["xmlns","viewBox"],$e=["id"],_e=["stop-color"],Pe=["stop-color"],Ee=["d","fill","stroke","stroke-width"],Se=["x","y","height","width","fill","stroke","stroke-width","onMouseenter"],Te=["x","y","font-size","fill"],Fe=["x","y","font-size","fill"],Le={key:4,class:"vue-data-ui-watermark"},Oe={key:6,ref:"source",dir:"auto"},ze=["innerHTML"],Ie={__name:"vue-ui-flow",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(ee,{expose:te}){const h=ee,{vue_ui_flow:oe}=s.useConfig(),B=e.computed(()=>!!h.dataset&&h.dataset.length);e.onMounted(()=>{O()});function O(){s.objectIsEmpty(h.dataset)&&s.error({componentName:"VueUiFlow",type:"dataset"})}const $=e.ref(s.createUid()),_=e.ref(null),z=e.ref(0),I=e.ref(0),y=e.ref(!1);function le(o){y.value=o,z.value+=1}const t=e.computed({get:()=>V(),set:o=>o});function V(){const o=Q.useNestedProp({userConfig:h.config,defaultConfig:oe});return o.theme?{...Q.useNestedProp({userConfig:s.themes.vue_ui_flow[o.theme]||h.config,defaultConfig:o}),customPalette:s.themePalettes[o.theme]||s.palette}:o}e.watch(()=>h.config,o=>{t.value=V(),O(),I.value+=1},{deep:!0});const{isPrinting:A,isImaging:H,generatePdf:M,generateImage:D}=K.usePrinter({elementId:`flow_${$.value}`,fileName:t.value.style.chart.title.text||"vue-ui-flow"}),ne=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),P=e.computed(()=>s.convertCustomPalette(t.value.customPalette)),q=e.computed(()=>t.value.style.chart.nodes.gap),g=e.computed(()=>t.value.style.chart.nodes.width),b=e.ref({showTable:t.value.table.show}),Y=e.computed(()=>t.value.style.chart.links.width),E=e.computed(()=>!h.dataset||!h.dataset.length?[]:h.dataset.map(o=>[o[0],o[1],s.checkNaN(o[2])])),G=e.computed(()=>{const o={};function n(r){o[r]||(o[r]={inflow:0,outflow:0})}E.value.forEach(([r,a,c])=>{n(r),n(a),o[r].outflow+=c,o[a].inflow+=c});let l=0;for(const r in o){const a=Math.max(o[r].inflow,o[r].outflow);l=Math.max(l,a)}return l});function ae(o){return o/G.value*100+t.value.style.chart.nodes.minHeight}function re(o){const n=t.value.style.chart.nodes.minHeight;return(o-n)/100*G.value}function se(o){const n={},l={};function r(u,i){n[u]||(n[u]={height:0,level:null,inflow:0,outflow:0}),n[u].level===null&&(n[u].level=i),l[i]||(l[i]=[]),l[i].includes(u)||l[i].push(u)}o.forEach(([u,i,v],k)=>{const p=n[u]?n[u].level:0,x=p+1;r(u,p),r(i,x),n[u].children||(n[u].children=[]),n[u].children.push({target:i,value:v}),n[u].outflow+=v,n[i].inflow+=v}),Object.keys(n).forEach((u,i)=>{n[u].color=P.value[i]||P.value[i%P.value.length]||s.palette[i]||s.palette[i%d.length]});for(const u in n)n[u].height=ae(Math.max(n[u].inflow,n[u].outflow)),n[u].name=u;const a={};for(const u in l){let i=0;l[u].forEach((v,k)=>{const p=n[v].height;a[v]={x:parseInt(u,10)*Y.value+t.value.style.chart.padding.left,y:i,absoluteY:i,height:p,i:k,color:n[v].color,value:re(p)},i+=p+q.value})}const c=[];for(const u in n){let i=a[u].absoluteY;n[u].children&&n[u].children.forEach(({target:v,value:k},p)=>{const x=a[v].y,F=a[u],L=a[v],X=s.checkNaN(i),R=s.checkNaN(i+k/n[u].outflow*F.height),Z=s.checkNaN(x),J=s.checkNaN(x+k/n[v].inflow*L.height),fe={id:s.createUid(),source:u,target:v,path:`M ${s.checkNaN(F.x)+s.checkNaN(g.value)} ${X} L ${s.checkNaN(F.x)+s.checkNaN(g.value)} ${R} L ${s.checkNaN(L.x)} ${J} L ${s.checkNaN(L.x)} ${Z} Z`,value:k,sourceColor:n[u].color,targetColor:n[v].color};c.push(fe),i+=R-X,a[v].y+=J-Z})}return{nodeCoordinates:a,links:c}}const f=e.computed(()=>{const o=se(h.dataset);return{nodes:Object.keys(o.nodeCoordinates).map((n,l)=>({...o.nodeCoordinates[n],name:n})),links:o.links}}),ue=e.computed(()=>ie(f.value.nodes));function ie(o){const n={};for(const r in o){const{x:a,height:c}=o[r];n[a]||(n[a]=0),n[a]+=c+q.value}return Math.max(...Object.values(n))}const S=e.computed(()=>{const{top:o,right:n,left:l,bottom:r}=t.value.style.chart.padding,a=E.value.length*Y.value;return{height:ue.value+o+r,width:n+Math.max(...f.value.nodes.map(c=>c.x))+g.value,left:l,top:o,right:a-n,p_top:o,p_bottom:r}});function ce(o){const n={},l={},r=new Set;return E.value.forEach(([a,c,u])=>{n[a]||(n[a]=[]),l[c]||(l[c]=[]),n[a].push(c),l[c].push(a)}),n[o]&&n[o].forEach(a=>r.add(a)),l[o]&&l[o].forEach(a=>r.add(a)),Array.from(r).concat(o)}const m=e.ref(null),C=e.ref(null);function de(o){m.value=ce(o.name),C.value=o.name}function ve(){m.value=null,C.value=null}const U=e.computed(()=>f.value.links.map(({source:o,target:n,sourceColor:l,targetColor:r,value:a})=>({source:o,target:n,sourceColor:l,targetColor:r,value:a})));function j(){e.nextTick(()=>{const o=U.value.map((r,a)=>[[r.source],[r.target],[r.value]]),n=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.source],[t.value.table.columnNames.target],[t.value.table.columnNames.value]]].concat(o),l=s.createCsvContent(n);s.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-flow"})})}const w=e.computed(()=>{const o=[t.value.table.columnNames.source,t.value.table.columnNames.target,t.value.table.columnNames.value],n=U.value.map((a,c)=>[{color:a.sourceColor,name:a.source},{color:a.targetColor,name:a.target},s.dataLabel({p:t.value.style.chart.nodes.labels.prefix,v:a.value,s:t.value.style.chart.nodes.labels.suffix,r:t.value.style.chart.nodes.labels.rounding})]),l={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.source,t.value.table.columnNames.target,t.value.table.columnNames.value],head:o,body:n,config:l}});function he(){return f.value}function W(){b.value.showTable=!b.value.showTable}const N=e.ref(!1);function T(){N.value=!N.value}return te({getData:he,generateCsv:j,generateImage:D,generatePdf:M,toggleTable:W,toggleAnnotator:T}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"flowChart",ref:_,class:e.normalizeClass(`vue-ui-flow ${y.value?"vue-data-ui-wrapper-fullscreen":""}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor}`),id:`flow_${$.value}`},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(be.PenAndPaper,{key:0,parent:_.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:N.value,onClose:T},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),ne.value?(e.openBlock(),e.createElementBlock("div",Ne,null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",xe,[(e.openBlock(),e.createBlock(me._sfc_main,{key:`title_${I.value}`,config:{title:{cy:"flow-title",...t.value.style.chart.title},subtitle:{cy:"flow-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))])):e.createCommentVNode("",!0),t.value.userOptions.show&&B.value?(e.openBlock(),e.createBlock(K.UserOptions,{ref:"details",key:`user_option_${z.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(A),isImaging:e.unref(H),uid:$.value,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:y.value,titles:{...t.value.userOptions.buttonTitles},chartElement:_.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:N.value,onToggleFullscreen:le,onGeneratePdf:e.unref(M),onGenerateCsv:j,onGenerateImage:e.unref(D),onToggleTable:W,onToggleAnnotator:T},e.createSlots({_:2},[o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:r})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:r})),void 0,!0)]),key:"4"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:r})=>[e.renderSlot(o.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:r})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(s.XMLNS),viewBox:`0 0 ${S.value.width} ${S.value.height}`,class:e.normalizeClass({"vue-data-ui-fullscreen--on":y.value,"vue-data-ui-fulscreen--off":!y.value}),style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(ye._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.links,(l,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{id:l.id,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":l.sourceColor},null,8,_e),e.createElementVNode("stop",{offset:"100%","stop-color":l.targetColor},null,8,Pe)],8,$e))),256))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.links,l=>(e.openBlock(),e.createElementBlock("path",{class:"vue-ui-flow-link",d:l.path,fill:`url(#${l.id})`,stroke:t.value.style.chart.links.stroke,"stroke-width":t.value.style.chart.links.strokeWidth,style:e.normalizeStyle(`opacity:${C.value?[l.target,l.source].includes(C.value)?1:.3:t.value.style.chart.links.opacity}`)},null,12,Ee))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.nodes,(l,r)=>(e.openBlock(),e.createElementBlock("rect",{class:"vue-ui-flow-node",x:l.x,y:e.unref(s.checkNaN)(l.absoluteY),height:e.unref(s.checkNaN)(l.height),width:g.value,fill:l.color,stroke:t.value.style.chart.nodes.stroke,"stroke-width":t.value.style.chart.nodes.strokeWidth,onMouseenter:a=>de(l),onMouseleave:n[0]||(n[0]=a=>ve()),style:e.normalizeStyle(`opacity:${m.value?m.value.includes(l.name)?1:.2:1}`)},null,44,Se))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.nodes,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:l.x+g.value/2,y:e.unref(s.checkNaN)(l.absoluteY+l.height/2-t.value.style.chart.nodes.labels.fontSize/4),"font-size":t.value.style.chart.nodes.labels.fontSize,fill:e.unref(s.adaptColorToBackground)(l.color),"text-anchor":"middle",style:e.normalizeStyle(`pointer-events: none; opacity:${m.value?m.value.includes(l.name)?1:0:1}`)},e.toDisplayString(t.value.style.chart.nodes.labels.abbreviation.use?e.unref(s.abbreviate)({source:l.name,length:t.value.style.chart.nodes.labels.abbreviation.length}):l.name),13,Te))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.nodes,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:l.x+g.value/2,y:e.unref(s.checkNaN)(l.absoluteY+l.height/2+t.value.style.chart.nodes.labels.fontSize),"font-size":t.value.style.chart.nodes.labels.fontSize,fill:e.unref(s.adaptColorToBackground)(l.color),"text-anchor":"middle",style:e.normalizeStyle(`pointer-events: none; opacity:${m.value?m.value.includes(l.name)?1:0:1}`)},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.chart.nodes.labels.formatter,l.value,e.unref(s.dataLabel)({p:t.value.style.chart.nodes.labels.prefix,v:l.value,s:t.value.style.chart.nodes.labels.suffix,r:t.value.style.chart.nodes.labels.rounding}),{datapoint:l,seriesIndex:r})),13,Fe))),256)),e.renderSlot(o.$slots,"svg",{svg:S.value},void 0,!0)],14,Be)),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Le,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(A)||e.unref(H)})),void 0,!0)])):e.createCommentVNode("",!0),B.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ke.default,{key:5,config:{type:"flow",style:{backgroundColor:t.value.style.chart.backgroundColor}}},null,8,["config"])),o.$slots.source?(e.openBlock(),e.createElementBlock("div",Oe,[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),B.value?(e.openBlock(),e.createBlock(ge.default,{key:7,hideDetails:"",config:{open:b.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(pe.DataTable,{colNames:w.value.colNames,head:w.value.head,body:w.value.body,config:w.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:n[1]||(n[1]=l=>b.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,ze)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l.name||l),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,we))}},Ve=Ce._export_sfc(Ie,[["__scopeId","data-v-49421974"]]);exports.default=Ve;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-pevhrKCt.cjs"),me=require("./Title-ClPXaj_S.cjs"),K=require("./usePrinter-CWosF8e1.cjs"),pe=require("./DataTable-DOjri-Qa.cjs"),ge=require("./vue-ui-accordion-lQ9g-y51.cjs"),ke=require("./vue-ui-skeleton-ClN7paFX.cjs"),Q=require("./useNestedProp-W1Kamknp.cjs"),ye=require("./PackageVersion-DtCIEusI.cjs"),be=require("./PenAndPaper-ManFh1Ds.cjs"),Ce=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),we=["id"],Ne={key:1,ref:"noTitle",class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},xe={key:2,style:"width:100%;background:transparent;padding-bottom:24px"},Be=["xmlns","viewBox"],$e=["id"],_e=["stop-color"],Pe=["stop-color"],Ee=["d","fill","stroke","stroke-width"],Se=["x","y","height","width","fill","stroke","stroke-width","onMouseenter"],Te=["x","y","font-size","fill"],Fe=["x","y","font-size","fill"],Le={key:4,class:"vue-data-ui-watermark"},Oe={key:6,ref:"source",dir:"auto"},ze=["innerHTML"],Ie={__name:"vue-ui-flow",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(ee,{expose:te}){const h=ee,{vue_ui_flow:oe}=s.useConfig(),B=e.computed(()=>!!h.dataset&&h.dataset.length);e.onMounted(()=>{O()});function O(){s.objectIsEmpty(h.dataset)&&s.error({componentName:"VueUiFlow",type:"dataset"})}const $=e.ref(s.createUid()),_=e.ref(null),z=e.ref(0),I=e.ref(0),y=e.ref(!1);function le(o){y.value=o,z.value+=1}const t=e.computed({get:()=>V(),set:o=>o});function V(){const o=Q.useNestedProp({userConfig:h.config,defaultConfig:oe});return o.theme?{...Q.useNestedProp({userConfig:s.themes.vue_ui_flow[o.theme]||h.config,defaultConfig:o}),customPalette:s.themePalettes[o.theme]||s.palette}:o}e.watch(()=>h.config,o=>{t.value=V(),O(),I.value+=1},{deep:!0});const{isPrinting:A,isImaging:H,generatePdf:M,generateImage:D}=K.usePrinter({elementId:`flow_${$.value}`,fileName:t.value.style.chart.title.text||"vue-ui-flow"}),ne=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),P=e.computed(()=>s.convertCustomPalette(t.value.customPalette)),q=e.computed(()=>t.value.style.chart.nodes.gap),g=e.computed(()=>t.value.style.chart.nodes.width),b=e.ref({showTable:t.value.table.show}),Y=e.computed(()=>t.value.style.chart.links.width),E=e.computed(()=>!h.dataset||!h.dataset.length?[]:h.dataset.map(o=>[o[0],o[1],s.checkNaN(o[2])])),G=e.computed(()=>{const o={};function n(r){o[r]||(o[r]={inflow:0,outflow:0})}E.value.forEach(([r,a,c])=>{n(r),n(a),o[r].outflow+=c,o[a].inflow+=c});let l=0;for(const r in o){const a=Math.max(o[r].inflow,o[r].outflow);l=Math.max(l,a)}return l});function ae(o){return o/G.value*100+t.value.style.chart.nodes.minHeight}function re(o){const n=t.value.style.chart.nodes.minHeight;return(o-n)/100*G.value}function se(o){const n={},l={};function r(u,i){n[u]||(n[u]={height:0,level:null,inflow:0,outflow:0}),n[u].level===null&&(n[u].level=i),l[i]||(l[i]=[]),l[i].includes(u)||l[i].push(u)}o.forEach(([u,i,v],k)=>{const p=n[u]?n[u].level:0,x=p+1;r(u,p),r(i,x),n[u].children||(n[u].children=[]),n[u].children.push({target:i,value:v}),n[u].outflow+=v,n[i].inflow+=v}),Object.keys(n).forEach((u,i)=>{n[u].color=P.value[i]||P.value[i%P.value.length]||s.palette[i]||s.palette[i%d.length]});for(const u in n)n[u].height=ae(Math.max(n[u].inflow,n[u].outflow)),n[u].name=u;const a={};for(const u in l){let i=0;l[u].forEach((v,k)=>{const p=n[v].height;a[v]={x:parseInt(u,10)*Y.value+t.value.style.chart.padding.left,y:i,absoluteY:i,height:p,i:k,color:n[v].color,value:re(p)},i+=p+q.value})}const c=[];for(const u in n){let i=a[u].absoluteY;n[u].children&&n[u].children.forEach(({target:v,value:k},p)=>{const x=a[v].y,F=a[u],L=a[v],X=s.checkNaN(i),R=s.checkNaN(i+k/n[u].outflow*F.height),Z=s.checkNaN(x),J=s.checkNaN(x+k/n[v].inflow*L.height),fe={id:s.createUid(),source:u,target:v,path:`M ${s.checkNaN(F.x)+s.checkNaN(g.value)} ${X} L ${s.checkNaN(F.x)+s.checkNaN(g.value)} ${R} L ${s.checkNaN(L.x)} ${J} L ${s.checkNaN(L.x)} ${Z} Z`,value:k,sourceColor:n[u].color,targetColor:n[v].color};c.push(fe),i+=R-X,a[v].y+=J-Z})}return{nodeCoordinates:a,links:c}}const f=e.computed(()=>{const o=se(h.dataset);return{nodes:Object.keys(o.nodeCoordinates).map((n,l)=>({...o.nodeCoordinates[n],name:n})),links:o.links}}),ue=e.computed(()=>ie(f.value.nodes));function ie(o){const n={};for(const r in o){const{x:a,height:c}=o[r];n[a]||(n[a]=0),n[a]+=c+q.value}return Math.max(...Object.values(n))}const S=e.computed(()=>{const{top:o,right:n,left:l,bottom:r}=t.value.style.chart.padding,a=E.value.length*Y.value;return{height:ue.value+o+r,width:n+Math.max(...f.value.nodes.map(c=>c.x))+g.value,left:l,top:o,right:a-n,p_top:o,p_bottom:r}});function ce(o){const n={},l={},r=new Set;return E.value.forEach(([a,c,u])=>{n[a]||(n[a]=[]),l[c]||(l[c]=[]),n[a].push(c),l[c].push(a)}),n[o]&&n[o].forEach(a=>r.add(a)),l[o]&&l[o].forEach(a=>r.add(a)),Array.from(r).concat(o)}const m=e.ref(null),C=e.ref(null);function de(o){m.value=ce(o.name),C.value=o.name}function ve(){m.value=null,C.value=null}const U=e.computed(()=>f.value.links.map(({source:o,target:n,sourceColor:l,targetColor:r,value:a})=>({source:o,target:n,sourceColor:l,targetColor:r,value:a})));function j(){e.nextTick(()=>{const o=U.value.map((r,a)=>[[r.source],[r.target],[r.value]]),n=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.source],[t.value.table.columnNames.target],[t.value.table.columnNames.value]]].concat(o),l=s.createCsvContent(n);s.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-flow"})})}const w=e.computed(()=>{const o=[t.value.table.columnNames.source,t.value.table.columnNames.target,t.value.table.columnNames.value],n=U.value.map((a,c)=>[{color:a.sourceColor,name:a.source},{color:a.targetColor,name:a.target},s.dataLabel({p:t.value.style.chart.nodes.labels.prefix,v:a.value,s:t.value.style.chart.nodes.labels.suffix,r:t.value.style.chart.nodes.labels.rounding})]),l={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.source,t.value.table.columnNames.target,t.value.table.columnNames.value],head:o,body:n,config:l}});function he(){return f.value}function W(){b.value.showTable=!b.value.showTable}const N=e.ref(!1);function T(){N.value=!N.value}return te({getData:he,generateCsv:j,generateImage:D,generatePdf:M,toggleTable:W,toggleAnnotator:T}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"flowChart",ref:_,class:e.normalizeClass(`vue-ui-flow ${y.value?"vue-data-ui-wrapper-fullscreen":""}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor}`),id:`flow_${$.value}`},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(be.PenAndPaper,{key:0,parent:_.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:N.value,onClose:T},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),ne.value?(e.openBlock(),e.createElementBlock("div",Ne,null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",xe,[(e.openBlock(),e.createBlock(me._sfc_main,{key:`title_${I.value}`,config:{title:{cy:"flow-title",...t.value.style.chart.title},subtitle:{cy:"flow-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))])):e.createCommentVNode("",!0),t.value.userOptions.show&&B.value?(e.openBlock(),e.createBlock(K.UserOptions,{ref:"details",key:`user_option_${z.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(A),isImaging:e.unref(H),uid:$.value,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:y.value,titles:{...t.value.userOptions.buttonTitles},chartElement:_.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:N.value,onToggleFullscreen:le,onGeneratePdf:e.unref(M),onGenerateCsv:j,onGenerateImage:e.unref(D),onToggleTable:W,onToggleAnnotator:T},e.createSlots({_:2},[o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:r})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:r})),void 0,!0)]),key:"4"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:r})=>[e.renderSlot(o.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:r})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(s.XMLNS),viewBox:`0 0 ${S.value.width} ${S.value.height}`,class:e.normalizeClass({"vue-data-ui-fullscreen--on":y.value,"vue-data-ui-fulscreen--off":!y.value}),style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(ye._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.links,(l,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{id:l.id,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":l.sourceColor},null,8,_e),e.createElementVNode("stop",{offset:"100%","stop-color":l.targetColor},null,8,Pe)],8,$e))),256))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.links,l=>(e.openBlock(),e.createElementBlock("path",{class:"vue-ui-flow-link",d:l.path,fill:`url(#${l.id})`,stroke:t.value.style.chart.links.stroke,"stroke-width":t.value.style.chart.links.strokeWidth,style:e.normalizeStyle(`opacity:${C.value?[l.target,l.source].includes(C.value)?1:.3:t.value.style.chart.links.opacity}`)},null,12,Ee))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.nodes,(l,r)=>(e.openBlock(),e.createElementBlock("rect",{class:"vue-ui-flow-node",x:l.x,y:e.unref(s.checkNaN)(l.absoluteY),height:e.unref(s.checkNaN)(l.height),width:g.value,fill:l.color,stroke:t.value.style.chart.nodes.stroke,"stroke-width":t.value.style.chart.nodes.strokeWidth,onMouseenter:a=>de(l),onMouseleave:n[0]||(n[0]=a=>ve()),style:e.normalizeStyle(`opacity:${m.value?m.value.includes(l.name)?1:.2:1}`)},null,44,Se))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.nodes,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:l.x+g.value/2,y:e.unref(s.checkNaN)(l.absoluteY+l.height/2-t.value.style.chart.nodes.labels.fontSize/4),"font-size":t.value.style.chart.nodes.labels.fontSize,fill:e.unref(s.adaptColorToBackground)(l.color),"text-anchor":"middle",style:e.normalizeStyle(`pointer-events: none; opacity:${m.value?m.value.includes(l.name)?1:0:1}`)},e.toDisplayString(t.value.style.chart.nodes.labels.abbreviation.use?e.unref(s.abbreviate)({source:l.name,length:t.value.style.chart.nodes.labels.abbreviation.length}):l.name),13,Te))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.nodes,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:l.x+g.value/2,y:e.unref(s.checkNaN)(l.absoluteY+l.height/2+t.value.style.chart.nodes.labels.fontSize),"font-size":t.value.style.chart.nodes.labels.fontSize,fill:e.unref(s.adaptColorToBackground)(l.color),"text-anchor":"middle",style:e.normalizeStyle(`pointer-events: none; opacity:${m.value?m.value.includes(l.name)?1:0:1}`)},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.chart.nodes.labels.formatter,l.value,e.unref(s.dataLabel)({p:t.value.style.chart.nodes.labels.prefix,v:l.value,s:t.value.style.chart.nodes.labels.suffix,r:t.value.style.chart.nodes.labels.rounding}),{datapoint:l,seriesIndex:r})),13,Fe))),256)),e.renderSlot(o.$slots,"svg",{svg:S.value},void 0,!0)],14,Be)),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Le,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(A)||e.unref(H)})),void 0,!0)])):e.createCommentVNode("",!0),B.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ke.default,{key:5,config:{type:"flow",style:{backgroundColor:t.value.style.chart.backgroundColor}}},null,8,["config"])),o.$slots.source?(e.openBlock(),e.createElementBlock("div",Oe,[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),B.value?(e.openBlock(),e.createBlock(ge.default,{key:7,hideDetails:"",config:{open:b.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(pe.DataTable,{colNames:w.value.colNames,head:w.value.head,body:w.value.body,config:w.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:n[1]||(n[1]=l=>b.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,ze)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l.name||l),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,we))}},Ve=Ce._export_sfc(Ie,[["__scopeId","data-v-49421974"]]);exports.default=Ve;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-C8hC7bb2.cjs"),H=require("./useNestedProp-Dv37rqyp.cjs"),X=require("./usePrinter-B9bLOCNs.cjs"),oe=require("./Title-DvefE4KM.cjs"),re=require("./PenAndPaper-oAikdUUx.cjs"),ne=require("./DataTable-CFqyTcn8.cjs"),se=require("./vue-ui-accordion-C2Jw7_0r.cjs"),Y=require("./useResponsive-BJ7DTGpm.cjs"),ue=require("./vue-ui-skeleton-CoYx8g2U.cjs"),ie=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ce=["id"],ve=["xmlns","viewBox"],de=["id"],he=["stop-color"],me=["stop-color"],fe=["stop-color"],pe=["stroke","stroke-width"],be=["stroke","stroke-width"],ye=["x","y","font-size","fill","font-weight"],ge=["points","fill"],ke=["stroke","stroke-width","rx"],Ce=["x","y","font-size","fill","font-weight"],we=["x","y","font-size","fill","font-weight"],xe={key:5,class:"vue-data-ui-watermark"},Le=["innerHTML"],Be={__name:"vue-ui-funnel",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(W,{expose:J}){const d=W;e.useCssVars(l=>({"0dcc78a9":ae.value}));const{vue_ui_funnel:K}=r.useConfig(),b=e.computed(()=>!!d.dataset&&d.dataset.length);e.onMounted(S);function S(){if(r.objectIsEmpty(d.dataset)?r.error({componentName:"VueUiFunnel",type:"dataset"}):d.dataset.forEach((l,o)=>{r.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","value"]}).forEach(a=>{b.value=!1,r.error({componentName:"VueUiFunnel",type:"datasetSerieAttribute",property:a,index:o})})}),t.value.responsive){const l=Y.throttle(()=>{const{width:o,height:a}=Y.useResponsive({chart:g.value,title:t.value.style.chart.title.text?V.value:null,source:E.value,noTitle:P.value});c.value.height=a,c.value.width=o,m.value=R(),u.value.circles=r.translateSize({relator:Math.min(o,a),adjuster:600,source:t.value.style.chart.circles.dataLabels.fontSize,threshold:10,fallback:10}),u.value.names=r.translateSize({relator:Math.min(o,a),adjuster:600,source:t.value.style.chart.bars.dataLabels.name.fontSize,threshold:10,fallback:10}),u.value.values=r.translateSize({relator:Math.min(o,a),adjuster:600,source:t.value.style.chart.bars.dataLabels.value.fontSize,threshold:10,fallback:10})});D.value=new ResizeObserver(l),D.value.observe(g.value.parentNode)}}const g=e.ref(null),k=e.ref(r.createUid()),z=e.ref(0),T=e.ref(0),A=e.ref(0),P=e.ref(null),E=e.ref(null),V=e.ref(null),D=e.ref(null),f=e.ref(!1);function F(){const l=H.useNestedProp({userConfig:d.config,defaultConfig:K});return l.theme?{...H.useNestedProp({userConfig:r.themes.vue_ui_funnel[l.theme]||d.config,defaultConfig:l})}:l}const t=e.computed({get:()=>F(),set:l=>l});e.watch(()=>d.config,l=>{t.value=F(),S(),T.value+=1,A.value+=1,u.value.circles=t.value.style.chart.circles.dataLabels.fontSize,u.value.names=t.value.style.chart.bars.dataLabels.name.fontSize,u.value.values=t.value.style.chart.bars.dataLabels.value.fontSize},{deep:!0});const{isPrinting:O,isImaging:I,generatePdf:q,generateImage:M}=X.usePrinter({elementId:`funnel_${k.value}`,fileName:t.value.style.chart.title.text||"vue-ui-funnel"}),Q=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),L=e.ref({showTable:t.value.table.show}),u=e.ref({circles:t.value.style.chart.circles.dataLabels.fontSize,names:t.value.style.chart.bars.dataLabels.name.fontSize,values:t.value.style.chart.bars.dataLabels.value.fontSize}),c=e.computed({get:()=>({height:t.value.style.chart.height,width:t.value.style.chart.width}),set:l=>l}),h=e.computed(()=>b.value?d.dataset.map((l,o)=>({...l,color:l.color?r.convertColorToHex(l.color):r.lightenHexColor(t.value.style.chart.bars.defaultColor,o/d.dataset.length)})):[]);setTimeout(()=>{f.value=!0},h.value.length*150);function R(){const l=t.value.style.chart.padding.left,o=t.value.style.chart.padding.top;return{left:l,top:o,right:c.value.width-t.value.style.chart.padding.right,bottom:c.value.height-t.value.style.chart.padding.bottom,width:c.value.width-l-t.value.style.chart.padding.right,height:c.value.height-o-t.value.style.chart.padding.bottom}}const m=e.ref(R()),y=e.computed(()=>m.value.height/d.dataset.length),p=e.computed(()=>y.value*t.value.style.chart.bars.gapRatio),G=e.computed(()=>m.value.width*t.value.style.chart.barCircleSpacingRatio),n=e.computed(()=>h.value.map((l,o)=>{const a=y.value-p.value,s=m.value.top+p.value/2*o+(y.value-p.value/2)*o+p.value/2,v=l.value/h.value[0].value,i=(m.value.width-a-G.value)*(l.value/h.value[0].value);return{...l,cx:m.value.left+a/2,cy:s+a/2,datapointIndex:o,fill:l.color,height:Math.max(a,0),proportion:v,r:Math.max(a/2,0),width:Math.max(i,0),x:m.value.left+a+G.value,y:s}})),Z=e.computed(()=>{const l=n.value.map(o=>`${o.x+o.width},${o.y+(y.value-p.value)/2}`);return`${n.value[0].x},${n.value[0].y+(y.value-p.value)/2} ${l.toString()} ${n.value.at(-1).x},${n.value.at(-1).y+(y.value-p.value)/2}`}),ee=e.computed(()=>({x1:n.value[0].cx,y1:n.value[0].cy,x2:n.value.at(-1).cx,y2:n.value.at(-1).cy})),C=e.ref(!1);function te(l){C.value=l,z.value+=1}const ae=e.computed(()=>`${h.value.length*150}ms`),B=e.ref(!1);function $(){B.value=!B.value}function U(){L.value.showTable=!L.value.showTable}const w=e.computed(()=>{const l=h.value.map(a=>({name:a.name,color:a.color})),o=h.value.map(a=>a.value);return{head:l,body:o}}),_=e.computed(()=>{const l=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage],o=w.value.head.map((v,i)=>{const x=r.applyDataLabel(t.value.style.chart.bars.dataLabels.value.formatter,w.value.body[i],r.dataLabel({p:t.value.style.chart.bars.dataLabels.value.prefix,v:w.value.body[i],s:t.value.style.chart.bars.dataLabels.value.suffix,r:t.value.table.td.roundingValue}),{datapoint:n.value[i]}),N=r.applyDataLabel(t.value.style.chart.circles.dataLabels.formatter,n.value[i].proportion*100,r.dataLabel({v:n.value[i].proportion*100,s:"%",r:t.value.table.td.roundingPercentage}),{datapoint:n.value[i]});return[{color:v.color,name:v.name},x,N]}),a={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage],head:l,body:o,config:a}});function j(){e.nextTick(()=>{const l=w.value.head.map((s,v)=>[[s.name],[w.value.body[v]],[n.value[v].proportion*100]]),o=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.series],[t.value.table.columnNames.value],["%"]]].concat(l),a=r.createCsvContent(o);r.downloadCsv({csvContent:a,title:t.value.style.chart.title.text||"vue-ui-funnel"})})}function le(){return h.value}return J({getData:le,generatePdf:q,generateCsv:j,generateImage:M,toggleTable:U,toggleAnnotator:$}),(l,o)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"funnelChart",ref:g,class:e.normalizeClass(`vue-ui-funnel ${C.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; ${t.value.responsive?"height:100%;":""} text-align:center;background:${t.value.style.chart.backgroundColor}`),id:`funnel_${k.value}`},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(re.PenAndPaper,{key:0,parent:g.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:B.value,onClose:$},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),Q.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:P,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:V,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(oe._sfc_main,{key:`title_${T.value}`,config:{title:{cy:"funnel-div-title",...t.value.style.chart.title},subtitle:{cy:"funnel-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&b.value?(e.openBlock(),e.createBlock(X.UserOptions,{ref:"details",key:`user_option_${z.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(O),isImaging:e.unref(I),uid:k.value,hasTooltip:!1,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasLabel:!1,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:C.value,chartElement:g.value,position:t.value.userOptions.position,titles:{...t.value.userOptions.buttonTitles},hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:B.value,onToggleAnnotator:$,onToggleFullscreen:te,onGeneratePdf:e.unref(q),onGenerateImage:e.unref(M),onToggleTable:U,onGenerateCsv:j},e.createSlots({_:2},[l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:s})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:s})),void 0,!0)]),key:"4"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:a,isAnnotator:s})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:a,isAnnotator:s})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","chartElement","position","titles","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":C.value,"vue-data-ui-fulscreen--off":!C.value}),viewBox:`0 0 ${c.value.width<=0?10:c.value.width} ${c.value.height<=0?10:c.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`funnel_area_${k.value}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.chart.backgroundColor,"stop-opacity":0},null,8,he),e.createElementVNode("stop",{offset:"20%","stop-color":t.value.style.chart.area.color},null,8,me),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.area.color},null,8,fe)],8,de)]),t.value.style.chart.circleLinks.show?(e.openBlock(),e.createElementBlock("line",e.mergeProps({key:0},ee.value,{stroke:t.value.style.chart.circleLinks.color,"stroke-width":12*t.value.style.chart.circleLinks.widthRatio,"stroke-linecap":"round",class:{animated:t.value.useCssAnimation},style:{strokeDasharray:t.value.useCssAnimation?m.value.height:0,strokeDashoffset:t.value.useCssAnimation?m.value.height:0}}),null,16,pe)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,({cx:a,cy:s,r:v,fill:i},x)=>(e.openBlock(),e.createElementBlock("circle",e.mergeProps({cx:a,cy:s,r:v,fill:i},{stroke:t.value.style.chart.circles.stroke,"stroke-width":t.value.style.chart.circles.strokeWidth,class:{animated:t.value.useCssAnimation&&!f.value},style:{animationDelay:`${150*x}ms`}}),null,16,be))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(a,s)=>(e.openBlock(),e.createElementBlock("text",{x:a.cx,y:a.cy+u.value.circles/3+t.value.style.chart.circles.dataLabels.offsetY,"text-anchor":"middle","font-size":u.value.circles,fill:t.value.style.chart.circles.dataLabels.adaptColorToBackground?e.unref(r.adaptColorToBackground)(a.color):t.value.style.chart.circles.dataLabels.color,"font-weight":t.value.style.chart.circles.dataLabels.bold?"bold":"normal",class:e.normalizeClass({animated:t.value.useCssAnimation&&!f.value}),style:e.normalizeStyle({animationDelay:`${150*s}ms`})},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.circles.dataLabels.formatter,a.proportion*100,e.unref(r.dataLabel)({v:a.proportion*100,s:"%",r:t.value.style.chart.circles.dataLabels.rounding}),{datapoint:a})),15,ye))),256)),t.value.style.chart.area.show?(e.openBlock(),e.createElementBlock("polygon",{key:1,points:Z.value,fill:`url(#funnel_area_${k.value})`,class:e.normalizeClass({animated:t.value.useCssAnimation&&!f.value}),style:e.normalizeStyle({transition:t.value.useCssAnimation?`all ${150*h.value.length}ms ease-in`:"none"})},null,14,ge)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,({x:a,y:s,height:v,width:i,fill:x},N)=>(e.openBlock(),e.createElementBlock("rect",e.mergeProps({x:a,y:s,height:v,width:i,fill:x},{stroke:t.value.style.chart.bars.stroke,"stroke-width":t.value.style.chart.bars.strokeWidth,rx:t.value.style.chart.bars.borderRadius,class:{animated:t.value.useCssAnimation&&!f.value},style:{animationDelay:`${150*N}ms`}}),null,16,ke))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(a,s)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("text",{x:a.x+a.width+t.value.style.chart.bars.dataLabels.name.offsetX+12,y:a.cy-u.value.names/2+t.value.style.chart.bars.dataLabels.name.offsetY,"text-anchor":"start","font-size":u.value.names,fill:t.value.style.chart.bars.dataLabels.name.color,"font-weight":t.value.style.chart.bars.dataLabels.name.bold?"bold":"normal",class:e.normalizeClass({animated:t.value.useCssAnimation&&!f.value}),style:e.normalizeStyle({animationDelay:`${150*s}ms`})},e.toDisplayString(a.name),15,Ce),e.createElementVNode("text",{x:a.x+a.width+t.value.style.chart.bars.dataLabels.value.offsetX+12,y:a.cy+u.value.values+t.value.style.chart.bars.dataLabels.value.offsetY,"text-anchor":"start","font-size":u.value.values,fill:t.value.style.chart.bars.dataLabels.value.color,"font-weight":t.value.style.chart.bars.dataLabels.value.bold?"bold":"normal",class:e.normalizeClass({animated:t.value.useCssAnimation&&!f.value}),style:e.normalizeStyle({animationDelay:`${150*s}ms`})},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.bars.dataLabels.value.formatter,a.value,e.unref(r.dataLabel)({p:t.value.style.chart.bars.dataLabels.value.prefix,v:a.value,s:t.value.style.chart.bars.dataLabels.value.suffix,r:t.value.style.chart.bars.dataLabels.value.rounding}),{datapoint:a})),15,we)]))),256)),e.renderSlot(l.$slots,"svg",{svg:c.value},void 0,!0)],14,ve)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",xe,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(O)||e.unref(I)})),void 0,!0)])):e.createCommentVNode("",!0),b.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ue.default,{key:6,config:{type:"verticalBar",style:{backgroundColor:t.value.style.chart.backgroundColor,verticalBar:{axis:{color:"#CCCCCC"},color:"#CCCCCC"}}}},null,8,["config"])),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:E,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createBlock(se.default,{key:8,hideDetails:"",config:{open:L.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(ne.DataTable,{key:`table_${A.value}`,colNames:_.value.colNames,head:_.value.head,body:_.value.body,config:_.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:o[0]||(o[0]=a=>L.value.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createElementVNode("div",{innerHTML:a,style:{display:"flex","align-items":"center"}},null,8,Le)]),td:e.withCtx(({td:a})=>[e.createTextVNode(e.toDisplayString(a.name?a.name:a),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,ce))}},_e=ie._export_sfc(Be,[["__scopeId","data-v-51a14bf0"]]);exports.default=_e;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-pevhrKCt.cjs"),H=require("./useNestedProp-W1Kamknp.cjs"),X=require("./usePrinter-CWosF8e1.cjs"),oe=require("./Title-ClPXaj_S.cjs"),re=require("./PenAndPaper-ManFh1Ds.cjs"),ne=require("./DataTable-DOjri-Qa.cjs"),se=require("./vue-ui-accordion-lQ9g-y51.cjs"),Y=require("./useResponsive-BJ7DTGpm.cjs"),ue=require("./vue-ui-skeleton-ClN7paFX.cjs"),ie=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ce=["id"],ve=["xmlns","viewBox"],de=["id"],he=["stop-color"],me=["stop-color"],fe=["stop-color"],pe=["stroke","stroke-width"],be=["stroke","stroke-width"],ye=["x","y","font-size","fill","font-weight"],ge=["points","fill"],ke=["stroke","stroke-width","rx"],Ce=["x","y","font-size","fill","font-weight"],we=["x","y","font-size","fill","font-weight"],xe={key:5,class:"vue-data-ui-watermark"},Le=["innerHTML"],Be={__name:"vue-ui-funnel",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(W,{expose:J}){const d=W;e.useCssVars(l=>({"0dcc78a9":ae.value}));const{vue_ui_funnel:K}=r.useConfig(),b=e.computed(()=>!!d.dataset&&d.dataset.length);e.onMounted(S);function S(){if(r.objectIsEmpty(d.dataset)?r.error({componentName:"VueUiFunnel",type:"dataset"}):d.dataset.forEach((l,o)=>{r.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","value"]}).forEach(a=>{b.value=!1,r.error({componentName:"VueUiFunnel",type:"datasetSerieAttribute",property:a,index:o})})}),t.value.responsive){const l=Y.throttle(()=>{const{width:o,height:a}=Y.useResponsive({chart:g.value,title:t.value.style.chart.title.text?V.value:null,source:E.value,noTitle:P.value});c.value.height=a,c.value.width=o,m.value=R(),u.value.circles=r.translateSize({relator:Math.min(o,a),adjuster:600,source:t.value.style.chart.circles.dataLabels.fontSize,threshold:10,fallback:10}),u.value.names=r.translateSize({relator:Math.min(o,a),adjuster:600,source:t.value.style.chart.bars.dataLabels.name.fontSize,threshold:10,fallback:10}),u.value.values=r.translateSize({relator:Math.min(o,a),adjuster:600,source:t.value.style.chart.bars.dataLabels.value.fontSize,threshold:10,fallback:10})});D.value=new ResizeObserver(l),D.value.observe(g.value.parentNode)}}const g=e.ref(null),k=e.ref(r.createUid()),z=e.ref(0),T=e.ref(0),A=e.ref(0),P=e.ref(null),E=e.ref(null),V=e.ref(null),D=e.ref(null),f=e.ref(!1);function F(){const l=H.useNestedProp({userConfig:d.config,defaultConfig:K});return l.theme?{...H.useNestedProp({userConfig:r.themes.vue_ui_funnel[l.theme]||d.config,defaultConfig:l})}:l}const t=e.computed({get:()=>F(),set:l=>l});e.watch(()=>d.config,l=>{t.value=F(),S(),T.value+=1,A.value+=1,u.value.circles=t.value.style.chart.circles.dataLabels.fontSize,u.value.names=t.value.style.chart.bars.dataLabels.name.fontSize,u.value.values=t.value.style.chart.bars.dataLabels.value.fontSize},{deep:!0});const{isPrinting:O,isImaging:I,generatePdf:q,generateImage:M}=X.usePrinter({elementId:`funnel_${k.value}`,fileName:t.value.style.chart.title.text||"vue-ui-funnel"}),Q=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),L=e.ref({showTable:t.value.table.show}),u=e.ref({circles:t.value.style.chart.circles.dataLabels.fontSize,names:t.value.style.chart.bars.dataLabels.name.fontSize,values:t.value.style.chart.bars.dataLabels.value.fontSize}),c=e.computed({get:()=>({height:t.value.style.chart.height,width:t.value.style.chart.width}),set:l=>l}),h=e.computed(()=>b.value?d.dataset.map((l,o)=>({...l,color:l.color?r.convertColorToHex(l.color):r.lightenHexColor(t.value.style.chart.bars.defaultColor,o/d.dataset.length)})):[]);setTimeout(()=>{f.value=!0},h.value.length*150);function R(){const l=t.value.style.chart.padding.left,o=t.value.style.chart.padding.top;return{left:l,top:o,right:c.value.width-t.value.style.chart.padding.right,bottom:c.value.height-t.value.style.chart.padding.bottom,width:c.value.width-l-t.value.style.chart.padding.right,height:c.value.height-o-t.value.style.chart.padding.bottom}}const m=e.ref(R()),y=e.computed(()=>m.value.height/d.dataset.length),p=e.computed(()=>y.value*t.value.style.chart.bars.gapRatio),G=e.computed(()=>m.value.width*t.value.style.chart.barCircleSpacingRatio),n=e.computed(()=>h.value.map((l,o)=>{const a=y.value-p.value,s=m.value.top+p.value/2*o+(y.value-p.value/2)*o+p.value/2,v=l.value/h.value[0].value,i=(m.value.width-a-G.value)*(l.value/h.value[0].value);return{...l,cx:m.value.left+a/2,cy:s+a/2,datapointIndex:o,fill:l.color,height:Math.max(a,0),proportion:v,r:Math.max(a/2,0),width:Math.max(i,0),x:m.value.left+a+G.value,y:s}})),Z=e.computed(()=>{const l=n.value.map(o=>`${o.x+o.width},${o.y+(y.value-p.value)/2}`);return`${n.value[0].x},${n.value[0].y+(y.value-p.value)/2} ${l.toString()} ${n.value.at(-1).x},${n.value.at(-1).y+(y.value-p.value)/2}`}),ee=e.computed(()=>({x1:n.value[0].cx,y1:n.value[0].cy,x2:n.value.at(-1).cx,y2:n.value.at(-1).cy})),C=e.ref(!1);function te(l){C.value=l,z.value+=1}const ae=e.computed(()=>`${h.value.length*150}ms`),B=e.ref(!1);function $(){B.value=!B.value}function U(){L.value.showTable=!L.value.showTable}const w=e.computed(()=>{const l=h.value.map(a=>({name:a.name,color:a.color})),o=h.value.map(a=>a.value);return{head:l,body:o}}),_=e.computed(()=>{const l=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage],o=w.value.head.map((v,i)=>{const x=r.applyDataLabel(t.value.style.chart.bars.dataLabels.value.formatter,w.value.body[i],r.dataLabel({p:t.value.style.chart.bars.dataLabels.value.prefix,v:w.value.body[i],s:t.value.style.chart.bars.dataLabels.value.suffix,r:t.value.table.td.roundingValue}),{datapoint:n.value[i]}),N=r.applyDataLabel(t.value.style.chart.circles.dataLabels.formatter,n.value[i].proportion*100,r.dataLabel({v:n.value[i].proportion*100,s:"%",r:t.value.table.td.roundingPercentage}),{datapoint:n.value[i]});return[{color:v.color,name:v.name},x,N]}),a={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage],head:l,body:o,config:a}});function j(){e.nextTick(()=>{const l=w.value.head.map((s,v)=>[[s.name],[w.value.body[v]],[n.value[v].proportion*100]]),o=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.series],[t.value.table.columnNames.value],["%"]]].concat(l),a=r.createCsvContent(o);r.downloadCsv({csvContent:a,title:t.value.style.chart.title.text||"vue-ui-funnel"})})}function le(){return h.value}return J({getData:le,generatePdf:q,generateCsv:j,generateImage:M,toggleTable:U,toggleAnnotator:$}),(l,o)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"funnelChart",ref:g,class:e.normalizeClass(`vue-ui-funnel ${C.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; ${t.value.responsive?"height:100%;":""} text-align:center;background:${t.value.style.chart.backgroundColor}`),id:`funnel_${k.value}`},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(re.PenAndPaper,{key:0,parent:g.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:B.value,onClose:$},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),Q.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:P,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:V,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(oe._sfc_main,{key:`title_${T.value}`,config:{title:{cy:"funnel-div-title",...t.value.style.chart.title},subtitle:{cy:"funnel-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&b.value?(e.openBlock(),e.createBlock(X.UserOptions,{ref:"details",key:`user_option_${z.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(O),isImaging:e.unref(I),uid:k.value,hasTooltip:!1,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasLabel:!1,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:C.value,chartElement:g.value,position:t.value.userOptions.position,titles:{...t.value.userOptions.buttonTitles},hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:B.value,onToggleAnnotator:$,onToggleFullscreen:te,onGeneratePdf:e.unref(q),onGenerateImage:e.unref(M),onToggleTable:U,onGenerateCsv:j},e.createSlots({_:2},[l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:s})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:s})),void 0,!0)]),key:"4"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:a,isAnnotator:s})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:a,isAnnotator:s})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","chartElement","position","titles","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":C.value,"vue-data-ui-fulscreen--off":!C.value}),viewBox:`0 0 ${c.value.width<=0?10:c.value.width} ${c.value.height<=0?10:c.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`funnel_area_${k.value}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.chart.backgroundColor,"stop-opacity":0},null,8,he),e.createElementVNode("stop",{offset:"20%","stop-color":t.value.style.chart.area.color},null,8,me),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.area.color},null,8,fe)],8,de)]),t.value.style.chart.circleLinks.show?(e.openBlock(),e.createElementBlock("line",e.mergeProps({key:0},ee.value,{stroke:t.value.style.chart.circleLinks.color,"stroke-width":12*t.value.style.chart.circleLinks.widthRatio,"stroke-linecap":"round",class:{animated:t.value.useCssAnimation},style:{strokeDasharray:t.value.useCssAnimation?m.value.height:0,strokeDashoffset:t.value.useCssAnimation?m.value.height:0}}),null,16,pe)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,({cx:a,cy:s,r:v,fill:i},x)=>(e.openBlock(),e.createElementBlock("circle",e.mergeProps({cx:a,cy:s,r:v,fill:i},{stroke:t.value.style.chart.circles.stroke,"stroke-width":t.value.style.chart.circles.strokeWidth,class:{animated:t.value.useCssAnimation&&!f.value},style:{animationDelay:`${150*x}ms`}}),null,16,be))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(a,s)=>(e.openBlock(),e.createElementBlock("text",{x:a.cx,y:a.cy+u.value.circles/3+t.value.style.chart.circles.dataLabels.offsetY,"text-anchor":"middle","font-size":u.value.circles,fill:t.value.style.chart.circles.dataLabels.adaptColorToBackground?e.unref(r.adaptColorToBackground)(a.color):t.value.style.chart.circles.dataLabels.color,"font-weight":t.value.style.chart.circles.dataLabels.bold?"bold":"normal",class:e.normalizeClass({animated:t.value.useCssAnimation&&!f.value}),style:e.normalizeStyle({animationDelay:`${150*s}ms`})},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.circles.dataLabels.formatter,a.proportion*100,e.unref(r.dataLabel)({v:a.proportion*100,s:"%",r:t.value.style.chart.circles.dataLabels.rounding}),{datapoint:a})),15,ye))),256)),t.value.style.chart.area.show?(e.openBlock(),e.createElementBlock("polygon",{key:1,points:Z.value,fill:`url(#funnel_area_${k.value})`,class:e.normalizeClass({animated:t.value.useCssAnimation&&!f.value}),style:e.normalizeStyle({transition:t.value.useCssAnimation?`all ${150*h.value.length}ms ease-in`:"none"})},null,14,ge)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,({x:a,y:s,height:v,width:i,fill:x},N)=>(e.openBlock(),e.createElementBlock("rect",e.mergeProps({x:a,y:s,height:v,width:i,fill:x},{stroke:t.value.style.chart.bars.stroke,"stroke-width":t.value.style.chart.bars.strokeWidth,rx:t.value.style.chart.bars.borderRadius,class:{animated:t.value.useCssAnimation&&!f.value},style:{animationDelay:`${150*N}ms`}}),null,16,ke))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(a,s)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("text",{x:a.x+a.width+t.value.style.chart.bars.dataLabels.name.offsetX+12,y:a.cy-u.value.names/2+t.value.style.chart.bars.dataLabels.name.offsetY,"text-anchor":"start","font-size":u.value.names,fill:t.value.style.chart.bars.dataLabels.name.color,"font-weight":t.value.style.chart.bars.dataLabels.name.bold?"bold":"normal",class:e.normalizeClass({animated:t.value.useCssAnimation&&!f.value}),style:e.normalizeStyle({animationDelay:`${150*s}ms`})},e.toDisplayString(a.name),15,Ce),e.createElementVNode("text",{x:a.x+a.width+t.value.style.chart.bars.dataLabels.value.offsetX+12,y:a.cy+u.value.values+t.value.style.chart.bars.dataLabels.value.offsetY,"text-anchor":"start","font-size":u.value.values,fill:t.value.style.chart.bars.dataLabels.value.color,"font-weight":t.value.style.chart.bars.dataLabels.value.bold?"bold":"normal",class:e.normalizeClass({animated:t.value.useCssAnimation&&!f.value}),style:e.normalizeStyle({animationDelay:`${150*s}ms`})},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.bars.dataLabels.value.formatter,a.value,e.unref(r.dataLabel)({p:t.value.style.chart.bars.dataLabels.value.prefix,v:a.value,s:t.value.style.chart.bars.dataLabels.value.suffix,r:t.value.style.chart.bars.dataLabels.value.rounding}),{datapoint:a})),15,we)]))),256)),e.renderSlot(l.$slots,"svg",{svg:c.value},void 0,!0)],14,ve)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",xe,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(O)||e.unref(I)})),void 0,!0)])):e.createCommentVNode("",!0),b.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ue.default,{key:6,config:{type:"verticalBar",style:{backgroundColor:t.value.style.chart.backgroundColor,verticalBar:{axis:{color:"#CCCCCC"},color:"#CCCCCC"}}}},null,8,["config"])),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:E,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createBlock(se.default,{key:8,hideDetails:"",config:{open:L.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(ne.DataTable,{key:`table_${A.value}`,colNames:_.value.colNames,head:_.value.head,body:_.value.body,config:_.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:o[0]||(o[0]=a=>L.value.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createElementVNode("div",{innerHTML:a,style:{display:"flex","align-items":"center"}},null,8,Le)]),td:e.withCtx(({td:a})=>[e.createTextVNode(e.toDisplayString(a.name?a.name:a),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,ce))}},_e=ie._export_sfc(Be,[["__scopeId","data-v-51a14bf0"]]);exports.default=_e;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { useCssVars as we, computed as i, onMounted as xe, ref as u, watch as $e, openBlock as s, createElementBlock as r, normalizeClass as L, normalizeStyle as T, createBlock as A, createCommentVNode as m, unref as d, createSlots as _e, withCtx as p, renderSlot as k, normalizeProps as X, guardReactiveProps as j, createElementVNode as C, mergeProps as H, Fragment as M, renderList as B, toDisplayString as E, createTextVNode as Le, nextTick as Te } from "vue";
|
|
2
|
-
import { u as Ae, o as Ne, e as ve, g as ze, c as Pe, d as Se, l as Fe, i as R, f as G, X as Oe, F as De, t as Ie, q as Me, r as Be, E as Y } from "./index-
|
|
3
|
-
import { u as de } from "./useNestedProp-
|
|
4
|
-
import { u as Ee, U as Re } from "./usePrinter-
|
|
5
|
-
import { _ as Ge } from "./Title-
|
|
6
|
-
import { P as Ve } from "./PenAndPaper-
|
|
7
|
-
import { D as Ue } from "./DataTable-
|
|
8
|
-
import Xe from "./vue-ui-accordion-
|
|
2
|
+
import { u as Ae, o as Ne, e as ve, g as ze, c as Pe, d as Se, l as Fe, i as R, f as G, X as Oe, F as De, t as Ie, q as Me, r as Be, E as Y } from "./index-CvGoB7HV.js";
|
|
3
|
+
import { u as de } from "./useNestedProp-CX0uXnyy.js";
|
|
4
|
+
import { u as Ee, U as Re } from "./usePrinter-B0E13IH3.js";
|
|
5
|
+
import { _ as Ge } from "./Title-kiBjyWrd.js";
|
|
6
|
+
import { P as Ve } from "./PenAndPaper-R8H8qKoM.js";
|
|
7
|
+
import { D as Ue } from "./DataTable-Ci7Hxwni.js";
|
|
8
|
+
import Xe from "./vue-ui-accordion-BUQB7L1N.js";
|
|
9
9
|
import { t as je, u as He } from "./useResponsive-CoxXLe23.js";
|
|
10
|
-
import Ye from "./vue-ui-skeleton-
|
|
10
|
+
import Ye from "./vue-ui-skeleton-CL1iMZq4.js";
|
|
11
11
|
import { _ as qe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
12
12
|
const We = ["id"], Je = ["xmlns", "viewBox"], Ke = ["id"], Qe = ["stop-color"], Ze = ["stop-color"], et = ["stop-color"], tt = ["stroke", "stroke-width"], at = ["stroke", "stroke-width"], lt = ["x", "y", "font-size", "fill", "font-weight"], st = ["points", "fill"], ot = ["stroke", "stroke-width", "rx"], nt = ["x", "y", "font-size", "fill", "font-weight"], rt = ["x", "y", "font-size", "fill", "font-weight"], ut = {
|
|
13
13
|
key: 5,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { computed as d, onMounted as Se, ref as u, watch as Ne, openBlock as o, createElementBlock as n, normalizeClass as F, normalizeStyle as H, createBlock as $, createCommentVNode as i, unref as p, createSlots as Le, withCtx as c, renderSlot as v, normalizeProps as S, guardReactiveProps as N, createVNode as re, createElementVNode as x, Fragment as ue, renderList as ne, createTextVNode as ie, toDisplayString as E, nextTick as Oe } from "vue";
|
|
2
|
-
import { u as Ie, o as Ae, e as ce, g as Fe, c as ve, t as Ee, a as De, p as D, b as Ve, d as Be, I as de, L as Ge, f as k, X as Me, i as he, x as pe, y as ze, q as We, r as He } from "./index-
|
|
3
|
-
import { L as Ue } from "./Legend-
|
|
4
|
-
import { _ as Xe } from "./Title-
|
|
5
|
-
import { _ as Re } from "./Tooltip-
|
|
6
|
-
import { D as Ye } from "./DataTable-
|
|
7
|
-
import { u as je, U as qe } from "./usePrinter-
|
|
8
|
-
import Je from "./vue-ui-skeleton-
|
|
9
|
-
import Ke from "./vue-ui-accordion-
|
|
10
|
-
import { u as ye } from "./useNestedProp-
|
|
11
|
-
import { _ as Qe } from "./PackageVersion-
|
|
12
|
-
import { P as Ze } from "./PenAndPaper-
|
|
2
|
+
import { u as Ie, o as Ae, e as ce, g as Fe, c as ve, t as Ee, a as De, p as D, b as Ve, d as Be, I as de, L as Ge, f as k, X as Me, i as he, x as pe, y as ze, q as We, r as He } from "./index-CvGoB7HV.js";
|
|
3
|
+
import { L as Ue } from "./Legend-D2OrVhyH.js";
|
|
4
|
+
import { _ as Xe } from "./Title-kiBjyWrd.js";
|
|
5
|
+
import { _ as Re } from "./Tooltip-3XuY4gCn.js";
|
|
6
|
+
import { D as Ye } from "./DataTable-Ci7Hxwni.js";
|
|
7
|
+
import { u as je, U as qe } from "./usePrinter-B0E13IH3.js";
|
|
8
|
+
import Je from "./vue-ui-skeleton-CL1iMZq4.js";
|
|
9
|
+
import Ke from "./vue-ui-accordion-BUQB7L1N.js";
|
|
10
|
+
import { u as ye } from "./useNestedProp-CX0uXnyy.js";
|
|
11
|
+
import { _ as Qe } from "./PackageVersion-jcUUbnGR.js";
|
|
12
|
+
import { P as Ze } from "./PenAndPaper-R8H8qKoM.js";
|
|
13
13
|
import { _ as et } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
14
14
|
const tt = ["id"], lt = {
|
|
15
15
|
key: 1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-C8hC7bb2.cjs"),re=require("./Legend-pgTgfe5J.cjs"),ne=require("./Title-DvefE4KM.cjs"),se=require("./Tooltip-BSs2B4GJ.cjs"),ue=require("./DataTable-CFqyTcn8.cjs"),U=require("./usePrinter-B9bLOCNs.cjs"),ie=require("./vue-ui-skeleton-CoYx8g2U.cjs"),ce=require("./vue-ui-accordion-C2Jw7_0r.cjs"),H=require("./useNestedProp-Dv37rqyp.cjs"),de=require("./PackageVersion-B9X8pKiF.cjs"),ve=require("./PenAndPaper-oAikdUUx.cjs"),pe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),he=["id"],fe={key:1,ref:"noTitle",class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},ye={key:2,style:"width:100%;background:transparent;padding-bottom:24px"},ge=["xmlns","viewBox"],me=["id"],be=["stdDeviation"],ke=["d","stroke","stroke-width"],Ce=["d","stroke","stroke-width"],we=["filter"],xe=["d","stroke","stroke-width"],$e=["d","stroke-width","onMouseenter","onClick"],Be={key:5,class:"vue-data-ui-watermark"},Ne=["onClick"],Te={key:0},_e={key:1},Se={key:8,ref:"source",dir:"auto"},Pe=["innerHTML"],Ve={__name:"vue-ui-galaxy",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(X,{expose:j,emit:S}){const i=X,{vue_ui_galaxy:Y}=r.useConfig(),b=e.computed(()=>!!i.dataset&&i.dataset.length);e.onMounted(()=>{P()});function P(){r.objectIsEmpty(i.dataset)?r.error({componentName:"VueUiGalaxy",type:"dataset"}):i.dataset.forEach((l,a)=>{r.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(o=>{r.error({componentName:"VueUiGalaxy",type:"datasetSerieAttribute",property:o,index:a})})})}const y=e.ref(r.createUid()),k=e.ref(null),J=e.ref(null),x=e.ref(!1),$=e.ref(""),c=e.ref(null),V=e.ref(0),E=e.ref(0),L=e.ref(0),O=e.ref(0),t=e.computed({get:()=>A(),set:l=>l});function A(){const l=H.useNestedProp({userConfig:i.config,defaultConfig:Y});return l.theme?{...H.useNestedProp({userConfig:r.themes.vue_ui_galaxy[l.theme]||i.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}e.watch(()=>i.config,l=>{t.value=A(),P(),E.value+=1,L.value+=1,O.value+=1},{deep:!0});const{isPrinting:F,isImaging:I,generatePdf:z,generateImage:D}=U.usePrinter({elementId:`galaxy_${y.value}`,fileName:t.value.style.chart.title.text||"vue-ui-galaxy"}),K=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),Q=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),v=e.ref({dataLabels:{show:t.value.style.chart.layout.labels.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),B=e.ref({height:180,width:250}),u=e.ref([]);function N(l){u.value.includes(l.id)?u.value=u.value.filter(a=>a!==l.id):u.value.push(l.id),S("selectLegend",g.value.map(a=>({name:a.name,color:a.color,value:a.value})))}const h=e.computed(()=>i.dataset.map((l,a)=>({name:l.name,color:r.convertColorToHex(l.color)||Q.value[a]||r.palette[a]||r.palette[a%r.palette.length],value:l.values?r.sanitizeArray(l.values).reduce((o,n)=>o+n,0):0,absoluteValues:r.sanitizeArray(l.values),id:r.createUid(),seriesIndex:a})).sort((l,a)=>a.value-l.value));function Z(){return h.value.map(l=>({name:l.name,color:l.color,value:l.value}))}const d=e.computed(()=>h.value.filter(l=>!u.value.includes(l.id)).map(l=>l.value).reduce((l,a)=>l+a,0)),ee=e.ref(190),q=e.computed(()=>h.value.filter(l=>!u.value.includes(l.id))),g=e.computed(()=>{const l=[];for(let a=0;a<q.value.length;a+=1){const o=q.value[a];let n=o.value/d.value*ee.value;a>0&&l.length&&(n+=l[a-1].points),l.push({points:n,...o,seriesIndex:a,proportion:o.value/d.value,path:r.createSpiralPath({points:n,startX:115+t.value.style.chart.layout.arcs.offsetX,startY:90+t.value.style.chart.layout.arcs.offsetY})})}return l.filter((a,o)=>!u.value.includes(a.id)).toSorted((a,o)=>o.points-a.points)}),m=e.ref(!1);function te(l){m.value=l,V.value+=1}const T=e.ref(null);function le({datapoint:l,_relativeIndex:a,seriesIndex:o,show:n=!1}){T.value={datapoint:l,seriesIndex:o,series:h.value,config:t.value},x.value=n,c.value=l.id;let s="";const f=t.value.style.chart.tooltip.customFormat;r.isFunction(f)&&r.functionReturnsString(()=>f({seriesIndex:o,datapoint:l,series:h.value,config:t.value}))?$.value=f({seriesIndex:o,datapoint:l,series:h.value,config:t.value}):(s+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${l.name}</div>`,s+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${l.color}"/></svg>`,t.value.style.chart.tooltip.showValue&&(s+=`<b>${r.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,l.value,r.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:l.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:l,seriesIndex:o})}</b>`),t.value.style.chart.tooltip.showPercentage&&(t.value.style.chart.tooltip.showValue?s+=`<span>(${r.dataLabel({v:l.proportion*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage})})</span></div>`:s+=`<b>${r.dataLabel({v:l.proportion*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage})}</b></div>`),$.value=`<div>${s}</div>`)}const G=e.computed(()=>h.value.map((l,a)=>({...l,proportion:(l.value||0)/i.dataset.map(o=>(o.values||[]).reduce((n,s)=>n+s,0)).reduce((o,n)=>o+n,0),opacity:u.value.includes(l.id)?.5:1,shape:l.shape||"circle",segregate:()=>N(l),isSegregated:u.value.includes(l.id)}))),oe=e.computed(()=>({cy:"galaxy-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),p=e.computed(()=>{const l=g.value.map(o=>({name:o.name,color:o.color})),a=g.value.map(o=>o.value);return{head:l,body:a}});function M(){e.nextTick(()=>{const l=p.value.head.map((n,s)=>[[n.name],[p.value.body[s]],[isNaN(p.value.body[s]/d.value)?"-":p.value.body[s]/d.value*100]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(l),o=r.createCsvContent(a);r.downloadCsv({csvContent:o,title:t.value.style.chart.title.text||"vue-ui-galaxy"})})}const C=e.computed(()=>{const l=[' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>',r.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:d.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue}),"100%"],a=p.value.head.map((s,f)=>{const ae=r.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:p.value.body[f],s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue});return[{color:s.color,name:s.name},ae,isNaN(p.value.body[f]/d.value)?"-":r.dataLabel({v:p.value.body[f]/d.value*100,s:"%",r:t.value.table.td.roundingPercentage})]}),o={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage],head:l,body:a,config:o}});function W(){v.value.showTable=!v.value.showTable}function R(){v.value.showTooltip=!v.value.showTooltip}const w=e.ref(!1);function _(){w.value=!w.value}return j({getData:Z,generatePdf:z,generateCsv:M,generateImage:D,toggleTable:W,toggleTooltip:R,toggleAnnotator:_}),(l,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"galaxyChart",ref:k,class:e.normalizeClass(`vue-ui-galaxy ${m.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor}`),id:`galaxy_${y.value}`},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(ve.PenAndPaper,{key:0,parent:k.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:w.value,onClose:_},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),K.value?(e.openBlock(),e.createElementBlock("div",fe,null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",ye,[(e.openBlock(),e.createBlock(ne._sfc_main,{key:`title_${E.value}`,config:{title:{cy:"galaxy-div-title",...t.value.style.chart.title},subtitle:{cy:"galaxy-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))])):e.createCommentVNode("",!0),t.value.userOptions.show&&b.value?(e.openBlock(),e.createBlock(U.UserOptions,{ref_key:"details",ref:J,key:`user_option_${V.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(F),isImaging:e.unref(I),uid:y.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isTooltip:v.value.showTooltip,isFullscreen:m.value,titles:{...t.value.userOptions.buttonTitles},chartElement:k.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:w.value,onToggleFullscreen:te,onGeneratePdf:e.unref(z),onGenerateCsv:M,onGenerateImage:e.unref(D),onToggleTable:W,onToggleTooltip:R,onToggleAnnotator:_},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:n})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:n})),void 0,!0)]),key:"5"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:n})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:n})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":m.value,"vue-data-ui-fulscreen--off":!m.value}),viewBox:`0 0 ${B.value.width} ${B.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(de._sfc_main),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${y.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},[e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:100/t.value.style.chart.layout.arcs.gradient.intensity},null,8,be)],8,me)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,o=>(e.openBlock(),e.createElementBlock("g",null,[o.value?(e.openBlock(),e.createElementBlock("path",{key:0,d:o.path,fill:"none",stroke:t.value.style.chart.backgroundColor,"stroke-width":(t.value.style.chart.layout.arcs.strokeWidth+t.value.style.chart.layout.arcs.borderWidth)*(c.value===o.id&&t.value.style.chart.layout.arcs.hoverEffect.show?t.value.style.chart.layout.arcs.hoverEffect.multiplicator:1),"stroke-linecap":"round"},null,8,ke)):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createElementBlock("path",{key:1,d:o.path,fill:"none",stroke:o.color,"stroke-width":t.value.style.chart.layout.arcs.strokeWidth*(c.value===o.id&&t.value.style.chart.layout.arcs.hoverEffect.show?t.value.style.chart.layout.arcs.hoverEffect.multiplicator:1),"stroke-linecap":"round",class:e.normalizeClass(`${c.value&&c.value!==o.id&&t.value.useBlurOnHover?"vue-ui-galaxy-blur":""}`)},null,10,Ce)):e.createCommentVNode("",!0),o.value&&t.value.style.chart.layout.arcs.gradient.show?(e.openBlock(),e.createElementBlock("g",{key:2,filter:`url(#blur_${y.value})`},[e.createElementVNode("path",{d:o.path,fill:"none",stroke:t.value.style.chart.layout.arcs.gradient.color,"stroke-width":t.value.style.chart.layout.arcs.strokeWidth/2*(c.value===o.id&&t.value.style.chart.layout.arcs.hoverEffect.show?t.value.style.chart.layout.arcs.hoverEffect.multiplicator:1),"stroke-linecap":"round",class:e.normalizeClass(`vue-ui-galaxy-gradient ${c.value&&c.value!==o.id&&t.value.useBlurOnHover?"vue-ui-galaxy-blur":""}`)},null,10,xe)],8,we)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(o,n)=>(e.openBlock(),e.createElementBlock("g",null,[o.value?(e.openBlock(),e.createElementBlock("path",{key:0,d:o.path,fill:"none",stroke:"transparent","stroke-width":t.value.style.chart.layout.arcs.strokeWidth+t.value.style.chart.layout.arcs.borderWidth,"stroke-linecap":"round",onMouseenter:s=>le({datapoint:o,relativeIndex:n,seriesIndex:o.seriesIndex,show:!0}),onMouseleave:a[0]||(a[0]=s=>{x.value=!1,c.value=null}),onClick:s=>S("selectDatapoint",o)},null,40,$e)):e.createCommentVNode("",!0)]))),256)),e.renderSlot(l.$slots,"svg",{svg:B.value},void 0,!0)],14,ge)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Be,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(F)||e.unref(I)})),void 0,!0)])):e.createCommentVNode("",!0),b.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ie.default,{key:6,config:{type:"galaxy",style:{backgroundColor:t.value.style.chart.backgroundColor,galaxy:{color:"#CCCCCC"}}}},null,8,["config"])),t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(re.Legend,{key:`legend_${O.value}`,legendSet:G.value,config:oe.value,onClickMarker:a[1]||(a[1]=({legend:o})=>N(o))},{item:e.withCtx(({legend:o,index:n})=>[e.createElementVNode("div",{onClick:s=>N(o),style:e.normalizeStyle(`opacity:${u.value.includes(o.id)?.5:1}`)},[e.createTextVNode(e.toDisplayString(o.name)+": "+e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,o.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:o.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:o,seriesIndex:n}))+" ",1),u.value.includes(o.id)?(e.openBlock(),e.createElementBlock("span",_e," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",Te," ("+e.toDisplayString(isNaN(o.value/d.value)?"-":e.unref(r.dataLabel)({v:o.value/d.value*100,s:"%",r:t.value.style.chart.legend.roundingPercentage}))+") ",1))],12,Ne)]),_:1},8,["legendSet","config"])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"legend",{legend:G.value},void 0,!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",Se,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(se._sfc_main,{show:v.value.showTooltip&&x.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,fontSize:t.value.style.chart.tooltip.fontSize,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:k.value,content:$.value,isCustom:e.unref(r.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...T.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...T.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isCustom"]),b.value?(e.openBlock(),e.createBlock(ce.default,{key:9,hideDetails:"",config:{open:v.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(ue.DataTable,{key:`table_${L.value}`,colNames:C.value.colNames,head:C.value.head,body:C.value.body,config:C.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:a[2]||(a[2]=o=>v.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,Pe)]),td:e.withCtx(({td:o})=>[e.createTextVNode(e.toDisplayString(o.name||o),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,he))}},Ee=pe._export_sfc(Ve,[["__scopeId","data-v-9e3163ed"]]);exports.default=Ee;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-pevhrKCt.cjs"),re=require("./Legend-DLz6uwmt.cjs"),ne=require("./Title-ClPXaj_S.cjs"),se=require("./Tooltip-BMKpn2T1.cjs"),ue=require("./DataTable-DOjri-Qa.cjs"),U=require("./usePrinter-CWosF8e1.cjs"),ie=require("./vue-ui-skeleton-ClN7paFX.cjs"),ce=require("./vue-ui-accordion-lQ9g-y51.cjs"),H=require("./useNestedProp-W1Kamknp.cjs"),de=require("./PackageVersion-DtCIEusI.cjs"),ve=require("./PenAndPaper-ManFh1Ds.cjs"),pe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),he=["id"],fe={key:1,ref:"noTitle",class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},ye={key:2,style:"width:100%;background:transparent;padding-bottom:24px"},ge=["xmlns","viewBox"],me=["id"],be=["stdDeviation"],ke=["d","stroke","stroke-width"],Ce=["d","stroke","stroke-width"],we=["filter"],xe=["d","stroke","stroke-width"],$e=["d","stroke-width","onMouseenter","onClick"],Be={key:5,class:"vue-data-ui-watermark"},Ne=["onClick"],Te={key:0},_e={key:1},Se={key:8,ref:"source",dir:"auto"},Pe=["innerHTML"],Ve={__name:"vue-ui-galaxy",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(X,{expose:j,emit:S}){const i=X,{vue_ui_galaxy:Y}=r.useConfig(),b=e.computed(()=>!!i.dataset&&i.dataset.length);e.onMounted(()=>{P()});function P(){r.objectIsEmpty(i.dataset)?r.error({componentName:"VueUiGalaxy",type:"dataset"}):i.dataset.forEach((l,a)=>{r.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(o=>{r.error({componentName:"VueUiGalaxy",type:"datasetSerieAttribute",property:o,index:a})})})}const y=e.ref(r.createUid()),k=e.ref(null),J=e.ref(null),x=e.ref(!1),$=e.ref(""),c=e.ref(null),V=e.ref(0),E=e.ref(0),L=e.ref(0),O=e.ref(0),t=e.computed({get:()=>A(),set:l=>l});function A(){const l=H.useNestedProp({userConfig:i.config,defaultConfig:Y});return l.theme?{...H.useNestedProp({userConfig:r.themes.vue_ui_galaxy[l.theme]||i.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}e.watch(()=>i.config,l=>{t.value=A(),P(),E.value+=1,L.value+=1,O.value+=1},{deep:!0});const{isPrinting:F,isImaging:I,generatePdf:z,generateImage:D}=U.usePrinter({elementId:`galaxy_${y.value}`,fileName:t.value.style.chart.title.text||"vue-ui-galaxy"}),K=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),Q=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),v=e.ref({dataLabels:{show:t.value.style.chart.layout.labels.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),B=e.ref({height:180,width:250}),u=e.ref([]);function N(l){u.value.includes(l.id)?u.value=u.value.filter(a=>a!==l.id):u.value.push(l.id),S("selectLegend",g.value.map(a=>({name:a.name,color:a.color,value:a.value})))}const h=e.computed(()=>i.dataset.map((l,a)=>({name:l.name,color:r.convertColorToHex(l.color)||Q.value[a]||r.palette[a]||r.palette[a%r.palette.length],value:l.values?r.sanitizeArray(l.values).reduce((o,n)=>o+n,0):0,absoluteValues:r.sanitizeArray(l.values),id:r.createUid(),seriesIndex:a})).sort((l,a)=>a.value-l.value));function Z(){return h.value.map(l=>({name:l.name,color:l.color,value:l.value}))}const d=e.computed(()=>h.value.filter(l=>!u.value.includes(l.id)).map(l=>l.value).reduce((l,a)=>l+a,0)),ee=e.ref(190),q=e.computed(()=>h.value.filter(l=>!u.value.includes(l.id))),g=e.computed(()=>{const l=[];for(let a=0;a<q.value.length;a+=1){const o=q.value[a];let n=o.value/d.value*ee.value;a>0&&l.length&&(n+=l[a-1].points),l.push({points:n,...o,seriesIndex:a,proportion:o.value/d.value,path:r.createSpiralPath({points:n,startX:115+t.value.style.chart.layout.arcs.offsetX,startY:90+t.value.style.chart.layout.arcs.offsetY})})}return l.filter((a,o)=>!u.value.includes(a.id)).toSorted((a,o)=>o.points-a.points)}),m=e.ref(!1);function te(l){m.value=l,V.value+=1}const T=e.ref(null);function le({datapoint:l,_relativeIndex:a,seriesIndex:o,show:n=!1}){T.value={datapoint:l,seriesIndex:o,series:h.value,config:t.value},x.value=n,c.value=l.id;let s="";const f=t.value.style.chart.tooltip.customFormat;r.isFunction(f)&&r.functionReturnsString(()=>f({seriesIndex:o,datapoint:l,series:h.value,config:t.value}))?$.value=f({seriesIndex:o,datapoint:l,series:h.value,config:t.value}):(s+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${l.name}</div>`,s+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${l.color}"/></svg>`,t.value.style.chart.tooltip.showValue&&(s+=`<b>${r.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,l.value,r.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:l.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:l,seriesIndex:o})}</b>`),t.value.style.chart.tooltip.showPercentage&&(t.value.style.chart.tooltip.showValue?s+=`<span>(${r.dataLabel({v:l.proportion*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage})})</span></div>`:s+=`<b>${r.dataLabel({v:l.proportion*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage})}</b></div>`),$.value=`<div>${s}</div>`)}const G=e.computed(()=>h.value.map((l,a)=>({...l,proportion:(l.value||0)/i.dataset.map(o=>(o.values||[]).reduce((n,s)=>n+s,0)).reduce((o,n)=>o+n,0),opacity:u.value.includes(l.id)?.5:1,shape:l.shape||"circle",segregate:()=>N(l),isSegregated:u.value.includes(l.id)}))),oe=e.computed(()=>({cy:"galaxy-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),p=e.computed(()=>{const l=g.value.map(o=>({name:o.name,color:o.color})),a=g.value.map(o=>o.value);return{head:l,body:a}});function M(){e.nextTick(()=>{const l=p.value.head.map((n,s)=>[[n.name],[p.value.body[s]],[isNaN(p.value.body[s]/d.value)?"-":p.value.body[s]/d.value*100]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(l),o=r.createCsvContent(a);r.downloadCsv({csvContent:o,title:t.value.style.chart.title.text||"vue-ui-galaxy"})})}const C=e.computed(()=>{const l=[' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>',r.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:d.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue}),"100%"],a=p.value.head.map((s,f)=>{const ae=r.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:p.value.body[f],s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue});return[{color:s.color,name:s.name},ae,isNaN(p.value.body[f]/d.value)?"-":r.dataLabel({v:p.value.body[f]/d.value*100,s:"%",r:t.value.table.td.roundingPercentage})]}),o={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage],head:l,body:a,config:o}});function W(){v.value.showTable=!v.value.showTable}function R(){v.value.showTooltip=!v.value.showTooltip}const w=e.ref(!1);function _(){w.value=!w.value}return j({getData:Z,generatePdf:z,generateCsv:M,generateImage:D,toggleTable:W,toggleTooltip:R,toggleAnnotator:_}),(l,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"galaxyChart",ref:k,class:e.normalizeClass(`vue-ui-galaxy ${m.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor}`),id:`galaxy_${y.value}`},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(ve.PenAndPaper,{key:0,parent:k.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:w.value,onClose:_},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),K.value?(e.openBlock(),e.createElementBlock("div",fe,null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",ye,[(e.openBlock(),e.createBlock(ne._sfc_main,{key:`title_${E.value}`,config:{title:{cy:"galaxy-div-title",...t.value.style.chart.title},subtitle:{cy:"galaxy-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))])):e.createCommentVNode("",!0),t.value.userOptions.show&&b.value?(e.openBlock(),e.createBlock(U.UserOptions,{ref_key:"details",ref:J,key:`user_option_${V.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(F),isImaging:e.unref(I),uid:y.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isTooltip:v.value.showTooltip,isFullscreen:m.value,titles:{...t.value.userOptions.buttonTitles},chartElement:k.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:w.value,onToggleFullscreen:te,onGeneratePdf:e.unref(z),onGenerateCsv:M,onGenerateImage:e.unref(D),onToggleTable:W,onToggleTooltip:R,onToggleAnnotator:_},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:n})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:n})),void 0,!0)]),key:"5"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:n})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:n})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":m.value,"vue-data-ui-fulscreen--off":!m.value}),viewBox:`0 0 ${B.value.width} ${B.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(de._sfc_main),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${y.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},[e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:100/t.value.style.chart.layout.arcs.gradient.intensity},null,8,be)],8,me)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,o=>(e.openBlock(),e.createElementBlock("g",null,[o.value?(e.openBlock(),e.createElementBlock("path",{key:0,d:o.path,fill:"none",stroke:t.value.style.chart.backgroundColor,"stroke-width":(t.value.style.chart.layout.arcs.strokeWidth+t.value.style.chart.layout.arcs.borderWidth)*(c.value===o.id&&t.value.style.chart.layout.arcs.hoverEffect.show?t.value.style.chart.layout.arcs.hoverEffect.multiplicator:1),"stroke-linecap":"round"},null,8,ke)):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createElementBlock("path",{key:1,d:o.path,fill:"none",stroke:o.color,"stroke-width":t.value.style.chart.layout.arcs.strokeWidth*(c.value===o.id&&t.value.style.chart.layout.arcs.hoverEffect.show?t.value.style.chart.layout.arcs.hoverEffect.multiplicator:1),"stroke-linecap":"round",class:e.normalizeClass(`${c.value&&c.value!==o.id&&t.value.useBlurOnHover?"vue-ui-galaxy-blur":""}`)},null,10,Ce)):e.createCommentVNode("",!0),o.value&&t.value.style.chart.layout.arcs.gradient.show?(e.openBlock(),e.createElementBlock("g",{key:2,filter:`url(#blur_${y.value})`},[e.createElementVNode("path",{d:o.path,fill:"none",stroke:t.value.style.chart.layout.arcs.gradient.color,"stroke-width":t.value.style.chart.layout.arcs.strokeWidth/2*(c.value===o.id&&t.value.style.chart.layout.arcs.hoverEffect.show?t.value.style.chart.layout.arcs.hoverEffect.multiplicator:1),"stroke-linecap":"round",class:e.normalizeClass(`vue-ui-galaxy-gradient ${c.value&&c.value!==o.id&&t.value.useBlurOnHover?"vue-ui-galaxy-blur":""}`)},null,10,xe)],8,we)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(o,n)=>(e.openBlock(),e.createElementBlock("g",null,[o.value?(e.openBlock(),e.createElementBlock("path",{key:0,d:o.path,fill:"none",stroke:"transparent","stroke-width":t.value.style.chart.layout.arcs.strokeWidth+t.value.style.chart.layout.arcs.borderWidth,"stroke-linecap":"round",onMouseenter:s=>le({datapoint:o,relativeIndex:n,seriesIndex:o.seriesIndex,show:!0}),onMouseleave:a[0]||(a[0]=s=>{x.value=!1,c.value=null}),onClick:s=>S("selectDatapoint",o)},null,40,$e)):e.createCommentVNode("",!0)]))),256)),e.renderSlot(l.$slots,"svg",{svg:B.value},void 0,!0)],14,ge)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Be,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(F)||e.unref(I)})),void 0,!0)])):e.createCommentVNode("",!0),b.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ie.default,{key:6,config:{type:"galaxy",style:{backgroundColor:t.value.style.chart.backgroundColor,galaxy:{color:"#CCCCCC"}}}},null,8,["config"])),t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(re.Legend,{key:`legend_${O.value}`,legendSet:G.value,config:oe.value,onClickMarker:a[1]||(a[1]=({legend:o})=>N(o))},{item:e.withCtx(({legend:o,index:n})=>[e.createElementVNode("div",{onClick:s=>N(o),style:e.normalizeStyle(`opacity:${u.value.includes(o.id)?.5:1}`)},[e.createTextVNode(e.toDisplayString(o.name)+": "+e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,o.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:o.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:o,seriesIndex:n}))+" ",1),u.value.includes(o.id)?(e.openBlock(),e.createElementBlock("span",_e," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",Te," ("+e.toDisplayString(isNaN(o.value/d.value)?"-":e.unref(r.dataLabel)({v:o.value/d.value*100,s:"%",r:t.value.style.chart.legend.roundingPercentage}))+") ",1))],12,Ne)]),_:1},8,["legendSet","config"])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"legend",{legend:G.value},void 0,!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",Se,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(se._sfc_main,{show:v.value.showTooltip&&x.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,fontSize:t.value.style.chart.tooltip.fontSize,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:k.value,content:$.value,isCustom:e.unref(r.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...T.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...T.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isCustom"]),b.value?(e.openBlock(),e.createBlock(ce.default,{key:9,hideDetails:"",config:{open:v.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(ue.DataTable,{key:`table_${L.value}`,colNames:C.value.colNames,head:C.value.head,body:C.value.body,config:C.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:a[2]||(a[2]=o=>v.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,Pe)]),td:e.withCtx(({td:o})=>[e.createTextVNode(e.toDisplayString(o.name||o),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,he))}},Ee=pe._export_sfc(Ve,[["__scopeId","data-v-9e3163ed"]]);exports.default=Ee;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { computed as g, ref as c, watch as oe, onMounted as Fe, onBeforeUnmount as Se, openBlock as s, createElementBlock as u, normalizeClass as se, normalizeStyle as re, createBlock as N, createCommentVNode as f, withCtx as z, toDisplayString as C, unref as v, createSlots as ze, renderSlot as m, normalizeProps as E, guardReactiveProps as T, createVNode as Ce, createElementVNode as y, Fragment as j, renderList as D } from "vue";
|
|
2
|
-
import { u as $e, c as Me, t as Pe, a as Oe, p as ne, b as Ie, o as ue, d as Ne, e as X, g as ie, m as ce, X as Xe, s as U, H as A, i as Ae, f as Ye, E as ve } from "./index-
|
|
2
|
+
import { u as $e, c as Me, t as Pe, a as Oe, p as ne, b as Ie, o as ue, d as Ne, e as X, g as ie, m as ce, X as Xe, s as U, H as A, i as Ae, f as Ye, E as ve } from "./index-CvGoB7HV.js";
|
|
3
3
|
import { t as Ge, u as Re } from "./useResponsive-CoxXLe23.js";
|
|
4
|
-
import { u as Ee, U as Te } from "./usePrinter-
|
|
5
|
-
import je from "./vue-ui-skeleton-
|
|
6
|
-
import { _ as De } from "./Title-
|
|
7
|
-
import { u as de } from "./useNestedProp-
|
|
8
|
-
import { _ as Ue } from "./PackageVersion-
|
|
9
|
-
import { P as Be } from "./PenAndPaper-
|
|
4
|
+
import { u as Ee, U as Te } from "./usePrinter-B0E13IH3.js";
|
|
5
|
+
import je from "./vue-ui-skeleton-CL1iMZq4.js";
|
|
6
|
+
import { _ as De } from "./Title-kiBjyWrd.js";
|
|
7
|
+
import { u as de } from "./useNestedProp-CX0uXnyy.js";
|
|
8
|
+
import { _ as Ue } from "./PackageVersion-jcUUbnGR.js";
|
|
9
|
+
import { P as Be } from "./PenAndPaper-R8H8qKoM.js";
|
|
10
10
|
import { _ as Le } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
11
11
|
const We = ["id"], Ve = { key: 0 }, qe = ["xmlns", "viewBox"], He = ["id"], Ze = ["stop-color"], Je = ["stop-color"], Ke = ["stop-color"], Qe = ["id"], et = ["stdDeviation"], tt = ["d", "fill", "stroke"], at = ["d", "filter"], lt = ["x", "y", "text-anchor", "font-size", "font-weight", "fill"], ot = ["x", "y", "font-size", "font-weight", "fill"], st = { key: 1 }, rt = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], nt = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], ut = ["x1", "y1", "x2", "y2", "stroke-width", "filter"], it = { key: 2 }, ct = ["d", "fill", "stroke", "stroke-width"], vt = ["cx", "cy", "fill", "r", "stroke-width", "stroke"], dt = ["x", "y", "font-size", "fill"], ht = {
|
|
12
12
|
key: 5,
|