vue-data-ui 2.3.89 → 2.3.90
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-6DWnAEHt.js → Arrow-C_Fnn6al.js} +1 -1
- package/dist/{Arrow-CW5gDSmt.cjs → Arrow-D1pymKl6.cjs} +1 -1
- package/dist/{BaseIcon-Dj8EbAXm.js → BaseIcon-BMfi5PnL.js} +1 -1
- package/dist/{BaseIcon-B_MrASni.cjs → BaseIcon-CnFXP_n9.cjs} +1 -1
- package/dist/{DataTable-BmYcdJ1w.js → DataTable-Cmbf3abv.js} +2 -2
- package/dist/{DataTable-DAwK5x3h.cjs → DataTable-cOEA6Z37.cjs} +1 -1
- package/dist/{Legend-BRG8ddDy.js → Legend-CCq0mNRg.js} +1 -1
- package/dist/{Legend-DhQ-a1RH.cjs → Legend-XqP6-7Ac.cjs} +1 -1
- package/dist/{Shape-D7jva0XA.cjs → Shape-B51JGReT.cjs} +1 -1
- package/dist/{Shape-BcL3EDZ5.js → Shape-BNocET8E.js} +1 -1
- package/dist/{Slicer-DI1kgq9D.js → Slicer-BKszZXjM.js} +2 -2
- package/dist/{Slicer-DV29nclP.cjs → Slicer-Bc7OWCcl.cjs} +1 -1
- package/dist/{Title-DYwo_Q5b.cjs → Title-BaR4XyXa.cjs} +1 -1
- package/dist/{Title-fAvrqioZ.js → Title-DlBwa3-X.js} +1 -1
- package/dist/{Tooltip-03RvVGln.cjs → Tooltip-CX57w9Q9.cjs} +1 -1
- package/dist/{Tooltip-TZYYFvPe.js → Tooltip-w32n-8sY.js} +1 -1
- package/dist/{index-BKTciLz4.cjs → index-B8EMsnjU.cjs} +1 -1
- package/dist/{index-Ca4RHJ4t.js → index-DQl1TFXa.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{useNestedProp-BFnXnY0k.cjs → useNestedProp-DlCe_zZz.cjs} +1 -1
- package/dist/{useNestedProp-vP7uimPz.js → useNestedProp-lmeFt-ev.js} +1 -1
- package/dist/{usePrinter-CxYg-Dw-.cjs → usePrinter-BmXrEJ99.cjs} +1 -1
- package/dist/{usePrinter-5fwXghqP.js → usePrinter-DgKGVvJC.js} +1 -1
- package/dist/{vue-data-ui-4VG00HFR.js → vue-data-ui-Byrb_Y3k.js} +57 -57
- package/dist/{vue-data-ui-BaLkNH7M.cjs → vue-data-ui-DQurgvN8.cjs} +1 -1
- package/dist/vue-data-ui.cjs +1 -1
- package/dist/vue-data-ui.js +1 -1
- package/dist/{vue-ui-3d-bar-DPJWcxqV.js → vue-ui-3d-bar-CM_usP2U.js} +7 -7
- package/dist/{vue-ui-3d-bar-rOT9iPsm.cjs → vue-ui-3d-bar-Ce-Re50D.cjs} +1 -1
- package/dist/{vue-ui-accordion-vYoYjedX.js → vue-ui-accordion-CroZrm7T.js} +3 -3
- package/dist/{vue-ui-accordion-SXHdW20_.cjs → vue-ui-accordion-DRI-fN6I.cjs} +1 -1
- package/dist/{vue-ui-age-pyramid-BEC4SHLl.js → vue-ui-age-pyramid-BZU-WI_a.js} +8 -8
- package/dist/{vue-ui-age-pyramid-HElID9Ax.cjs → vue-ui-age-pyramid-C08rTXJn.cjs} +1 -1
- package/dist/{vue-ui-annotator-B1NZRuJJ.cjs → vue-ui-annotator-BpzM25VY.cjs} +1 -1
- package/dist/{vue-ui-annotator-DFpv61wn.js → vue-ui-annotator-CsfYgmrC.js} +1 -1
- package/dist/{vue-ui-candlestick-AEKT8X3p.js → vue-ui-candlestick-BPi7aBEf.js} +9 -9
- package/dist/{vue-ui-candlestick-p1s0Av21.cjs → vue-ui-candlestick-m8fjxbj-.cjs} +1 -1
- package/dist/{vue-ui-carousel-table-DCk2p-1k.cjs → vue-ui-carousel-table-CpodLcgX.cjs} +1 -1
- package/dist/{vue-ui-carousel-table-DhzVxOvp.js → vue-ui-carousel-table-tbviS8Fo.js} +4 -4
- package/dist/{vue-ui-chestnut-oFfB3fBF.cjs → vue-ui-chestnut-Y0gQvbbf.cjs} +1 -1
- package/dist/{vue-ui-chestnut-qqcIpMGB.js → vue-ui-chestnut-ql9yEs6j.js} +6 -6
- package/dist/{vue-ui-cursor-CvJgJk1M.cjs → vue-ui-cursor-B3w0SgJP.cjs} +1 -1
- package/dist/{vue-ui-cursor-CgSghVjL.js → vue-ui-cursor-Dw7_R_Pd.js} +2 -2
- package/dist/{vue-ui-dashboard-CYzkic0X.js → vue-ui-dashboard-DAY0cdat.js} +2 -2
- package/dist/{vue-ui-dashboard-CtJdVmtu.cjs → vue-ui-dashboard-enrB5B3P.cjs} +1 -1
- package/dist/{vue-ui-digits-C0dMG-hR.cjs → vue-ui-digits-3Q6uZCzD.cjs} +1 -1
- package/dist/{vue-ui-digits-BO1hSjoq.js → vue-ui-digits-DN6CRpXc.js} +2 -2
- package/dist/{vue-ui-donut-DP-yxiw3.js → vue-ui-donut-B3yDJvZI.js} +9 -9
- package/dist/{vue-ui-donut-Dnnoj71c.cjs → vue-ui-donut-CCm7GJsm.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-C-yDyglF.js → vue-ui-donut-evolution-CzBvVRKG.js} +9 -9
- package/dist/{vue-ui-donut-evolution-vBUH5VVx.cjs → vue-ui-donut-evolution-DiN8Jm0n.cjs} +1 -1
- package/dist/{vue-ui-dumbbell-BUA_uSse.cjs → vue-ui-dumbbell-lb72j7bY.cjs} +1 -1
- package/dist/{vue-ui-dumbbell-D2SQ4cKV.js → vue-ui-dumbbell-vQ5YRGwJ.js} +8 -8
- package/dist/{vue-ui-flow-B-AFlw-n.cjs → vue-ui-flow-B5Gxaqvl.cjs} +1 -1
- package/dist/{vue-ui-flow-D_E9V2A1.js → vue-ui-flow-DAOKURA6.js} +7 -7
- package/dist/{vue-ui-galaxy-DqE2UiA3.js → vue-ui-galaxy-B86BK1JM.js} +9 -9
- package/dist/{vue-ui-galaxy-CbL5nONj.cjs → vue-ui-galaxy-Ck5cPkrh.cjs} +1 -1
- package/dist/{vue-ui-gauge-BUV_hQND.cjs → vue-ui-gauge-BwIhwSUw.cjs} +1 -1
- package/dist/{vue-ui-gauge-CFYXDw2p.js → vue-ui-gauge-n8TilFo9.js} +5 -5
- package/dist/{vue-ui-gizmo-BWztIJ3j.js → vue-ui-gizmo-CFIBlG4V.js} +2 -2
- package/dist/{vue-ui-gizmo-B-LxuvDh.cjs → vue-ui-gizmo-DrGaoiM_.cjs} +1 -1
- package/dist/{vue-ui-heatmap-DW5StHKM.cjs → vue-ui-heatmap-BLc6thGZ.cjs} +1 -1
- package/dist/{vue-ui-heatmap-E1MlhSCs.js → vue-ui-heatmap-ZkmD9EAg.js} +8 -8
- package/dist/{vue-ui-kpi-DeP0XmP7.js → vue-ui-kpi-CtJ3t6GX.js} +3 -3
- package/dist/{vue-ui-kpi-BWDPF-9X.cjs → vue-ui-kpi-D6Myg0y1.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-D5e8uW_d.cjs → vue-ui-mini-loader-BjJ_YYZj.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-Bal12IrX.js → vue-ui-mini-loader-Cosy9XjR.js} +2 -2
- package/dist/{vue-ui-molecule-DHBId4h4.cjs → vue-ui-molecule-CAj1HFit.cjs} +1 -1
- package/dist/{vue-ui-molecule-DHrHeQgF.js → vue-ui-molecule-DTFOBjgC.js} +9 -9
- package/dist/{vue-ui-mood-radar-DSXB9l99.cjs → vue-ui-mood-radar-CV2in2wO.cjs} +1 -1
- package/dist/{vue-ui-mood-radar-dJaJotNf.js → vue-ui-mood-radar-J_dI9m_i.js} +9 -9
- package/dist/{vue-ui-nested-donuts-CEX2cvop.cjs → vue-ui-nested-donuts-4vO23n9z.cjs} +1 -1
- package/dist/{vue-ui-nested-donuts--K9ygdH3.js → vue-ui-nested-donuts-CtqU4xxu.js} +9 -9
- package/dist/{vue-ui-onion-Iekdjs8b.cjs → vue-ui-onion-B3mtn6xf.cjs} +1 -1
- package/dist/{vue-ui-onion-Bm1inM56.js → vue-ui-onion-BMo0Ye54.js} +9 -9
- package/dist/{vue-ui-parallel-coordinate-plot-OlFoYL_3.cjs → vue-ui-parallel-coordinate-plot-DFMbhLY9.cjs} +1 -1
- package/dist/{vue-ui-parallel-coordinate-plot-9PSGD-LR.js → vue-ui-parallel-coordinate-plot-yKLZbDS5.js} +10 -10
- package/dist/{vue-ui-quadrant-iGQbx93I.js → vue-ui-quadrant-BrRasVaj.js} +10 -10
- package/dist/{vue-ui-quadrant-CgJeo2zZ.cjs → vue-ui-quadrant-CpJX1Jwa.cjs} +1 -1
- package/dist/{vue-ui-quick-chart-Du8lDPmh.cjs → vue-ui-quick-chart-CTxsI2tk.cjs} +1 -1
- package/dist/{vue-ui-quick-chart-DeEQcx6A.js → vue-ui-quick-chart-uH33UIjX.js} +7 -7
- package/dist/{vue-ui-radar-DfnhsNQV.js → vue-ui-radar-BJ3qMHP4.js} +10 -10
- package/dist/{vue-ui-radar-BYk9DWnM.cjs → vue-ui-radar-DFjsXmJ3.cjs} +1 -1
- package/dist/{vue-ui-rating-D0rgVdkT.cjs → vue-ui-rating-BEWaQMBR.cjs} +1 -1
- package/dist/{vue-ui-rating-CCesFD6e.js → vue-ui-rating-BFskhiyh.js} +2 -2
- package/dist/{vue-ui-relation-circle-8eoBav4O.cjs → vue-ui-relation-circle-DXuKdCih.cjs} +1 -1
- package/dist/{vue-ui-relation-circle-D2GXm_Fk.js → vue-ui-relation-circle-DdK4qk0P.js} +5 -5
- package/dist/{vue-ui-rings-B7_-G3JM.js → vue-ui-rings-BqHSq6Wt.js} +9 -9
- package/dist/{vue-ui-rings-CScmcQ1n.cjs → vue-ui-rings-D_T_D6AS.cjs} +1 -1
- package/dist/{vue-ui-scatter-DdhiNjLc.js → vue-ui-scatter-C0gfF6NJ.js} +10 -10
- package/dist/{vue-ui-scatter-BnBI8qdt.cjs → vue-ui-scatter-DPByFMNL.cjs} +1 -1
- package/dist/{vue-ui-screenshot-Cpy2qbf1.js → vue-ui-screenshot-6tOLntj9.js} +1 -1
- package/dist/{vue-ui-screenshot-BrhjnTwn.cjs → vue-ui-screenshot-CbvIYfYU.cjs} +1 -1
- package/dist/{vue-ui-skeleton-D7aLznpP.js → vue-ui-skeleton-BVJGmYjj.js} +2 -2
- package/dist/{vue-ui-skeleton-pDeQ3NcD.cjs → vue-ui-skeleton-Bli7jLZ7.cjs} +1 -1
- package/dist/{vue-ui-smiley-vcpYARLj.js → vue-ui-smiley-2EoxEmXW.js} +2 -2
- package/dist/{vue-ui-smiley-Cj0yi7_H.cjs → vue-ui-smiley-CUgH2tnV.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-CFJSCQnf.js → vue-ui-spark-trend-DjNPMOkN.js} +4 -4
- package/dist/{vue-ui-spark-trend-BW8k0jDd.cjs → vue-ui-spark-trend-sfgUJ32Q.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-CgRdDfk6.js → vue-ui-sparkbar-BBm3DE1P.js} +3 -3
- package/dist/{vue-ui-sparkbar-BbJHfAQj.cjs → vue-ui-sparkbar-CKWYzriN.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-BESRB8_4.cjs → vue-ui-sparkgauge-D0q9F9Nz.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-CCPMNge0.js → vue-ui-sparkgauge-IIW24eJQ.js} +3 -3
- package/dist/{vue-ui-sparkhistogram-BYnSfLdb.cjs → vue-ui-sparkhistogram-CywhBkm2.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram-D5z2Wtpk.js → vue-ui-sparkhistogram-DVXxA6ji.js} +4 -4
- package/dist/{vue-ui-sparkline-D5WUy4p5.cjs → vue-ui-sparkline-Besp8Ffy.cjs} +1 -1
- package/dist/{vue-ui-sparkline-KYN0oKt1.js → vue-ui-sparkline-CH89kcaa.js} +3 -3
- package/dist/{vue-ui-sparkstackbar-7lurD9-4.js → vue-ui-sparkstackbar-Bcod5yu_.js} +83 -70
- package/dist/vue-ui-sparkstackbar-qXm8Ozzm.cjs +1 -0
- package/dist/{vue-ui-stackbar-Ch-fmE9l.cjs → vue-ui-stackbar-D0fGVkCR.cjs} +1 -1
- package/dist/{vue-ui-stackbar-CsVmAvl3.js → vue-ui-stackbar-Djjcgtyg.js} +10 -10
- package/dist/{vue-ui-strip-plot-B63AgKts.js → vue-ui-strip-plot-ByPCQ4xk.js} +9 -9
- package/dist/{vue-ui-strip-plot-BLRl-tF6.cjs → vue-ui-strip-plot-XDj8rL9m.cjs} +1 -1
- package/dist/{vue-ui-table-hPqdMR-m.cjs → vue-ui-table-B6Kpda3o.cjs} +1 -1
- package/dist/{vue-ui-table-G5O8K-F_.js → vue-ui-table-D8Sm2fzX.js} +1 -1
- package/dist/{vue-ui-table-heatmap-BhVuTdSS.cjs → vue-ui-table-heatmap-DjEN0l12.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-t9Ngijvp.js → vue-ui-table-heatmap-mlq_J56h.js} +4 -4
- package/dist/{vue-ui-table-sparkline-DtjJrGve.cjs → vue-ui-table-sparkline-DByva7rj.cjs} +1 -1
- package/dist/{vue-ui-table-sparkline-BX4en1c-.js → vue-ui-table-sparkline-DF29_qZk.js} +5 -5
- package/dist/{vue-ui-thermometer-BWGyDQ7_.js → vue-ui-thermometer-BKf-rGuS.js} +5 -5
- package/dist/{vue-ui-thermometer-B07RI9fZ.cjs → vue-ui-thermometer-C3T56ras.cjs} +1 -1
- package/dist/{vue-ui-timer-8AlVLAJi.js → vue-ui-timer-B8jW8M60.js} +4 -4
- package/dist/{vue-ui-timer-CXrENAVg.cjs → vue-ui-timer-B_ZvV1ON.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-C43c4_IR.cjs → vue-ui-tiremarks-DRbSpTgq.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-DYIHGkBU.js → vue-ui-tiremarks-riEfve5q.js} +5 -5
- package/dist/{vue-ui-treemap-mmvdTHiX.js → vue-ui-treemap-5F0ynBnb.js} +9 -9
- package/dist/{vue-ui-treemap-BN90ISQv.cjs → vue-ui-treemap-CtKUTs2G.cjs} +1 -1
- package/dist/{vue-ui-vertical-bar-BRDO_Rsu.cjs → vue-ui-vertical-bar-BBIWdeXH.cjs} +1 -1
- package/dist/{vue-ui-vertical-bar-DAKHNRoR.js → vue-ui-vertical-bar-CxRBvHZy.js} +9 -9
- package/dist/{vue-ui-waffle-BN_yZEtJ.cjs → vue-ui-waffle-9a3C4Nj-.cjs} +1 -1
- package/dist/{vue-ui-waffle-B-A4NYNd.js → vue-ui-waffle-B8G4i5WH.js} +9 -9
- package/dist/{vue-ui-wheel-50_zeiIW.cjs → vue-ui-wheel-CErxlmqw.cjs} +1 -1
- package/dist/{vue-ui-wheel-DN9WvA6Z.js → vue-ui-wheel-DmzkGeCY.js} +5 -5
- package/dist/{vue-ui-word-cloud-BWTyaGAT.js → vue-ui-word-cloud-dMBTVGVk.js} +7 -7
- package/dist/{vue-ui-word-cloud-BVoFIb_q.cjs → vue-ui-word-cloud-nmx846H2.cjs} +1 -1
- package/dist/{vue-ui-xy-CJHHesUD.cjs → vue-ui-xy-CLYgZk3Y.cjs} +1 -1
- package/dist/{vue-ui-xy-canvas-CAcTkk_r.cjs → vue-ui-xy-canvas-CCwtKYgd.cjs} +1 -1
- package/dist/{vue-ui-xy-canvas-9NPbm7dE.js → vue-ui-xy-canvas-nraUv13Y.js} +10 -10
- package/dist/{vue-ui-xy-Dzp4qCjk.js → vue-ui-xy-iUQyB_PL.js} +12 -12
- package/package.json +1 -1
- package/dist/vue-ui-sparkstackbar-Dy-IfQ3q.cjs +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { computed as p, ref as y, watch as oe, onMounted as re, onBeforeUnmount as Le, openBlock as o, createElementBlock as r, normalizeClass as ne, normalizeStyle as E, createBlock as S, createCommentVNode as g, unref as d, createSlots as ze, withCtx as _, renderSlot as C, normalizeProps as ue, guardReactiveProps as ie, Fragment as w, renderList as $, createElementVNode as n, toDisplayString as L, createTextVNode as ce, nextTick as Xe } from "vue";
|
|
2
|
-
import { u as Se, c as de, t as Ae, o as Ne, e as ve, g as Te, v as he, C as Pe, f as z, X as ye, i as V, l as be, h as fe, q as Ge, r as De } from "./index-
|
|
2
|
+
import { u as Se, c as de, t as Ae, o as Ne, e as ve, g as Te, v as he, C as Pe, f as z, X as ye, i as V, l as be, h as fe, q as Ge, r as De } from "./index-DQl1TFXa.js";
|
|
3
3
|
import { t as Ie, u as Me } from "./useResponsive-NZB-WLRF.js";
|
|
4
|
-
import { _ as Fe } from "./Title-
|
|
5
|
-
import { u as Oe, U as Ee } from "./usePrinter-
|
|
6
|
-
import { D as Ve } from "./DataTable-
|
|
7
|
-
import He from "./vue-ui-skeleton-
|
|
8
|
-
import { L as We } from "./Legend-
|
|
9
|
-
import Re from "./vue-ui-accordion-
|
|
10
|
-
import { u as ge } from "./useNestedProp-
|
|
4
|
+
import { _ as Fe } from "./Title-DlBwa3-X.js";
|
|
5
|
+
import { u as Oe, U as Ee } from "./usePrinter-DgKGVvJC.js";
|
|
6
|
+
import { D as Ve } from "./DataTable-Cmbf3abv.js";
|
|
7
|
+
import He from "./vue-ui-skeleton-BVJGmYjj.js";
|
|
8
|
+
import { L as We } from "./Legend-CCq0mNRg.js";
|
|
9
|
+
import Re from "./vue-ui-accordion-CroZrm7T.js";
|
|
10
|
+
import { u as ge } from "./useNestedProp-lmeFt-ev.js";
|
|
11
11
|
import { _ as Be } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
12
12
|
const Ue = ["id"], je = ["xmlns", "viewBox"], qe = { key: 0 }, Ye = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], Ze = { key: 1 }, Je = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], Ke = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], Qe = { key: 2 }, et = ["x", "y", "font-size", "fill", "font-weight"], tt = ["x", "y", "font-size", "fill"], lt = { key: 3 }, at = ["x", "y", "font-size", "fill", "font-weight"], st = ["id"], ot = ["stop-color"], rt = ["stop-color"], nt = ["stop-color"], ut = ["id"], it = ["stop-color"], ct = ["stop-color"], dt = ["stop-color"], vt = ["id"], ht = ["stop-color"], yt = ["stop-color"], bt = ["id"], ft = ["stop-color"], gt = ["stop-color"], mt = { key: 0 }, pt = ["d", "fill"], _t = { key: 1 }, xt = ["x", "y", "height", "width", "fill"], kt = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], Ct = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], wt = { key: 2 }, $t = ["x", "y", "fill", "font-size"], Lt = { key: 3 }, zt = ["x", "y", "fill", "font-size"], Xt = {
|
|
13
13
|
key: 3,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-BKTciLz4.cjs"),he=require("./Title-DYwo_Q5b.cjs"),Z=require("./usePrinter-CxYg-Dw-.cjs"),fe=require("./DataTable-DAwK5x3h.cjs"),ve=require("./vue-ui-accordion-SXHdW20_.cjs"),me=require("./vue-ui-skeleton-pDeQ3NcD.cjs"),J=require("./useNestedProp-BFnXnY0k.cjs"),pe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ge=["id"],ke={key:0,style:"width:100%;background:transparent;padding-bottom:24px"},ye=["xmlns","viewBox"],be=["id"],we=["stop-color"],Ce=["stop-color"],Ne=["d","fill","stroke","stroke-width"],xe=["x","y","height","width","fill","stroke","stroke-width","onMouseenter"],$e=["x","y","font-size","fill"],Be=["x","y","font-size","fill"],_e={key:2,class:"vue-data-ui-watermark"},Ee=["innerHTML"],Se={__name:"vue-ui-flow",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(K,{expose:Q}){const f=K,{vue_ui_flow:ee}=s.useConfig(),x=e.computed(()=>!!f.dataset&&f.dataset.length);e.onMounted(()=>{P()});function P(){s.objectIsEmpty(f.dataset)&&s.error({componentName:"VueUiFlow",type:"dataset"})}const $=e.ref(s.createUid()),F=e.ref(null),L=e.ref(0),z=e.ref(0),y=e.ref(!1);function te(l){y.value=l,L.value+=1}const t=e.computed({get:()=>I(),set:l=>l});function I(){const l=J.useNestedProp({userConfig:f.config,defaultConfig:ee});return l.theme?{...J.useNestedProp({userConfig:s.themes.vue_ui_flow[l.theme]||f.config,defaultConfig:l}),customPalette:s.themePalettes[l.theme]||s.palette}:l}e.watch(()=>f.config,l=>{t.value=I(),P(),z.value+=1},{deep:!0});const{isPrinting:H,isImaging:O,generatePdf:M,generateImage:V}=Z.usePrinter({elementId:`flow_${$.value}`,fileName:t.value.style.chart.title.text||"vue-ui-flow"}),B=e.computed(()=>s.convertCustomPalette(t.value.customPalette)),D=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.computed(()=>!f.dataset||!f.dataset.length?[]:f.dataset.map(l=>[l[0],l[1],s.checkNaN(l[2])])),q=e.computed(()=>{const l={};function n(r){l[r]||(l[r]={inflow:0,outflow:0})}_.value.forEach(([r,a,c])=>{n(r),n(a),l[r].outflow+=c,l[a].inflow+=c});let o=0;for(const r in l){const a=Math.max(l[r].inflow,l[r].outflow);o=Math.max(o,a)}return o});function le(l){return l/q.value*100+t.value.style.chart.nodes.minHeight}function oe(l){const n=t.value.style.chart.nodes.minHeight;return(l-n)/100*q.value}function ne(l){const n={},o={};function r(u,i){n[u]||(n[u]={height:0,level:null,inflow:0,outflow:0}),n[u].level===null&&(n[u].level=i),o[i]||(o[i]=[]),o[i].includes(u)||o[i].push(u)}l.forEach(([u,i,h],k)=>{const p=n[u]?n[u].level:0,N=p+1;r(u,p),r(i,N),n[u].children||(n[u].children=[]),n[u].children.push({target:i,value:h}),n[u].outflow+=h,n[i].inflow+=h}),Object.keys(n).forEach((u,i)=>{n[u].color=B.value[i]||B.value[i%B.value.length]||s.palette[i]||s.palette[i%d.length]});for(const u in n)n[u].height=le(Math.max(n[u].inflow,n[u].outflow)),n[u].name=u;const a={};for(const u in o){let i=0;o[u].forEach((h,k)=>{const p=n[h].height;a[h]={x:parseInt(u,10)*Y.value+t.value.style.chart.padding.left,y:i,absoluteY:i,height:p,i:k,color:n[h].color,value:oe(p)},i+=p+D.value})}const c=[];for(const u in n){let i=a[u].absoluteY;n[u].children&&n[u].children.forEach(({target:h,value:k},p)=>{const N=a[h].y,S=a[u],T=a[h],A=s.checkNaN(i),W=s.checkNaN(i+k/n[u].outflow*S.height),X=s.checkNaN(N),R=s.checkNaN(N+k/n[h].inflow*T.height),de={id:s.createUid(),source:u,target:h,path:`M ${s.checkNaN(S.x)+s.checkNaN(g.value)} ${A} L ${s.checkNaN(S.x)+s.checkNaN(g.value)} ${W} L ${s.checkNaN(T.x)} ${R} L ${s.checkNaN(T.x)} ${X} Z`,value:k,sourceColor:n[u].color,targetColor:n[h].color};c.push(de),i+=W-A,a[h].y+=R-X})}return{nodeCoordinates:a,links:c}}const v=e.computed(()=>{const l=ne(f.dataset);return{nodes:Object.keys(l.nodeCoordinates).map((n,o)=>({...l.nodeCoordinates[n],name:n})),links:l.links}}),ae=e.computed(()=>se(v.value.nodes));function se(l){const n={};for(const r in l){const{x:a,height:c}=l[r];n[a]||(n[a]=0),n[a]+=c+D.value}return Math.max(...Object.values(n))}const E=e.computed(()=>{const{top:l,right:n,left:o,bottom:r}=t.value.style.chart.padding,a=_.value.length*Y.value;return{height:ae.value+l+r,width:n+Math.max(...v.value.nodes.map(c=>c.x))+g.value,left:o,top:l,right:a-n,p_top:l,p_bottom:r}});function re(l){const n={},o={},r=new Set;return _.value.forEach(([a,c,u])=>{n[a]||(n[a]=[]),o[c]||(o[c]=[]),n[a].push(c),o[c].push(a)}),n[l]&&n[l].forEach(a=>r.add(a)),o[l]&&o[l].forEach(a=>r.add(a)),Array.from(r).concat(l)}const m=e.ref(null),w=e.ref(null);function ue(l){m.value=re(l.name),w.value=l.name}function ie(){m.value=null,w.value=null}const G=e.computed(()=>v.value.links.map(({source:l,target:n,sourceColor:o,targetColor:r,value:a})=>({source:l,target:n,sourceColor:o,targetColor:r,value:a})));function U(){e.nextTick(()=>{const l=G.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(l),o=s.createCsvContent(n);s.downloadCsv({csvContent:o,title:t.value.style.chart.title.text||"vue-ui-flow"})})}const C=e.computed(()=>{const l=[t.value.table.columnNames.source,t.value.table.columnNames.target,t.value.table.columnNames.value],n=G.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})]),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.source,t.value.table.columnNames.target,t.value.table.columnNames.value],head:l,body:n,config:o}});function ce(){return v.value}function j(){b.value.showTable=!b.value.showTable}return Q({getData:ce,generateCsv:U,generateImage:V,generatePdf:M,toggleTable:j}),(l,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"flowChart",ref:F,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;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor}`),id:`flow_${$.value}`},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",ke,[(e.openBlock(),e.createBlock(he._sfc_main,{key:`title_${z.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&&x.value?(e.openBlock(),e.createBlock(Z.UserOptions,{ref:"details",key:`user_option_${L.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(H),isImaging:e.unref(O),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:F.value,position:t.value.userOptions.position,onToggleFullscreen:te,onGeneratePdf:e.unref(M),onGenerateCsv:U,onGenerateImage:e.unref(V),onToggleTable: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:o,isFullscreen:r})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:r})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","titles","chartElement","position","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(s.XMLNS),viewBox:`0 0 ${E.value.width} ${E.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.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value.links,(o,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{id:o.id,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":o.sourceColor},null,8,we),e.createElementVNode("stop",{offset:"100%","stop-color":o.targetColor},null,8,Ce)],8,be))),256))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value.links,o=>(e.openBlock(),e.createElementBlock("path",{class:"vue-ui-flow-link",d:o.path,fill:`url(#${o.id})`,stroke:t.value.style.chart.links.stroke,"stroke-width":t.value.style.chart.links.strokeWidth,style:e.normalizeStyle(`opacity:${w.value?[o.target,o.source].includes(w.value)?1:.3:t.value.style.chart.links.opacity}`)},null,12,Ne))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value.nodes,(o,r)=>(e.openBlock(),e.createElementBlock("rect",{class:"vue-ui-flow-node",x:o.x,y:e.unref(s.checkNaN)(o.absoluteY),height:e.unref(s.checkNaN)(o.height),width:g.value,fill:o.color,stroke:t.value.style.chart.nodes.stroke,"stroke-width":t.value.style.chart.nodes.strokeWidth,onMouseenter:a=>ue(o),onMouseleave:n[0]||(n[0]=a=>ie()),style:e.normalizeStyle(`opacity:${m.value?m.value.includes(o.name)?1:.2:1}`)},null,44,xe))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value.nodes,(o,r)=>(e.openBlock(),e.createElementBlock("text",{x:o.x+g.value/2,y:e.unref(s.checkNaN)(o.absoluteY+o.height/2-t.value.style.chart.nodes.labels.fontSize/4),"font-size":t.value.style.chart.nodes.labels.fontSize,fill:e.unref(s.adaptColorToBackground)(o.color),"text-anchor":"middle",style:e.normalizeStyle(`pointer-events: none; opacity:${m.value?m.value.includes(o.name)?1:0:1}`)},e.toDisplayString(t.value.style.chart.nodes.labels.abbreviation.use?e.unref(s.abbreviate)({source:o.name,length:t.value.style.chart.nodes.labels.abbreviation.length}):o.name),13,$e))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value.nodes,(o,r)=>(e.openBlock(),e.createElementBlock("text",{x:o.x+g.value/2,y:e.unref(s.checkNaN)(o.absoluteY+o.height/2+t.value.style.chart.nodes.labels.fontSize),"font-size":t.value.style.chart.nodes.labels.fontSize,fill:e.unref(s.adaptColorToBackground)(o.color),"text-anchor":"middle",style:e.normalizeStyle(`pointer-events: none; opacity:${m.value?m.value.includes(o.name)?1:0:1}`)},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.chart.nodes.labels.formatter,o.value,e.unref(s.dataLabel)({p:t.value.style.chart.nodes.labels.prefix,v:o.value,s:t.value.style.chart.nodes.labels.suffix,r:t.value.style.chart.nodes.labels.rounding}),{datapoint:o,seriesIndex:r})),13,Be))),256)),e.renderSlot(l.$slots,"svg",{svg:E.value},void 0,!0)],14,ye)),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",_e,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(H)||e.unref(O)})),void 0,!0)])):e.createCommentVNode("",!0),x.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(me.default,{key:3,config:{type:"flow",style:{backgroundColor:t.value.style.chart.backgroundColor}}},null,8,["config"])),x.value?(e.openBlock(),e.createBlock(ve.default,{key:4,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(fe.DataTable,{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:n[1]||(n[1]=o=>b.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,Ee)]),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,ge))}},Te=pe._export_sfc(Se,[["__scopeId","data-v-51f26d4b"]]);exports.default=Te;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-B8EMsnjU.cjs"),he=require("./Title-BaR4XyXa.cjs"),Z=require("./usePrinter-BmXrEJ99.cjs"),fe=require("./DataTable-cOEA6Z37.cjs"),ve=require("./vue-ui-accordion-DRI-fN6I.cjs"),me=require("./vue-ui-skeleton-Bli7jLZ7.cjs"),J=require("./useNestedProp-DlCe_zZz.cjs"),pe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ge=["id"],ke={key:0,style:"width:100%;background:transparent;padding-bottom:24px"},ye=["xmlns","viewBox"],be=["id"],we=["stop-color"],Ce=["stop-color"],Ne=["d","fill","stroke","stroke-width"],xe=["x","y","height","width","fill","stroke","stroke-width","onMouseenter"],$e=["x","y","font-size","fill"],Be=["x","y","font-size","fill"],_e={key:2,class:"vue-data-ui-watermark"},Ee=["innerHTML"],Se={__name:"vue-ui-flow",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(K,{expose:Q}){const f=K,{vue_ui_flow:ee}=s.useConfig(),x=e.computed(()=>!!f.dataset&&f.dataset.length);e.onMounted(()=>{P()});function P(){s.objectIsEmpty(f.dataset)&&s.error({componentName:"VueUiFlow",type:"dataset"})}const $=e.ref(s.createUid()),F=e.ref(null),L=e.ref(0),z=e.ref(0),y=e.ref(!1);function te(l){y.value=l,L.value+=1}const t=e.computed({get:()=>I(),set:l=>l});function I(){const l=J.useNestedProp({userConfig:f.config,defaultConfig:ee});return l.theme?{...J.useNestedProp({userConfig:s.themes.vue_ui_flow[l.theme]||f.config,defaultConfig:l}),customPalette:s.themePalettes[l.theme]||s.palette}:l}e.watch(()=>f.config,l=>{t.value=I(),P(),z.value+=1},{deep:!0});const{isPrinting:H,isImaging:O,generatePdf:M,generateImage:V}=Z.usePrinter({elementId:`flow_${$.value}`,fileName:t.value.style.chart.title.text||"vue-ui-flow"}),B=e.computed(()=>s.convertCustomPalette(t.value.customPalette)),D=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.computed(()=>!f.dataset||!f.dataset.length?[]:f.dataset.map(l=>[l[0],l[1],s.checkNaN(l[2])])),q=e.computed(()=>{const l={};function n(r){l[r]||(l[r]={inflow:0,outflow:0})}_.value.forEach(([r,a,c])=>{n(r),n(a),l[r].outflow+=c,l[a].inflow+=c});let o=0;for(const r in l){const a=Math.max(l[r].inflow,l[r].outflow);o=Math.max(o,a)}return o});function le(l){return l/q.value*100+t.value.style.chart.nodes.minHeight}function oe(l){const n=t.value.style.chart.nodes.minHeight;return(l-n)/100*q.value}function ne(l){const n={},o={};function r(u,i){n[u]||(n[u]={height:0,level:null,inflow:0,outflow:0}),n[u].level===null&&(n[u].level=i),o[i]||(o[i]=[]),o[i].includes(u)||o[i].push(u)}l.forEach(([u,i,h],k)=>{const p=n[u]?n[u].level:0,N=p+1;r(u,p),r(i,N),n[u].children||(n[u].children=[]),n[u].children.push({target:i,value:h}),n[u].outflow+=h,n[i].inflow+=h}),Object.keys(n).forEach((u,i)=>{n[u].color=B.value[i]||B.value[i%B.value.length]||s.palette[i]||s.palette[i%d.length]});for(const u in n)n[u].height=le(Math.max(n[u].inflow,n[u].outflow)),n[u].name=u;const a={};for(const u in o){let i=0;o[u].forEach((h,k)=>{const p=n[h].height;a[h]={x:parseInt(u,10)*Y.value+t.value.style.chart.padding.left,y:i,absoluteY:i,height:p,i:k,color:n[h].color,value:oe(p)},i+=p+D.value})}const c=[];for(const u in n){let i=a[u].absoluteY;n[u].children&&n[u].children.forEach(({target:h,value:k},p)=>{const N=a[h].y,S=a[u],T=a[h],A=s.checkNaN(i),W=s.checkNaN(i+k/n[u].outflow*S.height),X=s.checkNaN(N),R=s.checkNaN(N+k/n[h].inflow*T.height),de={id:s.createUid(),source:u,target:h,path:`M ${s.checkNaN(S.x)+s.checkNaN(g.value)} ${A} L ${s.checkNaN(S.x)+s.checkNaN(g.value)} ${W} L ${s.checkNaN(T.x)} ${R} L ${s.checkNaN(T.x)} ${X} Z`,value:k,sourceColor:n[u].color,targetColor:n[h].color};c.push(de),i+=W-A,a[h].y+=R-X})}return{nodeCoordinates:a,links:c}}const v=e.computed(()=>{const l=ne(f.dataset);return{nodes:Object.keys(l.nodeCoordinates).map((n,o)=>({...l.nodeCoordinates[n],name:n})),links:l.links}}),ae=e.computed(()=>se(v.value.nodes));function se(l){const n={};for(const r in l){const{x:a,height:c}=l[r];n[a]||(n[a]=0),n[a]+=c+D.value}return Math.max(...Object.values(n))}const E=e.computed(()=>{const{top:l,right:n,left:o,bottom:r}=t.value.style.chart.padding,a=_.value.length*Y.value;return{height:ae.value+l+r,width:n+Math.max(...v.value.nodes.map(c=>c.x))+g.value,left:o,top:l,right:a-n,p_top:l,p_bottom:r}});function re(l){const n={},o={},r=new Set;return _.value.forEach(([a,c,u])=>{n[a]||(n[a]=[]),o[c]||(o[c]=[]),n[a].push(c),o[c].push(a)}),n[l]&&n[l].forEach(a=>r.add(a)),o[l]&&o[l].forEach(a=>r.add(a)),Array.from(r).concat(l)}const m=e.ref(null),w=e.ref(null);function ue(l){m.value=re(l.name),w.value=l.name}function ie(){m.value=null,w.value=null}const G=e.computed(()=>v.value.links.map(({source:l,target:n,sourceColor:o,targetColor:r,value:a})=>({source:l,target:n,sourceColor:o,targetColor:r,value:a})));function U(){e.nextTick(()=>{const l=G.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(l),o=s.createCsvContent(n);s.downloadCsv({csvContent:o,title:t.value.style.chart.title.text||"vue-ui-flow"})})}const C=e.computed(()=>{const l=[t.value.table.columnNames.source,t.value.table.columnNames.target,t.value.table.columnNames.value],n=G.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})]),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.source,t.value.table.columnNames.target,t.value.table.columnNames.value],head:l,body:n,config:o}});function ce(){return v.value}function j(){b.value.showTable=!b.value.showTable}return Q({getData:ce,generateCsv:U,generateImage:V,generatePdf:M,toggleTable:j}),(l,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"flowChart",ref:F,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;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor}`),id:`flow_${$.value}`},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",ke,[(e.openBlock(),e.createBlock(he._sfc_main,{key:`title_${z.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&&x.value?(e.openBlock(),e.createBlock(Z.UserOptions,{ref:"details",key:`user_option_${L.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(H),isImaging:e.unref(O),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:F.value,position:t.value.userOptions.position,onToggleFullscreen:te,onGeneratePdf:e.unref(M),onGenerateCsv:U,onGenerateImage:e.unref(V),onToggleTable: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:o,isFullscreen:r})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:r})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","titles","chartElement","position","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(s.XMLNS),viewBox:`0 0 ${E.value.width} ${E.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.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value.links,(o,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{id:o.id,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":o.sourceColor},null,8,we),e.createElementVNode("stop",{offset:"100%","stop-color":o.targetColor},null,8,Ce)],8,be))),256))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value.links,o=>(e.openBlock(),e.createElementBlock("path",{class:"vue-ui-flow-link",d:o.path,fill:`url(#${o.id})`,stroke:t.value.style.chart.links.stroke,"stroke-width":t.value.style.chart.links.strokeWidth,style:e.normalizeStyle(`opacity:${w.value?[o.target,o.source].includes(w.value)?1:.3:t.value.style.chart.links.opacity}`)},null,12,Ne))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value.nodes,(o,r)=>(e.openBlock(),e.createElementBlock("rect",{class:"vue-ui-flow-node",x:o.x,y:e.unref(s.checkNaN)(o.absoluteY),height:e.unref(s.checkNaN)(o.height),width:g.value,fill:o.color,stroke:t.value.style.chart.nodes.stroke,"stroke-width":t.value.style.chart.nodes.strokeWidth,onMouseenter:a=>ue(o),onMouseleave:n[0]||(n[0]=a=>ie()),style:e.normalizeStyle(`opacity:${m.value?m.value.includes(o.name)?1:.2:1}`)},null,44,xe))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value.nodes,(o,r)=>(e.openBlock(),e.createElementBlock("text",{x:o.x+g.value/2,y:e.unref(s.checkNaN)(o.absoluteY+o.height/2-t.value.style.chart.nodes.labels.fontSize/4),"font-size":t.value.style.chart.nodes.labels.fontSize,fill:e.unref(s.adaptColorToBackground)(o.color),"text-anchor":"middle",style:e.normalizeStyle(`pointer-events: none; opacity:${m.value?m.value.includes(o.name)?1:0:1}`)},e.toDisplayString(t.value.style.chart.nodes.labels.abbreviation.use?e.unref(s.abbreviate)({source:o.name,length:t.value.style.chart.nodes.labels.abbreviation.length}):o.name),13,$e))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value.nodes,(o,r)=>(e.openBlock(),e.createElementBlock("text",{x:o.x+g.value/2,y:e.unref(s.checkNaN)(o.absoluteY+o.height/2+t.value.style.chart.nodes.labels.fontSize),"font-size":t.value.style.chart.nodes.labels.fontSize,fill:e.unref(s.adaptColorToBackground)(o.color),"text-anchor":"middle",style:e.normalizeStyle(`pointer-events: none; opacity:${m.value?m.value.includes(o.name)?1:0:1}`)},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.chart.nodes.labels.formatter,o.value,e.unref(s.dataLabel)({p:t.value.style.chart.nodes.labels.prefix,v:o.value,s:t.value.style.chart.nodes.labels.suffix,r:t.value.style.chart.nodes.labels.rounding}),{datapoint:o,seriesIndex:r})),13,Be))),256)),e.renderSlot(l.$slots,"svg",{svg:E.value},void 0,!0)],14,ye)),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",_e,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(H)||e.unref(O)})),void 0,!0)])):e.createCommentVNode("",!0),x.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(me.default,{key:3,config:{type:"flow",style:{backgroundColor:t.value.style.chart.backgroundColor}}},null,8,["config"])),x.value?(e.openBlock(),e.createBlock(ve.default,{key:4,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(fe.DataTable,{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:n[1]||(n[1]=o=>b.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,Ee)]),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,ge))}},Te=pe._export_sfc(Se,[["__scopeId","data-v-51f26d4b"]]);exports.default=Te;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { computed as m, onMounted as Le, ref as y, watch as He, openBlock as r, createElementBlock as h, normalizeClass as ce, normalizeStyle as _, createBlock as E, createCommentVNode as T, unref as i, createSlots as Oe, withCtx as k, renderSlot as C, normalizeProps as de, guardReactiveProps as ve, createElementVNode as S, Fragment as P, renderList as F, toDisplayString as U, createVNode as Ee, createTextVNode as Se, nextTick as Me } from "vue";
|
|
2
|
-
import { u as ze, o as Ye, e as De, c as fe, t as Ge, a as Be, p as V, b as Ae, v, f as he, X as Ue, F as me, I as Ve, i as je, q as Xe, r as We } from "./index-
|
|
3
|
-
import { _ as qe } from "./Title-
|
|
4
|
-
import { u as Re, U as Ze } from "./usePrinter-
|
|
5
|
-
import { D as Je } from "./DataTable-
|
|
6
|
-
import Ke from "./vue-ui-accordion-
|
|
7
|
-
import Qe from "./vue-ui-skeleton-
|
|
8
|
-
import { u as ge } from "./useNestedProp-
|
|
2
|
+
import { u as ze, o as Ye, e as De, c as fe, t as Ge, a as Be, p as V, b as Ae, v, f as he, X as Ue, F as me, I as Ve, i as je, q as Xe, r as We } from "./index-DQl1TFXa.js";
|
|
3
|
+
import { _ as qe } from "./Title-DlBwa3-X.js";
|
|
4
|
+
import { u as Re, U as Ze } from "./usePrinter-DgKGVvJC.js";
|
|
5
|
+
import { D as Je } from "./DataTable-Cmbf3abv.js";
|
|
6
|
+
import Ke from "./vue-ui-accordion-CroZrm7T.js";
|
|
7
|
+
import Qe from "./vue-ui-skeleton-BVJGmYjj.js";
|
|
8
|
+
import { u as ge } from "./useNestedProp-lmeFt-ev.js";
|
|
9
9
|
import { _ as et } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
10
10
|
const tt = ["id"], lt = {
|
|
11
11
|
key: 0,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { computed as v, onMounted as $e, ref as u, watch as _e, openBlock as s, createElementBlock as n, normalizeClass as L, normalizeStyle as W, createBlock as x, createCommentVNode as d, unref as h, createSlots as Te, withCtx as i, renderSlot as y, normalizeProps as I, guardReactiveProps as F, createElementVNode as $, Fragment as oe, renderList as se, createTextVNode as re, toDisplayString as O, createVNode as Pe, nextTick as Se } from "vue";
|
|
2
|
-
import { u as Ne, o as Le, e as ue, g as Ie, c as ne, t as Fe, a as Oe, p as E, b as Ee, d as De, G as ie, J as Ge, f as k, X as Ve, i as ce, x as ve, y as Be, q as Me, r as ze } from "./index-
|
|
3
|
-
import { L as We } from "./Legend-
|
|
4
|
-
import { _ as Ae } from "./Title-
|
|
5
|
-
import { _ as He } from "./Tooltip-
|
|
6
|
-
import { D as Ue } from "./DataTable-
|
|
7
|
-
import { u as Xe, U as Re } from "./usePrinter-
|
|
8
|
-
import Ye from "./vue-ui-skeleton-
|
|
9
|
-
import je from "./vue-ui-accordion-
|
|
10
|
-
import { u as de } from "./useNestedProp-
|
|
2
|
+
import { u as Ne, o as Le, e as ue, g as Ie, c as ne, t as Fe, a as Oe, p as E, b as Ee, d as De, G as ie, J as Ge, f as k, X as Ve, i as ce, x as ve, y as Be, q as Me, r as ze } from "./index-DQl1TFXa.js";
|
|
3
|
+
import { L as We } from "./Legend-CCq0mNRg.js";
|
|
4
|
+
import { _ as Ae } from "./Title-DlBwa3-X.js";
|
|
5
|
+
import { _ as He } from "./Tooltip-w32n-8sY.js";
|
|
6
|
+
import { D as Ue } from "./DataTable-Cmbf3abv.js";
|
|
7
|
+
import { u as Xe, U as Re } from "./usePrinter-DgKGVvJC.js";
|
|
8
|
+
import Ye from "./vue-ui-skeleton-BVJGmYjj.js";
|
|
9
|
+
import je from "./vue-ui-accordion-CroZrm7T.js";
|
|
10
|
+
import { u as de } from "./useNestedProp-lmeFt-ev.js";
|
|
11
11
|
import { _ as qe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
12
12
|
const Je = ["id"], Ke = {
|
|
13
13
|
key: 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-BKTciLz4.cjs"),le=require("./Legend-DhQ-a1RH.cjs"),oe=require("./Title-DYwo_Q5b.cjs"),ae=require("./Tooltip-03RvVGln.cjs"),re=require("./DataTable-DAwK5x3h.cjs"),W=require("./usePrinter-CxYg-Dw-.cjs"),ne=require("./vue-ui-skeleton-pDeQ3NcD.cjs"),se=require("./vue-ui-accordion-SXHdW20_.cjs"),U=require("./useNestedProp-BFnXnY0k.cjs"),ue=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ie=["id"],ce={key:0,style:"width:100%;background:transparent;padding-bottom:24px"},de=["xmlns","viewBox"],ve=["id"],he=["stdDeviation"],pe=["d","stroke","stroke-width"],fe=["d","stroke","stroke-width"],ye=["filter"],ge=["d","stroke","stroke-width"],me=["d","stroke-width","onMouseenter","onClick"],be={key:3,class:"vue-data-ui-watermark"},ke=["onClick"],Ce={key:0},we={key:1},xe=["innerHTML"],$e={__name:"vue-ui-galaxy",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(H,{expose:R,emit:_}){const i=H,{vue_ui_galaxy:X}=r.useConfig(),b=e.computed(()=>!!i.dataset&&i.dataset.length);e.onMounted(()=>{S()});function S(){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()),C=e.ref(null),j=e.ref(null),w=e.ref(!1),x=e.ref(""),c=e.ref(null),N=e.ref(0),P=e.ref(0),L=e.ref(0),E=e.ref(0),t=e.computed({get:()=>V(),set:l=>l});function V(){const l=U.useNestedProp({userConfig:i.config,defaultConfig:X});return l.theme?{...U.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=V(),S(),P.value+=1,L.value+=1,E.value+=1},{deep:!0});const{isPrinting:F,isImaging:I,generatePdf:O,generateImage:z}=W.usePrinter({elementId:`galaxy_${y.value}`,fileName:t.value.style.chart.title.text||"vue-ui-galaxy"}),Y=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}),$=e.ref({height:180,width:250}),u=e.ref([]);function B(l){u.value.includes(l.id)?u.value=u.value.filter(a=>a!==l.id):u.value.push(l.id),_("selectLegend",g.value.map(a=>({name:a.name,color:a.color,value:a.value})))}const p=e.computed(()=>i.dataset.map((l,a)=>({name:l.name,color:r.convertColorToHex(l.color)||Y.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 J(){return p.value.map(l=>({name:l.name,color:l.color,value:l.value}))}const d=e.computed(()=>p.value.filter(l=>!u.value.includes(l.id)).map(l=>l.value).reduce((l,a)=>l+a,0)),K=e.ref(190),D=e.computed(()=>p.value.filter(l=>!u.value.includes(l.id))),g=e.computed(()=>{const l=[];for(let a=0;a<D.value.length;a+=1){const o=D.value[a];let n=o.value/d.value*K.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 Q(l){m.value=l,N.value+=1}const T=e.ref(null);function Z({datapoint:l,_relativeIndex:a,seriesIndex:o,show:n=!1}){T.value={datapoint:l,seriesIndex:o,series:p.value,config:t.value},w.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:p.value,config:t.value}))?x.value=f({seriesIndex:o,datapoint:l,series:p.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>`),x.value=`<div>${s}</div>`)}const q=e.computed(()=>p.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:()=>B(l),isSegregated:u.value.includes(l.id)}))),ee=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":""})),h=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 G(){e.nextTick(()=>{const l=h.value.head.map((n,s)=>[[n.name],[h.value.body[s]],[isNaN(h.value.body[s]/d.value)?"-":h.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 k=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=h.value.head.map((s,f)=>{const te=r.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:h.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},te,isNaN(h.value.body[f]/d.value)?"-":r.dataLabel({v:h.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 M(){v.value.showTable=!v.value.showTable}function A(){v.value.showTooltip=!v.value.showTooltip}return R({getData:J,generatePdf:O,generateCsv:G,generateImage:z,toggleTable:M,toggleTooltip:A}),(l,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"galaxyChart",ref:C,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.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",ce,[(e.openBlock(),e.createBlock(oe._sfc_main,{key:`title_${P.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(W.UserOptions,{ref_key:"details",ref:j,key:`user_option_${N.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:C.value,position:t.value.userOptions.position,onToggleFullscreen:Q,onGeneratePdf:e.unref(O),onGenerateCsv:G,onGenerateImage:e.unref(z),onToggleTable:M,onToggleTooltip:A},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]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","position","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("svg",{key:2,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 ${$.value.width} ${$.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[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,he)],8,ve)]),(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,pe)):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,fe)):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,ge)],8,ye)):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=>Z({datapoint:o,relativeIndex:n,seriesIndex:o.seriesIndex,show:!0}),onMouseleave:a[0]||(a[0]=s=>{w.value=!1,c.value=null}),onClick:s=>_("selectDatapoint",o)},null,40,me)):e.createCommentVNode("",!0)]))),256)),e.renderSlot(l.$slots,"svg",{svg:$.value},void 0,!0)],14,de)):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(ne.default,{key:4,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(le.Legend,{key:`legend_${E.value}`,legendSet:q.value,config:ee.value,onClickMarker:a[1]||(a[1]=({legend:o})=>B(o))},{item:e.withCtx(({legend:o,index:n})=>[e.createElementVNode("div",{onClick:s=>B(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",we," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",Ce," ("+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,ke)]),_:1},8,["legendSet","config"])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"legend",{legend:q.value},void 0,!0),e.createVNode(ae._sfc_main,{show:v.value.showTooltip&&w.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:C.value,content:x.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(se.default,{key:6,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(re.DataTable,{key:`table_${L.value}`,colNames:k.value.colNames,head:k.value.head,body:k.value.body,config:k.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,xe)]),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,ie))}},Be=ue._export_sfc($e,[["__scopeId","data-v-a2be7205"]]);exports.default=Be;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-B8EMsnjU.cjs"),le=require("./Legend-XqP6-7Ac.cjs"),oe=require("./Title-BaR4XyXa.cjs"),ae=require("./Tooltip-CX57w9Q9.cjs"),re=require("./DataTable-cOEA6Z37.cjs"),W=require("./usePrinter-BmXrEJ99.cjs"),ne=require("./vue-ui-skeleton-Bli7jLZ7.cjs"),se=require("./vue-ui-accordion-DRI-fN6I.cjs"),U=require("./useNestedProp-DlCe_zZz.cjs"),ue=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ie=["id"],ce={key:0,style:"width:100%;background:transparent;padding-bottom:24px"},de=["xmlns","viewBox"],ve=["id"],he=["stdDeviation"],pe=["d","stroke","stroke-width"],fe=["d","stroke","stroke-width"],ye=["filter"],ge=["d","stroke","stroke-width"],me=["d","stroke-width","onMouseenter","onClick"],be={key:3,class:"vue-data-ui-watermark"},ke=["onClick"],Ce={key:0},we={key:1},xe=["innerHTML"],$e={__name:"vue-ui-galaxy",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(H,{expose:R,emit:_}){const i=H,{vue_ui_galaxy:X}=r.useConfig(),b=e.computed(()=>!!i.dataset&&i.dataset.length);e.onMounted(()=>{S()});function S(){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()),C=e.ref(null),j=e.ref(null),w=e.ref(!1),x=e.ref(""),c=e.ref(null),N=e.ref(0),P=e.ref(0),L=e.ref(0),E=e.ref(0),t=e.computed({get:()=>V(),set:l=>l});function V(){const l=U.useNestedProp({userConfig:i.config,defaultConfig:X});return l.theme?{...U.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=V(),S(),P.value+=1,L.value+=1,E.value+=1},{deep:!0});const{isPrinting:F,isImaging:I,generatePdf:O,generateImage:z}=W.usePrinter({elementId:`galaxy_${y.value}`,fileName:t.value.style.chart.title.text||"vue-ui-galaxy"}),Y=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}),$=e.ref({height:180,width:250}),u=e.ref([]);function B(l){u.value.includes(l.id)?u.value=u.value.filter(a=>a!==l.id):u.value.push(l.id),_("selectLegend",g.value.map(a=>({name:a.name,color:a.color,value:a.value})))}const p=e.computed(()=>i.dataset.map((l,a)=>({name:l.name,color:r.convertColorToHex(l.color)||Y.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 J(){return p.value.map(l=>({name:l.name,color:l.color,value:l.value}))}const d=e.computed(()=>p.value.filter(l=>!u.value.includes(l.id)).map(l=>l.value).reduce((l,a)=>l+a,0)),K=e.ref(190),D=e.computed(()=>p.value.filter(l=>!u.value.includes(l.id))),g=e.computed(()=>{const l=[];for(let a=0;a<D.value.length;a+=1){const o=D.value[a];let n=o.value/d.value*K.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 Q(l){m.value=l,N.value+=1}const T=e.ref(null);function Z({datapoint:l,_relativeIndex:a,seriesIndex:o,show:n=!1}){T.value={datapoint:l,seriesIndex:o,series:p.value,config:t.value},w.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:p.value,config:t.value}))?x.value=f({seriesIndex:o,datapoint:l,series:p.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>`),x.value=`<div>${s}</div>`)}const q=e.computed(()=>p.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:()=>B(l),isSegregated:u.value.includes(l.id)}))),ee=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":""})),h=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 G(){e.nextTick(()=>{const l=h.value.head.map((n,s)=>[[n.name],[h.value.body[s]],[isNaN(h.value.body[s]/d.value)?"-":h.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 k=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=h.value.head.map((s,f)=>{const te=r.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:h.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},te,isNaN(h.value.body[f]/d.value)?"-":r.dataLabel({v:h.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 M(){v.value.showTable=!v.value.showTable}function A(){v.value.showTooltip=!v.value.showTooltip}return R({getData:J,generatePdf:O,generateCsv:G,generateImage:z,toggleTable:M,toggleTooltip:A}),(l,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"galaxyChart",ref:C,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.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",ce,[(e.openBlock(),e.createBlock(oe._sfc_main,{key:`title_${P.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(W.UserOptions,{ref_key:"details",ref:j,key:`user_option_${N.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:C.value,position:t.value.userOptions.position,onToggleFullscreen:Q,onGeneratePdf:e.unref(O),onGenerateCsv:G,onGenerateImage:e.unref(z),onToggleTable:M,onToggleTooltip:A},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]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","position","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("svg",{key:2,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 ${$.value.width} ${$.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[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,he)],8,ve)]),(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,pe)):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,fe)):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,ge)],8,ye)):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=>Z({datapoint:o,relativeIndex:n,seriesIndex:o.seriesIndex,show:!0}),onMouseleave:a[0]||(a[0]=s=>{w.value=!1,c.value=null}),onClick:s=>_("selectDatapoint",o)},null,40,me)):e.createCommentVNode("",!0)]))),256)),e.renderSlot(l.$slots,"svg",{svg:$.value},void 0,!0)],14,de)):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(ne.default,{key:4,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(le.Legend,{key:`legend_${E.value}`,legendSet:q.value,config:ee.value,onClickMarker:a[1]||(a[1]=({legend:o})=>B(o))},{item:e.withCtx(({legend:o,index:n})=>[e.createElementVNode("div",{onClick:s=>B(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",we," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",Ce," ("+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,ke)]),_:1},8,["legendSet","config"])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"legend",{legend:q.value},void 0,!0),e.createVNode(ae._sfc_main,{show:v.value.showTooltip&&w.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:C.value,content:x.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(se.default,{key:6,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(re.DataTable,{key:`table_${L.value}`,colNames:k.value.colNames,head:k.value.head,body:k.value.body,config:k.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,xe)]),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,ie))}},Be=ue._export_sfc($e,[["__scopeId","data-v-a2be7205"]]);exports.default=Be;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-BKTciLz4.cjs"),Y=require("./useResponsive-B3TrDDIG.cjs"),R=require("./usePrinter-CxYg-Dw-.cjs"),J=require("./vue-ui-skeleton-pDeQ3NcD.cjs"),K=require("./Title-DYwo_Q5b.cjs"),D=require("./useNestedProp-BFnXnY0k.cjs"),Q=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ee=["id"],te={key:0},ae=["xmlns","viewBox"],le=["id"],oe=["stop-color"],re=["stop-color"],ne=["stop-color"],se=["id"],ue=["stdDeviation"],ie=["d","fill","stroke"],ce=["d","filter"],de=["x","y","text-anchor","font-size","font-weight","fill"],ve=["x","y","font-size","font-weight","fill"],he={key:1},fe=["x1","y1","x2","y2","stroke","stroke-width"],pe=["x1","y1","x2","y2","stroke","stroke-width"],me=["x1","y1","x2","y2","stroke-width","filter"],ye={key:2},ge=["d","fill","stroke","stroke-width"],ke=["cx","cy","fill","r","stroke-width","stroke"],be=["x","y","font-size","fill"],_e={key:3,class:"vue-data-ui-watermark"},xe={__name:"vue-ui-gauge",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(w,{expose:G}){const s=w,{vue_ui_gauge:j}=r.useConfig(),k=e.computed(()=>!!s.dataset&&Object.keys(s.dataset).length>0&&s.dataset.series&&s.dataset.series.length),h=e.ref(r.createUid()),A=e.ref(null),C=e.ref(0),b=e.ref(null),z=e.ref(null),B=e.ref(null),N=e.ref(0),t=e.computed({get:()=>P(),set:l=>l});e.watch(()=>s.config,l=>{t.value=P(),V(),N.value+=1},{deep:!0});function P(){const l=D.useNestedProp({userConfig:s.config,defaultConfig:j});return l.theme?{...D.useNestedProp({userConfig:r.themes.vue_ui_gauge[l.theme]||s.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}const{isPrinting:E,isImaging:M,generatePdf:$,generateImage:I}=R.usePrinter({elementId:`vue-ui-gauge_${h.value}`,fileName:t.value.style.chart.title.text||"vue-ui-gauge"}),q=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),p=e.computed(()=>{if(!k.value||r.objectIsEmpty(s.dataset.series||{}))return{value:0,series:[{from:0,to:0}]};const l=[];(s.dataset.series||[]).forEach(o=>{l.push(o.from||0),l.push(o.to||0)});const n=Math.max(...l);return{...s.dataset,series:(s.dataset.series||[]).map((o,i)=>({...o,color:r.convertColorToHex(o.color)||q.value[i]||r.palette[i],value:((o.to||0)-(o.from||0))/n*100}))}}),v=e.ref(512),a=e.ref({height:358.4,width:v.value,top:0,bottom:358.4,centerX:179.2,centerY:v.value/2,labelFontSize:18,legendFontSize:t.value.style.chart.legend.fontSize,pointerRadius:t.value.style.chart.layout.pointer.circle.radius,trackSize:t.value.style.chart.layout.track.size,pointerSize:t.value.style.chart.layout.pointer.size,pointerStrokeWidth:t.value.style.chart.layout.pointer.strokeWidth,markerOffset:t.value.style.chart.layout.markers.offsetY+3}),_=e.ref(0),y=e.ref(0),c=e.ref(t.value.style.chart.animation.use?0:s.dataset.value);e.watch(()=>s.dataset.value,()=>{X(s.dataset.value)});const d=e.computed(()=>{const l=a.value.width/2,n=u.value.base,o=Math.PI*((c.value+0-y.value)/(_.value-y.value))+Math.PI;return{x1:l,y1:n,x2:l+u.value.pointerSize*a.value.pointerSize*.9*Math.cos(o),y2:n+u.value.pointerSize*a.value.pointerSize*.9*Math.sin(o)}}),O=e.computed(()=>{const l=a.value.width/2,n=u.value.base,o=Math.PI*((c.value+0-y.value)/(_.value-y.value))+Math.PI,i=l+u.value.pointerSize*a.value.pointerSize*.9*Math.cos(o),S=n+u.value.pointerSize*a.value.pointerSize*.9*Math.sin(o),f=a.value.pointerRadius,W=l+f*Math.cos(o+Math.PI/2),T=n+f*Math.sin(o+Math.PI/2),H=l+f*Math.cos(o-Math.PI/2),Z=n+f*Math.sin(o-Math.PI/2);return isNaN(i)?null:`M ${i},${S} ${W},${T} ${H},${Z} Z`}),F=e.computed(()=>{for(let l=0;l<p.value.series.length;l+=1){const{color:n,from:o,to:i}=p.value.series[l];if(c.value>=o&&c.value<=i)return n}return"#2D353C"}),x=e.ref(null);function V(){if(r.objectIsEmpty(s.dataset)?r.error({componentName:"VueUiGauge",type:"dataset"}):(r.getMissingDatasetAttributes({datasetObject:s.dataset,requiredAttributes:["value","series"]}).forEach(l=>{r.error({componentName:"VueUiGauge",type:"datasetAttribute",property:l})}),Object.hasOwn(s.dataset,"series")&&(s.dataset.series.length?s.dataset.series.forEach((l,n)=>{r.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["from","to"]}).forEach(o=>{r.error({componentName:"VueUiGauge",type:"datasetSerieAttribute",property:o,index:n})})}):r.error({componentName:"VueUiGauge",type:"datasetAttributeEmpty",property:"series"}))),X(s.dataset.value||0),t.value.responsive){const l=Y.throttle(()=>{const{width:n,height:o}=Y.useResponsive({chart:b.value,title:t.value.style.chart.title.text?z.value:null,legend:B.value});a.value.width=n,a.value.height=o,a.value.centerX=n/2,a.value.centerY=v.value/2/358.4*o,a.value.bottom=o,a.value.labelFontSize=18/v.value*Math.min(o,n)<10?10:18/v.value*Math.min(o,n),a.value.legendFontSize=t.value.style.chart.legend.fontSize/v.value*Math.min(o,n)<14?14:t.value.style.chart.legend.fontSize/v.value*Math.min(o,n),a.value.pointerRadius=t.value.style.chart.layout.pointer.circle.radius/v.value*Math.min(o,n),a.value.trackSize=t.value.style.chart.layout.track.size/v.value*Math.min(o,n),a.value.pointerStrokeWidth=r.translateSize({relator:Math.min(n,o),adjuster:v.value,source:t.value.style.chart.layout.pointer.strokeWidth,threshold:2,fallback:2}),a.value.markerOffset=r.translateSize({relator:Math.max(n,o),adjuster:v.value,source:t.value.style.chart.layout.markers.offsetY+3,threshold:2,fallback:2})});x.value=new ResizeObserver(l),x.value.observe(b.value.parentNode)}}e.onMounted(()=>{V()}),e.onBeforeUnmount(()=>{x.value&&x.value.disconnect()});function X(l){const n=[];(p.value.series||[]).forEach(f=>{n.push(f.from||0),n.push(f.to||0)}),_.value=Math.max(...n),y.value=Math.min(...n);let o=t.value.style.chart.animation.speed;const i=Math.abs(l-c.value)/(o*60);function S(){c.value<l?c.value=Math.min(c.value+i,l):c.value>l&&(c.value=Math.max(c.value-i,l)),c.value!==l&&requestAnimationFrame(S)}S()}const u=e.computed(()=>{const l=t.value.responsive?Math.min(a.value.width,a.value.height):a.value.width;return{arcs:l/2.5,gradients:l/2.75,base:t.value.responsive?a.value.height/2:a.value.height*.7,ratingBase:t.value.responsive?a.value.height/2+a.value.height/4:a.value.height*.9,pointerSize:t.value.responsive?Math.min(a.value.width,a.value.height)/3:a.value.width/3.2}}),m=e.computed(()=>r.makeDonut({series:p.value.series},a.value.width/2,u.value.base,u.value.arcs,u.value.arcs,1,1,1,180,109.9495,40*a.value.trackSize)),L=e.computed(()=>r.makeDonut({series:p.value.series},a.value.width/2,u.value.base,u.value.gradients,u.value.gradients,.95,1,1,180,110.02,2*a.value.trackSize)),g=e.ref(!1);function U(l){g.value=l,C.value+=1}return G({generatePdf:$,generateImage:I}),(l,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-gauge ${g.value?"vue-data-ui-wrapper-fullscreen":""}`),ref_key:"gaugeChart",ref:b,id:`vue-ui-gauge_${h.value}`,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%":""}`)},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:z,style:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(K._sfc_main,{key:`title_${N.value}`,config:{title:{cy:"gauge-div-title",...t.value.style.chart.title},subtitle:{cy:"gauge-div-subtitle",...t.value.style.chart.title.subtitle}}},{default:e.withCtx(()=>[t.value.translations.base&&w.dataset.base?(e.openBlock(),e.createElementBlock("span",te,e.toDisplayString(t.value.translations.base)+": "+e.toDisplayString(w.dataset.base),1)):e.createCommentVNode("",!0)]),_:1},8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&k.value?(e.openBlock(),e.createBlock(R.UserOptions,{ref_key:"details",ref:A,key:`user_options_${C.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(M),isPrinting:e.unref(E),uid:h.value,hasXls:!1,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:g.value,titles:{...t.value.userOptions.buttonTitles},chartElement:b.value,position:t.value.userOptions.position,onToggleFullscreen:U,onGeneratePdf:e.unref($),onGenerateImage:e.unref(I)},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.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:i})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:i})),void 0,!0)]),key:"2"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),k.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":g.value,"vue-data-ui-fulscreen--off":!g.value}),viewBox:`0 0 ${a.value.width<=0?10:a.value.width} ${a.value.height<=0?10:a.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:hidden !important;background:transparent;color:${t.value.style.chart.color}`)},[e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{id:`gradient_${h.value}`,cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(r.setOpacity)("#FFFFFF",1)},null,8,oe),e.createElementVNode("stop",{offset:"80%","stop-color":e.unref(r.setOpacity)("#FFFFFF",t.value.style.chart.layout.track.gradientIntensity)},null,8,re),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.setOpacity)("#FFFFFF",1)},null,8,ne)],8,le)]),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${h.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},[e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:100/t.value.style.chart.layout.track.gradientIntensity},null,8,ue)],8,se)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(o,i)=>(e.openBlock(),e.createElementBlock("path",{key:`arc_${i}`,d:o.arcSlice,fill:o.color,stroke:t.value.style.chart.backgroundColor,"stroke-linecap":"round"},null,8,ie))),128)),t.value.style.chart.layout.track.useGradient?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(L.value,(o,i)=>(e.openBlock(),e.createElementBlock("path",{key:`arc_${i}`,d:o.arcSlice,fill:"#FFFFFF",stroke:"none","stroke-linecap":"round",filter:`url(#blur_${h.value})`},null,8,ce))),128)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(o,i)=>(e.openBlock(),e.createElementBlock("text",{x:e.unref(r.offsetFromCenterPoint)({centerX:a.value.width/2,centerY:u.value.base,initX:o.center.startX,initY:o.center.startY,offset:a.value.markerOffset}).x,y:e.unref(r.offsetFromCenterPoint)({centerX:a.value.width/2,centerY:u.value.base,initX:o.center.startX,initY:o.center.startY,offset:a.value.markerOffset}).y,"text-anchor":o.center.startX<a.value.width/2-5?"end":o.center.startX>a.value.width/2+5?"start":"middle","font-size":a.value.labelFontSize*t.value.style.chart.layout.markers.fontSizeRatio,"font-weight":`${t.value.style.chart.layout.markers.bold?"bold":"normal"}`,fill:t.value.style.chart.layout.markers.color},e.toDisplayString(o.from.toFixed(t.value.style.chart.layout.markers.roundingValue)),9,de))),256)),e.createElementVNode("text",{x:e.unref(r.offsetFromCenterPoint)({centerX:a.value.width/2,centerY:u.value.base,initX:m.value.at(-1).endX,initY:m.value.at(-1).endY,offset:a.value.markerOffset}).x,y:e.unref(r.offsetFromCenterPoint)({centerX:a.value.width/2,centerY:u.value.base,initX:m.value.at(-1).endX,initY:m.value.at(-1).endY,offset:a.value.markerOffset}).y,"text-anchor":"start","font-size":a.value.labelFontSize*t.value.style.chart.layout.markers.fontSizeRatio,"font-weight":`${t.value.style.chart.layout.markers.bold?"bold":"normal"}`,fill:t.value.style.chart.layout.markers.color},e.toDisplayString(_.value.toFixed(t.value.style.chart.layout.markers.roundingValue)),9,ve),t.value.style.chart.layout.pointer.type==="rounded"?(e.openBlock(),e.createElementBlock("g",he,[isNaN(d.value.x2)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("line",{key:0,x1:d.value.x1,y1:d.value.y1,x2:d.value.x2,y2:d.value.y2,stroke:t.value.style.chart.layout.pointer.stroke,"stroke-width":a.value.pointerStrokeWidth,"stroke-linecap":"round"},null,8,fe)),isNaN(d.value.x2)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("line",{key:1,x1:d.value.x1,y1:d.value.y1,x2:d.value.x2,y2:d.value.y2,stroke:t.value.style.chart.layout.pointer.useRatingColor?F.value:t.value.style.chart.layout.pointer.color,"stroke-linecap":"round","stroke-width":a.value.pointerStrokeWidth*.7},null,8,pe)),!isNaN(d.value.x2)&&t.value.style.chart.layout.track.useGradient?(e.openBlock(),e.createElementBlock("line",{key:2,x1:d.value.x1,y1:d.value.y1,x2:d.value.x2,y2:d.value.y2,stroke:"white","stroke-linecap":"round","stroke-width":a.value.pointerStrokeWidth*.3,filter:`url(#blur_${h.value})`},null,8,me)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("g",ye,[O.value?(e.openBlock(),e.createElementBlock("path",{key:0,d:O.value,fill:t.value.style.chart.layout.pointer.useRatingColor?F.value:t.value.style.chart.layout.pointer.color,stroke:t.value.style.chart.layout.pointer.stroke,"stroke-width":t.value.style.chart.layout.pointer.circle.strokeWidth,"stroke-linejoin":"round"},null,8,ge)):e.createCommentVNode("",!0)])),e.createElementVNode("circle",{cx:a.value.width/2,cy:u.value.base,fill:t.value.style.chart.layout.pointer.circle.color,r:a.value.pointerRadius<=0?1e-4:a.value.pointerRadius,"stroke-width":t.value.style.chart.layout.pointer.circle.strokeWidth,stroke:t.value.style.chart.layout.pointer.circle.stroke},null,8,ke),e.createElementVNode("text",{x:a.value.width/2,y:u.value.ratingBase,"text-anchor":"middle","font-size":a.value.legendFontSize,"font-weight":"bold",fill:t.value.style.chart.legend.useRatingColor?F.value:t.value.style.chart.legend.color},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.legend.formatter,c.value,e.unref(r.dataLabel)({p:t.value.style.chart.legend.prefix+(t.value.style.chart.legend.showPlusSymbol&&c.value>0?"+":""),v:c.value,s:t.value.style.chart.legend.suffix,r:t.value.style.chart.legend.roundingValue}))),9,be),e.renderSlot(l.$slots,"svg",{svg:a.value},void 0,!0)],14,ae)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",_e,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(E)||e.unref(M)})),void 0,!0)])):e.createCommentVNode("",!0),k.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(J.default,{key:4,config:{type:"gauge",style:{backgroundColor:t.value.style.chart.backgroundColor,gauge:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:B},[e.renderSlot(l.$slots,"legend",{legend:p.value},void 0,!0)],512)],14,ee))}},Se=Q._export_sfc(xe,[["__scopeId","data-v-f3c9ca1e"]]);exports.default=Se;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-B8EMsnjU.cjs"),Y=require("./useResponsive-B3TrDDIG.cjs"),R=require("./usePrinter-BmXrEJ99.cjs"),J=require("./vue-ui-skeleton-Bli7jLZ7.cjs"),K=require("./Title-BaR4XyXa.cjs"),D=require("./useNestedProp-DlCe_zZz.cjs"),Q=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ee=["id"],te={key:0},ae=["xmlns","viewBox"],le=["id"],oe=["stop-color"],re=["stop-color"],ne=["stop-color"],se=["id"],ue=["stdDeviation"],ie=["d","fill","stroke"],ce=["d","filter"],de=["x","y","text-anchor","font-size","font-weight","fill"],ve=["x","y","font-size","font-weight","fill"],he={key:1},fe=["x1","y1","x2","y2","stroke","stroke-width"],pe=["x1","y1","x2","y2","stroke","stroke-width"],me=["x1","y1","x2","y2","stroke-width","filter"],ye={key:2},ge=["d","fill","stroke","stroke-width"],ke=["cx","cy","fill","r","stroke-width","stroke"],be=["x","y","font-size","fill"],_e={key:3,class:"vue-data-ui-watermark"},xe={__name:"vue-ui-gauge",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(w,{expose:G}){const s=w,{vue_ui_gauge:j}=r.useConfig(),k=e.computed(()=>!!s.dataset&&Object.keys(s.dataset).length>0&&s.dataset.series&&s.dataset.series.length),h=e.ref(r.createUid()),A=e.ref(null),C=e.ref(0),b=e.ref(null),z=e.ref(null),B=e.ref(null),N=e.ref(0),t=e.computed({get:()=>P(),set:l=>l});e.watch(()=>s.config,l=>{t.value=P(),V(),N.value+=1},{deep:!0});function P(){const l=D.useNestedProp({userConfig:s.config,defaultConfig:j});return l.theme?{...D.useNestedProp({userConfig:r.themes.vue_ui_gauge[l.theme]||s.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}const{isPrinting:E,isImaging:M,generatePdf:$,generateImage:I}=R.usePrinter({elementId:`vue-ui-gauge_${h.value}`,fileName:t.value.style.chart.title.text||"vue-ui-gauge"}),q=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),p=e.computed(()=>{if(!k.value||r.objectIsEmpty(s.dataset.series||{}))return{value:0,series:[{from:0,to:0}]};const l=[];(s.dataset.series||[]).forEach(o=>{l.push(o.from||0),l.push(o.to||0)});const n=Math.max(...l);return{...s.dataset,series:(s.dataset.series||[]).map((o,i)=>({...o,color:r.convertColorToHex(o.color)||q.value[i]||r.palette[i],value:((o.to||0)-(o.from||0))/n*100}))}}),v=e.ref(512),a=e.ref({height:358.4,width:v.value,top:0,bottom:358.4,centerX:179.2,centerY:v.value/2,labelFontSize:18,legendFontSize:t.value.style.chart.legend.fontSize,pointerRadius:t.value.style.chart.layout.pointer.circle.radius,trackSize:t.value.style.chart.layout.track.size,pointerSize:t.value.style.chart.layout.pointer.size,pointerStrokeWidth:t.value.style.chart.layout.pointer.strokeWidth,markerOffset:t.value.style.chart.layout.markers.offsetY+3}),_=e.ref(0),y=e.ref(0),c=e.ref(t.value.style.chart.animation.use?0:s.dataset.value);e.watch(()=>s.dataset.value,()=>{X(s.dataset.value)});const d=e.computed(()=>{const l=a.value.width/2,n=u.value.base,o=Math.PI*((c.value+0-y.value)/(_.value-y.value))+Math.PI;return{x1:l,y1:n,x2:l+u.value.pointerSize*a.value.pointerSize*.9*Math.cos(o),y2:n+u.value.pointerSize*a.value.pointerSize*.9*Math.sin(o)}}),O=e.computed(()=>{const l=a.value.width/2,n=u.value.base,o=Math.PI*((c.value+0-y.value)/(_.value-y.value))+Math.PI,i=l+u.value.pointerSize*a.value.pointerSize*.9*Math.cos(o),S=n+u.value.pointerSize*a.value.pointerSize*.9*Math.sin(o),f=a.value.pointerRadius,W=l+f*Math.cos(o+Math.PI/2),T=n+f*Math.sin(o+Math.PI/2),H=l+f*Math.cos(o-Math.PI/2),Z=n+f*Math.sin(o-Math.PI/2);return isNaN(i)?null:`M ${i},${S} ${W},${T} ${H},${Z} Z`}),F=e.computed(()=>{for(let l=0;l<p.value.series.length;l+=1){const{color:n,from:o,to:i}=p.value.series[l];if(c.value>=o&&c.value<=i)return n}return"#2D353C"}),x=e.ref(null);function V(){if(r.objectIsEmpty(s.dataset)?r.error({componentName:"VueUiGauge",type:"dataset"}):(r.getMissingDatasetAttributes({datasetObject:s.dataset,requiredAttributes:["value","series"]}).forEach(l=>{r.error({componentName:"VueUiGauge",type:"datasetAttribute",property:l})}),Object.hasOwn(s.dataset,"series")&&(s.dataset.series.length?s.dataset.series.forEach((l,n)=>{r.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["from","to"]}).forEach(o=>{r.error({componentName:"VueUiGauge",type:"datasetSerieAttribute",property:o,index:n})})}):r.error({componentName:"VueUiGauge",type:"datasetAttributeEmpty",property:"series"}))),X(s.dataset.value||0),t.value.responsive){const l=Y.throttle(()=>{const{width:n,height:o}=Y.useResponsive({chart:b.value,title:t.value.style.chart.title.text?z.value:null,legend:B.value});a.value.width=n,a.value.height=o,a.value.centerX=n/2,a.value.centerY=v.value/2/358.4*o,a.value.bottom=o,a.value.labelFontSize=18/v.value*Math.min(o,n)<10?10:18/v.value*Math.min(o,n),a.value.legendFontSize=t.value.style.chart.legend.fontSize/v.value*Math.min(o,n)<14?14:t.value.style.chart.legend.fontSize/v.value*Math.min(o,n),a.value.pointerRadius=t.value.style.chart.layout.pointer.circle.radius/v.value*Math.min(o,n),a.value.trackSize=t.value.style.chart.layout.track.size/v.value*Math.min(o,n),a.value.pointerStrokeWidth=r.translateSize({relator:Math.min(n,o),adjuster:v.value,source:t.value.style.chart.layout.pointer.strokeWidth,threshold:2,fallback:2}),a.value.markerOffset=r.translateSize({relator:Math.max(n,o),adjuster:v.value,source:t.value.style.chart.layout.markers.offsetY+3,threshold:2,fallback:2})});x.value=new ResizeObserver(l),x.value.observe(b.value.parentNode)}}e.onMounted(()=>{V()}),e.onBeforeUnmount(()=>{x.value&&x.value.disconnect()});function X(l){const n=[];(p.value.series||[]).forEach(f=>{n.push(f.from||0),n.push(f.to||0)}),_.value=Math.max(...n),y.value=Math.min(...n);let o=t.value.style.chart.animation.speed;const i=Math.abs(l-c.value)/(o*60);function S(){c.value<l?c.value=Math.min(c.value+i,l):c.value>l&&(c.value=Math.max(c.value-i,l)),c.value!==l&&requestAnimationFrame(S)}S()}const u=e.computed(()=>{const l=t.value.responsive?Math.min(a.value.width,a.value.height):a.value.width;return{arcs:l/2.5,gradients:l/2.75,base:t.value.responsive?a.value.height/2:a.value.height*.7,ratingBase:t.value.responsive?a.value.height/2+a.value.height/4:a.value.height*.9,pointerSize:t.value.responsive?Math.min(a.value.width,a.value.height)/3:a.value.width/3.2}}),m=e.computed(()=>r.makeDonut({series:p.value.series},a.value.width/2,u.value.base,u.value.arcs,u.value.arcs,1,1,1,180,109.9495,40*a.value.trackSize)),L=e.computed(()=>r.makeDonut({series:p.value.series},a.value.width/2,u.value.base,u.value.gradients,u.value.gradients,.95,1,1,180,110.02,2*a.value.trackSize)),g=e.ref(!1);function U(l){g.value=l,C.value+=1}return G({generatePdf:$,generateImage:I}),(l,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-gauge ${g.value?"vue-data-ui-wrapper-fullscreen":""}`),ref_key:"gaugeChart",ref:b,id:`vue-ui-gauge_${h.value}`,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%":""}`)},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:z,style:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(K._sfc_main,{key:`title_${N.value}`,config:{title:{cy:"gauge-div-title",...t.value.style.chart.title},subtitle:{cy:"gauge-div-subtitle",...t.value.style.chart.title.subtitle}}},{default:e.withCtx(()=>[t.value.translations.base&&w.dataset.base?(e.openBlock(),e.createElementBlock("span",te,e.toDisplayString(t.value.translations.base)+": "+e.toDisplayString(w.dataset.base),1)):e.createCommentVNode("",!0)]),_:1},8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&k.value?(e.openBlock(),e.createBlock(R.UserOptions,{ref_key:"details",ref:A,key:`user_options_${C.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(M),isPrinting:e.unref(E),uid:h.value,hasXls:!1,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:g.value,titles:{...t.value.userOptions.buttonTitles},chartElement:b.value,position:t.value.userOptions.position,onToggleFullscreen:U,onGeneratePdf:e.unref($),onGenerateImage:e.unref(I)},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.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:i})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:i})),void 0,!0)]),key:"2"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),k.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":g.value,"vue-data-ui-fulscreen--off":!g.value}),viewBox:`0 0 ${a.value.width<=0?10:a.value.width} ${a.value.height<=0?10:a.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:hidden !important;background:transparent;color:${t.value.style.chart.color}`)},[e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{id:`gradient_${h.value}`,cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(r.setOpacity)("#FFFFFF",1)},null,8,oe),e.createElementVNode("stop",{offset:"80%","stop-color":e.unref(r.setOpacity)("#FFFFFF",t.value.style.chart.layout.track.gradientIntensity)},null,8,re),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.setOpacity)("#FFFFFF",1)},null,8,ne)],8,le)]),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${h.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},[e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:100/t.value.style.chart.layout.track.gradientIntensity},null,8,ue)],8,se)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(o,i)=>(e.openBlock(),e.createElementBlock("path",{key:`arc_${i}`,d:o.arcSlice,fill:o.color,stroke:t.value.style.chart.backgroundColor,"stroke-linecap":"round"},null,8,ie))),128)),t.value.style.chart.layout.track.useGradient?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(L.value,(o,i)=>(e.openBlock(),e.createElementBlock("path",{key:`arc_${i}`,d:o.arcSlice,fill:"#FFFFFF",stroke:"none","stroke-linecap":"round",filter:`url(#blur_${h.value})`},null,8,ce))),128)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(o,i)=>(e.openBlock(),e.createElementBlock("text",{x:e.unref(r.offsetFromCenterPoint)({centerX:a.value.width/2,centerY:u.value.base,initX:o.center.startX,initY:o.center.startY,offset:a.value.markerOffset}).x,y:e.unref(r.offsetFromCenterPoint)({centerX:a.value.width/2,centerY:u.value.base,initX:o.center.startX,initY:o.center.startY,offset:a.value.markerOffset}).y,"text-anchor":o.center.startX<a.value.width/2-5?"end":o.center.startX>a.value.width/2+5?"start":"middle","font-size":a.value.labelFontSize*t.value.style.chart.layout.markers.fontSizeRatio,"font-weight":`${t.value.style.chart.layout.markers.bold?"bold":"normal"}`,fill:t.value.style.chart.layout.markers.color},e.toDisplayString(o.from.toFixed(t.value.style.chart.layout.markers.roundingValue)),9,de))),256)),e.createElementVNode("text",{x:e.unref(r.offsetFromCenterPoint)({centerX:a.value.width/2,centerY:u.value.base,initX:m.value.at(-1).endX,initY:m.value.at(-1).endY,offset:a.value.markerOffset}).x,y:e.unref(r.offsetFromCenterPoint)({centerX:a.value.width/2,centerY:u.value.base,initX:m.value.at(-1).endX,initY:m.value.at(-1).endY,offset:a.value.markerOffset}).y,"text-anchor":"start","font-size":a.value.labelFontSize*t.value.style.chart.layout.markers.fontSizeRatio,"font-weight":`${t.value.style.chart.layout.markers.bold?"bold":"normal"}`,fill:t.value.style.chart.layout.markers.color},e.toDisplayString(_.value.toFixed(t.value.style.chart.layout.markers.roundingValue)),9,ve),t.value.style.chart.layout.pointer.type==="rounded"?(e.openBlock(),e.createElementBlock("g",he,[isNaN(d.value.x2)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("line",{key:0,x1:d.value.x1,y1:d.value.y1,x2:d.value.x2,y2:d.value.y2,stroke:t.value.style.chart.layout.pointer.stroke,"stroke-width":a.value.pointerStrokeWidth,"stroke-linecap":"round"},null,8,fe)),isNaN(d.value.x2)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("line",{key:1,x1:d.value.x1,y1:d.value.y1,x2:d.value.x2,y2:d.value.y2,stroke:t.value.style.chart.layout.pointer.useRatingColor?F.value:t.value.style.chart.layout.pointer.color,"stroke-linecap":"round","stroke-width":a.value.pointerStrokeWidth*.7},null,8,pe)),!isNaN(d.value.x2)&&t.value.style.chart.layout.track.useGradient?(e.openBlock(),e.createElementBlock("line",{key:2,x1:d.value.x1,y1:d.value.y1,x2:d.value.x2,y2:d.value.y2,stroke:"white","stroke-linecap":"round","stroke-width":a.value.pointerStrokeWidth*.3,filter:`url(#blur_${h.value})`},null,8,me)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("g",ye,[O.value?(e.openBlock(),e.createElementBlock("path",{key:0,d:O.value,fill:t.value.style.chart.layout.pointer.useRatingColor?F.value:t.value.style.chart.layout.pointer.color,stroke:t.value.style.chart.layout.pointer.stroke,"stroke-width":t.value.style.chart.layout.pointer.circle.strokeWidth,"stroke-linejoin":"round"},null,8,ge)):e.createCommentVNode("",!0)])),e.createElementVNode("circle",{cx:a.value.width/2,cy:u.value.base,fill:t.value.style.chart.layout.pointer.circle.color,r:a.value.pointerRadius<=0?1e-4:a.value.pointerRadius,"stroke-width":t.value.style.chart.layout.pointer.circle.strokeWidth,stroke:t.value.style.chart.layout.pointer.circle.stroke},null,8,ke),e.createElementVNode("text",{x:a.value.width/2,y:u.value.ratingBase,"text-anchor":"middle","font-size":a.value.legendFontSize,"font-weight":"bold",fill:t.value.style.chart.legend.useRatingColor?F.value:t.value.style.chart.legend.color},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.legend.formatter,c.value,e.unref(r.dataLabel)({p:t.value.style.chart.legend.prefix+(t.value.style.chart.legend.showPlusSymbol&&c.value>0?"+":""),v:c.value,s:t.value.style.chart.legend.suffix,r:t.value.style.chart.legend.roundingValue}))),9,be),e.renderSlot(l.$slots,"svg",{svg:a.value},void 0,!0)],14,ae)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",_e,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(E)||e.unref(M)})),void 0,!0)])):e.createCommentVNode("",!0),k.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(J.default,{key:4,config:{type:"gauge",style:{backgroundColor:t.value.style.chart.backgroundColor,gauge:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:B},[e.renderSlot(l.$slots,"legend",{legend:p.value},void 0,!0)],512)],14,ee))}},Se=Q._export_sfc(xe,[["__scopeId","data-v-f3c9ca1e"]]);exports.default=Se;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { computed as g, ref as h, watch as J, onMounted as ke, onBeforeUnmount as be, openBlock as o, createElementBlock as i, normalizeClass as Q, normalizeStyle as ee, createBlock as G, withCtx as I, toDisplayString as S, createCommentVNode as p, unref as c, createSlots as _e, renderSlot as x, normalizeProps as te, guardReactiveProps as ae, createElementVNode as f, Fragment as R, renderList as E } from "vue";
|
|
2
|
-
import { u as xe, c as we, t as Fe, a as Se, p as le, b as ze, o as se, d as Ce, e as O, g as re, m as oe, X as Me, s as A, K as X, i as $e, f as Pe, E as ue } from "./index-
|
|
2
|
+
import { u as xe, c as we, t as Fe, a as Se, p as le, b as ze, o as se, d as Ce, e as O, g as re, m as oe, X as Me, s as A, K as X, i as $e, f as Pe, E as ue } from "./index-DQl1TFXa.js";
|
|
3
3
|
import { t as Ie, u as Oe } from "./useResponsive-NZB-WLRF.js";
|
|
4
|
-
import { u as Xe, U as Ne } from "./usePrinter-
|
|
5
|
-
import Ye from "./vue-ui-skeleton-
|
|
6
|
-
import { _ as Ge } from "./Title-
|
|
7
|
-
import { u as ne } from "./useNestedProp-
|
|
4
|
+
import { u as Xe, U as Ne } from "./usePrinter-DgKGVvJC.js";
|
|
5
|
+
import Ye from "./vue-ui-skeleton-BVJGmYjj.js";
|
|
6
|
+
import { _ as Ge } from "./Title-DlBwa3-X.js";
|
|
7
|
+
import { u as ne } from "./useNestedProp-lmeFt-ev.js";
|
|
8
8
|
import { _ as Re } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
9
9
|
const Ee = ["id"], Ae = { key: 0 }, je = ["xmlns", "viewBox"], De = ["id"], Ue = ["stop-color"], Be = ["stop-color"], Le = ["stop-color"], We = ["id"], Te = ["stdDeviation"], Ve = ["d", "fill", "stroke"], qe = ["d", "filter"], He = ["x", "y", "text-anchor", "font-size", "font-weight", "fill"], Ke = ["x", "y", "font-size", "font-weight", "fill"], Ze = { key: 1 }, Je = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], Qe = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], et = ["x1", "y1", "x2", "y2", "stroke-width", "filter"], tt = { key: 2 }, at = ["d", "fill", "stroke", "stroke-width"], lt = ["cx", "cy", "fill", "r", "stroke-width", "stroke"], st = ["x", "y", "font-size", "fill"], rt = {
|
|
10
10
|
key: 3,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ref as x, onMounted as C, computed as c, watch as z, openBlock as a, createElementBlock as s, normalizeStyle as G, createElementVNode as t, createCommentVNode as r, Fragment as g, toDisplayString as y, unref as d } from "vue";
|
|
2
|
-
import { u as L, c as b, e as N, i as p, f as k } from "./index-
|
|
3
|
-
import { u as $ } from "./useNestedProp-
|
|
2
|
+
import { u as L, c as b, e as N, i as p, f as k } from "./index-DQl1TFXa.js";
|
|
3
|
+
import { u as $ } from "./useNestedProp-lmeFt-ev.js";
|
|
4
4
|
const F = ["viewBox", "width"], B = { key: 0 }, P = ["id"], D = ["stop-color"], I = ["stop-color"], M = ["stroke"], U = ["stroke"], V = ["width", "fill"], E = ["fill"], O = { key: 0 }, S = ["id"], A = /* @__PURE__ */ t("feGaussianBlur", {
|
|
5
5
|
in: "SourceGraphic",
|
|
6
6
|
stdDeviation: 1
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-B8EMsnjU.cjs"),m=require("./useNestedProp-DlCe_zZz.cjs"),k=["viewBox","width"],_={key:0},p=["id"],v=["stop-color"],g=["stop-color"],y=["stroke"],C=["stroke"],N=["width","fill"],w=["fill"],x={key:0},B=["id"],E=e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:1},null,-1),V=[E],b=["stroke"],L=["stroke","stroke-dasharray","stroke-dashoffset"],z=["filter"],G=["stroke","stroke-dasharray","stroke-dashoffset"],F=["fill"],$={__name:"vue-ui-gizmo",props:{config:{type:Object,default(){return{}}},dataset:{type:Number,default:0}},setup(i){const o=i,{vue_ui_gizmo:f}=a.useConfig(),n=e.ref(a.createUid());e.onMounted(()=>{c()});function c(){!o.dataset&&o.dataset!==0&&a.error({componentName:"VueUiGizmo",type:"dataset"}),o.dataset<0&&console.warn("VueUiGizmo: dataset cannot be negative.")}const t=e.computed({get:()=>d(),set:r=>r});function d(){return m.useNestedProp({userConfig:o.config,defaultConfig:f})}e.watch(()=>o.config,r=>{t.value=d(),c()},{deep:!0});const u=e.computed(()=>({battery:{width:t.value.showPercentage?140:80,height:50},gauge:{width:80,height:80}})[t.value.type]),l=e.computed(()=>{const s=2*Math.PI*35,h=s-o.dataset/100*s;return{dasharray:`${s} ${s}`,dashoffset:h}});return(r,s)=>(e.openBlock(),e.createElementBlock("svg",{class:"vue-ui-gizmo",viewBox:`0 0 ${u.value.width} ${u.value.height}`,width:t.value.size,style:e.normalizeStyle({background:"transparent",fontFamily:t.value.fontFamily})},[t.value.useGradient?(e.openBlock(),e.createElementBlock("defs",_,[e.createElementVNode("linearGradient",{id:`gizmo_gradient_${n.value}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.gradientColor},null,8,v),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.color},null,8,g)],8,p)])):e.createCommentVNode("",!0),t.value.type==="battery"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("path",{d:"M 5 10 L 5 40 C 5 43 7 45 9 45 L 65 45 C 68 45 70 43 70 40 L 70 38 C 73 38 75 38 75 33 L 75 17 C 75 12 73 12 70 12 L 70 10 C 70 7 68 5 65 5 L 10 5 C 7 5 5 7 5 10",stroke:t.value.stroke,"stroke-width":2,fill:"none"},null,8,y),e.createElementVNode("path",{d:"M 70 16 L 70 34",stroke:t.value.stroke,"stroke-width":2,fill:"none",style:{opacity:"0.5"}},null,8,C),e.createElementVNode("rect",{x:10,y:10,height:30,width:55*(i.dataset/100),fill:t.value.useGradient?`url(#gizmo_gradient_${n.value})`:t.value.color,rx:2},null,8,N),t.value.showPercentage?(e.openBlock(),e.createElementBlock("text",{key:0,x:85,y:32,"text-anchor":"start","font-size":"20",fill:t.value.textColor},e.toDisplayString(e.unref(a.applyDataLabel)(t.value.formatter,o.dataset,e.unref(a.dataLabel)({v:o.dataset,s:"%"}))),9,w)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),t.value.type==="gauge"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[t.value.useGradient?(e.openBlock(),e.createElementBlock("defs",x,[e.createElementVNode("filter",{id:`blur_${n.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},V,8,B)])):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:40,cy:40,r:35,stroke:t.value.stroke,"stroke-width":2*4,fill:"none"},null,8,b),e.createElementVNode("circle",{cx:40,cy:40,r:35,stroke:t.value.color,"stroke-width":2*4,"stroke-dasharray":l.value.dasharray,"stroke-dashoffset":l.value.dashoffset,"stroke-linecap":"round",fill:"none",style:{transform:"rotate(-90deg)","transform-origin":"50% 50%"}},null,8,L),t.value.useGradient?(e.openBlock(),e.createElementBlock("g",{key:1,filter:`url(#blur_${n.value})`},[e.createElementVNode("circle",{cx:40,cy:40,r:35,stroke:t.value.gradientColor,"stroke-width":1,fill:"none","stroke-dasharray":l.value.dasharray,"stroke-dashoffset":l.value.dashoffset,style:{transform:"rotate(-90deg)","transform-origin":"50% 50%"}},null,8,G)],8,z)):e.createCommentVNode("",!0),t.value.showPercentage?(e.openBlock(),e.createElementBlock("text",{key:2,x:40,y:47,"text-anchor":"middle","font-size":"20",fill:t.value.textColor},e.toDisplayString(e.unref(a.applyDataLabel)(t.value.formatter,o.dataset,e.unref(a.dataLabel)({v:o.dataset,s:"%"}))),9,F)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],12,k))}};exports.default=$;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-BKTciLz4.cjs"),ne=require("./Title-DYwo_Q5b.cjs"),J=require("./usePrinter-CxYg-Dw-.cjs"),re=require("./Tooltip-03RvVGln.cjs"),ie=require("./vue-ui-skeleton-pDeQ3NcD.cjs"),de=require("./BaseIcon-B_MrASni.cjs"),ce=require("./vue-ui-accordion-SXHdW20_.cjs"),Q=require("./useNestedProp-BFnXnY0k.cjs"),ve=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ye=["id"],pe={key:0,style:"width:100%;background:transparent"},he=["xmlns","viewBox"],ge=["x","y","width","height","fill","stroke","stroke-width"],fe=["x","y","width","height","fill","stroke","stroke-width"],me=["font-size","font-weight","fill","x","y"],be=["x","y","width","height","onMouseover"],xe={key:0},ke=["font-size","fill","x","y","font-weight"],we={key:0},_e=["text-anchor","font-size","fill","font-weight","transform"],Ce={key:1},Ne=["x","y","width","height","stroke","stroke-width"],Le={key:2},Be=["id"],$e=["stop-color"],Ve=["stop-color"],Ee=["x","y","font-size","fill"],Se=["x","y","height","rx","fill"],ze=["x","y","font-size","fill"],Ae=["stroke","x1","x2","y1","y2"],Te=["fill","d"],Me={key:3},Fe={id:"colorScaleHorizontal",x1:"0%",x2:"100%",y1:"0%",y2:"0%"},Pe=["stop-color"],Oe=["stop-color"],De=["x","y","width","height","rx"],Ie=["x","y","font-size","fill"],Re=["x","y","font-size","fill"],qe=["stroke","x1","x2","y1","y2"],He=["fill","d"],Ue={key:3,class:"vue-data-ui-watermark"},Ge={class:"vue-ui-data-table"},Xe={key:0},je=["data-cell"],Ye={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},We=["data-cell"],Ke={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Je={__name:"vue-ui-heatmap",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(B,{expose:Z}){const n=B;e.useCssVars(l=>({52850410:l.tdo}));const{vue_ui_heatmap:ee}=o.useConfig(),$=e.computed(()=>!!n.dataset&&n.dataset.length);o.objectIsEmpty(n.dataset)&&o.error({componentName:"VueUiHeatmap",type:"dataset"});const k=e.ref(o.createUid()),S=e.ref(null),te=e.ref(null),z=e.ref(!1),A=e.ref(""),O=e.ref(void 0),w=e.ref(null),D=e.ref(0),I=e.ref(null),R=e.ref(!1),q=e.ref(0),t=e.computed({get:()=>H(),set:l=>l});function H(){const l=Q.useNestedProp({userConfig:n.config,defaultConfig:ee});let s={};return l.theme?s={...Q.useNestedProp({userConfig:o.themes.vue_ui_heatmap[l.theme]||n.config,defaultConfig:l})}:s=l,n.config&&o.hasDeepProperty(n.config,"style.layout.dataLabels.xAxis.showOnlyAtModulo")?s.style.layout.dataLabels.xAxis.showOnlyAtModulo=n.config.style.layout.dataLabels.xAxis.showOnlyAtModulo:s.style.layout.dataLabels.xAxis.showOnlyAtModulo=null,s}e.watch(()=>n.config,l=>{t.value=H(),T(),q.value+=1},{deep:!0}),e.watch(()=>n.dataset,()=>{T()},{deep:!0});const{isPrinting:U,isImaging:G,generatePdf:X,generateImage:j}=J.usePrinter({elementId:`heatmap__${k.value}`,fileName:t.value.style.title.text||"vue-ui-heatmap"}),y=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.tooltip.show}),le=e.computed(()=>t.value.table.responsiveBreakpoint);function ae(){new ResizeObserver(s=>{s.forEach(u=>{R.value=u.contentRect.width<le.value})}).observe(I.value)}e.onMounted(T);function T(){ae()}const x=e.computed(()=>Math.max(...n.dataset.flatMap(l=>(l.values||[]).length))),p=e.computed(()=>{const l=t.value.style.layout.padding.top+t.value.style.layout.padding.bottom+n.dataset.length*t.value.style.layout.cells.height,s=t.value.style.layout.padding.left+t.value.style.layout.padding.right+(x.value<n.dataset.length?n.dataset.length:x.value)*t.value.style.layout.cells.height,u=l+(t.value.style.legend.show?t.value.style.legend.position==="right"?0:t.value.style.layout.cells.height*2:0);return{height:l,heightWithLegend:u,width:s}}),V=e.computed(()=>t.value.style.legend.position),a=e.computed(()=>({top:t.value.style.layout.padding.top,left:t.value.style.layout.padding.left,right:p.value.width-t.value.style.layout.padding.right-(V.value==="right"&&t.value.style.legend.show?92:0),bottom:p.value.height-t.value.style.layout.padding.bottom,height:p.value.height-t.value.style.layout.padding.top-t.value.style.layout.padding.bottom,width:p.value.width-t.value.style.layout.padding.right-t.value.style.layout.padding.left-(V.value==="right"&&t.value.style.legend.show?92:0)})),M=e.computed(()=>i.value.height*n.dataset.length),v=e.computed(()=>Math.max(...n.dataset.flatMap(l=>l.values))),m=e.computed(()=>Math.min(...n.dataset.flatMap(l=>l.values))),b=e.computed(()=>{const l=n.dataset.flatMap(u=>u.values);return l.reduce((u,r)=>u+r,0)/l.length}),i=e.computed(()=>({width:a.value.width/x.value,height:a.value.width/(x.value<n.dataset.length?n.dataset.length:x.value)})),h=e.computed(()=>{const l=t.value.style.layout.dataLabels.yAxis.values.length?t.value.style.layout.dataLabels.yAxis.values:n.dataset.map(u=>u.name),s=t.value.style.layout.dataLabels.xAxis.values;return{yLabels:l,xLabels:s.slice(0,x.value)}}),E=e.computed(()=>(n.dataset.forEach((l,s)=>{o.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["values"]}).forEach(u=>{o.error({componentName:"VueUiHeatmap",type:"datasetSerieAttribute",property:"values",index:s})})}),n.dataset.map(l=>({...l,temperatures:(l.values||[]).map((s,u)=>s>=b.value?{side:"up",color:o.interpolateColorHex(t.value.style.layout.cells.colors.cold,t.value.style.layout.cells.colors.hot,m.value,v.value,s),ratio:Math.abs(Math.abs(s-b.value)/Math.abs(v.value-b.value))>1?1:Math.abs(Math.abs(s-b.value)/Math.abs(v.value-b.value)),value:s,yAxisName:l.name,xAxisName:h.value.xLabels[u],id:`vue-data-ui-heatmap-cell-${o.createUid()}`}:{side:"down",ratio:Math.abs(1-Math.abs(s)/Math.abs(b.value))>1?1:Math.abs(1-Math.abs(s)/Math.abs(b.value)),color:o.interpolateColorHex(t.value.style.layout.cells.colors.cold,t.value.style.layout.cells.colors.hot,m.value,v.value,s),value:s,yAxisName:l.name,xAxisName:h.value.xLabels[u],id:`vue-data-ui-heatmap-cell-${o.createUid()}`})})))),g=e.ref(null),_=e.ref(null);function oe(l,s,u,r){w.value={x:u,y:r};const{value:d,yAxisName:c,xAxisName:f,id:ue}=l;O.value=ue,g.value=d,_.value={datapoint:l,seriesIndex:s,series:E.value,config:t.value},z.value=!0;let F="";const P=t.value.style.tooltip.customFormat;o.isFunction(P)&&o.functionReturnsString(()=>P({datapoint:l,seriesIndex:s,series:E.value,config:t.value}))?A.value=P({datapoint:l,seriesIndex:s,series:E.value,config:t.value}):(F+=`<div>${c} ${f?`${f}`:""}</div>`,F+=`<div style="margin-top:6px;padding-top:6px;border-top:1px solid ${t.value.style.tooltip.borderColor};font-weight:bold;display:flex;flex-direction:row;gap:12px;align-items:center;justify-content:center"><span style="color:${o.interpolateColorHex(t.value.style.layout.cells.colors.cold,t.value.style.layout.cells.colors.hot,m.value,v.value,d)}">⬤</span><span>${isNaN(d)?"-":o.applyDataLabel(t.value.style.layout.cells.value.formatter,d,o.dataLabel({p:t.value.style.layout.dataLabels.prefix,v:d,s:t.value.style.layout.dataLabels.suffix,r:t.value.style.tooltip.roundingValue}),{datapoint:l,seriesIndex:s})}</span></div>`,A.value=`<div style="font-size:${t.value.style.tooltip.fontSize}px">${F}</div>`)}const C=e.computed(()=>a.value.top+M.value*(1-g.value/v.value)),N=e.computed(()=>a.value.left+(p.value.width-a.value.left-t.value.style.layout.padding.right)*(g.value/v.value));e.computed(()=>{const l=n.dataset.map(u=>({name:u.name})),s=n.dataset.map(u=>u.values);return{head:l,body:s}});function Y(){e.nextTick(()=>{const l=["",...n.dataset.map((d,c)=>d.name)],s=[];for(let d=0;d<h.value.xLabels.length;d+=1){const c=[h.value.xLabels[d]];for(let f=0;f<n.dataset.length;f+=1)c.push([n.dataset[f].values[d]]);s.push(c)}const u=[[t.value.style.title.text],[t.value.style.title.subtitle.text],[[""],[""],[""]]].concat([l]).concat(s),r=o.createCsvContent(u);o.downloadCsv({csvContent:r,title:t.value.style.title.text||"vue-ui-heatmap"})})}const L=e.ref(!1);function se(l){L.value=l,D.value+=1}function W(){y.value.showTable=!y.value.showTable}function K(){y.value.showTooltip=!y.value.showTooltip}return Z({generatePdf:X,generateCsv:Y,generateImage:j,toggleTable:W,toggleTooltip:K}),(l,s)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"heatmapChart",ref:S,class:e.normalizeClass(`vue-ui-heatmap ${L.value?"vue-data-ui-wrapper-fullscreen":""}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;${t.value.style.title.text?"":"padding-top:36px"};background:${t.value.style.backgroundColor}`),id:`heatmap__${k.value}`},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",pe,[(e.openBlock(),e.createBlock(ne._sfc_main,{key:`title_${q.value}`,config:{title:{cy:"heatmap-div-title",...t.value.style.title},subtitle:{cy:"heatmap-div-subtitle",...t.value.style.title.subtitle}}},null,8,["config"]))])):e.createCommentVNode("",!0),t.value.userOptions.show&&$.value?(e.openBlock(),e.createBlock(J.UserOptions,{ref_key:"details",ref:te,key:`user_options_${D.value}`,backgroundColor:t.value.style.backgroundColor,color:t.value.style.color,isImaging:e.unref(G),isPrinting:e.unref(U),uid:k.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:L.value,isTooltip:y.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:S.value,position:t.value.userOptions.position,onToggleFullscreen:se,onGeneratePdf:e.unref(X),onGenerateCsv:Y,onGenerateImage:e.unref(j),onToggleTable:W,onToggleTooltip:K},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:u,isFullscreen:r})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:u,isFullscreen:r})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),$.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(o.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":L.value,"vue-data-ui-fulscreen--off":!L.value}),viewBox:`0 0 ${p.value.width} ${p.value.heightWithLegend}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.color}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.value,(u,r)=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.temperatures,(d,c)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:a.value.left+i.value.width*c+t.value.style.layout.cells.spacing/2,y:a.value.top+i.value.height*r+t.value.style.layout.cells.spacing/2,width:i.value.width-t.value.style.layout.cells.spacing,height:i.value.height-t.value.style.layout.cells.spacing,fill:t.value.style.layout.cells.colors.underlayer,stroke:t.value.style.backgroundColor,"stroke-width":t.value.style.layout.cells.spacing},null,8,ge),e.createElementVNode("rect",{x:a.value.left+i.value.width*c+t.value.style.layout.cells.spacing/2,y:a.value.top+i.value.height*r+t.value.style.layout.cells.spacing/2,width:i.value.width-t.value.style.layout.cells.spacing,height:i.value.height-t.value.style.layout.cells.spacing,fill:d.color,stroke:t.value.style.backgroundColor,"stroke-width":t.value.style.layout.cells.spacing},null,8,fe),t.value.style.layout.cells.value.show?(e.openBlock(),e.createElementBlock("text",{key:0,"text-anchor":"middle","font-size":t.value.style.layout.cells.value.fontSize,"font-weight":t.value.style.layout.cells.value.bold?"bold":"normal",fill:e.unref(o.adaptColorToBackground)(d.color),x:a.value.left+i.value.width*c+i.value.width/2,y:a.value.top+i.value.height*r+i.value.height/2+t.value.style.layout.cells.value.fontSize/3},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.layout.cells.value.formatter,d.value,e.unref(o.dataLabel)({p:t.value.style.layout.dataLabels.prefix,v:d.value,s:t.value.style.layout.dataLabels.suffix,r:t.value.style.layout.cells.value.roundingValue}),{datapoint:d})),9,me)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.temperatures,(d,c)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:a.value.left+i.value.width*c,y:a.value.top+i.value.height*r,width:i.value.width,height:i.value.height,fill:"transparent",stroke:"none",onMouseover:f=>oe(d,r,a.value.left+i.value.width*c,a.value.top+i.value.height*r),onMouseout:s[0]||(s[0]=f=>{z.value=!1,O.value=void 0,g.value=null,w.value=null})},null,40,be)]))),256)),t.value.style.layout.dataLabels.yAxis.show?(e.openBlock(),e.createElementBlock("g",xe,[e.createElementVNode("text",{"font-size":t.value.style.layout.dataLabels.yAxis.fontSize,fill:t.value.style.layout.dataLabels.yAxis.color,x:a.value.left+t.value.style.layout.dataLabels.yAxis.offsetX-6,y:a.value.top+i.value.height*r+i.value.height/2+t.value.style.layout.dataLabels.yAxis.fontSize/3+t.value.style.layout.dataLabels.yAxis.offsetY,"text-anchor":"end","font-weight":t.value.style.layout.dataLabels.yAxis.bold?"bold":"normal"},e.toDisplayString(h.value.yLabels[r]),9,ke)])):e.createCommentVNode("",!0)]))),256)),t.value.style.layout.dataLabels.xAxis.show?(e.openBlock(),e.createElementBlock("g",we,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value.xLabels,(u,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[!t.value.style.layout.dataLabels.xAxis.showOnlyAtModulo||t.value.style.layout.dataLabels.xAxis.showOnlyAtModulo&&r%t.value.style.layout.dataLabels.xAxis.showOnlyAtModulo===0?(e.openBlock(),e.createElementBlock("text",{key:0,"text-anchor":t.value.style.layout.dataLabels.xAxis.rotation===0?"middle":t.value.style.layout.dataLabels.xAxis.rotation<0?"start":"end","font-size":t.value.style.layout.dataLabels.xAxis.fontSize,fill:t.value.style.layout.dataLabels.xAxis.color,"font-weight":t.value.style.layout.dataLabels.xAxis.bold?"bold":"normal",transform:`translate(${a.value.left+i.value.width/2+a.value.width/h.value.xLabels.length*r+t.value.style.layout.dataLabels.xAxis.offsetX}, ${a.value.top+t.value.style.layout.dataLabels.xAxis.offsetY-6}), rotate(${t.value.style.layout.dataLabels.xAxis.rotation})`},e.toDisplayString(u),9,_e)):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0),w.value?(e.openBlock(),e.createElementBlock("g",Ce,[e.createElementVNode("rect",{style:{"pointer-events":"none"},x:w.value.x-t.value.style.layout.cells.selected.border/2+t.value.style.layout.cells.spacing,y:w.value.y-t.value.style.layout.cells.selected.border/2+t.value.style.layout.cells.spacing,width:i.value.width-t.value.style.layout.cells.spacing+t.value.style.layout.cells.selected.border-t.value.style.layout.cells.spacing,height:i.value.height-t.value.style.layout.cells.spacing+t.value.style.layout.cells.selected.border-t.value.style.layout.cells.spacing,fill:"transparent",stroke:t.value.style.layout.cells.selected.color,"stroke-width":t.value.style.layout.cells.selected.border,rx:1},null,8,Ne)])):e.createCommentVNode("",!0),t.value.style.legend.show&&V.value==="right"?(e.openBlock(),e.createElementBlock("g",Le,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`colorScaleVertical_${k.value}`,x2:"0%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.layout.cells.colors.hot},null,8,$e),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.layout.cells.colors.cold},null,8,Ve)],8,Be)]),e.createElementVNode("text",{x:a.value.right+36+18,y:a.value.top-t.value.style.legend.fontSize*1.5,"text-anchor":"middle","font-size":t.value.style.legend.fontSize*2,fill:t.value.style.legend.color},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.layout.cells.value.formatter,e.unref(o.checkNaN)(v.value),e.unref(o.dataLabel)({p:t.value.style.layout.dataLabels.prefix,v:e.unref(o.checkNaN)(v.value),s:t.value.style.layout.dataLabels.suffix,r:t.value.style.legend.roundingValue}))),9,Ee),e.createElementVNode("rect",{x:a.value.right+36,y:a.value.top,width:36,height:M.value,rx:t.value.style.legend.scaleBorderRadius,fill:`url(#colorScaleVertical_${k.value})`},null,8,Se),e.createElementVNode("text",{x:a.value.right+36+18,y:a.value.top+M.value+t.value.style.legend.fontSize*2.5,"text-anchor":"middle","font-size":t.value.style.legend.fontSize*2,fill:t.value.style.legend.color},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.layout.cells.value.formatter,e.unref(o.checkNaN)(m.value),e.unref(o.dataLabel)({p:t.value.style.layout.dataLabels.prefix,v:e.unref(o.checkNaN)(m.value),s:t.value.style.layout.dataLabels.suffix,r:t.value.style.legend.roundingValue}))),9,ze),g.value!==null?(e.openBlock(),e.createElementBlock("line",{key:0,stroke:e.unref(o.adaptColorToBackground)(_.value.datapoint.color),"stroke-width":"2",x1:a.value.right+36,x2:a.value.right+72,y1:C.value,y2:C.value},null,8,Ae)):e.createCommentVNode("",!0),g.value!==null?(e.openBlock(),e.createElementBlock("path",{key:1,fill:t.value.style.color,stroke:"none",d:`M ${a.value.right+36},${C.value} ${a.value.right+26},${C.value-8} ${a.value.right+26},${C.value+8}z`},null,8,Te)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.style.legend.show&&V.value==="bottom"?(e.openBlock(),e.createElementBlock("g",Me,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",Fe,[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.layout.cells.colors.cold},null,8,Pe),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.layout.cells.colors.hot},null,8,Oe)])]),e.createElementVNode("rect",{x:a.value.left,y:a.value.bottom+t.value.style.layout.cells.height,width:p.value.width-a.value.left-t.value.style.layout.padding.right,height:t.value.style.layout.cells.height,rx:t.value.style.legend.scaleBorderRadius>t.value.style.layout.cells.height/2?t.value.style.layout.cells.height/2:t.value.style.legend.scaleBorderRadius,fill:"url(#colorScaleHorizontal)"},null,8,De),e.createElementVNode("text",{x:a.value.left,y:a.value.bottom+t.value.style.layout.cells.height*2+t.value.style.legend.fontSize*2,"text-anchor":"start","font-size":t.value.style.legend.fontSize*2,fill:t.value.style.legend.color},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.layout.cells.value.formatter,e.unref(o.checkNaN)(m.value),e.unref(o.dataLabel)({p:t.value.style.layout.dataLabels.prefix,v:e.unref(o.checkNaN)(m.value),s:t.value.style.layout.dataLabels.suffix,r:t.value.style.legend.roundingValue}))),9,Ie),e.createElementVNode("text",{x:a.value.right,y:a.value.bottom+t.value.style.layout.cells.height*2+t.value.style.legend.fontSize*2,"text-anchor":"end","font-size":t.value.style.legend.fontSize*2,fill:t.value.style.legend.color},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.layout.cells.value.formatter,e.unref(o.checkNaN)(v.value),e.unref(o.dataLabel)({p:t.value.style.layout.dataLabels.prefix,v:e.unref(o.checkNaN)(v.value),s:t.value.style.layout.dataLabels.suffix,r:t.value.style.legend.roundingValue}))),9,Re),g.value!==null?(e.openBlock(),e.createElementBlock("line",{key:0,stroke:e.unref(o.adaptColorToBackground)(_.value.datapoint.color),"stroke-width":"2",x1:N.value,x2:N.value,y1:a.value.bottom+t.value.style.layout.cells.height,y2:a.value.bottom+t.value.style.layout.cells.height*2},null,8,qe)):e.createCommentVNode("",!0),g.value!==null?(e.openBlock(),e.createElementBlock("path",{key:1,fill:t.value.style.color,stroke:"none",d:`M ${N.value},${a.value.bottom+t.value.style.layout.cells.height} ${N.value-12},${a.value.bottom+t.value.style.layout.cells.height-20} ${N.value+12},${a.value.bottom+t.value.style.layout.cells.height-20}z`},null,8,He)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"svg",{svg:p.value},void 0,!0)],14,he)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ue,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(U)||e.unref(G)})),void 0,!0)])):e.createCommentVNode("",!0),$.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ie.default,{key:4,config:{type:"heatmap",style:{backgroundColor:t.value.style.backgroundColor,heatmap:{color:"#CCCCCC"}}}},null,8,["config"])),e.createVNode(re._sfc_main,{show:y.value.showTooltip&&z.value,backgroundColor:t.value.style.tooltip.backgroundColor,color:t.value.style.tooltip.color,borderRadius:t.value.style.tooltip.borderRadius,borderColor:t.value.style.tooltip.borderColor,borderWidth:t.value.style.tooltip.borderWidth,fontSize:t.value.style.tooltip.fontSize,backgroundOpacity:t.value.style.tooltip.backgroundOpacity,position:t.value.style.tooltip.position,offsetY:t.value.style.tooltip.offsetY,parent:S.value,content:A.value,isCustom:t.value.style.tooltip.customFormat&&typeof t.value.style.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({..._.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({..._.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isCustom"]),$.value?(e.openBlock(),e.createBlock(ce.default,{key:5,hideDetails:"",config:{open:y.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.backgroundColor,color:t.value.style.color},head:{backgroundColor:t.value.style.backgroundColor,color:t.value.style.color}}},{content:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"tableContainer",ref:I,class:"vue-ui-heatmap-table"},[e.createElementVNode("div",{style:"width:100%;overflow-x:auto;padding-top:36px;position:relative",class:e.normalizeClass({"vue-ui-responsive":R.value})},[e.createElementVNode("div",{role:"button",tabindex:"0",style:e.normalizeStyle(`width:32px; position: absolute; top: 0; left:4px; padding: 0 0px; display: flex; align-items:center;justify-content:center;height: 36px; width: 32px; cursor:pointer; background:${t.value.table.th.backgroundColor};`),onClick:s[1]||(s[1]=u=>y.value.showTable=!1),onKeypress:s[2]||(s[2]=e.withKeys(u=>y.value.showTable=!1,["enter"]))},[e.createVNode(de.default,{name:"close",stroke:t.value.table.th.color,"stroke-width":2},null,8,["stroke"])],36),e.createElementVNode("table",Ge,[e.createElementVNode("caption",{style:e.normalizeStyle(`backgroundColor:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline}`)},[e.createTextVNode(e.toDisplayString(t.value.style.title.text)+" ",1),t.value.style.title.subtitle.text?(e.openBlock(),e.createElementBlock("span",Xe,e.toDisplayString(t.value.style.title.subtitle.text),1)):e.createCommentVNode("",!0)],4),e.createElementVNode("thead",null,[e.createElementVNode("tr",{role:"row",style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color}`)},[e.createElementVNode("th",{style:e.normalizeStyle(`outline:${t.value.table.th.outline};padding-right:6px`)},null,4),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.dataset,(u,r)=>(e.openBlock(),e.createElementBlock("th",{align:"right",style:e.normalizeStyle(`outline:${t.value.table.th.outline};padding-right:6px`)},e.toDisplayString(u.name),5))),256))],4)]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value.xLabels,(u,r)=>(e.openBlock(),e.createElementBlock("tr",{role:"row",class:e.normalizeClass({"vue-ui-data-table__tbody__row":!0,"vue-ui-data-table__tbody__row-even":r%2===0,"vue-ui-data-table__tbody__row-odd":r%2!==0}),style:e.normalizeStyle(`background:${t.value.table.td.backgroundColor};color:${t.value.table.td.color}`)},[e.createElementVNode("td",{"data-cell":t.value.table.colNames.xAxis,class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`)},[e.createElementVNode("div",Ye,e.toDisplayString(u),1)],12,je),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.dataset,(d,c)=>(e.openBlock(),e.createElementBlock("td",{class:"vue-ui-data-table__tbody__td","data-cell":B.dataset[c].name,style:e.normalizeStyle(`outline:${t.value.table.td.outline}`)},[e.createElementVNode("div",Ke,e.toDisplayString(isNaN(d.values[r])?"-":e.unref(o.dataLabel)({p:t.value.style.layout.dataLabels.prefix,v:d.values[r],s:t.value.style.layout.dataLabels.suffix,r:t.value.table.td.roundingValue})),1)],12,We))),256))],6))),256))])])],2)],512)]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,ye))}},Qe=ve._export_sfc(Je,[["__scopeId","data-v-ba280e32"]]);exports.default=Qe;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-B8EMsnjU.cjs"),ne=require("./Title-BaR4XyXa.cjs"),J=require("./usePrinter-BmXrEJ99.cjs"),re=require("./Tooltip-CX57w9Q9.cjs"),ie=require("./vue-ui-skeleton-Bli7jLZ7.cjs"),de=require("./BaseIcon-CnFXP_n9.cjs"),ce=require("./vue-ui-accordion-DRI-fN6I.cjs"),Q=require("./useNestedProp-DlCe_zZz.cjs"),ve=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ye=["id"],pe={key:0,style:"width:100%;background:transparent"},he=["xmlns","viewBox"],ge=["x","y","width","height","fill","stroke","stroke-width"],fe=["x","y","width","height","fill","stroke","stroke-width"],me=["font-size","font-weight","fill","x","y"],be=["x","y","width","height","onMouseover"],xe={key:0},ke=["font-size","fill","x","y","font-weight"],we={key:0},_e=["text-anchor","font-size","fill","font-weight","transform"],Ce={key:1},Ne=["x","y","width","height","stroke","stroke-width"],Le={key:2},Be=["id"],$e=["stop-color"],Ve=["stop-color"],Ee=["x","y","font-size","fill"],Se=["x","y","height","rx","fill"],ze=["x","y","font-size","fill"],Ae=["stroke","x1","x2","y1","y2"],Te=["fill","d"],Me={key:3},Fe={id:"colorScaleHorizontal",x1:"0%",x2:"100%",y1:"0%",y2:"0%"},Pe=["stop-color"],Oe=["stop-color"],De=["x","y","width","height","rx"],Ie=["x","y","font-size","fill"],Re=["x","y","font-size","fill"],qe=["stroke","x1","x2","y1","y2"],He=["fill","d"],Ue={key:3,class:"vue-data-ui-watermark"},Ge={class:"vue-ui-data-table"},Xe={key:0},je=["data-cell"],Ye={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},We=["data-cell"],Ke={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Je={__name:"vue-ui-heatmap",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(B,{expose:Z}){const n=B;e.useCssVars(l=>({52850410:l.tdo}));const{vue_ui_heatmap:ee}=o.useConfig(),$=e.computed(()=>!!n.dataset&&n.dataset.length);o.objectIsEmpty(n.dataset)&&o.error({componentName:"VueUiHeatmap",type:"dataset"});const k=e.ref(o.createUid()),S=e.ref(null),te=e.ref(null),z=e.ref(!1),A=e.ref(""),O=e.ref(void 0),w=e.ref(null),D=e.ref(0),I=e.ref(null),R=e.ref(!1),q=e.ref(0),t=e.computed({get:()=>H(),set:l=>l});function H(){const l=Q.useNestedProp({userConfig:n.config,defaultConfig:ee});let s={};return l.theme?s={...Q.useNestedProp({userConfig:o.themes.vue_ui_heatmap[l.theme]||n.config,defaultConfig:l})}:s=l,n.config&&o.hasDeepProperty(n.config,"style.layout.dataLabels.xAxis.showOnlyAtModulo")?s.style.layout.dataLabels.xAxis.showOnlyAtModulo=n.config.style.layout.dataLabels.xAxis.showOnlyAtModulo:s.style.layout.dataLabels.xAxis.showOnlyAtModulo=null,s}e.watch(()=>n.config,l=>{t.value=H(),T(),q.value+=1},{deep:!0}),e.watch(()=>n.dataset,()=>{T()},{deep:!0});const{isPrinting:U,isImaging:G,generatePdf:X,generateImage:j}=J.usePrinter({elementId:`heatmap__${k.value}`,fileName:t.value.style.title.text||"vue-ui-heatmap"}),y=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.tooltip.show}),le=e.computed(()=>t.value.table.responsiveBreakpoint);function ae(){new ResizeObserver(s=>{s.forEach(u=>{R.value=u.contentRect.width<le.value})}).observe(I.value)}e.onMounted(T);function T(){ae()}const x=e.computed(()=>Math.max(...n.dataset.flatMap(l=>(l.values||[]).length))),p=e.computed(()=>{const l=t.value.style.layout.padding.top+t.value.style.layout.padding.bottom+n.dataset.length*t.value.style.layout.cells.height,s=t.value.style.layout.padding.left+t.value.style.layout.padding.right+(x.value<n.dataset.length?n.dataset.length:x.value)*t.value.style.layout.cells.height,u=l+(t.value.style.legend.show?t.value.style.legend.position==="right"?0:t.value.style.layout.cells.height*2:0);return{height:l,heightWithLegend:u,width:s}}),V=e.computed(()=>t.value.style.legend.position),a=e.computed(()=>({top:t.value.style.layout.padding.top,left:t.value.style.layout.padding.left,right:p.value.width-t.value.style.layout.padding.right-(V.value==="right"&&t.value.style.legend.show?92:0),bottom:p.value.height-t.value.style.layout.padding.bottom,height:p.value.height-t.value.style.layout.padding.top-t.value.style.layout.padding.bottom,width:p.value.width-t.value.style.layout.padding.right-t.value.style.layout.padding.left-(V.value==="right"&&t.value.style.legend.show?92:0)})),M=e.computed(()=>i.value.height*n.dataset.length),v=e.computed(()=>Math.max(...n.dataset.flatMap(l=>l.values))),m=e.computed(()=>Math.min(...n.dataset.flatMap(l=>l.values))),b=e.computed(()=>{const l=n.dataset.flatMap(u=>u.values);return l.reduce((u,r)=>u+r,0)/l.length}),i=e.computed(()=>({width:a.value.width/x.value,height:a.value.width/(x.value<n.dataset.length?n.dataset.length:x.value)})),h=e.computed(()=>{const l=t.value.style.layout.dataLabels.yAxis.values.length?t.value.style.layout.dataLabels.yAxis.values:n.dataset.map(u=>u.name),s=t.value.style.layout.dataLabels.xAxis.values;return{yLabels:l,xLabels:s.slice(0,x.value)}}),E=e.computed(()=>(n.dataset.forEach((l,s)=>{o.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["values"]}).forEach(u=>{o.error({componentName:"VueUiHeatmap",type:"datasetSerieAttribute",property:"values",index:s})})}),n.dataset.map(l=>({...l,temperatures:(l.values||[]).map((s,u)=>s>=b.value?{side:"up",color:o.interpolateColorHex(t.value.style.layout.cells.colors.cold,t.value.style.layout.cells.colors.hot,m.value,v.value,s),ratio:Math.abs(Math.abs(s-b.value)/Math.abs(v.value-b.value))>1?1:Math.abs(Math.abs(s-b.value)/Math.abs(v.value-b.value)),value:s,yAxisName:l.name,xAxisName:h.value.xLabels[u],id:`vue-data-ui-heatmap-cell-${o.createUid()}`}:{side:"down",ratio:Math.abs(1-Math.abs(s)/Math.abs(b.value))>1?1:Math.abs(1-Math.abs(s)/Math.abs(b.value)),color:o.interpolateColorHex(t.value.style.layout.cells.colors.cold,t.value.style.layout.cells.colors.hot,m.value,v.value,s),value:s,yAxisName:l.name,xAxisName:h.value.xLabels[u],id:`vue-data-ui-heatmap-cell-${o.createUid()}`})})))),g=e.ref(null),_=e.ref(null);function oe(l,s,u,r){w.value={x:u,y:r};const{value:d,yAxisName:c,xAxisName:f,id:ue}=l;O.value=ue,g.value=d,_.value={datapoint:l,seriesIndex:s,series:E.value,config:t.value},z.value=!0;let F="";const P=t.value.style.tooltip.customFormat;o.isFunction(P)&&o.functionReturnsString(()=>P({datapoint:l,seriesIndex:s,series:E.value,config:t.value}))?A.value=P({datapoint:l,seriesIndex:s,series:E.value,config:t.value}):(F+=`<div>${c} ${f?`${f}`:""}</div>`,F+=`<div style="margin-top:6px;padding-top:6px;border-top:1px solid ${t.value.style.tooltip.borderColor};font-weight:bold;display:flex;flex-direction:row;gap:12px;align-items:center;justify-content:center"><span style="color:${o.interpolateColorHex(t.value.style.layout.cells.colors.cold,t.value.style.layout.cells.colors.hot,m.value,v.value,d)}">⬤</span><span>${isNaN(d)?"-":o.applyDataLabel(t.value.style.layout.cells.value.formatter,d,o.dataLabel({p:t.value.style.layout.dataLabels.prefix,v:d,s:t.value.style.layout.dataLabels.suffix,r:t.value.style.tooltip.roundingValue}),{datapoint:l,seriesIndex:s})}</span></div>`,A.value=`<div style="font-size:${t.value.style.tooltip.fontSize}px">${F}</div>`)}const C=e.computed(()=>a.value.top+M.value*(1-g.value/v.value)),N=e.computed(()=>a.value.left+(p.value.width-a.value.left-t.value.style.layout.padding.right)*(g.value/v.value));e.computed(()=>{const l=n.dataset.map(u=>({name:u.name})),s=n.dataset.map(u=>u.values);return{head:l,body:s}});function Y(){e.nextTick(()=>{const l=["",...n.dataset.map((d,c)=>d.name)],s=[];for(let d=0;d<h.value.xLabels.length;d+=1){const c=[h.value.xLabels[d]];for(let f=0;f<n.dataset.length;f+=1)c.push([n.dataset[f].values[d]]);s.push(c)}const u=[[t.value.style.title.text],[t.value.style.title.subtitle.text],[[""],[""],[""]]].concat([l]).concat(s),r=o.createCsvContent(u);o.downloadCsv({csvContent:r,title:t.value.style.title.text||"vue-ui-heatmap"})})}const L=e.ref(!1);function se(l){L.value=l,D.value+=1}function W(){y.value.showTable=!y.value.showTable}function K(){y.value.showTooltip=!y.value.showTooltip}return Z({generatePdf:X,generateCsv:Y,generateImage:j,toggleTable:W,toggleTooltip:K}),(l,s)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"heatmapChart",ref:S,class:e.normalizeClass(`vue-ui-heatmap ${L.value?"vue-data-ui-wrapper-fullscreen":""}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;${t.value.style.title.text?"":"padding-top:36px"};background:${t.value.style.backgroundColor}`),id:`heatmap__${k.value}`},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",pe,[(e.openBlock(),e.createBlock(ne._sfc_main,{key:`title_${q.value}`,config:{title:{cy:"heatmap-div-title",...t.value.style.title},subtitle:{cy:"heatmap-div-subtitle",...t.value.style.title.subtitle}}},null,8,["config"]))])):e.createCommentVNode("",!0),t.value.userOptions.show&&$.value?(e.openBlock(),e.createBlock(J.UserOptions,{ref_key:"details",ref:te,key:`user_options_${D.value}`,backgroundColor:t.value.style.backgroundColor,color:t.value.style.color,isImaging:e.unref(G),isPrinting:e.unref(U),uid:k.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:L.value,isTooltip:y.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:S.value,position:t.value.userOptions.position,onToggleFullscreen:se,onGeneratePdf:e.unref(X),onGenerateCsv:Y,onGenerateImage:e.unref(j),onToggleTable:W,onToggleTooltip:K},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:u,isFullscreen:r})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:u,isFullscreen:r})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),$.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(o.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":L.value,"vue-data-ui-fulscreen--off":!L.value}),viewBox:`0 0 ${p.value.width} ${p.value.heightWithLegend}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.color}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.value,(u,r)=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.temperatures,(d,c)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:a.value.left+i.value.width*c+t.value.style.layout.cells.spacing/2,y:a.value.top+i.value.height*r+t.value.style.layout.cells.spacing/2,width:i.value.width-t.value.style.layout.cells.spacing,height:i.value.height-t.value.style.layout.cells.spacing,fill:t.value.style.layout.cells.colors.underlayer,stroke:t.value.style.backgroundColor,"stroke-width":t.value.style.layout.cells.spacing},null,8,ge),e.createElementVNode("rect",{x:a.value.left+i.value.width*c+t.value.style.layout.cells.spacing/2,y:a.value.top+i.value.height*r+t.value.style.layout.cells.spacing/2,width:i.value.width-t.value.style.layout.cells.spacing,height:i.value.height-t.value.style.layout.cells.spacing,fill:d.color,stroke:t.value.style.backgroundColor,"stroke-width":t.value.style.layout.cells.spacing},null,8,fe),t.value.style.layout.cells.value.show?(e.openBlock(),e.createElementBlock("text",{key:0,"text-anchor":"middle","font-size":t.value.style.layout.cells.value.fontSize,"font-weight":t.value.style.layout.cells.value.bold?"bold":"normal",fill:e.unref(o.adaptColorToBackground)(d.color),x:a.value.left+i.value.width*c+i.value.width/2,y:a.value.top+i.value.height*r+i.value.height/2+t.value.style.layout.cells.value.fontSize/3},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.layout.cells.value.formatter,d.value,e.unref(o.dataLabel)({p:t.value.style.layout.dataLabels.prefix,v:d.value,s:t.value.style.layout.dataLabels.suffix,r:t.value.style.layout.cells.value.roundingValue}),{datapoint:d})),9,me)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.temperatures,(d,c)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:a.value.left+i.value.width*c,y:a.value.top+i.value.height*r,width:i.value.width,height:i.value.height,fill:"transparent",stroke:"none",onMouseover:f=>oe(d,r,a.value.left+i.value.width*c,a.value.top+i.value.height*r),onMouseout:s[0]||(s[0]=f=>{z.value=!1,O.value=void 0,g.value=null,w.value=null})},null,40,be)]))),256)),t.value.style.layout.dataLabels.yAxis.show?(e.openBlock(),e.createElementBlock("g",xe,[e.createElementVNode("text",{"font-size":t.value.style.layout.dataLabels.yAxis.fontSize,fill:t.value.style.layout.dataLabels.yAxis.color,x:a.value.left+t.value.style.layout.dataLabels.yAxis.offsetX-6,y:a.value.top+i.value.height*r+i.value.height/2+t.value.style.layout.dataLabels.yAxis.fontSize/3+t.value.style.layout.dataLabels.yAxis.offsetY,"text-anchor":"end","font-weight":t.value.style.layout.dataLabels.yAxis.bold?"bold":"normal"},e.toDisplayString(h.value.yLabels[r]),9,ke)])):e.createCommentVNode("",!0)]))),256)),t.value.style.layout.dataLabels.xAxis.show?(e.openBlock(),e.createElementBlock("g",we,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value.xLabels,(u,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[!t.value.style.layout.dataLabels.xAxis.showOnlyAtModulo||t.value.style.layout.dataLabels.xAxis.showOnlyAtModulo&&r%t.value.style.layout.dataLabels.xAxis.showOnlyAtModulo===0?(e.openBlock(),e.createElementBlock("text",{key:0,"text-anchor":t.value.style.layout.dataLabels.xAxis.rotation===0?"middle":t.value.style.layout.dataLabels.xAxis.rotation<0?"start":"end","font-size":t.value.style.layout.dataLabels.xAxis.fontSize,fill:t.value.style.layout.dataLabels.xAxis.color,"font-weight":t.value.style.layout.dataLabels.xAxis.bold?"bold":"normal",transform:`translate(${a.value.left+i.value.width/2+a.value.width/h.value.xLabels.length*r+t.value.style.layout.dataLabels.xAxis.offsetX}, ${a.value.top+t.value.style.layout.dataLabels.xAxis.offsetY-6}), rotate(${t.value.style.layout.dataLabels.xAxis.rotation})`},e.toDisplayString(u),9,_e)):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0),w.value?(e.openBlock(),e.createElementBlock("g",Ce,[e.createElementVNode("rect",{style:{"pointer-events":"none"},x:w.value.x-t.value.style.layout.cells.selected.border/2+t.value.style.layout.cells.spacing,y:w.value.y-t.value.style.layout.cells.selected.border/2+t.value.style.layout.cells.spacing,width:i.value.width-t.value.style.layout.cells.spacing+t.value.style.layout.cells.selected.border-t.value.style.layout.cells.spacing,height:i.value.height-t.value.style.layout.cells.spacing+t.value.style.layout.cells.selected.border-t.value.style.layout.cells.spacing,fill:"transparent",stroke:t.value.style.layout.cells.selected.color,"stroke-width":t.value.style.layout.cells.selected.border,rx:1},null,8,Ne)])):e.createCommentVNode("",!0),t.value.style.legend.show&&V.value==="right"?(e.openBlock(),e.createElementBlock("g",Le,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`colorScaleVertical_${k.value}`,x2:"0%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.layout.cells.colors.hot},null,8,$e),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.layout.cells.colors.cold},null,8,Ve)],8,Be)]),e.createElementVNode("text",{x:a.value.right+36+18,y:a.value.top-t.value.style.legend.fontSize*1.5,"text-anchor":"middle","font-size":t.value.style.legend.fontSize*2,fill:t.value.style.legend.color},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.layout.cells.value.formatter,e.unref(o.checkNaN)(v.value),e.unref(o.dataLabel)({p:t.value.style.layout.dataLabels.prefix,v:e.unref(o.checkNaN)(v.value),s:t.value.style.layout.dataLabels.suffix,r:t.value.style.legend.roundingValue}))),9,Ee),e.createElementVNode("rect",{x:a.value.right+36,y:a.value.top,width:36,height:M.value,rx:t.value.style.legend.scaleBorderRadius,fill:`url(#colorScaleVertical_${k.value})`},null,8,Se),e.createElementVNode("text",{x:a.value.right+36+18,y:a.value.top+M.value+t.value.style.legend.fontSize*2.5,"text-anchor":"middle","font-size":t.value.style.legend.fontSize*2,fill:t.value.style.legend.color},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.layout.cells.value.formatter,e.unref(o.checkNaN)(m.value),e.unref(o.dataLabel)({p:t.value.style.layout.dataLabels.prefix,v:e.unref(o.checkNaN)(m.value),s:t.value.style.layout.dataLabels.suffix,r:t.value.style.legend.roundingValue}))),9,ze),g.value!==null?(e.openBlock(),e.createElementBlock("line",{key:0,stroke:e.unref(o.adaptColorToBackground)(_.value.datapoint.color),"stroke-width":"2",x1:a.value.right+36,x2:a.value.right+72,y1:C.value,y2:C.value},null,8,Ae)):e.createCommentVNode("",!0),g.value!==null?(e.openBlock(),e.createElementBlock("path",{key:1,fill:t.value.style.color,stroke:"none",d:`M ${a.value.right+36},${C.value} ${a.value.right+26},${C.value-8} ${a.value.right+26},${C.value+8}z`},null,8,Te)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.style.legend.show&&V.value==="bottom"?(e.openBlock(),e.createElementBlock("g",Me,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",Fe,[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.layout.cells.colors.cold},null,8,Pe),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.layout.cells.colors.hot},null,8,Oe)])]),e.createElementVNode("rect",{x:a.value.left,y:a.value.bottom+t.value.style.layout.cells.height,width:p.value.width-a.value.left-t.value.style.layout.padding.right,height:t.value.style.layout.cells.height,rx:t.value.style.legend.scaleBorderRadius>t.value.style.layout.cells.height/2?t.value.style.layout.cells.height/2:t.value.style.legend.scaleBorderRadius,fill:"url(#colorScaleHorizontal)"},null,8,De),e.createElementVNode("text",{x:a.value.left,y:a.value.bottom+t.value.style.layout.cells.height*2+t.value.style.legend.fontSize*2,"text-anchor":"start","font-size":t.value.style.legend.fontSize*2,fill:t.value.style.legend.color},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.layout.cells.value.formatter,e.unref(o.checkNaN)(m.value),e.unref(o.dataLabel)({p:t.value.style.layout.dataLabels.prefix,v:e.unref(o.checkNaN)(m.value),s:t.value.style.layout.dataLabels.suffix,r:t.value.style.legend.roundingValue}))),9,Ie),e.createElementVNode("text",{x:a.value.right,y:a.value.bottom+t.value.style.layout.cells.height*2+t.value.style.legend.fontSize*2,"text-anchor":"end","font-size":t.value.style.legend.fontSize*2,fill:t.value.style.legend.color},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.layout.cells.value.formatter,e.unref(o.checkNaN)(v.value),e.unref(o.dataLabel)({p:t.value.style.layout.dataLabels.prefix,v:e.unref(o.checkNaN)(v.value),s:t.value.style.layout.dataLabels.suffix,r:t.value.style.legend.roundingValue}))),9,Re),g.value!==null?(e.openBlock(),e.createElementBlock("line",{key:0,stroke:e.unref(o.adaptColorToBackground)(_.value.datapoint.color),"stroke-width":"2",x1:N.value,x2:N.value,y1:a.value.bottom+t.value.style.layout.cells.height,y2:a.value.bottom+t.value.style.layout.cells.height*2},null,8,qe)):e.createCommentVNode("",!0),g.value!==null?(e.openBlock(),e.createElementBlock("path",{key:1,fill:t.value.style.color,stroke:"none",d:`M ${N.value},${a.value.bottom+t.value.style.layout.cells.height} ${N.value-12},${a.value.bottom+t.value.style.layout.cells.height-20} ${N.value+12},${a.value.bottom+t.value.style.layout.cells.height-20}z`},null,8,He)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"svg",{svg:p.value},void 0,!0)],14,he)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ue,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(U)||e.unref(G)})),void 0,!0)])):e.createCommentVNode("",!0),$.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ie.default,{key:4,config:{type:"heatmap",style:{backgroundColor:t.value.style.backgroundColor,heatmap:{color:"#CCCCCC"}}}},null,8,["config"])),e.createVNode(re._sfc_main,{show:y.value.showTooltip&&z.value,backgroundColor:t.value.style.tooltip.backgroundColor,color:t.value.style.tooltip.color,borderRadius:t.value.style.tooltip.borderRadius,borderColor:t.value.style.tooltip.borderColor,borderWidth:t.value.style.tooltip.borderWidth,fontSize:t.value.style.tooltip.fontSize,backgroundOpacity:t.value.style.tooltip.backgroundOpacity,position:t.value.style.tooltip.position,offsetY:t.value.style.tooltip.offsetY,parent:S.value,content:A.value,isCustom:t.value.style.tooltip.customFormat&&typeof t.value.style.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({..._.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({..._.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isCustom"]),$.value?(e.openBlock(),e.createBlock(ce.default,{key:5,hideDetails:"",config:{open:y.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.backgroundColor,color:t.value.style.color},head:{backgroundColor:t.value.style.backgroundColor,color:t.value.style.color}}},{content:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"tableContainer",ref:I,class:"vue-ui-heatmap-table"},[e.createElementVNode("div",{style:"width:100%;overflow-x:auto;padding-top:36px;position:relative",class:e.normalizeClass({"vue-ui-responsive":R.value})},[e.createElementVNode("div",{role:"button",tabindex:"0",style:e.normalizeStyle(`width:32px; position: absolute; top: 0; left:4px; padding: 0 0px; display: flex; align-items:center;justify-content:center;height: 36px; width: 32px; cursor:pointer; background:${t.value.table.th.backgroundColor};`),onClick:s[1]||(s[1]=u=>y.value.showTable=!1),onKeypress:s[2]||(s[2]=e.withKeys(u=>y.value.showTable=!1,["enter"]))},[e.createVNode(de.default,{name:"close",stroke:t.value.table.th.color,"stroke-width":2},null,8,["stroke"])],36),e.createElementVNode("table",Ge,[e.createElementVNode("caption",{style:e.normalizeStyle(`backgroundColor:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline}`)},[e.createTextVNode(e.toDisplayString(t.value.style.title.text)+" ",1),t.value.style.title.subtitle.text?(e.openBlock(),e.createElementBlock("span",Xe,e.toDisplayString(t.value.style.title.subtitle.text),1)):e.createCommentVNode("",!0)],4),e.createElementVNode("thead",null,[e.createElementVNode("tr",{role:"row",style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color}`)},[e.createElementVNode("th",{style:e.normalizeStyle(`outline:${t.value.table.th.outline};padding-right:6px`)},null,4),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.dataset,(u,r)=>(e.openBlock(),e.createElementBlock("th",{align:"right",style:e.normalizeStyle(`outline:${t.value.table.th.outline};padding-right:6px`)},e.toDisplayString(u.name),5))),256))],4)]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value.xLabels,(u,r)=>(e.openBlock(),e.createElementBlock("tr",{role:"row",class:e.normalizeClass({"vue-ui-data-table__tbody__row":!0,"vue-ui-data-table__tbody__row-even":r%2===0,"vue-ui-data-table__tbody__row-odd":r%2!==0}),style:e.normalizeStyle(`background:${t.value.table.td.backgroundColor};color:${t.value.table.td.color}`)},[e.createElementVNode("td",{"data-cell":t.value.table.colNames.xAxis,class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`)},[e.createElementVNode("div",Ye,e.toDisplayString(u),1)],12,je),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.dataset,(d,c)=>(e.openBlock(),e.createElementBlock("td",{class:"vue-ui-data-table__tbody__td","data-cell":B.dataset[c].name,style:e.normalizeStyle(`outline:${t.value.table.td.outline}`)},[e.createElementVNode("div",Ke,e.toDisplayString(isNaN(d.values[r])?"-":e.unref(o.dataLabel)({p:t.value.style.layout.dataLabels.prefix,v:d.values[r],s:t.value.style.layout.dataLabels.suffix,r:t.value.table.td.roundingValue})),1)],12,We))),256))],6))),256))])])],2)],512)]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,ye))}},Qe=ve._export_sfc(Je,[["__scopeId","data-v-ba280e32"]]);exports.default=Qe;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { useCssVars as Me, computed as h, ref as p, watch as be, onMounted as Se, openBlock as s, createElementBlock as n, normalizeClass as U, normalizeStyle as m, createBlock as Y, createCommentVNode as c, unref as i, createSlots as Ne, withCtx as k, renderSlot as x, normalizeProps as j, guardReactiveProps as W, Fragment as A, renderList as S, createElementVNode as u, toDisplayString as f, createVNode as me, withKeys as Oe, createTextVNode as Fe, nextTick as Ve } from "vue";
|
|
2
|
-
import { u as Pe, o as Ie, e as xe, c as le, t as Be, L as Re, g as Ee, M as ae, X as Ge, F as oe, i as F, f as N, v as z, x as Xe, y as He, q as De, r as Ue } from "./index-
|
|
3
|
-
import { _ as Ye } from "./Title-
|
|
4
|
-
import { u as je, U as We } from "./usePrinter-
|
|
5
|
-
import { _ as qe } from "./Tooltip-
|
|
6
|
-
import Ke from "./vue-ui-skeleton-
|
|
7
|
-
import Je from "./BaseIcon-
|
|
8
|
-
import Qe from "./vue-ui-accordion-
|
|
9
|
-
import { u as we } from "./useNestedProp-
|
|
2
|
+
import { u as Pe, o as Ie, e as xe, c as le, t as Be, L as Re, g as Ee, M as ae, X as Ge, F as oe, i as F, f as N, v as z, x as Xe, y as He, q as De, r as Ue } from "./index-DQl1TFXa.js";
|
|
3
|
+
import { _ as Ye } from "./Title-DlBwa3-X.js";
|
|
4
|
+
import { u as je, U as We } from "./usePrinter-DgKGVvJC.js";
|
|
5
|
+
import { _ as qe } from "./Tooltip-w32n-8sY.js";
|
|
6
|
+
import Ke from "./vue-ui-skeleton-BVJGmYjj.js";
|
|
7
|
+
import Je from "./BaseIcon-BMfi5PnL.js";
|
|
8
|
+
import Qe from "./vue-ui-accordion-CroZrm7T.js";
|
|
9
|
+
import { u as we } from "./useNestedProp-lmeFt-ev.js";
|
|
10
10
|
import { _ as Ze } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
11
11
|
const et = ["id"], tt = {
|
|
12
12
|
key: 0,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { computed as N, watch as p, ref as C, onMounted as D, openBlock as i, createElementBlock as s, normalizeClass as v, normalizeStyle as u, createElementVNode as $, renderSlot as n, createTextVNode as y, toDisplayString as k, createVNode as S, Fragment as x, unref as h } from "vue";
|
|
2
|
-
import { u as z } from "./useNestedProp-
|
|
3
|
-
import { u as A, i as w, f as B } from "./index-
|
|
4
|
-
import L from "./vue-ui-digits-
|
|
2
|
+
import { u as z } from "./useNestedProp-lmeFt-ev.js";
|
|
3
|
+
import { u as A, i as w, f as B } from "./index-DQl1TFXa.js";
|
|
4
|
+
import L from "./vue-ui-digits-DN6CRpXc.js";
|
|
5
5
|
const T = {
|
|
6
6
|
__name: "vue-ui-kpi",
|
|
7
7
|
props: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),g=require("./useNestedProp-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),g=require("./useNestedProp-DlCe_zZz.cjs"),u=require("./index-B8EMsnjU.cjs"),p=require("./vue-ui-digits-3Q6uZCzD.cjs"),y={__name:"vue-ui-kpi",props:{config:{type:Object,default(){return{}}},dataset:{type:Number,default:0}},setup(n){const o=n,{vue_ui_kpi:m}=u.useConfig(),e=a.computed({get:()=>i(),set:t=>t});function i(){return g.useNestedProp({userConfig:o.config,defaultConfig:m})}a.watch(()=>o.config,t=>{e.value=i(),r()},{deep:!0});const f=a.ref((typeof o.dataset=="number",o.dataset)),l=a.ref(e.value.useAnimation?e.value.animationValueStart:f.value),s=t=>{const v=e.value.animationFrames,c=Math.abs(t-l.value)/v;function d(){l.value<t?l.value=Math.min(l.value+c,t):l.value>t&&(l.value=Math.max(l.value-c,t)),l.value!==t&&requestAnimationFrame(d)}d()};a.onMounted(()=>{r()});function r(){e.value.useAnimation?(l.value=e.value.animationValueStart,s(o.dataset)):l.value=o.dataset}return a.watch(()=>o.dataset,t=>{e.value.useAnimation?s(t):l.value=t}),(t,v)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(`vue-ui-kpi ${e.value.layoutClass}`),style:a.normalizeStyle(`background:${e.value.backgroundColor}; ${e.value.layoutCss}`)},[a.createElementVNode("div",{class:a.normalizeClass(`vue-ui-kpi-title ${e.value.titleClass}`),style:a.normalizeStyle(`font-family: ${e.value.fontFamily}; font-size:${e.value.titleFontSize}px; color:${e.value.titleColor}; font-weight:${e.value.titleBold?"bold":"normal"}; ${e.value.titleCss}`)},[a.renderSlot(t.$slots,"title",{comment:n.dataset}),a.createTextVNode(" "+a.toDisplayString(e.value.title),1)],6),a.renderSlot(t.$slots,"comment-before",{comment:n.dataset}),a.createElementVNode("div",{class:a.normalizeClass(`vue-ui-kpi-value ${e.value.valueClass}`),style:a.normalizeStyle(`font-family: ${e.value.fontFamily}; font-size:${e.value.valueFontSize}px; color:${e.value.valueColor}; font-weight:${e.value.valueBold?"bold":"normal"}; ${e.value.valueCss}`)},[a.renderSlot(t.$slots,"value",{comment:n.dataset}),e.value.analogDigits.show?(a.openBlock(),a.createElementBlock("div",{key:0,style:a.normalizeStyle({height:e.value.analogDigits.height+"px"})},[a.createVNode(p.default,{dataset:Number(l.value.toFixed(e.value.valueRounding)),config:{backgroundColor:e.value.backgroundColor,digits:{color:e.value.analogDigits.color,skeletonColor:e.value.analogDigits.skeletonColor}}},null,8,["dataset","config"])],4)):(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[a.createTextVNode(a.toDisplayString(a.unref(u.applyDataLabel)(e.value.formatter,l.value,a.unref(u.dataLabel)({p:e.value.prefix,v:l.value,s:e.value.suffix,r:e.value.valueRounding}))),1)],64))],6),a.renderSlot(t.$slots,"comment-after",{comment:n.dataset})],6))}};exports.default=y;
|