vue-data-ui 2.7.7-beta.2 → 2.8.1

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 (163) hide show
  1. package/dist/{Arrow-I5AiHXxB.js → Arrow-dZEf3SsT.js} +1 -1
  2. package/dist/{Arrow-D6q7wT70.cjs → Arrow-vOXpy5M-.cjs} +1 -1
  3. package/dist/{BaseIcon-BNBdVypn.cjs → BaseIcon-C2o75ceK.cjs} +1 -1
  4. package/dist/{BaseIcon-eOI-TaGA.js → BaseIcon-DZrvtZc3.js} +1 -1
  5. package/dist/{ColorPicker-RxZk7X7b.js → ColorPicker-CNr7vlRS.js} +3 -3
  6. package/dist/{ColorPicker-B3YPWhmx.cjs → ColorPicker-Dm8-2J-c.cjs} +1 -1
  7. package/dist/{DataTable-D6KdvUip.js → DataTable-D47NI3mY.js} +2 -2
  8. package/dist/{DataTable-DbFdIOSA.cjs → DataTable-DEFs-EaT.cjs} +1 -1
  9. package/dist/{Legend-C-PmQikI.cjs → Legend-BrWxrvx1.cjs} +1 -1
  10. package/dist/{Legend-D2hXVij0.js → Legend-CdT35-yb.js} +2 -2
  11. package/dist/PackageVersion-CX5-lR_7.cjs +1 -0
  12. package/dist/{PackageVersion-m64FzgEd.js → PackageVersion-D0X33ZDw.js} +3 -3
  13. package/dist/{PenAndPaper-DsrtCBwN.js → PenAndPaper-DOg71Z7q.js} +3 -3
  14. package/dist/{PenAndPaper-DQgGlIFz.cjs → PenAndPaper-mo5_icjt.cjs} +1 -1
  15. package/dist/{Shape-B5iAAqd4.js → Shape-BalEJckG.js} +1 -1
  16. package/dist/{Shape-B75ciWNR.cjs → Shape-DNTuLHYt.cjs} +1 -1
  17. package/dist/{Slicer-kYbzIqGE.js → Slicer-CB_l-Wls.js} +2 -2
  18. package/dist/{Slicer-CbLRKclY.cjs → Slicer-DKf0nwex.cjs} +1 -1
  19. package/dist/{Title-C0CT6jA6.js → Title-lqF_rq6c.js} +1 -1
  20. package/dist/{Title-BqVhWQj9.cjs → Title-s-4wtmyf.cjs} +1 -1
  21. package/dist/{Tooltip-DG7xNLW-.cjs → Tooltip-Br3lB3d1.cjs} +1 -1
  22. package/dist/{Tooltip-TflEtITP.js → Tooltip-DKFyA3ub.js} +1 -1
  23. package/dist/{dom-to-png-CpKxlQQV.cjs → dom-to-png-CgxmOicm.cjs} +1 -1
  24. package/dist/{dom-to-png-DOvFiyVD.js → dom-to-png-CjE9FVEC.js} +1 -1
  25. package/dist/{img-Df4jddw0.js → img-BN_XjXTk.js} +1 -1
  26. package/dist/{img-DJuM6hTd.cjs → img-DLXHtEji.cjs} +1 -1
  27. package/dist/{index-CHhWsvsT.js → index-BFQVpLxg.js} +1 -1
  28. package/dist/{index-B8vOvwaf.cjs → index-C2dCPlLw.cjs} +1 -1
  29. package/dist/{pdf-BV7moOjc.js → pdf-BFhwCcHB.js} +1 -1
  30. package/dist/{pdf-Bihl06mH.cjs → pdf-C_8oLgu7.cjs} +1 -1
  31. package/dist/style.css +1 -1
  32. package/dist/{useNestedProp-BFjDbZR0.js → useNestedProp-CQx8H1CV.js} +1 -1
  33. package/dist/{useNestedProp-C4sQAs2T.cjs → useNestedProp-Coe_9w4h.cjs} +1 -1
  34. package/dist/{usePrinter-Bi6GyL7Z.cjs → usePrinter-B7OpKMf9.cjs} +1 -1
  35. package/dist/{usePrinter-CAc9dBow.js → usePrinter-DKrOpSvE.js} +3 -3
  36. package/dist/{vue-data-ui-BiqUTQHh.js → vue-data-ui-C89e8X6S.js} +61 -61
  37. package/dist/{vue-data-ui-BXyPpDlS.cjs → vue-data-ui-DCeVvr5x.cjs} +1 -1
  38. package/dist/vue-data-ui.cjs +1 -1
  39. package/dist/vue-data-ui.js +1 -1
  40. package/dist/{vue-ui-3d-bar-BukVhbUM.js → vue-ui-3d-bar-CwIBC5RB.js} +9 -9
  41. package/dist/{vue-ui-3d-bar-CsfKeMor.cjs → vue-ui-3d-bar-Dr21Q9Ah.cjs} +1 -1
  42. package/dist/{vue-ui-accordion-C7pRXQdw.js → vue-ui-accordion-8x_k6qEe.js} +3 -3
  43. package/dist/{vue-ui-accordion-CBE2Lscz.cjs → vue-ui-accordion-CEJghMx7.cjs} +1 -1
  44. package/dist/{vue-ui-age-pyramid-Dax4kNLx.js → vue-ui-age-pyramid-CK58dJZD.js} +10 -10
  45. package/dist/{vue-ui-age-pyramid-CmhWu1qE.cjs → vue-ui-age-pyramid-CTipzKSo.cjs} +1 -1
  46. package/dist/{vue-ui-annotator-iiL8Nzi5.cjs → vue-ui-annotator-DbciFqaW.cjs} +1 -1
  47. package/dist/{vue-ui-annotator-3Q8JcMLX.js → vue-ui-annotator-_s2si5zW.js} +2 -2
  48. package/dist/{vue-ui-bullet-BnqMZQ7a.js → vue-ui-bullet-BNnj4D8l.js} +8 -8
  49. package/dist/{vue-ui-bullet-Da3iBcaw.cjs → vue-ui-bullet-Bl-8zrm9.cjs} +1 -1
  50. package/dist/{vue-ui-candlestick-9FDrczZR.cjs → vue-ui-candlestick-BNG2KkuK.cjs} +1 -1
  51. package/dist/{vue-ui-candlestick-D0mY94Jp.js → vue-ui-candlestick-BVk7pmj6.js} +11 -11
  52. package/dist/{vue-ui-carousel-table--HXY8XEd.js → vue-ui-carousel-table-CC9kZ_bu.js} +4 -4
  53. package/dist/{vue-ui-carousel-table-D82JYyHE.cjs → vue-ui-carousel-table-UzYywKWA.cjs} +1 -1
  54. package/dist/{vue-ui-chestnut-DGMEqNF1.js → vue-ui-chestnut-BhZBuz2y.js} +8 -8
  55. package/dist/{vue-ui-chestnut-ChxHav21.cjs → vue-ui-chestnut-CcMmDECP.cjs} +1 -1
  56. package/dist/{vue-ui-circle-pack-DDtij6Kr.js → vue-ui-circle-pack-C_vYTThy.js} +9 -9
  57. package/dist/{vue-ui-circle-pack-Bto97bX9.cjs → vue-ui-circle-pack-CdUy3_pV.cjs} +1 -1
  58. package/dist/{vue-ui-cursor-DnQjJnVr.cjs → vue-ui-cursor-CdUNnycj.cjs} +1 -1
  59. package/dist/{vue-ui-cursor-BffyiKnL.js → vue-ui-cursor-DHrWj61J.js} +2 -2
  60. package/dist/vue-ui-dashboard-C9JgMUfr.cjs +1 -0
  61. package/dist/vue-ui-dashboard-DJWoi76j.js +317 -0
  62. package/dist/{vue-ui-digits-CLgeA2NX.js → vue-ui-digits-D05LGBT4.js} +2 -2
  63. package/dist/{vue-ui-digits-BTZHIHFC.cjs → vue-ui-digits-D1Y6qbSL.cjs} +1 -1
  64. package/dist/{vue-ui-donut-7BmcLSnQ.cjs → vue-ui-donut-DoBw4yHW.cjs} +1 -1
  65. package/dist/{vue-ui-donut-Bb9t4OWG.js → vue-ui-donut-FXqedwJq.js} +12 -12
  66. package/dist/{vue-ui-donut-evolution-B3c99AS5.cjs → vue-ui-donut-evolution-Ddbh30nH.cjs} +1 -1
  67. package/dist/{vue-ui-donut-evolution-BzETpvh8.js → vue-ui-donut-evolution-dhz5D6f0.js} +11 -11
  68. package/dist/{vue-ui-dumbbell-q0DWy_nW.cjs → vue-ui-dumbbell-M0hlbBdb.cjs} +1 -1
  69. package/dist/{vue-ui-dumbbell-CovXfgXM.js → vue-ui-dumbbell-_GSk9lKx.js} +10 -10
  70. package/dist/{vue-ui-flow-D-S2_qAL.js → vue-ui-flow-Bu0ZfKlT.js} +9 -9
  71. package/dist/{vue-ui-flow-DOBvmEXN.cjs → vue-ui-flow-DEmCo5dS.cjs} +1 -1
  72. package/dist/{vue-ui-funnel-AgQDv8GV.js → vue-ui-funnel-BXWS_Gxs.js} +9 -9
  73. package/dist/{vue-ui-funnel-CG030eaF.cjs → vue-ui-funnel-BiFo1Gxp.cjs} +1 -1
  74. package/dist/{vue-ui-galaxy-VTaUhuNb.cjs → vue-ui-galaxy-B02Ek0C1.cjs} +1 -1
  75. package/dist/{vue-ui-galaxy-Eh1iX0hH.js → vue-ui-galaxy-DCbMRL-h.js} +11 -11
  76. package/dist/{vue-ui-gauge-Dp49FLkw.cjs → vue-ui-gauge-BgRhJVQ9.cjs} +1 -1
  77. package/dist/{vue-ui-gauge-BU3D6eVu.js → vue-ui-gauge-BxFg6VGp.js} +7 -7
  78. package/dist/{vue-ui-gizmo-BALGIrUN.js → vue-ui-gizmo-BxUeMXnL.js} +3 -3
  79. package/dist/{vue-ui-gizmo-bDjkcGjm.cjs → vue-ui-gizmo-DtjIhGeD.cjs} +1 -1
  80. package/dist/{vue-ui-heatmap-C4-jHxqE.js → vue-ui-heatmap-BFKdhq63.js} +10 -10
  81. package/dist/{vue-ui-heatmap-BSjmR3sS.cjs → vue-ui-heatmap-I7vcpM9m.cjs} +1 -1
  82. package/dist/{vue-ui-history-plot-CRhDY60l.js → vue-ui-history-plot-BBJAQx9-.js} +11 -11
  83. package/dist/{vue-ui-history-plot-JQTLEF-0.cjs → vue-ui-history-plot-HIqRsts_.cjs} +1 -1
  84. package/dist/{vue-ui-kpi-CVkh7BAP.cjs → vue-ui-kpi-BqK8aYMH.cjs} +1 -1
  85. package/dist/{vue-ui-kpi-BKvh1huR.js → vue-ui-kpi-D2Tbgo49.js} +3 -3
  86. package/dist/{vue-ui-mini-loader-C1LzgA-e.cjs → vue-ui-mini-loader-A8sYrPHv.cjs} +1 -1
  87. package/dist/{vue-ui-mini-loader-DbH7yYMi.js → vue-ui-mini-loader-Cw5ZfJY5.js} +2 -2
  88. package/dist/{vue-ui-molecule-NnAic6UM.cjs → vue-ui-molecule-BCiiaeC8.cjs} +1 -1
  89. package/dist/{vue-ui-molecule-CysKbgkZ.js → vue-ui-molecule-DFCX-pko.js} +11 -11
  90. package/dist/{vue-ui-mood-radar-ByisyMbS.cjs → vue-ui-mood-radar-A7_fZ0Ik.cjs} +1 -1
  91. package/dist/{vue-ui-mood-radar-DjGSlhy3.js → vue-ui-mood-radar-CSiS_gDF.js} +11 -11
  92. package/dist/{vue-ui-nested-donuts-XBgi1vDJ.js → vue-ui-nested-donuts-DvNUb57t.js} +11 -11
  93. package/dist/{vue-ui-nested-donuts-Bqlr_1UH.cjs → vue-ui-nested-donuts-FR-70vLE.cjs} +1 -1
  94. package/dist/{vue-ui-onion-D-O_hUCV.cjs → vue-ui-onion-DFUj5YN5.cjs} +1 -1
  95. package/dist/{vue-ui-onion-BXMEYteQ.js → vue-ui-onion-nl6W4uCt.js} +11 -11
  96. package/dist/{vue-ui-parallel-coordinate-plot-Bs32LBr4.js → vue-ui-parallel-coordinate-plot-BruWJBpM.js} +12 -12
  97. package/dist/{vue-ui-parallel-coordinate-plot-Tpk1xRt0.cjs → vue-ui-parallel-coordinate-plot-D32i3E9L.cjs} +1 -1
  98. package/dist/{vue-ui-quadrant-DfG2m9U9.js → vue-ui-quadrant-BdUpiOdu.js} +12 -12
  99. package/dist/{vue-ui-quadrant-CxrjcS0W.cjs → vue-ui-quadrant-Dn47DcoY.cjs} +1 -1
  100. package/dist/{vue-ui-quick-chart-BN752LC5.cjs → vue-ui-quick-chart-BXlOYyGL.cjs} +1 -1
  101. package/dist/{vue-ui-quick-chart-xFcZf4ic.js → vue-ui-quick-chart-CnerC9Qg.js} +9 -9
  102. package/dist/{vue-ui-radar-Dg9fIl6V.js → vue-ui-radar-BKx6YrLy.js} +12 -12
  103. package/dist/{vue-ui-radar-CpkoNVZF.cjs → vue-ui-radar-D9OrsteR.cjs} +1 -1
  104. package/dist/{vue-ui-rating-BOzOOjeP.js → vue-ui-rating-CM9uw6x8.js} +2 -2
  105. package/dist/{vue-ui-rating-CSIg9dgg.cjs → vue-ui-rating-Dc2Jqf26.cjs} +1 -1
  106. package/dist/{vue-ui-relation-circle-B8eDBnFj.js → vue-ui-relation-circle-6hpdGJz9.js} +7 -7
  107. package/dist/{vue-ui-relation-circle-BNNRdeuH.cjs → vue-ui-relation-circle-BXGepa63.cjs} +1 -1
  108. package/dist/{vue-ui-rings-Cmr5uRZw.js → vue-ui-rings-Cw66fFjF.js} +12 -12
  109. package/dist/{vue-ui-rings-DjDW0-Q6.cjs → vue-ui-rings-CxZFQwbk.cjs} +1 -1
  110. package/dist/{vue-ui-scatter-DGnuVGR2.js → vue-ui-scatter-Br9lsehL.js} +12 -12
  111. package/dist/{vue-ui-scatter-hA9kp5k6.cjs → vue-ui-scatter-CerEf0ET.cjs} +1 -1
  112. package/dist/{vue-ui-skeleton-Bbm-HuYK.js → vue-ui-skeleton-CHzvVaNP.js} +3 -3
  113. package/dist/{vue-ui-skeleton-Du-JZESo.cjs → vue-ui-skeleton-CfkVGDBV.cjs} +1 -1
  114. package/dist/{vue-ui-smiley-BRN7oHvx.cjs → vue-ui-smiley-CR5jHHYg.cjs} +1 -1
  115. package/dist/{vue-ui-smiley-DgI0gw_a.js → vue-ui-smiley-CeqcgusF.js} +2 -2
  116. package/dist/{vue-ui-spark-trend-CuGZ7SUB.js → vue-ui-spark-trend-CBGbYnep.js} +5 -5
  117. package/dist/{vue-ui-spark-trend-BcNN-FO8.cjs → vue-ui-spark-trend-tHT09aPz.cjs} +1 -1
  118. package/dist/{vue-ui-sparkbar-CsyQT684.js → vue-ui-sparkbar-1x0LFHXg.js} +4 -4
  119. package/dist/{vue-ui-sparkbar-DjoAo8_e.cjs → vue-ui-sparkbar-BKHS0kdd.cjs} +1 -1
  120. package/dist/{vue-ui-sparkgauge-BCPkzgDv.js → vue-ui-sparkgauge-CmsgH4VP.js} +4 -4
  121. package/dist/{vue-ui-sparkgauge-D7iAELw1.cjs → vue-ui-sparkgauge-D07IvlSw.cjs} +1 -1
  122. package/dist/{vue-ui-sparkhistogram-Ddkf1jvO.js → vue-ui-sparkhistogram-D8L5KGav.js} +5 -5
  123. package/dist/{vue-ui-sparkhistogram-Bf0QfydV.cjs → vue-ui-sparkhistogram-DiYgahNx.cjs} +1 -1
  124. package/dist/{vue-ui-sparkline-CdgHJGYS.cjs → vue-ui-sparkline-B151zYqx.cjs} +1 -1
  125. package/dist/{vue-ui-sparkline-DxwDic0p.js → vue-ui-sparkline-DNnFy0nI.js} +4 -4
  126. package/dist/{vue-ui-sparkstackbar-FV9amPXv.cjs → vue-ui-sparkstackbar-D-r0Eync.cjs} +1 -1
  127. package/dist/{vue-ui-sparkstackbar-oQ5zFbnG.js → vue-ui-sparkstackbar-Dm9r7g1y.js} +5 -5
  128. package/dist/{vue-ui-stackbar-DXCUbrDs.js → vue-ui-stackbar-5NB574Dp.js} +13 -13
  129. package/dist/{vue-ui-stackbar-B2BaQqZp.cjs → vue-ui-stackbar-Df9HHJgh.cjs} +1 -1
  130. package/dist/{vue-ui-strip-plot-CTTgQkQq.cjs → vue-ui-strip-plot-i_HCH7Xj.cjs} +1 -1
  131. package/dist/{vue-ui-strip-plot-8FTALylL.js → vue-ui-strip-plot-xXdnVANk.js} +11 -11
  132. package/dist/{vue-ui-table-BSZ4-uk3.cjs → vue-ui-table-BArM6fjG.cjs} +1 -1
  133. package/dist/{vue-ui-table-CoQmm6oQ.js → vue-ui-table-CEkrP2zd.js} +1 -1
  134. package/dist/{vue-ui-table-heatmap-9co1bgsX.cjs → vue-ui-table-heatmap-6iDYkY0u.cjs} +1 -1
  135. package/dist/{vue-ui-table-heatmap-DbrXViRF.js → vue-ui-table-heatmap-CZ3gb7v6.js} +4 -4
  136. package/dist/{vue-ui-table-sparkline-DmifMZlU.js → vue-ui-table-sparkline-CpCwGOlM.js} +5 -5
  137. package/dist/{vue-ui-table-sparkline-Bedq8Umj.cjs → vue-ui-table-sparkline-D2ANgidl.cjs} +1 -1
  138. package/dist/{vue-ui-thermometer-CRPYJ2zm.js → vue-ui-thermometer-7V4dPxGU.js} +7 -7
  139. package/dist/{vue-ui-thermometer-Dq06rElD.cjs → vue-ui-thermometer-Bjk-5s8s.cjs} +1 -1
  140. package/dist/{vue-ui-timer-BKBy1ZLE.js → vue-ui-timer-Bit954QR.js} +5 -5
  141. package/dist/{vue-ui-timer-DxuD_GzY.cjs → vue-ui-timer-D9i8dmxX.cjs} +1 -1
  142. package/dist/{vue-ui-tiremarks-NfgbQpwX.js → vue-ui-tiremarks-CgfFmdz9.js} +7 -7
  143. package/dist/{vue-ui-tiremarks-DNMh2uS8.cjs → vue-ui-tiremarks-H9vo6N1q.cjs} +1 -1
  144. package/dist/{vue-ui-treemap-BIFpEdcW.js → vue-ui-treemap-BgBGHQwK.js} +12 -12
  145. package/dist/{vue-ui-treemap-BPToyCts.cjs → vue-ui-treemap-C5oTJc6m.cjs} +1 -1
  146. package/dist/{vue-ui-vertical-bar-DvXKngor.cjs → vue-ui-vertical-bar-B6qA1hNj.cjs} +1 -1
  147. package/dist/{vue-ui-vertical-bar-CJPzwkOs.js → vue-ui-vertical-bar-DocNPjHZ.js} +12 -12
  148. package/dist/{vue-ui-waffle-W6LYkj3J.js → vue-ui-waffle-BBLFjjPk.js} +12 -12
  149. package/dist/{vue-ui-waffle-CjAk1ZgB.cjs → vue-ui-waffle-PuO6qyse.cjs} +1 -1
  150. package/dist/{vue-ui-wheel-C6CiUQPX.cjs → vue-ui-wheel-BX_pPLwM.cjs} +1 -1
  151. package/dist/{vue-ui-wheel-BrQpTjAd.js → vue-ui-wheel-BwcIurMc.js} +7 -7
  152. package/dist/{vue-ui-word-cloud-BDHwUS2t.js → vue-ui-word-cloud-CAjlNbxw.js} +10 -10
  153. package/dist/{vue-ui-word-cloud-DLZNBF3e.cjs → vue-ui-word-cloud-DGt-qnLp.cjs} +1 -1
  154. package/dist/{vue-ui-world-_B_bmsir.cjs → vue-ui-world-DGGJD8ge.cjs} +2 -2
  155. package/dist/{vue-ui-world-CHeMS2oK.js → vue-ui-world-oVo3n7m5.js} +14 -14
  156. package/dist/{vue-ui-xy-DCqIGXDR.js → vue-ui-xy-B618psvc.js} +16 -16
  157. package/dist/{vue-ui-xy-Bxf4aZvK.cjs → vue-ui-xy-BLTdcmpY.cjs} +2 -2
  158. package/dist/{vue-ui-xy-canvas-DkW65e7N.js → vue-ui-xy-canvas-DdMMZtbJ.js} +12 -12
  159. package/dist/{vue-ui-xy-canvas-C-FBIlH7.cjs → vue-ui-xy-canvas-DumADhZZ.cjs} +1 -1
  160. package/package.json +1 -1
  161. package/dist/PackageVersion-D22bJIIL.cjs +0 -1
  162. package/dist/vue-ui-dashboard-B9YwIx1g.cjs +0 -1
  163. package/dist/vue-ui-dashboard-BvzyqjWd.js +0 -248
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-B8vOvwaf.cjs"),ye=require("./useResponsive-DQmBAoBf.cjs"),Fe=require("./Title-BqVhWQj9.cjs"),me=require("./usePrinter-Bi6GyL7Z.cjs"),ze=require("./Tooltip-DG7xNLW-.cjs"),Oe=require("./DataTable-DbFdIOSA.cjs"),Ae=require("./Legend-C-PmQikI.cjs"),De=require("./vue-ui-skeleton-Du-JZESo.cjs"),qe=require("./vue-ui-accordion-CBE2Lscz.cjs"),ge=require("./useNestedProp-C4sQAs2T.cjs"),Me=require("./PackageVersion-D22bJIIL.cjs"),Re=require("./PenAndPaper-DQgGlIFz.cjs"),Ue=require("./useUserOptionState-BgepsfED.cjs"),je=require("./Shape-B75ciWNR.cjs"),Ge=require("./useChartAccessibility-Cm7nkzTG.cjs"),We=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),He=["id"],Ye=["xmlns","viewBox"],Xe=["id"],Je=["stop-color"],Ke=["stop-color"],Qe=["id"],Ze=["x","y","height","width"],et=["height","width"],tt={key:0},lt=["rx","x","y","height","width","stroke","stroke-width","filter"],at=["rx","x","y","height","width","fill","stroke","stroke-width","filter"],ot={key:1},rt=["rx","x","y","height","width","fill","filter"],nt=["x","y","height","width","filter"],ut={key:0},st={key:1},it={key:2},ct={key:3},vt=["onMouseover","x","y","height","width"],dt={key:5,class:"vue-data-ui-watermark"},pt=["onClick"],ht={key:0},ft={key:1},yt=["innerHTML"],mt={__name:"vue-ui-waffle",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(be,{expose:ke,emit:we}){const{vue_ui_waffle:Ce}=u.useConfig(),p=be,xe=e.useSlots(),V=e.computed(()=>!!p.dataset&&p.dataset.length),f=e.ref(u.createUid()),Be=e.ref(null),O=e.ref(!1),A=e.ref(""),B=e.ref(null),j=e.ref(0),N=e.ref(null),G=e.ref(null),W=e.ref(null),H=e.ref(null),Y=e.ref(null),X=e.ref(0),J=e.ref(0),K=e.ref(0),t=e.computed({get:()=>te(),set:l=>l}),{userOptionsVisible:D,setUserOptionsVisibility:Q,keepUserOptionState:Z}=Ue.useUserOptionState({config:t.value}),{svgRef:ee}=Ge.useChartAccessibility({config:t.value.style.chart.title});function te(){const l=ge.useNestedProp({userConfig:p.config,defaultConfig:Ce});return l.theme?{...ge.useNestedProp({userConfig:u.themes.vue_ui_waffle[l.theme]||p.config,defaultConfig:l}),customPalette:u.themePalettes[l.theme]||u.palette}:l}e.watch(()=>p.config,l=>{t.value=te(),D.value=!t.value.userOptions.showOnChartHover,le(),X.value+=1,J.value+=1,K.value+=1,y.value.showTable=t.value.table.show,y.value.showTooltip=t.value.style.chart.tooltip.show},{deep:!0});const P=e.ref(null);function le(){if(u.objectIsEmpty(p.dataset)?u.error({componentName:"VueUiWaffle",type:"dataset"}):p.dataset.forEach((l,o)=>{u.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(a=>{u.error({componentName:"VueUiWaffle",type:"datasetSerieAttribute",property:a,index:o})})}),t.value.responsive){const l=ye.throttle(()=>{const{width:o,height:a}=ye.useResponsive({chart:N.value,title:t.value.style.chart.title.text?G.value:null,legend:t.value.style.chart.legend.show?W.value:null,source:H.value,noTitle:Y.value});requestAnimationFrame(()=>{C.value.width=o,C.value.height=a,m.value.width=o,m.value.height=a})});P.value=new ResizeObserver(l),P.value.observe(N.value.parentNode)}}e.onMounted(()=>{le()}),e.onBeforeUnmount(()=>{P.value&&P.value.disconnect()});const{isPrinting:ae,isImaging:oe,generatePdf:re,generateImage:ne}=me.usePrinter({elementId:`vue-ui-waffle_${f.value}`,fileName:t.value.style.chart.title.text||"vue-ui-waffle",options:t.value.userOptions.print}),_e=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),ue=e.computed(()=>u.convertCustomPalette(t.value.customPalette)),y=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),C=e.ref({height:512,width:512}),m=e.ref({top:0,left:0,height:512,width:512}),g=e.computed(()=>(m.value.width-t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.spaceBetween)/t.value.style.chart.layout.grid.size),b=e.computed(()=>(m.value.height-t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.spaceBetween)/t.value.style.chart.layout.grid.size),T=e.computed(()=>m.value.width/t.value.style.chart.layout.grid.size),E=e.computed(()=>m.value.height/t.value.style.chart.layout.grid.size);function se(l){const o=t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.size,a=l.reduce((h,U)=>h+U,0),r=l.map(h=>h/a*o),n=r.map(Math.floor),i=r.map(h=>h%1);let d=o-n.reduce((h,U)=>h+U,0);for(;d>0;){let h=i.indexOf(Math.max(...i));n[h]+=1,i[h]=0,d-=1}return n}function ie(){return p.dataset.map((l,o)=>({...l,color:u.convertColorToHex(l.color)||ue.value[o]||u.palette[o]||u.palette[o%u.palette.length],uid:`serie_${o}`,absoluteIndex:o}))}const q=e.computed(()=>ie()),c=e.ref(q.value);e.watch(()=>p.dataset,l=>{c.value=ie()},{deep:!0});const Se=e.computed(()=>{const l=c.value.filter((o,a)=>!v.value.includes(o.uid)).map((o,a)=>(o.values||[]).reduce((r,n)=>r+n,0));return se(l)}),$e=e.computed(()=>{const l=c.value.map((o,a)=>(o.values||[]).reduce((r,n)=>r+n));return se(l)}),L=e.computed(()=>(p.dataset.forEach((l,o)=>{[null,void 0].includes(l.values)&&u.error({componentName:"VueUiWaffle",type:"datasetSerieAttribute",property:"values (number[])",index:o})}),c.value.filter((l,o)=>!v.value.includes(l.uid)).map((l,o)=>({absoluteIndex:l.absoluteIndex,uid:l.uid,name:l.name,color:l.color,value:(l.values||[]).reduce((a,r)=>a+r,0),absoluteValues:l.values||[],proportion:Se.value[o]})))),Ne=e.computed(()=>c.value.map((l,o)=>({absoluteIndex:l.absoluteIndex,uid:l.uid,name:l.name,color:l.color,value:(l.values||[]).reduce((a,r)=>a+r,0),absoluteValues:l.values||[],proportion:$e.value[o]})));function Te(){return Ne.value.map(l=>({name:l.name,color:l.color,value:l.value,proportion:l.proportion}))}const Le=e.computed(()=>{let l=0;return L.value.map((o,a)=>{const r=l,n=r+o.proportion,i=[];for(let d=Math.floor(r);d<Math.floor(n);d+=1)i.push(d);return l=n,{...o,start:r,rects:i}})}),s=e.computed(()=>Le.value.flatMap((l,o)=>l.rects.map((a,r)=>({isFirst:r===0,isLongEnough:a.length>2,name:l.name,color:l.color,value:l.value,serieIndex:o,absoluteStartIndex:r<3,serieId:l.uid,...l}))).map((l,o)=>({...l,isAbsoluteFirst:o%t.value.style.chart.layout.grid.size===0}))),_=e.computed(()=>{const l=[];for(let o=0;o<t.value.style.chart.layout.grid.size;o+=1)for(let a=0;a<t.value.style.chart.layout.grid.size;a+=1)l.push({isStartOfLine:a===0,position:t.value.style.chart.layout.grid.vertical?o:a,x:(t.value.style.chart.layout.grid.vertical?o:a)*(g.value+t.value.style.chart.layout.grid.spaceBetween),y:(t.value.style.chart.layout.grid.vertical?a:o)*(b.value+t.value.style.chart.layout.grid.spaceBetween)+m.value.top});return l}),v=e.ref([]),x=e.ref(!1),ce=e.ref(null),ve=e.ref(null);function de(l){if(!t.value.useAnimation){v.value.includes(l)?v.value=v.value.filter(n=>n!==l):v.value.length<S.value.length-1&&S.value.length>1&&v.value.push(l);return}const o=q.value.find(n=>n.uid===l).values.reduce((n,i)=>n+i,0),a=c.value.find(n=>n.uid===l).values.reduce((n,i)=>n+i,0);let r=a;if(v.value.includes(l)){let i=function(){r>n?(cancelAnimationFrame(ce.value),c.value=c.value.map((d,h)=>d.uid===l?{...d,values:[n]}:d),x.value=!1):(x.value=!0,r+=n*.025,c.value=c.value.map((d,h)=>d.uid===l?{...d,values:[r]}:d),ce.value=requestAnimationFrame(i))};v.value=v.value.filter(d=>d!==l);const n=o;i()}else if(v.value.length<S.value.length-1&&S.value.length>1){let n=function(){r<a/100?(cancelAnimationFrame(ve.value),v.value.push(l),c.value=c.value.map((i,d)=>i.uid===l?{...i,values:[0]}:i),x.value=!1):(x.value=!0,r/=1.15,c.value=c.value.map(i=>i.uid===l?{...i,values:[r]}:i),ve.value=requestAnimationFrame(n))};n()}Ee("selectLegend",L.value.map(n=>({name:n.name,color:n.color,value:n.value,proportion:n.proportion/Math.pow(t.value.style.chart.layout.grid.size,2)})))}const S=e.computed(()=>c.value.map((l,o)=>({name:l.name,color:l.color||ue[o]||u.palette[o]||u.palette[o%u.palette.length],value:(l.values||[]).reduce((a,r)=>a+r,0),uid:l.uid,shape:"square"})).map(l=>({...l,proportion:l.value/c.value.map(o=>(o.values||[]).reduce((a,r)=>a+r,0)).reduce((o,a)=>o+a,0),opacity:v.value.includes(l.uid)?.5:1,segregate:()=>de(l.uid),isSegregated:v.value.includes(l.uid)}))),Ve=e.computed(()=>({cy:"waffle-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),k=e.computed(()=>L.value.map(l=>l.value).reduce((l,o)=>l+o,0)),M=e.ref(null);function Pe(l){if(v.value.length===p.dataset.length)return;const o=s.value[l];M.value={datapoint:o,seriesIndex:o.absoluteIndex,series:c.value,config:t.value},O.value=!0,B.value=s.value[l].serieIndex;const a=t.value.style.chart.tooltip.customFormat;if(u.isFunction(a)&&u.functionReturnsString(()=>a({seriesIndex:s.value[l].absoluteIndex,datapoint:o,series:c.value,config:t.value})))A.value=a({seriesIndex:s.value[l].absoluteIndex,datapoint:o,series:c.value,config:t.value});else{let r="";if(r+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${o.name}</div>`,r+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 60 60" height="14" width="14"><rect x="0" y="0" height="60" width="60" stroke="none" rx="1" fill="${o.color}" />${xe.pattern?`<rect x="0" y="0" height="60" width="60" stroke="none" rx="1" stroke="none" fill="url(#pattern_${f.value}_${o.absoluteIndex})"/>`:""}</svg>`,t.value.style.chart.tooltip.showValue&&(r+=`<b>${u.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,o.value,u.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:o.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:o,seriesIndex:s.value[l].absoluteIndex,series:c.value})}</b>`),t.value.style.chart.tooltip.showPercentage){const n=u.dataLabel({v:o.value/k.value*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage});t.value.style.chart.tooltip.showValue?r+=`<span>(${n})</span></div>`:r+=`<b>${n}%</b></div>`}A.value=r}}const Ee=we,w=e.computed(()=>{const l=L.value.map(a=>({name:a.name,color:a.color})),o=L.value.map(a=>a.value);return{head:l,body:o}});function I(l){return t.value.useBlurOnHover&&![null,void 0].includes(B.value)&&B.value!==l?`url(#blur_${f.value})`:""}function pe(){e.nextTick(()=>{const l=w.value.head.map((r,n)=>[[r.name],[w.value.body[n]],[isNaN(w.value.body[n]/k.value)?"-":w.value.body[n]/k.value*100]]),o=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(l),a=u.createCsvContent(o);u.downloadCsv({csvContent:a,title:t.value.style.chart.title.text||"vue-ui-waffle"})})}const F=e.computed(()=>{const l=[' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>',u.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,k.value,u.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:k.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue})),"100%"],o=w.value.head.map((n,i)=>[{color:n.color,name:n.name},u.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,w.value.body[i],u.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:w.value.body[i],s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue})),isNaN(w.value.body[i]/k.value)?"-":u.dataLabel({v:w.value.body[i]/k.value*100,s:"%",r:t.value.table.td.roundingPercentage})]),a={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},shape:"square",breakpoint:t.value.table.responsiveBreakpoint},r=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage];return{head:l,body:o,config:a,colNames:r}}),$=e.ref(!1);function Ie(l){$.value=l,j.value+=1}function he(){y.value.showTable=!y.value.showTable}function fe(){y.value.showTooltip=!y.value.showTooltip}const z=e.ref(!1);function R(){z.value=!z.value}return ke({getData:Te,generatePdf:re,generateCsv:pe,generateImage:ne,toggleTable:he,toggleTooltip:fe,toggleAnnotator:R}),(l,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-waffle ${$.value?"vue-data-ui-wrapper-fullscreen":""}`),ref_key:"waffleChart",ref:N,id:`vue-ui-waffle_${f.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height: 100%":""}`),onMouseenter:o[3]||(o[3]=()=>e.unref(Q)(!0)),onMouseleave:o[4]||(o[4]=()=>e.unref(Q)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Re._sfc_main,{key:0,svgRef:e.unref(ee),backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:z.value,onClose:R},null,8,["svgRef","backgroundColor","color","active"])):e.createCommentVNode("",!0),_e.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:Y,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:G,style:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(Fe._sfc_main,{key:`title_${X.value}`,config:{title:{cy:"waffle-title",...t.value.style.chart.title},subtitle:{cy:"waffle-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&V.value&&(e.unref(Z)||e.unref(D))?(e.openBlock(),e.createBlock(me.UserOptions,{ref_key:"details",ref:Be,key:`user_options_${j.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(ae),isImaging:e.unref(oe),uid:f.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:$.value,isTooltip:y.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:N.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:z.value,onToggleFullscreen:Ie,onGeneratePdf:e.unref(re),onGenerateCsv:pe,onGenerateImage:e.unref(ne),onToggleTable:he,onToggleTooltip:fe,onToggleAnnotator:R,style:e.normalizeStyle({visibility:e.unref(Z)?e.unref(D)?"visible":"hidden":"visible"})},e.createSlots({_:2},[l.$slots.menuIcon?{name:"menuIcon",fn:e.withCtx(({isOpen:a,color:r})=>[e.renderSlot(l.$slots,"menuIcon",e.normalizeProps(e.guardReactiveProps({isOpen:a,color:r})),void 0,!0)]),key:"0"}:void 0,l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"5"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:r})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:r})),void 0,!0)]),key:"6"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:a,isAnnotator:r})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:a,isAnnotator:r})),void 0,!0)]),key:"7"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),V.value?(e.openBlock(),e.createElementBlock("svg",{key:4,ref_key:"svgRef",ref:ee,xmlns:e.unref(u.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":$.value,"vue-data-ui-fulscreen--off":!$.value}),viewBox:`0 0 ${C.value.width<=0?10:C.value.width} ${C.value.height<=0?10:C.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Me._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(a,r)=>(e.openBlock(),e.createElementBlock("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`gradient_${f.value}_${r}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(u.setOpacity)(e.unref(u.shiftHue)(a.color,.05),100-t.value.style.chart.layout.rect.gradientIntensity)},null,8,Je),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,Ke)],8,Xe))),256))]),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${f.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},o[5]||(o[5]=[e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:2},null,-1),e.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1)]),8,Qe)]),t.value.useCustomCells&&s.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(_.value,(a,r)=>(e.openBlock(),e.createElementBlock("foreignObject",{x:a.x,y:a.y,height:b.value<=0?1e-4:b.value,width:g.value<=0?1e-4:g.value,class:"vue-ui-waffle-custom-cell-foreignObject"},[e.renderSlot(l.$slots,"cell",e.mergeProps({ref_for:!0},{cell:{...a,color:s.value[r].color,...s.value[r]},isSelected:[null,void 0].includes(B.value)?!0:s.value[r].serieIndex===B.value}),void 0,!0)],8,Ze))),256)):e.createCommentVNode("",!0),!s.value.length&&!t.value.useCustomCells?(e.openBlock(),e.createElementBlock("rect",{key:1,x:12,y:12,height:m.value.height-24,width:m.value.width-24,rx:3,fill:"none",stroke:"black"},null,8,et)):s.value.length&&!t.value.useCustomCells?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[l.$slots.pattern?(e.openBlock(),e.createElementBlock("g",tt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(q.value,a=>(e.openBlock(),e.createElementBlock("defs",null,[e.renderSlot(l.$slots,"pattern",e.mergeProps({ref_for:!0},{seriesIndex:a.absoluteIndex,patternId:`pattern_${f.value}_${a.absoluteIndex}`}),void 0,!0)]))),256))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{rx:t.value.style.chart.layout.rect.rounded?t.value.style.chart.layout.rect.rounding:0,x:a.x+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.grid.spaceBetween/2,height:b.value<=0?1e-4:b.value,width:g.value<=0?1e-4:g.value,fill:"white",stroke:t.value.style.chart.layout.rect.stroke,"stroke-width":t.value.style.chart.layout.rect.strokeWidth,filter:I(s.value[r].serieIndex)},null,8,lt))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{rx:t.value.style.chart.layout.rect.rounded?t.value.style.chart.layout.rect.rounding:0,x:a.x+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.grid.spaceBetween/2,height:b.value<=0?1e-4:b.value,width:g.value<=0?1e-4:g.value,fill:t.value.style.chart.layout.rect.useGradient&&t.value.style.chart.layout.rect.gradientIntensity>0?`url(#gradient_${f.value}_${r})`:s.value[r].color,stroke:t.value.style.chart.layout.rect.stroke,"stroke-width":t.value.style.chart.layout.rect.strokeWidth,filter:I(s.value[r].serieIndex)},null,8,at))),256)),l.$slots.pattern?(e.openBlock(),e.createElementBlock("g",ot,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{rx:t.value.style.chart.layout.rect.rounded?t.value.style.chart.layout.rect.rounding:0,x:a.x+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.grid.spaceBetween/2,height:b.value<=0?1e-4:b.value,width:g.value<=0?1e-4:g.value,fill:`url(#pattern_${f.value}_${s.value[r].absoluteIndex})`,stroke:"none",filter:I(s.value[r].serieIndex)},null,8,rt))),256))])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[s.value.length&&!x.value&&!t.value.style.chart.layout.grid.vertical&&t.value.style.chart.layout.labels.captions.show&&(s.value[r].isFirst&&a.position<t.value.style.chart.layout.grid.size-2||s.value[r].isAbsoluteFirst&&r%t.value.style.chart.layout.grid.size===0&&s.value[r].absoluteStartIndex)?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:a.x+t.value.style.chart.layout.labels.captions.offsetX+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.labels.captions.offsetY+t.value.style.chart.layout.grid.spaceBetween/2,height:E.value<=0?1e-4:E.value,width:T.value*t.value.style.chart.layout.grid.size<=0?1e-4:T.value*t.value.style.chart.layout.grid.size,filter:I(s.value[r].serieIndex)},[e.createElementVNode("div",{class:"vue-ui-waffle-caption",style:e.normalizeStyle(`height: 100%; width: 100%; font-size:${t.value.style.chart.layout.labels.captions.fontSize}px;display:flex;align-items:center;justify-content:flex-start;padding: 0 ${T.value/12}px;color:${e.unref(u.adaptColorToBackground)(s.value[r].color)};gap:2px`)},[t.value.style.chart.layout.labels.captions.showSerieName?(e.openBlock(),e.createElementBlock("span",ut,e.toDisplayString(t.value.style.chart.layout.labels.captions.serieNameAbbreviation?e.unref(u.abbreviate)({source:s.value[r].name,length:t.value.style.chart.layout.labels.captions.serieNameMaxAbbreviationSize}):s.value[r].name)+": ",1)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.captions.showPercentage?(e.openBlock(),e.createElementBlock("span",st,e.toDisplayString(e.unref(u.dataLabel)({v:s.value[r].proportion,s:"%",r:t.value.style.chart.layout.labels.captions.roundingPercentage})),1)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.captions.showPercentage&&t.value.style.chart.layout.labels.captions.showValue?(e.openBlock(),e.createElementBlock("span",it," ("+e.toDisplayString(e.unref(u.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,s.value[r].value,e.unref(u.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:s.value[r].value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.layout.labels.captions.roundingValue}),{datapoint:s.value[r],position:a}))+") ",1)):e.createCommentVNode("",!0),!t.value.style.chart.layout.labels.captions.showPercentage&&t.value.style.chart.layout.labels.captions.showValue?(e.openBlock(),e.createElementBlock("span",ct,e.toDisplayString(e.unref(u.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,s.value[r].value,e.unref(u.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:s.value[r].value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.layout.labels.captions.roundingValue}),{datapoint:s.value[r],position:a})),1)):e.createCommentVNode("",!0)],4)],8,nt)):e.createCommentVNode("",!0)],64))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{onMouseover:n=>Pe(r),onMouseleave:o[0]||(o[0]=n=>{O.value=!1,B.value=null}),x:a.x+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.grid.spaceBetween/2,height:E.value<=0?1e-4:E.value,width:T.value<=0?1e-4:T.value,fill:"transparent",stroke:"none"},null,40,vt))),256)),e.renderSlot(l.$slots,"svg",{svg:C.value},void 0,!0)],14,Ye)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",dt,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(ae)||e.unref(oe)})),void 0,!0)])):e.createCommentVNode("",!0),V.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(De.default,{key:6,config:{type:"waffle",style:{backgroundColor:t.value.style.chart.backgroundColor,waffle:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:W},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(Ae.Legend,{key:`legend_${K.value}`,legendSet:S.value,config:Ve.value,onClickMarker:o[1]||(o[1]=({legend:a})=>de(a.uid))},e.createSlots({item:e.withCtx(({legend:a})=>[e.createElementVNode("div",{onClick:r=>a.segregate(),style:e.normalizeStyle(`opacity:${v.value.includes(a.uid)?.5:1}`)},[e.createTextVNode(e.toDisplayString(a.name)+": "+e.toDisplayString(e.unref(u.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,a.value,e.unref(u.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:a.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.legend.roundingValue,isAnimating:x.value}),{datapoint:a}))+" ",1),v.value.includes(a.uid)?(e.openBlock(),e.createElementBlock("span",ft," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",ht," ("+e.toDisplayString(isNaN(a.value/k.value)?"-":e.unref(u.dataLabel)({v:a.value/k.value*100,s:"%",r:t.value.style.chart.legend.roundingPercentage,isAnimating:x.value}))+") ",1))],12,pt)]),_:2},[l.$slots.pattern?{name:"legend-pattern",fn:e.withCtx(({legend:a,index:r})=>[e.createVNode(je._sfc_main,{shape:a.shape,radius:30,stroke:"none",plot:{x:30,y:30},fill:`url(#pattern_${f.value}_${r})`},null,8,["shape","fill"])]),key:"0"}:void 0]),1032,["legendSet","config"])):e.renderSlot(l.$slots,"legend",{key:1,legend:S.value},void 0,!0)],512),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:H,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(ze._sfc_main,{show:y.value.showTooltip&&O.value&&v.value.length<p.dataset.length,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:N.value,content:A.value,isCustom:t.value.style.chart.tooltip.customFormat&&typeof t.value.style.chart.tooltip.customFormat=="function",fontSize:t.value.style.chart.tooltip.fontSize,isFullscreen:$.value},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...M.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...M.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isCustom","fontSize","isFullscreen"]),V.value?(e.openBlock(),e.createBlock(qe.default,{key:8,hideDetails:"",config:{open:y.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(Oe.DataTable,{key:`table_${J.value}`,colNames:F.value.colNames,head:F.value.head,body:F.value.body,config:F.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:o[2]||(o[2]=a=>y.value.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createElementVNode("div",{innerHTML:a,style:{display:"flex","align-items":"center"}},null,8,yt)]),td:e.withCtx(({td:a})=>[e.createTextVNode(e.toDisplayString(a.name||a),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,He))}},gt=We._export_sfc(mt,[["__scopeId","data-v-b3044eda"]]);exports.default=gt;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-C2dCPlLw.cjs"),ye=require("./useResponsive-DQmBAoBf.cjs"),Fe=require("./Title-s-4wtmyf.cjs"),me=require("./usePrinter-B7OpKMf9.cjs"),ze=require("./Tooltip-Br3lB3d1.cjs"),Oe=require("./DataTable-DEFs-EaT.cjs"),Ae=require("./Legend-BrWxrvx1.cjs"),De=require("./vue-ui-skeleton-CfkVGDBV.cjs"),qe=require("./vue-ui-accordion-CEJghMx7.cjs"),ge=require("./useNestedProp-Coe_9w4h.cjs"),Me=require("./PackageVersion-CX5-lR_7.cjs"),Re=require("./PenAndPaper-mo5_icjt.cjs"),Ue=require("./useUserOptionState-BgepsfED.cjs"),je=require("./Shape-DNTuLHYt.cjs"),Ge=require("./useChartAccessibility-Cm7nkzTG.cjs"),We=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),He=["id"],Ye=["xmlns","viewBox"],Xe=["id"],Je=["stop-color"],Ke=["stop-color"],Qe=["id"],Ze=["x","y","height","width"],et=["height","width"],tt={key:0},lt=["rx","x","y","height","width","stroke","stroke-width","filter"],at=["rx","x","y","height","width","fill","stroke","stroke-width","filter"],ot={key:1},rt=["rx","x","y","height","width","fill","filter"],nt=["x","y","height","width","filter"],ut={key:0},st={key:1},it={key:2},ct={key:3},vt=["onMouseover","x","y","height","width"],dt={key:5,class:"vue-data-ui-watermark"},pt=["onClick"],ht={key:0},ft={key:1},yt=["innerHTML"],mt={__name:"vue-ui-waffle",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(be,{expose:ke,emit:we}){const{vue_ui_waffle:Ce}=u.useConfig(),p=be,xe=e.useSlots(),V=e.computed(()=>!!p.dataset&&p.dataset.length),f=e.ref(u.createUid()),Be=e.ref(null),O=e.ref(!1),A=e.ref(""),B=e.ref(null),j=e.ref(0),N=e.ref(null),G=e.ref(null),W=e.ref(null),H=e.ref(null),Y=e.ref(null),X=e.ref(0),J=e.ref(0),K=e.ref(0),t=e.computed({get:()=>te(),set:l=>l}),{userOptionsVisible:D,setUserOptionsVisibility:Q,keepUserOptionState:Z}=Ue.useUserOptionState({config:t.value}),{svgRef:ee}=Ge.useChartAccessibility({config:t.value.style.chart.title});function te(){const l=ge.useNestedProp({userConfig:p.config,defaultConfig:Ce});return l.theme?{...ge.useNestedProp({userConfig:u.themes.vue_ui_waffle[l.theme]||p.config,defaultConfig:l}),customPalette:u.themePalettes[l.theme]||u.palette}:l}e.watch(()=>p.config,l=>{t.value=te(),D.value=!t.value.userOptions.showOnChartHover,le(),X.value+=1,J.value+=1,K.value+=1,y.value.showTable=t.value.table.show,y.value.showTooltip=t.value.style.chart.tooltip.show},{deep:!0});const P=e.ref(null);function le(){if(u.objectIsEmpty(p.dataset)?u.error({componentName:"VueUiWaffle",type:"dataset"}):p.dataset.forEach((l,o)=>{u.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(a=>{u.error({componentName:"VueUiWaffle",type:"datasetSerieAttribute",property:a,index:o})})}),t.value.responsive){const l=ye.throttle(()=>{const{width:o,height:a}=ye.useResponsive({chart:N.value,title:t.value.style.chart.title.text?G.value:null,legend:t.value.style.chart.legend.show?W.value:null,source:H.value,noTitle:Y.value});requestAnimationFrame(()=>{C.value.width=o,C.value.height=a,m.value.width=o,m.value.height=a})});P.value=new ResizeObserver(l),P.value.observe(N.value.parentNode)}}e.onMounted(()=>{le()}),e.onBeforeUnmount(()=>{P.value&&P.value.disconnect()});const{isPrinting:ae,isImaging:oe,generatePdf:re,generateImage:ne}=me.usePrinter({elementId:`vue-ui-waffle_${f.value}`,fileName:t.value.style.chart.title.text||"vue-ui-waffle",options:t.value.userOptions.print}),_e=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),ue=e.computed(()=>u.convertCustomPalette(t.value.customPalette)),y=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),C=e.ref({height:512,width:512}),m=e.ref({top:0,left:0,height:512,width:512}),g=e.computed(()=>(m.value.width-t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.spaceBetween)/t.value.style.chart.layout.grid.size),b=e.computed(()=>(m.value.height-t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.spaceBetween)/t.value.style.chart.layout.grid.size),T=e.computed(()=>m.value.width/t.value.style.chart.layout.grid.size),E=e.computed(()=>m.value.height/t.value.style.chart.layout.grid.size);function se(l){const o=t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.size,a=l.reduce((h,U)=>h+U,0),r=l.map(h=>h/a*o),n=r.map(Math.floor),i=r.map(h=>h%1);let d=o-n.reduce((h,U)=>h+U,0);for(;d>0;){let h=i.indexOf(Math.max(...i));n[h]+=1,i[h]=0,d-=1}return n}function ie(){return p.dataset.map((l,o)=>({...l,color:u.convertColorToHex(l.color)||ue.value[o]||u.palette[o]||u.palette[o%u.palette.length],uid:`serie_${o}`,absoluteIndex:o}))}const q=e.computed(()=>ie()),c=e.ref(q.value);e.watch(()=>p.dataset,l=>{c.value=ie()},{deep:!0});const Se=e.computed(()=>{const l=c.value.filter((o,a)=>!v.value.includes(o.uid)).map((o,a)=>(o.values||[]).reduce((r,n)=>r+n,0));return se(l)}),$e=e.computed(()=>{const l=c.value.map((o,a)=>(o.values||[]).reduce((r,n)=>r+n));return se(l)}),L=e.computed(()=>(p.dataset.forEach((l,o)=>{[null,void 0].includes(l.values)&&u.error({componentName:"VueUiWaffle",type:"datasetSerieAttribute",property:"values (number[])",index:o})}),c.value.filter((l,o)=>!v.value.includes(l.uid)).map((l,o)=>({absoluteIndex:l.absoluteIndex,uid:l.uid,name:l.name,color:l.color,value:(l.values||[]).reduce((a,r)=>a+r,0),absoluteValues:l.values||[],proportion:Se.value[o]})))),Ne=e.computed(()=>c.value.map((l,o)=>({absoluteIndex:l.absoluteIndex,uid:l.uid,name:l.name,color:l.color,value:(l.values||[]).reduce((a,r)=>a+r,0),absoluteValues:l.values||[],proportion:$e.value[o]})));function Te(){return Ne.value.map(l=>({name:l.name,color:l.color,value:l.value,proportion:l.proportion}))}const Le=e.computed(()=>{let l=0;return L.value.map((o,a)=>{const r=l,n=r+o.proportion,i=[];for(let d=Math.floor(r);d<Math.floor(n);d+=1)i.push(d);return l=n,{...o,start:r,rects:i}})}),s=e.computed(()=>Le.value.flatMap((l,o)=>l.rects.map((a,r)=>({isFirst:r===0,isLongEnough:a.length>2,name:l.name,color:l.color,value:l.value,serieIndex:o,absoluteStartIndex:r<3,serieId:l.uid,...l}))).map((l,o)=>({...l,isAbsoluteFirst:o%t.value.style.chart.layout.grid.size===0}))),_=e.computed(()=>{const l=[];for(let o=0;o<t.value.style.chart.layout.grid.size;o+=1)for(let a=0;a<t.value.style.chart.layout.grid.size;a+=1)l.push({isStartOfLine:a===0,position:t.value.style.chart.layout.grid.vertical?o:a,x:(t.value.style.chart.layout.grid.vertical?o:a)*(g.value+t.value.style.chart.layout.grid.spaceBetween),y:(t.value.style.chart.layout.grid.vertical?a:o)*(b.value+t.value.style.chart.layout.grid.spaceBetween)+m.value.top});return l}),v=e.ref([]),x=e.ref(!1),ce=e.ref(null),ve=e.ref(null);function de(l){if(!t.value.useAnimation){v.value.includes(l)?v.value=v.value.filter(n=>n!==l):v.value.length<S.value.length-1&&S.value.length>1&&v.value.push(l);return}const o=q.value.find(n=>n.uid===l).values.reduce((n,i)=>n+i,0),a=c.value.find(n=>n.uid===l).values.reduce((n,i)=>n+i,0);let r=a;if(v.value.includes(l)){let i=function(){r>n?(cancelAnimationFrame(ce.value),c.value=c.value.map((d,h)=>d.uid===l?{...d,values:[n]}:d),x.value=!1):(x.value=!0,r+=n*.025,c.value=c.value.map((d,h)=>d.uid===l?{...d,values:[r]}:d),ce.value=requestAnimationFrame(i))};v.value=v.value.filter(d=>d!==l);const n=o;i()}else if(v.value.length<S.value.length-1&&S.value.length>1){let n=function(){r<a/100?(cancelAnimationFrame(ve.value),v.value.push(l),c.value=c.value.map((i,d)=>i.uid===l?{...i,values:[0]}:i),x.value=!1):(x.value=!0,r/=1.15,c.value=c.value.map(i=>i.uid===l?{...i,values:[r]}:i),ve.value=requestAnimationFrame(n))};n()}Ee("selectLegend",L.value.map(n=>({name:n.name,color:n.color,value:n.value,proportion:n.proportion/Math.pow(t.value.style.chart.layout.grid.size,2)})))}const S=e.computed(()=>c.value.map((l,o)=>({name:l.name,color:l.color||ue[o]||u.palette[o]||u.palette[o%u.palette.length],value:(l.values||[]).reduce((a,r)=>a+r,0),uid:l.uid,shape:"square"})).map(l=>({...l,proportion:l.value/c.value.map(o=>(o.values||[]).reduce((a,r)=>a+r,0)).reduce((o,a)=>o+a,0),opacity:v.value.includes(l.uid)?.5:1,segregate:()=>de(l.uid),isSegregated:v.value.includes(l.uid)}))),Ve=e.computed(()=>({cy:"waffle-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),k=e.computed(()=>L.value.map(l=>l.value).reduce((l,o)=>l+o,0)),M=e.ref(null);function Pe(l){if(v.value.length===p.dataset.length)return;const o=s.value[l];M.value={datapoint:o,seriesIndex:o.absoluteIndex,series:c.value,config:t.value},O.value=!0,B.value=s.value[l].serieIndex;const a=t.value.style.chart.tooltip.customFormat;if(u.isFunction(a)&&u.functionReturnsString(()=>a({seriesIndex:s.value[l].absoluteIndex,datapoint:o,series:c.value,config:t.value})))A.value=a({seriesIndex:s.value[l].absoluteIndex,datapoint:o,series:c.value,config:t.value});else{let r="";if(r+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${o.name}</div>`,r+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 60 60" height="14" width="14"><rect x="0" y="0" height="60" width="60" stroke="none" rx="1" fill="${o.color}" />${xe.pattern?`<rect x="0" y="0" height="60" width="60" stroke="none" rx="1" stroke="none" fill="url(#pattern_${f.value}_${o.absoluteIndex})"/>`:""}</svg>`,t.value.style.chart.tooltip.showValue&&(r+=`<b>${u.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,o.value,u.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:o.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:o,seriesIndex:s.value[l].absoluteIndex,series:c.value})}</b>`),t.value.style.chart.tooltip.showPercentage){const n=u.dataLabel({v:o.value/k.value*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage});t.value.style.chart.tooltip.showValue?r+=`<span>(${n})</span></div>`:r+=`<b>${n}%</b></div>`}A.value=r}}const Ee=we,w=e.computed(()=>{const l=L.value.map(a=>({name:a.name,color:a.color})),o=L.value.map(a=>a.value);return{head:l,body:o}});function I(l){return t.value.useBlurOnHover&&![null,void 0].includes(B.value)&&B.value!==l?`url(#blur_${f.value})`:""}function pe(){e.nextTick(()=>{const l=w.value.head.map((r,n)=>[[r.name],[w.value.body[n]],[isNaN(w.value.body[n]/k.value)?"-":w.value.body[n]/k.value*100]]),o=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(l),a=u.createCsvContent(o);u.downloadCsv({csvContent:a,title:t.value.style.chart.title.text||"vue-ui-waffle"})})}const F=e.computed(()=>{const l=[' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>',u.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,k.value,u.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:k.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue})),"100%"],o=w.value.head.map((n,i)=>[{color:n.color,name:n.name},u.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,w.value.body[i],u.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:w.value.body[i],s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue})),isNaN(w.value.body[i]/k.value)?"-":u.dataLabel({v:w.value.body[i]/k.value*100,s:"%",r:t.value.table.td.roundingPercentage})]),a={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},shape:"square",breakpoint:t.value.table.responsiveBreakpoint},r=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage];return{head:l,body:o,config:a,colNames:r}}),$=e.ref(!1);function Ie(l){$.value=l,j.value+=1}function he(){y.value.showTable=!y.value.showTable}function fe(){y.value.showTooltip=!y.value.showTooltip}const z=e.ref(!1);function R(){z.value=!z.value}return ke({getData:Te,generatePdf:re,generateCsv:pe,generateImage:ne,toggleTable:he,toggleTooltip:fe,toggleAnnotator:R}),(l,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-waffle ${$.value?"vue-data-ui-wrapper-fullscreen":""}`),ref_key:"waffleChart",ref:N,id:`vue-ui-waffle_${f.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height: 100%":""}`),onMouseenter:o[3]||(o[3]=()=>e.unref(Q)(!0)),onMouseleave:o[4]||(o[4]=()=>e.unref(Q)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Re._sfc_main,{key:0,svgRef:e.unref(ee),backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:z.value,onClose:R},null,8,["svgRef","backgroundColor","color","active"])):e.createCommentVNode("",!0),_e.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:Y,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:G,style:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(Fe._sfc_main,{key:`title_${X.value}`,config:{title:{cy:"waffle-title",...t.value.style.chart.title},subtitle:{cy:"waffle-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&V.value&&(e.unref(Z)||e.unref(D))?(e.openBlock(),e.createBlock(me.UserOptions,{ref_key:"details",ref:Be,key:`user_options_${j.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(ae),isImaging:e.unref(oe),uid:f.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:$.value,isTooltip:y.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:N.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:z.value,onToggleFullscreen:Ie,onGeneratePdf:e.unref(re),onGenerateCsv:pe,onGenerateImage:e.unref(ne),onToggleTable:he,onToggleTooltip:fe,onToggleAnnotator:R,style:e.normalizeStyle({visibility:e.unref(Z)?e.unref(D)?"visible":"hidden":"visible"})},e.createSlots({_:2},[l.$slots.menuIcon?{name:"menuIcon",fn:e.withCtx(({isOpen:a,color:r})=>[e.renderSlot(l.$slots,"menuIcon",e.normalizeProps(e.guardReactiveProps({isOpen:a,color:r})),void 0,!0)]),key:"0"}:void 0,l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"5"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:r})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:r})),void 0,!0)]),key:"6"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:a,isAnnotator:r})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:a,isAnnotator:r})),void 0,!0)]),key:"7"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),V.value?(e.openBlock(),e.createElementBlock("svg",{key:4,ref_key:"svgRef",ref:ee,xmlns:e.unref(u.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":$.value,"vue-data-ui-fulscreen--off":!$.value}),viewBox:`0 0 ${C.value.width<=0?10:C.value.width} ${C.value.height<=0?10:C.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Me._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(a,r)=>(e.openBlock(),e.createElementBlock("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`gradient_${f.value}_${r}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(u.setOpacity)(e.unref(u.shiftHue)(a.color,.05),100-t.value.style.chart.layout.rect.gradientIntensity)},null,8,Je),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,Ke)],8,Xe))),256))]),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${f.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},o[5]||(o[5]=[e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:2},null,-1),e.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1)]),8,Qe)]),t.value.useCustomCells&&s.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(_.value,(a,r)=>(e.openBlock(),e.createElementBlock("foreignObject",{x:a.x,y:a.y,height:b.value<=0?1e-4:b.value,width:g.value<=0?1e-4:g.value,class:"vue-ui-waffle-custom-cell-foreignObject"},[e.renderSlot(l.$slots,"cell",e.mergeProps({ref_for:!0},{cell:{...a,color:s.value[r].color,...s.value[r]},isSelected:[null,void 0].includes(B.value)?!0:s.value[r].serieIndex===B.value}),void 0,!0)],8,Ze))),256)):e.createCommentVNode("",!0),!s.value.length&&!t.value.useCustomCells?(e.openBlock(),e.createElementBlock("rect",{key:1,x:12,y:12,height:m.value.height-24,width:m.value.width-24,rx:3,fill:"none",stroke:"black"},null,8,et)):s.value.length&&!t.value.useCustomCells?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[l.$slots.pattern?(e.openBlock(),e.createElementBlock("g",tt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(q.value,a=>(e.openBlock(),e.createElementBlock("defs",null,[e.renderSlot(l.$slots,"pattern",e.mergeProps({ref_for:!0},{seriesIndex:a.absoluteIndex,patternId:`pattern_${f.value}_${a.absoluteIndex}`}),void 0,!0)]))),256))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{rx:t.value.style.chart.layout.rect.rounded?t.value.style.chart.layout.rect.rounding:0,x:a.x+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.grid.spaceBetween/2,height:b.value<=0?1e-4:b.value,width:g.value<=0?1e-4:g.value,fill:"white",stroke:t.value.style.chart.layout.rect.stroke,"stroke-width":t.value.style.chart.layout.rect.strokeWidth,filter:I(s.value[r].serieIndex)},null,8,lt))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{rx:t.value.style.chart.layout.rect.rounded?t.value.style.chart.layout.rect.rounding:0,x:a.x+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.grid.spaceBetween/2,height:b.value<=0?1e-4:b.value,width:g.value<=0?1e-4:g.value,fill:t.value.style.chart.layout.rect.useGradient&&t.value.style.chart.layout.rect.gradientIntensity>0?`url(#gradient_${f.value}_${r})`:s.value[r].color,stroke:t.value.style.chart.layout.rect.stroke,"stroke-width":t.value.style.chart.layout.rect.strokeWidth,filter:I(s.value[r].serieIndex)},null,8,at))),256)),l.$slots.pattern?(e.openBlock(),e.createElementBlock("g",ot,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{rx:t.value.style.chart.layout.rect.rounded?t.value.style.chart.layout.rect.rounding:0,x:a.x+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.grid.spaceBetween/2,height:b.value<=0?1e-4:b.value,width:g.value<=0?1e-4:g.value,fill:`url(#pattern_${f.value}_${s.value[r].absoluteIndex})`,stroke:"none",filter:I(s.value[r].serieIndex)},null,8,rt))),256))])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[s.value.length&&!x.value&&!t.value.style.chart.layout.grid.vertical&&t.value.style.chart.layout.labels.captions.show&&(s.value[r].isFirst&&a.position<t.value.style.chart.layout.grid.size-2||s.value[r].isAbsoluteFirst&&r%t.value.style.chart.layout.grid.size===0&&s.value[r].absoluteStartIndex)?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:a.x+t.value.style.chart.layout.labels.captions.offsetX+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.labels.captions.offsetY+t.value.style.chart.layout.grid.spaceBetween/2,height:E.value<=0?1e-4:E.value,width:T.value*t.value.style.chart.layout.grid.size<=0?1e-4:T.value*t.value.style.chart.layout.grid.size,filter:I(s.value[r].serieIndex)},[e.createElementVNode("div",{class:"vue-ui-waffle-caption",style:e.normalizeStyle(`height: 100%; width: 100%; font-size:${t.value.style.chart.layout.labels.captions.fontSize}px;display:flex;align-items:center;justify-content:flex-start;padding: 0 ${T.value/12}px;color:${e.unref(u.adaptColorToBackground)(s.value[r].color)};gap:2px`)},[t.value.style.chart.layout.labels.captions.showSerieName?(e.openBlock(),e.createElementBlock("span",ut,e.toDisplayString(t.value.style.chart.layout.labels.captions.serieNameAbbreviation?e.unref(u.abbreviate)({source:s.value[r].name,length:t.value.style.chart.layout.labels.captions.serieNameMaxAbbreviationSize}):s.value[r].name)+": ",1)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.captions.showPercentage?(e.openBlock(),e.createElementBlock("span",st,e.toDisplayString(e.unref(u.dataLabel)({v:s.value[r].proportion,s:"%",r:t.value.style.chart.layout.labels.captions.roundingPercentage})),1)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.captions.showPercentage&&t.value.style.chart.layout.labels.captions.showValue?(e.openBlock(),e.createElementBlock("span",it," ("+e.toDisplayString(e.unref(u.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,s.value[r].value,e.unref(u.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:s.value[r].value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.layout.labels.captions.roundingValue}),{datapoint:s.value[r],position:a}))+") ",1)):e.createCommentVNode("",!0),!t.value.style.chart.layout.labels.captions.showPercentage&&t.value.style.chart.layout.labels.captions.showValue?(e.openBlock(),e.createElementBlock("span",ct,e.toDisplayString(e.unref(u.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,s.value[r].value,e.unref(u.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:s.value[r].value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.layout.labels.captions.roundingValue}),{datapoint:s.value[r],position:a})),1)):e.createCommentVNode("",!0)],4)],8,nt)):e.createCommentVNode("",!0)],64))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{onMouseover:n=>Pe(r),onMouseleave:o[0]||(o[0]=n=>{O.value=!1,B.value=null}),x:a.x+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.grid.spaceBetween/2,height:E.value<=0?1e-4:E.value,width:T.value<=0?1e-4:T.value,fill:"transparent",stroke:"none"},null,40,vt))),256)),e.renderSlot(l.$slots,"svg",{svg:C.value},void 0,!0)],14,Ye)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",dt,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(ae)||e.unref(oe)})),void 0,!0)])):e.createCommentVNode("",!0),V.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(De.default,{key:6,config:{type:"waffle",style:{backgroundColor:t.value.style.chart.backgroundColor,waffle:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:W},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(Ae.Legend,{key:`legend_${K.value}`,legendSet:S.value,config:Ve.value,onClickMarker:o[1]||(o[1]=({legend:a})=>de(a.uid))},e.createSlots({item:e.withCtx(({legend:a})=>[e.createElementVNode("div",{onClick:r=>a.segregate(),style:e.normalizeStyle(`opacity:${v.value.includes(a.uid)?.5:1}`)},[e.createTextVNode(e.toDisplayString(a.name)+": "+e.toDisplayString(e.unref(u.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,a.value,e.unref(u.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:a.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.legend.roundingValue,isAnimating:x.value}),{datapoint:a}))+" ",1),v.value.includes(a.uid)?(e.openBlock(),e.createElementBlock("span",ft," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",ht," ("+e.toDisplayString(isNaN(a.value/k.value)?"-":e.unref(u.dataLabel)({v:a.value/k.value*100,s:"%",r:t.value.style.chart.legend.roundingPercentage,isAnimating:x.value}))+") ",1))],12,pt)]),_:2},[l.$slots.pattern?{name:"legend-pattern",fn:e.withCtx(({legend:a,index:r})=>[e.createVNode(je._sfc_main,{shape:a.shape,radius:30,stroke:"none",plot:{x:30,y:30},fill:`url(#pattern_${f.value}_${r})`},null,8,["shape","fill"])]),key:"0"}:void 0]),1032,["legendSet","config"])):e.renderSlot(l.$slots,"legend",{key:1,legend:S.value},void 0,!0)],512),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:H,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(ze._sfc_main,{show:y.value.showTooltip&&O.value&&v.value.length<p.dataset.length,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:N.value,content:A.value,isCustom:t.value.style.chart.tooltip.customFormat&&typeof t.value.style.chart.tooltip.customFormat=="function",fontSize:t.value.style.chart.tooltip.fontSize,isFullscreen:$.value},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...M.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...M.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isCustom","fontSize","isFullscreen"]),V.value?(e.openBlock(),e.createBlock(qe.default,{key:8,hideDetails:"",config:{open:y.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(Oe.DataTable,{key:`table_${J.value}`,colNames:F.value.colNames,head:F.value.head,body:F.value.body,config:F.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:o[2]||(o[2]=a=>y.value.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createElementVNode("div",{innerHTML:a,style:{display:"flex","align-items":"center"}},null,8,yt)]),td:e.withCtx(({td:a})=>[e.createTextVNode(e.toDisplayString(a.name||a),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,He))}},gt=We._export_sfc(mt,[["__scopeId","data-v-b3044eda"]]);exports.default=gt;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),i=require("./index-B8vOvwaf.cjs"),Q=require("./Title-BqVhWQj9.cjs"),R=require("./usePrinter-Bi6GyL7Z.cjs"),V=require("./useResponsive-DQmBAoBf.cjs"),Z=require("./vue-ui-skeleton-Du-JZESo.cjs"),U=require("./useNestedProp-C4sQAs2T.cjs"),ee=require("./PackageVersion-D22bJIIL.cjs"),te=require("./PenAndPaper-DQgGlIFz.cjs"),le=require("./useUserOptionState-BgepsfED.cjs"),oe=require("./useChartAccessibility-Cm7nkzTG.cjs"),ne=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ae=["id"],re=["xmlns","viewBox"],se=["width","height"],ue=["x1","x2","y1","y2","stroke","stroke-width","stroke-linecap"],ie=["d","fill"],ce=["cx","cy","r","stroke","stroke-width"],ve=["x","y","font-size","fill","font-weight"],de={key:5,class:"vue-data-ui-watermark"},he={__name:"vue-ui-wheel",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(L,{expose:X}){const{vue_ui_wheel:j}=i.useConfig(),c=L,m=e.computed(()=>!!c.dataset&&Object.keys(c.dataset).length),g=e.ref(i.createUid()),G=e.ref(null),b=e.ref(0),d=e.ref(null),B=e.ref(null),P=e.ref(null),S=e.ref(null),_=e.ref(0),t=e.computed({get:()=>$(),set:l=>l}),{userOptionsVisible:k,setUserOptionsVisibility:O,keepUserOptionState:N}=le.useUserOptionState({config:t.value}),{svgRef:x}=oe.useChartAccessibility({config:t.value.style.chart.title});function $(){const l=U.useNestedProp({userConfig:c.config,defaultConfig:j});return l.theme?{...U.useNestedProp({userConfig:i.themes.vue_ui_wheel[l.theme]||c.config,defaultConfig:l})}:l}e.watch(()=>c.config,l=>{t.value=$(),k.value=!t.value.userOptions.showOnChartHover,M(),_.value+=1},{deep:!0});const{isPrinting:I,isImaging:z,generatePdf:A,generateImage:F}=R.usePrinter({elementId:g.value,fileName:t.value.style.chart.title.text||"vue-ui-wheel",options:t.value.userOptions.print}),H=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),n=e.ref({size:360,height:360,width:360}),w=e.ref(t.value.style.chart.layout.percentage.fontSize),r=e.computed(()=>({radius:Math.min(n.value.width,n.value.height)*.9/2,centerX:n.value.width/2,centerY:n.value.height/2}));function E(l,a=1){return{x:r.value.centerX+r.value.radius*Math.cos(29.85+l*Math.PI/180)*a,y:r.value.centerY+r.value.radius*Math.sin(29.85+l*Math.PI/180)*a}}const s=e.ref(t.value.style.chart.animation.use?0:c.dataset.percentage||0);e.watch(()=>c.dataset,l=>{t.value.style.chart.animation.use?T(l.percentage):s.value=l.percentage||0},{deep:!0});const h=e.ref(null);e.onMounted(()=>{M()});function M(){if(i.objectIsEmpty(c.dataset)&&i.error({componentName:"VueUiWheel",type:"dataset"}),T(c.dataset.percentage||0),t.value.responsive){const l=V.throttle(()=>{const{width:a,height:o}=V.useResponsive({chart:d.value,title:t.value.style.chart.title.text?B.value:null,source:P.value,noTitle:S.value});requestAnimationFrame(()=>{n.value.width=a,n.value.height=o,w.value=t.value.style.chart.layout.percentage.fontSize/360*Math.min(a,o)})});h.value=new ResizeObserver(l),h.value.observe(d.value.parentNode)}}e.onBeforeUnmount(()=>{h.value&&h.value.disconnect()});function T(l){let a=t.value.style.chart.animation.speed;const o=Math.abs(l-s.value)/(a*120);function u(){s.value<l?s.value=Math.min(s.value+o,l):s.value>l&&(s.value=Math.max(s.value-o,l)),s.value!==l&&requestAnimationFrame(u)}u()}const v=e.computed(()=>Math.max(100,t.value.style.chart.layout.wheel.ticks.quantity)),f=e.computed(()=>100/v.value),q=e.computed(()=>{const l=[];for(let a=0;a<v.value;a+=1){const o=s.value>a*f.value?t.value.style.chart.layout.wheel.ticks.activeColor:t.value.style.chart.layout.wheel.ticks.inactiveColor,{x:u,y:W}=E(n.value.size/v.value*a),{x:J,y:K}=E(n.value.size/v.value*a,t.value.style.chart.layout.wheel.ticks.sizeRatio);l.push({x1:u,y1:W,x2:J,y2:K,color:t.value.style.chart.layout.wheel.ticks.gradient.show?i.shiftHue(o,a*f.value/v.value*(t.value.style.chart.layout.wheel.ticks.gradient.shiftHueIntensity/100)):o})}return l}),D=e.computed(()=>i.makeDonut({series:q.value.map(l=>({name:"",value:1,color:l.color}))},r.value.centerX,r.value.centerY,r.value.radius,r.value.radius,1.99999,2,1,360,105.25,r.value.radius*(1-t.value.style.chart.layout.wheel.ticks.sizeRatio))),y=e.ref(!1);function Y(l){y.value=l,b.value+=1}const p=e.ref(!1);function C(){p.value=!p.value}return X({generatePdf:A,generateImage:F,toggleAnnotator:C}),(l,a)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-wheel",ref_key:"wheelChart",ref:d,id:g.value,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height:100%":""}`),onMouseenter:a[0]||(a[0]=()=>e.unref(O)(!0)),onMouseleave:a[1]||(a[1]=()=>e.unref(O)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(te._sfc_main,{key:0,svgRef:e.unref(x),backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:p.value,onClose:C},null,8,["svgRef","backgroundColor","color","active"])):e.createCommentVNode("",!0),H.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:S,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:B,style:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(Q._sfc_main,{key:`title_${_.value}`,config:{title:{cy:"wheel-title",...t.value.style.chart.title},subtitle:{cy:"wheel-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&m.value&&(e.unref(N)||e.unref(k))?(e.openBlock(),e.createBlock(R.UserOptions,{ref_key:"details",ref:G,key:`user_options_${b.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(I),isImaging:e.unref(z),uid:g.value,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,hasXls:!1,isFullscreen:y.value,position:t.value.userOptions.position,titles:{...t.value.userOptions.buttonTitles},hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:p.value,chartElement:d.value,onToggleFullscreen:Y,onGeneratePdf:e.unref(A),onGenerateImage:e.unref(F),onToggleAnnotator:C,style:e.normalizeStyle({visibility:e.unref(N)?e.unref(k)?"visible":"hidden":"visible"})},e.createSlots({_:2},[l.$slots.menuIcon?{name:"menuIcon",fn:e.withCtx(({isOpen:o,color:u})=>[e.renderSlot(l.$slots,"menuIcon",e.normalizeProps(e.guardReactiveProps({isOpen:o,color:u})),void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:u})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:u})),void 0,!0)]),key:"3"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:u})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:u})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","position","titles","hasAnnotator","isAnnotation","chartElement","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),m.value?(e.openBlock(),e.createElementBlock("svg",{key:4,ref_key:"svgRef",ref:x,xmlns:e.unref(i.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":y.value,"vue-data-ui-fulscreen--off":!y.value}),viewBox:`0 0 ${n.value.width<=0?10:n.value.width} ${n.value.height<=0?10:n.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(ee._sfc_main),l.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:n.value.width<=0?10:n.value.width,height:n.value.height<=0?10:n.value.height,style:{pointerEvents:"none"}},[e.renderSlot(l.$slots,"chart-background",{},void 0,!0)],8,se)):e.createCommentVNode("",!0),t.value.style.chart.layout.wheel.ticks.type==="classic"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(q.value,(o,u)=>(e.openBlock(),e.createElementBlock("line",{x1:o.x1,x2:o.x2,y1:o.y1,y2:o.y2,stroke:o.color,"stroke-width":t.value.style.chart.layout.wheel.ticks.strokeWidth/360*Math.min(n.value.width,n.value.height),"stroke-linecap":t.value.style.chart.layout.wheel.ticks.rounded?"round":"butt",class:e.normalizeClass({"vue-ui-tick-animated":t.value.style.chart.animation.use&&u*f.value<=s.value})},null,10,ue))),256)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(D.value,(o,u)=>(e.openBlock(),e.createElementBlock("path",{d:o.arcSlice,fill:o.color,class:e.normalizeClass({"vue-ui-tick-animated":t.value.style.chart.animation.use&&u*f.value<=s.value})},null,10,ie))),256)),t.value.style.chart.layout.innerCircle.show?(e.openBlock(),e.createElementBlock("circle",{key:3,cx:r.value.centerX,cy:r.value.centerY,r:r.value.radius*.8<=0?1e-4:r.value.radius*.8,stroke:t.value.style.chart.layout.innerCircle.stroke,"stroke-width":t.value.style.chart.layout.innerCircle.strokeWidth,fill:"none"},null,8,ce)):e.createCommentVNode("",!0),t.value.style.chart.layout.percentage.show?(e.openBlock(),e.createElementBlock("text",{key:4,x:r.value.centerX,y:r.value.centerY+w.value/3,"font-size":w.value,fill:t.value.style.chart.layout.wheel.ticks.gradient.show?e.unref(i.shiftHue)(t.value.style.chart.layout.wheel.ticks.activeColor,s.value/100*(t.value.style.chart.layout.wheel.ticks.gradient.shiftHueIntensity/100)):t.value.style.chart.layout.wheel.ticks.activeColor,"text-anchor":"middle","font-weight":t.value.style.chart.layout.percentage.bold?"bold":"normal",style:{"font-variant-numeric":"tabluar-nums"}},e.toDisplayString(e.unref(i.applyDataLabel)(t.value.style.chart.layout.percentage.formatter,e.unref(i.checkNaN)(s.value),e.unref(i.dataLabel)({v:e.unref(i.checkNaN)(s.value),s:"%",r:t.value.style.chart.layout.percentage.rounding}))),9,ve)):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"svg",{svg:n.value},void 0,!0)],14,re)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",de,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(I)||e.unref(z)})),void 0,!0)])):e.createCommentVNode("",!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:6,ref_key:"source",ref:P,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),m.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Z.default,{key:7,config:{type:"wheel",style:{backgroundColor:t.value.style.chart.backgroundColor,wheel:{color:"#CCCCCC"}}}},null,8,["config"]))],44,ae))}},fe=ne._export_sfc(he,[["__scopeId","data-v-0ab72261"]]);exports.default=fe;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),i=require("./index-C2dCPlLw.cjs"),Q=require("./Title-s-4wtmyf.cjs"),R=require("./usePrinter-B7OpKMf9.cjs"),V=require("./useResponsive-DQmBAoBf.cjs"),Z=require("./vue-ui-skeleton-CfkVGDBV.cjs"),U=require("./useNestedProp-Coe_9w4h.cjs"),ee=require("./PackageVersion-CX5-lR_7.cjs"),te=require("./PenAndPaper-mo5_icjt.cjs"),le=require("./useUserOptionState-BgepsfED.cjs"),oe=require("./useChartAccessibility-Cm7nkzTG.cjs"),ne=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ae=["id"],re=["xmlns","viewBox"],se=["width","height"],ue=["x1","x2","y1","y2","stroke","stroke-width","stroke-linecap"],ie=["d","fill"],ce=["cx","cy","r","stroke","stroke-width"],ve=["x","y","font-size","fill","font-weight"],de={key:5,class:"vue-data-ui-watermark"},he={__name:"vue-ui-wheel",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(L,{expose:X}){const{vue_ui_wheel:j}=i.useConfig(),c=L,m=e.computed(()=>!!c.dataset&&Object.keys(c.dataset).length),g=e.ref(i.createUid()),G=e.ref(null),b=e.ref(0),d=e.ref(null),B=e.ref(null),P=e.ref(null),S=e.ref(null),_=e.ref(0),t=e.computed({get:()=>$(),set:l=>l}),{userOptionsVisible:k,setUserOptionsVisibility:O,keepUserOptionState:N}=le.useUserOptionState({config:t.value}),{svgRef:x}=oe.useChartAccessibility({config:t.value.style.chart.title});function $(){const l=U.useNestedProp({userConfig:c.config,defaultConfig:j});return l.theme?{...U.useNestedProp({userConfig:i.themes.vue_ui_wheel[l.theme]||c.config,defaultConfig:l})}:l}e.watch(()=>c.config,l=>{t.value=$(),k.value=!t.value.userOptions.showOnChartHover,M(),_.value+=1},{deep:!0});const{isPrinting:I,isImaging:z,generatePdf:A,generateImage:F}=R.usePrinter({elementId:g.value,fileName:t.value.style.chart.title.text||"vue-ui-wheel",options:t.value.userOptions.print}),H=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),n=e.ref({size:360,height:360,width:360}),w=e.ref(t.value.style.chart.layout.percentage.fontSize),r=e.computed(()=>({radius:Math.min(n.value.width,n.value.height)*.9/2,centerX:n.value.width/2,centerY:n.value.height/2}));function E(l,a=1){return{x:r.value.centerX+r.value.radius*Math.cos(29.85+l*Math.PI/180)*a,y:r.value.centerY+r.value.radius*Math.sin(29.85+l*Math.PI/180)*a}}const s=e.ref(t.value.style.chart.animation.use?0:c.dataset.percentage||0);e.watch(()=>c.dataset,l=>{t.value.style.chart.animation.use?T(l.percentage):s.value=l.percentage||0},{deep:!0});const h=e.ref(null);e.onMounted(()=>{M()});function M(){if(i.objectIsEmpty(c.dataset)&&i.error({componentName:"VueUiWheel",type:"dataset"}),T(c.dataset.percentage||0),t.value.responsive){const l=V.throttle(()=>{const{width:a,height:o}=V.useResponsive({chart:d.value,title:t.value.style.chart.title.text?B.value:null,source:P.value,noTitle:S.value});requestAnimationFrame(()=>{n.value.width=a,n.value.height=o,w.value=t.value.style.chart.layout.percentage.fontSize/360*Math.min(a,o)})});h.value=new ResizeObserver(l),h.value.observe(d.value.parentNode)}}e.onBeforeUnmount(()=>{h.value&&h.value.disconnect()});function T(l){let a=t.value.style.chart.animation.speed;const o=Math.abs(l-s.value)/(a*120);function u(){s.value<l?s.value=Math.min(s.value+o,l):s.value>l&&(s.value=Math.max(s.value-o,l)),s.value!==l&&requestAnimationFrame(u)}u()}const v=e.computed(()=>Math.max(100,t.value.style.chart.layout.wheel.ticks.quantity)),f=e.computed(()=>100/v.value),q=e.computed(()=>{const l=[];for(let a=0;a<v.value;a+=1){const o=s.value>a*f.value?t.value.style.chart.layout.wheel.ticks.activeColor:t.value.style.chart.layout.wheel.ticks.inactiveColor,{x:u,y:W}=E(n.value.size/v.value*a),{x:J,y:K}=E(n.value.size/v.value*a,t.value.style.chart.layout.wheel.ticks.sizeRatio);l.push({x1:u,y1:W,x2:J,y2:K,color:t.value.style.chart.layout.wheel.ticks.gradient.show?i.shiftHue(o,a*f.value/v.value*(t.value.style.chart.layout.wheel.ticks.gradient.shiftHueIntensity/100)):o})}return l}),D=e.computed(()=>i.makeDonut({series:q.value.map(l=>({name:"",value:1,color:l.color}))},r.value.centerX,r.value.centerY,r.value.radius,r.value.radius,1.99999,2,1,360,105.25,r.value.radius*(1-t.value.style.chart.layout.wheel.ticks.sizeRatio))),y=e.ref(!1);function Y(l){y.value=l,b.value+=1}const p=e.ref(!1);function C(){p.value=!p.value}return X({generatePdf:A,generateImage:F,toggleAnnotator:C}),(l,a)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-wheel",ref_key:"wheelChart",ref:d,id:g.value,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height:100%":""}`),onMouseenter:a[0]||(a[0]=()=>e.unref(O)(!0)),onMouseleave:a[1]||(a[1]=()=>e.unref(O)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(te._sfc_main,{key:0,svgRef:e.unref(x),backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:p.value,onClose:C},null,8,["svgRef","backgroundColor","color","active"])):e.createCommentVNode("",!0),H.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:S,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:B,style:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(Q._sfc_main,{key:`title_${_.value}`,config:{title:{cy:"wheel-title",...t.value.style.chart.title},subtitle:{cy:"wheel-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&m.value&&(e.unref(N)||e.unref(k))?(e.openBlock(),e.createBlock(R.UserOptions,{ref_key:"details",ref:G,key:`user_options_${b.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(I),isImaging:e.unref(z),uid:g.value,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,hasXls:!1,isFullscreen:y.value,position:t.value.userOptions.position,titles:{...t.value.userOptions.buttonTitles},hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:p.value,chartElement:d.value,onToggleFullscreen:Y,onGeneratePdf:e.unref(A),onGenerateImage:e.unref(F),onToggleAnnotator:C,style:e.normalizeStyle({visibility:e.unref(N)?e.unref(k)?"visible":"hidden":"visible"})},e.createSlots({_:2},[l.$slots.menuIcon?{name:"menuIcon",fn:e.withCtx(({isOpen:o,color:u})=>[e.renderSlot(l.$slots,"menuIcon",e.normalizeProps(e.guardReactiveProps({isOpen:o,color:u})),void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:u})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:u})),void 0,!0)]),key:"3"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:u})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:u})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","position","titles","hasAnnotator","isAnnotation","chartElement","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),m.value?(e.openBlock(),e.createElementBlock("svg",{key:4,ref_key:"svgRef",ref:x,xmlns:e.unref(i.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":y.value,"vue-data-ui-fulscreen--off":!y.value}),viewBox:`0 0 ${n.value.width<=0?10:n.value.width} ${n.value.height<=0?10:n.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(ee._sfc_main),l.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:n.value.width<=0?10:n.value.width,height:n.value.height<=0?10:n.value.height,style:{pointerEvents:"none"}},[e.renderSlot(l.$slots,"chart-background",{},void 0,!0)],8,se)):e.createCommentVNode("",!0),t.value.style.chart.layout.wheel.ticks.type==="classic"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(q.value,(o,u)=>(e.openBlock(),e.createElementBlock("line",{x1:o.x1,x2:o.x2,y1:o.y1,y2:o.y2,stroke:o.color,"stroke-width":t.value.style.chart.layout.wheel.ticks.strokeWidth/360*Math.min(n.value.width,n.value.height),"stroke-linecap":t.value.style.chart.layout.wheel.ticks.rounded?"round":"butt",class:e.normalizeClass({"vue-ui-tick-animated":t.value.style.chart.animation.use&&u*f.value<=s.value})},null,10,ue))),256)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(D.value,(o,u)=>(e.openBlock(),e.createElementBlock("path",{d:o.arcSlice,fill:o.color,class:e.normalizeClass({"vue-ui-tick-animated":t.value.style.chart.animation.use&&u*f.value<=s.value})},null,10,ie))),256)),t.value.style.chart.layout.innerCircle.show?(e.openBlock(),e.createElementBlock("circle",{key:3,cx:r.value.centerX,cy:r.value.centerY,r:r.value.radius*.8<=0?1e-4:r.value.radius*.8,stroke:t.value.style.chart.layout.innerCircle.stroke,"stroke-width":t.value.style.chart.layout.innerCircle.strokeWidth,fill:"none"},null,8,ce)):e.createCommentVNode("",!0),t.value.style.chart.layout.percentage.show?(e.openBlock(),e.createElementBlock("text",{key:4,x:r.value.centerX,y:r.value.centerY+w.value/3,"font-size":w.value,fill:t.value.style.chart.layout.wheel.ticks.gradient.show?e.unref(i.shiftHue)(t.value.style.chart.layout.wheel.ticks.activeColor,s.value/100*(t.value.style.chart.layout.wheel.ticks.gradient.shiftHueIntensity/100)):t.value.style.chart.layout.wheel.ticks.activeColor,"text-anchor":"middle","font-weight":t.value.style.chart.layout.percentage.bold?"bold":"normal",style:{"font-variant-numeric":"tabluar-nums"}},e.toDisplayString(e.unref(i.applyDataLabel)(t.value.style.chart.layout.percentage.formatter,e.unref(i.checkNaN)(s.value),e.unref(i.dataLabel)({v:e.unref(i.checkNaN)(s.value),s:"%",r:t.value.style.chart.layout.percentage.rounding}))),9,ve)):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"svg",{svg:n.value},void 0,!0)],14,re)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",de,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(I)||e.unref(z)})),void 0,!0)])):e.createCommentVNode("",!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:6,ref_key:"source",ref:P,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),m.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Z.default,{key:7,config:{type:"wheel",style:{backgroundColor:t.value.style.chart.backgroundColor,wheel:{color:"#CCCCCC"}}}},null,8,["config"]))],44,ae))}},fe=ne._export_sfc(he,[["__scopeId","data-v-0ab72261"]]);exports.default=fe;
@@ -1,12 +1,12 @@
1
1
  import { computed as f, ref as c, watch as J, onMounted as he, onBeforeUnmount as de, createElementBlock as v, openBlock as n, unref as s, normalizeStyle as S, createBlock as _, createCommentVNode as h, createSlots as ye, withCtx as g, renderSlot as y, normalizeProps as $, guardReactiveProps as O, normalizeClass as z, createVNode as fe, Fragment as K, renderList as Q, toDisplayString as pe } from "vue";
2
- import { u as ge, c as me, a as ke, o as we, e as be, w as Z, m as Ce, X as _e, i as $e, v as ee, f as Oe } from "./index-CHhWsvsT.js";
3
- import { _ as Ie } from "./Title-C0CT6jA6.js";
4
- import { u as xe, U as Ae } from "./usePrinter-CAc9dBow.js";
2
+ import { u as ge, c as me, a as ke, o as we, e as be, w as Z, m as Ce, X as _e, i as $e, v as ee, f as Oe } from "./index-BFQVpLxg.js";
3
+ import { _ as Ie } from "./Title-lqF_rq6c.js";
4
+ import { u as xe, U as Ae } from "./usePrinter-DKrOpSvE.js";
5
5
  import { t as Fe, u as Pe } from "./useResponsive-Cw4oZ8sQ.js";
6
- import Se from "./vue-ui-skeleton-Bbm-HuYK.js";
7
- import { u as te } from "./useNestedProp-BFjDbZR0.js";
8
- import { _ as ze } from "./PackageVersion-m64FzgEd.js";
9
- import { _ as Me } from "./PenAndPaper-DsrtCBwN.js";
6
+ import Se from "./vue-ui-skeleton-CHzvVaNP.js";
7
+ import { u as te } from "./useNestedProp-CQx8H1CV.js";
8
+ import { _ as ze } from "./PackageVersion-D0X33ZDw.js";
9
+ import { _ as Me } from "./PenAndPaper-DOg71Z7q.js";
10
10
  import { u as Te } from "./useUserOptionState-BIvW1Kz7.js";
11
11
  import { u as Ne } from "./useChartAccessibility-BWojgys7.js";
12
12
  import { _ as Re } from "./_plugin-vue_export-helper-CHgC5LLL.js";
@@ -1,18 +1,18 @@
1
1
  import { useCssVars as Ne, computed as K, ref as h, watch as de, onMounted as _e, onBeforeUnmount as Ae, createElementBlock as V, openBlock as b, unref as v, normalizeStyle as ne, createBlock as Q, createCommentVNode as U, createVNode as ve, createSlots as Ie, withCtx as S, renderSlot as $, normalizeProps as G, guardReactiveProps as L, normalizeClass as ye, createElementVNode as he, Fragment as Re, renderList as We, toDisplayString as be, createTextVNode as Ve, nextTick as we } from "vue";
2
- import { u as Ue, c as Ce, a6 as Be, v as De, t as Ee, p as se, a as Ge, o as Le, e as ke, g as He, f as je, X as Xe, q as qe, r as Ye, x as Ze } from "./index-CHhWsvsT.js";
3
- import { _ as Je } from "./Title-C0CT6jA6.js";
4
- import { u as Ke, U as Qe } from "./usePrinter-CAc9dBow.js";
2
+ import { u as Ue, c as Ce, a6 as Be, v as De, t as Ee, p as se, a as Ge, o as Le, e as ke, g as He, f as je, X as Xe, q as qe, r as Ye, x as Ze } from "./index-BFQVpLxg.js";
3
+ import { _ as Je } from "./Title-lqF_rq6c.js";
4
+ import { u as Ke, U as Qe } from "./usePrinter-DKrOpSvE.js";
5
5
  import { t as et, u as tt, d as ot } from "./useResponsive-Cw4oZ8sQ.js";
6
- import at from "./vue-ui-accordion-C7pRXQdw.js";
7
- import { D as lt } from "./DataTable-D6KdvUip.js";
8
- import { u as $e } from "./useNestedProp-BFjDbZR0.js";
9
- import { _ as nt } from "./PackageVersion-m64FzgEd.js";
10
- import { _ as st } from "./Tooltip-TflEtITP.js";
11
- import { _ as rt } from "./PenAndPaper-DsrtCBwN.js";
6
+ import at from "./vue-ui-accordion-8x_k6qEe.js";
7
+ import { D as lt } from "./DataTable-D47NI3mY.js";
8
+ import { u as $e } from "./useNestedProp-CQx8H1CV.js";
9
+ import { _ as nt } from "./PackageVersion-D0X33ZDw.js";
10
+ import { _ as st } from "./Tooltip-DKFyA3ub.js";
11
+ import { _ as rt } from "./PenAndPaper-DOg71Z7q.js";
12
12
  import { u as it } from "./useUserOptionState-BIvW1Kz7.js";
13
13
  import { u as ut } from "./useChartAccessibility-BWojgys7.js";
14
14
  import { u as ct } from "./usePanZoom-CUkkqW81.js";
15
- import dt from "./BaseIcon-eOI-TaGA.js";
15
+ import dt from "./BaseIcon-DZrvtZc3.js";
16
16
  import { _ as vt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
17
17
  function xe({
18
18
  word: w,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),h=require("./index-B8vOvwaf.cjs"),pe=require("./Title-BqVhWQj9.cjs"),ne=require("./usePrinter-Bi6GyL7Z.cjs"),ee=require("./useResponsive-DQmBAoBf.cjs"),me=require("./vue-ui-accordion-CBE2Lscz.cjs"),ge=require("./DataTable-DbFdIOSA.cjs"),re=require("./useNestedProp-C4sQAs2T.cjs"),ye=require("./PackageVersion-D22bJIIL.cjs"),be=require("./Tooltip-DG7xNLW-.cjs"),we=require("./PenAndPaper-DQgGlIFz.cjs"),ke=require("./useUserOptionState-BgepsfED.cjs"),Ce=require("./useChartAccessibility-Cm7nkzTG.cjs"),xe=require("./usePanZoom-PXRi2Rwx.cjs"),$e=require("./BaseIcon-BNBdVypn.cjs"),Se=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");function se({word:b,fontSize:p,pad:f,canvas:i,ctx:c,svg:n}){c.save(),c.font=`${n.style&&n.style.bold?"bold ":""}${p}px Arial`;const a=c.measureText(b.name),r=Math.ceil(a.width)+2+(f?f*2:0),u=Math.ceil(p)+2+(f?f*2:0);i.width=r,i.height=u,c.clearRect(0,0,r,u),c.font=`${n.style&&n.style.bold?"bold ":""}${p}px Arial`,c.textAlign="center",c.textBaseline="middle",c.fillStyle="black",c.fillText(b.name,r/2,u/2);const S=c.getImageData(0,0,r,u).data,C=[];for(let T=0;T<u;T+=1)for(let t=0;t<r;t+=1)S[(T*r+t)*4+3]>1&&C.push([t,T]);return c.restore(),{w:r,h:u,wordMask:C}}function ue({mask:b,maskW:p,maskH:f,wx:i,wy:c,wordMask:n}){for(let a=0;a<n.length;a+=1){const r=i+n[a][0],u=c+n[a][1];if(r<0||u<0||r>=p||u>=f||b[u*p+r])return!1}return!0}function ie({mask:b,maskW:p,maskH:f,wx:i,wy:c,wordMask:n}){for(let a=0;a<n.length;a+=1){const r=i+n[a][0],u=c+n[a][1];r>=0&&u>=0&&r<p&&u<f&&(b[u*p+r]=1)}}function Te({wordMask:b,w:p,h:f,dilation:i}){const c=new Set(b.map(([a,r])=>`${a},${r}`)),n=new Set(c);for(let[a,r]of b)for(let u=-i;u<=i;u+=1)for(let $=-i;$<=i;$+=1){if(u===0&&$===0)continue;const S=a+u,C=r+$;S>=0&&S<p&&C>=0&&C<f&&n.add(`${S},${C}`)}return Array.from(n).map(a=>a.split(",").map(Number))}function Pe({words:b,proximity:p=0,svg:f}){const{width:i,height:c}=f,n=Math.round(i),a=Math.round(c),r=1,u=f.minFontSize,$=f.maxFontSize,S=b.map(m=>m.value),C=Math.min(...S),T=Math.max(...S),t=new Uint8Array(n*a),O=document.createElement("canvas"),E=O.getContext("2d",{willReadFrequently:!0});O.width=n,O.height=a;const R=6,H=2,L=2,q=1,W=Math.floor(n/2),d=Math.floor(a/2),Y=[...b].sort((m,P)=>P.value-m.value),U=[];for(const m of Y){let P=u;T!==C&&(P=(m.value-C)/(T-C)*($-u)+u),P=Math.max(u,Math.min($,P));let A=!1,N=P;for(;!A&&N>=r;){let{w:z,h:B,wordMask:v}=se({word:m,fontSize:N,pad:p,canvas:O,ctx:E,svg:f});v=Te({wordMask:v,w:z,h:B,dilation:2});let F=0,M=0;for(;F<Math.max(n,a)&&!A&&M<1e4;){for(let x=0;x<360;x+=R){M+=1;const g=Math.round(W+F*Math.cos(x*Math.PI/180)-z/2),w=Math.round(d+F*Math.sin(x*Math.PI/180)-B/2);if(!(g<0||w<0||g+z>n||w+B>a)&&ue({mask:t,maskW:n,maskH:a,wx:g,wy:w,wordMask:v})){U.push({...m,x:g-n/2,y:w-a/2,fontSize:N,width:z,height:B,angle:0}),ie({mask:t,maskW:n,maskH:a,wx:g,wy:w,wordMask:v}),A=!0;break}}F+=H}A||(N-=1)}if(!A&&N<r){N=r;const{w:z,h:B,wordMask:v}=se({word:m,fontSize:N,pad:p,canvas:O,ctx:E,svg:f});let F=0,M=0;for(;F<Math.max(n,a)&&!A&&M<25e3;){for(let x=0;x<360;x+=L){M+=1;const g=Math.round(W+F*Math.cos(x*Math.PI/180)-z/2),w=Math.round(d+F*Math.sin(x*Math.PI/180)-B/2);if(!(g<0||w<0||g+z>n||w+B>a)&&ue({mask:t,maskW:n,maskH:a,wx:g,wy:w,wordMask:v})){U.push({...m,x:g-n/2,y:w-a/2,fontSize:N,width:z,height:B,angle:0}),ie({mask:t,maskW:n,maskH:a,wx:g,wy:w,wordMask:v}),A=!0;break}}F+=q}}}return U.sort((m,P)=>P.fontSize-m.fontSize)}const Ne=["id"],ze=["xmlns","viewBox"],Be=["width","height"],Fe=["transform"],Me=["fill","font-weight","x","y","font-size","transform","onMouseover"],Oe={key:4,class:"vue-data-ui-watermark"},Ae={key:5,"data-dom-to-png-ignore":"",class:"reset-wrapper"},Ve=["innerHTML"],Ie={__name:"vue-ui-word-cloud",props:{config:{type:Object,default(){return{}}},dataset:{type:[Array,String],default(){return[]}}},setup(b,{expose:p}){e.useCssVars(o=>({"1461b4f2":o.slicerColor}));const{vue_ui_word_cloud:f}=h.useConfig(),i=b,c=e.computed({get(){return!!i.dataset&&i.dataset.length},set(o){return o}}),n=e.ref(h.createUid()),a=e.ref(0),r=e.ref(null),u=e.ref(null),$=e.ref(null),S=e.ref(0),C=e.ref(0),T=e.ref(!1),t=e.computed({get:()=>W(),set:o=>o}),O=e.ref(E());function E(){return typeof i.dataset=="string"?h.createWordCloudDatasetFromPlainText(i.dataset):i.dataset.map((o,s)=>({...o,value:h.checkNaN(o.value)}))}e.watch(()=>i.dataset,()=>{O.value=E(),x()});const{userOptionsVisible:R,setUserOptionsVisibility:H,keepUserOptionState:L}=ke.useUserOptionState({config:t.value}),{svgRef:q}=Ce.useChartAccessibility({config:t.value.style.chart.title});function W(){const o=re.useNestedProp({userConfig:i.config,defaultConfig:f});return o.theme?{...re.useNestedProp({userConfig:h.themes.vue_ui_word_cloud[o.theme]||i.config,defaultConfig:o}),customPalette:h.themePalettes[o.theme]||h.palette}:o}e.watch(()=>i.config,o=>{t.value=W(),R.value=!t.value.userOptions.showOnChartHover,P(),S.value+=1,C.value+=1,v.value.showTable=t.value.table.show,v.value.showTooltip=t.value.style.chart.tooltip.show},{deep:!0});const d=e.ref({width:t.value.style.chart.width,height:t.value.style.chart.height,maxFontSize:t.value.style.chart.words.maxFontSize,minFontSize:t.value.style.chart.words.minFontSize,bold:t.value.style.chart.words.bold}),Y=ee.debounce(()=>{x()},10),U=ee.throttle(()=>{const{width:o,height:s}=ee.useResponsive({chart:r.value,title:t.value.style.chart.title.text?u.value:null,source:$.value});requestAnimationFrame(()=>{d.value.width=o,d.value.height=s,e.nextTick(Y)})}),m=e.ref(null);e.onMounted(P);function P(){h.objectIsEmpty(i.dataset)?h.error({componentName:"VueUiWordCloud",type:"dataset"}):O.value.forEach((o,s)=>{h.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name","value"]}).forEach(l=>{c.value=!1,h.error({componentName:"VueUiWordCloud",type:"datasetSerieAttribute",property:l,index:s})})}),t.value.responsive&&(m.value=new ResizeObserver(U),m.value.observe(r.value.parentNode))}e.onBeforeUnmount(()=>{m.value&&m.value.disconnect()});const{isPrinting:A,isImaging:N,generatePdf:z,generateImage:B}=ne.usePrinter({elementId:`wordCloud_${n.value}`,fileName:t.value.style.chart.title.text||"vue-ui-word-cloud",options:t.value.userOptions.print}),v=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show});function F(o,s,l="Arial"){const y=document.createElement("canvas").getContext("2d");return y.font=`${s}px ${t.value.style.chart.words.bold?"bold":"normal"} ${l}`,{width:y.measureText(o).width+t.value.style.chart.words.proximity,height:s}}const M=e.ref([]);e.watch(()=>i.dataset,x,{immediate:!0});function x(){const o=[...O.value].map(y=>y.value),s=Math.max(...o),l=Math.min(...o),k=[...O.value].map((y,V)=>{let I=(y.value-l)/(s-l)*(d.value.maxFontSize-d.value.minFontSize)+d.value.minFontSize;I=isNaN(I)?d.value.minFontSize:I;const ae=F(y.name,I);return{...y,id:h.createUid(),fontSize:I,width:ae.width,height:ae.height,color:t.value.style.chart.words.usePalette?t.value.customPalette[V]||t.value.customPalette[V%t.value.customPalette.length]||h.palette[V]||h.palette[V%h.palette.length]:t.value.style.chart.words.color}});M.value=Pe({words:k,svg:d.value,proximity:t.value.style.chart.words.proximity})}const g=e.computed(()=>{const o=M.value.map(l=>({name:l.name,color:l.color})),s=M.value.map(l=>l.value);return{head:o,body:s}});function w(){e.nextTick(()=>{const o=g.value.head.map((k,y)=>[[k.name],[g.value.body[y]]]),s=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],[t.value.table.columnNames.value]]].concat(o),l=h.createCsvContent(s);h.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-word-cloud"})})}const j=e.computed(()=>{const o=[t.value.table.columnNames.series,t.value.table.columnNames.value],s=g.value.head.map((y,V)=>{const I=h.dataLabel({p:t.value.table.td.prefix,v:g.value.body[V],s:t.value.table.td.suffix,r:t.value.table.td.roundingValue});return[{color:y.color,name:y.name},I]}),l={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value],head:o,body:s,config:l}}),X=e.ref(!1);function ce(o){X.value=o,a.value+=1}function de(){return M.value}function te(){v.value.showTable=!v.value.showTable}function oe(){v.value.showTooltip=!v.value.showTooltip}const D=e.ref(!1);function J(){D.value=!D.value}const ve=e.computed(()=>!D.value&&t.value.style.chart.zoom.show),{viewBox:Z,resetZoom:le,isZoom:he}=xe.usePanZoom(q,{x:0,y:0,width:d.value.width<=0?10:d.value.width,height:d.value.height<=0?10:d.value.height},1,ve);p({getData:de,generateCsv:w,generatePdf:z,generateImage:B,toggleTable:te,toggleTooltip:oe,toggleAnnotator:J});const _=e.ref(null),G=e.ref(!1),K=e.ref(""),Q=e.ref(null);function fe(o){if(!v.value.showTooltip)return;_.value=o.id,Q.value={datapoint:o,config:t.value};const s=t.value.style.chart.tooltip.customFormat;if(G.value=!1,h.isFunction(s))try{const l=s({datapoint:o,config:t.value});typeof l=="string"&&(K.value=l,G.value=!0)}catch{console.warn("Custom format cannot be applied."),G.value=!1}if(!G.value){let l=`<svg viewBox="0 0 10 10" height="${t.value.style.chart.tooltip.fontSize}"><circle cx="5" cy="5" r="5" fill="${o.color}"/></svg><span>${o.name}:</span><b>${(o.value||0).toFixed(t.value.style.chart.tooltip.roundingValue)}</b>`;K.value=`<div dir="auto" style="display:flex; gap:4px; align-items:center; jsutify-content:center;">${l}</div>`}T.value=!0}return(o,s)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-word-cloud",ref_key:"wordCloudChart",ref:r,id:`wordCloud_${n.value}`,style:e.normalizeStyle(`width: 100%; font-family:${t.value.style.fontFamily};background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height:100%":""}`),onMouseenter:s[3]||(s[3]=()=>e.unref(H)(!0)),onMouseleave:s[4]||(s[4]=()=>e.unref(H)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(we._sfc_main,{key:0,svgRef:e.unref(q),backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:D.value,onClose:J},null,8,["svgRef","backgroundColor","color","active"])):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"chartTitle",ref:u,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(pe._sfc_main,{key:`title_${S.value}`,config:{title:{...t.value.style.chart.title},subtitle:{...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&c.value&&(e.unref(L)||e.unref(R))?(e.openBlock(),e.createBlock(ne.UserOptions,{ref:"details",key:`user_option_${a.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(A),isImaging:e.unref(N),uid:n.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:X.value,titles:{...t.value.userOptions.buttonTitles},chartElement:r.value,position:t.value.userOptions.position,hasTooltip:t.value.style.chart.tooltip.show&&t.value.userOptions.buttons.tooltip,isTooltip:v.value.showTooltip,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:D.value,onToggleFullscreen:ce,onGeneratePdf:e.unref(z),onGenerateCsv:w,onGenerateImage:e.unref(B),onToggleTable:te,onToggleTooltip:oe,onToggleAnnotator:J,style:e.normalizeStyle({visibility:e.unref(L)?e.unref(R)?"visible":"hidden":"visible"})},e.createSlots({_:2},[o.$slots.menuIcon?{name:"menuIcon",fn:e.withCtx(({isOpen:l,color:k})=>[e.renderSlot(o.$slots,"menuIcon",e.normalizeProps(e.guardReactiveProps({isOpen:l,color:k})),void 0,!0)]),key:"0"}:void 0,o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:k})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:k})),void 0,!0)]),key:"5"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:k})=>[e.renderSlot(o.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:k})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","titles","chartElement","position","hasTooltip","isTooltip","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),c.value?(e.openBlock(),e.createElementBlock("svg",{key:3,ref_key:"svgRef",ref:q,class:e.normalizeClass({"vue-data-ui-fullscreen--on":X.value,"vue-data-ui-fulscreen--off":!X.value}),xmlns:e.unref(h.XMLNS),viewBox:`${e.unref(Z).x} ${e.unref(Z).y} ${e.unref(Z).width} ${e.unref(Z).height}`,style:"overflow:hidden;background:transparent;"},[e.createVNode(ye._sfc_main),o.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:d.value.width<=0?10:d.value.width,height:d.value.height<=0?10:d.value.height,style:{pointerEvents:"none"}},[e.renderSlot(o.$slots,"chart-background",{},void 0,!0)],8,Be)):e.createCommentVNode("",!0),e.createElementVNode("g",{transform:`translate(${(d.value.width<=0?10:d.value.width)/2}, ${(d.value.height<=0?10:d.value.height)/2})`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.value,(l,k)=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(),e.createElementBlock("text",{fill:l.color,"font-weight":t.value.style.chart.words.bold?"bold":"normal",key:k,x:l.x,y:l.y,"font-size":l.fontSize,transform:`translate(${l.width/2}, ${l.height/2})`,class:e.normalizeClass({animated:t.value.useCssAnimation,"word-selected":_.value&&_.value===l.id&&v.value.showTooltip,"word-not-selected":_.value&&_.value!==l.id&&v.value.showTooltip}),"text-anchor":"middle","dominant-baseline":"central",onMouseover:y=>fe(l),onMouseleave:s[0]||(s[0]=y=>{_.value=null,T.value=!1}),style:e.normalizeStyle(`animation-delay:${k*t.value.animationDelayMs}ms !important;`)},e.toDisplayString(l.name),47,Me))]))),256))],8,Fe),e.renderSlot(o.$slots,"svg",{svg:{height:d.value.height,width:d.value.width}},void 0,!0)],10,ze)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Oe,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(A)||e.unref(N)})),void 0,!0)])):e.createCommentVNode("",!0),e.unref(he)?(e.openBlock(),e.createElementBlock("div",Ae,[e.renderSlot(o.$slots,"reset-action",{reset:e.unref(le)},()=>[e.createElementVNode("button",{"data-cy-reset":"",tabindex:"0",role:"button",class:"vue-data-ui-refresh-button",style:e.normalizeStyle({background:t.value.style.chart.backgroundColor}),onClick:s[1]||(s[1]=l=>e.unref(le)(!0))},[e.createVNode($e.default,{name:"refresh",stroke:t.value.style.chart.color},null,8,["stroke"])],4)],!0)])):e.createCommentVNode("",!0),e.createVNode(be._sfc_main,{show:v.value.showTooltip&&T.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,fontSize:t.value.style.chart.tooltip.fontSize,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:r.value,content:K.value,isCustom:G.value},{"tooltip-before":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...Q.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...Q.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isCustom"]),o.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:6,ref_key:"source",ref:$,dir:"auto"},[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),c.value?(e.openBlock(),e.createBlock(me.default,{key:7,hideDetails:"",config:{open:v.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(ge.DataTable,{key:`table_${C.value}`,colNames:j.value.colNames,head:j.value.head,body:j.value.body,config:j.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:s[2]||(s[2]=l=>v.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,Ve)]),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)],44,Ne))}},_e=Se._export_sfc(Ie,[["__scopeId","data-v-d3519257"]]);exports.default=_e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),h=require("./index-C2dCPlLw.cjs"),pe=require("./Title-s-4wtmyf.cjs"),ne=require("./usePrinter-B7OpKMf9.cjs"),ee=require("./useResponsive-DQmBAoBf.cjs"),me=require("./vue-ui-accordion-CEJghMx7.cjs"),ge=require("./DataTable-DEFs-EaT.cjs"),re=require("./useNestedProp-Coe_9w4h.cjs"),ye=require("./PackageVersion-CX5-lR_7.cjs"),be=require("./Tooltip-Br3lB3d1.cjs"),we=require("./PenAndPaper-mo5_icjt.cjs"),ke=require("./useUserOptionState-BgepsfED.cjs"),Ce=require("./useChartAccessibility-Cm7nkzTG.cjs"),xe=require("./usePanZoom-PXRi2Rwx.cjs"),$e=require("./BaseIcon-C2o75ceK.cjs"),Se=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");function se({word:b,fontSize:p,pad:f,canvas:i,ctx:c,svg:n}){c.save(),c.font=`${n.style&&n.style.bold?"bold ":""}${p}px Arial`;const a=c.measureText(b.name),r=Math.ceil(a.width)+2+(f?f*2:0),u=Math.ceil(p)+2+(f?f*2:0);i.width=r,i.height=u,c.clearRect(0,0,r,u),c.font=`${n.style&&n.style.bold?"bold ":""}${p}px Arial`,c.textAlign="center",c.textBaseline="middle",c.fillStyle="black",c.fillText(b.name,r/2,u/2);const S=c.getImageData(0,0,r,u).data,C=[];for(let T=0;T<u;T+=1)for(let t=0;t<r;t+=1)S[(T*r+t)*4+3]>1&&C.push([t,T]);return c.restore(),{w:r,h:u,wordMask:C}}function ue({mask:b,maskW:p,maskH:f,wx:i,wy:c,wordMask:n}){for(let a=0;a<n.length;a+=1){const r=i+n[a][0],u=c+n[a][1];if(r<0||u<0||r>=p||u>=f||b[u*p+r])return!1}return!0}function ie({mask:b,maskW:p,maskH:f,wx:i,wy:c,wordMask:n}){for(let a=0;a<n.length;a+=1){const r=i+n[a][0],u=c+n[a][1];r>=0&&u>=0&&r<p&&u<f&&(b[u*p+r]=1)}}function Te({wordMask:b,w:p,h:f,dilation:i}){const c=new Set(b.map(([a,r])=>`${a},${r}`)),n=new Set(c);for(let[a,r]of b)for(let u=-i;u<=i;u+=1)for(let $=-i;$<=i;$+=1){if(u===0&&$===0)continue;const S=a+u,C=r+$;S>=0&&S<p&&C>=0&&C<f&&n.add(`${S},${C}`)}return Array.from(n).map(a=>a.split(",").map(Number))}function Pe({words:b,proximity:p=0,svg:f}){const{width:i,height:c}=f,n=Math.round(i),a=Math.round(c),r=1,u=f.minFontSize,$=f.maxFontSize,S=b.map(m=>m.value),C=Math.min(...S),T=Math.max(...S),t=new Uint8Array(n*a),O=document.createElement("canvas"),E=O.getContext("2d",{willReadFrequently:!0});O.width=n,O.height=a;const R=6,H=2,L=2,q=1,W=Math.floor(n/2),d=Math.floor(a/2),Y=[...b].sort((m,P)=>P.value-m.value),U=[];for(const m of Y){let P=u;T!==C&&(P=(m.value-C)/(T-C)*($-u)+u),P=Math.max(u,Math.min($,P));let A=!1,N=P;for(;!A&&N>=r;){let{w:z,h:B,wordMask:v}=se({word:m,fontSize:N,pad:p,canvas:O,ctx:E,svg:f});v=Te({wordMask:v,w:z,h:B,dilation:2});let F=0,M=0;for(;F<Math.max(n,a)&&!A&&M<1e4;){for(let x=0;x<360;x+=R){M+=1;const g=Math.round(W+F*Math.cos(x*Math.PI/180)-z/2),w=Math.round(d+F*Math.sin(x*Math.PI/180)-B/2);if(!(g<0||w<0||g+z>n||w+B>a)&&ue({mask:t,maskW:n,maskH:a,wx:g,wy:w,wordMask:v})){U.push({...m,x:g-n/2,y:w-a/2,fontSize:N,width:z,height:B,angle:0}),ie({mask:t,maskW:n,maskH:a,wx:g,wy:w,wordMask:v}),A=!0;break}}F+=H}A||(N-=1)}if(!A&&N<r){N=r;const{w:z,h:B,wordMask:v}=se({word:m,fontSize:N,pad:p,canvas:O,ctx:E,svg:f});let F=0,M=0;for(;F<Math.max(n,a)&&!A&&M<25e3;){for(let x=0;x<360;x+=L){M+=1;const g=Math.round(W+F*Math.cos(x*Math.PI/180)-z/2),w=Math.round(d+F*Math.sin(x*Math.PI/180)-B/2);if(!(g<0||w<0||g+z>n||w+B>a)&&ue({mask:t,maskW:n,maskH:a,wx:g,wy:w,wordMask:v})){U.push({...m,x:g-n/2,y:w-a/2,fontSize:N,width:z,height:B,angle:0}),ie({mask:t,maskW:n,maskH:a,wx:g,wy:w,wordMask:v}),A=!0;break}}F+=q}}}return U.sort((m,P)=>P.fontSize-m.fontSize)}const Ne=["id"],ze=["xmlns","viewBox"],Be=["width","height"],Fe=["transform"],Me=["fill","font-weight","x","y","font-size","transform","onMouseover"],Oe={key:4,class:"vue-data-ui-watermark"},Ae={key:5,"data-dom-to-png-ignore":"",class:"reset-wrapper"},Ve=["innerHTML"],Ie={__name:"vue-ui-word-cloud",props:{config:{type:Object,default(){return{}}},dataset:{type:[Array,String],default(){return[]}}},setup(b,{expose:p}){e.useCssVars(o=>({"1461b4f2":o.slicerColor}));const{vue_ui_word_cloud:f}=h.useConfig(),i=b,c=e.computed({get(){return!!i.dataset&&i.dataset.length},set(o){return o}}),n=e.ref(h.createUid()),a=e.ref(0),r=e.ref(null),u=e.ref(null),$=e.ref(null),S=e.ref(0),C=e.ref(0),T=e.ref(!1),t=e.computed({get:()=>W(),set:o=>o}),O=e.ref(E());function E(){return typeof i.dataset=="string"?h.createWordCloudDatasetFromPlainText(i.dataset):i.dataset.map((o,s)=>({...o,value:h.checkNaN(o.value)}))}e.watch(()=>i.dataset,()=>{O.value=E(),x()});const{userOptionsVisible:R,setUserOptionsVisibility:H,keepUserOptionState:L}=ke.useUserOptionState({config:t.value}),{svgRef:q}=Ce.useChartAccessibility({config:t.value.style.chart.title});function W(){const o=re.useNestedProp({userConfig:i.config,defaultConfig:f});return o.theme?{...re.useNestedProp({userConfig:h.themes.vue_ui_word_cloud[o.theme]||i.config,defaultConfig:o}),customPalette:h.themePalettes[o.theme]||h.palette}:o}e.watch(()=>i.config,o=>{t.value=W(),R.value=!t.value.userOptions.showOnChartHover,P(),S.value+=1,C.value+=1,v.value.showTable=t.value.table.show,v.value.showTooltip=t.value.style.chart.tooltip.show},{deep:!0});const d=e.ref({width:t.value.style.chart.width,height:t.value.style.chart.height,maxFontSize:t.value.style.chart.words.maxFontSize,minFontSize:t.value.style.chart.words.minFontSize,bold:t.value.style.chart.words.bold}),Y=ee.debounce(()=>{x()},10),U=ee.throttle(()=>{const{width:o,height:s}=ee.useResponsive({chart:r.value,title:t.value.style.chart.title.text?u.value:null,source:$.value});requestAnimationFrame(()=>{d.value.width=o,d.value.height=s,e.nextTick(Y)})}),m=e.ref(null);e.onMounted(P);function P(){h.objectIsEmpty(i.dataset)?h.error({componentName:"VueUiWordCloud",type:"dataset"}):O.value.forEach((o,s)=>{h.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name","value"]}).forEach(l=>{c.value=!1,h.error({componentName:"VueUiWordCloud",type:"datasetSerieAttribute",property:l,index:s})})}),t.value.responsive&&(m.value=new ResizeObserver(U),m.value.observe(r.value.parentNode))}e.onBeforeUnmount(()=>{m.value&&m.value.disconnect()});const{isPrinting:A,isImaging:N,generatePdf:z,generateImage:B}=ne.usePrinter({elementId:`wordCloud_${n.value}`,fileName:t.value.style.chart.title.text||"vue-ui-word-cloud",options:t.value.userOptions.print}),v=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show});function F(o,s,l="Arial"){const y=document.createElement("canvas").getContext("2d");return y.font=`${s}px ${t.value.style.chart.words.bold?"bold":"normal"} ${l}`,{width:y.measureText(o).width+t.value.style.chart.words.proximity,height:s}}const M=e.ref([]);e.watch(()=>i.dataset,x,{immediate:!0});function x(){const o=[...O.value].map(y=>y.value),s=Math.max(...o),l=Math.min(...o),k=[...O.value].map((y,V)=>{let I=(y.value-l)/(s-l)*(d.value.maxFontSize-d.value.minFontSize)+d.value.minFontSize;I=isNaN(I)?d.value.minFontSize:I;const ae=F(y.name,I);return{...y,id:h.createUid(),fontSize:I,width:ae.width,height:ae.height,color:t.value.style.chart.words.usePalette?t.value.customPalette[V]||t.value.customPalette[V%t.value.customPalette.length]||h.palette[V]||h.palette[V%h.palette.length]:t.value.style.chart.words.color}});M.value=Pe({words:k,svg:d.value,proximity:t.value.style.chart.words.proximity})}const g=e.computed(()=>{const o=M.value.map(l=>({name:l.name,color:l.color})),s=M.value.map(l=>l.value);return{head:o,body:s}});function w(){e.nextTick(()=>{const o=g.value.head.map((k,y)=>[[k.name],[g.value.body[y]]]),s=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],[t.value.table.columnNames.value]]].concat(o),l=h.createCsvContent(s);h.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-word-cloud"})})}const j=e.computed(()=>{const o=[t.value.table.columnNames.series,t.value.table.columnNames.value],s=g.value.head.map((y,V)=>{const I=h.dataLabel({p:t.value.table.td.prefix,v:g.value.body[V],s:t.value.table.td.suffix,r:t.value.table.td.roundingValue});return[{color:y.color,name:y.name},I]}),l={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value],head:o,body:s,config:l}}),X=e.ref(!1);function ce(o){X.value=o,a.value+=1}function de(){return M.value}function te(){v.value.showTable=!v.value.showTable}function oe(){v.value.showTooltip=!v.value.showTooltip}const D=e.ref(!1);function J(){D.value=!D.value}const ve=e.computed(()=>!D.value&&t.value.style.chart.zoom.show),{viewBox:Z,resetZoom:le,isZoom:he}=xe.usePanZoom(q,{x:0,y:0,width:d.value.width<=0?10:d.value.width,height:d.value.height<=0?10:d.value.height},1,ve);p({getData:de,generateCsv:w,generatePdf:z,generateImage:B,toggleTable:te,toggleTooltip:oe,toggleAnnotator:J});const _=e.ref(null),G=e.ref(!1),K=e.ref(""),Q=e.ref(null);function fe(o){if(!v.value.showTooltip)return;_.value=o.id,Q.value={datapoint:o,config:t.value};const s=t.value.style.chart.tooltip.customFormat;if(G.value=!1,h.isFunction(s))try{const l=s({datapoint:o,config:t.value});typeof l=="string"&&(K.value=l,G.value=!0)}catch{console.warn("Custom format cannot be applied."),G.value=!1}if(!G.value){let l=`<svg viewBox="0 0 10 10" height="${t.value.style.chart.tooltip.fontSize}"><circle cx="5" cy="5" r="5" fill="${o.color}"/></svg><span>${o.name}:</span><b>${(o.value||0).toFixed(t.value.style.chart.tooltip.roundingValue)}</b>`;K.value=`<div dir="auto" style="display:flex; gap:4px; align-items:center; jsutify-content:center;">${l}</div>`}T.value=!0}return(o,s)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-word-cloud",ref_key:"wordCloudChart",ref:r,id:`wordCloud_${n.value}`,style:e.normalizeStyle(`width: 100%; font-family:${t.value.style.fontFamily};background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height:100%":""}`),onMouseenter:s[3]||(s[3]=()=>e.unref(H)(!0)),onMouseleave:s[4]||(s[4]=()=>e.unref(H)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(we._sfc_main,{key:0,svgRef:e.unref(q),backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:D.value,onClose:J},null,8,["svgRef","backgroundColor","color","active"])):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"chartTitle",ref:u,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(pe._sfc_main,{key:`title_${S.value}`,config:{title:{...t.value.style.chart.title},subtitle:{...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&c.value&&(e.unref(L)||e.unref(R))?(e.openBlock(),e.createBlock(ne.UserOptions,{ref:"details",key:`user_option_${a.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(A),isImaging:e.unref(N),uid:n.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:X.value,titles:{...t.value.userOptions.buttonTitles},chartElement:r.value,position:t.value.userOptions.position,hasTooltip:t.value.style.chart.tooltip.show&&t.value.userOptions.buttons.tooltip,isTooltip:v.value.showTooltip,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:D.value,onToggleFullscreen:ce,onGeneratePdf:e.unref(z),onGenerateCsv:w,onGenerateImage:e.unref(B),onToggleTable:te,onToggleTooltip:oe,onToggleAnnotator:J,style:e.normalizeStyle({visibility:e.unref(L)?e.unref(R)?"visible":"hidden":"visible"})},e.createSlots({_:2},[o.$slots.menuIcon?{name:"menuIcon",fn:e.withCtx(({isOpen:l,color:k})=>[e.renderSlot(o.$slots,"menuIcon",e.normalizeProps(e.guardReactiveProps({isOpen:l,color:k})),void 0,!0)]),key:"0"}:void 0,o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:k})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:k})),void 0,!0)]),key:"5"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:k})=>[e.renderSlot(o.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:k})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","titles","chartElement","position","hasTooltip","isTooltip","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),c.value?(e.openBlock(),e.createElementBlock("svg",{key:3,ref_key:"svgRef",ref:q,class:e.normalizeClass({"vue-data-ui-fullscreen--on":X.value,"vue-data-ui-fulscreen--off":!X.value}),xmlns:e.unref(h.XMLNS),viewBox:`${e.unref(Z).x} ${e.unref(Z).y} ${e.unref(Z).width} ${e.unref(Z).height}`,style:"overflow:hidden;background:transparent;"},[e.createVNode(ye._sfc_main),o.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:d.value.width<=0?10:d.value.width,height:d.value.height<=0?10:d.value.height,style:{pointerEvents:"none"}},[e.renderSlot(o.$slots,"chart-background",{},void 0,!0)],8,Be)):e.createCommentVNode("",!0),e.createElementVNode("g",{transform:`translate(${(d.value.width<=0?10:d.value.width)/2}, ${(d.value.height<=0?10:d.value.height)/2})`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.value,(l,k)=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(),e.createElementBlock("text",{fill:l.color,"font-weight":t.value.style.chart.words.bold?"bold":"normal",key:k,x:l.x,y:l.y,"font-size":l.fontSize,transform:`translate(${l.width/2}, ${l.height/2})`,class:e.normalizeClass({animated:t.value.useCssAnimation,"word-selected":_.value&&_.value===l.id&&v.value.showTooltip,"word-not-selected":_.value&&_.value!==l.id&&v.value.showTooltip}),"text-anchor":"middle","dominant-baseline":"central",onMouseover:y=>fe(l),onMouseleave:s[0]||(s[0]=y=>{_.value=null,T.value=!1}),style:e.normalizeStyle(`animation-delay:${k*t.value.animationDelayMs}ms !important;`)},e.toDisplayString(l.name),47,Me))]))),256))],8,Fe),e.renderSlot(o.$slots,"svg",{svg:{height:d.value.height,width:d.value.width}},void 0,!0)],10,ze)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Oe,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(A)||e.unref(N)})),void 0,!0)])):e.createCommentVNode("",!0),e.unref(he)?(e.openBlock(),e.createElementBlock("div",Ae,[e.renderSlot(o.$slots,"reset-action",{reset:e.unref(le)},()=>[e.createElementVNode("button",{"data-cy-reset":"",tabindex:"0",role:"button",class:"vue-data-ui-refresh-button",style:e.normalizeStyle({background:t.value.style.chart.backgroundColor}),onClick:s[1]||(s[1]=l=>e.unref(le)(!0))},[e.createVNode($e.default,{name:"refresh",stroke:t.value.style.chart.color},null,8,["stroke"])],4)],!0)])):e.createCommentVNode("",!0),e.createVNode(be._sfc_main,{show:v.value.showTooltip&&T.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,fontSize:t.value.style.chart.tooltip.fontSize,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:r.value,content:K.value,isCustom:G.value},{"tooltip-before":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...Q.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...Q.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isCustom"]),o.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:6,ref_key:"source",ref:$,dir:"auto"},[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),c.value?(e.openBlock(),e.createBlock(me.default,{key:7,hideDetails:"",config:{open:v.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(ge.DataTable,{key:`table_${C.value}`,colNames:j.value.colNames,head:j.value.head,body:j.value.body,config:j.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:s[2]||(s[2]=l=>v.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,Ve)]),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)],44,Ne))}},_e=Se._export_sfc(Ie,[["__scopeId","data-v-d3519257"]]);exports.default=_e;