vue-data-ui 2.4.83 → 2.4.85
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-DdtSSnUZ.cjs → Arrow-Ajt3NMEa.cjs} +1 -1
- package/dist/{Arrow-Bl2aigOV.js → Arrow-Qayb_B0s.js} +1 -1
- package/dist/{BaseIcon-DG_iYn4X.js → BaseIcon-B8U62FEj.js} +1 -1
- package/dist/{BaseIcon-D92qdnv7.cjs → BaseIcon-BVrsMbvi.cjs} +1 -1
- package/dist/{DataTable-DyvnYg-x.cjs → DataTable-1PQD-SFb.cjs} +1 -1
- package/dist/{DataTable-CaiuB_-j.js → DataTable-C0tCPQ9i.js} +2 -2
- package/dist/{Legend-D2J3bvDm.cjs → Legend-BJ2Wbqut.cjs} +1 -1
- package/dist/{Legend-Br9uWuyZ.js → Legend-BTpe6qQB.js} +2 -2
- package/dist/{PackageVersion-Bxz2crF7.cjs → PackageVersion-BjfedMsH.cjs} +1 -1
- package/dist/{PackageVersion-tmgQTzP2.js → PackageVersion-CENy3Lm2.js} +1 -1
- package/dist/{PenAndPaper-CJ3Rnk2Q.js → PenAndPaper-Dr7ndoP_.js} +3 -3
- package/dist/{PenAndPaper-BFCXiNMF.cjs → PenAndPaper-nqRtAh6J.cjs} +1 -1
- package/dist/{Shape-qjsquBuY.cjs → Shape-Boa32JEn.cjs} +1 -1
- package/dist/{Shape-6QlwV5xV.js → Shape-zFv85Gc2.js} +1 -1
- package/dist/{Slicer-B9BStSWS.js → Slicer-BUYuk07t.js} +109 -124
- package/dist/Slicer-D6QLMg5N.cjs +1 -0
- package/dist/{Title-Bhq6SOYu.js → Title-CaET2xuF.js} +1 -1
- package/dist/{Title-BqNuK5vc.cjs → Title-DJUxOiaO.cjs} +1 -1
- package/dist/{Tooltip-CeBpQ6yn.js → Tooltip-Bkc4233T.js} +1 -1
- package/dist/{Tooltip-Kn7RnF0L.cjs → Tooltip-C5QuW94e.cjs} +1 -1
- package/dist/{index-BqR_a-C7.js → index-B7nCQFK0.js} +2 -1
- package/dist/index-COIn1phv.cjs +9 -0
- 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-DqofSFeh.js → useNestedProp-C9rlBRTT.js} +1 -1
- package/dist/{useNestedProp-D_XfpfnF.cjs → useNestedProp-CbMuGGl3.cjs} +1 -1
- package/dist/{usePrinter-BPjMJmKg.js → usePrinter-CQMn1b4E.js} +1 -1
- package/dist/{usePrinter-Bfrr3DDK.cjs → usePrinter-CXXfgFFN.cjs} +1 -1
- package/dist/{vue-data-ui-DsBOcTDd.js → vue-data-ui-BnsKGbqb.js} +60 -60
- package/dist/{vue-data-ui-oW2xn5YG.cjs → vue-data-ui-Bu_VIHgr.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-DL4o7lJD.cjs → vue-ui-3d-bar-D39F2dKF.cjs} +1 -1
- package/dist/{vue-ui-3d-bar-D5BCQifA.js → vue-ui-3d-bar-V5FBS9MA.js} +9 -9
- package/dist/{vue-ui-accordion-Cz3VCEN0.js → vue-ui-accordion-B8ptB5BQ.js} +3 -3
- package/dist/{vue-ui-accordion-Sqna6-tk.cjs → vue-ui-accordion-CGlnNTr8.cjs} +1 -1
- package/dist/vue-ui-age-pyramid-BdseHKUc.cjs +1 -0
- package/dist/{vue-ui-age-pyramid-Cl9eaBGr.js → vue-ui-age-pyramid-Bjp1R8Ku.js} +14 -12
- package/dist/{vue-ui-annotator-Ctx3YK1X.cjs → vue-ui-annotator-BoWZZRPg.cjs} +1 -1
- package/dist/{vue-ui-annotator-DQKvjXgI.js → vue-ui-annotator-V9m5fTGG.js} +1 -1
- package/dist/{vue-ui-bullet-CsMr2xzr.js → vue-ui-bullet-Bqvb5PV-.js} +8 -8
- package/dist/{vue-ui-bullet-CWJzycj2.cjs → vue-ui-bullet-DLIxlhFF.cjs} +1 -1
- package/dist/{vue-ui-candlestick-DKjfum_x.cjs → vue-ui-candlestick-D4BD8LyJ.cjs} +2 -2
- package/dist/{vue-ui-candlestick-BZ12fWHz.js → vue-ui-candlestick-DHCtmsh3.js} +72 -70
- package/dist/{vue-ui-carousel-table-CDR1Vv5V.js → vue-ui-carousel-table-Cn2RJkSb.js} +4 -4
- package/dist/{vue-ui-carousel-table-C6L5d_Fz.cjs → vue-ui-carousel-table-VIuoh2QI.cjs} +1 -1
- package/dist/{vue-ui-chestnut-CAnxXvl6.js → vue-ui-chestnut-C5qUO1uK.js} +8 -8
- package/dist/{vue-ui-chestnut-DFgQWktZ.cjs → vue-ui-chestnut-ClG9HZoC.cjs} +1 -1
- package/dist/{vue-ui-cursor-BHKTewso.cjs → vue-ui-cursor-Bo8et-dD.cjs} +1 -1
- package/dist/{vue-ui-cursor-CEG5U4Hg.js → vue-ui-cursor-eJau3iyr.js} +2 -2
- package/dist/{vue-ui-dashboard-CAZvucxS.js → vue-ui-dashboard-DnaH9bCw.js} +2 -2
- package/dist/{vue-ui-dashboard-cCxI_-fr.cjs → vue-ui-dashboard-WJqGQ8iR.cjs} +1 -1
- package/dist/{vue-ui-digits-xPdav4hy.js → vue-ui-digits-Cqjts2eq.js} +2 -2
- package/dist/{vue-ui-digits-Dl0z8lL5.cjs → vue-ui-digits-qIckO4-r.cjs} +1 -1
- package/dist/vue-ui-donut-BP7yj2DU.cjs +1 -0
- package/dist/{vue-ui-donut-evolution-BgXDvYij.cjs → vue-ui-donut-evolution-Cz8uFJp8.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-DtfH9oY2.js → vue-ui-donut-evolution-EzYvP11F.js} +11 -11
- package/dist/{vue-ui-donut-BX4NBJNA.js → vue-ui-donut-pprcnbIw.js} +17 -15
- package/dist/vue-ui-dumbbell-CYqHCr2S.cjs +9 -0
- package/dist/{vue-ui-dumbbell-DgTOdhga.js → vue-ui-dumbbell-DaxcxmnU.js} +48 -46
- package/dist/{vue-ui-flow-DIbRLuAg.js → vue-ui-flow-DbRgaKBu.js} +9 -9
- package/dist/{vue-ui-flow-Bt0sz3lA.cjs → vue-ui-flow-HeRCplGL.cjs} +1 -1
- package/dist/{vue-ui-funnel-CedEHtHD.js → vue-ui-funnel-B2del8KB.js} +37 -35
- package/dist/vue-ui-funnel-DxniWNkD.cjs +1 -0
- package/dist/{vue-ui-galaxy-aqDlVOGG.cjs → vue-ui-galaxy-BDA64dud.cjs} +1 -1
- package/dist/{vue-ui-galaxy-BcBicruu.js → vue-ui-galaxy-pUYeASJf.js} +11 -11
- package/dist/vue-ui-gauge-BOXoAgWk.cjs +1 -0
- package/dist/{vue-ui-gauge-B8ybUmVP.js → vue-ui-gauge-DpsXpEaW.js} +28 -26
- package/dist/{vue-ui-gizmo-J759kkHO.js → vue-ui-gizmo-BpYrhkon.js} +3 -3
- package/dist/{vue-ui-gizmo-DAzVCVgd.cjs → vue-ui-gizmo-Bq9uAmqd.cjs} +1 -1
- package/dist/{vue-ui-heatmap-5PChWU--.cjs → vue-ui-heatmap-CbKgGLtN.cjs} +1 -1
- package/dist/{vue-ui-heatmap-zXe_ZfjW.js → vue-ui-heatmap-Cz6_9Veh.js} +10 -10
- package/dist/vue-ui-history-plot-BoMdvItE.cjs +1 -0
- package/dist/{vue-ui-history-plot-DpCqc_J5.js → vue-ui-history-plot-DAotUjSF.js} +56 -54
- package/dist/{vue-ui-kpi-B0YGZB0U.js → vue-ui-kpi-Ch2p7m-i.js} +3 -3
- package/dist/{vue-ui-kpi-C-7Ihvt0.cjs → vue-ui-kpi-D6mp6EQ2.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-Cn4Q6TSw.cjs → vue-ui-mini-loader-CO-KGVlC.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-7sjb3XBu.js → vue-ui-mini-loader-E13lmwfO.js} +2 -2
- package/dist/{vue-ui-molecule-DZpXgYuN.js → vue-ui-molecule-C69K6EPO.js} +11 -11
- package/dist/{vue-ui-molecule-BDumH6dl.cjs → vue-ui-molecule-CeoDnPXB.cjs} +1 -1
- package/dist/{vue-ui-mood-radar-pnwFktum.cjs → vue-ui-mood-radar-BwOqQUuT.cjs} +1 -1
- package/dist/{vue-ui-mood-radar-CKqyK1Hp.js → vue-ui-mood-radar-DDtky572.js} +11 -11
- package/dist/{vue-ui-nested-donuts-DbxWMbwd.js → vue-ui-nested-donuts-AYPYIRrE.js} +16 -14
- package/dist/{vue-ui-nested-donuts-CHpsvVxD.cjs → vue-ui-nested-donuts-DMCd6DqT.cjs} +2 -2
- package/dist/{vue-ui-onion-F9rcTxc5.cjs → vue-ui-onion-BedLvfFe.cjs} +2 -2
- package/dist/{vue-ui-onion-q54wqIiz.js → vue-ui-onion-Bsa88sKK.js} +31 -29
- package/dist/{vue-ui-parallel-coordinate-plot-Cwnja7PH.cjs → vue-ui-parallel-coordinate-plot-CSOMIABF.cjs} +2 -2
- package/dist/{vue-ui-parallel-coordinate-plot-myA1ugJ6.js → vue-ui-parallel-coordinate-plot-KCEb4iRs.js} +62 -60
- package/dist/vue-ui-quadrant-BXQVOvpY.cjs +1 -0
- package/dist/{vue-ui-quadrant-OoCEzm12.js → vue-ui-quadrant-Bd_88Eht.js} +16 -14
- package/dist/{vue-ui-quick-chart-5lnK5fYa.js → vue-ui-quick-chart-CXAYKYHa.js} +55 -53
- package/dist/{vue-ui-quick-chart-CazRj-4z.cjs → vue-ui-quick-chart-dLItYwM_.cjs} +2 -2
- package/dist/vue-ui-radar-BuNtocmn.cjs +1 -0
- package/dist/{vue-ui-radar-BDKh_0GC.js → vue-ui-radar-De397oTB.js} +100 -98
- package/dist/{vue-ui-rating-BOzhaiSc.cjs → vue-ui-rating-BjiMVoyX.cjs} +1 -1
- package/dist/{vue-ui-rating-Dt3vyE2H.js → vue-ui-rating-wK3_ZWE5.js} +2 -2
- package/dist/vue-ui-relation-circle-BEGyr1h-.cjs +1 -0
- package/dist/{vue-ui-relation-circle-BOMeOf10.js → vue-ui-relation-circle-BxlK8MVs.js} +56 -54
- package/dist/{vue-ui-rings-3O2lFlg1.js → vue-ui-rings-BXrtMSML.js} +39 -37
- package/dist/{vue-ui-rings-DIA0oj1w.cjs → vue-ui-rings-BcNMBXxq.cjs} +2 -2
- package/dist/{vue-ui-scatter-SRz39O4w.js → vue-ui-scatter-BWZfLJ9P.js} +52 -50
- package/dist/vue-ui-scatter-DTy3yPVu.cjs +1 -0
- package/dist/{vue-ui-screenshot-OBhZYkuN.cjs → vue-ui-screenshot-BJgOwFMW.cjs} +1 -1
- package/dist/{vue-ui-screenshot-DeseMlsh.js → vue-ui-screenshot-hw4PC9Uu.js} +1 -1
- package/dist/{vue-ui-skeleton-6_VzxeeY.cjs → vue-ui-skeleton-BIqMxXV7.cjs} +1 -1
- package/dist/{vue-ui-skeleton-DbI8wJH-.js → vue-ui-skeleton-D66ZIUln.js} +3 -3
- package/dist/{vue-ui-smiley-BqRjGeM4.js → vue-ui-smiley-DWPYdcDB.js} +2 -2
- package/dist/{vue-ui-smiley-CQYCG8iR.cjs → vue-ui-smiley-Duy5Xo-j.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-YKlzV5ph.js → vue-ui-spark-trend-Ce4IaqPz.js} +5 -5
- package/dist/{vue-ui-spark-trend-C1MfKChb.cjs → vue-ui-spark-trend-DP5foaNi.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-BGc7K3E7.cjs → vue-ui-sparkbar-Bbns4V16.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-BEY67Uh8.js → vue-ui-sparkbar-Fa-Kc9Fr.js} +4 -4
- package/dist/{vue-ui-sparkgauge-DBJ6JcY4.cjs → vue-ui-sparkgauge-BrLrvNLH.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-COy9kS3g.js → vue-ui-sparkgauge-DUWcJ7cM.js} +4 -4
- package/dist/{vue-ui-sparkhistogram-Kof1NLnh.cjs → vue-ui-sparkhistogram-B0rhs_UN.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram-TOZ7cGZE.js → vue-ui-sparkhistogram-PgC-c-5a.js} +5 -5
- package/dist/{vue-ui-sparkline-Corg_lTS.js → vue-ui-sparkline-BqNlrKjb.js} +37 -35
- package/dist/vue-ui-sparkline-c5Awoj8J.cjs +1 -0
- package/dist/{vue-ui-sparkstackbar-2Vwz74c6.cjs → vue-ui-sparkstackbar-BmYIcpVZ.cjs} +1 -1
- package/dist/{vue-ui-sparkstackbar-D-W-02aO.js → vue-ui-sparkstackbar-DyJIUulr.js} +5 -5
- package/dist/{vue-ui-stackbar-DRLdPZii.js → vue-ui-stackbar-BebRtOYL.js} +55 -53
- package/dist/{vue-ui-stackbar-DZvxTz3J.cjs → vue-ui-stackbar-DJ9NH_l1.cjs} +2 -2
- package/dist/{vue-ui-strip-plot-tQk3HsSn.js → vue-ui-strip-plot-BGHj1BHd.js} +77 -75
- package/dist/vue-ui-strip-plot-f7vejZht.cjs +1 -0
- package/dist/{vue-ui-table-G09LTync.cjs → vue-ui-table-BFdGppRF.cjs} +1 -1
- package/dist/{vue-ui-table-CNsJsvNH.js → vue-ui-table-ClPMKcMn.js} +1 -1
- package/dist/{vue-ui-table-heatmap-Dl4lMTS6.cjs → vue-ui-table-heatmap-B7wTjM-H.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-CTs7AxUi.js → vue-ui-table-heatmap-DVQtPt-M.js} +4 -4
- package/dist/{vue-ui-table-sparkline-Dy5shfoJ.cjs → vue-ui-table-sparkline-DaKODjfM.cjs} +1 -1
- package/dist/{vue-ui-table-sparkline-ZtfktJZh.js → vue-ui-table-sparkline-DjxKXWQm.js} +5 -5
- package/dist/{vue-ui-thermometer-CaFnSru6.js → vue-ui-thermometer-CV_9k37V.js} +7 -7
- package/dist/{vue-ui-thermometer-039Cyhc2.cjs → vue-ui-thermometer-DE9r0emf.cjs} +1 -1
- package/dist/{vue-ui-timer-ChuLD5VW.js → vue-ui-timer-2w5Ayq7G.js} +35 -33
- package/dist/vue-ui-timer-Ct-KYWSX.cjs +64 -0
- package/dist/{vue-ui-tiremarks-nDFTQjHJ.js → vue-ui-tiremarks-BJnh0GBj.js} +7 -7
- package/dist/{vue-ui-tiremarks-BiLfVwpF.cjs → vue-ui-tiremarks-Cf04zARl.cjs} +1 -1
- package/dist/{vue-ui-treemap-Dv9HNV59.js → vue-ui-treemap-BD546LBi.js} +37 -35
- package/dist/vue-ui-treemap-D0vi4bv4.cjs +1 -0
- package/dist/{vue-ui-vertical-bar-W7AgfJa9.cjs → vue-ui-vertical-bar-D3QKHHnS.cjs} +2 -2
- package/dist/{vue-ui-vertical-bar-M3IDlqbG.js → vue-ui-vertical-bar-E5CTb1Bd.js} +53 -51
- package/dist/{vue-ui-waffle-CJYfXE-I.js → vue-ui-waffle-BAJIMbZK.js} +50 -48
- package/dist/vue-ui-waffle-BL0e3Yeq.cjs +1 -0
- package/dist/{vue-ui-wheel-BaMfH-RC.js → vue-ui-wheel-CPPLUSFq.js} +22 -20
- package/dist/vue-ui-wheel-Dy_B7BTG.cjs +1 -0
- package/dist/vue-ui-word-cloud-BPoAoeWZ.cjs +1 -0
- package/dist/{vue-ui-word-cloud-qympaTse.js → vue-ui-word-cloud-BVZcDY7m.js} +47 -45
- package/dist/vue-ui-xy-D4hRtHAi.cjs +3 -0
- package/dist/{vue-ui-xy-canvas-Dn_4rMul.cjs → vue-ui-xy-canvas-BSZTrqci.cjs} +2 -2
- package/dist/{vue-ui-xy-canvas-qk5Vd9ng.js → vue-ui-xy-canvas-DFUfTZwz.js} +36 -34
- package/dist/{vue-ui-xy-BB_4gujH.js → vue-ui-xy-tB-6IP2y.js} +833 -839
- package/package.json +1 -1
- package/dist/Slicer-BZ-tooWv.cjs +0 -1
- package/dist/index-D4M1RdVn.cjs +0 -9
- package/dist/vue-ui-age-pyramid-BP3AgRGA.cjs +0 -1
- package/dist/vue-ui-donut--6AZz6OL.cjs +0 -1
- package/dist/vue-ui-dumbbell-6eYMBh5-.cjs +0 -9
- package/dist/vue-ui-funnel-CnyUx_rr.cjs +0 -1
- package/dist/vue-ui-gauge-Cg5wvQOF.cjs +0 -1
- package/dist/vue-ui-history-plot-N8Okj-iE.cjs +0 -1
- package/dist/vue-ui-quadrant-BSaMyYkS.cjs +0 -1
- package/dist/vue-ui-radar-BBKYxxex.cjs +0 -1
- package/dist/vue-ui-relation-circle-COKOM6l_.cjs +0 -1
- package/dist/vue-ui-scatter-oA9YA_np.cjs +0 -1
- package/dist/vue-ui-sparkline-De42544c.cjs +0 -1
- package/dist/vue-ui-strip-plot-CY7AKOJ8.cjs +0 -1
- package/dist/vue-ui-timer-BIAfoC2X.cjs +0 -64
- package/dist/vue-ui-treemap-8aBLlF51.cjs +0 -1
- package/dist/vue-ui-waffle-DefdpuXf.cjs +0 -1
- package/dist/vue-ui-wheel-DicUDLkK.cjs +0 -1
- package/dist/vue-ui-word-cloud-B5n21JbB.cjs +0 -1
- package/dist/vue-ui-xy-Du5PZnkC.cjs +0 -3
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { computed as c, ref as b, watch as U, onMounted as re, openBlock as r, createElementBlock as i, normalizeStyle as C, renderSlot as M, normalizeProps as ie, guardReactiveProps as de, createElementVNode as f, toDisplayString as X, createCommentVNode as h, unref as v, createVNode as ve, Fragment as D, renderList as P, createBlock as ce } from "vue";
|
|
2
|
-
import { u as he, c as ye, t as fe, C as
|
|
3
|
-
import { u as Q } from "./useNestedProp-
|
|
4
|
-
import _e from "./vue-ui-skeleton-
|
|
2
|
+
import { u as he, c as ye, t as fe, C as q, $ as T, o as pe, e as Z, g as ge, w as I, a0 as me, a1 as be, X as ke, s as V, R as H, a2 as Y, i as J, f as K } from "./index-B7nCQFK0.js";
|
|
3
|
+
import { u as Q } from "./useNestedProp-C9rlBRTT.js";
|
|
4
|
+
import _e from "./vue-ui-skeleton-D66ZIUln.js";
|
|
5
5
|
import { t as xe, u as we } from "./useResponsive-CoxXLe23.js";
|
|
6
|
-
import { _ as $e } from "./PackageVersion-
|
|
6
|
+
import { _ as $e } from "./PackageVersion-CENy3Lm2.js";
|
|
7
7
|
import { _ as Le } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
8
|
-
const Ne = ["id"], Ce = ["xmlns", "viewBox"], Me = ["width", "height"], Ie = ["id"], Ve = ["stop-color"], ze = ["stop-color"], Se = ["id"],
|
|
8
|
+
const Ne = ["id"], Ce = ["xmlns", "viewBox"], Me = ["width", "height"], Ie = ["id"], Ve = ["stop-color"], ze = ["stop-color"], Se = ["id"], Ae = ["stop-color"], We = ["stop-color"], De = ["id"], Pe = ["stop-color"], Te = ["stop-color"], Fe = { key: 1 }, Oe = ["d", "fill"], Be = ["d", "fill"], Ee = ["d", "stroke", "stroke-width"], Ge = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Re = ["x", "y", "width", "height", "fill", "rx"], je = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], Ue = ["x1", "x2", "y1", "y2", "stroke", "stroke-dasharray", "stroke-width"], Xe = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], qe = ["x", "y", "font-size", "font-weight", "fill"], Ze = ["x", "y", "height", "width", "onMouseenter", "onClick"], He = {
|
|
9
9
|
__name: "vue-ui-sparkline",
|
|
10
10
|
props: {
|
|
11
11
|
config: {
|
|
@@ -39,11 +39,11 @@ const Ne = ["id"], Ce = ["xmlns", "viewBox"], Me = ["width", "height"], Ie = ["i
|
|
|
39
39
|
},
|
|
40
40
|
emits: ["hoverIndex", "selectDatapoint"],
|
|
41
41
|
setup(_, { emit: z }) {
|
|
42
|
-
const s = _, { vue_ui_sparkline: ee } = he(), $ = c(() => !!s.dataset && s.dataset.length), p = b(ye()), S = b(null),
|
|
43
|
-
get: () =>
|
|
42
|
+
const s = _, { vue_ui_sparkline: ee } = he(), $ = c(() => !!s.dataset && s.dataset.length), p = b(ye()), S = b(null), F = b(null), O = b(null), e = c({
|
|
43
|
+
get: () => B(),
|
|
44
44
|
set: (t) => t
|
|
45
45
|
});
|
|
46
|
-
function
|
|
46
|
+
function B() {
|
|
47
47
|
const t = Q({
|
|
48
48
|
userConfig: s.config,
|
|
49
49
|
defaultConfig: ee
|
|
@@ -54,14 +54,14 @@ const Ne = ["id"], Ce = ["xmlns", "viewBox"], Me = ["width", "height"], Ie = ["i
|
|
|
54
54
|
userConfig: fe.vue_ui_sparkline[t.theme] || s.config,
|
|
55
55
|
defaultConfig: t
|
|
56
56
|
})
|
|
57
|
-
} : l = t, s.config &&
|
|
57
|
+
} : l = t, s.config && q(s.config, "style.scaleMin") ? l.style.scaleMin = s.config.style.scaleMin : l.style.scaleMin = null, s.config && q(s.config, "style.scaleMax") ? l.style.scaleMax = s.config.style.scaleMax : l.style.scaleMax = null, l;
|
|
58
58
|
}
|
|
59
59
|
const L = c(() => T({
|
|
60
60
|
data: s.dataset,
|
|
61
61
|
threshold: e.value.downsample.threshold
|
|
62
62
|
}));
|
|
63
63
|
U(() => s.config, (t) => {
|
|
64
|
-
e.value =
|
|
64
|
+
e.value = B(), G(), u.value.chartWidth = e.value.style.chartWidth;
|
|
65
65
|
}, { deep: !0 }), U(() => s.dataset, (t) => {
|
|
66
66
|
k.value = T({
|
|
67
67
|
data: s.dataset.map((l) => ({
|
|
@@ -84,7 +84,7 @@ const Ne = ["id"], Ce = ["xmlns", "viewBox"], Me = ["width", "height"], Ie = ["i
|
|
|
84
84
|
threshold: e.value.downsample.threshold
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
|
-
const
|
|
87
|
+
const E = b(null);
|
|
88
88
|
re(() => {
|
|
89
89
|
if (G(), e.value.style.animation.show && s.dataset.length > 1) {
|
|
90
90
|
let a = function() {
|
|
@@ -99,7 +99,7 @@ const Ne = ["id"], Ce = ["xmlns", "viewBox"], Me = ["width", "height"], Ie = ["i
|
|
|
99
99
|
}
|
|
100
100
|
});
|
|
101
101
|
function G() {
|
|
102
|
-
if (pe(s.dataset) ?
|
|
102
|
+
if (pe(s.dataset) ? Z({
|
|
103
103
|
componentName: "VueUiSparkline",
|
|
104
104
|
type: "dataset"
|
|
105
105
|
}) : s.dataset.forEach((t, l) => {
|
|
@@ -107,7 +107,7 @@ const Ne = ["id"], Ce = ["xmlns", "viewBox"], Me = ["width", "height"], Ie = ["i
|
|
|
107
107
|
datasetObject: t,
|
|
108
108
|
requiredAttributes: ["period", "value"]
|
|
109
109
|
}).forEach((a) => {
|
|
110
|
-
|
|
110
|
+
Z({
|
|
111
111
|
componentName: "VueUiSparkline",
|
|
112
112
|
type: "datasetSerieAttribute",
|
|
113
113
|
property: a,
|
|
@@ -118,12 +118,14 @@ const Ne = ["id"], Ce = ["xmlns", "viewBox"], Me = ["width", "height"], Ie = ["i
|
|
|
118
118
|
const t = xe(() => {
|
|
119
119
|
const { width: l, height: a } = we({
|
|
120
120
|
chart: S.value,
|
|
121
|
-
title: e.value.style.title.show && s.showInfo ?
|
|
122
|
-
source:
|
|
121
|
+
title: e.value.style.title.show && s.showInfo ? F.value : null,
|
|
122
|
+
source: O.value
|
|
123
|
+
});
|
|
124
|
+
requestAnimationFrame(() => {
|
|
125
|
+
u.value.width = l, u.value.height = a, u.value.chartWidth = e.value.style.chartWidth / 500 * l, u.value.padding = s.forcedPadding / 500 * l;
|
|
123
126
|
});
|
|
124
|
-
u.value.width = l, u.value.height = a, u.value.chartWidth = e.value.style.chartWidth / 500 * l, u.value.padding = s.forcedPadding / 500 * l;
|
|
125
127
|
});
|
|
126
|
-
|
|
128
|
+
E.value = new ResizeObserver(t), E.value.observe(S.value.parentNode);
|
|
127
129
|
}
|
|
128
130
|
}
|
|
129
131
|
const u = b({
|
|
@@ -142,11 +144,11 @@ const Ne = ["id"], Ce = ["xmlns", "viewBox"], Me = ["width", "height"], Ie = ["i
|
|
|
142
144
|
width: s.showInfo && e.value.style.dataLabel.show ? u.value.chartWidth - n - l : u.value.width - u.value.padding - n - l,
|
|
143
145
|
height: u.value.height - t - a
|
|
144
146
|
};
|
|
145
|
-
}),
|
|
146
|
-
const t =
|
|
147
|
+
}), A = c(() => [null, void 0].includes(e.value.style.scaleMin) ? Math.min(...k.value.map((t) => isNaN(t.value) || [void 0, null, "NaN", NaN, 1 / 0, -1 / 0].includes(t.value) ? 0 : t.value || 0)) : e.value.style.scaleMin), ae = c(() => [null, void 0].includes(e.value.style.scaleMax) ? Math.max(...k.value.map((t) => isNaN(t.value) || [void 0, null, "NaN", NaN, 1 / 0, -1 / 0].includes(t.value) ? 0 : t.value || 0)) : e.value.style.scaleMax), x = c(() => {
|
|
148
|
+
const t = A.value >= 0 ? 0 : A.value;
|
|
147
149
|
return Math.abs(t);
|
|
148
|
-
}), le = c(() => ae.value + x.value), N = c(() => o.value.bottom - o.value.height *
|
|
149
|
-
function
|
|
150
|
+
}), le = c(() => ae.value + x.value), N = c(() => o.value.bottom - o.value.height * W(x.value));
|
|
151
|
+
function W(t) {
|
|
150
152
|
return t / le.value;
|
|
151
153
|
}
|
|
152
154
|
const g = c(() => L.value.length - 1), d = c(() => k.value.map((t, l) => {
|
|
@@ -155,9 +157,9 @@ const Ne = ["id"], Ce = ["xmlns", "viewBox"], Me = ["width", "height"], Ie = ["i
|
|
|
155
157
|
absoluteValue: a,
|
|
156
158
|
period: t.period,
|
|
157
159
|
plotValue: a + x.value,
|
|
158
|
-
toMax:
|
|
160
|
+
toMax: W(a + x.value),
|
|
159
161
|
x: o.value.start + l * (o.value.width / (g.value + 1) > u.padding ? u.padding : o.value.width / (g.value + 1)),
|
|
160
|
-
y: o.value.bottom - o.value.height *
|
|
162
|
+
y: o.value.bottom - o.value.height * W(a + x.value),
|
|
161
163
|
id: `plot_${p.value}_${l}`,
|
|
162
164
|
color: w.value ? e.value.style.bar.color : e.value.style.area.useGradient ? I(e.value.style.line.color, 0.05 * (1 - l / g.value)) : e.value.style.line.color,
|
|
163
165
|
width: o.value.width / (g.value + 1) > u.padding ? u.padding : o.value.width / (g.value + 1)
|
|
@@ -218,7 +220,7 @@ const Ne = ["id"], Ce = ["xmlns", "viewBox"], Me = ["width", "height"], Ie = ["i
|
|
|
218
220
|
e.value.style.title.show && _.showInfo ? (r(), i("div", {
|
|
219
221
|
key: 0,
|
|
220
222
|
ref_key: "chartTitle",
|
|
221
|
-
ref:
|
|
223
|
+
ref: F,
|
|
222
224
|
class: "vue-ui-sparkline-title",
|
|
223
225
|
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"};`)
|
|
224
226
|
}, [
|
|
@@ -270,11 +272,11 @@ const Ne = ["id"], Ce = ["xmlns", "viewBox"], Me = ["width", "height"], Ie = ["i
|
|
|
270
272
|
f("stop", {
|
|
271
273
|
offset: "0%",
|
|
272
274
|
"stop-color": e.value.style.bar.color
|
|
273
|
-
}, null, 8,
|
|
275
|
+
}, null, 8, Ae),
|
|
274
276
|
f("stop", {
|
|
275
277
|
offset: "100%",
|
|
276
278
|
"stop-color": v(I)(e.value.style.bar.color, 0.05)
|
|
277
|
-
}, null, 8,
|
|
279
|
+
}, null, 8, We)
|
|
278
280
|
], 8, Se),
|
|
279
281
|
f("linearGradient", {
|
|
280
282
|
x2: "0%",
|
|
@@ -291,16 +293,16 @@ const Ne = ["id"], Ce = ["xmlns", "viewBox"], Me = ["width", "height"], Ie = ["i
|
|
|
291
293
|
}, null, 8, Te)
|
|
292
294
|
], 8, De)
|
|
293
295
|
]),
|
|
294
|
-
e.value.style.area.show && !w.value && d.value[0] ? (r(), i("g",
|
|
296
|
+
e.value.style.area.show && !w.value && d.value[0] ? (r(), i("g", Fe, [
|
|
295
297
|
e.value.style.line.smooth ? (r(), i("path", {
|
|
296
298
|
key: 0,
|
|
297
299
|
d: `M ${d.value[0].x},${o.value.bottom} ${v(H)(d.value)} L ${d.value.at(-1).x},${o.value.bottom} Z`,
|
|
298
300
|
fill: e.value.style.area.useGradient ? `url(#sparkline_gradient_${p.value})` : v(V)(e.value.style.area.color, e.value.style.area.opacity)
|
|
299
|
-
}, null, 8,
|
|
301
|
+
}, null, 8, Oe)) : (r(), i("path", {
|
|
300
302
|
key: 1,
|
|
301
303
|
d: `M${ue.value}Z`,
|
|
302
304
|
fill: e.value.style.area.useGradient ? `url(#sparkline_gradient_${p.value})` : v(V)(e.value.style.area.color, e.value.style.area.opacity)
|
|
303
|
-
}, null, 8,
|
|
305
|
+
}, null, 8, Be))
|
|
304
306
|
])) : h("", !0),
|
|
305
307
|
e.value.style.line.smooth && !w.value ? (r(), i("path", {
|
|
306
308
|
key: 2,
|
|
@@ -309,7 +311,7 @@ const Ne = ["id"], Ce = ["xmlns", "viewBox"], Me = ["width", "height"], Ie = ["i
|
|
|
309
311
|
fill: "none",
|
|
310
312
|
"stroke-width": e.value.style.line.strokeWidth,
|
|
311
313
|
"stroke-linecap": "round"
|
|
312
|
-
}, null, 8,
|
|
314
|
+
}, null, 8, Ee)) : h("", !0),
|
|
313
315
|
(r(!0), i(D, null, P(d.value, (a, n) => (r(), i("g", null, [
|
|
314
316
|
n < d.value.length - 1 && !e.value.style.line.smooth && !w.value ? (r(), i("line", {
|
|
315
317
|
key: 0,
|
|
@@ -344,7 +346,7 @@ const Ne = ["id"], Ce = ["xmlns", "viewBox"], Me = ["width", "height"], Ie = ["i
|
|
|
344
346
|
"stroke-dasharray": e.value.style.verticalIndicator.strokeDasharray || 0
|
|
345
347
|
}, null, 8, je)) : h("", !0)
|
|
346
348
|
]))), 256)),
|
|
347
|
-
|
|
349
|
+
A.value < 0 ? (r(), i("line", {
|
|
348
350
|
key: 3,
|
|
349
351
|
x1: o.value.start,
|
|
350
352
|
x2: o.value.start + o.value.width - 16,
|
|
@@ -382,7 +384,7 @@ const Ne = ["id"], Ce = ["xmlns", "viewBox"], Me = ["width", "height"], Ie = ["i
|
|
|
382
384
|
e.value.style.dataLabel.formatter,
|
|
383
385
|
R.value,
|
|
384
386
|
v(K)({ p: e.value.style.dataLabel.prefix, v: R.value, s: e.value.style.dataLabel.suffix, r: e.value.style.dataLabel.roundingValue })
|
|
385
|
-
)), 9,
|
|
387
|
+
)), 9, qe)) : h("", !0),
|
|
386
388
|
(r(!0), i(D, null, P(d.value, (a, n) => (r(), i("rect", {
|
|
387
389
|
x: a.x - (o.value.width / (g.value + 1) > u.value.padding ? u.value.padding : o.value.width / (g.value + 1)) / 2,
|
|
388
390
|
y: o.value.top - 6,
|
|
@@ -392,13 +394,13 @@ const Ne = ["id"], Ce = ["xmlns", "viewBox"], Me = ["width", "height"], Ie = ["i
|
|
|
392
394
|
onMouseenter: (j) => se(a, n),
|
|
393
395
|
onMouseleave: oe,
|
|
394
396
|
onClick: () => ne(a, n)
|
|
395
|
-
}, null, 40,
|
|
397
|
+
}, null, 40, Ze))), 256)),
|
|
396
398
|
M(t.$slots, "svg", { svg: u.value }, void 0, !0)
|
|
397
399
|
], 12, Ce)) : h("", !0),
|
|
398
400
|
t.$slots.source ? (r(), i("div", {
|
|
399
401
|
key: 2,
|
|
400
402
|
ref_key: "source",
|
|
401
|
-
ref:
|
|
403
|
+
ref: O,
|
|
402
404
|
dir: "auto"
|
|
403
405
|
}, [
|
|
404
406
|
M(t.$slots, "source", {}, void 0, !0)
|
|
@@ -417,7 +419,7 @@ const Ne = ["id"], Ce = ["xmlns", "viewBox"], Me = ["width", "height"], Ie = ["i
|
|
|
417
419
|
}, null, 8, ["config"]))
|
|
418
420
|
], 12, Ne));
|
|
419
421
|
}
|
|
420
|
-
}, lt = /* @__PURE__ */ Le(He, [["__scopeId", "data-v-
|
|
422
|
+
}, lt = /* @__PURE__ */ Le(He, [["__scopeId", "data-v-db8c64e5"]]);
|
|
421
423
|
export {
|
|
422
424
|
lt as default
|
|
423
425
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-COIn1phv.cjs"),S=require("./useNestedProp-CbMuGGl3.cjs"),q=require("./vue-ui-skeleton-BIqMxXV7.cjs"),P=require("./useResponsive-BJ7DTGpm.cjs"),G=require("./PackageVersion-BjfedMsH.cjs"),R=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),H=["id"],U=["xmlns","viewBox"],X=["width","height"],Z=["id"],Y=["stop-color"],J=["stop-color"],K=["id"],Q=["stop-color"],ee=["stop-color"],te=["id"],le=["stop-color"],ae=["stop-color"],oe={key:1},ne=["d","fill"],re=["d","fill"],ue=["d","stroke","stroke-width"],se=["x1","x2","y1","y2","stroke","stroke-width"],ie=["x","y","width","height","fill","rx"],de=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],ce=["x1","x2","y1","y2","stroke","stroke-dasharray","stroke-width"],ve=["cx","cy","r","fill","stroke","stroke-width"],he=["x","y","font-size","font-weight","fill"],ye=["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(p,{emit:x}){const u=p,{vue_ui_sparkline:z}=r.useConfig(),k=e.computed(()=>!!u.dataset&&u.dataset.length),v=e.ref(r.createUid()),w=e.ref(null),V=e.ref(null),C=e.ref(null),t=e.computed({get:()=>L(),set:l=>l});function L(){const l=S.useNestedProp({userConfig:u.config,defaultConfig:z});let o={};return l.theme?o={...S.useNestedProp({userConfig:r.themes.vue_ui_sparkline[l.theme]||u.config,defaultConfig:l})}:o=l,u.config&&r.hasDeepProperty(u.config,"style.scaleMin")?o.style.scaleMin=u.config.style.scaleMin:o.style.scaleMin=null,u.config&&r.hasDeepProperty(u.config,"style.scaleMax")?o.style.scaleMax=u.config.style.scaleMax:o.style.scaleMax=null,o}const b=e.computed(()=>r.largestTriangleThreeBucketsArrayObjects({data:u.dataset,threshold:t.value.downsample.threshold}));e.watch(()=>u.config,l=>{t.value=L(),$(),n.value.chartWidth=t.value.style.chartWidth},{deep:!0}),e.watch(()=>u.dataset,l=>{f.value=r.largestTriangleThreeBucketsArrayObjects({data:u.dataset.map(o=>({...o,value:[void 0].includes(o.value)?null:o.value})),threshold:t.value.downsample.threshold})},{deep:!0});const f=e.ref(A());function A(){return r.largestTriangleThreeBucketsArrayObjects({data:u.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&&u.dataset.length>1){let a=function(){o<b.value.length?(f.value.push(b.value[o]),setTimeout(()=>{requestAnimationFrame(a)},l)):f.value=b.value,o+=1};f.value=[];const l=t.value.style.animation.animationFrames/u.dataset.length;let o=0;a()}});function $(){if(r.objectIsEmpty(u.dataset)?r.error({componentName:"VueUiSparkline",type:"dataset"}):u.dataset.forEach((l,o)=>{r.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["period","value"]}).forEach(a=>{r.error({componentName:"VueUiSparkline",type:"datasetSerieAttribute",property:a,index:o})})}),t.value.responsive){const l=P.throttle(()=>{const{width:o,height:a}=P.useResponsive({chart:w.value,title:t.value.style.title.show&&u.showInfo?V.value:null,source:C.value});requestAnimationFrame(()=>{n.value.width=o,n.value.height=a,n.value.chartWidth=t.value.style.chartWidth/500*o,n.value.padding=u.forcedPadding/500*o})});E.value=new ResizeObserver(l),E.value.observe(w.value.parentNode)}}const n=e.ref({height:80*u.heightRatio,width:500,chartWidth:t.value.style.chartWidth,padding:u.forcedPadding}),s=e.computed(()=>{const{top:l,right:o,bottom:a,left:i}=t.value.style.padding;return{top:l,left:i,right:n.value.width-o,bottom:n.value.height-a,start:u.showInfo&&t.value.style.dataLabel.show&&t.value.style.dataLabel.position==="left"?n.value.width-n.value.chartWidth+i:n.value.padding+i,width:u.showInfo&&t.value.style.dataLabel.show?n.value.chartWidth-i-o:n.value.width-n.value.padding-i-o,height:n.value.height-l-a}}),N=e.computed(()=>[null,void 0].includes(t.value.style.scaleMin)?Math.min(...f.value.map(l=>isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0)):t.value.style.scaleMin),D=e.computed(()=>[null,void 0].includes(t.value.style.scaleMax)?Math.max(...f.value.map(l=>isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0)):t.value.style.scaleMax),m=e.computed(()=>{const l=N.value>=0?0:N.value;return Math.abs(l)}),O=e.computed(()=>D.value+m.value),_=e.computed(()=>s.value.bottom-s.value.height*B(m.value));function B(l){return l/O.value}const h=e.computed(()=>b.value.length-1),d=e.computed(()=>f.value.map((l,o)=>{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:s.value.start+o*(s.value.width/(h.value+1)>n.padding?n.padding:s.value.width/(h.value+1)),y:s.value.bottom-s.value.height*B(a+m.value),id:`plot_${v.value}_${o}`,color:g.value?t.value.style.bar.color:t.value.style.area.useGradient?r.shiftHue(t.value.style.line.color,.05*(1-o/h.value)):t.value.style.line.color,width:s.value.width/(h.value+1)>n.padding?n.padding:s.value.width/(h.value+1)}})),T=e.computed(()=>{const l={x:d.value[0].x||0,y:(n.value.height||0)-6},o={x:d.value[d.value.length-1].x||0,y:(n.value.height||0)-6},a=[];return d.value.forEach(i=>{a.push(`${i.x||0},${i.y||0} `)}),[l.x,l.y,...a,o.x,o.y].toString()}),c=e.ref(void 0);function W(l,o){c.value=l,x("hoverIndex",{index:o})}function F(){c.value=void 0,x("hoverIndex",{index:void 0})}const y=e.computed(()=>{if(k.value){const l=d.value.map(a=>a.absoluteValue),o=l.reduce((a,i)=>a+i,0);return{latest:d.value[d.value.length-1].absoluteValue,sum:o,average:o/d.value.length,median:r.calcMedian(l),trend:r.calcLinearProgression(d.value.map(({x:a,y:i,absoluteValue:I})=>({x:a,y:i,value:I}))).trend}}else return{latest:null,sum:null,average:null,median:null,trend:null}}),M=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 j(l,o){x("selectDatapoint",{datapoint:l,index:o})}return(l,o)=>(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&&p.showInfo?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:V,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(r.XMLNS),viewBox:`0 0 ${n.value.width} ${n.value.height}`,style:e.normalizeStyle(`background:${t.value.style.backgroundColor};overflow:visible`)},[e.createVNode(G._sfc_main),l.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:n.value.width<=0?10:n.value.width,height:n.value.height<=0?10:n.value.height,style:{pointerEvents:"none"}},[e.renderSlot(l.$slots,"chart-background",{},void 0,!0)],8,X)):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(r.setOpacity)(e.unref(r.shiftHue)(t.value.style.area.color,.05),t.value.style.area.opacity)},null,8,Y),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.setOpacity)(t.value.style.area.color,t.value.style.area.opacity)},null,8,J)],8,Z),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,Q),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.shiftHue)(t.value.style.bar.color,.05)},null,8,ee)],8,K),e.createElementVNode("linearGradient",{x2:"0%",y2:"100%",id:`sparkline_bar_gradient_neg_${v.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(r.shiftHue)(t.value.style.bar.color,.05)},null,8,le),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.bar.color},null,8,ae)],8,te)]),t.value.style.area.show&&!g.value&&d.value[0]?(e.openBlock(),e.createElementBlock("g",oe,[t.value.style.line.smooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:`M ${d.value[0].x},${s.value.bottom} ${e.unref(r.createSmoothPath)(d.value)} L ${d.value.at(-1).x},${s.value.bottom} Z`,fill:t.value.style.area.useGradient?`url(#sparkline_gradient_${v.value})`:e.unref(r.setOpacity)(t.value.style.area.color,t.value.style.area.opacity)},null,8,ne)):(e.openBlock(),e.createElementBlock("path",{key:1,d:`M${T.value}Z`,fill:t.value.style.area.useGradient?`url(#sparkline_gradient_${v.value})`:e.unref(r.setOpacity)(t.value.style.area.color,t.value.style.area.opacity)},null,8,re))])):e.createCommentVNode("",!0),t.value.style.line.smooth&&!g.value?(e.openBlock(),e.createElementBlock("path",{key:2,d:`M ${e.unref(r.createSmoothPath)(d.value)}`,stroke:t.value.style.line.color,fill:"none","stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":"round"},null,8,ue)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(a,i)=>(e.openBlock(),e.createElementBlock("g",null,[i<d.value.length-1&&!t.value.style.line.smooth&&!g.value?(e.openBlock(),e.createElementBlock("line",{key:0,x1:a.x,x2:d.value[i+1].x,y1:a.y||0,y2:d.value[i+1].y||0,stroke:a.color,"stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round","shape-rendering":"geometricPrecision"},null,8,se)):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,ie)):e.createCommentVNode("",!0),t.value.style.verticalIndicator.show&&(c.value&&a.id===c.value.id||p.selectedIndex===i)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:a.x,x2:a.x,y1:s.value.top-6,y2:s.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,de)):e.createCommentVNode("",!0)]))),256)),N.value<0?(e.openBlock(),e.createElementBlock("line",{key:3,x1:s.value.start,x2:s.value.start+s.value.width-16,y1:e.unref(r.forceValidValue)(_.value,s.value.bottom),y2:e.unref(r.forceValidValue)(_.value,s.value.bottom),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,ce)):e.createCommentVNode("",!0),t.value.style.plot.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:4},e.renderList(d.value,(a,i)=>(e.openBlock(),e.createElementBlock("g",null,[c.value&&a.id===c.value.id||p.selectedIndex===i?(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,ve)):e.createCommentVNode("",!0)]))),256)):e.createCommentVNode("",!0),p.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:s.value.width+12+t.value.style.dataLabel.offsetX,y:n.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(r.applyDataLabel)(t.value.style.dataLabel.formatter,c.value.absoluteValue,e.unref(r.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(r.applyDataLabel)(t.value.style.dataLabel.formatter,M.value,e.unref(r.dataLabel)({p:t.value.style.dataLabel.prefix,v:M.value,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.roundingValue}))),9,he)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(a,i)=>(e.openBlock(),e.createElementBlock("rect",{x:a.x-(s.value.width/(h.value+1)>n.value.padding?n.value.padding:s.value.width/(h.value+1))/2,y:s.value.top-6,height:s.value.height+6,width:s.value.width/(h.value+1)>n.value.padding?n.value.padding:s.value.width/(h.value+1),fill:"transparent",onMouseenter:I=>W(a,i),onMouseleave:F,onClick:()=>j(a,i)},null,40,ye))),256)),e.renderSlot(l.$slots,"svg",{svg:n.value},void 0,!0)],12,U)):e.createCommentVNode("",!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"source",ref:C,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),k.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(q.default,{key:3,config:{type:"sparkline",style:{backgroundColor:t.value.style.backgroundColor,sparkline:{color:"#CCCCCC"}}}},null,8,["config"]))],12,H))}},pe=R._export_sfc(fe,[["__scopeId","data-v-db8c64e5"]]);exports.default=pe;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-D4M1RdVn.cjs"),V=require("./useNestedProp-D_XfpfnF.cjs"),q=require("./vue-ui-skeleton-6_VzxeeY.cjs"),O=require("./PackageVersion-Bxz2crF7.cjs"),U=require("./Tooltip-Kn7RnF0L.cjs"),M=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),j=["xmlns","viewBox"],H=["id"],I=["stop-color"],R=["stop-color"],W=["stop-color"],Y={id:"stackPill",clipPathUnits:"objectBoundingBox"},G=["fill"],X={key:0,"clip-path":"url(#stackPill)"},J=["x","width","height","fill"],K=["x","width","height","fill","stroke"],Q=["onClick","x","width","height","onMouseenter"],Z=["width","height","rx"],ee=["onClick"],te={style:{display:"flex","flex-direction":"row","align-items":"center",gap:"4px","justify-content":"center"}},le=["height","width"],oe=["fill"],ae={key:4,ref:"source",dir:"auto"},re={__name:"vue-ui-sparkstackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(P,{emit:D}){const u=P,{vue_ui_sparkstackbar:L}=a.useConfig(),F=e.useSlots();e.onMounted(()=>{F["chart-background"]&&console.warn("VueUiSparkStackbar does not support the #chart-background slot.")});const x=e.computed(()=>!!u.dataset&&u.dataset.length),B=e.ref(null),S=e.ref(a.createUid()),b=e.ref(!1),_=e.ref(""),t=e.computed({get:()=>$(),set:l=>l});function $(){const l=V.useNestedProp({userConfig:u.config,defaultConfig:L});return l.theme?{...V.useNestedProp({userConfig:a.themes.vue_ui_sparkstackbar[l.theme]||u.config,defaultConfig:l}),customPalette:a.themePalettes[l.theme]||a.palette}:l}e.watch(()=>u.config,l=>{t.value=$(),E()},{deep:!0}),e.watch(()=>u.dataset,l=>{v.value=u.dataset.map((n,o)=>({...n,color:n.color?a.convertColorToHex(n.color):f.value[o]||a.palette[o]||a.palette[o%a.palette.length]}))},{deep:!0});const f=e.computed(()=>a.convertCustomPalette(t.value.customPalette)),v=e.ref(u.dataset.map((l,n)=>({...l,value:t.value.style.animation.show?0:l.value||0,color:l.color?a.convertColorToHex(l.color):f.value[n]||a.palette[n]||a.palette[n%a.palette.length]}))),g=e.ref(!0);e.onMounted(()=>{if(E(),t.value.style.animation.show){let p=function(){r+=o/l,r<o?(v.value=v.value.map((s,i)=>({...s,value:s.value+=n[i],color:s.color?a.convertColorToHex(s.color):f.value[i]||a.palette[i]||a.palette[i%a.palette.length]})),requestAnimationFrame(p)):(g.value=!1,v.value=u.dataset.map((s,i)=>({...s,value:s.value||0,color:s.color?a.convertColorToHex(s.color):f.value[i]||a.palette[i]||a.palette[i%a.palette.length],id:a.createUid()})))};const l=t.value.style.animation.animationFrames,n=u.dataset.map((s,i)=>s.value/l),o=u.dataset.map(s=>s.value||0).reduce((s,i)=>s+i,0);let r=0;g.value=!0,p()}});function E(){a.objectIsEmpty(u.dataset)?a.error({componentName:"VueUiSparkStackbar",type:"dataset"}):u.dataset.forEach((l,n)=>{a.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","value"]}).forEach(o=>{a.error({componentName:"VueUiSparkStackbar",type:"datasetSerieAttribute",property:o,index:n})})})}const c=e.ref({width:500,height:16}),d=e.ref([]),N=e.computed(()=>u.dataset.map(l=>l.value||0).filter((l,n)=>!d.value.includes(n)).reduce((l,n)=>l+n,0)),y=e.computed(()=>v.value.map((l,n)=>{const o=l.value||0,r=o/N.value,p=isNaN(r)?0:r,s=p*c.value.width;return{...l,value:o,proportion:p,width:s,proportionLabel:a.dataLabel({v:p*100,s:"%",r:t.value.style.legend.percentage.rounding})}})),C=e.computed(()=>y.value.filter((l,n)=>!d.value.includes(n)));function T(l){d.value.includes(l)?d.value=d.value.filter(n=>n!==l):d.value.length<v.value.length-1&&d.value.push(l)}const h=e.computed(()=>{let l=0;const n=[];for(let o=0;o<C.value.length;o+=1)n.push({...C.value[o],start:l}),l+=C.value[o].width;return n});function z(l,n){D("selectDatapoint",{datapoint:l,index:n})}const w=e.ref(null),k=e.ref(!1),m=e.ref(null);function A({datapoint:l,seriesIndex:n}){if(!t.value.style.tooltip.show)return;w.value={datapoint:l,seriesIndex:n,config:t.value,series:y.value},b.value=!0,m.value=n;const o=t.value.style.tooltip.customFormat;if(a.isFunction(o))try{const r=o({seriesIndex:n,datapoint:l,series:y.value,config:t.value});typeof r=="string"&&(_.value=r,k.value=!0)}catch{console.warn("Custom format cannot be applied."),k.value=!1}if(!k.value){let r="";r+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${l.name}</div>`,r+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${l.color}"/></svg>`,r+=`<b>${l.proportionLabel}</b>`,r+=`<span>(${a.applyDataLabel(t.value.style.legend.value.formatter,l.value,a.dataLabel({p:t.value.style.legend.value.prefix,v:l.value,s:t.value.style.legend.value.suffix,r:t.value.style.legend.value.rounding}),{datapoint:l,seriesIndex:n})})</span>`,_.value=`<div>${r}</div>`}}return(l,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"sparkstackbarChart",ref:B,style:e.normalizeStyle(`width:100%; background:${t.value.style.backgroundColor}`)},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:calc(100% - 12px);background:transparent;margin:0 auto;margin:${t.value.style.title.margin};padding: 0 6px;text-align:${t.value.style.title.textAlign}`)},[e.createElementVNode("div",{style:e.normalizeStyle(`font-size:${t.value.style.title.fontSize}px;color:${t.value.style.title.color};font-weight:${t.value.style.title.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.text),5),t.value.style.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`font-size:${t.value.style.title.subtitle.fontSize}px;color:${t.value.style.title.subtitle.color};font-weight:${t.value.style.title.subtitle.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.subtitle.text),5)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),x.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(a.XMLNS),width:"100%",viewBox:`0 0 ${c.value.width} ${c.value.height}`},[e.createVNode(O._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{key:`stack_gradient_${r}`,gradientTransform:"rotate(90)",id:`stack_gradient_${r}_${S.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":o.color},null,8,I),e.createElementVNode("stop",{offset:"50%","stop-color":e.unref(a.setOpacity)(e.unref(a.shiftHue)(o.color,.05),100-t.value.style.bar.gradient.intensity)},null,8,R),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,W)],8,H))),128)),e.createElementVNode("clipPath",Y,[e.createElementVNode("rect",{x:"0.005",y:"-2",width:"0.99",height:"5",rx:"3",ry:"3",fill:t.value.style.backgroundColor},null,8,G)])]),N.value>0?(e.openBlock(),e.createElementBlock("g",X,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_underlayer_${r}`,x:o.start,y:0,width:o.width,height:c.value.height,fill:t.value.style.bar.gradient.underlayerColor,class:e.normalizeClass({animated:!g.value}),style:e.normalizeStyle({opacity:m.value!==null&&t.value.style.tooltip.show?m.value===r?1:.5:1})},null,14,J))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_${r}`,x:o.start,y:0,width:o.width,height:c.value.height,fill:t.value.style.bar.gradient.show?`url(#stack_gradient_${r}_${S.value})`:o.color,stroke:t.value.style.backgroundColor,"stroke-linecap":"round",class:e.normalizeClass({animated:!g.value}),style:e.normalizeStyle({opacity:m.value!==null&&t.value.style.tooltip.show?m.value===r?1:.5:1})},null,14,K))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_trap_${r}`,onClick:()=>z(o,r),x:o.start,y:0,width:o.width,height:c.value.height,fill:"transparent",stroke:"none",class:e.normalizeClass({animated:!g.value}),onMouseenter:()=>A({datapoint:o,seriesIndex:r}),onMouseleave:n[0]||(n[0]=p=>{b.value=!1,m.value=null})},null,42,Q))),128))])):(e.openBlock(),e.createElementBlock("rect",{key:1,x:2,y:1,width:c.value.width-4,height:c.value.height-2,stroke:"#CCCCCC","stroke-width":"2",fill:"transparent",rx:(c.value.height-4)/2},null,8,Z))],8,j)):e.createCommentVNode("",!0),x.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(q.default,{key:2,config:{type:"sparkStackbar",style:{backgroundColor:t.value.style.backgroundColor,sparkStackbar:{color:"#CCCCCC"}}}},null,8,["config"])),t.value.style.legend.show?(e.openBlock(),e.createElementBlock("div",{key:3,style:e.normalizeStyle(`background:transparent;margin:0 auto;margin:${t.value.style.legend.margin};justify-content:${t.value.style.legend.textAlign==="left"?"flex-start":t.value.style.legend.textAlign==="right"?"flex-end":"center"}`),class:"vue-ui-sparkstackbar-legend"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(o,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":d.value.includes(r)}),onClick:p=>{T(r),z(o,r)}},[e.createElementVNode("div",te,[(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:o.color},null,8,oe)],8,le)),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(o.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(d.value.includes(r)?" - ":o.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(a.applyDataLabel)(t.value.style.legend.value.formatter,o.value,e.unref(a.dataLabel)({p:t.value.style.legend.value.prefix,v:o.value,s:t.value.style.legend.value.suffix,r:t.value.style.legend.value.rounding}),{datapoint:o,seriesIndex:r}))+") ",5)):e.createCommentVNode("",!0)])],14,ee))),256))],4)):e.createCommentVNode("",!0),e.createVNode(U._sfc_main,{show:b.value&&t.value.style.tooltip.show,parent:B.value,backgroundColor:t.value.style.tooltip.backgroundColor,color:t.value.style.tooltip.color,fontSize:t.value.style.tooltip.fontSize,borderRadius:t.value.style.tooltip.borderRadius,borderColor:t.value.style.tooltip.borderColor,borderWidth:t.value.style.tooltip.borderWidth,backgroundOpacity:t.value.style.tooltip.backgroundOpacity,position:t.value.style.tooltip.position,content:_.value,isCustom:k.value,offsetY:-124+t.value.style.tooltip.offsetY,blockShiftY:!0},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...w.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...w.value})),void 0,!0)]),_:3},8,["show","parent","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","content","isCustom","offsetY"]),l.$slots.source?(e.openBlock(),e.createElementBlock("div",ae,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0)],4))}},ne=M._export_sfc(re,[["__scopeId","data-v-72244c73"]]);exports.default=ne;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-COIn1phv.cjs"),V=require("./useNestedProp-CbMuGGl3.cjs"),q=require("./vue-ui-skeleton-BIqMxXV7.cjs"),O=require("./PackageVersion-BjfedMsH.cjs"),U=require("./Tooltip-C5QuW94e.cjs"),M=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),j=["xmlns","viewBox"],H=["id"],I=["stop-color"],R=["stop-color"],W=["stop-color"],Y={id:"stackPill",clipPathUnits:"objectBoundingBox"},G=["fill"],X={key:0,"clip-path":"url(#stackPill)"},J=["x","width","height","fill"],K=["x","width","height","fill","stroke"],Q=["onClick","x","width","height","onMouseenter"],Z=["width","height","rx"],ee=["onClick"],te={style:{display:"flex","flex-direction":"row","align-items":"center",gap:"4px","justify-content":"center"}},le=["height","width"],oe=["fill"],ae={key:4,ref:"source",dir:"auto"},re={__name:"vue-ui-sparkstackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(P,{emit:D}){const u=P,{vue_ui_sparkstackbar:L}=a.useConfig(),F=e.useSlots();e.onMounted(()=>{F["chart-background"]&&console.warn("VueUiSparkStackbar does not support the #chart-background slot.")});const x=e.computed(()=>!!u.dataset&&u.dataset.length),B=e.ref(null),S=e.ref(a.createUid()),b=e.ref(!1),_=e.ref(""),t=e.computed({get:()=>$(),set:l=>l});function $(){const l=V.useNestedProp({userConfig:u.config,defaultConfig:L});return l.theme?{...V.useNestedProp({userConfig:a.themes.vue_ui_sparkstackbar[l.theme]||u.config,defaultConfig:l}),customPalette:a.themePalettes[l.theme]||a.palette}:l}e.watch(()=>u.config,l=>{t.value=$(),E()},{deep:!0}),e.watch(()=>u.dataset,l=>{v.value=u.dataset.map((n,o)=>({...n,color:n.color?a.convertColorToHex(n.color):f.value[o]||a.palette[o]||a.palette[o%a.palette.length]}))},{deep:!0});const f=e.computed(()=>a.convertCustomPalette(t.value.customPalette)),v=e.ref(u.dataset.map((l,n)=>({...l,value:t.value.style.animation.show?0:l.value||0,color:l.color?a.convertColorToHex(l.color):f.value[n]||a.palette[n]||a.palette[n%a.palette.length]}))),g=e.ref(!0);e.onMounted(()=>{if(E(),t.value.style.animation.show){let p=function(){r+=o/l,r<o?(v.value=v.value.map((s,i)=>({...s,value:s.value+=n[i],color:s.color?a.convertColorToHex(s.color):f.value[i]||a.palette[i]||a.palette[i%a.palette.length]})),requestAnimationFrame(p)):(g.value=!1,v.value=u.dataset.map((s,i)=>({...s,value:s.value||0,color:s.color?a.convertColorToHex(s.color):f.value[i]||a.palette[i]||a.palette[i%a.palette.length],id:a.createUid()})))};const l=t.value.style.animation.animationFrames,n=u.dataset.map((s,i)=>s.value/l),o=u.dataset.map(s=>s.value||0).reduce((s,i)=>s+i,0);let r=0;g.value=!0,p()}});function E(){a.objectIsEmpty(u.dataset)?a.error({componentName:"VueUiSparkStackbar",type:"dataset"}):u.dataset.forEach((l,n)=>{a.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","value"]}).forEach(o=>{a.error({componentName:"VueUiSparkStackbar",type:"datasetSerieAttribute",property:o,index:n})})})}const c=e.ref({width:500,height:16}),d=e.ref([]),N=e.computed(()=>u.dataset.map(l=>l.value||0).filter((l,n)=>!d.value.includes(n)).reduce((l,n)=>l+n,0)),y=e.computed(()=>v.value.map((l,n)=>{const o=l.value||0,r=o/N.value,p=isNaN(r)?0:r,s=p*c.value.width;return{...l,value:o,proportion:p,width:s,proportionLabel:a.dataLabel({v:p*100,s:"%",r:t.value.style.legend.percentage.rounding})}})),C=e.computed(()=>y.value.filter((l,n)=>!d.value.includes(n)));function T(l){d.value.includes(l)?d.value=d.value.filter(n=>n!==l):d.value.length<v.value.length-1&&d.value.push(l)}const h=e.computed(()=>{let l=0;const n=[];for(let o=0;o<C.value.length;o+=1)n.push({...C.value[o],start:l}),l+=C.value[o].width;return n});function z(l,n){D("selectDatapoint",{datapoint:l,index:n})}const w=e.ref(null),k=e.ref(!1),m=e.ref(null);function A({datapoint:l,seriesIndex:n}){if(!t.value.style.tooltip.show)return;w.value={datapoint:l,seriesIndex:n,config:t.value,series:y.value},b.value=!0,m.value=n;const o=t.value.style.tooltip.customFormat;if(a.isFunction(o))try{const r=o({seriesIndex:n,datapoint:l,series:y.value,config:t.value});typeof r=="string"&&(_.value=r,k.value=!0)}catch{console.warn("Custom format cannot be applied."),k.value=!1}if(!k.value){let r="";r+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${l.name}</div>`,r+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${l.color}"/></svg>`,r+=`<b>${l.proportionLabel}</b>`,r+=`<span>(${a.applyDataLabel(t.value.style.legend.value.formatter,l.value,a.dataLabel({p:t.value.style.legend.value.prefix,v:l.value,s:t.value.style.legend.value.suffix,r:t.value.style.legend.value.rounding}),{datapoint:l,seriesIndex:n})})</span>`,_.value=`<div>${r}</div>`}}return(l,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"sparkstackbarChart",ref:B,style:e.normalizeStyle(`width:100%; background:${t.value.style.backgroundColor}`)},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:calc(100% - 12px);background:transparent;margin:0 auto;margin:${t.value.style.title.margin};padding: 0 6px;text-align:${t.value.style.title.textAlign}`)},[e.createElementVNode("div",{style:e.normalizeStyle(`font-size:${t.value.style.title.fontSize}px;color:${t.value.style.title.color};font-weight:${t.value.style.title.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.text),5),t.value.style.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`font-size:${t.value.style.title.subtitle.fontSize}px;color:${t.value.style.title.subtitle.color};font-weight:${t.value.style.title.subtitle.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.subtitle.text),5)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),x.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(a.XMLNS),width:"100%",viewBox:`0 0 ${c.value.width} ${c.value.height}`},[e.createVNode(O._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{key:`stack_gradient_${r}`,gradientTransform:"rotate(90)",id:`stack_gradient_${r}_${S.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":o.color},null,8,I),e.createElementVNode("stop",{offset:"50%","stop-color":e.unref(a.setOpacity)(e.unref(a.shiftHue)(o.color,.05),100-t.value.style.bar.gradient.intensity)},null,8,R),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,W)],8,H))),128)),e.createElementVNode("clipPath",Y,[e.createElementVNode("rect",{x:"0.005",y:"-2",width:"0.99",height:"5",rx:"3",ry:"3",fill:t.value.style.backgroundColor},null,8,G)])]),N.value>0?(e.openBlock(),e.createElementBlock("g",X,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_underlayer_${r}`,x:o.start,y:0,width:o.width,height:c.value.height,fill:t.value.style.bar.gradient.underlayerColor,class:e.normalizeClass({animated:!g.value}),style:e.normalizeStyle({opacity:m.value!==null&&t.value.style.tooltip.show?m.value===r?1:.5:1})},null,14,J))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_${r}`,x:o.start,y:0,width:o.width,height:c.value.height,fill:t.value.style.bar.gradient.show?`url(#stack_gradient_${r}_${S.value})`:o.color,stroke:t.value.style.backgroundColor,"stroke-linecap":"round",class:e.normalizeClass({animated:!g.value}),style:e.normalizeStyle({opacity:m.value!==null&&t.value.style.tooltip.show?m.value===r?1:.5:1})},null,14,K))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_trap_${r}`,onClick:()=>z(o,r),x:o.start,y:0,width:o.width,height:c.value.height,fill:"transparent",stroke:"none",class:e.normalizeClass({animated:!g.value}),onMouseenter:()=>A({datapoint:o,seriesIndex:r}),onMouseleave:n[0]||(n[0]=p=>{b.value=!1,m.value=null})},null,42,Q))),128))])):(e.openBlock(),e.createElementBlock("rect",{key:1,x:2,y:1,width:c.value.width-4,height:c.value.height-2,stroke:"#CCCCCC","stroke-width":"2",fill:"transparent",rx:(c.value.height-4)/2},null,8,Z))],8,j)):e.createCommentVNode("",!0),x.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(q.default,{key:2,config:{type:"sparkStackbar",style:{backgroundColor:t.value.style.backgroundColor,sparkStackbar:{color:"#CCCCCC"}}}},null,8,["config"])),t.value.style.legend.show?(e.openBlock(),e.createElementBlock("div",{key:3,style:e.normalizeStyle(`background:transparent;margin:0 auto;margin:${t.value.style.legend.margin};justify-content:${t.value.style.legend.textAlign==="left"?"flex-start":t.value.style.legend.textAlign==="right"?"flex-end":"center"}`),class:"vue-ui-sparkstackbar-legend"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(o,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":d.value.includes(r)}),onClick:p=>{T(r),z(o,r)}},[e.createElementVNode("div",te,[(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:o.color},null,8,oe)],8,le)),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(o.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(d.value.includes(r)?" - ":o.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(a.applyDataLabel)(t.value.style.legend.value.formatter,o.value,e.unref(a.dataLabel)({p:t.value.style.legend.value.prefix,v:o.value,s:t.value.style.legend.value.suffix,r:t.value.style.legend.value.rounding}),{datapoint:o,seriesIndex:r}))+") ",5)):e.createCommentVNode("",!0)])],14,ee))),256))],4)):e.createCommentVNode("",!0),e.createVNode(U._sfc_main,{show:b.value&&t.value.style.tooltip.show,parent:B.value,backgroundColor:t.value.style.tooltip.backgroundColor,color:t.value.style.tooltip.color,fontSize:t.value.style.tooltip.fontSize,borderRadius:t.value.style.tooltip.borderRadius,borderColor:t.value.style.tooltip.borderColor,borderWidth:t.value.style.tooltip.borderWidth,backgroundOpacity:t.value.style.tooltip.backgroundOpacity,position:t.value.style.tooltip.position,content:_.value,isCustom:k.value,offsetY:-124+t.value.style.tooltip.offsetY,blockShiftY:!0},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...w.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...w.value})),void 0,!0)]),_:3},8,["show","parent","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","content","isCustom","offsetY"]),l.$slots.source?(e.openBlock(),e.createElementBlock("div",ae,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0)],4))}},ne=M._export_sfc(re,[["__scopeId","data-v-72244c73"]]);exports.default=ne;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useSlots as ne, onMounted as Y, computed as m, ref as d, watch as G, openBlock as s, createElementBlock as r, normalizeStyle as v, createElementVNode as p, toDisplayString as w, createCommentVNode as y, unref as C, createVNode as q, Fragment as x, renderList as $, normalizeClass as F, createBlock as ue, withCtx as H, renderSlot as U, normalizeProps as X, guardReactiveProps as J } from "vue";
|
|
2
|
-
import { u as ie, c as K, t as ce, a as de, p as i, d as N, b as ve, o as pe, e as Q, g as ge, f as V, X as fe, s as he, w as ye, i as Z, x as me } from "./index-
|
|
3
|
-
import { u as ee } from "./useNestedProp-
|
|
4
|
-
import ke from "./vue-ui-skeleton-
|
|
5
|
-
import { _ as be } from "./PackageVersion-
|
|
6
|
-
import { _ as _e } from "./Tooltip-
|
|
2
|
+
import { u as ie, c as K, t as ce, a as de, p as i, d as N, b as ve, o as pe, e as Q, g as ge, f as V, X as fe, s as he, w as ye, i as Z, x as me } from "./index-B7nCQFK0.js";
|
|
3
|
+
import { u as ee } from "./useNestedProp-C9rlBRTT.js";
|
|
4
|
+
import ke from "./vue-ui-skeleton-D66ZIUln.js";
|
|
5
|
+
import { _ as be } from "./PackageVersion-CENy3Lm2.js";
|
|
6
|
+
import { _ as _e } from "./Tooltip-Bkc4233T.js";
|
|
7
7
|
import { _ as we } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
8
8
|
const Ce = ["xmlns", "viewBox"], xe = ["id"], $e = ["stop-color"], Se = ["stop-color"], ze = ["stop-color"], Pe = {
|
|
9
9
|
id: "stackPill",
|