vue-data-ui 2.3.74 → 2.3.75
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-CYCrAySW.js → Arrow-BTG7M25z.js} +1 -1
- package/dist/{Arrow-DK6F5Fq3.cjs → Arrow-CZK77NmC.cjs} +1 -1
- package/dist/{BaseIcon-DBHVtm3A.cjs → BaseIcon--PMhZ3f-.cjs} +1 -1
- package/dist/{BaseIcon-kBIAYqUO.js → BaseIcon-BAOfPaXs.js} +1 -1
- package/dist/{DataTable-CKdV-L0e.js → DataTable-CQANRZju.js} +2 -2
- package/dist/{DataTable-BNFSPjhv.cjs → DataTable-DjQzrklZ.cjs} +1 -1
- package/dist/{Legend-Do2kcWFT.cjs → Legend-CtbPB0Bo.cjs} +1 -1
- package/dist/{Legend-Cj7T-DqJ.js → Legend-DX1kv21U.js} +1 -1
- package/dist/{Shape-DRDUAe_o.cjs → Shape-CadGs1Am.cjs} +1 -1
- package/dist/{Shape-Bo8ZjViG.js → Shape-kqcyauhC.js} +1 -1
- package/dist/{Slicer-D8jHSP7U.cjs → Slicer-i_oECHxH.cjs} +1 -1
- package/dist/{Slicer-4nGKvUYF.js → Slicer-yaJs-izT.js} +2 -2
- package/dist/{Title-DZjnxQdN.js → Title-C26I_HC3.js} +1 -1
- package/dist/{Title-D5cATWsL.cjs → Title-XBiDFYKD.cjs} +1 -1
- package/dist/{Tooltip--kgFEVZs.js → Tooltip-CH8GmDCG.js} +1 -1
- package/dist/{Tooltip-B8yLaegk.cjs → Tooltip-DxtWkIt5.cjs} +1 -1
- package/dist/{index-C8SH0f2u.js → index-Cm4Iry5c.js} +1 -1
- package/dist/{index-D_32ZGWd.cjs → index-DYUBiaGS.cjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/{useNestedProp-lS_T5lM3.js → useNestedProp-CurQIHTa.js} +1 -1
- package/dist/{useNestedProp-BvvH633N.cjs → useNestedProp-w7AMWWmz.cjs} +1 -1
- package/dist/{usePrinter-Dj50NAxo.js → usePrinter-B8RnF8_q.js} +1 -1
- package/dist/{usePrinter-BouFNHWR.cjs → usePrinter-ZlHxdaEz.cjs} +1 -1
- package/dist/{vue-data-ui-v_BbbLtJ.cjs → vue-data-ui-B7amrpT-.cjs} +1 -1
- package/dist/{vue-data-ui-DoXqU7xC.js → vue-data-ui-Bj6kEIpq.js} +57 -57
- package/dist/vue-data-ui.cjs +1 -1
- package/dist/vue-data-ui.js +1 -1
- package/dist/vue-ui-3d-bar-BAz41kL7.cjs +19 -0
- package/dist/{vue-ui-3d-bar-CnoPOJHm.js → vue-ui-3d-bar-Bg9IgVVc.js} +499 -486
- package/dist/{vue-ui-accordion-Cka6b_Up.cjs → vue-ui-accordion-1WxrfiCH.cjs} +1 -1
- package/dist/{vue-ui-accordion-YHleIgkV.js → vue-ui-accordion-Cb6XBCbu.js} +3 -3
- package/dist/{vue-ui-age-pyramid-CENg8fDg.js → vue-ui-age-pyramid-BhwmnQru.js} +182 -169
- package/dist/vue-ui-age-pyramid-CHNvRXx8.cjs +1 -0
- package/dist/{vue-ui-annotator-ByYg6QMs.cjs → vue-ui-annotator-B22cdlhA.cjs} +1 -1
- package/dist/{vue-ui-annotator-VJOLUkqJ.js → vue-ui-annotator-BiHQvMdW.js} +1 -1
- package/dist/{vue-ui-candlestick-CHsGD3bx.js → vue-ui-candlestick-Cl9dyh4l.js} +295 -279
- package/dist/vue-ui-candlestick-D7DjdYyw.cjs +2 -0
- package/dist/vue-ui-carousel-table-Do5cYRqN.cjs +1 -0
- package/dist/{vue-ui-carousel-table-RAtX3VBu.js → vue-ui-carousel-table-QsONwqNz.js} +106 -91
- package/dist/vue-ui-chestnut-CyE8MafY.cjs +6 -0
- package/dist/{vue-ui-chestnut-B5GQX0J_.js → vue-ui-chestnut-Drb01WMC.js} +215 -204
- package/dist/{vue-ui-cursor-CMm7XSSG.js → vue-ui-cursor-BP04_XbB.js} +2 -2
- package/dist/{vue-ui-cursor-DnZqLj21.cjs → vue-ui-cursor-DZeTQBKz.cjs} +1 -1
- package/dist/{vue-ui-dashboard-Ck_5L3eu.js → vue-ui-dashboard-BWdx5gjZ.js} +2 -2
- package/dist/{vue-ui-dashboard-DgEQJnLr.cjs → vue-ui-dashboard-Z63RE1XS.cjs} +1 -1
- package/dist/{vue-ui-digits-UvwUdi6U.cjs → vue-ui-digits-CBQaHW6a.cjs} +1 -1
- package/dist/{vue-ui-digits--ULH35um.js → vue-ui-digits-DUhkLcmd.js} +2 -2
- package/dist/vue-ui-donut-D2YJYgOB.cjs +1 -0
- package/dist/{vue-ui-donut-QQ1fWWvc.js → vue-ui-donut-DRPSwmGr.js} +376 -362
- package/dist/{vue-ui-donut-evolution-Cx8kBB_7.js → vue-ui-donut-evolution-gRXAyxq8.js} +270 -255
- package/dist/vue-ui-donut-evolution-jAMVgNHQ.cjs +1 -0
- package/dist/{vue-ui-dumbbell-BYvwHpU8.js → vue-ui-dumbbell-CQo5jqSK.js} +232 -213
- package/dist/vue-ui-dumbbell-DLfZcrXq.cjs +9 -0
- package/dist/vue-ui-flow-BQ3UbMUb.js +481 -0
- package/dist/vue-ui-flow-BlX2-eEC.cjs +1 -0
- package/dist/{vue-ui-galaxy-B0L57aec.js → vue-ui-galaxy-BHWugUKG.js} +175 -162
- package/dist/vue-ui-galaxy-Cax5o6Yl.cjs +1 -0
- package/dist/vue-ui-gauge-DG6_kvKh.js +500 -0
- package/dist/vue-ui-gauge-DpGcv_00.cjs +1 -0
- package/dist/vue-ui-gizmo-D9Vh9Rmr.cjs +1 -0
- package/dist/{vue-ui-gizmo-D2RfM55X.js → vue-ui-gizmo-bV148qAf.js} +66 -53
- package/dist/{vue-ui-heatmap-DKM0DH41.js → vue-ui-heatmap-BZZUvnMa.js} +157 -143
- package/dist/vue-ui-heatmap-B_ELXKKV.cjs +1 -0
- package/dist/vue-ui-kpi-C5v7qQvZ.js +98 -0
- package/dist/vue-ui-kpi-CwVAvTB2.cjs +1 -0
- package/dist/{vue-ui-mini-loader-MywnWlYI.js → vue-ui-mini-loader-BdKizX_J.js} +2 -2
- package/dist/{vue-ui-mini-loader-CLP19Txv.cjs → vue-ui-mini-loader-DZNY-3rr.cjs} +1 -1
- package/dist/{vue-ui-molecule-CLI9iTRE.js → vue-ui-molecule-MKyrhqqm.js} +177 -167
- package/dist/vue-ui-molecule-bva6OvPc.cjs +1 -0
- package/dist/{vue-ui-mood-radar-O30wZo9a.js → vue-ui-mood-radar-BNIFFvq0.js} +172 -161
- package/dist/vue-ui-mood-radar-CzQOAyNI.cjs +1 -0
- package/dist/{vue-ui-nested-donuts-D8o4TqTt.js → vue-ui-nested-donuts-BDAlZrMF.js} +377 -364
- package/dist/vue-ui-nested-donuts-CxdZC6JF.cjs +17 -0
- package/dist/{vue-ui-onion-Hmcke6xB.js → vue-ui-onion-CFa4VD-w.js} +191 -177
- package/dist/vue-ui-onion-Df7YcsVR.cjs +5 -0
- package/dist/vue-ui-parallel-coordinate-plot-D7Q2zfcR.cjs +8 -0
- package/dist/{vue-ui-parallel-coordinate-plot-CyChE3NP.js → vue-ui-parallel-coordinate-plot-DmqYXT-U.js} +298 -284
- package/dist/{vue-ui-quadrant-DimTQdAj.js → vue-ui-quadrant-D5jHkq9g.js} +347 -334
- package/dist/vue-ui-quadrant-ZqhcVYf5.cjs +1 -0
- package/dist/{vue-ui-quick-chart-DxJvENid.js → vue-ui-quick-chart-BjXXSx7V.js} +483 -469
- package/dist/vue-ui-quick-chart-Dt9AsEU6.cjs +15 -0
- package/dist/vue-ui-radar-2EuZr7i2.cjs +1 -0
- package/dist/{vue-ui-radar-D_FieunT.js → vue-ui-radar-CW8EKW4o.js} +202 -189
- package/dist/{vue-ui-rating-BHW2Onru.cjs → vue-ui-rating-DrtLvVA0.cjs} +1 -1
- package/dist/{vue-ui-rating-DF1BpH4E.js → vue-ui-rating-eSWsmJUU.js} +2 -2
- package/dist/vue-ui-relation-circle-C60OTe88.cjs +1 -0
- package/dist/vue-ui-relation-circle-DiUCpEqa.js +322 -0
- package/dist/{vue-ui-rings-BqS-iece.js → vue-ui-rings-BxhLbyG0.js} +203 -189
- package/dist/vue-ui-rings-CHq-a5ZS.cjs +2 -0
- package/dist/{vue-ui-scatter-Dns49Nht.js → vue-ui-scatter-DQchX_mM.js} +284 -270
- package/dist/vue-ui-scatter-DZUZUbnk.cjs +1 -0
- package/dist/{vue-ui-screenshot-5Gsnd0Wr.js → vue-ui-screenshot-CLa9vMzM.js} +1 -1
- package/dist/{vue-ui-screenshot---q062Kd.cjs → vue-ui-screenshot-SLSIpqx2.cjs} +1 -1
- package/dist/{vue-ui-skeleton-B4eWLjH3.js → vue-ui-skeleton-C1oUnz7R.js} +2 -2
- package/dist/{vue-ui-skeleton-fVPw-oIR.cjs → vue-ui-skeleton-ClpTCY1x.cjs} +1 -1
- package/dist/{vue-ui-smiley-B8Tyunn3.js → vue-ui-smiley-CmWHSt1S.js} +2 -2
- package/dist/{vue-ui-smiley-YfHmv0rQ.cjs → vue-ui-smiley-Daw8fPDy.cjs} +1 -1
- package/dist/vue-ui-spark-trend-CO69Dg31.js +263 -0
- package/dist/vue-ui-spark-trend-DmDlv8ie.cjs +1 -0
- package/dist/{vue-ui-sparkbar-9DBvdYn7.js → vue-ui-sparkbar-BRlqpe4e.js} +95 -87
- package/dist/vue-ui-sparkbar-BUGdi0BY.cjs +1 -0
- package/dist/vue-ui-sparkgauge-CCxKzDjT.cjs +1 -0
- package/dist/vue-ui-sparkgauge-CbuFESsM.js +178 -0
- package/dist/{vue-ui-sparkhistogram-BBUVmco4.js → vue-ui-sparkhistogram-B4-hrDHz.js} +79 -68
- package/dist/vue-ui-sparkhistogram-XtqX10_t.cjs +1 -0
- package/dist/vue-ui-sparkline-BZTEi9YC.cjs +1 -0
- package/dist/{vue-ui-sparkline-CeqNV6Re.js → vue-ui-sparkline-DlXNmG6M.js} +142 -123
- package/dist/vue-ui-sparkstackbar-CDmZeXnq.cjs +1 -0
- package/dist/{vue-ui-sparkstackbar-C3GMC1eW.js → vue-ui-sparkstackbar-J1YowQmP.js} +120 -104
- package/dist/{vue-ui-stackbar-DyGPrFxi.js → vue-ui-stackbar-CKIDqkkY.js} +235 -222
- package/dist/vue-ui-stackbar-CXGWukoJ.cjs +6 -0
- package/dist/vue-ui-strip-plot-CvmoRcYN.cjs +1 -0
- package/dist/{vue-ui-strip-plot-y1AnVJmq.js → vue-ui-strip-plot-JVLwIy0j.js} +246 -232
- package/dist/{vue-ui-table-B4kfykAO.js → vue-ui-table-BSi_cHh7.js} +1 -1
- package/dist/{vue-ui-table-xWvAQS-s.cjs → vue-ui-table-Dqi64VE7.cjs} +1 -1
- package/dist/vue-ui-table-heatmap-BwghEh5t.cjs +1 -0
- package/dist/{vue-ui-table-heatmap-YZRSzwRM.js → vue-ui-table-heatmap-CfvW3rcm.js} +106 -95
- package/dist/{vue-ui-table-sparkline-C0v2r4Kf.js → vue-ui-table-sparkline-Y6Lrrzxy.js} +151 -138
- package/dist/vue-ui-table-sparkline-bIy3kkHB.cjs +1 -0
- package/dist/{vue-ui-thermometer-D5qurIy7.js → vue-ui-thermometer-BPTs7Nxc.js} +116 -104
- package/dist/vue-ui-thermometer-DDtxYr7w.cjs +1 -0
- package/dist/{vue-ui-timer-VWjovnKL.js → vue-ui-timer-CkB7eZaE.js} +191 -176
- package/dist/vue-ui-timer-DRSSYxOX.cjs +64 -0
- package/dist/{vue-ui-tiremarks-jH6cdQOJ.js → vue-ui-tiremarks-BbOaoY8S.js} +115 -103
- package/dist/vue-ui-tiremarks-Bttwg3-p.cjs +1 -0
- package/dist/vue-ui-treemap-Chq0WQPe.cjs +1 -0
- package/dist/{vue-ui-treemap-BCc5sQLB.js → vue-ui-treemap-CoaK3wBl.js} +251 -237
- package/dist/{vue-ui-vertical-bar-2In_g5iC.js → vue-ui-vertical-bar-BA43_uHV.js} +314 -299
- package/dist/vue-ui-vertical-bar-BLIUt-HT.cjs +4 -0
- package/dist/{vue-ui-waffle-OzU830VX.js → vue-ui-waffle-BoEf8CcG.js} +285 -265
- package/dist/vue-ui-waffle-NBjY0mko.cjs +1 -0
- package/dist/vue-ui-wheel-Bgo2jpj0.js +255 -0
- package/dist/vue-ui-wheel-t5bI4a-P.cjs +1 -0
- package/dist/vue-ui-word-cloud-DPW_-Hzz.cjs +1 -0
- package/dist/vue-ui-word-cloud-Jd9_JUyi.js +512 -0
- package/dist/{vue-ui-xy-DuJtYXKl.js → vue-ui-xy-BMBYAC4z.js} +300 -274
- package/dist/vue-ui-xy-CBHEBcZK.cjs +3 -0
- package/dist/vue-ui-xy-canvas-D5FqRF4p.cjs +9 -0
- package/dist/{vue-ui-xy-canvas-CKibMJHh.js → vue-ui-xy-canvas-LOsQ_DM-.js} +345 -327
- package/package.json +1 -1
- package/dist/vue-ui-3d-bar-CwCEoPX-.cjs +0 -19
- package/dist/vue-ui-age-pyramid-GqCNpd_h.cjs +0 -1
- package/dist/vue-ui-candlestick-TdNVq_FX.cjs +0 -2
- package/dist/vue-ui-carousel-table-yXUSFk2u.cjs +0 -1
- package/dist/vue-ui-chestnut-EJj-dQSY.cjs +0 -6
- package/dist/vue-ui-donut-BqUBysA_.cjs +0 -1
- package/dist/vue-ui-donut-evolution-BXtEnop4.cjs +0 -1
- package/dist/vue-ui-dumbbell-CjIh7KTm.cjs +0 -9
- package/dist/vue-ui-flow-hp0Hpuhn.js +0 -469
- package/dist/vue-ui-flow-u29zqSQj.cjs +0 -1
- package/dist/vue-ui-galaxy-DE1HbBi-.cjs +0 -1
- package/dist/vue-ui-gauge-B_IZrsfj.cjs +0 -1
- package/dist/vue-ui-gauge-CPyyn7cL.js +0 -488
- package/dist/vue-ui-gizmo-DR4gacOL.cjs +0 -1
- package/dist/vue-ui-heatmap-DMB_eUpA.cjs +0 -1
- package/dist/vue-ui-kpi-BAxAY13T.js +0 -84
- package/dist/vue-ui-kpi-BD21xshi.cjs +0 -1
- package/dist/vue-ui-molecule-BNsWckH-.cjs +0 -1
- package/dist/vue-ui-mood-radar-BsWE1f8R.cjs +0 -1
- package/dist/vue-ui-nested-donuts-CYyUtXs2.cjs +0 -17
- package/dist/vue-ui-onion-D7TXJu5w.cjs +0 -5
- package/dist/vue-ui-parallel-coordinate-plot-BqZB7xKn.cjs +0 -8
- package/dist/vue-ui-quadrant-BPDTvxlT.cjs +0 -1
- package/dist/vue-ui-quick-chart-C_-ut0if.cjs +0 -15
- package/dist/vue-ui-radar-C5Kq19hg.cjs +0 -1
- package/dist/vue-ui-relation-circle-4kIYttRI.js +0 -310
- package/dist/vue-ui-relation-circle-DHMHHsqY.cjs +0 -1
- package/dist/vue-ui-rings-BqPS8NKl.cjs +0 -2
- package/dist/vue-ui-scatter-BLVcdf3d.cjs +0 -1
- package/dist/vue-ui-spark-trend-Dpv6am0Z.cjs +0 -1
- package/dist/vue-ui-spark-trend-Em9OqYyG.js +0 -251
- package/dist/vue-ui-sparkbar-BuSuwQYl.cjs +0 -1
- package/dist/vue-ui-sparkgauge-BN5feBzp.js +0 -167
- package/dist/vue-ui-sparkgauge-DKtUZMv1.cjs +0 -1
- package/dist/vue-ui-sparkhistogram-BmuusW02.cjs +0 -1
- package/dist/vue-ui-sparkline-Blzv-tIQ.cjs +0 -1
- package/dist/vue-ui-sparkstackbar-D__WDEMv.cjs +0 -1
- package/dist/vue-ui-stackbar-DFqJ5K_q.cjs +0 -6
- package/dist/vue-ui-strip-plot-z9fjJ6Dj.cjs +0 -1
- package/dist/vue-ui-table-heatmap-CGKecjtm.cjs +0 -1
- package/dist/vue-ui-table-sparkline-CHFZG3Tg.cjs +0 -1
- package/dist/vue-ui-thermometer-DoOxxVW1.cjs +0 -1
- package/dist/vue-ui-timer-D63zHe-I.cjs +0 -64
- package/dist/vue-ui-tiremarks-Cp8YEmXh.cjs +0 -1
- package/dist/vue-ui-treemap-DJrdEFW5.cjs +0 -1
- package/dist/vue-ui-vertical-bar-BfJJqN_z.cjs +0 -4
- package/dist/vue-ui-waffle-A2gmRbq0.cjs +0 -1
- package/dist/vue-ui-wheel-C9QXzWu1.js +0 -242
- package/dist/vue-ui-wheel-DGSh9VKq.cjs +0 -1
- package/dist/vue-ui-word-cloud-C2ZaVlfO.js +0 -498
- package/dist/vue-ui-word-cloud-DPFB1MYk.cjs +0 -1
- package/dist/vue-ui-xy-C-2-aijE.cjs +0 -3
- package/dist/vue-ui-xy-canvas-D7wf3xab.cjs +0 -9
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import { computed as u, ref as m, watch as B, onMounted as H, openBlock as s, createElementBlock as i, normalizeStyle as V, createBlock as C, unref as c, createElementVNode as k, createCommentVNode as v, toDisplayString as D } from "vue";
|
|
2
|
+
import { u as J, c as K, t as Q, o as Y, e as ee, s as y, T as te, X as ae, w as z, P as E, f as G, i as le } from "./index-Cm4Iry5c.js";
|
|
3
|
+
import { u as O } from "./useNestedProp-CurQIHTa.js";
|
|
4
|
+
import M from "./BaseIcon-BAOfPaXs.js";
|
|
5
|
+
import ne from "./vue-ui-skeleton-C1oUnz7R.js";
|
|
6
|
+
import { _ as oe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
7
|
+
const se = ["id"], ue = ["xmlns", "viewBox"], re = ["id"], ie = ["stop-color"], de = ["stop-color"], ve = { key: 0 }, ce = ["d", "fill"], ye = ["d", "fill"], he = ["d", "stroke", "stroke-width", "stroke-linecap", "stroke-linejoin"], fe = ["d", "stroke", "stroke-width", "stroke-linecap", "stroke-linejoin"], pe = ["height", "width", "x"], ge = { style: { width: "100%" } }, me = ["x", "y", "fill", "font-size", "font-weight"], ke = ["stroke", "cx", "cy", "fill"], _e = ["x", "y", "font-size", "fill", "font-weight"], be = {
|
|
8
|
+
__name: "vue-ui-spark-trend",
|
|
9
|
+
props: {
|
|
10
|
+
config: {
|
|
11
|
+
type: Object,
|
|
12
|
+
default() {
|
|
13
|
+
return {};
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
dataset: {
|
|
17
|
+
type: Array,
|
|
18
|
+
default() {
|
|
19
|
+
return [];
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
setup(U) {
|
|
24
|
+
const n = U, { vue_ui_spark_trend: P } = J(), q = u(() => !!n.dataset && n.dataset.length), _ = m(K()), e = u({
|
|
25
|
+
get: () => S(),
|
|
26
|
+
set: (t) => t
|
|
27
|
+
});
|
|
28
|
+
function S() {
|
|
29
|
+
const t = O({
|
|
30
|
+
userConfig: n.config,
|
|
31
|
+
defaultConfig: P
|
|
32
|
+
});
|
|
33
|
+
return t.theme ? {
|
|
34
|
+
...O({
|
|
35
|
+
userConfig: Q.vue_ui_spark_trend[t.theme] || n.config,
|
|
36
|
+
defaultConfig: t
|
|
37
|
+
})
|
|
38
|
+
} : t;
|
|
39
|
+
}
|
|
40
|
+
B(() => n.config, (t) => {
|
|
41
|
+
e.value = S(), I();
|
|
42
|
+
}, { deep: !0 }), B(() => n.dataset, (t) => {
|
|
43
|
+
p.value = n.dataset.map((l) => [void 0, 1 / 0, -1 / 0, null, NaN].includes(l) ? null : l);
|
|
44
|
+
}, { deep: !0 });
|
|
45
|
+
function L(t) {
|
|
46
|
+
return t.map((l) => y(l));
|
|
47
|
+
}
|
|
48
|
+
const p = m(n.dataset.map((t) => e.value.style.animation.show || [void 0, 1 / 0, -1 / 0, null, NaN].includes(t) ? null : t)), g = m(!1), $ = m(null);
|
|
49
|
+
H(() => {
|
|
50
|
+
I();
|
|
51
|
+
let l = 1e3 / e.value.style.animation.animationFrames, d = performance.now();
|
|
52
|
+
if (e.value.style.animation.show && e.value.style.animation.animationFrames && n.dataset.length > 1) {
|
|
53
|
+
let T = function() {
|
|
54
|
+
g.value = !0;
|
|
55
|
+
let j = performance.now(), A = j - d;
|
|
56
|
+
A > l ? (d = j - A % l, f < n.dataset.length ? (p.value.push(n.dataset[f]), f += 1, $.value = requestAnimationFrame(T)) : (cancelAnimationFrame($.value), p.value = L(n.dataset), g.value = !1)) : $.value = requestAnimationFrame(T);
|
|
57
|
+
};
|
|
58
|
+
p.value = [];
|
|
59
|
+
let f = 0;
|
|
60
|
+
T();
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
function I() {
|
|
64
|
+
Y(n.dataset) && ee({
|
|
65
|
+
componentName: "VueUiSparkTrend",
|
|
66
|
+
type: "dataset"
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
const o = m({
|
|
70
|
+
height: 80,
|
|
71
|
+
width: 300
|
|
72
|
+
}), h = u(() => ({
|
|
73
|
+
top: e.value.style.padding.top,
|
|
74
|
+
left: e.value.style.padding.left,
|
|
75
|
+
right: o.value.width - e.value.style.padding.right,
|
|
76
|
+
bottom: o.value.height - e.value.style.padding.bottom,
|
|
77
|
+
height: o.value.height - (e.value.style.padding.top + e.value.style.padding.bottom) - (e.value.style.dataLabel.show ? e.value.style.dataLabel.fontSize : 0),
|
|
78
|
+
width: o.value.width - (e.value.style.padding.left + e.value.style.padding.right)
|
|
79
|
+
})), N = u(() => {
|
|
80
|
+
const t = L(n.dataset);
|
|
81
|
+
return {
|
|
82
|
+
max: Math.max(...t.map((l) => y(l))),
|
|
83
|
+
min: Math.min(...t.map((l) => y(l)))
|
|
84
|
+
};
|
|
85
|
+
}), b = u(() => {
|
|
86
|
+
const t = N.value.min >= 0 ? 0 : N.value.min;
|
|
87
|
+
return Math.abs(t);
|
|
88
|
+
}), W = u(() => N.value.max + b.value);
|
|
89
|
+
function F(t) {
|
|
90
|
+
return t / W.value;
|
|
91
|
+
}
|
|
92
|
+
const X = u(() => n.dataset.length), a = u(() => p.value.map((t, l) => {
|
|
93
|
+
const d = isNaN(t) || [void 0, null, "NaN", NaN, 1 / 0, -1 / 0].includes(t) ? 0 : t || 0;
|
|
94
|
+
return {
|
|
95
|
+
value: y(t),
|
|
96
|
+
absoluteValue: y(d),
|
|
97
|
+
plotValue: y(d + b.value),
|
|
98
|
+
toMax: F(d + b.value),
|
|
99
|
+
x: h.value.left + y(l * (h.value.width / (X.value - 1))) - e.value.style.padding.right,
|
|
100
|
+
y: h.value.bottom - y(h.value.height * F(d + b.value))
|
|
101
|
+
};
|
|
102
|
+
})), x = u(() => {
|
|
103
|
+
const t = L(n.dataset);
|
|
104
|
+
return e.value.style.trendLabel.trendType === "global" ? te(t) : e.value.style.trendLabel.trendType === "n-1" && t.length > 1 ? (t.at(-1) / t.at(-2) - 1) * 100 : e.value.style.trendLabel.trendType === "lastToFirst" ? (t.at(-1) / t[0] - 1) * 100 : 0;
|
|
105
|
+
}), w = u(() => g.value || x.value === 0 ? "neutral" : x.value > 0 ? "positive" : "negative"), r = u(() => e.value.style.arrow.colors[w.value]), Z = u(() => {
|
|
106
|
+
const t = { x: a.value[0].x, y: o.value.height - 6 }, l = { x: a.value[a.value.length - 1].x, y: o.value.height - 6 }, d = [];
|
|
107
|
+
return a.value.forEach((f) => {
|
|
108
|
+
d.push(`${f.x},${f.y} `);
|
|
109
|
+
}), [t.x, t.y, ...d, l.x, l.y].toString();
|
|
110
|
+
}), R = u(() => {
|
|
111
|
+
let t = [];
|
|
112
|
+
return a.value.forEach((l) => {
|
|
113
|
+
t.push(`${l.x},${l.y} `);
|
|
114
|
+
}), `M ${t.toString()}`;
|
|
115
|
+
});
|
|
116
|
+
return (t, l) => (s(), i("div", {
|
|
117
|
+
class: "vue-ui-spark-trend",
|
|
118
|
+
id: _.value,
|
|
119
|
+
style: V(`width:100%;font-family:${e.value.style.fontFamily};backgroundColor:${e.value.style.backgroundColor}`)
|
|
120
|
+
}, [
|
|
121
|
+
q.value ? (s(), i("svg", {
|
|
122
|
+
key: 1,
|
|
123
|
+
xmlns: c(ae),
|
|
124
|
+
viewBox: `0 0 ${o.value.width} ${o.value.height}`,
|
|
125
|
+
style: V(`width:100%;background:${e.value.style.backgroundColor};overflow:visible`)
|
|
126
|
+
}, [
|
|
127
|
+
k("defs", null, [
|
|
128
|
+
k("linearGradient", {
|
|
129
|
+
x1: "0%",
|
|
130
|
+
y1: "0%",
|
|
131
|
+
x2: "0%",
|
|
132
|
+
y2: "100%",
|
|
133
|
+
id: `pill_gradient_${_.value}`
|
|
134
|
+
}, [
|
|
135
|
+
k("stop", {
|
|
136
|
+
offset: "0%",
|
|
137
|
+
"stop-color": (e.value.style.line.useColorTrend ? r.value : e.value.style.line.stroke) + c(z)[e.value.style.area.opacity]
|
|
138
|
+
}, null, 8, ie),
|
|
139
|
+
k("stop", {
|
|
140
|
+
offset: "100%",
|
|
141
|
+
"stop-color": e.value.style.backgroundColor
|
|
142
|
+
}, null, 8, de)
|
|
143
|
+
], 8, re)
|
|
144
|
+
]),
|
|
145
|
+
e.value.style.area.show && a.value[0] ? (s(), i("g", ve, [
|
|
146
|
+
e.value.style.line.smooth ? (s(), i("path", {
|
|
147
|
+
key: 0,
|
|
148
|
+
d: `M ${a.value[0].x},${h.value.bottom} ${c(E)(a.value)} L ${a.value.at(-1).x},${h.value.bottom} Z`,
|
|
149
|
+
fill: e.value.style.area.useGradient ? `url(#pill_gradient_${_.value})` : `${e.value.style.line.useColorTrend ? r.value : e.value.style.line.stroke}${c(z)[e.value.style.area.opacity]}`,
|
|
150
|
+
stroke: "none"
|
|
151
|
+
}, null, 8, ce)) : (s(), i("path", {
|
|
152
|
+
key: 1,
|
|
153
|
+
d: `M${Z.value}Z`,
|
|
154
|
+
fill: e.value.style.area.useGradient ? `url(#pill_gradient_${_.value})` : `${e.value.style.line.useColorTrend ? r.value : e.value.style.line.stroke}${c(z)[e.value.style.area.opacity]}`,
|
|
155
|
+
stroke: "none"
|
|
156
|
+
}, null, 8, ye))
|
|
157
|
+
])) : v("", !0),
|
|
158
|
+
e.value.style.line.smooth && a.value.length ? (s(), i("path", {
|
|
159
|
+
key: 1,
|
|
160
|
+
d: `M ${c(E)(a.value)}`,
|
|
161
|
+
stroke: e.value.style.line.useColorTrend ? r.value : e.value.style.line.stroke,
|
|
162
|
+
fill: "none",
|
|
163
|
+
"stroke-width": e.value.style.line.strokeWidth,
|
|
164
|
+
"stroke-linecap": e.value.style.line.strokeLinecap,
|
|
165
|
+
"stroke-linejoin": e.value.style.line.strokeLinejoin
|
|
166
|
+
}, null, 8, he)) : v("", !0),
|
|
167
|
+
!e.value.style.line.smooth && a.value.length ? (s(), i("path", {
|
|
168
|
+
key: 2,
|
|
169
|
+
d: R.value,
|
|
170
|
+
stroke: e.value.style.line.useColorTrend ? r.value : e.value.style.line.stroke,
|
|
171
|
+
fill: "none",
|
|
172
|
+
"stroke-width": e.value.style.line.strokeWidth,
|
|
173
|
+
"stroke-linecap": e.value.style.line.strokeLinecap,
|
|
174
|
+
"stroke-linejoin": e.value.style.line.strokeLinejoin
|
|
175
|
+
}, null, 8, fe)) : v("", !0),
|
|
176
|
+
g.value ? v("", !0) : (s(), i("foreignObject", {
|
|
177
|
+
key: 3,
|
|
178
|
+
height: o.value.height / 2,
|
|
179
|
+
width: o.value.height / 2,
|
|
180
|
+
x: o.value.height / 5,
|
|
181
|
+
y: 8
|
|
182
|
+
}, [
|
|
183
|
+
k("div", ge, [
|
|
184
|
+
w.value === "positive" ? (s(), C(M, {
|
|
185
|
+
key: 0,
|
|
186
|
+
stroke: r.value,
|
|
187
|
+
name: "arrowTop",
|
|
188
|
+
size: o.value.height / 2
|
|
189
|
+
}, null, 8, ["stroke", "size"])) : v("", !0),
|
|
190
|
+
w.value === "negative" ? (s(), C(M, {
|
|
191
|
+
key: 1,
|
|
192
|
+
stroke: r.value,
|
|
193
|
+
name: "arrowBottom",
|
|
194
|
+
size: o.value.height / 2
|
|
195
|
+
}, null, 8, ["stroke", "size"])) : v("", !0),
|
|
196
|
+
w.value === "neutral" ? (s(), C(M, {
|
|
197
|
+
key: 2,
|
|
198
|
+
stroke: r.value,
|
|
199
|
+
name: "arrowRight",
|
|
200
|
+
size: o.value.height / 2
|
|
201
|
+
}, null, 8, ["stroke", "size"])) : v("", !0)
|
|
202
|
+
])
|
|
203
|
+
], 8, pe)),
|
|
204
|
+
g.value ? v("", !0) : (s(), i("text", {
|
|
205
|
+
key: 4,
|
|
206
|
+
x: o.value.height / 2 - o.value.height / 20,
|
|
207
|
+
y: h.value.bottom,
|
|
208
|
+
"text-anchor": "middle",
|
|
209
|
+
fill: e.value.style.trendLabel.useColorTrend ? r.value : e.value.style.trendLabel.color,
|
|
210
|
+
"font-size": e.value.style.trendLabel.fontSize,
|
|
211
|
+
"font-weight": e.value.style.trendLabel.bold ? "bold" : "normal"
|
|
212
|
+
}, D(c(G)({
|
|
213
|
+
p: x.value > 0 ? "+" : "",
|
|
214
|
+
v: x.value,
|
|
215
|
+
s: "%",
|
|
216
|
+
r: e.value.style.trendLabel.rounding
|
|
217
|
+
})), 9, me)),
|
|
218
|
+
a.value.length && a.value.at(-1).x !== void 0 ? (s(), i("circle", {
|
|
219
|
+
key: 5,
|
|
220
|
+
stroke: e.value.style.backgroundColor,
|
|
221
|
+
"stroke-width": 2,
|
|
222
|
+
cx: a.value.at(-1).x,
|
|
223
|
+
cy: a.value.at(-1).y,
|
|
224
|
+
r: 4,
|
|
225
|
+
fill: r.value
|
|
226
|
+
}, null, 8, ke)) : v("", !0),
|
|
227
|
+
a.value.length && a.value.at(-1).x !== void 0 && e.value.style.dataLabel.show ? (s(), i("text", {
|
|
228
|
+
key: 6,
|
|
229
|
+
"text-anchor": "middle",
|
|
230
|
+
x: a.value.at(-1).x,
|
|
231
|
+
y: a.value.at(-1).y - e.value.style.dataLabel.fontSize / 1.5,
|
|
232
|
+
"font-size": e.value.style.dataLabel.fontSize,
|
|
233
|
+
fill: e.value.style.dataLabel.useColorTrend ? r.value : e.value.style.dataLabel.color,
|
|
234
|
+
"font-weight": e.value.style.dataLabel.bold ? "bold" : "normal"
|
|
235
|
+
}, D(c(le)(
|
|
236
|
+
e.value.style.dataLabel.formatter,
|
|
237
|
+
a.value.at(-1).value,
|
|
238
|
+
c(G)({
|
|
239
|
+
p: e.value.style.dataLabel.prefix,
|
|
240
|
+
v: a.value.at(-1).value,
|
|
241
|
+
s: e.value.style.dataLabel.suffix,
|
|
242
|
+
r: e.value.style.dataLabel.rounding
|
|
243
|
+
}),
|
|
244
|
+
{ datapoint: a.value.at(-1) }
|
|
245
|
+
)), 9, _e)) : v("", !0)
|
|
246
|
+
], 12, ue)) : (s(), C(ne, {
|
|
247
|
+
key: 0,
|
|
248
|
+
config: {
|
|
249
|
+
type: "sparkline",
|
|
250
|
+
style: {
|
|
251
|
+
backgroundColor: e.value.style.backgroundColor,
|
|
252
|
+
sparkline: {
|
|
253
|
+
color: "#CCCCCC"
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}, null, 8, ["config"]))
|
|
258
|
+
], 12, se));
|
|
259
|
+
}
|
|
260
|
+
}, Te = /* @__PURE__ */ oe(be, [["__scopeId", "data-v-8e661d1a"]]);
|
|
261
|
+
export {
|
|
262
|
+
Te as default
|
|
263
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-DYUBiaGS.cjs"),$=require("./useNestedProp-w7AMWWmz.cjs"),N=require("./BaseIcon--PMhZ3f-.cjs"),F=require("./vue-ui-skeleton-ClpTCY1x.cjs"),j=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),q=["id"],A=["xmlns","viewBox"],D=["id"],P=["stop-color"],G=["stop-color"],O={key:0},U=["d","fill"],W=["d","fill"],Z=["d","stroke","stroke-width","stroke-linecap","stroke-linejoin"],H=["d","stroke","stroke-width","stroke-linecap","stroke-linejoin"],R=["height","width","x"],X={style:{width:"100%"}},J=["x","y","fill","font-size","font-weight"],K=["stroke","cx","cy","fill"],Q=["x","y","font-size","fill","font-weight"],Y={__name:"vue-ui-spark-trend",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(V){const u=V,{vue_ui_spark_trend:E}=o.useConfig(),S=e.computed(()=>!!u.dataset&&u.dataset.length),y=e.ref(o.createUid()),t=e.computed({get:()=>x(),set:l=>l});function x(){const l=$.useNestedProp({userConfig:u.config,defaultConfig:E});return l.theme?{...$.useNestedProp({userConfig:o.themes.vue_ui_spark_trend[l.theme]||u.config,defaultConfig:l})}:l}e.watch(()=>u.config,l=>{t.value=x(),C()},{deep:!0}),e.watch(()=>u.dataset,l=>{v.value=u.dataset.map(n=>[void 0,1/0,-1/0,null,NaN].includes(n)?null:n)},{deep:!0});function k(l){return l.map(n=>o.checkNaN(n))}const v=e.ref(u.dataset.map(l=>t.value.style.animation.show||[void 0,1/0,-1/0,null,NaN].includes(l)?null:l)),h=e.ref(!1),g=e.ref(null);e.onMounted(()=>{C();let n=1e3/t.value.style.animation.animationFrames,i=performance.now();if(t.value.style.animation.show&&t.value.style.animation.animationFrames&&u.dataset.length>1){let b=function(){h.value=!0;let B=performance.now(),L=B-i;L>n?(i=B-L%n,d<u.dataset.length?(v.value.push(u.dataset[d]),d+=1,g.value=requestAnimationFrame(b)):(cancelAnimationFrame(g.value),v.value=k(u.dataset),h.value=!1)):g.value=requestAnimationFrame(b)};v.value=[];let d=0;b()}});function C(){o.objectIsEmpty(u.dataset)&&o.error({componentName:"VueUiSparkTrend",type:"dataset"})}const r=e.ref({height:80,width:300}),c=e.computed(()=>({top:t.value.style.padding.top,left:t.value.style.padding.left,right:r.value.width-t.value.style.padding.right,bottom:r.value.height-t.value.style.padding.bottom,height:r.value.height-(t.value.style.padding.top+t.value.style.padding.bottom)-(t.value.style.dataLabel.show?t.value.style.dataLabel.fontSize:0),width:r.value.width-(t.value.style.padding.left+t.value.style.padding.right)})),_=e.computed(()=>{const l=k(u.dataset);return{max:Math.max(...l.map(n=>o.checkNaN(n))),min:Math.min(...l.map(n=>o.checkNaN(n)))}}),p=e.computed(()=>{const l=_.value.min>=0?0:_.value.min;return Math.abs(l)}),T=e.computed(()=>_.value.max+p.value);function w(l){return l/T.value}const z=e.computed(()=>u.dataset.length),a=e.computed(()=>v.value.map((l,n)=>{const i=isNaN(l)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l)?0:l||0;return{value:o.checkNaN(l),absoluteValue:o.checkNaN(i),plotValue:o.checkNaN(i+p.value),toMax:w(i+p.value),x:c.value.left+o.checkNaN(n*(c.value.width/(z.value-1)))-t.value.style.padding.right,y:c.value.bottom-o.checkNaN(c.value.height*w(i+p.value))}})),f=e.computed(()=>{const l=k(u.dataset);return t.value.style.trendLabel.trendType==="global"?o.calcTrend(l):t.value.style.trendLabel.trendType==="n-1"&&l.length>1?(l.at(-1)/l.at(-2)-1)*100:t.value.style.trendLabel.trendType==="lastToFirst"?(l.at(-1)/l[0]-1)*100:0}),m=e.computed(()=>h.value||f.value===0?"neutral":f.value>0?"positive":"negative"),s=e.computed(()=>t.value.style.arrow.colors[m.value]),M=e.computed(()=>{const l={x:a.value[0].x,y:r.value.height-6},n={x:a.value[a.value.length-1].x,y:r.value.height-6},i=[];return a.value.forEach(d=>{i.push(`${d.x},${d.y} `)}),[l.x,l.y,...i,n.x,n.y].toString()}),I=e.computed(()=>{let l=[];return a.value.forEach(n=>{l.push(`${n.x},${n.y} `)}),`M ${l.toString()}`});return(l,n)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-spark-trend",id:y.value,style:e.normalizeStyle(`width:100%;font-family:${t.value.style.fontFamily};backgroundColor:${t.value.style.backgroundColor}`)},[S.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(o.XMLNS),viewBox:`0 0 ${r.value.width} ${r.value.height}`,style:e.normalizeStyle(`width:100%;background:${t.value.style.backgroundColor};overflow:visible`)},[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{x1:"0%",y1:"0%",x2:"0%",y2:"100%",id:`pill_gradient_${y.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":(t.value.style.line.useColorTrend?s.value:t.value.style.line.stroke)+e.unref(o.opacity)[t.value.style.area.opacity]},null,8,P),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.backgroundColor},null,8,G)],8,D)]),t.value.style.area.show&&a.value[0]?(e.openBlock(),e.createElementBlock("g",O,[t.value.style.line.smooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:`M ${a.value[0].x},${c.value.bottom} ${e.unref(o.createSmoothPath)(a.value)} L ${a.value.at(-1).x},${c.value.bottom} Z`,fill:t.value.style.area.useGradient?`url(#pill_gradient_${y.value})`:`${t.value.style.line.useColorTrend?s.value:t.value.style.line.stroke}${e.unref(o.opacity)[t.value.style.area.opacity]}`,stroke:"none"},null,8,U)):(e.openBlock(),e.createElementBlock("path",{key:1,d:`M${M.value}Z`,fill:t.value.style.area.useGradient?`url(#pill_gradient_${y.value})`:`${t.value.style.line.useColorTrend?s.value:t.value.style.line.stroke}${e.unref(o.opacity)[t.value.style.area.opacity]}`,stroke:"none"},null,8,W))])):e.createCommentVNode("",!0),t.value.style.line.smooth&&a.value.length?(e.openBlock(),e.createElementBlock("path",{key:1,d:`M ${e.unref(o.createSmoothPath)(a.value)}`,stroke:t.value.style.line.useColorTrend?s.value:t.value.style.line.stroke,fill:"none","stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":t.value.style.line.strokeLinecap,"stroke-linejoin":t.value.style.line.strokeLinejoin},null,8,Z)):e.createCommentVNode("",!0),!t.value.style.line.smooth&&a.value.length?(e.openBlock(),e.createElementBlock("path",{key:2,d:I.value,stroke:t.value.style.line.useColorTrend?s.value:t.value.style.line.stroke,fill:"none","stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":t.value.style.line.strokeLinecap,"stroke-linejoin":t.value.style.line.strokeLinejoin},null,8,H)):e.createCommentVNode("",!0),h.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("foreignObject",{key:3,height:r.value.height/2,width:r.value.height/2,x:r.value.height/5,y:8},[e.createElementVNode("div",X,[m.value==="positive"?(e.openBlock(),e.createBlock(N.default,{key:0,stroke:s.value,name:"arrowTop",size:r.value.height/2},null,8,["stroke","size"])):e.createCommentVNode("",!0),m.value==="negative"?(e.openBlock(),e.createBlock(N.default,{key:1,stroke:s.value,name:"arrowBottom",size:r.value.height/2},null,8,["stroke","size"])):e.createCommentVNode("",!0),m.value==="neutral"?(e.openBlock(),e.createBlock(N.default,{key:2,stroke:s.value,name:"arrowRight",size:r.value.height/2},null,8,["stroke","size"])):e.createCommentVNode("",!0)])],8,R)),h.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("text",{key:4,x:r.value.height/2-r.value.height/20,y:c.value.bottom,"text-anchor":"middle",fill:t.value.style.trendLabel.useColorTrend?s.value:t.value.style.trendLabel.color,"font-size":t.value.style.trendLabel.fontSize,"font-weight":t.value.style.trendLabel.bold?"bold":"normal"},e.toDisplayString(e.unref(o.dataLabel)({p:f.value>0?"+":"",v:f.value,s:"%",r:t.value.style.trendLabel.rounding})),9,J)),a.value.length&&a.value.at(-1).x!==void 0?(e.openBlock(),e.createElementBlock("circle",{key:5,stroke:t.value.style.backgroundColor,"stroke-width":2,cx:a.value.at(-1).x,cy:a.value.at(-1).y,r:4,fill:s.value},null,8,K)):e.createCommentVNode("",!0),a.value.length&&a.value.at(-1).x!==void 0&&t.value.style.dataLabel.show?(e.openBlock(),e.createElementBlock("text",{key:6,"text-anchor":"middle",x:a.value.at(-1).x,y:a.value.at(-1).y-t.value.style.dataLabel.fontSize/1.5,"font-size":t.value.style.dataLabel.fontSize,fill:t.value.style.dataLabel.useColorTrend?s.value:t.value.style.dataLabel.color,"font-weight":t.value.style.dataLabel.bold?"bold":"normal"},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.dataLabel.formatter,a.value.at(-1).value,e.unref(o.dataLabel)({p:t.value.style.dataLabel.prefix,v:a.value.at(-1).value,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.rounding}),{datapoint:a.value.at(-1)})),9,Q)):e.createCommentVNode("",!0)],12,A)):(e.openBlock(),e.createBlock(F.default,{key:0,config:{type:"sparkline",style:{backgroundColor:t.value.style.backgroundColor,sparkline:{color:"#CCCCCC"}}}},null,8,["config"]))],12,q))}},ee=j._export_sfc(Y,[["__scopeId","data-v-8e661d1a"]]);exports.default=ee;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { computed as g, ref as x,
|
|
2
|
-
import { u as
|
|
3
|
-
import { u as
|
|
4
|
-
import
|
|
5
|
-
const ie = ["onClick"],
|
|
1
|
+
import { computed as g, ref as x, watch as P, onMounted as q, nextTick as H, openBlock as r, createElementBlock as v, normalizeStyle as p, unref as s, renderSlot as z, normalizeProps as L, mergeProps as X, createCommentVNode as d, createElementVNode as c, toDisplayString as f, Fragment as T, renderList as R, guardReactiveProps as J, createBlock as K } from "vue";
|
|
2
|
+
import { u as Q, c as Y, t as Z, a as ee, p as k, b as te, o as le, e as E, g as ae, d as oe, w as b, i as w, f as C, X as se, v as ue } from "./index-Cm4Iry5c.js";
|
|
3
|
+
import { u as O } from "./useNestedProp-CurQIHTa.js";
|
|
4
|
+
import ne from "./vue-ui-skeleton-C1oUnz7R.js";
|
|
5
|
+
const ie = ["onClick"], re = { key: 1 }, ve = ["xmlns", "viewBox"], ce = ["id"], de = ["stop-color"], pe = ["stop-color"], fe = ["height", "width", "fill", "rx"], ye = ["height", "width", "fill", "rx"], me = ["height", "width", "fill", "rx"], we = {
|
|
6
6
|
__name: "vue-ui-sparkbar",
|
|
7
7
|
props: {
|
|
8
8
|
config: {
|
|
@@ -26,98 +26,106 @@ const ie = ["onClick"], ne = { key: 1 }, re = ["xmlns", "viewBox"], ve = ["id"],
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
emits: ["selectDatapoint"],
|
|
29
|
-
setup(
|
|
30
|
-
const a =
|
|
31
|
-
|
|
29
|
+
setup(_, { emit: V }) {
|
|
30
|
+
const a = _, { vue_ui_sparkbar: B } = Q(), $ = g(() => !!a.dataset && a.dataset.length), S = x(Y()), e = g({
|
|
31
|
+
get: () => A(),
|
|
32
|
+
set: (t) => t
|
|
33
|
+
});
|
|
34
|
+
function A() {
|
|
35
|
+
const t = O({
|
|
32
36
|
userConfig: a.config,
|
|
33
|
-
defaultConfig:
|
|
37
|
+
defaultConfig: B
|
|
34
38
|
});
|
|
35
39
|
return t.theme ? {
|
|
36
|
-
...
|
|
37
|
-
userConfig:
|
|
40
|
+
...O({
|
|
41
|
+
userConfig: Z.vue_ui_sparkbar[t.theme] || a.config,
|
|
38
42
|
defaultConfig: t
|
|
39
43
|
}),
|
|
40
|
-
customPalette:
|
|
44
|
+
customPalette: ee[t.theme] || k
|
|
41
45
|
} : t;
|
|
42
|
-
}
|
|
46
|
+
}
|
|
47
|
+
P(() => a.config, (t) => {
|
|
48
|
+
e.value = A();
|
|
49
|
+
}, { deep: !0 });
|
|
50
|
+
const M = g(() => te(e.value.customPalette)), y = x(a.dataset.map((t) => ({
|
|
43
51
|
...t,
|
|
44
52
|
value: e.value.style.animation.show ? 0 : t.value || 0,
|
|
45
53
|
formatter: t.formatter || null
|
|
46
|
-
}))),
|
|
47
|
-
|
|
48
|
-
|
|
54
|
+
}))), D = x(null);
|
|
55
|
+
q(async () => {
|
|
56
|
+
le(a.dataset) && E({
|
|
49
57
|
componentName: "VueUiSparkbar",
|
|
50
58
|
type: "dataset"
|
|
51
|
-
}),
|
|
59
|
+
}), F();
|
|
52
60
|
});
|
|
53
|
-
function
|
|
61
|
+
function F() {
|
|
54
62
|
if (e.value.style.animation.show) {
|
|
55
|
-
let
|
|
56
|
-
|
|
63
|
+
let I = function() {
|
|
64
|
+
i += l / t, i < l ? (y.value = y.value.map((u, h) => ({
|
|
57
65
|
...u,
|
|
58
66
|
value: u.value += o[h]
|
|
59
|
-
})),
|
|
67
|
+
})), D.value = requestAnimationFrame(I)) : y.value = a.dataset.map((u) => ({
|
|
60
68
|
...u,
|
|
61
69
|
value: u.value || 0,
|
|
62
70
|
formatter: u.formatter || null
|
|
63
71
|
}));
|
|
64
72
|
};
|
|
65
73
|
const t = e.value.style.animation.animationFrames, o = a.dataset.map((u, h) => u.value / t), l = a.dataset.map((u) => u.value || 0).reduce((u, h) => u + h, 0);
|
|
66
|
-
let
|
|
67
|
-
|
|
74
|
+
let i = 0;
|
|
75
|
+
I();
|
|
68
76
|
}
|
|
69
77
|
}
|
|
70
|
-
|
|
71
|
-
cancelAnimationFrame(
|
|
78
|
+
P(() => a.dataset, async (t) => {
|
|
79
|
+
cancelAnimationFrame(D.value), y.value = a.dataset.map((o) => ({
|
|
72
80
|
...o,
|
|
73
81
|
value: e.value.style.animation.show ? 0 : o.value || 0,
|
|
74
82
|
formatter: o.formatter || null
|
|
75
|
-
})),
|
|
83
|
+
})), H(F);
|
|
76
84
|
}, { deep: !0 });
|
|
77
|
-
const
|
|
85
|
+
const n = x({
|
|
78
86
|
width: 500,
|
|
79
87
|
height: 16
|
|
80
|
-
}),
|
|
81
|
-
|
|
88
|
+
}), U = g(() => Math.max(...a.dataset.map((t) => t.value))), j = g(() => (a.dataset.forEach((t, o) => {
|
|
89
|
+
ae({
|
|
82
90
|
datasetObject: t,
|
|
83
91
|
requiredAttributes: ["name", "value"]
|
|
84
92
|
}).forEach((l) => {
|
|
85
|
-
|
|
93
|
+
E({
|
|
86
94
|
componentName: "VueUiSparkbar",
|
|
87
95
|
type: "datasetSerieAttribute",
|
|
88
96
|
property: l,
|
|
89
97
|
index: o
|
|
90
98
|
});
|
|
91
99
|
});
|
|
92
|
-
}),
|
|
100
|
+
}), y.value.map((t, o) => ({
|
|
93
101
|
...t,
|
|
94
102
|
value: t.value || 0,
|
|
95
|
-
color:
|
|
103
|
+
color: oe(t.color) || M.value[o] || k[o] || k[o % k.length]
|
|
96
104
|
}))));
|
|
97
|
-
function
|
|
98
|
-
return t /
|
|
105
|
+
function G(t) {
|
|
106
|
+
return t / U.value;
|
|
99
107
|
}
|
|
100
|
-
function
|
|
101
|
-
return e.value.style.layout.independant ? t.target ? t.value / t.target : e.value.style.layout.percentage ? t.value > 100 ? 1 : t.value / 100 : e.value.style.layout.target === 0 ? 1 : t.value / e.value.style.layout.target :
|
|
108
|
+
function N(t) {
|
|
109
|
+
return e.value.style.layout.independant ? t.target ? t.value / t.target : e.value.style.layout.percentage ? t.value > 100 ? 1 : t.value / 100 : e.value.style.layout.target === 0 ? 1 : t.value / e.value.style.layout.target : G(t.value);
|
|
102
110
|
}
|
|
103
111
|
function m(t) {
|
|
104
112
|
return e.value.style.layout.independant && t.target || e.value.style.layout.target;
|
|
105
113
|
}
|
|
106
|
-
function
|
|
107
|
-
|
|
114
|
+
function W(t, o) {
|
|
115
|
+
V("selectDatapoint", { datapoint: t, index: o });
|
|
108
116
|
}
|
|
109
117
|
return (t, o) => (r(), v("div", {
|
|
110
|
-
style:
|
|
118
|
+
style: p({
|
|
111
119
|
width: "100%",
|
|
112
120
|
fontFamily: e.value.style.fontFamily,
|
|
113
|
-
background: e.value.style.backgroundColor + s(
|
|
121
|
+
background: e.value.style.backgroundColor + s(b)[a.backgroundOpacity]
|
|
114
122
|
})
|
|
115
123
|
}, [
|
|
116
|
-
t.$slots.title ?
|
|
124
|
+
t.$slots.title ? z(t.$slots, "title", L(X({ key: 0 }, { title: { ...t.title, title: e.value.style.title.text, subtitle: e.value.style.title.subtitle.text } }))) : d("", !0),
|
|
117
125
|
!t.$slots.title && e.value.style.title.text ? (r(), v("div", {
|
|
118
126
|
key: 1,
|
|
119
127
|
class: "vue-ui-sparkbar-title-container",
|
|
120
|
-
style:
|
|
128
|
+
style: p({
|
|
121
129
|
background: e.value.style.title.backgroundColor,
|
|
122
130
|
margin: e.value.style.title.margin,
|
|
123
131
|
textAlign: e.value.style.title.textAlign
|
|
@@ -125,57 +133,57 @@ const ie = ["onClick"], ne = { key: 1 }, re = ["xmlns", "viewBox"], ve = ["id"],
|
|
|
125
133
|
}, [
|
|
126
134
|
c("div", {
|
|
127
135
|
class: "vue-ui-sparkbar-title",
|
|
128
|
-
style:
|
|
136
|
+
style: p({
|
|
129
137
|
fontSize: e.value.style.title.fontSize + "px",
|
|
130
138
|
color: e.value.style.title.color,
|
|
131
139
|
fontWeight: e.value.style.title.bold ? "bold" : "normal"
|
|
132
140
|
})
|
|
133
|
-
},
|
|
141
|
+
}, f(e.value.style.title.text), 5),
|
|
134
142
|
e.value.style.title.subtitle.text ? (r(), v("div", {
|
|
135
143
|
key: 0,
|
|
136
144
|
class: "vue-ui-sparkbar-subtitle",
|
|
137
|
-
style:
|
|
145
|
+
style: p({
|
|
138
146
|
fontSize: e.value.style.title.subtitle.fontSize + "px",
|
|
139
147
|
color: e.value.style.title.subtitle.color,
|
|
140
148
|
fontWeight: e.value.style.title.subtitle.bold ? "bold" : "normal"
|
|
141
149
|
})
|
|
142
|
-
},
|
|
150
|
+
}, f(e.value.style.title.subtitle.text), 5)) : d("", !0)
|
|
143
151
|
], 4)) : d("", !0),
|
|
144
|
-
(r(!0), v(
|
|
152
|
+
(r(!0), v(T, null, R(j.value, (l, i) => (r(), v(T, null, [
|
|
145
153
|
$.value ? (r(), v("div", {
|
|
146
154
|
key: 0,
|
|
147
|
-
style:
|
|
148
|
-
onClick: () =>
|
|
155
|
+
style: p(`display:flex !important;${["left", "right"].includes(e.value.style.labels.name.position) ? `flex-direction: ${e.value.style.labels.name.position === "right" ? "row-reverse" : "row"} !important` : "flex-direction:column !important"};gap:${e.value.style.gap}px !important;align-items:center;${_.dataset.length > 0 && i !== _.dataset.length - 1 ? "margin-bottom:6px" : ""}`),
|
|
156
|
+
onClick: () => W(l, i)
|
|
149
157
|
}, [
|
|
150
|
-
|
|
158
|
+
z(t.$slots, "data-label", L(J({ bar: {
|
|
151
159
|
...l,
|
|
152
160
|
target: m(l),
|
|
153
161
|
valueLabel: s(w)(
|
|
154
162
|
l.formatter,
|
|
155
163
|
l.value,
|
|
156
|
-
s(
|
|
164
|
+
s(C)({
|
|
157
165
|
p: l.prefix || "",
|
|
158
166
|
v: l.value,
|
|
159
167
|
s: l.suffix || "",
|
|
160
168
|
r: l.rounding || 0
|
|
161
169
|
}),
|
|
162
|
-
{ datapoint: l, seriesIndex:
|
|
170
|
+
{ datapoint: l, seriesIndex: i }
|
|
163
171
|
),
|
|
164
172
|
targetLabel: s(w)(
|
|
165
173
|
l.formatter,
|
|
166
174
|
m(l),
|
|
167
|
-
s(
|
|
175
|
+
s(C)({
|
|
168
176
|
p: l.prefix || "",
|
|
169
177
|
v: m(l),
|
|
170
178
|
s: l.suffix || "",
|
|
171
179
|
r: l.rounding || 0
|
|
172
180
|
}),
|
|
173
|
-
{ datapoint: l, seriesIndex:
|
|
181
|
+
{ datapoint: l, seriesIndex: i }
|
|
174
182
|
)
|
|
175
183
|
} }))),
|
|
176
184
|
t.$slots["data-label"] ? d("", !0) : (r(), v("div", {
|
|
177
185
|
key: 0,
|
|
178
|
-
style:
|
|
186
|
+
style: p({
|
|
179
187
|
width: e.value.style.labels.name.width,
|
|
180
188
|
color: e.value.style.labels.name.color,
|
|
181
189
|
fontSize: e.value.style.labels.fontSize + "px",
|
|
@@ -183,36 +191,36 @@ const ie = ["onClick"], ne = { key: 1 }, re = ["xmlns", "viewBox"], ve = ["id"],
|
|
|
183
191
|
textAlign: ["left", "right"].includes(e.value.style.labels.name.position) || ["top", "top-left"].includes(e.value.style.labels.name.position) ? "left" : e.value.style.labels.name.position === "top-center" ? "center" : "right"
|
|
184
192
|
})
|
|
185
193
|
}, [
|
|
186
|
-
c("span", null,
|
|
194
|
+
c("span", null, f(l.name), 1),
|
|
187
195
|
e.value.style.labels.value.show ? (r(), v("span", {
|
|
188
196
|
key: 0,
|
|
189
|
-
style:
|
|
190
|
-
}, ": " +
|
|
197
|
+
style: p(`font-weight:${e.value.style.labels.value.bold ? "bold" : "normal"}`)
|
|
198
|
+
}, ": " + f(s(w)(
|
|
191
199
|
l.formatter,
|
|
192
200
|
l.value,
|
|
193
|
-
s(
|
|
201
|
+
s(C)({
|
|
194
202
|
p: l.prefix || "",
|
|
195
203
|
v: l.value,
|
|
196
204
|
s: l.suffix || "",
|
|
197
205
|
r: l.rounding || 0
|
|
198
206
|
}),
|
|
199
|
-
{ datapoint: l, seriesIndex:
|
|
207
|
+
{ datapoint: l, seriesIndex: i }
|
|
200
208
|
)), 5)) : d("", !0),
|
|
201
|
-
e.value.style.layout.showTargetValue ? (r(), v("span",
|
|
209
|
+
e.value.style.layout.showTargetValue ? (r(), v("span", re, f(" " + e.value.style.layout.targetValueText) + " " + f(s(w)(
|
|
202
210
|
l.formatter,
|
|
203
211
|
m(l),
|
|
204
|
-
s(
|
|
212
|
+
s(C)({
|
|
205
213
|
p: l.prefix || "",
|
|
206
214
|
v: m(l),
|
|
207
215
|
s: l.suffix || "",
|
|
208
216
|
r: l.rounding || 0
|
|
209
217
|
}),
|
|
210
|
-
{ datapoint: l, seriesIndex:
|
|
218
|
+
{ datapoint: l, seriesIndex: i }
|
|
211
219
|
)), 1)) : d("", !0)
|
|
212
220
|
], 4)),
|
|
213
221
|
(r(), v("svg", {
|
|
214
|
-
xmlns: s(
|
|
215
|
-
viewBox: `0 0 ${
|
|
222
|
+
xmlns: s(se),
|
|
223
|
+
viewBox: `0 0 ${n.value.width} ${n.value.height}`,
|
|
216
224
|
width: "100%"
|
|
217
225
|
}, [
|
|
218
226
|
c("defs", null, [
|
|
@@ -221,46 +229,46 @@ const ie = ["onClick"], ne = { key: 1 }, re = ["xmlns", "viewBox"], ve = ["id"],
|
|
|
221
229
|
y1: "0%",
|
|
222
230
|
x2: "100%",
|
|
223
231
|
y2: "0%",
|
|
224
|
-
id: `sparkbar_gradient_${
|
|
232
|
+
id: `sparkbar_gradient_${i}_${S.value}`
|
|
225
233
|
}, [
|
|
226
234
|
c("stop", {
|
|
227
235
|
offset: "0%",
|
|
228
|
-
"stop-color": `${s(
|
|
229
|
-
}, null, 8,
|
|
236
|
+
"stop-color": `${s(ue)(l.color, 0.03)}${s(b)[100 - e.value.style.bar.gradient.intensity]}`
|
|
237
|
+
}, null, 8, de),
|
|
230
238
|
c("stop", {
|
|
231
239
|
offset: "100%",
|
|
232
240
|
"stop-color": l.color
|
|
233
|
-
}, null, 8,
|
|
234
|
-
], 8,
|
|
241
|
+
}, null, 8, pe)
|
|
242
|
+
], 8, ce)
|
|
235
243
|
]),
|
|
236
244
|
c("rect", {
|
|
237
|
-
height:
|
|
238
|
-
width:
|
|
245
|
+
height: n.value.height,
|
|
246
|
+
width: n.value.width,
|
|
239
247
|
x: 0,
|
|
240
248
|
y: 0,
|
|
241
|
-
fill: `${e.value.style.gutter.backgroundColor}${s(
|
|
242
|
-
rx:
|
|
243
|
-
}, null, 8,
|
|
249
|
+
fill: `${e.value.style.gutter.backgroundColor}${s(b)[e.value.style.gutter.opacity]}`,
|
|
250
|
+
rx: n.value.height / 2
|
|
251
|
+
}, null, 8, fe),
|
|
244
252
|
c("rect", {
|
|
245
|
-
height:
|
|
246
|
-
width:
|
|
253
|
+
height: n.value.height,
|
|
254
|
+
width: n.value.width * N(l),
|
|
247
255
|
x: 0,
|
|
248
256
|
y: 0,
|
|
249
257
|
fill: e.value.style.bar.gradient.underlayerColor,
|
|
250
|
-
rx:
|
|
251
|
-
}, null, 8,
|
|
258
|
+
rx: n.value.height / 2
|
|
259
|
+
}, null, 8, ye),
|
|
252
260
|
c("rect", {
|
|
253
|
-
height:
|
|
254
|
-
width:
|
|
261
|
+
height: n.value.height,
|
|
262
|
+
width: n.value.width * N(l),
|
|
255
263
|
x: 0,
|
|
256
264
|
y: 0,
|
|
257
|
-
fill: e.value.style.bar.gradient.show ? `url(#sparkbar_gradient_${
|
|
258
|
-
rx:
|
|
259
|
-
}, null, 8,
|
|
260
|
-
], 8,
|
|
265
|
+
fill: e.value.style.bar.gradient.show ? `url(#sparkbar_gradient_${i}_${S.value})` : l.color,
|
|
266
|
+
rx: n.value.height / 2
|
|
267
|
+
}, null, 8, me)
|
|
268
|
+
], 8, ve))
|
|
261
269
|
], 12, ie)) : d("", !0)
|
|
262
270
|
], 64))), 256)),
|
|
263
|
-
$.value ? d("", !0) : (r(),
|
|
271
|
+
$.value ? d("", !0) : (r(), K(ne, {
|
|
264
272
|
key: 2,
|
|
265
273
|
config: {
|
|
266
274
|
type: "sparkbar",
|
|
@@ -276,5 +284,5 @@ const ie = ["onClick"], ne = { key: 1 }, re = ["xmlns", "viewBox"], ve = ["id"],
|
|
|
276
284
|
}
|
|
277
285
|
};
|
|
278
286
|
export {
|
|
279
|
-
|
|
287
|
+
we as default
|
|
280
288
|
};
|