vue-data-ui 2.3.96 → 2.3.98

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 (143) hide show
  1. package/dist/{Arrow-eiCuVfYA.cjs → Arrow-BLDzSVI-.cjs} +1 -1
  2. package/dist/{Arrow-Dse9W-xd.js → Arrow-DgyN_Z51.js} +1 -1
  3. package/dist/{BaseIcon-DJbzYsmN.cjs → BaseIcon-BriP3G7r.cjs} +1 -1
  4. package/dist/{BaseIcon-DFIHCTyJ.js → BaseIcon-CdxkWcA_.js} +1 -1
  5. package/dist/{DataTable-TdEc8llA.js → DataTable-CFtLoh2y.js} +2 -2
  6. package/dist/{DataTable-YpBvWSn5.cjs → DataTable-DT8VcwR5.cjs} +1 -1
  7. package/dist/{Legend-CsYNhmuM.cjs → Legend-BiaVNQjc.cjs} +1 -1
  8. package/dist/{Legend-BsB-CXKk.js → Legend-DlZZeU8Y.js} +1 -1
  9. package/dist/{PackageVersion-C5LvF-TN.js → PackageVersion-B2pJ6f4s.js} +1 -1
  10. package/dist/{PackageVersion-kqwH1rG4.cjs → PackageVersion-DMkpXFFU.cjs} +1 -1
  11. package/dist/{Shape-CyDjKOjw.cjs → Shape-CLCzNUYM.cjs} +1 -1
  12. package/dist/{Shape-DpWOBZlx.js → Shape-CbyenPbK.js} +1 -1
  13. package/dist/{Slicer-BQr2RZjz.js → Slicer-C2ocGjgt.js} +2 -2
  14. package/dist/{Slicer-D-wCwIJ3.cjs → Slicer-CCE1xFS8.cjs} +1 -1
  15. package/dist/{Title-BMSO566P.js → Title-DqYX5EDQ.js} +1 -1
  16. package/dist/{Title-DWSN4YUC.cjs → Title-spYln43E.cjs} +1 -1
  17. package/dist/{Tooltip-CHABi2zh.js → Tooltip-7I8a4mo2.js} +1 -1
  18. package/dist/{Tooltip-Bl8Ilf5h.cjs → Tooltip-BgkDlGZj.cjs} +1 -1
  19. package/dist/{index-BcpaEQjg.js → index-CHn5mpNE.js} +724 -702
  20. package/dist/{index-Bv8wGGBc.cjs → index-xtIm3ydy.cjs} +8 -8
  21. package/dist/style.css +1 -1
  22. package/dist/{useNestedProp-CEsVEbKF.js → useNestedProp-BF5raFbY.js} +1 -1
  23. package/dist/{useNestedProp-Bf7w6kTt.cjs → useNestedProp-XzXFHriE.cjs} +1 -1
  24. package/dist/{usePrinter-7jNVagoH.cjs → usePrinter-BrE53tUa.cjs} +1 -1
  25. package/dist/{usePrinter-DzCuoQHM.js → usePrinter-DNwJl64i.js} +1 -1
  26. package/dist/{vue-data-ui-BFU1Dig_.js → vue-data-ui-D74akyv3.js} +57 -57
  27. package/dist/{vue-data-ui-Bs74qL5y.cjs → vue-data-ui-DyzsgRrE.cjs} +1 -1
  28. package/dist/vue-data-ui.cjs +1 -1
  29. package/dist/vue-data-ui.js +7 -7
  30. package/dist/{vue-ui-3d-bar-4ue7sfgA.js → vue-ui-3d-bar-CEIsvuEw.js} +8 -8
  31. package/dist/{vue-ui-3d-bar-DxfiT-RQ.cjs → vue-ui-3d-bar-DABkuo-g.cjs} +1 -1
  32. package/dist/{vue-ui-accordion-CSkH8Ztm.cjs → vue-ui-accordion-DDiQi7FV.cjs} +1 -1
  33. package/dist/{vue-ui-accordion-Dhi5XiYk.js → vue-ui-accordion-DXd5ND_A.js} +3 -3
  34. package/dist/{vue-ui-age-pyramid-BApJ-rfW.js → vue-ui-age-pyramid-Bk87h-18.js} +9 -9
  35. package/dist/{vue-ui-age-pyramid-Ds5Q2JFz.cjs → vue-ui-age-pyramid-DgDByrGl.cjs} +1 -1
  36. package/dist/{vue-ui-annotator-BASwkqF2.js → vue-ui-annotator-B6velitp.js} +1 -1
  37. package/dist/{vue-ui-annotator-8qRRkhYB.cjs → vue-ui-annotator-CC523zDg.cjs} +1 -1
  38. package/dist/{vue-ui-candlestick-Dlgm0_M_.js → vue-ui-candlestick-BW7ajYg7.js} +10 -10
  39. package/dist/{vue-ui-candlestick-CljlKMFQ.cjs → vue-ui-candlestick-DbU_XaYN.cjs} +1 -1
  40. package/dist/{vue-ui-carousel-table-DkveY2W7.cjs → vue-ui-carousel-table-23OR7otR.cjs} +1 -1
  41. package/dist/{vue-ui-carousel-table-3izbh8XN.js → vue-ui-carousel-table-C2GpkqxJ.js} +4 -4
  42. package/dist/{vue-ui-chestnut-DzKXA8vJ.js → vue-ui-chestnut-s4sYE-Yq.js} +7 -7
  43. package/dist/{vue-ui-chestnut-CQu1jOyT.cjs → vue-ui-chestnut-ynySog92.cjs} +1 -1
  44. package/dist/{vue-ui-cursor-BrBsIJo3.js → vue-ui-cursor-B3OZaotE.js} +2 -2
  45. package/dist/{vue-ui-cursor-DbQV-LLF.cjs → vue-ui-cursor-C0JCZjSM.cjs} +1 -1
  46. package/dist/{vue-ui-dashboard-DXdmiwYq.js → vue-ui-dashboard-B8glPKoJ.js} +2 -2
  47. package/dist/{vue-ui-dashboard-Wzves807.cjs → vue-ui-dashboard-Bn3v9JMP.cjs} +1 -1
  48. package/dist/{vue-ui-digits-BppnP8CH.js → vue-ui-digits-BTw5A-9I.js} +2 -2
  49. package/dist/{vue-ui-digits-CSQi9Lh3.cjs → vue-ui-digits-Bf3jPyKq.cjs} +1 -1
  50. package/dist/{vue-ui-donut-DkHShWM1.js → vue-ui-donut-CMHiEbv5.js} +10 -10
  51. package/dist/{vue-ui-donut-evolution-oDtnYccI.js → vue-ui-donut-evolution-Cn-kZE-i.js} +10 -10
  52. package/dist/{vue-ui-donut-evolution-CwOes6ko.cjs → vue-ui-donut-evolution-DMM09v7x.cjs} +1 -1
  53. package/dist/{vue-ui-donut-CqlGTsGd.cjs → vue-ui-donut-yfNvdjlP.cjs} +1 -1
  54. package/dist/{vue-ui-dumbbell-DQlj4MnV.cjs → vue-ui-dumbbell-6liDM1Uq.cjs} +1 -1
  55. package/dist/{vue-ui-dumbbell-CDv2q1Sr.js → vue-ui-dumbbell-BRgiYAXh.js} +9 -9
  56. package/dist/{vue-ui-flow-Bx-zjQWh.cjs → vue-ui-flow-B7wvK8sK.cjs} +1 -1
  57. package/dist/{vue-ui-flow-1DFcpdAA.js → vue-ui-flow-CkRBNjsz.js} +8 -8
  58. package/dist/{vue-ui-galaxy-BqB8ilSB.cjs → vue-ui-galaxy-BuuC5iw-.cjs} +1 -1
  59. package/dist/{vue-ui-galaxy-bE0htYx4.js → vue-ui-galaxy-C1I2rPqV.js} +10 -10
  60. package/dist/{vue-ui-gauge-QgQpiMpP.js → vue-ui-gauge-B0PNChvw.js} +6 -6
  61. package/dist/{vue-ui-gauge-B3fJ7NBS.cjs → vue-ui-gauge-BvJ0qzq4.cjs} +1 -1
  62. package/dist/{vue-ui-gizmo-BPTXhk_5.cjs → vue-ui-gizmo-C6G_WlP5.cjs} +1 -1
  63. package/dist/{vue-ui-gizmo-Dvhxmifg.js → vue-ui-gizmo-HvL1eMUO.js} +3 -3
  64. package/dist/{vue-ui-heatmap-mKhWCDCz.cjs → vue-ui-heatmap-5ALzyHu_.cjs} +1 -1
  65. package/dist/{vue-ui-heatmap-Dz__vLIx.js → vue-ui-heatmap-CQXqbbaT.js} +9 -9
  66. package/dist/{vue-ui-kpi-By6cERhR.cjs → vue-ui-kpi-5u25Gbfg.cjs} +1 -1
  67. package/dist/{vue-ui-kpi-CBUwc_CD.js → vue-ui-kpi-JIlZQFAC.js} +3 -3
  68. package/dist/{vue-ui-mini-loader-jX_8sp7v.cjs → vue-ui-mini-loader-DcJ58uSW.cjs} +1 -1
  69. package/dist/{vue-ui-mini-loader-DgHibV20.js → vue-ui-mini-loader-Dktn_fME.js} +2 -2
  70. package/dist/{vue-ui-molecule-DKpW8ux_.js → vue-ui-molecule-BSSNMC6m.js} +10 -10
  71. package/dist/{vue-ui-molecule-B0U_SHX-.cjs → vue-ui-molecule-Wefpekma.cjs} +1 -1
  72. package/dist/{vue-ui-mood-radar-DVChUb6f.cjs → vue-ui-mood-radar-B7oYZs55.cjs} +1 -1
  73. package/dist/{vue-ui-mood-radar-DCDK2sIV.js → vue-ui-mood-radar-D4fVO5iO.js} +10 -10
  74. package/dist/{vue-ui-nested-donuts-FMQPCwII.js → vue-ui-nested-donuts-4_tabA8c.js} +10 -10
  75. package/dist/{vue-ui-nested-donuts-CGp-Jubi.cjs → vue-ui-nested-donuts-ClqZ-eJl.cjs} +1 -1
  76. package/dist/{vue-ui-onion-DL6021Q8.js → vue-ui-onion-Ch6BgUFP.js} +10 -10
  77. package/dist/{vue-ui-onion-uId6GP2z.cjs → vue-ui-onion-DQ9E4dGJ.cjs} +1 -1
  78. package/dist/{vue-ui-parallel-coordinate-plot-BQuvfJQt.js → vue-ui-parallel-coordinate-plot-BtZ1F37V.js} +11 -11
  79. package/dist/{vue-ui-parallel-coordinate-plot-BQnqXMkU.cjs → vue-ui-parallel-coordinate-plot-CeXmNMQ-.cjs} +1 -1
  80. package/dist/{vue-ui-quadrant-rUE9NWa4.js → vue-ui-quadrant-CGiq44Mt.js} +11 -11
  81. package/dist/{vue-ui-quadrant-D0aD-7Tw.cjs → vue-ui-quadrant-fhNZ5-B5.cjs} +1 -1
  82. package/dist/{vue-ui-quick-chart-Jh4YDviZ.js → vue-ui-quick-chart-B-vFmpy5.js} +8 -8
  83. package/dist/{vue-ui-quick-chart-D-sbJNy5.cjs → vue-ui-quick-chart-DI4IPOIj.cjs} +1 -1
  84. package/dist/{vue-ui-radar-De-YX5t1.cjs → vue-ui-radar-B80HMKEf.cjs} +1 -1
  85. package/dist/{vue-ui-radar-Bfdoz0Xo.js → vue-ui-radar-DWzxx466.js} +11 -11
  86. package/dist/{vue-ui-rating-Dur118_W.cjs → vue-ui-rating-BOGhqulq.cjs} +1 -1
  87. package/dist/{vue-ui-rating-D9vACqJ2.js → vue-ui-rating-CPuKzB4x.js} +2 -2
  88. package/dist/{vue-ui-relation-circle-Dux0WfBo.cjs → vue-ui-relation-circle-DNaNyiIv.cjs} +1 -1
  89. package/dist/{vue-ui-relation-circle-CnRm-wQ3.js → vue-ui-relation-circle-dUlg-_QI.js} +6 -6
  90. package/dist/{vue-ui-rings-BkrRebjS.cjs → vue-ui-rings-C_z0XK6f.cjs} +1 -1
  91. package/dist/{vue-ui-rings-B3K3LXLl.js → vue-ui-rings-CqFaPqaR.js} +10 -10
  92. package/dist/{vue-ui-scatter-DejGOjhr.js → vue-ui-scatter-Bsfc6z4K.js} +147 -147
  93. package/dist/vue-ui-scatter-DFiICBjw.cjs +1 -0
  94. package/dist/{vue-ui-screenshot-C08awO8c.js → vue-ui-screenshot-CXptYbDY.js} +1 -1
  95. package/dist/{vue-ui-screenshot-Bar9x-5m.cjs → vue-ui-screenshot-uE34c5Im.cjs} +1 -1
  96. package/dist/{vue-ui-skeleton-C53xk8CG.js → vue-ui-skeleton-BmPO8QNa.js} +3 -3
  97. package/dist/{vue-ui-skeleton-TRdDtmHK.cjs → vue-ui-skeleton-g8cEqYmt.cjs} +1 -1
  98. package/dist/{vue-ui-smiley-Cea-O3KH.js → vue-ui-smiley-ByBzn20M.js} +2 -2
  99. package/dist/{vue-ui-smiley-Dav2CD3O.cjs → vue-ui-smiley-DQEb9ejw.cjs} +1 -1
  100. package/dist/{vue-ui-spark-trend-6ntFUEU4.cjs → vue-ui-spark-trend-BXiiilKK.cjs} +1 -1
  101. package/dist/{vue-ui-spark-trend-Bs8twUaY.js → vue-ui-spark-trend-DYfjqLKr.js} +18 -18
  102. package/dist/{vue-ui-sparkbar-C21yWQQ3.cjs → vue-ui-sparkbar-BCqmWJWk.cjs} +1 -1
  103. package/dist/{vue-ui-sparkbar-Cbmc-caP.js → vue-ui-sparkbar-D37uDtG6.js} +4 -4
  104. package/dist/{vue-ui-sparkgauge-BmamgyGt.cjs → vue-ui-sparkgauge-Dp4bJ89f.cjs} +1 -1
  105. package/dist/{vue-ui-sparkgauge-0GVv8hjM.js → vue-ui-sparkgauge-f1tYOMwd.js} +4 -4
  106. package/dist/{vue-ui-sparkhistogram-DCM-BHkv.js → vue-ui-sparkhistogram-DHYJG6d0.js} +5 -5
  107. package/dist/{vue-ui-sparkhistogram-CfdPXl3J.cjs → vue-ui-sparkhistogram-Gh_h9QK_.cjs} +1 -1
  108. package/dist/{vue-ui-sparkline-BYJczOkd.js → vue-ui-sparkline-CENc9bgs.js} +4 -4
  109. package/dist/{vue-ui-sparkline-BTNHzn2V.cjs → vue-ui-sparkline-CkPExlPm.cjs} +1 -1
  110. package/dist/{vue-ui-sparkstackbar-CkAqCQvJ.js → vue-ui-sparkstackbar-BNUyfD4B.js} +4 -4
  111. package/dist/{vue-ui-sparkstackbar-DRhK17o6.cjs → vue-ui-sparkstackbar-WWR3yYii.cjs} +1 -1
  112. package/dist/{vue-ui-stackbar-CfYTo4Ku.js → vue-ui-stackbar-BQC8Ca_b.js} +33 -33
  113. package/dist/{vue-ui-stackbar-DYBUaxzj.cjs → vue-ui-stackbar-CFIZ94i3.cjs} +1 -1
  114. package/dist/{vue-ui-strip-plot-CIN4KwoI.cjs → vue-ui-strip-plot-BEyk6uih.cjs} +1 -1
  115. package/dist/{vue-ui-strip-plot-DEXBmsAI.js → vue-ui-strip-plot-OPkq7c7M.js} +10 -10
  116. package/dist/{vue-ui-table-DRpceoPe.cjs → vue-ui-table-Btz8Txup.cjs} +1 -1
  117. package/dist/{vue-ui-table-nN3CrtRu.js → vue-ui-table-DQno4vjF.js} +16 -16
  118. package/dist/{vue-ui-table-heatmap-DGJ9FlVp.cjs → vue-ui-table-heatmap-DAQ3DL1R.cjs} +1 -1
  119. package/dist/{vue-ui-table-heatmap-BA2teZNQ.js → vue-ui-table-heatmap-Dvl7B3i2.js} +15 -15
  120. package/dist/{vue-ui-table-sparkline-BvnGInz9.js → vue-ui-table-sparkline-DJwhjePK.js} +16 -16
  121. package/dist/{vue-ui-table-sparkline-Cu3WXN2z.cjs → vue-ui-table-sparkline-ZEGDkLve.cjs} +1 -1
  122. package/dist/{vue-ui-thermometer-DbZ0o20q.cjs → vue-ui-thermometer-DCP3GH7M.cjs} +1 -1
  123. package/dist/{vue-ui-thermometer-tMXK87ka.js → vue-ui-thermometer-Dmi60VAf.js} +6 -6
  124. package/dist/{vue-ui-timer-SzmYKRd2.js → vue-ui-timer-BffyRll5.js} +5 -5
  125. package/dist/{vue-ui-timer-BC8eaIGC.cjs → vue-ui-timer-BjlYd8dM.cjs} +1 -1
  126. package/dist/{vue-ui-tiremarks-D-OLOU0v.cjs → vue-ui-tiremarks-2RGbitnQ.cjs} +1 -1
  127. package/dist/{vue-ui-tiremarks-Ckslwdk8.js → vue-ui-tiremarks-GSBKzXEK.js} +6 -6
  128. package/dist/{vue-ui-treemap-Mm79m8P6.js → vue-ui-treemap-CuYV5RnC.js} +10 -10
  129. package/dist/{vue-ui-treemap-CUtRsRug.cjs → vue-ui-treemap-D0wMLDpi.cjs} +1 -1
  130. package/dist/{vue-ui-vertical-bar-CvLxGsDB.cjs → vue-ui-vertical-bar-CqH76_tw.cjs} +1 -1
  131. package/dist/{vue-ui-vertical-bar-r6pUOD2L.js → vue-ui-vertical-bar-n6-aILoL.js} +10 -10
  132. package/dist/{vue-ui-waffle-CSyW6ncV.cjs → vue-ui-waffle-CUw9wjum.cjs} +1 -1
  133. package/dist/{vue-ui-waffle-C_9IOFs2.js → vue-ui-waffle-DN0nEorT.js} +10 -10
  134. package/dist/{vue-ui-wheel-CKr2Vu47.cjs → vue-ui-wheel-bauD1n_w.cjs} +1 -1
  135. package/dist/{vue-ui-wheel-BOhOVAnh.js → vue-ui-wheel-gFxj5brx.js} +6 -6
  136. package/dist/{vue-ui-word-cloud-ES0R6vuB.js → vue-ui-word-cloud-BXCUAiAK.js} +26 -26
  137. package/dist/{vue-ui-word-cloud-D2pGh3Xa.cjs → vue-ui-word-cloud-CzXCfW8Q.cjs} +1 -1
  138. package/dist/{vue-ui-xy-CyFLJGSu.js → vue-ui-xy-BbRzriSg.js} +272 -272
  139. package/dist/{vue-ui-xy-BASuw3ZU.cjs → vue-ui-xy-CEfc7szr.cjs} +2 -2
  140. package/dist/{vue-ui-xy-canvas-BSV_IOwc.js → vue-ui-xy-canvas-Cw-F7w38.js} +34 -34
  141. package/dist/{vue-ui-xy-canvas-1N7guNkI.cjs → vue-ui-xy-canvas-DhHuhTxz.cjs} +1 -1
  142. package/package.json +1 -1
  143. package/dist/vue-ui-scatter-DeebI4Fn.cjs +0 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-Bv8wGGBc.cjs"),ie=require("./useResponsive-B3TrDDIG.cjs"),_e=require("./Title-DWSN4YUC.cjs"),ce=require("./usePrinter-7jNVagoH.cjs"),Se=require("./Tooltip-Bl8Ilf5h.cjs"),Ne=require("./DataTable-YpBvWSn5.cjs"),Le=require("./Legend-CsYNhmuM.cjs"),$e=require("./vue-ui-skeleton-TRdDtmHK.cjs"),Te=require("./vue-ui-accordion-CSkH8Ztm.cjs"),ve=require("./useNestedProp-Bf7w6kTt.cjs"),Pe=require("./PackageVersion-kqwH1rG4.cjs"),Ve=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),de=S=>(e.pushScopeId("data-v-a0574c0d"),S=S(),e.popScopeId(),S),Ie=["id"],Ee=["xmlns","viewBox"],ze=["id"],Fe=["stop-color"],De=["stop-color"],Oe=["id"],Ae=de(()=>e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:2},null,-1)),qe=de(()=>e.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1)),Me=[Ae,qe],Re=["x","y","height","width"],Ue=["height","width"],je=["rx","x","y","height","width","stroke","stroke-width","filter"],Ge=["rx","x","y","height","width","fill","stroke","stroke-width","filter"],We=["x","y","height","width","filter"],He={key:0},Ye={key:1},Xe={key:2},Je={key:3},Ke=["onMouseover","x","y","height","width"],Qe={key:3,class:"vue-data-ui-watermark"},Ze=["onClick"],et={key:0},tt={key:1},lt=["innerHTML"],at={__name:"vue-ui-waffle",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(S,{expose:pe,emit:he}){const p=S,{vue_ui_waffle:fe}=n.useConfig(),V=e.computed(()=>!!p.dataset&&p.dataset.length),b=e.ref(n.createUid()),ye=e.ref(null),F=e.ref(!1),D=e.ref(""),B=e.ref(null),M=e.ref(0),N=e.ref(null),R=e.ref(null),U=e.ref(null),j=e.ref(0),G=e.ref(0),W=e.ref(0),t=e.computed({get:()=>H(),set:l=>l});function H(){const l=ve.useNestedProp({userConfig:p.config,defaultConfig:fe});return l.theme?{...ve.useNestedProp({userConfig:n.themes.vue_ui_waffle[l.theme]||p.config,defaultConfig:l}),customPalette:n.themePalettes[l.theme]||n.palette}:l}e.watch(()=>p.config,l=>{t.value=H(),Y(),j.value+=1,G.value+=1,W.value+=1},{deep:!0});const I=e.ref(null);function Y(){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=ie.throttle(()=>{const{width:r,height:a}=ie.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,f.value.width=r,f.value.height=a});I.value=new ResizeObserver(l),I.value.observe(N.value.parentNode)}}e.onMounted(()=>{Y()}),e.onBeforeUnmount(()=>{I.value&&I.value.disconnect()});const{isPrinting:X,isImaging:J,generatePdf:K,generateImage:Q}=ce.usePrinter({elementId:`vue-ui-waffle_${b.value}`,fileName:t.value.style.chart.title.text||"vue-ui-waffle"}),Z=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),m=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),k=e.ref({height:512,width:512}),f=e.ref({top:0,left:0,height:512,width:512}),w=e.computed(()=>(f.value.width-t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.spaceBetween)/t.value.style.chart.layout.grid.size),x=e.computed(()=>(f.value.height-t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.spaceBetween)/t.value.style.chart.layout.grid.size),L=e.computed(()=>f.value.width/t.value.style.chart.layout.grid.size),E=e.computed(()=>f.value.height/t.value.style.chart.layout.grid.size);function ee(l){const r=t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.size,a=l.reduce((h,q)=>h+q,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,q)=>h+q,0);for(;d>0;){let h=i.indexOf(Math.max(...i));u[h]+=1,i[h]=0,d-=1}return u}function te(){return p.dataset.map((l,r)=>({...l,color:n.convertColorToHex(l.color)||Z.value[r]||n.palette[r]||n.palette[r%n.palette.length],uid:`serie_${r}`,absoluteIndex:r}))}const le=e.computed(()=>te()),c=e.ref(le.value);e.watch(()=>p.dataset,l=>{c.value=te()},{deep:!0});const ge=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 ee(l)}),me=e.computed(()=>{const l=c.value.map((r,a)=>(r.values||[]).reduce((o,u)=>o+u));return ee(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:ge.value[r]})))),be=e.computed(()=>c.value.map((l,r)=>({absoluteIndex:l.absoluteIndex,uid:l.uid,name:l.name,color:l.color,value:(l.values||[]).reduce((a,o)=>a+o,0),absoluteValues:l.values||[],proportion:me.value[r]})));function ke(){return be.value.map(l=>({name:l.name,color:l.color,value:l.value,proportion:l.proportion}))}const we=e.computed(()=>{let l=0;return $.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(()=>we.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)+f.value.top});return l}),v=e.ref([]),C=e.ref(!1),ae=e.ref(null),oe=e.ref(null);function re(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=le.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(ae.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),ae.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(oe.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),oe.value=requestAnimationFrame(u))};u()}he("selectLegend",$.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||Z[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:()=>re(l.uid),isSegregated:v.value.includes(l.uid)}))),xe=e.computed(()=>({cy:"waffle-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),y=e.computed(()=>$.value.map(l=>l.value).reduce((l,r)=>l+r,0)),O=e.ref(null);function Ce(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/y.value*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage});t.value.style.chart.tooltip.showValue?o+=`<span>(${u})</span></div>`:o+=`<b>${u}%</b></div>`}D.value=o}}const g=e.computed(()=>{const l=$.value.map(a=>({name:a.name,color:a.color})),r=$.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 ue(){e.nextTick(()=>{const l=g.value.head.map((o,u)=>[[o.name],[g.value.body[u]],[isNaN(g.value.body[u]/y.value)?"-":g.value.body[u]/y.value*100]]),r=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(l),a=n.createCsvContent(r);n.downloadCsv({csvContent:a,title:t.value.style.chart.title.text||"vue-ui-waffle"})})}const z=e.computed(()=>{const l=[' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>',n.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,y.value,n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:y.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue})),"100%"],r=g.value.head.map((u,i)=>[{color:u.color,name:u.name},n.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,g.value.body[i],n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:g.value.body[i],s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue})),isNaN(g.value.body[i]/y.value)?"-":n.dataLabel({v:g.value.body[i]/y.value*100,s:"%",r:t.value.table.td.roundingPercentage})]),a={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},shape:"square",breakpoint:t.value.table.responsiveBreakpoint},o=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage];return{head:l,body:r,config:a,colNames:o}}),P=e.ref(!1);function Be(l){P.value=l,M.value+=1}function ne(){m.value.showTable=!m.value.showTable}function se(){m.value.showTooltip=!m.value.showTooltip}return pe({getData:ke,generatePdf:K,generateCsv:ue,generateImage:Q,toggleTable:ne,toggleTooltip:se}),(l,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-waffle ${P.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:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(_e._sfc_main,{key:`title_${j.value}`,config:{title:{cy:"waffle-title",...t.value.style.chart.title},subtitle:{cy:"waffle-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&V.value?(e.openBlock(),e.createBlock(ce.UserOptions,{ref_key:"details",ref:ye,key:`user_options_${M.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(X),isImaging:e.unref(J),uid:b.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:P.value,isTooltip:m.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:N.value,position:t.value.userOptions.position,onToggleFullscreen:Be,onGeneratePdf:e.unref(K),onGenerateCsv:ue,onGenerateImage:e.unref(Q),onToggleTable:ne,onToggleTooltip:se},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","position","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),V.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(n.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":P.value,"vue-data-ui-fulscreen--off":!P.value}),viewBox:`0 0 ${k.value.width<=0?10:k.value.width} ${k.value.height<=0?10:k.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Pe._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(a,o)=>(e.openBlock(),e.createElementBlock("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`gradient_${b.value}_${o}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(n.setOpacity)(e.unref(n.shiftHue)(a.color,.05),100-t.value.style.chart.layout.rect.gradientIntensity)},null,8,Fe),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,De)],8,ze))),256))]),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${b.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},Me,8,Oe)]),t.value.useCustomCells&&s.value.length?(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,Re))),256)):e.createCommentVNode("",!0),!s.value.length&&!t.value.useCustomCells?(e.openBlock(),e.createElementBlock("rect",{key:1,x:12,y:12,height:f.value.height-24,width:f.value.width-24,rx:3,fill:"none",stroke:"black"},null,8,Ue)):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,je))),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,Ge))),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:L.value*t.value.style.chart.layout.grid.size<=0?1e-4:L.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 ${L.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",He,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",Ye,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",Xe," ("+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",Je,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,We)):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=>Ce(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:L.value<=0?1e-4:L.value,fill:"transparent",stroke:"none"},null,40,Ke))),256)),e.renderSlot(l.$slots,"svg",{svg:k.value},void 0,!0)],14,Ee)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Qe,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(X)||e.unref(J)})),void 0,!0)])):e.createCommentVNode("",!0),V.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock($e.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(Le.Legend,{key:`legend_${W.value}`,legendSet:_.value,config:xe.value,onClickMarker:r[1]||(r[1]=({legend:a})=>re(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",tt," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",et," ("+e.toDisplayString(isNaN(a.value/y.value)?"-":e.unref(n.dataLabel)({v:a.value/y.value*100,s:"%",r:t.value.style.chart.legend.roundingPercentage,isAnimating:C.value}))+") ",1))],12,Ze)]),_:1},8,["legendSet","config"])):e.renderSlot(l.$slots,"legend",{key:1,legend:_.value},void 0,!0)],512),e.createVNode(Se._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"]),V.value?(e.openBlock(),e.createBlock(Te.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.openBlock(),e.createBlock(Ne.DataTable,{key:`table_${G.value}`,colNames:z.value.colNames,head:z.value.head,body:z.value.body,config:z.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:r[2]||(r[2]=a=>m.value.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createElementVNode("div",{innerHTML:a,style:{display:"flex","align-items":"center"}},null,8,lt)]),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,Ie))}},ot=Ve._export_sfc(at,[["__scopeId","data-v-a0574c0d"]]);exports.default=ot;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-xtIm3ydy.cjs"),ie=require("./useResponsive-B3TrDDIG.cjs"),_e=require("./Title-spYln43E.cjs"),ce=require("./usePrinter-BrE53tUa.cjs"),Se=require("./Tooltip-BgkDlGZj.cjs"),Ne=require("./DataTable-DT8VcwR5.cjs"),Le=require("./Legend-BiaVNQjc.cjs"),$e=require("./vue-ui-skeleton-g8cEqYmt.cjs"),Te=require("./vue-ui-accordion-DDiQi7FV.cjs"),ve=require("./useNestedProp-XzXFHriE.cjs"),Pe=require("./PackageVersion-DMkpXFFU.cjs"),Ve=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),de=S=>(e.pushScopeId("data-v-a0574c0d"),S=S(),e.popScopeId(),S),Ie=["id"],Ee=["xmlns","viewBox"],ze=["id"],Fe=["stop-color"],De=["stop-color"],Oe=["id"],Ae=de(()=>e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:2},null,-1)),qe=de(()=>e.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1)),Me=[Ae,qe],Re=["x","y","height","width"],Ue=["height","width"],je=["rx","x","y","height","width","stroke","stroke-width","filter"],Ge=["rx","x","y","height","width","fill","stroke","stroke-width","filter"],We=["x","y","height","width","filter"],He={key:0},Ye={key:1},Xe={key:2},Je={key:3},Ke=["onMouseover","x","y","height","width"],Qe={key:3,class:"vue-data-ui-watermark"},Ze=["onClick"],et={key:0},tt={key:1},lt=["innerHTML"],at={__name:"vue-ui-waffle",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(S,{expose:pe,emit:he}){const p=S,{vue_ui_waffle:fe}=n.useConfig(),V=e.computed(()=>!!p.dataset&&p.dataset.length),b=e.ref(n.createUid()),ye=e.ref(null),F=e.ref(!1),D=e.ref(""),B=e.ref(null),M=e.ref(0),N=e.ref(null),R=e.ref(null),U=e.ref(null),j=e.ref(0),G=e.ref(0),W=e.ref(0),t=e.computed({get:()=>H(),set:l=>l});function H(){const l=ve.useNestedProp({userConfig:p.config,defaultConfig:fe});return l.theme?{...ve.useNestedProp({userConfig:n.themes.vue_ui_waffle[l.theme]||p.config,defaultConfig:l}),customPalette:n.themePalettes[l.theme]||n.palette}:l}e.watch(()=>p.config,l=>{t.value=H(),Y(),j.value+=1,G.value+=1,W.value+=1},{deep:!0});const I=e.ref(null);function Y(){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=ie.throttle(()=>{const{width:r,height:a}=ie.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,f.value.width=r,f.value.height=a});I.value=new ResizeObserver(l),I.value.observe(N.value.parentNode)}}e.onMounted(()=>{Y()}),e.onBeforeUnmount(()=>{I.value&&I.value.disconnect()});const{isPrinting:X,isImaging:J,generatePdf:K,generateImage:Q}=ce.usePrinter({elementId:`vue-ui-waffle_${b.value}`,fileName:t.value.style.chart.title.text||"vue-ui-waffle"}),Z=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),m=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),k=e.ref({height:512,width:512}),f=e.ref({top:0,left:0,height:512,width:512}),w=e.computed(()=>(f.value.width-t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.spaceBetween)/t.value.style.chart.layout.grid.size),x=e.computed(()=>(f.value.height-t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.spaceBetween)/t.value.style.chart.layout.grid.size),L=e.computed(()=>f.value.width/t.value.style.chart.layout.grid.size),E=e.computed(()=>f.value.height/t.value.style.chart.layout.grid.size);function ee(l){const r=t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.size,a=l.reduce((h,q)=>h+q,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,q)=>h+q,0);for(;d>0;){let h=i.indexOf(Math.max(...i));u[h]+=1,i[h]=0,d-=1}return u}function te(){return p.dataset.map((l,r)=>({...l,color:n.convertColorToHex(l.color)||Z.value[r]||n.palette[r]||n.palette[r%n.palette.length],uid:`serie_${r}`,absoluteIndex:r}))}const le=e.computed(()=>te()),c=e.ref(le.value);e.watch(()=>p.dataset,l=>{c.value=te()},{deep:!0});const ge=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 ee(l)}),me=e.computed(()=>{const l=c.value.map((r,a)=>(r.values||[]).reduce((o,u)=>o+u));return ee(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:ge.value[r]})))),be=e.computed(()=>c.value.map((l,r)=>({absoluteIndex:l.absoluteIndex,uid:l.uid,name:l.name,color:l.color,value:(l.values||[]).reduce((a,o)=>a+o,0),absoluteValues:l.values||[],proportion:me.value[r]})));function ke(){return be.value.map(l=>({name:l.name,color:l.color,value:l.value,proportion:l.proportion}))}const we=e.computed(()=>{let l=0;return $.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(()=>we.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)+f.value.top});return l}),v=e.ref([]),C=e.ref(!1),ae=e.ref(null),oe=e.ref(null);function re(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=le.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(ae.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),ae.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(oe.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),oe.value=requestAnimationFrame(u))};u()}he("selectLegend",$.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||Z[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:()=>re(l.uid),isSegregated:v.value.includes(l.uid)}))),xe=e.computed(()=>({cy:"waffle-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),y=e.computed(()=>$.value.map(l=>l.value).reduce((l,r)=>l+r,0)),O=e.ref(null);function Ce(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/y.value*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage});t.value.style.chart.tooltip.showValue?o+=`<span>(${u})</span></div>`:o+=`<b>${u}%</b></div>`}D.value=o}}const g=e.computed(()=>{const l=$.value.map(a=>({name:a.name,color:a.color})),r=$.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 ue(){e.nextTick(()=>{const l=g.value.head.map((o,u)=>[[o.name],[g.value.body[u]],[isNaN(g.value.body[u]/y.value)?"-":g.value.body[u]/y.value*100]]),r=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(l),a=n.createCsvContent(r);n.downloadCsv({csvContent:a,title:t.value.style.chart.title.text||"vue-ui-waffle"})})}const z=e.computed(()=>{const l=[' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>',n.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,y.value,n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:y.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue})),"100%"],r=g.value.head.map((u,i)=>[{color:u.color,name:u.name},n.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,g.value.body[i],n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:g.value.body[i],s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue})),isNaN(g.value.body[i]/y.value)?"-":n.dataLabel({v:g.value.body[i]/y.value*100,s:"%",r:t.value.table.td.roundingPercentage})]),a={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},shape:"square",breakpoint:t.value.table.responsiveBreakpoint},o=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage];return{head:l,body:r,config:a,colNames:o}}),P=e.ref(!1);function Be(l){P.value=l,M.value+=1}function ne(){m.value.showTable=!m.value.showTable}function se(){m.value.showTooltip=!m.value.showTooltip}return pe({getData:ke,generatePdf:K,generateCsv:ue,generateImage:Q,toggleTable:ne,toggleTooltip:se}),(l,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-waffle ${P.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:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(_e._sfc_main,{key:`title_${j.value}`,config:{title:{cy:"waffle-title",...t.value.style.chart.title},subtitle:{cy:"waffle-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&V.value?(e.openBlock(),e.createBlock(ce.UserOptions,{ref_key:"details",ref:ye,key:`user_options_${M.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(X),isImaging:e.unref(J),uid:b.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:P.value,isTooltip:m.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:N.value,position:t.value.userOptions.position,onToggleFullscreen:Be,onGeneratePdf:e.unref(K),onGenerateCsv:ue,onGenerateImage:e.unref(Q),onToggleTable:ne,onToggleTooltip:se},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","position","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),V.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(n.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":P.value,"vue-data-ui-fulscreen--off":!P.value}),viewBox:`0 0 ${k.value.width<=0?10:k.value.width} ${k.value.height<=0?10:k.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Pe._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(a,o)=>(e.openBlock(),e.createElementBlock("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`gradient_${b.value}_${o}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(n.setOpacity)(e.unref(n.shiftHue)(a.color,.05),100-t.value.style.chart.layout.rect.gradientIntensity)},null,8,Fe),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,De)],8,ze))),256))]),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${b.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},Me,8,Oe)]),t.value.useCustomCells&&s.value.length?(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,Re))),256)):e.createCommentVNode("",!0),!s.value.length&&!t.value.useCustomCells?(e.openBlock(),e.createElementBlock("rect",{key:1,x:12,y:12,height:f.value.height-24,width:f.value.width-24,rx:3,fill:"none",stroke:"black"},null,8,Ue)):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,je))),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,Ge))),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:L.value*t.value.style.chart.layout.grid.size<=0?1e-4:L.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 ${L.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",He,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",Ye,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",Xe," ("+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",Je,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,We)):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=>Ce(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:L.value<=0?1e-4:L.value,fill:"transparent",stroke:"none"},null,40,Ke))),256)),e.renderSlot(l.$slots,"svg",{svg:k.value},void 0,!0)],14,Ee)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Qe,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(X)||e.unref(J)})),void 0,!0)])):e.createCommentVNode("",!0),V.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock($e.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(Le.Legend,{key:`legend_${W.value}`,legendSet:_.value,config:xe.value,onClickMarker:r[1]||(r[1]=({legend:a})=>re(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",tt," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",et," ("+e.toDisplayString(isNaN(a.value/y.value)?"-":e.unref(n.dataLabel)({v:a.value/y.value*100,s:"%",r:t.value.style.chart.legend.roundingPercentage,isAnimating:C.value}))+") ",1))],12,Ze)]),_:1},8,["legendSet","config"])):e.renderSlot(l.$slots,"legend",{key:1,legend:_.value},void 0,!0)],512),e.createVNode(Se._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"]),V.value?(e.openBlock(),e.createBlock(Te.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.openBlock(),e.createBlock(Ne.DataTable,{key:`table_${G.value}`,colNames:z.value.colNames,head:z.value.head,body:z.value.body,config:z.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:r[2]||(r[2]=a=>m.value.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createElementVNode("div",{innerHTML:a,style:{display:"flex","align-items":"center"}},null,8,lt)]),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,Ie))}},ot=Ve._export_sfc(at,[["__scopeId","data-v-a0574c0d"]]);exports.default=ot;
@@ -1,15 +1,15 @@
1
1
  import { computed as d, ref as c, watch as Te, onMounted as We, onBeforeUnmount as qe, openBlock as s, createElementBlock as i, normalizeClass as Se, normalizeStyle as Q, createBlock as V, createCommentVNode as f, unref as h, createSlots as He, withCtx as b, renderSlot as w, normalizeProps as q, guardReactiveProps as H, createVNode as Le, createElementVNode as k, Fragment as T, renderList as M, toDisplayString as S, createTextVNode as Pe, nextTick as Xe, pushScopeId as Ye, popScopeId as Ke } from "vue";
2
- import { u as Je, c as Qe, t as Ze, a as et, p as B, o as tt, e as oe, g as lt, b as at, i as D, f as x, X as ot, s as ut, w as st, F as rt, K as nt, d as it, x as ct, y as vt, q as dt, r as ht } from "./index-BcpaEQjg.js";
2
+ import { u as Je, c as Qe, t as Ze, a as et, p as B, o as tt, e as oe, g as lt, b as at, i as D, f as x, X as ot, s as ut, w as st, F as rt, K as nt, d as it, x as ct, y as vt, q as dt, r as ht } from "./index-CHn5mpNE.js";
3
3
  import { t as pt, u as yt } from "./useResponsive-NZB-WLRF.js";
4
- import { _ as ft } from "./Title-BMSO566P.js";
5
- import { u as gt, U as mt } from "./usePrinter-DzCuoQHM.js";
6
- import { _ as bt } from "./Tooltip-CHABi2zh.js";
7
- import { D as wt } from "./DataTable-TdEc8llA.js";
8
- import { L as kt } from "./Legend-BsB-CXKk.js";
9
- import xt from "./vue-ui-skeleton-C53xk8CG.js";
10
- import Ct from "./vue-ui-accordion-Dhi5XiYk.js";
11
- import { u as ze } from "./useNestedProp-CEsVEbKF.js";
12
- import { _ as _t } from "./PackageVersion-C5LvF-TN.js";
4
+ import { _ as ft } from "./Title-DqYX5EDQ.js";
5
+ import { u as gt, U as mt } from "./usePrinter-DNwJl64i.js";
6
+ import { _ as bt } from "./Tooltip-7I8a4mo2.js";
7
+ import { D as wt } from "./DataTable-CFtLoh2y.js";
8
+ import { L as kt } from "./Legend-DlZZeU8Y.js";
9
+ import xt from "./vue-ui-skeleton-BmPO8QNa.js";
10
+ import Ct from "./vue-ui-accordion-DXd5ND_A.js";
11
+ import { u as ze } from "./useNestedProp-BF5raFbY.js";
12
+ import { _ as _t } from "./PackageVersion-B2pJ6f4s.js";
13
13
  import { _ as $t } from "./_plugin-vue_export-helper-CHgC5LLL.js";
14
14
  const Fe = (G) => (Ye("data-v-a0574c0d"), G = G(), Ke(), G), It = ["id"], Tt = ["xmlns", "viewBox"], St = ["id"], Lt = ["stop-color"], Pt = ["stop-color"], zt = ["id"], Ft = /* @__PURE__ */ Fe(() => /* @__PURE__ */ k("feGaussianBlur", {
15
15
  in: "SourceGraphic",
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-Bv8wGGBc.cjs"),U=require("./Title-DWSN4YUC.cjs"),I=require("./usePrinter-7jNVagoH.cjs"),S=require("./useResponsive-B3TrDDIG.cjs"),V=require("./vue-ui-skeleton-TRdDtmHK.cjs"),z=require("./useNestedProp-Bf7w6kTt.cjs"),G=require("./PackageVersion-kqwH1rG4.cjs"),X=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),j=["id"],H=["xmlns","viewBox"],D=["x1","x2","y1","y2","stroke","stroke-width","stroke-linecap"],Y=["cx","cy","r","stroke","stroke-width"],W=["x","y","font-size","fill","font-weight"],J={key:3,class:"vue-data-ui-watermark"},K={__name:"vue-ui-wheel",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(F,{expose:$}){const u=F,{vue_ui_wheel:O}=r.useConfig(),f=e.computed(()=>!!u.dataset&&Object.keys(u.dataset).length),y=e.ref(r.createUid()),M=e.ref(null),p=e.ref(0),h=e.ref(null),g=e.ref(null),k=e.ref(0),t=e.computed({get:()=>w(),set:l=>l});function w(){const l=z.useNestedProp({userConfig:u.config,defaultConfig:O});return l.theme?{...z.useNestedProp({userConfig:r.themes.vue_ui_wheel[l.theme]||u.config,defaultConfig:l})}:l}e.watch(()=>u.config,l=>{t.value=w(),P(),k.value+=1},{deep:!0});const{isPrinting:C,isImaging:b,generatePdf:_,generateImage:x}=I.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),s=e.computed(()=>({radius:Math.min(n.value.width,n.value.height)*.9/2,centerX:n.value.width/2,centerY:n.value.height/2}));function B(l,i=1){return{x:s.value.centerX+s.value.radius*Math.cos(29.85+l*Math.PI/180)*i,y:s.value.centerY+s.value.radius*Math.sin(29.85+l*Math.PI/180)*i}}const o=e.ref(t.value.style.chart.animation.use?0:u.dataset.percentage||0);e.watch(()=>u.dataset,l=>{t.value.style.chart.animation.use?N(l.percentage):o.value=l.percentage||0},{deep:!0});const v=e.ref(null);e.onMounted(()=>{P()});function P(){if(r.objectIsEmpty(u.dataset)&&r.error({componentName:"VueUiWheel",type:"dataset"}),N(u.dataset.percentage||0),t.value.responsive){const l=S.throttle(()=>{const{width:i,height:a}=S.useResponsive({chart:h.value,title:t.value.style.chart.title.text?g.value:null});n.value.width=i,n.value.height=a,m.value=t.value.style.chart.layout.percentage.fontSize/360*Math.min(i,a)});v.value=new ResizeObserver(l),v.value.observe(h.value.parentNode)}}e.onBeforeUnmount(()=>{v.value&&v.value.disconnect()});function N(l){let i=t.value.style.chart.animation.speed;const a=Math.abs(l-o.value)/(i*120);function c(){o.value<l?o.value=Math.min(o.value+a,l):o.value>l&&(o.value=Math.max(o.value-a,l)),o.value!==l&&requestAnimationFrame(c)}c()}const E=e.computed(()=>{const l=[];for(let a=0;a<100;a+=1){const c=o.value>a?t.value.style.chart.layout.wheel.ticks.activeColor:t.value.style.chart.layout.wheel.ticks.inactiveColor,{x:A,y:T}=B(n.value.size/100*a),{x:L,y:R}=B(n.value.size/100*a,t.value.style.chart.layout.wheel.ticks.sizeRatio);l.push({x1:A,y1:T,x2:L,y2:R,color:t.value.style.chart.layout.wheel.ticks.gradient.show?r.shiftHue(c,a/100*(t.value.style.chart.layout.wheel.ticks.gradient.shiftHueIntensity/100)):c})}return l}),d=e.ref(!1);function q(l){d.value=l,p.value+=1}return $({generatePdf:_,generateImage:x}),(l,i)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-wheel",ref_key:"wheelChart",ref:h,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:g,style:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(U._sfc_main,{key:`title_${k.value}`,config:{title:{cy:"wheel-title",...t.value.style.chart.title},subtitle:{cy:"wheel-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&f.value?(e.openBlock(),e.createBlock(I.UserOptions,{ref_key:"details",ref:M,key:`user_options_${p.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(C),isImaging:e.unref(b),uid:y.value,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,hasXls:!1,isFullscreen:d.value,position:t.value.userOptions.position,titles:{...t.value.userOptions.buttonTitles},chartElement:h.value,onToggleFullscreen:q,onGeneratePdf:e.unref(_),onGenerateImage:e.unref(x)},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","position","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":d.value,"vue-data-ui-fulscreen--off":!d.value}),viewBox:`0 0 ${n.value.width<=0?10:n.value.width} ${n.value.height<=0?10:n.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(G._sfc_main),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.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<=o.value})},null,10,D))),256)),t.value.style.chart.layout.innerCircle.show?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:s.value.centerX,cy:s.value.centerY,r:s.value.radius*.8<=0?1e-4:s.value.radius*.8,stroke:t.value.style.chart.layout.innerCircle.stroke,"stroke-width":t.value.style.chart.layout.innerCircle.strokeWidth,fill:"none"},null,8,Y)):e.createCommentVNode("",!0),t.value.style.chart.layout.percentage.show?(e.openBlock(),e.createElementBlock("text",{key:1,x:s.value.centerX,y:s.value.centerY+m.value/3,"font-size":m.value,fill:t.value.style.chart.layout.wheel.ticks.gradient.show?e.unref(r.shiftHue)(t.value.style.chart.layout.wheel.ticks.activeColor,o.value/100*(t.value.style.chart.layout.wheel.ticks.gradient.shiftHueIntensity/100)):t.value.style.chart.layout.wheel.ticks.activeColor,"text-anchor":"middle","font-weight":t.value.style.chart.layout.percentage.bold?"bold":"normal",style:{"font-variant-numeric":"tabluar-nums"}},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.percentage.formatter,e.unref(r.checkNaN)(o.value),e.unref(r.dataLabel)({v:e.unref(r.checkNaN)(o.value),s:"%",r:t.value.style.chart.layout.percentage.rounding}))),9,W)):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"svg",{svg:n.value},void 0,!0)],14,H)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",J,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(C)||e.unref(b)})),void 0,!0)])):e.createCommentVNode("",!0),f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(V.default,{key:4,config:{type:"wheel",style:{backgroundColor:t.value.style.chart.backgroundColor,wheel:{color:"#CCCCCC"}}}},null,8,["config"]))],12,j))}},Q=X._export_sfc(K,[["__scopeId","data-v-b8e98e43"]]);exports.default=Q;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-xtIm3ydy.cjs"),U=require("./Title-spYln43E.cjs"),I=require("./usePrinter-BrE53tUa.cjs"),S=require("./useResponsive-B3TrDDIG.cjs"),V=require("./vue-ui-skeleton-g8cEqYmt.cjs"),z=require("./useNestedProp-XzXFHriE.cjs"),G=require("./PackageVersion-DMkpXFFU.cjs"),X=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),j=["id"],H=["xmlns","viewBox"],D=["x1","x2","y1","y2","stroke","stroke-width","stroke-linecap"],Y=["cx","cy","r","stroke","stroke-width"],W=["x","y","font-size","fill","font-weight"],J={key:3,class:"vue-data-ui-watermark"},K={__name:"vue-ui-wheel",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(F,{expose:$}){const u=F,{vue_ui_wheel:O}=r.useConfig(),f=e.computed(()=>!!u.dataset&&Object.keys(u.dataset).length),y=e.ref(r.createUid()),M=e.ref(null),p=e.ref(0),h=e.ref(null),g=e.ref(null),k=e.ref(0),t=e.computed({get:()=>w(),set:l=>l});function w(){const l=z.useNestedProp({userConfig:u.config,defaultConfig:O});return l.theme?{...z.useNestedProp({userConfig:r.themes.vue_ui_wheel[l.theme]||u.config,defaultConfig:l})}:l}e.watch(()=>u.config,l=>{t.value=w(),P(),k.value+=1},{deep:!0});const{isPrinting:C,isImaging:b,generatePdf:_,generateImage:x}=I.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),s=e.computed(()=>({radius:Math.min(n.value.width,n.value.height)*.9/2,centerX:n.value.width/2,centerY:n.value.height/2}));function B(l,i=1){return{x:s.value.centerX+s.value.radius*Math.cos(29.85+l*Math.PI/180)*i,y:s.value.centerY+s.value.radius*Math.sin(29.85+l*Math.PI/180)*i}}const o=e.ref(t.value.style.chart.animation.use?0:u.dataset.percentage||0);e.watch(()=>u.dataset,l=>{t.value.style.chart.animation.use?N(l.percentage):o.value=l.percentage||0},{deep:!0});const v=e.ref(null);e.onMounted(()=>{P()});function P(){if(r.objectIsEmpty(u.dataset)&&r.error({componentName:"VueUiWheel",type:"dataset"}),N(u.dataset.percentage||0),t.value.responsive){const l=S.throttle(()=>{const{width:i,height:a}=S.useResponsive({chart:h.value,title:t.value.style.chart.title.text?g.value:null});n.value.width=i,n.value.height=a,m.value=t.value.style.chart.layout.percentage.fontSize/360*Math.min(i,a)});v.value=new ResizeObserver(l),v.value.observe(h.value.parentNode)}}e.onBeforeUnmount(()=>{v.value&&v.value.disconnect()});function N(l){let i=t.value.style.chart.animation.speed;const a=Math.abs(l-o.value)/(i*120);function c(){o.value<l?o.value=Math.min(o.value+a,l):o.value>l&&(o.value=Math.max(o.value-a,l)),o.value!==l&&requestAnimationFrame(c)}c()}const E=e.computed(()=>{const l=[];for(let a=0;a<100;a+=1){const c=o.value>a?t.value.style.chart.layout.wheel.ticks.activeColor:t.value.style.chart.layout.wheel.ticks.inactiveColor,{x:A,y:T}=B(n.value.size/100*a),{x:L,y:R}=B(n.value.size/100*a,t.value.style.chart.layout.wheel.ticks.sizeRatio);l.push({x1:A,y1:T,x2:L,y2:R,color:t.value.style.chart.layout.wheel.ticks.gradient.show?r.shiftHue(c,a/100*(t.value.style.chart.layout.wheel.ticks.gradient.shiftHueIntensity/100)):c})}return l}),d=e.ref(!1);function q(l){d.value=l,p.value+=1}return $({generatePdf:_,generateImage:x}),(l,i)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-wheel",ref_key:"wheelChart",ref:h,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:g,style:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(U._sfc_main,{key:`title_${k.value}`,config:{title:{cy:"wheel-title",...t.value.style.chart.title},subtitle:{cy:"wheel-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&f.value?(e.openBlock(),e.createBlock(I.UserOptions,{ref_key:"details",ref:M,key:`user_options_${p.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(C),isImaging:e.unref(b),uid:y.value,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,hasXls:!1,isFullscreen:d.value,position:t.value.userOptions.position,titles:{...t.value.userOptions.buttonTitles},chartElement:h.value,onToggleFullscreen:q,onGeneratePdf:e.unref(_),onGenerateImage:e.unref(x)},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","position","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":d.value,"vue-data-ui-fulscreen--off":!d.value}),viewBox:`0 0 ${n.value.width<=0?10:n.value.width} ${n.value.height<=0?10:n.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(G._sfc_main),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.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<=o.value})},null,10,D))),256)),t.value.style.chart.layout.innerCircle.show?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:s.value.centerX,cy:s.value.centerY,r:s.value.radius*.8<=0?1e-4:s.value.radius*.8,stroke:t.value.style.chart.layout.innerCircle.stroke,"stroke-width":t.value.style.chart.layout.innerCircle.strokeWidth,fill:"none"},null,8,Y)):e.createCommentVNode("",!0),t.value.style.chart.layout.percentage.show?(e.openBlock(),e.createElementBlock("text",{key:1,x:s.value.centerX,y:s.value.centerY+m.value/3,"font-size":m.value,fill:t.value.style.chart.layout.wheel.ticks.gradient.show?e.unref(r.shiftHue)(t.value.style.chart.layout.wheel.ticks.activeColor,o.value/100*(t.value.style.chart.layout.wheel.ticks.gradient.shiftHueIntensity/100)):t.value.style.chart.layout.wheel.ticks.activeColor,"text-anchor":"middle","font-weight":t.value.style.chart.layout.percentage.bold?"bold":"normal",style:{"font-variant-numeric":"tabluar-nums"}},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.percentage.formatter,e.unref(r.checkNaN)(o.value),e.unref(r.dataLabel)({v:e.unref(r.checkNaN)(o.value),s:"%",r:t.value.style.chart.layout.percentage.rounding}))),9,W)):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"svg",{svg:n.value},void 0,!0)],14,H)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",J,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(C)||e.unref(b)})),void 0,!0)])):e.createCommentVNode("",!0),f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(V.default,{key:4,config:{type:"wheel",style:{backgroundColor:t.value.style.chart.backgroundColor,wheel:{color:"#CCCCCC"}}}},null,8,["config"]))],12,j))}},Q=X._export_sfc(K,[["__scopeId","data-v-b8e98e43"]]);exports.default=Q;
@@ -1,11 +1,11 @@
1
1
  import { computed as p, ref as o, watch as L, onMounted as V, onBeforeUnmount as ee, openBlock as r, createElementBlock as v, normalizeStyle as U, createBlock as C, createCommentVNode as d, unref as n, createSlots as te, withCtx as _, renderSlot as f, normalizeProps as X, guardReactiveProps as B, normalizeClass as G, createVNode as ae, Fragment as le, renderList as se, toDisplayString as ne } from "vue";
