vue-data-ui 2.3.43 → 2.3.44
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/README.md +1 -1
- package/dist/{Arrow-BX4nehl3.cjs → Arrow-lVmaBZkc.cjs} +1 -1
- package/dist/{Arrow-CWpE_zpe.js → Arrow-nNje1ulZ.js} +1 -1
- package/dist/{BaseIcon-CvUiZjEX.js → BaseIcon-CKfFgKNf.js} +1 -1
- package/dist/{BaseIcon-DExFkY_J.cjs → BaseIcon-DVZfZ-bL.cjs} +1 -1
- package/dist/{DataTable-DxcXjsBO.js → DataTable-BRBTZQqC.js} +2 -2
- package/dist/{DataTable-BwXjoB6L.cjs → DataTable-C1-LQ9kU.cjs} +1 -1
- package/dist/{Legend-WlisJgNx.js → Legend-CBclUqQE.js} +1 -1
- package/dist/{Legend-CsoM5Opb.cjs → Legend-Wzo5EwiV.cjs} +1 -1
- package/dist/{Shape-BFjPrzUQ.cjs → Shape-B0yFykoL.cjs} +1 -1
- package/dist/{Shape-KaYj09DC.js → Shape-COYrBpTA.js} +1 -1
- package/dist/{Slicer-CdefiSuP.js → Slicer-DeKlCzs9.js} +1 -1
- package/dist/{Slicer-CMyTqI-E.cjs → Slicer-fdCI8qWb.cjs} +1 -1
- package/dist/{Title-BtxIcOzw.js → Title-BNmjrAmy.js} +1 -1
- package/dist/{Title-CO92NMAL.cjs → Title-ac0Tzobx.cjs} +1 -1
- package/dist/{Tooltip-CAVFRdaz.cjs → Tooltip-CUSoSjeD.cjs} +1 -1
- package/dist/{Tooltip-LICk5YoE.js → Tooltip-kARe11oF.js} +1 -1
- package/dist/index-CWGchQHo.cjs +4 -0
- package/dist/{index-Bbk73zTN.js → index-RX-sax8u.js} +197 -196
- package/dist/style.css +1 -1
- package/dist/types/vue-data-ui.d.cts +1 -0
- package/dist/types/vue-data-ui.d.ts +1 -0
- package/dist/{useNestedProp-UmsAOi8p.cjs → useNestedProp-ZSgzlkKZ.cjs} +1 -1
- package/dist/{useNestedProp-DyRlubve.js → useNestedProp-wLyS1qg3.js} +1 -1
- package/dist/{usePrinter-C98FQ0-q.cjs → usePrinter-Dz8P4PrQ.cjs} +1 -1
- package/dist/{usePrinter-BmgVJQqN.js → usePrinter-pEo9G4KY.js} +1 -1
- package/dist/{vue-data-ui-CBnsql5A.js → vue-data-ui-DoqWcxpg.js} +57 -57
- package/dist/{vue-data-ui-CU0iVEcI.cjs → vue-data-ui-PIOw96xJ.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-DjO8gk8_.js → vue-ui-3d-bar-B4kbEKT8.js} +7 -7
- package/dist/{vue-ui-3d-bar-D7Hgh9_L.cjs → vue-ui-3d-bar-D4ugNLFv.cjs} +1 -1
- package/dist/{vue-ui-accordion-CM5vg9Tx.cjs → vue-ui-accordion-BQfkZ2Fd.cjs} +1 -1
- package/dist/{vue-ui-accordion-CL_FobK9.js → vue-ui-accordion-SU0hvMyf.js} +3 -3
- package/dist/{vue-ui-age-pyramid-CAJyYi0a.js → vue-ui-age-pyramid-B2B2jipH.js} +8 -8
- package/dist/{vue-ui-age-pyramid-RYNu3tHb.cjs → vue-ui-age-pyramid-Dj3CbYws.cjs} +1 -1
- package/dist/{vue-ui-annotator-DFadnHMB.js → vue-ui-annotator-B38AOspl.js} +1 -1
- package/dist/{vue-ui-annotator-Cm1zAF7m.cjs → vue-ui-annotator-B4WY-W96.cjs} +1 -1
- package/dist/{vue-ui-candlestick-DxKxcHMq.js → vue-ui-candlestick-BX28jnUA.js} +9 -9
- package/dist/{vue-ui-candlestick-DG4ZvO5e.cjs → vue-ui-candlestick-C_85JG6p.cjs} +1 -1
- package/dist/{vue-ui-carousel-table-Blb5YFEv.js → vue-ui-carousel-table-BKPkc33T.js} +4 -4
- package/dist/{vue-ui-carousel-table-BVkgLC3s.cjs → vue-ui-carousel-table-CiDmXd8Y.cjs} +1 -1
- package/dist/{vue-ui-chestnut-B8Hz3FYZ.js → vue-ui-chestnut-2K97h81h.js} +6 -6
- package/dist/{vue-ui-chestnut-DWApH23R.cjs → vue-ui-chestnut-CGFb3yM2.cjs} +1 -1
- package/dist/{vue-ui-cursor-BxcQpwOY.js → vue-ui-cursor-DN6xr3nT.js} +2 -2
- package/dist/{vue-ui-cursor-D9asBQMh.cjs → vue-ui-cursor-DOIIfQfX.cjs} +1 -1
- package/dist/{vue-ui-dashboard-DgcdkN2P.js → vue-ui-dashboard-CFJfMnW1.js} +2 -2
- package/dist/{vue-ui-dashboard-CEvxFYWL.cjs → vue-ui-dashboard-D_H43fxs.cjs} +1 -1
- package/dist/{vue-ui-digits-CQyz7F1E.js → vue-ui-digits-D1sBPU-b.js} +2 -2
- package/dist/{vue-ui-digits-B6mHBfpO.cjs → vue-ui-digits-DoFQJ6ye.cjs} +1 -1
- package/dist/{vue-ui-donut-MAqy-4_Q.js → vue-ui-donut-BOkeHJmg.js} +9 -9
- package/dist/{vue-ui-donut-Bk9ZauPi.cjs → vue-ui-donut-DCKJRNhh.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-D8rLY20T.cjs → vue-ui-donut-evolution-BVfgqCAa.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-LwQMywJy.js → vue-ui-donut-evolution-CVChdWDx.js} +9 -9
- package/dist/{vue-ui-dumbbell-B82B7yyh.js → vue-ui-dumbbell-B_nLz9mF.js} +8 -8
- package/dist/{vue-ui-dumbbell-DeIwE9rZ.cjs → vue-ui-dumbbell-CAqglrag.cjs} +1 -1
- package/dist/{vue-ui-flow-MAa_-OBP.cjs → vue-ui-flow-AK4gWqNd.cjs} +1 -1
- package/dist/{vue-ui-flow-hFsm0I_o.js → vue-ui-flow-DAy7OWc2.js} +7 -7
- package/dist/{vue-ui-galaxy-DGCAtMPJ.cjs → vue-ui-galaxy-CN1h5FZm.cjs} +1 -1
- package/dist/{vue-ui-galaxy-CA4vT6T9.js → vue-ui-galaxy-dYrRlxj0.js} +9 -9
- package/dist/{vue-ui-gauge-adb9MqKU.cjs → vue-ui-gauge-BQwOev1K.cjs} +1 -1
- package/dist/{vue-ui-gauge-DnoClf1q.js → vue-ui-gauge-vH_nn0vx.js} +5 -5
- package/dist/{vue-ui-gizmo-tANH2jdv.cjs → vue-ui-gizmo-BaMtgUef.cjs} +1 -1
- package/dist/{vue-ui-gizmo-CM2rrjW-.js → vue-ui-gizmo-eS4XXOgq.js} +2 -2
- package/dist/{vue-ui-heatmap-B1s4zxvm.js → vue-ui-heatmap-CfQqnd1M.js} +8 -8
- package/dist/{vue-ui-heatmap-CBlqLxiH.cjs → vue-ui-heatmap-DOLn5piI.cjs} +1 -1
- package/dist/{vue-ui-kpi-DqKvoNCy.js → vue-ui-kpi-CvCoN7CE.js} +3 -3
- package/dist/{vue-ui-kpi-BFTk7ZU3.cjs → vue-ui-kpi-l2MRy6h9.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-D-AqqkAZ.js → vue-ui-mini-loader-CuRlbUQF.js} +2 -2
- package/dist/{vue-ui-mini-loader-BXwRtFgE.cjs → vue-ui-mini-loader-ac_hCdZA.cjs} +1 -1
- package/dist/{vue-ui-molecule-DzHocdro.js → vue-ui-molecule-BgW25jqW.js} +9 -9
- package/dist/{vue-ui-molecule-h4UuWEAW.cjs → vue-ui-molecule-Bv-v4WBT.cjs} +1 -1
- package/dist/{vue-ui-mood-radar-1Tlf6aw2.js → vue-ui-mood-radar-Dp_CgtVn.js} +9 -9
- package/dist/{vue-ui-mood-radar-CS7QJHs3.cjs → vue-ui-mood-radar-rk3wrRpE.cjs} +1 -1
- package/dist/{vue-ui-nested-donuts-BeCVjHuA.cjs → vue-ui-nested-donuts--JGjV59I.cjs} +1 -1
- package/dist/{vue-ui-nested-donuts-Du7HPk1D.js → vue-ui-nested-donuts-D41M6d-5.js} +9 -9
- package/dist/{vue-ui-onion-D6mP-ozX.js → vue-ui-onion-BaazweOI.js} +9 -9
- package/dist/{vue-ui-onion-CKIprro6.cjs → vue-ui-onion-Dzuhw8Y3.cjs} +1 -1
- package/dist/{vue-ui-parallel-coordinate-plot-rOpV6LMo.cjs → vue-ui-parallel-coordinate-plot-BSaqSFVM.cjs} +1 -1
- package/dist/{vue-ui-parallel-coordinate-plot-4duj4p9w.js → vue-ui-parallel-coordinate-plot-Dec8TPLy.js} +10 -10
- package/dist/{vue-ui-quadrant-BucLsuLe.js → vue-ui-quadrant-BDLc3Gxw.js} +10 -10
- package/dist/{vue-ui-quadrant-t8JYBTSb.cjs → vue-ui-quadrant-BqNSzKPZ.cjs} +1 -1
- package/dist/{vue-ui-quick-chart-QV_7Fkz8.js → vue-ui-quick-chart-CmWcXqKE.js} +6 -6
- package/dist/{vue-ui-quick-chart-iWzK1xOC.cjs → vue-ui-quick-chart-CpNYfh1z.cjs} +1 -1
- package/dist/{vue-ui-radar-BqDGkijn.cjs → vue-ui-radar-CCHVebWS.cjs} +1 -1
- package/dist/{vue-ui-radar-BjHAeK_r.js → vue-ui-radar-eOuJE8zH.js} +10 -10
- package/dist/{vue-ui-rating-Urv4VkCQ.cjs → vue-ui-rating-ChR7JmUp.cjs} +1 -1
- package/dist/{vue-ui-rating-DCBbo_zw.js → vue-ui-rating-Qjyodf8S.js} +2 -2
- package/dist/{vue-ui-relation-circle-Dqus5AEv.js → vue-ui-relation-circle-B3hL2PT7.js} +5 -5
- package/dist/{vue-ui-relation-circle-D5mWVeOH.cjs → vue-ui-relation-circle-BO5RERci.cjs} +1 -1
- package/dist/{vue-ui-rings-CenKPWLm.js → vue-ui-rings-CXfZ9XhE.js} +9 -9
- package/dist/{vue-ui-rings-BASFY1MR.cjs → vue-ui-rings-Cd_STL36.cjs} +1 -1
- package/dist/{vue-ui-scatter-C7_wKZgM.cjs → vue-ui-scatter-BwN3h_43.cjs} +1 -1
- package/dist/{vue-ui-scatter-DKVRfyEx.js → vue-ui-scatter-DjREew2O.js} +10 -10
- package/dist/{vue-ui-screenshot-BPVBFgZc.cjs → vue-ui-screenshot-Cnc7zmf5.cjs} +1 -1
- package/dist/{vue-ui-screenshot-BbsapvVI.js → vue-ui-screenshot-DSczef-u.js} +1 -1
- package/dist/{vue-ui-skeleton-0RSYEYO5.cjs → vue-ui-skeleton-B3I4L51F.cjs} +1 -1
- package/dist/{vue-ui-skeleton-B5cqEJh5.js → vue-ui-skeleton-CFx7wegx.js} +2 -2
- package/dist/{vue-ui-smiley-BVh_PrQG.cjs → vue-ui-smiley-Bpb_RAXE.cjs} +1 -1
- package/dist/{vue-ui-smiley-c3WVJntN.js → vue-ui-smiley-CFPh7_gg.js} +2 -2
- package/dist/{vue-ui-spark-trend-k-2KrIOw.js → vue-ui-spark-trend-C5Q_XOKH.js} +4 -4
- package/dist/{vue-ui-spark-trend-CXxzIkgB.cjs → vue-ui-spark-trend-poSc_8OY.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-BHmNelWN.cjs → vue-ui-sparkbar-CNy_3RJN.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-CfMBd1i2.js → vue-ui-sparkbar-skWyToQg.js} +3 -3
- package/dist/{vue-ui-sparkgauge-C4EZKUcd.js → vue-ui-sparkgauge-CZpfBAP4.js} +3 -3
- package/dist/{vue-ui-sparkgauge-C8Yzul1-.cjs → vue-ui-sparkgauge-d-LTd2S_.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram-CYCMk0Nn.js → vue-ui-sparkhistogram-0htrwNwY.js} +4 -4
- package/dist/{vue-ui-sparkhistogram-HUZeHvwQ.cjs → vue-ui-sparkhistogram-BkfhKPi2.cjs} +1 -1
- package/dist/vue-ui-sparkline-BBlg_5SH.js +359 -0
- package/dist/vue-ui-sparkline-ORHsW_3h.cjs +1 -0
- package/dist/{vue-ui-sparkstackbar-yntdZ_U1.js → vue-ui-sparkstackbar-B0hc7a5Y.js} +3 -3
- package/dist/{vue-ui-sparkstackbar-DtE-w92H.cjs → vue-ui-sparkstackbar-kWvsyt_R.cjs} +1 -1
- package/dist/{vue-ui-stackbar-7wKRXzJb.js → vue-ui-stackbar-CBB0xhoF.js} +10 -10
- package/dist/{vue-ui-stackbar-7edtVj-o.cjs → vue-ui-stackbar-n7e_yhY9.cjs} +1 -1
- package/dist/{vue-ui-strip-plot-B7RNUPFq.js → vue-ui-strip-plot-BxpUOCtS.js} +9 -9
- package/dist/{vue-ui-strip-plot-DnwkdcDH.cjs → vue-ui-strip-plot-ChempVMX.cjs} +1 -1
- package/dist/{vue-ui-table-D9nv-3WZ.js → vue-ui-table-6LeE9-Di.js} +1 -1
- package/dist/{vue-ui-table-CVZTOrVv.cjs → vue-ui-table-CiJxG7DF.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-CyoJgm-p.js → vue-ui-table-heatmap-BwFAqdF5.js} +4 -4
- package/dist/{vue-ui-table-heatmap-Ciq5iK60.cjs → vue-ui-table-heatmap-rO8vNnId.cjs} +1 -1
- package/dist/{vue-ui-table-sparkline-DMHBrCHg.cjs → vue-ui-table-sparkline-CkdPJpBy.cjs} +1 -1
- package/dist/{vue-ui-table-sparkline-BzBBbPlM.js → vue-ui-table-sparkline-D467Jh1F.js} +5 -5
- package/dist/{vue-ui-thermometer-CMwBVDKP.cjs → vue-ui-thermometer-BnmPU3GD.cjs} +1 -1
- package/dist/{vue-ui-thermometer-B7GO1JVB.js → vue-ui-thermometer-CvEudPLx.js} +5 -5
- package/dist/{vue-ui-timer-DOhULfFA.js → vue-ui-timer-BeBR3Quk.js} +4 -4
- package/dist/{vue-ui-timer-DL-jbhys.cjs → vue-ui-timer-CHIVe58Y.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-CdSz4A3e.js → vue-ui-tiremarks-CAuwXXbq.js} +5 -5
- package/dist/{vue-ui-tiremarks-CKSWZEz6.cjs → vue-ui-tiremarks-lOirAxZ6.cjs} +1 -1
- package/dist/{vue-ui-treemap-Bnf6Dwud.js → vue-ui-treemap-CUiOr_h_.js} +9 -9
- package/dist/{vue-ui-treemap-DuidfPhy.cjs → vue-ui-treemap-DHxxbiun.cjs} +1 -1
- package/dist/{vue-ui-vertical-bar-MKgSL3sf.cjs → vue-ui-vertical-bar--pPasMmy.cjs} +1 -1
- package/dist/{vue-ui-vertical-bar-CanIt-Gp.js → vue-ui-vertical-bar-ZWnyojw_.js} +9 -9
- package/dist/{vue-ui-waffle-BTqxJCqj.js → vue-ui-waffle-CSfAfoYA.js} +9 -9
- package/dist/{vue-ui-waffle-CaOODGGV.cjs → vue-ui-waffle-o3Ma4Ps3.cjs} +1 -1
- package/dist/{vue-ui-wheel-CGeoj8Je.js → vue-ui-wheel-BD-PZ7Oh.js} +5 -5
- package/dist/{vue-ui-wheel-CFwuHnTA.cjs → vue-ui-wheel-BxEO4n2n.cjs} +1 -1
- package/dist/{vue-ui-word-cloud-jTnL4pfH.js → vue-ui-word-cloud-B1AUYOjb.js} +7 -7
- package/dist/{vue-ui-word-cloud-aGr6Wv6n.cjs → vue-ui-word-cloud-CeSKTtaT.cjs} +1 -1
- package/dist/{vue-ui-xy-Oy6S6E9Z.js → vue-ui-xy-DK2WkNdd.js} +12 -12
- package/dist/{vue-ui-xy-DpqPRTcU.cjs → vue-ui-xy-DeEUEySp.cjs} +1 -1
- package/dist/{vue-ui-xy-canvas-D9QelGDC.js → vue-ui-xy-canvas-BBoqHWnZ.js} +10 -10
- package/dist/{vue-ui-xy-canvas--KPN7UHp.cjs → vue-ui-xy-canvas-BTMotEgF.cjs} +1 -1
- package/package.json +1 -1
- package/dist/index-CSbGUkq2.cjs +0 -4
- package/dist/vue-ui-sparkline-BDrgcGQT.cjs +0 -1
- package/dist/vue-ui-sparkline-CqaXadBL.js +0 -342
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
import { computed as v, ref as m, onMounted as ee, openBlock as n, createElementBlock as r, normalizeStyle as N, renderSlot as T, normalizeProps as te, guardReactiveProps as ae, createElementVNode as f, toDisplayString as B, createCommentVNode as y, unref as c, Fragment as P, renderList as A, createBlock as le } from "vue";
|
|
2
|
+
import { u as ue, c as se, t as oe, o as ne, e as E, g as re, s as I, R as ie, S as de, X as ve, v as C, M as O, i as R, f as j } from "./index-RX-sax8u.js";
|
|
3
|
+
import { u as U } from "./useNestedProp-wLyS1qg3.js";
|
|
4
|
+
import ce from "./vue-ui-skeleton-CFx7wegx.js";
|
|
5
|
+
import { t as he, u as ye } from "./useResponsive-NZB-WLRF.js";
|
|
6
|
+
import { _ as fe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
7
|
+
const pe = ["id"], ge = ["xmlns", "viewBox"], ke = ["id"], me = ["stop-color"], be = ["stop-color"], xe = ["id"], _e = ["stop-color"], we = ["stop-color"], $e = ["id"], Le = ["stop-color"], Ne = ["stop-color"], Ie = { key: 0 }, Ce = ["d", "fill"], Me = ["d", "fill"], Se = ["d", "stroke", "stroke-width"], ze = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Ve = ["x", "y", "width", "height", "fill", "rx"], Pe = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], Ae = ["x1", "x2", "y1", "y2", "stroke", "stroke-dasharray", "stroke-width"], We = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], De = ["x", "y", "font-size", "font-weight", "fill"], Fe = ["x", "y", "height", "width", "onMouseenter", "onClick"], Ge = {
|
|
8
|
+
__name: "vue-ui-sparkline",
|
|
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
|
+
showInfo: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: !0
|
|
25
|
+
},
|
|
26
|
+
selectedIndex: {
|
|
27
|
+
type: Number,
|
|
28
|
+
default: void 0
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
emits: ["hoverIndex", "selectDatapoint"],
|
|
32
|
+
setup(x, { emit: M }) {
|
|
33
|
+
const i = x, { vue_ui_sparkline: X } = ue(), $ = v(() => !!i.dataset && i.dataset.length), p = m(se()), S = m(null), W = m(null), e = v(() => {
|
|
34
|
+
const t = U({
|
|
35
|
+
userConfig: i.config,
|
|
36
|
+
defaultConfig: X
|
|
37
|
+
});
|
|
38
|
+
return t.theme ? {
|
|
39
|
+
...U({
|
|
40
|
+
userConfig: oe.vue_ui_sparkline[t.theme] || i.config,
|
|
41
|
+
defaultConfig: t
|
|
42
|
+
})
|
|
43
|
+
} : t;
|
|
44
|
+
}), b = m(i.dataset.map((t) => e.value.style.animation.show ? {
|
|
45
|
+
...t,
|
|
46
|
+
value: null
|
|
47
|
+
} : {
|
|
48
|
+
...t,
|
|
49
|
+
value: [void 0].includes(t.value) ? null : t.value
|
|
50
|
+
})), D = m(null);
|
|
51
|
+
ee(() => {
|
|
52
|
+
if (ne(i.dataset) ? E({
|
|
53
|
+
componentName: "VueUiSparkline",
|
|
54
|
+
type: "dataset"
|
|
55
|
+
}) : i.dataset.forEach((t, u) => {
|
|
56
|
+
re({
|
|
57
|
+
datasetObject: t,
|
|
58
|
+
requiredAttributes: ["period", "value"]
|
|
59
|
+
}).forEach((a) => {
|
|
60
|
+
E({
|
|
61
|
+
componentName: "VueUiSparkline",
|
|
62
|
+
type: "datasetSerieAttribute",
|
|
63
|
+
property: a,
|
|
64
|
+
index: u
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
}), e.value.style.animation.show && i.dataset.length > 1) {
|
|
68
|
+
let a = function() {
|
|
69
|
+
u < i.dataset.length ? (b.value.push(i.dataset[u]), setTimeout(() => {
|
|
70
|
+
requestAnimationFrame(a);
|
|
71
|
+
}, t)) : b.value = i.dataset, u += 1;
|
|
72
|
+
};
|
|
73
|
+
b.value = [];
|
|
74
|
+
const t = e.value.style.animation.animationFrames / i.dataset.length;
|
|
75
|
+
let u = 0;
|
|
76
|
+
a();
|
|
77
|
+
}
|
|
78
|
+
if (e.value.responsive) {
|
|
79
|
+
const t = he(() => {
|
|
80
|
+
const { width: u, height: a } = ye({
|
|
81
|
+
chart: S.value,
|
|
82
|
+
title: e.value.style.title.show && i.showInfo ? W.value : null
|
|
83
|
+
});
|
|
84
|
+
l.value.width = u, l.value.height = a, l.value.chartWidth = e.value.style.chartWidth / 500 * u, l.value.padding = 0.06 * u;
|
|
85
|
+
});
|
|
86
|
+
D.value = new ResizeObserver(t), D.value.observe(S.value.parentNode);
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
const l = m({
|
|
90
|
+
height: 80,
|
|
91
|
+
width: 500,
|
|
92
|
+
chartWidth: e.value.style.chartWidth,
|
|
93
|
+
padding: 30
|
|
94
|
+
}), Z = m(6), s = v(() => ({
|
|
95
|
+
top: 12,
|
|
96
|
+
left: 0,
|
|
97
|
+
right: l.value.width,
|
|
98
|
+
bottom: l.value.height - 3,
|
|
99
|
+
start: i.showInfo && e.value.style.dataLabel.show && e.value.style.dataLabel.position === "left" ? l.value.width - l.value.chartWidth : l.value.padding,
|
|
100
|
+
width: i.showInfo && e.value.style.dataLabel.show ? l.value.chartWidth : l.value.width - l.value.padding,
|
|
101
|
+
height: l.value.height - 12
|
|
102
|
+
})), z = v(() => Math.min(...b.value.map((t) => isNaN(t.value) || [void 0, null, "NaN", NaN, 1 / 0, -1 / 0].includes(t.value) ? 0 : t.value || 0))), q = v(() => Math.max(...b.value.map((t) => isNaN(t.value) || [void 0, null, "NaN", NaN, 1 / 0, -1 / 0].includes(t.value) ? 0 : t.value || 0))), _ = v(() => {
|
|
103
|
+
const t = z.value >= 0 ? 0 : z.value;
|
|
104
|
+
return Math.abs(t);
|
|
105
|
+
}), H = v(() => q.value + _.value + Z.value), L = v(() => s.value.bottom - s.value.height * V(_.value));
|
|
106
|
+
function V(t) {
|
|
107
|
+
return t / H.value;
|
|
108
|
+
}
|
|
109
|
+
const g = v(() => i.dataset.length - 1), o = v(() => b.value.map((t, u) => {
|
|
110
|
+
const a = isNaN(t.value) || [void 0, null, "NaN", NaN, 1 / 0, -1 / 0].includes(t.value) ? 0 : t.value || 0;
|
|
111
|
+
return {
|
|
112
|
+
absoluteValue: a,
|
|
113
|
+
period: t.period,
|
|
114
|
+
plotValue: a + _.value,
|
|
115
|
+
toMax: V(a + _.value),
|
|
116
|
+
x: s.value.start + u * (s.value.width / (g.value + 1) > l.padding ? l.padding : s.value.width / (g.value + 1)),
|
|
117
|
+
y: s.value.bottom - s.value.height * V(a + _.value),
|
|
118
|
+
id: `plot_${p.value}_${u}`,
|
|
119
|
+
color: w.value ? e.value.style.bar.color : e.value.style.area.useGradient ? I(e.value.style.line.color, 0.05 * (1 - u / g.value)) : e.value.style.line.color,
|
|
120
|
+
width: s.value.width / (g.value + 1) > l.padding ? l.padding : s.value.width / (g.value + 1)
|
|
121
|
+
};
|
|
122
|
+
})), Y = v(() => {
|
|
123
|
+
const t = { x: o.value[0].x, y: l.value.height - 6 }, u = { x: o.value[o.value.length - 1].x, y: l.value.height - 6 }, a = [];
|
|
124
|
+
return o.value.forEach((d) => {
|
|
125
|
+
a.push(`${d.x},${d.y} `);
|
|
126
|
+
}), [t.x, t.y, ...a, u.x, u.y].toString();
|
|
127
|
+
}), h = m(void 0);
|
|
128
|
+
function J(t, u) {
|
|
129
|
+
h.value = t, M("hoverIndex", { index: u });
|
|
130
|
+
}
|
|
131
|
+
function K() {
|
|
132
|
+
h.value = void 0, M("hoverIndex", { index: void 0 });
|
|
133
|
+
}
|
|
134
|
+
const k = v(() => {
|
|
135
|
+
if ($.value) {
|
|
136
|
+
const t = o.value.map((a) => a.absoluteValue), u = t.reduce((a, d) => a + d, 0);
|
|
137
|
+
return {
|
|
138
|
+
latest: o.value[o.value.length - 1].absoluteValue,
|
|
139
|
+
sum: u,
|
|
140
|
+
average: u / o.value.length,
|
|
141
|
+
median: ie(t),
|
|
142
|
+
trend: de(o.value.map(({ x: a, y: d, absoluteValue: G }) => ({
|
|
143
|
+
x: a,
|
|
144
|
+
y: d,
|
|
145
|
+
value: G
|
|
146
|
+
}))).trend
|
|
147
|
+
};
|
|
148
|
+
} else
|
|
149
|
+
return {
|
|
150
|
+
latest: null,
|
|
151
|
+
sum: null,
|
|
152
|
+
average: null,
|
|
153
|
+
median: null,
|
|
154
|
+
trend: null
|
|
155
|
+
};
|
|
156
|
+
}), F = v(() => $.value ? e.value.style.dataLabel.valueType === "latest" ? k.value.latest : e.value.style.dataLabel.valueType === "sum" ? k.value.sum : e.value.style.dataLabel.valueType === "average" ? k.value.average : 0 : 0), w = v(() => e.value.type && e.value.type === "bar");
|
|
157
|
+
function Q(t, u) {
|
|
158
|
+
M("selectDatapoint", { datapoint: t, index: u });
|
|
159
|
+
}
|
|
160
|
+
return (t, u) => (n(), r("div", {
|
|
161
|
+
ref_key: "sparklineChart",
|
|
162
|
+
ref: S,
|
|
163
|
+
class: "vue-ui-sparkline",
|
|
164
|
+
id: p.value,
|
|
165
|
+
style: N(`width:100%;font-family:${e.value.style.fontFamily}`)
|
|
166
|
+
}, [
|
|
167
|
+
T(t.$slots, "before", te(ae({
|
|
168
|
+
selected: h.value,
|
|
169
|
+
latest: k.value.latest,
|
|
170
|
+
sum: k.value.sum,
|
|
171
|
+
average: k.value.average,
|
|
172
|
+
median: k.value.median,
|
|
173
|
+
trend: k.value.trend
|
|
174
|
+
})), void 0, !0),
|
|
175
|
+
e.value.style.title.show && x.showInfo ? (n(), r("div", {
|
|
176
|
+
key: 0,
|
|
177
|
+
ref_key: "chartTitle",
|
|
178
|
+
ref: W,
|
|
179
|
+
class: "vue-ui-sparkline-title",
|
|
180
|
+
style: N(`display:flex;align-items:center;width:100%;color:${e.value.style.title.color};background:${e.value.style.backgroundColor};justify-content:${e.value.style.title.textAlign === "left" ? "flex-start" : e.value.style.title.textAlign === "right" ? "flex-end" : "center"};height:${e.value.style.title.fontSize * 2}px;font-size:${e.value.style.title.fontSize}px;font-weight:${e.value.style.title.bold ? "bold" : "normal"};`)
|
|
181
|
+
}, [
|
|
182
|
+
f("span", {
|
|
183
|
+
style: N(`padding:${e.value.style.title.textAlign === "left" ? "0 0 0 12px" : e.value.style.title.textAlign === "right" ? "0 12px 0 0" : "0"}`)
|
|
184
|
+
}, B(h.value ? h.value.period : e.value.style.title.text), 5)
|
|
185
|
+
], 4)) : y("", !0),
|
|
186
|
+
$.value ? (n(), r("svg", {
|
|
187
|
+
key: 1,
|
|
188
|
+
xmlns: c(ve),
|
|
189
|
+
viewBox: `0 0 ${l.value.width} ${l.value.height}`,
|
|
190
|
+
style: N(`background:${e.value.style.backgroundColor};overflow:visible`)
|
|
191
|
+
}, [
|
|
192
|
+
f("defs", null, [
|
|
193
|
+
f("linearGradient", {
|
|
194
|
+
x1: "0%",
|
|
195
|
+
y1: "0%",
|
|
196
|
+
x2: "100%",
|
|
197
|
+
y2: "0%",
|
|
198
|
+
id: `sparkline_gradient_${p.value}`
|
|
199
|
+
}, [
|
|
200
|
+
f("stop", {
|
|
201
|
+
offset: "0%",
|
|
202
|
+
"stop-color": `${c(I)(e.value.style.area.color, 0.05)}${c(C)[e.value.style.area.opacity]}`
|
|
203
|
+
}, null, 8, me),
|
|
204
|
+
f("stop", {
|
|
205
|
+
offset: "100%",
|
|
206
|
+
"stop-color": e.value.style.area.color + c(C)[e.value.style.area.opacity]
|
|
207
|
+
}, null, 8, be)
|
|
208
|
+
], 8, ke),
|
|
209
|
+
f("linearGradient", {
|
|
210
|
+
x2: "0%",
|
|
211
|
+
y2: "100%",
|
|
212
|
+
id: `sparkline_bar_gradient_pos_${p.value}`
|
|
213
|
+
}, [
|
|
214
|
+
f("stop", {
|
|
215
|
+
offset: "0%",
|
|
216
|
+
"stop-color": e.value.style.bar.color
|
|
217
|
+
}, null, 8, _e),
|
|
218
|
+
f("stop", {
|
|
219
|
+
offset: "100%",
|
|
220
|
+
"stop-color": `${c(I)(e.value.style.bar.color, 0.05)}`
|
|
221
|
+
}, null, 8, we)
|
|
222
|
+
], 8, xe),
|
|
223
|
+
f("linearGradient", {
|
|
224
|
+
x2: "0%",
|
|
225
|
+
y2: "100%",
|
|
226
|
+
id: `sparkline_bar_gradient_neg_${p.value}`
|
|
227
|
+
}, [
|
|
228
|
+
f("stop", {
|
|
229
|
+
offset: "0%",
|
|
230
|
+
"stop-color": `${c(I)(e.value.style.bar.color, 0.05)}`
|
|
231
|
+
}, null, 8, Le),
|
|
232
|
+
f("stop", {
|
|
233
|
+
offset: "100%",
|
|
234
|
+
"stop-color": e.value.style.bar.color
|
|
235
|
+
}, null, 8, Ne)
|
|
236
|
+
], 8, $e)
|
|
237
|
+
]),
|
|
238
|
+
e.value.style.area.show && !w.value && o.value[0] ? (n(), r("g", Ie, [
|
|
239
|
+
e.value.style.line.smooth ? (n(), r("path", {
|
|
240
|
+
key: 0,
|
|
241
|
+
d: `M ${o.value[0].x},${s.value.bottom} ${c(O)(o.value)} L ${o.value.at(-1).x},${s.value.bottom} Z`,
|
|
242
|
+
fill: e.value.style.area.useGradient ? `url(#sparkline_gradient_${p.value})` : `${e.value.style.area.color}${c(C)[e.value.style.area.opacity]}`
|
|
243
|
+
}, null, 8, Ce)) : (n(), r("path", {
|
|
244
|
+
key: 1,
|
|
245
|
+
d: `M${Y.value}Z`,
|
|
246
|
+
fill: e.value.style.area.useGradient ? `url(#sparkline_gradient_${p.value})` : `${e.value.style.area.color}${c(C)[e.value.style.area.opacity]}`
|
|
247
|
+
}, null, 8, Me))
|
|
248
|
+
])) : y("", !0),
|
|
249
|
+
e.value.style.line.smooth && !w.value ? (n(), r("path", {
|
|
250
|
+
key: 1,
|
|
251
|
+
d: `M ${c(O)(o.value)}`,
|
|
252
|
+
stroke: e.value.style.line.color,
|
|
253
|
+
fill: "none",
|
|
254
|
+
"stroke-width": e.value.style.line.strokeWidth,
|
|
255
|
+
"stroke-linecap": "round"
|
|
256
|
+
}, null, 8, Se)) : y("", !0),
|
|
257
|
+
(n(!0), r(P, null, A(o.value, (a, d) => (n(), r("g", null, [
|
|
258
|
+
d < o.value.length - 1 && !e.value.style.line.smooth && !w.value ? (n(), r("line", {
|
|
259
|
+
key: 0,
|
|
260
|
+
x1: a.x,
|
|
261
|
+
x2: o.value[d + 1].x,
|
|
262
|
+
y1: a.y,
|
|
263
|
+
y2: o.value[d + 1].y,
|
|
264
|
+
stroke: a.color,
|
|
265
|
+
"stroke-width": e.value.style.line.strokeWidth,
|
|
266
|
+
"stroke-linecap": "round",
|
|
267
|
+
"stroke-linejoin": "round",
|
|
268
|
+
"shape-rendering": "geometricPrecision"
|
|
269
|
+
}, null, 8, ze)) : y("", !0),
|
|
270
|
+
w.value ? (n(), r("rect", {
|
|
271
|
+
key: 1,
|
|
272
|
+
x: a.x - a.width / 2,
|
|
273
|
+
y: a.absoluteValue > 0 ? a.y : L.value,
|
|
274
|
+
width: a.width,
|
|
275
|
+
height: Math.abs(a.y - L.value),
|
|
276
|
+
fill: a.absoluteValue > 0 ? `url(#sparkline_bar_gradient_pos_${p.value})` : `url(#sparkline_bar_gradient_neg_${p.value})`,
|
|
277
|
+
rx: e.value.style.bar.borderRadius
|
|
278
|
+
}, null, 8, Ve)) : y("", !0),
|
|
279
|
+
e.value.style.verticalIndicator.show && (h.value && a.id === h.value.id || x.selectedIndex === d) ? (n(), r("line", {
|
|
280
|
+
key: 2,
|
|
281
|
+
x1: a.x,
|
|
282
|
+
x2: a.x,
|
|
283
|
+
y1: s.value.top - 6,
|
|
284
|
+
y2: s.value.bottom,
|
|
285
|
+
stroke: e.value.style.verticalIndicator.color || a.color,
|
|
286
|
+
"stroke-width": e.value.style.verticalIndicator.strokeWidth,
|
|
287
|
+
"stroke-linecap": "round",
|
|
288
|
+
"stroke-dasharray": e.value.style.verticalIndicator.strokeDasharray || 0
|
|
289
|
+
}, null, 8, Pe)) : y("", !0)
|
|
290
|
+
]))), 256)),
|
|
291
|
+
z.value < 0 ? (n(), r("line", {
|
|
292
|
+
key: 2,
|
|
293
|
+
x1: s.value.start,
|
|
294
|
+
x2: s.value.start + s.value.width - 16,
|
|
295
|
+
y1: L.value,
|
|
296
|
+
y2: L.value,
|
|
297
|
+
stroke: e.value.style.zeroLine.color,
|
|
298
|
+
"stroke-dasharray": e.value.style.zeroLine.strokeWidth * 2,
|
|
299
|
+
"stroke-width": e.value.style.zeroLine.strokeWidth,
|
|
300
|
+
"stroke-linecap": "round"
|
|
301
|
+
}, null, 8, Ae)) : y("", !0),
|
|
302
|
+
e.value.style.plot.show ? (n(!0), r(P, { key: 3 }, A(o.value, (a, d) => (n(), r("g", null, [
|
|
303
|
+
h.value && a.id === h.value.id || x.selectedIndex === d ? (n(), r("circle", {
|
|
304
|
+
key: 0,
|
|
305
|
+
cx: a.x,
|
|
306
|
+
cy: a.y,
|
|
307
|
+
r: e.value.style.plot.radius,
|
|
308
|
+
fill: a.color,
|
|
309
|
+
stroke: e.value.style.plot.stroke,
|
|
310
|
+
"stroke-width": e.value.style.plot.strokeWidth
|
|
311
|
+
}, null, 8, We)) : y("", !0)
|
|
312
|
+
]))), 256)) : y("", !0),
|
|
313
|
+
x.showInfo && e.value.style.dataLabel.show ? (n(), r("text", {
|
|
314
|
+
key: 4,
|
|
315
|
+
x: e.value.style.dataLabel.position === "left" ? 12 + e.value.style.dataLabel.offsetX : s.value.width + 12 + e.value.style.dataLabel.offsetX,
|
|
316
|
+
y: l.value.height / 2 + e.value.style.dataLabel.fontSize / 2.5 + e.value.style.dataLabel.offsetY,
|
|
317
|
+
"font-size": e.value.style.dataLabel.fontSize,
|
|
318
|
+
"font-weight": e.value.style.dataLabel.bold ? "bold" : "normal",
|
|
319
|
+
fill: e.value.style.dataLabel.color
|
|
320
|
+
}, B(h.value ? c(R)(
|
|
321
|
+
e.value.style.dataLabel.formatter,
|
|
322
|
+
h.value.absoluteValue,
|
|
323
|
+
c(j)({ p: e.value.style.dataLabel.prefix, v: h.value.absoluteValue, s: e.value.style.dataLabel.suffix, r: e.value.style.dataLabel.roundingValue }),
|
|
324
|
+
{ datapoint: h.value }
|
|
325
|
+
) : c(R)(
|
|
326
|
+
e.value.style.dataLabel.formatter,
|
|
327
|
+
F.value,
|
|
328
|
+
c(j)({ p: e.value.style.dataLabel.prefix, v: F.value, s: e.value.style.dataLabel.suffix, r: e.value.style.dataLabel.roundingValue })
|
|
329
|
+
)), 9, De)) : y("", !0),
|
|
330
|
+
(n(!0), r(P, null, A(o.value, (a, d) => (n(), r("rect", {
|
|
331
|
+
x: a.x - (s.value.width / (g.value + 1) > l.value.padding ? l.value.padding : s.value.width / (g.value + 1)) / 2,
|
|
332
|
+
y: s.value.top - 6,
|
|
333
|
+
height: s.value.height + 6,
|
|
334
|
+
width: s.value.width / (g.value + 1) > l.value.padding ? l.value.padding : s.value.width / (g.value + 1),
|
|
335
|
+
fill: "transparent",
|
|
336
|
+
onMouseenter: (G) => J(a, d),
|
|
337
|
+
onMouseleave: K,
|
|
338
|
+
onClick: () => Q(a, d)
|
|
339
|
+
}, null, 40, Fe))), 256)),
|
|
340
|
+
T(t.$slots, "svg", { svg: l.value }, void 0, !0)
|
|
341
|
+
], 12, ge)) : y("", !0),
|
|
342
|
+
$.value ? y("", !0) : (n(), le(ce, {
|
|
343
|
+
key: 2,
|
|
344
|
+
config: {
|
|
345
|
+
type: "sparkline",
|
|
346
|
+
style: {
|
|
347
|
+
backgroundColor: e.value.style.backgroundColor,
|
|
348
|
+
sparkline: {
|
|
349
|
+
color: "#CCCCCC"
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
}, null, 8, ["config"]))
|
|
354
|
+
], 12, pe));
|
|
355
|
+
}
|
|
356
|
+
}, Ue = /* @__PURE__ */ fe(Ge, [["__scopeId", "data-v-a8f8425a"]]);
|
|
357
|
+
export {
|
|
358
|
+
Ue as default
|
|
359
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-CWGchQHo.cjs"),C=require("./useNestedProp-ZSgzlkKZ.cjs"),F=require("./vue-ui-skeleton-B3I4L51F.cjs"),E=require("./useResponsive-B3TrDDIG.cjs"),T=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),q=["id"],G=["xmlns","viewBox"],O=["id"],j=["stop-color"],R=["stop-color"],H=["id"],U=["stop-color"],X=["stop-color"],Z=["id"],Y=["stop-color"],J=["stop-color"],K={key:0},Q=["d","fill"],ee=["d","fill"],te=["d","stroke","stroke-width"],le=["x1","x2","y1","y2","stroke","stroke-width"],ae=["x","y","width","height","fill","rx"],oe=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],ne=["x1","x2","y1","y2","stroke","stroke-dasharray","stroke-width"],ue=["cx","cy","r","fill","stroke","stroke-width"],re=["x","y","font-size","font-weight","fill"],se=["x","y","height","width","onMouseenter","onClick"],ie={__name:"vue-ui-sparkline",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}},showInfo:{type:Boolean,default:!0},selectedIndex:{type:Number,default:void 0}},emits:["hoverIndex","selectDatapoint"],setup(f,{emit:x}){const i=f,{vue_ui_sparkline:I}=u.useConfig(),g=e.computed(()=>!!i.dataset&&i.dataset.length),v=e.ref(u.createUid()),_=e.ref(null),B=e.ref(null),t=e.computed(()=>{const l=C.useNestedProp({userConfig:i.config,defaultConfig:I});return l.theme?{...C.useNestedProp({userConfig:u.themes.vue_ui_sparkline[l.theme]||i.config,defaultConfig:l})}:l}),p=e.ref(i.dataset.map(l=>t.value.style.animation.show?{...l,value:null}:{...l,value:[void 0].includes(l.value)?null:l.value})),L=e.ref(null);e.onMounted(()=>{if(u.objectIsEmpty(i.dataset)?u.error({componentName:"VueUiSparkline",type:"dataset"}):i.dataset.forEach((l,n)=>{u.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["period","value"]}).forEach(a=>{u.error({componentName:"VueUiSparkline",type:"datasetSerieAttribute",property:a,index:n})})}),t.value.style.animation.show&&i.dataset.length>1){let a=function(){n<i.dataset.length?(p.value.push(i.dataset[n]),setTimeout(()=>{requestAnimationFrame(a)},l)):p.value=i.dataset,n+=1};p.value=[];const l=t.value.style.animation.animationFrames/i.dataset.length;let n=0;a()}if(t.value.responsive){const l=E.throttle(()=>{const{width:n,height:a}=E.useResponsive({chart:_.value,title:t.value.style.title.show&&i.showInfo?B.value:null});o.value.width=n,o.value.height=a,o.value.chartWidth=t.value.style.chartWidth/500*n,o.value.padding=.06*n});L.value=new ResizeObserver(l),L.value.observe(_.value.parentNode)}});const o=e.ref({height:80,width:500,chartWidth:t.value.style.chartWidth,padding:30}),S=e.ref(6),r=e.computed(()=>({top:12,left:0,right:o.value.width,bottom:o.value.height-3,start:i.showInfo&&t.value.style.dataLabel.show&&t.value.style.dataLabel.position==="left"?o.value.width-o.value.chartWidth:o.value.padding,width:i.showInfo&&t.value.style.dataLabel.show?o.value.chartWidth:o.value.width-o.value.padding,height:o.value.height-12})),w=e.computed(()=>Math.min(...p.value.map(l=>isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0))),M=e.computed(()=>Math.max(...p.value.map(l=>isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0))),m=e.computed(()=>{const l=w.value>=0?0:w.value;return Math.abs(l)}),z=e.computed(()=>M.value+m.value+S.value),b=e.computed(()=>r.value.bottom-r.value.height*N(m.value));function N(l){return l/z.value}const h=e.computed(()=>i.dataset.length-1),s=e.computed(()=>p.value.map((l,n)=>{const a=isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0;return{absoluteValue:a,period:l.period,plotValue:a+m.value,toMax:N(a+m.value),x:r.value.start+n*(r.value.width/(h.value+1)>o.padding?o.padding:r.value.width/(h.value+1)),y:r.value.bottom-r.value.height*N(a+m.value),id:`plot_${v.value}_${n}`,color:k.value?t.value.style.bar.color:t.value.style.area.useGradient?u.shiftHue(t.value.style.line.color,.05*(1-n/h.value)):t.value.style.line.color,width:r.value.width/(h.value+1)>o.padding?o.padding:r.value.width/(h.value+1)}})),P=e.computed(()=>{const l={x:s.value[0].x,y:o.value.height-6},n={x:s.value[s.value.length-1].x,y:o.value.height-6},a=[];return s.value.forEach(d=>{a.push(`${d.x},${d.y} `)}),[l.x,l.y,...a,n.x,n.y].toString()}),c=e.ref(void 0);function D(l,n){c.value=l,x("hoverIndex",{index:n})}function A(){c.value=void 0,x("hoverIndex",{index:void 0})}const y=e.computed(()=>{if(g.value){const l=s.value.map(a=>a.absoluteValue),n=l.reduce((a,d)=>a+d,0);return{latest:s.value[s.value.length-1].absoluteValue,sum:n,average:n/s.value.length,median:u.calcMedian(l),trend:u.calcLinearProgression(s.value.map(({x:a,y:d,absoluteValue:V})=>({x:a,y:d,value:V}))).trend}}else return{latest:null,sum:null,average:null,median:null,trend:null}}),$=e.computed(()=>g.value?t.value.style.dataLabel.valueType==="latest"?y.value.latest:t.value.style.dataLabel.valueType==="sum"?y.value.sum:t.value.style.dataLabel.valueType==="average"?y.value.average:0:0),k=e.computed(()=>t.value.type&&t.value.type==="bar");function W(l,n){x("selectDatapoint",{datapoint:l,index:n})}return(l,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"sparklineChart",ref:_,class:"vue-ui-sparkline",id:v.value,style:e.normalizeStyle(`width:100%;font-family:${t.value.style.fontFamily}`)},[e.renderSlot(l.$slots,"before",e.normalizeProps(e.guardReactiveProps({selected:c.value,latest:y.value.latest,sum:y.value.sum,average:y.value.average,median:y.value.median,trend:y.value.trend})),void 0,!0),t.value.style.title.show&&f.showInfo?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:B,class:"vue-ui-sparkline-title",style:e.normalizeStyle(`display:flex;align-items:center;width:100%;color:${t.value.style.title.color};background:${t.value.style.backgroundColor};justify-content:${t.value.style.title.textAlign==="left"?"flex-start":t.value.style.title.textAlign==="right"?"flex-end":"center"};height:${t.value.style.title.fontSize*2}px;font-size:${t.value.style.title.fontSize}px;font-weight:${t.value.style.title.bold?"bold":"normal"};`)},[e.createElementVNode("span",{style:e.normalizeStyle(`padding:${t.value.style.title.textAlign==="left"?"0 0 0 12px":t.value.style.title.textAlign==="right"?"0 12px 0 0":"0"}`)},e.toDisplayString(c.value?c.value.period:t.value.style.title.text),5)],4)):e.createCommentVNode("",!0),g.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(u.XMLNS),viewBox:`0 0 ${o.value.width} ${o.value.height}`,style:e.normalizeStyle(`background:${t.value.style.backgroundColor};overflow:visible`)},[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{x1:"0%",y1:"0%",x2:"100%",y2:"0%",id:`sparkline_gradient_${v.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(u.shiftHue)(t.value.style.area.color,.05)}${e.unref(u.opacity)[t.value.style.area.opacity]}`},null,8,j),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.area.color+e.unref(u.opacity)[t.value.style.area.opacity]},null,8,R)],8,O),e.createElementVNode("linearGradient",{x2:"0%",y2:"100%",id:`sparkline_bar_gradient_pos_${v.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.bar.color},null,8,U),e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(u.shiftHue)(t.value.style.bar.color,.05)}`},null,8,X)],8,H),e.createElementVNode("linearGradient",{x2:"0%",y2:"100%",id:`sparkline_bar_gradient_neg_${v.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(u.shiftHue)(t.value.style.bar.color,.05)}`},null,8,Y),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.bar.color},null,8,J)],8,Z)]),t.value.style.area.show&&!k.value&&s.value[0]?(e.openBlock(),e.createElementBlock("g",K,[t.value.style.line.smooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:`M ${s.value[0].x},${r.value.bottom} ${e.unref(u.createSmoothPath)(s.value)} L ${s.value.at(-1).x},${r.value.bottom} Z`,fill:t.value.style.area.useGradient?`url(#sparkline_gradient_${v.value})`:`${t.value.style.area.color}${e.unref(u.opacity)[t.value.style.area.opacity]}`},null,8,Q)):(e.openBlock(),e.createElementBlock("path",{key:1,d:`M${P.value}Z`,fill:t.value.style.area.useGradient?`url(#sparkline_gradient_${v.value})`:`${t.value.style.area.color}${e.unref(u.opacity)[t.value.style.area.opacity]}`},null,8,ee))])):e.createCommentVNode("",!0),t.value.style.line.smooth&&!k.value?(e.openBlock(),e.createElementBlock("path",{key:1,d:`M ${e.unref(u.createSmoothPath)(s.value)}`,stroke:t.value.style.line.color,fill:"none","stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":"round"},null,8,te)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(a,d)=>(e.openBlock(),e.createElementBlock("g",null,[d<s.value.length-1&&!t.value.style.line.smooth&&!k.value?(e.openBlock(),e.createElementBlock("line",{key:0,x1:a.x,x2:s.value[d+1].x,y1:a.y,y2:s.value[d+1].y,stroke:a.color,"stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round","shape-rendering":"geometricPrecision"},null,8,le)):e.createCommentVNode("",!0),k.value?(e.openBlock(),e.createElementBlock("rect",{key:1,x:a.x-a.width/2,y:a.absoluteValue>0?a.y:b.value,width:a.width,height:Math.abs(a.y-b.value),fill:a.absoluteValue>0?`url(#sparkline_bar_gradient_pos_${v.value})`:`url(#sparkline_bar_gradient_neg_${v.value})`,rx:t.value.style.bar.borderRadius},null,8,ae)):e.createCommentVNode("",!0),t.value.style.verticalIndicator.show&&(c.value&&a.id===c.value.id||f.selectedIndex===d)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:a.x,x2:a.x,y1:r.value.top-6,y2:r.value.bottom,stroke:t.value.style.verticalIndicator.color||a.color,"stroke-width":t.value.style.verticalIndicator.strokeWidth,"stroke-linecap":"round","stroke-dasharray":t.value.style.verticalIndicator.strokeDasharray||0},null,8,oe)):e.createCommentVNode("",!0)]))),256)),w.value<0?(e.openBlock(),e.createElementBlock("line",{key:2,x1:r.value.start,x2:r.value.start+r.value.width-16,y1:b.value,y2:b.value,stroke:t.value.style.zeroLine.color,"stroke-dasharray":t.value.style.zeroLine.strokeWidth*2,"stroke-width":t.value.style.zeroLine.strokeWidth,"stroke-linecap":"round"},null,8,ne)):e.createCommentVNode("",!0),t.value.style.plot.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:3},e.renderList(s.value,(a,d)=>(e.openBlock(),e.createElementBlock("g",null,[c.value&&a.id===c.value.id||f.selectedIndex===d?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:a.x,cy:a.y,r:t.value.style.plot.radius,fill:a.color,stroke:t.value.style.plot.stroke,"stroke-width":t.value.style.plot.strokeWidth},null,8,ue)):e.createCommentVNode("",!0)]))),256)):e.createCommentVNode("",!0),f.showInfo&&t.value.style.dataLabel.show?(e.openBlock(),e.createElementBlock("text",{key:4,x:t.value.style.dataLabel.position==="left"?12+t.value.style.dataLabel.offsetX:r.value.width+12+t.value.style.dataLabel.offsetX,y:o.value.height/2+t.value.style.dataLabel.fontSize/2.5+t.value.style.dataLabel.offsetY,"font-size":t.value.style.dataLabel.fontSize,"font-weight":t.value.style.dataLabel.bold?"bold":"normal",fill:t.value.style.dataLabel.color},e.toDisplayString(c.value?e.unref(u.applyDataLabel)(t.value.style.dataLabel.formatter,c.value.absoluteValue,e.unref(u.dataLabel)({p:t.value.style.dataLabel.prefix,v:c.value.absoluteValue,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.roundingValue}),{datapoint:c.value}):e.unref(u.applyDataLabel)(t.value.style.dataLabel.formatter,$.value,e.unref(u.dataLabel)({p:t.value.style.dataLabel.prefix,v:$.value,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.roundingValue}))),9,re)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(a,d)=>(e.openBlock(),e.createElementBlock("rect",{x:a.x-(r.value.width/(h.value+1)>o.value.padding?o.value.padding:r.value.width/(h.value+1))/2,y:r.value.top-6,height:r.value.height+6,width:r.value.width/(h.value+1)>o.value.padding?o.value.padding:r.value.width/(h.value+1),fill:"transparent",onMouseenter:V=>D(a,d),onMouseleave:A,onClick:()=>W(a,d)},null,40,se))),256)),e.renderSlot(l.$slots,"svg",{svg:o.value},void 0,!0)],12,G)):e.createCommentVNode("",!0),g.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(F.default,{key:2,config:{type:"sparkline",style:{backgroundColor:t.value.style.backgroundColor,sparkline:{color:"#CCCCCC"}}}},null,8,["config"]))],12,q))}},de=T._export_sfc(ie,[["__scopeId","data-v-a8f8425a"]]);exports.default=de;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { computed as p, ref as m, onMounted as T, openBlock as n, createElementBlock as r, normalizeStyle as g, createElementVNode as u, toDisplayString as k, createCommentVNode as h, unref as b, Fragment as D, renderList as z, normalizeClass as A, createBlock as q } from "vue";
|
|
2
|
-
import { u as H, c as j, t as X, a as J, p as d, b as K, d as P, o as Q, e as E, g as R, f as I, X as W, s as Y, v as Z, i as ee } from "./index-
|
|
3
|
-
import { u as U } from "./useNestedProp-
|
|
4
|
-
import te from "./vue-ui-skeleton-
|
|
2
|
+
import { u as H, c as j, t as X, a as J, p as d, b as K, d as P, o as Q, e as E, g as R, f as I, X as W, s as Y, v as Z, i as ee } from "./index-RX-sax8u.js";
|
|
3
|
+
import { u as U } from "./useNestedProp-wLyS1qg3.js";
|
|
4
|
+
import te from "./vue-ui-skeleton-CFx7wegx.js";
|
|
5
5
|
import { _ as le } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
6
|
const ae = ["xmlns", "viewBox"], oe = ["id"], se = ["stop-color"], ne = ["stop-color"], re = ["stop-color"], ue = {
|
|
7
7
|
id: "stackPill",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-CWGchQHo.cjs"),C=require("./useNestedProp-ZSgzlkKZ.cjs"),E=require("./vue-ui-skeleton-B3I4L51F.cjs"),N=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),V=["xmlns","viewBox"],z=["id"],D=["stop-color"],P=["stop-color"],L=["stop-color"],A={id:"stackPill",clipPathUnits:"objectBoundingBox"},F=["fill"],U={"clip-path":"url(#stackPill)"},j=["height","width","fill"],q=["onClick","x","width","height","fill","stroke"],I=["onClick"],T={style:{display:"flex","flex-direction":"row","align-items":"center",gap:"4px","justify-content":"center"}},H=["height","width"],O=["fill"],M={__name:"vue-ui-sparkstackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(B,{emit:w}){const u=B,{vue_ui_sparkstackbar:$}=o.useConfig(),k=e.computed(()=>!!u.dataset&&u.dataset.length),b=e.ref(o.createUid()),t=e.computed(()=>{const l=C.useNestedProp({userConfig:u.config,defaultConfig:$});return l.theme?{...C.useNestedProp({userConfig:o.themes.vue_ui_sparkstackbar[l.theme]||u.config,defaultConfig:l}),customPalette:o.themePalettes[l.theme]||o.palette}:l}),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]}))),p=e.ref(!0);e.onMounted(()=>{if(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})})}),t.value.style.animation.show){let h=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(h)):(p.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;p.value=!0,h()}});const v=e.ref({width:500,height:16}),c=e.ref([]),g=e.computed(()=>u.dataset.map(l=>l.value||0).filter((l,n)=>!c.value.includes(n)).reduce((l,n)=>l+n,0)),_=e.computed(()=>d.value.map((l,n)=>({...l,value:l.value||0,proportion:(l.value||0)/g.value,width:(l.value||0)/g.value*v.value.width,proportionLabel:o.dataLabel({v:(l.value||0)/g.value*100,s:"%",r:t.value.style.legend.percentage.rounding})}))),y=e.computed(()=>_.value.filter((l,n)=>!c.value.includes(n)));function S(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 f=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){w("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:${t.value.style.backgroundColor};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),k.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(f.value,(a,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{key:`stack_gradient_${r}`,gradientTransform:"rotate(90)",id:`stack_gradient_${r}_${b.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":a.color},null,8,D),e.createElementVNode("stop",{offset:"50%","stop-color":`${e.unref(o.shiftHue)(a.color,.05)}${e.unref(o.opacity)[100-t.value.style.bar.gradient.intensity]}`},null,8,P),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,L)],8,z))),128)),e.createElementVNode("clipPath",A,[e.createElementVNode("rect",{x:"0.005",y:"-2",width:"0.99",height:"5",rx:"3",ry:"3",fill:t.value.style.backgroundColor},null,8,F)])]),e.createElementVNode("g",U,[e.createElementVNode("rect",{x:0,y:0,height:v.value.height,width:f.value.map(a=>a.width).reduce((a,r)=>a+r,0),fill:t.value.style.bar.gradient.underlayerColor,class:e.normalizeClass({animated:!p.value})},null,10,j),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.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}_${b.value})`:a.color,stroke:t.value.style.backgroundColor,"stroke-linecap":"round",class:e.normalizeClass({animated:!p.value})},null,10,q))),128))])],8,V)):e.createCommentVNode("",!0),k.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(E.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:${t.value.style.backgroundColor};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(_.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:h=>{S(r),x(a,r)}},[e.createElementVNode("div",T,[(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,O)],8,H)),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))}},G=N._export_sfc(M,[["__scopeId","data-v-86f11bbc"]]);exports.default=G;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { computed as h, ref as v, onMounted as Ne, openBlock as i, createElementBlock as n, normalizeClass as ze, normalizeStyle as G, renderSlot as b, createVNode as ie, createCommentVNode as d, createBlock as Y, unref as w, createSlots as tt, withCtx as f, normalizeProps as I, guardReactiveProps as V, Fragment as m, renderList as $, createElementVNode as P, toDisplayString as z, createTextVNode as at } from "vue";
|
|
2
|
-
import { u as lt, c as Me, o as ot, e as Oe, g as st, t as rt, a as it, p as Q, b as ut, d as nt, a0 as j, A as Pe, X as ct, l as vt, D as dt, f as D, v as ht, w as Fe, i as Re, x as gt, q as yt, r as bt } from "./index-
|
|
3
|
-
import { u as Ie } from "./useNestedProp-
|
|
2
|
+
import { u as lt, c as Me, o as ot, e as Oe, g as st, t as rt, a as it, p as Q, b as ut, d as nt, a0 as j, A as Pe, X as ct, l as vt, D as dt, f as D, v as ht, w as Fe, i as Re, x as gt, q as yt, r as bt } from "./index-RX-sax8u.js";
|
|
3
|
+
import { u as Ie } from "./useNestedProp-wLyS1qg3.js";
|
|
4
4
|
import { t as ft, u as mt } from "./useResponsive-NZB-WLRF.js";
|
|
5
|
-
import { u as pt, U as xt } from "./usePrinter-
|
|
6
|
-
import { S as kt } from "./Slicer-
|
|
7
|
-
import { _ as wt } from "./Tooltip-
|
|
8
|
-
import { _ as Ct } from "./Title-
|
|
9
|
-
import { L as Lt } from "./Legend-
|
|
10
|
-
import St from "./vue-ui-accordion-
|
|
11
|
-
import { D as $t } from "./DataTable-
|
|
12
|
-
import _t from "./vue-ui-skeleton-
|
|
5
|
+
import { u as pt, U as xt } from "./usePrinter-pEo9G4KY.js";
|
|
6
|
+
import { S as kt } from "./Slicer-DeKlCzs9.js";
|
|
7
|
+
import { _ as wt } from "./Tooltip-kARe11oF.js";
|
|
8
|
+
import { _ as Ct } from "./Title-BNmjrAmy.js";
|
|
9
|
+
import { L as Lt } from "./Legend-CBclUqQE.js";
|
|
10
|
+
import St from "./vue-ui-accordion-SU0hvMyf.js";
|
|
11
|
+
import { D as $t } from "./DataTable-BRBTZQqC.js";
|
|
12
|
+
import _t from "./vue-ui-skeleton-CFx7wegx.js";
|
|
13
13
|
import { _ as Tt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
14
14
|
const Nt = ["id"], zt = ["xmlns", "viewBox"], Mt = { key: 0 }, Ot = ["id"], Pt = ["stop-color"], Ft = ["stop-color"], Rt = ["stop-color"], It = ["x1", "x2", "y1", "y2", "stroke"], Vt = ["x1", "x2", "y1", "y2", "stroke"], Dt = ["x", "y", "height", "rx", "width", "fill", "stroke", "stroke-width"], At = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Et = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Ht = ["x", "y", "font-size", "fill", "font-weight"], Bt = ["transform", "font-size", "fill", "font-weight"], Ut = ["x", "y", "font-size", "fill", "font-weight"], Wt = { key: 0 }, Gt = ["x", "y", "font-size", "font-weight", "fill"], Yt = ["x1", "x2", "y1", "y2", "stroke"], Xt = ["x", "y", "font-size", "font-weight", "fill"], Jt = ["text-anchor", "font-size", "font-weight", "fill", "transform"], qt = ["x", "y", "width", "height", "onClick", "onMouseenter", "fill"], Zt = {
|
|
15
15
|
key: 3,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-CWGchQHo.cjs"),de=require("./useNestedProp-ZSgzlkKZ.cjs"),ve=require("./useResponsive-B3TrDDIG.cjs"),he=require("./usePrinter-Dz8P4PrQ.cjs"),Ee=require("./Slicer-fdCI8qWb.cjs"),Ve=require("./Tooltip-CUSoSjeD.cjs"),Pe=require("./Title-ac0Tzobx.cjs"),Me=require("./Legend-Wzo5EwiV.cjs"),Fe=require("./vue-ui-accordion-BQfkZ2Fd.cjs"),Re=require("./DataTable-C1-LQ9kU.cjs"),Oe=require("./vue-ui-skeleton-B3I4L51F.cjs"),De=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Ie=["id"],qe=["xmlns","viewBox"],Ae={key:0},He=["id"],Ue=["stop-color"],We=["stop-color"],Ge=["stop-color"],Ye=["x1","x2","y1","y2","stroke"],Je=["x1","x2","y1","y2","stroke"],Xe=["x","y","height","rx","width","fill","stroke","stroke-width"],Ze=["x1","x2","y1","y2","stroke","stroke-width"],Ke=["x1","x2","y1","y2","stroke","stroke-width"],Qe=["x","y","font-size","fill","font-weight"],je=["transform","font-size","fill","font-weight"],et=["x","y","font-size","fill","font-weight"],tt={key:0},at=["x","y","font-size","font-weight","fill"],lt=["x1","x2","y1","y2","stroke"],ot=["x","y","font-size","font-weight","fill"],rt=["text-anchor","font-size","font-weight","fill","transform"],st=["x","y","width","height","onClick","onMouseenter","fill"],nt={key:3,class:"vue-data-ui-watermark"},it=["onClick"],ut=["innerHTML"],ct={__name:"vue-ui-stackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint","selectLegend"],setup(U,{expose:ge,emit:W}){const f=U,{vue_ui_stackbar:me}=u.useConfig(),S=e.computed({get(){return!!f.dataset&&f.dataset.length},set(l){return l}}),L=e.ref(null),R=e.ref(u.createUid()),O=e.ref(!1),G=e.ref(null),D=e.ref(""),h=e.ref([]),Y=e.ref(0),J=e.ref(null),X=e.ref(null),Z=e.ref(null),K=e.ref(0),I=e.ref(!1),q=e.ref(null),E=e.ref(!1);e.onMounted(()=>{u.objectIsEmpty(f.dataset)?u.error({componentName:"VueUiStackbar",type:"dataset"}):f.dataset.forEach((l,o)=>{u.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","series"]}).forEach(a=>{S.value=!1,u.error({componentName:"VueUiStackbar",type:"datasetSerieAttribute",property:a,index:o})})}),setTimeout(()=>{E.value=!0},10)});const t=e.computed(()=>{const l=de.useNestedProp({userConfig:f.config,defaultConfig:me});return l.theme?{...de.useNestedProp({userConfig:u.themes.vue_ui_stackbar[l.theme]||f.config,defaultConfig:l}),customPalette:u.themePalettes[l.theme]||u.palette}:l}),p=e.ref({dataLabels:{show:t.value.style.chart.bars.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),{isPrinting:Q,isImaging:j,generatePdf:ee,generateImage:te}=he.usePrinter({elementId:`stackbar_${R.value}`,fileName:t.value.style.chart.title.text||"vue-ui-stackbar"}),V=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}}),pe=e.computed(()=>u.convertCustomPalette(t.value.customPalette)),ae=e.ref(null),le=e.ref(null);e.onMounted(()=>{if(t.value.responsive){const l=ve.throttle(()=>{E.value=!1;const{width:o,height:a}=ve.useResponsive({chart:L.value,title:t.value.style.chart.title.text?J.value:null,legend:t.value.style.chart.legend.show?X.value:null,slicer:t.value.style.chart.zoom.show&&N.value>1?Z.value:null});V.value.width=o,V.value.height=a,clearTimeout(le.value),le.value=setTimeout(()=>{E.value=!0},10)});ae.value=new ResizeObserver(l),ae.value.observe(L.value.parentNode)}});const n=e.computed(()=>{const{height:l,width:o}=V.value,{right:a}=V.value.paddingRatio,r=t.value.style.chart.padding.top,s=o-o*a,c=l-t.value.style.chart.padding.bottom,g=t.value.style.chart.padding.left,C=o-g-o*a,w=l-r-t.value.style.chart.padding.bottom;return{chartHeight:l,chartWidth:o,top:r,right:s,bottom:c,left:g,width:C,height:w<0?0:w}}),k=e.computed(()=>f.dataset.map((l,o)=>{const a=u.convertColorToHex(l.color)||pe.value[o]||u.palette[o]||u.palette[o%u.palette.length];return{...l,series:JSON.parse(JSON.stringify(l.series)).map(r=>t.value.style.chart.bars.distributed?Math.abs(r):r),signedSeries:l.series.map(r=>r>=0?1:-1),absoluteIndex:o,id:u.createUid(),color:a}})),N=e.computed(()=>Math.max(...k.value.filter(l=>!h.value.includes(l.id)).map(l=>l.series.length))),i=e.ref({start:0,end:Math.max(...f.dataset.map(l=>l.series.length))});function ye(){i.value={start:0,end:Math.max(...f.dataset.map(l=>l.series.length))},K.value+=1}const y=e.computed(()=>{const l=n.value.width/(i.value.end-i.value.start);return l<=0?0:l}),A=e.computed(()=>u.sumSeries(k.value.filter(l=>!h.value.includes(l.id))).slice(i.value.start,i.value.end)),be=e.computed(()=>u.sumSeries(k.value.filter(l=>!h.value.includes(l.id)).map(l=>({...l,series:l.series.map((o,a)=>l.signedSeries[a]===-1&&o>=0?-o:o)}))).slice(i.value.start,i.value.end)),P=e.computed(()=>{const l=k.value.filter(o=>!h.value.includes(o.id));return{positive:u.sumSeries(l.map(o=>({...o,series:o.series.slice(i.value.start,i.value.end).map(a=>a>=0?a:0)}))),negative:u.sumSeries(l.map(o=>({...o,series:o.series.slice(i.value.start,i.value.end).map(a=>a<0?a:0)})))}}),$=e.computed(()=>{const l=Math.max(...P.value.positive),o=Math.min(...P.value.negative),a=[-1/0,1/0,NaN,void 0,null].includes(o)?0:o,r=u.calculateNiceScale(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks);return r.ticks.map(s=>({zero:n.value.bottom-n.value.height*(Math.abs(r.min)/(r.max+Math.abs(r.min))),y:n.value.bottom-n.value.height*((s+Math.abs(r.min))/(r.max+Math.abs(r.min))),x:n.value.left-8,value:s}))}),M=e.computed(()=>t.value.style.chart.grid.x.timeLabels.values.slice(i.value.start,i.value.end)),d=e.computed(()=>{if(!S.value)return[];let l=Array(N.value).fill(0),o=Array(N.value).fill(0);const a=Math.max(...P.value.positive)||0,r=Math.min(...P.value.negative),s=[-1/0,1/0,NaN,void 0,null].includes(r)?0:r,c=u.calculateNiceScale(s>0?0:s,a<0?0:a,t.value.style.chart.grid.scale.ticks),{min:g,max:C}=c,w=C+(g>=0?0:Math.abs(g))||1,x=n.value.height,T=$.value[0]?$.value[0].zero:n.value.bottom;return k.value.filter(b=>!h.value.includes(b.id)).map(b=>{const B=b.series.slice(i.value.start,i.value.end),Ne=b.signedSeries.slice(i.value.start,i.value.end),$e=B.map((v,m)=>n.value.left+y.value*m+y.value*t.value.style.chart.bars.gapRatio/4),Te=B.map((v,m)=>{const z=t.value.style.chart.bars.distributed?(v||0)/A.value[m]:(v||0)/w;let H,_;return v>0?(_=x*z,H=T-_-l[m],l[m]+=_):(_=x*z,H=T+o[m],o[m]+=Math.abs(_)),H}),ze=B.map((v,m)=>{const z=t.value.style.chart.bars.distributed?(v||0)/A.value[m]:(v||0)/w;return v>0?x*z:x*Math.abs(z)}),_e=B.map(v=>Math.abs(v)).reduce((v,m)=>v+m,0);return{...b,proportions:B.map((v,m)=>t.value.style.chart.bars.distributed?(v||0)/A.value[m]:(v||0)/_e),series:B,signedSeries:Ne,x:$e,y:Te,height:ze}})}),fe=e.computed(()=>be.value.map((l,o)=>({value:l,sign:l>=0?1:-1})));function oe(l,o,a,r,s){const c=s===-1&&l>=0?-l:l;return u.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,c,u.dataLabel({p:t.value.style.chart.bars.dataLabels.prefix,v:c,s:t.value.style.chart.bars.dataLabels.suffix,r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:o,seriesIndex:a,datapointIndex:r})}function ke(l,o,a,r){return u.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,l,u.dataLabel({v:l,s:"%",r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:o,seriesIndex:a,datapointIndex:r})}function xe(l){const o=JSON.parse(JSON.stringify(d.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}));W("selectDatapoint",{datapoint:o,period:M.value[l]})}function Ce(l){q.value=l,O.value=!0;const o=t.value.style.chart.tooltip.customFormat,a=JSON.parse(JSON.stringify(d.value)).map(s=>({name:s.name,value:s.series[l]===0?0:(s.signedSeries[l]===-1&&s.series[l]>=0?-s.series[l]:s.series[l])||null,proportion:s.proportions[l]||null,color:s.color,id:s.id})),r=a.map(s=>Math.abs(s.value)).reduce((s,c)=>s+c,0);if(u.isFunction(o)&&u.functionReturnsString(()=>o({seriesIndex:l,datapoint:a,series:d.value,config:t.value})))D.value=o({seriesIndex:l,datapoint:a,series:d.value,config:t.value});else{const{showValue:s,showPercentage:c,borderColor:g,roundingValue:C,roundingPercentage:w}=t.value.style.chart.tooltip;let x="";M.value[l]&&(x+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${g};padding-bottom:6px;margin-bottom:3px;">${M.value[l]}</div>`);const T=[s&&c?"(":"",s&&c?")":""];a.reverse().forEach(b=>{x+=`
|
|
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_${b.id})`:b.color}"/></svg>
|
|
4
4
|
${b.name}${s||c?":":""} ${s?u.dataLabel({p:t.value.style.chart.bars.dataLabels.prefix,v:b.value,s:t.value.style.chart.bars.dataLabels.suffix,r:C}):""} ${T[0]}${c?u.dataLabel({v:isNaN(b.value/r)?0:Math.abs(b.value)/r*100,s:"%",r:w}):""}${T[1]}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { computed as p, ref as c, onMounted as Le, onBeforeUnmount as Pe, openBlock as r, createElementBlock as i, normalizeClass as O, normalizeStyle as V, createVNode as K, createCommentVNode as v, createBlock as H, unref as h, createSlots as Se, withCtx as f, renderSlot as m, normalizeProps as R, guardReactiveProps as U, Fragment as g, renderList as C, createElementVNode as x, toDisplayString as T, mergeProps as ze, createTextVNode as Ae, nextTick as Ne } from "vue";
|
|
2
|
-
import { u as Oe, c as Q, t as Fe, a as We, p as L, o as Ie, e as Z, g as pe, b as Me, d as ye, A as De, f as B, X as Ge, i as ee, l as Ee, h as Ve, w as fe, x as He, q as Re, r as Ue, C as Be } from "./index-
|
|
2
|
+
import { u as Oe, c as Q, t as Fe, a as We, p as L, o as Ie, e as Z, g as pe, b as Me, d as ye, A as De, f as B, X as Ge, i as ee, l as Ee, h as Ve, w as fe, x as He, q as Re, r as Ue, C as Be } from "./index-RX-sax8u.js";
|
|
3
3
|
import { t as Xe, u as je } from "./useResponsive-NZB-WLRF.js";
|
|
4
|
-
import { _ as Ye } from "./Title-
|
|
5
|
-
import { u as Je, U as qe } from "./usePrinter-
|
|
6
|
-
import { _ as Ke } from "./Tooltip-
|
|
7
|
-
import { D as Qe } from "./DataTable-
|
|
8
|
-
import Ze from "./vue-ui-skeleton-
|
|
9
|
-
import { _ as et } from "./Shape-
|
|
10
|
-
import tt from "./vue-ui-accordion-
|
|
11
|
-
import { u as be } from "./useNestedProp-
|
|
4
|
+
import { _ as Ye } from "./Title-BNmjrAmy.js";
|
|
5
|
+
import { u as Je, U as qe } from "./usePrinter-pEo9G4KY.js";
|
|
6
|
+
import { _ as Ke } from "./Tooltip-kARe11oF.js";
|
|
7
|
+
import { D as Qe } from "./DataTable-BRBTZQqC.js";
|
|
8
|
+
import Ze from "./vue-ui-skeleton-CFx7wegx.js";
|
|
9
|
+
import { _ as et } from "./Shape-COYrBpTA.js";
|
|
10
|
+
import tt from "./vue-ui-accordion-SU0hvMyf.js";
|
|
11
|
+
import { u as be } from "./useNestedProp-wLyS1qg3.js";
|
|
12
12
|
import { _ as lt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
13
13
|
const at = ["id"], ot = ["xmlns", "viewBox"], st = { key: 0 }, rt = { key: 0 }, ut = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], it = { key: 1 }, nt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], ct = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], vt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], ht = ["x", "y", "fill", "font-size"], dt = ["x", "y", "font-size", "fill"], pt = ["fill", "font-size", "transform"], yt = ["fill", "font-size", "x", "y"], ft = ["x1", "x2", "y1", "y2", "stroke"], bt = ["cx", "cy", "fill"], mt = ["cx", "cy", "fill"], gt = ["id"], xt = ["stop-color"], kt = ["stop-color"], Ct = ["stop-color"], wt = { key: 0 }, _t = ["x", "y", "font-size", "fill"], $t = {
|
|
14
14
|
key: 3,
|