vue-data-ui 2.4.60 → 2.4.62
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-BoAS4IQq.cjs → Arrow-C0lmBG2-.cjs} +1 -1
- package/dist/{Arrow-BLYi22nR.js → Arrow-E7FjAwN-.js} +1 -1
- package/dist/{BaseIcon-BHIQREMO.cjs → BaseIcon-DK3C9OCq.cjs} +1 -1
- package/dist/{BaseIcon-EWtqg17H.js → BaseIcon-DRLxlrSt.js} +1 -1
- package/dist/{DataTable-DO8KGCcE.js → DataTable-BANy6PnS.js} +2 -2
- package/dist/{DataTable-Dtq94CxH.cjs → DataTable-BLSMgcEN.cjs} +1 -1
- package/dist/{Legend-CMyzYtIb.cjs → Legend-CAgxjrra.cjs} +1 -1
- package/dist/{Legend-DGWOCyLt.js → Legend-pWq2tKCl.js} +1 -1
- package/dist/{PackageVersion-BSLNI6kk.js → PackageVersion-1NslmM8M.js} +1 -1
- package/dist/{PackageVersion-B_1OHk5A.cjs → PackageVersion-D3dK8oA3.cjs} +1 -1
- package/dist/{PenAndPaper-DhXsAnuf.cjs → PenAndPaper-CYFIR9j7.cjs} +1 -1
- package/dist/{PenAndPaper-CxMtGtJt.js → PenAndPaper-CdXSbSZY.js} +3 -3
- package/dist/{Shape-DnqZey62.js → Shape-BtKtwV0v.js} +1 -1
- package/dist/{Shape-y66NSXKp.cjs → Shape-DPztPWor.cjs} +1 -1
- package/dist/{Slicer-CkI4c7ft.cjs → Slicer-BggxvZRw.cjs} +1 -1
- package/dist/{Slicer-D9bKLcPd.js → Slicer-p4IqkHkJ.js} +2 -2
- package/dist/{Title-DjAOcuWO.cjs → Title-BhL7TMa_.cjs} +1 -1
- package/dist/{Title-CSqO5Y62.js → Title-DPefeOY7.js} +1 -1
- package/dist/{Tooltip-AHTiRuWB.cjs → Tooltip-C5qSWrXO.cjs} +1 -1
- package/dist/{Tooltip-D_6iYZSH.js → Tooltip-C72f83eg.js} +1 -1
- package/dist/{index-D7dTQAhm.js → index-B-k71vpj.js} +4 -1
- package/dist/index-CC7tVh7F.cjs +9 -0
- package/dist/style.css +1 -1
- package/dist/types/vue-data-ui.d.cts +3 -0
- package/dist/types/vue-data-ui.d.ts +3 -0
- package/dist/{useNestedProp-Dqsj7eUX.js → useNestedProp-BeXDUo1v.js} +1 -1
- package/dist/{useNestedProp-BxCE3J3Z.cjs → useNestedProp-CxwPeWts.cjs} +1 -1
- package/dist/{usePrinter-B_Ihuvge.js → usePrinter-BK-n-gRN.js} +1 -1
- package/dist/{usePrinter-sTw1FdN_.cjs → usePrinter-CMvfTteH.cjs} +1 -1
- package/dist/{vue-data-ui-BttN99Pm.cjs → vue-data-ui-CG-HnqKG.cjs} +1 -1
- package/dist/{vue-data-ui-CcmpjOfT.js → vue-data-ui-fOomZU3e.js} +60 -60
- package/dist/vue-data-ui.cjs +1 -1
- package/dist/vue-data-ui.js +1 -1
- package/dist/{vue-ui-3d-bar-TVrDBG5I.js → vue-ui-3d-bar-C95HBkYv.js} +9 -9
- package/dist/{vue-ui-3d-bar-8ewYobNj.cjs → vue-ui-3d-bar-DLrJ9TM8.cjs} +1 -1
- package/dist/{vue-ui-accordion-lCiFhb8k.js → vue-ui-accordion-DWAg7tbw.js} +3 -3
- package/dist/{vue-ui-accordion-BZH6cz4t.cjs → vue-ui-accordion-IZgkGqto.cjs} +1 -1
- package/dist/{vue-ui-age-pyramid-BqL8zDjt.cjs → vue-ui-age-pyramid-BSKXGW3a.cjs} +1 -1
- package/dist/{vue-ui-age-pyramid-rHtMf5-R.js → vue-ui-age-pyramid-BxBU5CCr.js} +10 -10
- package/dist/{vue-ui-annotator-DHgSReIY.js → vue-ui-annotator-DupDeVZx.js} +1 -1
- package/dist/{vue-ui-annotator-fZIPfk7y.cjs → vue-ui-annotator-GSRzlJ-N.cjs} +1 -1
- package/dist/{vue-ui-bullet-48af9PqJ.cjs → vue-ui-bullet-BD0MrIvY.cjs} +1 -1
- package/dist/{vue-ui-bullet-BwhlvcvA.js → vue-ui-bullet-Dgr-mCAc.js} +8 -8
- package/dist/{vue-ui-candlestick-dMIrnPD6.js → vue-ui-candlestick-DYupl4j5.js} +11 -11
- package/dist/{vue-ui-candlestick-Ce3tBGpX.cjs → vue-ui-candlestick-DpcBRWha.cjs} +1 -1
- package/dist/{vue-ui-carousel-table-ZhjRbt5-.cjs → vue-ui-carousel-table-CNS6ZzTc.cjs} +1 -1
- package/dist/{vue-ui-carousel-table-EcwgqGoI.js → vue-ui-carousel-table-DNwWV8de.js} +4 -4
- package/dist/{vue-ui-chestnut-VbrVVUon.cjs → vue-ui-chestnut-AVSIntNp.cjs} +1 -1
- package/dist/{vue-ui-chestnut-vnOyc43k.js → vue-ui-chestnut-OaTraMv4.js} +8 -8
- package/dist/{vue-ui-cursor-BdXcdH2e.cjs → vue-ui-cursor-CJJ78nNY.cjs} +1 -1
- package/dist/{vue-ui-cursor-nMbvzf_R.js → vue-ui-cursor-Dlo68AuK.js} +2 -2
- package/dist/{vue-ui-dashboard-BtaQn50h.js → vue-ui-dashboard-CzF8PeC6.js} +2 -2
- package/dist/{vue-ui-dashboard-CboN2WC8.cjs → vue-ui-dashboard-fYhjRzSY.cjs} +1 -1
- package/dist/{vue-ui-digits-CVfceh4-.js → vue-ui-digits-BHkW0Bi1.js} +2 -2
- package/dist/{vue-ui-digits-CUvrlpPz.cjs → vue-ui-digits-BSE3CEuv.cjs} +1 -1
- package/dist/{vue-ui-donut-CgYNthls.js → vue-ui-donut-CeestESD.js} +11 -11
- package/dist/{vue-ui-donut-BckYXDZJ.cjs → vue-ui-donut-DxH9EkK_.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-BhlBp6R-.cjs → vue-ui-donut-evolution-BDwV-Ncf.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-Bose25D6.js → vue-ui-donut-evolution-DGl_J0JB.js} +11 -11
- package/dist/{vue-ui-dumbbell-C2iT17s8.cjs → vue-ui-dumbbell-ChipHJ9p.cjs} +1 -1
- package/dist/{vue-ui-dumbbell-CzSlukSu.js → vue-ui-dumbbell-DlELQHtq.js} +10 -10
- package/dist/{vue-ui-flow-DoDWK84L.js → vue-ui-flow-BZIiidbF.js} +9 -9
- package/dist/{vue-ui-flow-DDlFrtkk.cjs → vue-ui-flow-BowAWyMA.cjs} +1 -1
- package/dist/{vue-ui-funnel-CM_ixf98.js → vue-ui-funnel-Bc7BrgHa.js} +9 -9
- package/dist/{vue-ui-funnel-BfJoFIfh.cjs → vue-ui-funnel-DLzHnLhb.cjs} +1 -1
- package/dist/{vue-ui-galaxy-CP71UAF5.cjs → vue-ui-galaxy-DesiP-Ev.cjs} +1 -1
- package/dist/{vue-ui-galaxy-DlwjTJCx.js → vue-ui-galaxy-t5R2Vz1t.js} +11 -11
- package/dist/{vue-ui-gauge-ByfGCK6z.js → vue-ui-gauge-CYx4jt71.js} +7 -7
- package/dist/{vue-ui-gauge-LqhfOqH-.cjs → vue-ui-gauge-_-1DxTe0.cjs} +1 -1
- package/dist/{vue-ui-gizmo-D8Rq5vzL.js → vue-ui-gizmo-DVcY_OyD.js} +3 -3
- package/dist/{vue-ui-gizmo-DFnOaVHf.cjs → vue-ui-gizmo-DeO_vFhP.cjs} +1 -1
- package/dist/{vue-ui-heatmap-A8qDlc58.cjs → vue-ui-heatmap-CWqJiKrJ.cjs} +1 -1
- package/dist/{vue-ui-heatmap-BLjVXXW4.js → vue-ui-heatmap-wLcx9ex3.js} +10 -10
- package/dist/{vue-ui-history-plot-DXoNlRFZ.js → vue-ui-history-plot-D7VjQwLk.js} +11 -11
- package/dist/{vue-ui-history-plot-Bxi5QRP8.cjs → vue-ui-history-plot-FJnUgshF.cjs} +1 -1
- package/dist/{vue-ui-kpi-Bbot_WSI.js → vue-ui-kpi-C4tl3luu.js} +3 -3
- package/dist/{vue-ui-kpi-5cGZ0OBJ.cjs → vue-ui-kpi-DcGp2H4d.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-DWX9tRhG.cjs → vue-ui-mini-loader-B41vyg7t.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-DOE9WO73.js → vue-ui-mini-loader-DZ-Rxr07.js} +2 -2
- package/dist/{vue-ui-molecule-0TReXB2j.js → vue-ui-molecule-51NSY4Z8.js} +11 -11
- package/dist/{vue-ui-molecule-CxeFzXS5.cjs → vue-ui-molecule-CUiAEOC9.cjs} +1 -1
- package/dist/{vue-ui-mood-radar-BMFn685U.js → vue-ui-mood-radar-DG3MA8BZ.js} +11 -11
- package/dist/{vue-ui-mood-radar-1jLzXLXZ.cjs → vue-ui-mood-radar-DkXzwU8x.cjs} +1 -1
- package/dist/{vue-ui-nested-donuts-B9rWg9V8.js → vue-ui-nested-donuts-Be9FYX8F.js} +11 -11
- package/dist/{vue-ui-nested-donuts-4FVj04vI.cjs → vue-ui-nested-donuts-Cerc7ILW.cjs} +1 -1
- package/dist/{vue-ui-onion-CnIF_tv7.js → vue-ui-onion-BhNd2hbK.js} +11 -11
- package/dist/{vue-ui-onion-Br97OxbL.cjs → vue-ui-onion-BpIopgzq.cjs} +1 -1
- package/dist/{vue-ui-parallel-coordinate-plot-D9iHCwiA.js → vue-ui-parallel-coordinate-plot-CSll-Vtd.js} +12 -12
- package/dist/{vue-ui-parallel-coordinate-plot-Bi_h0H7e.cjs → vue-ui-parallel-coordinate-plot-D1z9zPyF.cjs} +1 -1
- package/dist/{vue-ui-quadrant-DHDToQ9a.cjs → vue-ui-quadrant-303aQCVj.cjs} +1 -1
- package/dist/{vue-ui-quadrant-4wjbqumK.js → vue-ui-quadrant-mw0cCB8b.js} +12 -12
- package/dist/{vue-ui-quick-chart-s6FHOZf8.js → vue-ui-quick-chart-6sXw4LvX.js} +9 -9
- package/dist/{vue-ui-quick-chart-CJKM6r9X.cjs → vue-ui-quick-chart-DJfdl_Oc.cjs} +1 -1
- package/dist/{vue-ui-radar-DBR2qBM5.cjs → vue-ui-radar-B5c80iuj.cjs} +1 -1
- package/dist/{vue-ui-radar-DpT9w1N-.js → vue-ui-radar-DT2PXZ3W.js} +12 -12
- package/dist/{vue-ui-rating-D1Mbw1G8.cjs → vue-ui-rating-RKyIWluu.cjs} +1 -1
- package/dist/{vue-ui-rating-D31vSe7a.js → vue-ui-rating-x4INc3T_.js} +2 -2
- package/dist/{vue-ui-relation-circle-DfP6BpVn.js → vue-ui-relation-circle-OTUjuy7-.js} +7 -7
- package/dist/{vue-ui-relation-circle-BNJbqK_A.cjs → vue-ui-relation-circle-T_cM-vkm.cjs} +1 -1
- package/dist/{vue-ui-rings-ChcGuwL9.js → vue-ui-rings-B1c_TNA0.js} +11 -11
- package/dist/{vue-ui-rings-CjB8a3kO.cjs → vue-ui-rings-CEdur365.cjs} +1 -1
- package/dist/{vue-ui-scatter-jk0N3EwD.cjs → vue-ui-scatter-BM6iF4yl.cjs} +1 -1
- package/dist/{vue-ui-scatter-wUZ2CBpp.js → vue-ui-scatter-CjI7xkJm.js} +12 -12
- package/dist/{vue-ui-screenshot-Blg3Suvg.js → vue-ui-screenshot-DoMe-dMI.js} +1 -1
- package/dist/{vue-ui-screenshot-DAFpjSWg.cjs → vue-ui-screenshot-wadHKtkZ.cjs} +1 -1
- package/dist/{vue-ui-skeleton-m4l9jfqA.cjs → vue-ui-skeleton-BgEjqaz9.cjs} +1 -1
- package/dist/{vue-ui-skeleton-BObG0eVD.js → vue-ui-skeleton-DSXzxNMC.js} +3 -3
- package/dist/{vue-ui-smiley-rh3J3TRY.cjs → vue-ui-smiley-D5KYgUQi.cjs} +1 -1
- package/dist/{vue-ui-smiley-DuQ3M02e.js → vue-ui-smiley-DgfHBeGm.js} +2 -2
- package/dist/{vue-ui-spark-trend-SMpnQ3VV.js → vue-ui-spark-trend-CEU0TB9l.js} +5 -5
- package/dist/{vue-ui-spark-trend-DlNNTu2c.cjs → vue-ui-spark-trend-DhPXSFpU.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-chnu8aw9.cjs → vue-ui-sparkbar-8vDQ9r97.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-BB6fvRXK.js → vue-ui-sparkbar-C8TB_YCv.js} +4 -4
- package/dist/{vue-ui-sparkgauge-Bk_78-YB.js → vue-ui-sparkgauge-DCXX3ZDS.js} +4 -4
- package/dist/{vue-ui-sparkgauge-FONvy7z9.cjs → vue-ui-sparkgauge-DnYyNQQn.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram--uyRru2f.cjs → vue-ui-sparkhistogram-BQGAFZWZ.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram-CIsN7kQ2.js → vue-ui-sparkhistogram-CEmGA3kW.js} +5 -5
- package/dist/vue-ui-sparkline-BXvaVl-R.js +423 -0
- package/dist/vue-ui-sparkline-HQaxAzTw.cjs +1 -0
- package/dist/{vue-ui-sparkstackbar-DDMsCq0l.js → vue-ui-sparkstackbar-CI0uvrlh.js} +5 -5
- package/dist/{vue-ui-sparkstackbar-1RvV2xwt.cjs → vue-ui-sparkstackbar-DbtbyF5W.cjs} +1 -1
- package/dist/{vue-ui-stackbar-CQgtC1I4.cjs → vue-ui-stackbar-CYJLXaU0.cjs} +1 -1
- package/dist/{vue-ui-stackbar-BSo9t-88.js → vue-ui-stackbar-D-_Fp5r4.js} +12 -12
- package/dist/{vue-ui-strip-plot-BOSoKxsk.cjs → vue-ui-strip-plot-DUBjl9cR.cjs} +1 -1
- package/dist/{vue-ui-strip-plot-C99LsMeZ.js → vue-ui-strip-plot-pJsObuy6.js} +11 -11
- package/dist/{vue-ui-table-M-6G46br.cjs → vue-ui-table-CbvpwN05.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-BuYlqsq9.js → vue-ui-table-heatmap-BAlngE3L.js} +4 -4
- package/dist/{vue-ui-table-heatmap-CoozQ9bU.cjs → vue-ui-table-heatmap-sAuA3lIc.cjs} +1 -1
- package/dist/{vue-ui-table-3M-aoEc7.js → vue-ui-table-s7IHsGac.js} +1 -1
- package/dist/{vue-ui-table-sparkline-u0a2YCwp.cjs → vue-ui-table-sparkline-CjaF-Zjq.cjs} +1 -1
- package/dist/{vue-ui-table-sparkline-Dm5kErGp.js → vue-ui-table-sparkline-ClrZ-BC3.js} +5 -5
- package/dist/{vue-ui-thermometer-DrY5FsCD.js → vue-ui-thermometer-C_sqnPkS.js} +7 -7
- package/dist/{vue-ui-thermometer-DAz_NjaN.cjs → vue-ui-thermometer-fcy4HsN6.cjs} +1 -1
- package/dist/{vue-ui-timer-dCCTsApx.cjs → vue-ui-timer-B0lLVb4J.cjs} +1 -1
- package/dist/{vue-ui-timer-meFVXDUZ.js → vue-ui-timer-DeRjcfir.js} +5 -5
- package/dist/{vue-ui-tiremarks-CRKQklZh.cjs → vue-ui-tiremarks-CBnEObhg.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-PaZ-lr2D.js → vue-ui-tiremarks-DCOJWvBx.js} +7 -7
- package/dist/{vue-ui-treemap-Bce1C9jk.cjs → vue-ui-treemap-SPe7NLHg.cjs} +1 -1
- package/dist/{vue-ui-treemap-RjHcVtc6.js → vue-ui-treemap-UU9kd93i.js} +11 -11
- package/dist/{vue-ui-vertical-bar-C8rC-QBl.js → vue-ui-vertical-bar-Do1beV1x.js} +11 -11
- package/dist/{vue-ui-vertical-bar-e7zR_v0M.cjs → vue-ui-vertical-bar-DtPjSOTd.cjs} +1 -1
- package/dist/{vue-ui-waffle-BT8Yn0cl.js → vue-ui-waffle-B1XP-Qon.js} +11 -11
- package/dist/{vue-ui-waffle-BZLPoVht.cjs → vue-ui-waffle-CCWlLaex.cjs} +1 -1
- package/dist/{vue-ui-wheel-CT6r7EQR.cjs → vue-ui-wheel-BHVTUvG3.cjs} +1 -1
- package/dist/{vue-ui-wheel-Bq75N1i7.js → vue-ui-wheel-D6IUmaVZ.js} +7 -7
- package/dist/{vue-ui-word-cloud-BGh6DY8P.js → vue-ui-word-cloud-AubuQjfw.js} +10 -10
- package/dist/{vue-ui-word-cloud-PcOI8TCE.cjs → vue-ui-word-cloud-BvjWoqnE.cjs} +1 -1
- package/dist/{vue-ui-xy-DuCsguVf.js → vue-ui-xy-BMJpPJeS.js} +14 -14
- package/dist/{vue-ui-xy-BmNqzUPR.cjs → vue-ui-xy-CTLJncUe.cjs} +1 -1
- package/dist/{vue-ui-xy-canvas-6qf3rgfa.js → vue-ui-xy-canvas-DHU2wBAP.js} +11 -11
- package/dist/{vue-ui-xy-canvas-BnJBE19B.cjs → vue-ui-xy-canvas-De-MHu0Y.cjs} +1 -1
- package/package.json +1 -1
- package/dist/index-CgZGelSi.cjs +0 -9
- package/dist/vue-ui-sparkline-CFvUW--O.js +0 -419
- package/dist/vue-ui-sparkline-i6LHjMJR.cjs +0 -1
|
@@ -1,419 +0,0 @@
|
|
|
1
|
-
import { computed as v, ref as m, watch as U, onMounted as re, openBlock as o, createElementBlock as r, normalizeStyle as C, renderSlot as I, normalizeProps as ne, guardReactiveProps as ie, createElementVNode as f, toDisplayString as X, createCommentVNode as h, unref as c, createVNode as de, Fragment as A, renderList as D, createBlock as ve } from "vue";
|
|
2
|
-
import { u as he, c as ce, t as ye, _ as T, o as fe, e as Z, g as pe, w as M, $ as ge, a0 as me, X as ke, s as P, R as q, i as H, f as Y } from "./index-D7dTQAhm.js";
|
|
3
|
-
import { u as J } from "./useNestedProp-Dqsj7eUX.js";
|
|
4
|
-
import be from "./vue-ui-skeleton-BObG0eVD.js";
|
|
5
|
-
import { t as _e, u as xe } from "./useResponsive-CoxXLe23.js";
|
|
6
|
-
import { _ as we } from "./PackageVersion-BSLNI6kk.js";
|
|
7
|
-
import { _ as $e } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
8
|
-
const Le = ["id"], Ne = ["xmlns", "viewBox"], Ce = ["width", "height"], Ie = ["id"], Me = ["stop-color"], Pe = ["stop-color"], Ve = ["id"], ze = ["stop-color"], Se = ["stop-color"], We = ["id"], Ae = ["stop-color"], De = ["stop-color"], Te = { key: 1 }, Oe = ["d", "fill"], Be = ["d", "fill"], Ee = ["d", "stroke", "stroke-width"], Fe = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Ge = ["x", "y", "width", "height", "fill", "rx"], Re = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], je = ["x1", "x2", "y1", "y2", "stroke", "stroke-dasharray", "stroke-width"], Ue = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], Xe = ["x", "y", "font-size", "font-weight", "fill"], Ze = ["x", "y", "height", "width", "onMouseenter", "onClick"], qe = {
|
|
9
|
-
__name: "vue-ui-sparkline",
|
|
10
|
-
props: {
|
|
11
|
-
config: {
|
|
12
|
-
type: Object,
|
|
13
|
-
default() {
|
|
14
|
-
return {};
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
dataset: {
|
|
18
|
-
type: Array,
|
|
19
|
-
default() {
|
|
20
|
-
return [];
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
showInfo: {
|
|
24
|
-
type: Boolean,
|
|
25
|
-
default: !0
|
|
26
|
-
},
|
|
27
|
-
selectedIndex: {
|
|
28
|
-
type: Number,
|
|
29
|
-
default: void 0
|
|
30
|
-
},
|
|
31
|
-
heightRatio: {
|
|
32
|
-
type: Number,
|
|
33
|
-
default: 1
|
|
34
|
-
},
|
|
35
|
-
forcedPadding: {
|
|
36
|
-
type: Number,
|
|
37
|
-
default: 30
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
emits: ["hoverIndex", "selectDatapoint"],
|
|
41
|
-
setup(_, { emit: V }) {
|
|
42
|
-
const i = _, { vue_ui_sparkline: K } = he(), $ = v(() => !!i.dataset && i.dataset.length), p = m(ce()), z = m(null), O = m(null), B = m(null), e = v({
|
|
43
|
-
get: () => E(),
|
|
44
|
-
set: (t) => t
|
|
45
|
-
});
|
|
46
|
-
function E() {
|
|
47
|
-
const t = J({
|
|
48
|
-
userConfig: i.config,
|
|
49
|
-
defaultConfig: K
|
|
50
|
-
});
|
|
51
|
-
return t.theme ? {
|
|
52
|
-
...J({
|
|
53
|
-
userConfig: ye.vue_ui_sparkline[t.theme] || i.config,
|
|
54
|
-
defaultConfig: t
|
|
55
|
-
})
|
|
56
|
-
} : t;
|
|
57
|
-
}
|
|
58
|
-
const L = v(() => T({
|
|
59
|
-
data: i.dataset,
|
|
60
|
-
threshold: e.value.downsample.threshold
|
|
61
|
-
}));
|
|
62
|
-
U(() => i.config, (t) => {
|
|
63
|
-
e.value = E(), G(), l.value.chartWidth = e.value.style.chartWidth;
|
|
64
|
-
}, { deep: !0 }), U(() => i.dataset, (t) => {
|
|
65
|
-
b.value = T({
|
|
66
|
-
data: i.dataset.map((u) => ({
|
|
67
|
-
...u,
|
|
68
|
-
value: [void 0].includes(u.value) ? null : u.value
|
|
69
|
-
})),
|
|
70
|
-
threshold: e.value.downsample.threshold
|
|
71
|
-
});
|
|
72
|
-
}, { deep: !0 });
|
|
73
|
-
const b = m(Q());
|
|
74
|
-
function Q() {
|
|
75
|
-
return T({
|
|
76
|
-
data: i.dataset.map((t) => e.value.style.animation.show ? {
|
|
77
|
-
...t,
|
|
78
|
-
value: null
|
|
79
|
-
} : {
|
|
80
|
-
...t,
|
|
81
|
-
value: [void 0].includes(t.value) ? null : t.value
|
|
82
|
-
}),
|
|
83
|
-
threshold: e.value.downsample.threshold
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
const F = m(null);
|
|
87
|
-
re(() => {
|
|
88
|
-
if (G(), e.value.style.animation.show && i.dataset.length > 1) {
|
|
89
|
-
let a = function() {
|
|
90
|
-
u < L.value.length ? (b.value.push(L.value[u]), setTimeout(() => {
|
|
91
|
-
requestAnimationFrame(a);
|
|
92
|
-
}, t)) : b.value = L.value, u += 1;
|
|
93
|
-
};
|
|
94
|
-
b.value = [];
|
|
95
|
-
const t = e.value.style.animation.animationFrames / i.dataset.length;
|
|
96
|
-
let u = 0;
|
|
97
|
-
a();
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
function G() {
|
|
101
|
-
if (fe(i.dataset) ? Z({
|
|
102
|
-
componentName: "VueUiSparkline",
|
|
103
|
-
type: "dataset"
|
|
104
|
-
}) : i.dataset.forEach((t, u) => {
|
|
105
|
-
pe({
|
|
106
|
-
datasetObject: t,
|
|
107
|
-
requiredAttributes: ["period", "value"]
|
|
108
|
-
}).forEach((a) => {
|
|
109
|
-
Z({
|
|
110
|
-
componentName: "VueUiSparkline",
|
|
111
|
-
type: "datasetSerieAttribute",
|
|
112
|
-
property: a,
|
|
113
|
-
index: u
|
|
114
|
-
});
|
|
115
|
-
});
|
|
116
|
-
}), e.value.responsive) {
|
|
117
|
-
const t = _e(() => {
|
|
118
|
-
const { width: u, height: a } = xe({
|
|
119
|
-
chart: z.value,
|
|
120
|
-
title: e.value.style.title.show && i.showInfo ? O.value : null,
|
|
121
|
-
source: B.value
|
|
122
|
-
});
|
|
123
|
-
l.value.width = u, l.value.height = a, l.value.chartWidth = e.value.style.chartWidth / 500 * u, l.value.padding = i.forcedPadding / 500 * u;
|
|
124
|
-
});
|
|
125
|
-
F.value = new ResizeObserver(t), F.value.observe(z.value.parentNode);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
const l = m({
|
|
129
|
-
height: 80 * i.heightRatio,
|
|
130
|
-
width: 500,
|
|
131
|
-
chartWidth: e.value.style.chartWidth,
|
|
132
|
-
padding: i.forcedPadding
|
|
133
|
-
}), ee = m(6), s = v(() => ({
|
|
134
|
-
top: 12,
|
|
135
|
-
left: 0,
|
|
136
|
-
right: l.value.width,
|
|
137
|
-
bottom: l.value.height - 3,
|
|
138
|
-
start: i.showInfo && e.value.style.dataLabel.show && e.value.style.dataLabel.position === "left" ? l.value.width - l.value.chartWidth : l.value.padding,
|
|
139
|
-
width: i.showInfo && e.value.style.dataLabel.show ? l.value.chartWidth : l.value.width - l.value.padding,
|
|
140
|
-
height: l.value.height - 12
|
|
141
|
-
})), S = 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))), te = 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))), x = v(() => {
|
|
142
|
-
const t = S.value >= 0 ? 0 : S.value;
|
|
143
|
-
return Math.abs(t);
|
|
144
|
-
}), ae = v(() => te.value + x.value + ee.value), N = v(() => s.value.bottom - s.value.height * W(x.value));
|
|
145
|
-
function W(t) {
|
|
146
|
-
return t / ae.value;
|
|
147
|
-
}
|
|
148
|
-
const g = v(() => L.value.length - 1), n = v(() => b.value.map((t, u) => {
|
|
149
|
-
const a = isNaN(t.value) || [void 0, null, "NaN", NaN, 1 / 0, -1 / 0].includes(t.value) ? 0 : t.value || 0;
|
|
150
|
-
return {
|
|
151
|
-
absoluteValue: a,
|
|
152
|
-
period: t.period,
|
|
153
|
-
plotValue: a + x.value,
|
|
154
|
-
toMax: W(a + x.value),
|
|
155
|
-
x: s.value.start + u * (s.value.width / (g.value + 1) > l.padding ? l.padding : s.value.width / (g.value + 1)),
|
|
156
|
-
y: s.value.bottom - s.value.height * W(a + x.value),
|
|
157
|
-
id: `plot_${p.value}_${u}`,
|
|
158
|
-
color: w.value ? e.value.style.bar.color : e.value.style.area.useGradient ? M(e.value.style.line.color, 0.05 * (1 - u / g.value)) : e.value.style.line.color,
|
|
159
|
-
width: s.value.width / (g.value + 1) > l.padding ? l.padding : s.value.width / (g.value + 1)
|
|
160
|
-
};
|
|
161
|
-
})), le = v(() => {
|
|
162
|
-
const t = { x: n.value[0].x, y: l.value.height - 6 }, u = { x: n.value[n.value.length - 1].x, y: l.value.height - 6 }, a = [];
|
|
163
|
-
return n.value.forEach((d) => {
|
|
164
|
-
a.push(`${d.x},${d.y} `);
|
|
165
|
-
}), [t.x, t.y, ...a, u.x, u.y].toString();
|
|
166
|
-
}), y = m(void 0);
|
|
167
|
-
function ue(t, u) {
|
|
168
|
-
y.value = t, V("hoverIndex", { index: u });
|
|
169
|
-
}
|
|
170
|
-
function se() {
|
|
171
|
-
y.value = void 0, V("hoverIndex", { index: void 0 });
|
|
172
|
-
}
|
|
173
|
-
const k = v(() => {
|
|
174
|
-
if ($.value) {
|
|
175
|
-
const t = n.value.map((a) => a.absoluteValue), u = t.reduce((a, d) => a + d, 0);
|
|
176
|
-
return {
|
|
177
|
-
latest: n.value[n.value.length - 1].absoluteValue,
|
|
178
|
-
sum: u,
|
|
179
|
-
average: u / n.value.length,
|
|
180
|
-
median: ge(t),
|
|
181
|
-
trend: me(n.value.map(({ x: a, y: d, absoluteValue: j }) => ({
|
|
182
|
-
x: a,
|
|
183
|
-
y: d,
|
|
184
|
-
value: j
|
|
185
|
-
}))).trend
|
|
186
|
-
};
|
|
187
|
-
} else
|
|
188
|
-
return {
|
|
189
|
-
latest: null,
|
|
190
|
-
sum: null,
|
|
191
|
-
average: null,
|
|
192
|
-
median: null,
|
|
193
|
-
trend: null
|
|
194
|
-
};
|
|
195
|
-
}), R = 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");
|
|
196
|
-
function oe(t, u) {
|
|
197
|
-
V("selectDatapoint", { datapoint: t, index: u });
|
|
198
|
-
}
|
|
199
|
-
return (t, u) => (o(), r("div", {
|
|
200
|
-
ref_key: "sparklineChart",
|
|
201
|
-
ref: z,
|
|
202
|
-
class: "vue-ui-sparkline",
|
|
203
|
-
id: p.value,
|
|
204
|
-
style: C(`width:100%;font-family:${e.value.style.fontFamily};`)
|
|
205
|
-
}, [
|
|
206
|
-
I(t.$slots, "before", ne(ie({
|
|
207
|
-
selected: y.value,
|
|
208
|
-
latest: k.value.latest,
|
|
209
|
-
sum: k.value.sum,
|
|
210
|
-
average: k.value.average,
|
|
211
|
-
median: k.value.median,
|
|
212
|
-
trend: k.value.trend
|
|
213
|
-
})), void 0, !0),
|
|
214
|
-
e.value.style.title.show && _.showInfo ? (o(), r("div", {
|
|
215
|
-
key: 0,
|
|
216
|
-
ref_key: "chartTitle",
|
|
217
|
-
ref: O,
|
|
218
|
-
class: "vue-ui-sparkline-title",
|
|
219
|
-
style: C(`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"};`)
|
|
220
|
-
}, [
|
|
221
|
-
f("span", {
|
|
222
|
-
style: C(`padding:${e.value.style.title.textAlign === "left" ? "0 0 0 12px" : e.value.style.title.textAlign === "right" ? "0 12px 0 0" : "0"}`)
|
|
223
|
-
}, X(y.value ? y.value.period : e.value.style.title.text), 5)
|
|
224
|
-
], 4)) : h("", !0),
|
|
225
|
-
$.value ? (o(), r("svg", {
|
|
226
|
-
key: 1,
|
|
227
|
-
xmlns: c(ke),
|
|
228
|
-
viewBox: `0 0 ${l.value.width} ${l.value.height}`,
|
|
229
|
-
style: C(`background:${e.value.style.backgroundColor};overflow:visible`)
|
|
230
|
-
}, [
|
|
231
|
-
de(we),
|
|
232
|
-
t.$slots["chart-background"] ? (o(), r("foreignObject", {
|
|
233
|
-
key: 0,
|
|
234
|
-
x: 0,
|
|
235
|
-
y: 0,
|
|
236
|
-
width: l.value.width <= 0 ? 10 : l.value.width,
|
|
237
|
-
height: l.value.height <= 0 ? 10 : l.value.height,
|
|
238
|
-
style: {
|
|
239
|
-
pointerEvents: "none"
|
|
240
|
-
}
|
|
241
|
-
}, [
|
|
242
|
-
I(t.$slots, "chart-background", {}, void 0, !0)
|
|
243
|
-
], 8, Ce)) : h("", !0),
|
|
244
|
-
f("defs", null, [
|
|
245
|
-
f("linearGradient", {
|
|
246
|
-
x1: "0%",
|
|
247
|
-
y1: "0%",
|
|
248
|
-
x2: "100%",
|
|
249
|
-
y2: "0%",
|
|
250
|
-
id: `sparkline_gradient_${p.value}`
|
|
251
|
-
}, [
|
|
252
|
-
f("stop", {
|
|
253
|
-
offset: "0%",
|
|
254
|
-
"stop-color": c(P)(c(M)(e.value.style.area.color, 0.05), e.value.style.area.opacity)
|
|
255
|
-
}, null, 8, Me),
|
|
256
|
-
f("stop", {
|
|
257
|
-
offset: "100%",
|
|
258
|
-
"stop-color": c(P)(e.value.style.area.color, e.value.style.area.opacity)
|
|
259
|
-
}, null, 8, Pe)
|
|
260
|
-
], 8, Ie),
|
|
261
|
-
f("linearGradient", {
|
|
262
|
-
x2: "0%",
|
|
263
|
-
y2: "100%",
|
|
264
|
-
id: `sparkline_bar_gradient_pos_${p.value}`
|
|
265
|
-
}, [
|
|
266
|
-
f("stop", {
|
|
267
|
-
offset: "0%",
|
|
268
|
-
"stop-color": e.value.style.bar.color
|
|
269
|
-
}, null, 8, ze),
|
|
270
|
-
f("stop", {
|
|
271
|
-
offset: "100%",
|
|
272
|
-
"stop-color": c(M)(e.value.style.bar.color, 0.05)
|
|
273
|
-
}, null, 8, Se)
|
|
274
|
-
], 8, Ve),
|
|
275
|
-
f("linearGradient", {
|
|
276
|
-
x2: "0%",
|
|
277
|
-
y2: "100%",
|
|
278
|
-
id: `sparkline_bar_gradient_neg_${p.value}`
|
|
279
|
-
}, [
|
|
280
|
-
f("stop", {
|
|
281
|
-
offset: "0%",
|
|
282
|
-
"stop-color": c(M)(e.value.style.bar.color, 0.05)
|
|
283
|
-
}, null, 8, Ae),
|
|
284
|
-
f("stop", {
|
|
285
|
-
offset: "100%",
|
|
286
|
-
"stop-color": e.value.style.bar.color
|
|
287
|
-
}, null, 8, De)
|
|
288
|
-
], 8, We)
|
|
289
|
-
]),
|
|
290
|
-
e.value.style.area.show && !w.value && n.value[0] ? (o(), r("g", Te, [
|
|
291
|
-
e.value.style.line.smooth ? (o(), r("path", {
|
|
292
|
-
key: 0,
|
|
293
|
-
d: `M ${n.value[0].x},${s.value.bottom} ${c(q)(n.value)} L ${n.value.at(-1).x},${s.value.bottom} Z`,
|
|
294
|
-
fill: e.value.style.area.useGradient ? `url(#sparkline_gradient_${p.value})` : c(P)(e.value.style.area.color, e.value.style.area.opacity)
|
|
295
|
-
}, null, 8, Oe)) : (o(), r("path", {
|
|
296
|
-
key: 1,
|
|
297
|
-
d: `M${le.value}Z`,
|
|
298
|
-
fill: e.value.style.area.useGradient ? `url(#sparkline_gradient_${p.value})` : c(P)(e.value.style.area.color, e.value.style.area.opacity)
|
|
299
|
-
}, null, 8, Be))
|
|
300
|
-
])) : h("", !0),
|
|
301
|
-
e.value.style.line.smooth && !w.value ? (o(), r("path", {
|
|
302
|
-
key: 2,
|
|
303
|
-
d: `M ${c(q)(n.value)}`,
|
|
304
|
-
stroke: e.value.style.line.color,
|
|
305
|
-
fill: "none",
|
|
306
|
-
"stroke-width": e.value.style.line.strokeWidth,
|
|
307
|
-
"stroke-linecap": "round"
|
|
308
|
-
}, null, 8, Ee)) : h("", !0),
|
|
309
|
-
(o(!0), r(A, null, D(n.value, (a, d) => (o(), r("g", null, [
|
|
310
|
-
d < n.value.length - 1 && !e.value.style.line.smooth && !w.value ? (o(), r("line", {
|
|
311
|
-
key: 0,
|
|
312
|
-
x1: a.x,
|
|
313
|
-
x2: n.value[d + 1].x,
|
|
314
|
-
y1: a.y,
|
|
315
|
-
y2: n.value[d + 1].y,
|
|
316
|
-
stroke: a.color,
|
|
317
|
-
"stroke-width": e.value.style.line.strokeWidth,
|
|
318
|
-
"stroke-linecap": "round",
|
|
319
|
-
"stroke-linejoin": "round",
|
|
320
|
-
"shape-rendering": "geometricPrecision"
|
|
321
|
-
}, null, 8, Fe)) : h("", !0),
|
|
322
|
-
w.value ? (o(), r("rect", {
|
|
323
|
-
key: 1,
|
|
324
|
-
x: a.x - a.width / 2,
|
|
325
|
-
y: a.absoluteValue > 0 ? a.y : N.value,
|
|
326
|
-
width: a.width,
|
|
327
|
-
height: Math.abs(a.y - N.value),
|
|
328
|
-
fill: a.absoluteValue > 0 ? `url(#sparkline_bar_gradient_pos_${p.value})` : `url(#sparkline_bar_gradient_neg_${p.value})`,
|
|
329
|
-
rx: e.value.style.bar.borderRadius
|
|
330
|
-
}, null, 8, Ge)) : h("", !0),
|
|
331
|
-
e.value.style.verticalIndicator.show && (y.value && a.id === y.value.id || _.selectedIndex === d) ? (o(), r("line", {
|
|
332
|
-
key: 2,
|
|
333
|
-
x1: a.x,
|
|
334
|
-
x2: a.x,
|
|
335
|
-
y1: s.value.top - 6,
|
|
336
|
-
y2: s.value.bottom,
|
|
337
|
-
stroke: e.value.style.verticalIndicator.color || a.color,
|
|
338
|
-
"stroke-width": e.value.style.verticalIndicator.strokeWidth,
|
|
339
|
-
"stroke-linecap": "round",
|
|
340
|
-
"stroke-dasharray": e.value.style.verticalIndicator.strokeDasharray || 0
|
|
341
|
-
}, null, 8, Re)) : h("", !0)
|
|
342
|
-
]))), 256)),
|
|
343
|
-
S.value < 0 ? (o(), r("line", {
|
|
344
|
-
key: 3,
|
|
345
|
-
x1: s.value.start,
|
|
346
|
-
x2: s.value.start + s.value.width - 16,
|
|
347
|
-
y1: N.value,
|
|
348
|
-
y2: N.value,
|
|
349
|
-
stroke: e.value.style.zeroLine.color,
|
|
350
|
-
"stroke-dasharray": e.value.style.zeroLine.strokeWidth * 2,
|
|
351
|
-
"stroke-width": e.value.style.zeroLine.strokeWidth,
|
|
352
|
-
"stroke-linecap": "round"
|
|
353
|
-
}, null, 8, je)) : h("", !0),
|
|
354
|
-
e.value.style.plot.show ? (o(!0), r(A, { key: 4 }, D(n.value, (a, d) => (o(), r("g", null, [
|
|
355
|
-
y.value && a.id === y.value.id || _.selectedIndex === d ? (o(), r("circle", {
|
|
356
|
-
key: 0,
|
|
357
|
-
cx: a.x,
|
|
358
|
-
cy: a.y,
|
|
359
|
-
r: e.value.style.plot.radius,
|
|
360
|
-
fill: a.color,
|
|
361
|
-
stroke: e.value.style.plot.stroke,
|
|
362
|
-
"stroke-width": e.value.style.plot.strokeWidth
|
|
363
|
-
}, null, 8, Ue)) : h("", !0)
|
|
364
|
-
]))), 256)) : h("", !0),
|
|
365
|
-
_.showInfo && e.value.style.dataLabel.show ? (o(), r("text", {
|
|
366
|
-
key: 5,
|
|
367
|
-
x: e.value.style.dataLabel.position === "left" ? 12 + e.value.style.dataLabel.offsetX : s.value.width + 12 + e.value.style.dataLabel.offsetX,
|
|
368
|
-
y: l.value.height / 2 + e.value.style.dataLabel.fontSize / 2.5 + e.value.style.dataLabel.offsetY,
|
|
369
|
-
"font-size": e.value.style.dataLabel.fontSize,
|
|
370
|
-
"font-weight": e.value.style.dataLabel.bold ? "bold" : "normal",
|
|
371
|
-
fill: e.value.style.dataLabel.color
|
|
372
|
-
}, X(y.value ? c(H)(
|
|
373
|
-
e.value.style.dataLabel.formatter,
|
|
374
|
-
y.value.absoluteValue,
|
|
375
|
-
c(Y)({ p: e.value.style.dataLabel.prefix, v: y.value.absoluteValue, s: e.value.style.dataLabel.suffix, r: e.value.style.dataLabel.roundingValue }),
|
|
376
|
-
{ datapoint: y.value }
|
|
377
|
-
) : c(H)(
|
|
378
|
-
e.value.style.dataLabel.formatter,
|
|
379
|
-
R.value,
|
|
380
|
-
c(Y)({ p: e.value.style.dataLabel.prefix, v: R.value, s: e.value.style.dataLabel.suffix, r: e.value.style.dataLabel.roundingValue })
|
|
381
|
-
)), 9, Xe)) : h("", !0),
|
|
382
|
-
(o(!0), r(A, null, D(n.value, (a, d) => (o(), r("rect", {
|
|
383
|
-
x: a.x - (s.value.width / (g.value + 1) > l.value.padding ? l.value.padding : s.value.width / (g.value + 1)) / 2,
|
|
384
|
-
y: s.value.top - 6,
|
|
385
|
-
height: s.value.height + 6,
|
|
386
|
-
width: s.value.width / (g.value + 1) > l.value.padding ? l.value.padding : s.value.width / (g.value + 1),
|
|
387
|
-
fill: "transparent",
|
|
388
|
-
onMouseenter: (j) => ue(a, d),
|
|
389
|
-
onMouseleave: se,
|
|
390
|
-
onClick: () => oe(a, d)
|
|
391
|
-
}, null, 40, Ze))), 256)),
|
|
392
|
-
I(t.$slots, "svg", { svg: l.value }, void 0, !0)
|
|
393
|
-
], 12, Ne)) : h("", !0),
|
|
394
|
-
t.$slots.source ? (o(), r("div", {
|
|
395
|
-
key: 2,
|
|
396
|
-
ref_key: "source",
|
|
397
|
-
ref: B,
|
|
398
|
-
dir: "auto"
|
|
399
|
-
}, [
|
|
400
|
-
I(t.$slots, "source", {}, void 0, !0)
|
|
401
|
-
], 512)) : h("", !0),
|
|
402
|
-
$.value ? h("", !0) : (o(), ve(be, {
|
|
403
|
-
key: 3,
|
|
404
|
-
config: {
|
|
405
|
-
type: "sparkline",
|
|
406
|
-
style: {
|
|
407
|
-
backgroundColor: e.value.style.backgroundColor,
|
|
408
|
-
sparkline: {
|
|
409
|
-
color: "#CCCCCC"
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
}, null, 8, ["config"]))
|
|
414
|
-
], 12, Le));
|
|
415
|
-
}
|
|
416
|
-
}, at = /* @__PURE__ */ $e(qe, [["__scopeId", "data-v-eb31fee7"]]);
|
|
417
|
-
export {
|
|
418
|
-
at as default
|
|
419
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-CgZGelSi.cjs"),P=require("./useNestedProp-BxCE3J3Z.cjs"),G=require("./vue-ui-skeleton-m4l9jfqA.cjs"),M=require("./useResponsive-BJ7DTGpm.cjs"),R=require("./PackageVersion-B_1OHk5A.cjs"),H=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),U=["id"],X=["xmlns","viewBox"],Z=["width","height"],Y=["id"],J=["stop-color"],K=["stop-color"],Q=["id"],ee=["stop-color"],te=["stop-color"],le=["id"],ae=["stop-color"],oe=["stop-color"],re={key:1},ne=["d","fill"],ue=["d","fill"],se=["d","stroke","stroke-width"],ie=["x1","x2","y1","y2","stroke","stroke-width"],de=["x","y","width","height","fill","rx"],ce=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],ve=["x1","x2","y1","y2","stroke","stroke-dasharray","stroke-width"],he=["cx","cy","r","fill","stroke","stroke-width"],ye=["x","y","font-size","font-weight","fill"],pe=["x","y","height","width","onMouseenter","onClick"],fe={__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},heightRatio:{type:Number,default:1},forcedPadding:{type:Number,default:30}},emits:["hoverIndex","selectDatapoint"],setup(f,{emit:x}){const i=f,{vue_ui_sparkline:z}=n.useConfig(),k=e.computed(()=>!!i.dataset&&i.dataset.length),v=e.ref(n.createUid()),w=e.ref(null),C=e.ref(null),L=e.ref(null),t=e.computed({get:()=>V(),set:l=>l});function V(){const l=P.useNestedProp({userConfig:i.config,defaultConfig:z});return l.theme?{...P.useNestedProp({userConfig:n.themes.vue_ui_sparkline[l.theme]||i.config,defaultConfig:l})}:l}const b=e.computed(()=>n.largestTriangleThreeBucketsArrayObjects({data:i.dataset,threshold:t.value.downsample.threshold}));e.watch(()=>i.config,l=>{t.value=V(),$(),o.value.chartWidth=t.value.style.chartWidth},{deep:!0}),e.watch(()=>i.dataset,l=>{p.value=n.largestTriangleThreeBucketsArrayObjects({data:i.dataset.map(r=>({...r,value:[void 0].includes(r.value)?null:r.value})),threshold:t.value.downsample.threshold})},{deep:!0});const p=e.ref(A());function A(){return n.largestTriangleThreeBucketsArrayObjects({data:i.dataset.map(l=>t.value.style.animation.show?{...l,value:null}:{...l,value:[void 0].includes(l.value)?null:l.value}),threshold:t.value.downsample.threshold})}const E=e.ref(null);e.onMounted(()=>{if($(),t.value.style.animation.show&&i.dataset.length>1){let a=function(){r<b.value.length?(p.value.push(b.value[r]),setTimeout(()=>{requestAnimationFrame(a)},l)):p.value=b.value,r+=1};p.value=[];const l=t.value.style.animation.animationFrames/i.dataset.length;let r=0;a()}});function $(){if(n.objectIsEmpty(i.dataset)?n.error({componentName:"VueUiSparkline",type:"dataset"}):i.dataset.forEach((l,r)=>{n.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["period","value"]}).forEach(a=>{n.error({componentName:"VueUiSparkline",type:"datasetSerieAttribute",property:a,index:r})})}),t.value.responsive){const l=M.throttle(()=>{const{width:r,height:a}=M.useResponsive({chart:w.value,title:t.value.style.title.show&&i.showInfo?C.value:null,source:L.value});o.value.width=r,o.value.height=a,o.value.chartWidth=t.value.style.chartWidth/500*r,o.value.padding=i.forcedPadding/500*r});E.value=new ResizeObserver(l),E.value.observe(w.value.parentNode)}}const o=e.ref({height:80*i.heightRatio,width:500,chartWidth:t.value.style.chartWidth,padding:i.forcedPadding}),O=e.ref(6),u=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})),N=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))),T=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=N.value>=0?0:N.value;return Math.abs(l)}),D=e.computed(()=>T.value+m.value+O.value),_=e.computed(()=>u.value.bottom-u.value.height*B(m.value));function B(l){return l/D.value}const h=e.computed(()=>b.value.length-1),s=e.computed(()=>p.value.map((l,r)=>{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:B(a+m.value),x:u.value.start+r*(u.value.width/(h.value+1)>o.padding?o.padding:u.value.width/(h.value+1)),y:u.value.bottom-u.value.height*B(a+m.value),id:`plot_${v.value}_${r}`,color:g.value?t.value.style.bar.color:t.value.style.area.useGradient?n.shiftHue(t.value.style.line.color,.05*(1-r/h.value)):t.value.style.line.color,width:u.value.width/(h.value+1)>o.padding?o.padding:u.value.width/(h.value+1)}})),W=e.computed(()=>{const l={x:s.value[0].x,y:o.value.height-6},r={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,r.x,r.y].toString()}),c=e.ref(void 0);function j(l,r){c.value=l,x("hoverIndex",{index:r})}function F(){c.value=void 0,x("hoverIndex",{index:void 0})}const y=e.computed(()=>{if(k.value){const l=s.value.map(a=>a.absoluteValue),r=l.reduce((a,d)=>a+d,0);return{latest:s.value[s.value.length-1].absoluteValue,sum:r,average:r/s.value.length,median:n.calcMedian(l),trend:n.calcLinearProgression(s.value.map(({x:a,y:d,absoluteValue:S})=>({x:a,y:d,value:S}))).trend}}else return{latest:null,sum:null,average:null,median:null,trend:null}}),I=e.computed(()=>k.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),g=e.computed(()=>t.value.type&&t.value.type==="bar");function q(l,r){x("selectDatapoint",{datapoint:l,index:r})}return(l,r)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"sparklineChart",ref:w,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:C,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),k.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(n.XMLNS),viewBox:`0 0 ${o.value.width} ${o.value.height}`,style:e.normalizeStyle(`background:${t.value.style.backgroundColor};overflow:visible`)},[e.createVNode(R._sfc_main),l.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:o.value.width<=0?10:o.value.width,height:o.value.height<=0?10:o.value.height,style:{pointerEvents:"none"}},[e.renderSlot(l.$slots,"chart-background",{},void 0,!0)],8,Z)):e.createCommentVNode("",!0),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(n.setOpacity)(e.unref(n.shiftHue)(t.value.style.area.color,.05),t.value.style.area.opacity)},null,8,J),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(n.setOpacity)(t.value.style.area.color,t.value.style.area.opacity)},null,8,K)],8,Y),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,ee),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(n.shiftHue)(t.value.style.bar.color,.05)},null,8,te)],8,Q),e.createElementVNode("linearGradient",{x2:"0%",y2:"100%",id:`sparkline_bar_gradient_neg_${v.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(n.shiftHue)(t.value.style.bar.color,.05)},null,8,ae),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.bar.color},null,8,oe)],8,le)]),t.value.style.area.show&&!g.value&&s.value[0]?(e.openBlock(),e.createElementBlock("g",re,[t.value.style.line.smooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:`M ${s.value[0].x},${u.value.bottom} ${e.unref(n.createSmoothPath)(s.value)} L ${s.value.at(-1).x},${u.value.bottom} Z`,fill:t.value.style.area.useGradient?`url(#sparkline_gradient_${v.value})`:e.unref(n.setOpacity)(t.value.style.area.color,t.value.style.area.opacity)},null,8,ne)):(e.openBlock(),e.createElementBlock("path",{key:1,d:`M${W.value}Z`,fill:t.value.style.area.useGradient?`url(#sparkline_gradient_${v.value})`:e.unref(n.setOpacity)(t.value.style.area.color,t.value.style.area.opacity)},null,8,ue))])):e.createCommentVNode("",!0),t.value.style.line.smooth&&!g.value?(e.openBlock(),e.createElementBlock("path",{key:2,d:`M ${e.unref(n.createSmoothPath)(s.value)}`,stroke:t.value.style.line.color,fill:"none","stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":"round"},null,8,se)):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&&!g.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,ie)):e.createCommentVNode("",!0),g.value?(e.openBlock(),e.createElementBlock("rect",{key:1,x:a.x-a.width/2,y:a.absoluteValue>0?a.y:_.value,width:a.width,height:Math.abs(a.y-_.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,de)):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:u.value.top-6,y2:u.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,ce)):e.createCommentVNode("",!0)]))),256)),N.value<0?(e.openBlock(),e.createElementBlock("line",{key:3,x1:u.value.start,x2:u.value.start+u.value.width-16,y1:_.value,y2:_.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,ve)):e.createCommentVNode("",!0),t.value.style.plot.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:4},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,he)):e.createCommentVNode("",!0)]))),256)):e.createCommentVNode("",!0),f.showInfo&&t.value.style.dataLabel.show?(e.openBlock(),e.createElementBlock("text",{key:5,x:t.value.style.dataLabel.position==="left"?12+t.value.style.dataLabel.offsetX:u.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(n.applyDataLabel)(t.value.style.dataLabel.formatter,c.value.absoluteValue,e.unref(n.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(n.applyDataLabel)(t.value.style.dataLabel.formatter,I.value,e.unref(n.dataLabel)({p:t.value.style.dataLabel.prefix,v:I.value,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.roundingValue}))),9,ye)):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-(u.value.width/(h.value+1)>o.value.padding?o.value.padding:u.value.width/(h.value+1))/2,y:u.value.top-6,height:u.value.height+6,width:u.value.width/(h.value+1)>o.value.padding?o.value.padding:u.value.width/(h.value+1),fill:"transparent",onMouseenter:S=>j(a,d),onMouseleave:F,onClick:()=>q(a,d)},null,40,pe))),256)),e.renderSlot(l.$slots,"svg",{svg:o.value},void 0,!0)],12,X)):e.createCommentVNode("",!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"source",ref:L,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),k.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(G.default,{key:3,config:{type:"sparkline",style:{backgroundColor:t.value.style.backgroundColor,sparkline:{color:"#CCCCCC"}}}},null,8,["config"]))],12,U))}},me=H._export_sfc(fe,[["__scopeId","data-v-eb31fee7"]]);exports.default=me;
|