vue-data-ui 2.4.21 → 2.4.22

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 (147) hide show
  1. package/dist/{Arrow-BuVX2WoN.js → Arrow-BW_I0Vmx.js} +1 -1
  2. package/dist/{Arrow-DDe-g8rw.cjs → Arrow-D2zjDsxe.cjs} +1 -1
  3. package/dist/{BaseIcon-BdKOa64A.cjs → BaseIcon-BCC16NCl.cjs} +1 -1
  4. package/dist/{BaseIcon-BRSPQaGQ.js → BaseIcon-BbbAnrZI.js} +1 -1
  5. package/dist/{DataTable-BpVz3DBX.js → DataTable-Ce4R8v-3.js} +2 -2
  6. package/dist/{DataTable-H-KTkjfv.cjs → DataTable-DeevzR8O.cjs} +1 -1
  7. package/dist/{Legend-G5Zc4QaZ.cjs → Legend-BksImVUi.cjs} +1 -1
  8. package/dist/{Legend-hnLfwhmm.js → Legend-C6q2bLVV.js} +1 -1
  9. package/dist/{PackageVersion-BbQFSVXm.cjs → PackageVersion-AftniVVo.cjs} +1 -1
  10. package/dist/{PackageVersion-wqab02xF.js → PackageVersion-g2UOsY7H.js} +1 -1
  11. package/dist/{PenAndPaper-C_laA5mt.js → PenAndPaper-DRFeGfqV.js} +3 -3
  12. package/dist/{PenAndPaper-BX8pR5oV.cjs → PenAndPaper-j5noaKJZ.cjs} +1 -1
  13. package/dist/{Shape-QdnXSUyn.js → Shape-CBu7ails.js} +1 -1
  14. package/dist/{Shape-CJbFv4bs.cjs → Shape-Cf2Cj3g6.cjs} +1 -1
  15. package/dist/{Slicer-DV1kBscZ.js → Slicer-C0bRksfh.js} +2 -2
  16. package/dist/{Slicer-C1blYfez.cjs → Slicer-IneBjcpY.cjs} +1 -1
  17. package/dist/{Title-DBozX6nP.js → Title-B2orjUIW.js} +1 -1
  18. package/dist/{Title-BRqTk-nT.cjs → Title-BxrsVY3-.cjs} +1 -1
  19. package/dist/{Tooltip-DvGSIp31.cjs → Tooltip-BXc56Oxr.cjs} +1 -1
  20. package/dist/{Tooltip-Com_T8vc.js → Tooltip-CXjc5vb3.js} +1 -1
  21. package/dist/{index-CsQwCVqU.cjs → index-3oZdQf6G.cjs} +1 -1
  22. package/dist/{index-hV0hU1iE.js → index-D020Kb3z.js} +1 -1
  23. package/dist/style.css +1 -1
  24. package/dist/{useNestedProp-CRAUOmT5.js → useNestedProp-CZkNAGQh.js} +1 -1
  25. package/dist/{useNestedProp-DSYpaLxP.cjs → useNestedProp-vPTP0Wem.cjs} +1 -1
  26. package/dist/{usePrinter-O2fMMTMe.cjs → usePrinter-BKzxQK4e.cjs} +1 -1
  27. package/dist/{usePrinter-y3d31M4g.js → usePrinter-CN0J0NFL.js} +1 -1
  28. package/dist/{vue-data-ui-qBad3a6z.cjs → vue-data-ui-CWDZLUkp.cjs} +1 -1
  29. package/dist/{vue-data-ui-bEKZH8jG.js → vue-data-ui-e2cclW_4.js} +58 -58
  30. package/dist/vue-data-ui.cjs +1 -1
  31. package/dist/vue-data-ui.js +1 -1
  32. package/dist/{vue-ui-3d-bar-CkqKnqQt.cjs → vue-ui-3d-bar-DCeFCwb0.cjs} +1 -1
  33. package/dist/{vue-ui-3d-bar-f7YaBbrh.js → vue-ui-3d-bar-DggyGAlC.js} +9 -9
  34. package/dist/{vue-ui-accordion-m-s-7akB.js → vue-ui-accordion-B0fEWLwn.js} +3 -3
  35. package/dist/{vue-ui-accordion-CaktYQoo.cjs → vue-ui-accordion-QoJofzqF.cjs} +1 -1
  36. package/dist/{vue-ui-age-pyramid-EKKYQu3N.cjs → vue-ui-age-pyramid-CXtRGpVa.cjs} +1 -1
  37. package/dist/{vue-ui-age-pyramid-DkfNZR86.js → vue-ui-age-pyramid-DGDvfcvP.js} +10 -10
  38. package/dist/{vue-ui-annotator-DrVu5Pu0.js → vue-ui-annotator-BETCQ-pV.js} +1 -1
  39. package/dist/{vue-ui-annotator-v07J6oQG.cjs → vue-ui-annotator-BEZ0D_12.cjs} +1 -1
  40. package/dist/{vue-ui-bullet-CYDMehDZ.js → vue-ui-bullet-BK3d_nhc.js} +8 -8
  41. package/dist/{vue-ui-bullet-CdG92x7A.cjs → vue-ui-bullet-qAGQkwN4.cjs} +1 -1
  42. package/dist/{vue-ui-candlestick-Bw1O3QmK.js → vue-ui-candlestick-DQR8cYLr.js} +11 -11
  43. package/dist/{vue-ui-candlestick-D9yN-yRo.cjs → vue-ui-candlestick-DwfFHSRG.cjs} +1 -1
  44. package/dist/{vue-ui-carousel-table-kcQa0FHw.js → vue-ui-carousel-table-B6TSxUwp.js} +4 -4
  45. package/dist/{vue-ui-carousel-table-Cg6hAEVv.cjs → vue-ui-carousel-table-BrIXFgJp.cjs} +1 -1
  46. package/dist/{vue-ui-chestnut-Qu8c3_vB.cjs → vue-ui-chestnut-CWtw_edx.cjs} +1 -1
  47. package/dist/{vue-ui-chestnut-DE1AMXeX.js → vue-ui-chestnut-CpINqXRz.js} +8 -8
  48. package/dist/{vue-ui-cursor-DG8oufeh.cjs → vue-ui-cursor-DvX6FbhZ.cjs} +1 -1
  49. package/dist/{vue-ui-cursor-DbfjKtpf.js → vue-ui-cursor-yI58QC1O.js} +2 -2
  50. package/dist/{vue-ui-dashboard-BbwgfxLx.cjs → vue-ui-dashboard-BCic2CfN.cjs} +1 -1
  51. package/dist/{vue-ui-dashboard-CAkCNUBh.js → vue-ui-dashboard-Bb7vJ0Nx.js} +2 -2
  52. package/dist/{vue-ui-digits-DgQkxULm.cjs → vue-ui-digits-C4dI1v6b.cjs} +1 -1
  53. package/dist/{vue-ui-digits-BaXAiH4u.js → vue-ui-digits-D4uy7_hL.js} +2 -2
  54. package/dist/{vue-ui-donut-7GM_Wd1Y.js → vue-ui-donut-CRiEc5mP.js} +11 -11
  55. package/dist/{vue-ui-donut-BHzCOBu6.cjs → vue-ui-donut-ClvjMOxC.cjs} +1 -1
  56. package/dist/{vue-ui-donut-evolution-C-TkUOr6.cjs → vue-ui-donut-evolution-DFkGtmhv.cjs} +1 -1
  57. package/dist/{vue-ui-donut-evolution-DbU4RlP6.js → vue-ui-donut-evolution-DgrQVEh2.js} +11 -11
  58. package/dist/{vue-ui-dumbbell-DacMeiTU.cjs → vue-ui-dumbbell-BdkARfxX.cjs} +1 -1
  59. package/dist/{vue-ui-dumbbell-BacTx3zB.js → vue-ui-dumbbell-QCB4jZm4.js} +10 -10
  60. package/dist/{vue-ui-flow-D2G0YWL9.js → vue-ui-flow-CRnCk5Is.js} +9 -9
  61. package/dist/{vue-ui-flow-BUAvjG7i.cjs → vue-ui-flow-CYfdTIad.cjs} +1 -1
  62. package/dist/{vue-ui-galaxy-CxfV3BIw.cjs → vue-ui-galaxy-Cn9t3BG5.cjs} +1 -1
  63. package/dist/{vue-ui-galaxy-D6RFyIbQ.js → vue-ui-galaxy-WhRsA1Is.js} +11 -11
  64. package/dist/{vue-ui-gauge-DNJXnyLw.js → vue-ui-gauge-DwmCZiTj.js} +7 -7
  65. package/dist/{vue-ui-gauge-CJ5TKJpb.cjs → vue-ui-gauge-jYskVFUy.cjs} +1 -1
  66. package/dist/{vue-ui-gizmo-BBA51j_0.cjs → vue-ui-gizmo-C2P2qQYU.cjs} +1 -1
  67. package/dist/{vue-ui-gizmo-Db7-gRmB.js → vue-ui-gizmo-DpEZm4Uk.js} +3 -3
  68. package/dist/{vue-ui-heatmap-KQj8Jbpt.cjs → vue-ui-heatmap-D7TGNxC-.cjs} +1 -1
  69. package/dist/{vue-ui-heatmap-Ba6RMSTk.js → vue-ui-heatmap-u3SOjwts.js} +10 -10
  70. package/dist/{vue-ui-kpi-1srKxA1L.cjs → vue-ui-kpi-CCr0pHjp.cjs} +1 -1
  71. package/dist/{vue-ui-kpi-C8wyHy1H.js → vue-ui-kpi-Cdz5RM6j.js} +3 -3
  72. package/dist/{vue-ui-mini-loader-DutVmCuC.js → vue-ui-mini-loader-B2Xh0j5H.js} +2 -2
  73. package/dist/{vue-ui-mini-loader-BgKTecng.cjs → vue-ui-mini-loader-BuCeYPNP.cjs} +1 -1
  74. package/dist/{vue-ui-molecule-BOkIojio.js → vue-ui-molecule-GPDqR2rp.js} +11 -11
  75. package/dist/{vue-ui-molecule-CSezTn3m.cjs → vue-ui-molecule-z1A47zG1.cjs} +1 -1
  76. package/dist/{vue-ui-mood-radar-C8U8PHaq.js → vue-ui-mood-radar-DdQC5bH5.js} +11 -11
  77. package/dist/{vue-ui-mood-radar-CNTDrRs6.cjs → vue-ui-mood-radar-YZfCADah.cjs} +1 -1
  78. package/dist/{vue-ui-nested-donuts-DRWWnsdR.cjs → vue-ui-nested-donuts-CDSRcEX0.cjs} +1 -1
  79. package/dist/{vue-ui-nested-donuts-Bv2D1uFd.js → vue-ui-nested-donuts-Cf_KfoeP.js} +11 -11
  80. package/dist/{vue-ui-onion-CsnwbXED.cjs → vue-ui-onion-CmGZo3Sf.cjs} +1 -1
  81. package/dist/{vue-ui-onion-CT9YjU8v.js → vue-ui-onion-Lw3ohFAX.js} +11 -11
  82. package/dist/{vue-ui-parallel-coordinate-plot-C8KCRAX1.cjs → vue-ui-parallel-coordinate-plot-AHpf7ejC.cjs} +1 -1
  83. package/dist/{vue-ui-parallel-coordinate-plot-in5qpfXf.js → vue-ui-parallel-coordinate-plot-BsT0r0hr.js} +12 -12
  84. package/dist/{vue-ui-quadrant-Bw-0aW4F.cjs → vue-ui-quadrant-BPUIyB4-.cjs} +1 -1
  85. package/dist/{vue-ui-quadrant-C_9VNAXg.js → vue-ui-quadrant-BTmoe6UT.js} +12 -12
  86. package/dist/{vue-ui-quick-chart-C0YqMjyE.cjs → vue-ui-quick-chart-BYyXa06h.cjs} +1 -1
  87. package/dist/{vue-ui-quick-chart-BDBlm9uu.js → vue-ui-quick-chart-CRtE0pcc.js} +9 -9
  88. package/dist/{vue-ui-radar-C2QM_ee9.js → vue-ui-radar-BpkjOSOI.js} +12 -12
  89. package/dist/{vue-ui-radar-DXKMbeyW.cjs → vue-ui-radar-krdMX_hl.cjs} +1 -1
  90. package/dist/{vue-ui-rating-CsOknvaV.cjs → vue-ui-rating-9kj9GE7P.cjs} +1 -1
  91. package/dist/{vue-ui-rating-DVpgv2AY.js → vue-ui-rating-D1RlkwK9.js} +2 -2
  92. package/dist/{vue-ui-relation-circle-OXfdAyky.js → vue-ui-relation-circle-B7WGb08k.js} +7 -7
  93. package/dist/{vue-ui-relation-circle-ZA-M7aSc.cjs → vue-ui-relation-circle-Kv3G0P5k.cjs} +1 -1
  94. package/dist/{vue-ui-rings-qLQ-gl21.js → vue-ui-rings-DjXcLsY1.js} +11 -11
  95. package/dist/{vue-ui-rings-rftqDu-q.cjs → vue-ui-rings-DsZPnoqm.cjs} +1 -1
  96. package/dist/{vue-ui-scatter-Cv2IcrVH.cjs → vue-ui-scatter-D3ntjnfT.cjs} +1 -1
  97. package/dist/{vue-ui-scatter-4LbMvEAD.js → vue-ui-scatter-DEkTyyG8.js} +12 -12
  98. package/dist/{vue-ui-screenshot-BgjnQNxG.cjs → vue-ui-screenshot-BEbUxjNl.cjs} +1 -1
  99. package/dist/{vue-ui-screenshot-BV6ZYQRk.js → vue-ui-screenshot-kiJVXAGt.js} +1 -1
  100. package/dist/{vue-ui-skeleton-DsRTbz6d.cjs → vue-ui-skeleton-CI8sxaqr.cjs} +1 -1
  101. package/dist/{vue-ui-skeleton-BY8Jg9a_.js → vue-ui-skeleton-E1-7diF5.js} +3 -3
  102. package/dist/{vue-ui-smiley-BQ_3uicm.js → vue-ui-smiley-Cjbqlfre.js} +2 -2
  103. package/dist/{vue-ui-smiley-DB3y8CIb.cjs → vue-ui-smiley-CmkUQtfb.cjs} +1 -1
  104. package/dist/{vue-ui-spark-trend-Cgn7ONtS.cjs → vue-ui-spark-trend-C60Ypeev.cjs} +1 -1
  105. package/dist/{vue-ui-spark-trend-BhCJfY_p.js → vue-ui-spark-trend-DfpFe1UQ.js} +5 -5
  106. package/dist/{vue-ui-sparkbar-DxXt-GHr.js → vue-ui-sparkbar-B5oV2RUs.js} +4 -4
  107. package/dist/{vue-ui-sparkbar-D4GIhUXT.cjs → vue-ui-sparkbar-BAa71eZp.cjs} +1 -1
  108. package/dist/{vue-ui-sparkgauge-BbltbIrq.cjs → vue-ui-sparkgauge-UejPQm4b.cjs} +1 -1
  109. package/dist/{vue-ui-sparkgauge-BCPkJveV.js → vue-ui-sparkgauge-xlERw-g0.js} +4 -4
  110. package/dist/{vue-ui-sparkhistogram-DzX6lkk8.cjs → vue-ui-sparkhistogram-DC4jzkI0.cjs} +1 -1
  111. package/dist/{vue-ui-sparkhistogram-BKcr2mFc.js → vue-ui-sparkhistogram-nzFRlmgx.js} +5 -5
  112. package/dist/{vue-ui-sparkline-C-svTmFU.cjs → vue-ui-sparkline-BT4hxfBE.cjs} +1 -1
  113. package/dist/{vue-ui-sparkline-DYHUFUOp.js → vue-ui-sparkline-Duu0VrnG.js} +4 -4
  114. package/dist/{vue-ui-sparkstackbar-CL0uL_Te.cjs → vue-ui-sparkstackbar-K_vPau1u.cjs} +1 -1
  115. package/dist/{vue-ui-sparkstackbar-Btag2osm.js → vue-ui-sparkstackbar-tyoFIhva.js} +5 -5
  116. package/dist/{vue-ui-stackbar-CML7v_yU.cjs → vue-ui-stackbar-DRlvF164.cjs} +1 -1
  117. package/dist/{vue-ui-stackbar-C2mRU7ya.js → vue-ui-stackbar-e8BUjttp.js} +12 -12
  118. package/dist/{vue-ui-strip-plot-Vn5sEcME.cjs → vue-ui-strip-plot-8MOhIicL.cjs} +1 -1
  119. package/dist/{vue-ui-strip-plot-BIXF3VxN.js → vue-ui-strip-plot-Ef8oKjNV.js} +11 -11
  120. package/dist/{vue-ui-table-CyuRalnp.js → vue-ui-table-BOV6jtcL.js} +1 -1
  121. package/dist/{vue-ui-table-BbVpmm0B.cjs → vue-ui-table-DfevkNnK.cjs} +1 -1
  122. package/dist/{vue-ui-table-heatmap-DrQXQd41.cjs → vue-ui-table-heatmap-BMyRP1ol.cjs} +1 -1
  123. package/dist/{vue-ui-table-heatmap-DlGeS3l9.js → vue-ui-table-heatmap-CL-MybKI.js} +4 -4
  124. package/dist/{vue-ui-table-sparkline-DauDTktD.cjs → vue-ui-table-sparkline-CsqcT3ff.cjs} +1 -1
  125. package/dist/{vue-ui-table-sparkline-Yg2I33yZ.js → vue-ui-table-sparkline-DXvxiDJJ.js} +5 -5
  126. package/dist/{vue-ui-thermometer-Bglz0dOQ.cjs → vue-ui-thermometer-DyYqfAOW.cjs} +1 -1
  127. package/dist/{vue-ui-thermometer-DXwbqNrn.js → vue-ui-thermometer-WKzTNOOX.js} +7 -7
  128. package/dist/{vue-ui-timer-Brr7buaM.js → vue-ui-timer-CFDkyaxV.js} +5 -5
  129. package/dist/{vue-ui-timer-CpSEl8UD.cjs → vue-ui-timer-DQQGe1jt.cjs} +1 -1
  130. package/dist/{vue-ui-tiremarks-zdGmZNjo.cjs → vue-ui-tiremarks-C8iAWe-u.cjs} +1 -1
  131. package/dist/{vue-ui-tiremarks-DJowPFwY.js → vue-ui-tiremarks-aiUC8-YL.js} +7 -7
  132. package/dist/{vue-ui-treemap-a7NSP656.cjs → vue-ui-treemap-BORZ3g1I.cjs} +1 -1
  133. package/dist/{vue-ui-treemap-Bn5JU5BI.js → vue-ui-treemap-Bw-bWkza.js} +11 -11
  134. package/dist/{vue-ui-vertical-bar-CZxN7L9z.js → vue-ui-vertical-bar--mYbTcpi.js} +11 -11
  135. package/dist/{vue-ui-vertical-bar-BYG1vGlT.cjs → vue-ui-vertical-bar-B3ypOHUB.cjs} +1 -1
  136. package/dist/{vue-ui-waffle-CzUpKfkZ.js → vue-ui-waffle-Bj-tJs4n.js} +11 -11
  137. package/dist/{vue-ui-waffle-BbDBOivH.cjs → vue-ui-waffle-_84Hvek7.cjs} +1 -1
  138. package/dist/{vue-ui-wheel-CCje_ZSc.js → vue-ui-wheel-BywwqvY2.js} +7 -7
  139. package/dist/{vue-ui-wheel-lN3uYCr4.cjs → vue-ui-wheel-C-v9TgG1.cjs} +1 -1
  140. package/dist/{vue-ui-word-cloud-BjvG3n7x.cjs → vue-ui-word-cloud-CaQ4jLed.cjs} +1 -1
  141. package/dist/{vue-ui-word-cloud-D_5y92zN.js → vue-ui-word-cloud-CwExwCYc.js} +10 -10
  142. package/dist/{vue-ui-xy-Drm1aAb-.js → vue-ui-xy-CAYxRDzC.js} +14 -14
  143. package/dist/{vue-ui-xy-B-WlwJXZ.cjs → vue-ui-xy-CT3-xPpa.cjs} +1 -1
  144. package/dist/{vue-ui-xy-canvas-jieVsnBN.js → vue-ui-xy-canvas-BOElCo0f.js} +133 -131
  145. package/dist/vue-ui-xy-canvas-CdrfnVuI.cjs +9 -0
  146. package/package.json +1 -1
  147. package/dist/vue-ui-xy-canvas-BHrq_CYD.cjs +0 -9
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-CsQwCVqU.cjs"),de=require("./useResponsive-BJ7DTGpm.cjs"),Be=require("./Title-BRqTk-nT.cjs"),ve=require("./usePrinter-O2fMMTMe.cjs"),Ee=require("./Tooltip-DvGSIp31.cjs"),he=require("./Legend-G5Zc4QaZ.cjs"),Le=require("./vue-ui-skeleton-DsRTbz6d.cjs"),Pe=require("./BaseIcon-BdKOa64A.cjs"),ze=require("./vue-ui-accordion-CaktYQoo.cjs"),pe=require("./useNestedProp-DSYpaLxP.cjs"),De=require("./PackageVersion-BbQFSVXm.cjs"),Fe=require("./PenAndPaper-BX8pR5oV.cjs"),Me=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Oe=["id"],Ie=["onClick"],Ae=["xmlns","viewBox"],Re=["id"],qe=["stop-color"],He=["stop-color"],Xe=["x","y","width","height","fill","rx"],Ue=["x","y","width","height","fill","rx","stroke","stroke-width"],je=["x2","y1","y2","stroke","stroke-width"],Ge=["x1","x2","y1","y2","stroke","stroke-width"],We=["x","y","text-anchor","font-size","fill","font-weight"],Ye=["x","y","font-size","fill","font-weight"],Ke=["x","y","font-size","fill","font-weight"],Je=["x","y","font-size","fill","font-weight"],Qe=["y","width","height","fill","onMouseenter"],Ze={key:6,class:"vue-data-ui-watermark"},et=["onClick"],tt={style:"width:100%;padding-top: 36px;position:relative"},lt={class:"vue-ui-data-table"},at={key:0},ot={style:{width:"100%"}},nt=["data-cell"],rt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},ut=["data-cell"],st={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},it=["data-cell"],ct={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},dt=["data-cell"],vt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},ht=["data-cell"],pt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},yt=["data-cell"],gt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},ft=["data-cell"],mt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},bt={__name:"vue-ui-vertical-bar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(ye,{expose:ge,emit:fe}){const y=ye;e.useCssVars(l=>({"5a0dcab3":l.tdo}));const{vue_ui_vertical_bar:me}=n.useConfig(),B=e.computed(()=>!!y.dataset&&y.dataset.length),C=e.ref(n.createUid()),be=e.ref(null),D=e.ref(!1),F=e.ref(""),E=e.ref(0),ke=e.ref(null),q=e.ref(0),N=e.ref(null),H=e.ref(null),M=e.ref(null),X=e.ref(null),U=e.ref(null),j=e.ref(0),O=e.ref(0),t=e.computed({get:()=>G(),set:l=>l});function G(){const l=pe.useNestedProp({userConfig:y.config,defaultConfig:me});return l.theme?{...pe.useNestedProp({userConfig:n.themes.vue_ui_vertical_bar[l.theme]||y.config,defaultConfig:l}),customPalette:n.themePalettes[l.theme]||n.palette}:l}e.watch(()=>y.config,l=>{t.value=G(),te(),j.value+=1,O.value+=1,s.value=t.value.style.chart.layout.bars.height,c.value=t.value.style.chart.layout.bars.gap},{deep:!0}),e.watch(()=>y.dataset,P,{deep:!0});const{isPrinting:W,isImaging:Y,generatePdf:K,generateImage:J}=ve.usePrinter({elementId:`vue-ui-vertical-bar_${C.value}`,fileName:t.value.style.chart.title.text||"vue-ui-vertical-bar"}),Ce=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),Q=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),Z=e.ref(null),ee=e.ref(!1),_e=e.computed(()=>t.value.table.responsiveBreakpoint),L=e.ref(null);e.onMounted(()=>{te()});function te(){if(n.objectIsEmpty(y.dataset)&&n.error({componentName:"VueUiVerticalBar",type:"dataset"}),E.value=y.dataset.flatMap(l=>l.children&&l.children.length>0?l.children.length:1).reduce((l,o)=>l+o,0),xe(),t.value.responsive){const l=de.throttle(()=>{const{width:o,height:a}=de.useResponsive({chart:N.value,title:t.value.style.chart.title.text?H.value:null,legend:t.value.style.chart.legend.show?M.value:null,source:X.value,noTitle:U.value});oe.value=o,s.value=a/E.value-c.value*2});L.value=new ResizeObserver(l),L.value.observe(N.value.parentNode)}}e.onBeforeUnmount(()=>{L.value&&L.value.disconnect()});function xe(){new ResizeObserver(o=>{o.forEach(a=>{ee.value=a.contentRect.width<_e.value})}).observe(Z.value)}const p=e.ref({showTable:t.value.table.show,sortDesc:t.value.style.chart.layout.bars.sort==="desc",showTooltip:t.value.style.chart.tooltip.show}),le=e.computed(()=>p.value.sortDesc),_=e.computed(()=>(y.dataset.forEach((l,o)=>{!l.value&&!l.children&&n.error({componentName:"VueUiVerticalBar",type:"datasetAttributeEmpty",property:`value (index ${o})`}),l.children&&(n.objectIsEmpty(l.children)?n.error({componentName:"VueUiVerticalBar",type:"datasetAttributeEmpty",property:`children (index ${o})`}):l.children.forEach((a,r)=>{[null,void 0].includes(a.name)&&n.error({componentName:"VueUiVerticalBar",type:"datasetSerieAttribute",property:"name",key:"children",index:r})}))}),y.dataset.map((l,o)=>{const a=`vertical_parent_${o}_${C.value}`,r=l.children&&l.children.length>0,v=n.checkNaN(l.value?l.value:r?l.children.map(h=>h.value||0).reduce((h,b)=>h+b,0):0),i=v>=0?1:-1;return{...l,id:a,shape:"square",opacity:f.value.includes(a)?.5:1,value:Math.abs(v),sign:i,hasChildren:r,isChild:!1,segregate:()=>S(a),isSegregated:f.value.includes(a),color:n.convertColorToHex(l.color)||Q.value[o]||n.palette[o]||n.palette[o%n.palette.length],children:!l.children||!l.children.length?[]:l.children.toSorted((h,b)=>le.value?b.value-h.value:h.value-b.value).map((h,b)=>({...h,value:n.checkNaN(Math.abs(h.value)),sign:h.value>=0?1:-1,isChild:!0,parentId:a,parentName:l.name,parentValue:v,parentSign:i,id:`vertical_child_${o}_${b}_${C.value}`,childIndex:b,color:n.convertColorToHex(h.color)||n.convertColorToHex(l.color)||Q.value[o]||n.palette[o]||n.palette[o%n.palette.length]})).map((h,b)=>({...h,isFirstChild:b===0,isLastChild:b===l.children.length-1}))}}).toSorted((l,o)=>le.value?o.value-l.value:l.value-o.value))),ae=e.computed(()=>({cy:"vertical-bar-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),s=e.ref(t.value.style.chart.layout.bars.height),c=e.ref(t.value.style.chart.layout.bars.gap),Ne=e.computed(()=>(s.value+c.value)*E.value),oe=e.ref(512),d=e.computed(()=>({width:oe.value,height:Ne.value,padding:{top:12,left:128+t.value.style.chart.layout.bars.offsetX,right:64+t.value.style.chart.layout.bars.paddingRight,bottom:12}})),u=e.computed(()=>({fullHeight:d.value.padding.top+d.value.padding.bottom+d.value.height,top:d.value.padding.top,left:d.value.padding.left,right:d.value.width-d.value.padding.right,bottom:d.value.padding.top+d.value.height,width:d.value.width-(d.value.padding.left+d.value.padding.right)}));function P(){E.value=x.value.flatMap(l=>l.children&&l.children.length>0?l.children.length:1).reduce((l,o)=>l+o,0)}const f=e.ref([]);function S(l){f.value.includes(l)?f.value=f.value.filter(o=>o!==l):f.value.push(l),P(),fe("selectLegend",x.value)}const x=e.computed(()=>_.value.filter(l=>!f.value.includes(l.id))),m=e.computed(()=>x.value.map(l=>Math.abs(l.value)).reduce((l,o)=>l+o,0));function ne(l,o=!1,a=0){return o?n.dataLabel({v:n.checkNaN(Math.abs(l)/m.value*100),s:"%",r:a}):Math.abs(l)/m.value}const w=e.computed(()=>x.value.flatMap(l=>l.hasChildren?l.children:l)),$=e.computed(()=>w.value.map(l=>l.sign).includes(-1)),we=e.computed(()=>Math.max(...x.value.flatMap(l=>l.children&&l.children.length?Math.max(...l.children.map(o=>o.value)):l.value)));function k(l){const o=l/we.value;return u.value.width/($.value?2:1)*o}function $e(l){return k(l)+u.value.left}function V(l,o){const a=x.value.find(i=>i.id===l.parentId),r=u.value.top+(c.value+s.value)*o,v=a.children.length*(c.value+s.value);return{y:r+v/2-t.value.style.chart.layout.bars.parentLabels.fontSize,name:a.name,value:[void 0,NaN,null].includes(a.value)?"":a.sign===1?a.value:-a.value,percentageToTotal:isNaN(a.value/m.value)?"":ne(a.value,!0,t.value.style.chart.layout.bars.dataLabels.percentage.roundingPercentage),sign:a.sign}}function Se(){return x.value}const I=e.ref(null),A=e.ref(null);function Ve(l,o){A.value={datapoint:l,seriesIndex:o,series:_.value,config:t.value},D.value=!0,I.value=l.id;let a="";const r=l.isChild?l.parentName:l.name,v=l.isChild?l.name:"",i=t.value.style.chart.tooltip.customFormat;n.isFunction(i)&&n.functionReturnsString(()=>i({datapoint:l,series:_.value,config:t.value,seriesIndex:o}))?F.value=i({datapoint:l,series:_.value,config:t.value,seriesIndex:o}):(a+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;text-align:left;">
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-3oZdQf6G.cjs"),de=require("./useResponsive-BJ7DTGpm.cjs"),Be=require("./Title-BxrsVY3-.cjs"),ve=require("./usePrinter-BKzxQK4e.cjs"),Ee=require("./Tooltip-BXc56Oxr.cjs"),he=require("./Legend-BksImVUi.cjs"),Le=require("./vue-ui-skeleton-CI8sxaqr.cjs"),Pe=require("./BaseIcon-BCC16NCl.cjs"),ze=require("./vue-ui-accordion-QoJofzqF.cjs"),pe=require("./useNestedProp-vPTP0Wem.cjs"),De=require("./PackageVersion-AftniVVo.cjs"),Fe=require("./PenAndPaper-j5noaKJZ.cjs"),Me=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Oe=["id"],Ie=["onClick"],Ae=["xmlns","viewBox"],Re=["id"],qe=["stop-color"],He=["stop-color"],Xe=["x","y","width","height","fill","rx"],Ue=["x","y","width","height","fill","rx","stroke","stroke-width"],je=["x2","y1","y2","stroke","stroke-width"],Ge=["x1","x2","y1","y2","stroke","stroke-width"],We=["x","y","text-anchor","font-size","fill","font-weight"],Ye=["x","y","font-size","fill","font-weight"],Ke=["x","y","font-size","fill","font-weight"],Je=["x","y","font-size","fill","font-weight"],Qe=["y","width","height","fill","onMouseenter"],Ze={key:6,class:"vue-data-ui-watermark"},et=["onClick"],tt={style:"width:100%;padding-top: 36px;position:relative"},lt={class:"vue-ui-data-table"},at={key:0},ot={style:{width:"100%"}},nt=["data-cell"],rt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},ut=["data-cell"],st={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},it=["data-cell"],ct={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},dt=["data-cell"],vt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},ht=["data-cell"],pt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},yt=["data-cell"],gt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},ft=["data-cell"],mt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},bt={__name:"vue-ui-vertical-bar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(ye,{expose:ge,emit:fe}){const y=ye;e.useCssVars(l=>({"5a0dcab3":l.tdo}));const{vue_ui_vertical_bar:me}=n.useConfig(),B=e.computed(()=>!!y.dataset&&y.dataset.length),C=e.ref(n.createUid()),be=e.ref(null),D=e.ref(!1),F=e.ref(""),E=e.ref(0),ke=e.ref(null),q=e.ref(0),N=e.ref(null),H=e.ref(null),M=e.ref(null),X=e.ref(null),U=e.ref(null),j=e.ref(0),O=e.ref(0),t=e.computed({get:()=>G(),set:l=>l});function G(){const l=pe.useNestedProp({userConfig:y.config,defaultConfig:me});return l.theme?{...pe.useNestedProp({userConfig:n.themes.vue_ui_vertical_bar[l.theme]||y.config,defaultConfig:l}),customPalette:n.themePalettes[l.theme]||n.palette}:l}e.watch(()=>y.config,l=>{t.value=G(),te(),j.value+=1,O.value+=1,s.value=t.value.style.chart.layout.bars.height,c.value=t.value.style.chart.layout.bars.gap},{deep:!0}),e.watch(()=>y.dataset,P,{deep:!0});const{isPrinting:W,isImaging:Y,generatePdf:K,generateImage:J}=ve.usePrinter({elementId:`vue-ui-vertical-bar_${C.value}`,fileName:t.value.style.chart.title.text||"vue-ui-vertical-bar"}),Ce=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),Q=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),Z=e.ref(null),ee=e.ref(!1),_e=e.computed(()=>t.value.table.responsiveBreakpoint),L=e.ref(null);e.onMounted(()=>{te()});function te(){if(n.objectIsEmpty(y.dataset)&&n.error({componentName:"VueUiVerticalBar",type:"dataset"}),E.value=y.dataset.flatMap(l=>l.children&&l.children.length>0?l.children.length:1).reduce((l,o)=>l+o,0),xe(),t.value.responsive){const l=de.throttle(()=>{const{width:o,height:a}=de.useResponsive({chart:N.value,title:t.value.style.chart.title.text?H.value:null,legend:t.value.style.chart.legend.show?M.value:null,source:X.value,noTitle:U.value});oe.value=o,s.value=a/E.value-c.value*2});L.value=new ResizeObserver(l),L.value.observe(N.value.parentNode)}}e.onBeforeUnmount(()=>{L.value&&L.value.disconnect()});function xe(){new ResizeObserver(o=>{o.forEach(a=>{ee.value=a.contentRect.width<_e.value})}).observe(Z.value)}const p=e.ref({showTable:t.value.table.show,sortDesc:t.value.style.chart.layout.bars.sort==="desc",showTooltip:t.value.style.chart.tooltip.show}),le=e.computed(()=>p.value.sortDesc),_=e.computed(()=>(y.dataset.forEach((l,o)=>{!l.value&&!l.children&&n.error({componentName:"VueUiVerticalBar",type:"datasetAttributeEmpty",property:`value (index ${o})`}),l.children&&(n.objectIsEmpty(l.children)?n.error({componentName:"VueUiVerticalBar",type:"datasetAttributeEmpty",property:`children (index ${o})`}):l.children.forEach((a,r)=>{[null,void 0].includes(a.name)&&n.error({componentName:"VueUiVerticalBar",type:"datasetSerieAttribute",property:"name",key:"children",index:r})}))}),y.dataset.map((l,o)=>{const a=`vertical_parent_${o}_${C.value}`,r=l.children&&l.children.length>0,v=n.checkNaN(l.value?l.value:r?l.children.map(h=>h.value||0).reduce((h,b)=>h+b,0):0),i=v>=0?1:-1;return{...l,id:a,shape:"square",opacity:f.value.includes(a)?.5:1,value:Math.abs(v),sign:i,hasChildren:r,isChild:!1,segregate:()=>S(a),isSegregated:f.value.includes(a),color:n.convertColorToHex(l.color)||Q.value[o]||n.palette[o]||n.palette[o%n.palette.length],children:!l.children||!l.children.length?[]:l.children.toSorted((h,b)=>le.value?b.value-h.value:h.value-b.value).map((h,b)=>({...h,value:n.checkNaN(Math.abs(h.value)),sign:h.value>=0?1:-1,isChild:!0,parentId:a,parentName:l.name,parentValue:v,parentSign:i,id:`vertical_child_${o}_${b}_${C.value}`,childIndex:b,color:n.convertColorToHex(h.color)||n.convertColorToHex(l.color)||Q.value[o]||n.palette[o]||n.palette[o%n.palette.length]})).map((h,b)=>({...h,isFirstChild:b===0,isLastChild:b===l.children.length-1}))}}).toSorted((l,o)=>le.value?o.value-l.value:l.value-o.value))),ae=e.computed(()=>({cy:"vertical-bar-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),s=e.ref(t.value.style.chart.layout.bars.height),c=e.ref(t.value.style.chart.layout.bars.gap),Ne=e.computed(()=>(s.value+c.value)*E.value),oe=e.ref(512),d=e.computed(()=>({width:oe.value,height:Ne.value,padding:{top:12,left:128+t.value.style.chart.layout.bars.offsetX,right:64+t.value.style.chart.layout.bars.paddingRight,bottom:12}})),u=e.computed(()=>({fullHeight:d.value.padding.top+d.value.padding.bottom+d.value.height,top:d.value.padding.top,left:d.value.padding.left,right:d.value.width-d.value.padding.right,bottom:d.value.padding.top+d.value.height,width:d.value.width-(d.value.padding.left+d.value.padding.right)}));function P(){E.value=x.value.flatMap(l=>l.children&&l.children.length>0?l.children.length:1).reduce((l,o)=>l+o,0)}const f=e.ref([]);function S(l){f.value.includes(l)?f.value=f.value.filter(o=>o!==l):f.value.push(l),P(),fe("selectLegend",x.value)}const x=e.computed(()=>_.value.filter(l=>!f.value.includes(l.id))),m=e.computed(()=>x.value.map(l=>Math.abs(l.value)).reduce((l,o)=>l+o,0));function ne(l,o=!1,a=0){return o?n.dataLabel({v:n.checkNaN(Math.abs(l)/m.value*100),s:"%",r:a}):Math.abs(l)/m.value}const w=e.computed(()=>x.value.flatMap(l=>l.hasChildren?l.children:l)),$=e.computed(()=>w.value.map(l=>l.sign).includes(-1)),we=e.computed(()=>Math.max(...x.value.flatMap(l=>l.children&&l.children.length?Math.max(...l.children.map(o=>o.value)):l.value)));function k(l){const o=l/we.value;return u.value.width/($.value?2:1)*o}function $e(l){return k(l)+u.value.left}function V(l,o){const a=x.value.find(i=>i.id===l.parentId),r=u.value.top+(c.value+s.value)*o,v=a.children.length*(c.value+s.value);return{y:r+v/2-t.value.style.chart.layout.bars.parentLabels.fontSize,name:a.name,value:[void 0,NaN,null].includes(a.value)?"":a.sign===1?a.value:-a.value,percentageToTotal:isNaN(a.value/m.value)?"":ne(a.value,!0,t.value.style.chart.layout.bars.dataLabels.percentage.roundingPercentage),sign:a.sign}}function Se(){return x.value}const I=e.ref(null),A=e.ref(null);function Ve(l,o){A.value={datapoint:l,seriesIndex:o,series:_.value,config:t.value},D.value=!0,I.value=l.id;let a="";const r=l.isChild?l.parentName:l.name,v=l.isChild?l.name:"",i=t.value.style.chart.tooltip.customFormat;n.isFunction(i)&&n.functionReturnsString(()=>i({datapoint:l,series:_.value,config:t.value,seriesIndex:o}))?F.value=i({datapoint:l,series:_.value,config:t.value,seriesIndex:o}):(a+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;text-align:left;">
2
2
  <div style="display:flex;align-items:center;gap:4px;"><svg viewBox="0 0 12 12" height="14" width="14"><rect x="0" y="0" height="12" width="12" rx="2" stroke="none" fill="${l.color}"/></svg> ${r}</div>
3
3
  ${v?`<div>${v}</div>`:""}
4
4
  </div>`,t.value.style.chart.tooltip.showValue&&(a+=`<div>${t.value.translations.value}: <b>${n.applyDataLabel(t.value.style.chart.layout.bars.dataLabels.value.formatter,l.sign===1?l.value:-l.value,n.dataLabel({p:t.value.style.chart.tooltip.prefix,v:l.sign===1?l.value:-l.value,s:t.value.style.chart.tooltip.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:l,seriesIndex:o})}</b></div>`),t.value.style.chart.tooltip.showPercentage&&(a+=`<div>${t.value.translations.percentageToTotal} : <b>${n.dataLabel({v:Math.abs(l.value)/m.value*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage})}</b></div>`,l.isChild&&(a+=`<div>${t.value.translations.percentageToSerie}: <b>${n.dataLabel({v:Math.abs(l.value)/Math.abs(l.parentValue)*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage})}</b></div>`)),F.value=`<div style="text-align:left">${a}</div>`)}function re(l,o,a,r){if(!t.value.style.chart.layout.bars.dataLabels.value.show)return"";const v=n.applyDataLabel(t.value.style.chart.layout.bars.dataLabels.value.formatter,n.checkNaN(r===-1&&l>=0?-l:l),n.dataLabel({p:t.value.style.chart.layout.bars.dataLabels.value.prefix,v:n.checkNaN(r===-1&&l>=0?-l:l),s:t.value.style.chart.layout.bars.dataLabels.value.suffix,r:t.value.style.chart.layout.bars.dataLabels.value.roundingValue}),{datapoint:o,seriesIndex:a}),i=`(${ne(l,!0,t.value.style.chart.layout.bars.dataLabels.percentage.roundingPercentage)})`;return`${v}${t.value.style.chart.layout.bars.dataLabels.percentage.show?` ${i}`:""}`}const g=e.computed(()=>{const l=[t.value.translations.parentName,t.value.translations.value,t.value.translations.percentageToTotal,t.value.translations.childName,t.value.translations.value,t.value.translations.percentageToSerie,t.value.translations.percentageToTotal],o=w.value.map(a=>a.isChild?a.isFirstChild?{color:a.color,parentName:a.parentName,parentValue:a.parentValue,percentageToTotal:a.parentValue/m.value,childName:a.name,childValue:a.sign===1?a.value:-a.value,childPercentageToParent:Math.abs(a.value)/Math.abs(a.parentValue),childPercentageToTotal:Math.abs(a.value)/m.value}:{color:"",parentName:"",parentValue:"",percentageToTotal:"",childName:a.name,childValue:a.sign===1?a.value:-a.value,childPercentageToParent:Math.abs(a.value)/Math.abs(a.parentValue),childPercentageToTotal:Math.abs(a.value)/m.value}:{color:a.color,parentName:a.name,parentValue:a.sign===1?a.value:-a.value,percentageToTotal:Math.abs(a.value)/m.value,childName:"",childValue:"",childPercentageToParent:"",childPercentageToTotal:""});return{head:l,body:o}});function ue(){const l=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[""]],o=g.value.head,a=g.value.body.map(i=>[i.parentName,i.parentValue,i.percentageToTotal,i.childName,i.childValue,i.childPercentageToParent,i.childPercentageToTotal]),r=l.concat([o]).concat(a),v=n.createCsvContent(r);n.downloadCsv({csvContent:v,title:t.value.style.chart.title.text||"vue-ui-vertical-bar"})}const T=e.ref(!1);function Te(l){T.value=l,q.value+=1}function se(){p.value.showTable=!p.value.showTable}function ie(){p.value.sortDesc=!p.value.sortDesc,P()}function ce(){p.value.showTooltip=!p.value.showTooltip}const z=e.ref(!1);function R(){z.value=!z.value}return ge({getData:Se,recalculateHeight:P,generatePdf:K,generateCsv:ue,generateImage:J,toggleTable:se,toggleSort:ie,toggleTooltip:ce,toggleAnnotator:R}),(l,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-vertical-bar ${T.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),ref_key:"verticalBarChart",ref:N,id:`vue-ui-vertical-bar_${C.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height: 100%":""}`)},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Fe.PenAndPaper,{key:0,parent:N.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:z.value,onClose:R},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),Ce.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:U,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:H,style:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(Be._sfc_main,{key:`title_${j.value}`,config:{title:{cy:"vertical-bar-div-title",...t.value.style.chart.title},subtitle:{cy:"vertical-bar-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&B.value?(e.openBlock(),e.createBlock(ve.UserOptions,{ref_key:"details",ref:be,key:`user_options_${q.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(Y),isPrinting:e.unref(W),uid:C.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasSort:t.value.userOptions.buttons.sort,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:T.value,isTooltip:p.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:N.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:z.value,onToggleFullscreen:Te,onGeneratePdf:e.unref(K),onGenerateCsv:ue,onGenerateImage:e.unref(J),onToggleTable:se,onToggleSort:ie,onToggleTooltip:ce,onToggleAnnotator:R},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionLabels?{name:"optionLabels",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionLabels",{},void 0,!0)]),key:"5"}:void 0,l.$slots.optionSort?{name:"optionSort",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionSort",{},void 0,!0)]),key:"6"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:r})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:r})),void 0,!0)]),key:"7"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:a,isAnnotator:r})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:a,isAnnotator:r})),void 0,!0)]),key:"8"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasSort","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),t.value.style.chart.legend.show&&t.value.style.chart.legend.position==="top"?(e.openBlock(),e.createElementBlock("div",{key:4,ref_key:"chartLegend",ref:M},[(e.openBlock(),e.createBlock(he.Legend,{key:`legend_top_${O.value}`,legendSet:_.value,config:ae.value,onClickMarker:o[0]||(o[0]=({legend:a})=>S(a.id))},{item:e.withCtx(({legend:a,index:r})=>[e.createElementVNode("div",{"data-cy-legend-item":"",onClick:v=>S(a.id),style:e.normalizeStyle(`opacity:${f.value.includes(a.id)?.5:1}`)},e.toDisplayString(a.name)+": "+e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.bars.dataLabels.value.formatter,a.value,e.unref(n.dataLabel)({p:t.value.style.chart.legend.prefix,v:a.value,s:t.value.style.chart.legend.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:a,seriesIndex:r})),13,Ie)]),_:1},8,["legendSet","config"]))],512)):e.createCommentVNode("",!0),B.value?(e.openBlock(),e.createElementBlock("svg",{key:5,xmlns:e.unref(n.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":T.value,"vue-data-ui-fulscreen--off":!T.value}),viewBox:`0 0 ${d.value.width<=0?10:d.value.width} ${u.value.fullHeight<=0?10:u.value.fullHeight}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(De._sfc_main),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(a,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{x1:"0%",y1:"0%",x2:"100%",y2:"0%",id:`vertical_bar_gradient_${C.value}_${r}`},[e.createElementVNode("stop",{offset:"0%","stop-color":a.color},null,8,qe),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(n.setOpacity)(e.unref(n.shiftHue)(a.color,.03),100-t.value.style.chart.layout.bars.gradientIntensity)},null,8,He)],8,Re))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(a,r)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:e.unref(n.checkNaN)($.value?u.value.left+u.value.width/2-(a.sign===1?0:k(a.value)<=0?1e-4:k(a.value)):u.value.left),y:u.value.top+(c.value+s.value)*r,width:e.unref(n.checkNaN)(k(a.value)<=0?1e-4:k(a.value)),height:s.value<=0?1e-4:s.value,fill:t.value.style.chart.layout.bars.underlayerColor,rx:t.value.style.chart.layout.bars.borderRadius,class:e.normalizeClass({animated:t.value.useCssAnimation})},null,10,Xe)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(a,r)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:e.unref(n.checkNaN)($.value?u.value.left+u.value.width/2-(a.sign===1?0:k(a.value)<=0?1e-4:k(a.value)):u.value.left),y:u.value.top+(c.value+s.value)*r,width:e.unref(n.checkNaN)(k(a.value)<=0?1e-4:k(a.value)),height:s.value<=0?1e-4:s.value,fill:t.value.style.chart.layout.bars.useGradient?`url(#vertical_bar_gradient_${C.value}_${r})`:e.unref(n.setOpacity)(a.color,t.value.style.chart.layout.bars.fillOpacity),rx:t.value.style.chart.layout.bars.borderRadius,stroke:t.value.style.chart.layout.bars.useStroke?a.color:"none","stroke-width":t.value.style.chart.layout.bars.useStroke?t.value.style.chart.layout.bars.strokeWidth:0,class:e.normalizeClass({animated:t.value.useCssAnimation})},null,10,Ue),(!a.isChild||a.isLastChild)&&t.value.style.chart.layout.separators.show&&r!==w.value.length-1?(e.openBlock(),e.createElementBlock("line",{key:0,x1:0,x2:u.value.left,y1:s.value+c.value/2+u.value.top+(c.value+s.value)*r,y2:s.value+c.value/2+u.value.top+(c.value+s.value)*r,stroke:t.value.style.chart.layout.separators.color,"stroke-width":t.value.style.chart.layout.separators.strokeWidth,"stroke-linecap":"round"},null,8,je)):e.createCommentVNode("",!0),$.value&&t.value.style.chart.layout.separators.show?(e.openBlock(),e.createElementBlock("line",{key:1,x1:u.value.left+u.value.width/2,x2:u.value.left+u.value.width/2,y1:u.value.top,y2:u.value.bottom,stroke:t.value.style.chart.layout.separators.color,"stroke-width":t.value.style.chart.layout.separators.strokeWidth,"stroke-linecap":"round"},null,8,Ge)):e.createCommentVNode("",!0),e.createElementVNode("text",{x:$.value?u.value.left+u.value.width/2+(a.sign===1?-12:12)+(a.sign===1?-t.value.style.chart.layout.bars.dataLabels.offsetX:t.value.style.chart.layout.bars.dataLabels.offsetX):$e(a.value)+3+t.value.style.chart.layout.bars.dataLabels.offsetX,y:u.value.top+(c.value+s.value)*r+s.value/2+t.value.style.chart.layout.bars.dataLabels.fontSize/2,"text-anchor":!$.value||a.sign===-1?"start":"end","font-size":t.value.style.chart.layout.bars.dataLabels.fontSize,fill:t.value.style.chart.layout.bars.dataLabels.color,"font-weight":t.value.style.chart.layout.bars.dataLabels.bold?"bold":"normal"},e.toDisplayString(re(a.value,a,r,a.sign)),9,We),(a.isChild||!a.hasChildren)&&t.value.style.chart.layout.bars.nameLabels.show?(e.openBlock(),e.createElementBlock("text",{key:2,"text-anchor":"end",x:u.value.left-3+t.value.style.chart.layout.bars.nameLabels.offsetX,y:u.value.top+(c.value+s.value)*r+s.value/2+t.value.style.chart.layout.bars.nameLabels.fontSize/2,"font-size":t.value.style.chart.layout.bars.nameLabels.fontSize,fill:t.value.style.chart.layout.bars.nameLabels.color,"font-weight":t.value.style.chart.layout.bars.nameLabels.bold?"bold":"normal"},e.toDisplayString(a.name),9,Ye)):e.createCommentVNode("",!0),a.isChild&&a.childIndex===0&&t.value.style.chart.layout.bars.parentLabels.show?(e.openBlock(),e.createElementBlock("text",{key:3,x:3+t.value.style.chart.layout.bars.parentLabels.offsetX,y:V(a,r).y,"font-size":t.value.style.chart.layout.bars.parentLabels.fontSize,fill:t.value.style.chart.layout.bars.parentLabels.color,"font-weight":t.value.style.chart.layout.bars.parentLabels.bold?"bold":"normal","text-anchor":"start"},e.toDisplayString(V(a,r).name),9,Ke)):e.createCommentVNode("",!0),a.isChild&&a.childIndex===0&&t.value.style.chart.layout.bars.parentLabels.show?(e.openBlock(),e.createElementBlock("text",{key:4,x:3+t.value.style.chart.layout.bars.parentLabels.offsetX,y:V(a,r).y+t.value.style.chart.layout.bars.parentLabels.fontSize+6,"font-size":t.value.style.chart.layout.bars.parentLabels.fontSize,fill:t.value.style.chart.layout.bars.parentLabels.color,"font-weight":t.value.style.chart.layout.bars.dataLabels.bold?"bold":"normal","text-anchor":"start"},e.toDisplayString(re(V(a,r).value),V(a,r),r,a.parentSign||a.sign),9,Je)):e.createCommentVNode("",!0),e.createElementVNode("rect",{"data-cy-trap":"",x:0,y:u.value.top+(c.value+s.value)*r-c.value/2,width:d.value.width<=0?1e-4:d.value.width,height:s.value+c.value<=0?1e-4:s.value+c.value,fill:I.value===a.id?e.unref(n.setOpacity)(t.value.style.chart.layout.highlighter.color,t.value.style.chart.layout.highlighter.opacity):"transparent",onMouseenter:v=>Ve(a,r),onMouseleave:o[1]||(o[1]=v=>{ke.value=null,D.value=!1,I.value=null})},null,40,Qe)]))),256)),e.renderSlot(l.$slots,"svg",{svg:d.value},void 0,!0)],14,Ae)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ze,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(W)||e.unref(Y)})),void 0,!0)])):e.createCommentVNode("",!0),B.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Le.default,{key:7,config:{type:"verticalBar",style:{backgroundColor:t.value.style.chart.backgroundColor,verticalBar:{axis:{color:"#CCCCCC"},color:"#CCCCCC"}}}},null,8,["config"])),t.value.style.chart.legend.show&&t.value.style.chart.legend.position==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:8,ref_key:"chartLegend",ref:M},[(e.openBlock(),e.createBlock(he.Legend,{key:`legend_bottom_${O.value}`,legendSet:_.value,config:ae.value,onClickMarker:o[2]||(o[2]=({legend:a})=>S(a.id))},{item:e.withCtx(({legend:a,index:r})=>[e.createElementVNode("div",{onClick:v=>S(a.id),style:e.normalizeStyle(`opacity:${f.value.includes(a.id)?.5:1}`)},e.toDisplayString(a.name)+": "+e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.bars.dataLabels.value.formatter,a.value,e.unref(n.dataLabel)({p:t.value.style.chart.legend.prefix,v:a.value,s:t.value.style.chart.legend.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:a,seriesIndex:r})),13,et)]),_:1},8,["legendSet","config"]))],512)):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"legend",{legend:_.value},void 0,!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:9,ref_key:"source",ref:X,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(Ee._sfc_main,{show:p.value.showTooltip&&D.value&&f.value.length<y.dataset.length,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,fontSize:t.value.style.chart.tooltip.fontSize,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:N.value,content:F.value,isCustom:t.value.style.chart.tooltip.customFormat&&typeof t.value.style.chart.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...A.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...A.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isCustom"]),B.value?(e.openBlock(),e.createBlock(ze.default,{key:10,hideDetails:"",config:{open:p.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"tableContainer",ref:Z,class:"vue-ui-vertical-bar-table"},[e.createElementVNode("div",tt,[e.createElementVNode("div",{role:"button",tabindex:"0",style:e.normalizeStyle(`width:32px; position: absolute; top: 0; right:4px; padding: 0 0px; display: flex; align-items:center;justify-content:center;height: 36px; width: 32px; cursor:pointer; background:${t.value.table.th.backgroundColor};`),onClick:o[3]||(o[3]=a=>p.value.showTable=!1),onKeypress:o[4]||(o[4]=e.withKeys(a=>p.value.showTable=!1,["enter"]))},[e.createVNode(Pe.default,{name:"close",stroke:t.value.table.th.color,"stroke-width":2},null,8,["stroke"])],36),e.createElementVNode("div",{style:{width:"100%","container-type":"inline-size"},class:e.normalizeClass({"vue-ui-responsive":ee.value})},[e.createElementVNode("table",lt,[e.createElementVNode("caption",{style:e.normalizeStyle({backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline}),class:"vue-ui-data-table__caption"},[e.createTextVNode(e.toDisplayString(t.value.style.chart.title.text)+" ",1),t.value.style.chart.title.subtitle.text?(e.openBlock(),e.createElementBlock("span",at,e.toDisplayString(t.value.style.chart.title.subtitle.text),1)):e.createCommentVNode("",!0)],4),e.createElementVNode("thead",null,[e.createElementVNode("tr",{role:"row",style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value.head,a=>(e.openBlock(),e.createElementBlock("th",{style:e.normalizeStyle(`outline:${t.value.table.th.outline}`)},[e.createElementVNode("div",ot,e.toDisplayString(a),1)],4))),256))],4),e.createElementVNode("tr",null,[e.createElementVNode("th",{style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline}`)},null,4),e.createElementVNode("th",{style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline};text-align:right;padding-right:5px;font-weight:bold`)},"∑ "+e.toDisplayString(t.value.table.td.prefix)+e.toDisplayString(isNaN(m.value)?"":m.value.toFixed(t.value.table.td.roundingValue))+e.toDisplayString(t.value.table.td.suffix),5),e.createElementVNode("th",{style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline};text-align:right;padding-right:5px;font-weight:bold`)},"100%",4),e.createElementVNode("th",{style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline}`)},null,4),e.createElementVNode("th",{style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline}`)},null,4),e.createElementVNode("th",{style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline}`)},null,4),e.createElementVNode("th",{style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline}`)},null,4)])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value.body,(a,r)=>(e.openBlock(),e.createElementBlock("tr",{class:e.normalizeClass({"vue-ui-data-table__tbody__row":!0,"vue-ui-data-table__tbody__row-even":r%2===0,"vue-ui-data-table__tbody__row-odd":r%2!==0}),style:e.normalizeStyle(`background:${t.value.table.td.backgroundColor};color:${t.value.table.td.color}`)},[e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline};font-variant-numeric: tabular-nums;`),"data-cell":g.value.head[0]??""},[e.createElementVNode("div",rt,[a.color?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(`color:${a.color};margin-right:3px`)},"⬤",4)):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(a.parentName),1)])],12,nt),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":g.value.head[1]??""},[e.createElementVNode("div",st,e.toDisplayString(t.value.table.td.prefix)+e.toDisplayString(["",NaN,void 0].includes(a.parentValue)?"":a.parentValue.toFixed(t.value.table.td.roundingValue))+e.toDisplayString(t.value.table.td.suffix),1)],12,ut),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":g.value.head[2]??""},[e.createElementVNode("div",ct,e.toDisplayString(["",NaN,void 0].includes(a.percentageToTotal)?"":`${(a.percentageToTotal*100).toFixed(t.value.table.td.roundingPercentage)}%`),1)],12,it),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":g.value.head[3]??""},[e.createElementVNode("div",vt,e.toDisplayString(a.childName),1)],12,dt),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":g.value.head[4]??""},[e.createElementVNode("div",pt,e.toDisplayString(t.value.table.td.prefix)+e.toDisplayString(["",NaN,void 0].includes(a.childValue)?"":a.childValue.toFixed(t.value.table.td.roundingValue))+e.toDisplayString(t.value.table.td.suffix),1)],12,ht),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":g.value.head[5]??""},[e.createElementVNode("div",gt,e.toDisplayString(["",NaN,void 0].includes(a.childPercentageToParent)?"":`${(a.childPercentageToParent*100).toFixed(t.value.table.td.roundingPercentage)}%`),1)],12,yt),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":g.value.head[6]??""},[e.createElementVNode("div",mt,e.toDisplayString(["",NaN,void 0].includes(a.childPercentageToTotal)?"":`${(a.childPercentageToTotal*100).toFixed(t.value.table.td.roundingPercentage)}%`),1)],12,ft)],6))),256))])])],2)])],512)]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,Oe))}},kt=Me._export_sfc(bt,[["__scopeId","data-v-0976c0bc"]]);exports.default=kt;
