vue-data-ui 2.3.22 → 2.3.24

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 (142) hide show
  1. package/dist/{Arrow-DxXzMXB1.js → Arrow-BzYehwRw.js} +1 -1
  2. package/dist/{Arrow-BOSHa3Ag.cjs → Arrow-DfxwtZYG.cjs} +1 -1
  3. package/dist/{BaseIcon-C-k_mqXL.cjs → BaseIcon-eEUOqFAE.cjs} +1 -1
  4. package/dist/{BaseIcon-DuMfKUDs.js → BaseIcon-y4nt-SIh.js} +1 -1
  5. package/dist/{DataTable-CHXdpx94.cjs → DataTable-Ckvkqg78.cjs} +1 -1
  6. package/dist/{DataTable-DKHF_NH2.js → DataTable-DVpbqbwp.js} +2 -2
  7. package/dist/{Legend-BqqpwXbu.js → Legend-Crc6SgWK.js} +1 -1
  8. package/dist/{Legend-BwrzHxLy.cjs → Legend-DA1uCuos.cjs} +1 -1
  9. package/dist/{Shape-DW18-C9f.cjs → Shape-DaECX0MP.cjs} +1 -1
  10. package/dist/{Shape-Ccky9omb.js → Shape-_K1DD00e.js} +1 -1
  11. package/dist/{Slicer-BDsv196Y.js → Slicer-BL7ysGrk.js} +1 -1
  12. package/dist/{Slicer-xKlzke1v.cjs → Slicer-BeTiFzmi.cjs} +1 -1
  13. package/dist/{Title-Bx2ibobQ.js → Title-CMEhX9eJ.js} +1 -1
  14. package/dist/{Title-DxNugmhI.cjs → Title-D9E4eBNp.cjs} +1 -1
  15. package/dist/{Tooltip-DOEMrisX.js → Tooltip-B2XPbRE_.js} +1 -1
  16. package/dist/{Tooltip-BC2Wlz7P.cjs → Tooltip-C6EZFw-G.cjs} +1 -1
  17. package/dist/{index-BvjCO-wv.js → index-BbBCE1pM.js} +1 -1
  18. package/dist/{index-oufiZvaS.cjs → index-BcLWKvbg.cjs} +1 -1
  19. package/dist/style.css +1 -1
  20. package/dist/types/vue-data-ui.d.cts +1 -1
  21. package/dist/types/vue-data-ui.d.ts +1 -1
  22. package/dist/{useNestedProp-CmTItGss.cjs → useNestedProp-BcuQPNiW.cjs} +1 -1
  23. package/dist/{useNestedProp-2KJaYPfM.js → useNestedProp-QJwLGaK5.js} +1 -1
  24. package/dist/{usePrinter-Cc8ufBvU.cjs → usePrinter-BWCvrSz2.cjs} +1 -1
  25. package/dist/{usePrinter-CaKXrCiB.js → usePrinter-CnT0_Cbi.js} +1 -1
  26. package/dist/{vue-data-ui-DnlOZVL-.js → vue-data-ui-DfTF5XN4.js} +56 -56
  27. package/dist/{vue-data-ui-D5LrE3dP.cjs → vue-data-ui-JnBZ4O4G.cjs} +1 -1
  28. package/dist/vue-data-ui.cjs +1 -1
  29. package/dist/vue-data-ui.js +1 -1
  30. package/dist/{vue-ui-3d-bar-Cma1NB-u.cjs → vue-ui-3d-bar-Cmj5FUss.cjs} +1 -1
  31. package/dist/{vue-ui-3d-bar-qegO2SzJ.js → vue-ui-3d-bar-qtJF55BB.js} +7 -7
  32. package/dist/{vue-ui-accordion-DiR0dVog.cjs → vue-ui-accordion-BOEIWXgn.cjs} +1 -1
  33. package/dist/{vue-ui-accordion-q-bLDiD3.js → vue-ui-accordion-CM8Lp-MV.js} +3 -3
  34. package/dist/{vue-ui-age-pyramid-vQvy7rWY.js → vue-ui-age-pyramid-CVELozuZ.js} +8 -8
  35. package/dist/{vue-ui-age-pyramid-xk6Gt1LJ.cjs → vue-ui-age-pyramid-ZTUAsVJ3.cjs} +1 -1
  36. package/dist/{vue-ui-annotator-LwO1PGoN.cjs → vue-ui-annotator-BN1e8QBk.cjs} +1 -1
  37. package/dist/{vue-ui-annotator-BYT8v1SY.js → vue-ui-annotator-Cfl6lVxC.js} +1 -1
  38. package/dist/{vue-ui-candlestick-zvv6_kwp.js → vue-ui-candlestick-BhfanGOK.js} +9 -9
  39. package/dist/{vue-ui-candlestick-CmM0kwJR.cjs → vue-ui-candlestick-g0uWwqCg.cjs} +1 -1
  40. package/dist/vue-ui-carousel-table-CXmHksHV.js +346 -0
  41. package/dist/vue-ui-carousel-table-Ccc8TeFs.cjs +1 -0
  42. package/dist/{vue-ui-chestnut-A9asY_42.js → vue-ui-chestnut-Bw6l763j.js} +6 -6
  43. package/dist/{vue-ui-chestnut-4MvRD28_.cjs → vue-ui-chestnut-DHa1RSdI.cjs} +1 -1
  44. package/dist/{vue-ui-cursor-DusWgM7W.cjs → vue-ui-cursor-BGv7dDr-.cjs} +1 -1
  45. package/dist/{vue-ui-cursor-CPPPIH2W.js → vue-ui-cursor-BK77V_9W.js} +2 -2
  46. package/dist/{vue-ui-dashboard-CuQ81BKN.js → vue-ui-dashboard-CshdP-o6.js} +2 -2
  47. package/dist/{vue-ui-dashboard-ZTzEd521.cjs → vue-ui-dashboard-fqSrgnC8.cjs} +1 -1
  48. package/dist/{vue-ui-digits-DlupvOo-.cjs → vue-ui-digits-BFiCPsVU.cjs} +1 -1
  49. package/dist/{vue-ui-digits-Czkbi2AR.js → vue-ui-digits-tFHIZZ9N.js} +2 -2
  50. package/dist/{vue-ui-donut-DA5YfWlL.cjs → vue-ui-donut-BOq5T2_k.cjs} +1 -1
  51. package/dist/{vue-ui-donut-Cis7kzDB.js → vue-ui-donut-DwCC5FLx.js} +9 -9
  52. package/dist/{vue-ui-donut-evolution-BigmUCTm.cjs → vue-ui-donut-evolution-Bg70zsf9.cjs} +1 -1
  53. package/dist/{vue-ui-donut-evolution-D2I4ZD5a.js → vue-ui-donut-evolution-CysSbRMg.js} +9 -9
  54. package/dist/{vue-ui-dumbbell-D8ZSCX0H.cjs → vue-ui-dumbbell-DIbbkhZs.cjs} +1 -1
  55. package/dist/{vue-ui-dumbbell-fdV94xQB.js → vue-ui-dumbbell-Df9_opHf.js} +8 -8
  56. package/dist/{vue-ui-flow-CH6PmIBT.cjs → vue-ui-flow-BYvtiYei.cjs} +1 -1
  57. package/dist/{vue-ui-flow-C1PVwgKX.js → vue-ui-flow-DtZGgvJy.js} +7 -7
  58. package/dist/{vue-ui-galaxy-IFmqHh3R.cjs → vue-ui-galaxy-B2fbFVWs.cjs} +1 -1
  59. package/dist/{vue-ui-galaxy-DzWOfvyj.js → vue-ui-galaxy-DqiIk9DH.js} +9 -9
  60. package/dist/{vue-ui-gauge-Bbda2H3b.cjs → vue-ui-gauge-Ce80Waly.cjs} +1 -1
  61. package/dist/{vue-ui-gauge-CeGa1oMf.js → vue-ui-gauge-CkWosWjO.js} +5 -5
  62. package/dist/{vue-ui-gizmo-DyJngE0E.cjs → vue-ui-gizmo-Clsm9g4j.cjs} +1 -1
  63. package/dist/{vue-ui-gizmo-BILyJylm.js → vue-ui-gizmo-Cz_vLQob.js} +2 -2
  64. package/dist/{vue-ui-heatmap-Dp68UbGB.cjs → vue-ui-heatmap-C5C46dEp.cjs} +1 -1
  65. package/dist/{vue-ui-heatmap-DRk0VXaJ.js → vue-ui-heatmap-DPIUcnuz.js} +8 -8
  66. package/dist/{vue-ui-kpi-Mbre-_3M.cjs → vue-ui-kpi-D1ViyJSz.cjs} +1 -1
  67. package/dist/{vue-ui-kpi-u5GBFKBR.js → vue-ui-kpi-DUDYmxGM.js} +2 -2
  68. package/dist/{vue-ui-mini-loader-DLXv9Seq.js → vue-ui-mini-loader-WhdcL_Ka.js} +2 -2
  69. package/dist/{vue-ui-mini-loader-CXiMb5pi.cjs → vue-ui-mini-loader-ggvINlYv.cjs} +1 -1
  70. package/dist/{vue-ui-molecule-JlPbVJ8I.js → vue-ui-molecule-DJvkH7pt.js} +9 -9
  71. package/dist/{vue-ui-molecule-DOwGWqSR.cjs → vue-ui-molecule-fzhl4bdu.cjs} +1 -1
  72. package/dist/{vue-ui-mood-radar-C3Boyr96.js → vue-ui-mood-radar-D_5uqQQu.js} +9 -9
  73. package/dist/{vue-ui-mood-radar-BF3WqcyN.cjs → vue-ui-mood-radar-Dtk9oVC5.cjs} +1 -1
  74. package/dist/{vue-ui-nested-donuts-DkGXmwTg.cjs → vue-ui-nested-donuts-Ds13H5z7.cjs} +1 -1
  75. package/dist/{vue-ui-nested-donuts-C9CFBzvj.js → vue-ui-nested-donuts-XAlzU4h6.js} +9 -9
  76. package/dist/{vue-ui-onion-COYhqrEx.cjs → vue-ui-onion-DbkWcknp.cjs} +1 -1
  77. package/dist/{vue-ui-onion-BqzUINBq.js → vue-ui-onion-Dkg0bF7v.js} +9 -9
  78. package/dist/{vue-ui-parallel-coordinate-plot-BE8Bf0MQ.cjs → vue-ui-parallel-coordinate-plot-GFBhsvzT.cjs} +1 -1
  79. package/dist/{vue-ui-parallel-coordinate-plot-DtXx6zpM.js → vue-ui-parallel-coordinate-plot-VSLNUybk.js} +10 -10
  80. package/dist/{vue-ui-quadrant-g34Ky2Hq.cjs → vue-ui-quadrant-ByC7oL_6.cjs} +1 -1
  81. package/dist/{vue-ui-quadrant-Cr2jm-2w.js → vue-ui-quadrant-Dd6rn_Pi.js} +10 -10
  82. package/dist/{vue-ui-quick-chart-gurflOrc.js → vue-ui-quick-chart-Bu6exyaS.js} +6 -6
  83. package/dist/{vue-ui-quick-chart-BEXF1YLk.cjs → vue-ui-quick-chart-Dc71ePSN.cjs} +1 -1
  84. package/dist/{vue-ui-radar-DGXj7kOe.js → vue-ui-radar-CxJWvM3Y.js} +10 -10
  85. package/dist/{vue-ui-radar-B77sXFJD.cjs → vue-ui-radar-D8CnwaFE.cjs} +1 -1
  86. package/dist/{vue-ui-rating-J4wpjGDw.cjs → vue-ui-rating-CESNVfXP.cjs} +1 -1
  87. package/dist/{vue-ui-rating-D2wmEDux.js → vue-ui-rating-DS1AG6Jp.js} +2 -2
  88. package/dist/{vue-ui-relation-circle-8hDVUqzX.js → vue-ui-relation-circle-CDCF4oQw.js} +5 -5
  89. package/dist/{vue-ui-relation-circle-CkO4PvuL.cjs → vue-ui-relation-circle-DVhnxuiU.cjs} +1 -1
  90. package/dist/{vue-ui-rings-Bt4lsykR.cjs → vue-ui-rings-BfUQSnuu.cjs} +1 -1
  91. package/dist/{vue-ui-rings-Bs4I_DFj.js → vue-ui-rings-DluO88_f.js} +9 -9
  92. package/dist/{vue-ui-scatter-pnVV0nUg.cjs → vue-ui-scatter-CI0FcEEN.cjs} +1 -1
  93. package/dist/{vue-ui-scatter-BcuxFe_0.js → vue-ui-scatter-DWutde89.js} +10 -10
  94. package/dist/{vue-ui-screenshot-Q4jzniKW.cjs → vue-ui-screenshot-B3nuvgoB.cjs} +1 -1
  95. package/dist/{vue-ui-screenshot-CkunIVDh.js → vue-ui-screenshot-QZKcfcQz.js} +1 -1
  96. package/dist/{vue-ui-skeleton-Fsru0dbb.cjs → vue-ui-skeleton-BG428rdQ.cjs} +1 -1
  97. package/dist/{vue-ui-skeleton-jYHncdu5.js → vue-ui-skeleton-BYBsAUyH.js} +2 -2
  98. package/dist/{vue-ui-smiley-B3gIeKih.js → vue-ui-smiley-DlM_vi6f.js} +2 -2
  99. package/dist/{vue-ui-smiley-Bd3lgUj_.cjs → vue-ui-smiley-rIdwAdX9.cjs} +1 -1
  100. package/dist/{vue-ui-spark-trend-DfD8Q9Zl.cjs → vue-ui-spark-trend-vKIobiEO.cjs} +1 -1
  101. package/dist/{vue-ui-spark-trend-CgEi2LBP.js → vue-ui-spark-trend-z0SJASPo.js} +4 -4
  102. package/dist/{vue-ui-sparkbar-Bu_TX-tQ.js → vue-ui-sparkbar-8UFAzq_D.js} +3 -3
  103. package/dist/{vue-ui-sparkbar-BCmLvKvU.cjs → vue-ui-sparkbar-nRQoMePg.cjs} +1 -1
  104. package/dist/{vue-ui-sparkgauge-Cml4o6Bs.js → vue-ui-sparkgauge-Dek8oWQO.js} +3 -3
  105. package/dist/{vue-ui-sparkgauge-C_DSQGId.cjs → vue-ui-sparkgauge-JqAOrMu8.cjs} +1 -1
  106. package/dist/{vue-ui-sparkhistogram-BsyOeGbq.js → vue-ui-sparkhistogram-T-HHiCJz.js} +4 -4
  107. package/dist/{vue-ui-sparkhistogram-BZDofxtq.cjs → vue-ui-sparkhistogram-hffqVDLl.cjs} +1 -1
  108. package/dist/{vue-ui-sparkline-DOsWIDug.js → vue-ui-sparkline-5f5eFY-F.js} +3 -3
  109. package/dist/{vue-ui-sparkline-twqIgYC3.cjs → vue-ui-sparkline-CJpMZzGq.cjs} +1 -1
  110. package/dist/{vue-ui-sparkstackbar-DTgoeXjb.cjs → vue-ui-sparkstackbar-B__Fucjz.cjs} +1 -1
  111. package/dist/{vue-ui-sparkstackbar-DeWgfL12.js → vue-ui-sparkstackbar-OLeLCAfa.js} +3 -3
  112. package/dist/{vue-ui-strip-plot-BV27VHWB.cjs → vue-ui-strip-plot-DaIXrnMv.cjs} +1 -1
  113. package/dist/{vue-ui-strip-plot-Ci-hICkJ.js → vue-ui-strip-plot-ozTKwGJu.js} +9 -9
  114. package/dist/{vue-ui-table-R_KFQoq4.js → vue-ui-table-CSd6SuV6.js} +1 -1
  115. package/dist/{vue-ui-table-Bd9ddVGy.cjs → vue-ui-table-DEjTd9bz.cjs} +1 -1
  116. package/dist/{vue-ui-table-heatmap-TYLCpM_Y.js → vue-ui-table-heatmap-BCwbIRjJ.js} +4 -4
  117. package/dist/{vue-ui-table-heatmap-CPOETxT8.cjs → vue-ui-table-heatmap-Ch3DNTwB.cjs} +1 -1
  118. package/dist/{vue-ui-table-sparkline-H_qcrFc0.cjs → vue-ui-table-sparkline-BamEvqqU.cjs} +1 -1
  119. package/dist/{vue-ui-table-sparkline-B-qJP3Yr.js → vue-ui-table-sparkline-pqkWVgDE.js} +5 -5
  120. package/dist/{vue-ui-thermometer-fV6P7B8U.js → vue-ui-thermometer-BNKjEKa5.js} +5 -5
  121. package/dist/{vue-ui-thermometer-CBybvctJ.cjs → vue-ui-thermometer-j0imZL11.cjs} +1 -1
  122. package/dist/{vue-ui-timer-CU-tJV53.js → vue-ui-timer-UN1HRKqX.js} +4 -4
  123. package/dist/{vue-ui-timer-CwQteT9E.cjs → vue-ui-timer-y8-BpbDO.cjs} +1 -1
  124. package/dist/{vue-ui-tiremarks-Dxy0W8kp.js → vue-ui-tiremarks-BgPY-Xdg.js} +5 -5
  125. package/dist/{vue-ui-tiremarks-Ba1Er97s.cjs → vue-ui-tiremarks-Br8VFETW.cjs} +1 -1
  126. package/dist/{vue-ui-treemap-CFqf6BUd.js → vue-ui-treemap-DarcNBcD.js} +9 -9
  127. package/dist/{vue-ui-treemap-CpPqA91r.cjs → vue-ui-treemap-eOm05Tfs.cjs} +1 -1
  128. package/dist/{vue-ui-vertical-bar-Px2OPOQp.cjs → vue-ui-vertical-bar-BcM0OUyM.cjs} +1 -1
  129. package/dist/{vue-ui-vertical-bar-CpIgWUoF.js → vue-ui-vertical-bar-eHmn-md4.js} +9 -9
  130. package/dist/{vue-ui-waffle-DbR7pPaP.js → vue-ui-waffle-DWLU2K8D.js} +9 -9
  131. package/dist/{vue-ui-waffle-BEOhRYhC.cjs → vue-ui-waffle-rTt5NUn9.cjs} +1 -1
  132. package/dist/{vue-ui-wheel-BkbAV9mu.js → vue-ui-wheel-DDLbFhWQ.js} +5 -5
  133. package/dist/{vue-ui-wheel-C4H-fBbx.cjs → vue-ui-wheel-hSoxrrRg.cjs} +1 -1
  134. package/dist/{vue-ui-word-cloud-704bFMO3.js → vue-ui-word-cloud-Cxbw7xOK.js} +6 -6
  135. package/dist/{vue-ui-word-cloud-B8vX27Pz.cjs → vue-ui-word-cloud-FbXg9B5l.cjs} +1 -1
  136. package/dist/{vue-ui-xy-kFskWWiT.js → vue-ui-xy-B5D5L9TB.js} +12 -12
  137. package/dist/{vue-ui-xy-B8qzx04X.cjs → vue-ui-xy-BZrKDy2O.cjs} +1 -1
  138. package/dist/{vue-ui-xy-canvas-CJO0hp3z.js → vue-ui-xy-canvas-BZ3uoI37.js} +10 -10
  139. package/dist/{vue-ui-xy-canvas-BVhRHPYN.cjs → vue-ui-xy-canvas-BmaDU5gm.cjs} +1 -1
  140. package/package.json +1 -1
  141. package/dist/vue-ui-carousel-table-FMfXIF7s.cjs +0 -1
  142. package/dist/vue-ui-carousel-table-S3daEHYR.js +0 -330
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-oufiZvaS.cjs"),ke=require("./Title-DxNugmhI.cjs"),re=require("./usePrinter-Cc8ufBvU.cjs"),Ce=require("./Tooltip-BC2Wlz7P.cjs"),we=require("./Legend-BwrzHxLy.cjs"),xe=require("./vue-ui-skeleton-Fsru0dbb.cjs"),Te=require("./DataTable-CHXdpx94.cjs"),$e=require("./vue-ui-accordion-DiR0dVog.cjs"),ue=require("./useResponsive-B3TrDDIG.cjs"),se=require("./useNestedProp-CmTItGss.cjs"),Se=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");function ie(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,i=-1/0,v=0;for(let f=0;f<s;f+=1){const p=n[f].normalizedValue;p<u&&(u=p),p>i&&(i=p),v+=p}return Math.max(d**2*i/v**2,v**2/(d**2*u))}}function ce(n){const{xOffset:d,yOffset:s,width:u,height:i}=n;return{x0:d,y0:s,x1:d+u,y1:s+i}}function Ne(n,d,s){if(n.length===0)return!0;{const u=n.concat(d),i=ie(n,s),v=ie(u,s);return i>=v}}function Be(n){const d=[],s=n.length;for(let u=0;u<s;u+=1){const i=n[u],v=i.length;for(let h=0;h<v;h+=1)d.push(i[h])}return d}function _e(n,d){const s={...d,children:n};return ve(s)}function ze(n){return(n.x1-n.x0)*(n.y1-n.y0)}function de(n,d){const{width:s,height:u,xOffset:i,yOffset:v}=W(d),h=n.length,f=n.map(m=>m.normalizedValue||0).reduce((m,k)=>m+k,0),p=f/u,C=f/s;let b=i,w=v;const g=[];if(s>=u){for(let m=0;m<h;m+=1){const k=n[m],x=w+k.normalizedValue/p,t={x0:b,y0:w,x1:b+p,y1:x},T=Object.assign({},k,t);w=x,g.push(T)}return g}else{for(let m=0;m<h;m+=1){const k=n[m],x=b+k.normalizedValue/C,t={x0:b,y0:w,x1:x,y1:w+C},T=Object.assign({},k,t);b=x,g.push(T)}return g}}function Pe(n){const d=W(n),s=d.width,u=d.height;return Math.min(s,u)}function Oe(n,d){const s=n.length,u=n.map(p=>p.value??0).reduce((p,C)=>p+C,0),i=d/u,v=[];let h,f;for(let p=0;p<s;p+=1)f=n[p],h=Object.assign({},f,{normalizedValue:f.value*(i||0)}),v.push(h);return v}function W(n){const{x0:d,y0:s,x1:u,y1:i}=n;return{xOffset:d,yOffset:s,width:u-d,height:i-s}}function Ve(n,d,s,u){let i=n,v=d,h=s,f=u;for(;;){const p=i.length;if(p===0){const g=de(v,h);return f.concat(g)}const C=Pe(h),b=i[0],w=i.slice(1,p);if(Ne(v,b,C)){const g=v.concat(b);i=w,v=g,h=h,f=f}else{const g=v.length;let m=0;for(let T=0;T<g;T+=1)m+=v[T].normalizedValue;const k=Ee(h,m),x=de(v,h),t=f.concat(x);i=i,v=[],h=k,f=t}}}function ve(n){if(typeof n.children>"u"||!n.children.length)return[n];{const d=Oe(n.children,ze(n)),s=Ve(d,[],n,[]),u=s.length,i=[];for(let h=0;h<u;h+=1)i.push(ve(s[h]));return Be(i)}}function Ee(n,d){const{width:s,height:u,xOffset:i,yOffset:v}=W(n);if(s>=u){const h=d/u,f=s-h,p={xOffset:i+h,yOffset:v,width:f,height:u};return ce(p)}else{const h=d/s,f=u-h,p={xOffset:i,yOffset:v+h,width:s,height:f};return ce(p)}}const Re=n=>(e.pushScopeId("data-v-1e3a642b"),n=n(),e.popScopeId(),n),Fe=["id"],Ie=["xmlns","viewBox"],Le={key:0},De=["id"],qe=["stop-color"],Ae=["stop-color"],He=["x","y","height","width","fill","rx","stroke","stroke-width","onClick","onMouseenter"],Me=["x","y","height","width"],We={style:{width:"100%",height:"100%"},class:"vue-ui-treemap-cell"},Ue=Re(()=>e.createElementVNode("br",null,null,-1)),Ge={key:3,class:"vue-data-ui-watermark"},je=["onClick"],Xe={key:0},Ye={key:1},Ze=["innerHTML"],Je={__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:i}=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),g=e.ref([]),m=e.ref(null),k=e.ref(null),x=e.ref(null),t=e.computed(()=>{const o=se.useNestedProp({userConfig:u.config,defaultConfig:i});return o.theme?{...se.useNestedProp({userConfig:r.themes.vue_ui_treemap[o.theme]||u.config,defaultConfig:o}),customPalette:r.themePalettes[o.theme]||r.palette}:o}),{isPrinting:T,isImaging:U,generatePdf:G,generateImage:j}=re.usePrinter({elementId:`treemap_${f.value}`,fileName:t.value.style.chart.title.text||"vue-ui-treemap"}),L=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),N=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),B=e.ref({height:t.value.style.chart.height,width:t.value.style.chart.width}),z=e.computed(()=>({bottom:B.value.height-t.value.style.chart.padding.bottom,height:B.value.height-t.value.style.chart.padding.top-t.value.style.chart.padding.bottom,left:t.value.style.chart.padding.left,right:B.value.width-t.value.style.chart.padding.right,top:t.value.style.chart.padding.top,vbHeight:B.value.height,vbWidth:B.value.width,width:B.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right}));function X(o){o.forEach((a,l)=>{a.id=r.createUid(),a.color=r.convertColorToHex(a.color)||L.value[l]||r.palette[l]||r.palette[l%r.palette.length],a.children&&(a.children.forEach(c=>{c.parentId=a.id,c.color=a.color}),X(a.children))})}const P=e.ref(u.dataset),D=e.ref(null);e.onMounted(()=>{if(r.objectIsEmpty(u.dataset)&&r.error({componentName:"VueUiTreemap",type:"dataset"}),X(P.value),t.value.responsive){const o=ue.throttle(()=>{const{width:a,height:l}=ue.useResponsive({chart:m.value,title:t.value.style.chart.title.text?k.value:null,legend:t.value.style.chart.legend.show?x.value:null});B.value.width=a,B.value.height=l});D.value=new ResizeObserver(o),D.value.observe(m.value.parentNode)}}),e.onBeforeUnmount(()=>{D.value&&D.value.disconnect()});const H=e.ref(P.value),F=e.computed(()=>H.value.map((o,a)=>({...o,color:r.convertColorToHex(o.color)||L.value[a]||r.palette[a]||r.palette[a%r.palette.length]})).filter(o=>!g.value.includes(o.id))),E=e.computed(()=>P.value.filter(o=>!g.value.includes(o.id)).map(o=>o.value||0).reduce((o,a)=>o+a,0)),Y=e.computed({get(){let o=[...F.value];return t.value.style.chart.layout.sorted&&(o=[...F.value].sort((a,l)=>l.value-a.value)),o.map(a=>({...a}))},set(o){return o}});function Z(o,a){return o.value/a}function he(o,a,l){const c=t.value.style.chart.layout.rects.colorRatio-Z(a,l);return r.lightenHexColor(o,c<0?0:c)}function J(o,a,l,c){return o.map((y,V)=>{const A=he(r.convertColorToHex(a)||L.value[V]||r.palette[V]||r.palette[V%r.palette.length],y,c),be=Z(y,c);return{...y,color:A,proportion:be,parentName:l,children:y.children?J(y.children,A,y.name,c):void 0}})}const I=e.computed(()=>_e(Y.value.map((o,a)=>{const l=o.children?o.children.reduce((c,y)=>c+y.value,0):o.value;return{value:o.value,id:o.id,children:o.children?J(o.children.sort((c,y)=>y.value-c.value),o.color,o.name,l):void 0,color:o.color,name:o.name}}),{x0:z.value.left*2,y0:z.value.top,x1:z.value.width,y1:z.value.height}));function K({y0:o,y1:a}){return a-o<=0?1e-4:a-o}function Q({x0:o,x1:a}){return a-o<=0?1e-4:a-o}function O(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 pe(o){b.value=o,w.value+=1}const R=e.computed(()=>({startX:0,startY:0,width:z.value.vbWidth,height:z.value.vbHeight})),$=e.ref(!1);function ee(o,a=P.value){for(const l of a){if(l.id===o)return l;if(l.children){const c=ee(o,l.children);if(c)return c}}return null}function fe(o){$.value?(s("selectDatapoint",void 0),H.value=P.value):(s("selectDatapoint",o),H.value=[ee(o.parentId)]),$.value=!$.value}const S=e.ref(null),te=e.computed(()=>P.value.map((o,a)=>({...o,color:r.convertColorToHex(o.color)||L.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/P.value.map(l=>l.value).reduce((l,c)=>l+c,0),opacity:g.value.includes(o.id)?.5:1}))),ge=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 oe(o){$.value=!1,S.value=null,g.value.includes(o.id)?g.value=g.value.filter(a=>a!==o.id):g.value.length<u.dataset.length-1&&g.value.push(o.id),s("selectLegend",Y.value)}const M=e.ref(null);function me({datapoint:o,seriesIndex:a}){S.value=o,M.value={datapoint:o,seriesIndex:a,config:t.value,series:F.value};const l=t.value.style.chart.tooltip.customFormat;if(r.isFunction(l)&&r.functionReturnsString(()=>l({seriesIndex:a,datapoint:o,series:F.value,config:t.value})))C.value=l({seriesIndex:a,datapoint:o,series:F.value,config:t.value});else{let c="";c+=`<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>`,c+=`<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>`,c+=`<b>${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})}</b>`,C.value=`<div>${c}</div>`}p.value=!0}const _=e.computed(()=>{const o=I.value.map(l=>({name:l.name,color:l.color})),a=I.value.map(l=>l.value);return{head:o,body:a}});function le(){e.nextTick(()=>{const o=_.value.head.map((c,y)=>[[c.name],[_.value.body[y]],[isNaN(_.value.body[y]/E.value)?"-":_.value.body[y]/E.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=_.value.head.map((y,V)=>{const A=r.dataLabel({p:t.value.style.chart.layout.labels.prefix,v:_.value.body[V],s:t.value.style.chart.layout.labels.suffix,r:t.value.table.td.roundingValue});return[{color:y.color,name:y.name,shape:"square"},A,isNaN(_.value.body[V]/E.value)?"-":(_.value.body[V]/E.value*100).toFixed(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 ye(){return I.value}function ae(){N.value.showTable=!N.value.showTable}function ne(){N.value.showTooltip=!N.value.showTooltip}return d({getData:ye,generateCsv:le,generateImage:j,generatePdf:G,toggleTable:ae,toggleTooltip:ne}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"treemapChart",ref:m,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;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor}`),id:`treemap_${f.value}`},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:k,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:6px`)},[e.createVNode(ke._sfc_main,{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(re.UserOptions,{ref:"details",key:`user_option_${w.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(T),isImaging:e.unref(U),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:N.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:m.value,onToggleFullscreen:pe,onGeneratePdf:e.unref(G),onGenerateCsv:le,onGenerateImage:e.unref(j),onToggleTable:ae,onToggleTooltip:ne},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:c})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:c})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),v.value?(e.openBlock(),e.createElementBlock("svg",{key:2,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:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.value,(l,c)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.chart.layout.rects.gradient.show?(e.openBlock(),e.createElementBlock("defs",Le,[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,qe),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.lightenHexColor)(l.color,t.value.style.chart.layout.rects.gradient.intensity/100)},null,8,Ae)],8,De)])):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.value,(l,c)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:l.x0,y:l.y0,height:K(l),width:Q(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=>fe(l),onMouseenter:()=>me({datapoint:l,seriesIndex:c}),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,He),(e.openBlock(),e.createElementBlock("foreignObject",{x:l.x0,y:l.y0,height:K(l),width:Q(l),class:"vue-ui-treemap-cell-foreignObject"},[e.createElementVNode("div",We,[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% - ${O(l)/1.5}px);text-align:left;line-height:${O(l)<14?14:O(l)}px;padding:${O(l)/3}px; color:${e.unref(r.adaptColorToBackground)(l.color)}`)},[e.createElementVNode("span",{style:e.normalizeStyle(`width:100%;font-size:${O(l)}px;`)},e.toDisplayString(l.name),5),Ue,e.createElementVNode("span",{style:e.normalizeStyle(`width:100%;font-size:${O(l)}px;`)},e.toDisplayString(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})),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:O(l),isZoom:$.value,textColor:e.unref(r.adaptColorToBackground)(l.color)})),void 0,!0)])],8,Me))]))),256)),e.renderSlot(o.$slots,"svg",e.normalizeProps(e.guardReactiveProps({svg:z.value,isZoom:$.value,rect:S.value,config:t.value})),void 0,!0)],14,Ie)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ge,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(T)||e.unref(U)})),void 0,!0)])):e.createCommentVNode("",!0),v.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(xe.default,{key:4,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(we.Legend,{key:0,legendSet:te.value,config:ge.value,id:`treemap_legend_${f.value}`,onClickMarker:a[1]||(a[1]=({legend:l})=>oe(l))},{item:e.withCtx(({legend:l,index:c})=>[e.createElementVNode("div",{onClick:y=>oe(l),style:e.normalizeStyle(`opacity:${g.value.includes(l.id)?.5:1}`)},[e.createTextVNode(e.toDisplayString(l.name)+": "+e.toDisplayString(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}))+" ",1),g.value.includes(l.id)?(e.openBlock(),e.createElementBlock("span",Ye," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",Xe," ("+e.toDisplayString(isNaN(l.value/E.value)?"-":(l.value/E.value*100).toFixed(t.value.style.chart.legend.roundingPercentage))+"%) ",1))],12,je)]),_:1},8,["legendSet","config","id"])):e.renderSlot(o.$slots,"legend",{key:1,legend:te.value},void 0,!0)],512),e.createVNode(Ce._sfc_main,{show:N.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:m.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({...M.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...M.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($e.default,{key:5,hideDetails:"",config:{open:N.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(Te.DataTable,{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=>N.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,Ze)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l.name||l),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,Fe))}},Ke=Se._export_sfc(Je,[["__scopeId","data-v-1e3a642b"]]);exports.default=Ke;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-BcLWKvbg.cjs"),ke=require("./Title-D9E4eBNp.cjs"),re=require("./usePrinter-BWCvrSz2.cjs"),Ce=require("./Tooltip-C6EZFw-G.cjs"),we=require("./Legend-DA1uCuos.cjs"),xe=require("./vue-ui-skeleton-BG428rdQ.cjs"),Te=require("./DataTable-Ckvkqg78.cjs"),$e=require("./vue-ui-accordion-BOEIWXgn.cjs"),ue=require("./useResponsive-B3TrDDIG.cjs"),se=require("./useNestedProp-BcuQPNiW.cjs"),Se=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");function ie(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,i=-1/0,v=0;for(let f=0;f<s;f+=1){const p=n[f].normalizedValue;p<u&&(u=p),p>i&&(i=p),v+=p}return Math.max(d**2*i/v**2,v**2/(d**2*u))}}function ce(n){const{xOffset:d,yOffset:s,width:u,height:i}=n;return{x0:d,y0:s,x1:d+u,y1:s+i}}function Ne(n,d,s){if(n.length===0)return!0;{const u=n.concat(d),i=ie(n,s),v=ie(u,s);return i>=v}}function Be(n){const d=[],s=n.length;for(let u=0;u<s;u+=1){const i=n[u],v=i.length;for(let h=0;h<v;h+=1)d.push(i[h])}return d}function _e(n,d){const s={...d,children:n};return ve(s)}function ze(n){return(n.x1-n.x0)*(n.y1-n.y0)}function de(n,d){const{width:s,height:u,xOffset:i,yOffset:v}=W(d),h=n.length,f=n.map(m=>m.normalizedValue||0).reduce((m,k)=>m+k,0),p=f/u,C=f/s;let b=i,w=v;const g=[];if(s>=u){for(let m=0;m<h;m+=1){const k=n[m],x=w+k.normalizedValue/p,t={x0:b,y0:w,x1:b+p,y1:x},T=Object.assign({},k,t);w=x,g.push(T)}return g}else{for(let m=0;m<h;m+=1){const k=n[m],x=b+k.normalizedValue/C,t={x0:b,y0:w,x1:x,y1:w+C},T=Object.assign({},k,t);b=x,g.push(T)}return g}}function Pe(n){const d=W(n),s=d.width,u=d.height;return Math.min(s,u)}function Oe(n,d){const s=n.length,u=n.map(p=>p.value??0).reduce((p,C)=>p+C,0),i=d/u,v=[];let h,f;for(let p=0;p<s;p+=1)f=n[p],h=Object.assign({},f,{normalizedValue:f.value*(i||0)}),v.push(h);return v}function W(n){const{x0:d,y0:s,x1:u,y1:i}=n;return{xOffset:d,yOffset:s,width:u-d,height:i-s}}function Ve(n,d,s,u){let i=n,v=d,h=s,f=u;for(;;){const p=i.length;if(p===0){const g=de(v,h);return f.concat(g)}const C=Pe(h),b=i[0],w=i.slice(1,p);if(Ne(v,b,C)){const g=v.concat(b);i=w,v=g,h=h,f=f}else{const g=v.length;let m=0;for(let T=0;T<g;T+=1)m+=v[T].normalizedValue;const k=Ee(h,m),x=de(v,h),t=f.concat(x);i=i,v=[],h=k,f=t}}}function ve(n){if(typeof n.children>"u"||!n.children.length)return[n];{const d=Oe(n.children,ze(n)),s=Ve(d,[],n,[]),u=s.length,i=[];for(let h=0;h<u;h+=1)i.push(ve(s[h]));return Be(i)}}function Ee(n,d){const{width:s,height:u,xOffset:i,yOffset:v}=W(n);if(s>=u){const h=d/u,f=s-h,p={xOffset:i+h,yOffset:v,width:f,height:u};return ce(p)}else{const h=d/s,f=u-h,p={xOffset:i,yOffset:v+h,width:s,height:f};return ce(p)}}const Re=n=>(e.pushScopeId("data-v-1e3a642b"),n=n(),e.popScopeId(),n),Fe=["id"],Ie=["xmlns","viewBox"],Le={key:0},De=["id"],qe=["stop-color"],Ae=["stop-color"],He=["x","y","height","width","fill","rx","stroke","stroke-width","onClick","onMouseenter"],Me=["x","y","height","width"],We={style:{width:"100%",height:"100%"},class:"vue-ui-treemap-cell"},Ue=Re(()=>e.createElementVNode("br",null,null,-1)),Ge={key:3,class:"vue-data-ui-watermark"},je=["onClick"],Xe={key:0},Ye={key:1},Ze=["innerHTML"],Je={__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:i}=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),g=e.ref([]),m=e.ref(null),k=e.ref(null),x=e.ref(null),t=e.computed(()=>{const o=se.useNestedProp({userConfig:u.config,defaultConfig:i});return o.theme?{...se.useNestedProp({userConfig:r.themes.vue_ui_treemap[o.theme]||u.config,defaultConfig:o}),customPalette:r.themePalettes[o.theme]||r.palette}:o}),{isPrinting:T,isImaging:U,generatePdf:G,generateImage:j}=re.usePrinter({elementId:`treemap_${f.value}`,fileName:t.value.style.chart.title.text||"vue-ui-treemap"}),L=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),N=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),B=e.ref({height:t.value.style.chart.height,width:t.value.style.chart.width}),z=e.computed(()=>({bottom:B.value.height-t.value.style.chart.padding.bottom,height:B.value.height-t.value.style.chart.padding.top-t.value.style.chart.padding.bottom,left:t.value.style.chart.padding.left,right:B.value.width-t.value.style.chart.padding.right,top:t.value.style.chart.padding.top,vbHeight:B.value.height,vbWidth:B.value.width,width:B.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right}));function X(o){o.forEach((a,l)=>{a.id=r.createUid(),a.color=r.convertColorToHex(a.color)||L.value[l]||r.palette[l]||r.palette[l%r.palette.length],a.children&&(a.children.forEach(c=>{c.parentId=a.id,c.color=a.color}),X(a.children))})}const P=e.ref(u.dataset),D=e.ref(null);e.onMounted(()=>{if(r.objectIsEmpty(u.dataset)&&r.error({componentName:"VueUiTreemap",type:"dataset"}),X(P.value),t.value.responsive){const o=ue.throttle(()=>{const{width:a,height:l}=ue.useResponsive({chart:m.value,title:t.value.style.chart.title.text?k.value:null,legend:t.value.style.chart.legend.show?x.value:null});B.value.width=a,B.value.height=l});D.value=new ResizeObserver(o),D.value.observe(m.value.parentNode)}}),e.onBeforeUnmount(()=>{D.value&&D.value.disconnect()});const H=e.ref(P.value),F=e.computed(()=>H.value.map((o,a)=>({...o,color:r.convertColorToHex(o.color)||L.value[a]||r.palette[a]||r.palette[a%r.palette.length]})).filter(o=>!g.value.includes(o.id))),E=e.computed(()=>P.value.filter(o=>!g.value.includes(o.id)).map(o=>o.value||0).reduce((o,a)=>o+a,0)),Y=e.computed({get(){let o=[...F.value];return t.value.style.chart.layout.sorted&&(o=[...F.value].sort((a,l)=>l.value-a.value)),o.map(a=>({...a}))},set(o){return o}});function Z(o,a){return o.value/a}function he(o,a,l){const c=t.value.style.chart.layout.rects.colorRatio-Z(a,l);return r.lightenHexColor(o,c<0?0:c)}function J(o,a,l,c){return o.map((y,V)=>{const A=he(r.convertColorToHex(a)||L.value[V]||r.palette[V]||r.palette[V%r.palette.length],y,c),be=Z(y,c);return{...y,color:A,proportion:be,parentName:l,children:y.children?J(y.children,A,y.name,c):void 0}})}const I=e.computed(()=>_e(Y.value.map((o,a)=>{const l=o.children?o.children.reduce((c,y)=>c+y.value,0):o.value;return{value:o.value,id:o.id,children:o.children?J(o.children.sort((c,y)=>y.value-c.value),o.color,o.name,l):void 0,color:o.color,name:o.name}}),{x0:z.value.left*2,y0:z.value.top,x1:z.value.width,y1:z.value.height}));function K({y0:o,y1:a}){return a-o<=0?1e-4:a-o}function Q({x0:o,x1:a}){return a-o<=0?1e-4:a-o}function O(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 pe(o){b.value=o,w.value+=1}const R=e.computed(()=>({startX:0,startY:0,width:z.value.vbWidth,height:z.value.vbHeight})),$=e.ref(!1);function ee(o,a=P.value){for(const l of a){if(l.id===o)return l;if(l.children){const c=ee(o,l.children);if(c)return c}}return null}function fe(o){$.value?(s("selectDatapoint",void 0),H.value=P.value):(s("selectDatapoint",o),H.value=[ee(o.parentId)]),$.value=!$.value}const S=e.ref(null),te=e.computed(()=>P.value.map((o,a)=>({...o,color:r.convertColorToHex(o.color)||L.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/P.value.map(l=>l.value).reduce((l,c)=>l+c,0),opacity:g.value.includes(o.id)?.5:1}))),ge=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 oe(o){$.value=!1,S.value=null,g.value.includes(o.id)?g.value=g.value.filter(a=>a!==o.id):g.value.length<u.dataset.length-1&&g.value.push(o.id),s("selectLegend",Y.value)}const M=e.ref(null);function me({datapoint:o,seriesIndex:a}){S.value=o,M.value={datapoint:o,seriesIndex:a,config:t.value,series:F.value};const l=t.value.style.chart.tooltip.customFormat;if(r.isFunction(l)&&r.functionReturnsString(()=>l({seriesIndex:a,datapoint:o,series:F.value,config:t.value})))C.value=l({seriesIndex:a,datapoint:o,series:F.value,config:t.value});else{let c="";c+=`<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>`,c+=`<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>`,c+=`<b>${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})}</b>`,C.value=`<div>${c}</div>`}p.value=!0}const _=e.computed(()=>{const o=I.value.map(l=>({name:l.name,color:l.color})),a=I.value.map(l=>l.value);return{head:o,body:a}});function le(){e.nextTick(()=>{const o=_.value.head.map((c,y)=>[[c.name],[_.value.body[y]],[isNaN(_.value.body[y]/E.value)?"-":_.value.body[y]/E.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=_.value.head.map((y,V)=>{const A=r.dataLabel({p:t.value.style.chart.layout.labels.prefix,v:_.value.body[V],s:t.value.style.chart.layout.labels.suffix,r:t.value.table.td.roundingValue});return[{color:y.color,name:y.name,shape:"square"},A,isNaN(_.value.body[V]/E.value)?"-":(_.value.body[V]/E.value*100).toFixed(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 ye(){return I.value}function ae(){N.value.showTable=!N.value.showTable}function ne(){N.value.showTooltip=!N.value.showTooltip}return d({getData:ye,generateCsv:le,generateImage:j,generatePdf:G,toggleTable:ae,toggleTooltip:ne}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"treemapChart",ref:m,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;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor}`),id:`treemap_${f.value}`},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:k,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:6px`)},[e.createVNode(ke._sfc_main,{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(re.UserOptions,{ref:"details",key:`user_option_${w.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(T),isImaging:e.unref(U),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:N.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:m.value,onToggleFullscreen:pe,onGeneratePdf:e.unref(G),onGenerateCsv:le,onGenerateImage:e.unref(j),onToggleTable:ae,onToggleTooltip:ne},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:c})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:c})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),v.value?(e.openBlock(),e.createElementBlock("svg",{key:2,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:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.value,(l,c)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.chart.layout.rects.gradient.show?(e.openBlock(),e.createElementBlock("defs",Le,[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,qe),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.lightenHexColor)(l.color,t.value.style.chart.layout.rects.gradient.intensity/100)},null,8,Ae)],8,De)])):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.value,(l,c)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:l.x0,y:l.y0,height:K(l),width:Q(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=>fe(l),onMouseenter:()=>me({datapoint:l,seriesIndex:c}),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,He),(e.openBlock(),e.createElementBlock("foreignObject",{x:l.x0,y:l.y0,height:K(l),width:Q(l),class:"vue-ui-treemap-cell-foreignObject"},[e.createElementVNode("div",We,[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% - ${O(l)/1.5}px);text-align:left;line-height:${O(l)<14?14:O(l)}px;padding:${O(l)/3}px; color:${e.unref(r.adaptColorToBackground)(l.color)}`)},[e.createElementVNode("span",{style:e.normalizeStyle(`width:100%;font-size:${O(l)}px;`)},e.toDisplayString(l.name),5),Ue,e.createElementVNode("span",{style:e.normalizeStyle(`width:100%;font-size:${O(l)}px;`)},e.toDisplayString(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})),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:O(l),isZoom:$.value,textColor:e.unref(r.adaptColorToBackground)(l.color)})),void 0,!0)])],8,Me))]))),256)),e.renderSlot(o.$slots,"svg",e.normalizeProps(e.guardReactiveProps({svg:z.value,isZoom:$.value,rect:S.value,config:t.value})),void 0,!0)],14,Ie)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ge,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(T)||e.unref(U)})),void 0,!0)])):e.createCommentVNode("",!0),v.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(xe.default,{key:4,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(we.Legend,{key:0,legendSet:te.value,config:ge.value,id:`treemap_legend_${f.value}`,onClickMarker:a[1]||(a[1]=({legend:l})=>oe(l))},{item:e.withCtx(({legend:l,index:c})=>[e.createElementVNode("div",{onClick:y=>oe(l),style:e.normalizeStyle(`opacity:${g.value.includes(l.id)?.5:1}`)},[e.createTextVNode(e.toDisplayString(l.name)+": "+e.toDisplayString(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}))+" ",1),g.value.includes(l.id)?(e.openBlock(),e.createElementBlock("span",Ye," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",Xe," ("+e.toDisplayString(isNaN(l.value/E.value)?"-":(l.value/E.value*100).toFixed(t.value.style.chart.legend.roundingPercentage))+"%) ",1))],12,je)]),_:1},8,["legendSet","config","id"])):e.renderSlot(o.$slots,"legend",{key:1,legend:te.value},void 0,!0)],512),e.createVNode(Ce._sfc_main,{show:N.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:m.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({...M.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...M.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($e.default,{key:5,hideDetails:"",config:{open:N.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(Te.DataTable,{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=>N.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,Ze)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l.name||l),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,Fe))}},Ke=Se._export_sfc(Je,[["__scopeId","data-v-1e3a642b"]]);exports.default=Ke;
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-oufiZvaS.cjs"),ee=require("./useResponsive-B3TrDDIG.cjs"),me=require("./Title-DxNugmhI.cjs"),te=require("./usePrinter-Cc8ufBvU.cjs"),be=require("./Tooltip-BC2Wlz7P.cjs"),le=require("./Legend-BwrzHxLy.cjs"),ke=require("./vue-ui-skeleton-Fsru0dbb.cjs"),Ce=require("./BaseIcon-C-k_mqXL.cjs"),xe=require("./vue-ui-accordion-DiR0dVog.cjs"),ae=require("./useNestedProp-CmTItGss.cjs"),_e=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),$e=["id"],Ne=["onClick"],we=["xmlns","viewBox"],Se=["id"],Ve=["stop-color"],Te=["stop-color"],Ee=["x","y","width","height","fill","rx"],Be=["x","y","width","height","fill","rx","stroke","stroke-width"],ze=["x2","y1","y2","stroke","stroke-width"],Pe=["x","y","font-size","fill","font-weight"],Le=["x","y","font-size","fill","font-weight"],De=["x","y","font-size","fill","font-weight"],Fe=["x","y","font-size","fill","font-weight"],Ie=["y","width","height","fill","onMouseenter"],Oe={key:4,class:"vue-data-ui-watermark"},Re=["onClick"],Me={style:"width:100%;padding-top: 36px;position:relative"},qe={class:"vue-ui-data-table"},He={key:0},Ue={style:{width:"100%"}},Ae=["data-cell"],Ge={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Xe=["data-cell"],je={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},We=["data-cell"],Ye={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Ke=["data-cell"],Je={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Qe=["data-cell"],Ze={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},et=["data-cell"],tt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},lt=["data-cell"],at={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},ot={__name:"vue-ui-vertical-bar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(oe,{expose:ne,emit:re}){const f=oe;e.useCssVars(l=>({"1d948788":l.tdo}));const{vue_ui_vertical_bar:ue}=r.useConfig(),w=e.computed(()=>!!f.dataset&&f.dataset.length),m=e.ref(r.createUid()),ie=e.ref(null),E=e.ref(!1),B=e.ref(""),S=e.ref(0),se=e.ref(null),F=e.ref(0),C=e.ref(null),I=e.ref(null),z=e.ref(null),t=e.computed(()=>{const l=ae.useNestedProp({userConfig:f.config,defaultConfig:ue});return l.theme?{...ae.useNestedProp({userConfig:r.themes.vue_ui_vertical_bar[l.theme]||f.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}),{isPrinting:O,isImaging:R,generatePdf:M,generateImage:q}=te.usePrinter({elementId:`vue-ui-vertical-bar_${m.value}`,fileName:t.value.style.chart.title.text||"vue-ui-vertical-bar"}),H=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),U=e.ref(null),A=e.ref(!1),ce=e.computed(()=>t.value.table.responsiveBreakpoint),V=e.ref(null);e.onMounted(()=>{if(r.objectIsEmpty(f.dataset)&&r.error({componentName:"VueUiVerticalBar",type:"dataset"}),S.value=f.dataset.flatMap(l=>l.children&&l.children.length>0?l.children.length:1).reduce((l,o)=>l+o,0),de(),t.value.responsive){const l=ee.throttle(()=>{const{width:o,height:a}=ee.useResponsive({chart:C.value,title:t.value.style.chart.title.text?I.value:null,legend:t.value.style.chart.legend.show?z.value:null});j.value=o,s.value=a/S.value-d.value*2});V.value=new ResizeObserver(l),V.value.observe(C.value.parentNode)}}),e.onBeforeUnmount(()=>{V.value&&V.value.disconnect()});function de(){new ResizeObserver(o=>{o.forEach(a=>{A.value=a.contentRect.width<ce.value})}).observe(U.value)}const h=e.ref({showTable:t.value.table.show,sortDesc:t.value.style.chart.layout.bars.sort==="desc",showTooltip:t.value.style.chart.tooltip.show}),G=e.computed(()=>h.value.sortDesc),b=e.computed(()=>(f.dataset.forEach((l,o)=>{l.children&&(r.objectIsEmpty(l.children)?r.error({componentName:"VueUiVerticalBar",type:"datasetAttributeEmpty",property:`children (index ${o})`}):l.children.forEach((a,n)=>{[null,void 0].includes(a.name)&&r.error({componentName:"VueUiVerticalBar",type:"datasetSerieAttribute",property:"name",key:"children",index:n})}))}),f.dataset.map((l,o)=>{const a=`vertical_parent_${o}_${m.value}`,n=!!l.children&&l.children.length>0;return![null,void 0].includes(l.value)&&l.value<0&&console.warn(`VueUiVerticalBar is not designed to graph negative values. ${l.name||"serie at index"+o} has the following value: ${l.value}`),{...l,id:a,shape:"square",opacity:y.value.includes(a)?.5:1,value:n?l.children.map(u=>u.value||0).reduce((u,i)=>u+i,0):l.value||0,hasChildren:n,isChild:!1,segregate:()=>x(a),isSegregated:y.value.includes(a),color:r.convertColorToHex(l.color)||H.value[o]||r.palette[o]||r.palette[o%r.palette.length],children:!l.children||!l.children.length?[]:l.children.toSorted((u,i)=>G.value?i.value-u.value:u.value-i.value).map((u,i)=>(![null,void 0].includes(u.value)&&u.value<0&&console.warn(`VueUiVerticalBar is not designed to graph negative values. ${u.name+" child serie"||"child serie at index"+o+", "+i} has the following value: ${u.value}`),{...u,value:u.value||0,isChild:!0,parentId:a,parentName:l.name,parentValue:l.value,id:`vertical_child_${o}_${i}_${m.value}`,childIndex:i,color:r.convertColorToHex(u.color)||r.convertColorToHex(l.color)||H.value[o]||r.palette[o]||r.palette[o%r.palette.length]})).map((u,i)=>({...u,isFirstChild:i===0,isLastChild:i===l.children.length-1}))}}).toSorted((l,o)=>G.value?o.value-l.value:l.value-o.value))),X=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),d=e.ref(t.value.style.chart.layout.bars.gap),ve=e.computed(()=>(s.value+d.value)*S.value),j=e.ref(512),c=e.computed(()=>({width:j.value,height:ve.value,padding:{top:12,left:128+t.value.style.chart.layout.bars.offsetX,right:64+t.value.style.chart.layout.bars.paddingRight,bottom:12}})),v=e.computed(()=>({fullHeight:c.value.padding.top+c.value.padding.bottom+c.value.height,top:c.value.padding.top,left:c.value.padding.left,right:c.value.width-c.value.padding.right,bottom:c.value.padding.top+c.value.height,width:c.value.width-(c.value.padding.left+c.value.padding.right)}));function P(){S.value=k.value.flatMap(l=>l.children&&l.children.length>0?l.children.length:1).reduce((l,o)=>l+o,0)}const y=e.ref([]);function x(l){y.value.includes(l)?y.value=y.value.filter(o=>o!==l):y.value.push(l),P(),re("selectLegend",k.value)}const k=e.computed(()=>b.value.filter(l=>!y.value.includes(l.id))),p=e.computed(()=>k.value.map(l=>l.value).reduce((l,o)=>l+o));function W(l,o=!1,a=0){return o?(l/p.value*100).toFixed(a)+"%":l/p.value}const _=e.computed(()=>k.value.flatMap(l=>l.hasChildren?l.children:l)),he=e.computed(()=>Math.max(...k.value.flatMap(l=>l.children&&l.children.length?Math.max(...l.children.map(o=>o.value)):l.value)));function $(l){const o=l/he.value;return v.value.width*o}function pe(l){return $(l)+v.value.left}function T(l,o){const a=k.value.find(i=>i.id===l.parentId),n=v.value.top+(d.value+s.value)*o,u=a.children.length*(d.value+s.value);return{y:n+u/2-t.value.style.chart.layout.bars.parentLabels.fontSize,name:a.name,value:[void 0,NaN,null].includes(a.value)?"":a.value.toFixed(t.value.style.chart.layout.bars.dataLabels.value.roundingValue),percentageToTotal:isNaN(a.value/p.value)?"":W(a.value,!0,t.value.style.chart.layout.bars.dataLabels.percentage.roundingPercentage)}}function ge(){return k.value}const L=e.ref(null),D=e.ref(null);function ye(l,o){D.value={datapoint:l,seriesIndex:o,series:b.value,config:t.value},E.value=!0,L.value=l.id;let a="";const n=l.isChild?l.parentName:l.name,u=l.isChild?l.name:"",i=t.value.style.chart.tooltip.customFormat;r.isFunction(i)&&r.functionReturnsString(()=>i({datapoint:l,series:b.value,config:t.value,seriesIndex:o}))?B.value=i({datapoint:l,series:b.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"),r=require("./index-BcLWKvbg.cjs"),ee=require("./useResponsive-B3TrDDIG.cjs"),me=require("./Title-D9E4eBNp.cjs"),te=require("./usePrinter-BWCvrSz2.cjs"),be=require("./Tooltip-C6EZFw-G.cjs"),le=require("./Legend-DA1uCuos.cjs"),ke=require("./vue-ui-skeleton-BG428rdQ.cjs"),Ce=require("./BaseIcon-eEUOqFAE.cjs"),xe=require("./vue-ui-accordion-BOEIWXgn.cjs"),ae=require("./useNestedProp-BcuQPNiW.cjs"),_e=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),$e=["id"],Ne=["onClick"],we=["xmlns","viewBox"],Se=["id"],Ve=["stop-color"],Te=["stop-color"],Ee=["x","y","width","height","fill","rx"],Be=["x","y","width","height","fill","rx","stroke","stroke-width"],ze=["x2","y1","y2","stroke","stroke-width"],Pe=["x","y","font-size","fill","font-weight"],Le=["x","y","font-size","fill","font-weight"],De=["x","y","font-size","fill","font-weight"],Fe=["x","y","font-size","fill","font-weight"],Ie=["y","width","height","fill","onMouseenter"],Oe={key:4,class:"vue-data-ui-watermark"},Re=["onClick"],Me={style:"width:100%;padding-top: 36px;position:relative"},qe={class:"vue-ui-data-table"},He={key:0},Ue={style:{width:"100%"}},Ae=["data-cell"],Ge={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Xe=["data-cell"],je={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},We=["data-cell"],Ye={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Ke=["data-cell"],Je={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Qe=["data-cell"],Ze={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},et=["data-cell"],tt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},lt=["data-cell"],at={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},ot={__name:"vue-ui-vertical-bar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(oe,{expose:ne,emit:re}){const f=oe;e.useCssVars(l=>({"1d948788":l.tdo}));const{vue_ui_vertical_bar:ue}=r.useConfig(),w=e.computed(()=>!!f.dataset&&f.dataset.length),m=e.ref(r.createUid()),ie=e.ref(null),E=e.ref(!1),B=e.ref(""),S=e.ref(0),se=e.ref(null),F=e.ref(0),C=e.ref(null),I=e.ref(null),z=e.ref(null),t=e.computed(()=>{const l=ae.useNestedProp({userConfig:f.config,defaultConfig:ue});return l.theme?{...ae.useNestedProp({userConfig:r.themes.vue_ui_vertical_bar[l.theme]||f.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}),{isPrinting:O,isImaging:R,generatePdf:M,generateImage:q}=te.usePrinter({elementId:`vue-ui-vertical-bar_${m.value}`,fileName:t.value.style.chart.title.text||"vue-ui-vertical-bar"}),H=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),U=e.ref(null),A=e.ref(!1),ce=e.computed(()=>t.value.table.responsiveBreakpoint),V=e.ref(null);e.onMounted(()=>{if(r.objectIsEmpty(f.dataset)&&r.error({componentName:"VueUiVerticalBar",type:"dataset"}),S.value=f.dataset.flatMap(l=>l.children&&l.children.length>0?l.children.length:1).reduce((l,o)=>l+o,0),de(),t.value.responsive){const l=ee.throttle(()=>{const{width:o,height:a}=ee.useResponsive({chart:C.value,title:t.value.style.chart.title.text?I.value:null,legend:t.value.style.chart.legend.show?z.value:null});j.value=o,s.value=a/S.value-d.value*2});V.value=new ResizeObserver(l),V.value.observe(C.value.parentNode)}}),e.onBeforeUnmount(()=>{V.value&&V.value.disconnect()});function de(){new ResizeObserver(o=>{o.forEach(a=>{A.value=a.contentRect.width<ce.value})}).observe(U.value)}const h=e.ref({showTable:t.value.table.show,sortDesc:t.value.style.chart.layout.bars.sort==="desc",showTooltip:t.value.style.chart.tooltip.show}),G=e.computed(()=>h.value.sortDesc),b=e.computed(()=>(f.dataset.forEach((l,o)=>{l.children&&(r.objectIsEmpty(l.children)?r.error({componentName:"VueUiVerticalBar",type:"datasetAttributeEmpty",property:`children (index ${o})`}):l.children.forEach((a,n)=>{[null,void 0].includes(a.name)&&r.error({componentName:"VueUiVerticalBar",type:"datasetSerieAttribute",property:"name",key:"children",index:n})}))}),f.dataset.map((l,o)=>{const a=`vertical_parent_${o}_${m.value}`,n=!!l.children&&l.children.length>0;return![null,void 0].includes(l.value)&&l.value<0&&console.warn(`VueUiVerticalBar is not designed to graph negative values. ${l.name||"serie at index"+o} has the following value: ${l.value}`),{...l,id:a,shape:"square",opacity:y.value.includes(a)?.5:1,value:n?l.children.map(u=>u.value||0).reduce((u,i)=>u+i,0):l.value||0,hasChildren:n,isChild:!1,segregate:()=>x(a),isSegregated:y.value.includes(a),color:r.convertColorToHex(l.color)||H.value[o]||r.palette[o]||r.palette[o%r.palette.length],children:!l.children||!l.children.length?[]:l.children.toSorted((u,i)=>G.value?i.value-u.value:u.value-i.value).map((u,i)=>(![null,void 0].includes(u.value)&&u.value<0&&console.warn(`VueUiVerticalBar is not designed to graph negative values. ${u.name+" child serie"||"child serie at index"+o+", "+i} has the following value: ${u.value}`),{...u,value:u.value||0,isChild:!0,parentId:a,parentName:l.name,parentValue:l.value,id:`vertical_child_${o}_${i}_${m.value}`,childIndex:i,color:r.convertColorToHex(u.color)||r.convertColorToHex(l.color)||H.value[o]||r.palette[o]||r.palette[o%r.palette.length]})).map((u,i)=>({...u,isFirstChild:i===0,isLastChild:i===l.children.length-1}))}}).toSorted((l,o)=>G.value?o.value-l.value:l.value-o.value))),X=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),d=e.ref(t.value.style.chart.layout.bars.gap),ve=e.computed(()=>(s.value+d.value)*S.value),j=e.ref(512),c=e.computed(()=>({width:j.value,height:ve.value,padding:{top:12,left:128+t.value.style.chart.layout.bars.offsetX,right:64+t.value.style.chart.layout.bars.paddingRight,bottom:12}})),v=e.computed(()=>({fullHeight:c.value.padding.top+c.value.padding.bottom+c.value.height,top:c.value.padding.top,left:c.value.padding.left,right:c.value.width-c.value.padding.right,bottom:c.value.padding.top+c.value.height,width:c.value.width-(c.value.padding.left+c.value.padding.right)}));function P(){S.value=k.value.flatMap(l=>l.children&&l.children.length>0?l.children.length:1).reduce((l,o)=>l+o,0)}const y=e.ref([]);function x(l){y.value.includes(l)?y.value=y.value.filter(o=>o!==l):y.value.push(l),P(),re("selectLegend",k.value)}const k=e.computed(()=>b.value.filter(l=>!y.value.includes(l.id))),p=e.computed(()=>k.value.map(l=>l.value).reduce((l,o)=>l+o));function W(l,o=!1,a=0){return o?(l/p.value*100).toFixed(a)+"%":l/p.value}const _=e.computed(()=>k.value.flatMap(l=>l.hasChildren?l.children:l)),he=e.computed(()=>Math.max(...k.value.flatMap(l=>l.children&&l.children.length?Math.max(...l.children.map(o=>o.value)):l.value)));function $(l){const o=l/he.value;return v.value.width*o}function pe(l){return $(l)+v.value.left}function T(l,o){const a=k.value.find(i=>i.id===l.parentId),n=v.value.top+(d.value+s.value)*o,u=a.children.length*(d.value+s.value);return{y:n+u/2-t.value.style.chart.layout.bars.parentLabels.fontSize,name:a.name,value:[void 0,NaN,null].includes(a.value)?"":a.value.toFixed(t.value.style.chart.layout.bars.dataLabels.value.roundingValue),percentageToTotal:isNaN(a.value/p.value)?"":W(a.value,!0,t.value.style.chart.layout.bars.dataLabels.percentage.roundingPercentage)}}function ge(){return k.value}const L=e.ref(null),D=e.ref(null);function ye(l,o){D.value={datapoint:l,seriesIndex:o,series:b.value,config:t.value},E.value=!0,L.value=l.id;let a="";const n=l.isChild?l.parentName:l.name,u=l.isChild?l.name:"",i=t.value.style.chart.tooltip.customFormat;r.isFunction(i)&&r.functionReturnsString(()=>i({datapoint:l,series:b.value,config:t.value,seriesIndex:o}))?B.value=i({datapoint:l,series:b.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> ${n}</div>
3
3
  ${u?`<div>${u}</div>`:""}
4
4
  </div>`,t.value.style.chart.tooltip.showValue&&(a+=`<div>${t.value.translations.value}: <b>${t.value.style.chart.tooltip.prefix}${[void 0,NaN,null].includes(l.value)?"-":l.value.toFixed(t.value.style.chart.tooltip.roundingValue)}${t.value.style.chart.tooltip.suffix}</b></div>`),t.value.style.chart.tooltip.showPercentage&&(a+=`<div>${t.value.translations.percentageToTotal} : <b>${isNaN(l.value/p.value)?"-":`${(l.value/p.value*100).toFixed(t.value.style.chart.tooltip.roundingPercentage)}`}%</b></div>`,l.isChild&&(a+=`<div>${t.value.translations.percentageToSerie}: <b>${isNaN(l.value/l.parentValue)?"-":`${(l.value/l.parentValue*100).toFixed(t.value.style.chart.tooltip.roundingPercentage)}`}%</b></div>`)),B.value=`<div style="text-align:left">${a}</div>`)}function Y(l){if(isNaN(l)||!t.value.style.chart.layout.bars.dataLabels.value.show)return"";const o=r.dataLabel({p:t.value.style.chart.layout.bars.dataLabels.value.prefix,v:l,s:t.value.style.chart.layout.bars.dataLabels.value.suffix,r:t.value.style.chart.layout.bars.dataLabels.value.roundingValue}),a=`(${W(l,!0,t.value.style.chart.layout.bars.dataLabels.percentage.roundingPercentage)})`;return`${o}${t.value.style.chart.layout.bars.dataLabels.percentage.show?` ${a}`:""}`}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=_.value.map(a=>a.isChild?a.isFirstChild?{color:a.color,parentName:a.parentName,parentValue:a.parentValue,percentageToTotal:a.parentValue/p.value,childName:a.name,childValue:a.value,childPercentageToParent:a.value/a.parentValue,childPercentageToTotal:a.value/p.value}:{color:"",parentName:"",parentValue:"",percentageToTotal:"",childName:a.name,childValue:a.value,childPercentageToParent:a.value/a.parentValue,childPercentageToTotal:a.value/p.value}:{color:a.color,parentName:a.name,parentValue:a.value,percentageToTotal:a.value/p.value,childName:"",childValue:"",childPercentageToParent:"",childPercentageToTotal:""});return{head:l,body:o}});function K(){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]),n=l.concat([o]).concat(a),u=r.createCsvContent(n);r.downloadCsv({csvContent:u,title:t.value.style.chart.title.text||"vue-ui-vertical-bar"})}const N=e.ref(!1);function fe(l){N.value=l,F.value+=1}function J(){h.value.showTable=!h.value.showTable}function Q(){h.value.sortDesc=!h.value.sortDesc,P()}function Z(){h.value.showTooltip=!h.value.showTooltip}return ne({getData:ge,recalculateHeight:P,generatePdf:M,generateCsv:K,generateImage:q,toggleTable:J,toggleSort:Q,toggleTooltip:Z}),(l,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-vertical-bar ${N.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),ref_key:"verticalBarChart",ref:C,id:`vue-ui-vertical-bar_${m.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height: 100%":""}`)},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:I,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:12px`)},[e.createVNode(me._sfc_main,{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"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&w.value?(e.openBlock(),e.createBlock(te.UserOptions,{ref_key:"details",ref:ie,key:`user_options_${F.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(R),isPrinting:e.unref(O),uid:m.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:N.value,isTooltip:h.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:C.value,onToggleFullscreen:fe,onGeneratePdf:e.unref(M),onGenerateCsv:K,onGenerateImage:e.unref(q),onToggleTable:J,onToggleSort:Q,onToggleTooltip:Z},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:n})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:n})),void 0,!0)]),key:"7"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasSort","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),t.value.style.chart.legend.show&&t.value.style.chart.legend.position==="top"?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartLegend",ref:z},[e.createVNode(le.Legend,{legendSet:b.value,config:X.value,onClickMarker:o[0]||(o[0]=({legend:a})=>x(a.id))},{item:e.withCtx(({legend:a})=>[e.createElementVNode("div",{"data-cy-legend-item":"",onClick:n=>x(a.id),style:e.normalizeStyle(`opacity:${y.value.includes(a.id)?.5:1}`)},e.toDisplayString(a.name)+": "+e.toDisplayString(t.value.style.chart.legend.prefix)+e.toDisplayString(a.value.toFixed(t.value.style.chart.legend.roundingValue))+e.toDisplayString(t.value.style.chart.legend.suffix),13,Ne)]),_:1},8,["legendSet","config"])],512)):e.createCommentVNode("",!0),w.value?(e.openBlock(),e.createElementBlock("svg",{key:3,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":N.value,"vue-data-ui-fulscreen--off":!N.value}),viewBox:`0 0 ${c.value.width<=0?10:c.value.width} ${v.value.fullHeight<=0?10:v.value.fullHeight}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,(a,n)=>(e.openBlock(),e.createElementBlock("linearGradient",{x1:"0%",y1:"0%",x2:"100%",y2:"0%",id:`vertical_bar_gradient_${m.value}_${n}`},[e.createElementVNode("stop",{offset:"0%","stop-color":a.color},null,8,Ve),e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(r.shiftHue)(a.color,.03)}${e.unref(r.opacity)[100-t.value.style.chart.layout.bars.gradientIntensity]}`},null,8,Te)],8,Se))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,(a,n)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:v.value.left,y:v.value.top+(d.value+s.value)*n,width:$(a.value)<=0?1e-4:$(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,Ee)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,(a,n)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:v.value.left,y:v.value.top+(d.value+s.value)*n,width:$(a.value)<=0?1e-4:$(a.value),height:s.value<=0?1e-4:s.value,fill:t.value.style.chart.layout.bars.useGradient?`url(#vertical_bar_gradient_${m.value}_${n})`:`${a.color}${e.unref(r.opacity)[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,Be),(!a.isChild||a.isLastChild)&&t.value.style.chart.layout.separators.show&&n!==_.value.length-1?(e.openBlock(),e.createElementBlock("line",{key:0,x1:0,x2:v.value.left,y1:s.value+d.value/2+v.value.top+(d.value+s.value)*n,y2:s.value+d.value/2+v.value.top+(d.value+s.value)*n,stroke:t.value.style.chart.layout.separators.color,"stroke-width":t.value.style.chart.layout.separators.strokeWidth,"stroke-linecap":"round"},null,8,ze)):e.createCommentVNode("",!0),e.createElementVNode("text",{x:pe(a.value)+3+t.value.style.chart.layout.bars.dataLabels.offsetX,y:v.value.top+(d.value+s.value)*n+s.value/2+t.value.style.chart.layout.bars.dataLabels.fontSize/2,"text-anchor":"start","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(Y(a.value)),9,Pe),(a.isChild||!a.hasChildren)&&t.value.style.chart.layout.bars.nameLabels.show?(e.openBlock(),e.createElementBlock("text",{key:1,"text-anchor":"end",x:v.value.left-3+t.value.style.chart.layout.bars.nameLabels.offsetX,y:v.value.top+(d.value+s.value)*n+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,Le)):e.createCommentVNode("",!0),a.isChild&&a.childIndex===0&&t.value.style.chart.layout.bars.parentLabels.show?(e.openBlock(),e.createElementBlock("text",{key:2,x:3+t.value.style.chart.layout.bars.parentLabels.offsetX,y:T(a,n).y,"font-size":t.value.style.chart.layout.bars.parentLabels.fontSize,fill:t.value.style.chart.layout.bars.parentLabels.color,"font-weight":t.value.style.chart.layout.bars.parentLabels.bold?"bold":"normal","text-anchor":"start"},e.toDisplayString(T(a,n).name),9,De)):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:T(a,n).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(Y(T(a,n).value)),9,Fe)):e.createCommentVNode("",!0),e.createElementVNode("rect",{"data-cy-trap":"",x:0,y:v.value.top+(d.value+s.value)*n-d.value/2,width:c.value.width<=0?1e-4:c.value.width,height:s.value+d.value<=0?1e-4:s.value+d.value,fill:L.value===a.id?`${t.value.style.chart.layout.highlighter.color}${e.unref(r.opacity)[t.value.style.chart.layout.highlighter.opacity]}`:"transparent",onMouseenter:u=>ye(a,n),onMouseleave:o[1]||(o[1]=u=>{se.value=null,E.value=!1,L.value=null})},null,40,Ie)]))),256)),e.renderSlot(l.$slots,"svg",{svg:c.value},void 0,!0)],14,we)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Oe,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(O)||e.unref(R)})),void 0,!0)])):e.createCommentVNode("",!0),w.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ke.default,{key:5,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:6,ref_key:"chartLegend",ref:z},[e.createVNode(le.Legend,{legendSet:b.value,config:X.value,onClickMarker:o[2]||(o[2]=({legend:a})=>x(a.id))},{item:e.withCtx(({legend:a})=>[e.createElementVNode("div",{onClick:n=>x(a.id),style:e.normalizeStyle(`opacity:${y.value.includes(a.id)?.5:1}`)},e.toDisplayString(a.name)+" : "+e.toDisplayString(t.value.style.chart.legend.prefix)+e.toDisplayString(a.value.toFixed(t.value.style.chart.legend.roundingValue))+e.toDisplayString(t.value.style.chart.legend.suffix),13,Re)]),_:1},8,["legendSet","config"])],512)):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"legend",{legend:b.value},void 0,!0),e.createVNode(be._sfc_main,{show:h.value.showTooltip&&E.value&&y.value.length<f.dataset.length,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,fontSize:t.value.style.chart.tooltip.fontSize,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:C.value,content:B.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({...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","fontSize","backgroundOpacity","position","offsetY","parent","content","isCustom"]),w.value?(e.openBlock(),e.createBlock(xe.default,{key:7,hideDetails:"",config:{open:h.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:U,class:"vue-ui-vertical-bar-table"},[e.createElementVNode("div",Me,[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=>h.value.showTable=!1),onKeypress:o[4]||(o[4]=e.withKeys(a=>h.value.showTable=!1,["enter"]))},[e.createVNode(Ce.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":A.value})},[e.createElementVNode("table",qe,[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",He,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",Ue,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(p.value)?"":p.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,n)=>(e.openBlock(),e.createElementBlock("tr",{class:e.normalizeClass({"vue-ui-data-table__tbody__row":!0,"vue-ui-data-table__tbody__row-even":n%2===0,"vue-ui-data-table__tbody__row-odd":n%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",Ge,[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,Ae),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",je,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,Xe),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",Ye,e.toDisplayString(["",NaN,void 0].includes(a.percentageToTotal)?"":`${(a.percentageToTotal*100).toFixed(t.value.table.td.roundingPercentage)}%`),1)],12,We),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",Je,e.toDisplayString(a.childName),1)],12,Ke),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",Ze,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,Qe),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",tt,e.toDisplayString(["",NaN,void 0].includes(a.childPercentageToParent)?"":`${(a.childPercentageToParent*100).toFixed(t.value.table.td.roundingPercentage)}%`),1)],12,et),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",at,e.toDisplayString(["",NaN,void 0].includes(a.childPercentageToTotal)?"":`${(a.childPercentageToTotal*100).toFixed(t.value.table.td.roundingPercentage)}%`),1)],12,lt)],6))),256))])])],2)])],512)]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,$e))}},nt=_e._export_sfc(ot,[["__scopeId","data-v-c1e5caa2"]]);exports.default=nt;
@@ -1,14 +1,14 @@
1
1
  import { useCssVars as De, computed as f, ref as h, onMounted as Re, onBeforeUnmount as Me, openBlock as i, createElementBlock as c, normalizeClass as S, normalizeStyle as d, createVNode as D, createCommentVNode as b, createBlock as Q, unref as C, createSlots as Ue, withCtx as m, renderSlot as _, normalizeProps as G, guardReactiveProps as H, createElementVNode as o, toDisplayString as u, Fragment as R, renderList as M, withKeys as Xe, createTextVNode as Ae } from "vue";
2
- import { u as Ee, c as Ge, t as He, a as We, p as V, b as je, o as _e, e as Z, d as ee, X as Ye, s as qe, r as te, v as Ke, w as Je, f as Qe, n as Ze, q as et } from "./index-BvjCO-wv.js";
2
+ import { u as Ee, c as Ge, t as He, a as We, p as V, b as je, o as _e, e as Z, d as ee, X as Ye, s as qe, r as te, v as Ke, w as Je, f as Qe, n as Ze, q as et } from "./index-BbBCE1pM.js";
3
3
  import { t as tt, u as lt } from "./useResponsive-NZB-WLRF.js";
4
- import { _ as at } from "./Title-Bx2ibobQ.js";
5
- import { u as ot, U as nt } from "./usePrinter-CaKXrCiB.js";
6
- import { _ as ut } from "./Tooltip-DOEMrisX.js";
7
- import { L as $e } from "./Legend-BqqpwXbu.js";
8
- import rt from "./vue-ui-skeleton-jYHncdu5.js";
9
- import st from "./BaseIcon-DuMfKUDs.js";
10
- import it from "./vue-ui-accordion-q-bLDiD3.js";
11
- import { u as xe } from "./useNestedProp-2KJaYPfM.js";
4
+ import { _ as at } from "./Title-CMEhX9eJ.js";
5
+ import { u as ot, U as nt } from "./usePrinter-CnT0_Cbi.js";
6
+ import { _ as ut } from "./Tooltip-B2XPbRE_.js";
7
+ import { L as $e } from "./Legend-Crc6SgWK.js";
8
+ import rt from "./vue-ui-skeleton-BYBsAUyH.js";
9
+ import st from "./BaseIcon-y4nt-SIh.js";
10
+ import it from "./vue-ui-accordion-CM8Lp-MV.js";
11
+ import { u as xe } from "./useNestedProp-QJwLGaK5.js";
12
12
  import { _ as dt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
13
13
  const ct = ["id"], vt = ["onClick"], ht = ["xmlns", "viewBox"], pt = ["id"], gt = ["stop-color"], yt = ["stop-color"], ft = ["x", "y", "width", "height", "fill", "rx"], bt = ["x", "y", "width", "height", "fill", "rx", "stroke", "stroke-width"], mt = ["x2", "y1", "y2", "stroke", "stroke-width"], _t = ["x", "y", "font-size", "fill", "font-weight"], $t = ["x", "y", "font-size", "fill", "font-weight"], xt = ["x", "y", "font-size", "fill", "font-weight"], kt = ["x", "y", "font-size", "fill", "font-weight"], Ct = ["y", "width", "height", "fill", "onMouseenter"], wt = {
14
14
  key: 4,
@@ -1,14 +1,14 @@
1
1
  import { computed as c, ref as v, onMounted as Ae, onBeforeUnmount as Ve, openBlock as s, createElementBlock as n, normalizeClass as be, normalizeStyle as U, createVNode as te, createCommentVNode as m, createBlock as J, unref as y, createSlots as Me, withCtx as f, renderSlot as g, normalizeProps as j, guardReactiveProps as W, createElementVNode as b, Fragment as $, renderList as V, toDisplayString as T, createTextVNode as we, nextTick as De, pushScopeId as Ee, popScopeId as Ge } from "vue";
2
- import { u as Re, c as Ue, t as je, a as We, p as B, o as He, e as le, g as qe, b as Xe, d as Ye, f as I, X as Je, s as Ke, r as Qe, C as Ze, E as et, v as tt, w as lt, n as at, q as ot } from "./index-BvjCO-wv.js";
2
+ import { u as Re, c as Ue, t as je, a as We, p as B, o as He, e as le, g as qe, b as Xe, d as Ye, f as I, X as Je, s as Ke, r as Qe, C as Ze, E as et, v as tt, w as lt, n as at, q as ot } from "./index-BbBCE1pM.js";
3
3
  import { t as ut, u as rt } from "./useResponsive-NZB-WLRF.js";
4
- import { _ as st } from "./Title-Bx2ibobQ.js";
5
- import { u as nt, U as it } from "./usePrinter-CaKXrCiB.js";
6
- import { _ as ct } from "./Tooltip-DOEMrisX.js";
7
- import { D as vt } from "./DataTable-DKHF_NH2.js";
8
- import { L as dt } from "./Legend-BqqpwXbu.js";
9
- import ht from "./vue-ui-skeleton-jYHncdu5.js";
10
- import pt from "./vue-ui-accordion-q-bLDiD3.js";
11
- import { u as ke } from "./useNestedProp-2KJaYPfM.js";
4
+ import { _ as st } from "./Title-CMEhX9eJ.js";
5
+ import { u as nt, U as it } from "./usePrinter-CnT0_Cbi.js";
6
+ import { _ as ct } from "./Tooltip-B2XPbRE_.js";
7
+ import { D as vt } from "./DataTable-DVpbqbwp.js";
8
+ import { L as dt } from "./Legend-Crc6SgWK.js";
9
+ import ht from "./vue-ui-skeleton-BYBsAUyH.js";
10
+ import pt from "./vue-ui-accordion-CM8Lp-MV.js";
11
+ import { u as ke } from "./useNestedProp-QJwLGaK5.js";
12
12
  import { _ as yt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
13
13
  const xe = (M) => (Ee("data-v-766b8f65"), M = M(), Ge(), M), ft = ["id"], gt = ["xmlns", "viewBox"], mt = ["id"], bt = ["stop-color"], wt = ["stop-color"], kt = ["id"], xt = /* @__PURE__ */ xe(() => /* @__PURE__ */ b("feGaussianBlur", {
14
14
  in: "SourceGraphic",
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-oufiZvaS.cjs"),te=require("./useResponsive-B3TrDDIG.cjs"),me=require("./Title-DxNugmhI.cjs"),le=require("./usePrinter-Cc8ufBvU.cjs"),be=require("./Tooltip-BC2Wlz7P.cjs"),ke=require("./DataTable-CHXdpx94.cjs"),we=require("./Legend-BwrzHxLy.cjs"),xe=require("./vue-ui-skeleton-Fsru0dbb.cjs"),Ce=require("./vue-ui-accordion-DiR0dVog.cjs"),ae=require("./useNestedProp-CmTItGss.cjs"),Be=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),oe=S=>(e.pushScopeId("data-v-766b8f65"),S=S(),e.popScopeId(),S),_e=["id"],Se=["xmlns","viewBox"],Ne=["id"],$e=["stop-color"],Te=["stop-color"],Ve=["id"],Pe=oe(()=>e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:2},null,-1)),Ee=oe(()=>e.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1)),Ie=[Pe,Ee],ze=["x","y","height","width"],Fe=["rx","x","y","height","width","stroke","stroke-width","filter"],Le=["rx","x","y","height","width","fill","stroke","stroke-width","filter"],Oe=["x","y","height","width","filter"],De={key:0},Ae={key:1},Me={key:2},qe={key:3},Re=["onMouseover","x","y","height","width"],Ue={key:3,class:"vue-data-ui-watermark"},je=["onClick"],Ge={key:0},We={key:1},He=["innerHTML"],Ye={__name:"vue-ui-waffle",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(S,{expose:re,emit:ue}){const p=S,{vue_ui_waffle:ne}=s.useConfig(),P=e.computed(()=>!!p.dataset&&p.dataset.length),m=e.ref(s.createUid()),se=e.ref(null),F=e.ref(!1),L=e.ref(""),B=e.ref(null),A=e.ref(0),N=e.ref(null),M=e.ref(null),q=e.ref(null),t=e.computed(()=>{const l=ae.useNestedProp({userConfig:p.config,defaultConfig:ne});return l.theme?{...ae.useNestedProp({userConfig:s.themes.vue_ui_waffle[l.theme]||p.config,defaultConfig:l}),customPalette:s.themePalettes[l.theme]||s.palette}:l}),E=e.ref(null);e.onMounted(()=>{if(s.objectIsEmpty(p.dataset)?s.error({componentName:"VueUiWaffle",type:"dataset"}):p.dataset.forEach((l,o)=>{s.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(a=>{s.error({componentName:"VueUiWaffle",type:"datasetSerieAttribute",property:a,index:o})})}),t.value.responsive){const l=te.throttle(()=>{const{width:o,height:a}=te.useResponsive({chart:N.value,title:t.value.style.chart.title.text?M.value:null,legend:t.value.style.chart.legend.show?q.value:null});b.value.width=o,b.value.height=a,k.value.width=o,k.value.height=a});E.value=new ResizeObserver(l),E.value.observe(N.value.parentNode)}}),e.onBeforeUnmount(()=>{E.value&&E.value.disconnect()});const{isPrinting:R,isImaging:U,generatePdf:j,generateImage:G}=le.usePrinter({elementId:`vue-ui-waffle_${m.value}`,fileName:t.value.style.chart.title.text||"vue-ui-waffle"}),W=e.computed(()=>s.convertCustomPalette(t.value.customPalette)),y=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),b=e.ref({height:512,width:512}),k=e.ref({top:0,left:0,height:512,width:512}),w=e.computed(()=>(k.value.width-t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.spaceBetween)/t.value.style.chart.layout.grid.size),x=e.computed(()=>(k.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(()=>k.value.width/t.value.style.chart.layout.grid.size),I=e.computed(()=>k.value.height/t.value.style.chart.layout.grid.size);function H(l){const o=l.reduce((u,n)=>u+n,0),a=l.map(u=>Math.round(u/o*100)/100),r=a.reduce((u,n)=>u+n,0);if(r!==1){const u=a.length-1;a[u]+=1-r,a[u]=Math.round(a[u]*100)/100}return a}const Y=e.computed(()=>p.dataset.map((l,o)=>({...l,color:s.convertColorToHex(l.color)||W.value[o]||s.palette[o]||s.palette[o%s.palette.length],uid:`serie_${o}`,absoluteIndex:o}))),d=e.ref(Y.value),ie=e.computed(()=>{const l=d.value.filter((o,a)=>!v.value.includes(o.uid)).map((o,a)=>(o.values||[]).reduce((r,u)=>r+u,0));return H(l)}),ce=e.computed(()=>{const l=d.value.map((o,a)=>(o.values||[]).reduce((r,u)=>r+u));return H(l)}),h=e.computed(()=>(p.dataset.forEach((l,o)=>{[null,void 0].includes(l.values)&&s.error({componentName:"VueUiWaffle",type:"datasetSerieAttribute",property:"values (number[])",index:o})}),d.value.filter((l,o)=>!v.value.includes(l.uid)).map((l,o)=>({absoluteIndex:l.absoluteIndex,uid:l.uid,name:l.name,color:l.color,value:(l.values||[]).reduce((a,r)=>a+r,0),absoluteValues:l.values||[],proportion:ie.value[o]*Math.pow(t.value.style.chart.layout.grid.size,2)})))),de=e.computed(()=>d.value.map((l,o)=>({absoluteIndex:l.absoluteIndex,uid:l.uid,name:l.name,color:l.color,value:(l.values||[]).reduce((a,r)=>a+r,0),absoluteValues:l.values||[],proportion:ce.value[o]*Math.pow(t.value.style.chart.layout.grid.size,2)})));function ve(){return de.value.map(l=>({name:l.name,color:l.color,value:l.value,proportion:l.proportion/Math.pow(t.value.style.chart.layout.grid.size,2)}))}const pe=e.computed(()=>h.value.map((l,o)=>{const a=o>0?h.value.filter((n,c)=>c<o).map(n=>n.proportion).reduce((n,c)=>n+c)+l.proportion-h.value[o-1].proportion:l.proportion-l.proportion,r=a+l.proportion,u=[];for(let n=a;n<=r;n+=1)u.push(n);return{...l,start:o>0?h.value.filter((n,c)=>c<o).map(n=>n.proportion).reduce((n,c)=>n+c)+l.proportion-h.value[o-1].proportion:l.proportion-l.proportion,rects:u}})),i=e.computed(()=>pe.value.flatMap((l,o)=>l.rects.map((a,r)=>({isFirst:r===0,isLongEnough:a.length>2,name:l.name,color:l.color,value:l.value,serieIndex:o,absoluteStartIndex:r<3,serieId:l.uid,...l}))).map((l,o)=>({...l,isAbsoluteFirst:o%t.value.style.chart.layout.grid.size===0}))),T=e.computed(()=>{const l=[];for(let o=0;o<t.value.style.chart.layout.grid.size;o+=1)for(let a=0;a<t.value.style.chart.layout.grid.size;a+=1)l.push({isStartOfLine:a===0,position:t.value.style.chart.layout.grid.vertical?o:a,x:(t.value.style.chart.layout.grid.vertical?o:a)*(w.value+t.value.style.chart.layout.grid.spaceBetween),y:(t.value.style.chart.layout.grid.vertical?a:o)*(x.value+t.value.style.chart.layout.grid.spaceBetween)+k.value.top});return l}),v=e.ref([]),C=e.ref(!1),X=e.ref(null),J=e.ref(null);function K(l){if(!t.value.useAnimation){v.value.includes(l)?v.value=v.value.filter(u=>u!==l):v.value.length<_.value.length-1&&_.value.length>1&&v.value.push(l);return}const o=Y.value.find(u=>u.uid===l).values.reduce((u,n)=>u+n,0);let r=d.value.find(u=>u.uid===l).values.reduce((u,n)=>u+n,0);if(v.value.includes(l)){let n=function(){r>u?(cancelAnimationFrame(X.value),d.value=d.value.map((c,ge)=>c.uid===l?{...c,values:[u]}:c),C.value=!1):(C.value=!0,r+=u*.025,d.value=d.value.map((c,ge)=>c.uid===l?{...c,values:[r]}:c),X.value=requestAnimationFrame(n))};v.value=v.value.filter(c=>c!==l);const u=o;n()}else if(v.value.length<_.value.length-1&&_.value.length>1){let u=function(){r<.1?(cancelAnimationFrame(J.value),v.value.push(l),d.value=d.value.map((n,c)=>n.uid===l?{...n,values:[0]}:n),C.value=!1):(C.value=!0,r/=1.5,d.value=d.value.map((n,c)=>n.uid===l?{...n,values:[r]}:n),J.value=requestAnimationFrame(u))};u()}ue("selectLegend",h.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 _=e.computed(()=>d.value.map((l,o)=>({name:l.name,color:l.color||W[o]||s.palette[o]||s.palette[o%s.palette.length],value:(l.values||[]).reduce((a,r)=>a+r,0),uid:l.uid,shape:"square"})).map((l,o)=>({...l,proportion:l.value/d.value.map(a=>(a.values||[]).reduce((r,u)=>r+u,0)).reduce((a,r)=>a+r,0),opacity:v.value.includes(l.uid)?.5:1,segregate:()=>K(l.uid),isSegregated:v.value.includes(l.uid)}))),he=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":""})),f=e.computed(()=>h.value.map(l=>l.value).reduce((l,o)=>l+o,0)),O=e.ref(null);function fe(l){if(v.value.length===p.dataset.length)return;const o=i.value[l];O.value={datapoint:o,seriesIndex:o.absoluteIndex,series:d.value,config:t.value},F.value=!0,B.value=i.value[l].serieIndex;const a=t.value.style.chart.tooltip.customFormat;if(s.isFunction(a)&&s.functionReturnsString(()=>a({seriesIndex:i.value[l].absoluteIndex,datapoint:o,series:d.value,config:t.value})))L.value=a({seriesIndex:i.value[l].absoluteIndex,datapoint:o,series:d.value,config:t.value});else{let r="";r+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${o.name}</div>`,r+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><rect x="0" y="0" height="12" width="12" stroke="none" rx="1" fill="${o.color}" /></svg>`,t.value.style.chart.tooltip.showValue&&(r+=`<b>${s.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:o.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.tooltip.roundingValue})}</b>`),t.value.style.chart.tooltip.showPercentage&&(t.value.style.chart.tooltip.showValue?r+=`<span>(${(o.value/f.value*100).toFixed(t.value.style.chart.tooltip.roundingPercentage)}%)</span></div>`:r+=`<b>${(o.value/f.value*100).toFixed(t.value.style.chart.tooltip.roundingPercentage)}%</b></div>`),L.value=r}}const g=e.computed(()=>{const l=h.value.map(a=>({name:a.name,color:a.color})),o=h.value.map(a=>a.value);return{head:l,body:o}});function D(l){return t.value.useBlurOnHover&&![null,void 0].includes(B.value)&&B.value!==l?`url(#blur_${m.value})`:""}function Q(){e.nextTick(()=>{const l=g.value.head.map((r,u)=>[[r.name],[g.value.body[u]],[isNaN(g.value.body[u]/f.value)?"-":g.value.body[u]/f.value*100]]),o=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(l),a=s.createCsvContent(o);s.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>',s.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:f.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue}),"100%"],o=g.value.head.map((u,n)=>[{color:u.color,name:u.name},s.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:g.value.body[n],s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue}),isNaN(g.value.body[n]/f.value)?"-":(g.value.body[n]/f.value*100).toFixed(t.value.table.td.roundingPercentage)+"%"]),a={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},shape:"square",breakpoint:t.value.table.responsiveBreakpoint},r=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage];return{head:l,body:o,config:a,colNames:r}}),V=e.ref(!1);function ye(l){V.value=l,A.value+=1}function Z(){y.value.showTable=!y.value.showTable}function ee(){y.value.showTooltip=!y.value.showTooltip}return re({getData:ve,generatePdf:j,generateCsv:Q,generateImage:G,toggleTable:Z,toggleTooltip:ee}),(l,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-waffle ${V.value?"vue-data-ui-wrapper-fullscreen":""}`),ref_key:"waffleChart",ref:N,id:`vue-ui-waffle_${m.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height: 100%":""}`)},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:M,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:12px`)},[e.createVNode(me._sfc_main,{config:{title:{cy:"waffle-title",...t.value.style.chart.title},subtitle:{cy:"waffle-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&P.value?(e.openBlock(),e.createBlock(le.UserOptions,{ref_key:"details",ref:se,key:`user_options_${A.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(R),isImaging:e.unref(U),uid:m.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:V.value,isTooltip:y.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:N.value,onToggleFullscreen:ye,onGeneratePdf:e.unref(j),onGenerateCsv:Q,onGenerateImage:e.unref(G),onToggleTable:Z,onToggleTooltip:ee},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:r})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:r})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),P.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(s.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":V.value,"vue-data-ui-fulscreen--off":!V.value}),viewBox:`0 0 ${b.value.width<=0?10:b.value.width} ${b.value.height<=0?10:b.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(a,r)=>(e.openBlock(),e.createElementBlock("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`gradient_${m.value}_${r}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(s.shiftHue)(a.color,.05)}${e.unref(s.opacity)[100-t.value.style.chart.layout.rect.gradientIntensity]}`},null,8,$e),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,Te)],8,Ne))),256))]),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${m.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},Ie,8,Ve)]),t.value.useCustomCells?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(T.value,(a,r)=>(e.openBlock(),e.createElementBlock("foreignObject",{x:a.x,y:a.y,height:x.value<=0?1e-4:x.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:i.value[r].color,...i.value[r]},isSelected:[null,void 0].includes(B.value)?!0:i.value[r].serieIndex===B.value})),void 0,!0)],8,ze))),256)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{rx:t.value.style.chart.layout.rect.rounded?t.value.style.chart.layout.rect.rounding:0,x:a.x+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.grid.spaceBetween/2,height:x.value<=0?1e-4:x.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:D(i.value[r].serieIndex)},null,8,Fe))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{rx:t.value.style.chart.layout.rect.rounded?t.value.style.chart.layout.rect.rounding:0,x:a.x+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.grid.spaceBetween/2,height:x.value<=0?1e-4:x.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_${m.value}_${r})`:i.value[r].color,stroke:t.value.style.chart.layout.rect.stroke,"stroke-width":t.value.style.chart.layout.rect.strokeWidth,filter:D(i.value[r].serieIndex)},null,8,Le))),256))],64)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[!C.value&&!t.value.style.chart.layout.grid.vertical&&t.value.style.chart.layout.labels.captions.show&&(i.value[r].isFirst&&a.position<t.value.style.chart.layout.grid.size-2||i.value[r].isAbsoluteFirst&&r%t.value.style.chart.layout.grid.size===0&&i.value[r].absoluteStartIndex)?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:a.x+t.value.style.chart.layout.labels.captions.offsetX+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.labels.captions.offsetY+t.value.style.chart.layout.grid.spaceBetween/2,height:I.value<=0?1e-4:I.value,width:$.value*t.value.style.chart.layout.grid.size<=0?1e-4:$.value*t.value.style.chart.layout.grid.size,filter:D(i.value[r].serieIndex)},[e.createElementVNode("div",{class:"vue-ui-waffle-caption",style:e.normalizeStyle(`height: 100%; width: 100%; font-size:${t.value.style.chart.layout.labels.captions.fontSize}px;display:flex;align-items:center;justify-content:flex-start;padding: 0 ${$.value/12}px;color:${e.unref(s.adaptColorToBackground)(i.value[r].color)};gap:2px`)},[t.value.style.chart.layout.labels.captions.showSerieName?(e.openBlock(),e.createElementBlock("span",De,e.toDisplayString(t.value.style.chart.layout.labels.captions.serieNameAbbreviation?e.unref(s.abbreviate)({source:i.value[r].name,length:t.value.style.chart.layout.labels.captions.serieNameMaxAbbreviationSize}):i.value[r].name)+": ",1)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.captions.showPercentage?(e.openBlock(),e.createElementBlock("span",Ae,e.toDisplayString(e.unref(s.dataLabel)({v:i.value[r].proportion,s:"%",r:t.value.style.chart.layout.labels.captions.roundingPercentage})),1)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.captions.showPercentage&&t.value.style.chart.layout.labels.captions.showValue?(e.openBlock(),e.createElementBlock("span",Me," ("+e.toDisplayString(e.unref(s.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:i.value[r].value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.layout.labels.captions.roundingValue}))+") ",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",qe,e.toDisplayString(e.unref(s.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:i.value[r].value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.layout.labels.captions.roundingValue})),1)):e.createCommentVNode("",!0)],4)],8,Oe)):e.createCommentVNode("",!0)],64))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{onMouseover:u=>fe(r),onMouseleave:o[0]||(o[0]=u=>{F.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,Re))),256)),e.renderSlot(l.$slots,"svg",{svg:b.value},void 0,!0)],14,Se)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ue,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(R)||e.unref(U)})),void 0,!0)])):e.createCommentVNode("",!0),P.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(xe.default,{key:4,config:{type:"waffle",style:{backgroundColor:t.value.style.chart.backgroundColor,waffle:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:q},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(we.Legend,{key:0,legendSet:_.value,config:he.value,onClickMarker:o[1]||(o[1]=({legend:a})=>K(a.uid))},{item:e.withCtx(({legend:a})=>[e.createElementVNode("div",{onClick:r=>a.segregate(),style:e.normalizeStyle(`opacity:${v.value.includes(a.uid)?.5:1}`)},[e.createTextVNode(e.toDisplayString(a.name)+": "+e.toDisplayString(e.unref(s.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:C.value}))+" ",1),v.value.includes(a.uid)?(e.openBlock(),e.createElementBlock("span",We," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",Ge," ("+e.toDisplayString(isNaN(a.value/f.value)?"-":e.unref(s.dataLabel)({v:a.value/f.value*100,s:"%",r:t.value.style.chart.legend.roundingPercentage,isAnimating:C.value}))+") ",1))],12,je)]),_:1},8,["legendSet","config"])):e.renderSlot(l.$slots,"legend",{key:1,legend:_.value},void 0,!0)],512),e.createVNode(be._sfc_main,{show:y.value.showTooltip&&F.value&&v.value.length<p.dataset.length,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:N.value,content:L.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({...O.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...O.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isCustom","fontSize"]),P.value?(e.openBlock(),e.createBlock(Ce.default,{key:5,hideDetails:"",config:{open:y.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(ke.DataTable,{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:o[2]||(o[2]=a=>y.value.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createElementVNode("div",{innerHTML:a,style:{display:"flex","align-items":"center"}},null,8,He)]),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,_e))}},Xe=Be._export_sfc(Ye,[["__scopeId","data-v-766b8f65"]]);exports.default=Xe;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-BcLWKvbg.cjs"),te=require("./useResponsive-B3TrDDIG.cjs"),me=require("./Title-D9E4eBNp.cjs"),le=require("./usePrinter-BWCvrSz2.cjs"),be=require("./Tooltip-C6EZFw-G.cjs"),ke=require("./DataTable-Ckvkqg78.cjs"),we=require("./Legend-DA1uCuos.cjs"),xe=require("./vue-ui-skeleton-BG428rdQ.cjs"),Ce=require("./vue-ui-accordion-BOEIWXgn.cjs"),ae=require("./useNestedProp-BcuQPNiW.cjs"),Be=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),oe=S=>(e.pushScopeId("data-v-766b8f65"),S=S(),e.popScopeId(),S),_e=["id"],Se=["xmlns","viewBox"],Ne=["id"],$e=["stop-color"],Te=["stop-color"],Ve=["id"],Pe=oe(()=>e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:2},null,-1)),Ee=oe(()=>e.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1)),Ie=[Pe,Ee],ze=["x","y","height","width"],Fe=["rx","x","y","height","width","stroke","stroke-width","filter"],Le=["rx","x","y","height","width","fill","stroke","stroke-width","filter"],Oe=["x","y","height","width","filter"],De={key:0},Ae={key:1},Me={key:2},qe={key:3},Re=["onMouseover","x","y","height","width"],Ue={key:3,class:"vue-data-ui-watermark"},je=["onClick"],Ge={key:0},We={key:1},He=["innerHTML"],Ye={__name:"vue-ui-waffle",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(S,{expose:re,emit:ue}){const p=S,{vue_ui_waffle:ne}=s.useConfig(),P=e.computed(()=>!!p.dataset&&p.dataset.length),m=e.ref(s.createUid()),se=e.ref(null),F=e.ref(!1),L=e.ref(""),B=e.ref(null),A=e.ref(0),N=e.ref(null),M=e.ref(null),q=e.ref(null),t=e.computed(()=>{const l=ae.useNestedProp({userConfig:p.config,defaultConfig:ne});return l.theme?{...ae.useNestedProp({userConfig:s.themes.vue_ui_waffle[l.theme]||p.config,defaultConfig:l}),customPalette:s.themePalettes[l.theme]||s.palette}:l}),E=e.ref(null);e.onMounted(()=>{if(s.objectIsEmpty(p.dataset)?s.error({componentName:"VueUiWaffle",type:"dataset"}):p.dataset.forEach((l,o)=>{s.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(a=>{s.error({componentName:"VueUiWaffle",type:"datasetSerieAttribute",property:a,index:o})})}),t.value.responsive){const l=te.throttle(()=>{const{width:o,height:a}=te.useResponsive({chart:N.value,title:t.value.style.chart.title.text?M.value:null,legend:t.value.style.chart.legend.show?q.value:null});b.value.width=o,b.value.height=a,k.value.width=o,k.value.height=a});E.value=new ResizeObserver(l),E.value.observe(N.value.parentNode)}}),e.onBeforeUnmount(()=>{E.value&&E.value.disconnect()});const{isPrinting:R,isImaging:U,generatePdf:j,generateImage:G}=le.usePrinter({elementId:`vue-ui-waffle_${m.value}`,fileName:t.value.style.chart.title.text||"vue-ui-waffle"}),W=e.computed(()=>s.convertCustomPalette(t.value.customPalette)),y=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),b=e.ref({height:512,width:512}),k=e.ref({top:0,left:0,height:512,width:512}),w=e.computed(()=>(k.value.width-t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.spaceBetween)/t.value.style.chart.layout.grid.size),x=e.computed(()=>(k.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(()=>k.value.width/t.value.style.chart.layout.grid.size),I=e.computed(()=>k.value.height/t.value.style.chart.layout.grid.size);function H(l){const o=l.reduce((u,n)=>u+n,0),a=l.map(u=>Math.round(u/o*100)/100),r=a.reduce((u,n)=>u+n,0);if(r!==1){const u=a.length-1;a[u]+=1-r,a[u]=Math.round(a[u]*100)/100}return a}const Y=e.computed(()=>p.dataset.map((l,o)=>({...l,color:s.convertColorToHex(l.color)||W.value[o]||s.palette[o]||s.palette[o%s.palette.length],uid:`serie_${o}`,absoluteIndex:o}))),d=e.ref(Y.value),ie=e.computed(()=>{const l=d.value.filter((o,a)=>!v.value.includes(o.uid)).map((o,a)=>(o.values||[]).reduce((r,u)=>r+u,0));return H(l)}),ce=e.computed(()=>{const l=d.value.map((o,a)=>(o.values||[]).reduce((r,u)=>r+u));return H(l)}),h=e.computed(()=>(p.dataset.forEach((l,o)=>{[null,void 0].includes(l.values)&&s.error({componentName:"VueUiWaffle",type:"datasetSerieAttribute",property:"values (number[])",index:o})}),d.value.filter((l,o)=>!v.value.includes(l.uid)).map((l,o)=>({absoluteIndex:l.absoluteIndex,uid:l.uid,name:l.name,color:l.color,value:(l.values||[]).reduce((a,r)=>a+r,0),absoluteValues:l.values||[],proportion:ie.value[o]*Math.pow(t.value.style.chart.layout.grid.size,2)})))),de=e.computed(()=>d.value.map((l,o)=>({absoluteIndex:l.absoluteIndex,uid:l.uid,name:l.name,color:l.color,value:(l.values||[]).reduce((a,r)=>a+r,0),absoluteValues:l.values||[],proportion:ce.value[o]*Math.pow(t.value.style.chart.layout.grid.size,2)})));function ve(){return de.value.map(l=>({name:l.name,color:l.color,value:l.value,proportion:l.proportion/Math.pow(t.value.style.chart.layout.grid.size,2)}))}const pe=e.computed(()=>h.value.map((l,o)=>{const a=o>0?h.value.filter((n,c)=>c<o).map(n=>n.proportion).reduce((n,c)=>n+c)+l.proportion-h.value[o-1].proportion:l.proportion-l.proportion,r=a+l.proportion,u=[];for(let n=a;n<=r;n+=1)u.push(n);return{...l,start:o>0?h.value.filter((n,c)=>c<o).map(n=>n.proportion).reduce((n,c)=>n+c)+l.proportion-h.value[o-1].proportion:l.proportion-l.proportion,rects:u}})),i=e.computed(()=>pe.value.flatMap((l,o)=>l.rects.map((a,r)=>({isFirst:r===0,isLongEnough:a.length>2,name:l.name,color:l.color,value:l.value,serieIndex:o,absoluteStartIndex:r<3,serieId:l.uid,...l}))).map((l,o)=>({...l,isAbsoluteFirst:o%t.value.style.chart.layout.grid.size===0}))),T=e.computed(()=>{const l=[];for(let o=0;o<t.value.style.chart.layout.grid.size;o+=1)for(let a=0;a<t.value.style.chart.layout.grid.size;a+=1)l.push({isStartOfLine:a===0,position:t.value.style.chart.layout.grid.vertical?o:a,x:(t.value.style.chart.layout.grid.vertical?o:a)*(w.value+t.value.style.chart.layout.grid.spaceBetween),y:(t.value.style.chart.layout.grid.vertical?a:o)*(x.value+t.value.style.chart.layout.grid.spaceBetween)+k.value.top});return l}),v=e.ref([]),C=e.ref(!1),X=e.ref(null),J=e.ref(null);function K(l){if(!t.value.useAnimation){v.value.includes(l)?v.value=v.value.filter(u=>u!==l):v.value.length<_.value.length-1&&_.value.length>1&&v.value.push(l);return}const o=Y.value.find(u=>u.uid===l).values.reduce((u,n)=>u+n,0);let r=d.value.find(u=>u.uid===l).values.reduce((u,n)=>u+n,0);if(v.value.includes(l)){let n=function(){r>u?(cancelAnimationFrame(X.value),d.value=d.value.map((c,ge)=>c.uid===l?{...c,values:[u]}:c),C.value=!1):(C.value=!0,r+=u*.025,d.value=d.value.map((c,ge)=>c.uid===l?{...c,values:[r]}:c),X.value=requestAnimationFrame(n))};v.value=v.value.filter(c=>c!==l);const u=o;n()}else if(v.value.length<_.value.length-1&&_.value.length>1){let u=function(){r<.1?(cancelAnimationFrame(J.value),v.value.push(l),d.value=d.value.map((n,c)=>n.uid===l?{...n,values:[0]}:n),C.value=!1):(C.value=!0,r/=1.5,d.value=d.value.map((n,c)=>n.uid===l?{...n,values:[r]}:n),J.value=requestAnimationFrame(u))};u()}ue("selectLegend",h.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 _=e.computed(()=>d.value.map((l,o)=>({name:l.name,color:l.color||W[o]||s.palette[o]||s.palette[o%s.palette.length],value:(l.values||[]).reduce((a,r)=>a+r,0),uid:l.uid,shape:"square"})).map((l,o)=>({...l,proportion:l.value/d.value.map(a=>(a.values||[]).reduce((r,u)=>r+u,0)).reduce((a,r)=>a+r,0),opacity:v.value.includes(l.uid)?.5:1,segregate:()=>K(l.uid),isSegregated:v.value.includes(l.uid)}))),he=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":""})),f=e.computed(()=>h.value.map(l=>l.value).reduce((l,o)=>l+o,0)),O=e.ref(null);function fe(l){if(v.value.length===p.dataset.length)return;const o=i.value[l];O.value={datapoint:o,seriesIndex:o.absoluteIndex,series:d.value,config:t.value},F.value=!0,B.value=i.value[l].serieIndex;const a=t.value.style.chart.tooltip.customFormat;if(s.isFunction(a)&&s.functionReturnsString(()=>a({seriesIndex:i.value[l].absoluteIndex,datapoint:o,series:d.value,config:t.value})))L.value=a({seriesIndex:i.value[l].absoluteIndex,datapoint:o,series:d.value,config:t.value});else{let r="";r+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${o.name}</div>`,r+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><rect x="0" y="0" height="12" width="12" stroke="none" rx="1" fill="${o.color}" /></svg>`,t.value.style.chart.tooltip.showValue&&(r+=`<b>${s.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:o.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.tooltip.roundingValue})}</b>`),t.value.style.chart.tooltip.showPercentage&&(t.value.style.chart.tooltip.showValue?r+=`<span>(${(o.value/f.value*100).toFixed(t.value.style.chart.tooltip.roundingPercentage)}%)</span></div>`:r+=`<b>${(o.value/f.value*100).toFixed(t.value.style.chart.tooltip.roundingPercentage)}%</b></div>`),L.value=r}}const g=e.computed(()=>{const l=h.value.map(a=>({name:a.name,color:a.color})),o=h.value.map(a=>a.value);return{head:l,body:o}});function D(l){return t.value.useBlurOnHover&&![null,void 0].includes(B.value)&&B.value!==l?`url(#blur_${m.value})`:""}function Q(){e.nextTick(()=>{const l=g.value.head.map((r,u)=>[[r.name],[g.value.body[u]],[isNaN(g.value.body[u]/f.value)?"-":g.value.body[u]/f.value*100]]),o=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(l),a=s.createCsvContent(o);s.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>',s.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:f.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue}),"100%"],o=g.value.head.map((u,n)=>[{color:u.color,name:u.name},s.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:g.value.body[n],s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue}),isNaN(g.value.body[n]/f.value)?"-":(g.value.body[n]/f.value*100).toFixed(t.value.table.td.roundingPercentage)+"%"]),a={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},shape:"square",breakpoint:t.value.table.responsiveBreakpoint},r=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage];return{head:l,body:o,config:a,colNames:r}}),V=e.ref(!1);function ye(l){V.value=l,A.value+=1}function Z(){y.value.showTable=!y.value.showTable}function ee(){y.value.showTooltip=!y.value.showTooltip}return re({getData:ve,generatePdf:j,generateCsv:Q,generateImage:G,toggleTable:Z,toggleTooltip:ee}),(l,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-waffle ${V.value?"vue-data-ui-wrapper-fullscreen":""}`),ref_key:"waffleChart",ref:N,id:`vue-ui-waffle_${m.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height: 100%":""}`)},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:M,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:12px`)},[e.createVNode(me._sfc_main,{config:{title:{cy:"waffle-title",...t.value.style.chart.title},subtitle:{cy:"waffle-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&P.value?(e.openBlock(),e.createBlock(le.UserOptions,{ref_key:"details",ref:se,key:`user_options_${A.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(R),isImaging:e.unref(U),uid:m.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:V.value,isTooltip:y.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:N.value,onToggleFullscreen:ye,onGeneratePdf:e.unref(j),onGenerateCsv:Q,onGenerateImage:e.unref(G),onToggleTable:Z,onToggleTooltip:ee},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:r})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:r})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),P.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(s.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":V.value,"vue-data-ui-fulscreen--off":!V.value}),viewBox:`0 0 ${b.value.width<=0?10:b.value.width} ${b.value.height<=0?10:b.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(a,r)=>(e.openBlock(),e.createElementBlock("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`gradient_${m.value}_${r}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(s.shiftHue)(a.color,.05)}${e.unref(s.opacity)[100-t.value.style.chart.layout.rect.gradientIntensity]}`},null,8,$e),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,Te)],8,Ne))),256))]),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${m.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},Ie,8,Ve)]),t.value.useCustomCells?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(T.value,(a,r)=>(e.openBlock(),e.createElementBlock("foreignObject",{x:a.x,y:a.y,height:x.value<=0?1e-4:x.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:i.value[r].color,...i.value[r]},isSelected:[null,void 0].includes(B.value)?!0:i.value[r].serieIndex===B.value})),void 0,!0)],8,ze))),256)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{rx:t.value.style.chart.layout.rect.rounded?t.value.style.chart.layout.rect.rounding:0,x:a.x+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.grid.spaceBetween/2,height:x.value<=0?1e-4:x.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:D(i.value[r].serieIndex)},null,8,Fe))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{rx:t.value.style.chart.layout.rect.rounded?t.value.style.chart.layout.rect.rounding:0,x:a.x+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.grid.spaceBetween/2,height:x.value<=0?1e-4:x.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_${m.value}_${r})`:i.value[r].color,stroke:t.value.style.chart.layout.rect.stroke,"stroke-width":t.value.style.chart.layout.rect.strokeWidth,filter:D(i.value[r].serieIndex)},null,8,Le))),256))],64)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[!C.value&&!t.value.style.chart.layout.grid.vertical&&t.value.style.chart.layout.labels.captions.show&&(i.value[r].isFirst&&a.position<t.value.style.chart.layout.grid.size-2||i.value[r].isAbsoluteFirst&&r%t.value.style.chart.layout.grid.size===0&&i.value[r].absoluteStartIndex)?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:a.x+t.value.style.chart.layout.labels.captions.offsetX+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.labels.captions.offsetY+t.value.style.chart.layout.grid.spaceBetween/2,height:I.value<=0?1e-4:I.value,width:$.value*t.value.style.chart.layout.grid.size<=0?1e-4:$.value*t.value.style.chart.layout.grid.size,filter:D(i.value[r].serieIndex)},[e.createElementVNode("div",{class:"vue-ui-waffle-caption",style:e.normalizeStyle(`height: 100%; width: 100%; font-size:${t.value.style.chart.layout.labels.captions.fontSize}px;display:flex;align-items:center;justify-content:flex-start;padding: 0 ${$.value/12}px;color:${e.unref(s.adaptColorToBackground)(i.value[r].color)};gap:2px`)},[t.value.style.chart.layout.labels.captions.showSerieName?(e.openBlock(),e.createElementBlock("span",De,e.toDisplayString(t.value.style.chart.layout.labels.captions.serieNameAbbreviation?e.unref(s.abbreviate)({source:i.value[r].name,length:t.value.style.chart.layout.labels.captions.serieNameMaxAbbreviationSize}):i.value[r].name)+": ",1)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.captions.showPercentage?(e.openBlock(),e.createElementBlock("span",Ae,e.toDisplayString(e.unref(s.dataLabel)({v:i.value[r].proportion,s:"%",r:t.value.style.chart.layout.labels.captions.roundingPercentage})),1)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.captions.showPercentage&&t.value.style.chart.layout.labels.captions.showValue?(e.openBlock(),e.createElementBlock("span",Me," ("+e.toDisplayString(e.unref(s.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:i.value[r].value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.layout.labels.captions.roundingValue}))+") ",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",qe,e.toDisplayString(e.unref(s.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:i.value[r].value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.layout.labels.captions.roundingValue})),1)):e.createCommentVNode("",!0)],4)],8,Oe)):e.createCommentVNode("",!0)],64))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{onMouseover:u=>fe(r),onMouseleave:o[0]||(o[0]=u=>{F.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,Re))),256)),e.renderSlot(l.$slots,"svg",{svg:b.value},void 0,!0)],14,Se)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ue,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(R)||e.unref(U)})),void 0,!0)])):e.createCommentVNode("",!0),P.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(xe.default,{key:4,config:{type:"waffle",style:{backgroundColor:t.value.style.chart.backgroundColor,waffle:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:q},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(we.Legend,{key:0,legendSet:_.value,config:he.value,onClickMarker:o[1]||(o[1]=({legend:a})=>K(a.uid))},{item:e.withCtx(({legend:a})=>[e.createElementVNode("div",{onClick:r=>a.segregate(),style:e.normalizeStyle(`opacity:${v.value.includes(a.uid)?.5:1}`)},[e.createTextVNode(e.toDisplayString(a.name)+": "+e.toDisplayString(e.unref(s.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:C.value}))+" ",1),v.value.includes(a.uid)?(e.openBlock(),e.createElementBlock("span",We," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",Ge," ("+e.toDisplayString(isNaN(a.value/f.value)?"-":e.unref(s.dataLabel)({v:a.value/f.value*100,s:"%",r:t.value.style.chart.legend.roundingPercentage,isAnimating:C.value}))+") ",1))],12,je)]),_:1},8,["legendSet","config"])):e.renderSlot(l.$slots,"legend",{key:1,legend:_.value},void 0,!0)],512),e.createVNode(be._sfc_main,{show:y.value.showTooltip&&F.value&&v.value.length<p.dataset.length,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:N.value,content:L.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({...O.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...O.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isCustom","fontSize"]),P.value?(e.openBlock(),e.createBlock(Ce.default,{key:5,hideDetails:"",config:{open:y.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(ke.DataTable,{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:o[2]||(o[2]=a=>y.value.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createElementVNode("div",{innerHTML:a,style:{display:"flex","align-items":"center"}},null,8,He)]),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,_e))}},Xe=Be._export_sfc(Ye,[["__scopeId","data-v-766b8f65"]]);exports.default=Xe;
@@ -1,10 +1,10 @@
1
1
  import { computed as p, ref as s, watch as W, onMounted as q, onBeforeUnmount as J, openBlock as r, createElementBlock as h, normalizeStyle as C, createVNode as K, createCommentVNode as d, createBlock as N, unref as v, createSlots as Q, withCtx as _, renderSlot as y, normalizeProps as A, guardReactiveProps as M, normalizeClass as U, Fragment as Z, renderList as ee, toDisplayString as te } from "vue";
2
- import { u as ae, c as le, t as se, o as ne, e as oe, s as X, X as re } from "./index-BvjCO-wv.js";
3
- import { _ as ue } from "./Title-Bx2ibobQ.js";
4
- import { u as ie, U as ce } from "./usePrinter-CaKXrCiB.js";
2
+ import { u as ae, c as le, t as se, o as ne, e as oe, s as X, X as re } from "./index-BbBCE1pM.js";
3
+ import { _ as ue } from "./Title-CMEhX9eJ.js";
4
+ import { u as ie, U as ce } from "./usePrinter-CnT0_Cbi.js";
5
5
  import { t as he, u as ve } from "./useResponsive-NZB-WLRF.js";
6
- import de from "./vue-ui-skeleton-jYHncdu5.js";
7
- import { u as B } from "./useNestedProp-2KJaYPfM.js";
6
+ import de from "./vue-ui-skeleton-BYBsAUyH.js";
7
+ import { u as B } from "./useNestedProp-QJwLGaK5.js";
8
8
  import { _ as ye } from "./_plugin-vue_export-helper-CHgC5LLL.js";
9
9
  const fe = ["id"], ge = ["xmlns", "viewBox"], me = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-linecap"], pe = ["cx", "cy", "r", "stroke", "stroke-width"], ke = ["x", "y", "font-size", "fill", "font-weight"], we = {
10
10
  key: 3,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),c=require("./index-oufiZvaS.cjs"),q=require("./Title-DxNugmhI.cjs"),P=require("./usePrinter-Cc8ufBvU.cjs"),B=require("./useResponsive-B3TrDDIG.cjs"),T=require("./vue-ui-skeleton-Fsru0dbb.cjs"),S=require("./useNestedProp-CmTItGss.cjs"),U=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),G=["id"],L=["xmlns","viewBox"],R=["x1","x2","y1","y2","stroke","stroke-width","stroke-linecap"],X=["cx","cy","r","stroke","stroke-width"],j=["x","y","font-size","fill","font-weight"],H={key:3,class:"vue-data-ui-watermark"},Y={__name:"vue-ui-wheel",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(I,{expose:F}){const o=I,{vue_ui_wheel:N}=c.useConfig(),f=e.computed(()=>!!o.dataset&&Object.keys(o.dataset).length),y=e.ref(c.createUid()),z=e.ref(null),g=e.ref(0),d=e.ref(null),p=e.ref(null),t=e.computed(()=>{const l=S.useNestedProp({userConfig:o.config,defaultConfig:N});return l.theme?{...S.useNestedProp({userConfig:c.themes.vue_ui_wheel[l.theme]||o.config,defaultConfig:l})}:l}),{isPrinting:k,isImaging:w,generatePdf:C,generateImage:b}=P.usePrinter({elementId:y.value,fileName:t.value.style.chart.title.text||"vue-ui-wheel"}),n=e.ref({size:360,height:360,width:360}),m=e.ref(t.value.style.chart.layout.percentage.fontSize),r=e.computed(()=>({radius:Math.min(n.value.width,n.value.height)*.9/2,centerX:n.value.width/2,centerY:n.value.height/2}));function _(l,u=1){return{x:r.value.centerX+r.value.radius*Math.cos(29.85+l*Math.PI/180)*u,y:r.value.centerY+r.value.radius*Math.sin(29.85+l*Math.PI/180)*u}}const s=e.ref(t.value.style.chart.animation.use?0:o.dataset.percentage||0);e.watch(()=>o.dataset.percentage,()=>{s.value=e.ref(t.value.style.chart.animation.use?0:o.dataset.percentage||0),x()});const h=e.ref(null);e.onMounted(()=>{if(c.objectIsEmpty(o.dataset)&&c.error({componentName:"VueUiWheel",type:"dataset"}),x(),t.value.responsive){const l=B.throttle(()=>{const{width:u,height:a}=B.useResponsive({chart:d.value,title:t.value.style.chart.title.text?p.value:null});n.value.width=u,n.value.height=a,m.value=t.value.style.chart.layout.percentage.fontSize/360*Math.min(u,a)});h.value=new ResizeObserver(l),h.value.observe(d.value.parentNode)}}),e.onBeforeUnmount(()=>{h.value&&h.value.disconnect()});function x(){let l=0,u=t.value.style.chart.animation.speed,a=.005*t.value.style.chart.animation.acceleration;function i(){s.value+=u+l,l+=a,s.value<(o.dataset.percentage||0)?requestAnimationFrame(i):s.value=o.dataset.percentage||0}t.value.style.chart.animation.use&&(s.value=0,i())}const $=e.computed(()=>{const l=[];for(let a=0;a<100;a+=1){const i=s.value>a?t.value.style.chart.layout.wheel.ticks.activeColor:t.value.style.chart.layout.wheel.ticks.inactiveColor,{x:E,y:V}=_(n.value.size/100*a),{x:A,y:M}=_(n.value.size/100*a,.9);l.push({x1:E,y1:V,x2:A,y2:M,color:t.value.style.chart.layout.wheel.ticks.gradient.show?c.shiftHue(i,a/100*(t.value.style.chart.layout.wheel.ticks.gradient.shiftHueIntensity/100)):i})}return l}),v=e.ref(!1);function O(l){v.value=l,g.value+=1}return F({generatePdf:C,generateImage:b}),(l,u)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-wheel",ref_key:"wheelChart",ref:d,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.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:p,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:12px`)},[e.createVNode(q._sfc_main,{config:{title:{cy:"wheel-title",...t.value.style.chart.title},subtitle:{cy:"wheel-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&f.value?(e.openBlock(),e.createBlock(P.UserOptions,{ref_key:"details",ref:z,key:`user_options_${g.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(k),isImaging:e.unref(w),uid:y.value,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,hasXls:!1,isFullscreen:v.value,titles:{...t.value.userOptions.buttonTitles},chartElement:d.value,onToggleFullscreen:O,onGeneratePdf:e.unref(C),onGenerateImage:e.unref(b)},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:a,isFullscreen:i})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:i})),void 0,!0)]),key:"2"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(c.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":v.value,"vue-data-ui-fulscreen--off":!v.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:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.value,(a,i)=>(e.openBlock(),e.createElementBlock("line",{x1:a.x1,x2:a.x2,y1:a.y1,y2:a.y2,stroke:a.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&&i<=s.value})},null,10,R))),256)),t.value.style.chart.layout.innerCircle.show?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:r.value.centerX,cy:r.value.centerY,r:r.value.radius*.8<=0?1e-4:r.value.radius*.8,stroke:t.value.style.chart.layout.innerCircle.stroke,"stroke-width":t.value.style.chart.layout.innerCircle.strokeWidth,fill:"none"},null,8,X)):e.createCommentVNode("",!0),t.value.style.chart.layout.percentage.show?(e.openBlock(),e.createElementBlock("text",{key:1,x:r.value.centerX,y:r.value.centerY+m.value/3,"font-size":m.value,fill:t.value.style.chart.layout.wheel.ticks.gradient.show?e.unref(c.shiftHue)(t.value.style.chart.layout.wheel.ticks.activeColor,s.value/100*(t.value.style.chart.layout.wheel.ticks.gradient.shiftHueIntensity/100)):t.value.style.chart.layout.wheel.ticks.activeColor,"text-anchor":"middle","font-weight":t.value.style.chart.layout.percentage.bold?"bold":"normal",style:{"font-variant-numeric":"tabluar-nums"}},e.toDisplayString(Number(s.value.toFixed(t.value.style.chart.layout.percentage.rounding)).toLocaleString())+"% ",9,j)):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"svg",{svg:n.value},void 0,!0)],14,L)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",H,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(k)||e.unref(w)})),void 0,!0)])):e.createCommentVNode("",!0),f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(T.default,{key:4,config:{type:"wheel",style:{backgroundColor:t.value.style.chart.backgroundColor,wheel:{color:"#CCCCCC"}}}},null,8,["config"]))],12,G))}},D=U._export_sfc(Y,[["__scopeId","data-v-1ea442b0"]]);exports.default=D;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),c=require("./index-BcLWKvbg.cjs"),q=require("./Title-D9E4eBNp.cjs"),P=require("./usePrinter-BWCvrSz2.cjs"),B=require("./useResponsive-B3TrDDIG.cjs"),T=require("./vue-ui-skeleton-BG428rdQ.cjs"),S=require("./useNestedProp-BcuQPNiW.cjs"),U=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),G=["id"],L=["xmlns","viewBox"],R=["x1","x2","y1","y2","stroke","stroke-width","stroke-linecap"],X=["cx","cy","r","stroke","stroke-width"],j=["x","y","font-size","fill","font-weight"],H={key:3,class:"vue-data-ui-watermark"},Y={__name:"vue-ui-wheel",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(I,{expose:F}){const o=I,{vue_ui_wheel:N}=c.useConfig(),f=e.computed(()=>!!o.dataset&&Object.keys(o.dataset).length),y=e.ref(c.createUid()),z=e.ref(null),g=e.ref(0),d=e.ref(null),p=e.ref(null),t=e.computed(()=>{const l=S.useNestedProp({userConfig:o.config,defaultConfig:N});return l.theme?{...S.useNestedProp({userConfig:c.themes.vue_ui_wheel[l.theme]||o.config,defaultConfig:l})}:l}),{isPrinting:k,isImaging:w,generatePdf:C,generateImage:b}=P.usePrinter({elementId:y.value,fileName:t.value.style.chart.title.text||"vue-ui-wheel"}),n=e.ref({size:360,height:360,width:360}),m=e.ref(t.value.style.chart.layout.percentage.fontSize),r=e.computed(()=>({radius:Math.min(n.value.width,n.value.height)*.9/2,centerX:n.value.width/2,centerY:n.value.height/2}));function _(l,u=1){return{x:r.value.centerX+r.value.radius*Math.cos(29.85+l*Math.PI/180)*u,y:r.value.centerY+r.value.radius*Math.sin(29.85+l*Math.PI/180)*u}}const s=e.ref(t.value.style.chart.animation.use?0:o.dataset.percentage||0);e.watch(()=>o.dataset.percentage,()=>{s.value=e.ref(t.value.style.chart.animation.use?0:o.dataset.percentage||0),x()});const h=e.ref(null);e.onMounted(()=>{if(c.objectIsEmpty(o.dataset)&&c.error({componentName:"VueUiWheel",type:"dataset"}),x(),t.value.responsive){const l=B.throttle(()=>{const{width:u,height:a}=B.useResponsive({chart:d.value,title:t.value.style.chart.title.text?p.value:null});n.value.width=u,n.value.height=a,m.value=t.value.style.chart.layout.percentage.fontSize/360*Math.min(u,a)});h.value=new ResizeObserver(l),h.value.observe(d.value.parentNode)}}),e.onBeforeUnmount(()=>{h.value&&h.value.disconnect()});function x(){let l=0,u=t.value.style.chart.animation.speed,a=.005*t.value.style.chart.animation.acceleration;function i(){s.value+=u+l,l+=a,s.value<(o.dataset.percentage||0)?requestAnimationFrame(i):s.value=o.dataset.percentage||0}t.value.style.chart.animation.use&&(s.value=0,i())}const $=e.computed(()=>{const l=[];for(let a=0;a<100;a+=1){const i=s.value>a?t.value.style.chart.layout.wheel.ticks.activeColor:t.value.style.chart.layout.wheel.ticks.inactiveColor,{x:E,y:V}=_(n.value.size/100*a),{x:A,y:M}=_(n.value.size/100*a,.9);l.push({x1:E,y1:V,x2:A,y2:M,color:t.value.style.chart.layout.wheel.ticks.gradient.show?c.shiftHue(i,a/100*(t.value.style.chart.layout.wheel.ticks.gradient.shiftHueIntensity/100)):i})}return l}),v=e.ref(!1);function O(l){v.value=l,g.value+=1}return F({generatePdf:C,generateImage:b}),(l,u)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-wheel",ref_key:"wheelChart",ref:d,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.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:p,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:12px`)},[e.createVNode(q._sfc_main,{config:{title:{cy:"wheel-title",...t.value.style.chart.title},subtitle:{cy:"wheel-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&f.value?(e.openBlock(),e.createBlock(P.UserOptions,{ref_key:"details",ref:z,key:`user_options_${g.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(k),isImaging:e.unref(w),uid:y.value,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,hasXls:!1,isFullscreen:v.value,titles:{...t.value.userOptions.buttonTitles},chartElement:d.value,onToggleFullscreen:O,onGeneratePdf:e.unref(C),onGenerateImage:e.unref(b)},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:a,isFullscreen:i})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:i})),void 0,!0)]),key:"2"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(c.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":v.value,"vue-data-ui-fulscreen--off":!v.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:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.value,(a,i)=>(e.openBlock(),e.createElementBlock("line",{x1:a.x1,x2:a.x2,y1:a.y1,y2:a.y2,stroke:a.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&&i<=s.value})},null,10,R))),256)),t.value.style.chart.layout.innerCircle.show?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:r.value.centerX,cy:r.value.centerY,r:r.value.radius*.8<=0?1e-4:r.value.radius*.8,stroke:t.value.style.chart.layout.innerCircle.stroke,"stroke-width":t.value.style.chart.layout.innerCircle.strokeWidth,fill:"none"},null,8,X)):e.createCommentVNode("",!0),t.value.style.chart.layout.percentage.show?(e.openBlock(),e.createElementBlock("text",{key:1,x:r.value.centerX,y:r.value.centerY+m.value/3,"font-size":m.value,fill:t.value.style.chart.layout.wheel.ticks.gradient.show?e.unref(c.shiftHue)(t.value.style.chart.layout.wheel.ticks.activeColor,s.value/100*(t.value.style.chart.layout.wheel.ticks.gradient.shiftHueIntensity/100)):t.value.style.chart.layout.wheel.ticks.activeColor,"text-anchor":"middle","font-weight":t.value.style.chart.layout.percentage.bold?"bold":"normal",style:{"font-variant-numeric":"tabluar-nums"}},e.toDisplayString(Number(s.value.toFixed(t.value.style.chart.layout.percentage.rounding)).toLocaleString())+"% ",9,j)):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"svg",{svg:n.value},void 0,!0)],14,L)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",H,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(k)||e.unref(w)})),void 0,!0)])):e.createCommentVNode("",!0),f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(T.default,{key:4,config:{type:"wheel",style:{backgroundColor:t.value.style.chart.backgroundColor,wheel:{color:"#CCCCCC"}}}},null,8,["config"]))],12,G))}},D=U._export_sfc(Y,[["__scopeId","data-v-1ea442b0"]]);exports.default=D;
@@ -1,11 +1,11 @@
1
1
  import { computed as F, ref as r, onMounted as fe, onBeforeUnmount as ge, watch as pe, openBlock as c, createElementBlock as h, normalizeStyle as N, createVNode as R, createCommentVNode as y, createBlock as j, unref as m, createSlots as be, withCtx as v, renderSlot as f, normalizeProps as H, guardReactiveProps as q, normalizeClass as Y, createElementVNode as J, Fragment as ye, renderList as we, toDisplayString as K, createTextVNode as Ce, nextTick as Q } from "vue";
2
- import { u as ke, S as xe, c as Z, t as $e, a as _e, p as z, o as Te, e as ee, g as Pe, f as Fe, X as Ne, n as ze, q as Ie } from "./index-BvjCO-wv.js";
3
- import { _ as Se } from "./Title-Bx2ibobQ.js";
4
- import { u as Oe, U as Me } from "./usePrinter-CaKXrCiB.js";
2
+ import { u as ke, S as xe, c as Z, t as $e, a as _e, p as z, o as Te, e as ee, g as Pe, f as Fe, X as Ne, n as ze, q as Ie } from "./index-BbBCE1pM.js";
3
+ import { _ as Se } from "./Title-CMEhX9eJ.js";
4
+ import { u as Oe, U as Me } from "./usePrinter-CnT0_Cbi.js";
5
5
  import { t as De, u as We } from "./useResponsive-NZB-WLRF.js";
6
- import Ee from "./vue-ui-accordion-q-bLDiD3.js";
7
- import { D as Ae } from "./DataTable-DKHF_NH2.js";
8
- import { u as te } from "./useNestedProp-2KJaYPfM.js";
6
+ import Ee from "./vue-ui-accordion-CM8Lp-MV.js";
7
+ import { D as Ae } from "./DataTable-DVpbqbwp.js";
8
+ import { u as te } from "./useNestedProp-QJwLGaK5.js";
9
9
  import { _ as Ve } from "./_plugin-vue_export-helper-CHgC5LLL.js";
10
10
  const Be = ["id"], Ue = ["xmlns", "viewBox"], Ge = ["transform"], Le = ["fill", "font-weight", "x", "y", "font-size", "transform"], Xe = {
11
11
  key: 3,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-oufiZvaS.cjs"),Z=require("./Title-DxNugmhI.cjs"),M=require("./usePrinter-Cc8ufBvU.cjs"),D=require("./useResponsive-B3TrDDIG.cjs"),ee=require("./vue-ui-accordion-DiR0dVog.cjs"),te=require("./DataTable-CHXdpx94.cjs"),W=require("./useNestedProp-CmTItGss.cjs"),oe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),le=["id"],ae=["xmlns","viewBox"],ne=["transform"],se=["fill","font-weight","x","y","font-size","transform"],re={key:3,class:"vue-data-ui-watermark"},ue=["innerHTML"],ie={__name:"vue-ui-word-cloud",props:{config:{type:Object,default(){return{}}},dataset:{type:[Array,String],default(){return[]}}},setup(q,{expose:A}){const c=q,{vue_ui_word_cloud:U}=s.useConfig(),f=e.computed({get(){return!!c.dataset&&c.dataset.length},set(o){return o}}),x=e.ref(typeof c.dataset=="string"?s.createWordCloudDatasetFromPlainText(c.dataset):c.dataset),$=e.ref(s.createUid()),T=e.ref(0),g=e.ref(null),S=e.ref(null),t=e.computed(()=>{const o=W.useNestedProp({userConfig:c.config,defaultConfig:U});return o.theme?{...W.useNestedProp({userConfig:s.themes.vue_ui_word_cloud[o.theme]||c.config,defaultConfig:o}),customPalette:s.themePalettes[o.theme]||s.palette}:o}),r=e.ref({width:t.value.style.chart.width,height:t.value.style.chart.height,maxFontSize:t.value.style.chart.words.maxFontSize,minFontSize:t.value.style.chart.words.minFontSize}),p=e.ref(null);e.onMounted(()=>{if(s.objectIsEmpty(c.dataset)?s.error({componentName:"VueUiWordCloud",type:"dataset"}):x.value.forEach((o,a)=>{s.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name","value"]}).forEach(l=>{f.value=!1,s.error({componentName:"VueUiWordCloud",type:"datasetSerieAttribute",property:l,index:a})})}),t.value.responsive){const o=D.throttle(()=>{const{width:a,height:l}=D.useResponsive({chart:g.value,title:t.value.style.chart.title.text?S.value:null});r.value.width=a,r.value.height=l,e.nextTick(I)});p.value=new ResizeObserver(o),p.value.observe(g.value.parentNode)}}),e.onBeforeUnmount(()=>{p.value&&p.value.disconnect()});const{isPrinting:_,isImaging:z,generatePdf:F,generateImage:B}=M.usePrinter({elementId:`wordCloud_${$.value}`,fileName:t.value.style.chart.title.text||"vue-ui-word-cloud"}),y=e.ref({showTable:t.value.table.show});function G(o,a,l="Arial"){const n=document.createElement("canvas").getContext("2d");return n.font=`${a}px ${t.value.style.chart.words.bold?"bold":"normal"} ${l}`,{width:n.measureText(o).width+t.value.style.chart.words.proximity,height:a}}function L(o,a){return o.x<a.x+a.width&&o.x+o.width>a.x&&o.y<a.y+a.height&&o.y+o.height>a.y}function R(o,a,l){const u=[],n={x:-a/2,y:-l/2,width:a,height:l},i=0,v=0;return o.forEach(h=>{let P=!1;for(let w=0;w<Math.max(a,l)/2&&!P;w+=t.value.style.chart.words.packingWeight)for(let N=0;N<360&&!P;N+=t.value.style.chart.words.packingWeight){const V=N*Math.PI/180,H=i+w*Math.cos(V)-h.width/2,Y=v+w*Math.sin(V)-h.height/2,d={...h,x:H,y:Y},J=d.x>=n.x&&d.y>=n.y&&d.x+d.width<=n.x+n.width&&d.y+d.height<=n.y+n.height,K=u.some(Q=>L(d,Q));J&&!K&&(u.push(d),P=!0)}}),u}const m=e.ref([]);e.watch(()=>c.dataset,I,{immediate:!0});function I(){const o=x.value.map(n=>n.value),a=Math.max(...o),l=Math.min(...o),u=x.value.map((n,i)=>{const v=(n.value-l)/(a-l)*(r.value.maxFontSize-r.value.minFontSize)+r.value.minFontSize,h=G(n.name,v);return{...n,id:s.createUid(),fontSize:v,width:h.width,height:h.height,color:t.value.style.chart.words.usePalette?t.value.customPalette[i]||t.value.customPalette[i%t.value.customPalette.length]||s.palette[i]||s.palette[i%s.palette.length]:t.value.style.chart.words.color}});m.value=R(u,r.value.width,r.value.height).sort((n,i)=>i.fontSize-n.fontSize)}const b=e.computed(()=>{const o=m.value.map(l=>({name:l.name,color:l.color})),a=m.value.map(l=>l.value);return{head:o,body:a}});function E(){e.nextTick(()=>{const o=b.value.head.map((u,n)=>[[u.name],[b.value.body[n]]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],[t.value.table.columnNames.value]]].concat(o),l=s.createCsvContent(a);s.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-word-cloud"})})}const C=e.computed(()=>{const o=[t.value.table.columnNames.series,t.value.table.columnNames.value],a=b.value.head.map((n,i)=>{const v=s.dataLabel({p:t.value.table.td.prefix,v:b.value.body[i],s:t.value.table.td.suffix,r:t.value.table.td.roundingValue});return[{color:n.color,name:n.name},v]}),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}}),k=e.ref(!1);function X(o){k.value=o,T.value+=1}function j(){return m.value}function O(){y.value.showTable=!y.value.showTable}return A({getData:j,generateCsv:E,generatePdf:F,generateImage:B,toggleTable:O}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-word-cloud",ref_key:"wordCloudChart",ref:g,id:`wordCloud_${$.value}`,style:e.normalizeStyle(`width: 100%; font-family:${t.value.style.fontFamily};background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height:100%":""}`)},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:S,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:24px`)},[e.createVNode(Z._sfc_main,{config:{title:{...t.value.style.chart.title},subtitle:{...t.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&f.value?(e.openBlock(),e.createBlock(M.UserOptions,{ref:"details",key:`user_option_${T.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(_),isImaging:e.unref(z),uid:$.value,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:k.value,titles:{...t.value.userOptions.buttonTitles},chartElement:g.value,onToggleFullscreen:X,onGeneratePdf:e.unref(F),onGenerateCsv:E,onGenerateImage:e.unref(B),onToggleTable:O},e.createSlots({_:2},[o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:u})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:u})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createElementBlock("svg",{key:2,class:e.normalizeClass({"vue-data-ui-fullscreen--on":k.value,"vue-data-ui-fulscreen--off":!k.value}),xmlns:e.unref(s.XMLNS),viewBox:`0 0 ${r.value.width<=0?10:r.value.width} ${r.value.height<=0?10:r.value.height}`,style:e.normalizeStyle(`overflow:visible;background:${t.value.style.chart.backgroundColor};`)},[e.createElementVNode("g",{transform:`translate(${(r.value.width<=0?10:r.value.width)/2}, ${(r.value.height<=0?10:r.value.height)/2})`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,u)=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(),e.createElementBlock("text",{fill:l.color,"font-weight":t.value.style.chart.words.bold?"bold":"normal",key:u,x:l.x,y:l.y,"font-size":l.fontSize,transform:`translate(${l.width/2}, ${l.height/2})`,style:e.normalizeStyle(`animation-delay:${u*t.value.animationDelayMs}ms !important`),class:e.normalizeClass({animated:t.value.useCssAnimation}),"text-anchor":"middle","dominant-baseline":"middle"},e.toDisplayString(l.name),15,se))]))),256))],8,ne),e.renderSlot(o.$slots,"svg",{svg:{height:r.value.height,width:r.value.width}},void 0,!0)],14,ae)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",re,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(_)||e.unref(z)})),void 0,!0)])):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createBlock(ee.default,{key:4,hideDetails:"",config:{open:y.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(te.DataTable,{colNames:C.value.colNames,head:C.value.head,body:C.value.body,config:C.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[0]||(a[0]=l=>y.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,ue)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l.name||l),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],12,le))}},ce=oe._export_sfc(ie,[["__scopeId","data-v-682aa7fb"]]);exports.default=ce;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-BcLWKvbg.cjs"),Z=require("./Title-D9E4eBNp.cjs"),M=require("./usePrinter-BWCvrSz2.cjs"),D=require("./useResponsive-B3TrDDIG.cjs"),ee=require("./vue-ui-accordion-BOEIWXgn.cjs"),te=require("./DataTable-Ckvkqg78.cjs"),W=require("./useNestedProp-BcuQPNiW.cjs"),oe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),le=["id"],ae=["xmlns","viewBox"],ne=["transform"],se=["fill","font-weight","x","y","font-size","transform"],re={key:3,class:"vue-data-ui-watermark"},ue=["innerHTML"],ie={__name:"vue-ui-word-cloud",props:{config:{type:Object,default(){return{}}},dataset:{type:[Array,String],default(){return[]}}},setup(q,{expose:A}){const c=q,{vue_ui_word_cloud:U}=s.useConfig(),f=e.computed({get(){return!!c.dataset&&c.dataset.length},set(o){return o}}),x=e.ref(typeof c.dataset=="string"?s.createWordCloudDatasetFromPlainText(c.dataset):c.dataset),$=e.ref(s.createUid()),T=e.ref(0),g=e.ref(null),S=e.ref(null),t=e.computed(()=>{const o=W.useNestedProp({userConfig:c.config,defaultConfig:U});return o.theme?{...W.useNestedProp({userConfig:s.themes.vue_ui_word_cloud[o.theme]||c.config,defaultConfig:o}),customPalette:s.themePalettes[o.theme]||s.palette}:o}),r=e.ref({width:t.value.style.chart.width,height:t.value.style.chart.height,maxFontSize:t.value.style.chart.words.maxFontSize,minFontSize:t.value.style.chart.words.minFontSize}),p=e.ref(null);e.onMounted(()=>{if(s.objectIsEmpty(c.dataset)?s.error({componentName:"VueUiWordCloud",type:"dataset"}):x.value.forEach((o,a)=>{s.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name","value"]}).forEach(l=>{f.value=!1,s.error({componentName:"VueUiWordCloud",type:"datasetSerieAttribute",property:l,index:a})})}),t.value.responsive){const o=D.throttle(()=>{const{width:a,height:l}=D.useResponsive({chart:g.value,title:t.value.style.chart.title.text?S.value:null});r.value.width=a,r.value.height=l,e.nextTick(I)});p.value=new ResizeObserver(o),p.value.observe(g.value.parentNode)}}),e.onBeforeUnmount(()=>{p.value&&p.value.disconnect()});const{isPrinting:_,isImaging:z,generatePdf:F,generateImage:B}=M.usePrinter({elementId:`wordCloud_${$.value}`,fileName:t.value.style.chart.title.text||"vue-ui-word-cloud"}),y=e.ref({showTable:t.value.table.show});function G(o,a,l="Arial"){const n=document.createElement("canvas").getContext("2d");return n.font=`${a}px ${t.value.style.chart.words.bold?"bold":"normal"} ${l}`,{width:n.measureText(o).width+t.value.style.chart.words.proximity,height:a}}function L(o,a){return o.x<a.x+a.width&&o.x+o.width>a.x&&o.y<a.y+a.height&&o.y+o.height>a.y}function R(o,a,l){const u=[],n={x:-a/2,y:-l/2,width:a,height:l},i=0,v=0;return o.forEach(h=>{let P=!1;for(let w=0;w<Math.max(a,l)/2&&!P;w+=t.value.style.chart.words.packingWeight)for(let N=0;N<360&&!P;N+=t.value.style.chart.words.packingWeight){const V=N*Math.PI/180,H=i+w*Math.cos(V)-h.width/2,Y=v+w*Math.sin(V)-h.height/2,d={...h,x:H,y:Y},J=d.x>=n.x&&d.y>=n.y&&d.x+d.width<=n.x+n.width&&d.y+d.height<=n.y+n.height,K=u.some(Q=>L(d,Q));J&&!K&&(u.push(d),P=!0)}}),u}const m=e.ref([]);e.watch(()=>c.dataset,I,{immediate:!0});function I(){const o=x.value.map(n=>n.value),a=Math.max(...o),l=Math.min(...o),u=x.value.map((n,i)=>{const v=(n.value-l)/(a-l)*(r.value.maxFontSize-r.value.minFontSize)+r.value.minFontSize,h=G(n.name,v);return{...n,id:s.createUid(),fontSize:v,width:h.width,height:h.height,color:t.value.style.chart.words.usePalette?t.value.customPalette[i]||t.value.customPalette[i%t.value.customPalette.length]||s.palette[i]||s.palette[i%s.palette.length]:t.value.style.chart.words.color}});m.value=R(u,r.value.width,r.value.height).sort((n,i)=>i.fontSize-n.fontSize)}const b=e.computed(()=>{const o=m.value.map(l=>({name:l.name,color:l.color})),a=m.value.map(l=>l.value);return{head:o,body:a}});function E(){e.nextTick(()=>{const o=b.value.head.map((u,n)=>[[u.name],[b.value.body[n]]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],[t.value.table.columnNames.value]]].concat(o),l=s.createCsvContent(a);s.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-word-cloud"})})}const C=e.computed(()=>{const o=[t.value.table.columnNames.series,t.value.table.columnNames.value],a=b.value.head.map((n,i)=>{const v=s.dataLabel({p:t.value.table.td.prefix,v:b.value.body[i],s:t.value.table.td.suffix,r:t.value.table.td.roundingValue});return[{color:n.color,name:n.name},v]}),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}}),k=e.ref(!1);function X(o){k.value=o,T.value+=1}function j(){return m.value}function O(){y.value.showTable=!y.value.showTable}return A({getData:j,generateCsv:E,generatePdf:F,generateImage:B,toggleTable:O}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-word-cloud",ref_key:"wordCloudChart",ref:g,id:`wordCloud_${$.value}`,style:e.normalizeStyle(`width: 100%; font-family:${t.value.style.fontFamily};background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height:100%":""}`)},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:S,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:24px`)},[e.createVNode(Z._sfc_main,{config:{title:{...t.value.style.chart.title},subtitle:{...t.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&f.value?(e.openBlock(),e.createBlock(M.UserOptions,{ref:"details",key:`user_option_${T.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(_),isImaging:e.unref(z),uid:$.value,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:k.value,titles:{...t.value.userOptions.buttonTitles},chartElement:g.value,onToggleFullscreen:X,onGeneratePdf:e.unref(F),onGenerateCsv:E,onGenerateImage:e.unref(B),onToggleTable:O},e.createSlots({_:2},[o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:u})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:u})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createElementBlock("svg",{key:2,class:e.normalizeClass({"vue-data-ui-fullscreen--on":k.value,"vue-data-ui-fulscreen--off":!k.value}),xmlns:e.unref(s.XMLNS),viewBox:`0 0 ${r.value.width<=0?10:r.value.width} ${r.value.height<=0?10:r.value.height}`,style:e.normalizeStyle(`overflow:visible;background:${t.value.style.chart.backgroundColor};`)},[e.createElementVNode("g",{transform:`translate(${(r.value.width<=0?10:r.value.width)/2}, ${(r.value.height<=0?10:r.value.height)/2})`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,u)=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(),e.createElementBlock("text",{fill:l.color,"font-weight":t.value.style.chart.words.bold?"bold":"normal",key:u,x:l.x,y:l.y,"font-size":l.fontSize,transform:`translate(${l.width/2}, ${l.height/2})`,style:e.normalizeStyle(`animation-delay:${u*t.value.animationDelayMs}ms !important`),class:e.normalizeClass({animated:t.value.useCssAnimation}),"text-anchor":"middle","dominant-baseline":"middle"},e.toDisplayString(l.name),15,se))]))),256))],8,ne),e.renderSlot(o.$slots,"svg",{svg:{height:r.value.height,width:r.value.width}},void 0,!0)],14,ae)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",re,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(_)||e.unref(z)})),void 0,!0)])):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createBlock(ee.default,{key:4,hideDetails:"",config:{open:y.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(te.DataTable,{colNames:C.value.colNames,head:C.value.head,body:C.value.body,config:C.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[0]||(a[0]=l=>y.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,ue)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l.name||l),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],12,le))}},ce=oe._export_sfc(ie,[["__scopeId","data-v-682aa7fb"]]);exports.default=ce;
@@ -1,16 +1,16 @@
1
1
  import { p as Z } from "./pdf-97UbtKC2.js";
2
- import { U as J, s as K } from "./usePrinter-CaKXrCiB.js";
3
- import { c as U, a as Q, t as j, r as $, p as ee, u as te, O as X, I as M, E as le, T as ae, z as re, U as ie, L as se, V as oe, x as ne, s as ce, d as he, y as ue, b as de, q as ge, n as fe, C as be, R as Ie, W as me, f as Ne, v as _e, w as Fe, e as xe, o as ye, Y as Ae, B as Se } from "./index-BvjCO-wv.js";
4
- import { D as Le } from "./DataTable-DKHF_NH2.js";
5
- import { _ as Ce } from "./Title-Bx2ibobQ.js";
6
- import { _ as ke, u as we } from "./Tooltip-DOEMrisX.js";
7
- import { _ as Oe } from "./Shape-Ccky9omb.js";
8
- import ve from "./BaseIcon-DuMfKUDs.js";
9
- import Ge from "./vue-ui-table-sparkline-B-qJP3Yr.js";
10
- import ze from "./vue-ui-skeleton-jYHncdu5.js";
11
- import { S as pe } from "./Slicer-BDsv196Y.js";
12
- import Te from "./vue-ui-accordion-q-bLDiD3.js";
13
- import { u as q } from "./useNestedProp-2KJaYPfM.js";
2
+ import { U as J, s as K } from "./usePrinter-CnT0_Cbi.js";
3
+ import { c as U, a as Q, t as j, r as $, p as ee, u as te, O as X, I as M, E as le, T as ae, z as re, U as ie, L as se, V as oe, x as ne, s as ce, d as he, y as ue, b as de, q as ge, n as fe, C as be, R as Ie, W as me, f as Ne, v as _e, w as Fe, e as xe, o as ye, Y as Ae, B as Se } from "./index-BbBCE1pM.js";
4
+ import { D as Le } from "./DataTable-DVpbqbwp.js";
5
+ import { _ as Ce } from "./Title-CMEhX9eJ.js";
6
+ import { _ as ke, u as we } from "./Tooltip-B2XPbRE_.js";
7
+ import { _ as Oe } from "./Shape-_K1DD00e.js";
8
+ import ve from "./BaseIcon-y4nt-SIh.js";
9
+ import Ge from "./vue-ui-table-sparkline-pqkWVgDE.js";
10
+ import ze from "./vue-ui-skeleton-BYBsAUyH.js";
11
+ import { S as pe } from "./Slicer-BL7ysGrk.js";
12
+ import Te from "./vue-ui-accordion-CM8Lp-MV.js";
13
+ import { u as q } from "./useNestedProp-QJwLGaK5.js";
14
14
  import { resolveComponent as P, openBlock as r, createElementBlock as i, normalizeClass as T, normalizeStyle as S, createVNode as E, createCommentVNode as c, createBlock as V, createSlots as Me, withCtx as z, renderSlot as v, normalizeProps as Y, guardReactiveProps as W, createElementVNode as d, Fragment as I, renderList as m, toDisplayString as C, withDirectives as Pe, vModelCheckbox as Ve, createTextVNode as Re } from "vue";
15
15
  import { _ as De } from "./_plugin-vue_export-helper-CHgC5LLL.js";
16
16
  const He = U(), Be = {