vue-data-ui 2.4.26 → 2.4.27

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.
Files changed (152) hide show
  1. package/dist/{Arrow-D_FJ0BNg.js → Arrow-DqxPKITt.js} +1 -1
  2. package/dist/{Arrow-Cvajb7Pp.cjs → Arrow-S0bKj06d.cjs} +1 -1
  3. package/dist/{BaseIcon-DeKj5tiF.cjs → BaseIcon-BEvRHM2R.cjs} +1 -1
  4. package/dist/{BaseIcon-CeiDtKER.js → BaseIcon-DdR74ekM.js} +1 -1
  5. package/dist/{DataTable-D-c7laSt.cjs → DataTable-CKYq5S0j.cjs} +1 -1
  6. package/dist/{DataTable-BmAybhqW.js → DataTable-DY9Joecu.js} +2 -2
  7. package/dist/{Legend-7EZhiUrH.js → Legend-CSG4maaN.js} +1 -1
  8. package/dist/{Legend-D_dNnmCH.cjs → Legend-EHKRwZ5N.cjs} +1 -1
  9. package/dist/{PackageVersion-BRMtBck7.js → PackageVersion-CRyyH_HB.js} +1 -1
  10. package/dist/{PackageVersion-C2JzxDlg.cjs → PackageVersion-C_Y8uWJM.cjs} +1 -1
  11. package/dist/{PenAndPaper-u9Nkiu0T.js → PenAndPaper-BF7qtcRe.js} +3 -3
  12. package/dist/{PenAndPaper-Bur5hR1K.cjs → PenAndPaper-CotnLxGh.cjs} +1 -1
  13. package/dist/{Shape-DoR3mblZ.js → Shape-B-_UZQAs.js} +1 -1
  14. package/dist/{Shape-DJY2D6fU.cjs → Shape-DKxW8u2N.cjs} +1 -1
  15. package/dist/{Slicer-DO6JA4zU.cjs → Slicer-BeNAVIli.cjs} +1 -1
  16. package/dist/{Slicer-AM-8gKgh.js → Slicer-CKVHmNoC.js} +2 -2
  17. package/dist/{Title-BJut0KCO.cjs → Title-C8WRomob.cjs} +1 -1
  18. package/dist/{Title-D_ljAKoY.js → Title-CfjKQsLl.js} +1 -1
  19. package/dist/{Tooltip-OW2BdLyv.cjs → Tooltip-0vzas_4d.cjs} +1 -1
  20. package/dist/{Tooltip-Cy8PyEK7.js → Tooltip-B3hfjJYk.js} +1 -1
  21. package/dist/index-Dgjlvd_3.cjs +9 -0
  22. package/dist/{index-CpjF4-PU.js → index-DtCryprM.js} +5 -1
  23. package/dist/style.css +1 -1
  24. package/dist/types/vue-data-ui.d.cts +4 -0
  25. package/dist/types/vue-data-ui.d.ts +4 -0
  26. package/dist/{useNestedProp-C7FKZW2F.cjs → useNestedProp-DMaPxyYb.cjs} +1 -1
  27. package/dist/{useNestedProp-DiDiQc6z.js → useNestedProp-tT95LfDr.js} +1 -1
  28. package/dist/{usePrinter-SEUTEAmF.cjs → usePrinter-Bd-68vBM.cjs} +1 -1
  29. package/dist/{usePrinter-CZ0Ro0M3.js → usePrinter-D4_doq3d.js} +1 -1
  30. package/dist/{vue-data-ui-CL2AoklI.js → vue-data-ui-BHbGLvb2.js} +59 -59
  31. package/dist/{vue-data-ui-37JLfniv.cjs → vue-data-ui-Cd8mwZKF.cjs} +1 -1
  32. package/dist/vue-data-ui.cjs +1 -1
  33. package/dist/vue-data-ui.js +1 -1
  34. package/dist/{vue-ui-3d-bar-BlEG4n0o.js → vue-ui-3d-bar-BUZbm9kJ.js} +9 -9
  35. package/dist/{vue-ui-3d-bar-C8Qb1ifR.cjs → vue-ui-3d-bar-wE79cKJb.cjs} +1 -1
  36. package/dist/{vue-ui-accordion-D6Uwxwl0.js → vue-ui-accordion-C3p9yjUl.js} +3 -3
  37. package/dist/{vue-ui-accordion-iiUNHeV-.cjs → vue-ui-accordion-DAf1jeI5.cjs} +1 -1
  38. package/dist/{vue-ui-age-pyramid-CNWM-Vso.js → vue-ui-age-pyramid-BSRlLxEA.js} +10 -10
  39. package/dist/{vue-ui-age-pyramid-DjagE43x.cjs → vue-ui-age-pyramid-DtG_nStX.cjs} +1 -1
  40. package/dist/{vue-ui-annotator-BZe3neqk.js → vue-ui-annotator-DCBMlGAw.js} +1 -1
  41. package/dist/{vue-ui-annotator-CMVPAd95.cjs → vue-ui-annotator-g2vIoGtS.cjs} +1 -1
  42. package/dist/{vue-ui-bullet-O15K1or8.js → vue-ui-bullet-B95xQ8WK.js} +8 -8
  43. package/dist/{vue-ui-bullet-UVtGYVKm.cjs → vue-ui-bullet-C5jEVTbE.cjs} +1 -1
  44. package/dist/{vue-ui-candlestick-w_RkjrEB.js → vue-ui-candlestick-BWM5iWqv.js} +11 -11
  45. package/dist/{vue-ui-candlestick-CNmA8fQF.cjs → vue-ui-candlestick-eqL2uYci.cjs} +1 -1
  46. package/dist/{vue-ui-carousel-table-8bz5Gw6i.js → vue-ui-carousel-table-CyDUz_Gq.js} +28 -27
  47. package/dist/vue-ui-carousel-table-y7VQhC4I.cjs +1 -0
  48. package/dist/{vue-ui-chestnut-DHjsPGHg.cjs → vue-ui-chestnut-CVf4jIy8.cjs} +1 -1
  49. package/dist/{vue-ui-chestnut-C9kaPI5L.js → vue-ui-chestnut-DhqYkzID.js} +8 -8
  50. package/dist/{vue-ui-cursor-a11eeJlM.js → vue-ui-cursor-BZnAcEqs.js} +2 -2
  51. package/dist/{vue-ui-cursor-Dzc6b6gE.cjs → vue-ui-cursor-oziVE5oM.cjs} +1 -1
  52. package/dist/{vue-ui-dashboard-CfA-FY0a.cjs → vue-ui-dashboard-D1f7-Glw.cjs} +1 -1
  53. package/dist/{vue-ui-dashboard-B3cTzTF7.js → vue-ui-dashboard-TqWW5RI5.js} +2 -2
  54. package/dist/{vue-ui-digits-CHI-rZzx.js → vue-ui-digits-DASTO7R_.js} +2 -2
  55. package/dist/{vue-ui-digits-xq4pLzXW.cjs → vue-ui-digits-DQynEn2d.cjs} +1 -1
  56. package/dist/{vue-ui-donut-zCAjAqo7.cjs → vue-ui-donut-BR8Mg-n2.cjs} +1 -1
  57. package/dist/{vue-ui-donut-D4w732yO.js → vue-ui-donut-DzyBoMNU.js} +11 -11
  58. package/dist/{vue-ui-donut-evolution-BcEI-XQ5.js → vue-ui-donut-evolution-Da4D9v3R.js} +11 -11
  59. package/dist/{vue-ui-donut-evolution-DE-b4ShC.cjs → vue-ui-donut-evolution-NbhQnprN.cjs} +1 -1
  60. package/dist/{vue-ui-dumbbell-CRB1jDkp.js → vue-ui-dumbbell-CTvRHWls.js} +10 -10
  61. package/dist/{vue-ui-dumbbell-BHHVRpof.cjs → vue-ui-dumbbell-DcJN9Ioz.cjs} +1 -1
  62. package/dist/{vue-ui-flow---9a6iGC.cjs → vue-ui-flow-9oyLtjZU.cjs} +1 -1
  63. package/dist/{vue-ui-flow-CO_kwR_-.js → vue-ui-flow-aww0Tcl3.js} +9 -9
  64. package/dist/{vue-ui-funnel-BtFW0Wex.cjs → vue-ui-funnel-B9Y1bLEB.cjs} +1 -1
  65. package/dist/{vue-ui-funnel-BvLLEW0u.js → vue-ui-funnel-CqAc4qrq.js} +8 -8
  66. package/dist/{vue-ui-galaxy-CzBNCWvB.js → vue-ui-galaxy-C5BIxb4j.js} +11 -11
  67. package/dist/{vue-ui-galaxy-BpR7EuVp.cjs → vue-ui-galaxy-CuSb6qU7.cjs} +1 -1
  68. package/dist/{vue-ui-gauge-CjOu6oqn.cjs → vue-ui-gauge-DmJY5Dfj.cjs} +1 -1
  69. package/dist/{vue-ui-gauge-BLCrA4Z3.js → vue-ui-gauge-Lbp4fSO6.js} +7 -7
  70. package/dist/{vue-ui-gizmo-D550LJP_.cjs → vue-ui-gizmo-B2eu5Cgm.cjs} +1 -1
  71. package/dist/{vue-ui-gizmo-CbALdGSE.js → vue-ui-gizmo-BhGFYCMO.js} +3 -3
  72. package/dist/{vue-ui-heatmap--SVDRyYF.cjs → vue-ui-heatmap-Cg8NbY9c.cjs} +1 -1
  73. package/dist/{vue-ui-heatmap-GxECNV1K.js → vue-ui-heatmap-pCtD1kfU.js} +10 -10
  74. package/dist/{vue-ui-kpi-BeI-Uc3G.js → vue-ui-kpi-D8JYWPV_.js} +3 -3
  75. package/dist/{vue-ui-kpi-DmTDeYTk.cjs → vue-ui-kpi-f_UBt1sc.cjs} +1 -1
  76. package/dist/{vue-ui-mini-loader-Cq5NzQke.js → vue-ui-mini-loader-WEjnMYYV.js} +2 -2
  77. package/dist/{vue-ui-mini-loader-BPCifmPi.cjs → vue-ui-mini-loader-mPxJfkT2.cjs} +1 -1
  78. package/dist/{vue-ui-molecule-BYnnHVSs.js → vue-ui-molecule-3ZmmBGb2.js} +11 -11
  79. package/dist/{vue-ui-molecule-DDOtYnvu.cjs → vue-ui-molecule-OJyvyLfY.cjs} +1 -1
  80. package/dist/{vue-ui-mood-radar-DSph-BzR.js → vue-ui-mood-radar-BNtsGg0D.js} +11 -11
  81. package/dist/{vue-ui-mood-radar-CXxUmCON.cjs → vue-ui-mood-radar-C_WpF4wB.cjs} +1 -1
  82. package/dist/{vue-ui-nested-donuts-DxcqrnAz.cjs → vue-ui-nested-donuts-B2jLubqd.cjs} +1 -1
  83. package/dist/{vue-ui-nested-donuts-D-FKanpn.js → vue-ui-nested-donuts-jtOuJhbR.js} +11 -11
  84. package/dist/{vue-ui-onion-BTXdZW1F.cjs → vue-ui-onion-BFSYk82P.cjs} +1 -1
  85. package/dist/{vue-ui-onion-DNdKU_tZ.js → vue-ui-onion-DgzhhXA7.js} +11 -11
  86. package/dist/{vue-ui-parallel-coordinate-plot-CGvkjk3D.cjs → vue-ui-parallel-coordinate-plot-BFlAjzs3.cjs} +1 -1
  87. package/dist/{vue-ui-parallel-coordinate-plot-C08Mm2-q.js → vue-ui-parallel-coordinate-plot-C5AKz42e.js} +12 -12
  88. package/dist/{vue-ui-quadrant-DGtHGV8w.cjs → vue-ui-quadrant-BiApJsNE.cjs} +1 -1
  89. package/dist/{vue-ui-quadrant-CK8lzvET.js → vue-ui-quadrant-CqBNV30b.js} +12 -12
  90. package/dist/{vue-ui-quick-chart-C7chIyP1.js → vue-ui-quick-chart-DBbzmkAK.js} +9 -9
  91. package/dist/{vue-ui-quick-chart-DNh8sXOc.cjs → vue-ui-quick-chart-DsGbmmwr.cjs} +1 -1
  92. package/dist/{vue-ui-radar-CvklQTxx.js → vue-ui-radar-C2biHwNz.js} +12 -12
  93. package/dist/{vue-ui-radar-DIX_qX_c.cjs → vue-ui-radar-C4xga7lb.cjs} +1 -1
  94. package/dist/{vue-ui-rating-WfJhW6Yh.cjs → vue-ui-rating-AF6PTMiG.cjs} +1 -1
  95. package/dist/{vue-ui-rating-DkWhtX7L.js → vue-ui-rating-F4DM4bFb.js} +2 -2
  96. package/dist/{vue-ui-relation-circle-Bt2kayAM.js → vue-ui-relation-circle-B7ORrYO6.js} +7 -7
  97. package/dist/{vue-ui-relation-circle-UkI3rSGh.cjs → vue-ui-relation-circle-CMxzMy2N.cjs} +1 -1
  98. package/dist/{vue-ui-rings-6RqShpuH.cjs → vue-ui-rings-CgCIB6BD.cjs} +1 -1
  99. package/dist/{vue-ui-rings-CHIqJDps.js → vue-ui-rings-Doq5O6yQ.js} +11 -11
  100. package/dist/{vue-ui-scatter-Dl0lSlc1.cjs → vue-ui-scatter-Bw4_ui3D.cjs} +1 -1
  101. package/dist/{vue-ui-scatter-B-L_xBjF.js → vue-ui-scatter-DNS48w0P.js} +12 -12
  102. package/dist/{vue-ui-screenshot-BNGt_Ndj.js → vue-ui-screenshot-D_WCQPUk.js} +1 -1
  103. package/dist/{vue-ui-screenshot-BldyAQhp.cjs → vue-ui-screenshot-DuSWlrxS.cjs} +1 -1
  104. package/dist/{vue-ui-skeleton-5qiu2vOB.js → vue-ui-skeleton-Bw0j7S0v.js} +3 -3
  105. package/dist/{vue-ui-skeleton-CCo2ROV1.cjs → vue-ui-skeleton-Ng7RKLmM.cjs} +1 -1
  106. package/dist/{vue-ui-smiley-iWOs5GqV.js → vue-ui-smiley-B-ETDTJ2.js} +2 -2
  107. package/dist/{vue-ui-smiley-C7_S4eNS.cjs → vue-ui-smiley-BlB4Chmp.cjs} +1 -1
  108. package/dist/{vue-ui-spark-trend-sNzwu560.cjs → vue-ui-spark-trend-DuRx94ei.cjs} +1 -1
  109. package/dist/{vue-ui-spark-trend-MzGiDFGX.js → vue-ui-spark-trend-kJnXlgAD.js} +5 -5
  110. package/dist/{vue-ui-sparkbar-BVfXmqcD.cjs → vue-ui-sparkbar-BVPRp_3-.cjs} +1 -1
  111. package/dist/{vue-ui-sparkbar-DpxQR2gu.js → vue-ui-sparkbar-DwGySfoF.js} +4 -4
  112. package/dist/{vue-ui-sparkgauge-D4--jFQc.js → vue-ui-sparkgauge-CS92Bz1t.js} +4 -4
  113. package/dist/{vue-ui-sparkgauge-CS8UDWeQ.cjs → vue-ui-sparkgauge-CWufhmcn.cjs} +1 -1
  114. package/dist/{vue-ui-sparkhistogram-Cxjoa6ky.js → vue-ui-sparkhistogram-BEDVWIsL.js} +5 -5
  115. package/dist/{vue-ui-sparkhistogram-D8IhrzY-.cjs → vue-ui-sparkhistogram-BSL1pxc1.cjs} +1 -1
  116. package/dist/{vue-ui-sparkline-3Q4hEM7p.js → vue-ui-sparkline-BWHDD9ZL.js} +4 -4
  117. package/dist/{vue-ui-sparkline-D910H286.cjs → vue-ui-sparkline-xQ2ASk9Q.cjs} +1 -1
  118. package/dist/{vue-ui-sparkstackbar-CTSihv-L.cjs → vue-ui-sparkstackbar-DczF0DoH.cjs} +1 -1
  119. package/dist/{vue-ui-sparkstackbar-B59Bw7Az.js → vue-ui-sparkstackbar-UaXwlx2p.js} +5 -5
  120. package/dist/{vue-ui-stackbar-BGrrmjco.cjs → vue-ui-stackbar-DJiE_c3H.cjs} +1 -1
  121. package/dist/{vue-ui-stackbar-BTegNdY4.js → vue-ui-stackbar-EBbZeb4L.js} +12 -12
  122. package/dist/{vue-ui-strip-plot-BgT1J5OY.js → vue-ui-strip-plot-C5wIUe2j.js} +11 -11
  123. package/dist/{vue-ui-strip-plot-BVjyrdND.cjs → vue-ui-strip-plot-CUqnskSY.cjs} +1 -1
  124. package/dist/{vue-ui-table-fCHQvdbJ.cjs → vue-ui-table-BsXhzqil.cjs} +1 -1
  125. package/dist/{vue-ui-table-CgS1GU4Z.js → vue-ui-table-CopdN0r5.js} +1 -1
  126. package/dist/{vue-ui-table-heatmap-BqFJMAJ_.cjs → vue-ui-table-heatmap-BGi-lAnz.cjs} +1 -1
  127. package/dist/{vue-ui-table-heatmap-DgvQBYXr.js → vue-ui-table-heatmap-tA_0lJjn.js} +4 -4
  128. package/dist/{vue-ui-table-sparkline-fBE66WCN.js → vue-ui-table-sparkline-9HdhBdnp.js} +5 -5
  129. package/dist/{vue-ui-table-sparkline-CXLMpv0k.cjs → vue-ui-table-sparkline-BHyPQXZ0.cjs} +1 -1
  130. package/dist/{vue-ui-thermometer-tGfJAwyO.js → vue-ui-thermometer-BsR1qCbw.js} +7 -7
  131. package/dist/{vue-ui-thermometer-DulgA3i4.cjs → vue-ui-thermometer-DJ3auHYk.cjs} +1 -1
  132. package/dist/{vue-ui-timer-C2kPkRBe.js → vue-ui-timer-Bx5uXdY4.js} +5 -5
  133. package/dist/{vue-ui-timer-CASCNNyP.cjs → vue-ui-timer-DxXbrlZA.cjs} +1 -1
  134. package/dist/{vue-ui-tiremarks-4dlAjo6S.cjs → vue-ui-tiremarks-BIfgN7ZG.cjs} +1 -1
  135. package/dist/{vue-ui-tiremarks-CGlojo_b.js → vue-ui-tiremarks-m7OGuMw6.js} +7 -7
  136. package/dist/{vue-ui-treemap-jhaYQkiI.cjs → vue-ui-treemap-6bRwR5CK.cjs} +1 -1
  137. package/dist/{vue-ui-treemap-DufeK33k.js → vue-ui-treemap-Bf7wnDl1.js} +11 -11
  138. package/dist/{vue-ui-vertical-bar-B30icWwi.cjs → vue-ui-vertical-bar-BhiiTzOI.cjs} +1 -1
  139. package/dist/{vue-ui-vertical-bar-Dmo8wnx8.js → vue-ui-vertical-bar-DI3gBfva.js} +11 -11
  140. package/dist/{vue-ui-waffle-D59RaWZT.cjs → vue-ui-waffle-CXVfDfFQ.cjs} +1 -1
  141. package/dist/{vue-ui-waffle-BZxjBRnB.js → vue-ui-waffle-DIeMOgnB.js} +11 -11
  142. package/dist/{vue-ui-wheel-BeRyRbt8.js → vue-ui-wheel-BsDuXp0I.js} +7 -7
  143. package/dist/{vue-ui-wheel-De4-mY35.cjs → vue-ui-wheel-DqlLxmCx.cjs} +1 -1
  144. package/dist/{vue-ui-word-cloud-Bk0QzFwd.js → vue-ui-word-cloud-COixZsVG.js} +10 -10
  145. package/dist/{vue-ui-word-cloud-aPrfbkgM.cjs → vue-ui-word-cloud-CwX4PJRH.cjs} +1 -1
  146. package/dist/{vue-ui-xy-pCnGy_1K.cjs → vue-ui-xy-CI0yZAIl.cjs} +1 -1
  147. package/dist/{vue-ui-xy-canvas-DWf89_69.js → vue-ui-xy-canvas-BdIsNYh_.js} +11 -11
  148. package/dist/{vue-ui-xy-canvas-BDD6q_Yb.cjs → vue-ui-xy-canvas-ZLeAE6Ij.cjs} +1 -1
  149. package/dist/{vue-ui-xy-DFzFITJ1.js → vue-ui-xy-zDZjZ9y0.js} +14 -14
  150. package/package.json +1 -1
  151. package/dist/index-BtqOSPWK.cjs +0 -9
  152. package/dist/vue-ui-carousel-table-B5MDm7_a.cjs +0 -1
@@ -1,15 +1,15 @@
1
1
  import { computed as m, ref as p, onMounted as Ze, watch as Te, openBlock as a, createElementBlock as o, normalizeClass as T, normalizeStyle as re, createBlock as I, createCommentVNode as v, unref as c, createSlots as et, withCtx as F, renderSlot as P, normalizeProps as Y, guardReactiveProps as K, createVNode as tt, createElementVNode as d, Fragment as x, renderList as k, toDisplayString as b, withKeys as lt, createTextVNode as De, nextTick as at } from "vue";