@@ -1,16 +1,16 @@
1
1
  import { computed as v, ref as c, watch as Ae, onMounted as Ke, onBeforeUnmount as Je, openBlock as s, createElementBlock as n, normalizeClass as ze, normalizeStyle as Z, createBlock as N, createCommentVNode as f, unref as h, createSlots as Qe, withCtx as m, renderSlot as g, normalizeProps as D, guardReactiveProps as G, createVNode as Fe, createElementVNode as k, Fragment as I, renderList as R, toDisplayString as S, createTextVNode as Ne, nextTick as Ze, pushScopeId as et, popScopeId as tt } from "vue";
2
- import { u as at, c as lt, t as ot, a as ut, p as O, o as st, e as se, g as rt, b as nt, i as U, f as x, X as it, s as ct, w as vt, F as dt, K as ht, d as pt, x as yt, y as ft, q as gt, r as mt } from "./index-hV0hU1iE.js";
2
+ import { u as at, c as lt, t as ot, a as ut, p as O, o as st, e as se, g as rt, b as nt, i as U, f as x, X as it, s as ct, w as vt, F as dt, K as ht, d as pt, x as yt, y as ft, q as gt, r as mt } from "./index-D020Kb3z.js";
3
3
  import { t as bt, u as wt } from "./useResponsive-CoxXLe23.js";