2
- import { u as oe, c as re, t as ue, o as ie, e as ce, w as T, X as he, i as ve, v as E, f as de } from "./index-BcpaEQjg.js";
3
- import { _ as fe } from "./Title-BMSO566P.js";
4
- import { u as ye, U as me } from "./usePrinter-DzCuoQHM.js";
2
+ import { u as oe, c as re, t as ue, o as ie, e as ce, w as T, X as he, i as ve, v as E, f as de } from "./index-CHn5mpNE.js";
3
+ import { _ as fe } from "./Title-DqYX5EDQ.js";
4
+ import { u as ye, U as me } from "./usePrinter-DNwJl64i.js";
5
5
  import { t as ge, u as pe } from "./useResponsive-NZB-WLRF.js";
6
- import ke from "./vue-ui-skeleton-C53xk8CG.js";
7
- import { u as R } from "./useNestedProp-CEsVEbKF.js";
8
- import { _ as we } from "./PackageVersion-C5LvF-TN.js";
6
+ import ke from "./vue-ui-skeleton-BmPO8QNa.js";
7
+ import { u as R } from "./useNestedProp-BF5raFbY.js";
8
+ import { _ as we } from "./PackageVersion-B2pJ6f4s.js";
9
9
  import { _ as be } from "./_plugin-vue_export-helper-CHgC5LLL.js";
