vue-data-ui 2.3.88 → 2.3.89
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-kIoRmLea.js → Arrow-6DWnAEHt.js} +1 -1
- package/dist/{Arrow-CaBSHqw3.cjs → Arrow-CW5gDSmt.cjs} +1 -1
- package/dist/{BaseIcon-B2zEAYL0.cjs → BaseIcon-B_MrASni.cjs} +1 -1
- package/dist/{BaseIcon-dAh8thfs.js → BaseIcon-Dj8EbAXm.js} +1 -1
- package/dist/{DataTable-BLGE-au6.js → DataTable-BmYcdJ1w.js} +2 -2
- package/dist/{DataTable-DEvCstuA.cjs → DataTable-DAwK5x3h.cjs} +1 -1
- package/dist/{Legend-BAZwLtW5.js → Legend-BRG8ddDy.js} +1 -1
- package/dist/{Legend-D9oHmbQR.cjs → Legend-DhQ-a1RH.cjs} +1 -1
- package/dist/{Shape-Bw52scDY.js → Shape-BcL3EDZ5.js} +1 -1
- package/dist/{Shape-yv-533z4.cjs → Shape-D7jva0XA.cjs} +1 -1
- package/dist/{Slicer-eP9UH3h4.js → Slicer-DI1kgq9D.js} +2 -2
- package/dist/{Slicer-CnyR7m1m.cjs → Slicer-DV29nclP.cjs} +1 -1
- package/dist/{Title-BOtOowG-.cjs → Title-DYwo_Q5b.cjs} +1 -1
- package/dist/{Title-vxOwL9mI.js → Title-fAvrqioZ.js} +1 -1
- package/dist/{Tooltip-B25UdCt3.cjs → Tooltip-03RvVGln.cjs} +1 -1
- package/dist/{Tooltip-FDQ6j0dy.js → Tooltip-TZYYFvPe.js} +1 -1
- package/dist/img-BFCs759q.cjs +1 -0
- package/dist/img-DGzWcJ4Y.js +15 -0
- package/dist/{index-BzFQHG8B.cjs → index-BKTciLz4.cjs} +1 -1
- package/dist/{index-Bkzd7TEp.js → index-Ca4RHJ4t.js} +1 -1
- package/dist/pdf-9cRTLjY8.cjs +1 -0
- package/dist/{pdf-97UbtKC2.js → pdf-B7oVat64.js} +7 -7
- package/dist/style.css +1 -1
- package/dist/{useNestedProp-BU19Uk2G.cjs → useNestedProp-BFnXnY0k.cjs} +1 -1
- package/dist/{useNestedProp-BjKkGjnV.js → useNestedProp-vP7uimPz.js} +1 -1
- package/dist/{usePrinter-BO99ut-7.js → usePrinter-5fwXghqP.js} +155 -156
- package/dist/usePrinter-CxYg-Dw-.cjs +1 -0
- package/dist/{vue-data-ui-9X87OiUw.js → vue-data-ui-4VG00HFR.js} +57 -57
- package/dist/{vue-data-ui-C4vMufw3.cjs → vue-data-ui-BaLkNH7M.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-BQs0ss6E.js → vue-ui-3d-bar-DPJWcxqV.js} +7 -7
- package/dist/{vue-ui-3d-bar-DW_P_GEm.cjs → vue-ui-3d-bar-rOT9iPsm.cjs} +1 -1
- package/dist/{vue-ui-accordion-D9rDPTxC.cjs → vue-ui-accordion-SXHdW20_.cjs} +1 -1
- package/dist/{vue-ui-accordion-Dq8PnOQI.js → vue-ui-accordion-vYoYjedX.js} +3 -3
- package/dist/{vue-ui-age-pyramid-BtQBOmuj.js → vue-ui-age-pyramid-BEC4SHLl.js} +8 -8
- package/dist/{vue-ui-age-pyramid-w1cHqmfP.cjs → vue-ui-age-pyramid-HElID9Ax.cjs} +1 -1
- package/dist/{vue-ui-annotator-DN8dHbpa.cjs → vue-ui-annotator-B1NZRuJJ.cjs} +1 -1
- package/dist/{vue-ui-annotator-yL2aaXSM.js → vue-ui-annotator-DFpv61wn.js} +1 -1
- package/dist/{vue-ui-candlestick-DvI-paAZ.js → vue-ui-candlestick-AEKT8X3p.js} +9 -9
- package/dist/{vue-ui-candlestick-Bb3gE99L.cjs → vue-ui-candlestick-p1s0Av21.cjs} +1 -1
- package/dist/{vue-ui-carousel-table-DrnpUyMB.cjs → vue-ui-carousel-table-DCk2p-1k.cjs} +1 -1
- package/dist/{vue-ui-carousel-table-CFOGiUYF.js → vue-ui-carousel-table-DhzVxOvp.js} +4 -4
- package/dist/{vue-ui-chestnut--s6irU0q.cjs → vue-ui-chestnut-oFfB3fBF.cjs} +1 -1
- package/dist/{vue-ui-chestnut-BsAh9hFC.js → vue-ui-chestnut-qqcIpMGB.js} +6 -6
- package/dist/{vue-ui-cursor-C4ReYD2O.js → vue-ui-cursor-CgSghVjL.js} +2 -2
- package/dist/{vue-ui-cursor-B-XJpQPg.cjs → vue-ui-cursor-CvJgJk1M.cjs} +1 -1
- package/dist/{vue-ui-dashboard-B9vNbg0W.js → vue-ui-dashboard-CYzkic0X.js} +3 -3
- package/dist/vue-ui-dashboard-CtJdVmtu.cjs +1 -0
- package/dist/{vue-ui-digits-BWo3eCH7.js → vue-ui-digits-BO1hSjoq.js} +2 -2
- package/dist/{vue-ui-digits-DMXN0q7k.cjs → vue-ui-digits-C0dMG-hR.cjs} +1 -1
- package/dist/{vue-ui-donut-Cel6UjXl.js → vue-ui-donut-DP-yxiw3.js} +9 -9
- package/dist/{vue-ui-donut-B0iDrljg.cjs → vue-ui-donut-Dnnoj71c.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-daM3GjWu.js → vue-ui-donut-evolution-C-yDyglF.js} +9 -9
- package/dist/{vue-ui-donut-evolution-D94iUNlt.cjs → vue-ui-donut-evolution-vBUH5VVx.cjs} +1 -1
- package/dist/{vue-ui-dumbbell-AimehlIj.cjs → vue-ui-dumbbell-BUA_uSse.cjs} +1 -1
- package/dist/{vue-ui-dumbbell-DY_AhNS1.js → vue-ui-dumbbell-D2SQ4cKV.js} +8 -8
- package/dist/{vue-ui-flow-BhnVwgW5.cjs → vue-ui-flow-B-AFlw-n.cjs} +1 -1
- package/dist/{vue-ui-flow-DHemHIqr.js → vue-ui-flow-D_E9V2A1.js} +7 -7
- package/dist/{vue-ui-galaxy-DlS-pSHI.cjs → vue-ui-galaxy-CbL5nONj.cjs} +1 -1
- package/dist/{vue-ui-galaxy-D8uc51fE.js → vue-ui-galaxy-DqE2UiA3.js} +9 -9
- package/dist/{vue-ui-gauge-DkgiaTIQ.cjs → vue-ui-gauge-BUV_hQND.cjs} +1 -1
- package/dist/{vue-ui-gauge-BDP3AbQP.js → vue-ui-gauge-CFYXDw2p.js} +5 -5
- package/dist/{vue-ui-gizmo-d48XB9Y7.cjs → vue-ui-gizmo-B-LxuvDh.cjs} +1 -1
- package/dist/{vue-ui-gizmo-Bw-drsvJ.js → vue-ui-gizmo-BWztIJ3j.js} +2 -2
- package/dist/{vue-ui-heatmap-qXivxpXK.cjs → vue-ui-heatmap-DW5StHKM.cjs} +1 -1
- package/dist/{vue-ui-heatmap-D6rhUBIv.js → vue-ui-heatmap-E1MlhSCs.js} +8 -8
- package/dist/{vue-ui-kpi-DYtYBfVS.cjs → vue-ui-kpi-BWDPF-9X.cjs} +1 -1
- package/dist/{vue-ui-kpi-CaJNQu-7.js → vue-ui-kpi-DeP0XmP7.js} +3 -3
- package/dist/{vue-ui-mini-loader-C8WE9mmc.js → vue-ui-mini-loader-Bal12IrX.js} +2 -2
- package/dist/{vue-ui-mini-loader-Bd3n8Eh7.cjs → vue-ui-mini-loader-D5e8uW_d.cjs} +1 -1
- package/dist/{vue-ui-molecule-DCOIE2Oz.cjs → vue-ui-molecule-DHBId4h4.cjs} +1 -1
- package/dist/{vue-ui-molecule-BJ78cyz2.js → vue-ui-molecule-DHrHeQgF.js} +9 -9
- package/dist/{vue-ui-mood-radar-xc7ZIj7B.cjs → vue-ui-mood-radar-DSXB9l99.cjs} +1 -1
- package/dist/{vue-ui-mood-radar-BcKbxhUb.js → vue-ui-mood-radar-dJaJotNf.js} +9 -9
- package/dist/{vue-ui-nested-donuts-DmqrKtK-.js → vue-ui-nested-donuts--K9ygdH3.js} +9 -9
- package/dist/{vue-ui-nested-donuts-1AnFMRQE.cjs → vue-ui-nested-donuts-CEX2cvop.cjs} +1 -1
- package/dist/{vue-ui-onion-B7-Luph_.js → vue-ui-onion-Bm1inM56.js} +9 -9
- package/dist/{vue-ui-onion-B-CQQFDn.cjs → vue-ui-onion-Iekdjs8b.cjs} +1 -1
- package/dist/{vue-ui-parallel-coordinate-plot-Cl2fIY0h.js → vue-ui-parallel-coordinate-plot-9PSGD-LR.js} +10 -10
- package/dist/{vue-ui-parallel-coordinate-plot-Cg7rXYJl.cjs → vue-ui-parallel-coordinate-plot-OlFoYL_3.cjs} +1 -1
- package/dist/{vue-ui-quadrant-DzqQM8zj.cjs → vue-ui-quadrant-CgJeo2zZ.cjs} +1 -1
- package/dist/{vue-ui-quadrant-BMRu5C6_.js → vue-ui-quadrant-iGQbx93I.js} +10 -10
- package/dist/{vue-ui-quick-chart-bdjkTZCJ.js → vue-ui-quick-chart-DeEQcx6A.js} +7 -7
- package/dist/{vue-ui-quick-chart-D6Y5lQZz.cjs → vue-ui-quick-chart-Du8lDPmh.cjs} +1 -1
- package/dist/{vue-ui-radar-CmIznCHB.cjs → vue-ui-radar-BYk9DWnM.cjs} +1 -1
- package/dist/{vue-ui-radar-DUBmmYCM.js → vue-ui-radar-DfnhsNQV.js} +10 -10
- package/dist/{vue-ui-rating-vn6QGQ1T.js → vue-ui-rating-CCesFD6e.js} +2 -2
- package/dist/{vue-ui-rating-D353kmjW.cjs → vue-ui-rating-D0rgVdkT.cjs} +1 -1
- package/dist/{vue-ui-relation-circle-Dd_nf_ni.cjs → vue-ui-relation-circle-8eoBav4O.cjs} +1 -1
- package/dist/{vue-ui-relation-circle-Enjx6oV8.js → vue-ui-relation-circle-D2GXm_Fk.js} +5 -5
- package/dist/{vue-ui-rings-D3n403nM.js → vue-ui-rings-B7_-G3JM.js} +9 -9
- package/dist/{vue-ui-rings-BggXdDcB.cjs → vue-ui-rings-CScmcQ1n.cjs} +1 -1
- package/dist/{vue-ui-scatter-C5kTB_at.cjs → vue-ui-scatter-BnBI8qdt.cjs} +1 -1
- package/dist/{vue-ui-scatter-D8gjIVvT.js → vue-ui-scatter-DdhiNjLc.js} +10 -10
- package/dist/{vue-ui-screenshot-BOtri9ZP.cjs → vue-ui-screenshot-BrhjnTwn.cjs} +1 -1
- package/dist/{vue-ui-screenshot-BOtaOWHH.js → vue-ui-screenshot-Cpy2qbf1.js} +1 -1
- package/dist/{vue-ui-skeleton-B1pWkVPT.js → vue-ui-skeleton-D7aLznpP.js} +2 -2
- package/dist/{vue-ui-skeleton-B_ed6BaF.cjs → vue-ui-skeleton-pDeQ3NcD.cjs} +1 -1
- package/dist/{vue-ui-smiley-BHwhptXa.cjs → vue-ui-smiley-Cj0yi7_H.cjs} +1 -1
- package/dist/{vue-ui-smiley-Fx2vCfWl.js → vue-ui-smiley-vcpYARLj.js} +2 -2
- package/dist/{vue-ui-spark-trend-DYeF_f9D.cjs → vue-ui-spark-trend-BW8k0jDd.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-BbGJLy6v.js → vue-ui-spark-trend-CFJSCQnf.js} +4 -4
- package/dist/{vue-ui-sparkbar-waCPID8a.cjs → vue-ui-sparkbar-BbJHfAQj.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-D4zOXsmw.js → vue-ui-sparkbar-CgRdDfk6.js} +3 -3
- package/dist/{vue-ui-sparkgauge-ByLoId02.cjs → vue-ui-sparkgauge-BESRB8_4.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-CrOeVBM6.js → vue-ui-sparkgauge-CCPMNge0.js} +3 -3
- package/dist/{vue-ui-sparkhistogram-Du-8Djku.cjs → vue-ui-sparkhistogram-BYnSfLdb.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram-m8HxSpNJ.js → vue-ui-sparkhistogram-D5z2Wtpk.js} +4 -4
- package/dist/{vue-ui-sparkline-Ccq4xp69.cjs → vue-ui-sparkline-D5WUy4p5.cjs} +1 -1
- package/dist/{vue-ui-sparkline-KMDtu_Z0.js → vue-ui-sparkline-KYN0oKt1.js} +3 -3
- package/dist/{vue-ui-sparkstackbar-D3YWcJ_H.js → vue-ui-sparkstackbar-7lurD9-4.js} +80 -77
- package/dist/vue-ui-sparkstackbar-Dy-IfQ3q.cjs +1 -0
- package/dist/{vue-ui-stackbar-DlfuJps0.cjs → vue-ui-stackbar-Ch-fmE9l.cjs} +1 -1
- package/dist/{vue-ui-stackbar-D6oKKqGM.js → vue-ui-stackbar-CsVmAvl3.js} +10 -10
- package/dist/{vue-ui-strip-plot-BbAVQ73Y.js → vue-ui-strip-plot-B63AgKts.js} +9 -9
- package/dist/{vue-ui-strip-plot-CtJyMV8c.cjs → vue-ui-strip-plot-BLRl-tF6.cjs} +1 -1
- package/dist/{vue-ui-table-C3fDr-79.js → vue-ui-table-G5O8K-F_.js} +1 -1
- package/dist/{vue-ui-table-B1feGzci.cjs → vue-ui-table-hPqdMR-m.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-DTTq642Y.cjs → vue-ui-table-heatmap-BhVuTdSS.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-Bs11u_Bn.js → vue-ui-table-heatmap-t9Ngijvp.js} +4 -4
- package/dist/{vue-ui-table-sparkline-BmnqHZCN.js → vue-ui-table-sparkline-BX4en1c-.js} +5 -5
- package/dist/{vue-ui-table-sparkline-C9v0ZCRY.cjs → vue-ui-table-sparkline-DtjJrGve.cjs} +1 -1
- package/dist/{vue-ui-thermometer-DH4J5XrN.cjs → vue-ui-thermometer-B07RI9fZ.cjs} +1 -1
- package/dist/{vue-ui-thermometer-BF0EfLSS.js → vue-ui-thermometer-BWGyDQ7_.js} +5 -5
- package/dist/{vue-ui-timer-Dex5u9Ug.js → vue-ui-timer-8AlVLAJi.js} +4 -4
- package/dist/{vue-ui-timer-BoF6_mg_.cjs → vue-ui-timer-CXrENAVg.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-DEhFA_QA.cjs → vue-ui-tiremarks-C43c4_IR.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-i2bIrejU.js → vue-ui-tiremarks-DYIHGkBU.js} +5 -5
- package/dist/{vue-ui-treemap-BXfhAmfw.cjs → vue-ui-treemap-BN90ISQv.cjs} +1 -1
- package/dist/{vue-ui-treemap-CkHKUr9H.js → vue-ui-treemap-mmvdTHiX.js} +9 -9
- package/dist/{vue-ui-vertical-bar-Co4Vz7W1.cjs → vue-ui-vertical-bar-BRDO_Rsu.cjs} +1 -1
- package/dist/{vue-ui-vertical-bar-Ui-eKo2G.js → vue-ui-vertical-bar-DAKHNRoR.js} +9 -9
- package/dist/{vue-ui-waffle-IjZAL-JJ.js → vue-ui-waffle-B-A4NYNd.js} +9 -9
- package/dist/{vue-ui-waffle-DJIU32yG.cjs → vue-ui-waffle-BN_yZEtJ.cjs} +1 -1
- package/dist/{vue-ui-wheel-WTP6VSQg.cjs → vue-ui-wheel-50_zeiIW.cjs} +1 -1
- package/dist/{vue-ui-wheel-CEyocXra.js → vue-ui-wheel-DN9WvA6Z.js} +5 -5
- package/dist/{vue-ui-word-cloud-Cg-5NUED.cjs → vue-ui-word-cloud-BVoFIb_q.cjs} +1 -1
- package/dist/{vue-ui-word-cloud-CanNB33d.js → vue-ui-word-cloud-BWTyaGAT.js} +7 -7
- package/dist/vue-ui-xy-CJHHesUD.cjs +3 -0
- package/dist/{vue-ui-xy-Ea4QdEJG.js → vue-ui-xy-Dzp4qCjk.js} +769 -762
- package/dist/{vue-ui-xy-canvas-CtYuW5vo.js → vue-ui-xy-canvas-9NPbm7dE.js} +10 -10
- package/dist/{vue-ui-xy-canvas-DQCerSdP.cjs → vue-ui-xy-canvas-CAcTkk_r.cjs} +1 -1
- package/package.json +1 -1
- package/dist/pdf-Cz3729tZ.cjs +0 -1
- package/dist/usePrinter-BY2kEF_E.cjs +0 -1
- package/dist/vue-ui-dashboard-DRPAfzVQ.cjs +0 -1
- package/dist/vue-ui-sparkstackbar-BbG_IuZ6.cjs +0 -1
- package/dist/vue-ui-xy-B5Wip8Yp.cjs +0 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
import { u as
|
|
3
|
-
import { u as
|
|
4
|
-
import oe from "./vue-ui-skeleton-
|
|
1
|
+
import { computed as f, ref as k, watch as E, onMounted as X, openBlock as n, createElementBlock as u, normalizeStyle as g, createElementVNode as c, toDisplayString as _, createCommentVNode as y, unref as b, Fragment as D, renderList as P, normalizeClass as N, createBlock as W } from "vue";
|
|
2
|
+
import { u as J, c as I, t as K, a as Q, p as i, d as C, b as R, o as Y, e as U, g as Z, f as O, X as ee, s as te, w as le, i as ae } from "./index-Ca4RHJ4t.js";
|
|
3
|
+
import { u as V } from "./useNestedProp-vP7uimPz.js";
|
|
4
|
+
import oe from "./vue-ui-skeleton-D7aLznpP.js";
|
|
5
5
|
import { _ as se } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
6
|
const ne = ["xmlns", "viewBox"], re = ["id"], ue = ["stop-color"], ie = ["stop-color"], ce = ["stop-color"], de = {
|
|
7
7
|
id: "stackPill",
|
|
@@ -23,58 +23,58 @@ const ne = ["xmlns", "viewBox"], re = ["id"], ue = ["stop-color"], ie = ["stop-c
|
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
emits: ["selectDatapoint"],
|
|
26
|
-
setup(
|
|
27
|
-
const r =
|
|
28
|
-
get: () =>
|
|
26
|
+
setup(G, { emit: M }) {
|
|
27
|
+
const r = G, { vue_ui_sparkstackbar: T } = J(), z = f(() => !!r.dataset && r.dataset.length), A = k(I()), e = f({
|
|
28
|
+
get: () => L(),
|
|
29
29
|
set: (t) => t
|
|
30
30
|
});
|
|
31
|
-
function
|
|
32
|
-
const t =
|
|
31
|
+
function L() {
|
|
32
|
+
const t = V({
|
|
33
33
|
userConfig: r.config,
|
|
34
|
-
defaultConfig:
|
|
34
|
+
defaultConfig: T
|
|
35
35
|
});
|
|
36
36
|
return t.theme ? {
|
|
37
|
-
...
|
|
38
|
-
userConfig:
|
|
37
|
+
...V({
|
|
38
|
+
userConfig: K.vue_ui_sparkstackbar[t.theme] || r.config,
|
|
39
39
|
defaultConfig: t
|
|
40
40
|
}),
|
|
41
|
-
customPalette:
|
|
41
|
+
customPalette: Q[t.theme] || i
|
|
42
42
|
} : t;
|
|
43
43
|
}
|
|
44
|
-
|
|
45
|
-
e.value =
|
|
46
|
-
}, { deep: !0 }),
|
|
47
|
-
|
|
44
|
+
E(() => r.config, (t) => {
|
|
45
|
+
e.value = L(), B();
|
|
46
|
+
}, { deep: !0 }), E(() => r.dataset, (t) => {
|
|
47
|
+
p.value = r.dataset.map((a, l) => ({
|
|
48
48
|
...a,
|
|
49
|
-
color: a.color ?
|
|
49
|
+
color: a.color ? C(a.color) : x.value[l] || i[l] || i[l % i.length]
|
|
50
50
|
}));
|
|
51
51
|
}, { deep: !0 });
|
|
52
|
-
const
|
|
52
|
+
const x = f(() => R(e.value.customPalette)), p = k(r.dataset.map((t, a) => ({
|
|
53
53
|
...t,
|
|
54
54
|
value: e.value.style.animation.show ? 0 : t.value || 0,
|
|
55
|
-
color: t.color ?
|
|
56
|
-
}))),
|
|
55
|
+
color: t.color ? C(t.color) : x.value[a] || i[a] || i[a % i.length]
|
|
56
|
+
}))), w = k(!0);
|
|
57
57
|
X(() => {
|
|
58
|
-
if (
|
|
59
|
-
let
|
|
60
|
-
o += l / t, o < l ? (
|
|
58
|
+
if (B(), e.value.style.animation.show) {
|
|
59
|
+
let h = function() {
|
|
60
|
+
o += l / t, o < l ? (p.value = p.value.map((s, d) => ({
|
|
61
61
|
...s,
|
|
62
62
|
value: s.value += a[d],
|
|
63
|
-
color: s.color ?
|
|
64
|
-
})), requestAnimationFrame(
|
|
63
|
+
color: s.color ? C(s.color) : x.value[d] || i[d] || i[d % i.length]
|
|
64
|
+
})), requestAnimationFrame(h)) : (w.value = !1, p.value = r.dataset.map((s, d) => ({
|
|
65
65
|
...s,
|
|
66
66
|
value: s.value || 0,
|
|
67
|
-
color: s.color ?
|
|
68
|
-
id:
|
|
67
|
+
color: s.color ? C(s.color) : x.value[d] || i[d] || i[d % i.length],
|
|
68
|
+
id: I()
|
|
69
69
|
})));
|
|
70
70
|
};
|
|
71
71
|
const t = e.value.style.animation.animationFrames, a = r.dataset.map((s, d) => s.value / t), l = r.dataset.map((s) => s.value || 0).reduce((s, d) => s + d, 0);
|
|
72
72
|
let o = 0;
|
|
73
|
-
|
|
73
|
+
w.value = !0, h();
|
|
74
74
|
}
|
|
75
75
|
});
|
|
76
|
-
function
|
|
77
|
-
Y(r.dataset) ?
|
|
76
|
+
function B() {
|
|
77
|
+
Y(r.dataset) ? U({
|
|
78
78
|
componentName: "VueUiSparkStackbar",
|
|
79
79
|
type: "dataset"
|
|
80
80
|
}) : r.dataset.forEach((t, a) => {
|
|
@@ -82,7 +82,7 @@ const ne = ["xmlns", "viewBox"], re = ["id"], ue = ["stop-color"], ie = ["stop-c
|
|
|
82
82
|
datasetObject: t,
|
|
83
83
|
requiredAttributes: ["name", "value"]
|
|
84
84
|
}).forEach((l) => {
|
|
85
|
-
|
|
85
|
+
U({
|
|
86
86
|
componentName: "VueUiSparkStackbar",
|
|
87
87
|
type: "datasetSerieAttribute",
|
|
88
88
|
property: l,
|
|
@@ -91,24 +91,27 @@ const ne = ["xmlns", "viewBox"], re = ["id"], ue = ["stop-color"], ie = ["stop-c
|
|
|
91
91
|
});
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
|
-
const
|
|
94
|
+
const m = k({
|
|
95
95
|
width: 500,
|
|
96
96
|
height: 16
|
|
97
|
-
}), v =
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
97
|
+
}), v = k([]), q = f(() => r.dataset.map((t) => t.value || 0).filter((t, a) => !v.value.includes(a)).reduce((t, a) => t + a, 0)), F = f(() => p.value.map((t, a) => {
|
|
98
|
+
const l = t.value || 0, o = l / q.value, h = isNaN(o) ? 0 : o, s = h * m.value.width;
|
|
99
|
+
return {
|
|
100
|
+
...t,
|
|
101
|
+
value: l,
|
|
102
|
+
proportion: h,
|
|
103
|
+
width: s || m.value.width / p.value.length,
|
|
104
|
+
proportionLabel: O({
|
|
105
|
+
v: h * 100,
|
|
106
|
+
s: "%",
|
|
107
|
+
r: e.value.style.legend.percentage.rounding
|
|
108
|
+
})
|
|
109
|
+
};
|
|
110
|
+
})), $ = f(() => F.value.filter((t, a) => !v.value.includes(a)));
|
|
108
111
|
function H(t) {
|
|
109
|
-
v.value.includes(t) ? v.value = v.value.filter((a) => a !== t) : v.value.length <
|
|
112
|
+
v.value.includes(t) ? v.value = v.value.filter((a) => a !== t) : v.value.length < p.value.length - 1 && v.value.push(t);
|
|
110
113
|
}
|
|
111
|
-
const S =
|
|
114
|
+
const S = f(() => {
|
|
112
115
|
let t = 0;
|
|
113
116
|
const a = [];
|
|
114
117
|
for (let l = 0; l < $.value.length; l += 1)
|
|
@@ -118,8 +121,8 @@ const ne = ["xmlns", "viewBox"], re = ["id"], ue = ["stop-color"], ie = ["stop-c
|
|
|
118
121
|
}), t += $.value[l].width;
|
|
119
122
|
return a;
|
|
120
123
|
});
|
|
121
|
-
function
|
|
122
|
-
|
|
124
|
+
function j(t, a) {
|
|
125
|
+
M("selectDatapoint", { datapoint: t, index: a });
|
|
123
126
|
}
|
|
124
127
|
return (t, a) => (n(), u("div", {
|
|
125
128
|
style: g(`width:100%; background:${e.value.style.backgroundColor}`)
|
|
@@ -130,23 +133,23 @@ const ne = ["xmlns", "viewBox"], re = ["id"], ue = ["stop-color"], ie = ["stop-c
|
|
|
130
133
|
}, [
|
|
131
134
|
c("div", {
|
|
132
135
|
style: g(`font-size:${e.value.style.title.fontSize}px;color:${e.value.style.title.color};font-weight:${e.value.style.title.bold ? "bold" : "normal"}`)
|
|
133
|
-
},
|
|
136
|
+
}, _(e.value.style.title.text), 5),
|
|
134
137
|
e.value.style.title.subtitle.text ? (n(), u("div", {
|
|
135
138
|
key: 0,
|
|
136
139
|
style: g(`font-size:${e.value.style.title.subtitle.fontSize}px;color:${e.value.style.title.subtitle.color};font-weight:${e.value.style.title.subtitle.bold ? "bold" : "normal"}`)
|
|
137
|
-
},
|
|
138
|
-
], 4)) :
|
|
139
|
-
|
|
140
|
+
}, _(e.value.style.title.subtitle.text), 5)) : y("", !0)
|
|
141
|
+
], 4)) : y("", !0),
|
|
142
|
+
z.value ? (n(), u("svg", {
|
|
140
143
|
key: 1,
|
|
141
|
-
xmlns:
|
|
144
|
+
xmlns: b(ee),
|
|
142
145
|
width: "100%",
|
|
143
|
-
viewBox: `0 0 ${
|
|
146
|
+
viewBox: `0 0 ${m.value.width} ${m.value.height}`
|
|
144
147
|
}, [
|
|
145
148
|
c("defs", null, [
|
|
146
|
-
(n(!0), u(
|
|
149
|
+
(n(!0), u(D, null, P(S.value, (l, o) => (n(), u("linearGradient", {
|
|
147
150
|
key: `stack_gradient_${o}`,
|
|
148
151
|
gradientTransform: "rotate(90)",
|
|
149
|
-
id: `stack_gradient_${o}_${
|
|
152
|
+
id: `stack_gradient_${o}_${A.value}`
|
|
150
153
|
}, [
|
|
151
154
|
c("stop", {
|
|
152
155
|
offset: "0%",
|
|
@@ -154,7 +157,7 @@ const ne = ["xmlns", "viewBox"], re = ["id"], ue = ["stop-color"], ie = ["stop-c
|
|
|
154
157
|
}, null, 8, ue),
|
|
155
158
|
c("stop", {
|
|
156
159
|
offset: "50%",
|
|
157
|
-
"stop-color":
|
|
160
|
+
"stop-color": b(te)(b(le)(l.color, 0.05), 100 - e.value.style.bar.gradient.intensity)
|
|
158
161
|
}, null, 8, ie),
|
|
159
162
|
c("stop", {
|
|
160
163
|
offset: "100%",
|
|
@@ -177,26 +180,26 @@ const ne = ["xmlns", "viewBox"], re = ["id"], ue = ["stop-color"], ie = ["stop-c
|
|
|
177
180
|
c("rect", {
|
|
178
181
|
x: 0,
|
|
179
182
|
y: 0,
|
|
180
|
-
height:
|
|
183
|
+
height: m.value.height,
|
|
181
184
|
width: S.value.map((l) => l.width).reduce((l, o) => l + o, 0),
|
|
182
185
|
fill: e.value.style.bar.gradient.underlayerColor,
|
|
183
|
-
class:
|
|
186
|
+
class: N({ animated: !w.value })
|
|
184
187
|
}, null, 10, pe),
|
|
185
|
-
(n(!0), u(
|
|
188
|
+
(n(!0), u(D, null, P(S.value, (l, o) => (n(), u("rect", {
|
|
186
189
|
key: `stack_${o}`,
|
|
187
|
-
onClick: () =>
|
|
190
|
+
onClick: () => j(l, o),
|
|
188
191
|
x: l.start,
|
|
189
192
|
y: 0,
|
|
190
193
|
width: l.width,
|
|
191
|
-
height:
|
|
192
|
-
fill: e.value.style.bar.gradient.show ? `url(#stack_gradient_${o}_${
|
|
194
|
+
height: m.value.height,
|
|
195
|
+
fill: e.value.style.bar.gradient.show ? `url(#stack_gradient_${o}_${A.value})` : l.color,
|
|
193
196
|
stroke: e.value.style.backgroundColor,
|
|
194
197
|
"stroke-linecap": "round",
|
|
195
|
-
class:
|
|
198
|
+
class: N({ animated: !w.value })
|
|
196
199
|
}, null, 10, he))), 128))
|
|
197
200
|
])
|
|
198
|
-
], 8, ne)) :
|
|
199
|
-
|
|
201
|
+
], 8, ne)) : y("", !0),
|
|
202
|
+
z.value ? y("", !0) : (n(), W(oe, {
|
|
200
203
|
key: 2,
|
|
201
204
|
config: {
|
|
202
205
|
type: "sparkStackbar",
|
|
@@ -213,11 +216,11 @@ const ne = ["xmlns", "viewBox"], re = ["id"], ue = ["stop-color"], ie = ["stop-c
|
|
|
213
216
|
style: g(`background:transparent;margin:0 auto;margin:${e.value.style.legend.margin};justify-content:${e.value.style.legend.textAlign === "left" ? "flex-start" : e.value.style.legend.textAlign === "right" ? "flex-end" : "center"}`),
|
|
214
217
|
class: "vue-ui-sparkstackbar-legend"
|
|
215
218
|
}, [
|
|
216
|
-
(n(!0), u(
|
|
219
|
+
(n(!0), u(D, null, P(F.value, (l, o) => (n(), u("div", {
|
|
217
220
|
style: g(`font-size:${e.value.style.legend.fontSize}px;`),
|
|
218
|
-
class:
|
|
219
|
-
onClick: (
|
|
220
|
-
H(o),
|
|
221
|
+
class: N({ "vue-ui-sparkstackbar-legend-item": !0, "vue-ui-sparkstackbar-legend-item-unselected": v.value.includes(o) }),
|
|
222
|
+
onClick: (h) => {
|
|
223
|
+
H(o), j(l, o);
|
|
221
224
|
}
|
|
222
225
|
}, [
|
|
223
226
|
c("div", ye, [
|
|
@@ -235,31 +238,31 @@ const ne = ["xmlns", "viewBox"], re = ["id"], ue = ["stop-color"], ie = ["stop-c
|
|
|
235
238
|
], 8, me)),
|
|
236
239
|
c("span", {
|
|
237
240
|
style: g(`color:${e.value.style.legend.name.color}; font-weight:${e.value.style.legend.name.bold ? "bold" : "normal"}`)
|
|
238
|
-
},
|
|
241
|
+
}, _(l.name), 5),
|
|
239
242
|
e.value.style.legend.percentage.show ? (n(), u("span", {
|
|
240
243
|
key: 0,
|
|
241
244
|
style: g(`font-weight:${e.value.style.legend.percentage.bold ? "bold" : "normal"};color:${e.value.style.legend.percentage.color}`)
|
|
242
|
-
},
|
|
245
|
+
}, _(v.value.includes(o) ? " - " : l.proportionLabel), 5)) : y("", !0),
|
|
243
246
|
e.value.style.legend.value.show ? (n(), u("span", {
|
|
244
247
|
key: 1,
|
|
245
248
|
style: g(`font-weight:${e.value.style.legend.value.bold ? "bold" : "normal"};color:${e.value.style.legend.value.color}`)
|
|
246
|
-
}, " (" +
|
|
249
|
+
}, " (" + _(b(ae)(
|
|
247
250
|
e.value.style.legend.value.formatter,
|
|
248
251
|
l.value,
|
|
249
|
-
|
|
252
|
+
b(O)({
|
|
250
253
|
p: e.value.style.legend.value.prefix,
|
|
251
254
|
v: l.value,
|
|
252
255
|
s: e.value.style.legend.value.suffix,
|
|
253
256
|
r: e.value.style.legend.value.rounding
|
|
254
257
|
}),
|
|
255
258
|
{ datapoint: l, seriesIndex: o }
|
|
256
|
-
)) + ") ", 5)) :
|
|
259
|
+
)) + ") ", 5)) : y("", !0)
|
|
257
260
|
])
|
|
258
261
|
], 14, fe))), 256))
|
|
259
|
-
], 4)) :
|
|
262
|
+
], 4)) : y("", !0)
|
|
260
263
|
], 4));
|
|
261
264
|
}
|
|
262
|
-
}, Se = /* @__PURE__ */ se(_e, [["__scopeId", "data-v-
|
|
265
|
+
}, Se = /* @__PURE__ */ se(_e, [["__scopeId", "data-v-5b2aebbd"]]);
|
|
263
266
|
export {
|
|
264
267
|
Se as default
|
|
265
268
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-BKTciLz4.cjs"),w=require("./useNestedProp-BFnXnY0k.cjs"),V=require("./vue-ui-skeleton-pDeQ3NcD.cjs"),z=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),D=["xmlns","viewBox"],P=["id"],L=["stop-color"],A=["stop-color"],F=["stop-color"],U={id:"stackPill",clipPathUnits:"objectBoundingBox"},j=["fill"],q={"clip-path":"url(#stackPill)"},T=["height","width","fill"],H=["onClick","x","width","height","fill","stroke"],I=["onClick"],O={style:{display:"flex","flex-direction":"row","align-items":"center",gap:"4px","justify-content":"center"}},M=["height","width"],G=["fill"],W={__name:"vue-ui-sparkstackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(B,{emit:S}){const u=B,{vue_ui_sparkstackbar:E}=o.useConfig(),f=e.computed(()=>!!u.dataset&&u.dataset.length),k=e.ref(o.createUid()),t=e.computed({get:()=>_(),set:l=>l});function _(){const l=w.useNestedProp({userConfig:u.config,defaultConfig:E});return l.theme?{...w.useNestedProp({userConfig:o.themes.vue_ui_sparkstackbar[l.theme]||u.config,defaultConfig:l}),customPalette:o.themePalettes[l.theme]||o.palette}:l}e.watch(()=>u.config,l=>{t.value=_(),b()},{deep:!0}),e.watch(()=>u.dataset,l=>{d.value=u.dataset.map((n,a)=>({...n,color:n.color?o.convertColorToHex(n.color):m.value[a]||o.palette[a]||o.palette[a%o.palette.length]}))},{deep:!0});const m=e.computed(()=>o.convertCustomPalette(t.value.customPalette)),d=e.ref(u.dataset.map((l,n)=>({...l,value:t.value.style.animation.show?0:l.value||0,color:l.color?o.convertColorToHex(l.color):m.value[n]||o.palette[n]||o.palette[n%o.palette.length]}))),g=e.ref(!0);e.onMounted(()=>{if(b(),t.value.style.animation.show){let p=function(){r+=a/l,r<a?(d.value=d.value.map((s,i)=>({...s,value:s.value+=n[i],color:s.color?o.convertColorToHex(s.color):m.value[i]||o.palette[i]||o.palette[i%o.palette.length]})),requestAnimationFrame(p)):(g.value=!1,d.value=u.dataset.map((s,i)=>({...s,value:s.value||0,color:s.color?o.convertColorToHex(s.color):m.value[i]||o.palette[i]||o.palette[i%o.palette.length],id:o.createUid()})))};const l=t.value.style.animation.animationFrames,n=u.dataset.map((s,i)=>s.value/l),a=u.dataset.map(s=>s.value||0).reduce((s,i)=>s+i,0);let r=0;g.value=!0,p()}});function b(){o.objectIsEmpty(u.dataset)?o.error({componentName:"VueUiSparkStackbar",type:"dataset"}):u.dataset.forEach((l,n)=>{o.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","value"]}).forEach(a=>{o.error({componentName:"VueUiSparkStackbar",type:"datasetSerieAttribute",property:a,index:n})})})}const v=e.ref({width:500,height:16}),c=e.ref([]),N=e.computed(()=>u.dataset.map(l=>l.value||0).filter((l,n)=>!c.value.includes(n)).reduce((l,n)=>l+n,0)),C=e.computed(()=>d.value.map((l,n)=>{const a=l.value||0,r=a/N.value,p=isNaN(r)?0:r,s=p*v.value.width;return{...l,value:a,proportion:p,width:s||v.value.width/d.value.length,proportionLabel:o.dataLabel({v:p*100,s:"%",r:t.value.style.legend.percentage.rounding})}})),y=e.computed(()=>C.value.filter((l,n)=>!c.value.includes(n)));function $(l){c.value.includes(l)?c.value=c.value.filter(n=>n!==l):c.value.length<d.value.length-1&&c.value.push(l)}const h=e.computed(()=>{let l=0;const n=[];for(let a=0;a<y.value.length;a+=1)n.push({...y.value[a],start:l}),l+=y.value[a].width;return n});function x(l,n){S("selectDatapoint",{datapoint:l,index:n})}return(l,n)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`width:100%; background:${t.value.style.backgroundColor}`)},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:calc(100% - 12px);background:transparent;margin:0 auto;margin:${t.value.style.title.margin};padding: 0 6px;text-align:${t.value.style.title.textAlign}`)},[e.createElementVNode("div",{style:e.normalizeStyle(`font-size:${t.value.style.title.fontSize}px;color:${t.value.style.title.color};font-weight:${t.value.style.title.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.text),5),t.value.style.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`font-size:${t.value.style.title.subtitle.fontSize}px;color:${t.value.style.title.subtitle.color};font-weight:${t.value.style.title.subtitle.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.subtitle.text),5)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(o.XMLNS),width:"100%",viewBox:`0 0 ${v.value.width} ${v.value.height}`},[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(a,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{key:`stack_gradient_${r}`,gradientTransform:"rotate(90)",id:`stack_gradient_${r}_${k.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":a.color},null,8,L),e.createElementVNode("stop",{offset:"50%","stop-color":e.unref(o.setOpacity)(e.unref(o.shiftHue)(a.color,.05),100-t.value.style.bar.gradient.intensity)},null,8,A),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,F)],8,P))),128)),e.createElementVNode("clipPath",U,[e.createElementVNode("rect",{x:"0.005",y:"-2",width:"0.99",height:"5",rx:"3",ry:"3",fill:t.value.style.backgroundColor},null,8,j)])]),e.createElementVNode("g",q,[e.createElementVNode("rect",{x:0,y:0,height:v.value.height,width:h.value.map(a=>a.width).reduce((a,r)=>a+r,0),fill:t.value.style.bar.gradient.underlayerColor,class:e.normalizeClass({animated:!g.value})},null,10,T),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_${r}`,onClick:()=>x(a,r),x:a.start,y:0,width:a.width,height:v.value.height,fill:t.value.style.bar.gradient.show?`url(#stack_gradient_${r}_${k.value})`:a.color,stroke:t.value.style.backgroundColor,"stroke-linecap":"round",class:e.normalizeClass({animated:!g.value})},null,10,H))),128))])],8,D)):e.createCommentVNode("",!0),f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(V.default,{key:2,config:{type:"sparkStackbar",style:{backgroundColor:t.value.style.backgroundColor,sparkStackbar:{color:"#CCCCCC"}}}},null,8,["config"])),t.value.style.legend.show?(e.openBlock(),e.createElementBlock("div",{key:3,style:e.normalizeStyle(`background:transparent;margin:0 auto;margin:${t.value.style.legend.margin};justify-content:${t.value.style.legend.textAlign==="left"?"flex-start":t.value.style.legend.textAlign==="right"?"flex-end":"center"}`),class:"vue-ui-sparkstackbar-legend"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,(a,r)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`font-size:${t.value.style.legend.fontSize}px;`),class:e.normalizeClass({"vue-ui-sparkstackbar-legend-item":!0,"vue-ui-sparkstackbar-legend-item-unselected":c.value.includes(r)}),onClick:p=>{$(r),x(a,r)}},[e.createElementVNode("div",O,[(e.openBlock(),e.createElementBlock("svg",{height:`${t.value.style.legend.fontSize}px`,width:`${t.value.style.legend.fontSize}px`,viewBox:"0 0 10 10"},[e.createElementVNode("circle",{cx:5,cy:5,r:5,fill:a.color},null,8,G)],8,M)),e.createElementVNode("span",{style:e.normalizeStyle(`color:${t.value.style.legend.name.color}; font-weight:${t.value.style.legend.name.bold?"bold":"normal"}`)},e.toDisplayString(a.name),5),t.value.style.legend.percentage.show?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(`font-weight:${t.value.style.legend.percentage.bold?"bold":"normal"};color:${t.value.style.legend.percentage.color}`)},e.toDisplayString(c.value.includes(r)?" - ":a.proportionLabel),5)):e.createCommentVNode("",!0),t.value.style.legend.value.show?(e.openBlock(),e.createElementBlock("span",{key:1,style:e.normalizeStyle(`font-weight:${t.value.style.legend.value.bold?"bold":"normal"};color:${t.value.style.legend.value.color}`)}," ("+e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.legend.value.formatter,a.value,e.unref(o.dataLabel)({p:t.value.style.legend.value.prefix,v:a.value,s:t.value.style.legend.value.suffix,r:t.value.style.legend.value.rounding}),{datapoint:a,seriesIndex:r}))+") ",5)):e.createCommentVNode("",!0)])],14,I))),256))],4)):e.createCommentVNode("",!0)],4))}},X=z._export_sfc(W,[["__scopeId","data-v-5b2aebbd"]]);exports.default=X;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),c=require("./index-BzFQHG8B.cjs"),we=require("./useNestedProp-BU19Uk2G.cjs"),Ce=require("./useResponsive-B3TrDDIG.cjs"),Be=require("./usePrinter-BY2kEF_E.cjs"),We=require("./Slicer-CnyR7m1m.cjs"),Ue=require("./Tooltip-B25UdCt3.cjs"),Xe=require("./Title-BOtOowG-.cjs"),Ye=require("./Legend-D9oHmbQR.cjs"),Ge=require("./vue-ui-accordion-D9rDPTxC.cjs"),Je=require("./DataTable-DEvCstuA.cjs"),Ze=require("./vue-ui-skeleton-B_ed6BaF.cjs"),Ke=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Qe=["id"],je=["xmlns","viewBox"],et={key:0},tt=["id"],at=["stop-color"],lt=["stop-color"],ot=["stop-color"],rt=["x1","x2","y1","y2","stroke"],st=["x1","x2","y1","y2","stroke"],nt=["x1","x2","y1","y2","stroke"],it=["x1","x2","y1","y2","stroke"],ut=["x","y","height","rx","width","fill","stroke","stroke-width"],ct=["x","y","width","rx","height","fill","stroke","stroke-width"],dt=["x1","x2","y1","y2","stroke","stroke-width"],vt=["x1","x2","y1","y2","stroke","stroke-width"],ht=["x","y","font-size","fill","font-weight"],gt=["transform","font-size","fill","font-weight"],yt=["x","y","font-size","fill","font-weight"],mt={key:0},bt=["x","y","font-size","font-weight","fill"],pt=["x","y","font-size","fill","font-weight"],ft={key:0},kt=["x","y","font-size","font-weight","fill"],xt=["x1","x2","y1","y2","stroke"],wt=["x","y","font-size","font-weight","fill"],Ct=["x1","x2","y1","y2","stroke"],Bt=["font-size","font-weight","fill","text-anchor","transform"],Lt=["text-anchor","font-size","font-weight","fill","transform"],St=["font-size","font-weight","fill","x","y"],zt=["x","y","width","height","onClick","onMouseenter","fill"],_t=["x","y","width","height","onClick","onMouseenter","fill"],Nt={key:3,class:"vue-data-ui-watermark"},Et=["onClick"],Mt=["innerHTML"],$t={__name:"vue-ui-stackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint","selectLegend"],setup(G,{expose:Le,emit:J}){const y=G,{vue_ui_stackbar:Se}=c.useConfig(),E=e.computed({get(){return!!y.dataset&&y.dataset.length},set(l){return l}}),M=e.ref(null),W=e.ref(c.createUid()),O=e.ref(!1),Z=e.ref(null),U=e.ref(""),p=e.ref([]),K=e.ref(0),Q=e.ref(null),j=e.ref(null),ee=e.ref(null),te=e.ref(0),X=e.ref(!1),$=e.ref(null),T=e.ref(!1),ze=e.ref(0),_e=e.ref(0),Ne=e.ref(0);e.onMounted(()=>{Y()});const t=e.computed({get:()=>ae(),set:l=>l});function ae(){const l=we.useNestedProp({userConfig:y.config,defaultConfig:Se});let r={};return l.theme?r={...we.useNestedProp({userConfig:c.themes.vue_ui_stackbar[l.theme]||y.config,defaultConfig:l}),customPalette:c.themePalettes[l.theme]||c.palette}:r=l,y.config&&c.hasDeepProperty(y.config,"style.chart.grid.scale.scaleMin")?r.style.chart.grid.scale.scaleMin=y.config.style.chart.grid.scale.scaleMin:r.style.chart.grid.scale.scaleMin=null,y.config&&c.hasDeepProperty(y.config,"style.chart.grid.scale.scaleMax")?r.style.chart.grid.scale.scaleMax=y.config.style.chart.grid.scale.scaleMax:r.style.chart.grid.scale.scaleMax=null,r}e.watch(()=>y.config,l=>{t.value=ae(),Y(),ze.value+=1,_e.value+=1,Ne.value+=1},{deep:!0}),e.watch(()=>y.dataset,l=>{ue()},{deep:!0});const b=e.ref({dataLabels:{show:t.value.style.chart.bars.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),{isPrinting:le,isImaging:oe,generatePdf:re,generateImage:se}=Be.usePrinter({elementId:`stackbar_${W.value}`,fileName:t.value.style.chart.title.text||"vue-ui-stackbar"}),D=e.ref({width:t.value.style.chart.width,height:t.value.style.chart.height,paddingRatio:{top:t.value.style.chart.padding.top/t.value.style.chart.height,right:t.value.style.chart.padding.right/t.value.style.chart.width,bottom:t.value.style.chart.padding.bottom/t.value.style.chart.height,left:t.value.style.chart.padding.left/t.value.style.chart.width}}),Ee=e.computed(()=>c.convertCustomPalette(t.value.customPalette)),ne=e.ref(null),ie=e.ref(null);e.onMounted(()=>{Y()});function Y(){if(c.objectIsEmpty(y.dataset)?c.error({componentName:"VueUiStackbar",type:"dataset"}):y.dataset.forEach((l,r)=>{c.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","series"]}).forEach(a=>{E.value=!1,c.error({componentName:"VueUiStackbar",type:"datasetSerieAttribute",property:a,index:r})})}),setTimeout(()=>{T.value=!0},10),t.value.responsive){const l=Ce.throttle(()=>{T.value=!1;const{width:r,height:a}=Ce.useResponsive({chart:M.value,title:t.value.style.chart.title.text?Q.value:null,legend:t.value.style.chart.legend.show?j.value:null,slicer:t.value.style.chart.zoom.show&&L.value>1?ee.value:null});D.value.width=r,D.value.height=a,clearTimeout(ie.value),ie.value=setTimeout(()=>{T.value=!0},10)});ne.value=new ResizeObserver(l),ne.value.observe(M.value.parentNode)}}const s=e.computed(()=>{const{height:l,width:r}=D.value,{right:a}=D.value.paddingRatio,o=t.value.style.chart.padding.top,n=r-r*a,i=l-t.value.style.chart.padding.bottom,m=t.value.style.chart.padding.left,S=r-m-r*a,z=l-o-t.value.style.chart.padding.bottom;return{chartHeight:l,chartWidth:r,top:o,right:n,bottom:i,left:m,width:S,height:z<0?0:z}}),B=e.computed(()=>y.dataset.map((l,r)=>{const a=c.convertColorToHex(l.color)||Ee.value[r]||c.palette[r]||c.palette[r%c.palette.length];return{...l,series:JSON.parse(JSON.stringify(l.series)).map(o=>t.value.style.chart.bars.distributed?Math.abs(o):o),signedSeries:l.series.map(o=>o>=0?1:-1),absoluteIndex:r,id:c.createUid(),color:a}})),L=e.computed(()=>Math.max(...B.value.filter(l=>!p.value.includes(l.id)).map(l=>l.series.length))),u=e.ref({start:0,end:Math.max(...y.dataset.map(l=>l.series.length))});function ue(){u.value={start:0,end:Math.max(...y.dataset.map(l=>l.series.length))},te.value+=1}const d=e.computed(()=>{let l;return t.value.orientation==="vertical"?l=s.value.width/(u.value.end-u.value.start):l=s.value.height/(u.value.end-u.value.start),l<=0?0:l}),V=e.computed(()=>c.sumSeries(B.value.filter(l=>!p.value.includes(l.id))).slice(u.value.start,u.value.end)),Me=e.computed(()=>c.sumSeries(B.value.filter(l=>!p.value.includes(l.id)).map(l=>({...l,series:l.series.map((r,a)=>l.signedSeries[a]===-1&&r>=0?-r:r)}))).slice(u.value.start,u.value.end)),I=e.computed(()=>{const l=B.value.filter(r=>!p.value.includes(r.id));return{positive:c.sumSeries(l.map(r=>({...r,series:r.series.slice(u.value.start,u.value.end).map(a=>a>=0?a:0)}))),negative:c.sumSeries(l.map(r=>({...r,series:r.series.slice(u.value.start,u.value.end).map(a=>a<0?a:0)})))}}),w=e.computed(()=>{const l=t.value.style.chart.grid.scale.scaleMax!==null&&!t.value.style.chart.bars.distributed?t.value.style.chart.grid.scale.scaleMax:Math.max(...I.value.positive),r=Math.min(...I.value.negative),a=t.value.style.chart.grid.scale.scaleMin!==null&&!t.value.style.chart.bars.distributed?t.value.style.chart.grid.scale.scaleMin:[-1/0,1/0,NaN,void 0,null].includes(r)?0:r,o=!t.value.style.chart.bars.distributed&&(t.value.style.chart.grid.scale.scaleMax!==null||t.value.style.chart.grid.scale.scaleMin!==null)?c.calculateNiceScaleWithExactExtremes(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks):c.calculateNiceScale(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks);return o.ticks.map(n=>({zero:s.value.bottom-s.value.height*(Math.abs(o.min)/(o.max+Math.abs(o.min))),y:s.value.bottom-s.value.height*((n+Math.abs(o.min))/(o.max+Math.abs(o.min))),x:s.value.left-8,horizontal_zero:s.value.left+s.value.width*(Math.abs(o.min)/(o.max+Math.abs(o.min))),horizontal_x:s.value.left+s.value.width*((n+Math.abs(o.min))/(o.max+Math.abs(o.min))),horizontal_y:s.value.bottom-8,value:n}))}),F=e.computed(()=>t.value.style.chart.grid.x.timeLabels.values.slice(u.value.start,u.value.end)),g=e.computed(()=>{if(!E.value)return[];let l=Array(L.value).fill(0),r=Array(L.value).fill(0),a=Array(L.value).fill(0),o=Array(L.value).fill(0);const n=Math.max(...I.value.positive)||0,i=Math.min(...I.value.negative),m=[-1/0,1/0,NaN,void 0,null].includes(i)?0:i,S=!t.value.style.chart.bars.distributed&&(t.value.style.chart.grid.scale.scaleMax!==null||t.value.style.chart.grid.scale.scaleMin!==null)?c.calculateNiceScaleWithExactExtremes(t.value.style.chart.grid.scale.scaleMin!==null?t.value.style.chart.grid.scale.scaleMin:m>0?0:m,t.value.style.chart.grid.scale.scaleMax!==null?t.value.style.chart.grid.scale.scaleMax:n<0?0:n,t.value.style.chart.grid.scale.ticks):c.calculateNiceScale(t.value.style.chart.grid.scale.scaleMin!==null?t.value.style.chart.grid.scale.scaleMin:m>0?0:m,t.value.style.chart.grid.scale.scaleMax!==null?t.value.style.chart.grid.scale.scaleMax:n<0?0:n,t.value.style.chart.grid.scale.ticks),{min:z,max:P}=S,_=P+(z>=0?0:Math.abs(z))||1,f=s.value.height,q=s.value.width,ke=w.value[0]?w.value[0].zero:s.value.bottom,xe=w.value[0]?w.value[0].horizontal_zero:s.value.left;return B.value.filter(R=>!p.value.includes(R.id)).map(R=>{const C=R.series.slice(u.value.start,u.value.end),Pe=R.signedSeries.slice(u.value.start,u.value.end),Re=C.map((v,h)=>s.value.left+d.value*h+d.value*t.value.style.chart.bars.gapRatio/4),Oe=C.map((v,h)=>s.value.top+d.value*h+d.value*t.value.style.chart.bars.gapRatio/4),De=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;let N,x;return v>0?(x=f*k,N=ke-x-l[h],l[h]+=x):(x=f*k,N=ke+a[h],a[h]+=Math.abs(x)),N}),Ie=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;let N,x;return v>0?(x=q*k,N=xe+r[h],r[h]+=x):(x=q*k,N=xe-Math.abs(x)-o[h],o[h]+=Math.abs(x)),N}),Ae=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;return v>0?f*k:f*Math.abs(k)}),He=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;return v>0?q*k:q*Math.abs(k)}),qe=C.map(v=>Math.abs(v)).reduce((v,h)=>v+h,0);return{...R,proportions:C.map((v,h)=>t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/qe),series:C,signedSeries:Pe,x:Re,y:De,height:Ae,horizontal_width:He,horizontal_y:Oe,horizontal_x:Ie}})}),ce=e.computed(()=>Me.value.map((l,r)=>({value:l,sign:l>=0?1:-1})));function A(l,r,a,o,n){const i=n===-1&&l>=0?-l:l;return c.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,i,c.dataLabel({p:t.value.style.chart.bars.dataLabels.prefix,v:i,s:t.value.style.chart.bars.dataLabels.suffix,r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:r,seriesIndex:a,datapointIndex:o})}function de(l,r,a,o){return c.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,l,c.dataLabel({v:l,s:"%",r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:r,seriesIndex:a,datapointIndex:o})}function ve(l){const r=JSON.parse(JSON.stringify(g.value)).map(a=>({name:a.name,value:a.series[l]===0?0:a.series[l]||null,proportion:a.proportions[l]||null,color:a.color,id:a.id}));J("selectDatapoint",{datapoint:r,period:F.value[l]})}function he(l){$.value=l,O.value=!0;const r=t.value.style.chart.tooltip.customFormat,a=JSON.parse(JSON.stringify(g.value)).map(n=>({name:n.name,value:n.series[l]===0?0:(n.signedSeries[l]===-1&&n.series[l]>=0?-n.series[l]:n.series[l])||null,proportion:n.proportions[l]||null,color:n.color,id:n.id})),o=a.map(n=>Math.abs(n.value)).reduce((n,i)=>n+i,0);if(c.isFunction(r)&&c.functionReturnsString(()=>r({seriesIndex:l,datapoint:a,series:g.value,config:t.value})))U.value=r({seriesIndex:l,datapoint:a,series:g.value,config:t.value});else{const{showValue:n,showPercentage:i,borderColor:m,roundingValue:S,roundingPercentage:z}=t.value.style.chart.tooltip;let P="";F.value[l]&&(P+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${m};padding-bottom:6px;margin-bottom:3px;">${F.value[l]}</div>`);const _=[n&&i?"(":"",n&&i?")":""];a.reverse().forEach(f=>{P+=`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),c=require("./index-BKTciLz4.cjs"),we=require("./useNestedProp-BFnXnY0k.cjs"),Ce=require("./useResponsive-B3TrDDIG.cjs"),Be=require("./usePrinter-CxYg-Dw-.cjs"),We=require("./Slicer-DV29nclP.cjs"),Ue=require("./Tooltip-03RvVGln.cjs"),Xe=require("./Title-DYwo_Q5b.cjs"),Ye=require("./Legend-DhQ-a1RH.cjs"),Ge=require("./vue-ui-accordion-SXHdW20_.cjs"),Je=require("./DataTable-DAwK5x3h.cjs"),Ze=require("./vue-ui-skeleton-pDeQ3NcD.cjs"),Ke=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Qe=["id"],je=["xmlns","viewBox"],et={key:0},tt=["id"],at=["stop-color"],lt=["stop-color"],ot=["stop-color"],rt=["x1","x2","y1","y2","stroke"],st=["x1","x2","y1","y2","stroke"],nt=["x1","x2","y1","y2","stroke"],it=["x1","x2","y1","y2","stroke"],ut=["x","y","height","rx","width","fill","stroke","stroke-width"],ct=["x","y","width","rx","height","fill","stroke","stroke-width"],dt=["x1","x2","y1","y2","stroke","stroke-width"],vt=["x1","x2","y1","y2","stroke","stroke-width"],ht=["x","y","font-size","fill","font-weight"],gt=["transform","font-size","fill","font-weight"],yt=["x","y","font-size","fill","font-weight"],mt={key:0},bt=["x","y","font-size","font-weight","fill"],pt=["x","y","font-size","fill","font-weight"],ft={key:0},kt=["x","y","font-size","font-weight","fill"],xt=["x1","x2","y1","y2","stroke"],wt=["x","y","font-size","font-weight","fill"],Ct=["x1","x2","y1","y2","stroke"],Bt=["font-size","font-weight","fill","text-anchor","transform"],Lt=["text-anchor","font-size","font-weight","fill","transform"],St=["font-size","font-weight","fill","x","y"],zt=["x","y","width","height","onClick","onMouseenter","fill"],_t=["x","y","width","height","onClick","onMouseenter","fill"],Nt={key:3,class:"vue-data-ui-watermark"},Et=["onClick"],Mt=["innerHTML"],$t={__name:"vue-ui-stackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint","selectLegend"],setup(G,{expose:Le,emit:J}){const y=G,{vue_ui_stackbar:Se}=c.useConfig(),E=e.computed({get(){return!!y.dataset&&y.dataset.length},set(l){return l}}),M=e.ref(null),W=e.ref(c.createUid()),O=e.ref(!1),Z=e.ref(null),U=e.ref(""),p=e.ref([]),K=e.ref(0),Q=e.ref(null),j=e.ref(null),ee=e.ref(null),te=e.ref(0),X=e.ref(!1),$=e.ref(null),T=e.ref(!1),ze=e.ref(0),_e=e.ref(0),Ne=e.ref(0);e.onMounted(()=>{Y()});const t=e.computed({get:()=>ae(),set:l=>l});function ae(){const l=we.useNestedProp({userConfig:y.config,defaultConfig:Se});let r={};return l.theme?r={...we.useNestedProp({userConfig:c.themes.vue_ui_stackbar[l.theme]||y.config,defaultConfig:l}),customPalette:c.themePalettes[l.theme]||c.palette}:r=l,y.config&&c.hasDeepProperty(y.config,"style.chart.grid.scale.scaleMin")?r.style.chart.grid.scale.scaleMin=y.config.style.chart.grid.scale.scaleMin:r.style.chart.grid.scale.scaleMin=null,y.config&&c.hasDeepProperty(y.config,"style.chart.grid.scale.scaleMax")?r.style.chart.grid.scale.scaleMax=y.config.style.chart.grid.scale.scaleMax:r.style.chart.grid.scale.scaleMax=null,r}e.watch(()=>y.config,l=>{t.value=ae(),Y(),ze.value+=1,_e.value+=1,Ne.value+=1},{deep:!0}),e.watch(()=>y.dataset,l=>{ue()},{deep:!0});const b=e.ref({dataLabels:{show:t.value.style.chart.bars.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),{isPrinting:le,isImaging:oe,generatePdf:re,generateImage:se}=Be.usePrinter({elementId:`stackbar_${W.value}`,fileName:t.value.style.chart.title.text||"vue-ui-stackbar"}),D=e.ref({width:t.value.style.chart.width,height:t.value.style.chart.height,paddingRatio:{top:t.value.style.chart.padding.top/t.value.style.chart.height,right:t.value.style.chart.padding.right/t.value.style.chart.width,bottom:t.value.style.chart.padding.bottom/t.value.style.chart.height,left:t.value.style.chart.padding.left/t.value.style.chart.width}}),Ee=e.computed(()=>c.convertCustomPalette(t.value.customPalette)),ne=e.ref(null),ie=e.ref(null);e.onMounted(()=>{Y()});function Y(){if(c.objectIsEmpty(y.dataset)?c.error({componentName:"VueUiStackbar",type:"dataset"}):y.dataset.forEach((l,r)=>{c.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","series"]}).forEach(a=>{E.value=!1,c.error({componentName:"VueUiStackbar",type:"datasetSerieAttribute",property:a,index:r})})}),setTimeout(()=>{T.value=!0},10),t.value.responsive){const l=Ce.throttle(()=>{T.value=!1;const{width:r,height:a}=Ce.useResponsive({chart:M.value,title:t.value.style.chart.title.text?Q.value:null,legend:t.value.style.chart.legend.show?j.value:null,slicer:t.value.style.chart.zoom.show&&L.value>1?ee.value:null});D.value.width=r,D.value.height=a,clearTimeout(ie.value),ie.value=setTimeout(()=>{T.value=!0},10)});ne.value=new ResizeObserver(l),ne.value.observe(M.value.parentNode)}}const s=e.computed(()=>{const{height:l,width:r}=D.value,{right:a}=D.value.paddingRatio,o=t.value.style.chart.padding.top,n=r-r*a,i=l-t.value.style.chart.padding.bottom,m=t.value.style.chart.padding.left,S=r-m-r*a,z=l-o-t.value.style.chart.padding.bottom;return{chartHeight:l,chartWidth:r,top:o,right:n,bottom:i,left:m,width:S,height:z<0?0:z}}),B=e.computed(()=>y.dataset.map((l,r)=>{const a=c.convertColorToHex(l.color)||Ee.value[r]||c.palette[r]||c.palette[r%c.palette.length];return{...l,series:JSON.parse(JSON.stringify(l.series)).map(o=>t.value.style.chart.bars.distributed?Math.abs(o):o),signedSeries:l.series.map(o=>o>=0?1:-1),absoluteIndex:r,id:c.createUid(),color:a}})),L=e.computed(()=>Math.max(...B.value.filter(l=>!p.value.includes(l.id)).map(l=>l.series.length))),u=e.ref({start:0,end:Math.max(...y.dataset.map(l=>l.series.length))});function ue(){u.value={start:0,end:Math.max(...y.dataset.map(l=>l.series.length))},te.value+=1}const d=e.computed(()=>{let l;return t.value.orientation==="vertical"?l=s.value.width/(u.value.end-u.value.start):l=s.value.height/(u.value.end-u.value.start),l<=0?0:l}),V=e.computed(()=>c.sumSeries(B.value.filter(l=>!p.value.includes(l.id))).slice(u.value.start,u.value.end)),Me=e.computed(()=>c.sumSeries(B.value.filter(l=>!p.value.includes(l.id)).map(l=>({...l,series:l.series.map((r,a)=>l.signedSeries[a]===-1&&r>=0?-r:r)}))).slice(u.value.start,u.value.end)),I=e.computed(()=>{const l=B.value.filter(r=>!p.value.includes(r.id));return{positive:c.sumSeries(l.map(r=>({...r,series:r.series.slice(u.value.start,u.value.end).map(a=>a>=0?a:0)}))),negative:c.sumSeries(l.map(r=>({...r,series:r.series.slice(u.value.start,u.value.end).map(a=>a<0?a:0)})))}}),w=e.computed(()=>{const l=t.value.style.chart.grid.scale.scaleMax!==null&&!t.value.style.chart.bars.distributed?t.value.style.chart.grid.scale.scaleMax:Math.max(...I.value.positive),r=Math.min(...I.value.negative),a=t.value.style.chart.grid.scale.scaleMin!==null&&!t.value.style.chart.bars.distributed?t.value.style.chart.grid.scale.scaleMin:[-1/0,1/0,NaN,void 0,null].includes(r)?0:r,o=!t.value.style.chart.bars.distributed&&(t.value.style.chart.grid.scale.scaleMax!==null||t.value.style.chart.grid.scale.scaleMin!==null)?c.calculateNiceScaleWithExactExtremes(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks):c.calculateNiceScale(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks);return o.ticks.map(n=>({zero:s.value.bottom-s.value.height*(Math.abs(o.min)/(o.max+Math.abs(o.min))),y:s.value.bottom-s.value.height*((n+Math.abs(o.min))/(o.max+Math.abs(o.min))),x:s.value.left-8,horizontal_zero:s.value.left+s.value.width*(Math.abs(o.min)/(o.max+Math.abs(o.min))),horizontal_x:s.value.left+s.value.width*((n+Math.abs(o.min))/(o.max+Math.abs(o.min))),horizontal_y:s.value.bottom-8,value:n}))}),F=e.computed(()=>t.value.style.chart.grid.x.timeLabels.values.slice(u.value.start,u.value.end)),g=e.computed(()=>{if(!E.value)return[];let l=Array(L.value).fill(0),r=Array(L.value).fill(0),a=Array(L.value).fill(0),o=Array(L.value).fill(0);const n=Math.max(...I.value.positive)||0,i=Math.min(...I.value.negative),m=[-1/0,1/0,NaN,void 0,null].includes(i)?0:i,S=!t.value.style.chart.bars.distributed&&(t.value.style.chart.grid.scale.scaleMax!==null||t.value.style.chart.grid.scale.scaleMin!==null)?c.calculateNiceScaleWithExactExtremes(t.value.style.chart.grid.scale.scaleMin!==null?t.value.style.chart.grid.scale.scaleMin:m>0?0:m,t.value.style.chart.grid.scale.scaleMax!==null?t.value.style.chart.grid.scale.scaleMax:n<0?0:n,t.value.style.chart.grid.scale.ticks):c.calculateNiceScale(t.value.style.chart.grid.scale.scaleMin!==null?t.value.style.chart.grid.scale.scaleMin:m>0?0:m,t.value.style.chart.grid.scale.scaleMax!==null?t.value.style.chart.grid.scale.scaleMax:n<0?0:n,t.value.style.chart.grid.scale.ticks),{min:z,max:P}=S,_=P+(z>=0?0:Math.abs(z))||1,f=s.value.height,q=s.value.width,ke=w.value[0]?w.value[0].zero:s.value.bottom,xe=w.value[0]?w.value[0].horizontal_zero:s.value.left;return B.value.filter(R=>!p.value.includes(R.id)).map(R=>{const C=R.series.slice(u.value.start,u.value.end),Pe=R.signedSeries.slice(u.value.start,u.value.end),Re=C.map((v,h)=>s.value.left+d.value*h+d.value*t.value.style.chart.bars.gapRatio/4),Oe=C.map((v,h)=>s.value.top+d.value*h+d.value*t.value.style.chart.bars.gapRatio/4),De=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;let N,x;return v>0?(x=f*k,N=ke-x-l[h],l[h]+=x):(x=f*k,N=ke+a[h],a[h]+=Math.abs(x)),N}),Ie=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;let N,x;return v>0?(x=q*k,N=xe+r[h],r[h]+=x):(x=q*k,N=xe-Math.abs(x)-o[h],o[h]+=Math.abs(x)),N}),Ae=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;return v>0?f*k:f*Math.abs(k)}),He=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;return v>0?q*k:q*Math.abs(k)}),qe=C.map(v=>Math.abs(v)).reduce((v,h)=>v+h,0);return{...R,proportions:C.map((v,h)=>t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/qe),series:C,signedSeries:Pe,x:Re,y:De,height:Ae,horizontal_width:He,horizontal_y:Oe,horizontal_x:Ie}})}),ce=e.computed(()=>Me.value.map((l,r)=>({value:l,sign:l>=0?1:-1})));function A(l,r,a,o,n){const i=n===-1&&l>=0?-l:l;return c.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,i,c.dataLabel({p:t.value.style.chart.bars.dataLabels.prefix,v:i,s:t.value.style.chart.bars.dataLabels.suffix,r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:r,seriesIndex:a,datapointIndex:o})}function de(l,r,a,o){return c.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,l,c.dataLabel({v:l,s:"%",r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:r,seriesIndex:a,datapointIndex:o})}function ve(l){const r=JSON.parse(JSON.stringify(g.value)).map(a=>({name:a.name,value:a.series[l]===0?0:a.series[l]||null,proportion:a.proportions[l]||null,color:a.color,id:a.id}));J("selectDatapoint",{datapoint:r,period:F.value[l]})}function he(l){$.value=l,O.value=!0;const r=t.value.style.chart.tooltip.customFormat,a=JSON.parse(JSON.stringify(g.value)).map(n=>({name:n.name,value:n.series[l]===0?0:(n.signedSeries[l]===-1&&n.series[l]>=0?-n.series[l]:n.series[l])||null,proportion:n.proportions[l]||null,color:n.color,id:n.id})),o=a.map(n=>Math.abs(n.value)).reduce((n,i)=>n+i,0);if(c.isFunction(r)&&c.functionReturnsString(()=>r({seriesIndex:l,datapoint:a,series:g.value,config:t.value})))U.value=r({seriesIndex:l,datapoint:a,series:g.value,config:t.value});else{const{showValue:n,showPercentage:i,borderColor:m,roundingValue:S,roundingPercentage:z}=t.value.style.chart.tooltip;let P="";F.value[l]&&(P+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${m};padding-bottom:6px;margin-bottom:3px;">${F.value[l]}</div>`);const _=[n&&i?"(":"",n&&i?")":""];a.reverse().forEach(f=>{P+=`
|
|
2
2
|
<div style="display:flex;flex-direction:row;align-items:center;gap:4px">
|
|
3
3
|
<svg viewBox="0 0 12 12" height="14" width="14"><rect rx="1" x="0" y="0" height="12" width="12" stroke="none" fill="${t.value.style.chart.bars.gradient.show?`url(#gradient_${f.id})`:f.color}"/></svg>
|
|
4
4
|
${f.name}${n||i?":":""} ${n?c.dataLabel({p:t.value.style.chart.bars.dataLabels.prefix,v:f.value,s:t.value.style.chart.bars.dataLabels.suffix,r:S}):""} ${_[0]}${i?c.dataLabel({v:isNaN(f.value/o)?0:Math.abs(f.value)/o*100,s:"%",r:z}):""}${_[1]}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { computed as p, ref as b, onMounted as He, watch as Be, openBlock as s, createElementBlock as u, normalizeClass as ve, normalizeStyle as B, renderSlot as C, createVNode as he, createCommentVNode as v, createBlock as Q, unref as _, createSlots as ft, withCtx as z, normalizeProps as W, guardReactiveProps as X, Fragment as h, renderList as f, createElementVNode as D, toDisplayString as S, createTextVNode as mt } from "vue";
|
|
2
|
-
import { u as pt, c as We, t as xt, a as kt, p as oe, L as Xe, b as wt, o as Ct, e as Ue, g as _t, d as zt, a2 as se, _ as Ye, C as Ge, X as Lt, l as St, F as Je, f as E, x as qe, i as Ze, y as Mt, q as $t, r as Tt } from "./index-
|
|
3
|
-
import { u as Ke } from "./useNestedProp-
|
|
2
|
+
import { u as pt, c as We, t as xt, a as kt, p as oe, L as Xe, b as wt, o as Ct, e as Ue, g as _t, d as zt, a2 as se, _ as Ye, C as Ge, X as Lt, l as St, F as Je, f as E, x as qe, i as Ze, y as Mt, q as $t, r as Tt } from "./index-Ca4RHJ4t.js";
|
|
3
|
+
import { u as Ke } from "./useNestedProp-vP7uimPz.js";
|
|
4
4
|
import { t as Nt, u as Ot } from "./useResponsive-NZB-WLRF.js";
|
|
5
|
-
import { u as Pt, U as Rt } from "./usePrinter-
|
|
6
|
-
import { S as It } from "./Slicer-
|
|
7
|
-
import { _ as Ft } from "./Tooltip-
|
|
8
|
-
import { _ as Vt } from "./Title-
|
|
9
|
-
import { L as At } from "./Legend-
|
|
10
|
-
import Dt from "./vue-ui-accordion-
|
|
11
|
-
import { D as Et } from "./DataTable-
|
|
12
|
-
import Ht from "./vue-ui-skeleton-
|
|
5
|
+
import { u as Pt, U as Rt } from "./usePrinter-5fwXghqP.js";
|
|
6
|
+
import { S as It } from "./Slicer-DI1kgq9D.js";
|
|
7
|
+
import { _ as Ft } from "./Tooltip-TZYYFvPe.js";
|
|
8
|
+
import { _ as Vt } from "./Title-fAvrqioZ.js";
|
|
9
|
+
import { L as At } from "./Legend-BRG8ddDy.js";
|
|
10
|
+
import Dt from "./vue-ui-accordion-vYoYjedX.js";
|
|
11
|
+
import { D as Et } from "./DataTable-BmYcdJ1w.js";
|
|
12
|
+
import Ht from "./vue-ui-skeleton-D7aLznpP.js";
|
|
13
13
|
import { _ as Bt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
14
14
|
const Wt = ["id"], Xt = ["xmlns", "viewBox"], Ut = { key: 0 }, Yt = ["id"], Gt = ["stop-color"], Jt = ["stop-color"], qt = ["stop-color"], Zt = ["x1", "x2", "y1", "y2", "stroke"], Kt = ["x1", "x2", "y1", "y2", "stroke"], Qt = ["x1", "x2", "y1", "y2", "stroke"], jt = ["x1", "x2", "y1", "y2", "stroke"], ea = ["x", "y", "height", "rx", "width", "fill", "stroke", "stroke-width"], ta = ["x", "y", "width", "rx", "height", "fill", "stroke", "stroke-width"], aa = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], la = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], ra = ["x", "y", "font-size", "fill", "font-weight"], oa = ["transform", "font-size", "fill", "font-weight"], sa = ["x", "y", "font-size", "fill", "font-weight"], ia = { key: 0 }, ua = ["x", "y", "font-size", "font-weight", "fill"], na = ["x", "y", "font-size", "fill", "font-weight"], ca = { key: 0 }, va = ["x", "y", "font-size", "font-weight", "fill"], ha = ["x1", "x2", "y1", "y2", "stroke"], da = ["x", "y", "font-size", "font-weight", "fill"], ya = ["x1", "x2", "y1", "y2", "stroke"], ga = ["font-size", "font-weight", "fill", "text-anchor", "transform"], ba = ["text-anchor", "font-size", "font-weight", "fill", "transform"], fa = ["font-size", "font-weight", "fill", "x", "y"], ma = ["x", "y", "width", "height", "onClick", "onMouseenter", "fill"], pa = ["x", "y", "width", "height", "onClick", "onMouseenter", "fill"], xa = {
|
|
15
15
|
key: 3,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { computed as p, ref as n, watch as ze, onMounted as Ne, onBeforeUnmount as Ae, openBlock as s, createElementBlock as i, normalizeClass as F, normalizeStyle as q, createBlock as P, createCommentVNode as c, unref as h, createSlots as Oe, withCtx as b, renderSlot as m, normalizeProps as H, guardReactiveProps as R, Fragment as g, renderList as C, createElementVNode as x, toDisplayString as T, mergeProps as Fe, createVNode as We, createTextVNode as Ie, nextTick as Me } from "vue";
|
|
2
|
-
import { u as De, c as K, t as Ge, a as Ee, p as L, o as Ve, e as Q, g as be, b as He, d as me, v as Re, C as Ue, f as U, X as Be, i as Z, l as Xe, h as je, x as ge, y as Ye, q as Je, r as qe, E as Ke } from "./index-
|
|
2
|
+
import { u as De, c as K, t as Ge, a as Ee, p as L, o as Ve, e as Q, g as be, b as He, d as me, v as Re, C as Ue, f as U, X as Be, i as Z, l as Xe, h as je, x as ge, y as Ye, q as Je, r as qe, E as Ke } from "./index-Ca4RHJ4t.js";
|
|
3
3
|
import { t as Qe, u as Ze } from "./useResponsive-NZB-WLRF.js";
|
|
4
|
-
import { _ as et } from "./Title-
|
|
5
|
-
import { u as tt, U as lt } from "./usePrinter-
|
|
6
|
-
import { _ as at } from "./Tooltip-
|
|
7
|
-
import { D as ot } from "./DataTable-
|
|
8
|
-
import st from "./vue-ui-skeleton-
|
|
9
|
-
import { _ as rt } from "./Shape-
|
|
10
|
-
import ut from "./vue-ui-accordion-
|
|
11
|
-
import { u as xe } from "./useNestedProp-
|
|
4
|
+
import { _ as et } from "./Title-fAvrqioZ.js";
|
|
5
|
+
import { u as tt, U as lt } from "./usePrinter-5fwXghqP.js";
|
|
6
|
+
import { _ as at } from "./Tooltip-TZYYFvPe.js";
|
|
7
|
+
import { D as ot } from "./DataTable-BmYcdJ1w.js";
|
|
8
|
+
import st from "./vue-ui-skeleton-D7aLznpP.js";
|
|
9
|
+
import { _ as rt } from "./Shape-BcL3EDZ5.js";
|
|
10
|
+
import ut from "./vue-ui-accordion-vYoYjedX.js";
|
|
11
|
+
import { u as xe } from "./useNestedProp-vP7uimPz.js";
|
|
12
12
|
import { _ as it } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
13
13
|
const nt = ["id"], vt = ["xmlns", "viewBox"], ct = { key: 0 }, ht = { key: 0 }, dt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], pt = { key: 1 }, yt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], ft = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], bt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], mt = ["x", "y", "fill", "font-size"], gt = ["x", "y", "font-size", "fill"], xt = ["fill", "font-size", "transform"], kt = ["fill", "font-size", "x", "y"], Ct = ["x1", "x2", "y1", "y2", "stroke"], wt = ["cx", "cy", "fill"], _t = ["cx", "cy", "fill"], $t = ["id"], Tt = ["stop-color"], Lt = ["stop-color"], St = ["stop-color"], Pt = { key: 0 }, zt = ["x", "y", "font-size", "fill"], Nt = {
|
|
14
14
|
key: 3,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-BzFQHG8B.cjs"),K=require("./useResponsive-B3TrDDIG.cjs"),ie=require("./Title-BOtOowG-.cjs"),Q=require("./usePrinter-BY2kEF_E.cjs"),ce=require("./Tooltip-B25UdCt3.cjs"),ve=require("./DataTable-DEvCstuA.cjs"),de=require("./vue-ui-skeleton-B_ed6BaF.cjs"),he=require("./Shape-yv-533z4.cjs"),pe=require("./vue-ui-accordion-D9rDPTxC.cjs"),Z=require("./useNestedProp-BU19Uk2G.cjs"),me=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),fe=["id"],ye=["xmlns","viewBox"],be={key:0},ge={key:0},ke=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],xe={key:1},Ce=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],we=["x1","x2","y1","y2","stroke","stroke-width"],Be=["x1","x2","y1","y2","stroke","stroke-width"],_e=["x","y","fill","font-size"],Se=["x","y","font-size","fill"],$e=["fill","font-size","transform"],Ne=["fill","font-size","x","y"],Le=["x1","x2","y1","y2","stroke"],Te=["cx","cy","fill"],Pe=["cx","cy","fill"],Ee=["id"],ze=["stop-color"],Ve=["stop-color"],Ae=["stop-color"],Fe={key:0},Oe=["x","y","font-size","fill"],De={key:3,class:"vue-data-ui-watermark"},Me=["innerHTML"],We={__name:"vue-ui-strip-plot",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(ee,{expose:te,emit:le}){const v=ee,{vue_ui_strip_plot:ae}=o.useConfig(),p=e.computed({get(){return!!v.dataset&&v.dataset.length},set(l){return l}}),L=e.ref(o.createUid()),V=e.ref(0),T=e.ref(!1),P=e.ref(""),b=e.ref(null),A=e.ref(null),F=e.ref(!1),O=e.ref(0),D=e.ref(0),t=e.computed({get:()=>M(),set:l=>l});function M(){const l=Z.useNestedProp({userConfig:v.config,defaultConfig:ae});return l.theme?{...Z.useNestedProp({userConfig:o.themes.vue_ui_strip_plot[l.theme]||v.config,defaultConfig:l}),customPalette:o.themePalettes[l.theme]||o.palette}:l}e.watch(()=>v.config,l=>{t.value=M(),W(),O.value+=1,D.value+=1},{deep:!0});const C=e.ref(null);e.onMounted(()=>{W()});function W(){if(o.objectIsEmpty(v.dataset)?o.error({componentName:"VueUiStripPlot",type:"dataset"}):v.dataset.forEach((l,s)=>{o.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","plots"]}).forEach(a=>{p.value=!1,o.error({componentName:"VueUiStripPlot",type:"datasetSerieAttribute",property:a,index:s})}),l.plots&&l.plots.forEach((a,n)=>{o.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["name","value"]}).forEach(u=>{p.value=!1,o.error({componentName:"VueUiStripPlot",type:"datasetSerieAttribute",property:u,index:`${s},${n}`})})})}),t.value.responsive){const l=K.throttle(()=>{const{width:s,height:a}=K.useResponsive({chart:b.value,title:t.value.style.chart.title.text?A.value:null});w.value=a,y.value.width=s,y.value.height=a,k.value=(s-d.value.left-d.value.right)/v.dataset.length,B.value=o.translateSize({relator:Math.min(a,s),adjuster:600,source:t.value.style.chart.plots.radius,threshold:6,fallback:6})});C.value=new ResizeObserver(l),C.value.observe(b.value.parentNode)}F.value=!0,setTimeout(()=>{g.value=!1},oe.value*50)}e.onBeforeUnmount(()=>{C.value&&C.value.disconnect()});const{isPrinting:I,isImaging:G,generatePdf:q,generateImage:R}=Q.usePrinter({elementId:`strip-plot_${L.value}`,fileName:t.value.style.chart.title.text||"vue-ui-strip-plot"}),U=e.computed(()=>o.convertCustomPalette(t.value.customPalette)),g=e.ref(t.value.useCssAnimation),c=e.ref({showTable:t.value.table.show,dataLabels:{show:t.value.style.chart.labels.bestPlotLabel.show},showTooltip:t.value.style.chart.tooltip.show}),d=e.ref({top:t.value.style.chart.padding.top,bottom:t.value.style.chart.padding.bottom,left:t.value.style.chart.padding.left,right:t.value.style.chart.padding.right}),k=e.ref(t.value.style.chart.stripWidth),w=e.ref(t.value.style.chart.height),B=e.ref(t.value.style.chart.plots.radius),y=e.ref({width:k.value*v.dataset.length+d.value.left+d.value.right,height:t.value.style.chart.height}),r=e.computed(()=>{const l=k.value*v.dataset.length+d.value.left+d.value.right;return{left:d.value.left,right:l-d.value.right,top:d.value.top,bottom:w.value-d.value.bottom,width:k.value*v.dataset.length,height:w.value-d.value.top-d.value.bottom,stripWidth:k.value,absoluteHeight:w.value,absoluteWidth:l}}),_=e.computed(()=>p.value?v.dataset.map((l,s)=>{const a=o.createUid();return{...l,id:a,color:l.color?o.convertColorToHex(l.color):U.value[s]||o.palette[s]||o.palette[s%o.palette.length],plots:l.plots.map(n=>({...n,value:o.checkNaN(n.value),parentId:a,color:l.color?o.convertColorToHex(l.color):U.value[s]||o.palette[s]||o.palette[s%o.palette.length],id:o.createUid()})).sort((n,u)=>n.value-u.value)}}):null),h=e.computed(()=>(_.value||[]).map((l,s)=>({...l,plots:l.plots.map(a=>({...a,x:r.value.left+(s+1)*r.value.stripWidth-r.value.stripWidth/2}))}))),oe=e.computed(()=>Math.max(...h.value.map(l=>l.plots.length))),E=e.computed(()=>{const l=h.value.flatMap(s=>s.plots.map(a=>a.value));return{max:Math.max(...l),min:Math.min(...l)}}),m=e.computed(()=>o.calculateNiceScale(E.value.min<0?E.value.min:0,E.value.max,t.value.style.chart.grid.scaleSteps)),re=e.computed(()=>(h.value||[]).map((l,s)=>({...l,plots:l.plots.map(a=>({...a,y:r.value.bottom-(a.value+Math.abs(m.value.min))/(m.value.max+Math.abs(m.value.min))*r.value.height}))}))),H=e.computed(()=>m.value.ticks.map(l=>({y:r.value.bottom-r.value.height*((l+Math.abs(m.value.min))/(m.value.max+Math.abs(m.value.min))),x1:r.value.left,x2:r.value.right,value:l}))),z=e.ref(null),i=e.ref(null);function se({datapoint:l,seriesIndex:s}){z.value={datapoint:l,seriesIndex:s,config:t.value,series:_.value},T.value=!0,i.value=l;const a=t.value.style.chart.tooltip.customFormat;if(o.isFunction(a)&&o.functionReturnsString(()=>a({seriesIndex:s,datapoint:l,series:_.value,config:t.value})))P.value=a({seriesIndex:s,datapoint:l,series:_.value,config:t.value});else{let n="";n+=`<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="${t.value.style.chart.plots.gradient.show?`url(#${l.parentId})`:l.color}"/></svg>${l.name}</div>`,n+=`<div>${o.applyDataLabel(t.value.style.chart.labels.formatter,l.value,o.dataLabel({p:t.value.style.chart.labels.prefix,v:l.value,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:l,seriesIndex:s})}</div>`,P.value=`<div>${n}</div>`}}const S=e.computed(()=>{const l=h.value.flatMap(a=>JSON.parse(JSON.stringify(a.plots)).sort((n,u)=>u.value-n.value).map(n=>({name:`${a.name} - ${n.name}`,color:n.color}))),s=h.value.flatMap(a=>JSON.parse(JSON.stringify(a.plots)).sort((n,u)=>u.value-n.value).map(n=>n.value));return{head:l,body:s}});function j(){e.nextTick(()=>{const l=S.value.head.map((n,u)=>[[n.name],[S.value.body[u]]]),s=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.series],[t.value.table.columnNames.value]]].concat(l),a=o.createCsvContent(s);o.downloadCsv({csvContent:a,title:t.value.style.chart.title.text||"vue-ui-strip-plot"})})}const $=e.computed(()=>{const l=[t.value.table.columnNames.series,t.value.table.columnNames.value],s=S.value.head.map((u,f)=>{const N=o.dataLabel({p:t.value.style.chart.labels.prefix,v:S.value.body[f],s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue});return[{color:u.color,name:u.name},N]}),a={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value],head:l,body:s,config:a}}),x=e.ref(!1);function ne(l){x.value=l,V.value+=1}function ue(){return h.value}function X(){c.value.showTable=!c.value.showTable}function Y(){c.value.dataLabels.show=!c.value.dataLabels.show}function J(){c.value.showTooltip=!c.value.showTooltip}return te({getData:ue,generatePdf:q,generateCsv:j,generateImage:R,toggleTable:X,toggleLabels:Y,toggleTooltip:J}),(l,s)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"stripPlotChart",ref:b,class:e.normalizeClass(`vue-ui-strip-plot ${x.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};${t.value.responsive?"height:100%":""}`),id:`strip-plot_${L.value}`},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:A,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(ie._sfc_main,{key:`title_${O.value}`,config:{title:{cy:"donut-div-title",...t.value.style.chart.title},subtitle:{cy:"donut-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&p.value?(e.openBlock(),e.createBlock(Q.UserOptions,{ref:"details",key:`user_option_${V.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(I),isImaging:e.unref(G),uid:L.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,hasLabel:t.value.userOptions.buttons.labels,hasFullscreen:t.value.userOptions.buttons.fullscreen,isTooltip:c.value.showTooltip,isFullscreen:x.value,titles:{...t.value.userOptions.buttonTitles},chartElement:b.value,position:t.value.userOptions.position,onToggleFullscreen:ne,onGeneratePdf:e.unref(q),onGenerateCsv:j,onGenerateImage:e.unref(R),onToggleTable:X,onToggleLabels:Y,onToggleTooltip:J},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.optionLabels?{name:"optionLabels",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionLabels",{},void 0,!0)]),key:"5"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:n})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:n})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasLabel","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","position","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(o.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":x.value,"vue-data-ui-fulscreen--off":!x.value}),viewBox:`0 0 ${y.value.width<=0?10:y.value.width} ${y.value.height<=0?10:y.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color};`)},[t.value.style.chart.grid.show?(e.openBlock(),e.createElementBlock("g",be,[t.value.style.chart.grid.horizontalGrid.show?(e.openBlock(),e.createElementBlock("g",ge,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.value,a=>(e.openBlock(),e.createElementBlock("line",{x1:a.x1,x2:a.x2,y1:a.y,y2:a.y,stroke:t.value.style.chart.grid.horizontalGrid.stroke,"stroke-width":t.value.style.chart.grid.horizontalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.horizontalGrid.strokeDasharray,"stroke-linecap":"round"},null,8,ke))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.verticalGrid.show?(e.openBlock(),e.createElementBlock("g",xe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(a,n)=>(e.openBlock(),e.createElementBlock("line",{x1:r.value.left+(n+1)*r.value.stripWidth,x2:r.value.left+(n+1)*r.value.stripWidth,y1:r.value.top,y2:r.value.bottom,stroke:t.value.style.chart.grid.verticalGrid.stroke,"stroke-width":t.value.style.chart.grid.verticalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.verticalGrid.strokeDasharray,"stroke-linecap":"round"},null,8,Ce))),256))])):e.createCommentVNode("",!0),e.createElementVNode("line",{x1:r.value.left,x2:r.value.left,y1:r.value.top,y2:r.value.bottom,stroke:t.value.style.chart.grid.stroke,"stroke-width":t.value.style.chart.grid.strokeWidth,"stroke-linecap":"round"},null,8,we),e.createElementVNode("line",{x1:r.value.left,x2:r.value.right,y1:r.value.bottom,y2:r.value.bottom,stroke:t.value.style.chart.grid.stroke,"stroke-width":t.value.style.chart.grid.strokeWidth,"stroke-linecap":"round"},null,8,Be)])):e.createCommentVNode("",!0),t.value.style.chart.labels.yAxisLabels.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(H.value,(a,n)=>(e.openBlock(),e.createElementBlock("text",{x:a.x1-t.value.style.chart.labels.yAxisLabels.fontSize/2+t.value.style.chart.labels.yAxisLabels.offsetX,y:a.y+t.value.style.chart.labels.yAxisLabels.fontSize/3,fill:t.value.style.chart.labels.yAxisLabels.color,"font-size":t.value.style.chart.labels.yAxisLabels.fontSize,"text-anchor":"end"},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.chart.labels.formatter,a.value,e.unref(o.dataLabel)({p:t.value.style.chart.labels.prefix,v:a.value,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.labels.yAxisLabels.rounding}),{datapoint:a,seriesIndex:n})),9,_e))),256)):e.createCommentVNode("",!0),t.value.style.chart.labels.xAxisLabels.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(h.value,(a,n)=>(e.openBlock(),e.createElementBlock("text",{x:r.value.left+(n+1)*r.value.stripWidth-r.value.stripWidth/2,y:r.value.bottom+t.value.style.chart.labels.xAxisLabels.fontSize*2+t.value.style.chart.labels.xAxisLabels.offsetY,"font-size":t.value.style.chart.labels.xAxisLabels.fontSize,fill:t.value.style.chart.labels.xAxisLabels.color,"text-anchor":"middle"},e.toDisplayString(a.name),9,Se))),256)):e.createCommentVNode("",!0),t.value.style.chart.labels.axis.yLabel?(e.openBlock(),e.createElementBlock("text",{key:3,fill:t.value.style.chart.labels.axis.color,"font-size":t.value.style.chart.labels.axis.fontSize,transform:`translate(${t.value.style.chart.labels.axis.fontSize+t.value.style.chart.labels.axis.yLabelOffsetX}, ${r.value.top+r.value.height/2}) rotate(-90)`,"text-anchor":"middle"},e.toDisplayString(t.value.style.chart.labels.axis.yLabel),9,$e)):e.createCommentVNode("",!0),t.value.style.chart.labels.axis.xLabel?(e.openBlock(),e.createElementBlock("text",{key:4,fill:t.value.style.chart.labels.axis.color,"font-size":t.value.style.chart.labels.axis.fontSize,x:r.value.left+r.value.width/2,y:r.value.absoluteHeight,"text-anchor":"middle"},e.toDisplayString(t.value.style.chart.labels.axis.xLabel),9,Ne)):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[e.createElementVNode("line",{x1:r.value.left,x2:r.value.right,y1:i.value.y,y2:i.value.y,stroke:i.value.color,"stroke-width":1,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,Le),e.createElementVNode("circle",{cx:r.value.left,cy:i.value.y,r:3,fill:i.value.color,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,Te),e.createElementVNode("circle",{cx:r.value.right,cy:i.value.y,r:3,fill:i.value.color,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,Pe)],64)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,a=>(e.openBlock(),e.createElementBlock("radialGradient",{id:a.id,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(o.lightenHexColor)(a.color,t.value.style.chart.plots.gradient.intensity/100)},null,8,ze),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(o.darkenHexColor)(a.color,.1)},null,8,Ve),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,Ae)],8,Ee))),256))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(re.value,(a,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.plots,(u,f)=>(e.openBlock(),e.createBlock(he._sfc_main,e.mergeProps({plot:{x:u.x,y:F.value?u.y:r.value.top},radius:i.value&&i.value.id===u.id?B.value*1.5:B.value,shape:t.value.style.chart.plots.shape,stroke:t.value.style.chart.plots.stroke,strokeWidth:t.value.style.chart.plots.strokeWidth,color:t.value.style.chart.plots.gradient.show?`url(#${a.id})`:a.color,onMouseenter:N=>se({datapoint:u,seriesIndex:f}),onMouseleave:s[0]||(s[0]=N=>{T.value=!1,i.value=null}),onClick:N=>le("selectDatapoint",u),style:`transition: all 0.2s ease-in-out; opacity:${i.value?i.value.id===u.id?1:.2:t.value.style.chart.plots.opacity};${g.value?`transition-delay:${f*50}ms`:""}`,class:{"vue-ui-strip-plot-animated":t.value.useCssAnimation&&g.value,"vue-ui-strip-plot-select-circle":t.value.useCssAnimation&&!g.value}},l.$attrs),null,16,["plot","radius","shape","stroke","strokeWidth","color","onMouseenter","onClick","style","class"]))),256)),c.value.dataLabels.show?(e.openBlock(),e.createElementBlock("g",Fe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.plots,(u,f)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[f===a.plots.length-1||i.value&&i.value.id===u.id&&!c.value.showTooltip?(e.openBlock(),e.createElementBlock("text",{key:0,x:u.x,y:u.y+t.value.style.chart.labels.bestPlotLabel.offsetY-B.value*(i.value&&i.value.id===u.id&&!c.value.showTooltip?2:1.5),"font-size":t.value.style.chart.labels.bestPlotLabel.fontSize,fill:t.value.style.chart.labels.bestPlotLabel.color,"text-anchor":"middle",style:e.normalizeStyle(`opacity:${t.value.useCssAnimation&&g.value?0:1};transition:opacity 0.2s ease-in;`)},e.toDisplayString(u.name)+" "+e.toDisplayString(t.value.style.chart.labels.bestPlotLabel.showValue?e.unref(o.applyDataLabel)(t.value.style.chart.labels.formatter,u.value,e.unref(o.dataLabel)({p:`(${t.value.style.chart.labels.prefix}`,v:u.value,s:`${t.value.style.chart.labels.suffix})`,r:t.value.style.chart.labels.bestPlotLabel.rounding}),{datapoint:u,seriesIndex:f}):""),13,Oe)):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0)],64))),256)),e.renderSlot(l.$slots,"svg",{svg:r.value},void 0,!0)],14,ye)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",De,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(I)||e.unref(G)})),void 0,!0)])):e.createCommentVNode("",!0),p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(de.default,{key:4,config:{type:"stripPlot",style:{backgroundColor:t.value.style.chart.backgroundColor,stripPlot:{color:"#CCCCCC"}}}},null,8,["config"])),e.createVNode(ce._sfc_main,{show:c.value.showTooltip&&T.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:b.value,content:P.value,isCustom:e.unref(o.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...z.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...z.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isCustom"]),p.value?(e.openBlock(),e.createBlock(pe.default,{key:5,hideDetails:"",config:{open:c.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(ve.DataTable,{key:`table_${D.value}`,colNames:$.value.colNames,head:$.value.head,body:$.value.body,config:$.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:s[1]||(s[1]=a=>c.value.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createElementVNode("div",{innerHTML:a,style:{display:"flex","align-items":"center"}},null,8,Me)]),td:e.withCtx(({td:a})=>[e.createTextVNode(e.toDisplayString(a.name||a),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,fe))}},Ie=me._export_sfc(We,[["__scopeId","data-v-773b4af1"]]);exports.default=Ie;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-BKTciLz4.cjs"),K=require("./useResponsive-B3TrDDIG.cjs"),ie=require("./Title-DYwo_Q5b.cjs"),Q=require("./usePrinter-CxYg-Dw-.cjs"),ce=require("./Tooltip-03RvVGln.cjs"),ve=require("./DataTable-DAwK5x3h.cjs"),de=require("./vue-ui-skeleton-pDeQ3NcD.cjs"),he=require("./Shape-D7jva0XA.cjs"),pe=require("./vue-ui-accordion-SXHdW20_.cjs"),Z=require("./useNestedProp-BFnXnY0k.cjs"),me=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),fe=["id"],ye=["xmlns","viewBox"],be={key:0},ge={key:0},ke=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],xe={key:1},Ce=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],we=["x1","x2","y1","y2","stroke","stroke-width"],Be=["x1","x2","y1","y2","stroke","stroke-width"],_e=["x","y","fill","font-size"],Se=["x","y","font-size","fill"],$e=["fill","font-size","transform"],Ne=["fill","font-size","x","y"],Le=["x1","x2","y1","y2","stroke"],Te=["cx","cy","fill"],Pe=["cx","cy","fill"],Ee=["id"],ze=["stop-color"],Ve=["stop-color"],Ae=["stop-color"],Fe={key:0},Oe=["x","y","font-size","fill"],De={key:3,class:"vue-data-ui-watermark"},Me=["innerHTML"],We={__name:"vue-ui-strip-plot",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(ee,{expose:te,emit:le}){const v=ee,{vue_ui_strip_plot:ae}=o.useConfig(),p=e.computed({get(){return!!v.dataset&&v.dataset.length},set(l){return l}}),L=e.ref(o.createUid()),V=e.ref(0),T=e.ref(!1),P=e.ref(""),b=e.ref(null),A=e.ref(null),F=e.ref(!1),O=e.ref(0),D=e.ref(0),t=e.computed({get:()=>M(),set:l=>l});function M(){const l=Z.useNestedProp({userConfig:v.config,defaultConfig:ae});return l.theme?{...Z.useNestedProp({userConfig:o.themes.vue_ui_strip_plot[l.theme]||v.config,defaultConfig:l}),customPalette:o.themePalettes[l.theme]||o.palette}:l}e.watch(()=>v.config,l=>{t.value=M(),W(),O.value+=1,D.value+=1},{deep:!0});const C=e.ref(null);e.onMounted(()=>{W()});function W(){if(o.objectIsEmpty(v.dataset)?o.error({componentName:"VueUiStripPlot",type:"dataset"}):v.dataset.forEach((l,s)=>{o.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","plots"]}).forEach(a=>{p.value=!1,o.error({componentName:"VueUiStripPlot",type:"datasetSerieAttribute",property:a,index:s})}),l.plots&&l.plots.forEach((a,n)=>{o.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["name","value"]}).forEach(u=>{p.value=!1,o.error({componentName:"VueUiStripPlot",type:"datasetSerieAttribute",property:u,index:`${s},${n}`})})})}),t.value.responsive){const l=K.throttle(()=>{const{width:s,height:a}=K.useResponsive({chart:b.value,title:t.value.style.chart.title.text?A.value:null});w.value=a,y.value.width=s,y.value.height=a,k.value=(s-d.value.left-d.value.right)/v.dataset.length,B.value=o.translateSize({relator:Math.min(a,s),adjuster:600,source:t.value.style.chart.plots.radius,threshold:6,fallback:6})});C.value=new ResizeObserver(l),C.value.observe(b.value.parentNode)}F.value=!0,setTimeout(()=>{g.value=!1},oe.value*50)}e.onBeforeUnmount(()=>{C.value&&C.value.disconnect()});const{isPrinting:I,isImaging:G,generatePdf:q,generateImage:R}=Q.usePrinter({elementId:`strip-plot_${L.value}`,fileName:t.value.style.chart.title.text||"vue-ui-strip-plot"}),U=e.computed(()=>o.convertCustomPalette(t.value.customPalette)),g=e.ref(t.value.useCssAnimation),c=e.ref({showTable:t.value.table.show,dataLabels:{show:t.value.style.chart.labels.bestPlotLabel.show},showTooltip:t.value.style.chart.tooltip.show}),d=e.ref({top:t.value.style.chart.padding.top,bottom:t.value.style.chart.padding.bottom,left:t.value.style.chart.padding.left,right:t.value.style.chart.padding.right}),k=e.ref(t.value.style.chart.stripWidth),w=e.ref(t.value.style.chart.height),B=e.ref(t.value.style.chart.plots.radius),y=e.ref({width:k.value*v.dataset.length+d.value.left+d.value.right,height:t.value.style.chart.height}),r=e.computed(()=>{const l=k.value*v.dataset.length+d.value.left+d.value.right;return{left:d.value.left,right:l-d.value.right,top:d.value.top,bottom:w.value-d.value.bottom,width:k.value*v.dataset.length,height:w.value-d.value.top-d.value.bottom,stripWidth:k.value,absoluteHeight:w.value,absoluteWidth:l}}),_=e.computed(()=>p.value?v.dataset.map((l,s)=>{const a=o.createUid();return{...l,id:a,color:l.color?o.convertColorToHex(l.color):U.value[s]||o.palette[s]||o.palette[s%o.palette.length],plots:l.plots.map(n=>({...n,value:o.checkNaN(n.value),parentId:a,color:l.color?o.convertColorToHex(l.color):U.value[s]||o.palette[s]||o.palette[s%o.palette.length],id:o.createUid()})).sort((n,u)=>n.value-u.value)}}):null),h=e.computed(()=>(_.value||[]).map((l,s)=>({...l,plots:l.plots.map(a=>({...a,x:r.value.left+(s+1)*r.value.stripWidth-r.value.stripWidth/2}))}))),oe=e.computed(()=>Math.max(...h.value.map(l=>l.plots.length))),E=e.computed(()=>{const l=h.value.flatMap(s=>s.plots.map(a=>a.value));return{max:Math.max(...l),min:Math.min(...l)}}),m=e.computed(()=>o.calculateNiceScale(E.value.min<0?E.value.min:0,E.value.max,t.value.style.chart.grid.scaleSteps)),re=e.computed(()=>(h.value||[]).map((l,s)=>({...l,plots:l.plots.map(a=>({...a,y:r.value.bottom-(a.value+Math.abs(m.value.min))/(m.value.max+Math.abs(m.value.min))*r.value.height}))}))),H=e.computed(()=>m.value.ticks.map(l=>({y:r.value.bottom-r.value.height*((l+Math.abs(m.value.min))/(m.value.max+Math.abs(m.value.min))),x1:r.value.left,x2:r.value.right,value:l}))),z=e.ref(null),i=e.ref(null);function se({datapoint:l,seriesIndex:s}){z.value={datapoint:l,seriesIndex:s,config:t.value,series:_.value},T.value=!0,i.value=l;const a=t.value.style.chart.tooltip.customFormat;if(o.isFunction(a)&&o.functionReturnsString(()=>a({seriesIndex:s,datapoint:l,series:_.value,config:t.value})))P.value=a({seriesIndex:s,datapoint:l,series:_.value,config:t.value});else{let n="";n+=`<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="${t.value.style.chart.plots.gradient.show?`url(#${l.parentId})`:l.color}"/></svg>${l.name}</div>`,n+=`<div>${o.applyDataLabel(t.value.style.chart.labels.formatter,l.value,o.dataLabel({p:t.value.style.chart.labels.prefix,v:l.value,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:l,seriesIndex:s})}</div>`,P.value=`<div>${n}</div>`}}const S=e.computed(()=>{const l=h.value.flatMap(a=>JSON.parse(JSON.stringify(a.plots)).sort((n,u)=>u.value-n.value).map(n=>({name:`${a.name} - ${n.name}`,color:n.color}))),s=h.value.flatMap(a=>JSON.parse(JSON.stringify(a.plots)).sort((n,u)=>u.value-n.value).map(n=>n.value));return{head:l,body:s}});function j(){e.nextTick(()=>{const l=S.value.head.map((n,u)=>[[n.name],[S.value.body[u]]]),s=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.series],[t.value.table.columnNames.value]]].concat(l),a=o.createCsvContent(s);o.downloadCsv({csvContent:a,title:t.value.style.chart.title.text||"vue-ui-strip-plot"})})}const $=e.computed(()=>{const l=[t.value.table.columnNames.series,t.value.table.columnNames.value],s=S.value.head.map((u,f)=>{const N=o.dataLabel({p:t.value.style.chart.labels.prefix,v:S.value.body[f],s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue});return[{color:u.color,name:u.name},N]}),a={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value],head:l,body:s,config:a}}),x=e.ref(!1);function ne(l){x.value=l,V.value+=1}function ue(){return h.value}function X(){c.value.showTable=!c.value.showTable}function Y(){c.value.dataLabels.show=!c.value.dataLabels.show}function J(){c.value.showTooltip=!c.value.showTooltip}return te({getData:ue,generatePdf:q,generateCsv:j,generateImage:R,toggleTable:X,toggleLabels:Y,toggleTooltip:J}),(l,s)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"stripPlotChart",ref:b,class:e.normalizeClass(`vue-ui-strip-plot ${x.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};${t.value.responsive?"height:100%":""}`),id:`strip-plot_${L.value}`},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:A,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(ie._sfc_main,{key:`title_${O.value}`,config:{title:{cy:"donut-div-title",...t.value.style.chart.title},subtitle:{cy:"donut-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&p.value?(e.openBlock(),e.createBlock(Q.UserOptions,{ref:"details",key:`user_option_${V.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(I),isImaging:e.unref(G),uid:L.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,hasLabel:t.value.userOptions.buttons.labels,hasFullscreen:t.value.userOptions.buttons.fullscreen,isTooltip:c.value.showTooltip,isFullscreen:x.value,titles:{...t.value.userOptions.buttonTitles},chartElement:b.value,position:t.value.userOptions.position,onToggleFullscreen:ne,onGeneratePdf:e.unref(q),onGenerateCsv:j,onGenerateImage:e.unref(R),onToggleTable:X,onToggleLabels:Y,onToggleTooltip:J},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.optionLabels?{name:"optionLabels",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionLabels",{},void 0,!0)]),key:"5"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:n})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:n})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasLabel","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","position","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(o.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":x.value,"vue-data-ui-fulscreen--off":!x.value}),viewBox:`0 0 ${y.value.width<=0?10:y.value.width} ${y.value.height<=0?10:y.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color};`)},[t.value.style.chart.grid.show?(e.openBlock(),e.createElementBlock("g",be,[t.value.style.chart.grid.horizontalGrid.show?(e.openBlock(),e.createElementBlock("g",ge,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.value,a=>(e.openBlock(),e.createElementBlock("line",{x1:a.x1,x2:a.x2,y1:a.y,y2:a.y,stroke:t.value.style.chart.grid.horizontalGrid.stroke,"stroke-width":t.value.style.chart.grid.horizontalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.horizontalGrid.strokeDasharray,"stroke-linecap":"round"},null,8,ke))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.verticalGrid.show?(e.openBlock(),e.createElementBlock("g",xe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(a,n)=>(e.openBlock(),e.createElementBlock("line",{x1:r.value.left+(n+1)*r.value.stripWidth,x2:r.value.left+(n+1)*r.value.stripWidth,y1:r.value.top,y2:r.value.bottom,stroke:t.value.style.chart.grid.verticalGrid.stroke,"stroke-width":t.value.style.chart.grid.verticalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.verticalGrid.strokeDasharray,"stroke-linecap":"round"},null,8,Ce))),256))])):e.createCommentVNode("",!0),e.createElementVNode("line",{x1:r.value.left,x2:r.value.left,y1:r.value.top,y2:r.value.bottom,stroke:t.value.style.chart.grid.stroke,"stroke-width":t.value.style.chart.grid.strokeWidth,"stroke-linecap":"round"},null,8,we),e.createElementVNode("line",{x1:r.value.left,x2:r.value.right,y1:r.value.bottom,y2:r.value.bottom,stroke:t.value.style.chart.grid.stroke,"stroke-width":t.value.style.chart.grid.strokeWidth,"stroke-linecap":"round"},null,8,Be)])):e.createCommentVNode("",!0),t.value.style.chart.labels.yAxisLabels.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(H.value,(a,n)=>(e.openBlock(),e.createElementBlock("text",{x:a.x1-t.value.style.chart.labels.yAxisLabels.fontSize/2+t.value.style.chart.labels.yAxisLabels.offsetX,y:a.y+t.value.style.chart.labels.yAxisLabels.fontSize/3,fill:t.value.style.chart.labels.yAxisLabels.color,"font-size":t.value.style.chart.labels.yAxisLabels.fontSize,"text-anchor":"end"},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.chart.labels.formatter,a.value,e.unref(o.dataLabel)({p:t.value.style.chart.labels.prefix,v:a.value,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.labels.yAxisLabels.rounding}),{datapoint:a,seriesIndex:n})),9,_e))),256)):e.createCommentVNode("",!0),t.value.style.chart.labels.xAxisLabels.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(h.value,(a,n)=>(e.openBlock(),e.createElementBlock("text",{x:r.value.left+(n+1)*r.value.stripWidth-r.value.stripWidth/2,y:r.value.bottom+t.value.style.chart.labels.xAxisLabels.fontSize*2+t.value.style.chart.labels.xAxisLabels.offsetY,"font-size":t.value.style.chart.labels.xAxisLabels.fontSize,fill:t.value.style.chart.labels.xAxisLabels.color,"text-anchor":"middle"},e.toDisplayString(a.name),9,Se))),256)):e.createCommentVNode("",!0),t.value.style.chart.labels.axis.yLabel?(e.openBlock(),e.createElementBlock("text",{key:3,fill:t.value.style.chart.labels.axis.color,"font-size":t.value.style.chart.labels.axis.fontSize,transform:`translate(${t.value.style.chart.labels.axis.fontSize+t.value.style.chart.labels.axis.yLabelOffsetX}, ${r.value.top+r.value.height/2}) rotate(-90)`,"text-anchor":"middle"},e.toDisplayString(t.value.style.chart.labels.axis.yLabel),9,$e)):e.createCommentVNode("",!0),t.value.style.chart.labels.axis.xLabel?(e.openBlock(),e.createElementBlock("text",{key:4,fill:t.value.style.chart.labels.axis.color,"font-size":t.value.style.chart.labels.axis.fontSize,x:r.value.left+r.value.width/2,y:r.value.absoluteHeight,"text-anchor":"middle"},e.toDisplayString(t.value.style.chart.labels.axis.xLabel),9,Ne)):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[e.createElementVNode("line",{x1:r.value.left,x2:r.value.right,y1:i.value.y,y2:i.value.y,stroke:i.value.color,"stroke-width":1,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,Le),e.createElementVNode("circle",{cx:r.value.left,cy:i.value.y,r:3,fill:i.value.color,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,Te),e.createElementVNode("circle",{cx:r.value.right,cy:i.value.y,r:3,fill:i.value.color,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,Pe)],64)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,a=>(e.openBlock(),e.createElementBlock("radialGradient",{id:a.id,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(o.lightenHexColor)(a.color,t.value.style.chart.plots.gradient.intensity/100)},null,8,ze),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(o.darkenHexColor)(a.color,.1)},null,8,Ve),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,Ae)],8,Ee))),256))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(re.value,(a,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.plots,(u,f)=>(e.openBlock(),e.createBlock(he._sfc_main,e.mergeProps({plot:{x:u.x,y:F.value?u.y:r.value.top},radius:i.value&&i.value.id===u.id?B.value*1.5:B.value,shape:t.value.style.chart.plots.shape,stroke:t.value.style.chart.plots.stroke,strokeWidth:t.value.style.chart.plots.strokeWidth,color:t.value.style.chart.plots.gradient.show?`url(#${a.id})`:a.color,onMouseenter:N=>se({datapoint:u,seriesIndex:f}),onMouseleave:s[0]||(s[0]=N=>{T.value=!1,i.value=null}),onClick:N=>le("selectDatapoint",u),style:`transition: all 0.2s ease-in-out; opacity:${i.value?i.value.id===u.id?1:.2:t.value.style.chart.plots.opacity};${g.value?`transition-delay:${f*50}ms`:""}`,class:{"vue-ui-strip-plot-animated":t.value.useCssAnimation&&g.value,"vue-ui-strip-plot-select-circle":t.value.useCssAnimation&&!g.value}},l.$attrs),null,16,["plot","radius","shape","stroke","strokeWidth","color","onMouseenter","onClick","style","class"]))),256)),c.value.dataLabels.show?(e.openBlock(),e.createElementBlock("g",Fe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.plots,(u,f)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[f===a.plots.length-1||i.value&&i.value.id===u.id&&!c.value.showTooltip?(e.openBlock(),e.createElementBlock("text",{key:0,x:u.x,y:u.y+t.value.style.chart.labels.bestPlotLabel.offsetY-B.value*(i.value&&i.value.id===u.id&&!c.value.showTooltip?2:1.5),"font-size":t.value.style.chart.labels.bestPlotLabel.fontSize,fill:t.value.style.chart.labels.bestPlotLabel.color,"text-anchor":"middle",style:e.normalizeStyle(`opacity:${t.value.useCssAnimation&&g.value?0:1};transition:opacity 0.2s ease-in;`)},e.toDisplayString(u.name)+" "+e.toDisplayString(t.value.style.chart.labels.bestPlotLabel.showValue?e.unref(o.applyDataLabel)(t.value.style.chart.labels.formatter,u.value,e.unref(o.dataLabel)({p:`(${t.value.style.chart.labels.prefix}`,v:u.value,s:`${t.value.style.chart.labels.suffix})`,r:t.value.style.chart.labels.bestPlotLabel.rounding}),{datapoint:u,seriesIndex:f}):""),13,Oe)):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0)],64))),256)),e.renderSlot(l.$slots,"svg",{svg:r.value},void 0,!0)],14,ye)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",De,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(I)||e.unref(G)})),void 0,!0)])):e.createCommentVNode("",!0),p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(de.default,{key:4,config:{type:"stripPlot",style:{backgroundColor:t.value.style.chart.backgroundColor,stripPlot:{color:"#CCCCCC"}}}},null,8,["config"])),e.createVNode(ce._sfc_main,{show:c.value.showTooltip&&T.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:b.value,content:P.value,isCustom:e.unref(o.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...z.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...z.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isCustom"]),p.value?(e.openBlock(),e.createBlock(pe.default,{key:5,hideDetails:"",config:{open:c.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(ve.DataTable,{key:`table_${D.value}`,colNames:$.value.colNames,head:$.value.head,body:$.value.body,config:$.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:s[1]||(s[1]=a=>c.value.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createElementVNode("div",{innerHTML:a,style:{display:"flex","align-items":"center"}},null,8,Me)]),td:e.withCtx(({td:a})=>[e.createTextVNode(e.toDisplayString(a.name||a),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,fe))}},Ie=me._export_sfc(We,[["__scopeId","data-v-773b4af1"]]);exports.default=Ie;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as D, u as x, A as G, m as M, d as T, B as E, q as z, r as B, W as H } from "./index-
|
|
1
|
+
import { p as D, u as x, A as G, m as M, d as T, B as E, q as z, r as B, W as H } from "./index-Ca4RHJ4t.js";
|
|
2
2
|
import { openBlock as i, createElementBlock as c, normalizeStyle as g, createElementVNode as a, toDisplayString as u, Fragment as b, renderList as _, normalizeClass as f, createTextVNode as I, createCommentVNode as N, withDirectives as k, vModelText as w, withKeys as S, withModifiers as O, vModelSelect as P, createStaticVNode as R, pushScopeId as U, popScopeId as V } from "vue";
|
|
3
3
|
import { _ as j } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
4
|
const X = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index-BKTciLz4.cjs"),e=require("vue"),b=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),C={name:"vue-ui-table",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},data(){return{uid:`vue-ui-table-${Math.random()}`,bodyCopy:JSON.parse(JSON.stringify(this.dataset.body)).map((l,o)=>({...l,absoluteIndex:o})),buttonTimeout:null,canMoveChart:!1,chart:{height:316,type:"bar",width:512},constants:{ASC:1,BAR:"bar",DATE:"date",DESC:-1,DONUT:"donut",LINE:"line",NUMERIC:"numeric",PERCENTAGE:"percentage",TEXT:"text"},clientX:100,clientY:100,cssClass:{CELL:"smart-td-selected",FIRST_TD:"smart-td-selected-first",LAST_TD:"smart-td-selected-last",ROW:"smart-td-selected-neighbor"},currentDonut:void 0,currentFilter:void 0,currentSearch:void 0,currentSelectionSpan:{col:void 0,rows:[]},currentPage:0,dates:{},filteredDatesIndexes:{},hasNaN:{},iconColor:"#2D353C",iconSize:20,immutableRangeFilters:{},isExportRequest:!1,isLoading:!1,itemsPerPage:this.config.rowsPerPage?this.config.rowsPerPage:25,multiselects:{},paginatorOptions:[...new Set([10,25,50,100,250,500,this.config.rowsPerPage?this.config.rowsPerPage:25,this.dataset.body.length])].sort((l,o)=>l-o),palette:g.palette,percentages:{},rafId:null,rangeFilters:{},searches:{},selectedColumn:void 0,selectedDonutCategory:void 0,selectedPlot:void 0,showChart:!1,showDonutOptions:!1,sorts:{},tableBody:JSON.parse(JSON.stringify(this.dataset.body)).map((l,o)=>({...l,absoluteIndex:o})),tableHead:JSON.parse(JSON.stringify(this.dataset.header)).map(l=>({average:Object.hasOwn(l,"average")?l.average:!1,decimals:Object.hasOwn(l,"decimals")?l.decimals:0,isMultiselect:Object.hasOwn(l,"isMultiselect")?l.isMultiselect:!1,isPercentage:Object.hasOwn(l,"isPercentage")?l.isPercentage:!1,isSearch:Object.hasOwn(l,"isSearch")?l.isSearch:!1,isSort:Object.hasOwn(l,"isSort")?l.isSort:!1,name:l.name,percentageTo:Object.hasOwn(l,"percentageTo")?l.percentageTo:void 0,prefix:Object.hasOwn(l,"prefix")?l.prefix:"",rangeFilter:Object.hasOwn(l,"rangeFilter")?l.rangeFilter:!1,suffix:Object.hasOwn(l,"suffix")?l.suffix:"",sum:Object.hasOwn(l,"sum")?l.sum:!1,type:l.type}))}},mounted(){if(this.dataset.header.length===0)throw new Error(`vue-ui-table error: missing header data.
|
|
2
2
|
Provide an array of objects of type:
|
|
3
3
|
{
|
|
4
4
|
name: string;
|