4
- import { _ as kt } from "./Title-DBozX6nP.js";
5
- import { u as xt, U as Ct } from "./usePrinter-y3d31M4g.js";
6
- import { _ as _t } from "./Tooltip-Com_T8vc.js";
7
- import { D as $t } from "./DataTable-BpVz3DBX.js";
8
- import { L as Tt } from "./Legend-hnLfwhmm.js";
9
- import It from "./vue-ui-skeleton-BY8Jg9a_.js";
10
- import St from "./vue-ui-accordion-m-s-7akB.js";
11
- import { u as Oe } from "./useNestedProp-CRAUOmT5.js";
12
- import { _ as Pt } from "./PackageVersion-wqab02xF.js";
13
- import { P as Lt } from "./PenAndPaper-C_laA5mt.js";
4
+ import { _ as kt } from "./Title-B2orjUIW.js";
5
+ import { u as xt, U as Ct } from "./usePrinter-CN0J0NFL.js";
6
+ import { _ as _t } from "./Tooltip-CXjc5vb3.js";
7
+ import { D as $t } from "./DataTable-Ce4R8v-3.js";
8
+ import { L as Tt } from "./Legend-C6q2bLVV.js";
9
+ import It from "./vue-ui-skeleton-E1-7diF5.js";
10
+ import St from "./vue-ui-accordion-B0fEWLwn.js";
11
+ import { u as Oe } from "./useNestedProp-CZkNAGQh.js";
12
+ import { _ as Pt } from "./PackageVersion-g2UOsY7H.js";
13
+ import { P as Lt } from "./PenAndPaper-DRFeGfqV.js";
14
14
  import { _ as At } from "./_plugin-vue_export-helper-CHgC5LLL.js";