10
10
  const Ce = ["id"], _e = ["xmlns", "viewBox"], xe = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-linecap"], Ie = ["cx", "cy", "r", "stroke", "stroke-width"], $e = ["x", "y", "font-size", "fill", "font-weight"], Fe = {
11
11
  key: 3,
@@ -1,15 +1,15 @@
1
- import { useCssVars as Ae, computed as p, openBlock as u, createElementBlock as f, createVNode as ee, renderSlot as m, createElementVNode as $, normalizeStyle as te, pushScopeId as We, popScopeId as Re, ref as n, watch as Q, onMounted as Be, onBeforeUnmount as De, createBlock as A, createCommentVNode as z, unref as k, createSlots as Ve, withCtx as h, normalizeProps as W, guardReactiveProps as R, normalizeClass as me, Fragment as Ee, renderList as Ue, toDisplayString as fe, createTextVNode as Ge, nextTick as pe } from "vue";
2
- import { u as Le, Z as Xe, v as je, c as ge, t as Ye, a as qe, p as L, o as He, e as ye, g as Ze, f as Je, X as Ke, q as Qe, r as et, x as tt } from "./index-BcpaEQjg.js";
3
- import { _ as ot } from "./Title-BMSO566P.js";
4
- import { u as at, U as lt } from "./usePrinter-DzCuoQHM.js";
1
+ import { useCssVars as Ae, computed as p, openBlock as u, createElementBlock as f, createVNode as ee, renderSlot as m, createElementVNode as $, normalizeStyle as te, pushScopeId as We, popScopeId as Re, ref as n, watch as Z, onMounted as Be, onBeforeUnmount as De, createBlock as A, createCommentVNode as z, unref as k, createSlots as Ve, withCtx as h, normalizeProps as W, guardReactiveProps as R, normalizeClass as me, Fragment as Ee, renderList as Ue, toDisplayString as fe, createTextVNode as Ge, nextTick as pe } from "vue";
2
+ import { u as Le, _ as Xe, v as je, c as ge, t as Ye, a as qe, p as L, o as He, e as ye, g as Je, f as Ke, X as Qe, q as Ze, r as et, x as tt } from "./index-CHn5mpNE.js";
3
+ import { _ as ot } from "./Title-DqYX5EDQ.js";
4
+ import { u as at, U as lt } from "./usePrinter-DNwJl64i.js";
5
5
  import { d as st, t as nt, u as rt } from "./useResponsive-NZB-WLRF.js";
