vue-data-ui 2.4.55 → 2.4.57
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-Lu-rJXGl.cjs → Arrow-BhwhLRcU.cjs} +1 -1
- package/dist/{Arrow-D9oPJhO0.js → Arrow-DelnKkT1.js} +1 -1
- package/dist/{BaseIcon-mHeKnX4-.js → BaseIcon-9gdEHMWK.js} +1 -1
- package/dist/{BaseIcon-DxRKjbz1.cjs → BaseIcon-DujPvdJ_.cjs} +1 -1
- package/dist/{DataTable-rMMvio1U.cjs → DataTable-BUflha5V.cjs} +1 -1
- package/dist/{DataTable-D8MTezlM.js → DataTable-DgbrnD__.js} +2 -2
- package/dist/{Legend-wr5XLSfL.js → Legend-HooNAKB_.js} +1 -1
- package/dist/{Legend-Ba34oTdO.cjs → Legend-V3K-4ipN.cjs} +1 -1
- package/dist/{PackageVersion-xnKIqody.js → PackageVersion-S3SzpuwC.js} +1 -1
- package/dist/{PackageVersion-BJi2ywG9.cjs → PackageVersion-dQYEsTLp.cjs} +1 -1
- package/dist/{PenAndPaper-CX6N7FR7.cjs → PenAndPaper-1h87IVla.cjs} +1 -1
- package/dist/{PenAndPaper-iek0aH4r.js → PenAndPaper-v846FwcH.js} +3 -3
- package/dist/{Shape-B_lWjwmP.js → Shape-D7aacHaz.js} +1 -1
- package/dist/{Shape-9v-w5i6N.cjs → Shape-DV5sH0dX.cjs} +1 -1
- package/dist/{Slicer--m1nOwbO.cjs → Slicer-BRxR5OYL.cjs} +1 -1
- package/dist/{Slicer-Bwg4WzZf.js → Slicer-BXCORSCz.js} +2 -2
- package/dist/{Title-BWhYDGb-.cjs → Title-B-EsW0Q2.cjs} +1 -1
- package/dist/{Title-BecmraNn.js → Title-DLjHHdyq.js} +1 -1
- package/dist/{Tooltip-cPxZzSgr.cjs → Tooltip-B7gYRLGN.cjs} +1 -1
- package/dist/{Tooltip-BZYApG0d.js → Tooltip-BDaa-67h.js} +1 -1
- package/dist/{index-Dhlyke5j.js → index-CI-N9klv.js} +5 -1
- package/dist/index-o6tXRhOr.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-C9KmUVBy.cjs → useNestedProp-D-zaZbSR.cjs} +1 -1
- package/dist/{useNestedProp-D9eTQKze.js → useNestedProp-D1eJ0dvv.js} +1 -1
- package/dist/{usePrinter-BnBk8gnl.js → usePrinter-CXc8xCKk.js} +1 -1
- package/dist/{usePrinter-DpEuGyLP.cjs → usePrinter-H2UFIe6n.cjs} +1 -1
- package/dist/{vue-data-ui-CGGZHtx3.cjs → vue-data-ui-CvfX2D1d.cjs} +1 -1
- package/dist/{vue-data-ui-aSR5-7gp.js → vue-data-ui-DuXblXhF.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-D9pXx9fJ.js → vue-ui-3d-bar-fvTVGk8O.js} +9 -9
- package/dist/{vue-ui-3d-bar-Dm2wnS6e.cjs → vue-ui-3d-bar-zKUnnMOY.cjs} +1 -1
- package/dist/{vue-ui-accordion-CGpOsWNN.js → vue-ui-accordion-CYLks1fW.js} +3 -3
- package/dist/{vue-ui-accordion-mtZIFAv9.cjs → vue-ui-accordion-paZXh-GD.cjs} +1 -1
- package/dist/{vue-ui-age-pyramid-BcMERmA5.cjs → vue-ui-age-pyramid-Bg8Bexac.cjs} +1 -1
- package/dist/{vue-ui-age-pyramid-dbX4WaaY.js → vue-ui-age-pyramid-Ch3nY1Dx.js} +10 -10
- package/dist/{vue-ui-annotator-CY-rCEDB.cjs → vue-ui-annotator-BXbLcJ1L.cjs} +1 -1
- package/dist/{vue-ui-annotator-DfRkh1D_.js → vue-ui-annotator-DGupSF-o.js} +1 -1
- package/dist/{vue-ui-bullet-CUoiQcb5.js → vue-ui-bullet-BSRXabBe.js} +8 -8
- package/dist/{vue-ui-bullet-jsXAmYsX.cjs → vue-ui-bullet-DqM9h81O.cjs} +1 -1
- package/dist/{vue-ui-candlestick-BD58hsql.cjs → vue-ui-candlestick-C0PkovyK.cjs} +1 -1
- package/dist/{vue-ui-candlestick-BLIICgdz.js → vue-ui-candlestick-Dww4XHwQ.js} +11 -11
- package/dist/vue-ui-carousel-table-BZs-sxxu.js +396 -0
- package/dist/vue-ui-carousel-table-DbXCpYUm.cjs +1 -0
- package/dist/{vue-ui-chestnut-vivMozHy.cjs → vue-ui-chestnut-Be4Lagdr.cjs} +1 -1
- package/dist/{vue-ui-chestnut-DIPBJ5D2.js → vue-ui-chestnut-CnupXXAM.js} +8 -8
- package/dist/{vue-ui-cursor-CzLtzn7N.js → vue-ui-cursor-oqfOA98Q.js} +2 -2
- package/dist/{vue-ui-cursor-Cgv_2p2T.cjs → vue-ui-cursor-smlBNiGG.cjs} +1 -1
- package/dist/{vue-ui-dashboard-DqZVcLlQ.js → vue-ui-dashboard-BNu7yNYm.js} +2 -2
- package/dist/{vue-ui-dashboard-CtlrjFxl.cjs → vue-ui-dashboard-Dw_90R29.cjs} +1 -1
- package/dist/{vue-ui-digits-e1HQVXb9.cjs → vue-ui-digits-_8FbgFrI.cjs} +1 -1
- package/dist/{vue-ui-digits-CGFznMkY.js → vue-ui-digits-qztPrOEN.js} +2 -2
- package/dist/{vue-ui-donut-z2eOcEI5.cjs → vue-ui-donut-B7orj3vV.cjs} +1 -1
- package/dist/{vue-ui-donut-DmLq2iWK.js → vue-ui-donut-CK9dINFS.js} +11 -11
- package/dist/{vue-ui-donut-evolution-4odFZbUM.cjs → vue-ui-donut-evolution-BmTzjKlH.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-DpollzkH.js → vue-ui-donut-evolution-DpDpYw3f.js} +11 -11
- package/dist/{vue-ui-dumbbell-i7E-B6zN.cjs → vue-ui-dumbbell-5yfcA-Of.cjs} +1 -1
- package/dist/{vue-ui-dumbbell-DLr4Lh3u.js → vue-ui-dumbbell-Dx1I89N9.js} +10 -10
- package/dist/{vue-ui-flow-BuYhmRed.cjs → vue-ui-flow-Bar7LG9t.cjs} +1 -1
- package/dist/{vue-ui-flow-CosxAYPJ.js → vue-ui-flow-DJNqydD1.js} +9 -9
- package/dist/{vue-ui-funnel-BNPISgC0.cjs → vue-ui-funnel-lxHehCUr.cjs} +1 -1
- package/dist/{vue-ui-funnel-C_2YAtFj.js → vue-ui-funnel-mP8ftcS5.js} +8 -8
- package/dist/{vue-ui-galaxy-D1cWyHG9.js → vue-ui-galaxy-3cOLS6lh.js} +11 -11
- package/dist/{vue-ui-galaxy-DMOx2Le7.cjs → vue-ui-galaxy-B8zbGikp.cjs} +1 -1
- package/dist/{vue-ui-gauge-Dw7QvZei.cjs → vue-ui-gauge-Bz1nzveF.cjs} +1 -1
- package/dist/{vue-ui-gauge-Dnq0t_eH.js → vue-ui-gauge-CN_zo833.js} +7 -7
- package/dist/{vue-ui-gizmo-DcT9tTS-.cjs → vue-ui-gizmo-C9XQ-7Sj.cjs} +1 -1
- package/dist/{vue-ui-gizmo-vHQVGdpR.js → vue-ui-gizmo-akkNcCWf.js} +3 -3
- package/dist/{vue-ui-heatmap-CtxQI5Mq.js → vue-ui-heatmap-B3ClLioV.js} +10 -10
- package/dist/{vue-ui-heatmap-D-r7qdj0.cjs → vue-ui-heatmap-BW6dmp8j.cjs} +1 -1
- package/dist/{vue-ui-history-plot-BjcPvcaK.js → vue-ui-history-plot-C-EqVFW-.js} +11 -11
- package/dist/{vue-ui-history-plot-B8pP20QN.cjs → vue-ui-history-plot-Mp0zDeR-.cjs} +1 -1
- package/dist/{vue-ui-kpi-BjuKXuQM.js → vue-ui-kpi-C-axCKZx.js} +3 -3
- package/dist/{vue-ui-kpi-BPwU5pay.cjs → vue-ui-kpi-D8hh3p8f.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-DE2NXywp.cjs → vue-ui-mini-loader-Cal5W_q6.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-DZYw7bD6.js → vue-ui-mini-loader-CsZ1zxJz.js} +2 -2
- package/dist/{vue-ui-molecule-A3yHt8cl.js → vue-ui-molecule-BvNh7REY.js} +11 -11
- package/dist/{vue-ui-molecule-B8I4iuBQ.cjs → vue-ui-molecule-RkdIX-iW.cjs} +1 -1
- package/dist/{vue-ui-mood-radar-Dh1qbcXz.js → vue-ui-mood-radar-C7v4dBNw.js} +11 -11
- package/dist/{vue-ui-mood-radar-BKtVVOZz.cjs → vue-ui-mood-radar-DLpDoq0G.cjs} +1 -1
- package/dist/{vue-ui-nested-donuts-B5ixdGsx.cjs → vue-ui-nested-donuts-BO249_PV.cjs} +1 -1
- package/dist/{vue-ui-nested-donuts-DPuIU4IX.js → vue-ui-nested-donuts-C08kpvMd.js} +11 -11
- package/dist/{vue-ui-onion-BTMaTU2a.cjs → vue-ui-onion-BjNQgHPX.cjs} +1 -1
- package/dist/{vue-ui-onion-BgcJBzxI.js → vue-ui-onion-CTLBemDj.js} +11 -11
- package/dist/{vue-ui-parallel-coordinate-plot-Cye2V8MQ.cjs → vue-ui-parallel-coordinate-plot-CoeVi-98.cjs} +1 -1
- package/dist/{vue-ui-parallel-coordinate-plot-Ksh3Tuvx.js → vue-ui-parallel-coordinate-plot-H1FdP6AE.js} +12 -12
- package/dist/{vue-ui-quadrant-DOet5Q47.cjs → vue-ui-quadrant-D701bdNz.cjs} +1 -1
- package/dist/{vue-ui-quadrant-DGBXeeOe.js → vue-ui-quadrant-Dd-LDy4T.js} +12 -12
- package/dist/{vue-ui-quick-chart-DQcck_x6.js → vue-ui-quick-chart-BeNivWrg.js} +9 -9
- package/dist/{vue-ui-quick-chart-DhCA-7B5.cjs → vue-ui-quick-chart-CRNEkxoM.cjs} +1 -1
- package/dist/{vue-ui-radar-qk20LKHr.cjs → vue-ui-radar-3W9NRklj.cjs} +1 -1
- package/dist/{vue-ui-radar-CI5egNer.js → vue-ui-radar-D9U_vOad.js} +12 -12
- package/dist/{vue-ui-rating-Ch2PSMeW.js → vue-ui-rating-B7AlAqCY.js} +2 -2
- package/dist/{vue-ui-rating-CYhvKLSi.cjs → vue-ui-rating-DeuaL_cU.cjs} +1 -1
- package/dist/{vue-ui-relation-circle-t-WDgqtA.cjs → vue-ui-relation-circle-B8JtK-JM.cjs} +1 -1
- package/dist/{vue-ui-relation-circle-G6KC4zs0.js → vue-ui-relation-circle-CT23BNcW.js} +7 -7
- package/dist/{vue-ui-rings-NIIfGve4.js → vue-ui-rings-BZ7FYYxr.js} +11 -11
- package/dist/{vue-ui-rings-DxpkXXwJ.cjs → vue-ui-rings-CZCTLghE.cjs} +1 -1
- package/dist/{vue-ui-scatter-BqxcKjb2.js → vue-ui-scatter-DMr8OrC3.js} +12 -12
- package/dist/{vue-ui-scatter-DynxMn7l.cjs → vue-ui-scatter-DlA0xU5U.cjs} +1 -1
- package/dist/{vue-ui-screenshot-BUP9G_uK.cjs → vue-ui-screenshot-BFV1qEsF.cjs} +1 -1
- package/dist/{vue-ui-screenshot-DreZMmrO.js → vue-ui-screenshot-DHiX35pR.js} +1 -1
- package/dist/{vue-ui-skeleton-D_lU-hWK.cjs → vue-ui-skeleton-BIWgLDDf.cjs} +1 -1
- package/dist/{vue-ui-skeleton-DQqwDUqP.js → vue-ui-skeleton-owIhXtQF.js} +3 -3
- package/dist/{vue-ui-smiley-AGwF1X7u.cjs → vue-ui-smiley-BISneB7t.cjs} +1 -1
- package/dist/{vue-ui-smiley-CdmO39JE.js → vue-ui-smiley-CCOQ6zjo.js} +2 -2
- package/dist/{vue-ui-spark-trend-BUx5YwEZ.js → vue-ui-spark-trend-B56DI3Mc.js} +5 -5
- package/dist/{vue-ui-spark-trend-DD1s6Thz.cjs → vue-ui-spark-trend-lMzod-5S.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-KZd6YQwQ.js → vue-ui-sparkbar-CMkozDkx.js} +4 -4
- package/dist/{vue-ui-sparkbar-mlrF_QEO.cjs → vue-ui-sparkbar-DcdDLl8l.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-B4J8ZYzs.cjs → vue-ui-sparkgauge-BhwNRzrD.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-Db-d9x9r.js → vue-ui-sparkgauge-De06LRPj.js} +4 -4
- package/dist/{vue-ui-sparkhistogram-B61JDza9.js → vue-ui-sparkhistogram-CBDd7jIn.js} +5 -5
- package/dist/{vue-ui-sparkhistogram-DzJ5NNi9.cjs → vue-ui-sparkhistogram-D00ahrgs.cjs} +1 -1
- package/dist/{vue-ui-sparkline-P6ubVgp0.js → vue-ui-sparkline-BJejWvTN.js} +4 -4
- package/dist/{vue-ui-sparkline-S6HehQ0a.cjs → vue-ui-sparkline-CY92qVz0.cjs} +1 -1
- package/dist/{vue-ui-sparkstackbar-BDBqoeJQ.cjs → vue-ui-sparkstackbar-BjKL_6dq.cjs} +1 -1
- package/dist/{vue-ui-sparkstackbar-DKtOqh-Y.js → vue-ui-sparkstackbar-DlnmPom2.js} +5 -5
- package/dist/{vue-ui-stackbar-WShCS9A1.js → vue-ui-stackbar-19XdLQXB.js} +306 -291
- package/dist/vue-ui-stackbar-T4VBFpDo.cjs +6 -0
- package/dist/{vue-ui-strip-plot-Bq3u8k2l.js → vue-ui-strip-plot-Bly8GoNP.js} +11 -11
- package/dist/{vue-ui-strip-plot-DH4LQTfB.cjs → vue-ui-strip-plot-CtjbMamo.cjs} +1 -1
- package/dist/{vue-ui-table-sJN2rS51.js → vue-ui-table-BUF6Pyfp.js} +1 -1
- package/dist/{vue-ui-table-aV4pHrWD.cjs → vue-ui-table-BisPh85-.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-DsdyE14x.js → vue-ui-table-heatmap-By-MmFiq.js} +4 -4
- package/dist/{vue-ui-table-heatmap-CruECEYA.cjs → vue-ui-table-heatmap-CPn-jC0n.cjs} +1 -1
- package/dist/{vue-ui-table-sparkline-CcsNg6th.cjs → vue-ui-table-sparkline-CIDuWZZs.cjs} +1 -1
- package/dist/{vue-ui-table-sparkline-BlUe2QFV.js → vue-ui-table-sparkline-DG70UNkU.js} +5 -5
- package/dist/{vue-ui-thermometer-ButIh820.cjs → vue-ui-thermometer-CMvk1D7J.cjs} +1 -1
- package/dist/{vue-ui-thermometer-80aa72_6.js → vue-ui-thermometer-Vr2IP_p0.js} +7 -7
- package/dist/{vue-ui-timer-CuUSpISM.js → vue-ui-timer-CD7gFOjN.js} +5 -5
- package/dist/{vue-ui-timer-Dk4I7cRn.cjs → vue-ui-timer-CUHgN89f.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-CQ98xHZ5.js → vue-ui-tiremarks-44pO3jx1.js} +7 -7
- package/dist/{vue-ui-tiremarks-BsYfeNCN.cjs → vue-ui-tiremarks-w_gxHFeB.cjs} +1 -1
- package/dist/{vue-ui-treemap-CHXb8mBG.cjs → vue-ui-treemap-CFhTEaxa.cjs} +1 -1
- package/dist/{vue-ui-treemap-s1nZAhAS.js → vue-ui-treemap-CyOUM3-P.js} +11 -11
- package/dist/{vue-ui-vertical-bar-iZWowEik.cjs → vue-ui-vertical-bar-C51RKLB8.cjs} +1 -1
- package/dist/{vue-ui-vertical-bar-Dd306Z10.js → vue-ui-vertical-bar-wngOp0Zc.js} +11 -11
- package/dist/{vue-ui-waffle-BJgSuNVY.cjs → vue-ui-waffle-CXZc4t27.cjs} +1 -1
- package/dist/{vue-ui-waffle-CQfOCZjf.js → vue-ui-waffle-CuN7i0ci.js} +11 -11
- package/dist/{vue-ui-wheel-DB-4Rn84.js → vue-ui-wheel-B_gLugLx.js} +7 -7
- package/dist/{vue-ui-wheel-s8UTbo9G.cjs → vue-ui-wheel-u9Vc7ZTZ.cjs} +1 -1
- package/dist/{vue-ui-word-cloud-C-l2Z3Dd.js → vue-ui-word-cloud-DKHGS0my.js} +10 -10
- package/dist/{vue-ui-word-cloud-DvfOJe4M.cjs → vue-ui-word-cloud-tSXyXvd6.cjs} +1 -1
- package/dist/{vue-ui-xy-P_VLOaMg.js → vue-ui-xy-BK9R8MrJ.js} +14 -14
- package/dist/{vue-ui-xy-D1Nkk2Gp.cjs → vue-ui-xy-bX3g4COC.cjs} +1 -1
- package/dist/{vue-ui-xy-canvas-BwNEs-cY.js → vue-ui-xy-canvas-DaT4HoWD.js} +11 -11
- package/dist/{vue-ui-xy-canvas-CIKl9AXf.cjs → vue-ui-xy-canvas-gDaRsnBI.cjs} +1 -1
- package/package.json +1 -1
- package/dist/index-DGcOW0vL.cjs +0 -9
- package/dist/vue-ui-carousel-table-CCmB_BJ7.cjs +0 -1
- package/dist/vue-ui-carousel-table-NUliqwxA.js +0 -379
- package/dist/vue-ui-stackbar-DCCcEgQZ.cjs +0 -6
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useCssVars as me, computed as d, onMounted as ke, ref as g, watch as be, openBlock as l, createElementBlock as n, normalizeClass as P, normalizeStyle as ee, unref as c, createBlock as F, createCommentVNode as i, createSlots as xe, withCtx as I, renderSlot as p, normalizeProps as G, guardReactiveProps as W, createVNode as _e, createElementVNode as v, Fragment as O, renderList as te, toDisplayString as we } from "vue";
|
|
2
|
-
import { u as Ce, o as $e, e as se, g as Pe, c as Fe, t as Ie, a as Oe, p as x, b as Ae, v as f, d as A, X as Me, s as Ue, i as Ye, f as Ne } from "./index-
|
|
3
|
-
import { _ as Se } from "./Title-
|
|
4
|
-
import { u as Te, U as qe } from "./usePrinter-
|
|
5
|
-
import Le from "./vue-ui-skeleton-
|
|
6
|
-
import { u as oe } from "./useNestedProp-
|
|
7
|
-
import { _ as Ve } from "./PackageVersion-
|
|
8
|
-
import { P as Ge } from "./PenAndPaper-
|
|
2
|
+
import { u as Ce, o as $e, e as se, g as Pe, c as Fe, t as Ie, a as Oe, p as x, b as Ae, v as f, d as A, X as Me, s as Ue, i as Ye, f as Ne } from "./index-CI-N9klv.js";
|
|
3
|
+
import { _ as Se } from "./Title-DLjHHdyq.js";
|
|
4
|
+
import { u as Te, U as qe } from "./usePrinter-CXc8xCKk.js";
|
|
5
|
+
import Le from "./vue-ui-skeleton-owIhXtQF.js";
|
|
6
|
+
import { u as oe } from "./useNestedProp-D1eJ0dvv.js";
|
|
7
|
+
import { _ as Ve } from "./PackageVersion-S3SzpuwC.js";
|
|
8
|
+
import { P as Ge } from "./PenAndPaper-v846FwcH.js";
|
|
9
9
|
import { u as We } from "./useUserOptionState-BIvW1Kz7.js";
|
|
10
10
|
import { _ as Ee } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
11
11
|
const ze = ["id"], Be = {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ref as n, onMounted as Q, onBeforeUnmount as Y, computed as z, watch as Z, openBlock as l, createElementBlock as r, normalizeStyle as f, createBlock as ee, createCommentVNode as v, unref as te, createVNode as M, createElementVNode as C, mergeProps as V, renderSlot as O, normalizeProps as U, guardReactiveProps as E, toDisplayString as ae } from "vue";
|
|
2
|
-
import { u as se } from "./useNestedProp-
|
|
3
|
-
import { u as le, c as oe, X as re, F as W } from "./index-
|
|
2
|
+
import { u as se } from "./useNestedProp-D1eJ0dvv.js";
|
|
3
|
+
import { u as le, c as oe, X as re, F as W } from "./index-CI-N9klv.js";
|
|
4
4
|
import { t as ue, u as ie } from "./useResponsive-CoxXLe23.js";
|
|
5
|
-
import P from "./BaseIcon-
|
|
6
|
-
import { _ as ne } from "./Title-
|
|
7
|
-
import { _ as ce } from "./PackageVersion-
|
|
5
|
+
import P from "./BaseIcon-9gdEHMWK.js";
|
|
6
|
+
import { _ as ne } from "./Title-DLjHHdyq.js";
|
|
7
|
+
import { _ as ce } from "./PackageVersion-S3SzpuwC.js";
|
|
8
8
|
import { _ as de } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
9
9
|
class he {
|
|
10
10
|
constructor(A, k, T, H = !0, x = !0) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),L=require("./useNestedProp-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),L=require("./useNestedProp-D-zaZbSR.cjs"),g=require("./index-o6tXRhOr.cjs"),$=require("./useResponsive-BJ7DTGpm.cjs"),B=require("./BaseIcon-DujPvdJ_.cjs"),j=require("./Title-B-EsW0Q2.cjs"),q=require("./PackageVersion-dQYEsTLp.cjs"),O=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");class U{constructor(T,v,y,E=!0,b=!0){this.interval=v,this.elapsed=0,this.isPaused=!1;const S=`
|
|
2
2
|
let interval;
|
|
3
3
|
let elapsed = 0;
|
|
4
4
|
let paused = false;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { computed as h, ref as p, watch as W, onMounted as ce, openBlock as s, createElementBlock as c, normalizeClass as U, normalizeStyle as G, unref as n, createBlock as I, createCommentVNode as y, createSlots as ve, withCtx as F, renderSlot as b, normalizeProps as L, guardReactiveProps as j, createVNode as he, Fragment as Z, renderList as ee, toDisplayString as de } from "vue";
|
|
2
|
-
import { u as te } from "./useNestedProp-
|
|
3
|
-
import { u as fe, c as pe, t as ye, v as me, o as ge, e as ke, w as ae, X as be, i as _e, f as Ce } from "./index-
|
|
4
|
-
import { _ as $e } from "./Title-
|
|
5
|
-
import { u as we, U as xe } from "./usePrinter-
|
|
6
|
-
import Pe from "./vue-ui-skeleton-
|
|
7
|
-
import { _ as Oe } from "./PackageVersion-
|
|
8
|
-
import { P as Ae } from "./PenAndPaper-
|
|
2
|
+
import { u as te } from "./useNestedProp-D1eJ0dvv.js";
|
|
3
|
+
import { u as fe, c as pe, t as ye, v as me, o as ge, e as ke, w as ae, X as be, i as _e, f as Ce } from "./index-CI-N9klv.js";
|
|
4
|
+
import { _ as $e } from "./Title-DLjHHdyq.js";
|
|
5
|
+
import { u as we, U as xe } from "./usePrinter-CXc8xCKk.js";
|
|
6
|
+
import Pe from "./vue-ui-skeleton-owIhXtQF.js";
|
|
7
|
+
import { _ as Oe } from "./PackageVersion-S3SzpuwC.js";
|
|
8
|
+
import { P as Ae } from "./PenAndPaper-v846FwcH.js";
|
|
9
9
|
import { u as Ie } from "./useUserOptionState-BIvW1Kz7.js";
|
|
10
10
|
import { _ as Fe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
11
11
|
const ze = ["id"], Se = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),L=require("./useNestedProp-C9KmUVBy.cjs"),c=require("./index-DGcOW0vL.cjs"),K=require("./Title-BWhYDGb-.cjs"),G=require("./usePrinter-DpEuGyLP.cjs"),Q=require("./vue-ui-skeleton-D_lU-hWK.cjs"),W=require("./PackageVersion-BJi2ywG9.cjs"),Z=require("./PenAndPaper-CX6N7FR7.cjs"),ee=require("./useUserOptionState-BgepsfED.cjs"),te=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ae=["id"],oe={key:2,style:"width:100%;background:transparent;padding-bottom:12px"},le=["xmlns","viewBox"],re={key:0},ne=["d","stroke-width","stroke"],se={key:1},ue=["x1","y1","x2","y2","stroke-width","stroke"],ie=["x","y","font-size","fill","font-weight","text-anchor"],ce={key:5,class:"vue-data-ui-watermark"},ve={key:6,ref:"source",dir:"auto"},de={__name:"vue-ui-tiremarks",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(j,{expose:H}){const v=j,{vue_ui_tiremarks:D}=c.useConfig(),P=e.computed(()=>!!v.dataset&&Object.keys(v.dataset).length),$=e.ref(c.createUid()),B=e.ref(null),R=e.ref(null),O=e.ref(0),A=e.ref(0),t=e.computed({get:()=>I(),set:a=>a}),{userOptionsVisible:x,setUserOptionsVisibility:z,keepUserOptionState:N}=ee.useUserOptionState({config:t.value});function I(){const a=L.useNestedProp({userConfig:v.config,defaultConfig:D});return a.theme?{...L.useNestedProp({userConfig:c.themes.vue_ui_tiremarks[a.theme]||v.config,defaultConfig:a})}:a}e.watch(()=>v.config,a=>{t.value=I(),x.value=!t.value.showOnChartHover,M(),A.value+=1},{deep:!0});const{isPrinting:F,isImaging:E,generatePdf:V,generateImage:q}=G.usePrinter({elementId:$.value,fileName:t.value.style.chart.title.text||"vue-ui-tiremarks"}),X=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),s=e.ref(t.value.style.chart.animation.use?0:c.checkNaN(v.dataset.percentage));e.watch(()=>v.dataset,a=>{t.value.style.chart.animation.use?T(a.percentage):s.value=a.percentage||0},{deep:!0}),e.onMounted(()=>{M()});function T(a){let n=t.value.style.chart.animation.speed;const o=Math.abs(a-s.value)/(n*120);function r(){s.value<a?s.value=Math.min(s.value+o,a):s.value>a&&(s.value=Math.max(s.value-o,a)),s.value!==a&&requestAnimationFrame(r)}r()}function M(){c.objectIsEmpty(v.dataset)&&c.error({componentName:"VueUiTiremarks",type:"dataset"}),T(v.dataset.percentage||0)}const f=e.computed(()=>t.value.style.chart.layout.display==="vertical"),u=e.computed(()=>{const a={top:48,left:64,right:64,bottom:48};return f.value?{top:t.value.style.chart.percentage.verticalPosition==="top"?a.top:3,left:3,right:3,bottom:t.value.style.chart.percentage.verticalPosition==="bottom"?a.bottom:3}:{top:0,bottom:0,left:t.value.style.chart.percentage.horizontalPosition==="left"?a.left:3,right:t.value.style.chart.percentage.horizontalPosition==="right"?a.right:10}}),C=e.computed(()=>Object.values(u.value).reduce((a,n)=>a+n,0)),l=e.computed(()=>({height:f.value?312:56,width:f.value?56:312})),Y=e.ref(100);e.computed(()=>v.dataset.percentage/Y.value);const i=e.computed(()=>f.value?{mark:(l.value.height-C.value)/100*.5,space:(l.value.height-C.value)/100*.5}:{mark:(l.value.width-C.value)/100*.5,space:(l.value.width-C.value)/100*.5}),U=e.computed(()=>{const a=[];for(let o=0;o<100;o+=1){const r=t.value.style.chart.layout.ticks.gradient.show?c.shiftHue(t.value.style.chart.layout.activeColor,o/100*(t.value.style.chart.layout.ticks.gradient.shiftHueIntensity/100)):t.value.style.chart.layout.activeColor;if(f.value){const y=t.value.style.chart.layout.crescendo?(100-o)*(l.value.width-u.value.left-u.value.right)/100/3:0,d=u.value.left+4+y,h=l.value.width-u.value.right-4-y,p=l.value.height-u.value.bottom-o*i.value.mark-o*i.value.space-i.value.mark,m=l.value.height-u.value.bottom-o*i.value.mark-o*i.value.space-i.value.mark,k=(h-d)/t.value.style.chart.layout.curveAngleX,b=t.value.style.chart.layout.curveAngleY*((1+o)/100);a.push({x1:d,x2:h,y1:p,y2:m,curve:`M ${d} ${p} C ${d+k} ${p-b}, ${h-k} ${m-b}, ${h} ${m}`,color:r})}else{const y=t.value.style.chart.layout.crescendo?(100-o)*(l.value.height-u.value.top-u.value.bottom)/100/3:0,d=u.value.left+o*i.value.mark+o*i.value.space-i.value.mark,h=d,p=u.value.top+4+y,m=l.value.height-u.value.bottom-4-y,k=t.value.style.chart.layout.curveAngleY*((1+o)/100),b=(m-p)/t.value.style.chart.layout.curveAngleX;a.push({x1:d,x2:h,y1:p,y2:m,curve:`M ${d} ${p} C ${d+k} ${p+b}, ${h+k} ${m-b}, ${h} ${m}`,color:r})}}return a}),g=e.computed(()=>{let a,n,o;const r=t.value.style.chart.percentage.fontSize/3;return f.value?t.value.style.chart.percentage.verticalPosition==="top"?(a=l.value.width/2,n=u.value.top/2,o="middle"):t.value.style.chart.percentage.verticalPosition==="bottom"&&(a=l.value.width/2,n=l.value.height-u.value.bottom/2+r,o="middle"):t.value.style.chart.percentage.horizontalPosition==="left"?(a=4,n=l.value.height/2+r,o="start"):t.value.style.chart.percentage.horizontalPosition==="right"&&(a=l.value.width-u.value.right+8,n=l.value.height/2+r,o="start"),{x:a,y:n,textAnchor:o,bold:t.value.style.chart.percentage.bold,fontSize:t.value.style.chart.percentage.fontSize,fill:t.value.style.chart.percentage.color}}),_=e.ref(!1);function J(a){_.value=a,O.value+=1}const w=e.ref(!1);function S(){w.value=!w.value}return H({generatePdf:V,generateImage:q,toggleAnnotator:S}),(a,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tiremarksChart",ref:B,class:e.normalizeClass(`vue-ui-tiremarks ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor}`),id:$.value,onMouseenter:n[0]||(n[0]=()=>e.unref(z)(!0)),onMouseleave:n[1]||(n[1]=()=>e.unref(z)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Z.PenAndPaper,{key:0,parent:B.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:w.value,onClose:S},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),X.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:R,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",oe,[(e.openBlock(),e.createBlock(K._sfc_main,{key:`title_${A.value}`,config:{title:{cy:"wheel-title",...t.value.style.chart.title},subtitle:{cy:"wheel-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))])):e.createCommentVNode("",!0),t.value.userOptions.show&&P.value&&(e.unref(N)||e.unref(x))?(e.openBlock(),e.createBlock(G.UserOptions,{ref:"details",key:`user_options_${O.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(F),isImaging:e.unref(E),uid:$.value,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,hasXls:!1,isFullscreen:_.value,titles:{...t.value.userOptions.buttonTitles},chartElement:B.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:w.value,onToggleFullscreen:J,onGeneratePdf:e.unref(V),onGenerateImage:e.unref(q),onToggleAnnotator:S,style:e.normalizeStyle({visibility:e.unref(N)?e.unref(x)?"visible":"hidden":"visible"})},e.createSlots({_:2},[a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:r})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:r})),void 0,!0)]),key:"2"}:void 0,a.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:r})=>[e.renderSlot(a.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:r})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),P.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(c.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":_.value,"vue-data-ui-fulscreen--off":!_.value}),viewBox:`0 0 ${l.value.width} ${l.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(W._sfc_main),t.value.style.chart.layout.curved?(e.openBlock(),e.createElementBlock("g",re,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value,(o,r)=>(e.openBlock(),e.createElementBlock("path",{d:o.curve,"stroke-width":i.value.mark,stroke:s.value>=r?o.color:t.value.style.chart.layout.inactiveColor,"stroke-linecap":"round",fill:"none",class:e.normalizeClass({"vue-ui-tick-animated":t.value.style.chart.animation.use&&r<=s.value})},null,10,ne))),256))])):(e.openBlock(),e.createElementBlock("g",se,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value,(o,r)=>(e.openBlock(),e.createElementBlock("line",{x1:o.x1,y1:o.y1,x2:o.x2,y2:o.y2,"stroke-width":i.value.mark,stroke:s.value>=r?o.color:t.value.style.chart.layout.inactiveColor,"stroke-linecap":"round"},null,8,ue))),256))])),t.value.style.chart.percentage.show?(e.openBlock(),e.createElementBlock("text",{key:2,x:g.value.x,y:g.value.y,"font-size":g.value.fontSize,fill:t.value.style.chart.layout.ticks.gradient.show&&t.value.style.chart.percentage.useGradientColor?e.unref(c.shiftHue)(t.value.style.chart.layout.activeColor,s.value/100*(t.value.style.chart.layout.ticks.gradient.shiftHueIntensity/100)):t.value.style.chart.percentage.color,"font-weight":g.value.bold?"bold":"normal","text-anchor":g.value.textAnchor},e.toDisplayString(e.unref(c.applyDataLabel)(t.value.style.chart.percentage.formatter,s.value,e.unref(c.dataLabel)({v:s.value,s:"%",r:t.value.style.chart.percentage.rounding}))),9,ie)):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"svg",{svg:l.value},void 0,!0)],14,le)):e.createCommentVNode("",!0),a.$slots.watermark?(e.openBlock(),e.createElementBlock("div",ce,[e.renderSlot(a.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(F)||e.unref(E)})),void 0,!0)])):e.createCommentVNode("",!0),a.$slots.source?(e.openBlock(),e.createElementBlock("div",ve,[e.renderSlot(a.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),P.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Q.default,{key:7,config:{type:"tiremarks",style:{backgroundColor:t.value.style.chart.backgroundColor,tiremarks:{color:"#CCCCCC"}}}},null,8,["config"]))],46,ae))}},he=te._export_sfc(de,[["__scopeId","data-v-abf7fd42"]]);exports.default=he;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),L=require("./useNestedProp-D-zaZbSR.cjs"),c=require("./index-o6tXRhOr.cjs"),K=require("./Title-B-EsW0Q2.cjs"),G=require("./usePrinter-H2UFIe6n.cjs"),Q=require("./vue-ui-skeleton-BIWgLDDf.cjs"),W=require("./PackageVersion-dQYEsTLp.cjs"),Z=require("./PenAndPaper-1h87IVla.cjs"),ee=require("./useUserOptionState-BgepsfED.cjs"),te=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ae=["id"],oe={key:2,style:"width:100%;background:transparent;padding-bottom:12px"},le=["xmlns","viewBox"],re={key:0},ne=["d","stroke-width","stroke"],se={key:1},ue=["x1","y1","x2","y2","stroke-width","stroke"],ie=["x","y","font-size","fill","font-weight","text-anchor"],ce={key:5,class:"vue-data-ui-watermark"},ve={key:6,ref:"source",dir:"auto"},de={__name:"vue-ui-tiremarks",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(j,{expose:H}){const v=j,{vue_ui_tiremarks:D}=c.useConfig(),P=e.computed(()=>!!v.dataset&&Object.keys(v.dataset).length),$=e.ref(c.createUid()),B=e.ref(null),R=e.ref(null),O=e.ref(0),A=e.ref(0),t=e.computed({get:()=>I(),set:a=>a}),{userOptionsVisible:x,setUserOptionsVisibility:z,keepUserOptionState:N}=ee.useUserOptionState({config:t.value});function I(){const a=L.useNestedProp({userConfig:v.config,defaultConfig:D});return a.theme?{...L.useNestedProp({userConfig:c.themes.vue_ui_tiremarks[a.theme]||v.config,defaultConfig:a})}:a}e.watch(()=>v.config,a=>{t.value=I(),x.value=!t.value.showOnChartHover,M(),A.value+=1},{deep:!0});const{isPrinting:F,isImaging:E,generatePdf:V,generateImage:q}=G.usePrinter({elementId:$.value,fileName:t.value.style.chart.title.text||"vue-ui-tiremarks"}),X=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),s=e.ref(t.value.style.chart.animation.use?0:c.checkNaN(v.dataset.percentage));e.watch(()=>v.dataset,a=>{t.value.style.chart.animation.use?T(a.percentage):s.value=a.percentage||0},{deep:!0}),e.onMounted(()=>{M()});function T(a){let n=t.value.style.chart.animation.speed;const o=Math.abs(a-s.value)/(n*120);function r(){s.value<a?s.value=Math.min(s.value+o,a):s.value>a&&(s.value=Math.max(s.value-o,a)),s.value!==a&&requestAnimationFrame(r)}r()}function M(){c.objectIsEmpty(v.dataset)&&c.error({componentName:"VueUiTiremarks",type:"dataset"}),T(v.dataset.percentage||0)}const f=e.computed(()=>t.value.style.chart.layout.display==="vertical"),u=e.computed(()=>{const a={top:48,left:64,right:64,bottom:48};return f.value?{top:t.value.style.chart.percentage.verticalPosition==="top"?a.top:3,left:3,right:3,bottom:t.value.style.chart.percentage.verticalPosition==="bottom"?a.bottom:3}:{top:0,bottom:0,left:t.value.style.chart.percentage.horizontalPosition==="left"?a.left:3,right:t.value.style.chart.percentage.horizontalPosition==="right"?a.right:10}}),C=e.computed(()=>Object.values(u.value).reduce((a,n)=>a+n,0)),l=e.computed(()=>({height:f.value?312:56,width:f.value?56:312})),Y=e.ref(100);e.computed(()=>v.dataset.percentage/Y.value);const i=e.computed(()=>f.value?{mark:(l.value.height-C.value)/100*.5,space:(l.value.height-C.value)/100*.5}:{mark:(l.value.width-C.value)/100*.5,space:(l.value.width-C.value)/100*.5}),U=e.computed(()=>{const a=[];for(let o=0;o<100;o+=1){const r=t.value.style.chart.layout.ticks.gradient.show?c.shiftHue(t.value.style.chart.layout.activeColor,o/100*(t.value.style.chart.layout.ticks.gradient.shiftHueIntensity/100)):t.value.style.chart.layout.activeColor;if(f.value){const y=t.value.style.chart.layout.crescendo?(100-o)*(l.value.width-u.value.left-u.value.right)/100/3:0,d=u.value.left+4+y,h=l.value.width-u.value.right-4-y,p=l.value.height-u.value.bottom-o*i.value.mark-o*i.value.space-i.value.mark,m=l.value.height-u.value.bottom-o*i.value.mark-o*i.value.space-i.value.mark,k=(h-d)/t.value.style.chart.layout.curveAngleX,b=t.value.style.chart.layout.curveAngleY*((1+o)/100);a.push({x1:d,x2:h,y1:p,y2:m,curve:`M ${d} ${p} C ${d+k} ${p-b}, ${h-k} ${m-b}, ${h} ${m}`,color:r})}else{const y=t.value.style.chart.layout.crescendo?(100-o)*(l.value.height-u.value.top-u.value.bottom)/100/3:0,d=u.value.left+o*i.value.mark+o*i.value.space-i.value.mark,h=d,p=u.value.top+4+y,m=l.value.height-u.value.bottom-4-y,k=t.value.style.chart.layout.curveAngleY*((1+o)/100),b=(m-p)/t.value.style.chart.layout.curveAngleX;a.push({x1:d,x2:h,y1:p,y2:m,curve:`M ${d} ${p} C ${d+k} ${p+b}, ${h+k} ${m-b}, ${h} ${m}`,color:r})}}return a}),g=e.computed(()=>{let a,n,o;const r=t.value.style.chart.percentage.fontSize/3;return f.value?t.value.style.chart.percentage.verticalPosition==="top"?(a=l.value.width/2,n=u.value.top/2,o="middle"):t.value.style.chart.percentage.verticalPosition==="bottom"&&(a=l.value.width/2,n=l.value.height-u.value.bottom/2+r,o="middle"):t.value.style.chart.percentage.horizontalPosition==="left"?(a=4,n=l.value.height/2+r,o="start"):t.value.style.chart.percentage.horizontalPosition==="right"&&(a=l.value.width-u.value.right+8,n=l.value.height/2+r,o="start"),{x:a,y:n,textAnchor:o,bold:t.value.style.chart.percentage.bold,fontSize:t.value.style.chart.percentage.fontSize,fill:t.value.style.chart.percentage.color}}),_=e.ref(!1);function J(a){_.value=a,O.value+=1}const w=e.ref(!1);function S(){w.value=!w.value}return H({generatePdf:V,generateImage:q,toggleAnnotator:S}),(a,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tiremarksChart",ref:B,class:e.normalizeClass(`vue-ui-tiremarks ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor}`),id:$.value,onMouseenter:n[0]||(n[0]=()=>e.unref(z)(!0)),onMouseleave:n[1]||(n[1]=()=>e.unref(z)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Z.PenAndPaper,{key:0,parent:B.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:w.value,onClose:S},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),X.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:R,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",oe,[(e.openBlock(),e.createBlock(K._sfc_main,{key:`title_${A.value}`,config:{title:{cy:"wheel-title",...t.value.style.chart.title},subtitle:{cy:"wheel-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))])):e.createCommentVNode("",!0),t.value.userOptions.show&&P.value&&(e.unref(N)||e.unref(x))?(e.openBlock(),e.createBlock(G.UserOptions,{ref:"details",key:`user_options_${O.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(F),isImaging:e.unref(E),uid:$.value,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,hasXls:!1,isFullscreen:_.value,titles:{...t.value.userOptions.buttonTitles},chartElement:B.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:w.value,onToggleFullscreen:J,onGeneratePdf:e.unref(V),onGenerateImage:e.unref(q),onToggleAnnotator:S,style:e.normalizeStyle({visibility:e.unref(N)?e.unref(x)?"visible":"hidden":"visible"})},e.createSlots({_:2},[a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:r})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:r})),void 0,!0)]),key:"2"}:void 0,a.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:r})=>[e.renderSlot(a.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:r})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),P.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(c.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":_.value,"vue-data-ui-fulscreen--off":!_.value}),viewBox:`0 0 ${l.value.width} ${l.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(W._sfc_main),t.value.style.chart.layout.curved?(e.openBlock(),e.createElementBlock("g",re,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value,(o,r)=>(e.openBlock(),e.createElementBlock("path",{d:o.curve,"stroke-width":i.value.mark,stroke:s.value>=r?o.color:t.value.style.chart.layout.inactiveColor,"stroke-linecap":"round",fill:"none",class:e.normalizeClass({"vue-ui-tick-animated":t.value.style.chart.animation.use&&r<=s.value})},null,10,ne))),256))])):(e.openBlock(),e.createElementBlock("g",se,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value,(o,r)=>(e.openBlock(),e.createElementBlock("line",{x1:o.x1,y1:o.y1,x2:o.x2,y2:o.y2,"stroke-width":i.value.mark,stroke:s.value>=r?o.color:t.value.style.chart.layout.inactiveColor,"stroke-linecap":"round"},null,8,ue))),256))])),t.value.style.chart.percentage.show?(e.openBlock(),e.createElementBlock("text",{key:2,x:g.value.x,y:g.value.y,"font-size":g.value.fontSize,fill:t.value.style.chart.layout.ticks.gradient.show&&t.value.style.chart.percentage.useGradientColor?e.unref(c.shiftHue)(t.value.style.chart.layout.activeColor,s.value/100*(t.value.style.chart.layout.ticks.gradient.shiftHueIntensity/100)):t.value.style.chart.percentage.color,"font-weight":g.value.bold?"bold":"normal","text-anchor":g.value.textAnchor},e.toDisplayString(e.unref(c.applyDataLabel)(t.value.style.chart.percentage.formatter,s.value,e.unref(c.dataLabel)({v:s.value,s:"%",r:t.value.style.chart.percentage.rounding}))),9,ie)):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"svg",{svg:l.value},void 0,!0)],14,le)):e.createCommentVNode("",!0),a.$slots.watermark?(e.openBlock(),e.createElementBlock("div",ce,[e.renderSlot(a.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(F)||e.unref(E)})),void 0,!0)])):e.createCommentVNode("",!0),a.$slots.source?(e.openBlock(),e.createElementBlock("div",ve,[e.renderSlot(a.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),P.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Q.default,{key:7,config:{type:"tiremarks",style:{backgroundColor:t.value.style.chart.backgroundColor,tiremarks:{color:"#CCCCCC"}}}},null,8,["config"]))],46,ae))}},he=te._export_sfc(de,[["__scopeId","data-v-abf7fd42"]]);exports.default=he;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-DGcOW0vL.cjs"),Ve=require("./Title-BWhYDGb-.cjs"),me=require("./usePrinter-DpEuGyLP.cjs"),Ee=require("./Tooltip-cPxZzSgr.cjs"),Le=require("./Legend-Ba34oTdO.cjs"),Re=require("./vue-ui-skeleton-D_lU-hWK.cjs"),Ae=require("./DataTable-rMMvio1U.cjs"),Fe=require("./vue-ui-accordion-mtZIFAv9.cjs"),ye=require("./useResponsive-BJ7DTGpm.cjs"),be=require("./useNestedProp-C9KmUVBy.cjs"),Ie=require("./PackageVersion-BJi2ywG9.cjs"),De=require("./PenAndPaper-CX6N7FR7.cjs"),qe=require("./useUserOptionState-BgepsfED.cjs"),He=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");function ke(n,d){const s=n.length;if(s===0)throw new Error(`Max aspect ratio cannot be computed: ${n} is an empty array`);{let u=1/0,c=-1/0,v=0;for(let f=0;f<s;f+=1){const p=n[f].normalizedValue;p<u&&(u=p),p>c&&(c=p),v+=p}return Math.max(d**2*c/v**2,v**2/(d**2*u))}}function Ce(n){const{xOffset:d,yOffset:s,width:u,height:c}=n;return{x0:d,y0:s,x1:d+u,y1:s+c}}function Me(n,d,s){if(n.length===0)return!0;{const u=n.concat(d),c=ke(n,s),v=ke(u,s);return c>=v}}function Ue(n){const d=[],s=n.length;for(let u=0;u<s;u+=1){const c=n[u],v=c.length;for(let h=0;h<v;h+=1)d.push(c[h])}return d}function We(n,d){const s={...d,children:n};return xe(s)}function Ge(n){return(n.x1-n.x0)*(n.y1-n.y0)}function we(n,d){const{width:s,height:u,xOffset:c,yOffset:v}=Y(d),h=n.length,f=n.map(g=>g.normalizedValue||0).reduce((g,k)=>g+k,0),p=f/u,C=f/s;let b=c,w=v;const m=[];if(s>=u){for(let g=0;g<h;g+=1){const k=n[g],x=w+k.normalizedValue/p,B={x0:b,y0:w,x1:b+p,y1:x},T=Object.assign({},k,B);w=x,m.push(T)}return m}else{for(let g=0;g<h;g+=1){const k=n[g],x=b+k.normalizedValue/C,B={x0:b,y0:w,x1:x,y1:w+C},T=Object.assign({},k,B);b=x,m.push(T)}return m}}function je(n){const d=Y(n),s=d.width,u=d.height;return Math.min(s,u)}function Xe(n,d){const s=n.length,u=n.map(p=>p.value??0).reduce((p,C)=>p+C,0),c=d/u,v=[];let h,f;for(let p=0;p<s;p+=1)f=n[p],h=Object.assign({},f,{normalizedValue:f.value*(c||0)}),v.push(h);return v}function Y(n){const{x0:d,y0:s,x1:u,y1:c}=n;return{xOffset:d,yOffset:s,width:u-d,height:c-s}}function Ye(n,d,s,u){let c=n,v=d,h=s,f=u;for(;;){const p=c.length;if(p===0){const m=we(v,h);return f.concat(m)}const C=je(h),b=c[0],w=c.slice(1,p);if(Me(v,b,C)){const m=v.concat(b);c=w,v=m,h=h,f=f}else{const m=v.length;let g=0;for(let T=0;T<m;T+=1)g+=v[T].normalizedValue;const k=Ze(h,g),x=we(v,h),B=f.concat(x);c=c,v=[],h=k,f=B}}}function xe(n){if(typeof n.children>"u"||!n.children.length)return[n];{const d=Xe(n.children,Ge(n)),s=Ye(d,[],n,[]),u=s.length,c=[];for(let h=0;h<u;h+=1)c.push(xe(s[h]));return Ue(c)}}function Ze(n,d){const{width:s,height:u,xOffset:c,yOffset:v}=Y(n);if(s>=u){const h=d/u,f=s-h,p={xOffset:c+h,yOffset:v,width:f,height:u};return Ce(p)}else{const h=d/s,f=u-h,p={xOffset:c,yOffset:v+h,width:s,height:f};return Ce(p)}}const Je=n=>(e.pushScopeId("data-v-9a178263"),n=n(),e.popScopeId(),n),Ke=["id"],Qe=["xmlns","viewBox"],et={key:0},tt=["id"],ot=["stop-color"],lt=["stop-color"],at=["x","y","height","width","fill","rx","stroke","stroke-width","onClick","onMouseenter"],nt=["x","y","height","width"],rt={style:{width:"100%",height:"100%"},class:"vue-ui-treemap-cell"},ut=Je(()=>e.createElementVNode("br",null,null,-1)),st={key:5,class:"vue-data-ui-watermark"},it=["onClick"],ct={key:0},dt={key:1},vt=["innerHTML"],ht={__name:"vue-ui-treemap",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(n,{expose:d,emit:s}){const u=n,{vue_ui_treemap:c}=r.useConfig(),v=e.computed(()=>!!u.dataset&&u.dataset.length),h=e.computed(()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),f=e.ref(r.createUid()),p=e.ref(!1),C=e.ref(""),b=e.ref(!1),w=e.ref(0),m=e.ref([]),g=e.ref(null),k=e.ref(null),x=e.ref(null),B=e.ref(null),T=e.ref(null),Z=e.ref(0),J=e.ref(0),K=e.ref(0),t=e.computed({get:()=>te(),set:o=>o}),{userOptionsVisible:U,setUserOptionsVisibility:Q,keepUserOptionState:ee}=qe.useUserOptionState({config:t.value});function te(){const o=be.useNestedProp({userConfig:u.config,defaultConfig:c});return o.theme?{...be.useNestedProp({userConfig:r.themes.vue_ui_treemap[o.theme]||u.config,defaultConfig:o}),customPalette:r.themePalettes[o.theme]||r.palette}:o}e.watch(()=>u.config,o=>{t.value=te(),U.value=!t.value.showOnChartHover,Z.value+=1,J.value+=1,K.value+=1},{deep:!0});const{isPrinting:oe,isImaging:le,generatePdf:ae,generateImage:ne}=me.usePrinter({elementId:`treemap_${f.value}`,fileName:t.value.style.chart.title.text||"vue-ui-treemap"}),Te=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),I=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),O=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),P=e.ref({height:t.value.style.chart.height,width:t.value.style.chart.width}),z=e.computed(()=>({bottom:P.value.height-t.value.style.chart.padding.bottom,height:P.value.height-t.value.style.chart.padding.top-t.value.style.chart.padding.bottom,left:t.value.style.chart.padding.left,right:P.value.width-t.value.style.chart.padding.right,top:t.value.style.chart.padding.top,vbHeight:P.value.height,vbWidth:P.value.width,width:P.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right}));function re(o){o.forEach((a,l)=>{a.id=r.createUid(),a.color=r.convertColorToHex(a.color)||I.value[l]||r.palette[l]||r.palette[l%r.palette.length],a.children&&(a.children.forEach(i=>{i.parentId=a.id,i.color=a.color}),re(a.children))})}const V=e.ref(u.dataset),D=e.ref(null);e.onMounted(()=>{Se()});function Se(){if(r.objectIsEmpty(u.dataset)&&r.error({componentName:"VueUiTreemap",type:"dataset"}),re(V.value),t.value.responsive){const o=ye.throttle(()=>{const{width:a,height:l}=ye.useResponsive({chart:g.value,title:t.value.style.chart.title.text?k.value:null,legend:t.value.style.chart.legend.show?x.value:null,source:B.value,noTitle:T.value});P.value.width=a,P.value.height=l});D.value=new ResizeObserver(o),D.value.observe(g.value.parentNode)}}e.onBeforeUnmount(()=>{D.value&&D.value.disconnect()});const W=e.ref(V.value),A=e.computed(()=>W.value.map((o,a)=>({...o,color:r.convertColorToHex(o.color)||I.value[a]||r.palette[a]||r.palette[a%r.palette.length]})).filter(o=>!m.value.includes(o.id))),L=e.computed(()=>V.value.filter(o=>!m.value.includes(o.id)).map(o=>o.value||0).reduce((o,a)=>o+a,0)),ue=e.computed({get(){let o=[...A.value];return t.value.style.chart.layout.sorted&&(o=[...A.value].sort((a,l)=>l.value-a.value)),o.map(a=>({...a}))},set(o){return o}});function se(o,a){return o.value/a}function $e(o,a,l){const i=t.value.style.chart.layout.rects.colorRatio-se(a,l);return r.lightenHexColor(o,i<0?0:i)}function ie(o,a,l,i){return o.map((y,_)=>{const M=$e(r.convertColorToHex(a)||I.value[_]||r.palette[_]||r.palette[_%r.palette.length],y,i),ze=se(y,i);return{...y,color:M,proportion:ze,parentName:l,children:y.children?ie(y.children,M,y.name,i):void 0}})}const F=e.computed(()=>We(ue.value.map((o,a)=>{const l=o.children?o.children.reduce((i,y)=>i+y.value,0):o.value;return{value:o.value,id:o.id,children:o.children?ie(o.children.sort((i,y)=>y.value-i.value),o.color,o.name,l):void 0,color:o.color,name:o.name}}),{x0:z.value.left*2,y0:z.value.top,x1:z.value.width,y1:z.value.height}));function ce({y0:o,y1:a}){return a-o<=0?1e-4:a-o}function de({x0:o,x1:a}){return a-o<=0?1e-4:a-o}function E(o){const a=t.value.style.chart.layout.labels.fontSize*(o.proportion*2>1?1:o.proportion*2);return a<t.value.style.chart.layout.labels.minFontSize?t.value.style.chart.layout.labels.minFontSize:a}function Ne(o){b.value=o,w.value+=1}const R=e.computed(()=>({startX:0,startY:0,width:z.value.vbWidth,height:z.value.vbHeight})),S=e.ref(!1);function G(o,a=V.value){for(const l of a){if(l.id===o)return l;if(l.children){const i=G(o,l.children);if(i)return i}}return null}function Be(o){if(S.value)s("selectDatapoint",void 0),W.value=V.value;else{if(s("selectDatapoint",o),!G(o.parentId))return;W.value=[G(o.parentId)]}S.value=!S.value}const $=e.ref(null),ve=e.computed(()=>V.value.map((o,a)=>({...o,color:r.convertColorToHex(o.color)||I.value[a]||r.palette[a]||r.palette[a%r.palette.length],shape:"square"})).sort((o,a)=>a.value-o.value).map((o,a)=>({...o,proportion:o.value/V.value.map(l=>l.value).reduce((l,i)=>l+i,0),opacity:m.value.includes(o.id)?.5:1}))),Oe=e.computed(()=>({cy:"treemap-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""}));function he(o){S.value=!1,$.value=null,m.value.includes(o.id)?m.value=m.value.filter(a=>a!==o.id):m.value.length<u.dataset.length-1&&m.value.push(o.id),s("selectLegend",ue.value)}const j=e.ref(null);function Pe({datapoint:o,seriesIndex:a}){$.value=o,j.value={datapoint:o,seriesIndex:a,config:t.value,series:A.value};const l=t.value.style.chart.tooltip.customFormat;if(r.isFunction(l)&&r.functionReturnsString(()=>l({seriesIndex:a,datapoint:o,series:A.value,config:t.value})))C.value=l({seriesIndex:a,datapoint:o,series:A.value,config:t.value});else{let i="";i+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${o.name}</div>`,i+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><rect x="0" y="0" height="12" width="12" stroke="none" fill="${o.color}"/></svg>`,i+=`<b>${r.applyDataLabel(t.value.style.chart.layout.labels.formatter,o.value,r.dataLabel({p:t.value.style.chart.layout.labels.prefix,v:o.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:o,seriesIndex:a})}</b>`,C.value=`<div>${i}</div>`}p.value=!0}const N=e.computed(()=>{const o=F.value.map(l=>({name:l.name,color:l.color})),a=F.value.map(l=>l.value);return{head:o,body:a}});function pe(){e.nextTick(()=>{const o=N.value.head.map((i,y)=>[[i.name],[N.value.body[y]],[isNaN(N.value.body[y]/L.value)?"-":N.value.body[y]/L.value*100]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(o),l=r.createCsvContent(a);r.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-treemap"})})}const q=e.computed(()=>{const o=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage],a=N.value.head.map((y,_)=>{const M=r.applyDataLabel(t.value.style.chart.layout.labels.formatter,N.value.body[_],r.dataLabel({p:t.value.style.chart.layout.labels.prefix,v:N.value.body[_],s:t.value.style.chart.layout.labels.suffix,r:t.value.table.td.roundingValue}));return[{color:y.color,name:y.name,shape:"square"},M,isNaN(N.value.body[_]/L.value)?"-":r.dataLabel({v:N.value.body[_]/L.value*100,s:"%",r:t.value.table.td.roundingPercentage})]}),l={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value],head:o,body:a,config:l}});function _e(){return F.value}function fe(){O.value.showTable=!O.value.showTable}function ge(){O.value.showTooltip=!O.value.showTooltip}const H=e.ref(!1);function X(){H.value=!H.value}return d({getData:_e,generateCsv:pe,generateImage:ne,generatePdf:ae,toggleTable:fe,toggleTooltip:ge,toggleAnnotator:X}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"treemapChart",ref:g,class:e.normalizeClass(`vue-ui-treemap ${b.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; ${t.value.responsive?"height: 100%;":""} text-align:center;background:${t.value.style.chart.backgroundColor}`),id:`treemap_${f.value}`,onMouseenter:a[3]||(a[3]=()=>e.unref(Q)(!0)),onMouseleave:a[4]||(a[4]=()=>e.unref(Q)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(De.PenAndPaper,{key:0,parent:g.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:H.value,onClose:X},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),Te.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:T,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:k,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:6px`)},[(e.openBlock(),e.createBlock(Ve._sfc_main,{key:`title_${Z.value}`,config:{title:{cy:"treemap-div-title",...t.value.style.chart.title},subtitle:{cy:"treemap-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&v.value&&(e.unref(ee)||e.unref(U))?(e.openBlock(),e.createBlock(me.UserOptions,{ref:"details",key:`user_option_${w.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(oe),isImaging:e.unref(le),uid:f.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:b.value,isTooltip:O.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:g.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:H.value,onToggleFullscreen:Ne,onGeneratePdf:e.unref(ae),onGenerateCsv:pe,onGenerateImage:e.unref(ne),onToggleTable:fe,onToggleTooltip:ge,onToggleAnnotator:X,style:e.normalizeStyle({visibility:e.unref(ee)?e.unref(U)?"visible":"hidden":"visible"})},e.createSlots({_:2},[o.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:i})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:i})),void 0,!0)]),key:"5"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:i})=>[e.renderSlot(o.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:i})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),v.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":b.value,"vue-data-ui-fulscreen--off":!b.value,"vue-data-ui-zoom-plus":!S.value,"vue-data-ui-zoom-minus":S.value}),viewBox:`${R.value.startX} ${R.value.startY} ${R.value.width<=0?10:R.value.width} ${R.value.height<=0?10:R.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: hidden; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Ie._sfc_main),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(l,i)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.chart.layout.rects.gradient.show?(e.openBlock(),e.createElementBlock("defs",et,[e.createElementVNode("radialGradient",{id:`tgrad_${l.id}`,gradientTransform:"translate(-1, -1.000001) scale(2, 2)"},[e.createElementVNode("stop",{offset:"18%","stop-color":l.color},null,8,ot),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.lightenHexColor)(l.color,t.value.style.chart.layout.rects.gradient.intensity/100)},null,8,lt)],8,tt)])):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(l,i)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:l.x0,y:l.y0,height:ce(l),width:de(l),fill:h.value?l.color:t.value.style.chart.layout.rects.gradient.show?`url(#tgrad_${l.id})`:l.color,rx:t.value.style.chart.layout.rects.borderRadius,stroke:$.value&&$.value.id===l.id?t.value.style.chart.layout.rects.selected.stroke:t.value.style.chart.layout.rects.stroke,"stroke-width":$.value&&$.value.id===l.id?t.value.style.chart.layout.rects.selected.strokeWidth:t.value.style.chart.layout.rects.strokeWidth,onClick:y=>Be(l),onMouseenter:()=>Pe({datapoint:l,seriesIndex:i}),onMouseleave:a[0]||(a[0]=y=>{$.value=null,p.value=!1}),style:e.normalizeStyle(`opacity:${$.value?$.value.id===l.id?1:t.value.style.chart.layout.rects.selected.unselectedOpacity:1}`),class:"vue-ui-treemap-rect"},null,44,at),(e.openBlock(),e.createElementBlock("foreignObject",{x:l.x0,y:l.y0,height:ce(l),width:de(l),class:"vue-ui-treemap-cell-foreignObject"},[e.createElementVNode("div",rt,[t.value.style.chart.layout.labels.showDefaultLabels&&(l.proportion>t.value.style.chart.layout.labels.hideUnderProportion||S.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vue-ui-treemap-cell-default",style:e.normalizeStyle(`width:calc(100% - ${E(l)/1.5}px);text-align:left;line-height:${E(l)<14?14:E(l)}px;padding:${E(l)/3}px; color:${e.unref(r.adaptColorToBackground)(l.color)}`)},[e.createElementVNode("span",{style:e.normalizeStyle(`width:100%;font-size:${E(l)}px;`)},e.toDisplayString(l.name),5),ut,e.createElementVNode("span",{style:e.normalizeStyle(`width:100%;font-size:${E(l)}px;`)},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.formatter,l.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.labels.prefix,v:l.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.layout.labels.rounding}),{datapoint:l})),5)],4)):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"rect",e.normalizeProps(e.guardReactiveProps({rect:l,shouldShow:l.proportion>t.value.style.chart.layout.labels.hideUnderProportion||S.value,fontSize:E(l),isZoom:S.value,textColor:e.unref(r.adaptColorToBackground)(l.color)})),void 0,!0)])],8,nt))]))),256)),e.renderSlot(o.$slots,"svg",e.normalizeProps(e.guardReactiveProps({svg:z.value,isZoom:S.value,rect:$.value,config:t.value})),void 0,!0)],14,Qe)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",st,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(oe)||e.unref(le)})),void 0,!0)])):e.createCommentVNode("",!0),v.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Re.default,{key:6,config:{type:"treemap",style:{backgroundColor:t.value.style.chart.backgroundColor,treemap:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:x},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(Le.Legend,{key:`legend_${K.value}`,legendSet:ve.value,config:Oe.value,id:`treemap_legend_${f.value}`,onClickMarker:a[1]||(a[1]=({legend:l})=>he(l))},{item:e.withCtx(({legend:l,index:i})=>[e.createElementVNode("div",{onClick:y=>he(l),style:e.normalizeStyle(`opacity:${m.value.includes(l.id)?.5:1}`)},[e.createTextVNode(e.toDisplayString(l.name)+": "+e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.formatter,l.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.labels.prefix,v:l.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:l}))+" ",1),m.value.includes(l.id)?(e.openBlock(),e.createElementBlock("span",dt," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",ct," ("+e.toDisplayString(isNaN(l.value/L.value)?"-":(l.value/L.value*100).toFixed(t.value.style.chart.legend.roundingPercentage))+"%) ",1))],12,it)]),_:1},8,["legendSet","config","id"])):e.renderSlot(o.$slots,"legend",{key:1,legend:ve.value},void 0,!0)],512),o.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:B,dir:"auto"},[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(Ee._sfc_main,{show:O.value.showTooltip&&p.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,fontSize:t.value.style.chart.tooltip.fontSize,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:g.value,content:C.value,isFullscreen:b.value,isCustom:e.unref(r.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...j.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...j.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isFullscreen","isCustom"]),v.value?(e.openBlock(),e.createBlock(Fe.default,{key:8,hideDetails:"",config:{open:O.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(Ae.DataTable,{key:`table_${J.value}`,colNames:q.value.colNames,head:q.value.head,body:q.value.body,config:q.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:a[2]||(a[2]=l=>O.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,vt)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l.name||l),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,Ke))}},pt=He._export_sfc(ht,[["__scopeId","data-v-9a178263"]]);exports.default=pt;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-o6tXRhOr.cjs"),Ve=require("./Title-B-EsW0Q2.cjs"),me=require("./usePrinter-H2UFIe6n.cjs"),Ee=require("./Tooltip-B7gYRLGN.cjs"),Le=require("./Legend-V3K-4ipN.cjs"),Re=require("./vue-ui-skeleton-BIWgLDDf.cjs"),Ae=require("./DataTable-BUflha5V.cjs"),Fe=require("./vue-ui-accordion-paZXh-GD.cjs"),ye=require("./useResponsive-BJ7DTGpm.cjs"),be=require("./useNestedProp-D-zaZbSR.cjs"),Ie=require("./PackageVersion-dQYEsTLp.cjs"),De=require("./PenAndPaper-1h87IVla.cjs"),qe=require("./useUserOptionState-BgepsfED.cjs"),He=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");function ke(n,d){const s=n.length;if(s===0)throw new Error(`Max aspect ratio cannot be computed: ${n} is an empty array`);{let u=1/0,c=-1/0,v=0;for(let f=0;f<s;f+=1){const p=n[f].normalizedValue;p<u&&(u=p),p>c&&(c=p),v+=p}return Math.max(d**2*c/v**2,v**2/(d**2*u))}}function Ce(n){const{xOffset:d,yOffset:s,width:u,height:c}=n;return{x0:d,y0:s,x1:d+u,y1:s+c}}function Me(n,d,s){if(n.length===0)return!0;{const u=n.concat(d),c=ke(n,s),v=ke(u,s);return c>=v}}function Ue(n){const d=[],s=n.length;for(let u=0;u<s;u+=1){const c=n[u],v=c.length;for(let h=0;h<v;h+=1)d.push(c[h])}return d}function We(n,d){const s={...d,children:n};return xe(s)}function Ge(n){return(n.x1-n.x0)*(n.y1-n.y0)}function we(n,d){const{width:s,height:u,xOffset:c,yOffset:v}=Y(d),h=n.length,f=n.map(g=>g.normalizedValue||0).reduce((g,k)=>g+k,0),p=f/u,C=f/s;let b=c,w=v;const m=[];if(s>=u){for(let g=0;g<h;g+=1){const k=n[g],x=w+k.normalizedValue/p,B={x0:b,y0:w,x1:b+p,y1:x},T=Object.assign({},k,B);w=x,m.push(T)}return m}else{for(let g=0;g<h;g+=1){const k=n[g],x=b+k.normalizedValue/C,B={x0:b,y0:w,x1:x,y1:w+C},T=Object.assign({},k,B);b=x,m.push(T)}return m}}function je(n){const d=Y(n),s=d.width,u=d.height;return Math.min(s,u)}function Xe(n,d){const s=n.length,u=n.map(p=>p.value??0).reduce((p,C)=>p+C,0),c=d/u,v=[];let h,f;for(let p=0;p<s;p+=1)f=n[p],h=Object.assign({},f,{normalizedValue:f.value*(c||0)}),v.push(h);return v}function Y(n){const{x0:d,y0:s,x1:u,y1:c}=n;return{xOffset:d,yOffset:s,width:u-d,height:c-s}}function Ye(n,d,s,u){let c=n,v=d,h=s,f=u;for(;;){const p=c.length;if(p===0){const m=we(v,h);return f.concat(m)}const C=je(h),b=c[0],w=c.slice(1,p);if(Me(v,b,C)){const m=v.concat(b);c=w,v=m,h=h,f=f}else{const m=v.length;let g=0;for(let T=0;T<m;T+=1)g+=v[T].normalizedValue;const k=Ze(h,g),x=we(v,h),B=f.concat(x);c=c,v=[],h=k,f=B}}}function xe(n){if(typeof n.children>"u"||!n.children.length)return[n];{const d=Xe(n.children,Ge(n)),s=Ye(d,[],n,[]),u=s.length,c=[];for(let h=0;h<u;h+=1)c.push(xe(s[h]));return Ue(c)}}function Ze(n,d){const{width:s,height:u,xOffset:c,yOffset:v}=Y(n);if(s>=u){const h=d/u,f=s-h,p={xOffset:c+h,yOffset:v,width:f,height:u};return Ce(p)}else{const h=d/s,f=u-h,p={xOffset:c,yOffset:v+h,width:s,height:f};return Ce(p)}}const Je=n=>(e.pushScopeId("data-v-9a178263"),n=n(),e.popScopeId(),n),Ke=["id"],Qe=["xmlns","viewBox"],et={key:0},tt=["id"],ot=["stop-color"],lt=["stop-color"],at=["x","y","height","width","fill","rx","stroke","stroke-width","onClick","onMouseenter"],nt=["x","y","height","width"],rt={style:{width:"100%",height:"100%"},class:"vue-ui-treemap-cell"},ut=Je(()=>e.createElementVNode("br",null,null,-1)),st={key:5,class:"vue-data-ui-watermark"},it=["onClick"],ct={key:0},dt={key:1},vt=["innerHTML"],ht={__name:"vue-ui-treemap",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(n,{expose:d,emit:s}){const u=n,{vue_ui_treemap:c}=r.useConfig(),v=e.computed(()=>!!u.dataset&&u.dataset.length),h=e.computed(()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),f=e.ref(r.createUid()),p=e.ref(!1),C=e.ref(""),b=e.ref(!1),w=e.ref(0),m=e.ref([]),g=e.ref(null),k=e.ref(null),x=e.ref(null),B=e.ref(null),T=e.ref(null),Z=e.ref(0),J=e.ref(0),K=e.ref(0),t=e.computed({get:()=>te(),set:o=>o}),{userOptionsVisible:U,setUserOptionsVisibility:Q,keepUserOptionState:ee}=qe.useUserOptionState({config:t.value});function te(){const o=be.useNestedProp({userConfig:u.config,defaultConfig:c});return o.theme?{...be.useNestedProp({userConfig:r.themes.vue_ui_treemap[o.theme]||u.config,defaultConfig:o}),customPalette:r.themePalettes[o.theme]||r.palette}:o}e.watch(()=>u.config,o=>{t.value=te(),U.value=!t.value.showOnChartHover,Z.value+=1,J.value+=1,K.value+=1},{deep:!0});const{isPrinting:oe,isImaging:le,generatePdf:ae,generateImage:ne}=me.usePrinter({elementId:`treemap_${f.value}`,fileName:t.value.style.chart.title.text||"vue-ui-treemap"}),Te=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),I=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),O=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),P=e.ref({height:t.value.style.chart.height,width:t.value.style.chart.width}),z=e.computed(()=>({bottom:P.value.height-t.value.style.chart.padding.bottom,height:P.value.height-t.value.style.chart.padding.top-t.value.style.chart.padding.bottom,left:t.value.style.chart.padding.left,right:P.value.width-t.value.style.chart.padding.right,top:t.value.style.chart.padding.top,vbHeight:P.value.height,vbWidth:P.value.width,width:P.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right}));function re(o){o.forEach((a,l)=>{a.id=r.createUid(),a.color=r.convertColorToHex(a.color)||I.value[l]||r.palette[l]||r.palette[l%r.palette.length],a.children&&(a.children.forEach(i=>{i.parentId=a.id,i.color=a.color}),re(a.children))})}const V=e.ref(u.dataset),D=e.ref(null);e.onMounted(()=>{Se()});function Se(){if(r.objectIsEmpty(u.dataset)&&r.error({componentName:"VueUiTreemap",type:"dataset"}),re(V.value),t.value.responsive){const o=ye.throttle(()=>{const{width:a,height:l}=ye.useResponsive({chart:g.value,title:t.value.style.chart.title.text?k.value:null,legend:t.value.style.chart.legend.show?x.value:null,source:B.value,noTitle:T.value});P.value.width=a,P.value.height=l});D.value=new ResizeObserver(o),D.value.observe(g.value.parentNode)}}e.onBeforeUnmount(()=>{D.value&&D.value.disconnect()});const W=e.ref(V.value),A=e.computed(()=>W.value.map((o,a)=>({...o,color:r.convertColorToHex(o.color)||I.value[a]||r.palette[a]||r.palette[a%r.palette.length]})).filter(o=>!m.value.includes(o.id))),L=e.computed(()=>V.value.filter(o=>!m.value.includes(o.id)).map(o=>o.value||0).reduce((o,a)=>o+a,0)),ue=e.computed({get(){let o=[...A.value];return t.value.style.chart.layout.sorted&&(o=[...A.value].sort((a,l)=>l.value-a.value)),o.map(a=>({...a}))},set(o){return o}});function se(o,a){return o.value/a}function $e(o,a,l){const i=t.value.style.chart.layout.rects.colorRatio-se(a,l);return r.lightenHexColor(o,i<0?0:i)}function ie(o,a,l,i){return o.map((y,_)=>{const M=$e(r.convertColorToHex(a)||I.value[_]||r.palette[_]||r.palette[_%r.palette.length],y,i),ze=se(y,i);return{...y,color:M,proportion:ze,parentName:l,children:y.children?ie(y.children,M,y.name,i):void 0}})}const F=e.computed(()=>We(ue.value.map((o,a)=>{const l=o.children?o.children.reduce((i,y)=>i+y.value,0):o.value;return{value:o.value,id:o.id,children:o.children?ie(o.children.sort((i,y)=>y.value-i.value),o.color,o.name,l):void 0,color:o.color,name:o.name}}),{x0:z.value.left*2,y0:z.value.top,x1:z.value.width,y1:z.value.height}));function ce({y0:o,y1:a}){return a-o<=0?1e-4:a-o}function de({x0:o,x1:a}){return a-o<=0?1e-4:a-o}function E(o){const a=t.value.style.chart.layout.labels.fontSize*(o.proportion*2>1?1:o.proportion*2);return a<t.value.style.chart.layout.labels.minFontSize?t.value.style.chart.layout.labels.minFontSize:a}function Ne(o){b.value=o,w.value+=1}const R=e.computed(()=>({startX:0,startY:0,width:z.value.vbWidth,height:z.value.vbHeight})),S=e.ref(!1);function G(o,a=V.value){for(const l of a){if(l.id===o)return l;if(l.children){const i=G(o,l.children);if(i)return i}}return null}function Be(o){if(S.value)s("selectDatapoint",void 0),W.value=V.value;else{if(s("selectDatapoint",o),!G(o.parentId))return;W.value=[G(o.parentId)]}S.value=!S.value}const $=e.ref(null),ve=e.computed(()=>V.value.map((o,a)=>({...o,color:r.convertColorToHex(o.color)||I.value[a]||r.palette[a]||r.palette[a%r.palette.length],shape:"square"})).sort((o,a)=>a.value-o.value).map((o,a)=>({...o,proportion:o.value/V.value.map(l=>l.value).reduce((l,i)=>l+i,0),opacity:m.value.includes(o.id)?.5:1}))),Oe=e.computed(()=>({cy:"treemap-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""}));function he(o){S.value=!1,$.value=null,m.value.includes(o.id)?m.value=m.value.filter(a=>a!==o.id):m.value.length<u.dataset.length-1&&m.value.push(o.id),s("selectLegend",ue.value)}const j=e.ref(null);function Pe({datapoint:o,seriesIndex:a}){$.value=o,j.value={datapoint:o,seriesIndex:a,config:t.value,series:A.value};const l=t.value.style.chart.tooltip.customFormat;if(r.isFunction(l)&&r.functionReturnsString(()=>l({seriesIndex:a,datapoint:o,series:A.value,config:t.value})))C.value=l({seriesIndex:a,datapoint:o,series:A.value,config:t.value});else{let i="";i+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${o.name}</div>`,i+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><rect x="0" y="0" height="12" width="12" stroke="none" fill="${o.color}"/></svg>`,i+=`<b>${r.applyDataLabel(t.value.style.chart.layout.labels.formatter,o.value,r.dataLabel({p:t.value.style.chart.layout.labels.prefix,v:o.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:o,seriesIndex:a})}</b>`,C.value=`<div>${i}</div>`}p.value=!0}const N=e.computed(()=>{const o=F.value.map(l=>({name:l.name,color:l.color})),a=F.value.map(l=>l.value);return{head:o,body:a}});function pe(){e.nextTick(()=>{const o=N.value.head.map((i,y)=>[[i.name],[N.value.body[y]],[isNaN(N.value.body[y]/L.value)?"-":N.value.body[y]/L.value*100]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(o),l=r.createCsvContent(a);r.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-treemap"})})}const q=e.computed(()=>{const o=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage],a=N.value.head.map((y,_)=>{const M=r.applyDataLabel(t.value.style.chart.layout.labels.formatter,N.value.body[_],r.dataLabel({p:t.value.style.chart.layout.labels.prefix,v:N.value.body[_],s:t.value.style.chart.layout.labels.suffix,r:t.value.table.td.roundingValue}));return[{color:y.color,name:y.name,shape:"square"},M,isNaN(N.value.body[_]/L.value)?"-":r.dataLabel({v:N.value.body[_]/L.value*100,s:"%",r:t.value.table.td.roundingPercentage})]}),l={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value],head:o,body:a,config:l}});function _e(){return F.value}function fe(){O.value.showTable=!O.value.showTable}function ge(){O.value.showTooltip=!O.value.showTooltip}const H=e.ref(!1);function X(){H.value=!H.value}return d({getData:_e,generateCsv:pe,generateImage:ne,generatePdf:ae,toggleTable:fe,toggleTooltip:ge,toggleAnnotator:X}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"treemapChart",ref:g,class:e.normalizeClass(`vue-ui-treemap ${b.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; ${t.value.responsive?"height: 100%;":""} text-align:center;background:${t.value.style.chart.backgroundColor}`),id:`treemap_${f.value}`,onMouseenter:a[3]||(a[3]=()=>e.unref(Q)(!0)),onMouseleave:a[4]||(a[4]=()=>e.unref(Q)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(De.PenAndPaper,{key:0,parent:g.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:H.value,onClose:X},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),Te.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:T,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:k,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:6px`)},[(e.openBlock(),e.createBlock(Ve._sfc_main,{key:`title_${Z.value}`,config:{title:{cy:"treemap-div-title",...t.value.style.chart.title},subtitle:{cy:"treemap-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&v.value&&(e.unref(ee)||e.unref(U))?(e.openBlock(),e.createBlock(me.UserOptions,{ref:"details",key:`user_option_${w.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(oe),isImaging:e.unref(le),uid:f.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:b.value,isTooltip:O.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:g.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:H.value,onToggleFullscreen:Ne,onGeneratePdf:e.unref(ae),onGenerateCsv:pe,onGenerateImage:e.unref(ne),onToggleTable:fe,onToggleTooltip:ge,onToggleAnnotator:X,style:e.normalizeStyle({visibility:e.unref(ee)?e.unref(U)?"visible":"hidden":"visible"})},e.createSlots({_:2},[o.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:i})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:i})),void 0,!0)]),key:"5"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:i})=>[e.renderSlot(o.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:i})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),v.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":b.value,"vue-data-ui-fulscreen--off":!b.value,"vue-data-ui-zoom-plus":!S.value,"vue-data-ui-zoom-minus":S.value}),viewBox:`${R.value.startX} ${R.value.startY} ${R.value.width<=0?10:R.value.width} ${R.value.height<=0?10:R.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: hidden; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Ie._sfc_main),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(l,i)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.chart.layout.rects.gradient.show?(e.openBlock(),e.createElementBlock("defs",et,[e.createElementVNode("radialGradient",{id:`tgrad_${l.id}`,gradientTransform:"translate(-1, -1.000001) scale(2, 2)"},[e.createElementVNode("stop",{offset:"18%","stop-color":l.color},null,8,ot),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.lightenHexColor)(l.color,t.value.style.chart.layout.rects.gradient.intensity/100)},null,8,lt)],8,tt)])):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(l,i)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:l.x0,y:l.y0,height:ce(l),width:de(l),fill:h.value?l.color:t.value.style.chart.layout.rects.gradient.show?`url(#tgrad_${l.id})`:l.color,rx:t.value.style.chart.layout.rects.borderRadius,stroke:$.value&&$.value.id===l.id?t.value.style.chart.layout.rects.selected.stroke:t.value.style.chart.layout.rects.stroke,"stroke-width":$.value&&$.value.id===l.id?t.value.style.chart.layout.rects.selected.strokeWidth:t.value.style.chart.layout.rects.strokeWidth,onClick:y=>Be(l),onMouseenter:()=>Pe({datapoint:l,seriesIndex:i}),onMouseleave:a[0]||(a[0]=y=>{$.value=null,p.value=!1}),style:e.normalizeStyle(`opacity:${$.value?$.value.id===l.id?1:t.value.style.chart.layout.rects.selected.unselectedOpacity:1}`),class:"vue-ui-treemap-rect"},null,44,at),(e.openBlock(),e.createElementBlock("foreignObject",{x:l.x0,y:l.y0,height:ce(l),width:de(l),class:"vue-ui-treemap-cell-foreignObject"},[e.createElementVNode("div",rt,[t.value.style.chart.layout.labels.showDefaultLabels&&(l.proportion>t.value.style.chart.layout.labels.hideUnderProportion||S.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vue-ui-treemap-cell-default",style:e.normalizeStyle(`width:calc(100% - ${E(l)/1.5}px);text-align:left;line-height:${E(l)<14?14:E(l)}px;padding:${E(l)/3}px; color:${e.unref(r.adaptColorToBackground)(l.color)}`)},[e.createElementVNode("span",{style:e.normalizeStyle(`width:100%;font-size:${E(l)}px;`)},e.toDisplayString(l.name),5),ut,e.createElementVNode("span",{style:e.normalizeStyle(`width:100%;font-size:${E(l)}px;`)},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.formatter,l.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.labels.prefix,v:l.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.layout.labels.rounding}),{datapoint:l})),5)],4)):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"rect",e.normalizeProps(e.guardReactiveProps({rect:l,shouldShow:l.proportion>t.value.style.chart.layout.labels.hideUnderProportion||S.value,fontSize:E(l),isZoom:S.value,textColor:e.unref(r.adaptColorToBackground)(l.color)})),void 0,!0)])],8,nt))]))),256)),e.renderSlot(o.$slots,"svg",e.normalizeProps(e.guardReactiveProps({svg:z.value,isZoom:S.value,rect:$.value,config:t.value})),void 0,!0)],14,Qe)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",st,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(oe)||e.unref(le)})),void 0,!0)])):e.createCommentVNode("",!0),v.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Re.default,{key:6,config:{type:"treemap",style:{backgroundColor:t.value.style.chart.backgroundColor,treemap:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:x},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(Le.Legend,{key:`legend_${K.value}`,legendSet:ve.value,config:Oe.value,id:`treemap_legend_${f.value}`,onClickMarker:a[1]||(a[1]=({legend:l})=>he(l))},{item:e.withCtx(({legend:l,index:i})=>[e.createElementVNode("div",{onClick:y=>he(l),style:e.normalizeStyle(`opacity:${m.value.includes(l.id)?.5:1}`)},[e.createTextVNode(e.toDisplayString(l.name)+": "+e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.formatter,l.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.labels.prefix,v:l.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:l}))+" ",1),m.value.includes(l.id)?(e.openBlock(),e.createElementBlock("span",dt," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",ct," ("+e.toDisplayString(isNaN(l.value/L.value)?"-":(l.value/L.value*100).toFixed(t.value.style.chart.legend.roundingPercentage))+"%) ",1))],12,it)]),_:1},8,["legendSet","config","id"])):e.renderSlot(o.$slots,"legend",{key:1,legend:ve.value},void 0,!0)],512),o.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:B,dir:"auto"},[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(Ee._sfc_main,{show:O.value.showTooltip&&p.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,fontSize:t.value.style.chart.tooltip.fontSize,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:g.value,content:C.value,isFullscreen:b.value,isCustom:e.unref(r.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...j.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...j.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isFullscreen","isCustom"]),v.value?(e.openBlock(),e.createBlock(Fe.default,{key:8,hideDetails:"",config:{open:O.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(Ae.DataTable,{key:`table_${J.value}`,colNames:q.value.colNames,head:q.value.head,body:q.value.body,config:q.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:a[2]||(a[2]=l=>O.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,vt)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l.name||l),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,Ke))}},pt=He._export_sfc(ht,[["__scopeId","data-v-9a178263"]]);exports.default=pt;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { computed as k, ref as f, watch as ot, onMounted as lt, onBeforeUnmount as at, openBlock as g, createElementBlock as C, normalizeClass as Fe, normalizeStyle as R, unref as m, createBlock as E, createCommentVNode as O, createSlots as nt, withCtx as x, renderSlot as $, normalizeProps as G, guardReactiveProps as X, createVNode as Ie, Fragment as Le, renderList as Re, createElementVNode as S, toDisplayString as Y, createTextVNode as De, nextTick as st, pushScopeId as rt, popScopeId as ut } from "vue";
|
|
2
|
-
import { u as it, c as Me, t as ct, a as dt, p as T, b as vt, o as ht, e as ft, d as ae, i as ne, f as K, X as pt, l as Ve, G as Be, x as He, y as gt, q as yt, r as mt } from "./index-
|
|
3
|
-
import { _ as bt } from "./Title-
|
|
4
|
-
import { u as wt, U as kt } from "./usePrinter-
|
|
5
|
-
import { _ as Ct } from "./Tooltip-
|
|
6
|
-
import { L as $t } from "./Legend-
|
|
7
|
-
import xt from "./vue-ui-skeleton-
|
|
8
|
-
import { D as Tt } from "./DataTable-
|
|
9
|
-
import _t from "./vue-ui-accordion-
|
|
2
|
+
import { u as it, c as Me, t as ct, a as dt, p as T, b as vt, o as ht, e as ft, d as ae, i as ne, f as K, X as pt, l as Ve, G as Be, x as He, y as gt, q as yt, r as mt } from "./index-CI-N9klv.js";
|
|
3
|
+
import { _ as bt } from "./Title-DLjHHdyq.js";
|
|
4
|
+
import { u as wt, U as kt } from "./usePrinter-CXc8xCKk.js";
|
|
5
|
+
import { _ as Ct } from "./Tooltip-BDaa-67h.js";
|
|
6
|
+
import { L as $t } from "./Legend-HooNAKB_.js";
|
|
7
|
+
import xt from "./vue-ui-skeleton-owIhXtQF.js";
|
|
8
|
+
import { D as Tt } from "./DataTable-DgbrnD__.js";
|
|
9
|
+
import _t from "./vue-ui-accordion-CYLks1fW.js";
|
|
10
10
|
import { t as Ot, u as St } from "./useResponsive-CoxXLe23.js";
|
|
11
|
-
import { u as Ue } from "./useNestedProp-
|
|
12
|
-
import { _ as Nt } from "./PackageVersion-
|
|
13
|
-
import { P as zt } from "./PenAndPaper-
|
|
11
|
+
import { u as Ue } from "./useNestedProp-D1eJ0dvv.js";
|
|
12
|
+
import { _ as Nt } from "./PackageVersion-S3SzpuwC.js";
|
|
13
|
+
import { P as zt } from "./PenAndPaper-v846FwcH.js";
|
|
14
14
|
import { u as Pt } from "./useUserOptionState-BIvW1Kz7.js";
|
|
15
15
|
import { _ as At } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
16
16
|
function We(a, i) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-o6tXRhOr.cjs"),pe=require("./useResponsive-BJ7DTGpm.cjs"),Pe=require("./Title-B-EsW0Q2.cjs"),ye=require("./usePrinter-H2UFIe6n.cjs"),ze=require("./Tooltip-B7gYRLGN.cjs"),ge=require("./Legend-V3K-4ipN.cjs"),De=require("./vue-ui-skeleton-BIWgLDDf.cjs"),Fe=require("./BaseIcon-DujPvdJ_.cjs"),Oe=require("./vue-ui-accordion-paZXh-GD.cjs"),fe=require("./useNestedProp-D-zaZbSR.cjs"),Me=require("./PackageVersion-dQYEsTLp.cjs"),Ie=require("./PenAndPaper-1h87IVla.cjs"),Ae=require("./useUserOptionState-BgepsfED.cjs"),Re=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),qe=["id"],Ue=["onClick"],He=["xmlns","viewBox"],Xe=["id"],je=["stop-color"],Ge=["stop-color"],We=["x","y","width","height","fill","rx"],Ye=["x","y","width","height","fill","rx","stroke","stroke-width"],Ke=["x2","y1","y2","stroke","stroke-width"],Je=["x1","x2","y1","y2","stroke","stroke-width"],Qe=["x","y","text-anchor","font-size","fill","font-weight"],Ze=["x","y","font-size","fill","font-weight"],et=["x","y","font-size","fill","font-weight"],tt=["x","y","font-size","fill","font-weight"],lt=["y","width","height","fill","onMouseenter"],at={key:6,class:"vue-data-ui-watermark"},ot=["onClick"],nt={style:"width:100%;padding-top: 36px;position:relative"},rt={class:"vue-ui-data-table"},ut={key:0},st={style:{width:"100%"}},it=["data-cell"],ct={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},dt=["data-cell"],vt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},ht=["data-cell"],pt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},yt=["data-cell"],gt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},ft=["data-cell"],bt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},mt=["data-cell"],kt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Ct=["data-cell"],_t={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},xt={__name:"vue-ui-vertical-bar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(be,{expose:me,emit:ke}){const y=be;e.useCssVars(l=>({e2a35dee:l.tdo}));const{vue_ui_vertical_bar:Ce}=n.useConfig(),B=e.computed(()=>!!y.dataset&&y.dataset.length),C=e.ref(n.createUid()),_e=e.ref(null),D=e.ref(!1),F=e.ref(""),E=e.ref(0),xe=e.ref(null),U=e.ref(0),N=e.ref(null),H=e.ref(null),O=e.ref(null),X=e.ref(null),j=e.ref(null),G=e.ref(0),M=e.ref(0),t=e.computed({get:()=>K(),set:l=>l}),{userOptionsVisible:I,setUserOptionsVisibility:W,keepUserOptionState:Y}=Ae.useUserOptionState({config:t.value});function K(){const l=fe.useNestedProp({userConfig:y.config,defaultConfig:Ce});return l.theme?{...fe.useNestedProp({userConfig:n.themes.vue_ui_vertical_bar[l.theme]||y.config,defaultConfig:l}),customPalette:n.themePalettes[l.theme]||n.palette}:l}e.watch(()=>y.config,l=>{t.value=K(),I.value=!t.value.showOnChartHover,oe(),G.value+=1,M.value+=1,s.value=t.value.style.chart.layout.bars.height,c.value=t.value.style.chart.layout.bars.gap},{deep:!0}),e.watch(()=>y.dataset,P,{deep:!0});const{isPrinting:J,isImaging:Q,generatePdf:Z,generateImage:ee}=ye.usePrinter({elementId:`vue-ui-vertical-bar_${C.value}`,fileName:t.value.style.chart.title.text||"vue-ui-vertical-bar"}),Ne=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),te=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),le=e.ref(null),ae=e.ref(!1),we=e.computed(()=>t.value.table.responsiveBreakpoint),L=e.ref(null);e.onMounted(()=>{oe()});function oe(){if(n.objectIsEmpty(y.dataset)&&n.error({componentName:"VueUiVerticalBar",type:"dataset"}),E.value=y.dataset.flatMap(l=>l.children&&l.children.length>0?l.children.length:1).reduce((l,o)=>l+o,0),$e(),t.value.responsive){const l=pe.throttle(()=>{const{width:o,height:a}=pe.useResponsive({chart:N.value,title:t.value.style.chart.title.text?H.value:null,legend:t.value.style.chart.legend.show?O.value:null,source:X.value,noTitle:j.value});ue.value=o,s.value=a/E.value-c.value*2});L.value=new ResizeObserver(l),L.value.observe(N.value.parentNode)}}e.onBeforeUnmount(()=>{L.value&&L.value.disconnect()});function $e(){new ResizeObserver(o=>{o.forEach(a=>{ae.value=a.contentRect.width<we.value})}).observe(le.value)}const p=e.ref({showTable:t.value.table.show,sortDesc:t.value.style.chart.layout.bars.sort==="desc",showTooltip:t.value.style.chart.tooltip.show}),ne=e.computed(()=>p.value.sortDesc),_=e.computed(()=>(y.dataset.forEach((l,o)=>{!l.value&&!l.children&&n.error({componentName:"VueUiVerticalBar",type:"datasetAttributeEmpty",property:`value (index ${o})`}),l.children&&(n.objectIsEmpty(l.children)?n.error({componentName:"VueUiVerticalBar",type:"datasetAttributeEmpty",property:`children (index ${o})`}):l.children.forEach((a,r)=>{[null,void 0].includes(a.name)&&n.error({componentName:"VueUiVerticalBar",type:"datasetSerieAttribute",property:"name",key:"children",index:r})}))}),y.dataset.map((l,o)=>{const a=`vertical_parent_${o}_${C.value}`,r=l.children&&l.children.length>0,v=n.checkNaN(l.value?l.value:r?l.children.map(h=>h.value||0).reduce((h,m)=>h+m,0):0),i=v>=0?1:-1;return{...l,id:a,shape:"square",opacity:f.value.includes(a)?.5:1,value:Math.abs(v),sign:i,hasChildren:r,isChild:!1,segregate:()=>V(a),isSegregated:f.value.includes(a),color:n.convertColorToHex(l.color)||te.value[o]||n.palette[o]||n.palette[o%n.palette.length],children:!l.children||!l.children.length?[]:l.children.toSorted((h,m)=>ne.value?m.value-h.value:h.value-m.value).map((h,m)=>({...h,value:n.checkNaN(Math.abs(h.value)),sign:h.value>=0?1:-1,isChild:!0,parentId:a,parentName:l.name,parentValue:v,parentSign:i,id:`vertical_child_${o}_${m}_${C.value}`,childIndex:m,color:n.convertColorToHex(h.color)||n.convertColorToHex(l.color)||te.value[o]||n.palette[o]||n.palette[o%n.palette.length]})).map((h,m)=>({...h,isFirstChild:m===0,isLastChild:m===l.children.length-1}))}}).toSorted((l,o)=>ne.value?o.value-l.value:l.value-o.value))),re=e.computed(()=>({cy:"vertical-bar-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),s=e.ref(t.value.style.chart.layout.bars.height),c=e.ref(t.value.style.chart.layout.bars.gap),Se=e.computed(()=>(s.value+c.value)*E.value),ue=e.ref(512),d=e.computed(()=>({width:ue.value,height:Se.value,padding:{top:12,left:128+t.value.style.chart.layout.bars.offsetX,right:64+t.value.style.chart.layout.bars.paddingRight,bottom:12}})),u=e.computed(()=>({fullHeight:d.value.padding.top+d.value.padding.bottom+d.value.height,top:d.value.padding.top,left:d.value.padding.left,right:d.value.width-d.value.padding.right,bottom:d.value.padding.top+d.value.height,width:d.value.width-(d.value.padding.left+d.value.padding.right)}));function P(){E.value=x.value.flatMap(l=>l.children&&l.children.length>0?l.children.length:1).reduce((l,o)=>l+o,0)}const f=e.ref([]);function V(l){f.value.includes(l)?f.value=f.value.filter(o=>o!==l):f.value.push(l),P(),ke("selectLegend",x.value)}const x=e.computed(()=>_.value.filter(l=>!f.value.includes(l.id))),b=e.computed(()=>x.value.map(l=>Math.abs(l.value)).reduce((l,o)=>l+o,0));function se(l,o=!1,a=0){return o?n.dataLabel({v:n.checkNaN(Math.abs(l)/b.value*100),s:"%",r:a}):Math.abs(l)/b.value}const w=e.computed(()=>x.value.flatMap(l=>l.hasChildren?l.children:l)),$=e.computed(()=>w.value.map(l=>l.sign).includes(-1)),Ve=e.computed(()=>Math.max(...x.value.flatMap(l=>l.children&&l.children.length?Math.max(...l.children.map(o=>o.value)):l.value)));function k(l){const o=l/Ve.value;return u.value.width/($.value?2:1)*o}function Te(l){return k(l)+u.value.left}function T(l,o){const a=x.value.find(i=>i.id===l.parentId),r=u.value.top+(c.value+s.value)*o,v=a.children.length*(c.value+s.value);return{y:r+v/2-t.value.style.chart.layout.bars.parentLabels.fontSize,name:a.name,value:[void 0,NaN,null].includes(a.value)?"":a.sign===1?a.value:-a.value,percentageToTotal:isNaN(a.value/b.value)?"":se(a.value,!0,t.value.style.chart.layout.bars.dataLabels.percentage.roundingPercentage),sign:a.sign}}function Be(){return x.value}const A=e.ref(null),R=e.ref(null);function Ee(l,o){R.value={datapoint:l,seriesIndex:o,series:_.value,config:t.value},D.value=!0,A.value=l.id;let a="";const r=l.isChild?l.parentName:l.name,v=l.isChild?l.name:"",i=t.value.style.chart.tooltip.customFormat;n.isFunction(i)&&n.functionReturnsString(()=>i({datapoint:l,series:_.value,config:t.value,seriesIndex:o}))?F.value=i({datapoint:l,series:_.value,config:t.value,seriesIndex:o}):(a+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;text-align:left;">
|
|
2
2
|
<div style="display:flex;align-items:center;gap:4px;"><svg viewBox="0 0 12 12" height="14" width="14"><rect x="0" y="0" height="12" width="12" rx="2" stroke="none" fill="${l.color}"/></svg> ${r}</div>
|
|
3
3
|
${v?`<div>${v}</div>`:""}
|
|
4
4
|
</div>`,t.value.style.chart.tooltip.showValue&&(a+=`<div>${t.value.translations.value}: <b>${n.applyDataLabel(t.value.style.chart.layout.bars.dataLabels.value.formatter,l.sign===1?l.value:-l.value,n.dataLabel({p:t.value.style.chart.tooltip.prefix,v:l.sign===1?l.value:-l.value,s:t.value.style.chart.tooltip.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:l,seriesIndex:o})}</b></div>`),t.value.style.chart.tooltip.showPercentage&&(a+=`<div>${t.value.translations.percentageToTotal} : <b>${n.dataLabel({v:Math.abs(l.value)/b.value*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage})}</b></div>`,l.isChild&&(a+=`<div>${t.value.translations.percentageToSerie}: <b>${n.dataLabel({v:Math.abs(l.value)/Math.abs(l.parentValue)*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage})}</b></div>`)),F.value=`<div style="text-align:left">${a}</div>`)}function ie(l,o,a,r){if(!t.value.style.chart.layout.bars.dataLabels.value.show)return"";const v=n.applyDataLabel(t.value.style.chart.layout.bars.dataLabels.value.formatter,n.checkNaN(r===-1&&l>=0?-l:l),n.dataLabel({p:t.value.style.chart.layout.bars.dataLabels.value.prefix,v:n.checkNaN(r===-1&&l>=0?-l:l),s:t.value.style.chart.layout.bars.dataLabels.value.suffix,r:t.value.style.chart.layout.bars.dataLabels.value.roundingValue}),{datapoint:o,seriesIndex:a}),i=`(${se(l,!0,t.value.style.chart.layout.bars.dataLabels.percentage.roundingPercentage)})`;return`${v}${t.value.style.chart.layout.bars.dataLabels.percentage.show?` ${i}`:""}`}const g=e.computed(()=>{const l=[t.value.translations.parentName,t.value.translations.value,t.value.translations.percentageToTotal,t.value.translations.childName,t.value.translations.value,t.value.translations.percentageToSerie,t.value.translations.percentageToTotal],o=w.value.map(a=>a.isChild?a.isFirstChild?{color:a.color,parentName:a.parentName,parentValue:a.parentValue,percentageToTotal:a.parentValue/b.value,childName:a.name,childValue:a.sign===1?a.value:-a.value,childPercentageToParent:Math.abs(a.value)/Math.abs(a.parentValue),childPercentageToTotal:Math.abs(a.value)/b.value}:{color:"",parentName:"",parentValue:"",percentageToTotal:"",childName:a.name,childValue:a.sign===1?a.value:-a.value,childPercentageToParent:Math.abs(a.value)/Math.abs(a.parentValue),childPercentageToTotal:Math.abs(a.value)/b.value}:{color:a.color,parentName:a.name,parentValue:a.sign===1?a.value:-a.value,percentageToTotal:Math.abs(a.value)/b.value,childName:"",childValue:"",childPercentageToParent:"",childPercentageToTotal:""});return{head:l,body:o}});function ce(){const l=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[""]],o=g.value.head,a=g.value.body.map(i=>[i.parentName,i.parentValue,i.percentageToTotal,i.childName,i.childValue,i.childPercentageToParent,i.childPercentageToTotal]),r=l.concat([o]).concat(a),v=n.createCsvContent(r);n.downloadCsv({csvContent:v,title:t.value.style.chart.title.text||"vue-ui-vertical-bar"})}const S=e.ref(!1);function Le(l){S.value=l,U.value+=1}function de(){p.value.showTable=!p.value.showTable}function ve(){p.value.sortDesc=!p.value.sortDesc,P()}function he(){p.value.showTooltip=!p.value.showTooltip}const z=e.ref(!1);function q(){z.value=!z.value}return me({getData:Be,recalculateHeight:P,generatePdf:Z,generateCsv:ce,generateImage:ee,toggleTable:de,toggleSort:ve,toggleTooltip:he,toggleAnnotator:q}),(l,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-vertical-bar ${S.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),ref_key:"verticalBarChart",ref:N,id:`vue-ui-vertical-bar_${C.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height: 100%":""}`),onMouseenter:o[5]||(o[5]=()=>e.unref(W)(!0)),onMouseleave:o[6]||(o[6]=()=>e.unref(W)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Ie.PenAndPaper,{key:0,parent:N.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:z.value,onClose:q},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),Ne.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:j,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:H,style:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(Pe._sfc_main,{key:`title_${G.value}`,config:{title:{cy:"vertical-bar-div-title",...t.value.style.chart.title},subtitle:{cy:"vertical-bar-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&B.value&&(e.unref(Y)||e.unref(I))?(e.openBlock(),e.createBlock(ye.UserOptions,{ref_key:"details",ref:_e,key:`user_options_${U.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(Q),isPrinting:e.unref(J),uid:C.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasSort:t.value.userOptions.buttons.sort,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:S.value,isTooltip:p.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:N.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:z.value,onToggleFullscreen:Le,onGeneratePdf:e.unref(Z),onGenerateCsv:ce,onGenerateImage:e.unref(ee),onToggleTable:de,onToggleSort:ve,onToggleTooltip:he,onToggleAnnotator:q,style:e.normalizeStyle({visibility:e.unref(Y)?e.unref(I)?"visible":"hidden":"visible"})},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionLabels?{name:"optionLabels",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionLabels",{},void 0,!0)]),key:"5"}:void 0,l.$slots.optionSort?{name:"optionSort",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionSort",{},void 0,!0)]),key:"6"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:r})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:r})),void 0,!0)]),key:"7"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:a,isAnnotator:r})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:a,isAnnotator:r})),void 0,!0)]),key:"8"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasSort","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),t.value.style.chart.legend.show&&t.value.style.chart.legend.position==="top"?(e.openBlock(),e.createElementBlock("div",{key:4,ref_key:"chartLegend",ref:O},[(e.openBlock(),e.createBlock(ge.Legend,{key:`legend_top_${M.value}`,legendSet:_.value,config:re.value,onClickMarker:o[0]||(o[0]=({legend:a})=>V(a.id))},{item:e.withCtx(({legend:a,index:r})=>[e.createElementVNode("div",{"data-cy-legend-item":"",onClick:v=>V(a.id),style:e.normalizeStyle(`opacity:${f.value.includes(a.id)?.5:1}`)},e.toDisplayString(a.name)+": "+e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.bars.dataLabels.value.formatter,a.value,e.unref(n.dataLabel)({p:t.value.style.chart.legend.prefix,v:a.value,s:t.value.style.chart.legend.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:a,seriesIndex:r})),13,Ue)]),_:1},8,["legendSet","config"]))],512)):e.createCommentVNode("",!0),B.value?(e.openBlock(),e.createElementBlock("svg",{key:5,xmlns:e.unref(n.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":S.value,"vue-data-ui-fulscreen--off":!S.value}),viewBox:`0 0 ${d.value.width<=0?10:d.value.width} ${u.value.fullHeight<=0?10:u.value.fullHeight}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Me._sfc_main),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(a,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{x1:"0%",y1:"0%",x2:"100%",y2:"0%",id:`vertical_bar_gradient_${C.value}_${r}`},[e.createElementVNode("stop",{offset:"0%","stop-color":a.color},null,8,je),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(n.setOpacity)(e.unref(n.shiftHue)(a.color,.03),100-t.value.style.chart.layout.bars.gradientIntensity)},null,8,Ge)],8,Xe))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(a,r)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:e.unref(n.checkNaN)($.value?u.value.left+u.value.width/2-(a.sign===1?0:k(a.value)<=0?1e-4:k(a.value)):u.value.left),y:u.value.top+(c.value+s.value)*r,width:e.unref(n.checkNaN)(k(a.value)<=0?1e-4:k(a.value)),height:s.value<=0?1e-4:s.value,fill:t.value.style.chart.layout.bars.underlayerColor,rx:t.value.style.chart.layout.bars.borderRadius,class:e.normalizeClass({animated:t.value.useCssAnimation})},null,10,We)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(a,r)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:e.unref(n.checkNaN)($.value?u.value.left+u.value.width/2-(a.sign===1?0:k(a.value)<=0?1e-4:k(a.value)):u.value.left),y:u.value.top+(c.value+s.value)*r,width:e.unref(n.checkNaN)(k(a.value)<=0?1e-4:k(a.value)),height:s.value<=0?1e-4:s.value,fill:t.value.style.chart.layout.bars.useGradient?`url(#vertical_bar_gradient_${C.value}_${r})`:e.unref(n.setOpacity)(a.color,t.value.style.chart.layout.bars.fillOpacity),rx:t.value.style.chart.layout.bars.borderRadius,stroke:t.value.style.chart.layout.bars.useStroke?a.color:"none","stroke-width":t.value.style.chart.layout.bars.useStroke?t.value.style.chart.layout.bars.strokeWidth:0,class:e.normalizeClass({animated:t.value.useCssAnimation})},null,10,Ye),(!a.isChild||a.isLastChild)&&t.value.style.chart.layout.separators.show&&r!==w.value.length-1?(e.openBlock(),e.createElementBlock("line",{key:0,x1:0,x2:u.value.left,y1:s.value+c.value/2+u.value.top+(c.value+s.value)*r,y2:s.value+c.value/2+u.value.top+(c.value+s.value)*r,stroke:t.value.style.chart.layout.separators.color,"stroke-width":t.value.style.chart.layout.separators.strokeWidth,"stroke-linecap":"round"},null,8,Ke)):e.createCommentVNode("",!0),$.value&&t.value.style.chart.layout.separators.show?(e.openBlock(),e.createElementBlock("line",{key:1,x1:u.value.left+u.value.width/2,x2:u.value.left+u.value.width/2,y1:u.value.top,y2:u.value.bottom,stroke:t.value.style.chart.layout.separators.color,"stroke-width":t.value.style.chart.layout.separators.strokeWidth,"stroke-linecap":"round"},null,8,Je)):e.createCommentVNode("",!0),e.createElementVNode("text",{x:$.value?u.value.left+u.value.width/2+(a.sign===1?-12:12)+(a.sign===1?-t.value.style.chart.layout.bars.dataLabels.offsetX:t.value.style.chart.layout.bars.dataLabels.offsetX):Te(a.value)+3+t.value.style.chart.layout.bars.dataLabels.offsetX,y:u.value.top+(c.value+s.value)*r+s.value/2+t.value.style.chart.layout.bars.dataLabels.fontSize/2,"text-anchor":!$.value||a.sign===-1?"start":"end","font-size":t.value.style.chart.layout.bars.dataLabels.fontSize,fill:t.value.style.chart.layout.bars.dataLabels.color,"font-weight":t.value.style.chart.layout.bars.dataLabels.bold?"bold":"normal"},e.toDisplayString(ie(a.value,a,r,a.sign)),9,Qe),(a.isChild||!a.hasChildren)&&t.value.style.chart.layout.bars.nameLabels.show?(e.openBlock(),e.createElementBlock("text",{key:2,"text-anchor":"end",x:u.value.left-3+t.value.style.chart.layout.bars.nameLabels.offsetX,y:u.value.top+(c.value+s.value)*r+s.value/2+t.value.style.chart.layout.bars.nameLabels.fontSize/2,"font-size":t.value.style.chart.layout.bars.nameLabels.fontSize,fill:t.value.style.chart.layout.bars.nameLabels.color,"font-weight":t.value.style.chart.layout.bars.nameLabels.bold?"bold":"normal"},e.toDisplayString(a.name),9,Ze)):e.createCommentVNode("",!0),a.isChild&&a.childIndex===0&&t.value.style.chart.layout.bars.parentLabels.show?(e.openBlock(),e.createElementBlock("text",{key:3,x:3+t.value.style.chart.layout.bars.parentLabels.offsetX,y:T(a,r).y,"font-size":t.value.style.chart.layout.bars.parentLabels.fontSize,fill:t.value.style.chart.layout.bars.parentLabels.color,"font-weight":t.value.style.chart.layout.bars.parentLabels.bold?"bold":"normal","text-anchor":"start"},e.toDisplayString(T(a,r).name),9,et)):e.createCommentVNode("",!0),a.isChild&&a.childIndex===0&&t.value.style.chart.layout.bars.parentLabels.show?(e.openBlock(),e.createElementBlock("text",{key:4,x:3+t.value.style.chart.layout.bars.parentLabels.offsetX,y:T(a,r).y+t.value.style.chart.layout.bars.parentLabels.fontSize+6,"font-size":t.value.style.chart.layout.bars.parentLabels.fontSize,fill:t.value.style.chart.layout.bars.parentLabels.color,"font-weight":t.value.style.chart.layout.bars.dataLabels.bold?"bold":"normal","text-anchor":"start"},e.toDisplayString(ie(T(a,r).value),T(a,r),r,a.parentSign||a.sign),9,tt)):e.createCommentVNode("",!0),e.createElementVNode("rect",{"data-cy-trap":"",x:0,y:u.value.top+(c.value+s.value)*r-c.value/2,width:d.value.width<=0?1e-4:d.value.width,height:s.value+c.value<=0?1e-4:s.value+c.value,fill:A.value===a.id?e.unref(n.setOpacity)(t.value.style.chart.layout.highlighter.color,t.value.style.chart.layout.highlighter.opacity):"transparent",onMouseenter:v=>Ee(a,r),onMouseleave:o[1]||(o[1]=v=>{xe.value=null,D.value=!1,A.value=null})},null,40,lt)]))),256)),e.renderSlot(l.$slots,"svg",{svg:d.value},void 0,!0)],14,He)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",at,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(J)||e.unref(Q)})),void 0,!0)])):e.createCommentVNode("",!0),B.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(De.default,{key:7,config:{type:"verticalBar",style:{backgroundColor:t.value.style.chart.backgroundColor,verticalBar:{axis:{color:"#CCCCCC"},color:"#CCCCCC"}}}},null,8,["config"])),t.value.style.chart.legend.show&&t.value.style.chart.legend.position==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:8,ref_key:"chartLegend",ref:O},[(e.openBlock(),e.createBlock(ge.Legend,{key:`legend_bottom_${M.value}`,legendSet:_.value,config:re.value,onClickMarker:o[2]||(o[2]=({legend:a})=>V(a.id))},{item:e.withCtx(({legend:a,index:r})=>[e.createElementVNode("div",{onClick:v=>V(a.id),style:e.normalizeStyle(`opacity:${f.value.includes(a.id)?.5:1}`)},e.toDisplayString(a.name)+": "+e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.bars.dataLabels.value.formatter,a.value,e.unref(n.dataLabel)({p:t.value.style.chart.legend.prefix,v:a.value,s:t.value.style.chart.legend.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:a,seriesIndex:r})),13,ot)]),_:1},8,["legendSet","config"]))],512)):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"legend",{legend:_.value},void 0,!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:9,ref_key:"source",ref:X,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(ze._sfc_main,{show:p.value.showTooltip&&D.value&&f.value.length<y.dataset.length,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,fontSize:t.value.style.chart.tooltip.fontSize,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:N.value,content:F.value,isFullscreen:S.value,isCustom:t.value.style.chart.tooltip.customFormat&&typeof t.value.style.chart.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...R.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...R.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isFullscreen","isCustom"]),B.value?(e.openBlock(),e.createBlock(Oe.default,{key:10,hideDetails:"",config:{open:p.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"tableContainer",ref:le,class:"vue-ui-vertical-bar-table"},[e.createElementVNode("div",nt,[e.createElementVNode("div",{role:"button",tabindex:"0",style:e.normalizeStyle(`width:32px; position: absolute; top: 0; right:4px; padding: 0 0px; display: flex; align-items:center;justify-content:center;height: 36px; width: 32px; cursor:pointer; background:${t.value.table.th.backgroundColor};`),onClick:o[3]||(o[3]=a=>p.value.showTable=!1),onKeypress:o[4]||(o[4]=e.withKeys(a=>p.value.showTable=!1,["enter"]))},[e.createVNode(Fe.default,{name:"close",stroke:t.value.table.th.color,"stroke-width":2},null,8,["stroke"])],36),e.createElementVNode("div",{style:{width:"100%","container-type":"inline-size"},class:e.normalizeClass({"vue-ui-responsive":ae.value})},[e.createElementVNode("table",rt,[e.createElementVNode("caption",{style:e.normalizeStyle({backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline}),class:"vue-ui-data-table__caption"},[e.createTextVNode(e.toDisplayString(t.value.style.chart.title.text)+" ",1),t.value.style.chart.title.subtitle.text?(e.openBlock(),e.createElementBlock("span",ut,e.toDisplayString(t.value.style.chart.title.subtitle.text),1)):e.createCommentVNode("",!0)],4),e.createElementVNode("thead",null,[e.createElementVNode("tr",{role:"row",style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value.head,a=>(e.openBlock(),e.createElementBlock("th",{style:e.normalizeStyle(`outline:${t.value.table.th.outline}`)},[e.createElementVNode("div",st,e.toDisplayString(a),1)],4))),256))],4),e.createElementVNode("tr",null,[e.createElementVNode("th",{style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline}`)},null,4),e.createElementVNode("th",{style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline};text-align:right;padding-right:5px;font-weight:bold`)},"∑ "+e.toDisplayString(t.value.table.td.prefix)+e.toDisplayString(isNaN(b.value)?"":b.value.toFixed(t.value.table.td.roundingValue))+e.toDisplayString(t.value.table.td.suffix),5),e.createElementVNode("th",{style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline};text-align:right;padding-right:5px;font-weight:bold`)},"100%",4),e.createElementVNode("th",{style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline}`)},null,4),e.createElementVNode("th",{style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline}`)},null,4),e.createElementVNode("th",{style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline}`)},null,4),e.createElementVNode("th",{style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline}`)},null,4)])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value.body,(a,r)=>(e.openBlock(),e.createElementBlock("tr",{class:e.normalizeClass({"vue-ui-data-table__tbody__row":!0,"vue-ui-data-table__tbody__row-even":r%2===0,"vue-ui-data-table__tbody__row-odd":r%2!==0}),style:e.normalizeStyle(`background:${t.value.table.td.backgroundColor};color:${t.value.table.td.color}`)},[e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline};font-variant-numeric: tabular-nums;`),"data-cell":g.value.head[0]??""},[e.createElementVNode("div",ct,[a.color?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(`color:${a.color};margin-right:3px`)},"⬤",4)):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(a.parentName),1)])],12,it),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":g.value.head[1]??""},[e.createElementVNode("div",vt,e.toDisplayString(t.value.table.td.prefix)+e.toDisplayString(["",NaN,void 0].includes(a.parentValue)?"":a.parentValue.toFixed(t.value.table.td.roundingValue))+e.toDisplayString(t.value.table.td.suffix),1)],12,dt),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":g.value.head[2]??""},[e.createElementVNode("div",pt,e.toDisplayString(["",NaN,void 0].includes(a.percentageToTotal)?"":`${(a.percentageToTotal*100).toFixed(t.value.table.td.roundingPercentage)}%`),1)],12,ht),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":g.value.head[3]??""},[e.createElementVNode("div",gt,e.toDisplayString(a.childName),1)],12,yt),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":g.value.head[4]??""},[e.createElementVNode("div",bt,e.toDisplayString(t.value.table.td.prefix)+e.toDisplayString(["",NaN,void 0].includes(a.childValue)?"":a.childValue.toFixed(t.value.table.td.roundingValue))+e.toDisplayString(t.value.table.td.suffix),1)],12,ft),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":g.value.head[5]??""},[e.createElementVNode("div",kt,e.toDisplayString(["",NaN,void 0].includes(a.childPercentageToParent)?"":`${(a.childPercentageToParent*100).toFixed(t.value.table.td.roundingPercentage)}%`),1)],12,mt),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":g.value.head[6]??""},[e.createElementVNode("div",_t,e.toDisplayString(["",NaN,void 0].includes(a.childPercentageToTotal)?"":`${(a.childPercentageToTotal*100).toFixed(t.value.table.td.roundingPercentage)}%`),1)],12,Ct)],6))),256))])])],2)])],512)]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,qe))}},Nt=Re._export_sfc(xt,[["__scopeId","data-v-75fe9d91"]]);exports.default=Nt;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { useCssVars as at, computed as b, ref as r, watch as Ae, onMounted as lt, onBeforeUnmount as ot, openBlock as u, createElementBlock as i, normalizeClass as U, normalizeStyle as d, unref as c, createBlock as M, createCommentVNode as y, createSlots as nt, withCtx as k, renderSlot as _, normalizeProps as G, guardReactiveProps as H, createElementVNode as n, toDisplayString as v, createVNode as ie, Fragment as W, renderList as j, withKeys as ut, createTextVNode as st } from "vue";
|
|
2
|
-
import { u as rt, c as it, t as dt, a as ct, p as z, b as vt, o as Be, e as Z, v as S, d as de, i as ee, f as I, X as ht, s as ce, w as pt, x as yt, y as gt, q as ft, r as bt } from "./index-
|
|
2
|
+
import { u as rt, c as it, t as dt, a as ct, p as z, b as vt, o as Be, e as Z, v as S, d as de, i as ee, f as I, X as ht, s as ce, w as pt, x as yt, y as gt, q as ft, r as bt } from "./index-CI-N9klv.js";
|
|
3
3
|
import { t as mt, u as _t } from "./useResponsive-CoxXLe23.js";
|
|
4
|
-
import { _ as kt } from "./Title-
|
|
5
|
-
import { u as xt, U as $t } from "./usePrinter-
|
|
6
|
-
import { _ as Ct } from "./Tooltip-
|
|
7
|
-
import { L as De } from "./Legend-
|
|
8
|
-
import wt from "./vue-ui-skeleton-
|
|
9
|
-
import Tt from "./BaseIcon-
|
|
10
|
-
import Lt from "./vue-ui-accordion-
|
|
11
|
-
import { u as Re } from "./useNestedProp-
|
|
12
|
-
import { _ as Nt } from "./PackageVersion-
|
|
13
|
-
import { P as Pt } from "./PenAndPaper-
|
|
4
|
+
import { _ as kt } from "./Title-DLjHHdyq.js";
|
|
5
|
+
import { u as xt, U as $t } from "./usePrinter-CXc8xCKk.js";
|
|
6
|
+
import { _ as Ct } from "./Tooltip-BDaa-67h.js";
|
|
7
|
+
import { L as De } from "./Legend-HooNAKB_.js";
|
|
8
|
+
import wt from "./vue-ui-skeleton-owIhXtQF.js";
|
|
9
|
+
import Tt from "./BaseIcon-9gdEHMWK.js";
|
|
10
|
+
import Lt from "./vue-ui-accordion-CYLks1fW.js";
|
|
11
|
+
import { u as Re } from "./useNestedProp-D1eJ0dvv.js";
|
|
12
|
+
import { _ as Nt } from "./PackageVersion-S3SzpuwC.js";
|
|
13
|
+
import { P as Pt } from "./PenAndPaper-v846FwcH.js";
|
|
14
14
|
import { u as St } from "./useUserOptionState-BIvW1Kz7.js";
|
|
15
15
|
import { _ as Vt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
16
16
|
const Ft = ["id"], Ot = ["onClick"], Mt = ["xmlns", "viewBox"], zt = ["id"], It = ["stop-color"], At = ["stop-color"], Bt = ["x", "y", "width", "height", "fill", "rx"], Dt = ["x", "y", "width", "height", "fill", "rx", "stroke", "stroke-width"], Rt = ["x2", "y1", "y2", "stroke", "stroke-width"], Ut = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Xt = ["x", "y", "text-anchor", "font-size", "fill", "font-weight"], Et = ["x", "y", "font-size", "fill", "font-weight"], Gt = ["x", "y", "font-size", "fill", "font-weight"], Ht = ["x", "y", "font-size", "fill", "font-weight"], Wt = ["y", "width", "height", "fill", "onMouseenter"], jt = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-DGcOW0vL.cjs"),ye=require("./useResponsive-BJ7DTGpm.cjs"),Ee=require("./Title-BWhYDGb-.cjs"),ge=require("./usePrinter-DpEuGyLP.cjs"),Ie=require("./Tooltip-cPxZzSgr.cjs"),ze=require("./DataTable-rMMvio1U.cjs"),Fe=require("./Legend-Ba34oTdO.cjs"),Oe=require("./vue-ui-skeleton-D_lU-hWK.cjs"),Ae=require("./vue-ui-accordion-mtZIFAv9.cjs"),me=require("./useNestedProp-C9KmUVBy.cjs"),De=require("./PackageVersion-BJi2ywG9.cjs"),qe=require("./PenAndPaper-CX6N7FR7.cjs"),Me=require("./useUserOptionState-BgepsfED.cjs"),Re=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),be=$=>(e.pushScopeId("data-v-1d032eba"),$=$(),e.popScopeId(),$),Ue=["id"],je=["xmlns","viewBox"],Ge=["id"],We=["stop-color"],He=["stop-color"],Ye=["id"],Xe=be(()=>e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:2},null,-1)),Je=be(()=>e.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1)),Ke=[Xe,Je],Qe=["x","y","height","width"],Ze=["height","width"],et=["rx","x","y","height","width","stroke","stroke-width","filter"],tt=["rx","x","y","height","width","fill","stroke","stroke-width","filter"],lt=["x","y","height","width","filter"],at={key:0},ot={key:1},rt={key:2},ut={key:3},nt=["onMouseover","x","y","height","width"],st={key:5,class:"vue-data-ui-watermark"},it=["onClick"],ct={key:0},vt={key:1},dt=["innerHTML"],pt={__name:"vue-ui-waffle",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup($,{expose:ke,emit:we}){const p=$,{vue_ui_waffle:Ce}=n.useConfig(),V=e.computed(()=>!!p.dataset&&p.dataset.length),b=e.ref(n.createUid()),xe=e.ref(null),O=e.ref(!1),A=e.ref(""),B=e.ref(null),j=e.ref(0),S=e.ref(null),G=e.ref(null),W=e.ref(null),H=e.ref(null),Y=e.ref(null),X=e.ref(0),J=e.ref(0),K=e.ref(0),t=e.computed({get:()=>ee(),set:l=>l}),{userOptionsVisible:D,setUserOptionsVisibility:Q,keepUserOptionState:Z}=Me.useUserOptionState({config:t.value});function ee(){const l=me.useNestedProp({userConfig:p.config,defaultConfig:Ce});return l.theme?{...me.useNestedProp({userConfig:n.themes.vue_ui_waffle[l.theme]||p.config,defaultConfig:l}),customPalette:n.themePalettes[l.theme]||n.palette}:l}e.watch(()=>p.config,l=>{t.value=ee(),D.value=!t.value.showOnChartHover,te(),X.value+=1,J.value+=1,K.value+=1},{deep:!0});const E=e.ref(null);function te(){if(n.objectIsEmpty(p.dataset)?n.error({componentName:"VueUiWaffle",type:"dataset"}):p.dataset.forEach((l,o)=>{n.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(a=>{n.error({componentName:"VueUiWaffle",type:"datasetSerieAttribute",property:a,index:o})})}),t.value.responsive){const l=ye.throttle(()=>{const{width:o,height:a}=ye.useResponsive({chart:S.value,title:t.value.style.chart.title.text?G.value:null,legend:t.value.style.chart.legend.show?W.value:null,source:H.value,noTitle:Y.value});k.value.width=o,k.value.height=a,f.value.width=o,f.value.height=a});E.value=new ResizeObserver(l),E.value.observe(S.value.parentNode)}}e.onMounted(()=>{te()}),e.onBeforeUnmount(()=>{E.value&&E.value.disconnect()});const{isPrinting:le,isImaging:ae,generatePdf:oe,generateImage:re}=ge.usePrinter({elementId:`vue-ui-waffle_${b.value}`,fileName:t.value.style.chart.title.text||"vue-ui-waffle"}),Be=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),ue=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),m=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),k=e.ref({height:512,width:512}),f=e.ref({top:0,left:0,height:512,width:512}),w=e.computed(()=>(f.value.width-t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.spaceBetween)/t.value.style.chart.layout.grid.size),C=e.computed(()=>(f.value.height-t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.spaceBetween)/t.value.style.chart.layout.grid.size),T=e.computed(()=>f.value.width/t.value.style.chart.layout.grid.size),I=e.computed(()=>f.value.height/t.value.style.chart.layout.grid.size);function ne(l){const o=t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.size,a=l.reduce((h,U)=>h+U,0),r=l.map(h=>h/a*o),u=r.map(Math.floor),i=r.map(h=>h%1);let d=o-u.reduce((h,U)=>h+U,0);for(;d>0;){let h=i.indexOf(Math.max(...i));u[h]+=1,i[h]=0,d-=1}return u}function se(){return p.dataset.map((l,o)=>({...l,color:n.convertColorToHex(l.color)||ue.value[o]||n.palette[o]||n.palette[o%n.palette.length],uid:`serie_${o}`,absoluteIndex:o}))}const ie=e.computed(()=>se()),c=e.ref(ie.value);e.watch(()=>p.dataset,l=>{c.value=se()},{deep:!0});const Se=e.computed(()=>{const l=c.value.filter((o,a)=>!v.value.includes(o.uid)).map((o,a)=>(o.values||[]).reduce((r,u)=>r+u,0));return ne(l)}),_e=e.computed(()=>{const l=c.value.map((o,a)=>(o.values||[]).reduce((r,u)=>r+u));return ne(l)}),L=e.computed(()=>(p.dataset.forEach((l,o)=>{[null,void 0].includes(l.values)&&n.error({componentName:"VueUiWaffle",type:"datasetSerieAttribute",property:"values (number[])",index:o})}),c.value.filter((l,o)=>!v.value.includes(l.uid)).map((l,o)=>({absoluteIndex:l.absoluteIndex,uid:l.uid,name:l.name,color:l.color,value:(l.values||[]).reduce((a,r)=>a+r,0),absoluteValues:l.values||[],proportion:Se.value[o]})))),Ne=e.computed(()=>c.value.map((l,o)=>({absoluteIndex:l.absoluteIndex,uid:l.uid,name:l.name,color:l.color,value:(l.values||[]).reduce((a,r)=>a+r,0),absoluteValues:l.values||[],proportion:_e.value[o]})));function $e(){return Ne.value.map(l=>({name:l.name,color:l.color,value:l.value,proportion:l.proportion}))}const Te=e.computed(()=>{let l=0;return L.value.map((o,a)=>{const r=l,u=r+o.proportion,i=[];for(let d=Math.floor(r);d<Math.floor(u);d+=1)i.push(d);return l=u,{...o,start:r,rects:i}})}),s=e.computed(()=>Te.value.flatMap((l,o)=>l.rects.map((a,r)=>({isFirst:r===0,isLongEnough:a.length>2,name:l.name,color:l.color,value:l.value,serieIndex:o,absoluteStartIndex:r<3,serieId:l.uid,...l}))).map((l,o)=>({...l,isAbsoluteFirst:o%t.value.style.chart.layout.grid.size===0}))),P=e.computed(()=>{const l=[];for(let o=0;o<t.value.style.chart.layout.grid.size;o+=1)for(let a=0;a<t.value.style.chart.layout.grid.size;a+=1)l.push({isStartOfLine:a===0,position:t.value.style.chart.layout.grid.vertical?o:a,x:(t.value.style.chart.layout.grid.vertical?o:a)*(w.value+t.value.style.chart.layout.grid.spaceBetween),y:(t.value.style.chart.layout.grid.vertical?a:o)*(C.value+t.value.style.chart.layout.grid.spaceBetween)+f.value.top});return l}),v=e.ref([]),x=e.ref(!1),ce=e.ref(null),ve=e.ref(null);function de(l){if(!t.value.useAnimation){v.value.includes(l)?v.value=v.value.filter(u=>u!==l):v.value.length<_.value.length-1&&_.value.length>1&&v.value.push(l);return}const o=ie.value.find(u=>u.uid===l).values.reduce((u,i)=>u+i,0),a=c.value.find(u=>u.uid===l).values.reduce((u,i)=>u+i,0);let r=a;if(v.value.includes(l)){let i=function(){r>u?(cancelAnimationFrame(ce.value),c.value=c.value.map((d,h)=>d.uid===l?{...d,values:[u]}:d),x.value=!1):(x.value=!0,r+=u*.025,c.value=c.value.map((d,h)=>d.uid===l?{...d,values:[r]}:d),ce.value=requestAnimationFrame(i))};v.value=v.value.filter(d=>d!==l);const u=o;i()}else if(v.value.length<_.value.length-1&&_.value.length>1){let u=function(){r<a/100?(cancelAnimationFrame(ve.value),v.value.push(l),c.value=c.value.map((i,d)=>i.uid===l?{...i,values:[0]}:i),x.value=!1):(x.value=!0,r/=1.15,c.value=c.value.map(i=>i.uid===l?{...i,values:[r]}:i),ve.value=requestAnimationFrame(u))};u()}we("selectLegend",L.value.map(u=>({name:u.name,color:u.color,value:u.value,proportion:u.proportion/Math.pow(t.value.style.chart.layout.grid.size,2)})))}const _=e.computed(()=>c.value.map((l,o)=>({name:l.name,color:l.color||ue[o]||n.palette[o]||n.palette[o%n.palette.length],value:(l.values||[]).reduce((a,r)=>a+r,0),uid:l.uid,shape:"square"})).map(l=>({...l,proportion:l.value/c.value.map(o=>(o.values||[]).reduce((a,r)=>a+r,0)).reduce((o,a)=>o+a,0),opacity:v.value.includes(l.uid)?.5:1,segregate:()=>de(l.uid),isSegregated:v.value.includes(l.uid)}))),Le=e.computed(()=>({cy:"waffle-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),y=e.computed(()=>L.value.map(l=>l.value).reduce((l,o)=>l+o,0)),q=e.ref(null);function Pe(l){if(v.value.length===p.dataset.length)return;const o=s.value[l];q.value={datapoint:o,seriesIndex:o.absoluteIndex,series:c.value,config:t.value},O.value=!0,B.value=s.value[l].serieIndex;const a=t.value.style.chart.tooltip.customFormat;if(n.isFunction(a)&&n.functionReturnsString(()=>a({seriesIndex:s.value[l].absoluteIndex,datapoint:o,series:c.value,config:t.value})))A.value=a({seriesIndex:s.value[l].absoluteIndex,datapoint:o,series:c.value,config:t.value});else{let r="";if(r+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${o.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"><rect x="0" y="0" height="12" width="12" stroke="none" rx="1" fill="${o.color}" /></svg>`,t.value.style.chart.tooltip.showValue&&(r+=`<b>${n.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,o.value,n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:o.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:o,seriesIndex:s.value[l].absoluteIndex,series:c.value})}</b>`),t.value.style.chart.tooltip.showPercentage){const u=n.dataLabel({v:o.value/y.value*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage});t.value.style.chart.tooltip.showValue?r+=`<span>(${u})</span></div>`:r+=`<b>${u}%</b></div>`}A.value=r}}const g=e.computed(()=>{const l=L.value.map(a=>({name:a.name,color:a.color})),o=L.value.map(a=>a.value);return{head:l,body:o}});function M(l){return t.value.useBlurOnHover&&![null,void 0].includes(B.value)&&B.value!==l?`url(#blur_${b.value})`:""}function pe(){e.nextTick(()=>{const l=g.value.head.map((r,u)=>[[r.name],[g.value.body[u]],[isNaN(g.value.body[u]/y.value)?"-":g.value.body[u]/y.value*100]]),o=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(l),a=n.createCsvContent(o);n.downloadCsv({csvContent:a,title:t.value.style.chart.title.text||"vue-ui-waffle"})})}const z=e.computed(()=>{const l=[' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>',n.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,y.value,n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:y.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue})),"100%"],o=g.value.head.map((u,i)=>[{color:u.color,name:u.name},n.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,g.value.body[i],n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:g.value.body[i],s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue})),isNaN(g.value.body[i]/y.value)?"-":n.dataLabel({v:g.value.body[i]/y.value*100,s:"%",r:t.value.table.td.roundingPercentage})]),a={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},shape:"square",breakpoint:t.value.table.responsiveBreakpoint},r=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage];return{head:l,body:o,config:a,colNames:r}}),N=e.ref(!1);function Ve(l){N.value=l,j.value+=1}function he(){m.value.showTable=!m.value.showTable}function fe(){m.value.showTooltip=!m.value.showTooltip}const F=e.ref(!1);function R(){F.value=!F.value}return ke({getData:$e,generatePdf:oe,generateCsv:pe,generateImage:re,toggleTable:he,toggleTooltip:fe,toggleAnnotator:R}),(l,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-waffle ${N.value?"vue-data-ui-wrapper-fullscreen":""}`),ref_key:"waffleChart",ref:S,id:`vue-ui-waffle_${b.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height: 100%":""}`),onMouseenter:o[3]||(o[3]=()=>e.unref(Q)(!0)),onMouseleave:o[4]||(o[4]=()=>e.unref(Q)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(qe.PenAndPaper,{key:0,parent:S.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:F.value,onClose:R},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),Be.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:Y,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:G,style:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(Ee._sfc_main,{key:`title_${X.value}`,config:{title:{cy:"waffle-title",...t.value.style.chart.title},subtitle:{cy:"waffle-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&V.value&&(e.unref(Z)||e.unref(D))?(e.openBlock(),e.createBlock(ge.UserOptions,{ref_key:"details",ref:xe,key:`user_options_${j.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(le),isImaging:e.unref(ae),uid:b.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:N.value,isTooltip:m.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:S.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:F.value,onToggleFullscreen:Ve,onGeneratePdf:e.unref(oe),onGenerateCsv:pe,onGenerateImage:e.unref(re),onToggleTable:he,onToggleTooltip:fe,onToggleAnnotator:R,style:e.normalizeStyle({visibility:e.unref(Z)?e.unref(D)?"visible":"hidden":"visible"})},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:r})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:r})),void 0,!0)]),key:"5"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:a,isAnnotator:r})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:a,isAnnotator:r})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),V.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(n.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":N.value,"vue-data-ui-fulscreen--off":!N.value}),viewBox:`0 0 ${k.value.width<=0?10:k.value.width} ${k.value.height<=0?10:k.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(De._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(a,r)=>(e.openBlock(),e.createElementBlock("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`gradient_${b.value}_${r}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(n.setOpacity)(e.unref(n.shiftHue)(a.color,.05),100-t.value.style.chart.layout.rect.gradientIntensity)},null,8,We),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,He)],8,Ge))),256))]),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${b.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},Ke,8,Ye)]),t.value.useCustomCells&&s.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(P.value,(a,r)=>(e.openBlock(),e.createElementBlock("foreignObject",{x:a.x,y:a.y,height:C.value<=0?1e-4:C.value,width:w.value<=0?1e-4:w.value,class:"vue-ui-waffle-custom-cell-foreignObject"},[e.renderSlot(l.$slots,"cell",e.normalizeProps(e.guardReactiveProps({cell:{...a,color:s.value[r].color,...s.value[r]},isSelected:[null,void 0].includes(B.value)?!0:s.value[r].serieIndex===B.value})),void 0,!0)],8,Qe))),256)):e.createCommentVNode("",!0),!s.value.length&&!t.value.useCustomCells?(e.openBlock(),e.createElementBlock("rect",{key:1,x:12,y:12,height:f.value.height-24,width:f.value.width-24,rx:3,fill:"none",stroke:"black"},null,8,Ze)):s.value.length&&!t.value.useCustomCells?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.value,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{rx:t.value.style.chart.layout.rect.rounded?t.value.style.chart.layout.rect.rounding:0,x:a.x+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.grid.spaceBetween/2,height:C.value<=0?1e-4:C.value,width:w.value<=0?1e-4:w.value,fill:"white",stroke:t.value.style.chart.layout.rect.stroke,"stroke-width":t.value.style.chart.layout.rect.strokeWidth,filter:M(s.value[r].serieIndex)},null,8,et))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.value,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{rx:t.value.style.chart.layout.rect.rounded?t.value.style.chart.layout.rect.rounding:0,x:a.x+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.grid.spaceBetween/2,height:C.value<=0?1e-4:C.value,width:w.value<=0?1e-4:w.value,fill:t.value.style.chart.layout.rect.useGradient&&t.value.style.chart.layout.rect.gradientIntensity>0?`url(#gradient_${b.value}_${r})`:s.value[r].color,stroke:t.value.style.chart.layout.rect.stroke,"stroke-width":t.value.style.chart.layout.rect.strokeWidth,filter:M(s.value[r].serieIndex)},null,8,tt))),256))],64)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.value,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[s.value.length&&!x.value&&!t.value.style.chart.layout.grid.vertical&&t.value.style.chart.layout.labels.captions.show&&(s.value[r].isFirst&&a.position<t.value.style.chart.layout.grid.size-2||s.value[r].isAbsoluteFirst&&r%t.value.style.chart.layout.grid.size===0&&s.value[r].absoluteStartIndex)?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:a.x+t.value.style.chart.layout.labels.captions.offsetX+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.labels.captions.offsetY+t.value.style.chart.layout.grid.spaceBetween/2,height:I.value<=0?1e-4:I.value,width:T.value*t.value.style.chart.layout.grid.size<=0?1e-4:T.value*t.value.style.chart.layout.grid.size,filter:M(s.value[r].serieIndex)},[e.createElementVNode("div",{class:"vue-ui-waffle-caption",style:e.normalizeStyle(`height: 100%; width: 100%; font-size:${t.value.style.chart.layout.labels.captions.fontSize}px;display:flex;align-items:center;justify-content:flex-start;padding: 0 ${T.value/12}px;color:${e.unref(n.adaptColorToBackground)(s.value[r].color)};gap:2px`)},[t.value.style.chart.layout.labels.captions.showSerieName?(e.openBlock(),e.createElementBlock("span",at,e.toDisplayString(t.value.style.chart.layout.labels.captions.serieNameAbbreviation?e.unref(n.abbreviate)({source:s.value[r].name,length:t.value.style.chart.layout.labels.captions.serieNameMaxAbbreviationSize}):s.value[r].name)+": ",1)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.captions.showPercentage?(e.openBlock(),e.createElementBlock("span",ot,e.toDisplayString(e.unref(n.dataLabel)({v:s.value[r].proportion,s:"%",r:t.value.style.chart.layout.labels.captions.roundingPercentage})),1)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.captions.showPercentage&&t.value.style.chart.layout.labels.captions.showValue?(e.openBlock(),e.createElementBlock("span",rt," ("+e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,s.value[r].value,e.unref(n.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:s.value[r].value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.layout.labels.captions.roundingValue}),{datapoint:s.value[r],position:a}))+") ",1)):e.createCommentVNode("",!0),!t.value.style.chart.layout.labels.captions.showPercentage&&t.value.style.chart.layout.labels.captions.showValue?(e.openBlock(),e.createElementBlock("span",ut,e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,s.value[r].value,e.unref(n.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:s.value[r].value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.layout.labels.captions.roundingValue}),{datapoint:s.value[r],position:a})),1)):e.createCommentVNode("",!0)],4)],8,lt)):e.createCommentVNode("",!0)],64))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.value,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{onMouseover:u=>Pe(r),onMouseleave:o[0]||(o[0]=u=>{O.value=!1,B.value=null}),x:a.x+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.grid.spaceBetween/2,height:I.value<=0?1e-4:I.value,width:T.value<=0?1e-4:T.value,fill:"transparent",stroke:"none"},null,40,nt))),256)),e.renderSlot(l.$slots,"svg",{svg:k.value},void 0,!0)],14,je)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",st,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(le)||e.unref(ae)})),void 0,!0)])):e.createCommentVNode("",!0),V.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Oe.default,{key:6,config:{type:"waffle",style:{backgroundColor:t.value.style.chart.backgroundColor,waffle:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:W},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(Fe.Legend,{key:`legend_${K.value}`,legendSet:_.value,config:Le.value,onClickMarker:o[1]||(o[1]=({legend:a})=>de(a.uid))},{item:e.withCtx(({legend:a})=>[e.createElementVNode("div",{onClick:r=>a.segregate(),style:e.normalizeStyle(`opacity:${v.value.includes(a.uid)?.5:1}`)},[e.createTextVNode(e.toDisplayString(a.name)+": "+e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,a.value,e.unref(n.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:a.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.legend.roundingValue,isAnimating:x.value}),{datapoint:a}))+" ",1),v.value.includes(a.uid)?(e.openBlock(),e.createElementBlock("span",vt," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",ct," ("+e.toDisplayString(isNaN(a.value/y.value)?"-":e.unref(n.dataLabel)({v:a.value/y.value*100,s:"%",r:t.value.style.chart.legend.roundingPercentage,isAnimating:x.value}))+") ",1))],12,it)]),_:1},8,["legendSet","config"])):e.renderSlot(l.$slots,"legend",{key:1,legend:_.value},void 0,!0)],512),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:H,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(Ie._sfc_main,{show:m.value.showTooltip&&O.value&&v.value.length<p.dataset.length,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:S.value,content:A.value,isCustom:t.value.style.chart.tooltip.customFormat&&typeof t.value.style.chart.tooltip.customFormat=="function",fontSize:t.value.style.chart.tooltip.fontSize,isFullscreen:N.value},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...q.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...q.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isCustom","fontSize","isFullscreen"]),V.value?(e.openBlock(),e.createBlock(Ae.default,{key:8,hideDetails:"",config:{open:m.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(ze.DataTable,{key:`table_${J.value}`,colNames:z.value.colNames,head:z.value.head,body:z.value.body,config:z.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:o[2]||(o[2]=a=>m.value.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createElementVNode("div",{innerHTML:a,style:{display:"flex","align-items":"center"}},null,8,dt)]),td:e.withCtx(({td:a})=>[e.createTextVNode(e.toDisplayString(a.name||a),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,Ue))}},ht=Re._export_sfc(pt,[["__scopeId","data-v-1d032eba"]]);exports.default=ht;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-o6tXRhOr.cjs"),ye=require("./useResponsive-BJ7DTGpm.cjs"),Ee=require("./Title-B-EsW0Q2.cjs"),ge=require("./usePrinter-H2UFIe6n.cjs"),Ie=require("./Tooltip-B7gYRLGN.cjs"),ze=require("./DataTable-BUflha5V.cjs"),Fe=require("./Legend-V3K-4ipN.cjs"),Oe=require("./vue-ui-skeleton-BIWgLDDf.cjs"),Ae=require("./vue-ui-accordion-paZXh-GD.cjs"),me=require("./useNestedProp-D-zaZbSR.cjs"),De=require("./PackageVersion-dQYEsTLp.cjs"),qe=require("./PenAndPaper-1h87IVla.cjs"),Me=require("./useUserOptionState-BgepsfED.cjs"),Re=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),be=$=>(e.pushScopeId("data-v-1d032eba"),$=$(),e.popScopeId(),$),Ue=["id"],je=["xmlns","viewBox"],Ge=["id"],We=["stop-color"],He=["stop-color"],Ye=["id"],Xe=be(()=>e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:2},null,-1)),Je=be(()=>e.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1)),Ke=[Xe,Je],Qe=["x","y","height","width"],Ze=["height","width"],et=["rx","x","y","height","width","stroke","stroke-width","filter"],tt=["rx","x","y","height","width","fill","stroke","stroke-width","filter"],lt=["x","y","height","width","filter"],at={key:0},ot={key:1},rt={key:2},ut={key:3},nt=["onMouseover","x","y","height","width"],st={key:5,class:"vue-data-ui-watermark"},it=["onClick"],ct={key:0},vt={key:1},dt=["innerHTML"],pt={__name:"vue-ui-waffle",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup($,{expose:ke,emit:we}){const p=$,{vue_ui_waffle:Ce}=n.useConfig(),V=e.computed(()=>!!p.dataset&&p.dataset.length),b=e.ref(n.createUid()),xe=e.ref(null),O=e.ref(!1),A=e.ref(""),B=e.ref(null),j=e.ref(0),S=e.ref(null),G=e.ref(null),W=e.ref(null),H=e.ref(null),Y=e.ref(null),X=e.ref(0),J=e.ref(0),K=e.ref(0),t=e.computed({get:()=>ee(),set:l=>l}),{userOptionsVisible:D,setUserOptionsVisibility:Q,keepUserOptionState:Z}=Me.useUserOptionState({config:t.value});function ee(){const l=me.useNestedProp({userConfig:p.config,defaultConfig:Ce});return l.theme?{...me.useNestedProp({userConfig:n.themes.vue_ui_waffle[l.theme]||p.config,defaultConfig:l}),customPalette:n.themePalettes[l.theme]||n.palette}:l}e.watch(()=>p.config,l=>{t.value=ee(),D.value=!t.value.showOnChartHover,te(),X.value+=1,J.value+=1,K.value+=1},{deep:!0});const E=e.ref(null);function te(){if(n.objectIsEmpty(p.dataset)?n.error({componentName:"VueUiWaffle",type:"dataset"}):p.dataset.forEach((l,o)=>{n.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(a=>{n.error({componentName:"VueUiWaffle",type:"datasetSerieAttribute",property:a,index:o})})}),t.value.responsive){const l=ye.throttle(()=>{const{width:o,height:a}=ye.useResponsive({chart:S.value,title:t.value.style.chart.title.text?G.value:null,legend:t.value.style.chart.legend.show?W.value:null,source:H.value,noTitle:Y.value});k.value.width=o,k.value.height=a,f.value.width=o,f.value.height=a});E.value=new ResizeObserver(l),E.value.observe(S.value.parentNode)}}e.onMounted(()=>{te()}),e.onBeforeUnmount(()=>{E.value&&E.value.disconnect()});const{isPrinting:le,isImaging:ae,generatePdf:oe,generateImage:re}=ge.usePrinter({elementId:`vue-ui-waffle_${b.value}`,fileName:t.value.style.chart.title.text||"vue-ui-waffle"}),Be=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),ue=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),m=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),k=e.ref({height:512,width:512}),f=e.ref({top:0,left:0,height:512,width:512}),w=e.computed(()=>(f.value.width-t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.spaceBetween)/t.value.style.chart.layout.grid.size),C=e.computed(()=>(f.value.height-t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.spaceBetween)/t.value.style.chart.layout.grid.size),T=e.computed(()=>f.value.width/t.value.style.chart.layout.grid.size),I=e.computed(()=>f.value.height/t.value.style.chart.layout.grid.size);function ne(l){const o=t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.size,a=l.reduce((h,U)=>h+U,0),r=l.map(h=>h/a*o),u=r.map(Math.floor),i=r.map(h=>h%1);let d=o-u.reduce((h,U)=>h+U,0);for(;d>0;){let h=i.indexOf(Math.max(...i));u[h]+=1,i[h]=0,d-=1}return u}function se(){return p.dataset.map((l,o)=>({...l,color:n.convertColorToHex(l.color)||ue.value[o]||n.palette[o]||n.palette[o%n.palette.length],uid:`serie_${o}`,absoluteIndex:o}))}const ie=e.computed(()=>se()),c=e.ref(ie.value);e.watch(()=>p.dataset,l=>{c.value=se()},{deep:!0});const Se=e.computed(()=>{const l=c.value.filter((o,a)=>!v.value.includes(o.uid)).map((o,a)=>(o.values||[]).reduce((r,u)=>r+u,0));return ne(l)}),_e=e.computed(()=>{const l=c.value.map((o,a)=>(o.values||[]).reduce((r,u)=>r+u));return ne(l)}),L=e.computed(()=>(p.dataset.forEach((l,o)=>{[null,void 0].includes(l.values)&&n.error({componentName:"VueUiWaffle",type:"datasetSerieAttribute",property:"values (number[])",index:o})}),c.value.filter((l,o)=>!v.value.includes(l.uid)).map((l,o)=>({absoluteIndex:l.absoluteIndex,uid:l.uid,name:l.name,color:l.color,value:(l.values||[]).reduce((a,r)=>a+r,0),absoluteValues:l.values||[],proportion:Se.value[o]})))),Ne=e.computed(()=>c.value.map((l,o)=>({absoluteIndex:l.absoluteIndex,uid:l.uid,name:l.name,color:l.color,value:(l.values||[]).reduce((a,r)=>a+r,0),absoluteValues:l.values||[],proportion:_e.value[o]})));function $e(){return Ne.value.map(l=>({name:l.name,color:l.color,value:l.value,proportion:l.proportion}))}const Te=e.computed(()=>{let l=0;return L.value.map((o,a)=>{const r=l,u=r+o.proportion,i=[];for(let d=Math.floor(r);d<Math.floor(u);d+=1)i.push(d);return l=u,{...o,start:r,rects:i}})}),s=e.computed(()=>Te.value.flatMap((l,o)=>l.rects.map((a,r)=>({isFirst:r===0,isLongEnough:a.length>2,name:l.name,color:l.color,value:l.value,serieIndex:o,absoluteStartIndex:r<3,serieId:l.uid,...l}))).map((l,o)=>({...l,isAbsoluteFirst:o%t.value.style.chart.layout.grid.size===0}))),P=e.computed(()=>{const l=[];for(let o=0;o<t.value.style.chart.layout.grid.size;o+=1)for(let a=0;a<t.value.style.chart.layout.grid.size;a+=1)l.push({isStartOfLine:a===0,position:t.value.style.chart.layout.grid.vertical?o:a,x:(t.value.style.chart.layout.grid.vertical?o:a)*(w.value+t.value.style.chart.layout.grid.spaceBetween),y:(t.value.style.chart.layout.grid.vertical?a:o)*(C.value+t.value.style.chart.layout.grid.spaceBetween)+f.value.top});return l}),v=e.ref([]),x=e.ref(!1),ce=e.ref(null),ve=e.ref(null);function de(l){if(!t.value.useAnimation){v.value.includes(l)?v.value=v.value.filter(u=>u!==l):v.value.length<_.value.length-1&&_.value.length>1&&v.value.push(l);return}const o=ie.value.find(u=>u.uid===l).values.reduce((u,i)=>u+i,0),a=c.value.find(u=>u.uid===l).values.reduce((u,i)=>u+i,0);let r=a;if(v.value.includes(l)){let i=function(){r>u?(cancelAnimationFrame(ce.value),c.value=c.value.map((d,h)=>d.uid===l?{...d,values:[u]}:d),x.value=!1):(x.value=!0,r+=u*.025,c.value=c.value.map((d,h)=>d.uid===l?{...d,values:[r]}:d),ce.value=requestAnimationFrame(i))};v.value=v.value.filter(d=>d!==l);const u=o;i()}else if(v.value.length<_.value.length-1&&_.value.length>1){let u=function(){r<a/100?(cancelAnimationFrame(ve.value),v.value.push(l),c.value=c.value.map((i,d)=>i.uid===l?{...i,values:[0]}:i),x.value=!1):(x.value=!0,r/=1.15,c.value=c.value.map(i=>i.uid===l?{...i,values:[r]}:i),ve.value=requestAnimationFrame(u))};u()}we("selectLegend",L.value.map(u=>({name:u.name,color:u.color,value:u.value,proportion:u.proportion/Math.pow(t.value.style.chart.layout.grid.size,2)})))}const _=e.computed(()=>c.value.map((l,o)=>({name:l.name,color:l.color||ue[o]||n.palette[o]||n.palette[o%n.palette.length],value:(l.values||[]).reduce((a,r)=>a+r,0),uid:l.uid,shape:"square"})).map(l=>({...l,proportion:l.value/c.value.map(o=>(o.values||[]).reduce((a,r)=>a+r,0)).reduce((o,a)=>o+a,0),opacity:v.value.includes(l.uid)?.5:1,segregate:()=>de(l.uid),isSegregated:v.value.includes(l.uid)}))),Le=e.computed(()=>({cy:"waffle-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),y=e.computed(()=>L.value.map(l=>l.value).reduce((l,o)=>l+o,0)),q=e.ref(null);function Pe(l){if(v.value.length===p.dataset.length)return;const o=s.value[l];q.value={datapoint:o,seriesIndex:o.absoluteIndex,series:c.value,config:t.value},O.value=!0,B.value=s.value[l].serieIndex;const a=t.value.style.chart.tooltip.customFormat;if(n.isFunction(a)&&n.functionReturnsString(()=>a({seriesIndex:s.value[l].absoluteIndex,datapoint:o,series:c.value,config:t.value})))A.value=a({seriesIndex:s.value[l].absoluteIndex,datapoint:o,series:c.value,config:t.value});else{let r="";if(r+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${o.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"><rect x="0" y="0" height="12" width="12" stroke="none" rx="1" fill="${o.color}" /></svg>`,t.value.style.chart.tooltip.showValue&&(r+=`<b>${n.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,o.value,n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:o.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:o,seriesIndex:s.value[l].absoluteIndex,series:c.value})}</b>`),t.value.style.chart.tooltip.showPercentage){const u=n.dataLabel({v:o.value/y.value*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage});t.value.style.chart.tooltip.showValue?r+=`<span>(${u})</span></div>`:r+=`<b>${u}%</b></div>`}A.value=r}}const g=e.computed(()=>{const l=L.value.map(a=>({name:a.name,color:a.color})),o=L.value.map(a=>a.value);return{head:l,body:o}});function M(l){return t.value.useBlurOnHover&&![null,void 0].includes(B.value)&&B.value!==l?`url(#blur_${b.value})`:""}function pe(){e.nextTick(()=>{const l=g.value.head.map((r,u)=>[[r.name],[g.value.body[u]],[isNaN(g.value.body[u]/y.value)?"-":g.value.body[u]/y.value*100]]),o=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(l),a=n.createCsvContent(o);n.downloadCsv({csvContent:a,title:t.value.style.chart.title.text||"vue-ui-waffle"})})}const z=e.computed(()=>{const l=[' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>',n.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,y.value,n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:y.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue})),"100%"],o=g.value.head.map((u,i)=>[{color:u.color,name:u.name},n.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,g.value.body[i],n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:g.value.body[i],s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue})),isNaN(g.value.body[i]/y.value)?"-":n.dataLabel({v:g.value.body[i]/y.value*100,s:"%",r:t.value.table.td.roundingPercentage})]),a={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},shape:"square",breakpoint:t.value.table.responsiveBreakpoint},r=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage];return{head:l,body:o,config:a,colNames:r}}),N=e.ref(!1);function Ve(l){N.value=l,j.value+=1}function he(){m.value.showTable=!m.value.showTable}function fe(){m.value.showTooltip=!m.value.showTooltip}const F=e.ref(!1);function R(){F.value=!F.value}return ke({getData:$e,generatePdf:oe,generateCsv:pe,generateImage:re,toggleTable:he,toggleTooltip:fe,toggleAnnotator:R}),(l,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-waffle ${N.value?"vue-data-ui-wrapper-fullscreen":""}`),ref_key:"waffleChart",ref:S,id:`vue-ui-waffle_${b.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height: 100%":""}`),onMouseenter:o[3]||(o[3]=()=>e.unref(Q)(!0)),onMouseleave:o[4]||(o[4]=()=>e.unref(Q)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(qe.PenAndPaper,{key:0,parent:S.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:F.value,onClose:R},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),Be.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:Y,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:G,style:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(Ee._sfc_main,{key:`title_${X.value}`,config:{title:{cy:"waffle-title",...t.value.style.chart.title},subtitle:{cy:"waffle-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&V.value&&(e.unref(Z)||e.unref(D))?(e.openBlock(),e.createBlock(ge.UserOptions,{ref_key:"details",ref:xe,key:`user_options_${j.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(le),isImaging:e.unref(ae),uid:b.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:N.value,isTooltip:m.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:S.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:F.value,onToggleFullscreen:Ve,onGeneratePdf:e.unref(oe),onGenerateCsv:pe,onGenerateImage:e.unref(re),onToggleTable:he,onToggleTooltip:fe,onToggleAnnotator:R,style:e.normalizeStyle({visibility:e.unref(Z)?e.unref(D)?"visible":"hidden":"visible"})},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:r})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:r})),void 0,!0)]),key:"5"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:a,isAnnotator:r})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:a,isAnnotator:r})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),V.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(n.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":N.value,"vue-data-ui-fulscreen--off":!N.value}),viewBox:`0 0 ${k.value.width<=0?10:k.value.width} ${k.value.height<=0?10:k.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(De._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(a,r)=>(e.openBlock(),e.createElementBlock("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`gradient_${b.value}_${r}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(n.setOpacity)(e.unref(n.shiftHue)(a.color,.05),100-t.value.style.chart.layout.rect.gradientIntensity)},null,8,We),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,He)],8,Ge))),256))]),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${b.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},Ke,8,Ye)]),t.value.useCustomCells&&s.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(P.value,(a,r)=>(e.openBlock(),e.createElementBlock("foreignObject",{x:a.x,y:a.y,height:C.value<=0?1e-4:C.value,width:w.value<=0?1e-4:w.value,class:"vue-ui-waffle-custom-cell-foreignObject"},[e.renderSlot(l.$slots,"cell",e.normalizeProps(e.guardReactiveProps({cell:{...a,color:s.value[r].color,...s.value[r]},isSelected:[null,void 0].includes(B.value)?!0:s.value[r].serieIndex===B.value})),void 0,!0)],8,Qe))),256)):e.createCommentVNode("",!0),!s.value.length&&!t.value.useCustomCells?(e.openBlock(),e.createElementBlock("rect",{key:1,x:12,y:12,height:f.value.height-24,width:f.value.width-24,rx:3,fill:"none",stroke:"black"},null,8,Ze)):s.value.length&&!t.value.useCustomCells?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.value,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{rx:t.value.style.chart.layout.rect.rounded?t.value.style.chart.layout.rect.rounding:0,x:a.x+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.grid.spaceBetween/2,height:C.value<=0?1e-4:C.value,width:w.value<=0?1e-4:w.value,fill:"white",stroke:t.value.style.chart.layout.rect.stroke,"stroke-width":t.value.style.chart.layout.rect.strokeWidth,filter:M(s.value[r].serieIndex)},null,8,et))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.value,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{rx:t.value.style.chart.layout.rect.rounded?t.value.style.chart.layout.rect.rounding:0,x:a.x+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.grid.spaceBetween/2,height:C.value<=0?1e-4:C.value,width:w.value<=0?1e-4:w.value,fill:t.value.style.chart.layout.rect.useGradient&&t.value.style.chart.layout.rect.gradientIntensity>0?`url(#gradient_${b.value}_${r})`:s.value[r].color,stroke:t.value.style.chart.layout.rect.stroke,"stroke-width":t.value.style.chart.layout.rect.strokeWidth,filter:M(s.value[r].serieIndex)},null,8,tt))),256))],64)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.value,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[s.value.length&&!x.value&&!t.value.style.chart.layout.grid.vertical&&t.value.style.chart.layout.labels.captions.show&&(s.value[r].isFirst&&a.position<t.value.style.chart.layout.grid.size-2||s.value[r].isAbsoluteFirst&&r%t.value.style.chart.layout.grid.size===0&&s.value[r].absoluteStartIndex)?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:a.x+t.value.style.chart.layout.labels.captions.offsetX+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.labels.captions.offsetY+t.value.style.chart.layout.grid.spaceBetween/2,height:I.value<=0?1e-4:I.value,width:T.value*t.value.style.chart.layout.grid.size<=0?1e-4:T.value*t.value.style.chart.layout.grid.size,filter:M(s.value[r].serieIndex)},[e.createElementVNode("div",{class:"vue-ui-waffle-caption",style:e.normalizeStyle(`height: 100%; width: 100%; font-size:${t.value.style.chart.layout.labels.captions.fontSize}px;display:flex;align-items:center;justify-content:flex-start;padding: 0 ${T.value/12}px;color:${e.unref(n.adaptColorToBackground)(s.value[r].color)};gap:2px`)},[t.value.style.chart.layout.labels.captions.showSerieName?(e.openBlock(),e.createElementBlock("span",at,e.toDisplayString(t.value.style.chart.layout.labels.captions.serieNameAbbreviation?e.unref(n.abbreviate)({source:s.value[r].name,length:t.value.style.chart.layout.labels.captions.serieNameMaxAbbreviationSize}):s.value[r].name)+": ",1)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.captions.showPercentage?(e.openBlock(),e.createElementBlock("span",ot,e.toDisplayString(e.unref(n.dataLabel)({v:s.value[r].proportion,s:"%",r:t.value.style.chart.layout.labels.captions.roundingPercentage})),1)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.captions.showPercentage&&t.value.style.chart.layout.labels.captions.showValue?(e.openBlock(),e.createElementBlock("span",rt," ("+e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,s.value[r].value,e.unref(n.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:s.value[r].value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.layout.labels.captions.roundingValue}),{datapoint:s.value[r],position:a}))+") ",1)):e.createCommentVNode("",!0),!t.value.style.chart.layout.labels.captions.showPercentage&&t.value.style.chart.layout.labels.captions.showValue?(e.openBlock(),e.createElementBlock("span",ut,e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,s.value[r].value,e.unref(n.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:s.value[r].value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.layout.labels.captions.roundingValue}),{datapoint:s.value[r],position:a})),1)):e.createCommentVNode("",!0)],4)],8,lt)):e.createCommentVNode("",!0)],64))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.value,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{onMouseover:u=>Pe(r),onMouseleave:o[0]||(o[0]=u=>{O.value=!1,B.value=null}),x:a.x+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.grid.spaceBetween/2,height:I.value<=0?1e-4:I.value,width:T.value<=0?1e-4:T.value,fill:"transparent",stroke:"none"},null,40,nt))),256)),e.renderSlot(l.$slots,"svg",{svg:k.value},void 0,!0)],14,je)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",st,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(le)||e.unref(ae)})),void 0,!0)])):e.createCommentVNode("",!0),V.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Oe.default,{key:6,config:{type:"waffle",style:{backgroundColor:t.value.style.chart.backgroundColor,waffle:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:W},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(Fe.Legend,{key:`legend_${K.value}`,legendSet:_.value,config:Le.value,onClickMarker:o[1]||(o[1]=({legend:a})=>de(a.uid))},{item:e.withCtx(({legend:a})=>[e.createElementVNode("div",{onClick:r=>a.segregate(),style:e.normalizeStyle(`opacity:${v.value.includes(a.uid)?.5:1}`)},[e.createTextVNode(e.toDisplayString(a.name)+": "+e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,a.value,e.unref(n.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:a.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.legend.roundingValue,isAnimating:x.value}),{datapoint:a}))+" ",1),v.value.includes(a.uid)?(e.openBlock(),e.createElementBlock("span",vt," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",ct," ("+e.toDisplayString(isNaN(a.value/y.value)?"-":e.unref(n.dataLabel)({v:a.value/y.value*100,s:"%",r:t.value.style.chart.legend.roundingPercentage,isAnimating:x.value}))+") ",1))],12,it)]),_:1},8,["legendSet","config"])):e.renderSlot(l.$slots,"legend",{key:1,legend:_.value},void 0,!0)],512),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:H,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(Ie._sfc_main,{show:m.value.showTooltip&&O.value&&v.value.length<p.dataset.length,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:S.value,content:A.value,isCustom:t.value.style.chart.tooltip.customFormat&&typeof t.value.style.chart.tooltip.customFormat=="function",fontSize:t.value.style.chart.tooltip.fontSize,isFullscreen:N.value},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...q.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...q.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isCustom","fontSize","isFullscreen"]),V.value?(e.openBlock(),e.createBlock(Ae.default,{key:8,hideDetails:"",config:{open:m.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(ze.DataTable,{key:`table_${J.value}`,colNames:z.value.colNames,head:z.value.head,body:z.value.body,config:z.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:o[2]||(o[2]=a=>m.value.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createElementVNode("div",{innerHTML:a,style:{display:"flex","align-items":"center"}},null,8,dt)]),td:e.withCtx(({td:a})=>[e.createTextVNode(e.toDisplayString(a.name||a),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,Ue))}},ht=Re._export_sfc(pt,[["__scopeId","data-v-1d032eba"]]);exports.default=ht;
|