15
15
  const Be = (j) => (et("data-v-b51c7605"), j = j(), tt(), j), zt = ["id"], Ft = ["xmlns", "viewBox"], Nt = ["id"], Ot = ["stop-color"], Bt = ["stop-color"], Vt = ["id"], Mt = /* @__PURE__ */ Be(() => /* @__PURE__ */ k("feGaussianBlur", {
16
16
  in: "SourceGraphic",
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-CsQwCVqU.cjs"),pe=require("./useResponsive-BJ7DTGpm.cjs"),Le=require("./Title-BRqTk-nT.cjs"),he=require("./usePrinter-O2fMMTMe.cjs"),Pe=require("./Tooltip-DvGSIp31.cjs"),Ve=require("./DataTable-H-KTkjfv.cjs"),Ee=require("./Legend-G5Zc4QaZ.cjs"),Ie=require("./vue-ui-skeleton-DsRTbz6d.cjs"),ze=require("./vue-ui-accordion-CaktYQoo.cjs"),fe=require("./useNestedProp-DSYpaLxP.cjs"),Fe=require("./PackageVersion-BbQFSVXm.cjs"),Ae=require("./PenAndPaper-BX8pR5oV.cjs"),Oe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ye=N=>(e.pushScopeId("data-v-b51c7605"),N=N(),e.popScopeId(),N),De=["id"],qe=["xmlns","viewBox"],Me=["id"],Re=["stop-color"],Ue=["stop-color"],je=["id"],Ge=ye(()=>e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:2},null,-1)),We=ye(()=>e.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1)),He=[Ge,We],Ye=["x","y","height","width"],Xe=["height","width"],Je=["rx","x","y","height","width","stroke","stroke-width","filter"],Ke=["rx","x","y","height","width","fill","stroke","stroke-width","filter"],Qe=["x","y","height","width","filter"],Ze={key:0},et={key:1},tt={key:2},lt={key:3},at=["onMouseover","x","y","height","width"],ot={key:5,class:"vue-data-ui-watermark"},rt=["onClick"],ut={key:0},nt={key:1},st=["innerHTML"],it={__name:"vue-ui-waffle",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(N,{expose:ge,emit:me}){const p=N,{vue_ui_waffle:be}=n.useConfig(),V=e.computed(()=>!!p.dataset&&p.dataset.length),b=e.ref(n.createUid()),ke=e.ref(null),A=e.ref(!1),O=e.ref(""),B=e.ref(null),U=e.ref(0),_=e.ref(null),j=e.ref(null),G=e.ref(null),W=e.ref(null),H=e.ref(null),Y=e.ref(0),X=e.ref(0),J=e.ref(0),t=e.computed({get:()=>K(),set:l=>l});function K(){const l=fe.useNestedProp({userConfig:p.config,defaultConfig:be});return l.theme?{...fe.useNestedProp({userConfig:n.themes.vue_ui_waffle[l.theme]||p.config,defaultConfig:l}),customPalette:n.themePalettes[l.theme]||n.palette}:l}e.watch(()=>p.config,l=>{t.value=K(),Q(),Y.value+=1,X.value+=1,J.value+=1},{deep:!0});const E=e.ref(null);function Q(){if(n.objectIsEmpty(p.dataset)?n.error({componentName:"VueUiWaffle",type:"dataset"}):p.dataset.forEach((l,r)=>{n.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(a=>{n.error({componentName:"VueUiWaffle",type:"datasetSerieAttribute",property:a,index:r})})}),t.value.responsive){const l=pe.throttle(()=>{const{width:r,height:a}=pe.useResponsive({chart:_.value,title:t.value.style.chart.title.text?j.value:null,legend:t.value.style.chart.legend.show?G.value:null,source:W.value,noTitle:H.value});k.value.width=r,k.value.height=a,f.value.width=r,f.value.height=a});E.value=new ResizeObserver(l),E.value.observe(_.value.parentNode)}}e.onMounted(()=>{Q()}),e.onBeforeUnmount(()=>{E.value&&E.value.disconnect()});const{isPrinting:Z,isImaging:ee,generatePdf:te,generateImage:le}=he.usePrinter({elementId:`vue-ui-waffle_${b.value}`,fileName:t.value.style.chart.title.text||"vue-ui-waffle"}),we=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),ae=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),m=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),k=e.ref({height:512,width:512}),f=e.ref({top:0,left:0,height:512,width:512}),w=e.computed(()=>(f.value.width-t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.spaceBetween)/t.value.style.chart.layout.grid.size),C=e.computed(()=>(f.value.height-t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.spaceBetween)/t.value.style.chart.layout.grid.size),$=e.computed(()=>f.value.width/t.value.style.chart.layout.grid.size),I=e.computed(()=>f.value.height/t.value.style.chart.layout.grid.size);function oe(l){const r=t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.size,a=l.reduce((h,R)=>h+R,0),o=l.map(h=>h/a*r),u=o.map(Math.floor),i=o.map(h=>h%1);let d=r-u.reduce((h,R)=>h+R,0);for(;d>0;){let h=i.indexOf(Math.max(...i));u[h]+=1,i[h]=0,d-=1}return u}function re(){return p.dataset.map((l,r)=>({...l,color:n.convertColorToHex(l.color)||ae.value[r]||n.palette[r]||n.palette[r%n.palette.length],uid:`serie_${r}`,absoluteIndex:r}))}const ue=e.computed(()=>re()),c=e.ref(ue.value);e.watch(()=>p.dataset,l=>{c.value=re()},{deep:!0});const Ce=e.computed(()=>{const l=c.value.filter((r,a)=>!v.value.includes(r.uid)).map((r,a)=>(r.values||[]).reduce((o,u)=>o+u,0));return oe(l)}),xe=e.computed(()=>{const l=c.value.map((r,a)=>(r.values||[]).reduce((o,u)=>o+u));return oe(l)}),T=e.computed(()=>(p.dataset.forEach((l,r)=>{[null,void 0].includes(l.values)&&n.error({componentName:"VueUiWaffle",type:"datasetSerieAttribute",property:"values (number[])",index:r})}),c.value.filter((l,r)=>!v.value.includes(l.uid)).map((l,r)=>({absoluteIndex:l.absoluteIndex,uid:l.uid,name:l.name,color:l.color,value:(l.values||[]).reduce((a,o)=>a+o,0),absoluteValues:l.values||[],proportion:Ce.value[r]})))),Be=e.computed(()=>c.value.map((l,r)=>({absoluteIndex:l.absoluteIndex,uid:l.uid,name:l.name,color:l.color,value:(l.values||[]).reduce((a,o)=>a+o,0),absoluteValues:l.values||[],proportion:xe.value[r]})));function _e(){return Be.value.map(l=>({name:l.name,color:l.color,value:l.value,proportion:l.proportion}))}const Se=e.computed(()=>{let l=0;return T.value.map((r,a)=>{const o=l,u=o+r.proportion,i=[];for(let d=Math.floor(o);d<Math.floor(u);d+=1)i.push(d);return l=u,{...r,start:o,rects:i}})}),s=e.computed(()=>Se.value.flatMap((l,r)=>l.rects.map((a,o)=>({isFirst:o===0,isLongEnough:a.length>2,name:l.name,color:l.color,value:l.value,serieIndex:r,absoluteStartIndex:o<3,serieId:l.uid,...l}))).map((l,r)=>({...l,isAbsoluteFirst:r%t.value.style.chart.layout.grid.size===0}))),L=e.computed(()=>{const l=[];for(let r=0;r<t.value.style.chart.layout.grid.size;r+=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?r:a,x:(t.value.style.chart.layout.grid.vertical?r:a)*(w.value+t.value.style.chart.layout.grid.spaceBetween),y:(t.value.style.chart.layout.grid.vertical?a:r)*(C.value+t.value.style.chart.layout.grid.spaceBetween)+f.value.top});return l}),v=e.ref([]),x=e.ref(!1),ne=e.ref(null),se=e.ref(null);function ie(l){if(!t.value.useAnimation){v.value.includes(l)?v.value=v.value.filter(u=>u!==l):v.value.length<S.value.length-1&&S.value.length>1&&v.value.push(l);return}const r=ue.value.find(u=>u.uid===l).values.reduce((u,i)=>u+i,0);let o=c.value.find(u=>u.uid===l).values.reduce((u,i)=>u+i,0);if(v.value.includes(l)){let i=function(){o>u?(cancelAnimationFrame(ne.value),c.value=c.value.map((d,h)=>d.uid===l?{...d,values:[u]}:d),x.value=!1):(x.value=!0,o+=u*.025,c.value=c.value.map((d,h)=>d.uid===l?{...d,values:[o]}:d),ne.value=requestAnimationFrame(i))};v.value=v.value.filter(d=>d!==l);const u=r;i()}else if(v.value.length<S.value.length-1&&S.value.length>1){let u=function(){o<.1?(cancelAnimationFrame(se.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,o/=1.5,c.value=c.value.map((i,d)=>i.uid===l?{...i,values:[o]}:i),se.value=requestAnimationFrame(u))};u()}me("selectLegend",T.value.map(u=>({name:u.name,color:u.color,value:u.value,proportion:u.proportion/Math.pow(t.value.style.chart.layout.grid.size,2)})))}const S=e.computed(()=>c.value.map((l,r)=>({name:l.name,color:l.color||ae[r]||n.palette[r]||n.palette[r%n.palette.length],value:(l.values||[]).reduce((a,o)=>a+o,0),uid:l.uid,shape:"square"})).map((l,r)=>({...l,proportion:l.value/c.value.map(a=>(a.values||[]).reduce((o,u)=>o+u,0)).reduce((a,o)=>a+o,0),opacity:v.value.includes(l.uid)?.5:1,segregate:()=>ie(l.uid),isSegregated:v.value.includes(l.uid)}))),Ne=e.computed(()=>({cy:"waffle-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),y=e.computed(()=>T.value.map(l=>l.value).reduce((l,r)=>l+r,0)),D=e.ref(null);function $e(l){if(v.value.length===p.dataset.length)return;const r=s.value[l];D.value={datapoint:r,seriesIndex:r.absoluteIndex,series:c.value,config:t.value},A.value=!0,B.value=s.value[l].serieIndex;const a=t.value.style.chart.tooltip.customFormat;if(n.isFunction(a)&&n.functionReturnsString(()=>a({seriesIndex:s.value[l].absoluteIndex,datapoint:r,series:c.value,config:t.value})))O.value=a({seriesIndex:s.value[l].absoluteIndex,datapoint:r,series:c.value,config:t.value});else{let o="";if(o+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${r.name}</div>`,o+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><rect x="0" y="0" height="12" width="12" stroke="none" rx="1" fill="${r.color}" /></svg>`,t.value.style.chart.tooltip.showValue&&(o+=`<b>${n.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,r.value,n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:r.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:r,seriesIndex:s.value[l].absoluteIndex,series:c.value})}</b>`),t.value.style.chart.tooltip.showPercentage){const u=n.dataLabel({v:r.value/y.value*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage});t.value.style.chart.tooltip.showValue?o+=`<span>(${u})</span></div>`:o+=`<b>${u}%</b></div>`}O.value=o}}const g=e.computed(()=>{const l=T.value.map(a=>({name:a.name,color:a.color})),r=T.value.map(a=>a.value);return{head:l,body:r}});function q(l){return t.value.useBlurOnHover&&![null,void 0].includes(B.value)&&B.value!==l?`url(#blur_${b.value})`:""}function ce(){e.nextTick(()=>{const l=g.value.head.map((o,u)=>[[o.name],[g.value.body[u]],[isNaN(g.value.body[u]/y.value)?"-":g.value.body[u]/y.value*100]]),r=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(l),a=n.createCsvContent(r);n.downloadCsv({csvContent:a,title:t.value.style.chart.title.text||"vue-ui-waffle"})})}const z=e.computed(()=>{const l=[' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>',n.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,y.value,n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:y.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue})),"100%"],r=g.value.head.map((u,i)=>[{color:u.color,name:u.name},n.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,g.value.body[i],n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:g.value.body[i],s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue})),isNaN(g.value.body[i]/y.value)?"-":n.dataLabel({v:g.value.body[i]/y.value*100,s:"%",r:t.value.table.td.roundingPercentage})]),a={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},shape:"square",breakpoint:t.value.table.responsiveBreakpoint},o=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage];return{head:l,body:r,config:a,colNames:o}}),P=e.ref(!1);function Te(l){P.value=l,U.value+=1}function ve(){m.value.showTable=!m.value.showTable}function de(){m.value.showTooltip=!m.value.showTooltip}const F=e.ref(!1);function M(){F.value=!F.value}return ge({getData:_e,generatePdf:te,generateCsv:ce,generateImage:le,toggleTable:ve,toggleTooltip:de,toggleAnnotator:M}),(l,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-waffle ${P.value?"vue-data-ui-wrapper-fullscreen":""}`),ref_key:"waffleChart",ref:_,id:`vue-ui-waffle_${b.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height: 100%":""}`)},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Ae.PenAndPaper,{key:0,parent:_.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:F.value,onClose:M},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),we.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:H,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:j,style:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(Le._sfc_main,{key:`title_${Y.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.openBlock(),e.createBlock(he.UserOptions,{ref_key:"details",ref:ke,key:`user_options_${U.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(Z),isImaging:e.unref(ee),uid:b.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:P.value,isTooltip:m.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:_.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:F.value,onToggleFullscreen:Te,onGeneratePdf:e.unref(te),onGenerateCsv:ce,onGenerateImage:e.unref(le),onToggleTable:ve,onToggleTooltip:de,onToggleAnnotator:M},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:o})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:o})),void 0,!0)]),key:"5"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:a,isAnnotator:o})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:a,isAnnotator:o})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),V.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(n.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":P.value,"vue-data-ui-fulscreen--off":!P.value}),viewBox:`0 0 ${k.value.width<=0?10:k.value.width} ${k.value.height<=0?10:k.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Fe._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(a,o)=>(e.openBlock(),e.createElementBlock("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`gradient_${b.value}_${o}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(n.setOpacity)(e.unref(n.shiftHue)(a.color,.05),100-t.value.style.chart.layout.rect.gradientIntensity)},null,8,Re),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,Ue)],8,Me))),256))]),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${b.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},He,8,je)]),t.value.useCustomCells&&s.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(L.value,(a,o)=>(e.openBlock(),e.createElementBlock("foreignObject",{x:a.x,y:a.y,height:C.value<=0?1e-4:C.value,width:w.value<=0?1e-4:w.value,class:"vue-ui-waffle-custom-cell-foreignObject"},[e.renderSlot(l.$slots,"cell",e.normalizeProps(e.guardReactiveProps({cell:{...a,color:s.value[o].color,...s.value[o]},isSelected:[null,void 0].includes(B.value)?!0:s.value[o].serieIndex===B.value})),void 0,!0)],8,Ye))),256)):e.createCommentVNode("",!0),!s.value.length&&!t.value.useCustomCells?(e.openBlock(),e.createElementBlock("rect",{key:1,x:12,y:12,height:f.value.height-24,width:f.value.width-24,rx:3,fill:"none",stroke:"black"},null,8,Xe)):s.value.length&&!t.value.useCustomCells?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.value,(a,o)=>(e.openBlock(),e.createElementBlock("rect",{rx:t.value.style.chart.layout.rect.rounded?t.value.style.chart.layout.rect.rounding:0,x:a.x+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.grid.spaceBetween/2,height:C.value<=0?1e-4:C.value,width:w.value<=0?1e-4:w.value,fill:"white",stroke:t.value.style.chart.layout.rect.stroke,"stroke-width":t.value.style.chart.layout.rect.strokeWidth,filter:q(s.value[o].serieIndex)},null,8,Je))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.value,(a,o)=>(e.openBlock(),e.createElementBlock("rect",{rx:t.value.style.chart.layout.rect.rounded?t.value.style.chart.layout.rect.rounding:0,x:a.x+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.grid.spaceBetween/2,height:C.value<=0?1e-4:C.value,width:w.value<=0?1e-4:w.value,fill:t.value.style.chart.layout.rect.useGradient&&t.value.style.chart.layout.rect.gradientIntensity>0?`url(#gradient_${b.value}_${o})`:s.value[o].color,stroke:t.value.style.chart.layout.rect.stroke,"stroke-width":t.value.style.chart.layout.rect.strokeWidth,filter:q(s.value[o].serieIndex)},null,8,Ke))),256))],64)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.value,(a,o)=>(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[o].isFirst&&a.position<t.value.style.chart.layout.grid.size-2||s.value[o].isAbsoluteFirst&&o%t.value.style.chart.layout.grid.size===0&&s.value[o].absoluteStartIndex)?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:a.x+t.value.style.chart.layout.labels.captions.offsetX+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.labels.captions.offsetY+t.value.style.chart.layout.grid.spaceBetween/2,height:I.value<=0?1e-4:I.value,width:$.value*t.value.style.chart.layout.grid.size<=0?1e-4:$.value*t.value.style.chart.layout.grid.size,filter:q(s.value[o].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 ${$.value/12}px;color:${e.unref(n.adaptColorToBackground)(s.value[o].color)};gap:2px`)},[t.value.style.chart.layout.labels.captions.showSerieName?(e.openBlock(),e.createElementBlock("span",Ze,e.toDisplayString(t.value.style.chart.layout.labels.captions.serieNameAbbreviation?e.unref(n.abbreviate)({source:s.value[o].name,length:t.value.style.chart.layout.labels.captions.serieNameMaxAbbreviationSize}):s.value[o].name)+": ",1)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.captions.showPercentage?(e.openBlock(),e.createElementBlock("span",et,e.toDisplayString(e.unref(n.dataLabel)({v:s.value[o].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",tt," ("+e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,s.value[o].value,e.unref(n.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:s.value[o].value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.layout.labels.captions.roundingValue}),{datapoint:s.value[o],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",lt,e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,s.value[o].value,e.unref(n.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:s.value[o].value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.layout.labels.captions.roundingValue}),{datapoint:s.value[o],position:a})),1)):e.createCommentVNode("",!0)],4)],8,Qe)):e.createCommentVNode("",!0)],64))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.value,(a,o)=>(e.openBlock(),e.createElementBlock("rect",{onMouseover:u=>$e(o),onMouseleave:r[0]||(r[0]=u=>{A.value=!1,B.value=null}),x:a.x+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.grid.spaceBetween/2,height:I.value<=0?1e-4:I.value,width:$.value<=0?1e-4:$.value,fill:"transparent",stroke:"none"},null,40,at))),256)),e.renderSlot(l.$slots,"svg",{svg:k.value},void 0,!0)],14,qe)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",ot,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(Z)||e.unref(ee)})),void 0,!0)])):e.createCommentVNode("",!0),V.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ie.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:G},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(Ee.Legend,{key:`legend_${J.value}`,legendSet:S.value,config:Ne.value,onClickMarker:r[1]||(r[1]=({legend:a})=>ie(a.uid))},{item:e.withCtx(({legend:a})=>[e.createElementVNode("div",{onClick:o=>a.segregate(),style:e.normalizeStyle(`opacity:${v.value.includes(a.uid)?.5:1}`)},[e.createTextVNode(e.toDisplayString(a.name)+": "+e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,a.value,e.unref(n.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:a.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.legend.roundingValue,isAnimating:x.value}),{datapoint:a}))+" ",1),v.value.includes(a.uid)?(e.openBlock(),e.createElementBlock("span",nt," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",ut," ("+e.toDisplayString(isNaN(a.value/y.value)?"-":e.unref(n.dataLabel)({v:a.value/y.value*100,s:"%",r:t.value.style.chart.legend.roundingPercentage,isAnimating:x.value}))+") ",1))],12,rt)]),_:1},8,["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:W,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(Pe._sfc_main,{show:m.value.showTooltip&&A.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:_.value,content:O.value,isCustom:t.value.style.chart.tooltip.customFormat&&typeof t.value.style.chart.tooltip.customFormat=="function",fontSize:t.value.style.chart.tooltip.fontSize},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...D.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...D.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isCustom","fontSize"]),V.value?(e.openBlock(),e.createBlock(ze.default,{key:8,hideDetails:"",config:{open:m.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(Ve.DataTable,{key:`table_${X.value}`,colNames:z.value.colNames,head:z.value.head,body:z.value.body,config:z.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:r[2]||(r[2]=a=>m.value.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createElementVNode("div",{innerHTML:a,style:{display:"flex","align-items":"center"}},null,8,st)]),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)],14,De))}},ct=Oe._export_sfc(it,[["__scopeId","data-v-b51c7605"]]);exports.default=ct;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-3oZdQf6G.cjs"),pe=require("./useResponsive-BJ7DTGpm.cjs"),Le=require("./Title-BxrsVY3-.cjs"),he=require("./usePrinter-BKzxQK4e.cjs"),Pe=require("./Tooltip-BXc56Oxr.cjs"),Ve=require("./DataTable-DeevzR8O.cjs"),Ee=require("./Legend-BksImVUi.cjs"),Ie=require("./vue-ui-skeleton-CI8sxaqr.cjs"),ze=require("./vue-ui-accordion-QoJofzqF.cjs"),fe=require("./useNestedProp-vPTP0Wem.cjs"),Fe=require("./PackageVersion-AftniVVo.cjs"),Ae=require("./PenAndPaper-j5noaKJZ.cjs"),Oe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ye=N=>(e.pushScopeId("data-v-b51c7605"),N=N(),e.popScopeId(),N),De=["id"],qe=["xmlns","viewBox"],Me=["id"],Re=["stop-color"],Ue=["stop-color"],je=["id"],Ge=ye(()=>e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:2},null,-1)),We=ye(()=>e.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1)),He=[Ge,We],Ye=["x","y","height","width"],Xe=["height","width"],Je=["rx","x","y","height","width","stroke","stroke-width","filter"],Ke=["rx","x","y","height","width","fill","stroke","stroke-width","filter"],Qe=["x","y","height","width","filter"],Ze={key:0},et={key:1},tt={key:2},lt={key:3},at=["onMouseover","x","y","height","width"],ot={key:5,class:"vue-data-ui-watermark"},rt=["onClick"],ut={key:0},nt={key:1},st=["innerHTML"],it={__name:"vue-ui-waffle",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(N,{expose:ge,emit:me}){const p=N,{vue_ui_waffle:be}=n.useConfig(),V=e.computed(()=>!!p.dataset&&p.dataset.length),b=e.ref(n.createUid()),ke=e.ref(null),A=e.ref(!1),O=e.ref(""),B=e.ref(null),U=e.ref(0),_=e.ref(null),j=e.ref(null),G=e.ref(null),W=e.ref(null),H=e.ref(null),Y=e.ref(0),X=e.ref(0),J=e.ref(0),t=e.computed({get:()=>K(),set:l=>l});function K(){const l=fe.useNestedProp({userConfig:p.config,defaultConfig:be});return l.theme?{...fe.useNestedProp({userConfig:n.themes.vue_ui_waffle[l.theme]||p.config,defaultConfig:l}),customPalette:n.themePalettes[l.theme]||n.palette}:l}e.watch(()=>p.config,l=>{t.value=K(),Q(),Y.value+=1,X.value+=1,J.value+=1},{deep:!0});const E=e.ref(null);function Q(){if(n.objectIsEmpty(p.dataset)?n.error({componentName:"VueUiWaffle",type:"dataset"}):p.dataset.forEach((l,r)=>{n.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(a=>{n.error({componentName:"VueUiWaffle",type:"datasetSerieAttribute",property:a,index:r})})}),t.value.responsive){const l=pe.throttle(()=>{const{width:r,height:a}=pe.useResponsive({chart:_.value,title:t.value.style.chart.title.text?j.value:null,legend:t.value.style.chart.legend.show?G.value:null,source:W.value,noTitle:H.value});k.value.width=r,k.value.height=a,f.value.width=r,f.value.height=a});E.value=new ResizeObserver(l),E.value.observe(_.value.parentNode)}}e.onMounted(()=>{Q()}),e.onBeforeUnmount(()=>{E.value&&E.value.disconnect()});const{isPrinting:Z,isImaging:ee,generatePdf:te,generateImage:le}=he.usePrinter({elementId:`vue-ui-waffle_${b.value}`,fileName:t.value.style.chart.title.text||"vue-ui-waffle"}),we=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),ae=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),m=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),k=e.ref({height:512,width:512}),f=e.ref({top:0,left:0,height:512,width:512}),w=e.computed(()=>(f.value.width-t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.spaceBetween)/t.value.style.chart.layout.grid.size),C=e.computed(()=>(f.value.height-t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.spaceBetween)/t.value.style.chart.layout.grid.size),$=e.computed(()=>f.value.width/t.value.style.chart.layout.grid.size),I=e.computed(()=>f.value.height/t.value.style.chart.layout.grid.size);function oe(l){const r=t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.size,a=l.reduce((h,R)=>h+R,0),o=l.map(h=>h/a*r),u=o.map(Math.floor),i=o.map(h=>h%1);let d=r-u.reduce((h,R)=>h+R,0);for(;d>0;){let h=i.indexOf(Math.max(...i));u[h]+=1,i[h]=0,d-=1}return u}function re(){return p.dataset.map((l,r)=>({...l,color:n.convertColorToHex(l.color)||ae.value[r]||n.palette[r]||n.palette[r%n.palette.length],uid:`serie_${r}`,absoluteIndex:r}))}const ue=e.computed(()=>re()),c=e.ref(ue.value);e.watch(()=>p.dataset,l=>{c.value=re()},{deep:!0});const Ce=e.computed(()=>{const l=c.value.filter((r,a)=>!v.value.includes(r.uid)).map((r,a)=>(r.values||[]).reduce((o,u)=>o+u,0));return oe(l)}),xe=e.computed(()=>{const l=c.value.map((r,a)=>(r.values||[]).reduce((o,u)=>o+u));return oe(l)}),T=e.computed(()=>(p.dataset.forEach((l,r)=>{[null,void 0].includes(l.values)&&n.error({componentName:"VueUiWaffle",type:"datasetSerieAttribute",property:"values (number[])",index:r})}),c.value.filter((l,r)=>!v.value.includes(l.uid)).map((l,r)=>({absoluteIndex:l.absoluteIndex,uid:l.uid,name:l.name,color:l.color,value:(l.values||[]).reduce((a,o)=>a+o,0),absoluteValues:l.values||[],proportion:Ce.value[r]})))),Be=e.computed(()=>c.value.map((l,r)=>({absoluteIndex:l.absoluteIndex,uid:l.uid,name:l.name,color:l.color,value:(l.values||[]).reduce((a,o)=>a+o,0),absoluteValues:l.values||[],proportion:xe.value[r]})));function _e(){return Be.value.map(l=>({name:l.name,color:l.color,value:l.value,proportion:l.proportion}))}const Se=e.computed(()=>{let l=0;return T.value.map((r,a)=>{const o=l,u=o+r.proportion,i=[];for(let d=Math.floor(o);d<Math.floor(u);d+=1)i.push(d);return l=u,{...r,start:o,rects:i}})}),s=e.computed(()=>Se.value.flatMap((l,r)=>l.rects.map((a,o)=>({isFirst:o===0,isLongEnough:a.length>2,name:l.name,color:l.color,value:l.value,serieIndex:r,absoluteStartIndex:o<3,serieId:l.uid,...l}))).map((l,r)=>({...l,isAbsoluteFirst:r%t.value.style.chart.layout.grid.size===0}))),L=e.computed(()=>{const l=[];for(let r=0;r<t.value.style.chart.layout.grid.size;r+=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?r:a,x:(t.value.style.chart.layout.grid.vertical?r:a)*(w.value+t.value.style.chart.layout.grid.spaceBetween),y:(t.value.style.chart.layout.grid.vertical?a:r)*(C.value+t.value.style.chart.layout.grid.spaceBetween)+f.value.top});return l}),v=e.ref([]),x=e.ref(!1),ne=e.ref(null),se=e.ref(null);function ie(l){if(!t.value.useAnimation){v.value.includes(l)?v.value=v.value.filter(u=>u!==l):v.value.length<S.value.length-1&&S.value.length>1&&v.value.push(l);return}const r=ue.value.find(u=>u.uid===l).values.reduce((u,i)=>u+i,0);let o=c.value.find(u=>u.uid===l).values.reduce((u,i)=>u+i,0);if(v.value.includes(l)){let i=function(){o>u?(cancelAnimationFrame(ne.value),c.value=c.value.map((d,h)=>d.uid===l?{...d,values:[u]}:d),x.value=!1):(x.value=!0,o+=u*.025,c.value=c.value.map((d,h)=>d.uid===l?{...d,values:[o]}:d),ne.value=requestAnimationFrame(i))};v.value=v.value.filter(d=>d!==l);const u=r;i()}else if(v.value.length<S.value.length-1&&S.value.length>1){let u=function(){o<.1?(cancelAnimationFrame(se.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,o/=1.5,c.value=c.value.map((i,d)=>i.uid===l?{...i,values:[o]}:i),se.value=requestAnimationFrame(u))};u()}me("selectLegend",T.value.map(u=>({name:u.name,color:u.color,value:u.value,proportion:u.proportion/Math.pow(t.value.style.chart.layout.grid.size,2)})))}const S=e.computed(()=>c.value.map((l,r)=>({name:l.name,color:l.color||ae[r]||n.palette[r]||n.palette[r%n.palette.length],value:(l.values||[]).reduce((a,o)=>a+o,0),uid:l.uid,shape:"square"})).map((l,r)=>({...l,proportion:l.value/c.value.map(a=>(a.values||[]).reduce((o,u)=>o+u,0)).reduce((a,o)=>a+o,0),opacity:v.value.includes(l.uid)?.5:1,segregate:()=>ie(l.uid),isSegregated:v.value.includes(l.uid)}))),Ne=e.computed(()=>({cy:"waffle-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),y=e.computed(()=>T.value.map(l=>l.value).reduce((l,r)=>l+r,0)),D=e.ref(null);function $e(l){if(v.value.length===p.dataset.length)return;const r=s.value[l];D.value={datapoint:r,seriesIndex:r.absoluteIndex,series:c.value,config:t.value},A.value=!0,B.value=s.value[l].serieIndex;const a=t.value.style.chart.tooltip.customFormat;if(n.isFunction(a)&&n.functionReturnsString(()=>a({seriesIndex:s.value[l].absoluteIndex,datapoint:r,series:c.value,config:t.value})))O.value=a({seriesIndex:s.value[l].absoluteIndex,datapoint:r,series:c.value,config:t.value});else{let o="";if(o+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${r.name}</div>`,o+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><rect x="0" y="0" height="12" width="12" stroke="none" rx="1" fill="${r.color}" /></svg>`,t.value.style.chart.tooltip.showValue&&(o+=`<b>${n.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,r.value,n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:r.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:r,seriesIndex:s.value[l].absoluteIndex,series:c.value})}</b>`),t.value.style.chart.tooltip.showPercentage){const u=n.dataLabel({v:r.value/y.value*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage});t.value.style.chart.tooltip.showValue?o+=`<span>(${u})</span></div>`:o+=`<b>${u}%</b></div>`}O.value=o}}const g=e.computed(()=>{const l=T.value.map(a=>({name:a.name,color:a.color})),r=T.value.map(a=>a.value);return{head:l,body:r}});function q(l){return t.value.useBlurOnHover&&![null,void 0].includes(B.value)&&B.value!==l?`url(#blur_${b.value})`:""}function ce(){e.nextTick(()=>{const l=g.value.head.map((o,u)=>[[o.name],[g.value.body[u]],[isNaN(g.value.body[u]/y.value)?"-":g.value.body[u]/y.value*100]]),r=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(l),a=n.createCsvContent(r);n.downloadCsv({csvContent:a,title:t.value.style.chart.title.text||"vue-ui-waffle"})})}const z=e.computed(()=>{const l=[' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>',n.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,y.value,n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:y.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue})),"100%"],r=g.value.head.map((u,i)=>[{color:u.color,name:u.name},n.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,g.value.body[i],n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:g.value.body[i],s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue})),isNaN(g.value.body[i]/y.value)?"-":n.dataLabel({v:g.value.body[i]/y.value*100,s:"%",r:t.value.table.td.roundingPercentage})]),a={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},shape:"square",breakpoint:t.value.table.responsiveBreakpoint},o=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage];return{head:l,body:r,config:a,colNames:o}}),P=e.ref(!1);function Te(l){P.value=l,U.value+=1}function ve(){m.value.showTable=!m.value.showTable}function de(){m.value.showTooltip=!m.value.showTooltip}const F=e.ref(!1);function M(){F.value=!F.value}return ge({getData:_e,generatePdf:te,generateCsv:ce,generateImage:le,toggleTable:ve,toggleTooltip:de,toggleAnnotator:M}),(l,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-waffle ${P.value?"vue-data-ui-wrapper-fullscreen":""}`),ref_key:"waffleChart",ref:_,id:`vue-ui-waffle_${b.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height: 100%":""}`)},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Ae.PenAndPaper,{key:0,parent:_.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:F.value,onClose:M},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),we.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:H,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:j,style:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(Le._sfc_main,{key:`title_${Y.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.openBlock(),e.createBlock(he.UserOptions,{ref_key:"details",ref:ke,key:`user_options_${U.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(Z),isImaging:e.unref(ee),uid:b.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:P.value,isTooltip:m.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:_.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:F.value,onToggleFullscreen:Te,onGeneratePdf:e.unref(te),onGenerateCsv:ce,onGenerateImage:e.unref(le),onToggleTable:ve,onToggleTooltip:de,onToggleAnnotator:M},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:o})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:o})),void 0,!0)]),key:"5"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:a,isAnnotator:o})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:a,isAnnotator:o})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),V.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(n.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":P.value,"vue-data-ui-fulscreen--off":!P.value}),viewBox:`0 0 ${k.value.width<=0?10:k.value.width} ${k.value.height<=0?10:k.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Fe._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(a,o)=>(e.openBlock(),e.createElementBlock("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`gradient_${b.value}_${o}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(n.setOpacity)(e.unref(n.shiftHue)(a.color,.05),100-t.value.style.chart.layout.rect.gradientIntensity)},null,8,Re),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,Ue)],8,Me))),256))]),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${b.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},He,8,je)]),t.value.useCustomCells&&s.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(L.value,(a,o)=>(e.openBlock(),e.createElementBlock("foreignObject",{x:a.x,y:a.y,height:C.value<=0?1e-4:C.value,width:w.value<=0?1e-4:w.value,class:"vue-ui-waffle-custom-cell-foreignObject"},[e.renderSlot(l.$slots,"cell",e.normalizeProps(e.guardReactiveProps({cell:{...a,color:s.value[o].color,...s.value[o]},isSelected:[null,void 0].includes(B.value)?!0:s.value[o].serieIndex===B.value})),void 0,!0)],8,Ye))),256)):e.createCommentVNode("",!0),!s.value.length&&!t.value.useCustomCells?(e.openBlock(),e.createElementBlock("rect",{key:1,x:12,y:12,height:f.value.height-24,width:f.value.width-24,rx:3,fill:"none",stroke:"black"},null,8,Xe)):s.value.length&&!t.value.useCustomCells?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.value,(a,o)=>(e.openBlock(),e.createElementBlock("rect",{rx:t.value.style.chart.layout.rect.rounded?t.value.style.chart.layout.rect.rounding:0,x:a.x+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.grid.spaceBetween/2,height:C.value<=0?1e-4:C.value,width:w.value<=0?1e-4:w.value,fill:"white",stroke:t.value.style.chart.layout.rect.stroke,"stroke-width":t.value.style.chart.layout.rect.strokeWidth,filter:q(s.value[o].serieIndex)},null,8,Je))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.value,(a,o)=>(e.openBlock(),e.createElementBlock("rect",{rx:t.value.style.chart.layout.rect.rounded?t.value.style.chart.layout.rect.rounding:0,x:a.x+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.grid.spaceBetween/2,height:C.value<=0?1e-4:C.value,width:w.value<=0?1e-4:w.value,fill:t.value.style.chart.layout.rect.useGradient&&t.value.style.chart.layout.rect.gradientIntensity>0?`url(#gradient_${b.value}_${o})`:s.value[o].color,stroke:t.value.style.chart.layout.rect.stroke,"stroke-width":t.value.style.chart.layout.rect.strokeWidth,filter:q(s.value[o].serieIndex)},null,8,Ke))),256))],64)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.value,(a,o)=>(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[o].isFirst&&a.position<t.value.style.chart.layout.grid.size-2||s.value[o].isAbsoluteFirst&&o%t.value.style.chart.layout.grid.size===0&&s.value[o].absoluteStartIndex)?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:a.x+t.value.style.chart.layout.labels.captions.offsetX+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.labels.captions.offsetY+t.value.style.chart.layout.grid.spaceBetween/2,height:I.value<=0?1e-4:I.value,width:$.value*t.value.style.chart.layout.grid.size<=0?1e-4:$.value*t.value.style.chart.layout.grid.size,filter:q(s.value[o].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 ${$.value/12}px;color:${e.unref(n.adaptColorToBackground)(s.value[o].color)};gap:2px`)},[t.value.style.chart.layout.labels.captions.showSerieName?(e.openBlock(),e.createElementBlock("span",Ze,e.toDisplayString(t.value.style.chart.layout.labels.captions.serieNameAbbreviation?e.unref(n.abbreviate)({source:s.value[o].name,length:t.value.style.chart.layout.labels.captions.serieNameMaxAbbreviationSize}):s.value[o].name)+": ",1)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.captions.showPercentage?(e.openBlock(),e.createElementBlock("span",et,e.toDisplayString(e.unref(n.dataLabel)({v:s.value[o].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",tt," ("+e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,s.value[o].value,e.unref(n.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:s.value[o].value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.layout.labels.captions.roundingValue}),{datapoint:s.value[o],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",lt,e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,s.value[o].value,e.unref(n.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:s.value[o].value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.layout.labels.captions.roundingValue}),{datapoint:s.value[o],position:a})),1)):e.createCommentVNode("",!0)],4)],8,Qe)):e.createCommentVNode("",!0)],64))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.value,(a,o)=>(e.openBlock(),e.createElementBlock("rect",{onMouseover:u=>$e(o),onMouseleave:r[0]||(r[0]=u=>{A.value=!1,B.value=null}),x:a.x+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.grid.spaceBetween/2,height:I.value<=0?1e-4:I.value,width:$.value<=0?1e-4:$.value,fill:"transparent",stroke:"none"},null,40,at))),256)),e.renderSlot(l.$slots,"svg",{svg:k.value},void 0,!0)],14,qe)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",ot,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(Z)||e.unref(ee)})),void 0,!0)])):e.createCommentVNode("",!0),V.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ie.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:G},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(Ee.Legend,{key:`legend_${J.value}`,legendSet:S.value,config:Ne.value,onClickMarker:r[1]||(r[1]=({legend:a})=>ie(a.uid))},{item:e.withCtx(({legend:a})=>[e.createElementVNode("div",{onClick:o=>a.segregate(),style:e.normalizeStyle(`opacity:${v.value.includes(a.uid)?.5:1}`)},[e.createTextVNode(e.toDisplayString(a.name)+": "+e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,a.value,e.unref(n.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:a.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.legend.roundingValue,isAnimating:x.value}),{datapoint:a}))+" ",1),v.value.includes(a.uid)?(e.openBlock(),e.createElementBlock("span",nt," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",ut," ("+e.toDisplayString(isNaN(a.value/y.value)?"-":e.unref(n.dataLabel)({v:a.value/y.value*100,s:"%",r:t.value.style.chart.legend.roundingPercentage,isAnimating:x.value}))+") ",1))],12,rt)]),_:1},8,["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:W,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(Pe._sfc_main,{show:m.value.showTooltip&&A.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:_.value,content:O.value,isCustom:t.value.style.chart.tooltip.customFormat&&typeof t.value.style.chart.tooltip.customFormat=="function",fontSize:t.value.style.chart.tooltip.fontSize},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...D.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...D.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isCustom","fontSize"]),V.value?(e.openBlock(),e.createBlock(ze.default,{key:8,hideDetails:"",config:{open:m.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(Ve.DataTable,{key:`table_${X.value}`,colNames:z.value.colNames,head:z.value.head,body:z.value.body,config:z.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:r[2]||(r[2]=a=>m.value.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createElementVNode("div",{innerHTML:a,style:{display:"flex","align-items":"center"}},null,8,st)]),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)],14,De))}},ct=Oe._export_sfc(it,[["__scopeId","data-v-b51c7605"]]);exports.default=ct;
@@ -1,12 +1,12 @@
1
1
  import { computed as p, ref as n, watch as E, onMounted as oe, onBeforeUnmount as ne, openBlock as s, createElementBlock as c, normalizeStyle as R, createBlock as w, createCommentVNode as v, unref as r, createSlots as se, withCtx as b, renderSlot as f, normalizeProps as A, guardReactiveProps as I, normalizeClass as j, createVNode as re, Fragment as ue, renderList as ie, toDisplayString as ce } from "vue";
2
- import { u as ve, c as he, t as de, o as fe, e as ye, w as D, X as pe, i as ge, v as Y, f as me } from "./index-hV0hU1iE.js";
3
- import { _ as ke } from "./Title-DBozX6nP.js";
4
- import { u as we, U as be } from "./usePrinter-y3d31M4g.js";
2
+ import { u as ve, c as he, t as de, o as fe, e as ye, w as D, X as pe, i as ge, v as Y, f as me } from "./index-D020Kb3z.js";
3
+ import { _ as ke } from "./Title-B2orjUIW.js";
4
+ import { u as we, U as be } from "./usePrinter-CN0J0NFL.js";
5
5
  import { t as Ce, u as _e } from "./useResponsive-CoxXLe23.js";
6
- import $e from "./vue-ui-skeleton-BY8Jg9a_.js";
7
- import { u as H } from "./useNestedProp-CRAUOmT5.js";
8
- import { _ as xe } from "./PackageVersion-wqab02xF.js";
9
- import { P as Ae } from "./PenAndPaper-C_laA5mt.js";
6
+ import $e from "./vue-ui-skeleton-E1-7diF5.js";
7
+ import { u as H } from "./useNestedProp-CZkNAGQh.js";
8
+ import { _ as xe } from "./PackageVersion-g2UOsY7H.js";
9
+ import { P as Ae } from "./PenAndPaper-DRFeGfqV.js";
10
10
  import { _ as Ie } from "./_plugin-vue_export-helper-CHgC5LLL.js";
11
11
  const Pe = ["id"], Fe = ["xmlns", "viewBox"], Oe = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-linecap"], ze = ["cx", "cy", "r", "stroke", "stroke-width"], Se = ["x", "y", "font-size", "fill", "font-weight"], Ne = {
12
12
  key: 5,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-CsQwCVqU.cjs"),H=require("./Title-BRqTk-nT.cjs"),z=require("./usePrinter-O2fMMTMe.cjs"),O=require("./useResponsive-BJ7DTGpm.cjs"),D=require("./vue-ui-skeleton-DsRTbz6d.cjs"),F=require("./useNestedProp-DSYpaLxP.cjs"),Y=require("./PackageVersion-BbQFSVXm.cjs"),W=require("./PenAndPaper-BX8pR5oV.cjs"),J=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),K=["id"],Q=["xmlns","viewBox"],Z=["x1","x2","y1","y2","stroke","stroke-width","stroke-linecap"],ee=["cx","cy","r","stroke","stroke-width"],te=["x","y","font-size","fill","font-weight"],le={key:5,class:"vue-data-ui-watermark"},oe={__name:"vue-ui-wheel",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(E,{expose:M}){const i=E,{vue_ui_wheel:T}=r.useConfig(),p=e.computed(()=>!!i.dataset&&Object.keys(i.dataset).length),y=e.ref(r.createUid()),q=e.ref(null),k=e.ref(0),v=e.ref(null),w=e.ref(null),C=e.ref(null),b=e.ref(null),B=e.ref(0),t=e.computed({get:()=>P(),set:l=>l});function P(){const l=F.useNestedProp({userConfig:i.config,defaultConfig:T});return l.theme?{...F.useNestedProp({userConfig:r.themes.vue_ui_wheel[l.theme]||i.config,defaultConfig:l})}:l}e.watch(()=>i.config,l=>{t.value=P(),I(),B.value+=1},{deep:!0});const{isPrinting:_,isImaging:x,generatePdf:N,generateImage:S}=z.usePrinter({elementId:y.value,fileName:t.value.style.chart.title.text||"vue-ui-wheel"}),V=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),n=e.ref({size:360,height:360,width:360}),m=e.ref(t.value.style.chart.layout.percentage.fontSize),s=e.computed(()=>({radius:Math.min(n.value.width,n.value.height)*.9/2,centerX:n.value.width/2,centerY:n.value.height/2}));function A(l,c=1){return{x:s.value.centerX+s.value.radius*Math.cos(29.85+l*Math.PI/180)*c,y:s.value.centerY+s.value.radius*Math.sin(29.85+l*Math.PI/180)*c}}const a=e.ref(t.value.style.chart.animation.use?0:i.dataset.percentage||0);e.watch(()=>i.dataset,l=>{t.value.style.chart.animation.use?$(l.percentage):a.value=l.percentage||0},{deep:!0});const d=e.ref(null);e.onMounted(()=>{I()});function I(){if(r.objectIsEmpty(i.dataset)&&r.error({componentName:"VueUiWheel",type:"dataset"}),$(i.dataset.percentage||0),t.value.responsive){const l=O.throttle(()=>{const{width:c,height:o}=O.useResponsive({chart:v.value,title:t.value.style.chart.title.text?w.value:null,source:C.value,noTitle:b.value});n.value.width=c,n.value.height=o,m.value=t.value.style.chart.layout.percentage.fontSize/360*Math.min(c,o)});d.value=new ResizeObserver(l),d.value.observe(v.value.parentNode)}}e.onBeforeUnmount(()=>{d.value&&d.value.disconnect()});function $(l){let c=t.value.style.chart.animation.speed;const o=Math.abs(l-a.value)/(c*120);function u(){a.value<l?a.value=Math.min(a.value+o,l):a.value>l&&(a.value=Math.max(a.value-o,l)),a.value!==l&&requestAnimationFrame(u)}u()}const R=e.computed(()=>{const l=[];for(let o=0;o<100;o+=1){const u=a.value>o?t.value.style.chart.layout.wheel.ticks.activeColor:t.value.style.chart.layout.wheel.ticks.inactiveColor,{x:U,y:G}=A(n.value.size/100*o),{x:X,y:j}=A(n.value.size/100*o,t.value.style.chart.layout.wheel.ticks.sizeRatio);l.push({x1:U,y1:G,x2:X,y2:j,color:t.value.style.chart.layout.wheel.ticks.gradient.show?r.shiftHue(u,o/100*(t.value.style.chart.layout.wheel.ticks.gradient.shiftHueIntensity/100)):u})}return l}),h=e.ref(!1);function L(l){h.value=l,k.value+=1}const f=e.ref(!1);function g(){f.value=!f.value}return M({generatePdf:N,generateImage:S,toggleAnnotator:g}),(l,c)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-wheel",ref_key:"wheelChart",ref:v,id:y.value,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height:100%":""}`)},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(W.PenAndPaper,{key:0,parent:v.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:f.value,onClose:g},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),V.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:b,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:w,style:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(H._sfc_main,{key:`title_${B.value}`,config:{title:{cy:"wheel-title",...t.value.style.chart.title},subtitle:{cy:"wheel-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&p.value?(e.openBlock(),e.createBlock(z.UserOptions,{ref_key:"details",ref:q,key:`user_options_${k.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(_),isImaging:e.unref(x),uid:y.value,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,hasXls:!1,isFullscreen:h.value,position:t.value.userOptions.position,titles:{...t.value.userOptions.buttonTitles},hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:f.value,chartElement:v.value,onToggleFullscreen:L,onGeneratePdf:e.unref(N),onGenerateImage:e.unref(S),onToggleAnnotator:g},e.createSlots({_:2},[l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"1"}: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:"2"}: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:"3"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","position","titles","hasAnnotator","isAnnotation","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":h.value,"vue-data-ui-fulscreen--off":!h.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(Y._sfc_main),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.value,(o,u)=>(e.openBlock(),e.createElementBlock("line",{x1:o.x1,x2:o.x2,y1:o.y1,y2:o.y2,stroke:o.color,"stroke-width":5/360*Math.min(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<=a.value})},null,10,Z))),256)),t.value.style.chart.layout.innerCircle.show?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:s.value.centerX,cy:s.value.centerY,r:s.value.radius*.8<=0?1e-4:s.value.radius*.8,stroke:t.value.style.chart.layout.innerCircle.stroke,"stroke-width":t.value.style.chart.layout.innerCircle.strokeWidth,fill:"none"},null,8,ee)):e.createCommentVNode("",!0),t.value.style.chart.layout.percentage.show?(e.openBlock(),e.createElementBlock("text",{key:1,x:s.value.centerX,y:s.value.centerY+m.value/3,"font-size":m.value,fill:t.value.style.chart.layout.wheel.ticks.gradient.show?e.unref(r.shiftHue)(t.value.style.chart.layout.wheel.ticks.activeColor,a.value/100*(t.value.style.chart.layout.wheel.ticks.gradient.shiftHueIntensity/100)):t.value.style.chart.layout.wheel.ticks.activeColor,"text-anchor":"middle","font-weight":t.value.style.chart.layout.percentage.bold?"bold":"normal",style:{"font-variant-numeric":"tabluar-nums"}},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.percentage.formatter,e.unref(r.checkNaN)(a.value),e.unref(r.dataLabel)({v:e.unref(r.checkNaN)(a.value),s:"%",r:t.value.style.chart.layout.percentage.rounding}))),9,te)):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"svg",{svg:n.value},void 0,!0)],14,Q)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",le,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(_)||e.unref(x)})),void 0,!0)])):e.createCommentVNode("",!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:6,ref_key:"source",ref:C,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(D.default,{key:7,config:{type:"wheel",style:{backgroundColor:t.value.style.chart.backgroundColor,wheel:{color:"#CCCCCC"}}}},null,8,["config"]))],12,K))}},ne=J._export_sfc(oe,[["__scopeId","data-v-bc4a7284"]]);exports.default=ne;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-3oZdQf6G.cjs"),H=require("./Title-BxrsVY3-.cjs"),z=require("./usePrinter-BKzxQK4e.cjs"),O=require("./useResponsive-BJ7DTGpm.cjs"),D=require("./vue-ui-skeleton-CI8sxaqr.cjs"),F=require("./useNestedProp-vPTP0Wem.cjs"),Y=require("./PackageVersion-AftniVVo.cjs"),W=require("./PenAndPaper-j5noaKJZ.cjs"),J=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),K=["id"],Q=["xmlns","viewBox"],Z=["x1","x2","y1","y2","stroke","stroke-width","stroke-linecap"],ee=["cx","cy","r","stroke","stroke-width"],te=["x","y","font-size","fill","font-weight"],le={key:5,class:"vue-data-ui-watermark"},oe={__name:"vue-ui-wheel",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(E,{expose:M}){const i=E,{vue_ui_wheel:T}=r.useConfig(),p=e.computed(()=>!!i.dataset&&Object.keys(i.dataset).length),y=e.ref(r.createUid()),q=e.ref(null),k=e.ref(0),v=e.ref(null),w=e.ref(null),C=e.ref(null),b=e.ref(null),B=e.ref(0),t=e.computed({get:()=>P(),set:l=>l});function P(){const l=F.useNestedProp({userConfig:i.config,defaultConfig:T});return l.theme?{...F.useNestedProp({userConfig:r.themes.vue_ui_wheel[l.theme]||i.config,defaultConfig:l})}:l}e.watch(()=>i.config,l=>{t.value=P(),I(),B.value+=1},{deep:!0});const{isPrinting:_,isImaging:x,generatePdf:N,generateImage:S}=z.usePrinter({elementId:y.value,fileName:t.value.style.chart.title.text||"vue-ui-wheel"}),V=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),n=e.ref({size:360,height:360,width:360}),m=e.ref(t.value.style.chart.layout.percentage.fontSize),s=e.computed(()=>({radius:Math.min(n.value.width,n.value.height)*.9/2,centerX:n.value.width/2,centerY:n.value.height/2}));function A(l,c=1){return{x:s.value.centerX+s.value.radius*Math.cos(29.85+l*Math.PI/180)*c,y:s.value.centerY+s.value.radius*Math.sin(29.85+l*Math.PI/180)*c}}const a=e.ref(t.value.style.chart.animation.use?0:i.dataset.percentage||0);e.watch(()=>i.dataset,l=>{t.value.style.chart.animation.use?$(l.percentage):a.value=l.percentage||0},{deep:!0});const d=e.ref(null);e.onMounted(()=>{I()});function I(){if(r.objectIsEmpty(i.dataset)&&r.error({componentName:"VueUiWheel",type:"dataset"}),$(i.dataset.percentage||0),t.value.responsive){const l=O.throttle(()=>{const{width:c,height:o}=O.useResponsive({chart:v.value,title:t.value.style.chart.title.text?w.value:null,source:C.value,noTitle:b.value});n.value.width=c,n.value.height=o,m.value=t.value.style.chart.layout.percentage.fontSize/360*Math.min(c,o)});d.value=new ResizeObserver(l),d.value.observe(v.value.parentNode)}}e.onBeforeUnmount(()=>{d.value&&d.value.disconnect()});function $(l){let c=t.value.style.chart.animation.speed;const o=Math.abs(l-a.value)/(c*120);function u(){a.value<l?a.value=Math.min(a.value+o,l):a.value>l&&(a.value=Math.max(a.value-o,l)),a.value!==l&&requestAnimationFrame(u)}u()}const R=e.computed(()=>{const l=[];for(let o=0;o<100;o+=1){const u=a.value>o?t.value.style.chart.layout.wheel.ticks.activeColor:t.value.style.chart.layout.wheel.ticks.inactiveColor,{x:U,y:G}=A(n.value.size/100*o),{x:X,y:j}=A(n.value.size/100*o,t.value.style.chart.layout.wheel.ticks.sizeRatio);l.push({x1:U,y1:G,x2:X,y2:j,color:t.value.style.chart.layout.wheel.ticks.gradient.show?r.shiftHue(u,o/100*(t.value.style.chart.layout.wheel.ticks.gradient.shiftHueIntensity/100)):u})}return l}),h=e.ref(!1);function L(l){h.value=l,k.value+=1}const f=e.ref(!1);function g(){f.value=!f.value}return M({generatePdf:N,generateImage:S,toggleAnnotator:g}),(l,c)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-wheel",ref_key:"wheelChart",ref:v,id:y.value,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height:100%":""}`)},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(W.PenAndPaper,{key:0,parent:v.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:f.value,onClose:g},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),V.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:b,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:w,style:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(H._sfc_main,{key:`title_${B.value}`,config:{title:{cy:"wheel-title",...t.value.style.chart.title},subtitle:{cy:"wheel-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&p.value?(e.openBlock(),e.createBlock(z.UserOptions,{ref_key:"details",ref:q,key:`user_options_${k.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(_),isImaging:e.unref(x),uid:y.value,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,hasXls:!1,isFullscreen:h.value,position:t.value.userOptions.position,titles:{...t.value.userOptions.buttonTitles},hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:f.value,chartElement:v.value,onToggleFullscreen:L,onGeneratePdf:e.unref(N),onGenerateImage:e.unref(S),onToggleAnnotator:g},e.createSlots({_:2},[l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"1"}: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:"2"}: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:"3"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","position","titles","hasAnnotator","isAnnotation","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":h.value,"vue-data-ui-fulscreen--off":!h.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(Y._sfc_main),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.value,(o,u)=>(e.openBlock(),e.createElementBlock("line",{x1:o.x1,x2:o.x2,y1:o.y1,y2:o.y2,stroke:o.color,"stroke-width":5/360*Math.min(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<=a.value})},null,10,Z))),256)),t.value.style.chart.layout.innerCircle.show?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:s.value.centerX,cy:s.value.centerY,r:s.value.radius*.8<=0?1e-4:s.value.radius*.8,stroke:t.value.style.chart.layout.innerCircle.stroke,"stroke-width":t.value.style.chart.layout.innerCircle.strokeWidth,fill:"none"},null,8,ee)):e.createCommentVNode("",!0),t.value.style.chart.layout.percentage.show?(e.openBlock(),e.createElementBlock("text",{key:1,x:s.value.centerX,y:s.value.centerY+m.value/3,"font-size":m.value,fill:t.value.style.chart.layout.wheel.ticks.gradient.show?e.unref(r.shiftHue)(t.value.style.chart.layout.wheel.ticks.activeColor,a.value/100*(t.value.style.chart.layout.wheel.ticks.gradient.shiftHueIntensity/100)):t.value.style.chart.layout.wheel.ticks.activeColor,"text-anchor":"middle","font-weight":t.value.style.chart.layout.percentage.bold?"bold":"normal",style:{"font-variant-numeric":"tabluar-nums"}},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.percentage.formatter,e.unref(r.checkNaN)(a.value),e.unref(r.dataLabel)({v:e.unref(r.checkNaN)(a.value),s:"%",r:t.value.style.chart.layout.percentage.rounding}))),9,te)):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"svg",{svg:n.value},void 0,!0)],14,Q)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",le,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(_)||e.unref(x)})),void 0,!0)])):e.createCommentVNode("",!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:6,ref_key:"source",ref:C,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(D.default,{key:7,config:{type:"wheel",style:{backgroundColor:t.value.style.chart.backgroundColor,wheel:{color:"#CCCCCC"}}}},null,8,["config"]))],12,K))}},ne=J._export_sfc(oe,[["__scopeId","data-v-bc4a7284"]]);exports.default=ne;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-CsQwCVqU.cjs"),ke=require("./Title-BRqTk-nT.cjs"),ae=require("./usePrinter-O2fMMTMe.cjs"),G=require("./useResponsive-BJ7DTGpm.cjs"),we=require("./vue-ui-accordion-CaktYQoo.cjs"),xe=require("./DataTable-H-KTkjfv.cjs"),Se=require("./BaseIcon-BdKOa64A.cjs"),re=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ne=require("./useNestedProp-DSYpaLxP.cjs"),$e=require("./PackageVersion-BbQFSVXm.cjs"),Te=require("./Tooltip-DvGSIp31.cjs"),Ne=require("./PenAndPaper-BX8pR5oV.cjs"),Pe=c=>(e.pushScopeId("data-v-3fd7d274"),c=c(),e.popScopeId(),c),Be={"data-html2canvas-ignore":""},Fe={key:0,class:"reset-wrapper"},ze={key:1,class:"reset-wrapper"},_e={class:"mono-slicer"},Ae=Pe(()=>e.createElementVNode("div",{class:"slider-track"},null,-1)),Ve=["min","max","value"],Ee={__name:"MonoSlicer",props:{min:{type:Number,default:0},max:{type:Number,default:0},inputColor:{type:String,default:"#1A1A1A"},background:{type:String,default:"#FFFFFF"},borderColor:{type:String,default:"#FFFFFF"},selectColor:{type:String,default:"#4A4A4A"},textColor:{type:String,default:"#1A1A1A"},useResetSlot:{type:Boolean,default:!1},value:{type:Number,default:0},source:{type:Number,default:0}},emits:["update:value","reset"],setup(c,{emit:P}){const r=c;e.useCssVars(g=>({"90ad3208":E.value,"4f9eef70":S.value,"6e07ae3e":f.value,"2fd430a0":c.selectColor,"6b8169a4":y.value}));const E=e.computed(()=>r.inputColor),y=e.computed(()=>r.background),f=e.computed(()=>`${r.selectColor}33`),S=e.computed(()=>r.borderColor);function $(){P("reset")}const h=e.computed(()=>{const g=r.max-r.min,p=0,b=(r.value-r.min)/g*100;return{left:`${p}%`,width:`${b-p}%`,background:r.selectColor}});return(g,p)=>(e.openBlock(),e.createElementBlock("div",Be,[c.value!==c.source?(e.openBlock(),e.createElementBlock("div",Fe,[c.useResetSlot?e.renderSlot(g.$slots,"reset-action",{key:1,reset:$},void 0,!0):(e.openBlock(),e.createElementBlock("button",{key:0,"data-cy-reset":"",tabindex:"0",role:"button",class:"vue-data-ui-refresh-button",onClick:$},[e.createVNode(Se.default,{name:"refresh",stroke:c.textColor},null,8,["stroke"])]))])):(e.openBlock(),e.createElementBlock("div",ze)),e.createElementVNode("div",_e,[Ae,e.createElementVNode("div",{class:"range-highlight",style:e.normalizeStyle(h.value)},null,4),e.createElementVNode("input",{type:"range",min:c.min,max:c.max,value:Number(c.value),onInput:p[0]||(p[0]=b=>P("update:value",Number(b.target.value)))},null,40,Ve)])]))}},Ie=re._export_sfc(Ee,[["__scopeId","data-v-3fd7d274"]]),Oe=["id"],Me=["xmlns","viewBox"],Re=["transform"],qe=["fill","font-weight","x","y","font-size","transform","onMouseover"],We={key:4,class:"vue-data-ui-watermark"},De=["innerHTML"],Ue={__name:"vue-ui-word-cloud",props:{config:{type:Object,default(){return{}}},dataset:{type:[Array,String],default(){return[]}}},setup(c,{expose:P}){const r=c,{vue_ui_word_cloud:E}=s.useConfig(),y=e.computed({get(){return!!r.dataset&&r.dataset.length},set(o){return o}}),f=e.ref(typeof r.dataset=="string"?s.createWordCloudDatasetFromPlainText(r.dataset):r.dataset.map(o=>({...o,value:s.checkNaN(o.value)}))),S=e.ref(s.createUid()),$=e.ref(0),h=e.ref(null),g=e.ref(null),p=e.ref(null),b=e.ref(0),L=e.ref(0),I=e.ref(!1),t=e.computed({get:()=>j(),set:o=>o});function j(){const o=ne.useNestedProp({userConfig:r.config,defaultConfig:E});return o.theme?{...ne.useNestedProp({userConfig:s.themes.vue_ui_word_cloud[o.theme]||r.config,defaultConfig:o}),customPalette:s.themePalettes[o.theme]||s.palette}:o}e.watch(()=>r.config,o=>{t.value=j(),H(),b.value+=1,L.value+=1,O()},{deep:!0});const X=e.ref(null),C=e.ref(0),u=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}),se=G.throttle(()=>{const{width:o,height:a}=G.useResponsive({chart:h.value,title:t.value.style.chart.title.text?g.value:null,slicer:t.value.style.chart.zoom.show&&X.value,source:p.value});u.value.width=o,u.value.height=a,e.nextTick(M)});e.watch(()=>C.value,()=>{ue()});const ue=G.debounce(()=>{M()},10);function O(){C.value=Z.value}const B=e.ref(null);e.onMounted(()=>{H(),O()});function H(){s.objectIsEmpty(r.dataset)?s.error({componentName:"VueUiWordCloud",type:"dataset"}):f.value.forEach((o,a)=>{s.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name","value"]}).forEach(l=>{y.value=!1,s.error({componentName:"VueUiWordCloud",type:"datasetSerieAttribute",property:l,index:a})})}),t.value.responsive&&(B.value=new ResizeObserver(se),B.value.observe(h.value.parentNode))}e.onBeforeUnmount(()=>{B.value&&B.value.disconnect()});const{isPrinting:Y,isImaging:J,generatePdf:K,generateImage:Q}=ae.usePrinter({elementId:`wordCloud_${S.value}`,fileName:t.value.style.chart.title.text||"vue-ui-word-cloud"}),d=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show});function ie(o,a,l="Arial"){const n=document.createElement("canvas").getContext("2d");return n.font=`${a}px ${t.value.style.chart.words.bold?"bold":"normal"} ${l}`,{width:n.measureText(o).width+t.value.style.chart.words.proximity,height:a}}function ce(o,a){return o.x<a.x+a.width&&o.x+o.width>a.x&&o.y<a.y+a.height&&o.y+o.height>a.y}function de(o,a,l){const i=[],n={x:-a/2,y:-l/2,width:a,height:l},v=0,w=0;return o.forEach(x=>{let D=!1;for(let V=0;V<Math.max(a,l)/2&&!D;V+=t.value.style.chart.words.packingWeight)for(let U=0;U<360&&!D;U+=t.value.style.chart.words.packingWeight){const le=U*Math.PI/180,fe=v+V*Math.cos(le)-x.width/2,ge=w+V*Math.sin(le)-x.height/2,m={...x,x:fe,y:ge},ye=m.x>=n.x&&m.y>=n.y&&m.x+m.width<=n.x+n.width&&m.y+m.height<=n.y+n.height,be=i.some(Ce=>ce(m,Ce));ye&&!be&&(i.push(m),D=!0)}}),i}const T=e.ref([]);e.watch(()=>r.dataset,M,{immediate:!0});const Z=e.computed(()=>Math.min(...f.value.map(o=>o.value))),ve=e.computed(()=>Math.max(...f.value.map(o=>o.value)));function M(){const o=[...f.value].filter(n=>n.value>=C.value).map(n=>n.value),a=Math.max(...o),l=Math.min(...o),i=[...f.value].filter(n=>n.value>=C.value).map((n,v)=>{const w=(n.value-l)/(a-l)*(u.value.maxFontSize-u.value.minFontSize)+u.value.minFontSize,x=ie(n.name,w);return{...n,id:s.createUid(),fontSize:w,width:x.width,height:x.height,color:t.value.style.chart.words.usePalette?t.value.customPalette[v]||t.value.customPalette[v%t.value.customPalette.length]||s.palette[v]||s.palette[v%s.palette.length]:t.value.style.chart.words.color}});T.value=de(i,u.value.width,u.value.height).sort((n,v)=>v.fontSize-n.fontSize)}const F=e.computed(()=>{const o=T.value.map(l=>({name:l.name,color:l.color})),a=T.value.map(l=>l.value);return{head:o,body:a}});function ee(){e.nextTick(()=>{const o=F.value.head.map((i,n)=>[[i.name],[F.value.body[n]]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],[t.value.table.columnNames.value]]].concat(o),l=s.createCsvContent(a);s.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-word-cloud"})})}const z=e.computed(()=>{const o=[t.value.table.columnNames.series,t.value.table.columnNames.value],a=F.value.head.map((n,v)=>{const w=s.dataLabel({p:t.value.table.td.prefix,v:F.value.body[v],s:t.value.table.td.suffix,r:t.value.table.td.roundingValue});return[{color:n.color,name:n.name},w]}),l={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value],head:o,body:a,config:l}}),_=e.ref(!1);function he(o){_.value=o,$.value+=1}function pe(){return T.value}function te(){d.value.showTable=!d.value.showTable}function oe(){d.value.showTooltip=!d.value.showTooltip}const A=e.ref(!1);function R(){A.value=!A.value}P({getData:pe,generateCsv:ee,generatePdf:K,generateImage:Q,toggleTable:te,toggleTooltip:oe,toggleAnnotator:R});const k=e.ref(null),N=e.ref(!1),q=e.ref(""),W=e.ref(null);function me(o){if(!d.value.showTooltip)return;k.value=o.id,W.value={datapoint:o,config:t.value};const a=t.value.style.chart.tooltip.customFormat;if(N.value=!1,s.isFunction(a))try{const l=a({datapoint:o,config:t.value});typeof l=="string"&&(q.value=l,N.value=!0)}catch{console.warn("Custom format cannot be applied."),N.value=!1}if(!N.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>`;q.value=`<div dir="auto" style="display:flex; gap:4px; align-items:center; jsutify-content:center;">${l}</div>`}I.value=!0}return(o,a)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-word-cloud",ref_key:"wordCloudChart",ref:h,id:`wordCloud_${S.value}`,style:e.normalizeStyle(`width: 100%; font-family:${t.value.style.fontFamily};background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height:100%":""}`)},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Ne.PenAndPaper,{key:0,parent:h.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:A.value,onClose:R},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"chartTitle",ref:g,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(ke._sfc_main,{key:`title_${b.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&&y.value?(e.openBlock(),e.createBlock(ae.UserOptions,{ref:"details",key:`user_option_${$.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(Y),isImaging:e.unref(J),uid:S.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:_.value,titles:{...t.value.userOptions.buttonTitles},chartElement:h.value,position:t.value.userOptions.position,hasTooltip:t.value.style.chart.tooltip.show&&t.value.userOptions.buttons.tooltip,isTooltip:d.value.showTooltip,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:A.value,onToggleFullscreen:he,onGeneratePdf:e.unref(K),onGenerateCsv:ee,onGenerateImage:e.unref(Q),onToggleTable:te,onToggleTooltip:oe,onToggleAnnotator:R},e.createSlots({_:2},[o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:i})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:i})),void 0,!0)]),key:"4"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:i})=>[e.renderSlot(o.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:i})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","titles","chartElement","position","hasTooltip","isTooltip","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),y.value?(e.openBlock(),e.createElementBlock("svg",{key:3,class:e.normalizeClass({"vue-data-ui-fullscreen--on":_.value,"vue-data-ui-fulscreen--off":!_.value}),xmlns:e.unref(s.XMLNS),viewBox:`0 0 ${u.value.width<=0?10:u.value.width} ${u.value.height<=0?10:u.value.height}`,style:"overflow:visible;background:transparent;"},[e.createVNode($e._sfc_main),e.createElementVNode("g",{transform:`translate(${(u.value.width<=0?10:u.value.width)/2}, ${(u.value.height<=0?10:u.value.height)/2})`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(l,i)=>(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:i,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":k.value&&k.value===l.id&&d.value.showTooltip,"word-not-selected":k.value&&k.value!==l.id&&d.value.showTooltip}),"text-anchor":"middle","dominant-baseline":"central",onMouseover:n=>me(l),onMouseleave:a[0]||(a[0]=n=>{k.value=null,I.value=!1}),style:e.normalizeStyle(`animation-delay:${i*t.value.animationDelayMs}ms !important;`)},e.toDisplayString(l.name),47,qe))]))),256))],8,Re),e.renderSlot(o.$slots,"svg",{svg:{height:u.value.height,width:u.value.width}},void 0,!0)],10,Me)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",We,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(Y)||e.unref(J)})),void 0,!0)])):e.createCommentVNode("",!0),e.createVNode(Te._sfc_main,{show:d.value.showTooltip&&I.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:h.value,content:q.value,isCustom:N.value},{"tooltip-before":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...W.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...W.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isCustom"]),e.createElementVNode("div",{ref_key:"chartSlicer",ref:X,style:"width:100%;background:transparent","data-html2canvas-ignore":""},[t.value.style.chart.zoom.show?(e.openBlock(),e.createBlock(Ie,{key:0,value:C.value,"onUpdate:value":a[1]||(a[1]=l=>C.value=l),min:Z.value,max:ve.value,textColor:t.value.style.chart.color,inputColor:t.value.style.chart.zoom.color,selectColor:t.value.style.chart.zoom.highlightColor,useResetSlot:t.value.style.chart.zoom.useResetSlot,background:t.value.style.chart.zoom.color,borderColor:t.value.style.chart.backgroundColor,source:t.value.style.chart.width,onReset:O},{"reset-action":e.withCtx(({reset:l})=>[e.renderSlot(o.$slots,"reset-action",e.normalizeProps(e.guardReactiveProps({reset:l})),void 0,!0)]),_:3},8,["value","min","max","textColor","inputColor","selectColor","useResetSlot","background","borderColor","source"])):e.createCommentVNode("",!0)],512),o.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:5,ref_key:"source",ref:p,dir:"auto"},[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),y.value?(e.openBlock(),e.createBlock(we.default,{key:6,hideDetails:"",config:{open:d.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(xe.DataTable,{key:`table_${L.value}`,colNames:z.value.colNames,head:z.value.head,body:z.value.body,config:z.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:a[2]||(a[2]=l=>d.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,De)]),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)],12,Oe))}},Ge=re._export_sfc(Ue,[["__scopeId","data-v-13d267e2"]]);exports.default=Ge;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-3oZdQf6G.cjs"),ke=require("./Title-BxrsVY3-.cjs"),ae=require("./usePrinter-BKzxQK4e.cjs"),G=require("./useResponsive-BJ7DTGpm.cjs"),we=require("./vue-ui-accordion-QoJofzqF.cjs"),xe=require("./DataTable-DeevzR8O.cjs"),Se=require("./BaseIcon-BCC16NCl.cjs"),re=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ne=require("./useNestedProp-vPTP0Wem.cjs"),$e=require("./PackageVersion-AftniVVo.cjs"),Te=require("./Tooltip-BXc56Oxr.cjs"),Ne=require("./PenAndPaper-j5noaKJZ.cjs"),Pe=c=>(e.pushScopeId("data-v-3fd7d274"),c=c(),e.popScopeId(),c),Be={"data-html2canvas-ignore":""},Fe={key:0,class:"reset-wrapper"},ze={key:1,class:"reset-wrapper"},_e={class:"mono-slicer"},Ae=Pe(()=>e.createElementVNode("div",{class:"slider-track"},null,-1)),Ve=["min","max","value"],Ee={__name:"MonoSlicer",props:{min:{type:Number,default:0},max:{type:Number,default:0},inputColor:{type:String,default:"#1A1A1A"},background:{type:String,default:"#FFFFFF"},borderColor:{type:String,default:"#FFFFFF"},selectColor:{type:String,default:"#4A4A4A"},textColor:{type:String,default:"#1A1A1A"},useResetSlot:{type:Boolean,default:!1},value:{type:Number,default:0},source:{type:Number,default:0}},emits:["update:value","reset"],setup(c,{emit:P}){const r=c;e.useCssVars(g=>({"90ad3208":E.value,"4f9eef70":S.value,"6e07ae3e":f.value,"2fd430a0":c.selectColor,"6b8169a4":y.value}));const E=e.computed(()=>r.inputColor),y=e.computed(()=>r.background),f=e.computed(()=>`${r.selectColor}33`),S=e.computed(()=>r.borderColor);function $(){P("reset")}const h=e.computed(()=>{const g=r.max-r.min,p=0,b=(r.value-r.min)/g*100;return{left:`${p}%`,width:`${b-p}%`,background:r.selectColor}});return(g,p)=>(e.openBlock(),e.createElementBlock("div",Be,[c.value!==c.source?(e.openBlock(),e.createElementBlock("div",Fe,[c.useResetSlot?e.renderSlot(g.$slots,"reset-action",{key:1,reset:$},void 0,!0):(e.openBlock(),e.createElementBlock("button",{key:0,"data-cy-reset":"",tabindex:"0",role:"button",class:"vue-data-ui-refresh-button",onClick:$},[e.createVNode(Se.default,{name:"refresh",stroke:c.textColor},null,8,["stroke"])]))])):(e.openBlock(),e.createElementBlock("div",ze)),e.createElementVNode("div",_e,[Ae,e.createElementVNode("div",{class:"range-highlight",style:e.normalizeStyle(h.value)},null,4),e.createElementVNode("input",{type:"range",min:c.min,max:c.max,value:Number(c.value),onInput:p[0]||(p[0]=b=>P("update:value",Number(b.target.value)))},null,40,Ve)])]))}},Ie=re._export_sfc(Ee,[["__scopeId","data-v-3fd7d274"]]),Oe=["id"],Me=["xmlns","viewBox"],Re=["transform"],qe=["fill","font-weight","x","y","font-size","transform","onMouseover"],We={key:4,class:"vue-data-ui-watermark"},De=["innerHTML"],Ue={__name:"vue-ui-word-cloud",props:{config:{type:Object,default(){return{}}},dataset:{type:[Array,String],default(){return[]}}},setup(c,{expose:P}){const r=c,{vue_ui_word_cloud:E}=s.useConfig(),y=e.computed({get(){return!!r.dataset&&r.dataset.length},set(o){return o}}),f=e.ref(typeof r.dataset=="string"?s.createWordCloudDatasetFromPlainText(r.dataset):r.dataset.map(o=>({...o,value:s.checkNaN(o.value)}))),S=e.ref(s.createUid()),$=e.ref(0),h=e.ref(null),g=e.ref(null),p=e.ref(null),b=e.ref(0),L=e.ref(0),I=e.ref(!1),t=e.computed({get:()=>j(),set:o=>o});function j(){const o=ne.useNestedProp({userConfig:r.config,defaultConfig:E});return o.theme?{...ne.useNestedProp({userConfig:s.themes.vue_ui_word_cloud[o.theme]||r.config,defaultConfig:o}),customPalette:s.themePalettes[o.theme]||s.palette}:o}e.watch(()=>r.config,o=>{t.value=j(),H(),b.value+=1,L.value+=1,O()},{deep:!0});const X=e.ref(null),C=e.ref(0),u=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}),se=G.throttle(()=>{const{width:o,height:a}=G.useResponsive({chart:h.value,title:t.value.style.chart.title.text?g.value:null,slicer:t.value.style.chart.zoom.show&&X.value,source:p.value});u.value.width=o,u.value.height=a,e.nextTick(M)});e.watch(()=>C.value,()=>{ue()});const ue=G.debounce(()=>{M()},10);function O(){C.value=Z.value}const B=e.ref(null);e.onMounted(()=>{H(),O()});function H(){s.objectIsEmpty(r.dataset)?s.error({componentName:"VueUiWordCloud",type:"dataset"}):f.value.forEach((o,a)=>{s.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name","value"]}).forEach(l=>{y.value=!1,s.error({componentName:"VueUiWordCloud",type:"datasetSerieAttribute",property:l,index:a})})}),t.value.responsive&&(B.value=new ResizeObserver(se),B.value.observe(h.value.parentNode))}e.onBeforeUnmount(()=>{B.value&&B.value.disconnect()});const{isPrinting:Y,isImaging:J,generatePdf:K,generateImage:Q}=ae.usePrinter({elementId:`wordCloud_${S.value}`,fileName:t.value.style.chart.title.text||"vue-ui-word-cloud"}),d=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show});function ie(o,a,l="Arial"){const n=document.createElement("canvas").getContext("2d");return n.font=`${a}px ${t.value.style.chart.words.bold?"bold":"normal"} ${l}`,{width:n.measureText(o).width+t.value.style.chart.words.proximity,height:a}}function ce(o,a){return o.x<a.x+a.width&&o.x+o.width>a.x&&o.y<a.y+a.height&&o.y+o.height>a.y}function de(o,a,l){const i=[],n={x:-a/2,y:-l/2,width:a,height:l},v=0,w=0;return o.forEach(x=>{let D=!1;for(let V=0;V<Math.max(a,l)/2&&!D;V+=t.value.style.chart.words.packingWeight)for(let U=0;U<360&&!D;U+=t.value.style.chart.words.packingWeight){const le=U*Math.PI/180,fe=v+V*Math.cos(le)-x.width/2,ge=w+V*Math.sin(le)-x.height/2,m={...x,x:fe,y:ge},ye=m.x>=n.x&&m.y>=n.y&&m.x+m.width<=n.x+n.width&&m.y+m.height<=n.y+n.height,be=i.some(Ce=>ce(m,Ce));ye&&!be&&(i.push(m),D=!0)}}),i}const T=e.ref([]);e.watch(()=>r.dataset,M,{immediate:!0});const Z=e.computed(()=>Math.min(...f.value.map(o=>o.value))),ve=e.computed(()=>Math.max(...f.value.map(o=>o.value)));function M(){const o=[...f.value].filter(n=>n.value>=C.value).map(n=>n.value),a=Math.max(...o),l=Math.min(...o),i=[...f.value].filter(n=>n.value>=C.value).map((n,v)=>{const w=(n.value-l)/(a-l)*(u.value.maxFontSize-u.value.minFontSize)+u.value.minFontSize,x=ie(n.name,w);return{...n,id:s.createUid(),fontSize:w,width:x.width,height:x.height,color:t.value.style.chart.words.usePalette?t.value.customPalette[v]||t.value.customPalette[v%t.value.customPalette.length]||s.palette[v]||s.palette[v%s.palette.length]:t.value.style.chart.words.color}});T.value=de(i,u.value.width,u.value.height).sort((n,v)=>v.fontSize-n.fontSize)}const F=e.computed(()=>{const o=T.value.map(l=>({name:l.name,color:l.color})),a=T.value.map(l=>l.value);return{head:o,body:a}});function ee(){e.nextTick(()=>{const o=F.value.head.map((i,n)=>[[i.name],[F.value.body[n]]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],[t.value.table.columnNames.value]]].concat(o),l=s.createCsvContent(a);s.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-word-cloud"})})}const z=e.computed(()=>{const o=[t.value.table.columnNames.series,t.value.table.columnNames.value],a=F.value.head.map((n,v)=>{const w=s.dataLabel({p:t.value.table.td.prefix,v:F.value.body[v],s:t.value.table.td.suffix,r:t.value.table.td.roundingValue});return[{color:n.color,name:n.name},w]}),l={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value],head:o,body:a,config:l}}),_=e.ref(!1);function he(o){_.value=o,$.value+=1}function pe(){return T.value}function te(){d.value.showTable=!d.value.showTable}function oe(){d.value.showTooltip=!d.value.showTooltip}const A=e.ref(!1);function R(){A.value=!A.value}P({getData:pe,generateCsv:ee,generatePdf:K,generateImage:Q,toggleTable:te,toggleTooltip:oe,toggleAnnotator:R});const k=e.ref(null),N=e.ref(!1),q=e.ref(""),W=e.ref(null);function me(o){if(!d.value.showTooltip)return;k.value=o.id,W.value={datapoint:o,config:t.value};const a=t.value.style.chart.tooltip.customFormat;if(N.value=!1,s.isFunction(a))try{const l=a({datapoint:o,config:t.value});typeof l=="string"&&(q.value=l,N.value=!0)}catch{console.warn("Custom format cannot be applied."),N.value=!1}if(!N.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>`;q.value=`<div dir="auto" style="display:flex; gap:4px; align-items:center; jsutify-content:center;">${l}</div>`}I.value=!0}return(o,a)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-word-cloud",ref_key:"wordCloudChart",ref:h,id:`wordCloud_${S.value}`,style:e.normalizeStyle(`width: 100%; font-family:${t.value.style.fontFamily};background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height:100%":""}`)},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Ne.PenAndPaper,{key:0,parent:h.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:A.value,onClose:R},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"chartTitle",ref:g,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(ke._sfc_main,{key:`title_${b.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&&y.value?(e.openBlock(),e.createBlock(ae.UserOptions,{ref:"details",key:`user_option_${$.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(Y),isImaging:e.unref(J),uid:S.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:_.value,titles:{...t.value.userOptions.buttonTitles},chartElement:h.value,position:t.value.userOptions.position,hasTooltip:t.value.style.chart.tooltip.show&&t.value.userOptions.buttons.tooltip,isTooltip:d.value.showTooltip,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:A.value,onToggleFullscreen:he,onGeneratePdf:e.unref(K),onGenerateCsv:ee,onGenerateImage:e.unref(Q),onToggleTable:te,onToggleTooltip:oe,onToggleAnnotator:R},e.createSlots({_:2},[o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:i})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:i})),void 0,!0)]),key:"4"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:i})=>[e.renderSlot(o.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:i})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","titles","chartElement","position","hasTooltip","isTooltip","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),y.value?(e.openBlock(),e.createElementBlock("svg",{key:3,class:e.normalizeClass({"vue-data-ui-fullscreen--on":_.value,"vue-data-ui-fulscreen--off":!_.value}),xmlns:e.unref(s.XMLNS),viewBox:`0 0 ${u.value.width<=0?10:u.value.width} ${u.value.height<=0?10:u.value.height}`,style:"overflow:visible;background:transparent;"},[e.createVNode($e._sfc_main),e.createElementVNode("g",{transform:`translate(${(u.value.width<=0?10:u.value.width)/2}, ${(u.value.height<=0?10:u.value.height)/2})`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(l,i)=>(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:i,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":k.value&&k.value===l.id&&d.value.showTooltip,"word-not-selected":k.value&&k.value!==l.id&&d.value.showTooltip}),"text-anchor":"middle","dominant-baseline":"central",onMouseover:n=>me(l),onMouseleave:a[0]||(a[0]=n=>{k.value=null,I.value=!1}),style:e.normalizeStyle(`animation-delay:${i*t.value.animationDelayMs}ms !important;`)},e.toDisplayString(l.name),47,qe))]))),256))],8,Re),e.renderSlot(o.$slots,"svg",{svg:{height:u.value.height,width:u.value.width}},void 0,!0)],10,Me)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",We,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(Y)||e.unref(J)})),void 0,!0)])):e.createCommentVNode("",!0),e.createVNode(Te._sfc_main,{show:d.value.showTooltip&&I.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:h.value,content:q.value,isCustom:N.value},{"tooltip-before":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...W.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...W.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isCustom"]),e.createElementVNode("div",{ref_key:"chartSlicer",ref:X,style:"width:100%;background:transparent","data-html2canvas-ignore":""},[t.value.style.chart.zoom.show?(e.openBlock(),e.createBlock(Ie,{key:0,value:C.value,"onUpdate:value":a[1]||(a[1]=l=>C.value=l),min:Z.value,max:ve.value,textColor:t.value.style.chart.color,inputColor:t.value.style.chart.zoom.color,selectColor:t.value.style.chart.zoom.highlightColor,useResetSlot:t.value.style.chart.zoom.useResetSlot,background:t.value.style.chart.zoom.color,borderColor:t.value.style.chart.backgroundColor,source:t.value.style.chart.width,onReset:O},{"reset-action":e.withCtx(({reset:l})=>[e.renderSlot(o.$slots,"reset-action",e.normalizeProps(e.guardReactiveProps({reset:l})),void 0,!0)]),_:3},8,["value","min","max","textColor","inputColor","selectColor","useResetSlot","background","borderColor","source"])):e.createCommentVNode("",!0)],512),o.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:5,ref_key:"source",ref:p,dir:"auto"},[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),y.value?(e.openBlock(),e.createBlock(we.default,{key:6,hideDetails:"",config:{open:d.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(xe.DataTable,{key:`table_${L.value}`,colNames:z.value.colNames,head:z.value.head,body:z.value.body,config:z.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:a[2]||(a[2]=l=>d.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,De)]),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)],12,Oe))}},Ge=re._export_sfc(Ue,[["__scopeId","data-v-13d267e2"]]);exports.default=Ge;
