vue-data-ui 2.4.78 → 2.4.80
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-DbrjRMa6.cjs → Arrow-D7TkI6Ay.cjs} +1 -1
- package/dist/{Arrow-C7AmfY-d.js → Arrow-HywvQFIb.js} +1 -1
- package/dist/{BaseIcon-CIjjPDqj.cjs → BaseIcon-5jC5U27p.cjs} +1 -1
- package/dist/{BaseIcon-Dzpk4O8L.js → BaseIcon-CL3j-fI9.js} +1 -1
- package/dist/{DataTable-DtRXoetj.js → DataTable-DInI0nyj.js} +2 -2
- package/dist/{DataTable-wN-jvOfe.cjs → DataTable-fHBZCQD_.cjs} +1 -1
- package/dist/{Legend-DqGE1lkA.cjs → Legend-BGxT3Yv0.cjs} +1 -1
- package/dist/{Legend-RnRqBxiV.js → Legend-Ci1axdG_.js} +2 -2
- package/dist/{PackageVersion-CgJdp_Ki.js → PackageVersion-Cchpqacn.js} +1 -1
- package/dist/{PackageVersion-Dn-t7tbm.cjs → PackageVersion-X1kVHC-z.cjs} +1 -1
- package/dist/{PenAndPaper-BTLEk55u.js → PenAndPaper-BKH98f-S.js} +3 -3
- package/dist/{PenAndPaper-DFXJJink.cjs → PenAndPaper-ChPMqRX7.cjs} +1 -1
- package/dist/{Shape-B1fqUhjt.js → Shape-Cvp52J0c.js} +1 -1
- package/dist/{Shape-D7IbPjU8.cjs → Shape-kTprcCU0.cjs} +1 -1
- package/dist/Slicer-BAXp89_0.cjs +1 -0
- package/dist/Slicer-CtV2RLUM.js +546 -0
- package/dist/{Title-D-6pIV0l.cjs → Title-ByUzU0ju.cjs} +1 -1
- package/dist/{Title-XYNHfYwN.js → Title-PkqdmDqN.js} +1 -1
- package/dist/{Tooltip-CNox4F8U.cjs → Tooltip-D0I2_wrW.cjs} +1 -1
- package/dist/{Tooltip-DYRo59nq.js → Tooltip-m3Z3Wlu2.js} +1 -1
- package/dist/{index-B8Eaq54E.js → index-C2mIRYI5.js} +1 -1
- package/dist/{index-KJL8ra_6.cjs → index-DBFjPsZ3.cjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/{useNestedProp-Bu958azG.cjs → useNestedProp-C6A3gxy9.cjs} +1 -1
- package/dist/{useNestedProp-Ka0R_Yqa.js → useNestedProp-nx1ZIRNV.js} +1 -1
- package/dist/{usePrinter-D83W2gfG.js → usePrinter-D0_MYOSc.js} +1 -1
- package/dist/{usePrinter-pDOF3CfL.cjs → usePrinter-NpeVna5L.cjs} +1 -1
- package/dist/{vue-data-ui-Ot5xYhbV.cjs → vue-data-ui-DCBYDQ8d.cjs} +1 -1
- package/dist/{vue-data-ui-DgmXnSUU.js → vue-data-ui-DN2kou23.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-CB0XzatQ.cjs → vue-ui-3d-bar-BzqpUiO9.cjs} +1 -1
- package/dist/{vue-ui-3d-bar-CqiW8qFZ.js → vue-ui-3d-bar-CX4cgFJW.js} +9 -9
- package/dist/{vue-ui-accordion-4-dyMgJA.cjs → vue-ui-accordion-BB0V98cT.cjs} +1 -1
- package/dist/{vue-ui-accordion--5td7b94.js → vue-ui-accordion-CbgAyykZ.js} +3 -3
- package/dist/{vue-ui-age-pyramid-Bsg0z9ei.js → vue-ui-age-pyramid-DKNcamFG.js} +10 -10
- package/dist/{vue-ui-age-pyramid-DNseB8ej.cjs → vue-ui-age-pyramid-lTOdjMKu.cjs} +1 -1
- package/dist/{vue-ui-annotator-obnYFvvq.js → vue-ui-annotator-CUzQpHGa.js} +1 -1
- package/dist/{vue-ui-annotator-CHjtF8NT.cjs → vue-ui-annotator-pJhAuSac.cjs} +1 -1
- package/dist/{vue-ui-bullet-yKEVhE17.js → vue-ui-bullet-Bthmg1VV.js} +8 -8
- package/dist/{vue-ui-bullet-CNWHd7dO.cjs → vue-ui-bullet-R3ISDQsd.cjs} +1 -1
- package/dist/{vue-ui-candlestick-Cc-Ee4zv.js → vue-ui-candlestick-CvHVfAu7.js} +11 -11
- package/dist/{vue-ui-candlestick-VBq82rfW.cjs → vue-ui-candlestick-KvgWKIaO.cjs} +1 -1
- package/dist/{vue-ui-carousel-table-DLwVijSb.cjs → vue-ui-carousel-table-BjjvMcc0.cjs} +1 -1
- package/dist/{vue-ui-carousel-table-B6v1NycN.js → vue-ui-carousel-table-DCi_yXu2.js} +4 -4
- package/dist/{vue-ui-chestnut-CekC1moT.js → vue-ui-chestnut-BckiQcJs.js} +8 -8
- package/dist/{vue-ui-chestnut-DHZbhIf_.cjs → vue-ui-chestnut-Dotk5uHN.cjs} +1 -1
- package/dist/{vue-ui-cursor-Bz-jVx3a.cjs → vue-ui-cursor-C9LwYeDb.cjs} +1 -1
- package/dist/{vue-ui-cursor-CISKzkNu.js → vue-ui-cursor-DE0HZhQL.js} +2 -2
- package/dist/{vue-ui-dashboard-PAi8o4AC.cjs → vue-ui-dashboard-Dp87Gc9L.cjs} +1 -1
- package/dist/{vue-ui-dashboard-w7Ts26Xc.js → vue-ui-dashboard-DtWvVA-k.js} +2 -2
- package/dist/{vue-ui-digits-kaBR5FUU.js → vue-ui-digits-CFjurLzc.js} +2 -2
- package/dist/{vue-ui-digits-I_lj1m6d.cjs → vue-ui-digits-DQA6ixem.cjs} +1 -1
- package/dist/{vue-ui-donut-dDpMdK4G.cjs → vue-ui-donut-DIHfCjBP.cjs} +1 -1
- package/dist/{vue-ui-donut-BVuaExCl.js → vue-ui-donut-DRIPG4qf.js} +12 -12
- package/dist/{vue-ui-donut-evolution-ChGao_WW.cjs → vue-ui-donut-evolution-BrcrheUX.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-DAmX1OX-.js → vue-ui-donut-evolution-DfKOKQFY.js} +11 -11
- package/dist/{vue-ui-dumbbell-DsR4RQY9.cjs → vue-ui-dumbbell-CAg1cU2x.cjs} +1 -1
- package/dist/{vue-ui-dumbbell-CrQNRN_m.js → vue-ui-dumbbell-Dx6YSKly.js} +10 -10
- package/dist/{vue-ui-flow-B0lCe4G8.js → vue-ui-flow-DOipmqqm.js} +9 -9
- package/dist/{vue-ui-flow-Dhcvvzee.cjs → vue-ui-flow-HuZqv_Mr.cjs} +1 -1
- package/dist/{vue-ui-funnel-Cinv1hUx.js → vue-ui-funnel-CSRH6I73.js} +9 -9
- package/dist/{vue-ui-funnel-Bu_wMJ98.cjs → vue-ui-funnel-ClZWVU3W.cjs} +1 -1
- package/dist/{vue-ui-galaxy-zx6O9AuV.cjs → vue-ui-galaxy-B0Gxsuaj.cjs} +1 -1
- package/dist/{vue-ui-galaxy-BcwunIK3.js → vue-ui-galaxy-vP8xR-K-.js} +11 -11
- package/dist/{vue-ui-gauge-Cb6sxoZI.cjs → vue-ui-gauge-Dr7NdYqP.cjs} +1 -1
- package/dist/{vue-ui-gauge-C4W4OAXQ.js → vue-ui-gauge-QEApv_T5.js} +7 -7
- package/dist/{vue-ui-gizmo-D4VHyFmN.js → vue-ui-gizmo-Cr3L2fkb.js} +3 -3
- package/dist/{vue-ui-gizmo-DBSYx24z.cjs → vue-ui-gizmo-q7PyJf3N.cjs} +1 -1
- package/dist/{vue-ui-heatmap-C3WHfifV.js → vue-ui-heatmap-CY7z5uPC.js} +10 -10
- package/dist/{vue-ui-heatmap-CBNt4Huo.cjs → vue-ui-heatmap-Dlqs0ZRP.cjs} +1 -1
- package/dist/{vue-ui-history-plot-dJp-Lai2.js → vue-ui-history-plot-B0UmKljg.js} +11 -11
- package/dist/{vue-ui-history-plot-Dp8Llb3A.cjs → vue-ui-history-plot-De2TbpxV.cjs} +1 -1
- package/dist/{vue-ui-kpi-B3XhowYx.js → vue-ui-kpi-CR1lNimt.js} +3 -3
- package/dist/{vue-ui-kpi-Dnp8IUyb.cjs → vue-ui-kpi-CdbzO6dm.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-Cca7PA4v.js → vue-ui-mini-loader-B2k4Zk3c.js} +2 -2
- package/dist/{vue-ui-mini-loader-BgwhuEda.cjs → vue-ui-mini-loader-DJ2voqOx.cjs} +1 -1
- package/dist/{vue-ui-molecule-B1AocG3H.cjs → vue-ui-molecule-C72LUB1R.cjs} +1 -1
- package/dist/{vue-ui-molecule-BcZNqWfD.js → vue-ui-molecule-DAz6ytsR.js} +11 -11
- package/dist/{vue-ui-mood-radar-HjLL0ZZ8.js → vue-ui-mood-radar-CwFs3yx-.js} +11 -11
- package/dist/{vue-ui-mood-radar-Cn65TQEs.cjs → vue-ui-mood-radar-atwG7SN7.cjs} +1 -1
- package/dist/{vue-ui-nested-donuts-CymFt4B3.cjs → vue-ui-nested-donuts-CmjvIdjy.cjs} +1 -1
- package/dist/{vue-ui-nested-donuts-BIqySYG_.js → vue-ui-nested-donuts-CyOGu99e.js} +11 -11
- package/dist/{vue-ui-onion-muCAMEG8.js → vue-ui-onion-D-PSIMqW.js} +11 -11
- package/dist/{vue-ui-onion-BLMFR0GK.cjs → vue-ui-onion-Tcb-YXPb.cjs} +1 -1
- package/dist/{vue-ui-parallel-coordinate-plot-DYOlnKPw.js → vue-ui-parallel-coordinate-plot-CSq_ztwh.js} +12 -12
- package/dist/{vue-ui-parallel-coordinate-plot-i-hhfnwF.cjs → vue-ui-parallel-coordinate-plot-Do_BYnGv.cjs} +1 -1
- package/dist/{vue-ui-quadrant-TU5fWoEw.js → vue-ui-quadrant-A1-scvDl.js} +12 -12
- package/dist/{vue-ui-quadrant-DJPOp1-A.cjs → vue-ui-quadrant-CFT6mDQf.cjs} +1 -1
- package/dist/{vue-ui-quick-chart-DzuUofFN.js → vue-ui-quick-chart-CfAX6N6x.js} +9 -9
- package/dist/{vue-ui-quick-chart-CTJxOisL.cjs → vue-ui-quick-chart-oZu8nE65.cjs} +1 -1
- package/dist/{vue-ui-radar-C0WA20R8.js → vue-ui-radar-BF_X5reX.js} +12 -12
- package/dist/{vue-ui-radar-D4xX7TNQ.cjs → vue-ui-radar-BLIRb8-e.cjs} +1 -1
- package/dist/{vue-ui-rating-C2JILb2g.cjs → vue-ui-rating-BcJxCL9T.cjs} +1 -1
- package/dist/{vue-ui-rating-DUcyhyrN.js → vue-ui-rating-CPhAqTMY.js} +2 -2
- package/dist/{vue-ui-relation-circle-D-Wxskec.cjs → vue-ui-relation-circle-BSq5niUB.cjs} +1 -1
- package/dist/{vue-ui-relation-circle-BYlIjbUK.js → vue-ui-relation-circle-C4WtlzjR.js} +7 -7
- package/dist/{vue-ui-rings-w4KQSfym.js → vue-ui-rings-BxKf1fKQ.js} +12 -12
- package/dist/{vue-ui-rings-CsXVOIn3.cjs → vue-ui-rings-D_oSqIee.cjs} +1 -1
- package/dist/{vue-ui-scatter--5Ob2lKM.cjs → vue-ui-scatter-BzNnkurj.cjs} +1 -1
- package/dist/{vue-ui-scatter-CfgCA3Di.js → vue-ui-scatter-Dy-p7Wtu.js} +12 -12
- package/dist/{vue-ui-screenshot-BsD3ySuA.js → vue-ui-screenshot-CgPpGG9k.js} +1 -1
- package/dist/{vue-ui-screenshot-UEVUHXWY.cjs → vue-ui-screenshot-DSmfT3MR.cjs} +1 -1
- package/dist/{vue-ui-skeleton-D_YCUi1y.cjs → vue-ui-skeleton-20TN6Ch2.cjs} +1 -1
- package/dist/{vue-ui-skeleton-DpadzgbS.js → vue-ui-skeleton-Cb2qrhYT.js} +3 -3
- package/dist/{vue-ui-smiley-C32dLhtP.cjs → vue-ui-smiley-DtlSAsdM.cjs} +1 -1
- package/dist/{vue-ui-smiley-BHqeb-Ol.js → vue-ui-smiley-U2CIWUwg.js} +2 -2
- package/dist/{vue-ui-spark-trend-NAcB2zZ1.js → vue-ui-spark-trend-BMtR1Pi0.js} +5 -5
- package/dist/{vue-ui-spark-trend-Bt2wpc5C.cjs → vue-ui-spark-trend-Bdb83Or_.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-CgoGRT0_.cjs → vue-ui-sparkbar-C-0M8j8u.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-BPpSxe5Z.js → vue-ui-sparkbar-D0VeUaEb.js} +4 -4
- package/dist/{vue-ui-sparkgauge-frN6uK_L.cjs → vue-ui-sparkgauge-BWojoCVe.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-C1mW3KbZ.js → vue-ui-sparkgauge-Hp3ybBWb.js} +4 -4
- package/dist/{vue-ui-sparkhistogram-CqQY434G.cjs → vue-ui-sparkhistogram-DRASXRMH.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram-HgBi5OvP.js → vue-ui-sparkhistogram-PvQgia6F.js} +5 -5
- package/dist/{vue-ui-sparkline-BABBXY2c.js → vue-ui-sparkline-CI-MxWXp.js} +4 -4
- package/dist/{vue-ui-sparkline-XOa6LfX2.cjs → vue-ui-sparkline-DthSItEI.cjs} +1 -1
- package/dist/{vue-ui-sparkstackbar-Ch3JvFBq.js → vue-ui-sparkstackbar-BDw738BK.js} +5 -5
- package/dist/{vue-ui-sparkstackbar-B4Xduiv1.cjs → vue-ui-sparkstackbar-CSPWjjZ9.cjs} +1 -1
- package/dist/{vue-ui-stackbar-CH8tLDZq.cjs → vue-ui-stackbar-C14-7LhJ.cjs} +1 -1
- package/dist/{vue-ui-stackbar-JIEn0g7t.js → vue-ui-stackbar-CMe20-6p.js} +13 -13
- package/dist/{vue-ui-strip-plot-RZu43QbP.js → vue-ui-strip-plot-3V5Roils.js} +11 -11
- package/dist/{vue-ui-strip-plot-BkWzm1mI.cjs → vue-ui-strip-plot-CT6zIUSS.cjs} +1 -1
- package/dist/{vue-ui-table-CgtE4HWs.cjs → vue-ui-table-CwsJHKSJ.cjs} +1 -1
- package/dist/{vue-ui-table-CJ2gGmYi.js → vue-ui-table-LiO7zYPI.js} +1 -1
- package/dist/{vue-ui-table-heatmap-B_TfeHsa.js → vue-ui-table-heatmap-BDydCyHc.js} +4 -4
- package/dist/{vue-ui-table-heatmap-DxTs_PZF.cjs → vue-ui-table-heatmap-Ch3IAca3.cjs} +1 -1
- package/dist/{vue-ui-table-sparkline-DqMH7xbY.js → vue-ui-table-sparkline-CpMMEuyJ.js} +5 -5
- package/dist/{vue-ui-table-sparkline-PA9L6AjE.cjs → vue-ui-table-sparkline-uRakWvAL.cjs} +1 -1
- package/dist/{vue-ui-thermometer-AwZdEG3j.cjs → vue-ui-thermometer-C1WVxmG2.cjs} +1 -1
- package/dist/{vue-ui-thermometer-D7aR0elr.js → vue-ui-thermometer-ccjAdXXK.js} +7 -7
- package/dist/{vue-ui-timer-C9sO9AoQ.js → vue-ui-timer-Bz5-5ROu.js} +5 -5
- package/dist/{vue-ui-timer-C6fnDeD8.cjs → vue-ui-timer-C4xMxcYZ.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-Dje0I1vf.cjs → vue-ui-tiremarks-CpVvaTWi.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-KvOyYNVW.js → vue-ui-tiremarks-N_GjxnG-.js} +7 -7
- package/dist/{vue-ui-treemap-BPxLXNZ5.js → vue-ui-treemap-CaxwLYar.js} +11 -11
- package/dist/{vue-ui-treemap-C2Vrj3tg.cjs → vue-ui-treemap-I3ZJNnqf.cjs} +1 -1
- package/dist/{vue-ui-vertical-bar-BAdSzbYU.js → vue-ui-vertical-bar-CIFczbF9.js} +12 -12
- package/dist/{vue-ui-vertical-bar-_MWpPkwZ.cjs → vue-ui-vertical-bar-CwOtDK03.cjs} +1 -1
- package/dist/{vue-ui-waffle-DfJI5Lez.cjs → vue-ui-waffle-CMSJBjtH.cjs} +1 -1
- package/dist/{vue-ui-waffle-CW1UVf-q.js → vue-ui-waffle-C_HzXt-Y.js} +12 -12
- package/dist/{vue-ui-wheel-DAwYc7XY.js → vue-ui-wheel-BHszQkHF.js} +7 -7
- package/dist/{vue-ui-wheel-CzZEsjmd.cjs → vue-ui-wheel-CfcHGnt7.cjs} +1 -1
- package/dist/vue-ui-word-cloud-BaTb-aot.cjs +1 -0
- package/dist/{vue-ui-word-cloud-BzfYkI08.js → vue-ui-word-cloud-C0v5gBrv.js} +151 -149
- package/dist/{vue-ui-xy-CJYGMbMt.js → vue-ui-xy-CCXp8odX.js} +14 -14
- package/dist/{vue-ui-xy-BolkwiXB.cjs → vue-ui-xy-CabZW_Ej.cjs} +1 -1
- package/dist/{vue-ui-xy-canvas-sB1dmJQc.js → vue-ui-xy-canvas-CdgdK8ol.js} +11 -11
- package/dist/{vue-ui-xy-canvas-DkltjVWN.cjs → vue-ui-xy-canvas-Dk6948dM.cjs} +1 -1
- package/package.json +1 -1
- package/dist/Slicer-8bCK41mN.cjs +0 -1
- package/dist/Slicer-GQf9ZyPj.js +0 -491
- package/dist/vue-ui-word-cloud-BEyV6jMo.cjs +0 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { useSlots as at, onMounted as Ie, computed as k, ref as f, watch as nt, onBeforeUnmount as st, openBlock as g, createElementBlock as w, normalizeClass as Le, normalizeStyle as R, unref as y, createBlock as E, createCommentVNode as S, createSlots as rt, withCtx as T, renderSlot as $, normalizeProps as G, guardReactiveProps as X, createVNode as Re, Fragment as De, renderList as Me, createElementVNode as N, toDisplayString as Y, createTextVNode as Ve, nextTick as ut, pushScopeId as it, popScopeId as ct } from "vue";
|
|
2
|
-
import { u as dt, c as Ue, t as vt, a as ht, p as _, b as ft, o as pt, e as gt, d as ae, i as ne, f as K, X as yt, l as Be, G as He, x as We, y as mt, q as bt, r as kt } from "./index-
|
|
3
|
-
import { _ as wt } from "./Title-
|
|
4
|
-
import { u as Ct, U as $t } from "./usePrinter-
|
|
5
|
-
import { _ as xt } from "./Tooltip-
|
|
6
|
-
import { L as Tt } from "./Legend-
|
|
7
|
-
import _t from "./vue-ui-skeleton-
|
|
8
|
-
import { D as Ot } from "./DataTable-
|
|
9
|
-
import St from "./vue-ui-accordion
|
|
2
|
+
import { u as dt, c as Ue, t as vt, a as ht, p as _, b as ft, o as pt, e as gt, d as ae, i as ne, f as K, X as yt, l as Be, G as He, x as We, y as mt, q as bt, r as kt } from "./index-C2mIRYI5.js";
|
|
3
|
+
import { _ as wt } from "./Title-PkqdmDqN.js";
|
|
4
|
+
import { u as Ct, U as $t } from "./usePrinter-D0_MYOSc.js";
|
|
5
|
+
import { _ as xt } from "./Tooltip-m3Z3Wlu2.js";
|
|
6
|
+
import { L as Tt } from "./Legend-Ci1axdG_.js";
|
|
7
|
+
import _t from "./vue-ui-skeleton-Cb2qrhYT.js";
|
|
8
|
+
import { D as Ot } from "./DataTable-DInI0nyj.js";
|
|
9
|
+
import St from "./vue-ui-accordion-CbgAyykZ.js";
|
|
10
10
|
import { t as Nt, u as zt } from "./useResponsive-CoxXLe23.js";
|
|
11
|
-
import { u as Ee } from "./useNestedProp-
|
|
12
|
-
import { _ as Pt } from "./PackageVersion-
|
|
13
|
-
import { P as At } from "./PenAndPaper-
|
|
11
|
+
import { u as Ee } from "./useNestedProp-nx1ZIRNV.js";
|
|
12
|
+
import { _ as Pt } from "./PackageVersion-Cchpqacn.js";
|
|
13
|
+
import { P as At } from "./PenAndPaper-BKH98f-S.js";
|
|
14
14
|
import { u as Ft } from "./useUserOptionState-BIvW1Kz7.js";
|
|
15
15
|
import { _ as It } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
16
16
|
function Ge(a, c) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-KJL8ra_6.cjs"),Ee=require("./Title-D-6pIV0l.cjs"),ye=require("./usePrinter-pDOF3CfL.cjs"),Le=require("./Tooltip-CNox4F8U.cjs"),Re=require("./Legend-DqGE1lkA.cjs"),Ae=require("./vue-ui-skeleton-D_YCUi1y.cjs"),Fe=require("./DataTable-wN-jvOfe.cjs"),Ie=require("./vue-ui-accordion-4-dyMgJA.cjs"),be=require("./useResponsive-BJ7DTGpm.cjs"),ke=require("./useNestedProp-Bu958azG.cjs"),De=require("./PackageVersion-Dn-t7tbm.cjs"),qe=require("./PenAndPaper-DFXJJink.cjs"),Me=require("./useUserOptionState-BgepsfED.cjs"),He=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");function Ce(n,v){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,d=-1/0,p=0;for(let g=0;g<s;g+=1){const h=n[g].normalizedValue;h<u&&(u=h),h>d&&(d=h),p+=h}return Math.max(v**2*d/p**2,p**2/(v**2*u))}}function we(n){const{xOffset:v,yOffset:s,width:u,height:d}=n;return{x0:v,y0:s,x1:v+u,y1:s+d}}function Ue(n,v,s){if(n.length===0)return!0;{const u=n.concat(v),d=Ce(n,s),p=Ce(u,s);return d>=p}}function We(n){const v=[],s=n.length;for(let u=0;u<s;u+=1){const d=n[u],p=d.length;for(let c=0;c<p;c+=1)v.push(d[c])}return v}function Ge(n,v){const s={...v,children:n};return Te(s)}function je(n){return(n.x1-n.x0)*(n.y1-n.y0)}function xe(n,v){const{width:s,height:u,xOffset:d,yOffset:p}=Y(v),c=n.length,g=n.map(f=>f.normalizedValue||0).reduce((f,y)=>f+y,0),h=g/u,w=g/s;let C=d,b=p;const k=[];if(s>=u){for(let f=0;f<c;f+=1){const y=n[f],x=b+y.normalizedValue/h,B={x0:C,y0:b,x1:C+h,y1:x},T=Object.assign({},y,B);b=x,k.push(T)}return k}else{for(let f=0;f<c;f+=1){const y=n[f],x=C+y.normalizedValue/w,B={x0:C,y0:b,x1:x,y1:b+w},T=Object.assign({},y,B);C=x,k.push(T)}return k}}function Xe(n){const v=Y(n),s=v.width,u=v.height;return Math.min(s,u)}function Ye(n,v){const s=n.length,u=n.map(h=>h.value??0).reduce((h,w)=>h+w,0),d=v/u,p=[];let c,g;for(let h=0;h<s;h+=1)g=n[h],c=Object.assign({},g,{normalizedValue:g.value*(d||0)}),p.push(c);return p}function Y(n){const{x0:v,y0:s,x1:u,y1:d}=n;return{xOffset:v,yOffset:s,width:u-v,height:d-s}}function Ze(n,v,s,u){let d=n,p=v,c=s,g=u;for(;;){const h=d.length;if(h===0){const k=xe(p,c);return g.concat(k)}const w=Xe(c),C=d[0],b=d.slice(1,h);if(Ue(p,C,w)){const k=p.concat(C);d=b,p=k,c=c,g=g}else{const k=p.length;let f=0;for(let T=0;T<k;T+=1)f+=p[T].normalizedValue;const y=Je(c,f),x=xe(p,c),B=g.concat(x);d=d,p=[],c=y,g=B}}}function Te(n){if(typeof n.children>"u"||!n.children.length)return[n];{const v=Ye(n.children,je(n)),s=Ze(v,[],n,[]),u=s.length,d=[];for(let c=0;c<u;c+=1)d.push(Te(s[c]));return We(d)}}function Je(n,v){const{width:s,height:u,xOffset:d,yOffset:p}=Y(n);if(s>=u){const c=v/u,g=s-c,h={xOffset:d+c,yOffset:p,width:g,height:u};return we(h)}else{const c=v/s,g=u-c,h={xOffset:d,yOffset:p+c,width:s,height:g};return we(h)}}const Ke=n=>(e.pushScopeId("data-v-d58b1737"),n=n(),e.popScopeId(),n),Qe=["id"],et=["xmlns","viewBox"],tt={key:0},ot=["id"],lt=["stop-color"],at=["stop-color"],nt=["x","y","height","width","fill","rx","stroke","stroke-width","onClick","onMouseenter"],rt=["x","y","height","width"],ut={style:{width:"100%",height:"100%"},class:"vue-ui-treemap-cell"},st=Ke(()=>e.createElementVNode("br",null,null,-1)),it={key:5,class:"vue-data-ui-watermark"},ct=["onClick"],dt={key:0},vt={key:1},ht=["innerHTML"],pt={__name:"vue-ui-treemap",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(n,{expose:v,emit:s}){const u=n,{vue_ui_treemap:d}=r.useConfig(),p=e.useSlots();e.onMounted(()=>{p["chart-background"]&&console.warn("VueUiTreemap does not support the #chart-background slot.")});const c=e.computed(()=>!!u.dataset&&u.dataset.length),g=e.computed(()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),h=e.ref(r.createUid()),w=e.ref(!1),C=e.ref(""),b=e.ref(!1),k=e.ref(0),f=e.ref([]),y=e.ref(null),x=e.ref(null),B=e.ref(null),T=e.ref(null),Z=e.ref(null),J=e.ref(0),K=e.ref(0),Q=e.ref(0),t=e.computed({get:()=>oe(),set:o=>o}),{userOptionsVisible:U,setUserOptionsVisibility:ee,keepUserOptionState:te}=Me.useUserOptionState({config:t.value});function oe(){const o=ke.useNestedProp({userConfig:u.config,defaultConfig:d});return o.theme?{...ke.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=oe(),U.value=!t.value.showOnChartHover,J.value+=1,K.value+=1,Q.value+=1},{deep:!0});const{isPrinting:le,isImaging:ae,generatePdf:ne,generateImage:re}=ye.usePrinter({elementId:`treemap_${h.value}`,fileName:t.value.style.chart.title.text||"vue-ui-treemap"}),Se=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 ue(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}),ue(a.children))})}const V=e.ref(u.dataset),D=e.ref(null);e.onMounted(()=>{$e()});function $e(){if(r.objectIsEmpty(u.dataset)&&r.error({componentName:"VueUiTreemap",type:"dataset"}),ue(V.value),t.value.responsive){const o=be.throttle(()=>{const{width:a,height:l}=be.useResponsive({chart:y.value,title:t.value.style.chart.title.text?x.value:null,legend:t.value.style.chart.legend.show?B.value:null,source:T.value,noTitle:Z.value});P.value.width=a,P.value.height=l});D.value=new ResizeObserver(o),D.value.observe(y.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=>!f.value.includes(o.id))),L=e.computed(()=>V.value.filter(o=>!f.value.includes(o.id)).map(o=>o.value||0).reduce((o,a)=>o+a,0)),se=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 ie(o,a){return o.value/a}function Ne(o,a,l){const i=t.value.style.chart.layout.rects.colorRatio-ie(a,l);return r.lightenHexColor(o,i<0?0:i)}function ce(o,a,l,i){return o.map((m,_)=>{const H=Ne(r.convertColorToHex(a)||I.value[_]||r.palette[_]||r.palette[_%r.palette.length],m,i),Ve=ie(m,i);return{...m,color:H,proportion:Ve,parentName:l,children:m.children?ce(m.children,H,m.name,i):void 0}})}const F=e.computed(()=>Ge(se.value.map((o,a)=>{const l=o.children?o.children.reduce((i,m)=>i+m.value,0):o.value;return{value:o.value,id:o.id,children:o.children?ce(o.children.sort((i,m)=>m.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 de({y0:o,y1:a}){return a-o<=0?1e-4:a-o}function ve({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 Be(o){b.value=o,k.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 Oe(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),he=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:f.value.includes(o.id)?.5:1}))),Pe=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 pe(o){S.value=!1,$.value=null,f.value.includes(o.id)?f.value=f.value.filter(a=>a!==o.id):f.value.length<u.dataset.length-1&&f.value.push(o.id),s("selectLegend",se.value)}const j=e.ref(null);function _e({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>`}w.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 fe(){e.nextTick(()=>{const o=N.value.head.map((i,m)=>[[i.name],[N.value.body[m]],[isNaN(N.value.body[m]/L.value)?"-":N.value.body[m]/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((m,_)=>{const H=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:m.color,name:m.name,shape:"square"},H,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 ze(){return F.value}function ge(){O.value.showTable=!O.value.showTable}function me(){O.value.showTooltip=!O.value.showTooltip}const M=e.ref(!1);function X(){M.value=!M.value}return v({getData:ze,generateCsv:fe,generateImage:re,generatePdf:ne,toggleTable:ge,toggleTooltip:me,toggleAnnotator:X}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"treemapChart",ref:y,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_${h.value}`,onMouseenter:a[3]||(a[3]=()=>e.unref(ee)(!0)),onMouseleave:a[4]||(a[4]=()=>e.unref(ee)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(qe.PenAndPaper,{key:0,parent:y.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:M.value,onClose:X},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),Se.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:Z,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:x,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:6px`)},[(e.openBlock(),e.createBlock(Ee._sfc_main,{key:`title_${J.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&&c.value&&(e.unref(te)||e.unref(U))?(e.openBlock(),e.createBlock(ye.UserOptions,{ref:"details",key:`user_option_${k.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(le),isImaging:e.unref(ae),uid:h.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:y.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:M.value,onToggleFullscreen:Be,onGeneratePdf:e.unref(ne),onGenerateCsv:fe,onGenerateImage:e.unref(re),onToggleTable:ge,onToggleTooltip:me,onToggleAnnotator:X,style:e.normalizeStyle({visibility:e.unref(te)?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),c.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(De._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",tt,[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,lt),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.lightenHexColor)(l.color,t.value.style.chart.layout.rects.gradient.intensity/100)},null,8,at)],8,ot)])):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:de(l),width:ve(l),fill:g.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:m=>Oe(l),onMouseenter:()=>_e({datapoint:l,seriesIndex:i}),onMouseleave:a[0]||(a[0]=m=>{$.value=null,w.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,nt),(e.openBlock(),e.createElementBlock("foreignObject",{x:l.x0,y:l.y0,height:de(l),width:ve(l),class:"vue-ui-treemap-cell-foreignObject"},[e.createElementVNode("div",ut,[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),st,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,rt))]))),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,et)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",it,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(le)||e.unref(ae)})),void 0,!0)])):e.createCommentVNode("",!0),c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ae.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:B},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(Re.Legend,{key:`legend_${Q.value}`,legendSet:he.value,config:Pe.value,id:`treemap_legend_${h.value}`,onClickMarker:a[1]||(a[1]=({legend:l})=>pe(l))},{item:e.withCtx(({legend:l,index:i})=>[e.createElementVNode("div",{onClick:m=>pe(l),style:e.normalizeStyle(`opacity:${f.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),f.value.includes(l.id)?(e.openBlock(),e.createElementBlock("span",vt," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",dt," ("+e.toDisplayString(isNaN(l.value/L.value)?"-":(l.value/L.value*100).toFixed(t.value.style.chart.legend.roundingPercentage))+"%) ",1))],12,ct)]),_:1},8,["legendSet","config","id"])):e.renderSlot(o.$slots,"legend",{key:1,legend:he.value},void 0,!0)],512),o.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:T,dir:"auto"},[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(Le._sfc_main,{show:O.value.showTooltip&&w.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:y.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"]),c.value?(e.openBlock(),e.createBlock(Ie.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(Fe.DataTable,{key:`table_${K.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,ht)]),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,Qe))}},ft=He._export_sfc(pt,[["__scopeId","data-v-d58b1737"]]);exports.default=ft;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-DBFjPsZ3.cjs"),Ee=require("./Title-ByUzU0ju.cjs"),ye=require("./usePrinter-NpeVna5L.cjs"),Le=require("./Tooltip-D0I2_wrW.cjs"),Re=require("./Legend-BGxT3Yv0.cjs"),Ae=require("./vue-ui-skeleton-20TN6Ch2.cjs"),Fe=require("./DataTable-fHBZCQD_.cjs"),Ie=require("./vue-ui-accordion-BB0V98cT.cjs"),be=require("./useResponsive-BJ7DTGpm.cjs"),ke=require("./useNestedProp-C6A3gxy9.cjs"),De=require("./PackageVersion-X1kVHC-z.cjs"),qe=require("./PenAndPaper-ChPMqRX7.cjs"),Me=require("./useUserOptionState-BgepsfED.cjs"),He=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");function Ce(n,v){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,d=-1/0,p=0;for(let g=0;g<s;g+=1){const h=n[g].normalizedValue;h<u&&(u=h),h>d&&(d=h),p+=h}return Math.max(v**2*d/p**2,p**2/(v**2*u))}}function we(n){const{xOffset:v,yOffset:s,width:u,height:d}=n;return{x0:v,y0:s,x1:v+u,y1:s+d}}function Ue(n,v,s){if(n.length===0)return!0;{const u=n.concat(v),d=Ce(n,s),p=Ce(u,s);return d>=p}}function We(n){const v=[],s=n.length;for(let u=0;u<s;u+=1){const d=n[u],p=d.length;for(let c=0;c<p;c+=1)v.push(d[c])}return v}function Ge(n,v){const s={...v,children:n};return Te(s)}function je(n){return(n.x1-n.x0)*(n.y1-n.y0)}function xe(n,v){const{width:s,height:u,xOffset:d,yOffset:p}=Y(v),c=n.length,g=n.map(f=>f.normalizedValue||0).reduce((f,y)=>f+y,0),h=g/u,w=g/s;let C=d,b=p;const k=[];if(s>=u){for(let f=0;f<c;f+=1){const y=n[f],x=b+y.normalizedValue/h,B={x0:C,y0:b,x1:C+h,y1:x},T=Object.assign({},y,B);b=x,k.push(T)}return k}else{for(let f=0;f<c;f+=1){const y=n[f],x=C+y.normalizedValue/w,B={x0:C,y0:b,x1:x,y1:b+w},T=Object.assign({},y,B);C=x,k.push(T)}return k}}function Xe(n){const v=Y(n),s=v.width,u=v.height;return Math.min(s,u)}function Ye(n,v){const s=n.length,u=n.map(h=>h.value??0).reduce((h,w)=>h+w,0),d=v/u,p=[];let c,g;for(let h=0;h<s;h+=1)g=n[h],c=Object.assign({},g,{normalizedValue:g.value*(d||0)}),p.push(c);return p}function Y(n){const{x0:v,y0:s,x1:u,y1:d}=n;return{xOffset:v,yOffset:s,width:u-v,height:d-s}}function Ze(n,v,s,u){let d=n,p=v,c=s,g=u;for(;;){const h=d.length;if(h===0){const k=xe(p,c);return g.concat(k)}const w=Xe(c),C=d[0],b=d.slice(1,h);if(Ue(p,C,w)){const k=p.concat(C);d=b,p=k,c=c,g=g}else{const k=p.length;let f=0;for(let T=0;T<k;T+=1)f+=p[T].normalizedValue;const y=Je(c,f),x=xe(p,c),B=g.concat(x);d=d,p=[],c=y,g=B}}}function Te(n){if(typeof n.children>"u"||!n.children.length)return[n];{const v=Ye(n.children,je(n)),s=Ze(v,[],n,[]),u=s.length,d=[];for(let c=0;c<u;c+=1)d.push(Te(s[c]));return We(d)}}function Je(n,v){const{width:s,height:u,xOffset:d,yOffset:p}=Y(n);if(s>=u){const c=v/u,g=s-c,h={xOffset:d+c,yOffset:p,width:g,height:u};return we(h)}else{const c=v/s,g=u-c,h={xOffset:d,yOffset:p+c,width:s,height:g};return we(h)}}const Ke=n=>(e.pushScopeId("data-v-d58b1737"),n=n(),e.popScopeId(),n),Qe=["id"],et=["xmlns","viewBox"],tt={key:0},ot=["id"],lt=["stop-color"],at=["stop-color"],nt=["x","y","height","width","fill","rx","stroke","stroke-width","onClick","onMouseenter"],rt=["x","y","height","width"],ut={style:{width:"100%",height:"100%"},class:"vue-ui-treemap-cell"},st=Ke(()=>e.createElementVNode("br",null,null,-1)),it={key:5,class:"vue-data-ui-watermark"},ct=["onClick"],dt={key:0},vt={key:1},ht=["innerHTML"],pt={__name:"vue-ui-treemap",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(n,{expose:v,emit:s}){const u=n,{vue_ui_treemap:d}=r.useConfig(),p=e.useSlots();e.onMounted(()=>{p["chart-background"]&&console.warn("VueUiTreemap does not support the #chart-background slot.")});const c=e.computed(()=>!!u.dataset&&u.dataset.length),g=e.computed(()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),h=e.ref(r.createUid()),w=e.ref(!1),C=e.ref(""),b=e.ref(!1),k=e.ref(0),f=e.ref([]),y=e.ref(null),x=e.ref(null),B=e.ref(null),T=e.ref(null),Z=e.ref(null),J=e.ref(0),K=e.ref(0),Q=e.ref(0),t=e.computed({get:()=>oe(),set:o=>o}),{userOptionsVisible:U,setUserOptionsVisibility:ee,keepUserOptionState:te}=Me.useUserOptionState({config:t.value});function oe(){const o=ke.useNestedProp({userConfig:u.config,defaultConfig:d});return o.theme?{...ke.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=oe(),U.value=!t.value.showOnChartHover,J.value+=1,K.value+=1,Q.value+=1},{deep:!0});const{isPrinting:le,isImaging:ae,generatePdf:ne,generateImage:re}=ye.usePrinter({elementId:`treemap_${h.value}`,fileName:t.value.style.chart.title.text||"vue-ui-treemap"}),Se=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 ue(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}),ue(a.children))})}const V=e.ref(u.dataset),D=e.ref(null);e.onMounted(()=>{$e()});function $e(){if(r.objectIsEmpty(u.dataset)&&r.error({componentName:"VueUiTreemap",type:"dataset"}),ue(V.value),t.value.responsive){const o=be.throttle(()=>{const{width:a,height:l}=be.useResponsive({chart:y.value,title:t.value.style.chart.title.text?x.value:null,legend:t.value.style.chart.legend.show?B.value:null,source:T.value,noTitle:Z.value});P.value.width=a,P.value.height=l});D.value=new ResizeObserver(o),D.value.observe(y.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=>!f.value.includes(o.id))),L=e.computed(()=>V.value.filter(o=>!f.value.includes(o.id)).map(o=>o.value||0).reduce((o,a)=>o+a,0)),se=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 ie(o,a){return o.value/a}function Ne(o,a,l){const i=t.value.style.chart.layout.rects.colorRatio-ie(a,l);return r.lightenHexColor(o,i<0?0:i)}function ce(o,a,l,i){return o.map((m,_)=>{const H=Ne(r.convertColorToHex(a)||I.value[_]||r.palette[_]||r.palette[_%r.palette.length],m,i),Ve=ie(m,i);return{...m,color:H,proportion:Ve,parentName:l,children:m.children?ce(m.children,H,m.name,i):void 0}})}const F=e.computed(()=>Ge(se.value.map((o,a)=>{const l=o.children?o.children.reduce((i,m)=>i+m.value,0):o.value;return{value:o.value,id:o.id,children:o.children?ce(o.children.sort((i,m)=>m.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 de({y0:o,y1:a}){return a-o<=0?1e-4:a-o}function ve({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 Be(o){b.value=o,k.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 Oe(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),he=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:f.value.includes(o.id)?.5:1}))),Pe=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 pe(o){S.value=!1,$.value=null,f.value.includes(o.id)?f.value=f.value.filter(a=>a!==o.id):f.value.length<u.dataset.length-1&&f.value.push(o.id),s("selectLegend",se.value)}const j=e.ref(null);function _e({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>`}w.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 fe(){e.nextTick(()=>{const o=N.value.head.map((i,m)=>[[i.name],[N.value.body[m]],[isNaN(N.value.body[m]/L.value)?"-":N.value.body[m]/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((m,_)=>{const H=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:m.color,name:m.name,shape:"square"},H,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 ze(){return F.value}function ge(){O.value.showTable=!O.value.showTable}function me(){O.value.showTooltip=!O.value.showTooltip}const M=e.ref(!1);function X(){M.value=!M.value}return v({getData:ze,generateCsv:fe,generateImage:re,generatePdf:ne,toggleTable:ge,toggleTooltip:me,toggleAnnotator:X}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"treemapChart",ref:y,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_${h.value}`,onMouseenter:a[3]||(a[3]=()=>e.unref(ee)(!0)),onMouseleave:a[4]||(a[4]=()=>e.unref(ee)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(qe.PenAndPaper,{key:0,parent:y.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:M.value,onClose:X},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),Se.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:Z,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:x,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:6px`)},[(e.openBlock(),e.createBlock(Ee._sfc_main,{key:`title_${J.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&&c.value&&(e.unref(te)||e.unref(U))?(e.openBlock(),e.createBlock(ye.UserOptions,{ref:"details",key:`user_option_${k.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(le),isImaging:e.unref(ae),uid:h.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:y.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:M.value,onToggleFullscreen:Be,onGeneratePdf:e.unref(ne),onGenerateCsv:fe,onGenerateImage:e.unref(re),onToggleTable:ge,onToggleTooltip:me,onToggleAnnotator:X,style:e.normalizeStyle({visibility:e.unref(te)?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),c.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(De._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",tt,[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,lt),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.lightenHexColor)(l.color,t.value.style.chart.layout.rects.gradient.intensity/100)},null,8,at)],8,ot)])):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:de(l),width:ve(l),fill:g.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:m=>Oe(l),onMouseenter:()=>_e({datapoint:l,seriesIndex:i}),onMouseleave:a[0]||(a[0]=m=>{$.value=null,w.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,nt),(e.openBlock(),e.createElementBlock("foreignObject",{x:l.x0,y:l.y0,height:de(l),width:ve(l),class:"vue-ui-treemap-cell-foreignObject"},[e.createElementVNode("div",ut,[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),st,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,rt))]))),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,et)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",it,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(le)||e.unref(ae)})),void 0,!0)])):e.createCommentVNode("",!0),c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ae.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:B},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(Re.Legend,{key:`legend_${Q.value}`,legendSet:he.value,config:Pe.value,id:`treemap_legend_${h.value}`,onClickMarker:a[1]||(a[1]=({legend:l})=>pe(l))},{item:e.withCtx(({legend:l,index:i})=>[e.createElementVNode("div",{onClick:m=>pe(l),style:e.normalizeStyle(`opacity:${f.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),f.value.includes(l.id)?(e.openBlock(),e.createElementBlock("span",vt," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",dt," ("+e.toDisplayString(isNaN(l.value/L.value)?"-":(l.value/L.value*100).toFixed(t.value.style.chart.legend.roundingPercentage))+"%) ",1))],12,ct)]),_:1},8,["legendSet","config","id"])):e.renderSlot(o.$slots,"legend",{key:1,legend:he.value},void 0,!0)],512),o.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:T,dir:"auto"},[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(Le._sfc_main,{show:O.value.showTooltip&&w.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:y.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"]),c.value?(e.openBlock(),e.createBlock(Ie.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(Fe.DataTable,{key:`table_${K.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,ht)]),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,Qe))}},ft=He._export_sfc(pt,[["__scopeId","data-v-d58b1737"]]);exports.default=ft;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { useCssVars as dt, useSlots as vt, computed as b, ref as i, watch as Re, onMounted as Ue, onBeforeUnmount as ct, openBlock as u, createElementBlock as r, normalizeClass as A, normalizeStyle as c, unref as d, createBlock as B, createCommentVNode as p, createSlots as ce, withCtx as k, renderSlot as m, normalizeProps as E, guardReactiveProps as H, createElementVNode as n, toDisplayString as h, createVNode as q, Fragment as W, renderList as G, withKeys as ht, createTextVNode as pt } from "vue";
|
|
2
|
-
import { u as yt, c as gt, t as ft, a as bt, p as D, b as mt, o as Xe, e as K, v as N, d as he, i as le, f as R, X as _t, s as pe, w as kt, x as $t, y as xt, q as wt, r as Ct } from "./index-
|
|
2
|
+
import { u as yt, c as gt, t as ft, a as bt, p as D, b as mt, o as Xe, e as K, v as N, d as he, i as le, f as R, X as _t, s as pe, w as kt, x as $t, y as xt, q as wt, r as Ct } from "./index-C2mIRYI5.js";
|
|
3
3
|
import { t as Tt, u as Lt } from "./useResponsive-CoxXLe23.js";
|
|
4
|
-
import { _ as Nt } from "./Title-
|
|
5
|
-
import { u as Pt, U as St } from "./usePrinter-
|
|
6
|
-
import { _ as Vt } from "./Tooltip-
|
|
7
|
-
import { L as Ee } from "./Legend-
|
|
8
|
-
import It from "./vue-ui-skeleton-
|
|
9
|
-
import Ot from "./BaseIcon-
|
|
10
|
-
import Ft from "./vue-ui-accordion
|
|
11
|
-
import { u as He } from "./useNestedProp-
|
|
12
|
-
import { _ as Mt } from "./PackageVersion-
|
|
13
|
-
import { P as zt } from "./PenAndPaper-
|
|
4
|
+
import { _ as Nt } from "./Title-PkqdmDqN.js";
|
|
5
|
+
import { u as Pt, U as St } from "./usePrinter-D0_MYOSc.js";
|
|
6
|
+
import { _ as Vt } from "./Tooltip-m3Z3Wlu2.js";
|
|
7
|
+
import { L as Ee } from "./Legend-Ci1axdG_.js";
|
|
8
|
+
import It from "./vue-ui-skeleton-Cb2qrhYT.js";
|
|
9
|
+
import Ot from "./BaseIcon-CL3j-fI9.js";
|
|
10
|
+
import Ft from "./vue-ui-accordion-CbgAyykZ.js";
|
|
11
|
+
import { u as He } from "./useNestedProp-nx1ZIRNV.js";
|
|
12
|
+
import { _ as Mt } from "./PackageVersion-Cchpqacn.js";
|
|
13
|
+
import { P as zt } from "./PenAndPaper-BKH98f-S.js";
|
|
14
14
|
import { u as At } from "./useUserOptionState-BIvW1Kz7.js";
|
|
15
|
-
import { _ as We } from "./Shape-
|
|
15
|
+
import { _ as We } from "./Shape-Cvp52J0c.js";
|
|
16
16
|
import { _ as Bt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
17
17
|
const Dt = ["id"], Rt = ["onClick"], Ut = ["xmlns", "viewBox"], Xt = ["width", "height"], Et = ["id"], Ht = ["stop-color"], Wt = ["stop-color"], Gt = { key: 1 }, jt = ["x", "y", "width", "height", "fill", "rx"], Yt = ["x", "y", "width", "height", "fill", "rx", "stroke", "stroke-width"], qt = ["x", "y", "width", "height", "fill", "rx", "stroke", "stroke-width"], Kt = ["x2", "y1", "y2", "stroke", "stroke-width"], Jt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Qt = ["x", "y", "text-anchor", "font-size", "fill", "font-weight"], Zt = ["x", "y", "font-size", "fill", "font-weight"], ea = ["x", "y", "font-size", "fill", "font-weight"], ta = ["x", "y", "font-size", "fill", "font-weight"], aa = ["y", "width", "height", "fill", "onMouseenter"], la = {
|
|
18
18
|
key: 6,
|
|
@@ -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-DBFjPsZ3.cjs"),ge=require("./useResponsive-BJ7DTGpm.cjs"),Me=require("./Title-ByUzU0ju.cjs"),fe=require("./usePrinter-NpeVna5L.cjs"),Ae=require("./Tooltip-D0I2_wrW.cjs"),me=require("./Legend-BGxT3Yv0.cjs"),Re=require("./vue-ui-skeleton-20TN6Ch2.cjs"),qe=require("./BaseIcon-5jC5U27p.cjs"),Ue=require("./vue-ui-accordion-BB0V98cT.cjs"),be=require("./useNestedProp-C6A3gxy9.cjs"),He=require("./PackageVersion-X1kVHC-z.cjs"),Xe=require("./PenAndPaper-ChPMqRX7.cjs"),je=require("./useUserOptionState-BgepsfED.cjs"),ke=require("./Shape-kTprcCU0.cjs"),We=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Ge=["id"],Ye=["onClick"],Ke=["xmlns","viewBox"],Je=["width","height"],Qe=["id"],Ze=["stop-color"],et=["stop-color"],tt={key:1},lt=["x","y","width","height","fill","rx"],at=["x","y","width","height","fill","rx","stroke","stroke-width"],ot=["x","y","width","height","fill","rx","stroke","stroke-width"],nt=["x2","y1","y2","stroke","stroke-width"],rt=["x1","x2","y1","y2","stroke","stroke-width"],ut=["x","y","text-anchor","font-size","fill","font-weight"],st=["x","y","font-size","fill","font-weight"],it=["x","y","font-size","fill","font-weight"],ct=["x","y","font-size","fill","font-weight"],dt=["y","width","height","fill","onMouseenter"],vt={key:6,class:"vue-data-ui-watermark"},ht=["onClick"],pt={style:"width:100%;padding-top: 36px;position:relative"},yt={class:"vue-ui-data-table"},gt={key:0},ft={style:{width:"100%"}},mt=["data-cell"],bt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},kt=["data-cell"],Ct={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},_t=["data-cell"],xt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Nt=["data-cell"],wt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},$t=["data-cell"],St={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Vt=["data-cell"],Bt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Tt=["data-cell"],Et={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Lt={__name:"vue-ui-vertical-bar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(Ce,{expose:_e,emit:xe}){const f=Ce;e.useCssVars(a=>({"6df2c512":a.tdo}));const{vue_ui_vertical_bar:Ne}=n.useConfig(),we=e.useSlots(),E=e.computed(()=>!!f.dataset&&f.dataset.length),y=e.ref(n.createUid()),$e=e.ref(null),O=e.ref(!1),I=e.ref(""),L=e.ref(0),Se=e.ref(null),X=e.ref(0),S=e.ref(null),j=e.ref(null),M=e.ref(null),W=e.ref(null),G=e.ref(null),Y=e.ref(0),A=e.ref(0),t=e.computed({get:()=>Q(),set:a=>a}),{userOptionsVisible:R,setUserOptionsVisibility:K,keepUserOptionState:J}=je.useUserOptionState({config:t.value});function Q(){const a=be.useNestedProp({userConfig:f.config,defaultConfig:Ne});return a.theme?{...be.useNestedProp({userConfig:n.themes.vue_ui_vertical_bar[a.theme]||f.config,defaultConfig:a}),customPalette:n.themePalettes[a.theme]||n.palette}:a}e.watch(()=>f.config,a=>{t.value=Q(),R.value=!t.value.showOnChartHover,re(),Y.value+=1,A.value+=1,s.value=t.value.style.chart.layout.bars.height,c.value=t.value.style.chart.layout.bars.gap},{deep:!0}),e.watch(()=>f.dataset,z,{deep:!0});const{isPrinting:Z,isImaging:ee,generatePdf:te,generateImage:le}=fe.usePrinter({elementId:`vue-ui-vertical-bar_${y.value}`,fileName:t.value.style.chart.title.text||"vue-ui-vertical-bar"}),Ve=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),ae=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),oe=e.ref(null),ne=e.ref(!1),Be=e.computed(()=>t.value.table.responsiveBreakpoint),P=e.ref(null);e.onMounted(()=>{re()});function re(){if(n.objectIsEmpty(f.dataset)&&n.error({componentName:"VueUiVerticalBar",type:"dataset"}),L.value=f.dataset.flatMap(a=>a.children&&a.children.length>0?a.children.length:1).reduce((a,o)=>a+o,0),Te(),t.value.responsive){const a=ge.throttle(()=>{const{width:o,height:l}=ge.useResponsive({chart:S.value,title:t.value.style.chart.title.text?j.value:null,legend:t.value.style.chart.legend.show?M.value:null,source:W.value,noTitle:G.value});ie.value=o,s.value=l/L.value-c.value*2});P.value=new ResizeObserver(a),P.value.observe(S.value.parentNode)}}e.onBeforeUnmount(()=>{P.value&&P.value.disconnect()});function Te(){new ResizeObserver(o=>{o.forEach(l=>{ne.value=l.contentRect.width<Be.value})}).observe(oe.value)}const g=e.ref({showTable:t.value.table.show,sortDesc:t.value.style.chart.layout.bars.sort==="desc",showTooltip:t.value.style.chart.tooltip.show}),ue=e.computed(()=>g.value.sortDesc),x=e.computed(()=>(f.dataset.forEach((a,o)=>{!a.value&&!a.children&&n.error({componentName:"VueUiVerticalBar",type:"datasetAttributeEmpty",property:`value (index ${o})`}),a.children&&(n.objectIsEmpty(a.children)?n.error({componentName:"VueUiVerticalBar",type:"datasetAttributeEmpty",property:`children (index ${o})`}):a.children.forEach((l,r)=>{[null,void 0].includes(l.name)&&n.error({componentName:"VueUiVerticalBar",type:"datasetSerieAttribute",property:"name",key:"children",index:r})}))}),f.dataset.map((a,o)=>{const l=`vertical_parent_${o}_${y.value}`,r=a.children&&a.children.length>0,v=n.checkNaN(a.value?a.value:r?a.children.map(p=>p.value||0).reduce((p,C)=>p+C,0):0),d=v>=0?1:-1;return{...a,id:l,absoluteIndex:o,shape:"square",opacity:b.value.includes(l)?.5:1,value:Math.abs(v),sign:d,hasChildren:r,isChild:!1,segregate:()=>B(l),isSegregated:b.value.includes(l),color:n.convertColorToHex(a.color)||ae.value[o]||n.palette[o]||n.palette[o%n.palette.length],children:!a.children||!a.children.length?[]:a.children.toSorted(D.value?()=>0:(p,C)=>ue.value?C.value-p.value:p.value-C.value).map((p,C)=>({...p,value:n.checkNaN(Math.abs(p.value)),absoluteIndex:o,sign:p.value>=0?1:-1,isChild:!0,parentId:l,parentName:a.name,parentValue:v,parentSign:d,id:`vertical_child_${o}_${C}_${y.value}`,childIndex:C,color:n.convertColorToHex(p.color)||n.convertColorToHex(a.color)||ae.value[o]||n.palette[o]||n.palette[o%n.palette.length]})).map((p,C)=>({...p,isFirstChild:C===0,isLastChild:C===a.children.length-1}))}}).toSorted(D.value?()=>0:(a,o)=>ue.value?o.value-a.value:a.value-o.value))),se=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),Ee=e.computed(()=>(s.value+c.value)*L.value),ie=e.ref(512),i=e.computed(()=>({width:ie.value,height:Ee.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:i.value.padding.top+i.value.padding.bottom+i.value.height,top:i.value.padding.top,left:i.value.padding.left,right:i.value.width-i.value.padding.right,bottom:i.value.padding.top+i.value.height,width:i.value.width-(i.value.padding.left+i.value.padding.right)}));function z(){L.value=N.value.flatMap(a=>a.children&&a.children.length>0?a.children.length:1).reduce((a,o)=>a+o,0)}const b=e.ref([]);function B(a){b.value.includes(a)?b.value=b.value.filter(o=>o!==a):b.value.push(a),z(),xe("selectLegend",N.value)}const N=e.computed(()=>x.value.filter(a=>!b.value.includes(a.id))),k=e.computed(()=>N.value.map(a=>Math.abs(a.value)).reduce((a,o)=>a+o,0));function ce(a,o=!1,l=0){return o?n.dataLabel({v:n.checkNaN(Math.abs(a)/k.value*100),s:"%",r:l}):Math.abs(a)/k.value}const w=e.computed(()=>N.value.flatMap(a=>a.hasChildren?a.children:a)),$=e.computed(()=>w.value.map(a=>a.sign).includes(-1)),Le=e.computed(()=>Math.max(...N.value.flatMap(a=>a.children&&a.children.length?Math.max(...a.children.map(o=>o.value)):a.value)));function h(a){const o=a/Le.value;return u.value.width/($.value?2:1)*o}function Pe(a){return h(a)+u.value.left}function T(a,o){const l=N.value.find(d=>d.id===a.parentId),r=u.value.top+(c.value+s.value)*o,v=l.children.length*(c.value+s.value);return{y:r+v/2-t.value.style.chart.layout.bars.parentLabels.fontSize,name:l.name,value:[void 0,NaN,null].includes(l.value)?"":l.sign===1?l.value:-l.value,percentageToTotal:isNaN(l.value/k.value)?"":ce(l.value,!0,t.value.style.chart.layout.bars.dataLabels.percentage.roundingPercentage),sign:l.sign}}function ze(){return N.value}const q=e.ref(null),U=e.ref(null);function De(a,o){U.value={datapoint:a,seriesIndex:o,series:x.value,config:t.value},O.value=!0,q.value=a.id;let l="";const r=a.isChild?a.parentName:a.name,v=a.isChild?a.name:"",d=t.value.style.chart.tooltip.customFormat;n.isFunction(d)&&n.functionReturnsString(()=>d({datapoint:a,series:x.value,config:t.value,seriesIndex:o}))?I.value=d({datapoint:a,series:x.value,config:t.value,seriesIndex:o}):(l+=`<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 60 60" height="14" width="14"><rect x="0" y="0" height="60" width="60" rx="5" stroke="none" fill="${a.color}"/>${we.pattern?`<rect x="0" y="0" height="60" width="60" rx="5" stroke="none" fill="url(#pattern_${y.value}_${a.absoluteIndex})"/>`:""}</svg> ${r}</div>
|
|
3
3
|
${v?`<div>${v}</div>`:""}
|
|
4
4
|
</div>`,t.value.style.chart.tooltip.showValue&&(l+=`<div>${t.value.translations.value}: <b>${n.applyDataLabel(t.value.style.chart.layout.bars.dataLabels.value.formatter,a.sign===1?a.value:-a.value,n.dataLabel({p:t.value.style.chart.tooltip.prefix,v:a.sign===1?a.value:-a.value,s:t.value.style.chart.tooltip.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:a,seriesIndex:o})}</b></div>`),t.value.style.chart.tooltip.showPercentage&&(l+=`<div>${t.value.translations.percentageToTotal} : <b>${n.dataLabel({v:Math.abs(a.value)/k.value*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage})}</b></div>`,a.isChild&&(l+=`<div>${t.value.translations.percentageToSerie}: <b>${n.dataLabel({v:Math.abs(a.value)/Math.abs(a.parentValue)*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage})}</b></div>`)),I.value=`<div style="text-align:left">${l}</div>`)}function de(a,o,l,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&&a>=0?-a:a),n.dataLabel({p:t.value.style.chart.layout.bars.dataLabels.value.prefix,v:n.checkNaN(r===-1&&a>=0?-a:a),s:t.value.style.chart.layout.bars.dataLabels.value.suffix,r:t.value.style.chart.layout.bars.dataLabels.value.roundingValue}),{datapoint:o,seriesIndex:l}),d=`(${ce(a,!0,t.value.style.chart.layout.bars.dataLabels.percentage.roundingPercentage)})`;return`${v}${t.value.style.chart.layout.bars.dataLabels.percentage.show?` ${d}`:""}`}const m=e.computed(()=>{const a=[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(l=>l.isChild?l.isFirstChild?{color:l.color,parentName:l.parentName,parentValue:l.parentValue,percentageToTotal:l.parentValue/k.value,childName:l.name,childValue:l.sign===1?l.value:-l.value,childPercentageToParent:Math.abs(l.value)/Math.abs(l.parentValue),childPercentageToTotal:Math.abs(l.value)/k.value}:{color:"",parentName:"",parentValue:"",percentageToTotal:"",childName:l.name,childValue:l.sign===1?l.value:-l.value,childPercentageToParent:Math.abs(l.value)/Math.abs(l.parentValue),childPercentageToTotal:Math.abs(l.value)/k.value}:{color:l.color,parentName:l.name,parentValue:l.sign===1?l.value:-l.value,percentageToTotal:Math.abs(l.value)/k.value,childName:"",childValue:"",childPercentageToParent:"",childPercentageToTotal:""});return{head:a,body:o}});function ve(){const a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[""]],o=m.value.head,l=m.value.body.map(d=>[d.parentName,d.parentValue,d.percentageToTotal,d.childName,d.childValue,d.childPercentageToParent,d.childPercentageToTotal]),r=a.concat([o]).concat(l),v=n.createCsvContent(r);n.downloadCsv({csvContent:v,title:t.value.style.chart.title.text||"vue-ui-vertical-bar"})}const V=e.ref(!1);function Fe(a){V.value=a,X.value+=1}function he(){g.value.showTable=!g.value.showTable}const Oe=e.ref({none:0,asc:1,desc:2}),_=e.ref(0),D=e.ref(!1);e.onMounted(()=>{["none","asc","desc"].includes(t.value.style.chart.layout.bars.sort)||n.error({componentName:"VueUiVerticalBar",type:"attributeWrongValue",property:"style.chart.layout.bars.sort",key:t.value.style.chart.layout.bars.sort}),_.value=Oe.value[t.value.style.chart.layout.bars.sort],g.value.sortDesc=_.value===2,D.value=_.value===0});function Ie(){_.value+=1,_.value>2&&(_.value=0)}function pe(){Ie(),g.value.sortDesc=_.value===2,D.value=_.value===0,z()}function ye(){g.value.showTooltip=!g.value.showTooltip}const F=e.ref(!1);function H(){F.value=!F.value}return _e({getData:ze,recalculateHeight:z,generatePdf:te,generateCsv:ve,generateImage:le,toggleTable:he,toggleSort:pe,toggleTooltip:ye,toggleAnnotator:H}),(a,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-vertical-bar ${V.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),ref_key:"verticalBarChart",ref:S,id:`vue-ui-vertical-bar_${y.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(K)(!0)),onMouseleave:o[6]||(o[6]=()=>e.unref(K)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Xe.PenAndPaper,{key:0,parent:S.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:F.value,onClose:H},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),Ve.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:G,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:j,style:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(Me._sfc_main,{key:`title_${Y.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&&E.value&&(e.unref(J)||e.unref(R))?(e.openBlock(),e.createBlock(fe.UserOptions,{ref_key:"details",ref:$e,key:`user_options_${X.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(ee),isPrinting:e.unref(Z),uid:y.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:V.value,isTooltip:g.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:Fe,onGeneratePdf:e.unref(te),onGenerateCsv:ve,onGenerateImage:e.unref(le),onToggleTable:he,onToggleSort:pe,onToggleTooltip:ye,onToggleAnnotator:H,style:e.normalizeStyle({visibility:e.unref(J)?e.unref(R)?"visible":"hidden":"visible"})},e.createSlots({_:2},[a.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,a.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,a.$slots.optionLabels?{name:"optionLabels",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionLabels",{},void 0,!0)]),key:"5"}:void 0,a.$slots.optionSort?{name:"optionSort",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionSort",{},void 0,!0)]),key:"6"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:r})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:r})),void 0,!0)]),key:"7"}:void 0,a.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:r})=>[e.renderSlot(a.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,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:M},[(e.openBlock(),e.createBlock(me.Legend,{key:`legend_top_${A.value}`,legendSet:x.value,config:se.value,onClickMarker:o[0]||(o[0]=({legend:l})=>B(l.id))},e.createSlots({item:e.withCtx(({legend:l,index:r})=>[e.createElementVNode("div",{"data-cy-legend-item":"",onClick:v=>B(l.id),style:e.normalizeStyle(`opacity:${b.value.includes(l.id)?.5:1}`)},e.toDisplayString(l.name)+": "+e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.bars.dataLabels.value.formatter,l.value,e.unref(n.dataLabel)({p:t.value.style.chart.legend.prefix,v:l.value,s:t.value.style.chart.legend.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:l,seriesIndex:r})),13,Ye)]),_:2},[a.$slots.pattern?{name:"legend-pattern",fn:e.withCtx(({legend:l,index:r})=>[e.createVNode(ke._sfc_main,{shape:l.shape,radius:30,stroke:"none",plot:{x:30,y:30},fill:`url(#pattern_${y.value}_${r})`},null,8,["shape","fill"])]),key:"0"}:void 0]),1032,["legendSet","config"]))],512)):e.createCommentVNode("",!0),E.value?(e.openBlock(),e.createElementBlock("svg",{key:5,xmlns:e.unref(n.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":V.value,"vue-data-ui-fulscreen--off":!V.value}),viewBox:`0 0 ${i.value.width<=0?10:i.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(He._sfc_main),a.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:i.value.width<=0?10:i.value.width,height:u.value.fullHeight<=0?10:u.value.fullHeight,style:{pointerEvents:"none"}},[e.renderSlot(a.$slots,"chart-background",{},void 0,!0)],8,Je)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(l,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{x1:"0%",y1:"0%",x2:"100%",y2:"0%",id:`vertical_bar_gradient_${y.value}_${r}`},[e.createElementVNode("stop",{offset:"0%","stop-color":l.color},null,8,Ze),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(n.setOpacity)(e.unref(n.shiftHue)(l.color,.03),100-t.value.style.chart.layout.bars.gradientIntensity)},null,8,et)],8,Qe))),256)),a.$slots.pattern?(e.openBlock(),e.createElementBlock("g",tt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,l=>(e.openBlock(),e.createElementBlock("defs",null,[e.renderSlot(a.$slots,"pattern",e.normalizeProps(e.guardReactiveProps({seriesIndex:l.absoluteIndex,patternId:`pattern_${y.value}_${l.absoluteIndex}`})),void 0,!0)]))),256))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:e.unref(n.checkNaN)($.value?u.value.left+u.value.width/2-(l.sign===1?0:h(l.value)<=0?1e-4:h(l.value)):u.value.left),y:u.value.top+(c.value+s.value)*r,width:e.unref(n.checkNaN)(h(l.value)<=0?1e-4:h(l.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,lt)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:e.unref(n.checkNaN)($.value?u.value.left+u.value.width/2-(l.sign===1?0:h(l.value)<=0?1e-4:h(l.value)):u.value.left),y:u.value.top+(c.value+s.value)*r,width:e.unref(n.checkNaN)(h(l.value)<=0?1e-4:h(l.value)),height:s.value<=0?1e-4:s.value,fill:t.value.style.chart.layout.bars.useGradient?`url(#vertical_bar_gradient_${y.value}_${r})`:e.unref(n.setOpacity)(l.color,t.value.style.chart.layout.bars.fillOpacity),rx:t.value.style.chart.layout.bars.borderRadius,stroke:t.value.style.chart.layout.bars.useStroke?l.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,at),a.$slots.pattern?(e.openBlock(),e.createElementBlock("rect",{key:0,x:e.unref(n.checkNaN)($.value?u.value.left+u.value.width/2-(l.sign===1?0:h(l.value)<=0?1e-4:h(l.value)):u.value.left),y:u.value.top+(c.value+s.value)*r,width:e.unref(n.checkNaN)(h(l.value)<=0?1e-4:h(l.value)),height:s.value<=0?1e-4:s.value,fill:`url(#pattern_${y.value}_${l.absoluteIndex})`,rx:t.value.style.chart.layout.bars.borderRadius,stroke:t.value.style.chart.layout.bars.useStroke?l.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,ot)):e.createCommentVNode("",!0),(!l.isChild||l.isLastChild)&&t.value.style.chart.layout.separators.show&&r!==w.value.length-1?(e.openBlock(),e.createElementBlock("line",{key:1,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,nt)):e.createCommentVNode("",!0),$.value&&t.value.style.chart.layout.separators.show?(e.openBlock(),e.createElementBlock("line",{key:2,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,rt)):e.createCommentVNode("",!0),e.createElementVNode("text",{x:$.value?u.value.left+u.value.width/2+(l.sign===1?-12:12)+(l.sign===1?-t.value.style.chart.layout.bars.dataLabels.offsetX:t.value.style.chart.layout.bars.dataLabels.offsetX):Pe(l.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||l.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(de(l.value,l,r,l.sign)),9,ut),(l.isChild||!l.hasChildren)&&t.value.style.chart.layout.bars.nameLabels.show?(e.openBlock(),e.createElementBlock("text",{key:3,"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(l.name),9,st)):e.createCommentVNode("",!0),l.isChild&&l.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(l,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(l,r).name),9,it)):e.createCommentVNode("",!0),l.isChild&&l.childIndex===0&&t.value.style.chart.layout.bars.parentLabels.show?(e.openBlock(),e.createElementBlock("text",{key:5,x:3+t.value.style.chart.layout.bars.parentLabels.offsetX,y:T(l,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(de(T(l,r).value),T(l,r),r,l.parentSign||l.sign),9,ct)):e.createCommentVNode("",!0),e.createElementVNode("rect",{"data-cy-trap":"",x:0,y:u.value.top+(c.value+s.value)*r-c.value/2,width:i.value.width<=0?1e-4:i.value.width,height:s.value+c.value<=0?1e-4:s.value+c.value,fill:q.value===l.id?e.unref(n.setOpacity)(t.value.style.chart.layout.highlighter.color,t.value.style.chart.layout.highlighter.opacity):"transparent",onMouseenter:v=>De(l,r),onMouseleave:o[1]||(o[1]=v=>{Se.value=null,O.value=!1,q.value=null})},null,40,dt)]))),256)),e.renderSlot(a.$slots,"svg",{svg:i.value},void 0,!0)],14,Ke)):e.createCommentVNode("",!0),a.$slots.watermark?(e.openBlock(),e.createElementBlock("div",vt,[e.renderSlot(a.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(Z)||e.unref(ee)})),void 0,!0)])):e.createCommentVNode("",!0),E.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Re.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:M},[(e.openBlock(),e.createBlock(me.Legend,{key:`legend_bottom_${A.value}`,legendSet:x.value,config:se.value,onClickMarker:o[2]||(o[2]=({legend:l})=>B(l.id))},e.createSlots({item:e.withCtx(({legend:l,index:r})=>[e.createElementVNode("div",{onClick:v=>B(l.id),style:e.normalizeStyle(`opacity:${b.value.includes(l.id)?.5:1}`)},e.toDisplayString(l.name)+": "+e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.bars.dataLabels.value.formatter,l.value,e.unref(n.dataLabel)({p:t.value.style.chart.legend.prefix,v:l.value,s:t.value.style.chart.legend.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:l,seriesIndex:r})),13,ht)]),_:2},[a.$slots.pattern?{name:"legend-pattern",fn:e.withCtx(({legend:l,index:r})=>[e.createVNode(ke._sfc_main,{shape:l.shape,radius:30,stroke:"none",plot:{x:30,y:30},fill:`url(#pattern_${y.value}_${r})`},null,8,["shape","fill"])]),key:"0"}:void 0]),1032,["legendSet","config"]))],512)):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"legend",{legend:x.value},void 0,!0),a.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:9,ref_key:"source",ref:W,dir:"auto"},[e.renderSlot(a.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(Ae._sfc_main,{show:g.value.showTooltip&&O.value&&b.value.length<f.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:S.value,content:I.value,isFullscreen:V.value,isCustom:t.value.style.chart.tooltip.customFormat&&typeof t.value.style.chart.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(a.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...U.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(a.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...U.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isFullscreen","isCustom"]),E.value?(e.openBlock(),e.createBlock(Ue.default,{key:10,hideDetails:"",config:{open:g.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:oe,class:"vue-ui-vertical-bar-table"},[e.createElementVNode("div",pt,[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]=l=>g.value.showTable=!1),onKeypress:o[4]||(o[4]=e.withKeys(l=>g.value.showTable=!1,["enter"]))},[e.createVNode(qe.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":ne.value})},[e.createElementVNode("table",yt,[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",gt,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(m.value.head,l=>(e.openBlock(),e.createElementBlock("th",{style:e.normalizeStyle(`outline:${t.value.table.th.outline}`)},[e.createElementVNode("div",ft,e.toDisplayString(l),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(k.value)?"":k.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(m.value.body,(l,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":m.value.head[0]??""},[e.createElementVNode("div",bt,[l.color?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(`color:${l.color};margin-right:3px`)},"⬤",4)):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(l.parentName),1)])],12,mt),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":m.value.head[1]??""},[e.createElementVNode("div",Ct,e.toDisplayString(t.value.table.td.prefix)+e.toDisplayString(["",NaN,void 0].includes(l.parentValue)?"":l.parentValue.toFixed(t.value.table.td.roundingValue))+e.toDisplayString(t.value.table.td.suffix),1)],12,kt),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":m.value.head[2]??""},[e.createElementVNode("div",xt,e.toDisplayString(["",NaN,void 0].includes(l.percentageToTotal)?"":`${(l.percentageToTotal*100).toFixed(t.value.table.td.roundingPercentage)}%`),1)],12,_t),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":m.value.head[3]??""},[e.createElementVNode("div",wt,e.toDisplayString(l.childName),1)],12,Nt),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":m.value.head[4]??""},[e.createElementVNode("div",St,e.toDisplayString(t.value.table.td.prefix)+e.toDisplayString(["",NaN,void 0].includes(l.childValue)?"":l.childValue.toFixed(t.value.table.td.roundingValue))+e.toDisplayString(t.value.table.td.suffix),1)],12,$t),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":m.value.head[5]??""},[e.createElementVNode("div",Bt,e.toDisplayString(["",NaN,void 0].includes(l.childPercentageToParent)?"":`${(l.childPercentageToParent*100).toFixed(t.value.table.td.roundingPercentage)}%`),1)],12,Vt),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":m.value.head[6]??""},[e.createElementVNode("div",Et,e.toDisplayString(["",NaN,void 0].includes(l.childPercentageToTotal)?"":`${(l.childPercentageToTotal*100).toFixed(t.value.table.td.roundingPercentage)}%`),1)],12,Tt)],6))),256))])])],2)])],512)]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,Ge))}},Pt=We._export_sfc(Lt,[["__scopeId","data-v-086d7789"]]);exports.default=Pt;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-KJL8ra_6.cjs"),ye=require("./useResponsive-BJ7DTGpm.cjs"),Ie=require("./Title-D-6pIV0l.cjs"),ge=require("./usePrinter-pDOF3CfL.cjs"),ze=require("./Tooltip-CNox4F8U.cjs"),Fe=require("./DataTable-wN-jvOfe.cjs"),Oe=require("./Legend-DqGE1lkA.cjs"),Ae=require("./vue-ui-skeleton-D_YCUi1y.cjs"),De=require("./vue-ui-accordion-4-dyMgJA.cjs"),me=require("./useNestedProp-Bu958azG.cjs"),qe=require("./PackageVersion-Dn-t7tbm.cjs"),Me=require("./PenAndPaper-DFXJJink.cjs"),Re=require("./useUserOptionState-BgepsfED.cjs"),Ue=require("./Shape-D7IbPjU8.cjs"),je=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),be=L=>(e.pushScopeId("data-v-8a0b99ad"),L=L(),e.popScopeId(),L),Ge=["id"],We=["xmlns","viewBox"],He=["id"],Ye=["stop-color"],Xe=["stop-color"],Je=["id"],Ke=be(()=>e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:2},null,-1)),Qe=be(()=>e.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1)),Ze=[Ke,Qe],et=["x","y","height","width"],tt=["height","width"],lt={key:0},at=["rx","x","y","height","width","stroke","stroke-width","filter"],ot=["rx","x","y","height","width","fill","stroke","stroke-width","filter"],rt={key:1},nt=["rx","x","y","height","width","fill","filter"],ut=["x","y","height","width","filter"],st={key:0},it={key:1},ct={key:2},dt={key:3},vt=["onMouseover","x","y","height","width"],pt={key:5,class:"vue-data-ui-watermark"},ht=["onClick"],ft={key:0},yt={key:1},gt=["innerHTML"],mt={__name:"vue-ui-waffle",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(L,{expose:ke,emit:we}){const p=L,{vue_ui_waffle:Ce}=u.useConfig(),xe=e.useSlots(),T=e.computed(()=>!!p.dataset&&p.dataset.length),f=e.ref(u.createUid()),Be=e.ref(null),A=e.ref(!1),D=e.ref(""),B=e.ref(null),G=e.ref(0),_=e.ref(null),W=e.ref(null),H=e.ref(null),Y=e.ref(null),X=e.ref(null),J=e.ref(0),K=e.ref(0),Q=e.ref(0),t=e.computed({get:()=>te(),set:l=>l}),{userOptionsVisible:q,setUserOptionsVisibility:Z,keepUserOptionState:ee}=Re.useUserOptionState({config:t.value});function te(){const l=me.useNestedProp({userConfig:p.config,defaultConfig:Ce});return l.theme?{...me.useNestedProp({userConfig:u.themes.vue_ui_waffle[l.theme]||p.config,defaultConfig:l}),customPalette:u.themePalettes[l.theme]||u.palette}:l}e.watch(()=>p.config,l=>{t.value=te(),q.value=!t.value.showOnChartHover,le(),J.value+=1,K.value+=1,Q.value+=1},{deep:!0});const E=e.ref(null);function le(){if(u.objectIsEmpty(p.dataset)?u.error({componentName:"VueUiWaffle",type:"dataset"}):p.dataset.forEach((l,o)=>{u.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(a=>{u.error({componentName:"VueUiWaffle",type:"datasetSerieAttribute",property:a,index:o})})}),t.value.responsive){const l=ye.throttle(()=>{const{width:o,height:a}=ye.useResponsive({chart:_.value,title:t.value.style.chart.title.text?W.value:null,legend:t.value.style.chart.legend.show?H.value:null,source:Y.value,noTitle:X.value});C.value.width=o,C.value.height=a,y.value.width=o,y.value.height=a});E.value=new ResizeObserver(l),E.value.observe(_.value.parentNode)}}e.onMounted(()=>{le()}),e.onBeforeUnmount(()=>{E.value&&E.value.disconnect()});const{isPrinting:ae,isImaging:oe,generatePdf:re,generateImage:ne}=ge.usePrinter({elementId:`vue-ui-waffle_${f.value}`,fileName:t.value.style.chart.title.text||"vue-ui-waffle"}),_e=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),ue=e.computed(()=>u.convertCustomPalette(t.value.customPalette)),w=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),C=e.ref({height:512,width:512}),y=e.ref({top:0,left:0,height:512,width:512}),g=e.computed(()=>(y.value.width-t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.spaceBetween)/t.value.style.chart.layout.grid.size),m=e.computed(()=>(y.value.height-t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.spaceBetween)/t.value.style.chart.layout.grid.size),P=e.computed(()=>y.value.width/t.value.style.chart.layout.grid.size),I=e.computed(()=>y.value.height/t.value.style.chart.layout.grid.size);function se(l){const o=t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.size,a=l.reduce((h,j)=>h+j,0),r=l.map(h=>h/a*o),n=r.map(Math.floor),i=r.map(h=>h%1);let v=o-n.reduce((h,j)=>h+j,0);for(;v>0;){let h=i.indexOf(Math.max(...i));n[h]+=1,i[h]=0,v-=1}return n}function ie(){return p.dataset.map((l,o)=>({...l,color:u.convertColorToHex(l.color)||ue.value[o]||u.palette[o]||u.palette[o%u.palette.length],uid:`serie_${o}`,absoluteIndex:o}))}const M=e.computed(()=>ie()),c=e.ref(M.value);e.watch(()=>p.dataset,l=>{c.value=ie()},{deep:!0});const Se=e.computed(()=>{const l=c.value.filter((o,a)=>!d.value.includes(o.uid)).map((o,a)=>(o.values||[]).reduce((r,n)=>r+n,0));return se(l)}),$e=e.computed(()=>{const l=c.value.map((o,a)=>(o.values||[]).reduce((r,n)=>r+n));return se(l)}),V=e.computed(()=>(p.dataset.forEach((l,o)=>{[null,void 0].includes(l.values)&&u.error({componentName:"VueUiWaffle",type:"datasetSerieAttribute",property:"values (number[])",index:o})}),c.value.filter((l,o)=>!d.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 Le(){return Ne.value.map(l=>({name:l.name,color:l.color,value:l.value,proportion:l.proportion}))}const Pe=e.computed(()=>{let l=0;return V.value.map((o,a)=>{const r=l,n=r+o.proportion,i=[];for(let v=Math.floor(r);v<Math.floor(n);v+=1)i.push(v);return l=n,{...o,start:r,rects:i}})}),s=e.computed(()=>Pe.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}))),S=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)*(g.value+t.value.style.chart.layout.grid.spaceBetween),y:(t.value.style.chart.layout.grid.vertical?a:o)*(m.value+t.value.style.chart.layout.grid.spaceBetween)+y.value.top});return l}),d=e.ref([]),x=e.ref(!1),ce=e.ref(null),de=e.ref(null);function ve(l){if(!t.value.useAnimation){d.value.includes(l)?d.value=d.value.filter(n=>n!==l):d.value.length<$.value.length-1&&$.value.length>1&&d.value.push(l);return}const o=M.value.find(n=>n.uid===l).values.reduce((n,i)=>n+i,0),a=c.value.find(n=>n.uid===l).values.reduce((n,i)=>n+i,0);let r=a;if(d.value.includes(l)){let i=function(){r>n?(cancelAnimationFrame(ce.value),c.value=c.value.map((v,h)=>v.uid===l?{...v,values:[n]}:v),x.value=!1):(x.value=!0,r+=n*.025,c.value=c.value.map((v,h)=>v.uid===l?{...v,values:[r]}:v),ce.value=requestAnimationFrame(i))};d.value=d.value.filter(v=>v!==l);const n=o;i()}else if(d.value.length<$.value.length-1&&$.value.length>1){let n=function(){r<a/100?(cancelAnimationFrame(de.value),d.value.push(l),c.value=c.value.map((i,v)=>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),de.value=requestAnimationFrame(n))};n()}we("selectLegend",V.value.map(n=>({name:n.name,color:n.color,value:n.value,proportion:n.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]||u.palette[o]||u.palette[o%u.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:d.value.includes(l.uid)?.5:1,segregate:()=>ve(l.uid),isSegregated:d.value.includes(l.uid)}))),Ve=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":""})),b=e.computed(()=>V.value.map(l=>l.value).reduce((l,o)=>l+o,0)),R=e.ref(null);function Te(l){if(d.value.length===p.dataset.length)return;const o=s.value[l];R.value={datapoint:o,seriesIndex:o.absoluteIndex,series:c.value,config:t.value},A.value=!0,B.value=s.value[l].serieIndex;const a=t.value.style.chart.tooltip.customFormat;if(u.isFunction(a)&&u.functionReturnsString(()=>a({seriesIndex:s.value[l].absoluteIndex,datapoint:o,series:c.value,config:t.value})))D.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 60 60" height="14" width="14"><rect x="0" y="0" height="60" width="60" stroke="none" rx="1" fill="${o.color}" />${xe.pattern?`<rect x="0" y="0" height="60" width="60" stroke="none" rx="1" stroke="none" fill="url(#pattern_${f.value}_${o.absoluteIndex})"/>`:""}</svg>`,t.value.style.chart.tooltip.showValue&&(r+=`<b>${u.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,o.value,u.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 n=u.dataLabel({v:o.value/b.value*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage});t.value.style.chart.tooltip.showValue?r+=`<span>(${n})</span></div>`:r+=`<b>${n}%</b></div>`}D.value=r}}const k=e.computed(()=>{const l=V.value.map(a=>({name:a.name,color:a.color})),o=V.value.map(a=>a.value);return{head:l,body:o}});function z(l){return t.value.useBlurOnHover&&![null,void 0].includes(B.value)&&B.value!==l?`url(#blur_${f.value})`:""}function pe(){e.nextTick(()=>{const l=k.value.head.map((r,n)=>[[r.name],[k.value.body[n]],[isNaN(k.value.body[n]/b.value)?"-":k.value.body[n]/b.value*100]]),o=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(l),a=u.createCsvContent(o);u.downloadCsv({csvContent:a,title:t.value.style.chart.title.text||"vue-ui-waffle"})})}const F=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>',u.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,b.value,u.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:b.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue})),"100%"],o=k.value.head.map((n,i)=>[{color:n.color,name:n.name},u.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,k.value.body[i],u.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:k.value.body[i],s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue})),isNaN(k.value.body[i]/b.value)?"-":u.dataLabel({v:k.value.body[i]/b.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 Ee(l){N.value=l,G.value+=1}function he(){w.value.showTable=!w.value.showTable}function fe(){w.value.showTooltip=!w.value.showTooltip}const O=e.ref(!1);function U(){O.value=!O.value}return ke({getData:Le,generatePdf:re,generateCsv:pe,generateImage:ne,toggleTable:he,toggleTooltip:fe,toggleAnnotator:U}),(l,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-waffle ${N.value?"vue-data-ui-wrapper-fullscreen":""}`),ref_key:"waffleChart",ref:_,id:`vue-ui-waffle_${f.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(Z)(!0)),onMouseleave:o[4]||(o[4]=()=>e.unref(Z)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Me.PenAndPaper,{key:0,parent:_.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:O.value,onClose:U},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),_e.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:X,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:W,style:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(Ie._sfc_main,{key:`title_${J.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&&T.value&&(e.unref(ee)||e.unref(q))?(e.openBlock(),e.createBlock(ge.UserOptions,{ref_key:"details",ref:Be,key:`user_options_${G.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(ae),isImaging:e.unref(oe),uid:f.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:w.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:_.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:O.value,onToggleFullscreen:Ee,onGeneratePdf:e.unref(re),onGenerateCsv:pe,onGenerateImage:e.unref(ne),onToggleTable:he,onToggleTooltip:fe,onToggleAnnotator:U,style:e.normalizeStyle({visibility:e.unref(ee)?e.unref(q)?"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),T.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(u.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":N.value,"vue-data-ui-fulscreen--off":!N.value}),viewBox:`0 0 ${C.value.width<=0?10:C.value.width} ${C.value.height<=0?10:C.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(qe._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_${f.value}_${r}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(u.setOpacity)(e.unref(u.shiftHue)(a.color,.05),100-t.value.style.chart.layout.rect.gradientIntensity)},null,8,Ye),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,Xe)],8,He))),256))]),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${f.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},Ze,8,Je)]),t.value.useCustomCells&&s.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(S.value,(a,r)=>(e.openBlock(),e.createElementBlock("foreignObject",{x:a.x,y:a.y,height:m.value<=0?1e-4:m.value,width:g.value<=0?1e-4:g.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,et))),256)):e.createCommentVNode("",!0),!s.value.length&&!t.value.useCustomCells?(e.openBlock(),e.createElementBlock("rect",{key:1,x:12,y:12,height:y.value.height-24,width:y.value.width-24,rx:3,fill:"none",stroke:"black"},null,8,tt)):s.value.length&&!t.value.useCustomCells?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[l.$slots.pattern?(e.openBlock(),e.createElementBlock("g",lt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.value,a=>(e.openBlock(),e.createElementBlock("defs",null,[e.renderSlot(l.$slots,"pattern",e.normalizeProps(e.guardReactiveProps({seriesIndex:a.absoluteIndex,patternId:`pattern_${f.value}_${a.absoluteIndex}`})),void 0,!0)]))),256))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.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:m.value<=0?1e-4:m.value,width:g.value<=0?1e-4:g.value,fill:"white",stroke:t.value.style.chart.layout.rect.stroke,"stroke-width":t.value.style.chart.layout.rect.strokeWidth,filter:z(s.value[r].serieIndex)},null,8,at))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.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:m.value<=0?1e-4:m.value,width:g.value<=0?1e-4:g.value,fill:t.value.style.chart.layout.rect.useGradient&&t.value.style.chart.layout.rect.gradientIntensity>0?`url(#gradient_${f.value}_${r})`:s.value[r].color,stroke:t.value.style.chart.layout.rect.stroke,"stroke-width":t.value.style.chart.layout.rect.strokeWidth,filter:z(s.value[r].serieIndex)},null,8,ot))),256)),l.$slots.pattern?(e.openBlock(),e.createElementBlock("g",rt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.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:m.value<=0?1e-4:m.value,width:g.value<=0?1e-4:g.value,fill:`url(#pattern_${f.value}_${s.value[r].absoluteIndex})`,stroke:"none",filter:z(s.value[r].serieIndex)},null,8,nt))),256))])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.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:P.value*t.value.style.chart.layout.grid.size<=0?1e-4:P.value*t.value.style.chart.layout.grid.size,filter:z(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 ${P.value/12}px;color:${e.unref(u.adaptColorToBackground)(s.value[r].color)};gap:2px`)},[t.value.style.chart.layout.labels.captions.showSerieName?(e.openBlock(),e.createElementBlock("span",st,e.toDisplayString(t.value.style.chart.layout.labels.captions.serieNameAbbreviation?e.unref(u.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",it,e.toDisplayString(e.unref(u.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",ct," ("+e.toDisplayString(e.unref(u.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,s.value[r].value,e.unref(u.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",dt,e.toDisplayString(e.unref(u.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,s.value[r].value,e.unref(u.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,ut)):e.createCommentVNode("",!0)],64))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.value,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{onMouseover:n=>Te(r),onMouseleave:o[0]||(o[0]=n=>{A.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:P.value<=0?1e-4:P.value,fill:"transparent",stroke:"none"},null,40,vt))),256)),e.renderSlot(l.$slots,"svg",{svg:C.value},void 0,!0)],14,We)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",pt,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(ae)||e.unref(oe)})),void 0,!0)])):e.createCommentVNode("",!0),T.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ae.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:H},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(Oe.Legend,{key:`legend_${Q.value}`,legendSet:$.value,config:Ve.value,onClickMarker:o[1]||(o[1]=({legend:a})=>ve(a.uid))},e.createSlots({item:e.withCtx(({legend:a})=>[e.createElementVNode("div",{onClick:r=>a.segregate(),style:e.normalizeStyle(`opacity:${d.value.includes(a.uid)?.5:1}`)},[e.createTextVNode(e.toDisplayString(a.name)+": "+e.toDisplayString(e.unref(u.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,a.value,e.unref(u.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),d.value.includes(a.uid)?(e.openBlock(),e.createElementBlock("span",yt," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",ft," ("+e.toDisplayString(isNaN(a.value/b.value)?"-":e.unref(u.dataLabel)({v:a.value/b.value*100,s:"%",r:t.value.style.chart.legend.roundingPercentage,isAnimating:x.value}))+") ",1))],12,ht)]),_:2},[l.$slots.pattern?{name:"legend-pattern",fn:e.withCtx(({legend:a,index:r})=>[e.createVNode(Ue._sfc_main,{shape:a.shape,radius:30,stroke:"none",plot:{x:30,y:30},fill:`url(#pattern_${f.value}_${r})`},null,8,["shape","fill"])]),key:"0"}:void 0]),1032,["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:Y,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(ze._sfc_main,{show:w.value.showTooltip&&A.value&&d.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:_.value,content:D.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({...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","backgroundOpacity","position","offsetY","parent","content","isCustom","fontSize","isFullscreen"]),T.value?(e.openBlock(),e.createBlock(De.default,{key:8,hideDetails:"",config:{open:w.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(Fe.DataTable,{key:`table_${K.value}`,colNames:F.value.colNames,head:F.value.head,body:F.value.body,config:F.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=>w.value.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createElementVNode("div",{innerHTML:a,style:{display:"flex","align-items":"center"}},null,8,gt)]),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,Ge))}},bt=je._export_sfc(mt,[["__scopeId","data-v-8a0b99ad"]]);exports.default=bt;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-DBFjPsZ3.cjs"),ye=require("./useResponsive-BJ7DTGpm.cjs"),Ie=require("./Title-ByUzU0ju.cjs"),ge=require("./usePrinter-NpeVna5L.cjs"),ze=require("./Tooltip-D0I2_wrW.cjs"),Fe=require("./DataTable-fHBZCQD_.cjs"),Oe=require("./Legend-BGxT3Yv0.cjs"),Ae=require("./vue-ui-skeleton-20TN6Ch2.cjs"),De=require("./vue-ui-accordion-BB0V98cT.cjs"),me=require("./useNestedProp-C6A3gxy9.cjs"),qe=require("./PackageVersion-X1kVHC-z.cjs"),Me=require("./PenAndPaper-ChPMqRX7.cjs"),Re=require("./useUserOptionState-BgepsfED.cjs"),Ue=require("./Shape-kTprcCU0.cjs"),je=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),be=L=>(e.pushScopeId("data-v-8a0b99ad"),L=L(),e.popScopeId(),L),Ge=["id"],We=["xmlns","viewBox"],He=["id"],Ye=["stop-color"],Xe=["stop-color"],Je=["id"],Ke=be(()=>e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:2},null,-1)),Qe=be(()=>e.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1)),Ze=[Ke,Qe],et=["x","y","height","width"],tt=["height","width"],lt={key:0},at=["rx","x","y","height","width","stroke","stroke-width","filter"],ot=["rx","x","y","height","width","fill","stroke","stroke-width","filter"],rt={key:1},nt=["rx","x","y","height","width","fill","filter"],ut=["x","y","height","width","filter"],st={key:0},it={key:1},ct={key:2},dt={key:3},vt=["onMouseover","x","y","height","width"],pt={key:5,class:"vue-data-ui-watermark"},ht=["onClick"],ft={key:0},yt={key:1},gt=["innerHTML"],mt={__name:"vue-ui-waffle",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(L,{expose:ke,emit:we}){const p=L,{vue_ui_waffle:Ce}=u.useConfig(),xe=e.useSlots(),T=e.computed(()=>!!p.dataset&&p.dataset.length),f=e.ref(u.createUid()),Be=e.ref(null),A=e.ref(!1),D=e.ref(""),B=e.ref(null),G=e.ref(0),_=e.ref(null),W=e.ref(null),H=e.ref(null),Y=e.ref(null),X=e.ref(null),J=e.ref(0),K=e.ref(0),Q=e.ref(0),t=e.computed({get:()=>te(),set:l=>l}),{userOptionsVisible:q,setUserOptionsVisibility:Z,keepUserOptionState:ee}=Re.useUserOptionState({config:t.value});function te(){const l=me.useNestedProp({userConfig:p.config,defaultConfig:Ce});return l.theme?{...me.useNestedProp({userConfig:u.themes.vue_ui_waffle[l.theme]||p.config,defaultConfig:l}),customPalette:u.themePalettes[l.theme]||u.palette}:l}e.watch(()=>p.config,l=>{t.value=te(),q.value=!t.value.showOnChartHover,le(),J.value+=1,K.value+=1,Q.value+=1},{deep:!0});const E=e.ref(null);function le(){if(u.objectIsEmpty(p.dataset)?u.error({componentName:"VueUiWaffle",type:"dataset"}):p.dataset.forEach((l,o)=>{u.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(a=>{u.error({componentName:"VueUiWaffle",type:"datasetSerieAttribute",property:a,index:o})})}),t.value.responsive){const l=ye.throttle(()=>{const{width:o,height:a}=ye.useResponsive({chart:_.value,title:t.value.style.chart.title.text?W.value:null,legend:t.value.style.chart.legend.show?H.value:null,source:Y.value,noTitle:X.value});C.value.width=o,C.value.height=a,y.value.width=o,y.value.height=a});E.value=new ResizeObserver(l),E.value.observe(_.value.parentNode)}}e.onMounted(()=>{le()}),e.onBeforeUnmount(()=>{E.value&&E.value.disconnect()});const{isPrinting:ae,isImaging:oe,generatePdf:re,generateImage:ne}=ge.usePrinter({elementId:`vue-ui-waffle_${f.value}`,fileName:t.value.style.chart.title.text||"vue-ui-waffle"}),_e=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),ue=e.computed(()=>u.convertCustomPalette(t.value.customPalette)),w=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),C=e.ref({height:512,width:512}),y=e.ref({top:0,left:0,height:512,width:512}),g=e.computed(()=>(y.value.width-t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.spaceBetween)/t.value.style.chart.layout.grid.size),m=e.computed(()=>(y.value.height-t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.spaceBetween)/t.value.style.chart.layout.grid.size),P=e.computed(()=>y.value.width/t.value.style.chart.layout.grid.size),I=e.computed(()=>y.value.height/t.value.style.chart.layout.grid.size);function se(l){const o=t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.size,a=l.reduce((h,j)=>h+j,0),r=l.map(h=>h/a*o),n=r.map(Math.floor),i=r.map(h=>h%1);let v=o-n.reduce((h,j)=>h+j,0);for(;v>0;){let h=i.indexOf(Math.max(...i));n[h]+=1,i[h]=0,v-=1}return n}function ie(){return p.dataset.map((l,o)=>({...l,color:u.convertColorToHex(l.color)||ue.value[o]||u.palette[o]||u.palette[o%u.palette.length],uid:`serie_${o}`,absoluteIndex:o}))}const M=e.computed(()=>ie()),c=e.ref(M.value);e.watch(()=>p.dataset,l=>{c.value=ie()},{deep:!0});const Se=e.computed(()=>{const l=c.value.filter((o,a)=>!d.value.includes(o.uid)).map((o,a)=>(o.values||[]).reduce((r,n)=>r+n,0));return se(l)}),$e=e.computed(()=>{const l=c.value.map((o,a)=>(o.values||[]).reduce((r,n)=>r+n));return se(l)}),V=e.computed(()=>(p.dataset.forEach((l,o)=>{[null,void 0].includes(l.values)&&u.error({componentName:"VueUiWaffle",type:"datasetSerieAttribute",property:"values (number[])",index:o})}),c.value.filter((l,o)=>!d.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 Le(){return Ne.value.map(l=>({name:l.name,color:l.color,value:l.value,proportion:l.proportion}))}const Pe=e.computed(()=>{let l=0;return V.value.map((o,a)=>{const r=l,n=r+o.proportion,i=[];for(let v=Math.floor(r);v<Math.floor(n);v+=1)i.push(v);return l=n,{...o,start:r,rects:i}})}),s=e.computed(()=>Pe.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}))),S=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)*(g.value+t.value.style.chart.layout.grid.spaceBetween),y:(t.value.style.chart.layout.grid.vertical?a:o)*(m.value+t.value.style.chart.layout.grid.spaceBetween)+y.value.top});return l}),d=e.ref([]),x=e.ref(!1),ce=e.ref(null),de=e.ref(null);function ve(l){if(!t.value.useAnimation){d.value.includes(l)?d.value=d.value.filter(n=>n!==l):d.value.length<$.value.length-1&&$.value.length>1&&d.value.push(l);return}const o=M.value.find(n=>n.uid===l).values.reduce((n,i)=>n+i,0),a=c.value.find(n=>n.uid===l).values.reduce((n,i)=>n+i,0);let r=a;if(d.value.includes(l)){let i=function(){r>n?(cancelAnimationFrame(ce.value),c.value=c.value.map((v,h)=>v.uid===l?{...v,values:[n]}:v),x.value=!1):(x.value=!0,r+=n*.025,c.value=c.value.map((v,h)=>v.uid===l?{...v,values:[r]}:v),ce.value=requestAnimationFrame(i))};d.value=d.value.filter(v=>v!==l);const n=o;i()}else if(d.value.length<$.value.length-1&&$.value.length>1){let n=function(){r<a/100?(cancelAnimationFrame(de.value),d.value.push(l),c.value=c.value.map((i,v)=>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),de.value=requestAnimationFrame(n))};n()}we("selectLegend",V.value.map(n=>({name:n.name,color:n.color,value:n.value,proportion:n.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]||u.palette[o]||u.palette[o%u.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:d.value.includes(l.uid)?.5:1,segregate:()=>ve(l.uid),isSegregated:d.value.includes(l.uid)}))),Ve=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":""})),b=e.computed(()=>V.value.map(l=>l.value).reduce((l,o)=>l+o,0)),R=e.ref(null);function Te(l){if(d.value.length===p.dataset.length)return;const o=s.value[l];R.value={datapoint:o,seriesIndex:o.absoluteIndex,series:c.value,config:t.value},A.value=!0,B.value=s.value[l].serieIndex;const a=t.value.style.chart.tooltip.customFormat;if(u.isFunction(a)&&u.functionReturnsString(()=>a({seriesIndex:s.value[l].absoluteIndex,datapoint:o,series:c.value,config:t.value})))D.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 60 60" height="14" width="14"><rect x="0" y="0" height="60" width="60" stroke="none" rx="1" fill="${o.color}" />${xe.pattern?`<rect x="0" y="0" height="60" width="60" stroke="none" rx="1" stroke="none" fill="url(#pattern_${f.value}_${o.absoluteIndex})"/>`:""}</svg>`,t.value.style.chart.tooltip.showValue&&(r+=`<b>${u.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,o.value,u.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 n=u.dataLabel({v:o.value/b.value*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage});t.value.style.chart.tooltip.showValue?r+=`<span>(${n})</span></div>`:r+=`<b>${n}%</b></div>`}D.value=r}}const k=e.computed(()=>{const l=V.value.map(a=>({name:a.name,color:a.color})),o=V.value.map(a=>a.value);return{head:l,body:o}});function z(l){return t.value.useBlurOnHover&&![null,void 0].includes(B.value)&&B.value!==l?`url(#blur_${f.value})`:""}function pe(){e.nextTick(()=>{const l=k.value.head.map((r,n)=>[[r.name],[k.value.body[n]],[isNaN(k.value.body[n]/b.value)?"-":k.value.body[n]/b.value*100]]),o=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(l),a=u.createCsvContent(o);u.downloadCsv({csvContent:a,title:t.value.style.chart.title.text||"vue-ui-waffle"})})}const F=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>',u.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,b.value,u.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:b.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue})),"100%"],o=k.value.head.map((n,i)=>[{color:n.color,name:n.name},u.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,k.value.body[i],u.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:k.value.body[i],s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue})),isNaN(k.value.body[i]/b.value)?"-":u.dataLabel({v:k.value.body[i]/b.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 Ee(l){N.value=l,G.value+=1}function he(){w.value.showTable=!w.value.showTable}function fe(){w.value.showTooltip=!w.value.showTooltip}const O=e.ref(!1);function U(){O.value=!O.value}return ke({getData:Le,generatePdf:re,generateCsv:pe,generateImage:ne,toggleTable:he,toggleTooltip:fe,toggleAnnotator:U}),(l,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-waffle ${N.value?"vue-data-ui-wrapper-fullscreen":""}`),ref_key:"waffleChart",ref:_,id:`vue-ui-waffle_${f.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(Z)(!0)),onMouseleave:o[4]||(o[4]=()=>e.unref(Z)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Me.PenAndPaper,{key:0,parent:_.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:O.value,onClose:U},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),_e.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:X,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:W,style:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(Ie._sfc_main,{key:`title_${J.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&&T.value&&(e.unref(ee)||e.unref(q))?(e.openBlock(),e.createBlock(ge.UserOptions,{ref_key:"details",ref:Be,key:`user_options_${G.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(ae),isImaging:e.unref(oe),uid:f.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:w.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:_.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:O.value,onToggleFullscreen:Ee,onGeneratePdf:e.unref(re),onGenerateCsv:pe,onGenerateImage:e.unref(ne),onToggleTable:he,onToggleTooltip:fe,onToggleAnnotator:U,style:e.normalizeStyle({visibility:e.unref(ee)?e.unref(q)?"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),T.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(u.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":N.value,"vue-data-ui-fulscreen--off":!N.value}),viewBox:`0 0 ${C.value.width<=0?10:C.value.width} ${C.value.height<=0?10:C.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(qe._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_${f.value}_${r}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(u.setOpacity)(e.unref(u.shiftHue)(a.color,.05),100-t.value.style.chart.layout.rect.gradientIntensity)},null,8,Ye),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,Xe)],8,He))),256))]),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${f.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},Ze,8,Je)]),t.value.useCustomCells&&s.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(S.value,(a,r)=>(e.openBlock(),e.createElementBlock("foreignObject",{x:a.x,y:a.y,height:m.value<=0?1e-4:m.value,width:g.value<=0?1e-4:g.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,et))),256)):e.createCommentVNode("",!0),!s.value.length&&!t.value.useCustomCells?(e.openBlock(),e.createElementBlock("rect",{key:1,x:12,y:12,height:y.value.height-24,width:y.value.width-24,rx:3,fill:"none",stroke:"black"},null,8,tt)):s.value.length&&!t.value.useCustomCells?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[l.$slots.pattern?(e.openBlock(),e.createElementBlock("g",lt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.value,a=>(e.openBlock(),e.createElementBlock("defs",null,[e.renderSlot(l.$slots,"pattern",e.normalizeProps(e.guardReactiveProps({seriesIndex:a.absoluteIndex,patternId:`pattern_${f.value}_${a.absoluteIndex}`})),void 0,!0)]))),256))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.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:m.value<=0?1e-4:m.value,width:g.value<=0?1e-4:g.value,fill:"white",stroke:t.value.style.chart.layout.rect.stroke,"stroke-width":t.value.style.chart.layout.rect.strokeWidth,filter:z(s.value[r].serieIndex)},null,8,at))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.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:m.value<=0?1e-4:m.value,width:g.value<=0?1e-4:g.value,fill:t.value.style.chart.layout.rect.useGradient&&t.value.style.chart.layout.rect.gradientIntensity>0?`url(#gradient_${f.value}_${r})`:s.value[r].color,stroke:t.value.style.chart.layout.rect.stroke,"stroke-width":t.value.style.chart.layout.rect.strokeWidth,filter:z(s.value[r].serieIndex)},null,8,ot))),256)),l.$slots.pattern?(e.openBlock(),e.createElementBlock("g",rt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.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:m.value<=0?1e-4:m.value,width:g.value<=0?1e-4:g.value,fill:`url(#pattern_${f.value}_${s.value[r].absoluteIndex})`,stroke:"none",filter:z(s.value[r].serieIndex)},null,8,nt))),256))])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.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:P.value*t.value.style.chart.layout.grid.size<=0?1e-4:P.value*t.value.style.chart.layout.grid.size,filter:z(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 ${P.value/12}px;color:${e.unref(u.adaptColorToBackground)(s.value[r].color)};gap:2px`)},[t.value.style.chart.layout.labels.captions.showSerieName?(e.openBlock(),e.createElementBlock("span",st,e.toDisplayString(t.value.style.chart.layout.labels.captions.serieNameAbbreviation?e.unref(u.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",it,e.toDisplayString(e.unref(u.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",ct," ("+e.toDisplayString(e.unref(u.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,s.value[r].value,e.unref(u.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",dt,e.toDisplayString(e.unref(u.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,s.value[r].value,e.unref(u.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,ut)):e.createCommentVNode("",!0)],64))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.value,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{onMouseover:n=>Te(r),onMouseleave:o[0]||(o[0]=n=>{A.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:P.value<=0?1e-4:P.value,fill:"transparent",stroke:"none"},null,40,vt))),256)),e.renderSlot(l.$slots,"svg",{svg:C.value},void 0,!0)],14,We)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",pt,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(ae)||e.unref(oe)})),void 0,!0)])):e.createCommentVNode("",!0),T.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ae.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:H},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(Oe.Legend,{key:`legend_${Q.value}`,legendSet:$.value,config:Ve.value,onClickMarker:o[1]||(o[1]=({legend:a})=>ve(a.uid))},e.createSlots({item:e.withCtx(({legend:a})=>[e.createElementVNode("div",{onClick:r=>a.segregate(),style:e.normalizeStyle(`opacity:${d.value.includes(a.uid)?.5:1}`)},[e.createTextVNode(e.toDisplayString(a.name)+": "+e.toDisplayString(e.unref(u.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,a.value,e.unref(u.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),d.value.includes(a.uid)?(e.openBlock(),e.createElementBlock("span",yt," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",ft," ("+e.toDisplayString(isNaN(a.value/b.value)?"-":e.unref(u.dataLabel)({v:a.value/b.value*100,s:"%",r:t.value.style.chart.legend.roundingPercentage,isAnimating:x.value}))+") ",1))],12,ht)]),_:2},[l.$slots.pattern?{name:"legend-pattern",fn:e.withCtx(({legend:a,index:r})=>[e.createVNode(Ue._sfc_main,{shape:a.shape,radius:30,stroke:"none",plot:{x:30,y:30},fill:`url(#pattern_${f.value}_${r})`},null,8,["shape","fill"])]),key:"0"}:void 0]),1032,["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:Y,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(ze._sfc_main,{show:w.value.showTooltip&&A.value&&d.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:_.value,content:D.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({...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","backgroundOpacity","position","offsetY","parent","content","isCustom","fontSize","isFullscreen"]),T.value?(e.openBlock(),e.createBlock(De.default,{key:8,hideDetails:"",config:{open:w.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(Fe.DataTable,{key:`table_${K.value}`,colNames:F.value.colNames,head:F.value.head,body:F.value.body,config:F.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=>w.value.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createElementVNode("div",{innerHTML:a,style:{display:"flex","align-items":"center"}},null,8,gt)]),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,Ge))}},bt=je._export_sfc(mt,[["__scopeId","data-v-8a0b99ad"]]);exports.default=bt;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { useSlots as tt, computed as d, ref as v, watch as Ne, onMounted as lt, onBeforeUnmount as at, openBlock as s, createElementBlock as r, normalizeClass as Be, normalizeStyle as X, unref as c, createBlock as N, createCommentVNode as y, createSlots as Ve, withCtx as b, renderSlot as g, normalizeProps as B, guardReactiveProps as V, createVNode as ne, createElementVNode as x, Fragment as _, renderList as O, toDisplayString as A, createTextVNode as Me, nextTick as ot, pushScopeId as ut, popScopeId as st } from "vue";
|
|
2
|
-
import { u as rt, c as nt, t as it, a as vt, p as M, o as ct, e as ie, g as dt, b as ht, i as E, f as C, X as pt, s as yt, w as ft, G as gt, L as bt, d as mt, x as wt, y as kt, q as xt, r as _t } from "./index-
|
|
2
|
+
import { u as rt, c as nt, t as it, a as vt, p as M, o as ct, e as ie, g as dt, b as ht, i as E, f as C, X as pt, s as yt, w as ft, G as gt, L as bt, d as mt, x as wt, y as kt, q as xt, r as _t } from "./index-C2mIRYI5.js";
|
|
3
3
|
import { t as Ct, u as $t } from "./useResponsive-CoxXLe23.js";
|
|
4
|
-
import { _ as It } from "./Title-
|
|
5
|
-
import { u as Tt, U as St } from "./usePrinter-
|
|
6
|
-
import { _ as Pt } from "./Tooltip-
|
|
7
|
-
import { D as Lt } from "./DataTable-
|
|
8
|
-
import { L as Ot } from "./Legend-
|
|
9
|
-
import At from "./vue-ui-skeleton-
|
|
10
|
-
import Ft from "./vue-ui-accordion
|
|
11
|
-
import { u as De } from "./useNestedProp-
|
|
12
|
-
import { _ as zt } from "./PackageVersion-
|
|
13
|
-
import { P as Nt } from "./PenAndPaper-
|
|
4
|
+
import { _ as It } from "./Title-PkqdmDqN.js";
|
|
5
|
+
import { u as Tt, U as St } from "./usePrinter-D0_MYOSc.js";
|
|
6
|
+
import { _ as Pt } from "./Tooltip-m3Z3Wlu2.js";
|
|
7
|
+
import { D as Lt } from "./DataTable-DInI0nyj.js";
|
|
8
|
+
import { L as Ot } from "./Legend-Ci1axdG_.js";
|
|
9
|
+
import At from "./vue-ui-skeleton-Cb2qrhYT.js";
|
|
10
|
+
import Ft from "./vue-ui-accordion-CbgAyykZ.js";
|
|
11
|
+
import { u as De } from "./useNestedProp-nx1ZIRNV.js";
|
|
12
|
+
import { _ as zt } from "./PackageVersion-Cchpqacn.js";
|
|
13
|
+
import { P as Nt } from "./PenAndPaper-BKH98f-S.js";
|
|
14
14
|
import { u as Bt } from "./useUserOptionState-BIvW1Kz7.js";
|
|
15
|
-
import { _ as Vt } from "./Shape-
|
|
15
|
+
import { _ as Vt } from "./Shape-Cvp52J0c.js";
|
|
16
16
|
import { _ as Mt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
17
17
|
const Ue = (W) => (ut("data-v-8a0b99ad"), W = W(), st(), W), Dt = ["id"], Ut = ["xmlns", "viewBox"], Gt = ["id"], Rt = ["stop-color"], jt = ["stop-color"], Et = ["id"], Wt = /* @__PURE__ */ Ue(() => /* @__PURE__ */ x("feGaussianBlur", {
|
|
18
18
|
in: "SourceGraphic",
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { computed as p, ref as r, watch as H, onMounted as re, onBeforeUnmount as ue, openBlock as n, createElementBlock as c, normalizeStyle as A, unref as o, createBlock as w, createCommentVNode as v, createSlots as ie, withCtx as b, renderSlot as f, normalizeProps as I, guardReactiveProps as P, normalizeClass as Y, createVNode as ce, Fragment as ve, renderList as he, toDisplayString as de } from "vue";
|
|
2
|
-
import { u as fe, c as ye, t as pe, o as ge, e as me, w as W, X as ke, i as we, v as q, f as be } from "./index-
|
|
3
|
-
import { _ as Ce } from "./Title-
|
|
4
|
-
import { u as _e, U as $e } from "./usePrinter-
|
|
2
|
+
import { u as fe, c as ye, t as pe, o as ge, e as me, w as W, X as ke, i as we, v as q, f as be } from "./index-C2mIRYI5.js";
|
|
3
|
+
import { _ as Ce } from "./Title-PkqdmDqN.js";
|
|
4
|
+
import { u as _e, U as $e } from "./usePrinter-D0_MYOSc.js";
|
|
5
5
|
import { t as Oe, u as xe } from "./useResponsive-CoxXLe23.js";
|
|
6
|
-
import Ae from "./vue-ui-skeleton-
|
|
7
|
-
import { u as V } from "./useNestedProp-
|
|
8
|
-
import { _ as Ie } from "./PackageVersion-
|
|
9
|
-
import { P as Pe } from "./PenAndPaper-
|
|
6
|
+
import Ae from "./vue-ui-skeleton-Cb2qrhYT.js";
|
|
7
|
+
import { u as V } from "./useNestedProp-nx1ZIRNV.js";
|
|
8
|
+
import { _ as Ie } from "./PackageVersion-Cchpqacn.js";
|
|
9
|
+
import { P as Pe } from "./PenAndPaper-BKH98f-S.js";
|
|
10
10
|
import { u as Fe } from "./useUserOptionState-BIvW1Kz7.js";
|
|
11
11
|
import { _ as Se } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
12
12
|
const ze = ["id"], Me = ["xmlns", "viewBox"], Ne = ["width", "height"], Te = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-linecap"], Ue = ["cx", "cy", "r", "stroke", "stroke-width"], Le = ["x", "y", "font-size", "fill", "font-weight"], Xe = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-KJL8ra_6.cjs"),W=require("./Title-D-6pIV0l.cjs"),E=require("./usePrinter-pDOF3CfL.cjs"),M=require("./useResponsive-BJ7DTGpm.cjs"),J=require("./vue-ui-skeleton-D_YCUi1y.cjs"),T=require("./useNestedProp-Bu958azG.cjs"),K=require("./PackageVersion-Dn-t7tbm.cjs"),Q=require("./PenAndPaper-DFXJJink.cjs"),Z=require("./useUserOptionState-BgepsfED.cjs"),ee=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),te=["id"],ne=["xmlns","viewBox"],oe=["width","height"],le=["x1","x2","y1","y2","stroke","stroke-width","stroke-linecap"],ae=["cx","cy","r","stroke","stroke-width"],re=["x","y","font-size","fill","font-weight"],se={key:5,class:"vue-data-ui-watermark"},ue={__name:"vue-ui-wheel",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(V,{expose:q}){const c=V,{vue_ui_wheel:U}=s.useConfig(),p=e.computed(()=>!!c.dataset&&Object.keys(c.dataset).length),y=e.ref(s.createUid()),R=e.ref(null),w=e.ref(0),v=e.ref(null),C=e.ref(null),b=e.ref(null),B=e.ref(null),P=e.ref(0),t=e.computed({get:()=>_(),set:n=>n}),{userOptionsVisible:m,setUserOptionsVisibility:S,keepUserOptionState:N}=Z.useUserOptionState({config:t.value});function _(){const n=T.useNestedProp({userConfig:c.config,defaultConfig:U});return n.theme?{...T.useNestedProp({userConfig:s.themes.vue_ui_wheel[n.theme]||c.config,defaultConfig:n})}:n}e.watch(()=>c.config,n=>{t.value=_(),m.value=!t.value.showOnChartHover,z(),P.value+=1},{deep:!0});const{isPrinting:O,isImaging:x,generatePdf:$,generateImage:A}=E.usePrinter({elementId:y.value,fileName:t.value.style.chart.title.text||"vue-ui-wheel"}),L=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),l=e.ref({size:360,height:360,width:360}),g=e.ref(t.value.style.chart.layout.percentage.fontSize),i=e.computed(()=>({radius:Math.min(l.value.width,l.value.height)*.9/2,centerX:l.value.width/2,centerY:l.value.height/2}));function I(n,r=1){return{x:i.value.centerX+i.value.radius*Math.cos(29.85+n*Math.PI/180)*r,y:i.value.centerY+i.value.radius*Math.sin(29.85+n*Math.PI/180)*r}}const a=e.ref(t.value.style.chart.animation.use?0:c.dataset.percentage||0);e.watch(()=>c.dataset,n=>{t.value.style.chart.animation.use?F(n.percentage):a.value=n.percentage||0},{deep:!0});const d=e.ref(null);e.onMounted(()=>{z()});function z(){if(s.objectIsEmpty(c.dataset)&&s.error({componentName:"VueUiWheel",type:"dataset"}),F(c.dataset.percentage||0),t.value.responsive){const n=M.throttle(()=>{const{width:r,height:o}=M.useResponsive({chart:v.value,title:t.value.style.chart.title.text?C.value:null,source:b.value,noTitle:B.value});l.value.width=r,l.value.height=o,g.value=t.value.style.chart.layout.percentage.fontSize/360*Math.min(r,o)});d.value=new ResizeObserver(n),d.value.observe(v.value.parentNode)}}e.onBeforeUnmount(()=>{d.value&&d.value.disconnect()});function F(n){let r=t.value.style.chart.animation.speed;const o=Math.abs(n-a.value)/(r*120);function u(){a.value<n?a.value=Math.min(a.value+o,n):a.value>n&&(a.value=Math.max(a.value-o,n)),a.value!==n&&requestAnimationFrame(u)}u()}const j=e.computed(()=>{const n=[];for(let o=0;o<100;o+=1){const u=a.value>o?t.value.style.chart.layout.wheel.ticks.activeColor:t.value.style.chart.layout.wheel.ticks.inactiveColor,{x:H,y:X}=I(l.value.size/100*o),{x:D,y:Y}=I(l.value.size/100*o,t.value.style.chart.layout.wheel.ticks.sizeRatio);n.push({x1:H,y1:X,x2:D,y2:Y,color:t.value.style.chart.layout.wheel.ticks.gradient.show?s.shiftHue(u,o/100*(t.value.style.chart.layout.wheel.ticks.gradient.shiftHueIntensity/100)):u})}return n}),h=e.ref(!1);function G(n){h.value=n,w.value+=1}const f=e.ref(!1);function k(){f.value=!f.value}return q({generatePdf:$,generateImage:A,toggleAnnotator:k}),(n,r)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-wheel",ref_key:"wheelChart",ref:v,id:y.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:r[0]||(r[0]=()=>e.unref(S)(!0)),onMouseleave:r[1]||(r[1]=()=>e.unref(S)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Q.PenAndPaper,{key:0,parent:v.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:f.value,onClose:k},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),L.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:B,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:C,style:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(W._sfc_main,{key:`title_${P.value}`,config:{title:{cy:"wheel-title",...t.value.style.chart.title},subtitle:{cy:"wheel-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&p.value&&(e.unref(N)||e.unref(m))?(e.openBlock(),e.createBlock(E.UserOptions,{ref_key:"details",ref:R,key:`user_options_${w.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(O),isImaging:e.unref(x),uid:y.value,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,hasXls:!1,isFullscreen:h.value,position:t.value.userOptions.position,titles:{...t.value.userOptions.buttonTitles},hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:f.value,chartElement:v.value,onToggleFullscreen:G,onGeneratePdf:e.unref($),onGenerateImage:e.unref(A),onToggleAnnotator:k,style:e.normalizeStyle({visibility:e.unref(N)?e.unref(m)?"visible":"hidden":"visible"})},e.createSlots({_:2},[n.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(n.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,n.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(n.$slots,"optionImg",{},void 0,!0)]),key:"1"}:void 0,n.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:u})=>[e.renderSlot(n.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:u})),void 0,!0)]),key:"2"}:void 0,n.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:u})=>[e.renderSlot(n.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:u})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","position","titles","hasAnnotator","isAnnotation","chartElement","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(s.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":h.value,"vue-data-ui-fulscreen--off":!h.value}),viewBox:`0 0 ${l.value.width<=0?10:l.value.width} ${l.value.height<=0?10:l.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(K._sfc_main),n.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:l.value.width<=0?10:l.value.width,height:l.value.height<=0?10:l.value.height,style:{pointerEvents:"none"}},[e.renderSlot(n.$slots,"chart-background",{},void 0,!0)],8,oe)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(j.value,(o,u)=>(e.openBlock(),e.createElementBlock("line",{x1:o.x1,x2:o.x2,y1:o.y1,y2:o.y2,stroke:o.color,"stroke-width":5/360*Math.min(l.value.width,l.value.height),"stroke-linecap":t.value.style.chart.layout.wheel.ticks.rounded?"round":"butt",class:e.normalizeClass({"vue-ui-tick-animated":t.value.style.chart.animation.use&&u<=a.value})},null,10,le))),256)),t.value.style.chart.layout.innerCircle.show?(e.openBlock(),e.createElementBlock("circle",{key:1,cx:i.value.centerX,cy:i.value.centerY,r:i.value.radius*.8<=0?1e-4:i.value.radius*.8,stroke:t.value.style.chart.layout.innerCircle.stroke,"stroke-width":t.value.style.chart.layout.innerCircle.strokeWidth,fill:"none"},null,8,ae)):e.createCommentVNode("",!0),t.value.style.chart.layout.percentage.show?(e.openBlock(),e.createElementBlock("text",{key:2,x:i.value.centerX,y:i.value.centerY+g.value/3,"font-size":g.value,fill:t.value.style.chart.layout.wheel.ticks.gradient.show?e.unref(s.shiftHue)(t.value.style.chart.layout.wheel.ticks.activeColor,a.value/100*(t.value.style.chart.layout.wheel.ticks.gradient.shiftHueIntensity/100)):t.value.style.chart.layout.wheel.ticks.activeColor,"text-anchor":"middle","font-weight":t.value.style.chart.layout.percentage.bold?"bold":"normal",style:{"font-variant-numeric":"tabluar-nums"}},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.chart.layout.percentage.formatter,e.unref(s.checkNaN)(a.value),e.unref(s.dataLabel)({v:e.unref(s.checkNaN)(a.value),s:"%",r:t.value.style.chart.layout.percentage.rounding}))),9,re)):e.createCommentVNode("",!0),e.renderSlot(n.$slots,"svg",{svg:l.value},void 0,!0)],14,ne)):e.createCommentVNode("",!0),n.$slots.watermark?(e.openBlock(),e.createElementBlock("div",se,[e.renderSlot(n.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(O)||e.unref(x)})),void 0,!0)])):e.createCommentVNode("",!0),n.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:6,ref_key:"source",ref:b,dir:"auto"},[e.renderSlot(n.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(J.default,{key:7,config:{type:"wheel",style:{backgroundColor:t.value.style.chart.backgroundColor,wheel:{color:"#CCCCCC"}}}},null,8,["config"]))],44,te))}},ie=ee._export_sfc(ue,[["__scopeId","data-v-9a761d10"]]);exports.default=ie;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-DBFjPsZ3.cjs"),W=require("./Title-ByUzU0ju.cjs"),E=require("./usePrinter-NpeVna5L.cjs"),M=require("./useResponsive-BJ7DTGpm.cjs"),J=require("./vue-ui-skeleton-20TN6Ch2.cjs"),T=require("./useNestedProp-C6A3gxy9.cjs"),K=require("./PackageVersion-X1kVHC-z.cjs"),Q=require("./PenAndPaper-ChPMqRX7.cjs"),Z=require("./useUserOptionState-BgepsfED.cjs"),ee=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),te=["id"],ne=["xmlns","viewBox"],oe=["width","height"],le=["x1","x2","y1","y2","stroke","stroke-width","stroke-linecap"],ae=["cx","cy","r","stroke","stroke-width"],re=["x","y","font-size","fill","font-weight"],se={key:5,class:"vue-data-ui-watermark"},ue={__name:"vue-ui-wheel",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(V,{expose:q}){const c=V,{vue_ui_wheel:U}=s.useConfig(),p=e.computed(()=>!!c.dataset&&Object.keys(c.dataset).length),y=e.ref(s.createUid()),R=e.ref(null),w=e.ref(0),v=e.ref(null),C=e.ref(null),b=e.ref(null),B=e.ref(null),P=e.ref(0),t=e.computed({get:()=>_(),set:n=>n}),{userOptionsVisible:m,setUserOptionsVisibility:S,keepUserOptionState:N}=Z.useUserOptionState({config:t.value});function _(){const n=T.useNestedProp({userConfig:c.config,defaultConfig:U});return n.theme?{...T.useNestedProp({userConfig:s.themes.vue_ui_wheel[n.theme]||c.config,defaultConfig:n})}:n}e.watch(()=>c.config,n=>{t.value=_(),m.value=!t.value.showOnChartHover,z(),P.value+=1},{deep:!0});const{isPrinting:O,isImaging:x,generatePdf:$,generateImage:A}=E.usePrinter({elementId:y.value,fileName:t.value.style.chart.title.text||"vue-ui-wheel"}),L=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),l=e.ref({size:360,height:360,width:360}),g=e.ref(t.value.style.chart.layout.percentage.fontSize),i=e.computed(()=>({radius:Math.min(l.value.width,l.value.height)*.9/2,centerX:l.value.width/2,centerY:l.value.height/2}));function I(n,r=1){return{x:i.value.centerX+i.value.radius*Math.cos(29.85+n*Math.PI/180)*r,y:i.value.centerY+i.value.radius*Math.sin(29.85+n*Math.PI/180)*r}}const a=e.ref(t.value.style.chart.animation.use?0:c.dataset.percentage||0);e.watch(()=>c.dataset,n=>{t.value.style.chart.animation.use?F(n.percentage):a.value=n.percentage||0},{deep:!0});const d=e.ref(null);e.onMounted(()=>{z()});function z(){if(s.objectIsEmpty(c.dataset)&&s.error({componentName:"VueUiWheel",type:"dataset"}),F(c.dataset.percentage||0),t.value.responsive){const n=M.throttle(()=>{const{width:r,height:o}=M.useResponsive({chart:v.value,title:t.value.style.chart.title.text?C.value:null,source:b.value,noTitle:B.value});l.value.width=r,l.value.height=o,g.value=t.value.style.chart.layout.percentage.fontSize/360*Math.min(r,o)});d.value=new ResizeObserver(n),d.value.observe(v.value.parentNode)}}e.onBeforeUnmount(()=>{d.value&&d.value.disconnect()});function F(n){let r=t.value.style.chart.animation.speed;const o=Math.abs(n-a.value)/(r*120);function u(){a.value<n?a.value=Math.min(a.value+o,n):a.value>n&&(a.value=Math.max(a.value-o,n)),a.value!==n&&requestAnimationFrame(u)}u()}const j=e.computed(()=>{const n=[];for(let o=0;o<100;o+=1){const u=a.value>o?t.value.style.chart.layout.wheel.ticks.activeColor:t.value.style.chart.layout.wheel.ticks.inactiveColor,{x:H,y:X}=I(l.value.size/100*o),{x:D,y:Y}=I(l.value.size/100*o,t.value.style.chart.layout.wheel.ticks.sizeRatio);n.push({x1:H,y1:X,x2:D,y2:Y,color:t.value.style.chart.layout.wheel.ticks.gradient.show?s.shiftHue(u,o/100*(t.value.style.chart.layout.wheel.ticks.gradient.shiftHueIntensity/100)):u})}return n}),h=e.ref(!1);function G(n){h.value=n,w.value+=1}const f=e.ref(!1);function k(){f.value=!f.value}return q({generatePdf:$,generateImage:A,toggleAnnotator:k}),(n,r)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-wheel",ref_key:"wheelChart",ref:v,id:y.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:r[0]||(r[0]=()=>e.unref(S)(!0)),onMouseleave:r[1]||(r[1]=()=>e.unref(S)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Q.PenAndPaper,{key:0,parent:v.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:f.value,onClose:k},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),L.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:B,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:C,style:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(W._sfc_main,{key:`title_${P.value}`,config:{title:{cy:"wheel-title",...t.value.style.chart.title},subtitle:{cy:"wheel-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&p.value&&(e.unref(N)||e.unref(m))?(e.openBlock(),e.createBlock(E.UserOptions,{ref_key:"details",ref:R,key:`user_options_${w.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(O),isImaging:e.unref(x),uid:y.value,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,hasXls:!1,isFullscreen:h.value,position:t.value.userOptions.position,titles:{...t.value.userOptions.buttonTitles},hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:f.value,chartElement:v.value,onToggleFullscreen:G,onGeneratePdf:e.unref($),onGenerateImage:e.unref(A),onToggleAnnotator:k,style:e.normalizeStyle({visibility:e.unref(N)?e.unref(m)?"visible":"hidden":"visible"})},e.createSlots({_:2},[n.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(n.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,n.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(n.$slots,"optionImg",{},void 0,!0)]),key:"1"}:void 0,n.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:u})=>[e.renderSlot(n.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:u})),void 0,!0)]),key:"2"}:void 0,n.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:u})=>[e.renderSlot(n.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:u})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","position","titles","hasAnnotator","isAnnotation","chartElement","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(s.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":h.value,"vue-data-ui-fulscreen--off":!h.value}),viewBox:`0 0 ${l.value.width<=0?10:l.value.width} ${l.value.height<=0?10:l.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(K._sfc_main),n.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:l.value.width<=0?10:l.value.width,height:l.value.height<=0?10:l.value.height,style:{pointerEvents:"none"}},[e.renderSlot(n.$slots,"chart-background",{},void 0,!0)],8,oe)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(j.value,(o,u)=>(e.openBlock(),e.createElementBlock("line",{x1:o.x1,x2:o.x2,y1:o.y1,y2:o.y2,stroke:o.color,"stroke-width":5/360*Math.min(l.value.width,l.value.height),"stroke-linecap":t.value.style.chart.layout.wheel.ticks.rounded?"round":"butt",class:e.normalizeClass({"vue-ui-tick-animated":t.value.style.chart.animation.use&&u<=a.value})},null,10,le))),256)),t.value.style.chart.layout.innerCircle.show?(e.openBlock(),e.createElementBlock("circle",{key:1,cx:i.value.centerX,cy:i.value.centerY,r:i.value.radius*.8<=0?1e-4:i.value.radius*.8,stroke:t.value.style.chart.layout.innerCircle.stroke,"stroke-width":t.value.style.chart.layout.innerCircle.strokeWidth,fill:"none"},null,8,ae)):e.createCommentVNode("",!0),t.value.style.chart.layout.percentage.show?(e.openBlock(),e.createElementBlock("text",{key:2,x:i.value.centerX,y:i.value.centerY+g.value/3,"font-size":g.value,fill:t.value.style.chart.layout.wheel.ticks.gradient.show?e.unref(s.shiftHue)(t.value.style.chart.layout.wheel.ticks.activeColor,a.value/100*(t.value.style.chart.layout.wheel.ticks.gradient.shiftHueIntensity/100)):t.value.style.chart.layout.wheel.ticks.activeColor,"text-anchor":"middle","font-weight":t.value.style.chart.layout.percentage.bold?"bold":"normal",style:{"font-variant-numeric":"tabluar-nums"}},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.chart.layout.percentage.formatter,e.unref(s.checkNaN)(a.value),e.unref(s.dataLabel)({v:e.unref(s.checkNaN)(a.value),s:"%",r:t.value.style.chart.layout.percentage.rounding}))),9,re)):e.createCommentVNode("",!0),e.renderSlot(n.$slots,"svg",{svg:l.value},void 0,!0)],14,ne)):e.createCommentVNode("",!0),n.$slots.watermark?(e.openBlock(),e.createElementBlock("div",se,[e.renderSlot(n.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(O)||e.unref(x)})),void 0,!0)])):e.createCommentVNode("",!0),n.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:6,ref_key:"source",ref:b,dir:"auto"},[e.renderSlot(n.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(J.default,{key:7,config:{type:"wheel",style:{backgroundColor:t.value.style.chart.backgroundColor,wheel:{color:"#CCCCCC"}}}},null,8,["config"]))],44,te))}},ie=ee._export_sfc(ue,[["__scopeId","data-v-9a761d10"]]);exports.default=ie;
|