vue-data-ui 2.3.48 → 2.3.49

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 (144) hide show
  1. package/dist/{Arrow-Zxlib5TA.js → Arrow-Bo8pfwKs.js} +1 -1
  2. package/dist/{Arrow-DVDUyObR.cjs → Arrow-iqIdxIKZ.cjs} +1 -1
  3. package/dist/{BaseIcon-B_4EdVx8.js → BaseIcon-BoVYVkUT.js} +1 -1
  4. package/dist/{BaseIcon-DQUa2wbN.cjs → BaseIcon-DuVD-1qH.cjs} +1 -1
  5. package/dist/{DataTable-pfsiGYAz.cjs → DataTable-CMF1l-gL.cjs} +1 -1
  6. package/dist/{DataTable-97z7jeB3.js → DataTable-Dy0vFXS7.js} +2 -2
  7. package/dist/{Legend-Dc30ZC8U.js → Legend-BbSR193q.js} +1 -1
  8. package/dist/{Legend-lleMcfy9.cjs → Legend-C3LgyVKP.cjs} +1 -1
  9. package/dist/{Shape-Cjf9rDFw.js → Shape-B5VTXCQH.js} +1 -1
  10. package/dist/{Shape-BtSgIgD_.cjs → Shape-BNlNwrBB.cjs} +1 -1
  11. package/dist/Slicer-CIqhDVuv.cjs +1 -0
  12. package/dist/{Slicer-dehuss8u.js → Slicer-D62jXLRQ.js} +53 -49
  13. package/dist/{Title-DZ-9X7T_.js → Title-0px6u9U5.js} +1 -1
  14. package/dist/{Title-CUtmTGbN.cjs → Title-CSRD5z1r.cjs} +1 -1
  15. package/dist/{Tooltip-DhxfsNhL.cjs → Tooltip-DFpYO4rz.cjs} +1 -1
  16. package/dist/{Tooltip-BE1vKyP4.js → Tooltip-TTopnCsK.js} +1 -1
  17. package/dist/{index-CAkeI2u7.js → index-8Lp8V0TB.js} +2 -1
  18. package/dist/index-De6Dj52h.cjs +4 -0
  19. package/dist/style.css +1 -1
  20. package/dist/types/vue-data-ui.d.cts +1 -0
  21. package/dist/types/vue-data-ui.d.ts +1 -0
  22. package/dist/{useNestedProp-N72tOTWX.js → useNestedProp-DE-a5lMx.js} +1 -1
  23. package/dist/{useNestedProp-DM4rgjhE.cjs → useNestedProp-Vjg1xsU_.cjs} +1 -1
  24. package/dist/{usePrinter-DbJ9I2vE.cjs → usePrinter-SLYneJmG.cjs} +1 -1
  25. package/dist/{usePrinter-MbSdbzew.js → usePrinter-cCBJ71Cc.js} +1 -1
  26. package/dist/{vue-data-ui-BQHuRwzO.cjs → vue-data-ui-B1ngLIqD.cjs} +1 -1
  27. package/dist/{vue-data-ui-BtPs_riR.js → vue-data-ui-pmpX1nQY.js} +57 -57
  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-DXIhL0TF.cjs → vue-ui-3d-bar-8yOSr9F5.cjs} +1 -1
  31. package/dist/{vue-ui-3d-bar-CLfyDLPQ.js → vue-ui-3d-bar-DcoFVkRG.js} +7 -7
  32. package/dist/{vue-ui-accordion-BbsnFhS8.js → vue-ui-accordion-BQfLl7n5.js} +3 -3
  33. package/dist/{vue-ui-accordion-Bs0EHuxc.cjs → vue-ui-accordion-CiSEQOBc.cjs} +1 -1
  34. package/dist/{vue-ui-age-pyramid-DpsPcpxc.cjs → vue-ui-age-pyramid-BRr6sDTU.cjs} +1 -1
  35. package/dist/{vue-ui-age-pyramid-B4ZZuW-3.js → vue-ui-age-pyramid-Cyzoxsd_.js} +8 -8
  36. package/dist/{vue-ui-annotator-B6tm7G-3.cjs → vue-ui-annotator-60JYTNTN.cjs} +1 -1
  37. package/dist/{vue-ui-annotator-BhE_ZF6c.js → vue-ui-annotator-DkkEj4IE.js} +1 -1
  38. package/dist/{vue-ui-candlestick-C4uPOJHQ.js → vue-ui-candlestick-CDLGf1AM.js} +9 -9
  39. package/dist/{vue-ui-candlestick-DWF0o42E.cjs → vue-ui-candlestick-D7IRuRY-.cjs} +1 -1
  40. package/dist/{vue-ui-carousel-table-CuK3NH57.js → vue-ui-carousel-table-CGqR-L66.js} +4 -4
  41. package/dist/{vue-ui-carousel-table-BOx_7UQr.cjs → vue-ui-carousel-table-dITvFJuB.cjs} +1 -1
  42. package/dist/{vue-ui-chestnut-C7w4B_ur.js → vue-ui-chestnut-BGLp2adQ.js} +6 -6
  43. package/dist/{vue-ui-chestnut-wEen0cKE.cjs → vue-ui-chestnut-x6ysM7Re.cjs} +1 -1
  44. package/dist/{vue-ui-cursor-Yv8kl6qP.cjs → vue-ui-cursor-C5gPJbwq.cjs} +1 -1
  45. package/dist/{vue-ui-cursor-Ctgm3n3f.js → vue-ui-cursor-X_1-s3ik.js} +2 -2
  46. package/dist/{vue-ui-dashboard-DPpvlOhB.cjs → vue-ui-dashboard-Cgtk8oJP.cjs} +1 -1
  47. package/dist/{vue-ui-dashboard-2lnPhwSk.js → vue-ui-dashboard-zfHS3YDI.js} +2 -2
  48. package/dist/{vue-ui-digits-BaQVgAB3.js → vue-ui-digits-C6o6diGb.js} +2 -2
  49. package/dist/{vue-ui-digits-CDsLYZQx.cjs → vue-ui-digits-DJL1XNX-.cjs} +1 -1
  50. package/dist/{vue-ui-donut-BJvvOCw4.cjs → vue-ui-donut-BwdyNBGR.cjs} +1 -1
  51. package/dist/{vue-ui-donut-Bkhnx2Na.js → vue-ui-donut-Do84LyRn.js} +9 -9
  52. package/dist/{vue-ui-donut-evolution-R7XCcHKT.cjs → vue-ui-donut-evolution-CIjVTIAJ.cjs} +1 -1
  53. package/dist/{vue-ui-donut-evolution-ASmhsxgl.js → vue-ui-donut-evolution-DQnRpcIw.js} +9 -9
  54. package/dist/{vue-ui-dumbbell-Bnx1whQL.js → vue-ui-dumbbell-B71pIx5Z.js} +8 -8
  55. package/dist/{vue-ui-dumbbell-DOf__qbw.cjs → vue-ui-dumbbell-D_Bvl_1q.cjs} +1 -1
  56. package/dist/{vue-ui-flow-Cpt4rGww.js → vue-ui-flow-BFXzVNCo.js} +7 -7
  57. package/dist/{vue-ui-flow-DESqaa_D.cjs → vue-ui-flow-DpFcTi7P.cjs} +1 -1
  58. package/dist/{vue-ui-galaxy-lyWd6uQ2.cjs → vue-ui-galaxy-CI546a3O.cjs} +1 -1
  59. package/dist/{vue-ui-galaxy-yll2l5no.js → vue-ui-galaxy-DC0LoWFu.js} +9 -9
  60. package/dist/{vue-ui-gauge-_imuFpna.cjs → vue-ui-gauge-COVSZG36.cjs} +1 -1
  61. package/dist/{vue-ui-gauge-DvErHglc.js → vue-ui-gauge-Chz7KDBu.js} +5 -5
  62. package/dist/{vue-ui-gizmo-BoTTd12O.cjs → vue-ui-gizmo-DuSQv_6q.cjs} +1 -1
  63. package/dist/{vue-ui-gizmo-CcJZ1BaJ.js → vue-ui-gizmo-ydAuESKo.js} +2 -2
  64. package/dist/{vue-ui-heatmap-DJ1FMowz.js → vue-ui-heatmap-Ba_jzJB2.js} +8 -8
  65. package/dist/{vue-ui-heatmap-BfVdowyK.cjs → vue-ui-heatmap-CdpBaTry.cjs} +1 -1
  66. package/dist/{vue-ui-kpi-tyv7wQWA.js → vue-ui-kpi-C5yFYQ19.js} +3 -3
  67. package/dist/{vue-ui-kpi-BtOxRhb1.cjs → vue-ui-kpi-D2TypVZG.cjs} +1 -1
  68. package/dist/{vue-ui-mini-loader-BZSFz3n8.js → vue-ui-mini-loader-BD6Lu94h.js} +2 -2
  69. package/dist/{vue-ui-mini-loader-DAp6v1OO.cjs → vue-ui-mini-loader-DJXMipP5.cjs} +1 -1
  70. package/dist/{vue-ui-molecule-DRC62I9B.cjs → vue-ui-molecule-DCCCC-6a.cjs} +1 -1
  71. package/dist/{vue-ui-molecule-B_IidHvj.js → vue-ui-molecule-DCsLwmnF.js} +9 -9
  72. package/dist/{vue-ui-mood-radar-DTVywXlL.cjs → vue-ui-mood-radar-CX6Gq6UB.cjs} +1 -1
  73. package/dist/{vue-ui-mood-radar-BdYscbyC.js → vue-ui-mood-radar-D-FUCHS-.js} +9 -9
  74. package/dist/{vue-ui-nested-donuts-Bw0Iifx1.js → vue-ui-nested-donuts-CgRfdcJy.js} +9 -9
  75. package/dist/{vue-ui-nested-donuts-EPd_poHo.cjs → vue-ui-nested-donuts-DWuCVtg8.cjs} +1 -1
  76. package/dist/{vue-ui-onion-B9wG-dIS.js → vue-ui-onion-BWo7GrFe.js} +9 -9
  77. package/dist/{vue-ui-onion-4ULM84d3.cjs → vue-ui-onion-Dg-7GylY.cjs} +1 -1
  78. package/dist/{vue-ui-parallel-coordinate-plot-5T4gwxht.js → vue-ui-parallel-coordinate-plot-DSUZL2Sy.js} +10 -10
  79. package/dist/{vue-ui-parallel-coordinate-plot-BUfuDzc3.cjs → vue-ui-parallel-coordinate-plot-prF4TxQD.cjs} +1 -1
  80. package/dist/{vue-ui-quadrant-Dr5JjCka.cjs → vue-ui-quadrant-Ct06vgiw.cjs} +1 -1
  81. package/dist/{vue-ui-quadrant-C8Gob7gq.js → vue-ui-quadrant-DYApa1bj.js} +10 -10
  82. package/dist/{vue-ui-quick-chart-8GGtO2tf.cjs → vue-ui-quick-chart-CwIWb_LQ.cjs} +1 -1
  83. package/dist/{vue-ui-quick-chart-CFHyJ7rZ.js → vue-ui-quick-chart-DOHmWoHL.js} +6 -6
  84. package/dist/{vue-ui-radar-Dy5kHYce.cjs → vue-ui-radar-BJ23WOh7.cjs} +1 -1
  85. package/dist/{vue-ui-radar-Cr1Mb9Bx.js → vue-ui-radar-C4SFHmfz.js} +10 -10
  86. package/dist/{vue-ui-rating-ClL1a6MY.js → vue-ui-rating-BSFASHFc.js} +2 -2
  87. package/dist/{vue-ui-rating-BDKvG8bm.cjs → vue-ui-rating-BsRGR-VS.cjs} +1 -1
  88. package/dist/{vue-ui-relation-circle-Cq__UW9k.cjs → vue-ui-relation-circle-CEzXa3yt.cjs} +1 -1
  89. package/dist/{vue-ui-relation-circle-oVSySfff.js → vue-ui-relation-circle-Dg-99k9k.js} +5 -5
  90. package/dist/{vue-ui-rings-B7381qCZ.js → vue-ui-rings-CCcc9cFR.js} +9 -9
  91. package/dist/{vue-ui-rings-C8g7Xj86.cjs → vue-ui-rings-DiQhsWx_.cjs} +1 -1
  92. package/dist/{vue-ui-scatter-Bh2Mjbi3.js → vue-ui-scatter-BgsexKX4.js} +10 -10
  93. package/dist/{vue-ui-scatter-D_DPdRoK.cjs → vue-ui-scatter-D7z4c6k-.cjs} +1 -1
  94. package/dist/{vue-ui-screenshot-D46q2vBL.cjs → vue-ui-screenshot-Bj85MdEJ.cjs} +1 -1
  95. package/dist/{vue-ui-screenshot-Bl86uY0k.js → vue-ui-screenshot-viGaG1cU.js} +1 -1
  96. package/dist/{vue-ui-skeleton-CHI4nqtV.cjs → vue-ui-skeleton-Cl9Kp9yE.cjs} +1 -1
  97. package/dist/{vue-ui-skeleton-DtWvFTM9.js → vue-ui-skeleton-apODtH32.js} +2 -2
  98. package/dist/{vue-ui-smiley-BCsFzW-q.js → vue-ui-smiley-BUDu21nW.js} +2 -2
  99. package/dist/{vue-ui-smiley-CvpjObu1.cjs → vue-ui-smiley-CfDLeydH.cjs} +1 -1
  100. package/dist/{vue-ui-spark-trend-Cb1unGKY.js → vue-ui-spark-trend-B1bpQlNI.js} +4 -4
  101. package/dist/{vue-ui-spark-trend-BGEFwDpP.cjs → vue-ui-spark-trend-ZS_m-z6R.cjs} +1 -1
  102. package/dist/{vue-ui-sparkbar-K6DV0yr0.cjs → vue-ui-sparkbar-C8fgdM5i.cjs} +1 -1
  103. package/dist/{vue-ui-sparkbar-2-EGfoOE.js → vue-ui-sparkbar-CpwYwA2h.js} +3 -3
  104. package/dist/{vue-ui-sparkgauge-0uv6HhvN.cjs → vue-ui-sparkgauge-CGy4jbtz.cjs} +1 -1
  105. package/dist/{vue-ui-sparkgauge-DdQDS2KM.js → vue-ui-sparkgauge-DpDoOc6V.js} +3 -3
  106. package/dist/{vue-ui-sparkhistogram-DV6-Hmhz.cjs → vue-ui-sparkhistogram-CX35Cfkc.cjs} +1 -1
  107. package/dist/{vue-ui-sparkhistogram-CQOY13sM.js → vue-ui-sparkhistogram-CcEB0gwD.js} +4 -4
  108. package/dist/{vue-ui-sparkline-Cnu3UnAn.js → vue-ui-sparkline-Bk4kWGco.js} +3 -3
  109. package/dist/{vue-ui-sparkline-oYEzsMF2.cjs → vue-ui-sparkline-CdPAtBR8.cjs} +1 -1
  110. package/dist/{vue-ui-sparkstackbar-vJoAUAZJ.cjs → vue-ui-sparkstackbar-6xwj9rme.cjs} +1 -1
  111. package/dist/{vue-ui-sparkstackbar-CoHqnRmF.js → vue-ui-sparkstackbar-B7Pvvmo_.js} +3 -3
  112. package/dist/{vue-ui-stackbar-BKiUGEDc.cjs → vue-ui-stackbar-7xZmgZo4.cjs} +1 -1
  113. package/dist/{vue-ui-stackbar-BGNfdn6K.js → vue-ui-stackbar-BMhowvyb.js} +10 -10
  114. package/dist/{vue-ui-strip-plot-CPXr1Unl.js → vue-ui-strip-plot-CnLnX_zO.js} +9 -9
  115. package/dist/{vue-ui-strip-plot-DTvz7qPm.cjs → vue-ui-strip-plot-DOXU1HhU.cjs} +1 -1
  116. package/dist/{vue-ui-table-BkY3KOTh.js → vue-ui-table-CoIUKpaM.js} +1 -1
  117. package/dist/{vue-ui-table-XywHpa9F.cjs → vue-ui-table-Ly0OlueB.cjs} +1 -1
  118. package/dist/{vue-ui-table-heatmap-Ft_4H5TG.js → vue-ui-table-heatmap-CtVr--3k.js} +4 -4
  119. package/dist/{vue-ui-table-heatmap-CiRaCqLh.cjs → vue-ui-table-heatmap-cLUGY_I8.cjs} +1 -1
  120. package/dist/{vue-ui-table-sparkline-CXD6RQwT.js → vue-ui-table-sparkline-Ct4n3vjB.js} +5 -5
  121. package/dist/{vue-ui-table-sparkline-c_fn53DV.cjs → vue-ui-table-sparkline-i_FQjHJt.cjs} +1 -1
  122. package/dist/{vue-ui-thermometer-DPv-QZyR.js → vue-ui-thermometer-CELrItTb.js} +5 -5
  123. package/dist/{vue-ui-thermometer-Cm-phIMA.cjs → vue-ui-thermometer-vrEGhPDN.cjs} +1 -1
  124. package/dist/{vue-ui-timer-B_e8jeFu.js → vue-ui-timer-BKhOVqdo.js} +4 -4
  125. package/dist/{vue-ui-timer-B-1okA9J.cjs → vue-ui-timer-C5oaCNfC.cjs} +1 -1
  126. package/dist/{vue-ui-tiremarks-n429npvo.cjs → vue-ui-tiremarks-CSbL6U73.cjs} +1 -1
  127. package/dist/{vue-ui-tiremarks-BTx3UPF6.js → vue-ui-tiremarks-p6l5H8Xo.js} +5 -5
  128. package/dist/{vue-ui-treemap-C6dlrtc-.cjs → vue-ui-treemap-BwegaYVE.cjs} +1 -1
  129. package/dist/{vue-ui-treemap-Df7c03TV.js → vue-ui-treemap-C4DTISo2.js} +9 -9
  130. package/dist/{vue-ui-vertical-bar-D04Qa1Ve.cjs → vue-ui-vertical-bar-B3GbC7E_.cjs} +1 -1
  131. package/dist/{vue-ui-vertical-bar-bipz8aIc.js → vue-ui-vertical-bar-C8dwl1ez.js} +9 -9
  132. package/dist/{vue-ui-waffle-Dc-Drk3w.js → vue-ui-waffle-BjXgV05U.js} +9 -9
  133. package/dist/{vue-ui-waffle-1JK9OthJ.cjs → vue-ui-waffle-DfhoqEtv.cjs} +1 -1
  134. package/dist/{vue-ui-wheel-CTD6Bxrd.js → vue-ui-wheel-BpGLo5wJ.js} +5 -5
  135. package/dist/{vue-ui-wheel-w2xLqgyW.cjs → vue-ui-wheel-CtUEp9En.cjs} +1 -1
  136. package/dist/{vue-ui-word-cloud-DxIS-nBr.cjs → vue-ui-word-cloud-BSmOL5UE.cjs} +1 -1
  137. package/dist/{vue-ui-word-cloud-DO8E-MmK.js → vue-ui-word-cloud-DNBF-X9H.js} +7 -7
  138. package/dist/{vue-ui-xy-y3ThqwCN.cjs → vue-ui-xy-ClD6S1Ok.cjs} +2 -2
  139. package/dist/{vue-ui-xy-CM5MM7qx.js → vue-ui-xy-W_Zawlkz.js} +137 -136
  140. package/dist/{vue-ui-xy-canvas-Dg1-pLp8.cjs → vue-ui-xy-canvas-BZTwibcy.cjs} +1 -1
  141. package/dist/{vue-ui-xy-canvas-Any2UpuS.js → vue-ui-xy-canvas-DELc-ZEx.js} +10 -10
  142. package/package.json +1 -1
  143. package/dist/Slicer-CanBZJ4V.cjs +0 -1
  144. package/dist/index-DGxA8bUJ.cjs +0 -4
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),E=require("./useNestedProp-DM4rgjhE.cjs"),v=require("./index-DGxA8bUJ.cjs"),T=require("./Title-CUtmTGbN.cjs"),O=require("./usePrinter-DbJ9I2vE.cjs"),j=require("./vue-ui-skeleton-CHI4nqtV.cjs"),U=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),H=["id"],M=["xmlns","viewBox"],D={key:0},X=["d","stroke-width","stroke"],R={key:1},Y=["x1","y1","x2","y2","stroke-width","stroke"],J=["x","y","font-size","fill","font-weight","text-anchor"],K={key:3,class:"vue-data-ui-watermark"},Q={__name:"vue-ui-tiremarks",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(A,{expose:V}){const u=A,{vue_ui_tiremarks:q}=v.useConfig(),x=e.computed(()=>!!u.dataset&&Object.keys(u.dataset).length),$=e.ref(v.createUid()),w=e.ref(null),P=e.ref(0),t=e.computed(()=>{const a=E.useNestedProp({userConfig:u.config,defaultConfig:q});return a.theme?{...E.useNestedProp({userConfig:v.themes.vue_ui_tiremarks[a.theme]||u.config,defaultConfig:a})}:a}),{isPrinting:B,isImaging:z,generatePdf:S,generateImage:I}=O.usePrinter({elementId:$.value,fileName:t.value.style.chart.title.text||"vue-ui-tiremarks"}),i=e.ref(t.value.style.chart.animation.use?0:u.dataset.percentage);e.watch(()=>u.dataset.percentage,()=>{i.value=e.ref(t.value.style.chart.animation.use?0:u.dataset.percentage),F()}),e.onMounted(()=>{v.objectIsEmpty(u.dataset)&&v.error({componentName:"VueUiTiremarks",type:"dataset"}),F()});function F(){let a=0,s=t.value.style.chart.animation.speed,l=.005*t.value.style.chart.animation.acceleration;function r(){i.value+=s+a,a+=l,i.value<u.dataset.percentage?requestAnimationFrame(r):i.value=u.dataset.percentage}t.value.style.chart.animation.use&&(i.value=0,r())}const y=e.computed(()=>t.value.style.chart.layout.display==="vertical"),n=e.computed(()=>{const a={top:48,left:64,right:64,bottom:48};return y.value?{top:t.value.style.chart.percentage.verticalPosition==="top"?a.top:3,left:3,right:3,bottom:t.value.style.chart.percentage.verticalPosition==="bottom"?a.bottom:3}:{top:0,bottom:0,left:t.value.style.chart.percentage.horizontalPosition==="left"?a.left:3,right:t.value.style.chart.percentage.horizontalPosition==="right"?a.right:10}}),C=e.computed(()=>Object.values(n.value).reduce((a,s)=>a+s,0)),o=e.computed(()=>({height:y.value?312:56,width:y.value?56:312})),L=e.ref(100);e.computed(()=>u.dataset.percentage/L.value);const c=e.computed(()=>y.value?{mark:(o.value.height-C.value)/100*.5,space:(o.value.height-C.value)/100*.5}:{mark:(o.value.width-C.value)/100*.5,space:(o.value.width-C.value)/100*.5}),N=e.computed(()=>{const a=[];for(let l=0;l<100;l+=1){const r=t.value.style.chart.layout.ticks.gradient.show?v.shiftHue(t.value.style.chart.layout.activeColor,l/100*(t.value.style.chart.layout.ticks.gradient.shiftHueIntensity/100)):t.value.style.chart.layout.activeColor;if(y.value){const f=t.value.style.chart.layout.crescendo?(100-l)*(o.value.width-n.value.left-n.value.right)/100/3:0,d=n.value.left+4+f,h=o.value.width-n.value.right-4-f,m=o.value.height-n.value.bottom-l*c.value.mark-l*c.value.space-c.value.mark,g=o.value.height-n.value.bottom-l*c.value.mark-l*c.value.space-c.value.mark,k=(h-d)/t.value.style.chart.layout.curveAngleX,b=t.value.style.chart.layout.curveAngleY*((1+l)/100);a.push({x1:d,x2:h,y1:m,y2:g,curve:`M ${d} ${m} C ${d+k} ${m-b}, ${h-k} ${g-b}, ${h} ${g}`,color:r})}else{const f=t.value.style.chart.layout.crescendo?(100-l)*(o.value.height-n.value.top-n.value.bottom)/100/3:0,d=n.value.left+l*c.value.mark+l*c.value.space-c.value.mark,h=d,m=n.value.top+4+f,g=o.value.height-n.value.bottom-4-f,k=t.value.style.chart.layout.curveAngleY*((1+l)/100),b=(g-m)/t.value.style.chart.layout.curveAngleX;a.push({x1:d,x2:h,y1:m,y2:g,curve:`M ${d} ${m} C ${d+k} ${m+b}, ${h+k} ${g-b}, ${h} ${g}`,color:r})}}return a}),p=e.computed(()=>{let a,s,l;const r=t.value.style.chart.percentage.fontSize/3;return y.value?t.value.style.chart.percentage.verticalPosition==="top"?(a=o.value.width/2,s=n.value.top/2,l="middle"):t.value.style.chart.percentage.verticalPosition==="bottom"&&(a=o.value.width/2,s=o.value.height-n.value.bottom/2+r,l="middle"):t.value.style.chart.percentage.horizontalPosition==="left"?(a=4,s=o.value.height/2+r,l="start"):t.value.style.chart.percentage.horizontalPosition==="right"&&(a=o.value.width-n.value.right+8,s=o.value.height/2+r,l="start"),{x:a,y:s,textAnchor:l,bold:t.value.style.chart.percentage.bold,fontSize:t.value.style.chart.percentage.fontSize,fill:t.value.style.chart.percentage.color}}),_=e.ref(!1);function G(a){_.value=a,P.value+=1}return V({generatePdf:S,generateImage:I}),(a,s)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tiremarksChart",ref:w,class:e.normalizeClass(`vue-ui-tiremarks ${t.value.useCssAnimation?"":"vue-ui-dna"}`),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}`),id:$.value},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:12px`)},[e.createVNode(T._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&&x.value?(e.openBlock(),e.createBlock(O.UserOptions,{ref:"details",key:`user_options_${P.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(B),isImaging:e.unref(z),uid:$.value,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,hasXls:!1,isFullscreen:_.value,titles:{...t.value.userOptions.buttonTitles},chartElement:w.value,onToggleFullscreen:G,onGeneratePdf:e.unref(S),onGenerateImage:e.unref(I)},e.createSlots({_:2},[a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:r})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:r})),void 0,!0)]),key:"2"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),x.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(v.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":_.value,"vue-data-ui-fulscreen--off":!_.value}),viewBox:`0 0 ${o.value.width} ${o.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[t.value.style.chart.layout.curved?(e.openBlock(),e.createElementBlock("g",D,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{d:l.curve,"stroke-width":c.value.mark,stroke:i.value>=r?l.color:t.value.style.chart.layout.inactiveColor,"stroke-linecap":"round",fill:"none",class:e.normalizeClass({"vue-ui-tick-animated":t.value.style.chart.animation.use&&r<=i.value})},null,10,X))),256))])):(e.openBlock(),e.createElementBlock("g",R,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{x1:l.x1,y1:l.y1,x2:l.x2,y2:l.y2,"stroke-width":c.value.mark,stroke:i.value>=r?l.color:t.value.style.chart.layout.inactiveColor,"stroke-linecap":"round"},null,8,Y))),256))])),t.value.style.chart.percentage.show?(e.openBlock(),e.createElementBlock("text",{key:2,x:p.value.x,y:p.value.y,"font-size":p.value.fontSize,fill:t.value.style.chart.layout.ticks.gradient.show&&t.value.style.chart.percentage.useGradientColor?e.unref(v.shiftHue)(t.value.style.chart.layout.activeColor,i.value/100*(t.value.style.chart.layout.ticks.gradient.shiftHueIntensity/100)):t.value.style.chart.percentage.color,"font-weight":p.value.bold?"bold":"normal","text-anchor":p.value.textAnchor},e.toDisplayString(e.unref(v.applyDataLabel)(t.value.style.chart.percentage.formatter,i.value,e.unref(v.dataLabel)({v:i.value,s:"%",r:t.value.style.chart.percentage.rounding}))),9,J)):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"svg",{svg:o.value},void 0,!0)],14,M)):e.createCommentVNode("",!0),a.$slots.watermark?(e.openBlock(),e.createElementBlock("div",K,[e.renderSlot(a.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(B)||e.unref(z)})),void 0,!0)])):e.createCommentVNode("",!0),x.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(j.default,{key:4,config:{type:"tiremarks",style:{backgroundColor:t.value.style.chart.backgroundColor,tiremarks:{color:"#CCCCCC"}}}},null,8,["config"]))],14,H))}},W=U._export_sfc(Q,[["__scopeId","data-v-0cc3937c"]]);exports.default=W;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),E=require("./useNestedProp-Vjg1xsU_.cjs"),v=require("./index-De6Dj52h.cjs"),T=require("./Title-CSRD5z1r.cjs"),O=require("./usePrinter-SLYneJmG.cjs"),j=require("./vue-ui-skeleton-Cl9Kp9yE.cjs"),U=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),H=["id"],M=["xmlns","viewBox"],D={key:0},X=["d","stroke-width","stroke"],R={key:1},Y=["x1","y1","x2","y2","stroke-width","stroke"],J=["x","y","font-size","fill","font-weight","text-anchor"],K={key:3,class:"vue-data-ui-watermark"},Q={__name:"vue-ui-tiremarks",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(A,{expose:V}){const u=A,{vue_ui_tiremarks:q}=v.useConfig(),x=e.computed(()=>!!u.dataset&&Object.keys(u.dataset).length),$=e.ref(v.createUid()),w=e.ref(null),P=e.ref(0),t=e.computed(()=>{const a=E.useNestedProp({userConfig:u.config,defaultConfig:q});return a.theme?{...E.useNestedProp({userConfig:v.themes.vue_ui_tiremarks[a.theme]||u.config,defaultConfig:a})}:a}),{isPrinting:B,isImaging:z,generatePdf:S,generateImage:I}=O.usePrinter({elementId:$.value,fileName:t.value.style.chart.title.text||"vue-ui-tiremarks"}),i=e.ref(t.value.style.chart.animation.use?0:u.dataset.percentage);e.watch(()=>u.dataset.percentage,()=>{i.value=e.ref(t.value.style.chart.animation.use?0:u.dataset.percentage),F()}),e.onMounted(()=>{v.objectIsEmpty(u.dataset)&&v.error({componentName:"VueUiTiremarks",type:"dataset"}),F()});function F(){let a=0,s=t.value.style.chart.animation.speed,l=.005*t.value.style.chart.animation.acceleration;function r(){i.value+=s+a,a+=l,i.value<u.dataset.percentage?requestAnimationFrame(r):i.value=u.dataset.percentage}t.value.style.chart.animation.use&&(i.value=0,r())}const y=e.computed(()=>t.value.style.chart.layout.display==="vertical"),n=e.computed(()=>{const a={top:48,left:64,right:64,bottom:48};return y.value?{top:t.value.style.chart.percentage.verticalPosition==="top"?a.top:3,left:3,right:3,bottom:t.value.style.chart.percentage.verticalPosition==="bottom"?a.bottom:3}:{top:0,bottom:0,left:t.value.style.chart.percentage.horizontalPosition==="left"?a.left:3,right:t.value.style.chart.percentage.horizontalPosition==="right"?a.right:10}}),C=e.computed(()=>Object.values(n.value).reduce((a,s)=>a+s,0)),o=e.computed(()=>({height:y.value?312:56,width:y.value?56:312})),L=e.ref(100);e.computed(()=>u.dataset.percentage/L.value);const c=e.computed(()=>y.value?{mark:(o.value.height-C.value)/100*.5,space:(o.value.height-C.value)/100*.5}:{mark:(o.value.width-C.value)/100*.5,space:(o.value.width-C.value)/100*.5}),N=e.computed(()=>{const a=[];for(let l=0;l<100;l+=1){const r=t.value.style.chart.layout.ticks.gradient.show?v.shiftHue(t.value.style.chart.layout.activeColor,l/100*(t.value.style.chart.layout.ticks.gradient.shiftHueIntensity/100)):t.value.style.chart.layout.activeColor;if(y.value){const f=t.value.style.chart.layout.crescendo?(100-l)*(o.value.width-n.value.left-n.value.right)/100/3:0,d=n.value.left+4+f,h=o.value.width-n.value.right-4-f,m=o.value.height-n.value.bottom-l*c.value.mark-l*c.value.space-c.value.mark,g=o.value.height-n.value.bottom-l*c.value.mark-l*c.value.space-c.value.mark,k=(h-d)/t.value.style.chart.layout.curveAngleX,b=t.value.style.chart.layout.curveAngleY*((1+l)/100);a.push({x1:d,x2:h,y1:m,y2:g,curve:`M ${d} ${m} C ${d+k} ${m-b}, ${h-k} ${g-b}, ${h} ${g}`,color:r})}else{const f=t.value.style.chart.layout.crescendo?(100-l)*(o.value.height-n.value.top-n.value.bottom)/100/3:0,d=n.value.left+l*c.value.mark+l*c.value.space-c.value.mark,h=d,m=n.value.top+4+f,g=o.value.height-n.value.bottom-4-f,k=t.value.style.chart.layout.curveAngleY*((1+l)/100),b=(g-m)/t.value.style.chart.layout.curveAngleX;a.push({x1:d,x2:h,y1:m,y2:g,curve:`M ${d} ${m} C ${d+k} ${m+b}, ${h+k} ${g-b}, ${h} ${g}`,color:r})}}return a}),p=e.computed(()=>{let a,s,l;const r=t.value.style.chart.percentage.fontSize/3;return y.value?t.value.style.chart.percentage.verticalPosition==="top"?(a=o.value.width/2,s=n.value.top/2,l="middle"):t.value.style.chart.percentage.verticalPosition==="bottom"&&(a=o.value.width/2,s=o.value.height-n.value.bottom/2+r,l="middle"):t.value.style.chart.percentage.horizontalPosition==="left"?(a=4,s=o.value.height/2+r,l="start"):t.value.style.chart.percentage.horizontalPosition==="right"&&(a=o.value.width-n.value.right+8,s=o.value.height/2+r,l="start"),{x:a,y:s,textAnchor:l,bold:t.value.style.chart.percentage.bold,fontSize:t.value.style.chart.percentage.fontSize,fill:t.value.style.chart.percentage.color}}),_=e.ref(!1);function G(a){_.value=a,P.value+=1}return V({generatePdf:S,generateImage:I}),(a,s)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tiremarksChart",ref:w,class:e.normalizeClass(`vue-ui-tiremarks ${t.value.useCssAnimation?"":"vue-ui-dna"}`),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}`),id:$.value},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:12px`)},[e.createVNode(T._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&&x.value?(e.openBlock(),e.createBlock(O.UserOptions,{ref:"details",key:`user_options_${P.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(B),isImaging:e.unref(z),uid:$.value,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,hasXls:!1,isFullscreen:_.value,titles:{...t.value.userOptions.buttonTitles},chartElement:w.value,onToggleFullscreen:G,onGeneratePdf:e.unref(S),onGenerateImage:e.unref(I)},e.createSlots({_:2},[a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:r})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:r})),void 0,!0)]),key:"2"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),x.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(v.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":_.value,"vue-data-ui-fulscreen--off":!_.value}),viewBox:`0 0 ${o.value.width} ${o.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[t.value.style.chart.layout.curved?(e.openBlock(),e.createElementBlock("g",D,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{d:l.curve,"stroke-width":c.value.mark,stroke:i.value>=r?l.color:t.value.style.chart.layout.inactiveColor,"stroke-linecap":"round",fill:"none",class:e.normalizeClass({"vue-ui-tick-animated":t.value.style.chart.animation.use&&r<=i.value})},null,10,X))),256))])):(e.openBlock(),e.createElementBlock("g",R,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{x1:l.x1,y1:l.y1,x2:l.x2,y2:l.y2,"stroke-width":c.value.mark,stroke:i.value>=r?l.color:t.value.style.chart.layout.inactiveColor,"stroke-linecap":"round"},null,8,Y))),256))])),t.value.style.chart.percentage.show?(e.openBlock(),e.createElementBlock("text",{key:2,x:p.value.x,y:p.value.y,"font-size":p.value.fontSize,fill:t.value.style.chart.layout.ticks.gradient.show&&t.value.style.chart.percentage.useGradientColor?e.unref(v.shiftHue)(t.value.style.chart.layout.activeColor,i.value/100*(t.value.style.chart.layout.ticks.gradient.shiftHueIntensity/100)):t.value.style.chart.percentage.color,"font-weight":p.value.bold?"bold":"normal","text-anchor":p.value.textAnchor},e.toDisplayString(e.unref(v.applyDataLabel)(t.value.style.chart.percentage.formatter,i.value,e.unref(v.dataLabel)({v:i.value,s:"%",r:t.value.style.chart.percentage.rounding}))),9,J)):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"svg",{svg:o.value},void 0,!0)],14,M)):e.createCommentVNode("",!0),a.$slots.watermark?(e.openBlock(),e.createElementBlock("div",K,[e.renderSlot(a.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(B)||e.unref(z)})),void 0,!0)])):e.createCommentVNode("",!0),x.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(j.default,{key:4,config:{type:"tiremarks",style:{backgroundColor:t.value.style.chart.backgroundColor,tiremarks:{color:"#CCCCCC"}}}},null,8,["config"]))],14,H))}},W=U._export_sfc(Q,[["__scopeId","data-v-0cc3937c"]]);exports.default=W;
@@ -1,9 +1,9 @@
1
1
  import { computed as h, ref as p, watch as Z, onMounted as ee, openBlock as s, createElementBlock as v, normalizeClass as O, normalizeStyle as S, createVNode as te, createCommentVNode as _, createBlock as V, unref as d, createSlots as ae, withCtx as A, renderSlot as w, normalizeProps as X, guardReactiveProps as D, Fragment as M, renderList as H, toDisplayString as le } from "vue";
2
- import { u as R } from "./useNestedProp-N72tOTWX.js";
3
- import { u as re, c as oe, t as se, o as ne, e as ue, s as Y, X as ie, i as ce, f as ve } from "./index-CAkeI2u7.js";
4
- import { _ as he } from "./Title-DZ-9X7T_.js";
5
- import { u as de, U as ge } from "./usePrinter-MbSdbzew.js";
6
- import ye from "./vue-ui-skeleton-DtWvFTM9.js";
2
+ import { u as R } from "./useNestedProp-DE-a5lMx.js";
3
+ import { u as re, c as oe, t as se, o as ne, e as ue, s as Y, X as ie, i as ce, f as ve } from "./index-8Lp8V0TB.js";
4
+ import { _ as he } from "./Title-0px6u9U5.js";
5
+ import { u as de, U as ge } from "./usePrinter-cCBJ71Cc.js";
6
+ import ye from "./vue-ui-skeleton-apODtH32.js";
7
7
  import { _ as me } from "./_plugin-vue_export-helper-CHgC5LLL.js";
8
8
  const fe = ["id"], pe = ["xmlns", "viewBox"], ke = { key: 0 }, _e = ["d", "stroke-width", "stroke"], be = { key: 1 }, Ce = ["x1", "y1", "x2", "y2", "stroke-width", "stroke"], $e = ["x", "y", "font-size", "fill", "font-weight", "text-anchor"], xe = {
9
9
  key: 3,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-DGxA8bUJ.cjs"),ke=require("./Title-CUtmTGbN.cjs"),re=require("./usePrinter-DbJ9I2vE.cjs"),Ce=require("./Tooltip-DhxfsNhL.cjs"),we=require("./Legend-lleMcfy9.cjs"),xe=require("./vue-ui-skeleton-CHI4nqtV.cjs"),Te=require("./DataTable-pfsiGYAz.cjs"),$e=require("./vue-ui-accordion-Bs0EHuxc.cjs"),ue=require("./useResponsive-B3TrDDIG.cjs"),se=require("./useNestedProp-DM4rgjhE.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 Le=n=>(e.pushScopeId("data-v-7028d693"),n=n(),e.popScopeId(),n),Re=["id"],Fe=["xmlns","viewBox"],De={key:0},Ie=["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=Le(()=>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 l=se.useNestedProp({userConfig:u.config,defaultConfig:i});return l.theme?{...se.useNestedProp({userConfig:r.themes.vue_ui_treemap[l.theme]||u.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}),{isPrinting:T,isImaging:U,generatePdf:G,generateImage:j}=re.usePrinter({elementId:`treemap_${f.value}`,fileName:t.value.style.chart.title.text||"vue-ui-treemap"}),D=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),B=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),_=e.ref({height:t.value.style.chart.height,width:t.value.style.chart.width}),P=e.computed(()=>({bottom:_.value.height-t.value.style.chart.padding.bottom,height:_.value.height-t.value.style.chart.padding.top-t.value.style.chart.padding.bottom,left:t.value.style.chart.padding.left,right:_.value.width-t.value.style.chart.padding.right,top:t.value.style.chart.padding.top,vbHeight:_.value.height,vbWidth:_.value.width,width:_.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right}));function X(l){l.forEach((a,o)=>{a.id=r.createUid(),a.color=r.convertColorToHex(a.color)||D.value[o]||r.palette[o]||r.palette[o%r.palette.length],a.children&&(a.children.forEach(c=>{c.parentId=a.id,c.color=a.color}),X(a.children))})}const O=e.ref(u.dataset),I=e.ref(null);e.onMounted(()=>{if(r.objectIsEmpty(u.dataset)&&r.error({componentName:"VueUiTreemap",type:"dataset"}),X(O.value),t.value.responsive){const l=ue.throttle(()=>{const{width:a,height:o}=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});_.value.width=a,_.value.height=o});I.value=new ResizeObserver(l),I.value.observe(m.value.parentNode)}}),e.onBeforeUnmount(()=>{I.value&&I.value.disconnect()});const H=e.ref(O.value),R=e.computed(()=>H.value.map((l,a)=>({...l,color:r.convertColorToHex(l.color)||D.value[a]||r.palette[a]||r.palette[a%r.palette.length]})).filter(l=>!g.value.includes(l.id))),E=e.computed(()=>O.value.filter(l=>!g.value.includes(l.id)).map(l=>l.value||0).reduce((l,a)=>l+a,0)),Y=e.computed({get(){let l=[...R.value];return t.value.style.chart.layout.sorted&&(l=[...R.value].sort((a,o)=>o.value-a.value)),l.map(a=>({...a}))},set(l){return l}});function Z(l,a){return l.value/a}function he(l,a,o){const c=t.value.style.chart.layout.rects.colorRatio-Z(a,o);return r.lightenHexColor(l,c<0?0:c)}function J(l,a,o,c){return l.map((y,z)=>{const A=he(r.convertColorToHex(a)||D.value[z]||r.palette[z]||r.palette[z%r.palette.length],y,c),be=Z(y,c);return{...y,color:A,proportion:be,parentName:o,children:y.children?J(y.children,A,y.name,c):void 0}})}const F=e.computed(()=>_e(Y.value.map((l,a)=>{const o=l.children?l.children.reduce((c,y)=>c+y.value,0):l.value;return{value:l.value,id:l.id,children:l.children?J(l.children.sort((c,y)=>y.value-c.value),l.color,l.name,o):void 0,color:l.color,name:l.name}}),{x0:P.value.left*2,y0:P.value.top,x1:P.value.width,y1:P.value.height}));function K({y0:l,y1:a}){return a-l<=0?1e-4:a-l}function Q({x0:l,x1:a}){return a-l<=0?1e-4:a-l}function V(l){const a=t.value.style.chart.layout.labels.fontSize*(l.proportion*2>1?1:l.proportion*2);return a<t.value.style.chart.layout.labels.minFontSize?t.value.style.chart.layout.labels.minFontSize:a}function pe(l){b.value=l,w.value+=1}const L=e.computed(()=>({startX:0,startY:0,width:P.value.vbWidth,height:P.value.vbHeight})),$=e.ref(!1);function ee(l,a=O.value){for(const o of a){if(o.id===l)return o;if(o.children){const c=ee(l,o.children);if(c)return c}}return null}function fe(l){$.value?(s("selectDatapoint",void 0),H.value=O.value):(s("selectDatapoint",l),H.value=[ee(l.parentId)]),$.value=!$.value}const S=e.ref(null),te=e.computed(()=>O.value.map((l,a)=>({...l,color:r.convertColorToHex(l.color)||D.value[a]||r.palette[a]||r.palette[a%r.palette.length],shape:"square"})).sort((l,a)=>a.value-l.value).map((l,a)=>({...l,proportion:l.value/O.value.map(o=>o.value).reduce((o,c)=>o+c,0),opacity:g.value.includes(l.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 le(l){$.value=!1,S.value=null,g.value.includes(l.id)?g.value=g.value.filter(a=>a!==l.id):g.value.length<u.dataset.length-1&&g.value.push(l.id),s("selectLegend",Y.value)}const M=e.ref(null);function me({datapoint:l,seriesIndex:a}){S.value=l,M.value={datapoint:l,seriesIndex:a,config:t.value,series:R.value};const o=t.value.style.chart.tooltip.customFormat;if(r.isFunction(o)&&r.functionReturnsString(()=>o({seriesIndex:a,datapoint:l,series:R.value,config:t.value})))C.value=o({seriesIndex:a,datapoint:l,series:R.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;">${l.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="${l.color}"/></svg>`,c+=`<b>${r.applyDataLabel(t.value.style.chart.layout.labels.formatter,l.value,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.tooltip.roundingValue}),{datapoint:l,seriesIndex:a})}</b>`,C.value=`<div>${c}</div>`}p.value=!0}const N=e.computed(()=>{const l=F.value.map(o=>({name:o.name,color:o.color})),a=F.value.map(o=>o.value);return{head:l,body:a}});function oe(){e.nextTick(()=>{const l=N.value.head.map((c,y)=>[[c.name],[N.value.body[y]],[isNaN(N.value.body[y]/E.value)?"-":N.value.body[y]/E.value*100]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(l),o=r.createCsvContent(a);r.downloadCsv({csvContent:o,title:t.value.style.chart.title.text||"vue-ui-treemap"})})}const q=e.computed(()=>{const l=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage],a=N.value.head.map((y,z)=>{const A=r.applyDataLabel(t.value.style.chart.layout.labels.formatter,N.value.body[z],r.dataLabel({p:t.value.style.chart.layout.labels.prefix,v:N.value.body[z],s:t.value.style.chart.layout.labels.suffix,r:t.value.table.td.roundingValue}));return[{color:y.color,name:y.name,shape:"square"},A,isNaN(N.value.body[z]/E.value)?"-":r.dataLabel({v:N.value.body[z]/E.value*100,s:"%",r:t.value.table.td.roundingPercentage})]}),o={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:l,body:a,config:o}});function ye(){return F.value}function ae(){B.value.showTable=!B.value.showTable}function ne(){B.value.showTooltip=!B.value.showTooltip}return d({getData:ye,generateCsv:oe,generateImage:j,generatePdf:G,toggleTable:ae,toggleTooltip:ne}),(l,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:B.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:m.value,onToggleFullscreen:pe,onGeneratePdf:e.unref(G),onGenerateCsv:oe,onGenerateImage:e.unref(j),onToggleTable:ae,onToggleTooltip:ne},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:o,isFullscreen:c})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,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:`${L.value.startX} ${L.value.startY} ${L.value.width<=0?10:L.value.width} ${L.value.height<=0?10:L.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(F.value,(o,c)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.chart.layout.rects.gradient.show?(e.openBlock(),e.createElementBlock("defs",De,[e.createElementVNode("radialGradient",{id:`tgrad_${o.id}`,gradientTransform:"translate(-1, -1.000001) scale(2, 2)"},[e.createElementVNode("stop",{offset:"18%","stop-color":o.color},null,8,qe),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.lightenHexColor)(o.color,t.value.style.chart.layout.rects.gradient.intensity/100)},null,8,Ae)],8,Ie)])):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(o,c)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:o.x0,y:o.y0,height:K(o),width:Q(o),fill:h.value?o.color:t.value.style.chart.layout.rects.gradient.show?`url(#tgrad_${o.id})`:o.color,rx:t.value.style.chart.layout.rects.borderRadius,stroke:S.value&&S.value.id===o.id?t.value.style.chart.layout.rects.selected.stroke:t.value.style.chart.layout.rects.stroke,"stroke-width":S.value&&S.value.id===o.id?t.value.style.chart.layout.rects.selected.strokeWidth:t.value.style.chart.layout.rects.strokeWidth,onClick:y=>fe(o),onMouseenter:()=>me({datapoint:o,seriesIndex:c}),onMouseleave:a[0]||(a[0]=y=>{S.value=null,p.value=!1}),style:e.normalizeStyle(`opacity:${S.value?S.value.id===o.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:o.x0,y:o.y0,height:K(o),width:Q(o),class:"vue-ui-treemap-cell-foreignObject"},[e.createElementVNode("div",We,[t.value.style.chart.layout.labels.showDefaultLabels&&(o.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% - ${V(o)/1.5}px);text-align:left;line-height:${V(o)<14?14:V(o)}px;padding:${V(o)/3}px; color:${e.unref(r.adaptColorToBackground)(o.color)}`)},[e.createElementVNode("span",{style:e.normalizeStyle(`width:100%;font-size:${V(o)}px;`)},e.toDisplayString(o.name),5),Ue,e.createElementVNode("span",{style:e.normalizeStyle(`width:100%;font-size:${V(o)}px;`)},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.formatter,o.value,e.unref(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.layout.labels.rounding}),{datapoint:o})),5)],4)):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"rect",e.normalizeProps(e.guardReactiveProps({rect:o,shouldShow:o.proportion>t.value.style.chart.layout.labels.hideUnderProportion||$.value,fontSize:V(o),isZoom:$.value,textColor:e.unref(r.adaptColorToBackground)(o.color)})),void 0,!0)])],8,Me))]))),256)),e.renderSlot(l.$slots,"svg",e.normalizeProps(e.guardReactiveProps({svg:P.value,isZoom:$.value,rect:S.value,config:t.value})),void 0,!0)],14,Fe)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ge,[e.renderSlot(l.$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:o})=>le(o))},{item:e.withCtx(({legend:o,index:c})=>[e.createElementVNode("div",{onClick:y=>le(o),style:e.normalizeStyle(`opacity:${g.value.includes(o.id)?.5:1}`)},[e.createTextVNode(e.toDisplayString(o.name)+": "+e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.formatter,o.value,e.unref(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.legend.roundingValue}),{datapoint:o}))+" ",1),g.value.includes(o.id)?(e.openBlock(),e.createElementBlock("span",Ye," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",Xe," ("+e.toDisplayString(isNaN(o.value/E.value)?"-":(o.value/E.value*100).toFixed(t.value.style.chart.legend.roundingPercentage))+"%) ",1))],12,je)]),_:1},8,["legendSet","config","id"])):e.renderSlot(l.$slots,"legend",{key:1,legend:te.value},void 0,!0)],512),e.createVNode(Ce._sfc_main,{show:B.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(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...M.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...M.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isCustom"]),v.value?(e.openBlock(),e.createBlock($e.default,{key:5,hideDetails:"",config:{open:B.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(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]=o=>B.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,Ze)]),td:e.withCtx(({td:o})=>[e.createTextVNode(e.toDisplayString(o.name||o),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,Re))}},Ke=Se._export_sfc(Je,[["__scopeId","data-v-7028d693"]]);exports.default=Ke;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-De6Dj52h.cjs"),ke=require("./Title-CSRD5z1r.cjs"),re=require("./usePrinter-SLYneJmG.cjs"),Ce=require("./Tooltip-DFpYO4rz.cjs"),we=require("./Legend-C3LgyVKP.cjs"),xe=require("./vue-ui-skeleton-Cl9Kp9yE.cjs"),Te=require("./DataTable-CMF1l-gL.cjs"),$e=require("./vue-ui-accordion-CiSEQOBc.cjs"),ue=require("./useResponsive-B3TrDDIG.cjs"),se=require("./useNestedProp-Vjg1xsU_.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 Le=n=>(e.pushScopeId("data-v-7028d693"),n=n(),e.popScopeId(),n),Re=["id"],Fe=["xmlns","viewBox"],De={key:0},Ie=["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=Le(()=>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 l=se.useNestedProp({userConfig:u.config,defaultConfig:i});return l.theme?{...se.useNestedProp({userConfig:r.themes.vue_ui_treemap[l.theme]||u.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}),{isPrinting:T,isImaging:U,generatePdf:G,generateImage:j}=re.usePrinter({elementId:`treemap_${f.value}`,fileName:t.value.style.chart.title.text||"vue-ui-treemap"}),D=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),B=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),_=e.ref({height:t.value.style.chart.height,width:t.value.style.chart.width}),P=e.computed(()=>({bottom:_.value.height-t.value.style.chart.padding.bottom,height:_.value.height-t.value.style.chart.padding.top-t.value.style.chart.padding.bottom,left:t.value.style.chart.padding.left,right:_.value.width-t.value.style.chart.padding.right,top:t.value.style.chart.padding.top,vbHeight:_.value.height,vbWidth:_.value.width,width:_.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right}));function X(l){l.forEach((a,o)=>{a.id=r.createUid(),a.color=r.convertColorToHex(a.color)||D.value[o]||r.palette[o]||r.palette[o%r.palette.length],a.children&&(a.children.forEach(c=>{c.parentId=a.id,c.color=a.color}),X(a.children))})}const O=e.ref(u.dataset),I=e.ref(null);e.onMounted(()=>{if(r.objectIsEmpty(u.dataset)&&r.error({componentName:"VueUiTreemap",type:"dataset"}),X(O.value),t.value.responsive){const l=ue.throttle(()=>{const{width:a,height:o}=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});_.value.width=a,_.value.height=o});I.value=new ResizeObserver(l),I.value.observe(m.value.parentNode)}}),e.onBeforeUnmount(()=>{I.value&&I.value.disconnect()});const H=e.ref(O.value),R=e.computed(()=>H.value.map((l,a)=>({...l,color:r.convertColorToHex(l.color)||D.value[a]||r.palette[a]||r.palette[a%r.palette.length]})).filter(l=>!g.value.includes(l.id))),E=e.computed(()=>O.value.filter(l=>!g.value.includes(l.id)).map(l=>l.value||0).reduce((l,a)=>l+a,0)),Y=e.computed({get(){let l=[...R.value];return t.value.style.chart.layout.sorted&&(l=[...R.value].sort((a,o)=>o.value-a.value)),l.map(a=>({...a}))},set(l){return l}});function Z(l,a){return l.value/a}function he(l,a,o){const c=t.value.style.chart.layout.rects.colorRatio-Z(a,o);return r.lightenHexColor(l,c<0?0:c)}function J(l,a,o,c){return l.map((y,z)=>{const A=he(r.convertColorToHex(a)||D.value[z]||r.palette[z]||r.palette[z%r.palette.length],y,c),be=Z(y,c);return{...y,color:A,proportion:be,parentName:o,children:y.children?J(y.children,A,y.name,c):void 0}})}const F=e.computed(()=>_e(Y.value.map((l,a)=>{const o=l.children?l.children.reduce((c,y)=>c+y.value,0):l.value;return{value:l.value,id:l.id,children:l.children?J(l.children.sort((c,y)=>y.value-c.value),l.color,l.name,o):void 0,color:l.color,name:l.name}}),{x0:P.value.left*2,y0:P.value.top,x1:P.value.width,y1:P.value.height}));function K({y0:l,y1:a}){return a-l<=0?1e-4:a-l}function Q({x0:l,x1:a}){return a-l<=0?1e-4:a-l}function V(l){const a=t.value.style.chart.layout.labels.fontSize*(l.proportion*2>1?1:l.proportion*2);return a<t.value.style.chart.layout.labels.minFontSize?t.value.style.chart.layout.labels.minFontSize:a}function pe(l){b.value=l,w.value+=1}const L=e.computed(()=>({startX:0,startY:0,width:P.value.vbWidth,height:P.value.vbHeight})),$=e.ref(!1);function ee(l,a=O.value){for(const o of a){if(o.id===l)return o;if(o.children){const c=ee(l,o.children);if(c)return c}}return null}function fe(l){$.value?(s("selectDatapoint",void 0),H.value=O.value):(s("selectDatapoint",l),H.value=[ee(l.parentId)]),$.value=!$.value}const S=e.ref(null),te=e.computed(()=>O.value.map((l,a)=>({...l,color:r.convertColorToHex(l.color)||D.value[a]||r.palette[a]||r.palette[a%r.palette.length],shape:"square"})).sort((l,a)=>a.value-l.value).map((l,a)=>({...l,proportion:l.value/O.value.map(o=>o.value).reduce((o,c)=>o+c,0),opacity:g.value.includes(l.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 le(l){$.value=!1,S.value=null,g.value.includes(l.id)?g.value=g.value.filter(a=>a!==l.id):g.value.length<u.dataset.length-1&&g.value.push(l.id),s("selectLegend",Y.value)}const M=e.ref(null);function me({datapoint:l,seriesIndex:a}){S.value=l,M.value={datapoint:l,seriesIndex:a,config:t.value,series:R.value};const o=t.value.style.chart.tooltip.customFormat;if(r.isFunction(o)&&r.functionReturnsString(()=>o({seriesIndex:a,datapoint:l,series:R.value,config:t.value})))C.value=o({seriesIndex:a,datapoint:l,series:R.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;">${l.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="${l.color}"/></svg>`,c+=`<b>${r.applyDataLabel(t.value.style.chart.layout.labels.formatter,l.value,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.tooltip.roundingValue}),{datapoint:l,seriesIndex:a})}</b>`,C.value=`<div>${c}</div>`}p.value=!0}const N=e.computed(()=>{const l=F.value.map(o=>({name:o.name,color:o.color})),a=F.value.map(o=>o.value);return{head:l,body:a}});function oe(){e.nextTick(()=>{const l=N.value.head.map((c,y)=>[[c.name],[N.value.body[y]],[isNaN(N.value.body[y]/E.value)?"-":N.value.body[y]/E.value*100]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(l),o=r.createCsvContent(a);r.downloadCsv({csvContent:o,title:t.value.style.chart.title.text||"vue-ui-treemap"})})}const q=e.computed(()=>{const l=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage],a=N.value.head.map((y,z)=>{const A=r.applyDataLabel(t.value.style.chart.layout.labels.formatter,N.value.body[z],r.dataLabel({p:t.value.style.chart.layout.labels.prefix,v:N.value.body[z],s:t.value.style.chart.layout.labels.suffix,r:t.value.table.td.roundingValue}));return[{color:y.color,name:y.name,shape:"square"},A,isNaN(N.value.body[z]/E.value)?"-":r.dataLabel({v:N.value.body[z]/E.value*100,s:"%",r:t.value.table.td.roundingPercentage})]}),o={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:l,body:a,config:o}});function ye(){return F.value}function ae(){B.value.showTable=!B.value.showTable}function ne(){B.value.showTooltip=!B.value.showTooltip}return d({getData:ye,generateCsv:oe,generateImage:j,generatePdf:G,toggleTable:ae,toggleTooltip:ne}),(l,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:B.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:m.value,onToggleFullscreen:pe,onGeneratePdf:e.unref(G),onGenerateCsv:oe,onGenerateImage:e.unref(j),onToggleTable:ae,onToggleTooltip:ne},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:o,isFullscreen:c})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,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:`${L.value.startX} ${L.value.startY} ${L.value.width<=0?10:L.value.width} ${L.value.height<=0?10:L.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(F.value,(o,c)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.chart.layout.rects.gradient.show?(e.openBlock(),e.createElementBlock("defs",De,[e.createElementVNode("radialGradient",{id:`tgrad_${o.id}`,gradientTransform:"translate(-1, -1.000001) scale(2, 2)"},[e.createElementVNode("stop",{offset:"18%","stop-color":o.color},null,8,qe),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.lightenHexColor)(o.color,t.value.style.chart.layout.rects.gradient.intensity/100)},null,8,Ae)],8,Ie)])):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(o,c)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:o.x0,y:o.y0,height:K(o),width:Q(o),fill:h.value?o.color:t.value.style.chart.layout.rects.gradient.show?`url(#tgrad_${o.id})`:o.color,rx:t.value.style.chart.layout.rects.borderRadius,stroke:S.value&&S.value.id===o.id?t.value.style.chart.layout.rects.selected.stroke:t.value.style.chart.layout.rects.stroke,"stroke-width":S.value&&S.value.id===o.id?t.value.style.chart.layout.rects.selected.strokeWidth:t.value.style.chart.layout.rects.strokeWidth,onClick:y=>fe(o),onMouseenter:()=>me({datapoint:o,seriesIndex:c}),onMouseleave:a[0]||(a[0]=y=>{S.value=null,p.value=!1}),style:e.normalizeStyle(`opacity:${S.value?S.value.id===o.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:o.x0,y:o.y0,height:K(o),width:Q(o),class:"vue-ui-treemap-cell-foreignObject"},[e.createElementVNode("div",We,[t.value.style.chart.layout.labels.showDefaultLabels&&(o.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% - ${V(o)/1.5}px);text-align:left;line-height:${V(o)<14?14:V(o)}px;padding:${V(o)/3}px; color:${e.unref(r.adaptColorToBackground)(o.color)}`)},[e.createElementVNode("span",{style:e.normalizeStyle(`width:100%;font-size:${V(o)}px;`)},e.toDisplayString(o.name),5),Ue,e.createElementVNode("span",{style:e.normalizeStyle(`width:100%;font-size:${V(o)}px;`)},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.formatter,o.value,e.unref(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.layout.labels.rounding}),{datapoint:o})),5)],4)):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"rect",e.normalizeProps(e.guardReactiveProps({rect:o,shouldShow:o.proportion>t.value.style.chart.layout.labels.hideUnderProportion||$.value,fontSize:V(o),isZoom:$.value,textColor:e.unref(r.adaptColorToBackground)(o.color)})),void 0,!0)])],8,Me))]))),256)),e.renderSlot(l.$slots,"svg",e.normalizeProps(e.guardReactiveProps({svg:P.value,isZoom:$.value,rect:S.value,config:t.value})),void 0,!0)],14,Fe)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ge,[e.renderSlot(l.$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:o})=>le(o))},{item:e.withCtx(({legend:o,index:c})=>[e.createElementVNode("div",{onClick:y=>le(o),style:e.normalizeStyle(`opacity:${g.value.includes(o.id)?.5:1}`)},[e.createTextVNode(e.toDisplayString(o.name)+": "+e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.formatter,o.value,e.unref(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.legend.roundingValue}),{datapoint:o}))+" ",1),g.value.includes(o.id)?(e.openBlock(),e.createElementBlock("span",Ye," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",Xe," ("+e.toDisplayString(isNaN(o.value/E.value)?"-":(o.value/E.value*100).toFixed(t.value.style.chart.legend.roundingPercentage))+"%) ",1))],12,je)]),_:1},8,["legendSet","config","id"])):e.renderSlot(l.$slots,"legend",{key:1,legend:te.value},void 0,!0)],512),e.createVNode(Ce._sfc_main,{show:B.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(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...M.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...M.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isCustom"]),v.value?(e.openBlock(),e.createBlock($e.default,{key:5,hideDetails:"",config:{open:B.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(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]=o=>B.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,Ze)]),td:e.withCtx(({td:o})=>[e.createTextVNode(e.toDisplayString(o.name||o),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,Re))}},Ke=Se._export_sfc(Je,[["__scopeId","data-v-7028d693"]]);exports.default=Ke;
@@ -1,14 +1,14 @@
1
1
  import { computed as C, ref as y, onMounted as Ee, onBeforeUnmount as Ue, openBlock as m, createElementBlock as k, normalizeClass as xe, normalizeStyle as M, createVNode as se, createCommentVNode as V, createBlock as te, unref as b, createSlots as Ge, withCtx as T, renderSlot as _, normalizeProps as G, guardReactiveProps as X, Fragment as $e, renderList as Te, createElementVNode as O, toDisplayString as q, createTextVNode as _e, nextTick as Xe, pushScopeId as qe, popScopeId as je } from "vue";
2
- import { u as Ye, c as Oe, t as Ze, a as Je, p as x, b as Ke, o as Qe, e as et, d as le, i as oe, f as Z, X as tt, l as Se, D as Ne, w as ze, x as lt, q as ot, r as at } from "./index-CAkeI2u7.js";
3
- import { _ as nt } from "./Title-DZ-9X7T_.js";
4
- import { u as st, U as rt } from "./usePrinter-MbSdbzew.js";
5
- import { _ as ut } from "./Tooltip-BE1vKyP4.js";
6
- import { L as it } from "./Legend-Dc30ZC8U.js";
7
- import ct from "./vue-ui-skeleton-DtWvFTM9.js";
8
- import { D as dt } from "./DataTable-97z7jeB3.js";
9
- import vt from "./vue-ui-accordion-BbsnFhS8.js";
2
+ import { u as Ye, c as Oe, t as Ze, a as Je, p as x, b as Ke, o as Qe, e as et, d as le, i as oe, f as Z, X as tt, l as Se, D as Ne, w as ze, x as lt, q as ot, r as at } from "./index-8Lp8V0TB.js";
3
+ import { _ as nt } from "./Title-0px6u9U5.js";
4
+ import { u as st, U as rt } from "./usePrinter-cCBJ71Cc.js";
5
+ import { _ as ut } from "./Tooltip-TTopnCsK.js";
6
+ import { L as it } from "./Legend-BbSR193q.js";
7
+ import ct from "./vue-ui-skeleton-apODtH32.js";
8
+ import { D as dt } from "./DataTable-Dy0vFXS7.js";
9
+ import vt from "./vue-ui-accordion-BQfLl7n5.js";
10
10
  import { t as ht, u as ft } from "./useResponsive-NZB-WLRF.js";
11
- import { u as Pe } from "./useNestedProp-N72tOTWX.js";
11
+ import { u as Pe } from "./useNestedProp-DE-a5lMx.js";
12
12
  import { _ as pt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
13
13
  function Ie(a, i) {
14
14
  const s = a.length;
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-DGxA8bUJ.cjs"),le=require("./useResponsive-B3TrDDIG.cjs"),Ce=require("./Title-CUtmTGbN.cjs"),ae=require("./usePrinter-DbJ9I2vE.cjs"),xe=require("./Tooltip-DhxfsNhL.cjs"),oe=require("./Legend-lleMcfy9.cjs"),_e=require("./vue-ui-skeleton-CHI4nqtV.cjs"),we=require("./BaseIcon-DQUa2wbN.cjs"),$e=require("./vue-ui-accordion-Bs0EHuxc.cjs"),ne=require("./useNestedProp-DM4rgjhE.cjs"),Ne=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Se=["id"],Ve=["onClick"],Te=["xmlns","viewBox"],Ee=["id"],Be=["stop-color"],Le=["stop-color"],ze=["x","y","width","height","fill","rx"],Pe=["x","y","width","height","fill","rx","stroke","stroke-width"],De=["x2","y1","y2","stroke","stroke-width"],Fe=["x1","x2","y1","y2","stroke","stroke-width"],Me=["x","y","text-anchor","font-size","fill","font-weight"],Ie=["x","y","font-size","fill","font-weight"],Oe=["x","y","font-size","fill","font-weight"],Re=["x","y","font-size","fill","font-weight"],qe=["y","width","height","fill","onMouseenter"],He={key:4,class:"vue-data-ui-watermark"},Xe=["onClick"],je={style:"width:100%;padding-top: 36px;position:relative"},Ae={class:"vue-ui-data-table"},Ge={key:0},Ue={style:{width:"100%"}},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=["data-cell"],nt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},rt=["data-cell"],ut={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},st={__name:"vue-ui-vertical-bar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(re,{expose:ue,emit:se}){const f=re;e.useCssVars(a=>({"3d2b43f6":a.tdo}));const{vue_ui_vertical_bar:ie}=r.useConfig(),V=e.computed(()=>!!f.dataset&&f.dataset.length),m=e.ref(r.createUid()),ce=e.ref(null),B=e.ref(!1),L=e.ref(""),T=e.ref(0),de=e.ref(null),I=e.ref(0),$=e.ref(null),O=e.ref(null),z=e.ref(null),t=e.computed(()=>{const a=ne.useNestedProp({userConfig:f.config,defaultConfig:ie});return a.theme?{...ne.useNestedProp({userConfig:r.themes.vue_ui_vertical_bar[a.theme]||f.config,defaultConfig:a}),customPalette:r.themePalettes[a.theme]||r.palette}:a}),{isPrinting:R,isImaging:q,generatePdf:H,generateImage:X}=ae.usePrinter({elementId:`vue-ui-vertical-bar_${m.value}`,fileName:t.value.style.chart.title.text||"vue-ui-vertical-bar"}),j=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),A=e.ref(null),G=e.ref(!1),ve=e.computed(()=>t.value.table.responsiveBreakpoint),E=e.ref(null);e.onMounted(()=>{if(r.objectIsEmpty(f.dataset)&&r.error({componentName:"VueUiVerticalBar",type:"dataset"}),T.value=f.dataset.flatMap(a=>a.children&&a.children.length>0?a.children.length:1).reduce((a,o)=>a+o,0),he(),t.value.responsive){const a=le.throttle(()=>{const{width:o,height:l}=le.useResponsive({chart:$.value,title:t.value.style.chart.title.text?O.value:null,legend:t.value.style.chart.legend.show?z.value:null});Y.value=o,c.value=l/T.value-v.value*2});E.value=new ResizeObserver(a),E.value.observe($.value.parentNode)}}),e.onBeforeUnmount(()=>{E.value&&E.value.disconnect()});function he(){new ResizeObserver(o=>{o.forEach(l=>{G.value=l.contentRect.width<ve.value})}).observe(A.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}),U=e.computed(()=>h.value.sortDesc),k=e.computed(()=>(f.dataset.forEach((a,o)=>{a.children&&(r.objectIsEmpty(a.children)?r.error({componentName:"VueUiVerticalBar",type:"datasetAttributeEmpty",property:`children (index ${o})`}):a.children.forEach((l,n)=>{[null,void 0].includes(l.name)&&r.error({componentName:"VueUiVerticalBar",type:"datasetSerieAttribute",property:"name",key:"children",index:n})}))}),f.dataset.map((a,o)=>{const l=`vertical_parent_${o}_${m.value}`,n=!!a.children&&a.children.length>0;return{...a,id:l,shape:"square",opacity:y.value.includes(l)?.5:1,value:n?a.children.map(s=>s.value||0).reduce((s,i)=>s+i,0):Math.abs(a.value)||0,sign:a.value>=0?1:-1,hasChildren:n,isChild:!1,segregate:()=>N(l),isSegregated:y.value.includes(l),color:r.convertColorToHex(a.color)||j.value[o]||r.palette[o]||r.palette[o%r.palette.length],children:!a.children||!a.children.length?[]:a.children.toSorted((s,i)=>U.value?i.value-s.value:s.value-i.value).map((s,i)=>({...s,value:Math.abs(s.value)||0,sign:s.value>=0?1:-1,isChild:!0,parentId:l,parentName:a.name,parentValue:a.value||n?a.children.map(M=>M.value||0).reduce((M,ke)=>M+ke,0):0,id:`vertical_child_${o}_${i}_${m.value}`,childIndex:i,color:r.convertColorToHex(s.color)||r.convertColorToHex(a.color)||j.value[o]||r.palette[o]||r.palette[o%r.palette.length]})).map((s,i)=>({...s,isFirstChild:i===0,isLastChild:i===a.children.length-1}))}}).toSorted((a,o)=>U.value?o.value-a.value:a.value-o.value))),W=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":""})),c=e.ref(t.value.style.chart.layout.bars.height),v=e.ref(t.value.style.chart.layout.bars.gap),pe=e.computed(()=>(c.value+v.value)*T.value),Y=e.ref(512),d=e.computed(()=>({width:Y.value,height:pe.value,padding:{top:12,left:128+t.value.style.chart.layout.bars.offsetX,right:64+t.value.style.chart.layout.bars.paddingRight,bottom:12}})),u=e.computed(()=>({fullHeight:d.value.padding.top+d.value.padding.bottom+d.value.height,top:d.value.padding.top,left:d.value.padding.left,right:d.value.width-d.value.padding.right,bottom:d.value.padding.top+d.value.height,width:d.value.width-(d.value.padding.left+d.value.padding.right)}));function P(){T.value=C.value.flatMap(a=>a.children&&a.children.length>0?a.children.length:1).reduce((a,o)=>a+o,0)}const y=e.ref([]);function N(a){y.value.includes(a)?y.value=y.value.filter(o=>o!==a):y.value.push(a),P(),se("selectLegend",C.value)}const C=e.computed(()=>k.value.filter(a=>!y.value.includes(a.id))),g=e.computed(()=>C.value.map(a=>Math.abs(a.value)).reduce((a,o)=>a+o,0));function K(a,o=!1,l=0){return o?r.dataLabel({v:Math.abs(a)/g.value*100,s:"%",r:l}):Math.abs(a)/g.value}const x=e.computed(()=>C.value.flatMap(a=>a.hasChildren?a.children:a)),_=e.computed(()=>x.value.map(a=>a.sign).includes(-1)),ye=e.computed(()=>Math.max(...C.value.flatMap(a=>a.children&&a.children.length?Math.max(...a.children.map(o=>o.value)):a.value)));function b(a){const o=a/ye.value;return u.value.width/(_.value?2:1)*o}function ge(a){return b(a)+u.value.left}function w(a,o){const l=C.value.find(i=>i.id===a.parentId),n=u.value.top+(v.value+c.value)*o,s=l.children.length*(v.value+c.value);return{y:n+s/2-t.value.style.chart.layout.bars.parentLabels.fontSize,name:l.name,value:[void 0,NaN,null].includes(l.value)?"":l.sign===1?l.value:-l.value,percentageToTotal:isNaN(l.value/g.value)?"":K(l.value,!0,t.value.style.chart.layout.bars.dataLabels.percentage.roundingPercentage),sign:l.sign}}function fe(){return C.value}const D=e.ref(null),F=e.ref(null);function be(a,o){F.value={datapoint:a,seriesIndex:o,series:k.value,config:t.value},B.value=!0,D.value=a.id;let l="";const n=a.isChild?a.parentName:a.name,s=a.isChild?a.name:"",i=t.value.style.chart.tooltip.customFormat;r.isFunction(i)&&r.functionReturnsString(()=>i({datapoint:a,series:k.value,config:t.value,seriesIndex:o}))?L.value=i({datapoint:a,series:k.value,config:t.value,seriesIndex:o}):(l+=`<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-De6Dj52h.cjs"),le=require("./useResponsive-B3TrDDIG.cjs"),Ce=require("./Title-CSRD5z1r.cjs"),ae=require("./usePrinter-SLYneJmG.cjs"),xe=require("./Tooltip-DFpYO4rz.cjs"),oe=require("./Legend-C3LgyVKP.cjs"),_e=require("./vue-ui-skeleton-Cl9Kp9yE.cjs"),we=require("./BaseIcon-DuVD-1qH.cjs"),$e=require("./vue-ui-accordion-CiSEQOBc.cjs"),ne=require("./useNestedProp-Vjg1xsU_.cjs"),Ne=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Se=["id"],Ve=["onClick"],Te=["xmlns","viewBox"],Ee=["id"],Be=["stop-color"],Le=["stop-color"],ze=["x","y","width","height","fill","rx"],Pe=["x","y","width","height","fill","rx","stroke","stroke-width"],De=["x2","y1","y2","stroke","stroke-width"],Fe=["x1","x2","y1","y2","stroke","stroke-width"],Me=["x","y","text-anchor","font-size","fill","font-weight"],Ie=["x","y","font-size","fill","font-weight"],Oe=["x","y","font-size","fill","font-weight"],Re=["x","y","font-size","fill","font-weight"],qe=["y","width","height","fill","onMouseenter"],He={key:4,class:"vue-data-ui-watermark"},Xe=["onClick"],je={style:"width:100%;padding-top: 36px;position:relative"},Ae={class:"vue-ui-data-table"},Ge={key:0},Ue={style:{width:"100%"}},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=["data-cell"],nt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},rt=["data-cell"],ut={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},st={__name:"vue-ui-vertical-bar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(re,{expose:ue,emit:se}){const f=re;e.useCssVars(a=>({"3d2b43f6":a.tdo}));const{vue_ui_vertical_bar:ie}=r.useConfig(),V=e.computed(()=>!!f.dataset&&f.dataset.length),m=e.ref(r.createUid()),ce=e.ref(null),B=e.ref(!1),L=e.ref(""),T=e.ref(0),de=e.ref(null),I=e.ref(0),$=e.ref(null),O=e.ref(null),z=e.ref(null),t=e.computed(()=>{const a=ne.useNestedProp({userConfig:f.config,defaultConfig:ie});return a.theme?{...ne.useNestedProp({userConfig:r.themes.vue_ui_vertical_bar[a.theme]||f.config,defaultConfig:a}),customPalette:r.themePalettes[a.theme]||r.palette}:a}),{isPrinting:R,isImaging:q,generatePdf:H,generateImage:X}=ae.usePrinter({elementId:`vue-ui-vertical-bar_${m.value}`,fileName:t.value.style.chart.title.text||"vue-ui-vertical-bar"}),j=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),A=e.ref(null),G=e.ref(!1),ve=e.computed(()=>t.value.table.responsiveBreakpoint),E=e.ref(null);e.onMounted(()=>{if(r.objectIsEmpty(f.dataset)&&r.error({componentName:"VueUiVerticalBar",type:"dataset"}),T.value=f.dataset.flatMap(a=>a.children&&a.children.length>0?a.children.length:1).reduce((a,o)=>a+o,0),he(),t.value.responsive){const a=le.throttle(()=>{const{width:o,height:l}=le.useResponsive({chart:$.value,title:t.value.style.chart.title.text?O.value:null,legend:t.value.style.chart.legend.show?z.value:null});Y.value=o,c.value=l/T.value-v.value*2});E.value=new ResizeObserver(a),E.value.observe($.value.parentNode)}}),e.onBeforeUnmount(()=>{E.value&&E.value.disconnect()});function he(){new ResizeObserver(o=>{o.forEach(l=>{G.value=l.contentRect.width<ve.value})}).observe(A.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}),U=e.computed(()=>h.value.sortDesc),k=e.computed(()=>(f.dataset.forEach((a,o)=>{a.children&&(r.objectIsEmpty(a.children)?r.error({componentName:"VueUiVerticalBar",type:"datasetAttributeEmpty",property:`children (index ${o})`}):a.children.forEach((l,n)=>{[null,void 0].includes(l.name)&&r.error({componentName:"VueUiVerticalBar",type:"datasetSerieAttribute",property:"name",key:"children",index:n})}))}),f.dataset.map((a,o)=>{const l=`vertical_parent_${o}_${m.value}`,n=!!a.children&&a.children.length>0;return{...a,id:l,shape:"square",opacity:y.value.includes(l)?.5:1,value:n?a.children.map(s=>s.value||0).reduce((s,i)=>s+i,0):Math.abs(a.value)||0,sign:a.value>=0?1:-1,hasChildren:n,isChild:!1,segregate:()=>N(l),isSegregated:y.value.includes(l),color:r.convertColorToHex(a.color)||j.value[o]||r.palette[o]||r.palette[o%r.palette.length],children:!a.children||!a.children.length?[]:a.children.toSorted((s,i)=>U.value?i.value-s.value:s.value-i.value).map((s,i)=>({...s,value:Math.abs(s.value)||0,sign:s.value>=0?1:-1,isChild:!0,parentId:l,parentName:a.name,parentValue:a.value||n?a.children.map(M=>M.value||0).reduce((M,ke)=>M+ke,0):0,id:`vertical_child_${o}_${i}_${m.value}`,childIndex:i,color:r.convertColorToHex(s.color)||r.convertColorToHex(a.color)||j.value[o]||r.palette[o]||r.palette[o%r.palette.length]})).map((s,i)=>({...s,isFirstChild:i===0,isLastChild:i===a.children.length-1}))}}).toSorted((a,o)=>U.value?o.value-a.value:a.value-o.value))),W=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":""})),c=e.ref(t.value.style.chart.layout.bars.height),v=e.ref(t.value.style.chart.layout.bars.gap),pe=e.computed(()=>(c.value+v.value)*T.value),Y=e.ref(512),d=e.computed(()=>({width:Y.value,height:pe.value,padding:{top:12,left:128+t.value.style.chart.layout.bars.offsetX,right:64+t.value.style.chart.layout.bars.paddingRight,bottom:12}})),u=e.computed(()=>({fullHeight:d.value.padding.top+d.value.padding.bottom+d.value.height,top:d.value.padding.top,left:d.value.padding.left,right:d.value.width-d.value.padding.right,bottom:d.value.padding.top+d.value.height,width:d.value.width-(d.value.padding.left+d.value.padding.right)}));function P(){T.value=C.value.flatMap(a=>a.children&&a.children.length>0?a.children.length:1).reduce((a,o)=>a+o,0)}const y=e.ref([]);function N(a){y.value.includes(a)?y.value=y.value.filter(o=>o!==a):y.value.push(a),P(),se("selectLegend",C.value)}const C=e.computed(()=>k.value.filter(a=>!y.value.includes(a.id))),g=e.computed(()=>C.value.map(a=>Math.abs(a.value)).reduce((a,o)=>a+o,0));function K(a,o=!1,l=0){return o?r.dataLabel({v:Math.abs(a)/g.value*100,s:"%",r:l}):Math.abs(a)/g.value}const x=e.computed(()=>C.value.flatMap(a=>a.hasChildren?a.children:a)),_=e.computed(()=>x.value.map(a=>a.sign).includes(-1)),ye=e.computed(()=>Math.max(...C.value.flatMap(a=>a.children&&a.children.length?Math.max(...a.children.map(o=>o.value)):a.value)));function b(a){const o=a/ye.value;return u.value.width/(_.value?2:1)*o}function ge(a){return b(a)+u.value.left}function w(a,o){const l=C.value.find(i=>i.id===a.parentId),n=u.value.top+(v.value+c.value)*o,s=l.children.length*(v.value+c.value);return{y:n+s/2-t.value.style.chart.layout.bars.parentLabels.fontSize,name:l.name,value:[void 0,NaN,null].includes(l.value)?"":l.sign===1?l.value:-l.value,percentageToTotal:isNaN(l.value/g.value)?"":K(l.value,!0,t.value.style.chart.layout.bars.dataLabels.percentage.roundingPercentage),sign:l.sign}}function fe(){return C.value}const D=e.ref(null),F=e.ref(null);function be(a,o){F.value={datapoint:a,seriesIndex:o,series:k.value,config:t.value},B.value=!0,D.value=a.id;let l="";const n=a.isChild?a.parentName:a.name,s=a.isChild?a.name:"",i=t.value.style.chart.tooltip.customFormat;r.isFunction(i)&&r.functionReturnsString(()=>i({datapoint:a,series:k.value,config:t.value,seriesIndex:o}))?L.value=i({datapoint:a,series:k.value,config:t.value,seriesIndex:o}):(l+=`<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="${a.color}"/></svg> ${n}</div>
3
3
  ${s?`<div>${s}</div>`:""}
4
4
  </div>`,t.value.style.chart.tooltip.showValue&&(l+=`<div>${t.value.translations.value}: <b>${r.applyDataLabel(t.value.style.chart.layout.bars.dataLabels.value.formatter,a.sign===1?a.value:-a.value,r.dataLabel({p:t.value.style.chart.tooltip.prefix,v:a.sign===1?a.value:-a.value,s:t.value.style.chart.tooltip.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:a,seriesIndex:o})}</b></div>`),t.value.style.chart.tooltip.showPercentage&&(l+=`<div>${t.value.translations.percentageToTotal} : <b>${r.dataLabel({v:Math.abs(a.value)/g.value*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage})}</b></div>`,a.isChild&&(l+=`<div>${t.value.translations.percentageToSerie}: <b>${r.dataLabel({v:Math.abs(a.value)/Math.abs(a.parentValue)*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage})}</b></div>`)),L.value=`<div style="text-align:left">${l}</div>`)}function J(a,o,l,n){if(!t.value.style.chart.layout.bars.dataLabels.value.show)return"";const s=r.applyDataLabel(t.value.style.chart.layout.bars.dataLabels.value.formatter,n===-1&&a>=0?-a:a,r.dataLabel({p:t.value.style.chart.layout.bars.dataLabels.value.prefix,v:n===-1&&a>=0?-a:a,s:t.value.style.chart.layout.bars.dataLabels.value.suffix,r:t.value.style.chart.layout.bars.dataLabels.value.roundingValue}),{datapoint:o,seriesIndex:l}),i=`(${K(a,!0,t.value.style.chart.layout.bars.dataLabels.percentage.roundingPercentage)})`;return`${s}${t.value.style.chart.layout.bars.dataLabels.percentage.show?` ${i}`:""}`}const p=e.computed(()=>{const a=[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=x.value.map(l=>l.isChild?l.isFirstChild?{color:l.color,parentName:l.parentName,parentValue:l.parentValue,percentageToTotal:l.parentValue/g.value,childName:l.name,childValue:l.sign===1?l.value:-l.value,childPercentageToParent:Math.abs(l.value)/Math.abs(l.parentValue),childPercentageToTotal:Math.abs(l.value)/g.value}:{color:"",parentName:"",parentValue:"",percentageToTotal:"",childName:l.name,childValue:l.sign===1?l.value:-l.value,childPercentageToParent:Math.abs(l.value)/Math.abs(l.parentValue),childPercentageToTotal:Math.abs(l.value)/g.value}:{color:l.color,parentName:l.name,parentValue:l.sign===1?l.value:-l.value,percentageToTotal:Math.abs(l.value)/g.value,childName:"",childValue:"",childPercentageToParent:"",childPercentageToTotal:""});return{head:a,body:o}});function Q(){const a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[""]],o=p.value.head,l=p.value.body.map(i=>[i.parentName,i.parentValue,i.percentageToTotal,i.childName,i.childValue,i.childPercentageToParent,i.childPercentageToTotal]),n=a.concat([o]).concat(l),s=r.createCsvContent(n);r.downloadCsv({csvContent:s,title:t.value.style.chart.title.text||"vue-ui-vertical-bar"})}const S=e.ref(!1);function me(a){S.value=a,I.value+=1}function Z(){h.value.showTable=!h.value.showTable}function ee(){h.value.sortDesc=!h.value.sortDesc,P()}function te(){h.value.showTooltip=!h.value.showTooltip}return ue({getData:fe,recalculateHeight:P,generatePdf:H,generateCsv:Q,generateImage:X,toggleTable:Z,toggleSort:ee,toggleTooltip:te}),(a,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-vertical-bar ${S.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),ref_key:"verticalBarChart",ref:$,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:O,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:12px`)},[e.createVNode(Ce._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&&V.value?(e.openBlock(),e.createBlock(ae.UserOptions,{ref_key:"details",ref:ce,key:`user_options_${I.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(q),isPrinting:e.unref(R),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:S.value,isTooltip:h.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:$.value,onToggleFullscreen:me,onGeneratePdf:e.unref(H),onGenerateCsv:Q,onGenerateImage:e.unref(X),onToggleTable:Z,onToggleSort:ee,onToggleTooltip:te},e.createSlots({_:2},[a.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,a.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,a.$slots.optionLabels?{name:"optionLabels",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionLabels",{},void 0,!0)]),key:"5"}:void 0,a.$slots.optionSort?{name:"optionSort",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionSort",{},void 0,!0)]),key:"6"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:n})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,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(oe.Legend,{legendSet:k.value,config:W.value,onClickMarker:o[0]||(o[0]=({legend:l})=>N(l.id))},{item:e.withCtx(({legend:l,index:n})=>[e.createElementVNode("div",{"data-cy-legend-item":"",onClick:s=>N(l.id),style:e.normalizeStyle(`opacity:${y.value.includes(l.id)?.5:1}`)},e.toDisplayString(l.name)+": "+e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.bars.dataLabels.value.formatter,l.value,e.unref(r.dataLabel)({p:t.value.style.chart.legend.prefix,v:l.value,s:t.value.style.chart.legend.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:l,seriesIndex:n})),13,Ve)]),_:1},8,["legendSet","config"])],512)):e.createCommentVNode("",!0),V.value?(e.openBlock(),e.createElementBlock("svg",{key:3,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":S.value,"vue-data-ui-fulscreen--off":!S.value}),viewBox:`0 0 ${d.value.width<=0?10:d.value.width} ${u.value.fullHeight<=0?10:u.value.fullHeight}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(l,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":l.color},null,8,Be),e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(r.shiftHue)(l.color,.03)}${e.unref(r.opacity)[100-t.value.style.chart.layout.bars.gradientIntensity]}`},null,8,Le)],8,Ee))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(l,n)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:_.value?u.value.left+u.value.width/2-(l.sign===1?0:b(l.value)<=0?1e-4:b(l.value)):u.value.left,y:u.value.top+(v.value+c.value)*n,width:b(l.value)<=0?1e-4:b(l.value),height:c.value<=0?1e-4:c.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,ze)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(l,n)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:_.value?u.value.left+u.value.width/2-(l.sign===1?0:b(l.value)<=0?1e-4:b(l.value)):u.value.left,y:u.value.top+(v.value+c.value)*n,width:b(l.value)<=0?1e-4:b(l.value),height:c.value<=0?1e-4:c.value,fill:t.value.style.chart.layout.bars.useGradient?`url(#vertical_bar_gradient_${m.value}_${n})`:`${l.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?l.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,Pe),(!l.isChild||l.isLastChild)&&t.value.style.chart.layout.separators.show&&n!==x.value.length-1?(e.openBlock(),e.createElementBlock("line",{key:0,x1:0,x2:u.value.left,y1:c.value+v.value/2+u.value.top+(v.value+c.value)*n,y2:c.value+v.value/2+u.value.top+(v.value+c.value)*n,stroke:t.value.style.chart.layout.separators.color,"stroke-width":t.value.style.chart.layout.separators.strokeWidth,"stroke-linecap":"round"},null,8,De)):e.createCommentVNode("",!0),_.value&&t.value.style.chart.layout.separators.show?(e.openBlock(),e.createElementBlock("line",{key:1,x1:u.value.left+u.value.width/2,x2:u.value.left+u.value.width/2,y1:u.value.top,y2:u.value.bottom,stroke:t.value.style.chart.layout.separators.color,"stroke-width":t.value.style.chart.layout.separators.strokeWidth,"stroke-linecap":"round"},null,8,Fe)):e.createCommentVNode("",!0),e.createElementVNode("text",{x:_.value?u.value.left+u.value.width/2+(l.sign===1?-12:12)+(l.sign===1?-t.value.style.chart.layout.bars.dataLabels.offsetX:t.value.style.chart.layout.bars.dataLabels.offsetX):ge(l.value)+3+t.value.style.chart.layout.bars.dataLabels.offsetX,y:u.value.top+(v.value+c.value)*n+c.value/2+t.value.style.chart.layout.bars.dataLabels.fontSize/2,"text-anchor":!_.value||l.sign===-1?"start":"end","font-size":t.value.style.chart.layout.bars.dataLabels.fontSize,fill:t.value.style.chart.layout.bars.dataLabels.color,"font-weight":t.value.style.chart.layout.bars.dataLabels.bold?"bold":"normal"},e.toDisplayString(J(l.value,l,n,l.sign)),9,Me),(l.isChild||!l.hasChildren)&&t.value.style.chart.layout.bars.nameLabels.show?(e.openBlock(),e.createElementBlock("text",{key:2,"text-anchor":"end",x:u.value.left-3+t.value.style.chart.layout.bars.nameLabels.offsetX,y:u.value.top+(v.value+c.value)*n+c.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(l.name),9,Ie)):e.createCommentVNode("",!0),l.isChild&&l.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:w(l,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(w(l,n).name),9,Oe)):e.createCommentVNode("",!0),l.isChild&&l.childIndex===0&&t.value.style.chart.layout.bars.parentLabels.show?(e.openBlock(),e.createElementBlock("text",{key:4,x:3+t.value.style.chart.layout.bars.parentLabels.offsetX,y:w(l,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(J(w(l,n).value),w(l,n),n,w(l,n).sign),9,Re)):e.createCommentVNode("",!0),e.createElementVNode("rect",{"data-cy-trap":"",x:0,y:u.value.top+(v.value+c.value)*n-v.value/2,width:d.value.width<=0?1e-4:d.value.width,height:c.value+v.value<=0?1e-4:c.value+v.value,fill:D.value===l.id?`${t.value.style.chart.layout.highlighter.color}${e.unref(r.opacity)[t.value.style.chart.layout.highlighter.opacity]}`:"transparent",onMouseenter:s=>be(l,n),onMouseleave:o[1]||(o[1]=s=>{de.value=null,B.value=!1,D.value=null})},null,40,qe)]))),256)),e.renderSlot(a.$slots,"svg",{svg:d.value},void 0,!0)],14,Te)):e.createCommentVNode("",!0),a.$slots.watermark?(e.openBlock(),e.createElementBlock("div",He,[e.renderSlot(a.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(R)||e.unref(q)})),void 0,!0)])):e.createCommentVNode("",!0),V.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(_e.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(oe.Legend,{legendSet:k.value,config:W.value,onClickMarker:o[2]||(o[2]=({legend:l})=>N(l.id))},{item:e.withCtx(({legend:l,index:n})=>[e.createElementVNode("div",{onClick:s=>N(l.id),style:e.normalizeStyle(`opacity:${y.value.includes(l.id)?.5:1}`)},e.toDisplayString(l.name)+": "+e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.bars.dataLabels.value.formatter,l.value,e.unref(r.dataLabel)({p:t.value.style.chart.legend.prefix,v:l.value,s:t.value.style.chart.legend.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:l,seriesIndex:n})),13,Xe)]),_:1},8,["legendSet","config"])],512)):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"legend",{legend:k.value},void 0,!0),e.createVNode(xe._sfc_main,{show:h.value.showTooltip&&B.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:$.value,content:L.value,isCustom:t.value.style.chart.tooltip.customFormat&&typeof t.value.style.chart.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(a.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...F.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(a.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...F.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isCustom"]),V.value?(e.openBlock(),e.createBlock($e.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:A,class:"vue-ui-vertical-bar-table"},[e.createElementVNode("div",je,[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]=l=>h.value.showTable=!1),onKeypress:o[4]||(o[4]=e.withKeys(l=>h.value.showTable=!1,["enter"]))},[e.createVNode(we.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":G.value})},[e.createElementVNode("table",Ae,[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",Ge,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(p.value.head,l=>(e.openBlock(),e.createElementBlock("th",{style:e.normalizeStyle(`outline:${t.value.table.th.outline}`)},[e.createElementVNode("div",Ue,e.toDisplayString(l),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(g.value)?"":g.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(p.value.body,(l,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":p.value.head[0]??""},[e.createElementVNode("div",Ye,[l.color?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(`color:${l.color};margin-right:3px`)},"⬤",4)):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(l.parentName),1)])],12,We),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":p.value.head[1]??""},[e.createElementVNode("div",Je,e.toDisplayString(t.value.table.td.prefix)+e.toDisplayString(["",NaN,void 0].includes(l.parentValue)?"":l.parentValue.toFixed(t.value.table.td.roundingValue))+e.toDisplayString(t.value.table.td.suffix),1)],12,Ke),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":p.value.head[2]??""},[e.createElementVNode("div",Ze,e.toDisplayString(["",NaN,void 0].includes(l.percentageToTotal)?"":`${(l.percentageToTotal*100).toFixed(t.value.table.td.roundingPercentage)}%`),1)],12,Qe),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":p.value.head[3]??""},[e.createElementVNode("div",tt,e.toDisplayString(l.childName),1)],12,et),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":p.value.head[4]??""},[e.createElementVNode("div",at,e.toDisplayString(t.value.table.td.prefix)+e.toDisplayString(["",NaN,void 0].includes(l.childValue)?"":l.childValue.toFixed(t.value.table.td.roundingValue))+e.toDisplayString(t.value.table.td.suffix),1)],12,lt),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":p.value.head[5]??""},[e.createElementVNode("div",nt,e.toDisplayString(["",NaN,void 0].includes(l.childPercentageToParent)?"":`${(l.childPercentageToParent*100).toFixed(t.value.table.td.roundingPercentage)}%`),1)],12,ot),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":p.value.head[6]??""},[e.createElementVNode("div",ut,e.toDisplayString(["",NaN,void 0].includes(l.childPercentageToTotal)?"":`${(l.childPercentageToTotal*100).toFixed(t.value.table.td.roundingPercentage)}%`),1)],12,rt)],6))),256))])])],2)])],512)]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,Se))}},it=Ne._export_sfc(st,[["__scopeId","data-v-60989d33"]]);exports.default=it;
@@ -1,14 +1,14 @@
1
1
  import { useCssVars as Ee, computed as f, ref as p, onMounted as Ge, onBeforeUnmount as He, openBlock as i, createElementBlock as v, normalizeClass as B, normalizeStyle as d, createVNode as X, createCommentVNode as b, createBlock as ae, unref as m, createSlots as Ue, withCtx as _, renderSlot as x, normalizeProps as W, guardReactiveProps as j, createElementVNode as u, toDisplayString as c, Fragment as A, renderList as E, withKeys as We, createTextVNode as je } from "vue";
2
- import { u as Ye, c as qe, t as Ke, a as Je, p as V, b as Qe, o as we, e as le, d as oe, i as Y, f as z, X as Ze, s as et, v as ue, w as tt, x as at, q as lt, r as ot } from "./index-CAkeI2u7.js";
2
+ import { u as Ye, c as qe, t as Ke, a as Je, p as V, b as Qe, o as we, e as le, d as oe, i as Y, f as z, X as Ze, s as et, v as ue, w as tt, x as at, q as lt, r as ot } from "./index-8Lp8V0TB.js";
3
3
  import { t as ut, u as nt } from "./useResponsive-NZB-WLRF.js";
4
- import { _ as st } from "./Title-DZ-9X7T_.js";
5
- import { u as rt, U as it } from "./usePrinter-MbSdbzew.js";
6
- import { _ as dt } from "./Tooltip-BE1vKyP4.js";
7
- import { L as Ce } from "./Legend-Dc30ZC8U.js";
8
- import ct from "./vue-ui-skeleton-DtWvFTM9.js";
9
- import vt from "./BaseIcon-B_4EdVx8.js";
10
- import ht from "./vue-ui-accordion-BbsnFhS8.js";
11
- import { u as Te } from "./useNestedProp-N72tOTWX.js";
4
+ import { _ as st } from "./Title-0px6u9U5.js";
5
+ import { u as rt, U as it } from "./usePrinter-cCBJ71Cc.js";
6
+ import { _ as dt } from "./Tooltip-TTopnCsK.js";
7
+ import { L as Ce } from "./Legend-BbSR193q.js";
8
+ import ct from "./vue-ui-skeleton-apODtH32.js";
9
+ import vt from "./BaseIcon-BoVYVkUT.js";
10
+ import ht from "./vue-ui-accordion-BQfLl7n5.js";
11
+ import { u as Te } from "./useNestedProp-DE-a5lMx.js";
12
12
  import { _ as pt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
13
13
  const gt = ["id"], yt = ["onClick"], ft = ["xmlns", "viewBox"], bt = ["id"], mt = ["stop-color"], _t = ["stop-color"], xt = ["x", "y", "width", "height", "fill", "rx"], kt = ["x", "y", "width", "height", "fill", "rx", "stroke", "stroke-width"], $t = ["x2", "y1", "y2", "stroke", "stroke-width"], wt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Ct = ["x", "y", "text-anchor", "font-size", "fill", "font-weight"], Tt = ["x", "y", "font-size", "fill", "font-weight"], Lt = ["x", "y", "font-size", "fill", "font-weight"], Pt = ["x", "y", "font-size", "fill", "font-weight"], Nt = ["y", "width", "height", "fill", "onMouseenter"], St = {
14
14
  key: 4,
@@ -1,14 +1,14 @@
1
1
  import { computed as c, ref as v, onMounted as Me, onBeforeUnmount as De, openBlock as r, createElementBlock as i, normalizeClass as xe, normalizeStyle as W, createVNode as oe, createCommentVNode as p, createBlock as Q, unref as h, createSlots as Ge, withCtx as m, renderSlot as b, normalizeProps as q, guardReactiveProps as H, createElementVNode as w, Fragment as T, renderList as V, toDisplayString as S, createTextVNode as Ce, nextTick as Re, pushScopeId as Ue, popScopeId as je } from "vue";
2
- import { u as Ee, c as We, t as qe, a as He, p as B, o as Xe, e as ue, g as Ye, b as Je, d as Ke, i as M, f as x, X as Qe, s as Ze, v as et, D as tt, F as lt, w as at, x as ot, q as ut, r as st } from "./index-CAkeI2u7.js";
2
+ import { u as Ee, c as We, t as qe, a as He, p as B, o as Xe, e as ue, g as Ye, b as Je, d as Ke, i as M, f as x, X as Qe, s as Ze, v as et, D as tt, F as lt, w as at, x as ot, q as ut, r as st } from "./index-8Lp8V0TB.js";
3
3
  import { t as rt, u as nt } from "./useResponsive-NZB-WLRF.js";
4
- import { _ as it } from "./Title-DZ-9X7T_.js";
5
- import { u as ct, U as vt } from "./usePrinter-MbSdbzew.js";
6
- import { _ as dt } from "./Tooltip-BE1vKyP4.js";
7
- import { D as ht } from "./DataTable-97z7jeB3.js";
8
- import { L as yt } from "./Legend-Dc30ZC8U.js";
9
- import ft from "./vue-ui-skeleton-DtWvFTM9.js";
10
- import pt from "./vue-ui-accordion-BbsnFhS8.js";
11
- import { u as _e } from "./useNestedProp-N72tOTWX.js";
4
+ import { _ as it } from "./Title-0px6u9U5.js";
5
+ import { u as ct, U as vt } from "./usePrinter-cCBJ71Cc.js";
6
+ import { _ as dt } from "./Tooltip-TTopnCsK.js";
7
+ import { D as ht } from "./DataTable-Dy0vFXS7.js";
8
+ import { L as yt } from "./Legend-BbSR193q.js";
9
+ import ft from "./vue-ui-skeleton-apODtH32.js";
10
+ import pt from "./vue-ui-accordion-BQfLl7n5.js";
11
+ import { u as _e } from "./useNestedProp-DE-a5lMx.js";
12
12
  import { _ as gt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
13
13
  const $e = (D) => (Ue("data-v-66e13c6a"), D = D(), je(), D), mt = ["id"], bt = ["xmlns", "viewBox"], wt = ["id"], kt = ["stop-color"], xt = ["stop-color"], Ct = ["id"], _t = /* @__PURE__ */ $e(() => /* @__PURE__ */ w("feGaussianBlur", {
14
14
  in: "SourceGraphic",
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-DGxA8bUJ.cjs"),ae=require("./useResponsive-B3TrDDIG.cjs"),be=require("./Title-CUtmTGbN.cjs"),oe=require("./usePrinter-DbJ9I2vE.cjs"),ke=require("./Tooltip-DhxfsNhL.cjs"),we=require("./DataTable-pfsiGYAz.cjs"),xe=require("./Legend-lleMcfy9.cjs"),Ce=require("./vue-ui-skeleton-CHI4nqtV.cjs"),Be=require("./vue-ui-accordion-Bs0EHuxc.cjs"),re=require("./useNestedProp-DM4rgjhE.cjs"),_e=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ue=S=>(e.pushScopeId("data-v-66e13c6a"),S=S(),e.popScopeId(),S),Se=["id"],Ne=["xmlns","viewBox"],$e=["id"],Le=["stop-color"],Te=["stop-color"],Ve=["id"],Pe=ue(()=>e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:2},null,-1)),Ie=ue(()=>e.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1)),Ee=[Pe,Ie],ze=["x","y","height","width"],Fe=["height","width"],De=["rx","x","y","height","width","stroke","stroke-width","filter"],Oe=["rx","x","y","height","width","fill","stroke","stroke-width","filter"],Ae=["x","y","height","width","filter"],Me={key:0},qe={key:1},Re={key:2},Ue={key:3},je=["onMouseover","x","y","height","width"],Ge={key:3,class:"vue-data-ui-watermark"},We=["onClick"],He={key:0},Ye={key:1},Xe=["innerHTML"],Je={__name:"vue-ui-waffle",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(S,{expose:ne,emit:se}){const p=S,{vue_ui_waffle:ie}=n.useConfig(),P=e.computed(()=>!!p.dataset&&p.dataset.length),b=e.ref(n.createUid()),ce=e.ref(null),F=e.ref(!1),D=e.ref(""),B=e.ref(null),q=e.ref(0),N=e.ref(null),R=e.ref(null),U=e.ref(null),t=e.computed(()=>{const l=re.useNestedProp({userConfig:p.config,defaultConfig:ie});return l.theme?{...re.useNestedProp({userConfig:n.themes.vue_ui_waffle[l.theme]||p.config,defaultConfig:l}),customPalette:n.themePalettes[l.theme]||n.palette}:l}),I=e.ref(null);e.onMounted(()=>{if(n.objectIsEmpty(p.dataset)?n.error({componentName:"VueUiWaffle",type:"dataset"}):p.dataset.forEach((l,r)=>{n.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(a=>{n.error({componentName:"VueUiWaffle",type:"datasetSerieAttribute",property:a,index:r})})}),t.value.responsive){const l=ae.throttle(()=>{const{width:r,height:a}=ae.useResponsive({chart:N.value,title:t.value.style.chart.title.text?R.value:null,legend:t.value.style.chart.legend.show?U.value:null});k.value.width=r,k.value.height=a,y.value.width=r,y.value.height=a});I.value=new ResizeObserver(l),I.value.observe(N.value.parentNode)}}),e.onBeforeUnmount(()=>{I.value&&I.value.disconnect()});const{isPrinting:j,isImaging:G,generatePdf:W,generateImage:H}=oe.usePrinter({elementId:`vue-ui-waffle_${b.value}`,fileName:t.value.style.chart.title.text||"vue-ui-waffle"}),Y=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),m=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),k=e.ref({height:512,width:512}),y=e.ref({top:0,left:0,height:512,width:512}),w=e.computed(()=>(y.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(()=>(y.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(()=>y.value.width/t.value.style.chart.layout.grid.size),E=e.computed(()=>y.value.height/t.value.style.chart.layout.grid.size);function X(l){const r=t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.size,a=l.reduce((h,M)=>h+M,0),o=l.map(h=>h/a*r),u=o.map(Math.floor),i=o.map(h=>h%1);let d=r-u.reduce((h,M)=>h+M,0);for(;d>0;){let h=i.indexOf(Math.max(...i));u[h]+=1,i[h]=0,d-=1}return u}const J=e.computed(()=>p.dataset.map((l,r)=>({...l,color:n.convertColorToHex(l.color)||Y.value[r]||n.palette[r]||n.palette[r%n.palette.length],uid:`serie_${r}`,absoluteIndex:r}))),c=e.ref(J.value),ve=e.computed(()=>{const l=c.value.filter((r,a)=>!v.value.includes(r.uid)).map((r,a)=>(r.values||[]).reduce((o,u)=>o+u,0));return X(l)}),de=e.computed(()=>{const l=c.value.map((r,a)=>(r.values||[]).reduce((o,u)=>o+u));return X(l)}),L=e.computed(()=>(p.dataset.forEach((l,r)=>{[null,void 0].includes(l.values)&&n.error({componentName:"VueUiWaffle",type:"datasetSerieAttribute",property:"values (number[])",index:r})}),c.value.filter((l,r)=>!v.value.includes(l.uid)).map((l,r)=>({absoluteIndex:l.absoluteIndex,uid:l.uid,name:l.name,color:l.color,value:(l.values||[]).reduce((a,o)=>a+o,0),absoluteValues:l.values||[],proportion:ve.value[r]})))),he=e.computed(()=>c.value.map((l,r)=>({absoluteIndex:l.absoluteIndex,uid:l.uid,name:l.name,color:l.color,value:(l.values||[]).reduce((a,o)=>a+o,0),absoluteValues:l.values||[],proportion:de.value[r]})));function pe(){return he.value.map(l=>({name:l.name,color:l.color,value:l.value,proportion:l.proportion}))}const ye=e.computed(()=>{let l=0;return L.value.map((r,a)=>{const o=l,u=o+r.proportion,i=[];for(let d=Math.floor(o);d<Math.floor(u);d+=1)i.push(d);return l=u,{...r,start:o,rects:i}})}),s=e.computed(()=>ye.value.flatMap((l,r)=>l.rects.map((a,o)=>({isFirst:o===0,isLongEnough:a.length>2,name:l.name,color:l.color,value:l.value,serieIndex:r,absoluteStartIndex:o<3,serieId:l.uid,...l}))).map((l,r)=>({...l,isAbsoluteFirst:r%t.value.style.chart.layout.grid.size===0}))),T=e.computed(()=>{const l=[];for(let r=0;r<t.value.style.chart.layout.grid.size;r+=1)for(let a=0;a<t.value.style.chart.layout.grid.size;a+=1)l.push({isStartOfLine:a===0,position:t.value.style.chart.layout.grid.vertical?r:a,x:(t.value.style.chart.layout.grid.vertical?r:a)*(w.value+t.value.style.chart.layout.grid.spaceBetween),y:(t.value.style.chart.layout.grid.vertical?a:r)*(x.value+t.value.style.chart.layout.grid.spaceBetween)+y.value.top});return l}),v=e.ref([]),C=e.ref(!1),K=e.ref(null),Q=e.ref(null);function Z(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 r=J.value.find(u=>u.uid===l).values.reduce((u,i)=>u+i,0);let o=c.value.find(u=>u.uid===l).values.reduce((u,i)=>u+i,0);if(v.value.includes(l)){let i=function(){o>u?(cancelAnimationFrame(K.value),c.value=c.value.map((d,h)=>d.uid===l?{...d,values:[u]}:d),C.value=!1):(C.value=!0,o+=u*.025,c.value=c.value.map((d,h)=>d.uid===l?{...d,values:[o]}:d),K.value=requestAnimationFrame(i))};v.value=v.value.filter(d=>d!==l);const u=r;i()}else if(v.value.length<_.value.length-1&&_.value.length>1){let u=function(){o<.1?(cancelAnimationFrame(Q.value),v.value.push(l),c.value=c.value.map((i,d)=>i.uid===l?{...i,values:[0]}:i),C.value=!1):(C.value=!0,o/=1.5,c.value=c.value.map((i,d)=>i.uid===l?{...i,values:[o]}:i),Q.value=requestAnimationFrame(u))};u()}se("selectLegend",L.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(()=>c.value.map((l,r)=>({name:l.name,color:l.color||Y[r]||n.palette[r]||n.palette[r%n.palette.length],value:(l.values||[]).reduce((a,o)=>a+o,0),uid:l.uid,shape:"square"})).map((l,r)=>({...l,proportion:l.value/c.value.map(a=>(a.values||[]).reduce((o,u)=>o+u,0)).reduce((a,o)=>a+o,0),opacity:v.value.includes(l.uid)?.5:1,segregate:()=>Z(l.uid),isSegregated:v.value.includes(l.uid)}))),fe=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(()=>L.value.map(l=>l.value).reduce((l,r)=>l+r,0)),O=e.ref(null);function ge(l){if(v.value.length===p.dataset.length)return;const r=s.value[l];O.value={datapoint:r,seriesIndex:r.absoluteIndex,series:c.value,config:t.value},F.value=!0,B.value=s.value[l].serieIndex;const a=t.value.style.chart.tooltip.customFormat;if(n.isFunction(a)&&n.functionReturnsString(()=>a({seriesIndex:s.value[l].absoluteIndex,datapoint:r,series:c.value,config:t.value})))D.value=a({seriesIndex:s.value[l].absoluteIndex,datapoint:r,series:c.value,config:t.value});else{let o="";if(o+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${r.name}</div>`,o+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><rect x="0" y="0" height="12" width="12" stroke="none" rx="1" fill="${r.color}" /></svg>`,t.value.style.chart.tooltip.showValue&&(o+=`<b>${n.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,r.value,n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:r.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:r,seriesIndex:s.value[l].absoluteIndex,series:c.value})}</b>`),t.value.style.chart.tooltip.showPercentage){const u=n.dataLabel({v:r.value/f.value*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage});t.value.style.chart.tooltip.showValue?o+=`<span>(${u})</span></div>`:o+=`<b>${u}%</b></div>`}D.value=o}}const g=e.computed(()=>{const l=L.value.map(a=>({name:a.name,color:a.color})),r=L.value.map(a=>a.value);return{head:l,body:r}});function A(l){return t.value.useBlurOnHover&&![null,void 0].includes(B.value)&&B.value!==l?`url(#blur_${b.value})`:""}function ee(){e.nextTick(()=>{const l=g.value.head.map((o,u)=>[[o.name],[g.value.body[u]],[isNaN(g.value.body[u]/f.value)?"-":g.value.body[u]/f.value*100]]),r=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(l),a=n.createCsvContent(r);n.downloadCsv({csvContent:a,title:t.value.style.chart.title.text||"vue-ui-waffle"})})}const z=e.computed(()=>{const l=[' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>',n.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,f.value,n.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%"],r=g.value.head.map((u,i)=>[{color:u.color,name:u.name},n.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,g.value.body[i],n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:g.value.body[i],s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue})),isNaN(g.value.body[i]/f.value)?"-":n.dataLabel({v:g.value.body[i]/f.value*100,s:"%",r:t.value.table.td.roundingPercentage})]),a={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},shape:"square",breakpoint:t.value.table.responsiveBreakpoint},o=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage];return{head:l,body:r,config:a,colNames:o}}),V=e.ref(!1);function me(l){V.value=l,q.value+=1}function te(){m.value.showTable=!m.value.showTable}function le(){m.value.showTooltip=!m.value.showTooltip}return ne({getData:pe,generatePdf:W,generateCsv:ee,generateImage:H,toggleTable:te,toggleTooltip:le}),(l,r)=>(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_${b.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:R,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:12px`)},[e.createVNode(be._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(oe.UserOptions,{ref_key:"details",ref:ce,key:`user_options_${q.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(j),isImaging:e.unref(G),uid:b.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:V.value,isTooltip:m.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:N.value,onToggleFullscreen:me,onGeneratePdf:e.unref(W),onGenerateCsv:ee,onGenerateImage:e.unref(H),onToggleTable:te,onToggleTooltip:le},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:o})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:o})),void 0,!0)]),key:"5"}:void 0]),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(n.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":V.value,"vue-data-ui-fulscreen--off":!V.value}),viewBox:`0 0 ${k.value.width<=0?10:k.value.width} ${k.value.height<=0?10:k.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:${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(s.value,(a,o)=>(e.openBlock(),e.createElementBlock("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`gradient_${b.value}_${o}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(n.shiftHue)(a.color,.05)}${e.unref(n.opacity)[100-t.value.style.chart.layout.rect.gradientIntensity]}`},null,8,Le),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,Te)],8,$e))),256))]),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${b.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},Ee,8,Ve)]),t.value.useCustomCells?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(T.value,(a,o)=>(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:s.value[o].color,...s.value[o]},isSelected:[null,void 0].includes(B.value)?!0:s.value[o].serieIndex===B.value})),void 0,!0)],8,ze))),256)):e.createCommentVNode("",!0),!s.value.length&&!t.value.useCustomCells?(e.openBlock(),e.createElementBlock("rect",{key:1,x:12,y:12,height:y.value.height-24,width:y.value.width-24,rx:3,fill:"none",stroke:"black"},null,8,Fe)):s.value.length&&!t.value.useCustomCells?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(a,o)=>(e.openBlock(),e.createElementBlock("rect",{rx:t.value.style.chart.layout.rect.rounded?t.value.style.chart.layout.rect.rounding:0,x:a.x+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.grid.spaceBetween/2,height: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:A(s.value[o].serieIndex)},null,8,De))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(a,o)=>(e.openBlock(),e.createElementBlock("rect",{rx:t.value.style.chart.layout.rect.rounded?t.value.style.chart.layout.rect.rounding:0,x:a.x+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.grid.spaceBetween/2,height: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_${b.value}_${o})`:s.value[o].color,stroke:t.value.style.chart.layout.rect.stroke,"stroke-width":t.value.style.chart.layout.rect.strokeWidth,filter:A(s.value[o].serieIndex)},null,8,Oe))),256))],64)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(a,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[s.value.length&&!C.value&&!t.value.style.chart.layout.grid.vertical&&t.value.style.chart.layout.labels.captions.show&&(s.value[o].isFirst&&a.position<t.value.style.chart.layout.grid.size-2||s.value[o].isAbsoluteFirst&&o%t.value.style.chart.layout.grid.size===0&&s.value[o].absoluteStartIndex)?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:a.x+t.value.style.chart.layout.labels.captions.offsetX+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.labels.captions.offsetY+t.value.style.chart.layout.grid.spaceBetween/2,height:E.value<=0?1e-4:E.value,width:$.value*t.value.style.chart.layout.grid.size<=0?1e-4:$.value*t.value.style.chart.layout.grid.size,filter:A(s.value[o].serieIndex)},[e.createElementVNode("div",{class:"vue-ui-waffle-caption",style:e.normalizeStyle(`height: 100%; width: 100%; font-size:${t.value.style.chart.layout.labels.captions.fontSize}px;display:flex;align-items:center;justify-content:flex-start;padding: 0 ${$.value/12}px;color:${e.unref(n.adaptColorToBackground)(s.value[o].color)};gap:2px`)},[t.value.style.chart.layout.labels.captions.showSerieName?(e.openBlock(),e.createElementBlock("span",Me,e.toDisplayString(t.value.style.chart.layout.labels.captions.serieNameAbbreviation?e.unref(n.abbreviate)({source:s.value[o].name,length:t.value.style.chart.layout.labels.captions.serieNameMaxAbbreviationSize}):s.value[o].name)+": ",1)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.captions.showPercentage?(e.openBlock(),e.createElementBlock("span",qe,e.toDisplayString(e.unref(n.dataLabel)({v:s.value[o].proportion,s:"%",r:t.value.style.chart.layout.labels.captions.roundingPercentage})),1)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.captions.showPercentage&&t.value.style.chart.layout.labels.captions.showValue?(e.openBlock(),e.createElementBlock("span",Re," ("+e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,s.value[o].value,e.unref(n.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:s.value[o].value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.layout.labels.captions.roundingValue}),{datapoint:s.value[o],position:a}))+") ",1)):e.createCommentVNode("",!0),!t.value.style.chart.layout.labels.captions.showPercentage&&t.value.style.chart.layout.labels.captions.showValue?(e.openBlock(),e.createElementBlock("span",Ue,e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,s.value[o].value,e.unref(n.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:s.value[o].value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.layout.labels.captions.roundingValue}),{datapoint:s.value[o],position:a})),1)):e.createCommentVNode("",!0)],4)],8,Ae)):e.createCommentVNode("",!0)],64))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(a,o)=>(e.openBlock(),e.createElementBlock("rect",{onMouseover:u=>ge(o),onMouseleave:r[0]||(r[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:E.value<=0?1e-4:E.value,width:$.value<=0?1e-4:$.value,fill:"transparent",stroke:"none"},null,40,je))),256)),e.renderSlot(l.$slots,"svg",{svg:k.value},void 0,!0)],14,Ne)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ge,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(j)||e.unref(G)})),void 0,!0)])):e.createCommentVNode("",!0),P.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ce.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:U},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(xe.Legend,{key:0,legendSet:_.value,config:fe.value,onClickMarker:r[1]||(r[1]=({legend:a})=>Z(a.uid))},{item:e.withCtx(({legend:a})=>[e.createElementVNode("div",{onClick:o=>a.segregate(),style:e.normalizeStyle(`opacity:${v.value.includes(a.uid)?.5:1}`)},[e.createTextVNode(e.toDisplayString(a.name)+": "+e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,a.value,e.unref(n.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:a.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.legend.roundingValue,isAnimating:C.value}),{datapoint:a}))+" ",1),v.value.includes(a.uid)?(e.openBlock(),e.createElementBlock("span",Ye," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",He," ("+e.toDisplayString(isNaN(a.value/f.value)?"-":e.unref(n.dataLabel)({v:a.value/f.value*100,s:"%",r:t.value.style.chart.legend.roundingPercentage,isAnimating:C.value}))+") ",1))],12,We)]),_:1},8,["legendSet","config"])):e.renderSlot(l.$slots,"legend",{key:1,legend:_.value},void 0,!0)],512),e.createVNode(ke._sfc_main,{show:m.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:D.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(Be.default,{key:5,hideDetails:"",config:{open:m.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(we.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:r[2]||(r[2]=a=>m.value.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createElementVNode("div",{innerHTML:a,style:{display:"flex","align-items":"center"}},null,8,Xe)]),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,Se))}},Ke=_e._export_sfc(Je,[["__scopeId","data-v-66e13c6a"]]);exports.default=Ke;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-De6Dj52h.cjs"),ae=require("./useResponsive-B3TrDDIG.cjs"),be=require("./Title-CSRD5z1r.cjs"),oe=require("./usePrinter-SLYneJmG.cjs"),ke=require("./Tooltip-DFpYO4rz.cjs"),we=require("./DataTable-CMF1l-gL.cjs"),xe=require("./Legend-C3LgyVKP.cjs"),Ce=require("./vue-ui-skeleton-Cl9Kp9yE.cjs"),Be=require("./vue-ui-accordion-CiSEQOBc.cjs"),re=require("./useNestedProp-Vjg1xsU_.cjs"),_e=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ue=S=>(e.pushScopeId("data-v-66e13c6a"),S=S(),e.popScopeId(),S),Se=["id"],Ne=["xmlns","viewBox"],$e=["id"],Le=["stop-color"],Te=["stop-color"],Ve=["id"],Pe=ue(()=>e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:2},null,-1)),Ie=ue(()=>e.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1)),Ee=[Pe,Ie],ze=["x","y","height","width"],Fe=["height","width"],De=["rx","x","y","height","width","stroke","stroke-width","filter"],Oe=["rx","x","y","height","width","fill","stroke","stroke-width","filter"],Ae=["x","y","height","width","filter"],Me={key:0},qe={key:1},Re={key:2},Ue={key:3},je=["onMouseover","x","y","height","width"],Ge={key:3,class:"vue-data-ui-watermark"},We=["onClick"],He={key:0},Ye={key:1},Xe=["innerHTML"],Je={__name:"vue-ui-waffle",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(S,{expose:ne,emit:se}){const p=S,{vue_ui_waffle:ie}=n.useConfig(),P=e.computed(()=>!!p.dataset&&p.dataset.length),b=e.ref(n.createUid()),ce=e.ref(null),F=e.ref(!1),D=e.ref(""),B=e.ref(null),q=e.ref(0),N=e.ref(null),R=e.ref(null),U=e.ref(null),t=e.computed(()=>{const l=re.useNestedProp({userConfig:p.config,defaultConfig:ie});return l.theme?{...re.useNestedProp({userConfig:n.themes.vue_ui_waffle[l.theme]||p.config,defaultConfig:l}),customPalette:n.themePalettes[l.theme]||n.palette}:l}),I=e.ref(null);e.onMounted(()=>{if(n.objectIsEmpty(p.dataset)?n.error({componentName:"VueUiWaffle",type:"dataset"}):p.dataset.forEach((l,r)=>{n.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(a=>{n.error({componentName:"VueUiWaffle",type:"datasetSerieAttribute",property:a,index:r})})}),t.value.responsive){const l=ae.throttle(()=>{const{width:r,height:a}=ae.useResponsive({chart:N.value,title:t.value.style.chart.title.text?R.value:null,legend:t.value.style.chart.legend.show?U.value:null});k.value.width=r,k.value.height=a,y.value.width=r,y.value.height=a});I.value=new ResizeObserver(l),I.value.observe(N.value.parentNode)}}),e.onBeforeUnmount(()=>{I.value&&I.value.disconnect()});const{isPrinting:j,isImaging:G,generatePdf:W,generateImage:H}=oe.usePrinter({elementId:`vue-ui-waffle_${b.value}`,fileName:t.value.style.chart.title.text||"vue-ui-waffle"}),Y=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),m=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),k=e.ref({height:512,width:512}),y=e.ref({top:0,left:0,height:512,width:512}),w=e.computed(()=>(y.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(()=>(y.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(()=>y.value.width/t.value.style.chart.layout.grid.size),E=e.computed(()=>y.value.height/t.value.style.chart.layout.grid.size);function X(l){const r=t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.size,a=l.reduce((h,M)=>h+M,0),o=l.map(h=>h/a*r),u=o.map(Math.floor),i=o.map(h=>h%1);let d=r-u.reduce((h,M)=>h+M,0);for(;d>0;){let h=i.indexOf(Math.max(...i));u[h]+=1,i[h]=0,d-=1}return u}const J=e.computed(()=>p.dataset.map((l,r)=>({...l,color:n.convertColorToHex(l.color)||Y.value[r]||n.palette[r]||n.palette[r%n.palette.length],uid:`serie_${r}`,absoluteIndex:r}))),c=e.ref(J.value),ve=e.computed(()=>{const l=c.value.filter((r,a)=>!v.value.includes(r.uid)).map((r,a)=>(r.values||[]).reduce((o,u)=>o+u,0));return X(l)}),de=e.computed(()=>{const l=c.value.map((r,a)=>(r.values||[]).reduce((o,u)=>o+u));return X(l)}),L=e.computed(()=>(p.dataset.forEach((l,r)=>{[null,void 0].includes(l.values)&&n.error({componentName:"VueUiWaffle",type:"datasetSerieAttribute",property:"values (number[])",index:r})}),c.value.filter((l,r)=>!v.value.includes(l.uid)).map((l,r)=>({absoluteIndex:l.absoluteIndex,uid:l.uid,name:l.name,color:l.color,value:(l.values||[]).reduce((a,o)=>a+o,0),absoluteValues:l.values||[],proportion:ve.value[r]})))),he=e.computed(()=>c.value.map((l,r)=>({absoluteIndex:l.absoluteIndex,uid:l.uid,name:l.name,color:l.color,value:(l.values||[]).reduce((a,o)=>a+o,0),absoluteValues:l.values||[],proportion:de.value[r]})));function pe(){return he.value.map(l=>({name:l.name,color:l.color,value:l.value,proportion:l.proportion}))}const ye=e.computed(()=>{let l=0;return L.value.map((r,a)=>{const o=l,u=o+r.proportion,i=[];for(let d=Math.floor(o);d<Math.floor(u);d+=1)i.push(d);return l=u,{...r,start:o,rects:i}})}),s=e.computed(()=>ye.value.flatMap((l,r)=>l.rects.map((a,o)=>({isFirst:o===0,isLongEnough:a.length>2,name:l.name,color:l.color,value:l.value,serieIndex:r,absoluteStartIndex:o<3,serieId:l.uid,...l}))).map((l,r)=>({...l,isAbsoluteFirst:r%t.value.style.chart.layout.grid.size===0}))),T=e.computed(()=>{const l=[];for(let r=0;r<t.value.style.chart.layout.grid.size;r+=1)for(let a=0;a<t.value.style.chart.layout.grid.size;a+=1)l.push({isStartOfLine:a===0,position:t.value.style.chart.layout.grid.vertical?r:a,x:(t.value.style.chart.layout.grid.vertical?r:a)*(w.value+t.value.style.chart.layout.grid.spaceBetween),y:(t.value.style.chart.layout.grid.vertical?a:r)*(x.value+t.value.style.chart.layout.grid.spaceBetween)+y.value.top});return l}),v=e.ref([]),C=e.ref(!1),K=e.ref(null),Q=e.ref(null);function Z(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 r=J.value.find(u=>u.uid===l).values.reduce((u,i)=>u+i,0);let o=c.value.find(u=>u.uid===l).values.reduce((u,i)=>u+i,0);if(v.value.includes(l)){let i=function(){o>u?(cancelAnimationFrame(K.value),c.value=c.value.map((d,h)=>d.uid===l?{...d,values:[u]}:d),C.value=!1):(C.value=!0,o+=u*.025,c.value=c.value.map((d,h)=>d.uid===l?{...d,values:[o]}:d),K.value=requestAnimationFrame(i))};v.value=v.value.filter(d=>d!==l);const u=r;i()}else if(v.value.length<_.value.length-1&&_.value.length>1){let u=function(){o<.1?(cancelAnimationFrame(Q.value),v.value.push(l),c.value=c.value.map((i,d)=>i.uid===l?{...i,values:[0]}:i),C.value=!1):(C.value=!0,o/=1.5,c.value=c.value.map((i,d)=>i.uid===l?{...i,values:[o]}:i),Q.value=requestAnimationFrame(u))};u()}se("selectLegend",L.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(()=>c.value.map((l,r)=>({name:l.name,color:l.color||Y[r]||n.palette[r]||n.palette[r%n.palette.length],value:(l.values||[]).reduce((a,o)=>a+o,0),uid:l.uid,shape:"square"})).map((l,r)=>({...l,proportion:l.value/c.value.map(a=>(a.values||[]).reduce((o,u)=>o+u,0)).reduce((a,o)=>a+o,0),opacity:v.value.includes(l.uid)?.5:1,segregate:()=>Z(l.uid),isSegregated:v.value.includes(l.uid)}))),fe=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(()=>L.value.map(l=>l.value).reduce((l,r)=>l+r,0)),O=e.ref(null);function ge(l){if(v.value.length===p.dataset.length)return;const r=s.value[l];O.value={datapoint:r,seriesIndex:r.absoluteIndex,series:c.value,config:t.value},F.value=!0,B.value=s.value[l].serieIndex;const a=t.value.style.chart.tooltip.customFormat;if(n.isFunction(a)&&n.functionReturnsString(()=>a({seriesIndex:s.value[l].absoluteIndex,datapoint:r,series:c.value,config:t.value})))D.value=a({seriesIndex:s.value[l].absoluteIndex,datapoint:r,series:c.value,config:t.value});else{let o="";if(o+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${r.name}</div>`,o+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><rect x="0" y="0" height="12" width="12" stroke="none" rx="1" fill="${r.color}" /></svg>`,t.value.style.chart.tooltip.showValue&&(o+=`<b>${n.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,r.value,n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:r.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:r,seriesIndex:s.value[l].absoluteIndex,series:c.value})}</b>`),t.value.style.chart.tooltip.showPercentage){const u=n.dataLabel({v:r.value/f.value*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage});t.value.style.chart.tooltip.showValue?o+=`<span>(${u})</span></div>`:o+=`<b>${u}%</b></div>`}D.value=o}}const g=e.computed(()=>{const l=L.value.map(a=>({name:a.name,color:a.color})),r=L.value.map(a=>a.value);return{head:l,body:r}});function A(l){return t.value.useBlurOnHover&&![null,void 0].includes(B.value)&&B.value!==l?`url(#blur_${b.value})`:""}function ee(){e.nextTick(()=>{const l=g.value.head.map((o,u)=>[[o.name],[g.value.body[u]],[isNaN(g.value.body[u]/f.value)?"-":g.value.body[u]/f.value*100]]),r=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(l),a=n.createCsvContent(r);n.downloadCsv({csvContent:a,title:t.value.style.chart.title.text||"vue-ui-waffle"})})}const z=e.computed(()=>{const l=[' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>',n.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,f.value,n.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%"],r=g.value.head.map((u,i)=>[{color:u.color,name:u.name},n.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,g.value.body[i],n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:g.value.body[i],s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue})),isNaN(g.value.body[i]/f.value)?"-":n.dataLabel({v:g.value.body[i]/f.value*100,s:"%",r:t.value.table.td.roundingPercentage})]),a={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},shape:"square",breakpoint:t.value.table.responsiveBreakpoint},o=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage];return{head:l,body:r,config:a,colNames:o}}),V=e.ref(!1);function me(l){V.value=l,q.value+=1}function te(){m.value.showTable=!m.value.showTable}function le(){m.value.showTooltip=!m.value.showTooltip}return ne({getData:pe,generatePdf:W,generateCsv:ee,generateImage:H,toggleTable:te,toggleTooltip:le}),(l,r)=>(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_${b.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:R,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:12px`)},[e.createVNode(be._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(oe.UserOptions,{ref_key:"details",ref:ce,key:`user_options_${q.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(j),isImaging:e.unref(G),uid:b.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:V.value,isTooltip:m.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:N.value,onToggleFullscreen:me,onGeneratePdf:e.unref(W),onGenerateCsv:ee,onGenerateImage:e.unref(H),onToggleTable:te,onToggleTooltip:le},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:o})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:o})),void 0,!0)]),key:"5"}:void 0]),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(n.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":V.value,"vue-data-ui-fulscreen--off":!V.value}),viewBox:`0 0 ${k.value.width<=0?10:k.value.width} ${k.value.height<=0?10:k.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:${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(s.value,(a,o)=>(e.openBlock(),e.createElementBlock("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`gradient_${b.value}_${o}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(n.shiftHue)(a.color,.05)}${e.unref(n.opacity)[100-t.value.style.chart.layout.rect.gradientIntensity]}`},null,8,Le),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,Te)],8,$e))),256))]),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${b.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},Ee,8,Ve)]),t.value.useCustomCells?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(T.value,(a,o)=>(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:s.value[o].color,...s.value[o]},isSelected:[null,void 0].includes(B.value)?!0:s.value[o].serieIndex===B.value})),void 0,!0)],8,ze))),256)):e.createCommentVNode("",!0),!s.value.length&&!t.value.useCustomCells?(e.openBlock(),e.createElementBlock("rect",{key:1,x:12,y:12,height:y.value.height-24,width:y.value.width-24,rx:3,fill:"none",stroke:"black"},null,8,Fe)):s.value.length&&!t.value.useCustomCells?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(a,o)=>(e.openBlock(),e.createElementBlock("rect",{rx:t.value.style.chart.layout.rect.rounded?t.value.style.chart.layout.rect.rounding:0,x:a.x+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.grid.spaceBetween/2,height: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:A(s.value[o].serieIndex)},null,8,De))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(a,o)=>(e.openBlock(),e.createElementBlock("rect",{rx:t.value.style.chart.layout.rect.rounded?t.value.style.chart.layout.rect.rounding:0,x:a.x+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.grid.spaceBetween/2,height: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_${b.value}_${o})`:s.value[o].color,stroke:t.value.style.chart.layout.rect.stroke,"stroke-width":t.value.style.chart.layout.rect.strokeWidth,filter:A(s.value[o].serieIndex)},null,8,Oe))),256))],64)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(a,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[s.value.length&&!C.value&&!t.value.style.chart.layout.grid.vertical&&t.value.style.chart.layout.labels.captions.show&&(s.value[o].isFirst&&a.position<t.value.style.chart.layout.grid.size-2||s.value[o].isAbsoluteFirst&&o%t.value.style.chart.layout.grid.size===0&&s.value[o].absoluteStartIndex)?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:a.x+t.value.style.chart.layout.labels.captions.offsetX+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.labels.captions.offsetY+t.value.style.chart.layout.grid.spaceBetween/2,height:E.value<=0?1e-4:E.value,width:$.value*t.value.style.chart.layout.grid.size<=0?1e-4:$.value*t.value.style.chart.layout.grid.size,filter:A(s.value[o].serieIndex)},[e.createElementVNode("div",{class:"vue-ui-waffle-caption",style:e.normalizeStyle(`height: 100%; width: 100%; font-size:${t.value.style.chart.layout.labels.captions.fontSize}px;display:flex;align-items:center;justify-content:flex-start;padding: 0 ${$.value/12}px;color:${e.unref(n.adaptColorToBackground)(s.value[o].color)};gap:2px`)},[t.value.style.chart.layout.labels.captions.showSerieName?(e.openBlock(),e.createElementBlock("span",Me,e.toDisplayString(t.value.style.chart.layout.labels.captions.serieNameAbbreviation?e.unref(n.abbreviate)({source:s.value[o].name,length:t.value.style.chart.layout.labels.captions.serieNameMaxAbbreviationSize}):s.value[o].name)+": ",1)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.captions.showPercentage?(e.openBlock(),e.createElementBlock("span",qe,e.toDisplayString(e.unref(n.dataLabel)({v:s.value[o].proportion,s:"%",r:t.value.style.chart.layout.labels.captions.roundingPercentage})),1)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.captions.showPercentage&&t.value.style.chart.layout.labels.captions.showValue?(e.openBlock(),e.createElementBlock("span",Re," ("+e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,s.value[o].value,e.unref(n.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:s.value[o].value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.layout.labels.captions.roundingValue}),{datapoint:s.value[o],position:a}))+") ",1)):e.createCommentVNode("",!0),!t.value.style.chart.layout.labels.captions.showPercentage&&t.value.style.chart.layout.labels.captions.showValue?(e.openBlock(),e.createElementBlock("span",Ue,e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,s.value[o].value,e.unref(n.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:s.value[o].value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.layout.labels.captions.roundingValue}),{datapoint:s.value[o],position:a})),1)):e.createCommentVNode("",!0)],4)],8,Ae)):e.createCommentVNode("",!0)],64))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(a,o)=>(e.openBlock(),e.createElementBlock("rect",{onMouseover:u=>ge(o),onMouseleave:r[0]||(r[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:E.value<=0?1e-4:E.value,width:$.value<=0?1e-4:$.value,fill:"transparent",stroke:"none"},null,40,je))),256)),e.renderSlot(l.$slots,"svg",{svg:k.value},void 0,!0)],14,Ne)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ge,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(j)||e.unref(G)})),void 0,!0)])):e.createCommentVNode("",!0),P.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ce.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:U},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(xe.Legend,{key:0,legendSet:_.value,config:fe.value,onClickMarker:r[1]||(r[1]=({legend:a})=>Z(a.uid))},{item:e.withCtx(({legend:a})=>[e.createElementVNode("div",{onClick:o=>a.segregate(),style:e.normalizeStyle(`opacity:${v.value.includes(a.uid)?.5:1}`)},[e.createTextVNode(e.toDisplayString(a.name)+": "+e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,a.value,e.unref(n.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:a.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.legend.roundingValue,isAnimating:C.value}),{datapoint:a}))+" ",1),v.value.includes(a.uid)?(e.openBlock(),e.createElementBlock("span",Ye," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",He," ("+e.toDisplayString(isNaN(a.value/f.value)?"-":e.unref(n.dataLabel)({v:a.value/f.value*100,s:"%",r:t.value.style.chart.legend.roundingPercentage,isAnimating:C.value}))+") ",1))],12,We)]),_:1},8,["legendSet","config"])):e.renderSlot(l.$slots,"legend",{key:1,legend:_.value},void 0,!0)],512),e.createVNode(ke._sfc_main,{show:m.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:D.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(Be.default,{key:5,hideDetails:"",config:{open:m.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(we.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:r[2]||(r[2]=a=>m.value.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createElementVNode("div",{innerHTML:a,style:{display:"flex","align-items":"center"}},null,8,Xe)]),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,Se))}},Ke=_e._export_sfc(Je,[["__scopeId","data-v-66e13c6a"]]);exports.default=Ke;
@@ -1,10 +1,10 @@
1
1
  import { computed as p, ref as s, watch as W, onMounted as q, onBeforeUnmount as J, openBlock as u, createElementBlock as v, normalizeStyle as C, createVNode as K, createCommentVNode as d, createBlock as A, unref as i, createSlots as Q, withCtx as _, renderSlot as y, normalizeProps as N, guardReactiveProps as M, normalizeClass as L, 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 U, X as re, i as ue, f as ie } from "./index-CAkeI2u7.js";
3
- import { _ as ce } from "./Title-DZ-9X7T_.js";
4
- import { u as he, U as ve } from "./usePrinter-MbSdbzew.js";
2
+ import { u as ae, c as le, t as se, o as ne, e as oe, s as U, X as re, i as ue, f as ie } from "./index-8Lp8V0TB.js";
3
+ import { _ as ce } from "./Title-0px6u9U5.js";
4
+ import { u as he, U as ve } from "./usePrinter-cCBJ71Cc.js";
5
5
  import { t as de, u as ye } from "./useResponsive-NZB-WLRF.js";
6
- import fe from "./vue-ui-skeleton-DtWvFTM9.js";
7
- import { u as X } from "./useNestedProp-N72tOTWX.js";
6
+ import fe from "./vue-ui-skeleton-apODtH32.js";
7
+ import { u as X } from "./useNestedProp-DE-a5lMx.js";
8
8
  import { _ as ge } from "./_plugin-vue_export-helper-CHgC5LLL.js";
9
9
  const me = ["id"], pe = ["xmlns", "viewBox"], ke = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-linecap"], we = ["cx", "cy", "r", "stroke", "stroke-width"], be = ["x", "y", "font-size", "fill", "font-weight"], Ce = {
10
10
  key: 3,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-DGxA8bUJ.cjs"),q=require("./Title-CUtmTGbN.cjs"),P=require("./usePrinter-DbJ9I2vE.cjs"),B=require("./useResponsive-B3TrDDIG.cjs"),T=require("./vue-ui-skeleton-CHI4nqtV.cjs"),I=require("./useNestedProp-DM4rgjhE.cjs"),L=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),U=["id"],G=["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"},D={__name:"vue-ui-wheel",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(S,{expose:z}){const r=S,{vue_ui_wheel:F}=s.useConfig(),f=e.computed(()=>!!r.dataset&&Object.keys(r.dataset).length),y=e.ref(s.createUid()),N=e.ref(null),g=e.ref(0),d=e.ref(null),p=e.ref(null),t=e.computed(()=>{const l=I.useNestedProp({userConfig:r.config,defaultConfig:F});return l.theme?{...I.useNestedProp({userConfig:s.themes.vue_ui_wheel[l.theme]||r.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),o=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,i=1){return{x:o.value.centerX+o.value.radius*Math.cos(29.85+l*Math.PI/180)*i,y:o.value.centerY+o.value.radius*Math.sin(29.85+l*Math.PI/180)*i}}const u=e.ref(t.value.style.chart.animation.use?0:r.dataset.percentage||0);e.watch(()=>r.dataset.percentage,()=>{u.value=e.ref(t.value.style.chart.animation.use?0:r.dataset.percentage||0),x()});const h=e.ref(null);e.onMounted(()=>{if(s.objectIsEmpty(r.dataset)&&s.error({componentName:"VueUiWheel",type:"dataset"}),x(),t.value.responsive){const l=B.throttle(()=>{const{width:i,height:a}=B.useResponsive({chart:d.value,title:t.value.style.chart.title.text?p.value:null});n.value.width=i,n.value.height=a,m.value=t.value.style.chart.layout.percentage.fontSize/360*Math.min(i,a)});h.value=new ResizeObserver(l),h.value.observe(d.value.parentNode)}}),e.onBeforeUnmount(()=>{h.value&&h.value.disconnect()});function x(){let l=0,i=t.value.style.chart.animation.speed,a=.005*t.value.style.chart.animation.acceleration;function c(){u.value+=i+l,l+=a,u.value<(r.dataset.percentage||0)?requestAnimationFrame(c):u.value=r.dataset.percentage||0}t.value.style.chart.animation.use&&(u.value=0,c())}const $=e.computed(()=>{const l=[];for(let a=0;a<100;a+=1){const c=u.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?s.shiftHue(c,a/100*(t.value.style.chart.layout.wheel.ticks.gradient.shiftHueIntensity/100)):c})}return l}),v=e.ref(!1);function O(l){v.value=l,g.value+=1}return z({generatePdf:C,generateImage:b}),(l,i)=>(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:N,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:c})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:c})),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(s.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,c)=>(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&&c<=u.value})},null,10,R))),256)),t.value.style.chart.layout.innerCircle.show?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:o.value.centerX,cy:o.value.centerY,r:o.value.radius*.8<=0?1e-4:o.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:o.value.centerX,y:o.value.centerY+m.value/3,"font-size":m.value,fill:t.value.style.chart.layout.wheel.ticks.gradient.show?e.unref(s.shiftHue)(t.value.style.chart.layout.wheel.ticks.activeColor,u.value/100*(t.value.style.chart.layout.wheel.ticks.gradient.shiftHueIntensity/100)):t.value.style.chart.layout.wheel.ticks.activeColor,"text-anchor":"middle","font-weight":t.value.style.chart.layout.percentage.bold?"bold":"normal",style:{"font-variant-numeric":"tabluar-nums"}},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.chart.layout.percentage.formatter,u.value,e.unref(s.dataLabel)({v:u.value,s:"%",r:t.value.style.chart.layout.percentage.rounding}))),9,j)):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"svg",{svg:n.value},void 0,!0)],14,G)):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,U))}},Y=L._export_sfc(D,[["__scopeId","data-v-a9569c10"]]);exports.default=Y;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-De6Dj52h.cjs"),q=require("./Title-CSRD5z1r.cjs"),P=require("./usePrinter-SLYneJmG.cjs"),B=require("./useResponsive-B3TrDDIG.cjs"),T=require("./vue-ui-skeleton-Cl9Kp9yE.cjs"),I=require("./useNestedProp-Vjg1xsU_.cjs"),L=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),U=["id"],G=["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"},D={__name:"vue-ui-wheel",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(S,{expose:z}){const r=S,{vue_ui_wheel:F}=s.useConfig(),f=e.computed(()=>!!r.dataset&&Object.keys(r.dataset).length),y=e.ref(s.createUid()),N=e.ref(null),g=e.ref(0),d=e.ref(null),p=e.ref(null),t=e.computed(()=>{const l=I.useNestedProp({userConfig:r.config,defaultConfig:F});return l.theme?{...I.useNestedProp({userConfig:s.themes.vue_ui_wheel[l.theme]||r.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),o=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,i=1){return{x:o.value.centerX+o.value.radius*Math.cos(29.85+l*Math.PI/180)*i,y:o.value.centerY+o.value.radius*Math.sin(29.85+l*Math.PI/180)*i}}const u=e.ref(t.value.style.chart.animation.use?0:r.dataset.percentage||0);e.watch(()=>r.dataset.percentage,()=>{u.value=e.ref(t.value.style.chart.animation.use?0:r.dataset.percentage||0),x()});const h=e.ref(null);e.onMounted(()=>{if(s.objectIsEmpty(r.dataset)&&s.error({componentName:"VueUiWheel",type:"dataset"}),x(),t.value.responsive){const l=B.throttle(()=>{const{width:i,height:a}=B.useResponsive({chart:d.value,title:t.value.style.chart.title.text?p.value:null});n.value.width=i,n.value.height=a,m.value=t.value.style.chart.layout.percentage.fontSize/360*Math.min(i,a)});h.value=new ResizeObserver(l),h.value.observe(d.value.parentNode)}}),e.onBeforeUnmount(()=>{h.value&&h.value.disconnect()});function x(){let l=0,i=t.value.style.chart.animation.speed,a=.005*t.value.style.chart.animation.acceleration;function c(){u.value+=i+l,l+=a,u.value<(r.dataset.percentage||0)?requestAnimationFrame(c):u.value=r.dataset.percentage||0}t.value.style.chart.animation.use&&(u.value=0,c())}const $=e.computed(()=>{const l=[];for(let a=0;a<100;a+=1){const c=u.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?s.shiftHue(c,a/100*(t.value.style.chart.layout.wheel.ticks.gradient.shiftHueIntensity/100)):c})}return l}),v=e.ref(!1);function O(l){v.value=l,g.value+=1}return z({generatePdf:C,generateImage:b}),(l,i)=>(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:N,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:c})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:c})),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(s.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,c)=>(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&&c<=u.value})},null,10,R))),256)),t.value.style.chart.layout.innerCircle.show?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:o.value.centerX,cy:o.value.centerY,r:o.value.radius*.8<=0?1e-4:o.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:o.value.centerX,y:o.value.centerY+m.value/3,"font-size":m.value,fill:t.value.style.chart.layout.wheel.ticks.gradient.show?e.unref(s.shiftHue)(t.value.style.chart.layout.wheel.ticks.activeColor,u.value/100*(t.value.style.chart.layout.wheel.ticks.gradient.shiftHueIntensity/100)):t.value.style.chart.layout.wheel.ticks.activeColor,"text-anchor":"middle","font-weight":t.value.style.chart.layout.percentage.bold?"bold":"normal",style:{"font-variant-numeric":"tabluar-nums"}},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.chart.layout.percentage.formatter,u.value,e.unref(s.dataLabel)({v:u.value,s:"%",r:t.value.style.chart.layout.percentage.rounding}))),9,j)):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"svg",{svg:n.value},void 0,!0)],14,G)):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,U))}},Y=L._export_sfc(D,[["__scopeId","data-v-a9569c10"]]);exports.default=Y;