@@ -1,16 +1,16 @@
1
1
  import { useCssVars as Be, computed as p, openBlock as r, createElementBlock as h, createVNode as oe, renderSlot as d, createElementVNode as x, normalizeStyle as ae, pushScopeId as De, popScopeId as Ve, ref as n, watch as te, onMounted as Ee, onBeforeUnmount as Ue, createBlock as z, createCommentVNode as C, unref as $, createSlots as Ge, withCtx as v, normalizeProps as A, guardReactiveProps as I, normalizeClass as ge, Fragment as Le, renderList as Xe, toDisplayString as ye, createTextVNode as je, nextTick as be } from "vue";
2
- import { u as Ye, a1 as qe, v as He, c as Ce, t as Je, a as Ke, p as X, o as Qe, e as ke, g as Ze, f as et, X as tt, q as ot, r as at, x as lt } from "./index-hV0hU1iE.js";
3
- import { _ as nt } from "./Title-DBozX6nP.js";
4
- import { u as st, U as rt } from "./usePrinter-y3d31M4g.js";
2
+ import { u as Ye, a1 as qe, v as He, c as Ce, t as Je, a as Ke, p as X, o as Qe, e as ke, g as Ze, f as et, X as tt, q as ot, r as at, x as lt } from "./index-D020Kb3z.js";
3
+ import { _ as nt } from "./Title-B2orjUIW.js";
4
+ import { u as st, U as rt } from "./usePrinter-CN0J0NFL.js";
5
5
  import { d as ut, t as it, u as ct } from "./useResponsive-CoxXLe23.js";