6
- import ut from "./vue-ui-accordion-Dhi5XiYk.js";
7
- import { D as it } from "./DataTable-TdEc8llA.js";
8
- import ct from "./BaseIcon-DFIHCTyJ.js";
6
+ import ut from "./vue-ui-accordion-DXd5ND_A.js";
7
+ import { D as it } from "./DataTable-CFtLoh2y.js";
8
+ import ct from "./BaseIcon-CdxkWcA_.js";
9
9
  import { _ as Ce } from "./_plugin-vue_export-helper-CHgC5LLL.js";
10
- import { u as be } from "./useNestedProp-CEsVEbKF.js";
11
- import { _ as dt } from "./PackageVersion-C5LvF-TN.js";
12
- import { _ as vt } from "./Tooltip-CHABi2zh.js";
10
+ import { u as be } from "./useNestedProp-BF5raFbY.js";
11
+ import { _ as dt } from "./PackageVersion-B2pJ6f4s.js";
12
+ import { _ as vt } from "./Tooltip-7I8a4mo2.js";
13
13
  const ht = (i) => (We("data-v-3fd7d274"), i = i(), Re(), i), mt = { "data-html2canvas-ignore": "" }, ft = {
14
14
  key: 0,
15
15
  class: "reset-wrapper"
@@ -164,7 +164,7 @@ const ht = (i) => (We("data-v-3fd7d274"), i = i(), Re(), i), mt = { "data-html2c
164
164
  customPalette: qe[t.theme] || L
165
165
  } : t;
166
166
  }