2
- import { u as ot, o as ut, e as q, g as st, c as Ie, t as nt, a as rt, p as J, b as it, I as ct, d as ie, C as Oe, m as ce, X as vt, s as U, D as dt, i as ve, f as Q, j as Ee, k as Z, n as Ve, J as He, q as ht, r as yt } from "./index-CpjF4-PU.js";
3
- import { _ as ft } from "./Title-D_ljAKoY.js";
4
- import { u as gt, U as bt } from "./usePrinter-CZ0Ro0M3.js";
5
- import { D as mt } from "./DataTable-BmAybhqW.js";
6
- import { L as pt } from "./Legend-7EZhiUrH.js";
7
- import xt from "./vue-ui-skeleton-5qiu2vOB.js";
8
- import { S as kt } from "./Slicer-AM-8gKgh.js";
9
- import _t from "./vue-ui-accordion-D6Uwxwl0.js";
10
- import { u as Me } from "./useNestedProp-DiDiQc6z.js";
11
- import { _ as Ct } from "./PackageVersion-BRMtBck7.js";
12
- import { P as wt } from "./PenAndPaper-u9Nkiu0T.js";
2
+ import { u as ot, o as ut, e as q, g as st, c as Ie, t as nt, a as rt, p as J, b as it, I as ct, d as ie, C as Oe, m as ce, X as vt, s as U, D as dt, i as ve, f as Q, j as Ee, k as Z, n as Ve, J as He, q as ht, r as yt } from "./index-DtCryprM.js";
3
+ import { _ as ft } from "./Title-CfjKQsLl.js";
4
+ import { u as gt, U as bt } from "./usePrinter-D4_doq3d.js";
5
+ import { D as mt } from "./DataTable-DY9Joecu.js";
6
+ import { L as pt } from "./Legend-CSG4maaN.js";
7
+ import xt from "./vue-ui-skeleton-Bw0j7S0v.js";
8
+ import { S as kt } from "./Slicer-CKVHmNoC.js";
9
+ import _t from "./vue-ui-accordion-C3p9yjUl.js";
10
+ import { u as Me } from "./useNestedProp-tT95LfDr.js";
11
+ import { _ as Ct } from "./PackageVersion-CRyyH_HB.js";
12
+ import { P as wt } from "./PenAndPaper-BF7qtcRe.js";
13
13
  import { _ as Lt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
14
14
  const At = ["id"], $t = ["xmlns", "viewBox"], St = ["id"], Nt = ["stop-color"], zt = ["stop-color"], Ft = ["id"], Pt = ["stop-color"], Tt = ["stop-color"], Dt = ["stop-color"], It = { key: 0 }, Ot = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Et = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Vt = { key: 0 }, Ht = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Mt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Wt = ["x", "y", "font-size", "fill", "font-weight"], Rt = ["text-anchor", "font-size", "fill", "transform"], Ut = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], Xt = { key: 1 }, Gt = ["cx", "cy", "r", "fill"], jt = { key: 0 }, Bt = { key: 0 }, Yt = ["d", "stroke"], Kt = ["text-anchor", "x", "y", "fill"], qt = ["cx", "cy", "r", "fill"], Jt = { key: 0 }, Qt = ["cx", "cy", "fill"], Zt = { key: 1 }, el = ["d", "fill", "stroke"], tl = { key: 2 }, ll = ["d", "fill", "stroke"], al = ["x", "y", "font-size", "fill"], ol = ["x", "y", "width", "fill", "onClick"], ul = ["x", "y", "width", "height", "onMouseenter", "onClick"], sl = {
15
15
  key: 3,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-BtqOSPWK.cjs"),_e=require("./Title-BJut0KCO.cjs"),ie=require("./usePrinter-SEUTEAmF.cjs"),Ee=require("./DataTable-D-c7laSt.cjs"),Ne=require("./Legend-D_dNnmCH.cjs"),we=require("./vue-ui-skeleton-CCo2ROV1.cjs"),Se=require("./Slicer-DO6JA4zU.cjs"),Le=require("./vue-ui-accordion-iiUNHeV-.cjs"),de=require("./useNestedProp-C7FKZW2F.cjs"),Ve=require("./PackageVersion-C2JzxDlg.cjs"),Ae=require("./PenAndPaper-Bur5hR1K.cjs"),$e=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ze=["id"],Fe=["xmlns","viewBox"],De=["id"],Pe=["stop-color"],Te=["stop-color"],Oe=["id"],Ie=["stop-color"],Me=["stop-color"],He=["stop-color"],Re={key:0},qe=["x1","x2","y1","y2","stroke","stroke-width"],We=["x1","x2","y1","y2","stroke","stroke-width"],Ue={key:0},Xe=["x1","x2","y1","y2","stroke","stroke-width"],Ge=["x1","x2","y1","y2","stroke","stroke-width"],Ye=["x","y","font-size","fill","font-weight"],je=["text-anchor","font-size","fill","transform"],Ke=["x1","y1","x2","y2","stroke","stroke-width"],Je={key:1},Qe=["cx","cy","r","fill"],Ze={key:0},et={key:0},tt=["d","stroke"],lt=["text-anchor","x","y","fill"],at=["cx","cy","r","fill"],ot={key:0},ut=["cx","cy","fill"],nt={key:1},rt=["d","fill","stroke"],st={key:2},ct=["d","fill","stroke"],it=["x","y","font-size","fill"],dt=["x","y","width","fill","onClick"],vt=["x","y","width","height","onMouseenter","onClick"],ht={key:3,"data-cy-zoom":"",class:"vue-ui-donut-evolution-dialog"},yt=["x","y","width","height","fill"],mt=["x1","y1","x2","y2","stroke"],ft=["x1","y2","x2","y1","stroke"],gt=["onKeypress","cx","cy","r"],pt=["d","stroke"],kt=["cx","cy","r","fill"],bt=["d","fill","stroke"],xt={class:"vue-ui-donut-evolution-focus"},Bt=["text-anchor","x","y","fill"],Ct=["cx","cy","r","fill"],_t=["cx","cy","r","fill"],Et=["x","y","fill"],Nt=["x","y","font-size","fill"],wt={key:5,class:"vue-data-ui-watermark"},St=["onClick"],Lt={key:0},Vt={key:1},At={key:9,ref:"source",dir:"auto"},$t={key:0},zt={key:1},Ft={__name:"vue-ui-donut-evolution",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(ve,{expose:he,emit:q}){const p=ve,{vue_ui_donut_evolution:ye}=n.useConfig(),A=e.computed(()=>!!p.dataset&&p.dataset.length),i=e.ref({start:0,end:Math.max(...p.dataset.map(a=>a.values.length))});function W(){i.value={start:0,end:L.value},G.value+=1}e.onMounted(()=>{U()});function U(){n.objectIsEmpty(p.dataset)?n.error({componentName:"VueUiDonutEvolution",type:"dataset"}):p.dataset.length&&p.dataset.forEach((a,c)=>{n.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["name","values"]}).forEach(l=>{n.error({componentName:"VueUiDonutEvolution",type:"datasetSerieAttribute",property:l,index:c})})})}const _=e.ref(n.createUid()),y=e.ref([]),h=e.ref(null),D=e.ref(null),k=e.ref(!1),b=e.ref(null),P=e.ref(null),me=e.ref(null),X=e.ref(0),G=e.ref(0),Y=e.ref(0),j=e.ref(0),K=e.ref(0),t=e.computed({get:()=>J(),set:a=>a});function J(){const a=de.useNestedProp({userConfig:p.config,defaultConfig:ye});return a.theme?{...de.useNestedProp({userConfig:n.themes.vue_ui_donut_evolution[a.theme]||p.config,defaultConfig:a}),customPalette:n.themePalettes[a.theme]||n.palette}:a}e.watch(()=>p.config,a=>{t.value=J(),U(),Y.value+=1,j.value+=1,K.value+=1},{deep:!0}),e.watch(()=>p.dataset,a=>{W()},{deep:!0});const{isPrinting:Q,isImaging:Z,generatePdf:ee,generateImage:te}=ie.usePrinter({elementId:_.value,fileName:t.value.style.chart.title.text||"vue-ui-donut-evolution"}),fe=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),ge=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),$=e.ref({showTable:t.value.table.show}),u=e.computed(()=>({top:t.value.style.chart.layout.padding.top,right:t.value.style.chart.layout.padding.right,bottom:t.value.style.chart.layout.padding.bottom,left:t.value.style.chart.layout.padding.left})),s=e.computed(()=>{const a=t.value.style.chart.layout.height,c=t.value.style.chart.layout.width,l=a-u.value.top-u.value.bottom,r=c-u.value.left-u.value.right;return{absoluteHeight:a,absoluteWidth:c,centerX:u.value.left+r/2,centerY:u.value.top+l/2,height:l,width:r}}),C=e.computed(()=>(p.dataset.forEach((a,c)=>{[null,void 0].includes(a.name)&&n.error({componentName:"VueUiDonutEvolution",type:"datasetSerieAttribute",property:"name",index:c}),[null,void 0].includes(a.values)&&n.error({componentName:"VueUiDonutEvolution",type:"datasetSerieAttribute",property:"values",index:c})}),p.dataset.map((a,c)=>({...a,values:n.sanitizeArray(a.values),color:n.convertColorToHex(a.color)||ge.value[c]||n.palette[c]||n.palette[c%n.palette.length],length:(a.values||[]).length,uid:n.createUid()})))),S=e.computed(()=>C.value.filter(a=>!y.value.includes(a.uid)).map(a=>({...a,values:a.values.filter((c,l)=>l>=i.value.start&&l<=i.value.end)}))),L=e.computed(()=>Math.max(...S.value.map(a=>a.length))),f=e.computed(()=>s.value.width/(i.value.end-i.value.start)),m=e.computed(()=>{const a=[];for(let o=0;o<i.value.end-i.value.start;o+=1){const v=S.value.map(B=>B.values[o]??null),d=v.filter(B=>[void 0,null].includes(B)).length===v.length,x=v.reduce((B,g)=>B+g,0),R=v.map(B=>B/x),w=u.value.left+f.value*o+f.value/2;a.push({index:o,percentages:R,subtotal:d||x<0?null:x,values:v,x:w})}const c=0,l=Math.max(...a.map(o=>o.subtotal)),r=a.length===1?l*2:l;return a.map((o,v)=>{const d=f.value/2*.7,x=d>s.value.width/16?s.value.width/16:d,R=h.value===o.index?s.value.width/16:x,w=a.length>4?d*2:d*2>f.value/2*.7?f.value/2*.7:d*2,B=s.value.absoluteHeight-u.value.bottom-s.value.height*o.subtotal/n.calculateNiceScale(c,r,t.value.style.chart.layout.grid.yAxis.dataLabels.steps).max;return{...o,y:B,radius:x,activeRadius:R,hoverRadius:w,donut:n.makeDonut({series:S.value.map((g,ce)=>({color:g.color,name:g.name,value:g.values[v]??0}))},o.x,B,x,x,1.99999,2,1,360,105.25,x/2),donutHover:n.makeDonut({series:S.value.map((g,ce)=>({color:g.color,name:g.name,value:g.values[v]??0}))},o.x,B,w,w,1.99999,2,1,360,105.25,w/2),donutFocus:n.makeDonut({series:S.value.map((g,ce)=>({color:g.color,name:g.name,value:g.values[v]??0}))},s.value.centerX,s.value.centerY,s.value.height/3.6,s.value.height/3.6,1.99999,2,1,360,105.25,s.value.height/6)}})});function z(a,c,l){return n.applyDataLabel(t.value.style.chart.layout.dataLabels.formatter,a,n.dataLabel({p:t.value.style.chart.layout.dataLabels.prefix,v:a,s:t.value.style.chart.layout.dataLabels.suffix,r:t.value.style.chart.layout.dataLabels.rounding}),{datapoint:c,index:l})}const T=e.computed(()=>({max:Math.max(...m.value.map(a=>a.subtotal)),min:0})),E=e.computed(()=>{const a=m.value.length===1?T.value.max*2:T.value.max;return n.calculateNiceScale(T.value.min,a,t.value.style.chart.layout.grid.yAxis.dataLabels.steps)});function pe(a){return a/E.value.max}const ke=e.computed(()=>E.value.ticks.map(a=>({y:s.value.absoluteHeight-u.value.bottom-s.value.height*pe(a),value:a})));function le(a,c){return isNaN(a.value/n.sumByAttribute(c,"value"))?0:(a.value/n.sumByAttribute(c,"value")*100).toFixed(0)+"%"}function ae(){k.value||(h.value=null,D.value=null)}function be(a){k.value||(h.value=a.index,D.value=a)}const O=e.ref(null);function I(a,c){a.subtotal&&(D.value=null,h.value=null,k.value=!0,b.value=a,[null,void 0].includes(c)||(O.value=c))}function oe(){b.value=null,k.value=!1,O.value=null}const ue=e.computed(()=>C.value.map((a,c)=>({name:a.name,value:a.values.slice(i.value.start,i.value.end).reduce((l,r)=>l+r,0),shape:"circle",uid:a.uid,color:a.color})).sort((a,c)=>c.value-a.value).map(a=>({...a,opacity:y.value.includes(a.uid)?.5:1,segregate:()=>M(a.uid),isSegregated:y.value.includes(a.uid)}))),ne=e.computed(()=>m.value.map(a=>a.subtotal).reduce((a,c)=>a+c,0)),xe=e.computed(()=>({cy:"donut-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 M(a){if(y.value.includes(a))y.value=y.value.filter(c=>c!==a),q("selectLegend",null);else{if(y.value.length===C.value.length-1)return;y.value.push(a),q("selectLegend",C.value.find(c=>c.uid===a))}b.value&&I(m.value.find((c,l)=>l===O.value))}const N=e.computed(()=>{const a=[""].concat(C.value.filter(o=>!y.value.includes(o.uid)).map(o=>({name:o.name,color:o.color}))).concat(["Σ"]);let c=[];for(let o=0;o<L.value;o+=1){const v=C.value.filter(d=>!y.value.includes(d.uid)).map(d=>d.values[o]??0).reduce((d,x)=>d+x,0);c.push([t.value.style.chart.layout.grid.xAxis.dataLabels.values[o]??"-"].concat(C.value.filter(d=>!y.value.includes(d.uid)).map(d=>({value:d.values[o]??0,percentage:d.values[o]?d.values[o]/v*100:0}))).concat([`${t.value.style.chart.layout.dataLabels.prefix}${Number(v.toFixed(t.value.table.td.roundingValue))}${t.value.style.chart.layout.dataLabels.suffix}`]))}const 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},r=[t.value.table.columnNames.period].concat(C.value.filter(o=>!y.value.includes(o.uid)).map(o=>o.name)).concat(t.value.table.columnNames.total);return{head:a,body:c,config:l,colNames:r}});function Be(){return C.value}function re(){e.nextTick(()=>{const a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[""]],c=[...N.value.head.map(v=>v.name??v)],l=[...N.value.body.map(v=>v.map(d=>d.value??d))],r=a.concat([c]).concat(l),o=n.createCsvContent(r);n.downloadCsv({csvContent:o,title:t.value.style.chart.title.text||"vue-ui-donut-evolution"})})}const V=e.ref(!1);function Ce(a){V.value=a,X.value+=1}function se(){$.value.showTable=!$.value.showTable}const F=e.ref(!1);function H(){F.value=!F.value}return he({getData:Be,generatePdf:ee,generateCsv:re,generateImage:te,toggleTable:se,toggleAnnotator:H}),(a,c)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"donutEvolutionChart",ref:P,class:e.normalizeClass(`vue-ui-donut-evolution ${V.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor}`),id:_.value},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Ae.PenAndPaper,{key:0,parent:P.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),fe.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:me,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,style:"width:100%;background:transparent;padding-bottom:24px",onMouseleave:ae},[(e.openBlock(),e.createBlock(_e._sfc_main,{key:`title_${Y.value}`,config:{title:{cy:"donut-evolution-div-title",...t.value.style.chart.title},subtitle:{cy:"donut-evolution-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],32)):e.createCommentVNode("",!0),t.value.userOptions.show&&A.value?(e.openBlock(),e.createBlock(ie.UserOptions,{ref:"details",key:`user_options_${X.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(Q),isImaging:e.unref(Z),uid:_.value,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:V.value,titles:{...t.value.userOptions.buttonTitles},chartElement:P.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:F.value,onToggleFullscreen:Ce,onGeneratePdf:e.unref(ee),onGenerateCsv:re,onGenerateImage:e.unref(te),onToggleTable:se,onToggleAnnotator:H},e.createSlots({_:2},[a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,a.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTable",{},void 0,!0)]),key:"3"}: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:"4"}: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:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),A.value?(e.openBlock(),e.createElementBlock("svg",{key:4,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 ${s.value.absoluteWidth} ${s.value.absoluteHeight}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Ve._sfc_main),e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`hover_${_.value}`,x1:"0%",y1:"0%",x2:"0%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(n.setOpacity)(t.value.style.chart.backgroundColor,t.value.style.chart.layout.highlighter.opacity)},null,8,Pe),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(n.setOpacity)(t.value.style.chart.layout.highlighter.color,t.value.style.chart.layout.highlighter.opacity)},null,8,Te)],8,De),e.createElementVNode("radialGradient",{id:`focus_${_.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(n.setOpacity)(e.unref(n.convertColorToHex)(t.value.style.chart.backgroundColor),0)},null,8,Ie),e.createElementVNode("stop",{offset:"77%","stop-color":e.unref(n.setOpacity)("#FFFFFF",30)},null,8,Me),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(n.setOpacity)(e.unref(n.convertColorToHex)(t.value.style.chart.backgroundColor),0)},null,8,He)],8,Oe)]),t.value.style.chart.layout.grid.show?(e.openBlock(),e.createElementBlock("g",Re,[e.createElementVNode("line",{x1:u.value.left,x2:u.value.left,y1:u.value.top,y2:u.value.top+s.value.height,stroke:t.value.style.chart.layout.grid.stroke,"stroke-width":t.value.style.chart.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,qe),e.createElementVNode("line",{x1:u.value.left,x2:s.value.absoluteWidth-u.value.right,y1:s.value.absoluteHeight-u.value.bottom,y2:s.value.absoluteHeight-u.value.bottom,stroke:t.value.style.chart.layout.grid.stroke,"stroke-width":t.value.style.chart.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,We),t.value.style.chart.layout.grid.showVerticalLines?(e.openBlock(),e.createElementBlock("g",Ue,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value.end-i.value.start,(l,r)=>(e.openBlock(),e.createElementBlock("line",{x1:u.value.left+(r+1)*f.value,x2:u.value.left+(r+1)*f.value,y1:u.value.top,y2:s.value.absoluteHeight-u.value.bottom,stroke:t.value.style.chart.layout.grid.stroke,"stroke-width":t.value.style.chart.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,Xe))),256))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.style.chart.layout.grid.yAxis.dataLabels.show?(e.openBlock(),e.createElementBlock("g",{key:1,class:e.normalizeClass({"donut-opacity":!0,"donut-behind":h.value!==null||k.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ke.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[l.value>=E.value.min&&l.value<=E.value.max?(e.openBlock(),e.createElementBlock("line",{key:0,x1:u.value.left,x2:u.value.left-5,y1:l.y,y2:l.y,stroke:t.value.style.chart.layout.grid.stroke,"stroke-width":t.value.style.chart.layout.grid.strokeWidth},null,8,Ge)):e.createCommentVNode("",!0),l.value>=E.value.min&&l.value<=E.value.max?(e.openBlock(),e.createElementBlock("text",{key:1,x:u.value.left-8+t.value.style.chart.layout.grid.yAxis.dataLabels.offsetX,y:l.y+t.value.style.chart.layout.grid.yAxis.dataLabels.fontSize/3,"font-size":t.value.style.chart.layout.grid.yAxis.dataLabels.fontSize,"text-anchor":"end",fill:t.value.style.chart.layout.grid.yAxis.dataLabels.color,"font-weight":t.value.style.chart.layout.grid.yAxis.dataLabels.bold?"bold":"normal"},e.toDisplayString(e.unref(n.canShowValue)(l.value)?e.unref(n.applyDataLabel)(t.value.style.chart.layout.dataLabels.formatter,l.value,e.unref(n.dataLabel)({p:t.value.style.chart.layout.dataLabels.prefix,v:l.value,s:t.value.style.chart.layout.dataLabels.suffix,r:t.value.style.chart.layout.grid.yAxis.dataLabels.roundingValue}),{datapoint:l,seriesIndex:r}):""),9,Ye)):e.createCommentVNode("",!0)]))),256))],2)):e.createCommentVNode("",!0),t.value.style.chart.layout.grid.xAxis.dataLabels.show?(e.openBlock(),e.createElementBlock("g",{key:2,class:e.normalizeClass({"donut-opacity":!0,"donut-behind":k.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value.end-i.value.start,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.chart.layout.grid.xAxis.dataLabels.showOnlyFirstAndLast&&(r===0||r===L.value-1)||!t.value.style.chart.layout.grid.xAxis.dataLabels.showOnlyFirstAndLast?(e.openBlock(),e.createElementBlock("text",{key:0,"text-anchor":t.value.style.chart.layout.grid.xAxis.dataLabels.rotation>0?"start":t.value.style.chart.layout.grid.xAxis.dataLabels.rotation<0?"end":"middle","font-size":t.value.style.chart.layout.grid.xAxis.dataLabels.fontSize,fill:t.value.style.chart.layout.grid.xAxis.dataLabels.color,transform:`translate(${u.value.left+f.value*r+f.value/2}, ${t.value.style.chart.layout.grid.xAxis.dataLabels.offsetY+s.value.absoluteHeight-u.value.bottom+t.value.style.chart.layout.grid.xAxis.dataLabels.fontSize*2}), rotate(${t.value.style.chart.layout.grid.xAxis.dataLabels.rotation})`},e.toDisplayString(t.value.style.chart.layout.grid.xAxis.dataLabels.values[Number(r)+Number(i.value.start)]??""),9,je)):e.createCommentVNode("",!0)]))),256))],2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.chart.layout.line.show&&r<m.value.length-1&&![l.subtotal,m.value[r+1].subtotal].includes(null)?(e.openBlock(),e.createElementBlock("line",{key:0,class:e.normalizeClass({"donut-opacity":!0,"donut-behind":h.value!==null||k.value}),x1:l.x,y1:l.y,x2:m.value[r+1].x,y2:m.value[r+1].y,stroke:t.value.style.chart.layout.line.stroke,"stroke-width":t.value.style.chart.layout.line.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round"},null,10,Ke)):e.createCommentVNode("",!0),l.subtotal!==null?(e.openBlock(),e.createElementBlock("g",Je,[l.subtotal?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:l.x,cy:l.y,r:l.activeRadius,fill:t.value.style.chart.backgroundColor},null,8,Qe)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",{class:e.normalizeClass({"donut-opacity":!0,"donut-behind":r!==h.value&&h.value!==null||k.value})},[l.subtotal?(e.openBlock(),e.createElementBlock("g",Ze,[h.value!==null&&h.value===r?(e.openBlock(),e.createElementBlock("g",et,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.donutHover,o=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("path",{d:e.unref(n.calcNutArrowPath)(o,{x:o.center.endX,y:o.center.endY},12,12,{x:l.x,y:l.y},!0,20),stroke:o.color,"stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,8,tt)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.donutHover,(o,v)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("text",{"data-cy-hover-label":"","text-anchor":e.unref(n.calcMarkerOffsetX)(o,!0,0).anchor,x:e.unref(n.calcMarkerOffsetX)(o,!0,3).x,y:e.unref(n.calcMarkerOffsetY)(o),fill:t.value.style.chart.layout.grid.yAxis.dataLabels.color,"font-size":8,"font-weight":"bold"},e.toDisplayString(o.name)+": "+e.toDisplayString(le(o,l.donut))+" ("+e.toDisplayString(o.value===null?"-":z(o.value,o,v))+") ",9,lt)]))),256)),e.createElementVNode("g",null,[e.createElementVNode("circle",{cx:l.x,cy:l.y,r:l.hoverRadius,fill:t.value.style.chart.backgroundColor},null,8,at)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],2))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",{class:e.normalizeClass({"donut-opacity":!0,"donut-behind":r!==h.value&&h.value!==null||k.value})},[l.subtotal!==null?(e.openBlock(),e.createElementBlock("g",ot,[l.subtotal===0?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:l.x,cy:l.y,r:3,fill:t.value.style.chart.color},null,8,ut)):h.value!==null&&h.value===r?(e.openBlock(),e.createElementBlock("g",nt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.donutHover,(o,v)=>(e.openBlock(),e.createElementBlock("path",{d:o.arcSlice,fill:`${o.color}`,"stroke-width":1,stroke:t.value.style.chart.backgroundColor},null,8,rt))),256))])):(e.openBlock(),e.createElementBlock("g",st,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.donut,(o,v)=>(e.openBlock(),e.createElementBlock("path",{d:o.arcSlice,fill:`${o.color}`,"stroke-width":.5,stroke:t.value.style.chart.backgroundColor},null,8,ct))),256))]))])):e.createCommentVNode("",!0)],2))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",{class:e.normalizeClass({"donut-opacity":!0,"donut-behind":r!==h.value&&h.value!==null||k.value})},[l.subtotal!==null&&t.value.style.chart.layout.dataLabels.show?(e.openBlock(),e.createElementBlock("text",{key:0,"text-anchor":"middle",x:l.x,y:h.value===l.index&&l.subtotal?l.y+t.value.style.chart.layout.dataLabels.fontSize/3:l.y-l.radius-t.value.style.chart.layout.dataLabels.fontSize+t.value.style.chart.layout.dataLabels.offsetY,"font-size":t.value.style.chart.layout.dataLabels.fontSize,"font-weight":"bold",fill:t.value.style.chart.layout.dataLabels.color},e.toDisplayString(z(l.subtotal,l,r)),9,it)):e.createCommentVNode("",!0)],2))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,r)=>(e.openBlock(),e.createElementBlock("rect",{x:u.value.left+r*f.value,y:s.value.absoluteHeight-u.value.bottom-10,width:f.value,height:10,fill:h.value===l.index?`url(#hover_${_.value})`:"transparent",onClick:o=>I(l,r),class:e.normalizeClass({"donut-hover":h.value===l.index&&l.subtotal})},null,10,dt))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,r)=>(e.openBlock(),e.createElementBlock("rect",{"data-cy-trap":"",x:u.value.left+r*f.value,y:u.value.top,width:f.value,height:s.value.height,fill:"transparent",onMouseenter:o=>be(l),onMouseleave:ae,onClick:o=>I(l,r),class:e.normalizeClass({"donut-hover":h.value===l.index&&l.subtotal})},null,42,vt))),256)),k.value?(e.openBlock(),e.createElementBlock("g",ht,[e.createElementVNode("rect",{rx:4,x:u.value.left,y:u.value.top,width:s.value.width,height:s.value.height,fill:t.value.style.chart.backgroundColor,style:{filter:"drop-shadow(0 12px 12px rgba(0,0,0,0.3))"}},null,8,yt),e.createElementVNode("line",{"data-html2canvas-ignore":"",x1:s.value.absoluteWidth-u.value.right-15,y1:u.value.top+5,x2:s.value.absoluteWidth-u.value.right-4,y2:u.value.top+15.5,"stroke-linecap":"round",stroke:t.value.style.chart.color,"stroke-width":"1.5"},null,8,mt),e.createElementVNode("line",{"data-html2canvas-ignore":"",x1:s.value.absoluteWidth-u.value.right-15,y2:u.value.top+5,x2:s.value.absoluteWidth-u.value.right-4,y1:u.value.top+15.5,"stroke-linecap":"round",stroke:t.value.style.chart.color,"stroke-width":"1.5"},null,8,ft),e.createElementVNode("circle",{"data-cy-close":"",onClick:oe,onKeypress:e.withKeys(oe,["enter"]),cx:s.value.absoluteWidth-u.value.right-s.value.width/40,cy:u.value.top+s.value.height/30,r:s.value.height/12,fill:"transparent",style:{cursor:"pointer"},tabindex:"0"},null,40,gt),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value.donutFocus,l=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("path",{"data-cy-zoom-donut":"",d:e.unref(n.calcNutArrowPath)(l,{x:s.value.centerX,y:s.value.centerY},12,12,!1,!1,15),stroke:l.color,"stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round",fill:"none",class:"vue-ui-donut-evolution-focus"},null,8,pt)]))),256)),e.createElementVNode("circle",{cx:u.value.left+s.value.width/2,cy:u.value.top+s.value.height/2,r:s.value.height/7,fill:t.value.style.chart.backgroundColor},null,8,kt),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value.donutFocus,(l,r)=>(e.openBlock(),e.createElementBlock("path",{d:l.arcSlice,fill:`${l.color}`,"stroke-width":1,stroke:t.value.style.chart.backgroundColor,class:"vue-ui-donut-evolution-focus"},null,8,bt))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value.donutFocus,(l,r)=>(e.openBlock(),e.createElementBlock("g",xt,[e.createElementVNode("text",{"text-anchor":e.unref(n.calcMarkerOffsetX)(l,!0,20).anchor,x:e.unref(n.calcMarkerOffsetX)(l,!0,10).x,y:e.unref(n.calcMarkerOffsetY)(l),fill:t.value.style.chart.layout.grid.yAxis.dataLabels.color,"font-size":10,"font-weight":"bold"},e.toDisplayString(l.name)+": "+e.toDisplayString(le(l,b.value.donutFocus))+" ("+e.toDisplayString(l.value===null?"-":z(l.value,l,r))+") ",9,Bt)]))),256)),e.createElementVNode("circle",{cx:u.value.left+s.value.width/2,cy:u.value.top+s.value.height/2,r:s.value.height/3.8,fill:`url(#focus_${_.value})`},null,8,Ct),e.createElementVNode("circle",{cx:u.value.left+s.value.width/2,cy:u.value.top+s.value.height/2,r:s.value.height/7.7,fill:t.value.style.chart.backgroundColor},null,8,_t),e.createElementVNode("text",{"text-anchor":"middle",x:u.value.left+s.value.width/2,y:u.value.top+s.value.height/2+14/3,"font-size":14,"font-weight":"bold",fill:t.value.style.chart.layout.dataLabels.color,class:"vue-ui-donut-evolution-focus"},e.toDisplayString(z(b.value.subtotal,b.value,null)),9,Et),t.value.style.chart.layout.grid.xAxis.dataLabels.values[b.value.index]?(e.openBlock(),e.createElementBlock("text",{key:0,x:u.value.left+6,y:u.value.top+t.value.style.chart.layout.grid.xAxis.dataLabels.fontSize*2,"font-size":t.value.style.chart.layout.grid.xAxis.dataLabels.fontSize*1.6,fill:t.value.style.chart.layout.dataLabels.color},e.toDisplayString(t.value.style.chart.layout.grid.xAxis.dataLabels.values[Number(b.value.index)+Number(i.value.start)]),9,Nt)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"svg",{svg:s.value},void 0,!0)],14,Fe)):e.createCommentVNode("",!0),a.$slots.watermark?(e.openBlock(),e.createElementBlock("div",wt,[e.renderSlot(a.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(Q)||e.unref(Z)})),void 0,!0)])):e.createCommentVNode("",!0),A.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(we.default,{key:6,config:{type:"donutEvolution",style:{backgroundColor:t.value.style.chart.backgroundColor,donutEvolution:{axis:{color:"#CCCCCC"},donuts:{color:"#CCCCCC"}}}}},null,8,["config"])),L.value>1&&t.value.style.chart.zoom.show?(e.openBlock(),e.createBlock(Se.Slicer,{key:`slicer_${G.value}`,background:t.value.style.chart.zoom.color,borderColor:t.value.style.chart.backgroundColor,fontSize:t.value.style.chart.zoom.fontSize,useResetSlot:t.value.style.chart.zoom.useResetSlot,labelLeft:t.value.style.chart.layout.grid.xAxis.dataLabels.values[Number(i.value.start)]||"",labelRight:t.value.style.chart.layout.grid.xAxis.dataLabels.values[Number(i.value.end)-1]||"",textColor:t.value.style.chart.color,inputColor:t.value.style.chart.zoom.color,selectColor:t.value.style.chart.zoom.highlightColor,max:L.value,min:0,valueStart:i.value.start,valueEnd:i.value.end,start:i.value.start,"onUpdate:start":c[0]||(c[0]=l=>i.value.start=l),end:i.value.end,"onUpdate:end":c[1]||(c[1]=l=>i.value.end=l),onReset:W},{"reset-action":e.withCtx(({reset:l})=>[e.renderSlot(a.$slots,"reset-action",e.normalizeProps(e.guardReactiveProps({reset:l})),void 0,!0)]),_:3},8,["background","borderColor","fontSize","useResetSlot","labelLeft","labelRight","textColor","inputColor","selectColor","max","valueStart","valueEnd","start","end"])):e.createCommentVNode("",!0),t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(Ne.Legend,{key:`legend_${K.value}`,legendSet:ue.value,config:xe.value,onClickMarker:c[2]||(c[2]=({legend:l})=>M(l.uid))},{item:e.withCtx(({legend:l,index:r})=>[e.createElementVNode("div",{"data-cy-legend-item":"",onClick:o=>M(l.uid),style:e.normalizeStyle(`opacity:${y.value.includes(l.uid)?.5:1}`)},[e.createTextVNode(e.toDisplayString(l.name)+": "+e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.dataLabels.formatter,l.value,e.unref(n.dataLabel)({p:t.value.style.chart.layout.dataLabels.prefix,v:l.value,s:t.value.style.chart.layout.dataLabels.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:l,seriesIndex:r}))+" ",1),y.value.includes(l.uid)?(e.openBlock(),e.createElementBlock("span",Vt," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",Lt," ("+e.toDisplayString(isNaN(l.value/ne.value)?"-":e.unref(n.dataLabel)({v:l.value/ne.value*100,s:"%",r:t.value.style.chart.legend.roundingPercentage}))+") ",1))],12,St)]),_:1},8,["legendSet","config"])):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"legend",{legend:ue.value},void 0,!0),a.$slots.source?(e.openBlock(),e.createElementBlock("div",At,[e.renderSlot(a.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),A.value?(e.openBlock(),e.createBlock(Le.default,{key:10,hideDetails:"",config:{open:$.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(Ee.DataTable,{key:`table_${j.value}`,colNames:N.value.colNames,head:N.value.head,body:N.value.body,config:N.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:c[3]||(c[3]=l=>$.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createTextVNode(e.toDisplayString(l.name??l),1)]),td:e.withCtx(({td:l})=>[l.value===null?(e.openBlock(),e.createElementBlock("span",$t,"-")):(e.openBlock(),e.createElementBlock("b",zt,e.toDisplayString(isNaN(l.value)?"":t.value.style.chart.layout.dataLabels.prefix)+e.toDisplayString(!isNaN(l.value)&&l.value!==null?Number(l.value.toFixed(t.value.table.td.roundingValue)).toLocaleString():l)+e.toDisplayString(isNaN(l.value)?"":t.value.style.chart.layout.dataLabels.suffix),1)),e.createElementVNode("span",null,e.toDisplayString(l.percentage&&!isNaN(l.percentage)?`(${Number(l.percentage.toFixed(t.value.table.td.roundingPercentage)).toLocaleString()}%)`:""),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,ze))}},Dt=$e._export_sfc(Ft,[["__scopeId","data-v-800b47b9"]]);exports.default=Dt;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-Dgjlvd_3.cjs"),_e=require("./Title-C8WRomob.cjs"),ie=require("./usePrinter-Bd-68vBM.cjs"),Ee=require("./DataTable-CKYq5S0j.cjs"),Ne=require("./Legend-EHKRwZ5N.cjs"),we=require("./vue-ui-skeleton-Ng7RKLmM.cjs"),Se=require("./Slicer-BeNAVIli.cjs"),Le=require("./vue-ui-accordion-DAf1jeI5.cjs"),de=require("./useNestedProp-DMaPxyYb.cjs"),Ve=require("./PackageVersion-C_Y8uWJM.cjs"),Ae=require("./PenAndPaper-CotnLxGh.cjs"),$e=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ze=["id"],Fe=["xmlns","viewBox"],De=["id"],Pe=["stop-color"],Te=["stop-color"],Oe=["id"],Ie=["stop-color"],Me=["stop-color"],He=["stop-color"],Re={key:0},qe=["x1","x2","y1","y2","stroke","stroke-width"],We=["x1","x2","y1","y2","stroke","stroke-width"],Ue={key:0},Xe=["x1","x2","y1","y2","stroke","stroke-width"],Ge=["x1","x2","y1","y2","stroke","stroke-width"],Ye=["x","y","font-size","fill","font-weight"],je=["text-anchor","font-size","fill","transform"],Ke=["x1","y1","x2","y2","stroke","stroke-width"],Je={key:1},Qe=["cx","cy","r","fill"],Ze={key:0},et={key:0},tt=["d","stroke"],lt=["text-anchor","x","y","fill"],at=["cx","cy","r","fill"],ot={key:0},ut=["cx","cy","fill"],nt={key:1},rt=["d","fill","stroke"],st={key:2},ct=["d","fill","stroke"],it=["x","y","font-size","fill"],dt=["x","y","width","fill","onClick"],vt=["x","y","width","height","onMouseenter","onClick"],ht={key:3,"data-cy-zoom":"",class:"vue-ui-donut-evolution-dialog"},yt=["x","y","width","height","fill"],mt=["x1","y1","x2","y2","stroke"],ft=["x1","y2","x2","y1","stroke"],gt=["onKeypress","cx","cy","r"],pt=["d","stroke"],kt=["cx","cy","r","fill"],bt=["d","fill","stroke"],xt={class:"vue-ui-donut-evolution-focus"},Bt=["text-anchor","x","y","fill"],Ct=["cx","cy","r","fill"],_t=["cx","cy","r","fill"],Et=["x","y","fill"],Nt=["x","y","font-size","fill"],wt={key:5,class:"vue-data-ui-watermark"},St=["onClick"],Lt={key:0},Vt={key:1},At={key:9,ref:"source",dir:"auto"},$t={key:0},zt={key:1},Ft={__name:"vue-ui-donut-evolution",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(ve,{expose:he,emit:q}){const p=ve,{vue_ui_donut_evolution:ye}=n.useConfig(),A=e.computed(()=>!!p.dataset&&p.dataset.length),i=e.ref({start:0,end:Math.max(...p.dataset.map(a=>a.values.length))});function W(){i.value={start:0,end:L.value},G.value+=1}e.onMounted(()=>{U()});function U(){n.objectIsEmpty(p.dataset)?n.error({componentName:"VueUiDonutEvolution",type:"dataset"}):p.dataset.length&&p.dataset.forEach((a,c)=>{n.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["name","values"]}).forEach(l=>{n.error({componentName:"VueUiDonutEvolution",type:"datasetSerieAttribute",property:l,index:c})})})}const _=e.ref(n.createUid()),y=e.ref([]),h=e.ref(null),D=e.ref(null),k=e.ref(!1),b=e.ref(null),P=e.ref(null),me=e.ref(null),X=e.ref(0),G=e.ref(0),Y=e.ref(0),j=e.ref(0),K=e.ref(0),t=e.computed({get:()=>J(),set:a=>a});function J(){const a=de.useNestedProp({userConfig:p.config,defaultConfig:ye});return a.theme?{...de.useNestedProp({userConfig:n.themes.vue_ui_donut_evolution[a.theme]||p.config,defaultConfig:a}),customPalette:n.themePalettes[a.theme]||n.palette}:a}e.watch(()=>p.config,a=>{t.value=J(),U(),Y.value+=1,j.value+=1,K.value+=1},{deep:!0}),e.watch(()=>p.dataset,a=>{W()},{deep:!0});const{isPrinting:Q,isImaging:Z,generatePdf:ee,generateImage:te}=ie.usePrinter({elementId:_.value,fileName:t.value.style.chart.title.text||"vue-ui-donut-evolution"}),fe=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),ge=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),$=e.ref({showTable:t.value.table.show}),u=e.computed(()=>({top:t.value.style.chart.layout.padding.top,right:t.value.style.chart.layout.padding.right,bottom:t.value.style.chart.layout.padding.bottom,left:t.value.style.chart.layout.padding.left})),s=e.computed(()=>{const a=t.value.style.chart.layout.height,c=t.value.style.chart.layout.width,l=a-u.value.top-u.value.bottom,r=c-u.value.left-u.value.right;return{absoluteHeight:a,absoluteWidth:c,centerX:u.value.left+r/2,centerY:u.value.top+l/2,height:l,width:r}}),C=e.computed(()=>(p.dataset.forEach((a,c)=>{[null,void 0].includes(a.name)&&n.error({componentName:"VueUiDonutEvolution",type:"datasetSerieAttribute",property:"name",index:c}),[null,void 0].includes(a.values)&&n.error({componentName:"VueUiDonutEvolution",type:"datasetSerieAttribute",property:"values",index:c})}),p.dataset.map((a,c)=>({...a,values:n.sanitizeArray(a.values),color:n.convertColorToHex(a.color)||ge.value[c]||n.palette[c]||n.palette[c%n.palette.length],length:(a.values||[]).length,uid:n.createUid()})))),S=e.computed(()=>C.value.filter(a=>!y.value.includes(a.uid)).map(a=>({...a,values:a.values.filter((c,l)=>l>=i.value.start&&l<=i.value.end)}))),L=e.computed(()=>Math.max(...S.value.map(a=>a.length))),f=e.computed(()=>s.value.width/(i.value.end-i.value.start)),m=e.computed(()=>{const a=[];for(let o=0;o<i.value.end-i.value.start;o+=1){const v=S.value.map(B=>B.values[o]??null),d=v.filter(B=>[void 0,null].includes(B)).length===v.length,x=v.reduce((B,g)=>B+g,0),R=v.map(B=>B/x),w=u.value.left+f.value*o+f.value/2;a.push({index:o,percentages:R,subtotal:d||x<0?null:x,values:v,x:w})}const c=0,l=Math.max(...a.map(o=>o.subtotal)),r=a.length===1?l*2:l;return a.map((o,v)=>{const d=f.value/2*.7,x=d>s.value.width/16?s.value.width/16:d,R=h.value===o.index?s.value.width/16:x,w=a.length>4?d*2:d*2>f.value/2*.7?f.value/2*.7:d*2,B=s.value.absoluteHeight-u.value.bottom-s.value.height*o.subtotal/n.calculateNiceScale(c,r,t.value.style.chart.layout.grid.yAxis.dataLabels.steps).max;return{...o,y:B,radius:x,activeRadius:R,hoverRadius:w,donut:n.makeDonut({series:S.value.map((g,ce)=>({color:g.color,name:g.name,value:g.values[v]??0}))},o.x,B,x,x,1.99999,2,1,360,105.25,x/2),donutHover:n.makeDonut({series:S.value.map((g,ce)=>({color:g.color,name:g.name,value:g.values[v]??0}))},o.x,B,w,w,1.99999,2,1,360,105.25,w/2),donutFocus:n.makeDonut({series:S.value.map((g,ce)=>({color:g.color,name:g.name,value:g.values[v]??0}))},s.value.centerX,s.value.centerY,s.value.height/3.6,s.value.height/3.6,1.99999,2,1,360,105.25,s.value.height/6)}})});function z(a,c,l){return n.applyDataLabel(t.value.style.chart.layout.dataLabels.formatter,a,n.dataLabel({p:t.value.style.chart.layout.dataLabels.prefix,v:a,s:t.value.style.chart.layout.dataLabels.suffix,r:t.value.style.chart.layout.dataLabels.rounding}),{datapoint:c,index:l})}const T=e.computed(()=>({max:Math.max(...m.value.map(a=>a.subtotal)),min:0})),E=e.computed(()=>{const a=m.value.length===1?T.value.max*2:T.value.max;return n.calculateNiceScale(T.value.min,a,t.value.style.chart.layout.grid.yAxis.dataLabels.steps)});function pe(a){return a/E.value.max}const ke=e.computed(()=>E.value.ticks.map(a=>({y:s.value.absoluteHeight-u.value.bottom-s.value.height*pe(a),value:a})));function le(a,c){return isNaN(a.value/n.sumByAttribute(c,"value"))?0:(a.value/n.sumByAttribute(c,"value")*100).toFixed(0)+"%"}function ae(){k.value||(h.value=null,D.value=null)}function be(a){k.value||(h.value=a.index,D.value=a)}const O=e.ref(null);function I(a,c){a.subtotal&&(D.value=null,h.value=null,k.value=!0,b.value=a,[null,void 0].includes(c)||(O.value=c))}function oe(){b.value=null,k.value=!1,O.value=null}const ue=e.computed(()=>C.value.map((a,c)=>({name:a.name,value:a.values.slice(i.value.start,i.value.end).reduce((l,r)=>l+r,0),shape:"circle",uid:a.uid,color:a.color})).sort((a,c)=>c.value-a.value).map(a=>({...a,opacity:y.value.includes(a.uid)?.5:1,segregate:()=>M(a.uid),isSegregated:y.value.includes(a.uid)}))),ne=e.computed(()=>m.value.map(a=>a.subtotal).reduce((a,c)=>a+c,0)),xe=e.computed(()=>({cy:"donut-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 M(a){if(y.value.includes(a))y.value=y.value.filter(c=>c!==a),q("selectLegend",null);else{if(y.value.length===C.value.length-1)return;y.value.push(a),q("selectLegend",C.value.find(c=>c.uid===a))}b.value&&I(m.value.find((c,l)=>l===O.value))}const N=e.computed(()=>{const a=[""].concat(C.value.filter(o=>!y.value.includes(o.uid)).map(o=>({name:o.name,color:o.color}))).concat(["Σ"]);let c=[];for(let o=0;o<L.value;o+=1){const v=C.value.filter(d=>!y.value.includes(d.uid)).map(d=>d.values[o]??0).reduce((d,x)=>d+x,0);c.push([t.value.style.chart.layout.grid.xAxis.dataLabels.values[o]??"-"].concat(C.value.filter(d=>!y.value.includes(d.uid)).map(d=>({value:d.values[o]??0,percentage:d.values[o]?d.values[o]/v*100:0}))).concat([`${t.value.style.chart.layout.dataLabels.prefix}${Number(v.toFixed(t.value.table.td.roundingValue))}${t.value.style.chart.layout.dataLabels.suffix}`]))}const 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},r=[t.value.table.columnNames.period].concat(C.value.filter(o=>!y.value.includes(o.uid)).map(o=>o.name)).concat(t.value.table.columnNames.total);return{head:a,body:c,config:l,colNames:r}});function Be(){return C.value}function re(){e.nextTick(()=>{const a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[""]],c=[...N.value.head.map(v=>v.name??v)],l=[...N.value.body.map(v=>v.map(d=>d.value??d))],r=a.concat([c]).concat(l),o=n.createCsvContent(r);n.downloadCsv({csvContent:o,title:t.value.style.chart.title.text||"vue-ui-donut-evolution"})})}const V=e.ref(!1);function Ce(a){V.value=a,X.value+=1}function se(){$.value.showTable=!$.value.showTable}const F=e.ref(!1);function H(){F.value=!F.value}return he({getData:Be,generatePdf:ee,generateCsv:re,generateImage:te,toggleTable:se,toggleAnnotator:H}),(a,c)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"donutEvolutionChart",ref:P,class:e.normalizeClass(`vue-ui-donut-evolution ${V.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor}`),id:_.value},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Ae.PenAndPaper,{key:0,parent:P.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),fe.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:me,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,style:"width:100%;background:transparent;padding-bottom:24px",onMouseleave:ae},[(e.openBlock(),e.createBlock(_e._sfc_main,{key:`title_${Y.value}`,config:{title:{cy:"donut-evolution-div-title",...t.value.style.chart.title},subtitle:{cy:"donut-evolution-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],32)):e.createCommentVNode("",!0),t.value.userOptions.show&&A.value?(e.openBlock(),e.createBlock(ie.UserOptions,{ref:"details",key:`user_options_${X.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(Q),isImaging:e.unref(Z),uid:_.value,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:V.value,titles:{...t.value.userOptions.buttonTitles},chartElement:P.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:F.value,onToggleFullscreen:Ce,onGeneratePdf:e.unref(ee),onGenerateCsv:re,onGenerateImage:e.unref(te),onToggleTable:se,onToggleAnnotator:H},e.createSlots({_:2},[a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,a.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTable",{},void 0,!0)]),key:"3"}: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:"4"}: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:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),A.value?(e.openBlock(),e.createElementBlock("svg",{key:4,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 ${s.value.absoluteWidth} ${s.value.absoluteHeight}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Ve._sfc_main),e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`hover_${_.value}`,x1:"0%",y1:"0%",x2:"0%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(n.setOpacity)(t.value.style.chart.backgroundColor,t.value.style.chart.layout.highlighter.opacity)},null,8,Pe),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(n.setOpacity)(t.value.style.chart.layout.highlighter.color,t.value.style.chart.layout.highlighter.opacity)},null,8,Te)],8,De),e.createElementVNode("radialGradient",{id:`focus_${_.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(n.setOpacity)(e.unref(n.convertColorToHex)(t.value.style.chart.backgroundColor),0)},null,8,Ie),e.createElementVNode("stop",{offset:"77%","stop-color":e.unref(n.setOpacity)("#FFFFFF",30)},null,8,Me),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(n.setOpacity)(e.unref(n.convertColorToHex)(t.value.style.chart.backgroundColor),0)},null,8,He)],8,Oe)]),t.value.style.chart.layout.grid.show?(e.openBlock(),e.createElementBlock("g",Re,[e.createElementVNode("line",{x1:u.value.left,x2:u.value.left,y1:u.value.top,y2:u.value.top+s.value.height,stroke:t.value.style.chart.layout.grid.stroke,"stroke-width":t.value.style.chart.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,qe),e.createElementVNode("line",{x1:u.value.left,x2:s.value.absoluteWidth-u.value.right,y1:s.value.absoluteHeight-u.value.bottom,y2:s.value.absoluteHeight-u.value.bottom,stroke:t.value.style.chart.layout.grid.stroke,"stroke-width":t.value.style.chart.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,We),t.value.style.chart.layout.grid.showVerticalLines?(e.openBlock(),e.createElementBlock("g",Ue,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value.end-i.value.start,(l,r)=>(e.openBlock(),e.createElementBlock("line",{x1:u.value.left+(r+1)*f.value,x2:u.value.left+(r+1)*f.value,y1:u.value.top,y2:s.value.absoluteHeight-u.value.bottom,stroke:t.value.style.chart.layout.grid.stroke,"stroke-width":t.value.style.chart.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,Xe))),256))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.style.chart.layout.grid.yAxis.dataLabels.show?(e.openBlock(),e.createElementBlock("g",{key:1,class:e.normalizeClass({"donut-opacity":!0,"donut-behind":h.value!==null||k.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ke.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[l.value>=E.value.min&&l.value<=E.value.max?(e.openBlock(),e.createElementBlock("line",{key:0,x1:u.value.left,x2:u.value.left-5,y1:l.y,y2:l.y,stroke:t.value.style.chart.layout.grid.stroke,"stroke-width":t.value.style.chart.layout.grid.strokeWidth},null,8,Ge)):e.createCommentVNode("",!0),l.value>=E.value.min&&l.value<=E.value.max?(e.openBlock(),e.createElementBlock("text",{key:1,x:u.value.left-8+t.value.style.chart.layout.grid.yAxis.dataLabels.offsetX,y:l.y+t.value.style.chart.layout.grid.yAxis.dataLabels.fontSize/3,"font-size":t.value.style.chart.layout.grid.yAxis.dataLabels.fontSize,"text-anchor":"end",fill:t.value.style.chart.layout.grid.yAxis.dataLabels.color,"font-weight":t.value.style.chart.layout.grid.yAxis.dataLabels.bold?"bold":"normal"},e.toDisplayString(e.unref(n.canShowValue)(l.value)?e.unref(n.applyDataLabel)(t.value.style.chart.layout.dataLabels.formatter,l.value,e.unref(n.dataLabel)({p:t.value.style.chart.layout.dataLabels.prefix,v:l.value,s:t.value.style.chart.layout.dataLabels.suffix,r:t.value.style.chart.layout.grid.yAxis.dataLabels.roundingValue}),{datapoint:l,seriesIndex:r}):""),9,Ye)):e.createCommentVNode("",!0)]))),256))],2)):e.createCommentVNode("",!0),t.value.style.chart.layout.grid.xAxis.dataLabels.show?(e.openBlock(),e.createElementBlock("g",{key:2,class:e.normalizeClass({"donut-opacity":!0,"donut-behind":k.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value.end-i.value.start,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.chart.layout.grid.xAxis.dataLabels.showOnlyFirstAndLast&&(r===0||r===L.value-1)||!t.value.style.chart.layout.grid.xAxis.dataLabels.showOnlyFirstAndLast?(e.openBlock(),e.createElementBlock("text",{key:0,"text-anchor":t.value.style.chart.layout.grid.xAxis.dataLabels.rotation>0?"start":t.value.style.chart.layout.grid.xAxis.dataLabels.rotation<0?"end":"middle","font-size":t.value.style.chart.layout.grid.xAxis.dataLabels.fontSize,fill:t.value.style.chart.layout.grid.xAxis.dataLabels.color,transform:`translate(${u.value.left+f.value*r+f.value/2}, ${t.value.style.chart.layout.grid.xAxis.dataLabels.offsetY+s.value.absoluteHeight-u.value.bottom+t.value.style.chart.layout.grid.xAxis.dataLabels.fontSize*2}), rotate(${t.value.style.chart.layout.grid.xAxis.dataLabels.rotation})`},e.toDisplayString(t.value.style.chart.layout.grid.xAxis.dataLabels.values[Number(r)+Number(i.value.start)]??""),9,je)):e.createCommentVNode("",!0)]))),256))],2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.chart.layout.line.show&&r<m.value.length-1&&![l.subtotal,m.value[r+1].subtotal].includes(null)?(e.openBlock(),e.createElementBlock("line",{key:0,class:e.normalizeClass({"donut-opacity":!0,"donut-behind":h.value!==null||k.value}),x1:l.x,y1:l.y,x2:m.value[r+1].x,y2:m.value[r+1].y,stroke:t.value.style.chart.layout.line.stroke,"stroke-width":t.value.style.chart.layout.line.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round"},null,10,Ke)):e.createCommentVNode("",!0),l.subtotal!==null?(e.openBlock(),e.createElementBlock("g",Je,[l.subtotal?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:l.x,cy:l.y,r:l.activeRadius,fill:t.value.style.chart.backgroundColor},null,8,Qe)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",{class:e.normalizeClass({"donut-opacity":!0,"donut-behind":r!==h.value&&h.value!==null||k.value})},[l.subtotal?(e.openBlock(),e.createElementBlock("g",Ze,[h.value!==null&&h.value===r?(e.openBlock(),e.createElementBlock("g",et,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.donutHover,o=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("path",{d:e.unref(n.calcNutArrowPath)(o,{x:o.center.endX,y:o.center.endY},12,12,{x:l.x,y:l.y},!0,20),stroke:o.color,"stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,8,tt)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.donutHover,(o,v)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("text",{"data-cy-hover-label":"","text-anchor":e.unref(n.calcMarkerOffsetX)(o,!0,0).anchor,x:e.unref(n.calcMarkerOffsetX)(o,!0,3).x,y:e.unref(n.calcMarkerOffsetY)(o),fill:t.value.style.chart.layout.grid.yAxis.dataLabels.color,"font-size":8,"font-weight":"bold"},e.toDisplayString(o.name)+": "+e.toDisplayString(le(o,l.donut))+" ("+e.toDisplayString(o.value===null?"-":z(o.value,o,v))+") ",9,lt)]))),256)),e.createElementVNode("g",null,[e.createElementVNode("circle",{cx:l.x,cy:l.y,r:l.hoverRadius,fill:t.value.style.chart.backgroundColor},null,8,at)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],2))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",{class:e.normalizeClass({"donut-opacity":!0,"donut-behind":r!==h.value&&h.value!==null||k.value})},[l.subtotal!==null?(e.openBlock(),e.createElementBlock("g",ot,[l.subtotal===0?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:l.x,cy:l.y,r:3,fill:t.value.style.chart.color},null,8,ut)):h.value!==null&&h.value===r?(e.openBlock(),e.createElementBlock("g",nt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.donutHover,(o,v)=>(e.openBlock(),e.createElementBlock("path",{d:o.arcSlice,fill:`${o.color}`,"stroke-width":1,stroke:t.value.style.chart.backgroundColor},null,8,rt))),256))])):(e.openBlock(),e.createElementBlock("g",st,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.donut,(o,v)=>(e.openBlock(),e.createElementBlock("path",{d:o.arcSlice,fill:`${o.color}`,"stroke-width":.5,stroke:t.value.style.chart.backgroundColor},null,8,ct))),256))]))])):e.createCommentVNode("",!0)],2))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",{class:e.normalizeClass({"donut-opacity":!0,"donut-behind":r!==h.value&&h.value!==null||k.value})},[l.subtotal!==null&&t.value.style.chart.layout.dataLabels.show?(e.openBlock(),e.createElementBlock("text",{key:0,"text-anchor":"middle",x:l.x,y:h.value===l.index&&l.subtotal?l.y+t.value.style.chart.layout.dataLabels.fontSize/3:l.y-l.radius-t.value.style.chart.layout.dataLabels.fontSize+t.value.style.chart.layout.dataLabels.offsetY,"font-size":t.value.style.chart.layout.dataLabels.fontSize,"font-weight":"bold",fill:t.value.style.chart.layout.dataLabels.color},e.toDisplayString(z(l.subtotal,l,r)),9,it)):e.createCommentVNode("",!0)],2))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,r)=>(e.openBlock(),e.createElementBlock("rect",{x:u.value.left+r*f.value,y:s.value.absoluteHeight-u.value.bottom-10,width:f.value,height:10,fill:h.value===l.index?`url(#hover_${_.value})`:"transparent",onClick:o=>I(l,r),class:e.normalizeClass({"donut-hover":h.value===l.index&&l.subtotal})},null,10,dt))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,r)=>(e.openBlock(),e.createElementBlock("rect",{"data-cy-trap":"",x:u.value.left+r*f.value,y:u.value.top,width:f.value,height:s.value.height,fill:"transparent",onMouseenter:o=>be(l),onMouseleave:ae,onClick:o=>I(l,r),class:e.normalizeClass({"donut-hover":h.value===l.index&&l.subtotal})},null,42,vt))),256)),k.value?(e.openBlock(),e.createElementBlock("g",ht,[e.createElementVNode("rect",{rx:4,x:u.value.left,y:u.value.top,width:s.value.width,height:s.value.height,fill:t.value.style.chart.backgroundColor,style:{filter:"drop-shadow(0 12px 12px rgba(0,0,0,0.3))"}},null,8,yt),e.createElementVNode("line",{"data-html2canvas-ignore":"",x1:s.value.absoluteWidth-u.value.right-15,y1:u.value.top+5,x2:s.value.absoluteWidth-u.value.right-4,y2:u.value.top+15.5,"stroke-linecap":"round",stroke:t.value.style.chart.color,"stroke-width":"1.5"},null,8,mt),e.createElementVNode("line",{"data-html2canvas-ignore":"",x1:s.value.absoluteWidth-u.value.right-15,y2:u.value.top+5,x2:s.value.absoluteWidth-u.value.right-4,y1:u.value.top+15.5,"stroke-linecap":"round",stroke:t.value.style.chart.color,"stroke-width":"1.5"},null,8,ft),e.createElementVNode("circle",{"data-cy-close":"",onClick:oe,onKeypress:e.withKeys(oe,["enter"]),cx:s.value.absoluteWidth-u.value.right-s.value.width/40,cy:u.value.top+s.value.height/30,r:s.value.height/12,fill:"transparent",style:{cursor:"pointer"},tabindex:"0"},null,40,gt),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value.donutFocus,l=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("path",{"data-cy-zoom-donut":"",d:e.unref(n.calcNutArrowPath)(l,{x:s.value.centerX,y:s.value.centerY},12,12,!1,!1,15),stroke:l.color,"stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round",fill:"none",class:"vue-ui-donut-evolution-focus"},null,8,pt)]))),256)),e.createElementVNode("circle",{cx:u.value.left+s.value.width/2,cy:u.value.top+s.value.height/2,r:s.value.height/7,fill:t.value.style.chart.backgroundColor},null,8,kt),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value.donutFocus,(l,r)=>(e.openBlock(),e.createElementBlock("path",{d:l.arcSlice,fill:`${l.color}`,"stroke-width":1,stroke:t.value.style.chart.backgroundColor,class:"vue-ui-donut-evolution-focus"},null,8,bt))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value.donutFocus,(l,r)=>(e.openBlock(),e.createElementBlock("g",xt,[e.createElementVNode("text",{"text-anchor":e.unref(n.calcMarkerOffsetX)(l,!0,20).anchor,x:e.unref(n.calcMarkerOffsetX)(l,!0,10).x,y:e.unref(n.calcMarkerOffsetY)(l),fill:t.value.style.chart.layout.grid.yAxis.dataLabels.color,"font-size":10,"font-weight":"bold"},e.toDisplayString(l.name)+": "+e.toDisplayString(le(l,b.value.donutFocus))+" ("+e.toDisplayString(l.value===null?"-":z(l.value,l,r))+") ",9,Bt)]))),256)),e.createElementVNode("circle",{cx:u.value.left+s.value.width/2,cy:u.value.top+s.value.height/2,r:s.value.height/3.8,fill:`url(#focus_${_.value})`},null,8,Ct),e.createElementVNode("circle",{cx:u.value.left+s.value.width/2,cy:u.value.top+s.value.height/2,r:s.value.height/7.7,fill:t.value.style.chart.backgroundColor},null,8,_t),e.createElementVNode("text",{"text-anchor":"middle",x:u.value.left+s.value.width/2,y:u.value.top+s.value.height/2+14/3,"font-size":14,"font-weight":"bold",fill:t.value.style.chart.layout.dataLabels.color,class:"vue-ui-donut-evolution-focus"},e.toDisplayString(z(b.value.subtotal,b.value,null)),9,Et),t.value.style.chart.layout.grid.xAxis.dataLabels.values[b.value.index]?(e.openBlock(),e.createElementBlock("text",{key:0,x:u.value.left+6,y:u.value.top+t.value.style.chart.layout.grid.xAxis.dataLabels.fontSize*2,"font-size":t.value.style.chart.layout.grid.xAxis.dataLabels.fontSize*1.6,fill:t.value.style.chart.layout.dataLabels.color},e.toDisplayString(t.value.style.chart.layout.grid.xAxis.dataLabels.values[Number(b.value.index)+Number(i.value.start)]),9,Nt)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"svg",{svg:s.value},void 0,!0)],14,Fe)):e.createCommentVNode("",!0),a.$slots.watermark?(e.openBlock(),e.createElementBlock("div",wt,[e.renderSlot(a.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(Q)||e.unref(Z)})),void 0,!0)])):e.createCommentVNode("",!0),A.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(we.default,{key:6,config:{type:"donutEvolution",style:{backgroundColor:t.value.style.chart.backgroundColor,donutEvolution:{axis:{color:"#CCCCCC"},donuts:{color:"#CCCCCC"}}}}},null,8,["config"])),L.value>1&&t.value.style.chart.zoom.show?(e.openBlock(),e.createBlock(Se.Slicer,{key:`slicer_${G.value}`,background:t.value.style.chart.zoom.color,borderColor:t.value.style.chart.backgroundColor,fontSize:t.value.style.chart.zoom.fontSize,useResetSlot:t.value.style.chart.zoom.useResetSlot,labelLeft:t.value.style.chart.layout.grid.xAxis.dataLabels.values[Number(i.value.start)]||"",labelRight:t.value.style.chart.layout.grid.xAxis.dataLabels.values[Number(i.value.end)-1]||"",textColor:t.value.style.chart.color,inputColor:t.value.style.chart.zoom.color,selectColor:t.value.style.chart.zoom.highlightColor,max:L.value,min:0,valueStart:i.value.start,valueEnd:i.value.end,start:i.value.start,"onUpdate:start":c[0]||(c[0]=l=>i.value.start=l),end:i.value.end,"onUpdate:end":c[1]||(c[1]=l=>i.value.end=l),onReset:W},{"reset-action":e.withCtx(({reset:l})=>[e.renderSlot(a.$slots,"reset-action",e.normalizeProps(e.guardReactiveProps({reset:l})),void 0,!0)]),_:3},8,["background","borderColor","fontSize","useResetSlot","labelLeft","labelRight","textColor","inputColor","selectColor","max","valueStart","valueEnd","start","end"])):e.createCommentVNode("",!0),t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(Ne.Legend,{key:`legend_${K.value}`,legendSet:ue.value,config:xe.value,onClickMarker:c[2]||(c[2]=({legend:l})=>M(l.uid))},{item:e.withCtx(({legend:l,index:r})=>[e.createElementVNode("div",{"data-cy-legend-item":"",onClick:o=>M(l.uid),style:e.normalizeStyle(`opacity:${y.value.includes(l.uid)?.5:1}`)},[e.createTextVNode(e.toDisplayString(l.name)+": "+e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.dataLabels.formatter,l.value,e.unref(n.dataLabel)({p:t.value.style.chart.layout.dataLabels.prefix,v:l.value,s:t.value.style.chart.layout.dataLabels.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:l,seriesIndex:r}))+" ",1),y.value.includes(l.uid)?(e.openBlock(),e.createElementBlock("span",Vt," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",Lt," ("+e.toDisplayString(isNaN(l.value/ne.value)?"-":e.unref(n.dataLabel)({v:l.value/ne.value*100,s:"%",r:t.value.style.chart.legend.roundingPercentage}))+") ",1))],12,St)]),_:1},8,["legendSet","config"])):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"legend",{legend:ue.value},void 0,!0),a.$slots.source?(e.openBlock(),e.createElementBlock("div",At,[e.renderSlot(a.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),A.value?(e.openBlock(),e.createBlock(Le.default,{key:10,hideDetails:"",config:{open:$.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(Ee.DataTable,{key:`table_${j.value}`,colNames:N.value.colNames,head:N.value.head,body:N.value.body,config:N.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:c[3]||(c[3]=l=>$.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createTextVNode(e.toDisplayString(l.name??l),1)]),td:e.withCtx(({td:l})=>[l.value===null?(e.openBlock(),e.createElementBlock("span",$t,"-")):(e.openBlock(),e.createElementBlock("b",zt,e.toDisplayString(isNaN(l.value)?"":t.value.style.chart.layout.dataLabels.prefix)+e.toDisplayString(!isNaN(l.value)&&l.value!==null?Number(l.value.toFixed(t.value.table.td.roundingValue)).toLocaleString():l)+e.toDisplayString(isNaN(l.value)?"":t.value.style.chart.layout.dataLabels.suffix),1)),e.createElementVNode("span",null,e.toDisplayString(l.percentage&&!isNaN(l.percentage)?`(${Number(l.percentage.toFixed(t.value.table.td.roundingPercentage)).toLocaleString()}%)`:""),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,ze))}},Dt=$e._export_sfc(Ft,[["__scopeId","data-v-800b47b9"]]);exports.default=Dt;
@@ -1,15 +1,15 @@
1
1
  import { computed as m, ref as v, watch as de, onMounted as ve, onBeforeUnmount as Ne, openBlock as o, createElementBlock as r, normalizeClass as he, normalizeStyle as H, createBlock as L, createCommentVNode as y, unref as d, createSlots as Te, withCtx as _, renderSlot as k, normalizeProps as W, guardReactiveProps as R, createVNode as Pe, Fragment as w, renderList as $, createElementVNode as n, toDisplayString as A, createTextVNode as ye, nextTick as Ge } from "vue";
2
- import { u as De, c as fe, t as Ie, o as Me, e as be, g as Oe, v as ge, C as Fe, f as z, X as pe, i as B, l as me, h as _e, q as Ve, r as Ee } from "./index-CpjF4-PU.js";
2
+ import { u as De, c as fe, t as Ie, o as Me, e as be, g as Oe, v as ge, C as Fe, f as z, X as pe, i as B, l as me, h as _e, q as Ve, r as Ee } from "./index-DtCryprM.js";
3
3
  import { t as He, u as We } from "./useResponsive-CoxXLe23.js";
4
- import { _ as Re } from "./Title-D_ljAKoY.js";
5
- import { u as Be, U as Ue } from "./usePrinter-CZ0Ro0M3.js";
6
- import { D as je } from "./DataTable-BmAybhqW.js";
7
- import qe from "./vue-ui-skeleton-5qiu2vOB.js";
8
- import { L as Ye } from "./Legend-7EZhiUrH.js";
9
- import Ze from "./vue-ui-accordion-D6Uwxwl0.js";
10
- import { u as ke } from "./useNestedProp-DiDiQc6z.js";
11
- import { _ as Je } from "./PackageVersion-BRMtBck7.js";
12
- import { P as Ke } from "./PenAndPaper-u9Nkiu0T.js";
4
+ import { _ as Re } from "./Title-CfjKQsLl.js";
5
+ import { u as Be, U as Ue } from "./usePrinter-D4_doq3d.js";
6
+ import { D as je } from "./DataTable-DY9Joecu.js";
7
+ import qe from "./vue-ui-skeleton-Bw0j7S0v.js";
8
+ import { L as Ye } from "./Legend-CSG4maaN.js";
9
+ import Ze from "./vue-ui-accordion-C3p9yjUl.js";
10
+ import { u as ke } from "./useNestedProp-tT95LfDr.js";
11
+ import { _ as Je } from "./PackageVersion-CRyyH_HB.js";
12
+ import { P as Ke } from "./PenAndPaper-BF7qtcRe.js";
13
13
  import { _ as Qe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
14
14
  const et = ["id"], tt = ["xmlns", "viewBox"], lt = { key: 0 }, at = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], st = { key: 1 }, ot = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], rt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], nt = { key: 2 }, ut = ["x", "y", "font-size", "fill", "font-weight"], it = ["x", "y", "font-size", "fill"], ct = { key: 3 }, dt = ["x", "y", "font-size", "fill", "font-weight"], vt = ["id"], ht = ["stop-color"], yt = ["stop-color"], ft = ["stop-color"], bt = ["id"], gt = ["stop-color"], pt = ["stop-color"], mt = ["stop-color"], _t = ["id"], kt = ["stop-color"], xt = ["stop-color"], Ct = ["id"], wt = ["stop-color"], $t = ["stop-color"], Lt = { key: 0 }, At = ["d", "fill"], zt = { key: 1 }, Xt = ["x", "y", "height", "width", "fill"], St = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], Nt = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], Tt = { key: 2 }, Pt = ["x", "y", "fill", "font-size"], Gt = { key: 3 }, Dt = ["x", "y", "fill", "font-size"], It = {
15
15
  key: 5,
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-BtqOSPWK.cjs"),Y=require("./useResponsive-BJ7DTGpm.cjs"),ne=require("./Title-BJut0KCO.cjs"),Z=require("./usePrinter-SEUTEAmF.cjs"),ue=require("./DataTable-D-c7laSt.cjs"),ce=require("./vue-ui-skeleton-CCo2ROV1.cjs"),ie=require("./Legend-D_dNnmCH.cjs"),de=require("./vue-ui-accordion-iiUNHeV-.cjs"),J=require("./useNestedProp-C7FKZW2F.cjs"),ve=require("./PackageVersion-C2JzxDlg.cjs"),he=require("./PenAndPaper-Bur5hR1K.cjs"),ye=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),fe=["id"],me=["xmlns","viewBox"],be={key:0},pe=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],ge={key:1},ke=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],_e=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],xe={key:2},Ce=["x","y","font-size","fill","font-weight"],we=["x","y","font-size","fill"],Be={key:3},Ne=["x","y","font-size","fill","font-weight"],Ee=["id"],$e=["stop-color"],Le=["stop-color"],Ve=["stop-color"],Se=["id"],ze=["stop-color"],Ae=["stop-color"],Pe=["stop-color"],Te=["id"],Xe=["stop-color"],De=["stop-color"],Fe=["id"],Me=["stop-color"],Ge=["stop-color"],Ie={key:0},Oe=["d","fill"],qe={key:1},He=["x","y","height","width","fill"],Re=["cx","cy","r","fill","stroke","stroke-width"],We=["cx","cy","r","fill","stroke","stroke-width"],Ue={key:2},je=["x","y","fill","font-size"],Ye={key:3},Ze=["x","y","fill","font-size"],Je={key:5,class:"vue-data-ui-watermark"},Ke=["xmlns","height","width"],Qe=["fill"],et=["innerHTML"],tt={__name:"vue-ui-dumbbell",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(K,{expose:Q,emit:at}){const y=K,{vue_ui_dumbbell:ee}=s.useConfig(),b=e.computed({get(){return!!y.dataset&&y.dataset.length},set(a){return a}}),d=e.ref(s.createUid()),V=e.ref(0),p=e.ref(null),S=e.ref(null),z=e.ref(null),A=e.ref(null),P=e.ref(null),T=e.ref(0),X=e.ref(0),D=e.ref(0),t=e.computed({get:()=>F(),set:a=>a});function F(){const a=J.useNestedProp({userConfig:y.config,defaultConfig:ee});return a.theme?{...J.useNestedProp({userConfig:s.themes.vue_ui_dumbbell[a.theme]||y.config,defaultConfig:a})}:a}e.watch(()=>y.config,a=>{t.value=F(),M(),T.value+=1,X.value+=1,D.value+=1,i.value=t.value.style.chart.rowHeight,g.value=t.value.style.chart.width},{deep:!0}),e.watch(()=>y.dataset,a=>{R()},{deep:!0});const _=e.ref(null);e.onMounted(()=>{M()});function M(){if(s.objectIsEmpty(y.dataset)?s.error({componentName:"VueUiDumbbell",type:"dataset"}):y.dataset.forEach((a,n)=>{s.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["name","start","end"]}).forEach(l=>{b.value=!1,s.error({componentName:"VueUiDumbbell",type:"datasetSerieAttribute",property:l,index:n})})}),t.value.responsive){const a=Y.throttle(()=>{const{width:n,height:l}=Y.useResponsive({chart:p.value,title:t.value.style.chart.title.text?S.value:null,legend:t.value.style.chart.legend.show?z.value:null,source:A.value,noTitle:P.value});g.value=n,i.value=l/y.dataset.length,v.value=C()});_.value=new ResizeObserver(a),_.value.observe(p.value.parentNode)}}e.onBeforeUnmount(()=>{_.value&&_.value.disconnect()});const{isPrinting:G,isImaging:I,generatePdf:O,generateImage:q}=Z.usePrinter({elementId:`dumbbell_${d.value}`,fileName:t.value.style.chart.title.text||"vue-ui-dumbbell"}),te=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),x=e.ref({showTable:t.value.table.show}),f=e.computed(()=>y.dataset.map((a,n)=>({...a,start:s.checkNaN(a.start),end:s.checkNaN(a.end),id:s.createUid()}))),E=e.computed(()=>({max:Math.max(...f.value.flatMap(a=>[a.start,a.end])),min:Math.min(...f.value.flatMap(a=>[a.start,a.end]))})),c=e.computed(()=>s.calculateNiceScale(E.value.min<0?E.value.min:0,E.value.max,t.value.style.chart.grid.scaleSteps)),i=e.ref(t.value.style.chart.rowHeight),g=e.ref(t.value.style.chart.width),r=e.computed(()=>{const a=i.value,n=t.value.style.chart.padding.left+t.value.style.chart.padding.right+g.value,l=t.value.style.chart.padding.top+t.value.style.chart.padding.bottom+a*y.dataset.length,o=c.value.ticks.length*(g.value/c.value.ticks.length);return{left:t.value.style.chart.padding.left,right:n-t.value.style.chart.padding.right,top:t.value.style.chart.padding.top,bottom:l-t.value.style.chart.padding.bottom,width:g.value,height:a*y.dataset.length,rowHeight:a,absoluteHeight:l,absoluteWidth:n,widthPlotReference:o}});function C(){return f.value.map((a,n)=>{const l=r.value.left+(a.start+Math.abs(c.value.min))/(c.value.max+Math.abs(c.value.min))*r.value.widthPlotReference,o=r.value.left+(a.end+Math.abs(c.value.min))/(c.value.max+Math.abs(c.value.min))*r.value.widthPlotReference,u=l+(o-l)/2;return{...a,startX:l,endX:o,centerX:u,y:r.value.top+n*i.value+i.value/2,endVal:a.start}})}const v=e.ref([]),H=e.ref(null),le=e.computed(()=>f.value.map(a=>a.end).reduce((a,n)=>a+n,0));e.onMounted(()=>{R()});function R(){v.value=C();let a=v.value.map(l=>l.start).reduce((l,o)=>l+o,0);function n(){const l=f.value.map(o=>o.end-o.start);a>=le.value?(cancelAnimationFrame(H.value),v.value=C()):(v.value=v.value.map((o,u)=>{o.endVal+=l[u]*(t.value.animationSpeed/100);const h=r.value.left+(o.start+Math.abs(c.value.min))/(c.value.max+Math.abs(c.value.min))*r.value.widthPlotReference,N=r.value.left+(o.endVal+Math.abs(c.value.min))/(c.value.max+Math.abs(c.value.min))*r.value.widthPlotReference,L=h+(N-h)/2;return{...o,startX:h,endX:N,centerX:L,y:r.value.top+u*i.value+i.value/2,endVal:o.endVal}}),a=v.value.map(o=>o.endVal).reduce((o,u)=>o+u,0),H.value=requestAnimationFrame(n))}t.value.useAnimation?n():v.value=C()}const W=e.computed(()=>[{name:t.value.style.chart.legend.labelStart,color:t.value.style.chart.plots.gradient.show?`url(#start_grad_${d.value})`:t.value.style.chart.plots.startColor},{name:t.value.style.chart.legend.labelEnd,color:t.value.style.chart.plots.gradient.show?`url(#end_grad_${d.value})`:t.value.style.chart.plots.endColor}]),ae=e.computed(()=>({cy:"donut-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,paddingTop:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),m=e.computed(()=>{const a=v.value.map(l=>({name:l.name})),n=v.value.map(l=>({start:l.start,end:l.end}));return{head:a,body:n}}),w=e.computed(()=>{const a=[t.value.table.columnNames.series,t.value.table.columnNames.start,t.value.table.columnNames.end,t.value.table.columnNames.progression],n=m.value.head.map((u,h)=>{const N=s.dataLabel({p:t.value.style.chart.labels.prefix,v:m.value.body[h].start,s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue}),L=s.dataLabel({p:t.value.style.chart.labels.prefix,v:m.value.body[h].end,s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue}),se=s.dataLabel({v:100*(m.value.body[h].end/m.value.body[h].start-1),s:"%",r:t.value.table.td.roundingPercentage});return[{name:u.name},N,L,se]}),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.start,t.value.table.columnNames.end,t.value.table.columnNames.progression],head:a,body:n,config:l}});function U(){e.nextTick(()=>{const a=m.value.head.map((o,u)=>[[o.name],[m.value.body[u].start],[m.value.body[u].end]]),n=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.series],[t.value.table.columnNames.start],[t.value.table.columnNames.end]]].concat(a),l=s.createCsvContent(n);s.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-dumbbell"})})}const k=e.ref(!1);function oe(a){k.value=a,V.value+=1}function re(){return v.value}function j(){x.value.showTable=!x.value.showTable}const B=e.ref(!1);function $(){B.value=!B.value}return Q({getData:re,generatePdf:O,generateCsv:U,generateImage:q,toggleTable:j,toggleAnnotator:$}),(a,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"dumbbellChart",ref:p,class:e.normalizeClass(`vue-ui-dumbbell ${k.value?"vue-data-ui-wrapper-fullscreen":""}`),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%":""}`),id:`dumbbell_${d.value}`},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(he.PenAndPaper,{key:0,parent:p.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:B.value,onClose:$},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),te.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:P,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:S,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(ne._sfc_main,{key:`title_${T.value}`,config:{title:{cy:"donut-div-title",...t.value.style.chart.title},subtitle:{cy:"donut-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&b.value?(e.openBlock(),e.createBlock(Z.UserOptions,{ref:"details",key:`user_option_${V.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(G),isImaging:e.unref(I),uid:d.value,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:k.value,titles:{...t.value.userOptions.buttonTitles},chartElement:p.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:B.value,onToggleFullscreen:oe,onGeneratePdf:e.unref(O),onGenerateCsv:U,onGenerateImage:e.unref(q),onToggleTable:j,onToggleAnnotator:$},e.createSlots({_:2},[a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,a.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:o})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:o})),void 0,!0)]),key:"4"}:void 0,a.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:o})=>[e.renderSlot(a.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:o})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(s.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":k.value,"vue-data-ui-fulscreen--off":!k.value}),viewBox:`0 0 ${r.value.absoluteWidth<=0?10:r.value.absoluteWidth} ${r.value.absoluteHeight<=0?10:r.value.absoluteHeight}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(ve._sfc_main),t.value.style.chart.grid.verticalGrid.show?(e.openBlock(),e.createElementBlock("g",be,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value.ticks,(l,o)=>(e.openBlock(),e.createElementBlock("line",{x1:r.value.left+o*r.value.width/(c.value.ticks.length-1),x2:r.value.left+o*r.value.width/(c.value.ticks.length-1),y1:r.value.top,y2:r.value.bottom,stroke:t.value.style.chart.grid.verticalGrid.stroke,"stroke-width":t.value.style.chart.grid.verticalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.verticalGrid.strokeDasharray},null,8,pe))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.horizontalGrid.show?(e.openBlock(),e.createElementBlock("g",ge,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(l,o)=>(e.openBlock(),e.createElementBlock("line",{x1:r.value.left,x2:r.value.right,y1:r.value.top+o*i.value,y2:r.value.top+o*i.value,stroke:t.value.style.chart.grid.horizontalGrid.stroke,"stroke-width":t.value.style.chart.grid.horizontalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.horizontalGrid.strokeDasharray},null,8,ke))),256)),e.createElementVNode("line",{x1:r.value.left,x2:r.value.right,y1:r.value.bottom,y2:r.value.bottom,stroke:t.value.style.chart.grid.horizontalGrid.stroke,"stroke-width":t.value.style.chart.grid.horizontalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.horizontalGrid.strokeDasharray},null,8,_e)])):e.createCommentVNode("",!0),t.value.style.chart.labels.yAxisLabels.show?(e.openBlock(),e.createElementBlock("g",xe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(l,o)=>(e.openBlock(),e.createElementBlock("text",{x:r.value.left-6+t.value.style.chart.labels.yAxisLabels.offsetX,y:r.value.top+o*i.value+(t.value.style.chart.labels.yAxisLabels.showProgression?i.value/3:i.value/2)+t.value.style.chart.labels.yAxisLabels.fontSize/3,"font-size":t.value.style.chart.labels.yAxisLabels.fontSize,fill:t.value.style.chart.labels.yAxisLabels.color,"font-weight":t.value.style.chart.labels.yAxisLabels.bold?"bold":"normal","text-anchor":"end"},e.toDisplayString(l.name),9,Ce))),256)),t.value.style.chart.labels.yAxisLabels.showProgression?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(f.value,(l,o)=>(e.openBlock(),e.createElementBlock("text",{x:r.value.left-6+t.value.style.chart.labels.yAxisLabels.offsetX,y:r.value.top+o*i.value+i.value/1.3+t.value.style.chart.labels.yAxisLabels.fontSize/3,"font-size":t.value.style.chart.labels.yAxisLabels.fontSize,fill:t.value.style.chart.labels.yAxisLabels.color,"text-anchor":"end"},e.toDisplayString(e.unref(s.dataLabel)({v:100*(l.end/l.start-1),s:"%",r:t.value.style.chart.labels.yAxisLabels.rounding})),9,we))),256)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.style.chart.labels.xAxisLabels.show?(e.openBlock(),e.createElementBlock("g",Be,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value.ticks,(l,o)=>(e.openBlock(),e.createElementBlock("text",{x:r.value.left+o*(r.value.width/(c.value.ticks.length-1)),y:r.value.bottom+t.value.style.chart.labels.xAxisLabels.fontSize+t.value.style.chart.labels.xAxisLabels.offsetY,"font-size":t.value.style.chart.labels.xAxisLabels.fontSize,fill:t.value.style.chart.labels.xAxisLabels.color,"font-weight":t.value.style.chart.labels.xAxisLabels.bold?"bold":"normal","text-anchor":"middle"},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.chart.labels.formatter,l,e.unref(s.dataLabel)({p:t.value.style.chart.labels.prefix,v:l,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.labels.xAxisLabels.rounding}),{datapoint:l,seriesIndex:o})),9,Ne))),256))])):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{id:`start_grad_${d.value}`,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(s.lightenHexColor)(t.value.style.chart.plots.startColor,t.value.style.chart.plots.gradient.intensity/100)},null,8,$e),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(s.darkenHexColor)(t.value.style.chart.plots.startColor,.1)},null,8,Le),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.startColor},null,8,Ve)],8,Ee),e.createElementVNode("radialGradient",{id:`end_grad_${d.value}`,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(s.lightenHexColor)(t.value.style.chart.plots.endColor,t.value.style.chart.plots.gradient.intensity/100)},null,8,ze),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(s.darkenHexColor)(t.value.style.chart.plots.endColor,.1)},null,8,Ae),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.endColor},null,8,Pe)],8,Se)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(l,o)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`grad_positive_${d.value}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.chart.plots.startColor},null,8,Xe),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.endColor},null,8,De)],8,Te),e.createElementVNode("linearGradient",{id:`grad_negative_${d.value}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.chart.plots.endColor},null,8,Me),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.startColor},null,8,Ge)],8,Fe)]),t.value.style.chart.plots.link.type==="curved"?(e.openBlock(),e.createElementBlock("g",Ie,[e.createElementVNode("path",{d:`M
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-Dgjlvd_3.cjs"),Y=require("./useResponsive-BJ7DTGpm.cjs"),ne=require("./Title-C8WRomob.cjs"),Z=require("./usePrinter-Bd-68vBM.cjs"),ue=require("./DataTable-CKYq5S0j.cjs"),ce=require("./vue-ui-skeleton-Ng7RKLmM.cjs"),ie=require("./Legend-EHKRwZ5N.cjs"),de=require("./vue-ui-accordion-DAf1jeI5.cjs"),J=require("./useNestedProp-DMaPxyYb.cjs"),ve=require("./PackageVersion-C_Y8uWJM.cjs"),he=require("./PenAndPaper-CotnLxGh.cjs"),ye=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),fe=["id"],me=["xmlns","viewBox"],be={key:0},pe=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],ge={key:1},ke=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],_e=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],xe={key:2},Ce=["x","y","font-size","fill","font-weight"],we=["x","y","font-size","fill"],Be={key:3},Ne=["x","y","font-size","fill","font-weight"],Ee=["id"],$e=["stop-color"],Le=["stop-color"],Ve=["stop-color"],Se=["id"],ze=["stop-color"],Ae=["stop-color"],Pe=["stop-color"],Te=["id"],Xe=["stop-color"],De=["stop-color"],Fe=["id"],Me=["stop-color"],Ge=["stop-color"],Ie={key:0},Oe=["d","fill"],qe={key:1},He=["x","y","height","width","fill"],Re=["cx","cy","r","fill","stroke","stroke-width"],We=["cx","cy","r","fill","stroke","stroke-width"],Ue={key:2},je=["x","y","fill","font-size"],Ye={key:3},Ze=["x","y","fill","font-size"],Je={key:5,class:"vue-data-ui-watermark"},Ke=["xmlns","height","width"],Qe=["fill"],et=["innerHTML"],tt={__name:"vue-ui-dumbbell",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(K,{expose:Q,emit:at}){const y=K,{vue_ui_dumbbell:ee}=s.useConfig(),b=e.computed({get(){return!!y.dataset&&y.dataset.length},set(a){return a}}),d=e.ref(s.createUid()),V=e.ref(0),p=e.ref(null),S=e.ref(null),z=e.ref(null),A=e.ref(null),P=e.ref(null),T=e.ref(0),X=e.ref(0),D=e.ref(0),t=e.computed({get:()=>F(),set:a=>a});function F(){const a=J.useNestedProp({userConfig:y.config,defaultConfig:ee});return a.theme?{...J.useNestedProp({userConfig:s.themes.vue_ui_dumbbell[a.theme]||y.config,defaultConfig:a})}:a}e.watch(()=>y.config,a=>{t.value=F(),M(),T.value+=1,X.value+=1,D.value+=1,i.value=t.value.style.chart.rowHeight,g.value=t.value.style.chart.width},{deep:!0}),e.watch(()=>y.dataset,a=>{R()},{deep:!0});const _=e.ref(null);e.onMounted(()=>{M()});function M(){if(s.objectIsEmpty(y.dataset)?s.error({componentName:"VueUiDumbbell",type:"dataset"}):y.dataset.forEach((a,n)=>{s.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["name","start","end"]}).forEach(l=>{b.value=!1,s.error({componentName:"VueUiDumbbell",type:"datasetSerieAttribute",property:l,index:n})})}),t.value.responsive){const a=Y.throttle(()=>{const{width:n,height:l}=Y.useResponsive({chart:p.value,title:t.value.style.chart.title.text?S.value:null,legend:t.value.style.chart.legend.show?z.value:null,source:A.value,noTitle:P.value});g.value=n,i.value=l/y.dataset.length,v.value=C()});_.value=new ResizeObserver(a),_.value.observe(p.value.parentNode)}}e.onBeforeUnmount(()=>{_.value&&_.value.disconnect()});const{isPrinting:G,isImaging:I,generatePdf:O,generateImage:q}=Z.usePrinter({elementId:`dumbbell_${d.value}`,fileName:t.value.style.chart.title.text||"vue-ui-dumbbell"}),te=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),x=e.ref({showTable:t.value.table.show}),f=e.computed(()=>y.dataset.map((a,n)=>({...a,start:s.checkNaN(a.start),end:s.checkNaN(a.end),id:s.createUid()}))),E=e.computed(()=>({max:Math.max(...f.value.flatMap(a=>[a.start,a.end])),min:Math.min(...f.value.flatMap(a=>[a.start,a.end]))})),c=e.computed(()=>s.calculateNiceScale(E.value.min<0?E.value.min:0,E.value.max,t.value.style.chart.grid.scaleSteps)),i=e.ref(t.value.style.chart.rowHeight),g=e.ref(t.value.style.chart.width),r=e.computed(()=>{const a=i.value,n=t.value.style.chart.padding.left+t.value.style.chart.padding.right+g.value,l=t.value.style.chart.padding.top+t.value.style.chart.padding.bottom+a*y.dataset.length,o=c.value.ticks.length*(g.value/c.value.ticks.length);return{left:t.value.style.chart.padding.left,right:n-t.value.style.chart.padding.right,top:t.value.style.chart.padding.top,bottom:l-t.value.style.chart.padding.bottom,width:g.value,height:a*y.dataset.length,rowHeight:a,absoluteHeight:l,absoluteWidth:n,widthPlotReference:o}});function C(){return f.value.map((a,n)=>{const l=r.value.left+(a.start+Math.abs(c.value.min))/(c.value.max+Math.abs(c.value.min))*r.value.widthPlotReference,o=r.value.left+(a.end+Math.abs(c.value.min))/(c.value.max+Math.abs(c.value.min))*r.value.widthPlotReference,u=l+(o-l)/2;return{...a,startX:l,endX:o,centerX:u,y:r.value.top+n*i.value+i.value/2,endVal:a.start}})}const v=e.ref([]),H=e.ref(null),le=e.computed(()=>f.value.map(a=>a.end).reduce((a,n)=>a+n,0));e.onMounted(()=>{R()});function R(){v.value=C();let a=v.value.map(l=>l.start).reduce((l,o)=>l+o,0);function n(){const l=f.value.map(o=>o.end-o.start);a>=le.value?(cancelAnimationFrame(H.value),v.value=C()):(v.value=v.value.map((o,u)=>{o.endVal+=l[u]*(t.value.animationSpeed/100);const h=r.value.left+(o.start+Math.abs(c.value.min))/(c.value.max+Math.abs(c.value.min))*r.value.widthPlotReference,N=r.value.left+(o.endVal+Math.abs(c.value.min))/(c.value.max+Math.abs(c.value.min))*r.value.widthPlotReference,L=h+(N-h)/2;return{...o,startX:h,endX:N,centerX:L,y:r.value.top+u*i.value+i.value/2,endVal:o.endVal}}),a=v.value.map(o=>o.endVal).reduce((o,u)=>o+u,0),H.value=requestAnimationFrame(n))}t.value.useAnimation?n():v.value=C()}const W=e.computed(()=>[{name:t.value.style.chart.legend.labelStart,color:t.value.style.chart.plots.gradient.show?`url(#start_grad_${d.value})`:t.value.style.chart.plots.startColor},{name:t.value.style.chart.legend.labelEnd,color:t.value.style.chart.plots.gradient.show?`url(#end_grad_${d.value})`:t.value.style.chart.plots.endColor}]),ae=e.computed(()=>({cy:"donut-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,paddingTop:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),m=e.computed(()=>{const a=v.value.map(l=>({name:l.name})),n=v.value.map(l=>({start:l.start,end:l.end}));return{head:a,body:n}}),w=e.computed(()=>{const a=[t.value.table.columnNames.series,t.value.table.columnNames.start,t.value.table.columnNames.end,t.value.table.columnNames.progression],n=m.value.head.map((u,h)=>{const N=s.dataLabel({p:t.value.style.chart.labels.prefix,v:m.value.body[h].start,s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue}),L=s.dataLabel({p:t.value.style.chart.labels.prefix,v:m.value.body[h].end,s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue}),se=s.dataLabel({v:100*(m.value.body[h].end/m.value.body[h].start-1),s:"%",r:t.value.table.td.roundingPercentage});return[{name:u.name},N,L,se]}),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.start,t.value.table.columnNames.end,t.value.table.columnNames.progression],head:a,body:n,config:l}});function U(){e.nextTick(()=>{const a=m.value.head.map((o,u)=>[[o.name],[m.value.body[u].start],[m.value.body[u].end]]),n=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.series],[t.value.table.columnNames.start],[t.value.table.columnNames.end]]].concat(a),l=s.createCsvContent(n);s.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-dumbbell"})})}const k=e.ref(!1);function oe(a){k.value=a,V.value+=1}function re(){return v.value}function j(){x.value.showTable=!x.value.showTable}const B=e.ref(!1);function $(){B.value=!B.value}return Q({getData:re,generatePdf:O,generateCsv:U,generateImage:q,toggleTable:j,toggleAnnotator:$}),(a,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"dumbbellChart",ref:p,class:e.normalizeClass(`vue-ui-dumbbell ${k.value?"vue-data-ui-wrapper-fullscreen":""}`),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%":""}`),id:`dumbbell_${d.value}`},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(he.PenAndPaper,{key:0,parent:p.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:B.value,onClose:$},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),te.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:P,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:S,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(ne._sfc_main,{key:`title_${T.value}`,config:{title:{cy:"donut-div-title",...t.value.style.chart.title},subtitle:{cy:"donut-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&b.value?(e.openBlock(),e.createBlock(Z.UserOptions,{ref:"details",key:`user_option_${V.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(G),isImaging:e.unref(I),uid:d.value,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:k.value,titles:{...t.value.userOptions.buttonTitles},chartElement:p.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:B.value,onToggleFullscreen:oe,onGeneratePdf:e.unref(O),onGenerateCsv:U,onGenerateImage:e.unref(q),onToggleTable:j,onToggleAnnotator:$},e.createSlots({_:2},[a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,a.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:o})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:o})),void 0,!0)]),key:"4"}:void 0,a.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:o})=>[e.renderSlot(a.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:o})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(s.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":k.value,"vue-data-ui-fulscreen--off":!k.value}),viewBox:`0 0 ${r.value.absoluteWidth<=0?10:r.value.absoluteWidth} ${r.value.absoluteHeight<=0?10:r.value.absoluteHeight}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(ve._sfc_main),t.value.style.chart.grid.verticalGrid.show?(e.openBlock(),e.createElementBlock("g",be,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value.ticks,(l,o)=>(e.openBlock(),e.createElementBlock("line",{x1:r.value.left+o*r.value.width/(c.value.ticks.length-1),x2:r.value.left+o*r.value.width/(c.value.ticks.length-1),y1:r.value.top,y2:r.value.bottom,stroke:t.value.style.chart.grid.verticalGrid.stroke,"stroke-width":t.value.style.chart.grid.verticalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.verticalGrid.strokeDasharray},null,8,pe))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.horizontalGrid.show?(e.openBlock(),e.createElementBlock("g",ge,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(l,o)=>(e.openBlock(),e.createElementBlock("line",{x1:r.value.left,x2:r.value.right,y1:r.value.top+o*i.value,y2:r.value.top+o*i.value,stroke:t.value.style.chart.grid.horizontalGrid.stroke,"stroke-width":t.value.style.chart.grid.horizontalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.horizontalGrid.strokeDasharray},null,8,ke))),256)),e.createElementVNode("line",{x1:r.value.left,x2:r.value.right,y1:r.value.bottom,y2:r.value.bottom,stroke:t.value.style.chart.grid.horizontalGrid.stroke,"stroke-width":t.value.style.chart.grid.horizontalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.horizontalGrid.strokeDasharray},null,8,_e)])):e.createCommentVNode("",!0),t.value.style.chart.labels.yAxisLabels.show?(e.openBlock(),e.createElementBlock("g",xe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(l,o)=>(e.openBlock(),e.createElementBlock("text",{x:r.value.left-6+t.value.style.chart.labels.yAxisLabels.offsetX,y:r.value.top+o*i.value+(t.value.style.chart.labels.yAxisLabels.showProgression?i.value/3:i.value/2)+t.value.style.chart.labels.yAxisLabels.fontSize/3,"font-size":t.value.style.chart.labels.yAxisLabels.fontSize,fill:t.value.style.chart.labels.yAxisLabels.color,"font-weight":t.value.style.chart.labels.yAxisLabels.bold?"bold":"normal","text-anchor":"end"},e.toDisplayString(l.name),9,Ce))),256)),t.value.style.chart.labels.yAxisLabels.showProgression?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(f.value,(l,o)=>(e.openBlock(),e.createElementBlock("text",{x:r.value.left-6+t.value.style.chart.labels.yAxisLabels.offsetX,y:r.value.top+o*i.value+i.value/1.3+t.value.style.chart.labels.yAxisLabels.fontSize/3,"font-size":t.value.style.chart.labels.yAxisLabels.fontSize,fill:t.value.style.chart.labels.yAxisLabels.color,"text-anchor":"end"},e.toDisplayString(e.unref(s.dataLabel)({v:100*(l.end/l.start-1),s:"%",r:t.value.style.chart.labels.yAxisLabels.rounding})),9,we))),256)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.style.chart.labels.xAxisLabels.show?(e.openBlock(),e.createElementBlock("g",Be,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value.ticks,(l,o)=>(e.openBlock(),e.createElementBlock("text",{x:r.value.left+o*(r.value.width/(c.value.ticks.length-1)),y:r.value.bottom+t.value.style.chart.labels.xAxisLabels.fontSize+t.value.style.chart.labels.xAxisLabels.offsetY,"font-size":t.value.style.chart.labels.xAxisLabels.fontSize,fill:t.value.style.chart.labels.xAxisLabels.color,"font-weight":t.value.style.chart.labels.xAxisLabels.bold?"bold":"normal","text-anchor":"middle"},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.chart.labels.formatter,l,e.unref(s.dataLabel)({p:t.value.style.chart.labels.prefix,v:l,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.labels.xAxisLabels.rounding}),{datapoint:l,seriesIndex:o})),9,Ne))),256))])):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{id:`start_grad_${d.value}`,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(s.lightenHexColor)(t.value.style.chart.plots.startColor,t.value.style.chart.plots.gradient.intensity/100)},null,8,$e),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(s.darkenHexColor)(t.value.style.chart.plots.startColor,.1)},null,8,Le),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.startColor},null,8,Ve)],8,Ee),e.createElementVNode("radialGradient",{id:`end_grad_${d.value}`,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(s.lightenHexColor)(t.value.style.chart.plots.endColor,t.value.style.chart.plots.gradient.intensity/100)},null,8,ze),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(s.darkenHexColor)(t.value.style.chart.plots.endColor,.1)},null,8,Ae),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.endColor},null,8,Pe)],8,Se)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(l,o)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`grad_positive_${d.value}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.chart.plots.startColor},null,8,Xe),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.endColor},null,8,De)],8,Te),e.createElementVNode("linearGradient",{id:`grad_negative_${d.value}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.chart.plots.endColor},null,8,Me),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.startColor},null,8,Ge)],8,Fe)]),t.value.style.chart.plots.link.type==="curved"?(e.openBlock(),e.createElementBlock("g",Ie,[e.createElementVNode("path",{d:`M
2
2
  ${l.startX},${l.y+t.value.style.chart.plots.radius/2}
3
3
  C ${l.centerX},${l.y} ${l.centerX},${l.y}
4
4
  ${l.endX},${l.y+t.value.style.chart.plots.radius/2}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-BtqOSPWK.cjs"),me=require("./Title-BJut0KCO.cjs"),K=require("./usePrinter-SEUTEAmF.cjs"),pe=require("./DataTable-D-c7laSt.cjs"),ge=require("./vue-ui-accordion-iiUNHeV-.cjs"),ke=require("./vue-ui-skeleton-CCo2ROV1.cjs"),Q=require("./useNestedProp-C7FKZW2F.cjs"),ye=require("./PackageVersion-C2JzxDlg.cjs"),be=require("./PenAndPaper-Bur5hR1K.cjs"),Ce=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),we=["id"],Ne={key:1,ref:"noTitle",class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},xe={key:2,style:"width:100%;background:transparent;padding-bottom:24px"},Be=["xmlns","viewBox"],$e=["id"],_e=["stop-color"],Pe=["stop-color"],Ee=["d","fill","stroke","stroke-width"],Se=["x","y","height","width","fill","stroke","stroke-width","onMouseenter"],Te=["x","y","font-size","fill"],Fe=["x","y","font-size","fill"],Le={key:4,class:"vue-data-ui-watermark"},Oe={key:6,ref:"source",dir:"auto"},ze=["innerHTML"],Ie={__name:"vue-ui-flow",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(ee,{expose:te}){const h=ee,{vue_ui_flow:oe}=s.useConfig(),B=e.computed(()=>!!h.dataset&&h.dataset.length);e.onMounted(()=>{O()});function O(){s.objectIsEmpty(h.dataset)&&s.error({componentName:"VueUiFlow",type:"dataset"})}const $=e.ref(s.createUid()),_=e.ref(null),z=e.ref(0),I=e.ref(0),y=e.ref(!1);function le(o){y.value=o,z.value+=1}const t=e.computed({get:()=>V(),set:o=>o});function V(){const o=Q.useNestedProp({userConfig:h.config,defaultConfig:oe});return o.theme?{...Q.useNestedProp({userConfig:s.themes.vue_ui_flow[o.theme]||h.config,defaultConfig:o}),customPalette:s.themePalettes[o.theme]||s.palette}:o}e.watch(()=>h.config,o=>{t.value=V(),O(),I.value+=1},{deep:!0});const{isPrinting:A,isImaging:H,generatePdf:M,generateImage:D}=K.usePrinter({elementId:`flow_${$.value}`,fileName:t.value.style.chart.title.text||"vue-ui-flow"}),ne=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),P=e.computed(()=>s.convertCustomPalette(t.value.customPalette)),q=e.computed(()=>t.value.style.chart.nodes.gap),g=e.computed(()=>t.value.style.chart.nodes.width),b=e.ref({showTable:t.value.table.show}),Y=e.computed(()=>t.value.style.chart.links.width),E=e.computed(()=>!h.dataset||!h.dataset.length?[]:h.dataset.map(o=>[o[0],o[1],s.checkNaN(o[2])])),G=e.computed(()=>{const o={};function n(r){o[r]||(o[r]={inflow:0,outflow:0})}E.value.forEach(([r,a,c])=>{n(r),n(a),o[r].outflow+=c,o[a].inflow+=c});let l=0;for(const r in o){const a=Math.max(o[r].inflow,o[r].outflow);l=Math.max(l,a)}return l});function ae(o){return o/G.value*100+t.value.style.chart.nodes.minHeight}function re(o){const n=t.value.style.chart.nodes.minHeight;return(o-n)/100*G.value}function se(o){const n={},l={};function r(u,i){n[u]||(n[u]={height:0,level:null,inflow:0,outflow:0}),n[u].level===null&&(n[u].level=i),l[i]||(l[i]=[]),l[i].includes(u)||l[i].push(u)}o.forEach(([u,i,v],k)=>{const p=n[u]?n[u].level:0,x=p+1;r(u,p),r(i,x),n[u].children||(n[u].children=[]),n[u].children.push({target:i,value:v}),n[u].outflow+=v,n[i].inflow+=v}),Object.keys(n).forEach((u,i)=>{n[u].color=P.value[i]||P.value[i%P.value.length]||s.palette[i]||s.palette[i%d.length]});for(const u in n)n[u].height=ae(Math.max(n[u].inflow,n[u].outflow)),n[u].name=u;const a={};for(const u in l){let i=0;l[u].forEach((v,k)=>{const p=n[v].height;a[v]={x:parseInt(u,10)*Y.value+t.value.style.chart.padding.left,y:i,absoluteY:i,height:p,i:k,color:n[v].color,value:re(p)},i+=p+q.value})}const c=[];for(const u in n){let i=a[u].absoluteY;n[u].children&&n[u].children.forEach(({target:v,value:k},p)=>{const x=a[v].y,F=a[u],L=a[v],X=s.checkNaN(i),R=s.checkNaN(i+k/n[u].outflow*F.height),Z=s.checkNaN(x),J=s.checkNaN(x+k/n[v].inflow*L.height),fe={id:s.createUid(),source:u,target:v,path:`M ${s.checkNaN(F.x)+s.checkNaN(g.value)} ${X} L ${s.checkNaN(F.x)+s.checkNaN(g.value)} ${R} L ${s.checkNaN(L.x)} ${J} L ${s.checkNaN(L.x)} ${Z} Z`,value:k,sourceColor:n[u].color,targetColor:n[v].color};c.push(fe),i+=R-X,a[v].y+=J-Z})}return{nodeCoordinates:a,links:c}}const f=e.computed(()=>{const o=se(h.dataset);return{nodes:Object.keys(o.nodeCoordinates).map((n,l)=>({...o.nodeCoordinates[n],name:n})),links:o.links}}),ue=e.computed(()=>ie(f.value.nodes));function ie(o){const n={};for(const r in o){const{x:a,height:c}=o[r];n[a]||(n[a]=0),n[a]+=c+q.value}return Math.max(...Object.values(n))}const S=e.computed(()=>{const{top:o,right:n,left:l,bottom:r}=t.value.style.chart.padding,a=E.value.length*Y.value;return{height:ue.value+o+r,width:n+Math.max(...f.value.nodes.map(c=>c.x))+g.value,left:l,top:o,right:a-n,p_top:o,p_bottom:r}});function ce(o){const n={},l={},r=new Set;return E.value.forEach(([a,c,u])=>{n[a]||(n[a]=[]),l[c]||(l[c]=[]),n[a].push(c),l[c].push(a)}),n[o]&&n[o].forEach(a=>r.add(a)),l[o]&&l[o].forEach(a=>r.add(a)),Array.from(r).concat(o)}const m=e.ref(null),C=e.ref(null);function de(o){m.value=ce(o.name),C.value=o.name}function ve(){m.value=null,C.value=null}const U=e.computed(()=>f.value.links.map(({source:o,target:n,sourceColor:l,targetColor:r,value:a})=>({source:o,target:n,sourceColor:l,targetColor:r,value:a})));function j(){e.nextTick(()=>{const o=U.value.map((r,a)=>[[r.source],[r.target],[r.value]]),n=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.source],[t.value.table.columnNames.target],[t.value.table.columnNames.value]]].concat(o),l=s.createCsvContent(n);s.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-flow"})})}const w=e.computed(()=>{const o=[t.value.table.columnNames.source,t.value.table.columnNames.target,t.value.table.columnNames.value],n=U.value.map((a,c)=>[{color:a.sourceColor,name:a.source},{color:a.targetColor,name:a.target},s.dataLabel({p:t.value.style.chart.nodes.labels.prefix,v:a.value,s:t.value.style.chart.nodes.labels.suffix,r:t.value.style.chart.nodes.labels.rounding})]),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.source,t.value.table.columnNames.target,t.value.table.columnNames.value],head:o,body:n,config:l}});function he(){return f.value}function W(){b.value.showTable=!b.value.showTable}const N=e.ref(!1);function T(){N.value=!N.value}return te({getData:he,generateCsv:j,generateImage:D,generatePdf:M,toggleTable:W,toggleAnnotator:T}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"flowChart",ref:_,class:e.normalizeClass(`vue-ui-flow ${y.value?"vue-data-ui-wrapper-fullscreen":""}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor}`),id:`flow_${$.value}`},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(be.PenAndPaper,{key:0,parent:_.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:N.value,onClose:T},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),ne.value?(e.openBlock(),e.createElementBlock("div",Ne,null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",xe,[(e.openBlock(),e.createBlock(me._sfc_main,{key:`title_${I.value}`,config:{title:{cy:"flow-title",...t.value.style.chart.title},subtitle:{cy:"flow-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))])):e.createCommentVNode("",!0),t.value.userOptions.show&&B.value?(e.openBlock(),e.createBlock(K.UserOptions,{ref:"details",key:`user_option_${z.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(A),isImaging:e.unref(H),uid:$.value,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:y.value,titles:{...t.value.userOptions.buttonTitles},chartElement:_.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:N.value,onToggleFullscreen:le,onGeneratePdf:e.unref(M),onGenerateCsv:j,onGenerateImage:e.unref(D),onToggleTable:W,onToggleAnnotator:T},e.createSlots({_:2},[o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:r})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:r})),void 0,!0)]),key:"4"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:r})=>[e.renderSlot(o.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:r})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(s.XMLNS),viewBox:`0 0 ${S.value.width} ${S.value.height}`,class:e.normalizeClass({"vue-data-ui-fullscreen--on":y.value,"vue-data-ui-fulscreen--off":!y.value}),style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(ye._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.links,(l,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{id:l.id,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":l.sourceColor},null,8,_e),e.createElementVNode("stop",{offset:"100%","stop-color":l.targetColor},null,8,Pe)],8,$e))),256))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.links,l=>(e.openBlock(),e.createElementBlock("path",{class:"vue-ui-flow-link",d:l.path,fill:`url(#${l.id})`,stroke:t.value.style.chart.links.stroke,"stroke-width":t.value.style.chart.links.strokeWidth,style:e.normalizeStyle(`opacity:${C.value?[l.target,l.source].includes(C.value)?1:.3:t.value.style.chart.links.opacity}`)},null,12,Ee))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.nodes,(l,r)=>(e.openBlock(),e.createElementBlock("rect",{class:"vue-ui-flow-node",x:l.x,y:e.unref(s.checkNaN)(l.absoluteY),height:e.unref(s.checkNaN)(l.height),width:g.value,fill:l.color,stroke:t.value.style.chart.nodes.stroke,"stroke-width":t.value.style.chart.nodes.strokeWidth,onMouseenter:a=>de(l),onMouseleave:n[0]||(n[0]=a=>ve()),style:e.normalizeStyle(`opacity:${m.value?m.value.includes(l.name)?1:.2:1}`)},null,44,Se))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.nodes,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:l.x+g.value/2,y:e.unref(s.checkNaN)(l.absoluteY+l.height/2-t.value.style.chart.nodes.labels.fontSize/4),"font-size":t.value.style.chart.nodes.labels.fontSize,fill:e.unref(s.adaptColorToBackground)(l.color),"text-anchor":"middle",style:e.normalizeStyle(`pointer-events: none; opacity:${m.value?m.value.includes(l.name)?1:0:1}`)},e.toDisplayString(t.value.style.chart.nodes.labels.abbreviation.use?e.unref(s.abbreviate)({source:l.name,length:t.value.style.chart.nodes.labels.abbreviation.length}):l.name),13,Te))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.nodes,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:l.x+g.value/2,y:e.unref(s.checkNaN)(l.absoluteY+l.height/2+t.value.style.chart.nodes.labels.fontSize),"font-size":t.value.style.chart.nodes.labels.fontSize,fill:e.unref(s.adaptColorToBackground)(l.color),"text-anchor":"middle",style:e.normalizeStyle(`pointer-events: none; opacity:${m.value?m.value.includes(l.name)?1:0:1}`)},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.chart.nodes.labels.formatter,l.value,e.unref(s.dataLabel)({p:t.value.style.chart.nodes.labels.prefix,v:l.value,s:t.value.style.chart.nodes.labels.suffix,r:t.value.style.chart.nodes.labels.rounding}),{datapoint:l,seriesIndex:r})),13,Fe))),256)),e.renderSlot(o.$slots,"svg",{svg:S.value},void 0,!0)],14,Be)),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Le,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(A)||e.unref(H)})),void 0,!0)])):e.createCommentVNode("",!0),B.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ke.default,{key:5,config:{type:"flow",style:{backgroundColor:t.value.style.chart.backgroundColor}}},null,8,["config"])),o.$slots.source?(e.openBlock(),e.createElementBlock("div",Oe,[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),B.value?(e.openBlock(),e.createBlock(ge.default,{key:7,hideDetails:"",config:{open:b.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.createVNode(pe.DataTable,{colNames:w.value.colNames,head:w.value.head,body:w.value.body,config:w.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:n[1]||(n[1]=l=>b.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,ze)]),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)],14,we))}},Ve=Ce._export_sfc(Ie,[["__scopeId","data-v-49421974"]]);exports.default=Ve;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-Dgjlvd_3.cjs"),me=require("./Title-C8WRomob.cjs"),K=require("./usePrinter-Bd-68vBM.cjs"),pe=require("./DataTable-CKYq5S0j.cjs"),ge=require("./vue-ui-accordion-DAf1jeI5.cjs"),ke=require("./vue-ui-skeleton-Ng7RKLmM.cjs"),Q=require("./useNestedProp-DMaPxyYb.cjs"),ye=require("./PackageVersion-C_Y8uWJM.cjs"),be=require("./PenAndPaper-CotnLxGh.cjs"),Ce=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),we=["id"],Ne={key:1,ref:"noTitle",class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},xe={key:2,style:"width:100%;background:transparent;padding-bottom:24px"},Be=["xmlns","viewBox"],$e=["id"],_e=["stop-color"],Pe=["stop-color"],Ee=["d","fill","stroke","stroke-width"],Se=["x","y","height","width","fill","stroke","stroke-width","onMouseenter"],Te=["x","y","font-size","fill"],Fe=["x","y","font-size","fill"],Le={key:4,class:"vue-data-ui-watermark"},Oe={key:6,ref:"source",dir:"auto"},ze=["innerHTML"],Ie={__name:"vue-ui-flow",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(ee,{expose:te}){const h=ee,{vue_ui_flow:oe}=s.useConfig(),B=e.computed(()=>!!h.dataset&&h.dataset.length);e.onMounted(()=>{O()});function O(){s.objectIsEmpty(h.dataset)&&s.error({componentName:"VueUiFlow",type:"dataset"})}const $=e.ref(s.createUid()),_=e.ref(null),z=e.ref(0),I=e.ref(0),y=e.ref(!1);function le(o){y.value=o,z.value+=1}const t=e.computed({get:()=>V(),set:o=>o});function V(){const o=Q.useNestedProp({userConfig:h.config,defaultConfig:oe});return o.theme?{...Q.useNestedProp({userConfig:s.themes.vue_ui_flow[o.theme]||h.config,defaultConfig:o}),customPalette:s.themePalettes[o.theme]||s.palette}:o}e.watch(()=>h.config,o=>{t.value=V(),O(),I.value+=1},{deep:!0});const{isPrinting:A,isImaging:H,generatePdf:M,generateImage:D}=K.usePrinter({elementId:`flow_${$.value}`,fileName:t.value.style.chart.title.text||"vue-ui-flow"}),ne=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),P=e.computed(()=>s.convertCustomPalette(t.value.customPalette)),q=e.computed(()=>t.value.style.chart.nodes.gap),g=e.computed(()=>t.value.style.chart.nodes.width),b=e.ref({showTable:t.value.table.show}),Y=e.computed(()=>t.value.style.chart.links.width),E=e.computed(()=>!h.dataset||!h.dataset.length?[]:h.dataset.map(o=>[o[0],o[1],s.checkNaN(o[2])])),G=e.computed(()=>{const o={};function n(r){o[r]||(o[r]={inflow:0,outflow:0})}E.value.forEach(([r,a,c])=>{n(r),n(a),o[r].outflow+=c,o[a].inflow+=c});let l=0;for(const r in o){const a=Math.max(o[r].inflow,o[r].outflow);l=Math.max(l,a)}return l});function ae(o){return o/G.value*100+t.value.style.chart.nodes.minHeight}function re(o){const n=t.value.style.chart.nodes.minHeight;return(o-n)/100*G.value}function se(o){const n={},l={};function r(u,i){n[u]||(n[u]={height:0,level:null,inflow:0,outflow:0}),n[u].level===null&&(n[u].level=i),l[i]||(l[i]=[]),l[i].includes(u)||l[i].push(u)}o.forEach(([u,i,v],k)=>{const p=n[u]?n[u].level:0,x=p+1;r(u,p),r(i,x),n[u].children||(n[u].children=[]),n[u].children.push({target:i,value:v}),n[u].outflow+=v,n[i].inflow+=v}),Object.keys(n).forEach((u,i)=>{n[u].color=P.value[i]||P.value[i%P.value.length]||s.palette[i]||s.palette[i%d.length]});for(const u in n)n[u].height=ae(Math.max(n[u].inflow,n[u].outflow)),n[u].name=u;const a={};for(const u in l){let i=0;l[u].forEach((v,k)=>{const p=n[v].height;a[v]={x:parseInt(u,10)*Y.value+t.value.style.chart.padding.left,y:i,absoluteY:i,height:p,i:k,color:n[v].color,value:re(p)},i+=p+q.value})}const c=[];for(const u in n){let i=a[u].absoluteY;n[u].children&&n[u].children.forEach(({target:v,value:k},p)=>{const x=a[v].y,F=a[u],L=a[v],X=s.checkNaN(i),R=s.checkNaN(i+k/n[u].outflow*F.height),Z=s.checkNaN(x),J=s.checkNaN(x+k/n[v].inflow*L.height),fe={id:s.createUid(),source:u,target:v,path:`M ${s.checkNaN(F.x)+s.checkNaN(g.value)} ${X} L ${s.checkNaN(F.x)+s.checkNaN(g.value)} ${R} L ${s.checkNaN(L.x)} ${J} L ${s.checkNaN(L.x)} ${Z} Z`,value:k,sourceColor:n[u].color,targetColor:n[v].color};c.push(fe),i+=R-X,a[v].y+=J-Z})}return{nodeCoordinates:a,links:c}}const f=e.computed(()=>{const o=se(h.dataset);return{nodes:Object.keys(o.nodeCoordinates).map((n,l)=>({...o.nodeCoordinates[n],name:n})),links:o.links}}),ue=e.computed(()=>ie(f.value.nodes));function ie(o){const n={};for(const r in o){const{x:a,height:c}=o[r];n[a]||(n[a]=0),n[a]+=c+q.value}return Math.max(...Object.values(n))}const S=e.computed(()=>{const{top:o,right:n,left:l,bottom:r}=t.value.style.chart.padding,a=E.value.length*Y.value;return{height:ue.value+o+r,width:n+Math.max(...f.value.nodes.map(c=>c.x))+g.value,left:l,top:o,right:a-n,p_top:o,p_bottom:r}});function ce(o){const n={},l={},r=new Set;return E.value.forEach(([a,c,u])=>{n[a]||(n[a]=[]),l[c]||(l[c]=[]),n[a].push(c),l[c].push(a)}),n[o]&&n[o].forEach(a=>r.add(a)),l[o]&&l[o].forEach(a=>r.add(a)),Array.from(r).concat(o)}const m=e.ref(null),C=e.ref(null);function de(o){m.value=ce(o.name),C.value=o.name}function ve(){m.value=null,C.value=null}const U=e.computed(()=>f.value.links.map(({source:o,target:n,sourceColor:l,targetColor:r,value:a})=>({source:o,target:n,sourceColor:l,targetColor:r,value:a})));function j(){e.nextTick(()=>{const o=U.value.map((r,a)=>[[r.source],[r.target],[r.value]]),n=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.source],[t.value.table.columnNames.target],[t.value.table.columnNames.value]]].concat(o),l=s.createCsvContent(n);s.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-flow"})})}const w=e.computed(()=>{const o=[t.value.table.columnNames.source,t.value.table.columnNames.target,t.value.table.columnNames.value],n=U.value.map((a,c)=>[{color:a.sourceColor,name:a.source},{color:a.targetColor,name:a.target},s.dataLabel({p:t.value.style.chart.nodes.labels.prefix,v:a.value,s:t.value.style.chart.nodes.labels.suffix,r:t.value.style.chart.nodes.labels.rounding})]),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.source,t.value.table.columnNames.target,t.value.table.columnNames.value],head:o,body:n,config:l}});function he(){return f.value}function W(){b.value.showTable=!b.value.showTable}const N=e.ref(!1);function T(){N.value=!N.value}return te({getData:he,generateCsv:j,generateImage:D,generatePdf:M,toggleTable:W,toggleAnnotator:T}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"flowChart",ref:_,class:e.normalizeClass(`vue-ui-flow ${y.value?"vue-data-ui-wrapper-fullscreen":""}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor}`),id:`flow_${$.value}`},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(be.PenAndPaper,{key:0,parent:_.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:N.value,onClose:T},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),ne.value?(e.openBlock(),e.createElementBlock("div",Ne,null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",xe,[(e.openBlock(),e.createBlock(me._sfc_main,{key:`title_${I.value}`,config:{title:{cy:"flow-title",...t.value.style.chart.title},subtitle:{cy:"flow-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))])):e.createCommentVNode("",!0),t.value.userOptions.show&&B.value?(e.openBlock(),e.createBlock(K.UserOptions,{ref:"details",key:`user_option_${z.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(A),isImaging:e.unref(H),uid:$.value,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:y.value,titles:{...t.value.userOptions.buttonTitles},chartElement:_.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:N.value,onToggleFullscreen:le,onGeneratePdf:e.unref(M),onGenerateCsv:j,onGenerateImage:e.unref(D),onToggleTable:W,onToggleAnnotator:T},e.createSlots({_:2},[o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:r})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:r})),void 0,!0)]),key:"4"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:r})=>[e.renderSlot(o.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:r})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(s.XMLNS),viewBox:`0 0 ${S.value.width} ${S.value.height}`,class:e.normalizeClass({"vue-data-ui-fullscreen--on":y.value,"vue-data-ui-fulscreen--off":!y.value}),style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(ye._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.links,(l,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{id:l.id,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":l.sourceColor},null,8,_e),e.createElementVNode("stop",{offset:"100%","stop-color":l.targetColor},null,8,Pe)],8,$e))),256))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.links,l=>(e.openBlock(),e.createElementBlock("path",{class:"vue-ui-flow-link",d:l.path,fill:`url(#${l.id})`,stroke:t.value.style.chart.links.stroke,"stroke-width":t.value.style.chart.links.strokeWidth,style:e.normalizeStyle(`opacity:${C.value?[l.target,l.source].includes(C.value)?1:.3:t.value.style.chart.links.opacity}`)},null,12,Ee))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.nodes,(l,r)=>(e.openBlock(),e.createElementBlock("rect",{class:"vue-ui-flow-node",x:l.x,y:e.unref(s.checkNaN)(l.absoluteY),height:e.unref(s.checkNaN)(l.height),width:g.value,fill:l.color,stroke:t.value.style.chart.nodes.stroke,"stroke-width":t.value.style.chart.nodes.strokeWidth,onMouseenter:a=>de(l),onMouseleave:n[0]||(n[0]=a=>ve()),style:e.normalizeStyle(`opacity:${m.value?m.value.includes(l.name)?1:.2:1}`)},null,44,Se))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.nodes,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:l.x+g.value/2,y:e.unref(s.checkNaN)(l.absoluteY+l.height/2-t.value.style.chart.nodes.labels.fontSize/4),"font-size":t.value.style.chart.nodes.labels.fontSize,fill:e.unref(s.adaptColorToBackground)(l.color),"text-anchor":"middle",style:e.normalizeStyle(`pointer-events: none; opacity:${m.value?m.value.includes(l.name)?1:0:1}`)},e.toDisplayString(t.value.style.chart.nodes.labels.abbreviation.use?e.unref(s.abbreviate)({source:l.name,length:t.value.style.chart.nodes.labels.abbreviation.length}):l.name),13,Te))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.nodes,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:l.x+g.value/2,y:e.unref(s.checkNaN)(l.absoluteY+l.height/2+t.value.style.chart.nodes.labels.fontSize),"font-size":t.value.style.chart.nodes.labels.fontSize,fill:e.unref(s.adaptColorToBackground)(l.color),"text-anchor":"middle",style:e.normalizeStyle(`pointer-events: none; opacity:${m.value?m.value.includes(l.name)?1:0:1}`)},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.chart.nodes.labels.formatter,l.value,e.unref(s.dataLabel)({p:t.value.style.chart.nodes.labels.prefix,v:l.value,s:t.value.style.chart.nodes.labels.suffix,r:t.value.style.chart.nodes.labels.rounding}),{datapoint:l,seriesIndex:r})),13,Fe))),256)),e.renderSlot(o.$slots,"svg",{svg:S.value},void 0,!0)],14,Be)),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Le,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(A)||e.unref(H)})),void 0,!0)])):e.createCommentVNode("",!0),B.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ke.default,{key:5,config:{type:"flow",style:{backgroundColor:t.value.style.chart.backgroundColor}}},null,8,["config"])),o.$slots.source?(e.openBlock(),e.createElementBlock("div",Oe,[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),B.value?(e.openBlock(),e.createBlock(ge.default,{key:7,hideDetails:"",config:{open:b.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.createVNode(pe.DataTable,{colNames:w.value.colNames,head:w.value.head,body:w.value.body,config:w.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:n[1]||(n[1]=l=>b.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,ze)]),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)],14,we))}},Ve=Ce._export_sfc(Ie,[["__scopeId","data-v-49421974"]]);exports.default=Ve;
@@ -1,13 +1,13 @@
1
1
  import { computed as m, onMounted as Ee, ref as b, watch as Se, openBlock as u, createElementBlock as i, normalizeClass as he, normalizeStyle as N, createBlock as P, createCommentVNode as C, unref as c, createSlots as Me, withCtx as y, renderSlot as k, normalizeProps as X, guardReactiveProps as W, createVNode as me, createElementVNode as S, Fragment as F, renderList as O, toDisplayString as q, createTextVNode as ze, nextTick as Ye } from "vue";
2
- import { u as De, o as Ge, e as Be, c as ge, t as Ue, a as Ve, p as K, b as je, v as f, f as pe, X as Xe, F as be, K as We, i as qe, q as Ke, r as Re } from "./index-CpjF4-PU.js";
3
- import { _ as Ze } from "./Title-D_ljAKoY.js";
4
- import { u as Je, U as Qe } from "./usePrinter-CZ0Ro0M3.js";
5
- import { D as et } from "./DataTable-BmAybhqW.js";
6
- import tt from "./vue-ui-accordion-D6Uwxwl0.js";
7
- import ot from "./vue-ui-skeleton-5qiu2vOB.js";
8
- import { u as ye } from "./useNestedProp-DiDiQc6z.js";
9
- import { _ as lt } from "./PackageVersion-BRMtBck7.js";
10
- import { P as at } from "./PenAndPaper-u9Nkiu0T.js";
2
+ import { u as De, o as Ge, e as Be, c as ge, t as Ue, a as Ve, p as K, b as je, v as f, f as pe, X as Xe, F as be, K as We, i as qe, q as Ke, r as Re } from "./index-DtCryprM.js";
3
+ import { _ as Ze } from "./Title-CfjKQsLl.js";
4
+ import { u as Je, U as Qe } from "./usePrinter-D4_doq3d.js";
5
+ import { D as et } from "./DataTable-DY9Joecu.js";
6
+ import tt from "./vue-ui-accordion-C3p9yjUl.js";
7
+ import ot from "./vue-ui-skeleton-Bw0j7S0v.js";
8
+ import { u as ye } from "./useNestedProp-tT95LfDr.js";
9
+ import { _ as lt } from "./PackageVersion-CRyyH_HB.js";
10
+ import { P as at } from "./PenAndPaper-BF7qtcRe.js";
11
11
  import { _ as nt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
12
12
  const st = ["id"], rt = {
13
13
  key: 1,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-BtqOSPWK.cjs"),H=require("./useNestedProp-C7FKZW2F.cjs"),X=require("./usePrinter-SEUTEAmF.cjs"),oe=require("./Title-BJut0KCO.cjs"),re=require("./PenAndPaper-Bur5hR1K.cjs"),ne=require("./DataTable-D-c7laSt.cjs"),se=require("./vue-ui-accordion-iiUNHeV-.cjs"),Y=require("./useResponsive-BJ7DTGpm.cjs"),ue=require("./vue-ui-skeleton-CCo2ROV1.cjs"),ie=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ce=["id"],ve=["xmlns","viewBox"],de=["id"],he=["stop-color"],me=["stop-color"],fe=["stop-color"],pe=["stroke","stroke-width"],be=["stroke","stroke-width"],ye=["x","y","font-size","fill","font-weight"],ge=["points","fill"],ke=["stroke","stroke-width","rx"],Ce=["x","y","font-size","fill","font-weight"],we=["x","y","font-size","fill","font-weight"],xe={key:5,class:"vue-data-ui-watermark"},Le=["innerHTML"],Be={__name:"vue-ui-funnel",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(W,{expose:J}){const d=W;e.useCssVars(l=>({"0dcc78a9":ae.value}));const{vue_ui_funnel:K}=r.useConfig(),b=e.computed(()=>!!d.dataset&&d.dataset.length);e.onMounted(S);function S(){if(r.objectIsEmpty(d.dataset)?r.error({componentName:"VueUiFunnel",type:"dataset"}):d.dataset.forEach((l,o)=>{r.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","value"]}).forEach(a=>{b.value=!1,r.error({componentName:"VueUiFunnel",type:"datasetSerieAttribute",property:a,index:o})})}),t.value.responsive){const l=Y.throttle(()=>{const{width:o,height:a}=Y.useResponsive({chart:g.value,title:t.value.style.chart.title.text?V.value:null,source:E.value,noTitle:P.value});c.value.height=a,c.value.width=o,m.value=R(),u.value.circles=r.translateSize({relator:Math.min(o,a),adjuster:600,source:t.value.style.chart.circles.dataLabels.fontSize,threshold:10,fallback:10}),u.value.names=r.translateSize({relator:Math.min(o,a),adjuster:600,source:t.value.style.chart.bars.dataLabels.name.fontSize,threshold:10,fallback:10}),u.value.values=r.translateSize({relator:Math.min(o,a),adjuster:600,source:t.value.style.chart.bars.dataLabels.value.fontSize,threshold:10,fallback:10})});D.value=new ResizeObserver(l),D.value.observe(g.value.parentNode)}}const g=e.ref(null),k=e.ref(r.createUid()),z=e.ref(0),T=e.ref(0),A=e.ref(0),P=e.ref(null),E=e.ref(null),V=e.ref(null),D=e.ref(null),f=e.ref(!1);function F(){const l=H.useNestedProp({userConfig:d.config,defaultConfig:K});return l.theme?{...H.useNestedProp({userConfig:r.themes.vue_ui_funnel[l.theme]||d.config,defaultConfig:l})}:l}const t=e.computed({get:()=>F(),set:l=>l});e.watch(()=>d.config,l=>{t.value=F(),S(),T.value+=1,A.value+=1,u.value.circles=t.value.style.chart.circles.dataLabels.fontSize,u.value.names=t.value.style.chart.bars.dataLabels.name.fontSize,u.value.values=t.value.style.chart.bars.dataLabels.value.fontSize},{deep:!0});const{isPrinting:O,isImaging:I,generatePdf:q,generateImage:M}=X.usePrinter({elementId:`funnel_${k.value}`,fileName:t.value.style.chart.title.text||"vue-ui-funnel"}),Q=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),L=e.ref({showTable:t.value.table.show}),u=e.ref({circles:t.value.style.chart.circles.dataLabels.fontSize,names:t.value.style.chart.bars.dataLabels.name.fontSize,values:t.value.style.chart.bars.dataLabels.value.fontSize}),c=e.computed({get:()=>({height:t.value.style.chart.height,width:t.value.style.chart.width}),set:l=>l}),h=e.computed(()=>b.value?d.dataset.map((l,o)=>({...l,color:l.color?r.convertColorToHex(l.color):r.lightenHexColor(t.value.style.chart.bars.defaultColor,o/d.dataset.length)})):[]);setTimeout(()=>{f.value=!0},h.value.length*150);function R(){const l=t.value.style.chart.padding.left,o=t.value.style.chart.padding.top;return{left:l,top:o,right:c.value.width-t.value.style.chart.padding.right,bottom:c.value.height-t.value.style.chart.padding.bottom,width:c.value.width-l-t.value.style.chart.padding.right,height:c.value.height-o-t.value.style.chart.padding.bottom}}const m=e.ref(R()),y=e.computed(()=>m.value.height/d.dataset.length),p=e.computed(()=>y.value*t.value.style.chart.bars.gapRatio),G=e.computed(()=>m.value.width*t.value.style.chart.barCircleSpacingRatio),n=e.computed(()=>h.value.map((l,o)=>{const a=y.value-p.value,s=m.value.top+p.value/2*o+(y.value-p.value/2)*o+p.value/2,v=l.value/h.value[0].value,i=(m.value.width-a-G.value)*(l.value/h.value[0].value);return{...l,cx:m.value.left+a/2,cy:s+a/2,datapointIndex:o,fill:l.color,height:Math.max(a,0),proportion:v,r:Math.max(a/2,0),width:Math.max(i,0),x:m.value.left+a+G.value,y:s}})),Z=e.computed(()=>{const l=n.value.map(o=>`${o.x+o.width},${o.y+(y.value-p.value)/2}`);return`${n.value[0].x},${n.value[0].y+(y.value-p.value)/2} ${l.toString()} ${n.value.at(-1).x},${n.value.at(-1).y+(y.value-p.value)/2}`}),ee=e.computed(()=>({x1:n.value[0].cx,y1:n.value[0].cy,x2:n.value.at(-1).cx,y2:n.value.at(-1).cy})),C=e.ref(!1);function te(l){C.value=l,z.value+=1}const ae=e.computed(()=>`${h.value.length*150}ms`),B=e.ref(!1);function $(){B.value=!B.value}function U(){L.value.showTable=!L.value.showTable}const w=e.computed(()=>{const l=h.value.map(a=>({name:a.name,color:a.color})),o=h.value.map(a=>a.value);return{head:l,body:o}}),_=e.computed(()=>{const l=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage],o=w.value.head.map((v,i)=>{const x=r.applyDataLabel(t.value.style.chart.bars.dataLabels.value.formatter,w.value.body[i],r.dataLabel({p:t.value.style.chart.bars.dataLabels.value.prefix,v:w.value.body[i],s:t.value.style.chart.bars.dataLabels.value.suffix,r:t.value.table.td.roundingValue}),{datapoint:n.value[i]}),N=r.applyDataLabel(t.value.style.chart.circles.dataLabels.formatter,n.value[i].proportion*100,r.dataLabel({v:n.value[i].proportion*100,s:"%",r:t.value.table.td.roundingPercentage}),{datapoint:n.value[i]});return[{color:v.color,name:v.name},x,N]}),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},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage],head:l,body:o,config:a}});function j(){e.nextTick(()=>{const l=w.value.head.map((s,v)=>[[s.name],[w.value.body[v]],[n.value[v].proportion*100]]),o=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.series],[t.value.table.columnNames.value],["%"]]].concat(l),a=r.createCsvContent(o);r.downloadCsv({csvContent:a,title:t.value.style.chart.title.text||"vue-ui-funnel"})})}function le(){return h.value}return J({getData:le,generatePdf:q,generateCsv:j,generateImage:M,toggleTable:U,toggleAnnotator:$}),(l,o)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"funnelChart",ref:g,class:e.normalizeClass(`vue-ui-funnel ${C.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:`funnel_${k.value}`},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(re.PenAndPaper,{key:0,parent:g.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:B.value,onClose:$},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),Q.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:P,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:V,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(oe._sfc_main,{key:`title_${T.value}`,config:{title:{cy:"funnel-div-title",...t.value.style.chart.title},subtitle:{cy:"funnel-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&b.value?(e.openBlock(),e.createBlock(X.UserOptions,{ref:"details",key:`user_option_${z.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(O),isImaging:e.unref(I),uid:k.value,hasTooltip:!1,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasLabel:!1,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:C.value,chartElement:g.value,position:t.value.userOptions.position,titles:{...t.value.userOptions.buttonTitles},hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:B.value,onToggleAnnotator:$,onToggleFullscreen:te,onGeneratePdf:e.unref(q),onGenerateImage:e.unref(M),onToggleTable:U,onGenerateCsv:j},e.createSlots({_:2},[l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:s})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:s})),void 0,!0)]),key:"4"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:a,isAnnotator:s})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:a,isAnnotator:s})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","chartElement","position","titles","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":C.value,"vue-data-ui-fulscreen--off":!C.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.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`funnel_area_${k.value}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.chart.backgroundColor,"stop-opacity":0},null,8,he),e.createElementVNode("stop",{offset:"20%","stop-color":t.value.style.chart.area.color},null,8,me),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.area.color},null,8,fe)],8,de)]),t.value.style.chart.circleLinks.show?(e.openBlock(),e.createElementBlock("line",e.mergeProps({key:0},ee.value,{stroke:t.value.style.chart.circleLinks.color,"stroke-width":12*t.value.style.chart.circleLinks.widthRatio,"stroke-linecap":"round",class:{animated:t.value.useCssAnimation},style:{strokeDasharray:t.value.useCssAnimation?m.value.height:0,strokeDashoffset:t.value.useCssAnimation?m.value.height:0}}),null,16,pe)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,({cx:a,cy:s,r:v,fill:i},x)=>(e.openBlock(),e.createElementBlock("circle",e.mergeProps({cx:a,cy:s,r:v,fill:i},{stroke:t.value.style.chart.circles.stroke,"stroke-width":t.value.style.chart.circles.strokeWidth,class:{animated:t.value.useCssAnimation&&!f.value},style:{animationDelay:`${150*x}ms`}}),null,16,be))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(a,s)=>(e.openBlock(),e.createElementBlock("text",{x:a.cx,y:a.cy+u.value.circles/3+t.value.style.chart.circles.dataLabels.offsetY,"text-anchor":"middle","font-size":u.value.circles,fill:t.value.style.chart.circles.dataLabels.adaptColorToBackground?e.unref(r.adaptColorToBackground)(a.color):t.value.style.chart.circles.dataLabels.color,"font-weight":t.value.style.chart.circles.dataLabels.bold?"bold":"normal",class:e.normalizeClass({animated:t.value.useCssAnimation&&!f.value}),style:e.normalizeStyle({animationDelay:`${150*s}ms`})},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.circles.dataLabels.formatter,a.proportion*100,e.unref(r.dataLabel)({v:a.proportion*100,s:"%",r:t.value.style.chart.circles.dataLabels.rounding}),{datapoint:a})),15,ye))),256)),t.value.style.chart.area.show?(e.openBlock(),e.createElementBlock("polygon",{key:1,points:Z.value,fill:`url(#funnel_area_${k.value})`,class:e.normalizeClass({animated:t.value.useCssAnimation&&!f.value}),style:e.normalizeStyle({transition:t.value.useCssAnimation?`all ${150*h.value.length}ms ease-in`:"none"})},null,14,ge)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,({x:a,y:s,height:v,width:i,fill:x},N)=>(e.openBlock(),e.createElementBlock("rect",e.mergeProps({x:a,y:s,height:v,width:i,fill:x},{stroke:t.value.style.chart.bars.stroke,"stroke-width":t.value.style.chart.bars.strokeWidth,rx:t.value.style.chart.bars.borderRadius,class:{animated:t.value.useCssAnimation&&!f.value},style:{animationDelay:`${150*N}ms`}}),null,16,ke))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(a,s)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("text",{x:a.x+a.width+t.value.style.chart.bars.dataLabels.name.offsetX+12,y:a.cy-u.value.names/2+t.value.style.chart.bars.dataLabels.name.offsetY,"text-anchor":"start","font-size":u.value.names,fill:t.value.style.chart.bars.dataLabels.name.color,"font-weight":t.value.style.chart.bars.dataLabels.name.bold?"bold":"normal",class:e.normalizeClass({animated:t.value.useCssAnimation&&!f.value}),style:e.normalizeStyle({animationDelay:`${150*s}ms`})},e.toDisplayString(a.name),15,Ce),e.createElementVNode("text",{x:a.x+a.width+t.value.style.chart.bars.dataLabels.value.offsetX+12,y:a.cy+u.value.values+t.value.style.chart.bars.dataLabels.value.offsetY,"text-anchor":"start","font-size":u.value.values,fill:t.value.style.chart.bars.dataLabels.value.color,"font-weight":t.value.style.chart.bars.dataLabels.value.bold?"bold":"normal",class:e.normalizeClass({animated:t.value.useCssAnimation&&!f.value}),style:e.normalizeStyle({animationDelay:`${150*s}ms`})},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.bars.dataLabels.value.formatter,a.value,e.unref(r.dataLabel)({p:t.value.style.chart.bars.dataLabels.value.prefix,v:a.value,s:t.value.style.chart.bars.dataLabels.value.suffix,r:t.value.style.chart.bars.dataLabels.value.rounding}),{datapoint:a})),15,we)]))),256)),e.renderSlot(l.$slots,"svg",{svg:c.value},void 0,!0)],14,ve)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",xe,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(O)||e.unref(I)})),void 0,!0)])):e.createCommentVNode("",!0),b.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ue.default,{key:6,config:{type:"verticalBar",style:{backgroundColor:t.value.style.chart.backgroundColor,verticalBar:{axis:{color:"#CCCCCC"},color:"#CCCCCC"}}}},null,8,["config"])),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:E,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createBlock(se.default,{key:8,hideDetails:"",config:{open:L.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(ne.DataTable,{key:`table_${A.value}`,colNames:_.value.colNames,head:_.value.head,body:_.value.body,config:_.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[0]||(o[0]=a=>L.value.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createElementVNode("div",{innerHTML:a,style:{display:"flex","align-items":"center"}},null,8,Le)]),td:e.withCtx(({td:a})=>[e.createTextVNode(e.toDisplayString(a.name?a.name:a),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,ce))}},_e=ie._export_sfc(Be,[["__scopeId","data-v-51a14bf0"]]);exports.default=_e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-Dgjlvd_3.cjs"),H=require("./useNestedProp-DMaPxyYb.cjs"),X=require("./usePrinter-Bd-68vBM.cjs"),oe=require("./Title-C8WRomob.cjs"),re=require("./PenAndPaper-CotnLxGh.cjs"),ne=require("./DataTable-CKYq5S0j.cjs"),se=require("./vue-ui-accordion-DAf1jeI5.cjs"),Y=require("./useResponsive-BJ7DTGpm.cjs"),ue=require("./vue-ui-skeleton-Ng7RKLmM.cjs"),ie=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ce=["id"],ve=["xmlns","viewBox"],de=["id"],he=["stop-color"],me=["stop-color"],fe=["stop-color"],pe=["stroke","stroke-width"],be=["stroke","stroke-width"],ye=["x","y","font-size","fill","font-weight"],ge=["points","fill"],ke=["stroke","stroke-width","rx"],Ce=["x","y","font-size","fill","font-weight"],we=["x","y","font-size","fill","font-weight"],xe={key:5,class:"vue-data-ui-watermark"},Le=["innerHTML"],Be={__name:"vue-ui-funnel",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(W,{expose:J}){const d=W;e.useCssVars(l=>({"0dcc78a9":ae.value}));const{vue_ui_funnel:K}=r.useConfig(),b=e.computed(()=>!!d.dataset&&d.dataset.length);e.onMounted(S);function S(){if(r.objectIsEmpty(d.dataset)?r.error({componentName:"VueUiFunnel",type:"dataset"}):d.dataset.forEach((l,o)=>{r.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","value"]}).forEach(a=>{b.value=!1,r.error({componentName:"VueUiFunnel",type:"datasetSerieAttribute",property:a,index:o})})}),t.value.responsive){const l=Y.throttle(()=>{const{width:o,height:a}=Y.useResponsive({chart:g.value,title:t.value.style.chart.title.text?V.value:null,source:E.value,noTitle:P.value});c.value.height=a,c.value.width=o,m.value=R(),u.value.circles=r.translateSize({relator:Math.min(o,a),adjuster:600,source:t.value.style.chart.circles.dataLabels.fontSize,threshold:10,fallback:10}),u.value.names=r.translateSize({relator:Math.min(o,a),adjuster:600,source:t.value.style.chart.bars.dataLabels.name.fontSize,threshold:10,fallback:10}),u.value.values=r.translateSize({relator:Math.min(o,a),adjuster:600,source:t.value.style.chart.bars.dataLabels.value.fontSize,threshold:10,fallback:10})});D.value=new ResizeObserver(l),D.value.observe(g.value.parentNode)}}const g=e.ref(null),k=e.ref(r.createUid()),z=e.ref(0),T=e.ref(0),A=e.ref(0),P=e.ref(null),E=e.ref(null),V=e.ref(null),D=e.ref(null),f=e.ref(!1);function F(){const l=H.useNestedProp({userConfig:d.config,defaultConfig:K});return l.theme?{...H.useNestedProp({userConfig:r.themes.vue_ui_funnel[l.theme]||d.config,defaultConfig:l})}:l}const t=e.computed({get:()=>F(),set:l=>l});e.watch(()=>d.config,l=>{t.value=F(),S(),T.value+=1,A.value+=1,u.value.circles=t.value.style.chart.circles.dataLabels.fontSize,u.value.names=t.value.style.chart.bars.dataLabels.name.fontSize,u.value.values=t.value.style.chart.bars.dataLabels.value.fontSize},{deep:!0});const{isPrinting:O,isImaging:I,generatePdf:q,generateImage:M}=X.usePrinter({elementId:`funnel_${k.value}`,fileName:t.value.style.chart.title.text||"vue-ui-funnel"}),Q=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),L=e.ref({showTable:t.value.table.show}),u=e.ref({circles:t.value.style.chart.circles.dataLabels.fontSize,names:t.value.style.chart.bars.dataLabels.name.fontSize,values:t.value.style.chart.bars.dataLabels.value.fontSize}),c=e.computed({get:()=>({height:t.value.style.chart.height,width:t.value.style.chart.width}),set:l=>l}),h=e.computed(()=>b.value?d.dataset.map((l,o)=>({...l,color:l.color?r.convertColorToHex(l.color):r.lightenHexColor(t.value.style.chart.bars.defaultColor,o/d.dataset.length)})):[]);setTimeout(()=>{f.value=!0},h.value.length*150);function R(){const l=t.value.style.chart.padding.left,o=t.value.style.chart.padding.top;return{left:l,top:o,right:c.value.width-t.value.style.chart.padding.right,bottom:c.value.height-t.value.style.chart.padding.bottom,width:c.value.width-l-t.value.style.chart.padding.right,height:c.value.height-o-t.value.style.chart.padding.bottom}}const m=e.ref(R()),y=e.computed(()=>m.value.height/d.dataset.length),p=e.computed(()=>y.value*t.value.style.chart.bars.gapRatio),G=e.computed(()=>m.value.width*t.value.style.chart.barCircleSpacingRatio),n=e.computed(()=>h.value.map((l,o)=>{const a=y.value-p.value,s=m.value.top+p.value/2*o+(y.value-p.value/2)*o+p.value/2,v=l.value/h.value[0].value,i=(m.value.width-a-G.value)*(l.value/h.value[0].value);return{...l,cx:m.value.left+a/2,cy:s+a/2,datapointIndex:o,fill:l.color,height:Math.max(a,0),proportion:v,r:Math.max(a/2,0),width:Math.max(i,0),x:m.value.left+a+G.value,y:s}})),Z=e.computed(()=>{const l=n.value.map(o=>`${o.x+o.width},${o.y+(y.value-p.value)/2}`);return`${n.value[0].x},${n.value[0].y+(y.value-p.value)/2} ${l.toString()} ${n.value.at(-1).x},${n.value.at(-1).y+(y.value-p.value)/2}`}),ee=e.computed(()=>({x1:n.value[0].cx,y1:n.value[0].cy,x2:n.value.at(-1).cx,y2:n.value.at(-1).cy})),C=e.ref(!1);function te(l){C.value=l,z.value+=1}const ae=e.computed(()=>`${h.value.length*150}ms`),B=e.ref(!1);function $(){B.value=!B.value}function U(){L.value.showTable=!L.value.showTable}const w=e.computed(()=>{const l=h.value.map(a=>({name:a.name,color:a.color})),o=h.value.map(a=>a.value);return{head:l,body:o}}),_=e.computed(()=>{const l=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage],o=w.value.head.map((v,i)=>{const x=r.applyDataLabel(t.value.style.chart.bars.dataLabels.value.formatter,w.value.body[i],r.dataLabel({p:t.value.style.chart.bars.dataLabels.value.prefix,v:w.value.body[i],s:t.value.style.chart.bars.dataLabels.value.suffix,r:t.value.table.td.roundingValue}),{datapoint:n.value[i]}),N=r.applyDataLabel(t.value.style.chart.circles.dataLabels.formatter,n.value[i].proportion*100,r.dataLabel({v:n.value[i].proportion*100,s:"%",r:t.value.table.td.roundingPercentage}),{datapoint:n.value[i]});return[{color:v.color,name:v.name},x,N]}),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},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage],head:l,body:o,config:a}});function j(){e.nextTick(()=>{const l=w.value.head.map((s,v)=>[[s.name],[w.value.body[v]],[n.value[v].proportion*100]]),o=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.series],[t.value.table.columnNames.value],["%"]]].concat(l),a=r.createCsvContent(o);r.downloadCsv({csvContent:a,title:t.value.style.chart.title.text||"vue-ui-funnel"})})}function le(){return h.value}return J({getData:le,generatePdf:q,generateCsv:j,generateImage:M,toggleTable:U,toggleAnnotator:$}),(l,o)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"funnelChart",ref:g,class:e.normalizeClass(`vue-ui-funnel ${C.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:`funnel_${k.value}`},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(re.PenAndPaper,{key:0,parent:g.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:B.value,onClose:$},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),Q.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:P,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:V,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(oe._sfc_main,{key:`title_${T.value}`,config:{title:{cy:"funnel-div-title",...t.value.style.chart.title},subtitle:{cy:"funnel-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&b.value?(e.openBlock(),e.createBlock(X.UserOptions,{ref:"details",key:`user_option_${z.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(O),isImaging:e.unref(I),uid:k.value,hasTooltip:!1,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasLabel:!1,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:C.value,chartElement:g.value,position:t.value.userOptions.position,titles:{...t.value.userOptions.buttonTitles},hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:B.value,onToggleAnnotator:$,onToggleFullscreen:te,onGeneratePdf:e.unref(q),onGenerateImage:e.unref(M),onToggleTable:U,onGenerateCsv:j},e.createSlots({_:2},[l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:s})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:s})),void 0,!0)]),key:"4"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:a,isAnnotator:s})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:a,isAnnotator:s})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","chartElement","position","titles","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":C.value,"vue-data-ui-fulscreen--off":!C.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.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`funnel_area_${k.value}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.chart.backgroundColor,"stop-opacity":0},null,8,he),e.createElementVNode("stop",{offset:"20%","stop-color":t.value.style.chart.area.color},null,8,me),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.area.color},null,8,fe)],8,de)]),t.value.style.chart.circleLinks.show?(e.openBlock(),e.createElementBlock("line",e.mergeProps({key:0},ee.value,{stroke:t.value.style.chart.circleLinks.color,"stroke-width":12*t.value.style.chart.circleLinks.widthRatio,"stroke-linecap":"round",class:{animated:t.value.useCssAnimation},style:{strokeDasharray:t.value.useCssAnimation?m.value.height:0,strokeDashoffset:t.value.useCssAnimation?m.value.height:0}}),null,16,pe)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,({cx:a,cy:s,r:v,fill:i},x)=>(e.openBlock(),e.createElementBlock("circle",e.mergeProps({cx:a,cy:s,r:v,fill:i},{stroke:t.value.style.chart.circles.stroke,"stroke-width":t.value.style.chart.circles.strokeWidth,class:{animated:t.value.useCssAnimation&&!f.value},style:{animationDelay:`${150*x}ms`}}),null,16,be))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(a,s)=>(e.openBlock(),e.createElementBlock("text",{x:a.cx,y:a.cy+u.value.circles/3+t.value.style.chart.circles.dataLabels.offsetY,"text-anchor":"middle","font-size":u.value.circles,fill:t.value.style.chart.circles.dataLabels.adaptColorToBackground?e.unref(r.adaptColorToBackground)(a.color):t.value.style.chart.circles.dataLabels.color,"font-weight":t.value.style.chart.circles.dataLabels.bold?"bold":"normal",class:e.normalizeClass({animated:t.value.useCssAnimation&&!f.value}),style:e.normalizeStyle({animationDelay:`${150*s}ms`})},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.circles.dataLabels.formatter,a.proportion*100,e.unref(r.dataLabel)({v:a.proportion*100,s:"%",r:t.value.style.chart.circles.dataLabels.rounding}),{datapoint:a})),15,ye))),256)),t.value.style.chart.area.show?(e.openBlock(),e.createElementBlock("polygon",{key:1,points:Z.value,fill:`url(#funnel_area_${k.value})`,class:e.normalizeClass({animated:t.value.useCssAnimation&&!f.value}),style:e.normalizeStyle({transition:t.value.useCssAnimation?`all ${150*h.value.length}ms ease-in`:"none"})},null,14,ge)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,({x:a,y:s,height:v,width:i,fill:x},N)=>(e.openBlock(),e.createElementBlock("rect",e.mergeProps({x:a,y:s,height:v,width:i,fill:x},{stroke:t.value.style.chart.bars.stroke,"stroke-width":t.value.style.chart.bars.strokeWidth,rx:t.value.style.chart.bars.borderRadius,class:{animated:t.value.useCssAnimation&&!f.value},style:{animationDelay:`${150*N}ms`}}),null,16,ke))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(a,s)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("text",{x:a.x+a.width+t.value.style.chart.bars.dataLabels.name.offsetX+12,y:a.cy-u.value.names/2+t.value.style.chart.bars.dataLabels.name.offsetY,"text-anchor":"start","font-size":u.value.names,fill:t.value.style.chart.bars.dataLabels.name.color,"font-weight":t.value.style.chart.bars.dataLabels.name.bold?"bold":"normal",class:e.normalizeClass({animated:t.value.useCssAnimation&&!f.value}),style:e.normalizeStyle({animationDelay:`${150*s}ms`})},e.toDisplayString(a.name),15,Ce),e.createElementVNode("text",{x:a.x+a.width+t.value.style.chart.bars.dataLabels.value.offsetX+12,y:a.cy+u.value.values+t.value.style.chart.bars.dataLabels.value.offsetY,"text-anchor":"start","font-size":u.value.values,fill:t.value.style.chart.bars.dataLabels.value.color,"font-weight":t.value.style.chart.bars.dataLabels.value.bold?"bold":"normal",class:e.normalizeClass({animated:t.value.useCssAnimation&&!f.value}),style:e.normalizeStyle({animationDelay:`${150*s}ms`})},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.bars.dataLabels.value.formatter,a.value,e.unref(r.dataLabel)({p:t.value.style.chart.bars.dataLabels.value.prefix,v:a.value,s:t.value.style.chart.bars.dataLabels.value.suffix,r:t.value.style.chart.bars.dataLabels.value.rounding}),{datapoint:a})),15,we)]))),256)),e.renderSlot(l.$slots,"svg",{svg:c.value},void 0,!0)],14,ve)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",xe,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(O)||e.unref(I)})),void 0,!0)])):e.createCommentVNode("",!0),b.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ue.default,{key:6,config:{type:"verticalBar",style:{backgroundColor:t.value.style.chart.backgroundColor,verticalBar:{axis:{color:"#CCCCCC"},color:"#CCCCCC"}}}},null,8,["config"])),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:E,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createBlock(se.default,{key:8,hideDetails:"",config:{open:L.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(ne.DataTable,{key:`table_${A.value}`,colNames:_.value.colNames,head:_.value.head,body:_.value.body,config:_.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[0]||(o[0]=a=>L.value.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createElementVNode("div",{innerHTML:a,style:{display:"flex","align-items":"center"}},null,8,Le)]),td:e.withCtx(({td:a})=>[e.createTextVNode(e.toDisplayString(a.name?a.name:a),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,ce))}},_e=ie._export_sfc(Be,[["__scopeId","data-v-51a14bf0"]]);exports.default=_e;
@@ -1,13 +1,13 @@
1
1
  import { useCssVars as we, computed as i, onMounted as xe, ref as u, watch as $e, openBlock as s, createElementBlock as r, normalizeClass as L, normalizeStyle as T, createBlock as A, createCommentVNode as m, unref as d, createSlots as _e, withCtx as p, renderSlot as k, normalizeProps as X, guardReactiveProps as j, createElementVNode as C, mergeProps as H, Fragment as M, renderList as B, toDisplayString as E, createTextVNode as Le, nextTick as Te } from "vue";
2
- import { u as Ae, o as Ne, e as ve, g as ze, c as Pe, d as Se, l as Fe, i as R, f as G, X as Oe, F as De, t as Ie, q as Me, r as Be, E as Y } from "./index-CpjF4-PU.js";
3
- import { u as de } from "./useNestedProp-DiDiQc6z.js";
4
- import { u as Ee, U as Re } from "./usePrinter-CZ0Ro0M3.js";
5
- import { _ as Ge } from "./Title-D_ljAKoY.js";
6
- import { P as Ve } from "./PenAndPaper-u9Nkiu0T.js";
7
- import { D as Ue } from "./DataTable-BmAybhqW.js";
8
- import Xe from "./vue-ui-accordion-D6Uwxwl0.js";
2
+ import { u as Ae, o as Ne, e as ve, g as ze, c as Pe, d as Se, l as Fe, i as R, f as G, X as Oe, F as De, t as Ie, q as Me, r as Be, E as Y } from "./index-DtCryprM.js";
3
+ import { u as de } from "./useNestedProp-tT95LfDr.js";
4
+ import { u as Ee, U as Re } from "./usePrinter-D4_doq3d.js";
5
+ import { _ as Ge } from "./Title-CfjKQsLl.js";
6
+ import { P as Ve } from "./PenAndPaper-BF7qtcRe.js";
7
+ import { D as Ue } from "./DataTable-DY9Joecu.js";
8
+ import Xe from "./vue-ui-accordion-C3p9yjUl.js";
9
9
  import { t as je, u as He } from "./useResponsive-CoxXLe23.js";
10
- import Ye from "./vue-ui-skeleton-5qiu2vOB.js";
10
+ import Ye from "./vue-ui-skeleton-Bw0j7S0v.js";
11
11
  import { _ as qe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
12
12
  const We = ["id"], Je = ["xmlns", "viewBox"], Ke = ["id"], Qe = ["stop-color"], Ze = ["stop-color"], et = ["stop-color"], tt = ["stroke", "stroke-width"], at = ["stroke", "stroke-width"], lt = ["x", "y", "font-size", "fill", "font-weight"], st = ["points", "fill"], ot = ["stroke", "stroke-width", "rx"], nt = ["x", "y", "font-size", "fill", "font-weight"], rt = ["x", "y", "font-size", "fill", "font-weight"], ut = {
13
13
  key: 5,
@@ -1,15 +1,15 @@
1
1
  import { computed as d, onMounted as Se, ref as u, watch as Ne, openBlock as o, createElementBlock as n, normalizeClass as F, normalizeStyle as H, createBlock as $, createCommentVNode as i, unref as p, createSlots as Le, withCtx as c, renderSlot as v, normalizeProps as S, guardReactiveProps as N, createVNode as re, createElementVNode as x, Fragment as ue, renderList as ne, createTextVNode as ie, toDisplayString as E, nextTick as Oe } from "vue";
2
- import { u as Ie, o as Ae, e as ce, g as Fe, c as ve, t as Ee, a as De, p as D, b as Ve, d as Be, I as de, L as Ge, f as k, X as Me, i as he, x as pe, y as ze, q as We, r as He } from "./index-CpjF4-PU.js";
3
- import { L as Ue } from "./Legend-7EZhiUrH.js";
4
- import { _ as Xe } from "./Title-D_ljAKoY.js";
5
- import { _ as Re } from "./Tooltip-Cy8PyEK7.js";
6
- import { D as Ye } from "./DataTable-BmAybhqW.js";
7
- import { u as je, U as qe } from "./usePrinter-CZ0Ro0M3.js";
8
- import Je from "./vue-ui-skeleton-5qiu2vOB.js";
9
- import Ke from "./vue-ui-accordion-D6Uwxwl0.js";
10
- import { u as ye } from "./useNestedProp-DiDiQc6z.js";
11
- import { _ as Qe } from "./PackageVersion-BRMtBck7.js";
12
- import { P as Ze } from "./PenAndPaper-u9Nkiu0T.js";
2
+ import { u as Ie, o as Ae, e as ce, g as Fe, c as ve, t as Ee, a as De, p as D, b as Ve, d as Be, I as de, L as Ge, f as k, X as Me, i as he, x as pe, y as ze, q as We, r as He } from "./index-DtCryprM.js";
3
+ import { L as Ue } from "./Legend-CSG4maaN.js";
4
+ import { _ as Xe } from "./Title-CfjKQsLl.js";
5
+ import { _ as Re } from "./Tooltip-B3hfjJYk.js";
6
+ import { D as Ye } from "./DataTable-DY9Joecu.js";
7
+ import { u as je, U as qe } from "./usePrinter-D4_doq3d.js";
8
+ import Je from "./vue-ui-skeleton-Bw0j7S0v.js";
9
+ import Ke from "./vue-ui-accordion-C3p9yjUl.js";
10
+ import { u as ye } from "./useNestedProp-tT95LfDr.js";
11
+ import { _ as Qe } from "./PackageVersion-CRyyH_HB.js";
12
+ import { P as Ze } from "./PenAndPaper-BF7qtcRe.js";
13
13
  import { _ as et } from "./_plugin-vue_export-helper-CHgC5LLL.js";
14
14
  const tt = ["id"], lt = {
15
15
  key: 1,