6
- import dt from "./vue-ui-accordion-m-s-7akB.js";
7
- import { D as vt } from "./DataTable-BpVz3DBX.js";
8
- import ht from "./BaseIcon-BRSPQaGQ.js";
6
+ import dt from "./vue-ui-accordion-B0fEWLwn.js";
7
+ import { D as vt } from "./DataTable-Ce4R8v-3.js";
8
+ import ht from "./BaseIcon-BbbAnrZI.js";
9
9
  import { _ as $e } from "./_plugin-vue_export-helper-CHgC5LLL.js";
10
- import { u as we } from "./useNestedProp-CRAUOmT5.js";
11
- import { _ as mt } from "./PackageVersion-wqab02xF.js";
12
- import { _ as ft } from "./Tooltip-Com_T8vc.js";
13
- import { P as pt } from "./PenAndPaper-C_laA5mt.js";
10
+ import { u as we } from "./useNestedProp-CZkNAGQh.js";
11
+ import { _ as mt } from "./PackageVersion-g2UOsY7H.js";
12
+ import { _ as ft } from "./Tooltip-CXjc5vb3.js";
13
+ import { P as pt } from "./PenAndPaper-DRFeGfqV.js";
14
14
  const gt = (c) => (De("data-v-3fd7d274"), c = c(), Ve(), c), yt = { "data-html2canvas-ignore": "" }, bt = {
15
15
  key: 0,
16
16
  class: "reset-wrapper"
@@ -1,17 +1,17 @@
1
- import { c as J, a as K, t as Q, z as j, p as $, V as q, O as R, f as U, K as ee, F as te, i as ie, a2 as ae, a0 as re, a3 as le, v as se, a4 as ne, d as oe, B as ce, b as he, q as de, R as ue, a5 as ge, r as fe, e as Ne, y as me, M as Ie, x as xe, a6 as be, Y as Fe, o as _e, s as ye, w as Ae, E as Ce, A as Le, u as Se } from "./index-hV0hU1iE.js";
2
- import { D as ke } from "./DataTable-BpVz3DBX.js";
3
- import { _ as we } from "./Title-DBozX6nP.js";
4
- import { _ as Oe, u as Ge } from "./Tooltip-Com_T8vc.js";
5
- import { U as ve } from "./usePrinter-y3d31M4g.js";
6
- import { _ as pe } from "./Shape-QdnXSUyn.js";
7
- import Me from "./BaseIcon-BRSPQaGQ.js";
8
- import ze from "./vue-ui-table-sparkline-Yg2I33yZ.js";
9
- import Te from "./vue-ui-skeleton-BY8Jg9a_.js";
10
- import { S as Pe } from "./Slicer-DV1kBscZ.js";
11
- import Ve from "./vue-ui-accordion-m-s-7akB.js";
12
- import { u as Z } from "./useNestedProp-CRAUOmT5.js";
13
- import { _ as Re } from "./PackageVersion-wqab02xF.js";
14
- import { P as De } from "./PenAndPaper-C_laA5mt.js";
1
+ import { c as J, a as K, t as Q, z as j, p as $, V as q, O as R, f as U, K as ee, F as te, i as ie, a2 as ae, a0 as re, a3 as le, v as se, a4 as ne, d as oe, B as ce, b as he, q as de, R as ue, a5 as ge, r as fe, e as Ne, y as me, M as Ie, x as xe, a6 as be, Y as Fe, o as _e, s as ye, w as Ae, E as Ce, A as Le, u as Se } from "./index-D020Kb3z.js";
2
+ import { D as ke } from "./DataTable-Ce4R8v-3.js";
3
+ import { _ as we } from "./Title-B2orjUIW.js";
4
+ import { _ as Oe, u as Ge } from "./Tooltip-CXjc5vb3.js";
5
+ import { U as ve } from "./usePrinter-CN0J0NFL.js";
6
+ import { _ as pe } from "./Shape-CBu7ails.js";
7
+ import Me from "./BaseIcon-BbbAnrZI.js";
8
+ import ze from "./vue-ui-table-sparkline-DXvxiDJJ.js";
9
+ import Te from "./vue-ui-skeleton-E1-7diF5.js";
10
+ import { S as Pe } from "./Slicer-C0bRksfh.js";
11
+ import Ve from "./vue-ui-accordion-B0fEWLwn.js";
12
+ import { u as Z } from "./useNestedProp-CZkNAGQh.js";
13
+ import { _ as Re } from "./PackageVersion-g2UOsY7H.js";
14
+ import { P as De } from "./PenAndPaper-DRFeGfqV.js";
15
15
  import { resolveComponent as P, openBlock as r, createElementBlock as l, normalizeClass as V, normalizeStyle as C, createBlock as D, createCommentVNode as c, createSlots as Be, withCtx as z, renderSlot as O, normalizeProps as H, guardReactiveProps as W, createVNode as X, createElementVNode as g, Fragment as N, renderList as I, toDisplayString as S, withDirectives as He, vModelCheckbox as We, createTextVNode as Ee } from "vue";
16
16
  import { _ as Ye } from "./_plugin-vue_export-helper-CHgC5LLL.js";
17
17
  const Xe = J(), qe = {