167
- Q(() => s.config, (t) => {
167
+ Z(() => s.config, (t) => {
168
168
  e.value = oe(), le(), g.value += 1, S.value += 1, Y();
169
169
  }, { deep: !0 });
170
170
  const ae = n(null), T = n(0), r = n({
@@ -180,7 +180,7 @@ const ht = (i) => (We("data-v-3fd7d274"), i = i(), Re(), i), mt = { "data-html2c
180
180
  });
181
181
  r.value.width = t, r.value.height = a, pe(q);
182
182
  });
183
- Q(() => T.value, () => {
183
+ Z(() => T.value, () => {
184
184
  ke();
185
185
  });
186
186
  const ke = st(() => {
@@ -198,7 +198,7 @@ const ht = (i) => (We("data-v-3fd7d274"), i = i(), Re(), i), mt = { "data-html2c
198
198
  componentName: "VueUiWordCloud",
199
199
  type: "dataset"
200
200
  }) : b.value.forEach((t, a) => {
201
- Ze({
201
+ Je({
202
202
  datasetObject: t,
203
203
  requiredAttributes: ["name", "value"]
204
204
  }).forEach((o) => {
@@ -234,16 +234,16 @@ const ht = (i) => (We("data-v-3fd7d274"), i = i(), Re(), i), mt = { "data-html2c
234
234
  function Se(t, a, o) {
235
235
  const c = [], l = { x: -a / 2, y: -o / 2, width: a, height: o }, v = 0, _ = 0;
236
236
  return t.forEach((N) => {
237
- let J = !1;
238
- for (let G = 0; G < Math.max(a, o) / 2 && !J; G += e.value.style.chart.words.packingWeight)
239
- for (let K = 0; K < 360 && !J; K += e.value.style.chart.words.packingWeight) {
240
- const he = K * Math.PI / 180, ze = v + G * Math.cos(he) - N.width / 2, Pe = _ + G * Math.sin(he) - N.height / 2, y = { ...N, x: ze, y: Pe }, Ie = y.x >= l.x && y.y >= l.y && y.x + y.width <= l.x + l.width && y.y + y.height <= l.y + l.height, Oe = c.some((Me) => xe(y, Me));
241
- Ie && !Oe && (c.push(y), J = !0);
237
+ let K = !1;
238
+ for (let G = 0; G < Math.max(a, o) / 2 && !K; G += e.value.style.chart.words.packingWeight)
239
+ for (let Q = 0; Q < 360 && !K; Q += e.value.style.chart.words.packingWeight) {
240
+ const he = Q * Math.PI / 180, ze = v + G * Math.cos(he) - N.width / 2, Pe = _ + G * Math.sin(he) - N.height / 2, y = { ...N, x: ze, y: Pe }, Ie = y.x >= l.x && y.y >= l.y && y.x + y.width <= l.x + l.width && y.y + y.height <= l.y + l.height, Oe = c.some((Me) => xe(y, Me));
241
+ Ie && !Oe && (c.push(y), K = !0);
242
242
  }
243
243
  }), c;
244
244
  }
245
245
  const O = n([]);
246
- Q(() => s.dataset, q, { immediate: !0 });
246
+ Z(() => s.dataset, q, { immediate: !0 });
247
247
  const ie = p(() => Math.min(...b.value.map((t) => t.value))), Te = p(() => Math.max(...b.value.map((t) => t.value)));
248
248
  function q() {
249
249
  const t = [...b.value].filter((l) => l.value >= T.value).map((l) => l.value), a = Math.max(...t), o = Math.min(...t), c = [...b.value].filter((l) => l.value >= T.value).map((l, v) => {
@@ -270,7 +270,7 @@ const ht = (i) => (We("data-v-3fd7d274"), i = i(), Re(), i), mt = { "data-html2c
270
270
  pe(() => {
271
271
  const t = V.value.head.map((c, l) => [[
272
272
  c.name
273
- ], [V.value.body[l]]]), a = [[e.value.style.chart.title.text], [e.value.style.chart.title.subtitle.text], [[""], [e.value.table.columnNames.value]]].concat(t), o = Qe(a);
273
+ ], [V.value.body[l]]]), a = [[e.value.style.chart.title.text], [e.value.style.chart.title.subtitle.text], [[""], [e.value.table.columnNames.value]]].concat(t), o = Ze(a);
274
274
  et({ csvContent: o, title: e.value.style.chart.title.text || "vue-ui-word-cloud" });
275
275
  });
276
276
  }
@@ -279,7 +279,7 @@ const ht = (i) => (We("data-v-3fd7d274"), i = i(), Re(), i), mt = { "data-html2c
279
279
  e.value.table.columnNames.series,
280
280
  e.value.table.columnNames.value
281
281
  ], a = V.value.head.map((l, v) => {
282
- const _ = Je({ p: e.value.table.td.prefix, v: V.value.body[v], s: e.value.table.td.suffix, r: e.value.table.td.roundingValue });
282
+ const _ = Ke({ p: e.value.table.td.prefix, v: V.value.body[v], s: e.value.table.td.suffix, r: e.value.table.td.roundingValue });
283
283
  return [
284
284
  {
285
285
  color: l.color,
@@ -330,10 +330,10 @@ const ht = (i) => (We("data-v-3fd7d274"), i = i(), Re(), i), mt = { "data-html2c
330
330
  toggleTable: de,
331
331
  toggleTooltip: ve
332
332
  });
333
- const F = n(null), M = n(!1), H = n(""), Z = n(null);
333
+ const F = n(null), M = n(!1), H = n(""), J = n(null);
334
334
  function Ne(t) {
335
335
  if (!d.value.showTooltip) return;
336
- F.value = t.id, Z.value = { datapoint: t, config: e.value };
336
+ F.value = t.id, J.value = { datapoint: t, config: e.value };
337
337
  const a = e.value.style.chart.tooltip.customFormat;
338
338
  if (M.value = !1, tt(a))
339
339
  try {
@@ -441,7 +441,7 @@ const ht = (i) => (We("data-v-3fd7d274"), i = i(), Re(), i), mt = { "data-html2c
441
441
  x.value ? (u(), f("svg", {
442
442
  key: 2,
443
443
  class: me({ "vue-data-ui-fullscreen--on": U.value, "vue-data-ui-fulscreen--off": !U.value }),
444
- xmlns: k(Ke),
444
+ xmlns: k(Qe),
445
445
  viewBox: `0 0 ${r.value.width <= 0 ? 10 : r.value.width} ${r.value.height <= 0 ? 10 : r.value.height}`,
446
446
  style: "overflow:visible;background:transparent;"
447
447
  }, [
@@ -492,10 +492,10 @@ const ht = (i) => (We("data-v-3fd7d274"), i = i(), Re(), i), mt = { "data-html2c
492
492
  isCustom: M.value
493
493
  }, {
494
494
  "tooltip-before": h(() => [
495
- m(t.$slots, "tooltip-before", W(R({ ...Z.value })), void 0, !0)
495
+ m(t.$slots, "tooltip-before", W(R({ ...J.value })), void 0, !0)
496
496
  ]),
497
497
  "tooltip-after": h(() => [
498
- m(t.$slots, "tooltip-after", W(R({ ...Z.value })), void 0, !0)
498
+ m(t.$slots, "tooltip-after", W(R({ ...J.value })), void 0, !0)
499
499
  ]),
500
500
  _: 3
501
501
  }, 8, ["show", "backgroundColor", "color", "fontSize", "borderRadius", "borderColor", "borderWidth", "backgroundOpacity", "position", "offsetY", "parent", "content", "isCustom"]),
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-Bv8wGGBc.cjs"),ye=require("./Title-DWSN4YUC.cjs"),te=require("./usePrinter-7jNVagoH.cjs"),D=require("./useResponsive-B3TrDDIG.cjs"),be=require("./vue-ui-accordion-CSkH8Ztm.cjs"),Ce=require("./DataTable-YpBvWSn5.cjs"),ke=require("./BaseIcon-DJbzYsmN.cjs"),le=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),oe=require("./useNestedProp-Bf7w6kTt.cjs"),we=require("./PackageVersion-kqwH1rG4.cjs"),xe=require("./Tooltip-Bl8Ilf5h.cjs"),Se=i=>(e.pushScopeId("data-v-3fd7d274"),i=i(),e.popScopeId(),i),$e={"data-html2canvas-ignore":""},Te={key:0,class:"reset-wrapper"},Ne={key:1,class:"reset-wrapper"},Fe={class:"mono-slicer"},Pe=Se(()=>e.createElementVNode("div",{class:"slider-track"},null,-1)),Be=["min","max","value"],ze={__name:"MonoSlicer",props:{min:{type:Number,default:0},max:{type:Number,default:0},inputColor:{type:String,default:"#1A1A1A"},background:{type:String,default:"#FFFFFF"},borderColor:{type:String,default:"#FFFFFF"},selectColor:{type:String,default:"#4A4A4A"},textColor:{type:String,default:"#1A1A1A"},useResetSlot:{type:Boolean,default:!1},value:{type:Number,default:0},source:{type:Number,default:0}},emits:["update:value","reset"],setup(i,{emit:F}){const r=i;e.useCssVars(g=>({"90ad3208":V.value,"4f9eef70":S.value,"6e07ae3e":p.value,"2fd430a0":i.selectColor,"6b8169a4":y.value}));const V=e.computed(()=>r.inputColor),y=e.computed(()=>r.background),p=e.computed(()=>`${r.selectColor}33`),S=e.computed(()=>r.borderColor);function $(){F("reset")}const f=e.computed(()=>{const g=r.max-r.min,h=0,b=(r.value-r.min)/g*100;return{left:`${h}%`,width:`${b-h}%`,background:r.selectColor}});return(g,h)=>(e.openBlock(),e.createElementBlock("div",$e,[i.value!==i.source?(e.openBlock(),e.createElementBlock("div",Te,[i.useResetSlot?e.renderSlot(g.$slots,"reset-action",{key:1,reset:$},void 0,!0):(e.openBlock(),e.createElementBlock("button",{key:0,"data-cy-reset":"",tabindex:"0",role:"button",class:"vue-data-ui-refresh-button",onClick:$},[e.createVNode(ke.default,{name:"refresh",stroke:i.textColor},null,8,["stroke"])]))])):(e.openBlock(),e.createElementBlock("div",Ne)),e.createElementVNode("div",Fe,[Pe,e.createElementVNode("div",{class:"range-highlight",style:e.normalizeStyle(f.value)},null,4),e.createElementVNode("input",{type:"range",min:i.min,max:i.max,value:Number(i.value),onInput:h[0]||(h[0]=b=>F("update:value",Number(b.target.value)))},null,40,Be)])]))}},_e=le._export_sfc(ze,[["__scopeId","data-v-3fd7d274"]]),Ee=["id"],Ve=["xmlns","viewBox"],Ie=["transform"],Oe=["fill","font-weight","x","y","font-size","transform","onMouseover"],Me={key:3,class:"vue-data-ui-watermark"},Ae=["innerHTML"],Re={__name:"vue-ui-word-cloud",props:{config:{type:Object,default(){return{}}},dataset:{type:[Array,String],default(){return[]}}},setup(i,{expose:F}){const r=i,{vue_ui_word_cloud:V}=s.useConfig(),y=e.computed({get(){return!!r.dataset&&r.dataset.length},set(o){return o}}),p=e.ref(typeof r.dataset=="string"?s.createWordCloudDatasetFromPlainText(r.dataset):r.dataset.map(o=>({...o,value:s.checkNaN(o.value)}))),S=e.ref(s.createUid()),$=e.ref(0),f=e.ref(null),g=e.ref(null),h=e.ref(0),b=e.ref(0),I=e.ref(!1),t=e.computed({get:()=>U(),set:o=>o});function U(){const o=oe.useNestedProp({userConfig:r.config,defaultConfig:V});return o.theme?{...oe.useNestedProp({userConfig:s.themes.vue_ui_word_cloud[o.theme]||r.config,defaultConfig:o}),customPalette:s.themePalettes[o.theme]||s.palette}:o}e.watch(()=>r.config,o=>{t.value=U(),L(),h.value+=1,b.value+=1,O()},{deep:!0});const G=e.ref(null),C=e.ref(0),u=e.ref({width:t.value.style.chart.width,height:t.value.style.chart.height,maxFontSize:t.value.style.chart.words.maxFontSize,minFontSize:t.value.style.chart.words.minFontSize}),ae=D.throttle(()=>{const{width:o,height:a}=D.useResponsive({chart:f.value,title:t.value.style.chart.title.text?g.value:null,slicer:t.value.style.chart.zoom.show&&G.value});u.value.width=o,u.value.height=a,e.nextTick(M)});e.watch(()=>C.value,()=>{ne()});const ne=D.debounce(()=>{M()},10);function O(){C.value=J.value}const P=e.ref(null);e.onMounted(()=>{L(),O()});function L(){s.objectIsEmpty(r.dataset)?s.error({componentName:"VueUiWordCloud",type:"dataset"}):p.value.forEach((o,a)=>{s.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name","value"]}).forEach(l=>{y.value=!1,s.error({componentName:"VueUiWordCloud",type:"datasetSerieAttribute",property:l,index:a})})}),t.value.responsive&&(P.value=new ResizeObserver(ae),P.value.observe(f.value.parentNode))}e.onBeforeUnmount(()=>{P.value&&P.value.disconnect()});const{isPrinting:j,isImaging:X,generatePdf:H,generateImage:Y}=te.usePrinter({elementId:`wordCloud_${S.value}`,fileName:t.value.style.chart.title.text||"vue-ui-word-cloud"}),d=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show});function re(o,a,l="Arial"){const n=document.createElement("canvas").getContext("2d");return n.font=`${a}px ${t.value.style.chart.words.bold?"bold":"normal"} ${l}`,{width:n.measureText(o).width+t.value.style.chart.words.proximity,height:a}}function se(o,a){return o.x<a.x+a.width&&o.x+o.width>a.x&&o.y<a.y+a.height&&o.y+o.height>a.y}function ue(o,a,l){const c=[],n={x:-a/2,y:-l/2,width:a,height:l},v=0,w=0;return o.forEach(x=>{let W=!1;for(let E=0;E<Math.max(a,l)/2&&!W;E+=t.value.style.chart.words.packingWeight)for(let q=0;q<360&&!W;q+=t.value.style.chart.words.packingWeight){const ee=q*Math.PI/180,he=v+E*Math.cos(ee)-x.width/2,me=w+E*Math.sin(ee)-x.height/2,m={...x,x:he,y:me},pe=m.x>=n.x&&m.y>=n.y&&m.x+m.width<=n.x+n.width&&m.y+m.height<=n.y+n.height,fe=c.some(ge=>se(m,ge));pe&&!fe&&(c.push(m),W=!0)}}),c}const T=e.ref([]);e.watch(()=>r.dataset,M,{immediate:!0});const J=e.computed(()=>Math.min(...p.value.map(o=>o.value))),ie=e.computed(()=>Math.max(...p.value.map(o=>o.value)));function M(){const o=[...p.value].filter(n=>n.value>=C.value).map(n=>n.value),a=Math.max(...o),l=Math.min(...o),c=[...p.value].filter(n=>n.value>=C.value).map((n,v)=>{const w=(n.value-l)/(a-l)*(u.value.maxFontSize-u.value.minFontSize)+u.value.minFontSize,x=re(n.name,w);return{...n,id:s.createUid(),fontSize:w,width:x.width,height:x.height,color:t.value.style.chart.words.usePalette?t.value.customPalette[v]||t.value.customPalette[v%t.value.customPalette.length]||s.palette[v]||s.palette[v%s.palette.length]:t.value.style.chart.words.color}});T.value=ue(c,u.value.width,u.value.height).sort((n,v)=>v.fontSize-n.fontSize)}const B=e.computed(()=>{const o=T.value.map(l=>({name:l.name,color:l.color})),a=T.value.map(l=>l.value);return{head:o,body:a}});function K(){e.nextTick(()=>{const o=B.value.head.map((c,n)=>[[c.name],[B.value.body[n]]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],[t.value.table.columnNames.value]]].concat(o),l=s.createCsvContent(a);s.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-word-cloud"})})}const z=e.computed(()=>{const o=[t.value.table.columnNames.series,t.value.table.columnNames.value],a=B.value.head.map((n,v)=>{const w=s.dataLabel({p:t.value.table.td.prefix,v:B.value.body[v],s:t.value.table.td.suffix,r:t.value.table.td.roundingValue});return[{color:n.color,name:n.name},w]}),l={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value],head:o,body:a,config:l}}),_=e.ref(!1);function ce(o){_.value=o,$.value+=1}function de(){return T.value}function Q(){d.value.showTable=!d.value.showTable}function Z(){d.value.showTooltip=!d.value.showTooltip}F({getData:de,generateCsv:K,generatePdf:H,generateImage:Y,toggleTable:Q,toggleTooltip:Z});const k=e.ref(null),N=e.ref(!1),A=e.ref(""),R=e.ref(null);function ve(o){if(!d.value.showTooltip)return;k.value=o.id,R.value={datapoint:o,config:t.value};const a=t.value.style.chart.tooltip.customFormat;if(N.value=!1,s.isFunction(a))try{const l=a({datapoint:o,config:t.value});typeof l=="string"&&(A.value=l,N.value=!0)}catch{console.warn("Custom format cannot be applied."),N.value=!1}if(!N.value){let l=`<svg viewBox="0 0 10 10" height="${t.value.style.chart.tooltip.fontSize}"><circle cx="5" cy="5" r="5" fill="${o.color}"/></svg><span>${o.name}:</span><b>${(o.value||0).toFixed(t.value.style.chart.tooltip.roundingValue)}</b>`;A.value=`<div dir="auto" style="display:flex; gap:4px; align-items:center; jsutify-content:center;">${l}</div>`}I.value=!0}return(o,a)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-word-cloud",ref_key:"wordCloudChart",ref:f,id:`wordCloud_${S.value}`,style:e.normalizeStyle(`width: 100%; font-family:${t.value.style.fontFamily};background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height:100%":""}`)},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:g,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(ye._sfc_main,{key:`title_${h.value}`,config:{title:{...t.value.style.chart.title},subtitle:{...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&y.value?(e.openBlock(),e.createBlock(te.UserOptions,{ref:"details",key:`user_option_${$.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(j),isImaging:e.unref(X),uid:S.value,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:_.value,titles:{...t.value.userOptions.buttonTitles},chartElement:f.value,position:t.value.userOptions.position,hasTooltip:t.value.style.chart.tooltip.show&&t.value.userOptions.buttons.tooltip,isTooltip:d.value.showTooltip,onToggleFullscreen:ce,onGeneratePdf:e.unref(H),onGenerateCsv:K,onGenerateImage:e.unref(Y),onToggleTable:Q,onToggleTooltip:Z},e.createSlots({_:2},[o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:c})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:c})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","titles","chartElement","position","hasTooltip","isTooltip","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),y.value?(e.openBlock(),e.createElementBlock("svg",{key:2,class:e.normalizeClass({"vue-data-ui-fullscreen--on":_.value,"vue-data-ui-fulscreen--off":!_.value}),xmlns:e.unref(s.XMLNS),viewBox:`0 0 ${u.value.width<=0?10:u.value.width} ${u.value.height<=0?10:u.value.height}`,style:"overflow:visible;background:transparent;"},[e.createVNode(we._sfc_main),e.createElementVNode("g",{transform:`translate(${(u.value.width<=0?10:u.value.width)/2}, ${(u.value.height<=0?10:u.value.height)/2})`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(l,c)=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(),e.createElementBlock("text",{fill:l.color,"font-weight":t.value.style.chart.words.bold?"bold":"normal",key:c,x:l.x,y:l.y,"font-size":l.fontSize,transform:`translate(${l.width/2}, ${l.height/2})`,class:e.normalizeClass({animated:t.value.useCssAnimation,"word-selected":k.value&&k.value===l.id&&d.value.showTooltip,"word-not-selected":k.value&&k.value!==l.id&&d.value.showTooltip}),"text-anchor":"middle","dominant-baseline":"middle",onMouseover:n=>ve(l),onMouseleave:a[0]||(a[0]=n=>{k.value=null,I.value=!1}),style:e.normalizeStyle(`animation-delay:${c*t.value.animationDelayMs}ms !important;`)},e.toDisplayString(l.name),47,Oe))]))),256))],8,Ie),e.renderSlot(o.$slots,"svg",{svg:{height:u.value.height,width:u.value.width}},void 0,!0)],10,Ve)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Me,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(j)||e.unref(X)})),void 0,!0)])):e.createCommentVNode("",!0),e.createVNode(xe._sfc_main,{show:d.value.showTooltip&&I.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,fontSize:t.value.style.chart.tooltip.fontSize,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:f.value,content:A.value,isCustom:N.value},{"tooltip-before":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...R.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...R.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isCustom"]),e.createElementVNode("div",{ref_key:"chartSlicer",ref:G,style:"width:100%;background:transparent","data-html2canvas-ignore":""},[t.value.style.chart.zoom.show?(e.openBlock(),e.createBlock(_e,{key:0,value:C.value,"onUpdate:value":a[1]||(a[1]=l=>C.value=l),min:J.value,max:ie.value,textColor:t.value.style.chart.color,inputColor:t.value.style.chart.zoom.color,selectColor:t.value.style.chart.zoom.highlightColor,useResetSlot:t.value.style.chart.zoom.useResetSlot,background:t.value.style.chart.zoom.color,borderColor:t.value.style.chart.backgroundColor,source:t.value.style.chart.width,onReset:O},{"reset-action":e.withCtx(({reset:l})=>[e.renderSlot(o.$slots,"reset-action",e.normalizeProps(e.guardReactiveProps({reset:l})),void 0,!0)]),_:3},8,["value","min","max","textColor","inputColor","selectColor","useResetSlot","background","borderColor","source"])):e.createCommentVNode("",!0)],512),y.value?(e.openBlock(),e.createBlock(be.default,{key:4,hideDetails:"",config:{open:d.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(Ce.DataTable,{key:`table_${b.value}`,colNames:z.value.colNames,head:z.value.head,body:z.value.body,config:z.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:a[2]||(a[2]=l=>d.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,Ae)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l.name||l),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],12,Ee))}},We=le._export_sfc(Re,[["__scopeId","data-v-7f4cd511"]]);exports.default=We;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-xtIm3ydy.cjs"),ye=require("./Title-spYln43E.cjs"),te=require("./usePrinter-BrE53tUa.cjs"),D=require("./useResponsive-B3TrDDIG.cjs"),be=require("./vue-ui-accordion-DDiQi7FV.cjs"),Ce=require("./DataTable-DT8VcwR5.cjs"),ke=require("./BaseIcon-BriP3G7r.cjs"),le=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),oe=require("./useNestedProp-XzXFHriE.cjs"),we=require("./PackageVersion-DMkpXFFU.cjs"),xe=require("./Tooltip-BgkDlGZj.cjs"),Se=i=>(e.pushScopeId("data-v-3fd7d274"),i=i(),e.popScopeId(),i),$e={"data-html2canvas-ignore":""},Te={key:0,class:"reset-wrapper"},Ne={key:1,class:"reset-wrapper"},Fe={class:"mono-slicer"},Pe=Se(()=>e.createElementVNode("div",{class:"slider-track"},null,-1)),Be=["min","max","value"],ze={__name:"MonoSlicer",props:{min:{type:Number,default:0},max:{type:Number,default:0},inputColor:{type:String,default:"#1A1A1A"},background:{type:String,default:"#FFFFFF"},borderColor:{type:String,default:"#FFFFFF"},selectColor:{type:String,default:"#4A4A4A"},textColor:{type:String,default:"#1A1A1A"},useResetSlot:{type:Boolean,default:!1},value:{type:Number,default:0},source:{type:Number,default:0}},emits:["update:value","reset"],setup(i,{emit:F}){const r=i;e.useCssVars(g=>({"90ad3208":V.value,"4f9eef70":S.value,"6e07ae3e":p.value,"2fd430a0":i.selectColor,"6b8169a4":y.value}));const V=e.computed(()=>r.inputColor),y=e.computed(()=>r.background),p=e.computed(()=>`${r.selectColor}33`),S=e.computed(()=>r.borderColor);function $(){F("reset")}const f=e.computed(()=>{const g=r.max-r.min,h=0,b=(r.value-r.min)/g*100;return{left:`${h}%`,width:`${b-h}%`,background:r.selectColor}});return(g,h)=>(e.openBlock(),e.createElementBlock("div",$e,[i.value!==i.source?(e.openBlock(),e.createElementBlock("div",Te,[i.useResetSlot?e.renderSlot(g.$slots,"reset-action",{key:1,reset:$},void 0,!0):(e.openBlock(),e.createElementBlock("button",{key:0,"data-cy-reset":"",tabindex:"0",role:"button",class:"vue-data-ui-refresh-button",onClick:$},[e.createVNode(ke.default,{name:"refresh",stroke:i.textColor},null,8,["stroke"])]))])):(e.openBlock(),e.createElementBlock("div",Ne)),e.createElementVNode("div",Fe,[Pe,e.createElementVNode("div",{class:"range-highlight",style:e.normalizeStyle(f.value)},null,4),e.createElementVNode("input",{type:"range",min:i.min,max:i.max,value:Number(i.value),onInput:h[0]||(h[0]=b=>F("update:value",Number(b.target.value)))},null,40,Be)])]))}},_e=le._export_sfc(ze,[["__scopeId","data-v-3fd7d274"]]),Ee=["id"],Ve=["xmlns","viewBox"],Ie=["transform"],Oe=["fill","font-weight","x","y","font-size","transform","onMouseover"],Me={key:3,class:"vue-data-ui-watermark"},Ae=["innerHTML"],Re={__name:"vue-ui-word-cloud",props:{config:{type:Object,default(){return{}}},dataset:{type:[Array,String],default(){return[]}}},setup(i,{expose:F}){const r=i,{vue_ui_word_cloud:V}=s.useConfig(),y=e.computed({get(){return!!r.dataset&&r.dataset.length},set(o){return o}}),p=e.ref(typeof r.dataset=="string"?s.createWordCloudDatasetFromPlainText(r.dataset):r.dataset.map(o=>({...o,value:s.checkNaN(o.value)}))),S=e.ref(s.createUid()),$=e.ref(0),f=e.ref(null),g=e.ref(null),h=e.ref(0),b=e.ref(0),I=e.ref(!1),t=e.computed({get:()=>U(),set:o=>o});function U(){const o=oe.useNestedProp({userConfig:r.config,defaultConfig:V});return o.theme?{...oe.useNestedProp({userConfig:s.themes.vue_ui_word_cloud[o.theme]||r.config,defaultConfig:o}),customPalette:s.themePalettes[o.theme]||s.palette}:o}e.watch(()=>r.config,o=>{t.value=U(),L(),h.value+=1,b.value+=1,O()},{deep:!0});const G=e.ref(null),C=e.ref(0),u=e.ref({width:t.value.style.chart.width,height:t.value.style.chart.height,maxFontSize:t.value.style.chart.words.maxFontSize,minFontSize:t.value.style.chart.words.minFontSize}),ae=D.throttle(()=>{const{width:o,height:a}=D.useResponsive({chart:f.value,title:t.value.style.chart.title.text?g.value:null,slicer:t.value.style.chart.zoom.show&&G.value});u.value.width=o,u.value.height=a,e.nextTick(M)});e.watch(()=>C.value,()=>{ne()});const ne=D.debounce(()=>{M()},10);function O(){C.value=J.value}const P=e.ref(null);e.onMounted(()=>{L(),O()});function L(){s.objectIsEmpty(r.dataset)?s.error({componentName:"VueUiWordCloud",type:"dataset"}):p.value.forEach((o,a)=>{s.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name","value"]}).forEach(l=>{y.value=!1,s.error({componentName:"VueUiWordCloud",type:"datasetSerieAttribute",property:l,index:a})})}),t.value.responsive&&(P.value=new ResizeObserver(ae),P.value.observe(f.value.parentNode))}e.onBeforeUnmount(()=>{P.value&&P.value.disconnect()});const{isPrinting:j,isImaging:X,generatePdf:H,generateImage:Y}=te.usePrinter({elementId:`wordCloud_${S.value}`,fileName:t.value.style.chart.title.text||"vue-ui-word-cloud"}),d=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show});function re(o,a,l="Arial"){const n=document.createElement("canvas").getContext("2d");return n.font=`${a}px ${t.value.style.chart.words.bold?"bold":"normal"} ${l}`,{width:n.measureText(o).width+t.value.style.chart.words.proximity,height:a}}function se(o,a){return o.x<a.x+a.width&&o.x+o.width>a.x&&o.y<a.y+a.height&&o.y+o.height>a.y}function ue(o,a,l){const c=[],n={x:-a/2,y:-l/2,width:a,height:l},v=0,w=0;return o.forEach(x=>{let W=!1;for(let E=0;E<Math.max(a,l)/2&&!W;E+=t.value.style.chart.words.packingWeight)for(let q=0;q<360&&!W;q+=t.value.style.chart.words.packingWeight){const ee=q*Math.PI/180,he=v+E*Math.cos(ee)-x.width/2,me=w+E*Math.sin(ee)-x.height/2,m={...x,x:he,y:me},pe=m.x>=n.x&&m.y>=n.y&&m.x+m.width<=n.x+n.width&&m.y+m.height<=n.y+n.height,fe=c.some(ge=>se(m,ge));pe&&!fe&&(c.push(m),W=!0)}}),c}const T=e.ref([]);e.watch(()=>r.dataset,M,{immediate:!0});const J=e.computed(()=>Math.min(...p.value.map(o=>o.value))),ie=e.computed(()=>Math.max(...p.value.map(o=>o.value)));function M(){const o=[...p.value].filter(n=>n.value>=C.value).map(n=>n.value),a=Math.max(...o),l=Math.min(...o),c=[...p.value].filter(n=>n.value>=C.value).map((n,v)=>{const w=(n.value-l)/(a-l)*(u.value.maxFontSize-u.value.minFontSize)+u.value.minFontSize,x=re(n.name,w);return{...n,id:s.createUid(),fontSize:w,width:x.width,height:x.height,color:t.value.style.chart.words.usePalette?t.value.customPalette[v]||t.value.customPalette[v%t.value.customPalette.length]||s.palette[v]||s.palette[v%s.palette.length]:t.value.style.chart.words.color}});T.value=ue(c,u.value.width,u.value.height).sort((n,v)=>v.fontSize-n.fontSize)}const B=e.computed(()=>{const o=T.value.map(l=>({name:l.name,color:l.color})),a=T.value.map(l=>l.value);return{head:o,body:a}});function K(){e.nextTick(()=>{const o=B.value.head.map((c,n)=>[[c.name],[B.value.body[n]]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],[t.value.table.columnNames.value]]].concat(o),l=s.createCsvContent(a);s.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-word-cloud"})})}const z=e.computed(()=>{const o=[t.value.table.columnNames.series,t.value.table.columnNames.value],a=B.value.head.map((n,v)=>{const w=s.dataLabel({p:t.value.table.td.prefix,v:B.value.body[v],s:t.value.table.td.suffix,r:t.value.table.td.roundingValue});return[{color:n.color,name:n.name},w]}),l={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value],head:o,body:a,config:l}}),_=e.ref(!1);function ce(o){_.value=o,$.value+=1}function de(){return T.value}function Q(){d.value.showTable=!d.value.showTable}function Z(){d.value.showTooltip=!d.value.showTooltip}F({getData:de,generateCsv:K,generatePdf:H,generateImage:Y,toggleTable:Q,toggleTooltip:Z});const k=e.ref(null),N=e.ref(!1),A=e.ref(""),R=e.ref(null);function ve(o){if(!d.value.showTooltip)return;k.value=o.id,R.value={datapoint:o,config:t.value};const a=t.value.style.chart.tooltip.customFormat;if(N.value=!1,s.isFunction(a))try{const l=a({datapoint:o,config:t.value});typeof l=="string"&&(A.value=l,N.value=!0)}catch{console.warn("Custom format cannot be applied."),N.value=!1}if(!N.value){let l=`<svg viewBox="0 0 10 10" height="${t.value.style.chart.tooltip.fontSize}"><circle cx="5" cy="5" r="5" fill="${o.color}"/></svg><span>${o.name}:</span><b>${(o.value||0).toFixed(t.value.style.chart.tooltip.roundingValue)}</b>`;A.value=`<div dir="auto" style="display:flex; gap:4px; align-items:center; jsutify-content:center;">${l}</div>`}I.value=!0}return(o,a)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-word-cloud",ref_key:"wordCloudChart",ref:f,id:`wordCloud_${S.value}`,style:e.normalizeStyle(`width: 100%; font-family:${t.value.style.fontFamily};background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height:100%":""}`)},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:g,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(ye._sfc_main,{key:`title_${h.value}`,config:{title:{...t.value.style.chart.title},subtitle:{...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&y.value?(e.openBlock(),e.createBlock(te.UserOptions,{ref:"details",key:`user_option_${$.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(j),isImaging:e.unref(X),uid:S.value,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:_.value,titles:{...t.value.userOptions.buttonTitles},chartElement:f.value,position:t.value.userOptions.position,hasTooltip:t.value.style.chart.tooltip.show&&t.value.userOptions.buttons.tooltip,isTooltip:d.value.showTooltip,onToggleFullscreen:ce,onGeneratePdf:e.unref(H),onGenerateCsv:K,onGenerateImage:e.unref(Y),onToggleTable:Q,onToggleTooltip:Z},e.createSlots({_:2},[o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:c})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:c})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","titles","chartElement","position","hasTooltip","isTooltip","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),y.value?(e.openBlock(),e.createElementBlock("svg",{key:2,class:e.normalizeClass({"vue-data-ui-fullscreen--on":_.value,"vue-data-ui-fulscreen--off":!_.value}),xmlns:e.unref(s.XMLNS),viewBox:`0 0 ${u.value.width<=0?10:u.value.width} ${u.value.height<=0?10:u.value.height}`,style:"overflow:visible;background:transparent;"},[e.createVNode(we._sfc_main),e.createElementVNode("g",{transform:`translate(${(u.value.width<=0?10:u.value.width)/2}, ${(u.value.height<=0?10:u.value.height)/2})`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(l,c)=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(),e.createElementBlock("text",{fill:l.color,"font-weight":t.value.style.chart.words.bold?"bold":"normal",key:c,x:l.x,y:l.y,"font-size":l.fontSize,transform:`translate(${l.width/2}, ${l.height/2})`,class:e.normalizeClass({animated:t.value.useCssAnimation,"word-selected":k.value&&k.value===l.id&&d.value.showTooltip,"word-not-selected":k.value&&k.value!==l.id&&d.value.showTooltip}),"text-anchor":"middle","dominant-baseline":"middle",onMouseover:n=>ve(l),onMouseleave:a[0]||(a[0]=n=>{k.value=null,I.value=!1}),style:e.normalizeStyle(`animation-delay:${c*t.value.animationDelayMs}ms !important;`)},e.toDisplayString(l.name),47,Oe))]))),256))],8,Ie),e.renderSlot(o.$slots,"svg",{svg:{height:u.value.height,width:u.value.width}},void 0,!0)],10,Ve)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Me,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(j)||e.unref(X)})),void 0,!0)])):e.createCommentVNode("",!0),e.createVNode(xe._sfc_main,{show:d.value.showTooltip&&I.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,fontSize:t.value.style.chart.tooltip.fontSize,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:f.value,content:A.value,isCustom:N.value},{"tooltip-before":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...R.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...R.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isCustom"]),e.createElementVNode("div",{ref_key:"chartSlicer",ref:G,style:"width:100%;background:transparent","data-html2canvas-ignore":""},[t.value.style.chart.zoom.show?(e.openBlock(),e.createBlock(_e,{key:0,value:C.value,"onUpdate:value":a[1]||(a[1]=l=>C.value=l),min:J.value,max:ie.value,textColor:t.value.style.chart.color,inputColor:t.value.style.chart.zoom.color,selectColor:t.value.style.chart.zoom.highlightColor,useResetSlot:t.value.style.chart.zoom.useResetSlot,background:t.value.style.chart.zoom.color,borderColor:t.value.style.chart.backgroundColor,source:t.value.style.chart.width,onReset:O},{"reset-action":e.withCtx(({reset:l})=>[e.renderSlot(o.$slots,"reset-action",e.normalizeProps(e.guardReactiveProps({reset:l})),void 0,!0)]),_:3},8,["value","min","max","textColor","inputColor","selectColor","useResetSlot","background","borderColor","source"])):e.createCommentVNode("",!0)],512),y.value?(e.openBlock(),e.createBlock(be.default,{key:4,hideDetails:"",config:{open:d.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(Ce.DataTable,{key:`table_${b.value}`,colNames:z.value.colNames,head:z.value.head,body:z.value.body,config:z.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:a[2]||(a[2]=l=>d.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,Ae)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l.name||l),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],12,Ee))}},We=le._export_sfc(Re,[["__scopeId","data-v-7f4cd511"]]);exports.default=We;