vue-data-ui 2.4.20 → 2.4.21

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-TG2JsMwT.js → Arrow-BuVX2WoN.js} +1 -1
  2. package/dist/{Arrow-DjiNIFce.cjs → Arrow-DDe-g8rw.cjs} +1 -1
  3. package/dist/{BaseIcon-CgiYTpkb.js → BaseIcon-BRSPQaGQ.js} +1 -1
  4. package/dist/{BaseIcon-D-YgPcX1.cjs → BaseIcon-BdKOa64A.cjs} +1 -1
  5. package/dist/{DataTable-B-_LZJ5T.js → DataTable-BpVz3DBX.js} +2 -2
  6. package/dist/{DataTable-T6NSDRqO.cjs → DataTable-H-KTkjfv.cjs} +1 -1
  7. package/dist/{Legend-B3KPtqT8.cjs → Legend-G5Zc4QaZ.cjs} +1 -1
  8. package/dist/{Legend-CJnJQbiR.js → Legend-hnLfwhmm.js} +1 -1
  9. package/dist/{PackageVersion-BjoP5ypd.cjs → PackageVersion-BbQFSVXm.cjs} +1 -1
  10. package/dist/{PackageVersion-DHeUFci0.js → PackageVersion-wqab02xF.js} +1 -1
  11. package/dist/{PenAndPaper-C0H3KJhQ.cjs → PenAndPaper-BX8pR5oV.cjs} +1 -1
  12. package/dist/{PenAndPaper-BKIQk9Cq.js → PenAndPaper-C_laA5mt.js} +3 -3
  13. package/dist/{Shape-BmBZkR94.cjs → Shape-CJbFv4bs.cjs} +1 -1
  14. package/dist/{Shape-nQyHwd5x.js → Shape-QdnXSUyn.js} +1 -1
  15. package/dist/Slicer-C1blYfez.cjs +1 -0
  16. package/dist/{Slicer-Cs0G0M7b.js → Slicer-DV1kBscZ.js} +58 -58
  17. package/dist/{Title-Az2QIayC.cjs → Title-BRqTk-nT.cjs} +1 -1
  18. package/dist/{Title-Dl6c1jg0.js → Title-DBozX6nP.js} +1 -1
  19. package/dist/{Tooltip-8UZ341MF.js → Tooltip-Com_T8vc.js} +1 -1
  20. package/dist/{Tooltip-wdo3yY_W.cjs → Tooltip-DvGSIp31.cjs} +1 -1
  21. package/dist/{index-DsF7Aej7.cjs → index-CsQwCVqU.cjs} +1 -1
  22. package/dist/{index-C2sScL5o.js → index-hV0hU1iE.js} +1 -1
  23. package/dist/style.css +1 -1
  24. package/dist/{useNestedProp-CuE-kmwp.js → useNestedProp-CRAUOmT5.js} +1 -1
  25. package/dist/{useNestedProp-D0YHk8Cd.cjs → useNestedProp-DSYpaLxP.cjs} +1 -1
  26. package/dist/{usePrinter-CUDeluax.cjs → usePrinter-O2fMMTMe.cjs} +1 -1
  27. package/dist/{usePrinter-CddPH-Ds.js → usePrinter-y3d31M4g.js} +1 -1
  28. package/dist/{vue-data-ui-DqHj_pWh.js → vue-data-ui-bEKZH8jG.js} +58 -58
  29. package/dist/{vue-data-ui-owDqn8Xa.cjs → vue-data-ui-qBad3a6z.cjs} +1 -1
  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-DJscSRTK.cjs → vue-ui-3d-bar-CkqKnqQt.cjs} +1 -1
  33. package/dist/{vue-ui-3d-bar-Bp1Qr_3F.js → vue-ui-3d-bar-f7YaBbrh.js} +9 -9
  34. package/dist/{vue-ui-accordion-Av34wbMx.cjs → vue-ui-accordion-CaktYQoo.cjs} +1 -1
  35. package/dist/{vue-ui-accordion-BH4FO7io.js → vue-ui-accordion-m-s-7akB.js} +3 -3
  36. package/dist/{vue-ui-age-pyramid-BOPzYxu_.js → vue-ui-age-pyramid-DkfNZR86.js} +10 -10
  37. package/dist/{vue-ui-age-pyramid-DbwlbzZl.cjs → vue-ui-age-pyramid-EKKYQu3N.cjs} +1 -1
  38. package/dist/{vue-ui-annotator-CGj1ftbP.js → vue-ui-annotator-DrVu5Pu0.js} +1 -1
  39. package/dist/{vue-ui-annotator-Dd0ZkXyj.cjs → vue-ui-annotator-v07J6oQG.cjs} +1 -1
  40. package/dist/{vue-ui-bullet-C6D22-Ah.js → vue-ui-bullet-CYDMehDZ.js} +8 -8
  41. package/dist/{vue-ui-bullet-B1LUeFVN.cjs → vue-ui-bullet-CdG92x7A.cjs} +1 -1
  42. package/dist/{vue-ui-candlestick-6kWB1Iz6.js → vue-ui-candlestick-Bw1O3QmK.js} +11 -11
  43. package/dist/{vue-ui-candlestick-BfBmmv4x.cjs → vue-ui-candlestick-D9yN-yRo.cjs} +1 -1
  44. package/dist/{vue-ui-carousel-table-BdZ2MO_U.cjs → vue-ui-carousel-table-Cg6hAEVv.cjs} +1 -1
  45. package/dist/{vue-ui-carousel-table-BFyyF9Ql.js → vue-ui-carousel-table-kcQa0FHw.js} +4 -4
  46. package/dist/{vue-ui-chestnut-RzOkxqA7.js → vue-ui-chestnut-DE1AMXeX.js} +8 -8
  47. package/dist/{vue-ui-chestnut-DjG-n6FA.cjs → vue-ui-chestnut-Qu8c3_vB.cjs} +1 -1
  48. package/dist/{vue-ui-cursor-B7aO28Bc.cjs → vue-ui-cursor-DG8oufeh.cjs} +1 -1
  49. package/dist/{vue-ui-cursor-CvZS65zZ.js → vue-ui-cursor-DbfjKtpf.js} +2 -2
  50. package/dist/{vue-ui-dashboard-BMaPi8dt.cjs → vue-ui-dashboard-BbwgfxLx.cjs} +1 -1
  51. package/dist/{vue-ui-dashboard-B5xuKqwS.js → vue-ui-dashboard-CAkCNUBh.js} +2 -2
  52. package/dist/{vue-ui-digits-C8VAWZ3p.js → vue-ui-digits-BaXAiH4u.js} +2 -2
  53. package/dist/{vue-ui-digits-BMNNUYnH.cjs → vue-ui-digits-DgQkxULm.cjs} +1 -1
  54. package/dist/{vue-ui-donut-NsU-zF5W.js → vue-ui-donut-7GM_Wd1Y.js} +11 -11
  55. package/dist/{vue-ui-donut-BMhNabzn.cjs → vue-ui-donut-BHzCOBu6.cjs} +1 -1
  56. package/dist/{vue-ui-donut-evolution-Bi3VA_yA.cjs → vue-ui-donut-evolution-C-TkUOr6.cjs} +1 -1
  57. package/dist/{vue-ui-donut-evolution-BpBAko36.js → vue-ui-donut-evolution-DbU4RlP6.js} +11 -11
  58. package/dist/{vue-ui-dumbbell-DcoUMxUR.js → vue-ui-dumbbell-BacTx3zB.js} +10 -10
  59. package/dist/{vue-ui-dumbbell-Bcyuwjih.cjs → vue-ui-dumbbell-DacMeiTU.cjs} +1 -1
  60. package/dist/{vue-ui-flow-C9usdqKR.cjs → vue-ui-flow-BUAvjG7i.cjs} +1 -1
  61. package/dist/{vue-ui-flow-CHtg7-D-.js → vue-ui-flow-D2G0YWL9.js} +9 -9
  62. package/dist/{vue-ui-galaxy-DCl7i83C.cjs → vue-ui-galaxy-CxfV3BIw.cjs} +1 -1
  63. package/dist/{vue-ui-galaxy-oU6i5aA-.js → vue-ui-galaxy-D6RFyIbQ.js} +11 -11
  64. package/dist/{vue-ui-gauge-C8pggd2h.cjs → vue-ui-gauge-CJ5TKJpb.cjs} +1 -1
  65. package/dist/{vue-ui-gauge-Dy2ZQxvF.js → vue-ui-gauge-DNJXnyLw.js} +7 -7
  66. package/dist/{vue-ui-gizmo-BQdo0Q3v.cjs → vue-ui-gizmo-BBA51j_0.cjs} +1 -1
  67. package/dist/{vue-ui-gizmo-CW4t27JP.js → vue-ui-gizmo-Db7-gRmB.js} +3 -3
  68. package/dist/{vue-ui-heatmap-Cdu2Xhjf.js → vue-ui-heatmap-Ba6RMSTk.js} +10 -10
  69. package/dist/{vue-ui-heatmap-CFT-bLNP.cjs → vue-ui-heatmap-KQj8Jbpt.cjs} +1 -1
  70. package/dist/{vue-ui-kpi-DfRy61t9.cjs → vue-ui-kpi-1srKxA1L.cjs} +1 -1
  71. package/dist/{vue-ui-kpi-Dnh9ZTZH.js → vue-ui-kpi-C8wyHy1H.js} +3 -3
  72. package/dist/{vue-ui-mini-loader-CI0Mwg9T.cjs → vue-ui-mini-loader-BgKTecng.cjs} +1 -1
  73. package/dist/{vue-ui-mini-loader-CLh4mj5Z.js → vue-ui-mini-loader-DutVmCuC.js} +2 -2
  74. package/dist/{vue-ui-molecule-Dyfk9UfE.js → vue-ui-molecule-BOkIojio.js} +11 -11
  75. package/dist/{vue-ui-molecule-Cqvn7ZGx.cjs → vue-ui-molecule-CSezTn3m.cjs} +1 -1
  76. package/dist/{vue-ui-mood-radar-D9XUvCNH.js → vue-ui-mood-radar-C8U8PHaq.js} +11 -11
  77. package/dist/{vue-ui-mood-radar-UqlWcAkr.cjs → vue-ui-mood-radar-CNTDrRs6.cjs} +1 -1
  78. package/dist/{vue-ui-nested-donuts-DP4yfGUH.js → vue-ui-nested-donuts-Bv2D1uFd.js} +11 -11
  79. package/dist/{vue-ui-nested-donuts-vUJ2g2dk.cjs → vue-ui-nested-donuts-DRWWnsdR.cjs} +1 -1
  80. package/dist/{vue-ui-onion-IxyzzuZC.js → vue-ui-onion-CT9YjU8v.js} +11 -11
  81. package/dist/{vue-ui-onion-fJOV7lwQ.cjs → vue-ui-onion-CsnwbXED.cjs} +1 -1
  82. package/dist/{vue-ui-parallel-coordinate-plot-C6CQj1ih.cjs → vue-ui-parallel-coordinate-plot-C8KCRAX1.cjs} +1 -1
  83. package/dist/{vue-ui-parallel-coordinate-plot-6LNS_W9b.js → vue-ui-parallel-coordinate-plot-in5qpfXf.js} +12 -12
  84. package/dist/{vue-ui-quadrant-BPJzCH5I.cjs → vue-ui-quadrant-Bw-0aW4F.cjs} +1 -1
  85. package/dist/{vue-ui-quadrant-eQs9Dod-.js → vue-ui-quadrant-C_9VNAXg.js} +12 -12
  86. package/dist/{vue-ui-quick-chart-CTMgh6oC.js → vue-ui-quick-chart-BDBlm9uu.js} +9 -9
  87. package/dist/{vue-ui-quick-chart-CWhEkYew.cjs → vue-ui-quick-chart-C0YqMjyE.cjs} +1 -1
  88. package/dist/{vue-ui-radar-Rrbv8dAs.js → vue-ui-radar-C2QM_ee9.js} +12 -12
  89. package/dist/{vue-ui-radar-CbwxQra8.cjs → vue-ui-radar-DXKMbeyW.cjs} +1 -1
  90. package/dist/{vue-ui-rating-BDy7Vxiz.cjs → vue-ui-rating-CsOknvaV.cjs} +1 -1
  91. package/dist/{vue-ui-rating-b_H5cz4V.js → vue-ui-rating-DVpgv2AY.js} +2 -2
  92. package/dist/{vue-ui-relation-circle-BsaD2Vz5.js → vue-ui-relation-circle-OXfdAyky.js} +7 -7
  93. package/dist/{vue-ui-relation-circle-CYxPC6gU.cjs → vue-ui-relation-circle-ZA-M7aSc.cjs} +1 -1
  94. package/dist/{vue-ui-rings-CywU-FZc.js → vue-ui-rings-qLQ-gl21.js} +11 -11
  95. package/dist/{vue-ui-rings-Dj329t-Y.cjs → vue-ui-rings-rftqDu-q.cjs} +1 -1
  96. package/dist/{vue-ui-scatter-Cf7C-P1q.js → vue-ui-scatter-4LbMvEAD.js} +12 -12
  97. package/dist/{vue-ui-scatter-BU3bhusK.cjs → vue-ui-scatter-Cv2IcrVH.cjs} +1 -1
  98. package/dist/{vue-ui-screenshot-DBeBfiuI.js → vue-ui-screenshot-BV6ZYQRk.js} +1 -1
  99. package/dist/{vue-ui-screenshot-v4TXqkKi.cjs → vue-ui-screenshot-BgjnQNxG.cjs} +1 -1
  100. package/dist/{vue-ui-skeleton-BgKRd_jD.js → vue-ui-skeleton-BY8Jg9a_.js} +3 -3
  101. package/dist/{vue-ui-skeleton-e8hBgzZq.cjs → vue-ui-skeleton-DsRTbz6d.cjs} +1 -1
  102. package/dist/{vue-ui-smiley-BEPDv0B2.js → vue-ui-smiley-BQ_3uicm.js} +2 -2
  103. package/dist/{vue-ui-smiley-WLjNbXtv.cjs → vue-ui-smiley-DB3y8CIb.cjs} +1 -1
  104. package/dist/{vue-ui-spark-trend-CWlczo-T.js → vue-ui-spark-trend-BhCJfY_p.js} +5 -5
  105. package/dist/{vue-ui-spark-trend-BqJ9Du4S.cjs → vue-ui-spark-trend-Cgn7ONtS.cjs} +1 -1
  106. package/dist/{vue-ui-sparkbar-CC644wqU.cjs → vue-ui-sparkbar-D4GIhUXT.cjs} +1 -1
  107. package/dist/{vue-ui-sparkbar-CpzctkDi.js → vue-ui-sparkbar-DxXt-GHr.js} +4 -4
  108. package/dist/{vue-ui-sparkgauge-DhTYuVVk.js → vue-ui-sparkgauge-BCPkJveV.js} +4 -4
  109. package/dist/{vue-ui-sparkgauge-QdcUMSrr.cjs → vue-ui-sparkgauge-BbltbIrq.cjs} +1 -1
  110. package/dist/{vue-ui-sparkhistogram-DT8aWhy7.js → vue-ui-sparkhistogram-BKcr2mFc.js} +5 -5
  111. package/dist/{vue-ui-sparkhistogram-B_bkoRo5.cjs → vue-ui-sparkhistogram-DzX6lkk8.cjs} +1 -1
  112. package/dist/{vue-ui-sparkline-gNuSbC73.cjs → vue-ui-sparkline-C-svTmFU.cjs} +1 -1
  113. package/dist/{vue-ui-sparkline-B0y9q_YB.js → vue-ui-sparkline-DYHUFUOp.js} +4 -4
  114. package/dist/{vue-ui-sparkstackbar-D0EW5UMR.js → vue-ui-sparkstackbar-Btag2osm.js} +5 -5
  115. package/dist/{vue-ui-sparkstackbar-BObzDdzR.cjs → vue-ui-sparkstackbar-CL0uL_Te.cjs} +1 -1
  116. package/dist/{vue-ui-stackbar-Behinggy.js → vue-ui-stackbar-C2mRU7ya.js} +12 -12
  117. package/dist/{vue-ui-stackbar-BRxbXX0l.cjs → vue-ui-stackbar-CML7v_yU.cjs} +1 -1
  118. package/dist/{vue-ui-strip-plot-DjyK_xfj.js → vue-ui-strip-plot-BIXF3VxN.js} +11 -11
  119. package/dist/{vue-ui-strip-plot-CjhT-LmB.cjs → vue-ui-strip-plot-Vn5sEcME.cjs} +1 -1
  120. package/dist/{vue-ui-table-C2YKKkgd.cjs → vue-ui-table-BbVpmm0B.cjs} +1 -1
  121. package/dist/{vue-ui-table-DYrm2td6.js → vue-ui-table-CyuRalnp.js} +1 -1
  122. package/dist/{vue-ui-table-heatmap-uSw3G5Yp.js → vue-ui-table-heatmap-DlGeS3l9.js} +4 -4
  123. package/dist/{vue-ui-table-heatmap-_A66YkO3.cjs → vue-ui-table-heatmap-DrQXQd41.cjs} +1 -1
  124. package/dist/{vue-ui-table-sparkline-CimHSr9x.cjs → vue-ui-table-sparkline-DauDTktD.cjs} +1 -1
  125. package/dist/{vue-ui-table-sparkline-DP752Vad.js → vue-ui-table-sparkline-Yg2I33yZ.js} +5 -5
  126. package/dist/{vue-ui-thermometer-CqmSsg-L.cjs → vue-ui-thermometer-Bglz0dOQ.cjs} +1 -1
  127. package/dist/{vue-ui-thermometer-BAoZL-gV.js → vue-ui-thermometer-DXwbqNrn.js} +7 -7
  128. package/dist/{vue-ui-timer-CmeHwizl.js → vue-ui-timer-Brr7buaM.js} +5 -5
  129. package/dist/{vue-ui-timer-B3kBoPr3.cjs → vue-ui-timer-CpSEl8UD.cjs} +1 -1
  130. package/dist/{vue-ui-tiremarks-DEcQ-B-G.js → vue-ui-tiremarks-DJowPFwY.js} +7 -7
  131. package/dist/{vue-ui-tiremarks-DyAHN8nt.cjs → vue-ui-tiremarks-zdGmZNjo.cjs} +1 -1
  132. package/dist/{vue-ui-treemap-sI6K1nm9.js → vue-ui-treemap-Bn5JU5BI.js} +11 -11
  133. package/dist/{vue-ui-treemap-CNSeLpGe.cjs → vue-ui-treemap-a7NSP656.cjs} +1 -1
  134. package/dist/{vue-ui-vertical-bar-B1TdmM7c.cjs → vue-ui-vertical-bar-BYG1vGlT.cjs} +1 -1
  135. package/dist/{vue-ui-vertical-bar-COsFMFTH.js → vue-ui-vertical-bar-CZxN7L9z.js} +11 -11
  136. package/dist/{vue-ui-waffle-Cz1aIQK1.cjs → vue-ui-waffle-BbDBOivH.cjs} +1 -1
  137. package/dist/{vue-ui-waffle-DBjvyyH7.js → vue-ui-waffle-CzUpKfkZ.js} +11 -11
  138. package/dist/{vue-ui-wheel-BGT8eh76.js → vue-ui-wheel-CCje_ZSc.js} +7 -7
  139. package/dist/{vue-ui-wheel-D2SqIwip.cjs → vue-ui-wheel-lN3uYCr4.cjs} +1 -1
  140. package/dist/{vue-ui-word-cloud-BFLqOtlV.cjs → vue-ui-word-cloud-BjvG3n7x.cjs} +1 -1
  141. package/dist/{vue-ui-word-cloud-vUXYTp4a.js → vue-ui-word-cloud-D_5y92zN.js} +10 -10
  142. package/dist/{vue-ui-xy-CoDtZktc.cjs → vue-ui-xy-B-WlwJXZ.cjs} +1 -1
  143. package/dist/{vue-ui-xy-DyDkCQL0.js → vue-ui-xy-Drm1aAb-.js} +14 -14
  144. package/dist/{vue-ui-xy-canvas-C6db7VrZ.cjs → vue-ui-xy-canvas-BHrq_CYD.cjs} +1 -1
  145. package/dist/{vue-ui-xy-canvas-DnPYfALY.js → vue-ui-xy-canvas-jieVsnBN.js} +11 -11
  146. package/package.json +1 -1
  147. package/dist/Slicer-BUhJuKdW.cjs +0 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-DsF7Aej7.cjs"),Pe=require("./Title-Az2QIayC.cjs"),pe=require("./usePrinter-CUDeluax.cjs"),ze=require("./Tooltip-wdo3yY_W.cjs"),Oe=require("./Legend-B3KPtqT8.cjs"),Ve=require("./vue-ui-skeleton-e8hBgzZq.cjs"),Ee=require("./DataTable-T6NSDRqO.cjs"),Le=require("./vue-ui-accordion-Av34wbMx.cjs"),fe=require("./useResponsive-BJ7DTGpm.cjs"),ge=require("./useNestedProp-D0YHk8Cd.cjs"),Re=require("./PackageVersion-BjoP5ypd.cjs"),Ae=require("./PenAndPaper-C0H3KJhQ.cjs"),Fe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");function me(n,d){const s=n.length;if(s===0)throw new Error(`Max aspect ratio cannot be computed: ${n} is an empty array`);{let u=1/0,c=-1/0,v=0;for(let f=0;f<s;f+=1){const p=n[f].normalizedValue;p<u&&(u=p),p>c&&(c=p),v+=p}return Math.max(d**2*c/v**2,v**2/(d**2*u))}}function ye(n){const{xOffset:d,yOffset:s,width:u,height:c}=n;return{x0:d,y0:s,x1:d+u,y1:s+c}}function Ie(n,d,s){if(n.length===0)return!0;{const u=n.concat(d),c=me(n,s),v=me(u,s);return c>=v}}function De(n){const d=[],s=n.length;for(let u=0;u<s;u+=1){const c=n[u],v=c.length;for(let h=0;h<v;h+=1)d.push(c[h])}return d}function qe(n,d){const s={...d,children:n};return ke(s)}function He(n){return(n.x1-n.x0)*(n.y1-n.y0)}function be(n,d){const{width:s,height:u,xOffset:c,yOffset:v}=X(d),h=n.length,f=n.map(g=>g.normalizedValue||0).reduce((g,k)=>g+k,0),p=f/u,C=f/s;let b=c,w=v;const m=[];if(s>=u){for(let g=0;g<h;g+=1){const k=n[g],x=w+k.normalizedValue/p,B={x0:b,y0:w,x1:b+p,y1:x},T=Object.assign({},k,B);w=x,m.push(T)}return m}else{for(let g=0;g<h;g+=1){const k=n[g],x=b+k.normalizedValue/C,B={x0:b,y0:w,x1:x,y1:w+C},T=Object.assign({},k,B);b=x,m.push(T)}return m}}function Me(n){const d=X(n),s=d.width,u=d.height;return Math.min(s,u)}function We(n,d){const s=n.length,u=n.map(p=>p.value??0).reduce((p,C)=>p+C,0),c=d/u,v=[];let h,f;for(let p=0;p<s;p+=1)f=n[p],h=Object.assign({},f,{normalizedValue:f.value*(c||0)}),v.push(h);return v}function X(n){const{x0:d,y0:s,x1:u,y1:c}=n;return{xOffset:d,yOffset:s,width:u-d,height:c-s}}function Ue(n,d,s,u){let c=n,v=d,h=s,f=u;for(;;){const p=c.length;if(p===0){const m=be(v,h);return f.concat(m)}const C=Me(h),b=c[0],w=c.slice(1,p);if(Ie(v,b,C)){const m=v.concat(b);c=w,v=m,h=h,f=f}else{const m=v.length;let g=0;for(let T=0;T<m;T+=1)g+=v[T].normalizedValue;const k=Ge(h,g),x=be(v,h),B=f.concat(x);c=c,v=[],h=k,f=B}}}function ke(n){if(typeof n.children>"u"||!n.children.length)return[n];{const d=We(n.children,He(n)),s=Ue(d,[],n,[]),u=s.length,c=[];for(let h=0;h<u;h+=1)c.push(ke(s[h]));return De(c)}}function Ge(n,d){const{width:s,height:u,xOffset:c,yOffset:v}=X(n);if(s>=u){const h=d/u,f=s-h,p={xOffset:c+h,yOffset:v,width:f,height:u};return ye(p)}else{const h=d/s,f=u-h,p={xOffset:c,yOffset:v+h,width:s,height:f};return ye(p)}}const je=n=>(e.pushScopeId("data-v-04106534"),n=n(),e.popScopeId(),n),Xe=["id"],Ye=["xmlns","viewBox"],Ze={key:0},Je=["id"],Ke=["stop-color"],Qe=["stop-color"],et=["x","y","height","width","fill","rx","stroke","stroke-width","onClick","onMouseenter"],tt=["x","y","height","width"],ot={style:{width:"100%",height:"100%"},class:"vue-ui-treemap-cell"},lt=je(()=>e.createElementVNode("br",null,null,-1)),at={key:5,class:"vue-data-ui-watermark"},nt=["onClick"],rt={key:0},ut={key:1},st=["innerHTML"],it={__name:"vue-ui-treemap",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(n,{expose:d,emit:s}){const u=n,{vue_ui_treemap:c}=r.useConfig(),v=e.computed(()=>!!u.dataset&&u.dataset.length),h=e.computed(()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),f=e.ref(r.createUid()),p=e.ref(!1),C=e.ref(""),b=e.ref(!1),w=e.ref(0),m=e.ref([]),g=e.ref(null),k=e.ref(null),x=e.ref(null),B=e.ref(null),T=e.ref(null),Y=e.ref(0),Z=e.ref(0),J=e.ref(0),t=e.computed({get:()=>K(),set:o=>o});function K(){const o=ge.useNestedProp({userConfig:u.config,defaultConfig:c});return o.theme?{...ge.useNestedProp({userConfig:r.themes.vue_ui_treemap[o.theme]||u.config,defaultConfig:o}),customPalette:r.themePalettes[o.theme]||r.palette}:o}e.watch(()=>u.config,o=>{t.value=K(),Y.value+=1,Z.value+=1,J.value+=1},{deep:!0});const{isPrinting:Q,isImaging:ee,generatePdf:te,generateImage:oe}=pe.usePrinter({elementId:`treemap_${f.value}`,fileName:t.value.style.chart.title.text||"vue-ui-treemap"}),Ce=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),I=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),_=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),P=e.ref({height:t.value.style.chart.height,width:t.value.style.chart.width}),O=e.computed(()=>({bottom:P.value.height-t.value.style.chart.padding.bottom,height:P.value.height-t.value.style.chart.padding.top-t.value.style.chart.padding.bottom,left:t.value.style.chart.padding.left,right:P.value.width-t.value.style.chart.padding.right,top:t.value.style.chart.padding.top,vbHeight:P.value.height,vbWidth:P.value.width,width:P.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right}));function le(o){o.forEach((a,l)=>{a.id=r.createUid(),a.color=r.convertColorToHex(a.color)||I.value[l]||r.palette[l]||r.palette[l%r.palette.length],a.children&&(a.children.forEach(i=>{i.parentId=a.id,i.color=a.color}),le(a.children))})}const V=e.ref(u.dataset),D=e.ref(null);e.onMounted(()=>{we()});function we(){if(r.objectIsEmpty(u.dataset)&&r.error({componentName:"VueUiTreemap",type:"dataset"}),le(V.value),t.value.responsive){const o=fe.throttle(()=>{const{width:a,height:l}=fe.useResponsive({chart:g.value,title:t.value.style.chart.title.text?k.value:null,legend:t.value.style.chart.legend.show?x.value:null,source:B.value,noTitle:T.value});P.value.width=a,P.value.height=l});D.value=new ResizeObserver(o),D.value.observe(g.value.parentNode)}}e.onBeforeUnmount(()=>{D.value&&D.value.disconnect()});const W=e.ref(V.value),A=e.computed(()=>W.value.map((o,a)=>({...o,color:r.convertColorToHex(o.color)||I.value[a]||r.palette[a]||r.palette[a%r.palette.length]})).filter(o=>!m.value.includes(o.id))),L=e.computed(()=>V.value.filter(o=>!m.value.includes(o.id)).map(o=>o.value||0).reduce((o,a)=>o+a,0)),ae=e.computed({get(){let o=[...A.value];return t.value.style.chart.layout.sorted&&(o=[...A.value].sort((a,l)=>l.value-a.value)),o.map(a=>({...a}))},set(o){return o}});function ne(o,a){return o.value/a}function xe(o,a,l){const i=t.value.style.chart.layout.rects.colorRatio-ne(a,l);return r.lightenHexColor(o,i<0?0:i)}function re(o,a,l,i){return o.map((y,z)=>{const M=xe(r.convertColorToHex(a)||I.value[z]||r.palette[z]||r.palette[z%r.palette.length],y,i),_e=ne(y,i);return{...y,color:M,proportion:_e,parentName:l,children:y.children?re(y.children,M,y.name,i):void 0}})}const F=e.computed(()=>qe(ae.value.map((o,a)=>{const l=o.children?o.children.reduce((i,y)=>i+y.value,0):o.value;return{value:o.value,id:o.id,children:o.children?re(o.children.sort((i,y)=>y.value-i.value),o.color,o.name,l):void 0,color:o.color,name:o.name}}),{x0:O.value.left*2,y0:O.value.top,x1:O.value.width,y1:O.value.height}));function ue({y0:o,y1:a}){return a-o<=0?1e-4:a-o}function se({x0:o,x1:a}){return a-o<=0?1e-4:a-o}function E(o){const a=t.value.style.chart.layout.labels.fontSize*(o.proportion*2>1?1:o.proportion*2);return a<t.value.style.chart.layout.labels.minFontSize?t.value.style.chart.layout.labels.minFontSize:a}function Te(o){b.value=o,w.value+=1}const R=e.computed(()=>({startX:0,startY:0,width:O.value.vbWidth,height:O.value.vbHeight})),$=e.ref(!1);function U(o,a=V.value){for(const l of a){if(l.id===o)return l;if(l.children){const i=U(o,l.children);if(i)return i}}return null}function $e(o){if($.value)s("selectDatapoint",void 0),W.value=V.value;else{if(s("selectDatapoint",o),!U(o.parentId))return;W.value=[U(o.parentId)]}$.value=!$.value}const S=e.ref(null),ie=e.computed(()=>V.value.map((o,a)=>({...o,color:r.convertColorToHex(o.color)||I.value[a]||r.palette[a]||r.palette[a%r.palette.length],shape:"square"})).sort((o,a)=>a.value-o.value).map((o,a)=>({...o,proportion:o.value/V.value.map(l=>l.value).reduce((l,i)=>l+i,0),opacity:m.value.includes(o.id)?.5:1}))),Se=e.computed(()=>({cy:"treemap-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""}));function ce(o){$.value=!1,S.value=null,m.value.includes(o.id)?m.value=m.value.filter(a=>a!==o.id):m.value.length<u.dataset.length-1&&m.value.push(o.id),s("selectLegend",ae.value)}const G=e.ref(null);function Ne({datapoint:o,seriesIndex:a}){S.value=o,G.value={datapoint:o,seriesIndex:a,config:t.value,series:A.value};const l=t.value.style.chart.tooltip.customFormat;if(r.isFunction(l)&&r.functionReturnsString(()=>l({seriesIndex:a,datapoint:o,series:A.value,config:t.value})))C.value=l({seriesIndex:a,datapoint:o,series:A.value,config:t.value});else{let i="";i+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${o.name}</div>`,i+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><rect x="0" y="0" height="12" width="12" stroke="none" fill="${o.color}"/></svg>`,i+=`<b>${r.applyDataLabel(t.value.style.chart.layout.labels.formatter,o.value,r.dataLabel({p:t.value.style.chart.layout.labels.prefix,v:o.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:o,seriesIndex:a})}</b>`,C.value=`<div>${i}</div>`}p.value=!0}const N=e.computed(()=>{const o=F.value.map(l=>({name:l.name,color:l.color})),a=F.value.map(l=>l.value);return{head:o,body:a}});function de(){e.nextTick(()=>{const o=N.value.head.map((i,y)=>[[i.name],[N.value.body[y]],[isNaN(N.value.body[y]/L.value)?"-":N.value.body[y]/L.value*100]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(o),l=r.createCsvContent(a);r.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-treemap"})})}const q=e.computed(()=>{const o=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage],a=N.value.head.map((y,z)=>{const M=r.applyDataLabel(t.value.style.chart.layout.labels.formatter,N.value.body[z],r.dataLabel({p:t.value.style.chart.layout.labels.prefix,v:N.value.body[z],s:t.value.style.chart.layout.labels.suffix,r:t.value.table.td.roundingValue}));return[{color:y.color,name:y.name,shape:"square"},M,isNaN(N.value.body[z]/L.value)?"-":r.dataLabel({v:N.value.body[z]/L.value*100,s:"%",r:t.value.table.td.roundingPercentage})]}),l={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value],head:o,body:a,config:l}});function Be(){return F.value}function ve(){_.value.showTable=!_.value.showTable}function he(){_.value.showTooltip=!_.value.showTooltip}const H=e.ref(!1);function j(){H.value=!H.value}return d({getData:Be,generateCsv:de,generateImage:oe,generatePdf:te,toggleTable:ve,toggleTooltip:he,toggleAnnotator:j}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"treemapChart",ref:g,class:e.normalizeClass(`vue-ui-treemap ${b.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; ${t.value.responsive?"height: 100%;":""} text-align:center;background:${t.value.style.chart.backgroundColor}`),id:`treemap_${f.value}`},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Ae.PenAndPaper,{key:0,parent:g.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:H.value,onClose:j},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),Ce.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:T,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:k,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:6px`)},[(e.openBlock(),e.createBlock(Pe._sfc_main,{key:`title_${Y.value}`,config:{title:{cy:"treemap-div-title",...t.value.style.chart.title},subtitle:{cy:"treemap-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&v.value?(e.openBlock(),e.createBlock(pe.UserOptions,{ref:"details",key:`user_option_${w.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(Q),isImaging:e.unref(ee),uid:f.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:b.value,isTooltip:_.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:g.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:H.value,onToggleFullscreen:Te,onGeneratePdf:e.unref(te),onGenerateCsv:de,onGenerateImage:e.unref(oe),onToggleTable:ve,onToggleTooltip:he,onToggleAnnotator:j},e.createSlots({_:2},[o.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:i})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:i})),void 0,!0)]),key:"5"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:i})=>[e.renderSlot(o.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:i})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),v.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":b.value,"vue-data-ui-fulscreen--off":!b.value,"vue-data-ui-zoom-plus":!$.value,"vue-data-ui-zoom-minus":$.value}),viewBox:`${R.value.startX} ${R.value.startY} ${R.value.width<=0?10:R.value.width} ${R.value.height<=0?10:R.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: hidden; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Re._sfc_main),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(l,i)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.chart.layout.rects.gradient.show?(e.openBlock(),e.createElementBlock("defs",Ze,[e.createElementVNode("radialGradient",{id:`tgrad_${l.id}`,gradientTransform:"translate(-1, -1.000001) scale(2, 2)"},[e.createElementVNode("stop",{offset:"18%","stop-color":l.color},null,8,Ke),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.lightenHexColor)(l.color,t.value.style.chart.layout.rects.gradient.intensity/100)},null,8,Qe)],8,Je)])):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(l,i)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:l.x0,y:l.y0,height:ue(l),width:se(l),fill:h.value?l.color:t.value.style.chart.layout.rects.gradient.show?`url(#tgrad_${l.id})`:l.color,rx:t.value.style.chart.layout.rects.borderRadius,stroke:S.value&&S.value.id===l.id?t.value.style.chart.layout.rects.selected.stroke:t.value.style.chart.layout.rects.stroke,"stroke-width":S.value&&S.value.id===l.id?t.value.style.chart.layout.rects.selected.strokeWidth:t.value.style.chart.layout.rects.strokeWidth,onClick:y=>$e(l),onMouseenter:()=>Ne({datapoint:l,seriesIndex:i}),onMouseleave:a[0]||(a[0]=y=>{S.value=null,p.value=!1}),style:e.normalizeStyle(`opacity:${S.value?S.value.id===l.id?1:t.value.style.chart.layout.rects.selected.unselectedOpacity:1}`),class:"vue-ui-treemap-rect"},null,44,et),(e.openBlock(),e.createElementBlock("foreignObject",{x:l.x0,y:l.y0,height:ue(l),width:se(l),class:"vue-ui-treemap-cell-foreignObject"},[e.createElementVNode("div",ot,[t.value.style.chart.layout.labels.showDefaultLabels&&(l.proportion>t.value.style.chart.layout.labels.hideUnderProportion||$.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vue-ui-treemap-cell-default",style:e.normalizeStyle(`width:calc(100% - ${E(l)/1.5}px);text-align:left;line-height:${E(l)<14?14:E(l)}px;padding:${E(l)/3}px; color:${e.unref(r.adaptColorToBackground)(l.color)}`)},[e.createElementVNode("span",{style:e.normalizeStyle(`width:100%;font-size:${E(l)}px;`)},e.toDisplayString(l.name),5),lt,e.createElementVNode("span",{style:e.normalizeStyle(`width:100%;font-size:${E(l)}px;`)},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.formatter,l.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.labels.prefix,v:l.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.layout.labels.rounding}),{datapoint:l})),5)],4)):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"rect",e.normalizeProps(e.guardReactiveProps({rect:l,shouldShow:l.proportion>t.value.style.chart.layout.labels.hideUnderProportion||$.value,fontSize:E(l),isZoom:$.value,textColor:e.unref(r.adaptColorToBackground)(l.color)})),void 0,!0)])],8,tt))]))),256)),e.renderSlot(o.$slots,"svg",e.normalizeProps(e.guardReactiveProps({svg:O.value,isZoom:$.value,rect:S.value,config:t.value})),void 0,!0)],14,Ye)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",at,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(Q)||e.unref(ee)})),void 0,!0)])):e.createCommentVNode("",!0),v.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ve.default,{key:6,config:{type:"treemap",style:{backgroundColor:t.value.style.chart.backgroundColor,treemap:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:x},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(Oe.Legend,{key:`legend_${J.value}`,legendSet:ie.value,config:Se.value,id:`treemap_legend_${f.value}`,onClickMarker:a[1]||(a[1]=({legend:l})=>ce(l))},{item:e.withCtx(({legend:l,index:i})=>[e.createElementVNode("div",{onClick:y=>ce(l),style:e.normalizeStyle(`opacity:${m.value.includes(l.id)?.5:1}`)},[e.createTextVNode(e.toDisplayString(l.name)+": "+e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.formatter,l.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.labels.prefix,v:l.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:l}))+" ",1),m.value.includes(l.id)?(e.openBlock(),e.createElementBlock("span",ut," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",rt," ("+e.toDisplayString(isNaN(l.value/L.value)?"-":(l.value/L.value*100).toFixed(t.value.style.chart.legend.roundingPercentage))+"%) ",1))],12,nt)]),_:1},8,["legendSet","config","id"])):e.renderSlot(o.$slots,"legend",{key:1,legend:ie.value},void 0,!0)],512),o.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:B,dir:"auto"},[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(ze._sfc_main,{show:_.value.showTooltip&&p.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,fontSize:t.value.style.chart.tooltip.fontSize,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:g.value,content:C.value,isCustom:e.unref(r.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...G.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...G.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isCustom"]),v.value?(e.openBlock(),e.createBlock(Le.default,{key:8,hideDetails:"",config:{open:_.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(Ee.DataTable,{key:`table_${Z.value}`,colNames:q.value.colNames,head:q.value.head,body:q.value.body,config:q.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:a[2]||(a[2]=l=>_.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,st)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l.name||l),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,Xe))}},ct=Fe._export_sfc(it,[["__scopeId","data-v-04106534"]]);exports.default=ct;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-CsQwCVqU.cjs"),Pe=require("./Title-BRqTk-nT.cjs"),pe=require("./usePrinter-O2fMMTMe.cjs"),ze=require("./Tooltip-DvGSIp31.cjs"),Oe=require("./Legend-G5Zc4QaZ.cjs"),Ve=require("./vue-ui-skeleton-DsRTbz6d.cjs"),Ee=require("./DataTable-H-KTkjfv.cjs"),Le=require("./vue-ui-accordion-CaktYQoo.cjs"),fe=require("./useResponsive-BJ7DTGpm.cjs"),ge=require("./useNestedProp-DSYpaLxP.cjs"),Re=require("./PackageVersion-BbQFSVXm.cjs"),Ae=require("./PenAndPaper-BX8pR5oV.cjs"),Fe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");function me(n,d){const s=n.length;if(s===0)throw new Error(`Max aspect ratio cannot be computed: ${n} is an empty array`);{let u=1/0,c=-1/0,v=0;for(let f=0;f<s;f+=1){const p=n[f].normalizedValue;p<u&&(u=p),p>c&&(c=p),v+=p}return Math.max(d**2*c/v**2,v**2/(d**2*u))}}function ye(n){const{xOffset:d,yOffset:s,width:u,height:c}=n;return{x0:d,y0:s,x1:d+u,y1:s+c}}function Ie(n,d,s){if(n.length===0)return!0;{const u=n.concat(d),c=me(n,s),v=me(u,s);return c>=v}}function De(n){const d=[],s=n.length;for(let u=0;u<s;u+=1){const c=n[u],v=c.length;for(let h=0;h<v;h+=1)d.push(c[h])}return d}function qe(n,d){const s={...d,children:n};return ke(s)}function He(n){return(n.x1-n.x0)*(n.y1-n.y0)}function be(n,d){const{width:s,height:u,xOffset:c,yOffset:v}=X(d),h=n.length,f=n.map(g=>g.normalizedValue||0).reduce((g,k)=>g+k,0),p=f/u,C=f/s;let b=c,w=v;const m=[];if(s>=u){for(let g=0;g<h;g+=1){const k=n[g],x=w+k.normalizedValue/p,B={x0:b,y0:w,x1:b+p,y1:x},T=Object.assign({},k,B);w=x,m.push(T)}return m}else{for(let g=0;g<h;g+=1){const k=n[g],x=b+k.normalizedValue/C,B={x0:b,y0:w,x1:x,y1:w+C},T=Object.assign({},k,B);b=x,m.push(T)}return m}}function Me(n){const d=X(n),s=d.width,u=d.height;return Math.min(s,u)}function We(n,d){const s=n.length,u=n.map(p=>p.value??0).reduce((p,C)=>p+C,0),c=d/u,v=[];let h,f;for(let p=0;p<s;p+=1)f=n[p],h=Object.assign({},f,{normalizedValue:f.value*(c||0)}),v.push(h);return v}function X(n){const{x0:d,y0:s,x1:u,y1:c}=n;return{xOffset:d,yOffset:s,width:u-d,height:c-s}}function Ue(n,d,s,u){let c=n,v=d,h=s,f=u;for(;;){const p=c.length;if(p===0){const m=be(v,h);return f.concat(m)}const C=Me(h),b=c[0],w=c.slice(1,p);if(Ie(v,b,C)){const m=v.concat(b);c=w,v=m,h=h,f=f}else{const m=v.length;let g=0;for(let T=0;T<m;T+=1)g+=v[T].normalizedValue;const k=Ge(h,g),x=be(v,h),B=f.concat(x);c=c,v=[],h=k,f=B}}}function ke(n){if(typeof n.children>"u"||!n.children.length)return[n];{const d=We(n.children,He(n)),s=Ue(d,[],n,[]),u=s.length,c=[];for(let h=0;h<u;h+=1)c.push(ke(s[h]));return De(c)}}function Ge(n,d){const{width:s,height:u,xOffset:c,yOffset:v}=X(n);if(s>=u){const h=d/u,f=s-h,p={xOffset:c+h,yOffset:v,width:f,height:u};return ye(p)}else{const h=d/s,f=u-h,p={xOffset:c,yOffset:v+h,width:s,height:f};return ye(p)}}const je=n=>(e.pushScopeId("data-v-04106534"),n=n(),e.popScopeId(),n),Xe=["id"],Ye=["xmlns","viewBox"],Ze={key:0},Je=["id"],Ke=["stop-color"],Qe=["stop-color"],et=["x","y","height","width","fill","rx","stroke","stroke-width","onClick","onMouseenter"],tt=["x","y","height","width"],ot={style:{width:"100%",height:"100%"},class:"vue-ui-treemap-cell"},lt=je(()=>e.createElementVNode("br",null,null,-1)),at={key:5,class:"vue-data-ui-watermark"},nt=["onClick"],rt={key:0},ut={key:1},st=["innerHTML"],it={__name:"vue-ui-treemap",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(n,{expose:d,emit:s}){const u=n,{vue_ui_treemap:c}=r.useConfig(),v=e.computed(()=>!!u.dataset&&u.dataset.length),h=e.computed(()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),f=e.ref(r.createUid()),p=e.ref(!1),C=e.ref(""),b=e.ref(!1),w=e.ref(0),m=e.ref([]),g=e.ref(null),k=e.ref(null),x=e.ref(null),B=e.ref(null),T=e.ref(null),Y=e.ref(0),Z=e.ref(0),J=e.ref(0),t=e.computed({get:()=>K(),set:o=>o});function K(){const o=ge.useNestedProp({userConfig:u.config,defaultConfig:c});return o.theme?{...ge.useNestedProp({userConfig:r.themes.vue_ui_treemap[o.theme]||u.config,defaultConfig:o}),customPalette:r.themePalettes[o.theme]||r.palette}:o}e.watch(()=>u.config,o=>{t.value=K(),Y.value+=1,Z.value+=1,J.value+=1},{deep:!0});const{isPrinting:Q,isImaging:ee,generatePdf:te,generateImage:oe}=pe.usePrinter({elementId:`treemap_${f.value}`,fileName:t.value.style.chart.title.text||"vue-ui-treemap"}),Ce=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),I=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),_=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),P=e.ref({height:t.value.style.chart.height,width:t.value.style.chart.width}),O=e.computed(()=>({bottom:P.value.height-t.value.style.chart.padding.bottom,height:P.value.height-t.value.style.chart.padding.top-t.value.style.chart.padding.bottom,left:t.value.style.chart.padding.left,right:P.value.width-t.value.style.chart.padding.right,top:t.value.style.chart.padding.top,vbHeight:P.value.height,vbWidth:P.value.width,width:P.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right}));function le(o){o.forEach((a,l)=>{a.id=r.createUid(),a.color=r.convertColorToHex(a.color)||I.value[l]||r.palette[l]||r.palette[l%r.palette.length],a.children&&(a.children.forEach(i=>{i.parentId=a.id,i.color=a.color}),le(a.children))})}const V=e.ref(u.dataset),D=e.ref(null);e.onMounted(()=>{we()});function we(){if(r.objectIsEmpty(u.dataset)&&r.error({componentName:"VueUiTreemap",type:"dataset"}),le(V.value),t.value.responsive){const o=fe.throttle(()=>{const{width:a,height:l}=fe.useResponsive({chart:g.value,title:t.value.style.chart.title.text?k.value:null,legend:t.value.style.chart.legend.show?x.value:null,source:B.value,noTitle:T.value});P.value.width=a,P.value.height=l});D.value=new ResizeObserver(o),D.value.observe(g.value.parentNode)}}e.onBeforeUnmount(()=>{D.value&&D.value.disconnect()});const W=e.ref(V.value),A=e.computed(()=>W.value.map((o,a)=>({...o,color:r.convertColorToHex(o.color)||I.value[a]||r.palette[a]||r.palette[a%r.palette.length]})).filter(o=>!m.value.includes(o.id))),L=e.computed(()=>V.value.filter(o=>!m.value.includes(o.id)).map(o=>o.value||0).reduce((o,a)=>o+a,0)),ae=e.computed({get(){let o=[...A.value];return t.value.style.chart.layout.sorted&&(o=[...A.value].sort((a,l)=>l.value-a.value)),o.map(a=>({...a}))},set(o){return o}});function ne(o,a){return o.value/a}function xe(o,a,l){const i=t.value.style.chart.layout.rects.colorRatio-ne(a,l);return r.lightenHexColor(o,i<0?0:i)}function re(o,a,l,i){return o.map((y,z)=>{const M=xe(r.convertColorToHex(a)||I.value[z]||r.palette[z]||r.palette[z%r.palette.length],y,i),_e=ne(y,i);return{...y,color:M,proportion:_e,parentName:l,children:y.children?re(y.children,M,y.name,i):void 0}})}const F=e.computed(()=>qe(ae.value.map((o,a)=>{const l=o.children?o.children.reduce((i,y)=>i+y.value,0):o.value;return{value:o.value,id:o.id,children:o.children?re(o.children.sort((i,y)=>y.value-i.value),o.color,o.name,l):void 0,color:o.color,name:o.name}}),{x0:O.value.left*2,y0:O.value.top,x1:O.value.width,y1:O.value.height}));function ue({y0:o,y1:a}){return a-o<=0?1e-4:a-o}function se({x0:o,x1:a}){return a-o<=0?1e-4:a-o}function E(o){const a=t.value.style.chart.layout.labels.fontSize*(o.proportion*2>1?1:o.proportion*2);return a<t.value.style.chart.layout.labels.minFontSize?t.value.style.chart.layout.labels.minFontSize:a}function Te(o){b.value=o,w.value+=1}const R=e.computed(()=>({startX:0,startY:0,width:O.value.vbWidth,height:O.value.vbHeight})),$=e.ref(!1);function U(o,a=V.value){for(const l of a){if(l.id===o)return l;if(l.children){const i=U(o,l.children);if(i)return i}}return null}function $e(o){if($.value)s("selectDatapoint",void 0),W.value=V.value;else{if(s("selectDatapoint",o),!U(o.parentId))return;W.value=[U(o.parentId)]}$.value=!$.value}const S=e.ref(null),ie=e.computed(()=>V.value.map((o,a)=>({...o,color:r.convertColorToHex(o.color)||I.value[a]||r.palette[a]||r.palette[a%r.palette.length],shape:"square"})).sort((o,a)=>a.value-o.value).map((o,a)=>({...o,proportion:o.value/V.value.map(l=>l.value).reduce((l,i)=>l+i,0),opacity:m.value.includes(o.id)?.5:1}))),Se=e.computed(()=>({cy:"treemap-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""}));function ce(o){$.value=!1,S.value=null,m.value.includes(o.id)?m.value=m.value.filter(a=>a!==o.id):m.value.length<u.dataset.length-1&&m.value.push(o.id),s("selectLegend",ae.value)}const G=e.ref(null);function Ne({datapoint:o,seriesIndex:a}){S.value=o,G.value={datapoint:o,seriesIndex:a,config:t.value,series:A.value};const l=t.value.style.chart.tooltip.customFormat;if(r.isFunction(l)&&r.functionReturnsString(()=>l({seriesIndex:a,datapoint:o,series:A.value,config:t.value})))C.value=l({seriesIndex:a,datapoint:o,series:A.value,config:t.value});else{let i="";i+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${o.name}</div>`,i+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><rect x="0" y="0" height="12" width="12" stroke="none" fill="${o.color}"/></svg>`,i+=`<b>${r.applyDataLabel(t.value.style.chart.layout.labels.formatter,o.value,r.dataLabel({p:t.value.style.chart.layout.labels.prefix,v:o.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:o,seriesIndex:a})}</b>`,C.value=`<div>${i}</div>`}p.value=!0}const N=e.computed(()=>{const o=F.value.map(l=>({name:l.name,color:l.color})),a=F.value.map(l=>l.value);return{head:o,body:a}});function de(){e.nextTick(()=>{const o=N.value.head.map((i,y)=>[[i.name],[N.value.body[y]],[isNaN(N.value.body[y]/L.value)?"-":N.value.body[y]/L.value*100]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(o),l=r.createCsvContent(a);r.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-treemap"})})}const q=e.computed(()=>{const o=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage],a=N.value.head.map((y,z)=>{const M=r.applyDataLabel(t.value.style.chart.layout.labels.formatter,N.value.body[z],r.dataLabel({p:t.value.style.chart.layout.labels.prefix,v:N.value.body[z],s:t.value.style.chart.layout.labels.suffix,r:t.value.table.td.roundingValue}));return[{color:y.color,name:y.name,shape:"square"},M,isNaN(N.value.body[z]/L.value)?"-":r.dataLabel({v:N.value.body[z]/L.value*100,s:"%",r:t.value.table.td.roundingPercentage})]}),l={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value],head:o,body:a,config:l}});function Be(){return F.value}function ve(){_.value.showTable=!_.value.showTable}function he(){_.value.showTooltip=!_.value.showTooltip}const H=e.ref(!1);function j(){H.value=!H.value}return d({getData:Be,generateCsv:de,generateImage:oe,generatePdf:te,toggleTable:ve,toggleTooltip:he,toggleAnnotator:j}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"treemapChart",ref:g,class:e.normalizeClass(`vue-ui-treemap ${b.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; ${t.value.responsive?"height: 100%;":""} text-align:center;background:${t.value.style.chart.backgroundColor}`),id:`treemap_${f.value}`},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Ae.PenAndPaper,{key:0,parent:g.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:H.value,onClose:j},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),Ce.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:T,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:k,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:6px`)},[(e.openBlock(),e.createBlock(Pe._sfc_main,{key:`title_${Y.value}`,config:{title:{cy:"treemap-div-title",...t.value.style.chart.title},subtitle:{cy:"treemap-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&v.value?(e.openBlock(),e.createBlock(pe.UserOptions,{ref:"details",key:`user_option_${w.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(Q),isImaging:e.unref(ee),uid:f.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:b.value,isTooltip:_.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:g.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:H.value,onToggleFullscreen:Te,onGeneratePdf:e.unref(te),onGenerateCsv:de,onGenerateImage:e.unref(oe),onToggleTable:ve,onToggleTooltip:he,onToggleAnnotator:j},e.createSlots({_:2},[o.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:i})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:i})),void 0,!0)]),key:"5"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:i})=>[e.renderSlot(o.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:i})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),v.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":b.value,"vue-data-ui-fulscreen--off":!b.value,"vue-data-ui-zoom-plus":!$.value,"vue-data-ui-zoom-minus":$.value}),viewBox:`${R.value.startX} ${R.value.startY} ${R.value.width<=0?10:R.value.width} ${R.value.height<=0?10:R.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: hidden; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Re._sfc_main),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(l,i)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.chart.layout.rects.gradient.show?(e.openBlock(),e.createElementBlock("defs",Ze,[e.createElementVNode("radialGradient",{id:`tgrad_${l.id}`,gradientTransform:"translate(-1, -1.000001) scale(2, 2)"},[e.createElementVNode("stop",{offset:"18%","stop-color":l.color},null,8,Ke),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.lightenHexColor)(l.color,t.value.style.chart.layout.rects.gradient.intensity/100)},null,8,Qe)],8,Je)])):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(l,i)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:l.x0,y:l.y0,height:ue(l),width:se(l),fill:h.value?l.color:t.value.style.chart.layout.rects.gradient.show?`url(#tgrad_${l.id})`:l.color,rx:t.value.style.chart.layout.rects.borderRadius,stroke:S.value&&S.value.id===l.id?t.value.style.chart.layout.rects.selected.stroke:t.value.style.chart.layout.rects.stroke,"stroke-width":S.value&&S.value.id===l.id?t.value.style.chart.layout.rects.selected.strokeWidth:t.value.style.chart.layout.rects.strokeWidth,onClick:y=>$e(l),onMouseenter:()=>Ne({datapoint:l,seriesIndex:i}),onMouseleave:a[0]||(a[0]=y=>{S.value=null,p.value=!1}),style:e.normalizeStyle(`opacity:${S.value?S.value.id===l.id?1:t.value.style.chart.layout.rects.selected.unselectedOpacity:1}`),class:"vue-ui-treemap-rect"},null,44,et),(e.openBlock(),e.createElementBlock("foreignObject",{x:l.x0,y:l.y0,height:ue(l),width:se(l),class:"vue-ui-treemap-cell-foreignObject"},[e.createElementVNode("div",ot,[t.value.style.chart.layout.labels.showDefaultLabels&&(l.proportion>t.value.style.chart.layout.labels.hideUnderProportion||$.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vue-ui-treemap-cell-default",style:e.normalizeStyle(`width:calc(100% - ${E(l)/1.5}px);text-align:left;line-height:${E(l)<14?14:E(l)}px;padding:${E(l)/3}px; color:${e.unref(r.adaptColorToBackground)(l.color)}`)},[e.createElementVNode("span",{style:e.normalizeStyle(`width:100%;font-size:${E(l)}px;`)},e.toDisplayString(l.name),5),lt,e.createElementVNode("span",{style:e.normalizeStyle(`width:100%;font-size:${E(l)}px;`)},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.formatter,l.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.labels.prefix,v:l.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.layout.labels.rounding}),{datapoint:l})),5)],4)):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"rect",e.normalizeProps(e.guardReactiveProps({rect:l,shouldShow:l.proportion>t.value.style.chart.layout.labels.hideUnderProportion||$.value,fontSize:E(l),isZoom:$.value,textColor:e.unref(r.adaptColorToBackground)(l.color)})),void 0,!0)])],8,tt))]))),256)),e.renderSlot(o.$slots,"svg",e.normalizeProps(e.guardReactiveProps({svg:O.value,isZoom:$.value,rect:S.value,config:t.value})),void 0,!0)],14,Ye)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",at,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(Q)||e.unref(ee)})),void 0,!0)])):e.createCommentVNode("",!0),v.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ve.default,{key:6,config:{type:"treemap",style:{backgroundColor:t.value.style.chart.backgroundColor,treemap:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:x},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(Oe.Legend,{key:`legend_${J.value}`,legendSet:ie.value,config:Se.value,id:`treemap_legend_${f.value}`,onClickMarker:a[1]||(a[1]=({legend:l})=>ce(l))},{item:e.withCtx(({legend:l,index:i})=>[e.createElementVNode("div",{onClick:y=>ce(l),style:e.normalizeStyle(`opacity:${m.value.includes(l.id)?.5:1}`)},[e.createTextVNode(e.toDisplayString(l.name)+": "+e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.formatter,l.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.labels.prefix,v:l.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:l}))+" ",1),m.value.includes(l.id)?(e.openBlock(),e.createElementBlock("span",ut," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",rt," ("+e.toDisplayString(isNaN(l.value/L.value)?"-":(l.value/L.value*100).toFixed(t.value.style.chart.legend.roundingPercentage))+"%) ",1))],12,nt)]),_:1},8,["legendSet","config","id"])):e.renderSlot(o.$slots,"legend",{key:1,legend:ie.value},void 0,!0)],512),o.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:B,dir:"auto"},[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(ze._sfc_main,{show:_.value.showTooltip&&p.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,fontSize:t.value.style.chart.tooltip.fontSize,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:g.value,content:C.value,isCustom:e.unref(r.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...G.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...G.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isCustom"]),v.value?(e.openBlock(),e.createBlock(Le.default,{key:8,hideDetails:"",config:{open:_.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(Ee.DataTable,{key:`table_${Z.value}`,colNames:q.value.colNames,head:q.value.head,body:q.value.body,config:q.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:a[2]||(a[2]=l=>_.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,st)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l.name||l),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,Xe))}},ct=Fe._export_sfc(it,[["__scopeId","data-v-04106534"]]);exports.default=ct;
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-DsF7Aej7.cjs"),de=require("./useResponsive-BJ7DTGpm.cjs"),Be=require("./Title-Az2QIayC.cjs"),ve=require("./usePrinter-CUDeluax.cjs"),Ee=require("./Tooltip-wdo3yY_W.cjs"),he=require("./Legend-B3KPtqT8.cjs"),Le=require("./vue-ui-skeleton-e8hBgzZq.cjs"),Pe=require("./BaseIcon-D-YgPcX1.cjs"),ze=require("./vue-ui-accordion-Av34wbMx.cjs"),pe=require("./useNestedProp-D0YHk8Cd.cjs"),De=require("./PackageVersion-BjoP5ypd.cjs"),Fe=require("./PenAndPaper-C0H3KJhQ.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-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;">
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 { useCssVars as Ze, computed as b, ref as r, watch as Me, onMounted as et, onBeforeUnmount as tt, openBlock as u, createElementBlock as i, normalizeClass as R, normalizeStyle as c, createBlock as M, createCommentVNode as g, unref as h, createSlots as at, withCtx as k, renderSlot as _, normalizeProps as U, guardReactiveProps as H, createElementVNode as n, toDisplayString as d, createVNode as re, Fragment as W, renderList as j, withKeys as lt, createTextVNode as ot } from "vue";
2
- import { u as nt, c as ut, t as st, a as rt, p as O, b as it, o as Oe, e as Z, v as S, d as ie, i as ee, f as I, X as dt, s as de, w as ct, x as vt, y as ht, q as pt, r as gt } from "./index-C2sScL5o.js";
2
+ import { u as nt, c as ut, t as st, a as rt, p as O, b as it, o as Oe, e as Z, v as S, d as ie, i as ee, f as I, X as dt, s as de, w as ct, x as vt, y as ht, q as pt, r as gt } from "./index-hV0hU1iE.js";
3
3
  import { t as yt, u as ft } from "./useResponsive-CoxXLe23.js";
4
- import { _ as bt } from "./Title-Dl6c1jg0.js";
5
- import { u as mt, U as _t } from "./usePrinter-CddPH-Ds.js";
6
- import { _ as kt } from "./Tooltip-8UZ341MF.js";
7
- import { L as Ie } from "./Legend-CJnJQbiR.js";
8
- import xt from "./vue-ui-skeleton-BgKRd_jD.js";
9
- import $t from "./BaseIcon-CgiYTpkb.js";
10
- import Ct from "./vue-ui-accordion-BH4FO7io.js";
11
- import { u as Ae } from "./useNestedProp-CuE-kmwp.js";
12
- import { _ as wt } from "./PackageVersion-DHeUFci0.js";
13
- import { P as Tt } from "./PenAndPaper-BKIQk9Cq.js";
4
+ import { _ as bt } from "./Title-DBozX6nP.js";
5
+ import { u as mt, U as _t } from "./usePrinter-y3d31M4g.js";
6
+ import { _ as kt } from "./Tooltip-Com_T8vc.js";
7
+ import { L as Ie } from "./Legend-hnLfwhmm.js";
8
+ import xt from "./vue-ui-skeleton-BY8Jg9a_.js";
9
+ import $t from "./BaseIcon-BRSPQaGQ.js";
10
+ import Ct from "./vue-ui-accordion-m-s-7akB.js";
11
+ import { u as Ae } from "./useNestedProp-CRAUOmT5.js";
12
+ import { _ as wt } from "./PackageVersion-wqab02xF.js";
13
+ import { P as Tt } from "./PenAndPaper-C_laA5mt.js";
14
14
  import { _ as Lt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
15
15
  const Nt = ["id"], Pt = ["onClick"], St = ["xmlns", "viewBox"], Vt = ["id"], zt = ["stop-color"], Ft = ["stop-color"], Mt = ["x", "y", "width", "height", "fill", "rx"], Ot = ["x", "y", "width", "height", "fill", "rx", "stroke", "stroke-width"], It = ["x2", "y1", "y2", "stroke", "stroke-width"], At = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Bt = ["x", "y", "text-anchor", "font-size", "fill", "font-weight"], Dt = ["x", "y", "font-size", "fill", "font-weight"], Rt = ["x", "y", "font-size", "fill", "font-weight"], Xt = ["x", "y", "font-size", "fill", "font-weight"], Et = ["y", "width", "height", "fill", "onMouseenter"], Gt = {
16
16
  key: 6,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-DsF7Aej7.cjs"),pe=require("./useResponsive-BJ7DTGpm.cjs"),Le=require("./Title-Az2QIayC.cjs"),he=require("./usePrinter-CUDeluax.cjs"),Pe=require("./Tooltip-wdo3yY_W.cjs"),Ve=require("./DataTable-T6NSDRqO.cjs"),Ee=require("./Legend-B3KPtqT8.cjs"),Ie=require("./vue-ui-skeleton-e8hBgzZq.cjs"),ze=require("./vue-ui-accordion-Av34wbMx.cjs"),fe=require("./useNestedProp-D0YHk8Cd.cjs"),Fe=require("./PackageVersion-BjoP5ypd.cjs"),Ae=require("./PenAndPaper-C0H3KJhQ.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-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,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-C2sScL5o.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-hV0hU1iE.js";
3
3
  import { t as bt, u as wt } from "./useResponsive-CoxXLe23.js";
4
- import { _ as kt } from "./Title-Dl6c1jg0.js";
5
- import { u as xt, U as Ct } from "./usePrinter-CddPH-Ds.js";
6
- import { _ as _t } from "./Tooltip-8UZ341MF.js";
7
- import { D as $t } from "./DataTable-B-_LZJ5T.js";
8
- import { L as Tt } from "./Legend-CJnJQbiR.js";
9
- import It from "./vue-ui-skeleton-BgKRd_jD.js";
10
- import St from "./vue-ui-accordion-BH4FO7io.js";
11
- import { u as Oe } from "./useNestedProp-CuE-kmwp.js";
12
- import { _ as Pt } from "./PackageVersion-DHeUFci0.js";
13
- import { P as Lt } from "./PenAndPaper-BKIQk9Cq.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";
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,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-C2sScL5o.js";
3
- import { _ as ke } from "./Title-Dl6c1jg0.js";
4
- import { u as we, U as be } from "./usePrinter-CddPH-Ds.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-hV0hU1iE.js";
3
+ import { _ as ke } from "./Title-DBozX6nP.js";
4
+ import { u as we, U as be } from "./usePrinter-y3d31M4g.js";
5
5
  import { t as Ce, u as _e } from "./useResponsive-CoxXLe23.js";
6
- import $e from "./vue-ui-skeleton-BgKRd_jD.js";
7
- import { u as H } from "./useNestedProp-CuE-kmwp.js";
8
- import { _ as xe } from "./PackageVersion-DHeUFci0.js";
9
- import { P as Ae } from "./PenAndPaper-BKIQk9Cq.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";
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-DsF7Aej7.cjs"),H=require("./Title-Az2QIayC.cjs"),z=require("./usePrinter-CUDeluax.cjs"),O=require("./useResponsive-BJ7DTGpm.cjs"),D=require("./vue-ui-skeleton-e8hBgzZq.cjs"),F=require("./useNestedProp-D0YHk8Cd.cjs"),Y=require("./PackageVersion-BjoP5ypd.cjs"),W=require("./PenAndPaper-C0H3KJhQ.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-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;