vue-data-ui 2.3.63 → 2.3.64

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 (140) hide show
  1. package/dist/{Arrow-CBx1Hj4I.js → Arrow-DPnMmAX7.js} +1 -1
  2. package/dist/{Arrow-fP0md3L3.cjs → Arrow-uesE2kaL.cjs} +1 -1
  3. package/dist/{BaseIcon-O8jJvy48.cjs → BaseIcon-3dGIQkTt.cjs} +1 -1
  4. package/dist/{BaseIcon-CS18qRiy.js → BaseIcon-BNFf4B_v.js} +1 -1
  5. package/dist/{DataTable-BGJ2mVxG.js → DataTable-BwHWRlRZ.js} +2 -2
  6. package/dist/{DataTable-CSEiZDAb.cjs → DataTable-UBogHlHz.cjs} +1 -1
  7. package/dist/{Legend-UWyvC57K.js → Legend-CsVEDSh6.js} +1 -1
  8. package/dist/{Legend-DuuSl2rJ.cjs → Legend-DomGAell.cjs} +1 -1
  9. package/dist/{Shape-Dsx4SQVn.cjs → Shape-D-NzWRg3.cjs} +1 -1
  10. package/dist/{Shape-HfEpP-Tk.js → Shape-D3yIJobN.js} +1 -1
  11. package/dist/{Slicer-Bk3Rt85L.js → Slicer-BBKMtMzF.js} +2 -2
  12. package/dist/{Slicer-Cf74aFVz.cjs → Slicer-CyAlmC4y.cjs} +1 -1
  13. package/dist/{Title-PZ6S96pU.cjs → Title-CRj-Ysyr.cjs} +1 -1
  14. package/dist/{Title-CPZstF2C.js → Title-DbTGPg4G.js} +1 -1
  15. package/dist/{Tooltip-BoIYPSX3.cjs → Tooltip-DBdcH3mQ.cjs} +1 -1
  16. package/dist/{Tooltip-CBmmiqKr.js → Tooltip-u79R5W5y.js} +1 -1
  17. package/dist/{index-NNZeHOBS.cjs → index-7N8NxNg5.cjs} +1 -1
  18. package/dist/{index-C_05i_JG.js → index-CguVaFlt.js} +1 -1
  19. package/dist/style.css +1 -1
  20. package/dist/{useNestedProp-DLnT0Wtg.js → useNestedProp-BbEbJmgv.js} +1 -1
  21. package/dist/{useNestedProp-CPsbJAGj.cjs → useNestedProp-DmS8KxmW.cjs} +1 -1
  22. package/dist/{usePrinter-DOhlzlnx.js → usePrinter-ClsMRVJG.js} +1 -1
  23. package/dist/{usePrinter-BLbY8qGZ.cjs → usePrinter-qYDc_jVR.cjs} +1 -1
  24. package/dist/{vue-data-ui-vqnxkVKv.js → vue-data-ui-BQxedlG9.js} +57 -57
  25. package/dist/{vue-data-ui-D5aG0WkE.cjs → vue-data-ui-DbkGvG6G.cjs} +1 -1
  26. package/dist/vue-data-ui.cjs +1 -1
  27. package/dist/vue-data-ui.js +1 -1
  28. package/dist/{vue-ui-3d-bar-Cez69HMH.cjs → vue-ui-3d-bar-CsQlP4Di.cjs} +1 -1
  29. package/dist/{vue-ui-3d-bar-b7Pu7sfL.js → vue-ui-3d-bar-DFd8LLYs.js} +7 -7
  30. package/dist/{vue-ui-accordion-rGJVvi_V.js → vue-ui-accordion-w15FGKRN.js} +3 -3
  31. package/dist/{vue-ui-accordion-CcdyvXrp.cjs → vue-ui-accordion-x_3F7J52.cjs} +1 -1
  32. package/dist/{vue-ui-age-pyramid-B6LKyKjc.cjs → vue-ui-age-pyramid-DVfxc6Ov.cjs} +1 -1
  33. package/dist/{vue-ui-age-pyramid-CH1Vj2R6.js → vue-ui-age-pyramid-frmKw0vt.js} +8 -8
  34. package/dist/{vue-ui-annotator-CTio5IiK.js → vue-ui-annotator-BWF8Pe0l.js} +1 -1
  35. package/dist/{vue-ui-annotator-BfmMNM_X.cjs → vue-ui-annotator-DeTV1vC_.cjs} +1 -1
  36. package/dist/{vue-ui-candlestick-C4kT9W0j.js → vue-ui-candlestick-C4VhdwJ6.js} +9 -9
  37. package/dist/{vue-ui-candlestick-DvX9Jxoi.cjs → vue-ui-candlestick-ryLshJfb.cjs} +1 -1
  38. package/dist/{vue-ui-carousel-table-Df2HHk0v.js → vue-ui-carousel-table-B8w17Va9.js} +4 -4
  39. package/dist/{vue-ui-carousel-table-CMs7scX3.cjs → vue-ui-carousel-table-DVNL0Pst.cjs} +1 -1
  40. package/dist/{vue-ui-chestnut-CCw8h0_m.cjs → vue-ui-chestnut-C6D2XKD_.cjs} +1 -1
  41. package/dist/{vue-ui-chestnut-BKTnDElg.js → vue-ui-chestnut-J3y-gLdr.js} +6 -6
  42. package/dist/{vue-ui-cursor-C-8bpiuy.cjs → vue-ui-cursor-8X87Qqag.cjs} +1 -1
  43. package/dist/{vue-ui-cursor-DOOlFN5D.js → vue-ui-cursor-uZQJBHDI.js} +2 -2
  44. package/dist/{vue-ui-dashboard-D7U1UkAh.js → vue-ui-dashboard-B9cXpm-f.js} +2 -2
  45. package/dist/{vue-ui-dashboard-B_h8KxOx.cjs → vue-ui-dashboard-BvxPzSpX.cjs} +1 -1
  46. package/dist/{vue-ui-digits-DmxQgABv.js → vue-ui-digits-CGRdypIC.js} +2 -2
  47. package/dist/{vue-ui-digits-DoQoNGGx.cjs → vue-ui-digits-CH8cnwd1.cjs} +1 -1
  48. package/dist/{vue-ui-donut-DdnwGXq6.cjs → vue-ui-donut-B6-Z6EDh.cjs} +1 -1
  49. package/dist/{vue-ui-donut-t5zf9Lm5.js → vue-ui-donut-Wc9_Wp7Z.js} +9 -9
  50. package/dist/{vue-ui-donut-evolution-uPCTV6E6.js → vue-ui-donut-evolution-BYYu5GGU.js} +9 -9
  51. package/dist/{vue-ui-donut-evolution-DsRAZLMN.cjs → vue-ui-donut-evolution-DGEUEHTT.cjs} +1 -1
  52. package/dist/{vue-ui-dumbbell-BCdxqHVR.js → vue-ui-dumbbell-CYMWl8i6.js} +8 -8
  53. package/dist/{vue-ui-dumbbell-D1Ak2pEE.cjs → vue-ui-dumbbell-MhRtKyw1.cjs} +1 -1
  54. package/dist/{vue-ui-flow-J1SmdKkh.js → vue-ui-flow-B1HsQT8G.js} +7 -7
  55. package/dist/{vue-ui-flow-CLqm5nkx.cjs → vue-ui-flow-Ch6-m_HE.cjs} +1 -1
  56. package/dist/{vue-ui-galaxy-CSXbhXBe.cjs → vue-ui-galaxy-B5IQYeE2.cjs} +1 -1
  57. package/dist/{vue-ui-galaxy-DNMbyKNg.js → vue-ui-galaxy-CFlBhbpn.js} +9 -9
  58. package/dist/{vue-ui-gauge-CC_9cSwj.js → vue-ui-gauge-DQyUybt9.js} +5 -5
  59. package/dist/{vue-ui-gauge-O3ntKI31.cjs → vue-ui-gauge-YclVOv9i.cjs} +1 -1
  60. package/dist/{vue-ui-gizmo-qrJt0nH6.cjs → vue-ui-gizmo-BV0cRYJR.cjs} +1 -1
  61. package/dist/{vue-ui-gizmo-C5vGMHUU.js → vue-ui-gizmo-Dc8Oh1GS.js} +2 -2
  62. package/dist/{vue-ui-heatmap-BjimHnMb.cjs → vue-ui-heatmap-DvTbIgBC.cjs} +1 -1
  63. package/dist/{vue-ui-heatmap-ByxLZuR5.js → vue-ui-heatmap-Dxet06AN.js} +8 -8
  64. package/dist/{vue-ui-kpi-DdNQlVCe.js → vue-ui-kpi-6Ug3wB5-.js} +3 -3
  65. package/dist/{vue-ui-kpi-eyxMedig.cjs → vue-ui-kpi-Obs0pp5K.cjs} +1 -1
  66. package/dist/{vue-ui-mini-loader-B5ykH9BF.cjs → vue-ui-mini-loader--9JCcmel.cjs} +1 -1
  67. package/dist/{vue-ui-mini-loader-C05VGcNr.js → vue-ui-mini-loader-DO8L0uoR.js} +2 -2
  68. package/dist/{vue-ui-molecule-DI0oHPT5.js → vue-ui-molecule-DUqT-xxF.js} +9 -9
  69. package/dist/{vue-ui-molecule-LZ1SRkgK.cjs → vue-ui-molecule-Di8d69m_.cjs} +1 -1
  70. package/dist/{vue-ui-mood-radar-DIDqiVMf.js → vue-ui-mood-radar-UMlgOP0N.js} +9 -9
  71. package/dist/{vue-ui-mood-radar-BJqk2oK_.cjs → vue-ui-mood-radar-hwK3JZHx.cjs} +1 -1
  72. package/dist/{vue-ui-nested-donuts-Nggnu_iK.cjs → vue-ui-nested-donuts-CoydBQ1Z.cjs} +1 -1
  73. package/dist/{vue-ui-nested-donuts-BkSiryoB.js → vue-ui-nested-donuts-DFWDYNRb.js} +9 -9
  74. package/dist/{vue-ui-onion-xiubSG3j.js → vue-ui-onion-CXscsP8f.js} +9 -9
  75. package/dist/{vue-ui-onion-B29Cxru2.cjs → vue-ui-onion-Dxd8NNV8.cjs} +1 -1
  76. package/dist/{vue-ui-parallel-coordinate-plot-DjmOGHVx.js → vue-ui-parallel-coordinate-plot-8fsiFsCK.js} +10 -10
  77. package/dist/{vue-ui-parallel-coordinate-plot-DqrkSOo6.cjs → vue-ui-parallel-coordinate-plot-B4y-tLrW.cjs} +1 -1
  78. package/dist/{vue-ui-quadrant-Df_2X-ca.cjs → vue-ui-quadrant-C8ZGy7Vz.cjs} +1 -1
  79. package/dist/{vue-ui-quadrant-Cc79ggIy.js → vue-ui-quadrant-CtaVeR8A.js} +10 -10
  80. package/dist/{vue-ui-quick-chart-BnBGXd4d.cjs → vue-ui-quick-chart-B4o_RZTj.cjs} +2 -2
  81. package/dist/{vue-ui-quick-chart-t_cPx4OT.js → vue-ui-quick-chart-BkbnCL9J.js} +10 -10
  82. package/dist/{vue-ui-radar-C3qEonKT.js → vue-ui-radar-CYpFzHVj.js} +10 -10
  83. package/dist/{vue-ui-radar-D3W9B9JE.cjs → vue-ui-radar-FzvdUuQW.cjs} +1 -1
  84. package/dist/{vue-ui-rating-aOa6zIr5.cjs → vue-ui-rating-CQMIQetd.cjs} +1 -1
  85. package/dist/{vue-ui-rating-DffL7w-I.js → vue-ui-rating-Pbbo9WlF.js} +2 -2
  86. package/dist/{vue-ui-relation-circle-D0zUfd3f.js → vue-ui-relation-circle-DXN96O8B.js} +5 -5
  87. package/dist/{vue-ui-relation-circle-BZ7r7Unx.cjs → vue-ui-relation-circle-DyVNLOkn.cjs} +1 -1
  88. package/dist/{vue-ui-rings-BjWAtE4x.cjs → vue-ui-rings-Py5qpBEi.cjs} +1 -1
  89. package/dist/{vue-ui-rings-PHbuqfoT.js → vue-ui-rings-RaL8pTXF.js} +9 -9
  90. package/dist/{vue-ui-scatter-DMJ77QYr.cjs → vue-ui-scatter-C0Qbl8if.cjs} +1 -1
  91. package/dist/{vue-ui-scatter-DuCnr2yB.js → vue-ui-scatter-C5-IZPAD.js} +10 -10
  92. package/dist/{vue-ui-screenshot-DBuA631a.cjs → vue-ui-screenshot-5dSbg20c.cjs} +1 -1
  93. package/dist/{vue-ui-screenshot-DbwRrmHv.js → vue-ui-screenshot-xDbAEPnl.js} +1 -1
  94. package/dist/{vue-ui-skeleton-CcJR2m18.js → vue-ui-skeleton-ChHLL5Hw.js} +2 -2
  95. package/dist/{vue-ui-skeleton-CI4t8LHn.cjs → vue-ui-skeleton-D5jxUSy8.cjs} +1 -1
  96. package/dist/{vue-ui-smiley-2rJFSSZS.js → vue-ui-smiley-CMoVMgzF.js} +2 -2
  97. package/dist/{vue-ui-smiley-C7KBm0fz.cjs → vue-ui-smiley-DELBP4YY.cjs} +1 -1
  98. package/dist/{vue-ui-spark-trend-VH2nwGJf.cjs → vue-ui-spark-trend-Bd--ueZ_.cjs} +1 -1
  99. package/dist/{vue-ui-spark-trend-DY_sfo6o.js → vue-ui-spark-trend-CwTDE8hW.js} +4 -4
  100. package/dist/{vue-ui-sparkbar-Bs8ZQem1.cjs → vue-ui-sparkbar-BI9p7mG3.cjs} +1 -1
  101. package/dist/{vue-ui-sparkbar-B0O77PcV.js → vue-ui-sparkbar-DlHNW471.js} +3 -3
  102. package/dist/{vue-ui-sparkgauge-B5KqrHQZ.js → vue-ui-sparkgauge-Bv4PqAAa.js} +3 -3
  103. package/dist/{vue-ui-sparkgauge-Cd7b4u0z.cjs → vue-ui-sparkgauge-OmKjwPSm.cjs} +1 -1
  104. package/dist/{vue-ui-sparkhistogram-DwRPeG7H.js → vue-ui-sparkhistogram-Caz0-A2v.js} +4 -4
  105. package/dist/{vue-ui-sparkhistogram-CEWCLohQ.cjs → vue-ui-sparkhistogram-Du2G89Uf.cjs} +1 -1
  106. package/dist/{vue-ui-sparkline-W5bZnpQo.js → vue-ui-sparkline-BjBx0Xph.js} +3 -3
  107. package/dist/{vue-ui-sparkline-CuFtIMpq.cjs → vue-ui-sparkline-Cb9oSi7e.cjs} +1 -1
  108. package/dist/{vue-ui-sparkstackbar-9hBQZ0lZ.js → vue-ui-sparkstackbar-D0h3xCgn.js} +3 -3
  109. package/dist/{vue-ui-sparkstackbar-TyVFUMtT.cjs → vue-ui-sparkstackbar-DAvtpGxR.cjs} +1 -1
  110. package/dist/{vue-ui-stackbar-BlkgM0nD.js → vue-ui-stackbar-D6Twi4kA.js} +10 -10
  111. package/dist/{vue-ui-stackbar-CwVcupxt.cjs → vue-ui-stackbar-DtGhGaha.cjs} +1 -1
  112. package/dist/{vue-ui-strip-plot-C1GfRjXJ.cjs → vue-ui-strip-plot-BKZS4u9o.cjs} +1 -1
  113. package/dist/{vue-ui-strip-plot-CBfqkkY6.js → vue-ui-strip-plot-hssak3_i.js} +9 -9
  114. package/dist/{vue-ui-table-B8cvvLk8.js → vue-ui-table-DbA-NarQ.js} +1 -1
  115. package/dist/{vue-ui-table-CmguTt4I.cjs → vue-ui-table-HbHx9LFn.cjs} +1 -1
  116. package/dist/{vue-ui-table-heatmap-wVWltZ2x.js → vue-ui-table-heatmap-Bp2AW6SZ.js} +4 -4
  117. package/dist/{vue-ui-table-heatmap-DMnh8-b1.cjs → vue-ui-table-heatmap-YqkKo7Rw.cjs} +1 -1
  118. package/dist/{vue-ui-table-sparkline-_POawNEL.js → vue-ui-table-sparkline-CSCRSC9Z.js} +5 -5
  119. package/dist/{vue-ui-table-sparkline-wtIFAc20.cjs → vue-ui-table-sparkline-D6tpky88.cjs} +1 -1
  120. package/dist/{vue-ui-thermometer-D6SnFJb1.cjs → vue-ui-thermometer-BtNbxKWF.cjs} +1 -1
  121. package/dist/{vue-ui-thermometer-CFJqd-VY.js → vue-ui-thermometer-C4D5DYLq.js} +5 -5
  122. package/dist/{vue-ui-timer-D8dgDAfe.js → vue-ui-timer-B1gf42-7.js} +4 -4
  123. package/dist/{vue-ui-timer-194y0LUC.cjs → vue-ui-timer-CjSaHRia.cjs} +1 -1
  124. package/dist/{vue-ui-tiremarks-CH1BFqbO.js → vue-ui-tiremarks-2w8HGpJh.js} +5 -5
  125. package/dist/{vue-ui-tiremarks-BM28JsxE.cjs → vue-ui-tiremarks-B-E_m-JM.cjs} +1 -1
  126. package/dist/{vue-ui-treemap-DHsoVY5n.js → vue-ui-treemap-BratMgOF.js} +9 -9
  127. package/dist/{vue-ui-treemap-BIpIg3Qa.cjs → vue-ui-treemap-TQu-XVV4.cjs} +1 -1
  128. package/dist/{vue-ui-vertical-bar-DNODBoSo.js → vue-ui-vertical-bar-BWhOc_BN.js} +9 -9
  129. package/dist/{vue-ui-vertical-bar-Du8ikoWM.cjs → vue-ui-vertical-bar-CUSxr8J5.cjs} +1 -1
  130. package/dist/{vue-ui-waffle-_Bi9MRx8.cjs → vue-ui-waffle-BmjYKwYK.cjs} +1 -1
  131. package/dist/{vue-ui-waffle-C8hMAeMl.js → vue-ui-waffle-CrunUoiX.js} +9 -9
  132. package/dist/{vue-ui-wheel-BZxcRGJX.cjs → vue-ui-wheel-49jAAVu7.cjs} +1 -1
  133. package/dist/{vue-ui-wheel-CmZKsfKj.js → vue-ui-wheel-8pydvFdd.js} +5 -5
  134. package/dist/{vue-ui-word-cloud-nHVG2yid.cjs → vue-ui-word-cloud-C89Siwo7.cjs} +1 -1
  135. package/dist/{vue-ui-word-cloud-fLf-x06l.js → vue-ui-word-cloud-D5-ouQkK.js} +7 -7
  136. package/dist/{vue-ui-xy-CPln5bGQ.js → vue-ui-xy-BZkuRafq.js} +12 -12
  137. package/dist/{vue-ui-xy-qxQy2sOl.cjs → vue-ui-xy-DsiERLim.cjs} +1 -1
  138. package/dist/{vue-ui-xy-canvas-Z1tJJV5-.cjs → vue-ui-xy-canvas-DG-o3-nt.cjs} +1 -1
  139. package/dist/{vue-ui-xy-canvas-k30CEsKi.js → vue-ui-xy-canvas-DcywpKdf.js} +10 -10
  140. package/package.json +1 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-NNZeHOBS.cjs"),A=require("./Title-PZ6S96pU.cjs"),F=require("./usePrinter-BLbY8qGZ.cjs"),D=require("./vue-ui-skeleton-CI4t8LHn.cjs"),I=require("./useNestedProp-CPsbJAGj.cjs"),R=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),X=["id"],J={key:0,style:"width:100%"},K=["xmlns","viewBox"],Q={id:"vueUiPill",clipPathUnits:"objectBoundingBox"},Z=["fill"],ee=["id"],te=["stop-color"],oe=["stop-color"],le=["stop-color"],re={"clip-path":"url(#vueUiPill)"},ae=["x","y","height","width"],se=["x","y","height","width","fill"],ne=["x1","x2","y1","y2","stroke-width","stroke"],ue=["x1","x2","y1","y2","stroke-width","stroke"],ce=["x1","x2","y1","y2","stroke-width","stroke"],ie=["x1","x2","y1","y2","stroke-width","stroke"],de=["x1","x2","y1","y2","stroke-width","stroke"],he=["x1","x2","y1","y2","stroke-width","stroke"],ve=["x1","x2","y1","y2","stroke-width","stroke"],me=["x1","x2","y1","y2","stroke-width","stroke"],ye=["x","y","height","width"],pe=["y","x","fill","font-size","font-weight"],fe={key:3,class:"vue-data-ui-watermark"},ge={__name:"vue-ui-thermometer",props:{dataset:{type:Object,default(){return{}}},config:{type:Object,default(){return{}}}},setup(m,{expose:q}){const s=m;e.useCssVars(l=>({"1a02c3eb":z.value,"12f74203":O.value,"32637bb0":M.value}));const{vue_ui_thermometer:S}=r.useConfig(),f=e.computed(()=>!!s.dataset&&Object.keys(s.dataset).length);e.onMounted(()=>{r.objectIsEmpty(s.dataset)?r.error({componentName:"VueUiThermometer",type:"dataset"}):r.getMissingDatasetAttributes({datasetObject:s.dataset,requiredAttributes:["value","from","to"]}).forEach(l=>{r.error({componentName:"VueUiThermometer",type:"datasetAttribute",property:l})})});const d=e.ref(r.createUid()),w=e.ref(null),C=e.ref(0),t=e.computed(()=>{const l=I.useNestedProp({userConfig:s.config,defaultConfig:S});return l.theme?{...I.useNestedProp({userConfig:r.themes.vue_ui_thermometer[l.theme]||s.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}),{isPrinting:N,isImaging:B,generatePdf:E,generateImage:V}=F.usePrinter({elementId:`thermometer__${d.value}`,fileName:t.value.style.title.text||"vue-ui-thermometer"}),y=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),T=e.computed(()=>t.value.style.chart.thermometer.width),i=e.computed(()=>s.dataset.steps||10),c=e.ref({top:t.value.style.chart.padding.top,left:t.value.style.chart.padding.left,right:t.value.style.chart.padding.right,bottom:t.value.style.chart.padding.bottom});function p(l,n,o){const u=[],b=P(l),_=P(n);for(let v=0;v<o;v++){const G=g(b.red,_.red,v,o),W=g(b.green,_.green,v,o),H=g(b.blue,_.blue,v,o),j=`#${k(G)}${k(W)}${k(H)}`;u.push(j)}return u}function P(l){const n=l.slice(1);return{red:parseInt(n.slice(0,2),16),green:parseInt(n.slice(2,4),16),blue:parseInt(n.slice(4,6),16)}}function g(l,n,o,u){return Math.round(l+(n-l)*o/u)}function k(l){return l.toString(16).padStart(2,"0")}const a=e.computed(()=>{const l=T.value+c.value.left+c.value.right,n=t.value.style.chart.height;return{width:l,left:c.value.left,right:l-c.value.right,top:c.value.top,bottom:n-c.value.bottom,height:n}}),Y=e.computed(()=>a.value),x=e.computed(()=>{const l=r.checkNaN(s.dataset.from)<0?Math.abs(r.checkNaN(s.dataset.from)):r.checkNaN(s.dataset.from),n=r.checkNaN(s.dataset.to)<0?Math.abs(r.checkNaN(s.dataset.to)):r.checkNaN(s.dataset.to);let o=0;return r.checkNaN(s.dataset.to)>0?o=l+n:l>n?o=l-n:o=n-l,(1-(Math.abs(r.checkNaN(s.dataset.from))+r.checkNaN(s.dataset.value))/o)*(a.value.height-c.value.top-c.value.bottom)}),M=e.computed(()=>`${x.value}px`),O=e.computed(()=>`${a.value.height-t.value.style.chart.padding.bottom-c.value.top}px`),z=e.computed(()=>`${t.value.style.chart.animation.speedMs}ms`),L=e.computed(()=>{if(s.dataset.colors){if(!s.dataset.colors.from)return p(y.value[0]||r.palette[0],r.convertColorToHex(s.dataset.colors.to),i.value||10);if(!s.dataset.colors.to)return p(r.convertColorToHex(s.dataset.colors.from),y.value[1]||r.palette[1],i.value||10)}else return p(y.value[1]||r.palette[1],y.value[0]||r.palette[0],i.value||10);return p(r.convertColorToHex(s.dataset.colors.from),r.convertColorToHex(s.dataset.colors.to),i.value||10)}),$=e.computed(()=>{const l=[];let n=0;const o=a.value.height-c.value.top-c.value.bottom;for(let u=0;u<o-1;u+=o/i.value)l.push({x:a.value.left,y:a.value.top+u,qYLess:a.value.top+u+o/i.value/4,halfY:a.value.top+u+o/i.value/2,qYMore:a.value.top+u+o/i.value/4*3,color:L.value[n],height:o/i.value}),n+=1;return l}),h=e.ref(!1);function U(l){h.value=l,C.value+=1}return q({generatePdf:E,generateImage:V}),(l,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"thermoChart",ref:w,class:e.normalizeClass(`vue-ui-thermometer ${h.value?"vue-data-ui-wrapper-fullscreen":""}`),style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color};font-family:${t.value.style.fontFamily}`),id:`thermometer__${d.value}`},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",J,[e.createVNode(A._sfc_main,{config:{title:{cy:"thermometer-div-title",...t.value.style.title},subtitle:{cy:"thermometer-div-subtitle",...t.value.style.title.subtitle}}},null,8,["config"])])):e.createCommentVNode("",!0),t.value.userOptions.show&&f.value?(e.openBlock(),e.createBlock(F.UserOptions,{ref:"details",key:`user_options_${C.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(B),isPrinting:e.unref(N),uid:d.value,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,hasXls:!1,isFullscreen:h.value,titles:{...t.value.userOptions.buttonTitles},chartElement:w.value,onToggleFullscreen:U,onGeneratePdf:e.unref(E),onGenerateImage:e.unref(V)},e.createSlots({_:2},[l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:u})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:u})),void 0,!0)]),key:"2"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","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":h.value,"vue-data-ui-fulscreen--off":!h.value}),width:"100%",viewBox:`0 0 ${a.value.width} ${a.value.height}`,style:e.normalizeStyle(`background:${t.value.style.chart.backgroundColor}`)},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",Q,[e.createElementVNode("rect",{x:"0",y:"0",width:"1",height:"1",rx:"0.5",ry:"0.07",fill:t.value.style.chart.backgroundColor},null,8,Z)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.value,(o,u)=>(e.openBlock(),e.createElementBlock("linearGradient",{id:`vueUiThermometerGradient_${u}_${d.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":o.color},null,8,te),e.createElementVNode("stop",{offset:"50%","stop-color":`${o.color}${e.unref(r.opacity)[100-t.value.style.chart.graduations.gradient.intensity]}`},null,8,oe),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,le)],8,ee))),256))]),e.createElementVNode("g",re,[e.createElementVNode("rect",{x:a.value.left,y:a.value.top,height:a.value.height-c.value.top-c.value.bottom,width:a.value.width-c.value.left-c.value.right,fill:"#FFFFFF"},null,8,ae),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.value,(o,u)=>(e.openBlock(),e.createElementBlock("g",{key:`graduation_${u}`},[e.createElementVNode("rect",{x:o.x,y:o.y,height:o.height,width:a.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right,fill:t.value.style.chart.graduations.gradient.show?`url(#vueUiThermometerGradient_${u}_${d.value})`:o.color,"shape-rendering":"crispEdges"},null,8,se),t.value.style.chart.graduations.show&&["both","left"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:0,x1:o.x,x2:o.x+10,y1:o.y,y2:o.y,"stroke-width":t.value.style.chart.graduations.strokeWidth,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,ne)):e.createCommentVNode("",!0),t.value.style.chart.graduations.showIntermediate?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.value.style.chart.graduations.show&&["both","left"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:0,x1:o.x,x2:o.x+5,y1:o.halfY,y2:o.halfY,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,ue)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","left"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:1,x1:o.x,x2:o.x+2.5,y1:o.qYLess,y2:o.qYLess,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,ce)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","left"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:o.x,x2:o.x+2.5,y1:o.qYMore,y2:o.qYMore,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,ie)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","right"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:a.value.right,x2:a.value.right-10,y1:o.y,y2:o.y,"stroke-width":t.value.style.chart.graduations.strokeWidth,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,de)):e.createCommentVNode("",!0),t.value.style.chart.graduations.showIntermediate?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[t.value.style.chart.graduations.show&&["both","right"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:0,x1:a.value.right,x2:a.value.right-5,y1:o.halfY,y2:o.halfY,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,he)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","right"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:1,x1:a.value.right,x2:a.value.right-2.5,y1:o.qYLess,y2:o.qYLess,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,ve)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","right"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:a.value.right,x2:a.value.right-2.5,y1:o.qYMore,y2:o.qYMore,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,me)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)]))),128)),e.createElementVNode("rect",{class:e.normalizeClass({"vue-ui-thermometer-temperature":t.value.style.chart.animation.use}),x:a.value.left,y:a.value.top,height:x.value,width:a.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right,fill:"#FFFFFF66"},null,10,ye)]),e.createElementVNode("text",{class:e.normalizeClass({"vue-ui-thermometer-temperature-value":t.value.style.chart.animation.use}),y:x.value+a.value.top+t.value.style.chart.label.fontSize/3,x:a.value.left-10,"text-anchor":"end",fill:t.value.style.chart.label.color,"font-size":t.value.style.chart.label.fontSize,"font-weight":t.value.style.chart.label.bold?"bold":"normal"},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.label.formatter,m.dataset.value,e.unref(r.dataLabel)({p:t.value.style.chart.label.prefix,v:m.dataset.value,s:t.value.style.chart.label.suffix,r:t.value.style.chart.label.rounding}),{datapoint:m.dataset})),11,pe),e.renderSlot(l.$slots,"svg",{svg:Y.value},void 0,!0)],14,K)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",fe,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(N)||e.unref(B)})),void 0,!0)])):e.createCommentVNode("",!0),f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(D.default,{key:4,config:{type:"thermometer",style:{backgroundColor:t.value.style.chart.backgroundColor,thermometer:{color:"#CCCCCC"}}}},null,8,["config"]))],14,X))}},ke=R._export_sfc(ge,[["__scopeId","data-v-90e1355a"]]);exports.default=ke;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-7N8NxNg5.cjs"),A=require("./Title-CRj-Ysyr.cjs"),F=require("./usePrinter-qYDc_jVR.cjs"),D=require("./vue-ui-skeleton-D5jxUSy8.cjs"),I=require("./useNestedProp-DmS8KxmW.cjs"),R=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),X=["id"],J={key:0,style:"width:100%"},K=["xmlns","viewBox"],Q={id:"vueUiPill",clipPathUnits:"objectBoundingBox"},Z=["fill"],ee=["id"],te=["stop-color"],oe=["stop-color"],le=["stop-color"],re={"clip-path":"url(#vueUiPill)"},ae=["x","y","height","width"],se=["x","y","height","width","fill"],ne=["x1","x2","y1","y2","stroke-width","stroke"],ue=["x1","x2","y1","y2","stroke-width","stroke"],ce=["x1","x2","y1","y2","stroke-width","stroke"],ie=["x1","x2","y1","y2","stroke-width","stroke"],de=["x1","x2","y1","y2","stroke-width","stroke"],he=["x1","x2","y1","y2","stroke-width","stroke"],ve=["x1","x2","y1","y2","stroke-width","stroke"],me=["x1","x2","y1","y2","stroke-width","stroke"],ye=["x","y","height","width"],pe=["y","x","fill","font-size","font-weight"],fe={key:3,class:"vue-data-ui-watermark"},ge={__name:"vue-ui-thermometer",props:{dataset:{type:Object,default(){return{}}},config:{type:Object,default(){return{}}}},setup(m,{expose:q}){const s=m;e.useCssVars(l=>({"1a02c3eb":z.value,"12f74203":O.value,"32637bb0":M.value}));const{vue_ui_thermometer:S}=r.useConfig(),f=e.computed(()=>!!s.dataset&&Object.keys(s.dataset).length);e.onMounted(()=>{r.objectIsEmpty(s.dataset)?r.error({componentName:"VueUiThermometer",type:"dataset"}):r.getMissingDatasetAttributes({datasetObject:s.dataset,requiredAttributes:["value","from","to"]}).forEach(l=>{r.error({componentName:"VueUiThermometer",type:"datasetAttribute",property:l})})});const d=e.ref(r.createUid()),w=e.ref(null),C=e.ref(0),t=e.computed(()=>{const l=I.useNestedProp({userConfig:s.config,defaultConfig:S});return l.theme?{...I.useNestedProp({userConfig:r.themes.vue_ui_thermometer[l.theme]||s.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}),{isPrinting:N,isImaging:B,generatePdf:E,generateImage:V}=F.usePrinter({elementId:`thermometer__${d.value}`,fileName:t.value.style.title.text||"vue-ui-thermometer"}),y=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),T=e.computed(()=>t.value.style.chart.thermometer.width),i=e.computed(()=>s.dataset.steps||10),c=e.ref({top:t.value.style.chart.padding.top,left:t.value.style.chart.padding.left,right:t.value.style.chart.padding.right,bottom:t.value.style.chart.padding.bottom});function p(l,n,o){const u=[],b=P(l),_=P(n);for(let v=0;v<o;v++){const G=g(b.red,_.red,v,o),W=g(b.green,_.green,v,o),H=g(b.blue,_.blue,v,o),j=`#${k(G)}${k(W)}${k(H)}`;u.push(j)}return u}function P(l){const n=l.slice(1);return{red:parseInt(n.slice(0,2),16),green:parseInt(n.slice(2,4),16),blue:parseInt(n.slice(4,6),16)}}function g(l,n,o,u){return Math.round(l+(n-l)*o/u)}function k(l){return l.toString(16).padStart(2,"0")}const a=e.computed(()=>{const l=T.value+c.value.left+c.value.right,n=t.value.style.chart.height;return{width:l,left:c.value.left,right:l-c.value.right,top:c.value.top,bottom:n-c.value.bottom,height:n}}),Y=e.computed(()=>a.value),x=e.computed(()=>{const l=r.checkNaN(s.dataset.from)<0?Math.abs(r.checkNaN(s.dataset.from)):r.checkNaN(s.dataset.from),n=r.checkNaN(s.dataset.to)<0?Math.abs(r.checkNaN(s.dataset.to)):r.checkNaN(s.dataset.to);let o=0;return r.checkNaN(s.dataset.to)>0?o=l+n:l>n?o=l-n:o=n-l,(1-(Math.abs(r.checkNaN(s.dataset.from))+r.checkNaN(s.dataset.value))/o)*(a.value.height-c.value.top-c.value.bottom)}),M=e.computed(()=>`${x.value}px`),O=e.computed(()=>`${a.value.height-t.value.style.chart.padding.bottom-c.value.top}px`),z=e.computed(()=>`${t.value.style.chart.animation.speedMs}ms`),L=e.computed(()=>{if(s.dataset.colors){if(!s.dataset.colors.from)return p(y.value[0]||r.palette[0],r.convertColorToHex(s.dataset.colors.to),i.value||10);if(!s.dataset.colors.to)return p(r.convertColorToHex(s.dataset.colors.from),y.value[1]||r.palette[1],i.value||10)}else return p(y.value[1]||r.palette[1],y.value[0]||r.palette[0],i.value||10);return p(r.convertColorToHex(s.dataset.colors.from),r.convertColorToHex(s.dataset.colors.to),i.value||10)}),$=e.computed(()=>{const l=[];let n=0;const o=a.value.height-c.value.top-c.value.bottom;for(let u=0;u<o-1;u+=o/i.value)l.push({x:a.value.left,y:a.value.top+u,qYLess:a.value.top+u+o/i.value/4,halfY:a.value.top+u+o/i.value/2,qYMore:a.value.top+u+o/i.value/4*3,color:L.value[n],height:o/i.value}),n+=1;return l}),h=e.ref(!1);function U(l){h.value=l,C.value+=1}return q({generatePdf:E,generateImage:V}),(l,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"thermoChart",ref:w,class:e.normalizeClass(`vue-ui-thermometer ${h.value?"vue-data-ui-wrapper-fullscreen":""}`),style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color};font-family:${t.value.style.fontFamily}`),id:`thermometer__${d.value}`},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",J,[e.createVNode(A._sfc_main,{config:{title:{cy:"thermometer-div-title",...t.value.style.title},subtitle:{cy:"thermometer-div-subtitle",...t.value.style.title.subtitle}}},null,8,["config"])])):e.createCommentVNode("",!0),t.value.userOptions.show&&f.value?(e.openBlock(),e.createBlock(F.UserOptions,{ref:"details",key:`user_options_${C.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(B),isPrinting:e.unref(N),uid:d.value,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,hasXls:!1,isFullscreen:h.value,titles:{...t.value.userOptions.buttonTitles},chartElement:w.value,onToggleFullscreen:U,onGeneratePdf:e.unref(E),onGenerateImage:e.unref(V)},e.createSlots({_:2},[l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:u})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:u})),void 0,!0)]),key:"2"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","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":h.value,"vue-data-ui-fulscreen--off":!h.value}),width:"100%",viewBox:`0 0 ${a.value.width} ${a.value.height}`,style:e.normalizeStyle(`background:${t.value.style.chart.backgroundColor}`)},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",Q,[e.createElementVNode("rect",{x:"0",y:"0",width:"1",height:"1",rx:"0.5",ry:"0.07",fill:t.value.style.chart.backgroundColor},null,8,Z)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.value,(o,u)=>(e.openBlock(),e.createElementBlock("linearGradient",{id:`vueUiThermometerGradient_${u}_${d.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":o.color},null,8,te),e.createElementVNode("stop",{offset:"50%","stop-color":`${o.color}${e.unref(r.opacity)[100-t.value.style.chart.graduations.gradient.intensity]}`},null,8,oe),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,le)],8,ee))),256))]),e.createElementVNode("g",re,[e.createElementVNode("rect",{x:a.value.left,y:a.value.top,height:a.value.height-c.value.top-c.value.bottom,width:a.value.width-c.value.left-c.value.right,fill:"#FFFFFF"},null,8,ae),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.value,(o,u)=>(e.openBlock(),e.createElementBlock("g",{key:`graduation_${u}`},[e.createElementVNode("rect",{x:o.x,y:o.y,height:o.height,width:a.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right,fill:t.value.style.chart.graduations.gradient.show?`url(#vueUiThermometerGradient_${u}_${d.value})`:o.color,"shape-rendering":"crispEdges"},null,8,se),t.value.style.chart.graduations.show&&["both","left"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:0,x1:o.x,x2:o.x+10,y1:o.y,y2:o.y,"stroke-width":t.value.style.chart.graduations.strokeWidth,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,ne)):e.createCommentVNode("",!0),t.value.style.chart.graduations.showIntermediate?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.value.style.chart.graduations.show&&["both","left"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:0,x1:o.x,x2:o.x+5,y1:o.halfY,y2:o.halfY,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,ue)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","left"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:1,x1:o.x,x2:o.x+2.5,y1:o.qYLess,y2:o.qYLess,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,ce)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","left"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:o.x,x2:o.x+2.5,y1:o.qYMore,y2:o.qYMore,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,ie)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","right"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:a.value.right,x2:a.value.right-10,y1:o.y,y2:o.y,"stroke-width":t.value.style.chart.graduations.strokeWidth,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,de)):e.createCommentVNode("",!0),t.value.style.chart.graduations.showIntermediate?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[t.value.style.chart.graduations.show&&["both","right"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:0,x1:a.value.right,x2:a.value.right-5,y1:o.halfY,y2:o.halfY,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,he)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","right"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:1,x1:a.value.right,x2:a.value.right-2.5,y1:o.qYLess,y2:o.qYLess,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,ve)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","right"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:a.value.right,x2:a.value.right-2.5,y1:o.qYMore,y2:o.qYMore,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,me)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)]))),128)),e.createElementVNode("rect",{class:e.normalizeClass({"vue-ui-thermometer-temperature":t.value.style.chart.animation.use}),x:a.value.left,y:a.value.top,height:x.value,width:a.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right,fill:"#FFFFFF66"},null,10,ye)]),e.createElementVNode("text",{class:e.normalizeClass({"vue-ui-thermometer-temperature-value":t.value.style.chart.animation.use}),y:x.value+a.value.top+t.value.style.chart.label.fontSize/3,x:a.value.left-10,"text-anchor":"end",fill:t.value.style.chart.label.color,"font-size":t.value.style.chart.label.fontSize,"font-weight":t.value.style.chart.label.bold?"bold":"normal"},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.label.formatter,m.dataset.value,e.unref(r.dataLabel)({p:t.value.style.chart.label.prefix,v:m.dataset.value,s:t.value.style.chart.label.suffix,r:t.value.style.chart.label.rounding}),{datapoint:m.dataset})),11,pe),e.renderSlot(l.$slots,"svg",{svg:Y.value},void 0,!0)],14,K)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",fe,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(N)||e.unref(B)})),void 0,!0)])):e.createCommentVNode("",!0),f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(D.default,{key:4,config:{type:"thermometer",style:{backgroundColor:t.value.style.chart.backgroundColor,thermometer:{color:"#CCCCCC"}}}},null,8,["config"]))],14,X))}},ke=R._export_sfc(ge,[["__scopeId","data-v-90e1355a"]]);exports.default=ke;
@@ -1,9 +1,9 @@
1
1
  import { useCssVars as ie, computed as c, onMounted as he, ref as k, openBlock as o, createElementBlock as n, normalizeClass as $, normalizeStyle as B, createVNode as ce, createCommentVNode as h, createBlock as j, unref as v, createSlots as de, withCtx as q, renderSlot as x, normalizeProps as A, guardReactiveProps as D, createElementVNode as d, Fragment as F, renderList as H, toDisplayString as ve } from "vue";
2
- import { u as ye, o as fe, e as X, g as me, c as ge, t as pe, a as ke, p as b, b as xe, s as f, d as P, X as be, w as _e, i as we, f as Ce } from "./index-C_05i_JG.js";
3
- import { _ as $e } from "./Title-CPZstF2C.js";
4
- import { u as Fe, U as Pe } from "./usePrinter-DOhlzlnx.js";
5
- import Ie from "./vue-ui-skeleton-CcJR2m18.js";
6
- import { u as R } from "./useNestedProp-DLnT0Wtg.js";
2
+ import { u as ye, o as fe, e as X, g as me, c as ge, t as pe, a as ke, p as b, b as xe, s as f, d as P, X as be, w as _e, i as we, f as Ce } from "./index-CguVaFlt.js";
3
+ import { _ as $e } from "./Title-DbTGPg4G.js";
4
+ import { u as Fe, U as Pe } from "./usePrinter-ClsMRVJG.js";
5
+ import Ie from "./vue-ui-skeleton-ChHLL5Hw.js";
6
+ import { u as R } from "./useNestedProp-BbEbJmgv.js";
7
7
  import { _ as Ye } from "./_plugin-vue_export-helper-CHgC5LLL.js";
8
8
  const Me = ["id"], Ne = {
9
9
  key: 0,
@@ -1,9 +1,9 @@
1
1
  import { ref as d, onMounted as q, onBeforeUnmount as J, computed as D, openBlock as r, createElementBlock as u, normalizeStyle as f, createVNode as _, createCommentVNode as p, unref as K, createElementVNode as M, mergeProps as E, renderSlot as N, normalizeProps as j, guardReactiveProps as B, toDisplayString as Q } from "vue";
2
- import { u as Y } from "./useNestedProp-DLnT0Wtg.js";
3
- import { u as Z, c as ee, X as te, D as O } from "./index-C_05i_JG.js";
2
+ import { u as Y } from "./useNestedProp-BbEbJmgv.js";
3
+ import { u as Z, c as ee, X as te, D as O } from "./index-CguVaFlt.js";
4
4
  import { t as ae, u as se } from "./useResponsive-NZB-WLRF.js";
5
- import x from "./BaseIcon-CS18qRiy.js";
6
- import { _ as le } from "./Title-CPZstF2C.js";
5
+ import x from "./BaseIcon-BNFf4B_v.js";
6
+ import { _ as le } from "./Title-DbTGPg4G.js";
7
7
  import { _ as oe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
8
8
  class re {
9
9
  constructor(F, w, I, z = !0, C = !0) {
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),F=require("./useNestedProp-CPsbJAGj.cjs"),w=require("./index-NNZeHOBS.cjs"),z=require("./useResponsive-B3TrDDIG.cjs"),b=require("./BaseIcon-O8jJvy48.cjs"),H=require("./Title-PZ6S96pU.cjs"),A=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");class L{constructor(N,p,_,T=!0,g=!0){this.interval=p,this.elapsed=0,this.isPaused=!1;const C=`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),F=require("./useNestedProp-DmS8KxmW.cjs"),w=require("./index-7N8NxNg5.cjs"),z=require("./useResponsive-B3TrDDIG.cjs"),b=require("./BaseIcon-3dGIQkTt.cjs"),H=require("./Title-CRj-Ysyr.cjs"),A=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");class L{constructor(N,p,_,T=!0,g=!0){this.interval=p,this.elapsed=0,this.isPaused=!1;const C=`
2
2
  let interval;
3
3
  let elapsed = 0;
4
4
  let paused = false;
@@ -1,9 +1,9 @@
1
1
  import { computed as h, ref as k, watch as ee, onMounted as te, openBlock as s, createElementBlock as v, normalizeClass as O, normalizeStyle as S, createVNode as ae, createCommentVNode as _, createBlock as X, unref as d, createSlots as le, withCtx as A, renderSlot as w, normalizeProps as D, guardReactiveProps as M, Fragment as H, renderList as R, toDisplayString as re } from "vue";
2
- import { u as Y } from "./useNestedProp-DLnT0Wtg.js";
3
- import { u as oe, c as se, t as ne, s as N, o as ue, e as ie, v as q, X as ce, i as ve, f as he } from "./index-C_05i_JG.js";
4
- import { _ as de } from "./Title-CPZstF2C.js";
5
- import { u as ge, U as ye } from "./usePrinter-DOhlzlnx.js";
6
- import me from "./vue-ui-skeleton-CcJR2m18.js";
2
+ import { u as Y } from "./useNestedProp-BbEbJmgv.js";
3
+ import { u as oe, c as se, t as ne, s as N, o as ue, e as ie, v as q, X as ce, i as ve, f as he } from "./index-CguVaFlt.js";
4
+ import { _ as de } from "./Title-DbTGPg4G.js";
5
+ import { u as ge, U as ye } from "./usePrinter-ClsMRVJG.js";
6
+ import me from "./vue-ui-skeleton-ChHLL5Hw.js";
7
7
  import { _ as fe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
8
8
  const pe = ["id"], ke = ["xmlns", "viewBox"], _e = { key: 0 }, be = ["d", "stroke-width", "stroke"], Ce = { key: 1 }, $e = ["x1", "y1", "x2", "y2", "stroke-width", "stroke"], xe = ["x", "y", "font-size", "fill", "font-weight", "text-anchor"], we = {
9
9
  key: 3,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),E=require("./useNestedProp-CPsbJAGj.cjs"),s=require("./index-NNZeHOBS.cjs"),T=require("./Title-PZ6S96pU.cjs"),O=require("./usePrinter-BLbY8qGZ.cjs"),j=require("./vue-ui-skeleton-CI4t8LHn.cjs"),U=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),H=["id"],M=["xmlns","viewBox"],D={key:0},X=["d","stroke-width","stroke"],R={key:1},Y=["x1","y1","x2","y2","stroke-width","stroke"],J=["x","y","font-size","fill","font-weight","text-anchor"],K={key:3,class:"vue-data-ui-watermark"},Q={__name:"vue-ui-tiremarks",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(A,{expose:V}){const i=A,{vue_ui_tiremarks:q}=s.useConfig(),x=e.computed(()=>!!i.dataset&&Object.keys(i.dataset).length),$=e.ref(s.createUid()),w=e.ref(null),P=e.ref(0),t=e.computed(()=>{const a=E.useNestedProp({userConfig:i.config,defaultConfig:q});return a.theme?{...E.useNestedProp({userConfig:s.themes.vue_ui_tiremarks[a.theme]||i.config,defaultConfig:a})}:a}),{isPrinting:B,isImaging:N,generatePdf:z,generateImage:S}=O.usePrinter({elementId:$.value,fileName:t.value.style.chart.title.text||"vue-ui-tiremarks"}),c=e.ref(t.value.style.chart.animation.use?0:s.checkNaN(i.dataset.percentage));e.watch(()=>i.dataset.percentage,()=>{c.value=t.value.style.chart.animation.use?0:s.checkNaN(i.dataset.percentage),I()}),e.onMounted(()=>{s.objectIsEmpty(i.dataset)&&s.error({componentName:"VueUiTiremarks",type:"dataset"}),I()});function I(){let a=0,u=t.value.style.chart.animation.speed,l=.005*t.value.style.chart.animation.acceleration;function r(){c.value+=u+a,a+=l,c.value<i.dataset.percentage?requestAnimationFrame(r):c.value=s.checkNaN(i.dataset.percentage)}t.value.style.chart.animation.use&&(c.value=0,r())}const y=e.computed(()=>t.value.style.chart.layout.display==="vertical"),n=e.computed(()=>{const a={top:48,left:64,right:64,bottom:48};return y.value?{top:t.value.style.chart.percentage.verticalPosition==="top"?a.top:3,left:3,right:3,bottom:t.value.style.chart.percentage.verticalPosition==="bottom"?a.bottom:3}:{top:0,bottom:0,left:t.value.style.chart.percentage.horizontalPosition==="left"?a.left:3,right:t.value.style.chart.percentage.horizontalPosition==="right"?a.right:10}}),C=e.computed(()=>Object.values(n.value).reduce((a,u)=>a+u,0)),o=e.computed(()=>({height:y.value?312:56,width:y.value?56:312})),L=e.ref(100);e.computed(()=>i.dataset.percentage/L.value);const v=e.computed(()=>y.value?{mark:(o.value.height-C.value)/100*.5,space:(o.value.height-C.value)/100*.5}:{mark:(o.value.width-C.value)/100*.5,space:(o.value.width-C.value)/100*.5}),F=e.computed(()=>{const a=[];for(let l=0;l<100;l+=1){const r=t.value.style.chart.layout.ticks.gradient.show?s.shiftHue(t.value.style.chart.layout.activeColor,l/100*(t.value.style.chart.layout.ticks.gradient.shiftHueIntensity/100)):t.value.style.chart.layout.activeColor;if(y.value){const f=t.value.style.chart.layout.crescendo?(100-l)*(o.value.width-n.value.left-n.value.right)/100/3:0,d=n.value.left+4+f,h=o.value.width-n.value.right-4-f,m=o.value.height-n.value.bottom-l*v.value.mark-l*v.value.space-v.value.mark,g=o.value.height-n.value.bottom-l*v.value.mark-l*v.value.space-v.value.mark,k=(h-d)/t.value.style.chart.layout.curveAngleX,b=t.value.style.chart.layout.curveAngleY*((1+l)/100);a.push({x1:d,x2:h,y1:m,y2:g,curve:`M ${d} ${m} C ${d+k} ${m-b}, ${h-k} ${g-b}, ${h} ${g}`,color:r})}else{const f=t.value.style.chart.layout.crescendo?(100-l)*(o.value.height-n.value.top-n.value.bottom)/100/3:0,d=n.value.left+l*v.value.mark+l*v.value.space-v.value.mark,h=d,m=n.value.top+4+f,g=o.value.height-n.value.bottom-4-f,k=t.value.style.chart.layout.curveAngleY*((1+l)/100),b=(g-m)/t.value.style.chart.layout.curveAngleX;a.push({x1:d,x2:h,y1:m,y2:g,curve:`M ${d} ${m} C ${d+k} ${m+b}, ${h+k} ${g-b}, ${h} ${g}`,color:r})}}return a}),p=e.computed(()=>{let a,u,l;const r=t.value.style.chart.percentage.fontSize/3;return y.value?t.value.style.chart.percentage.verticalPosition==="top"?(a=o.value.width/2,u=n.value.top/2,l="middle"):t.value.style.chart.percentage.verticalPosition==="bottom"&&(a=o.value.width/2,u=o.value.height-n.value.bottom/2+r,l="middle"):t.value.style.chart.percentage.horizontalPosition==="left"?(a=4,u=o.value.height/2+r,l="start"):t.value.style.chart.percentage.horizontalPosition==="right"&&(a=o.value.width-n.value.right+8,u=o.value.height/2+r,l="start"),{x:a,y:u,textAnchor:l,bold:t.value.style.chart.percentage.bold,fontSize:t.value.style.chart.percentage.fontSize,fill:t.value.style.chart.percentage.color}}),_=e.ref(!1);function G(a){_.value=a,P.value+=1}return V({generatePdf:z,generateImage:S}),(a,u)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tiremarksChart",ref:w,class:e.normalizeClass(`vue-ui-tiremarks ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor}`),id:$.value},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:12px`)},[e.createVNode(T._sfc_main,{config:{title:{cy:"wheel-title",...t.value.style.chart.title},subtitle:{cy:"wheel-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&x.value?(e.openBlock(),e.createBlock(O.UserOptions,{ref:"details",key:`user_options_${P.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(B),isImaging:e.unref(N),uid:$.value,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,hasXls:!1,isFullscreen:_.value,titles:{...t.value.userOptions.buttonTitles},chartElement:w.value,onToggleFullscreen:G,onGeneratePdf:e.unref(z),onGenerateImage:e.unref(S)},e.createSlots({_:2},[a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:r})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:r})),void 0,!0)]),key:"2"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),x.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(s.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":_.value,"vue-data-ui-fulscreen--off":!_.value}),viewBox:`0 0 ${o.value.width} ${o.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[t.value.style.chart.layout.curved?(e.openBlock(),e.createElementBlock("g",D,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{d:l.curve,"stroke-width":v.value.mark,stroke:c.value>=r?l.color:t.value.style.chart.layout.inactiveColor,"stroke-linecap":"round",fill:"none",class:e.normalizeClass({"vue-ui-tick-animated":t.value.style.chart.animation.use&&r<=c.value})},null,10,X))),256))])):(e.openBlock(),e.createElementBlock("g",R,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{x1:l.x1,y1:l.y1,x2:l.x2,y2:l.y2,"stroke-width":v.value.mark,stroke:c.value>=r?l.color:t.value.style.chart.layout.inactiveColor,"stroke-linecap":"round"},null,8,Y))),256))])),t.value.style.chart.percentage.show?(e.openBlock(),e.createElementBlock("text",{key:2,x:p.value.x,y:p.value.y,"font-size":p.value.fontSize,fill:t.value.style.chart.layout.ticks.gradient.show&&t.value.style.chart.percentage.useGradientColor?e.unref(s.shiftHue)(t.value.style.chart.layout.activeColor,c.value/100*(t.value.style.chart.layout.ticks.gradient.shiftHueIntensity/100)):t.value.style.chart.percentage.color,"font-weight":p.value.bold?"bold":"normal","text-anchor":p.value.textAnchor},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.chart.percentage.formatter,c.value,e.unref(s.dataLabel)({v:c.value,s:"%",r:t.value.style.chart.percentage.rounding}))),9,J)):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"svg",{svg:o.value},void 0,!0)],14,M)):e.createCommentVNode("",!0),a.$slots.watermark?(e.openBlock(),e.createElementBlock("div",K,[e.renderSlot(a.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(B)||e.unref(N)})),void 0,!0)])):e.createCommentVNode("",!0),x.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(j.default,{key:4,config:{type:"tiremarks",style:{backgroundColor:t.value.style.chart.backgroundColor,tiremarks:{color:"#CCCCCC"}}}},null,8,["config"]))],14,H))}},W=U._export_sfc(Q,[["__scopeId","data-v-51f57492"]]);exports.default=W;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),E=require("./useNestedProp-DmS8KxmW.cjs"),s=require("./index-7N8NxNg5.cjs"),T=require("./Title-CRj-Ysyr.cjs"),O=require("./usePrinter-qYDc_jVR.cjs"),j=require("./vue-ui-skeleton-D5jxUSy8.cjs"),U=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),H=["id"],M=["xmlns","viewBox"],D={key:0},X=["d","stroke-width","stroke"],R={key:1},Y=["x1","y1","x2","y2","stroke-width","stroke"],J=["x","y","font-size","fill","font-weight","text-anchor"],K={key:3,class:"vue-data-ui-watermark"},Q={__name:"vue-ui-tiremarks",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(A,{expose:V}){const i=A,{vue_ui_tiremarks:q}=s.useConfig(),x=e.computed(()=>!!i.dataset&&Object.keys(i.dataset).length),$=e.ref(s.createUid()),w=e.ref(null),P=e.ref(0),t=e.computed(()=>{const a=E.useNestedProp({userConfig:i.config,defaultConfig:q});return a.theme?{...E.useNestedProp({userConfig:s.themes.vue_ui_tiremarks[a.theme]||i.config,defaultConfig:a})}:a}),{isPrinting:B,isImaging:N,generatePdf:z,generateImage:S}=O.usePrinter({elementId:$.value,fileName:t.value.style.chart.title.text||"vue-ui-tiremarks"}),c=e.ref(t.value.style.chart.animation.use?0:s.checkNaN(i.dataset.percentage));e.watch(()=>i.dataset.percentage,()=>{c.value=t.value.style.chart.animation.use?0:s.checkNaN(i.dataset.percentage),I()}),e.onMounted(()=>{s.objectIsEmpty(i.dataset)&&s.error({componentName:"VueUiTiremarks",type:"dataset"}),I()});function I(){let a=0,u=t.value.style.chart.animation.speed,l=.005*t.value.style.chart.animation.acceleration;function r(){c.value+=u+a,a+=l,c.value<i.dataset.percentage?requestAnimationFrame(r):c.value=s.checkNaN(i.dataset.percentage)}t.value.style.chart.animation.use&&(c.value=0,r())}const y=e.computed(()=>t.value.style.chart.layout.display==="vertical"),n=e.computed(()=>{const a={top:48,left:64,right:64,bottom:48};return y.value?{top:t.value.style.chart.percentage.verticalPosition==="top"?a.top:3,left:3,right:3,bottom:t.value.style.chart.percentage.verticalPosition==="bottom"?a.bottom:3}:{top:0,bottom:0,left:t.value.style.chart.percentage.horizontalPosition==="left"?a.left:3,right:t.value.style.chart.percentage.horizontalPosition==="right"?a.right:10}}),C=e.computed(()=>Object.values(n.value).reduce((a,u)=>a+u,0)),o=e.computed(()=>({height:y.value?312:56,width:y.value?56:312})),L=e.ref(100);e.computed(()=>i.dataset.percentage/L.value);const v=e.computed(()=>y.value?{mark:(o.value.height-C.value)/100*.5,space:(o.value.height-C.value)/100*.5}:{mark:(o.value.width-C.value)/100*.5,space:(o.value.width-C.value)/100*.5}),F=e.computed(()=>{const a=[];for(let l=0;l<100;l+=1){const r=t.value.style.chart.layout.ticks.gradient.show?s.shiftHue(t.value.style.chart.layout.activeColor,l/100*(t.value.style.chart.layout.ticks.gradient.shiftHueIntensity/100)):t.value.style.chart.layout.activeColor;if(y.value){const f=t.value.style.chart.layout.crescendo?(100-l)*(o.value.width-n.value.left-n.value.right)/100/3:0,d=n.value.left+4+f,h=o.value.width-n.value.right-4-f,m=o.value.height-n.value.bottom-l*v.value.mark-l*v.value.space-v.value.mark,g=o.value.height-n.value.bottom-l*v.value.mark-l*v.value.space-v.value.mark,k=(h-d)/t.value.style.chart.layout.curveAngleX,b=t.value.style.chart.layout.curveAngleY*((1+l)/100);a.push({x1:d,x2:h,y1:m,y2:g,curve:`M ${d} ${m} C ${d+k} ${m-b}, ${h-k} ${g-b}, ${h} ${g}`,color:r})}else{const f=t.value.style.chart.layout.crescendo?(100-l)*(o.value.height-n.value.top-n.value.bottom)/100/3:0,d=n.value.left+l*v.value.mark+l*v.value.space-v.value.mark,h=d,m=n.value.top+4+f,g=o.value.height-n.value.bottom-4-f,k=t.value.style.chart.layout.curveAngleY*((1+l)/100),b=(g-m)/t.value.style.chart.layout.curveAngleX;a.push({x1:d,x2:h,y1:m,y2:g,curve:`M ${d} ${m} C ${d+k} ${m+b}, ${h+k} ${g-b}, ${h} ${g}`,color:r})}}return a}),p=e.computed(()=>{let a,u,l;const r=t.value.style.chart.percentage.fontSize/3;return y.value?t.value.style.chart.percentage.verticalPosition==="top"?(a=o.value.width/2,u=n.value.top/2,l="middle"):t.value.style.chart.percentage.verticalPosition==="bottom"&&(a=o.value.width/2,u=o.value.height-n.value.bottom/2+r,l="middle"):t.value.style.chart.percentage.horizontalPosition==="left"?(a=4,u=o.value.height/2+r,l="start"):t.value.style.chart.percentage.horizontalPosition==="right"&&(a=o.value.width-n.value.right+8,u=o.value.height/2+r,l="start"),{x:a,y:u,textAnchor:l,bold:t.value.style.chart.percentage.bold,fontSize:t.value.style.chart.percentage.fontSize,fill:t.value.style.chart.percentage.color}}),_=e.ref(!1);function G(a){_.value=a,P.value+=1}return V({generatePdf:z,generateImage:S}),(a,u)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tiremarksChart",ref:w,class:e.normalizeClass(`vue-ui-tiremarks ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor}`),id:$.value},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:12px`)},[e.createVNode(T._sfc_main,{config:{title:{cy:"wheel-title",...t.value.style.chart.title},subtitle:{cy:"wheel-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&x.value?(e.openBlock(),e.createBlock(O.UserOptions,{ref:"details",key:`user_options_${P.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(B),isImaging:e.unref(N),uid:$.value,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,hasXls:!1,isFullscreen:_.value,titles:{...t.value.userOptions.buttonTitles},chartElement:w.value,onToggleFullscreen:G,onGeneratePdf:e.unref(z),onGenerateImage:e.unref(S)},e.createSlots({_:2},[a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:r})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:r})),void 0,!0)]),key:"2"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),x.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(s.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":_.value,"vue-data-ui-fulscreen--off":!_.value}),viewBox:`0 0 ${o.value.width} ${o.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[t.value.style.chart.layout.curved?(e.openBlock(),e.createElementBlock("g",D,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{d:l.curve,"stroke-width":v.value.mark,stroke:c.value>=r?l.color:t.value.style.chart.layout.inactiveColor,"stroke-linecap":"round",fill:"none",class:e.normalizeClass({"vue-ui-tick-animated":t.value.style.chart.animation.use&&r<=c.value})},null,10,X))),256))])):(e.openBlock(),e.createElementBlock("g",R,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{x1:l.x1,y1:l.y1,x2:l.x2,y2:l.y2,"stroke-width":v.value.mark,stroke:c.value>=r?l.color:t.value.style.chart.layout.inactiveColor,"stroke-linecap":"round"},null,8,Y))),256))])),t.value.style.chart.percentage.show?(e.openBlock(),e.createElementBlock("text",{key:2,x:p.value.x,y:p.value.y,"font-size":p.value.fontSize,fill:t.value.style.chart.layout.ticks.gradient.show&&t.value.style.chart.percentage.useGradientColor?e.unref(s.shiftHue)(t.value.style.chart.layout.activeColor,c.value/100*(t.value.style.chart.layout.ticks.gradient.shiftHueIntensity/100)):t.value.style.chart.percentage.color,"font-weight":p.value.bold?"bold":"normal","text-anchor":p.value.textAnchor},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.chart.percentage.formatter,c.value,e.unref(s.dataLabel)({v:c.value,s:"%",r:t.value.style.chart.percentage.rounding}))),9,J)):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"svg",{svg:o.value},void 0,!0)],14,M)):e.createCommentVNode("",!0),a.$slots.watermark?(e.openBlock(),e.createElementBlock("div",K,[e.renderSlot(a.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(B)||e.unref(N)})),void 0,!0)])):e.createCommentVNode("",!0),x.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(j.default,{key:4,config:{type:"tiremarks",style:{backgroundColor:t.value.style.chart.backgroundColor,tiremarks:{color:"#CCCCCC"}}}},null,8,["config"]))],14,H))}},W=U._export_sfc(Q,[["__scopeId","data-v-51f57492"]]);exports.default=W;
@@ -1,14 +1,14 @@
1
1
  import { computed as C, ref as y, onMounted as He, onBeforeUnmount as Ue, openBlock as m, createElementBlock as k, normalizeClass as xe, normalizeStyle as M, createVNode as re, createCommentVNode as V, createBlock as te, unref as b, createSlots as Ge, withCtx as T, renderSlot as _, normalizeProps as G, guardReactiveProps as X, Fragment as $e, renderList as Te, createElementVNode as O, toDisplayString as q, createTextVNode as _e, nextTick as Xe, pushScopeId as qe, popScopeId as je } from "vue";
2
- import { u as Ye, c as Oe, t as Ze, a as Je, p as x, b as Ke, o as Qe, e as et, d as le, i as oe, f as Z, X as tt, l as Se, E as Ne, x as ze, y as lt, q as ot, r as at } from "./index-C_05i_JG.js";
3
- import { _ as nt } from "./Title-CPZstF2C.js";
4
- import { u as st, U as rt } from "./usePrinter-DOhlzlnx.js";
5
- import { _ as ut } from "./Tooltip-CBmmiqKr.js";
6
- import { L as it } from "./Legend-UWyvC57K.js";
7
- import ct from "./vue-ui-skeleton-CcJR2m18.js";
8
- import { D as dt } from "./DataTable-BGJ2mVxG.js";
9
- import vt from "./vue-ui-accordion-rGJVvi_V.js";
2
+ import { u as Ye, c as Oe, t as Ze, a as Je, p as x, b as Ke, o as Qe, e as et, d as le, i as oe, f as Z, X as tt, l as Se, E as Ne, x as ze, y as lt, q as ot, r as at } from "./index-CguVaFlt.js";
3
+ import { _ as nt } from "./Title-DbTGPg4G.js";
4
+ import { u as st, U as rt } from "./usePrinter-ClsMRVJG.js";
5
+ import { _ as ut } from "./Tooltip-u79R5W5y.js";
6
+ import { L as it } from "./Legend-CsVEDSh6.js";
7
+ import ct from "./vue-ui-skeleton-ChHLL5Hw.js";
8
+ import { D as dt } from "./DataTable-BwHWRlRZ.js";
9
+ import vt from "./vue-ui-accordion-w15FGKRN.js";
10
10
  import { t as ht, u as ft } from "./useResponsive-NZB-WLRF.js";
11
- import { u as Ie } from "./useNestedProp-DLnT0Wtg.js";
11
+ import { u as Ie } from "./useNestedProp-BbEbJmgv.js";
12
12
  import { _ as pt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
13
13
  function Pe(a, i) {
14
14
  const s = a.length;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-NNZeHOBS.cjs"),ke=require("./Title-PZ6S96pU.cjs"),re=require("./usePrinter-BLbY8qGZ.cjs"),Ce=require("./Tooltip-BoIYPSX3.cjs"),we=require("./Legend-DuuSl2rJ.cjs"),xe=require("./vue-ui-skeleton-CI4t8LHn.cjs"),Te=require("./DataTable-CSEiZDAb.cjs"),$e=require("./vue-ui-accordion-CcdyvXrp.cjs"),ue=require("./useResponsive-B3TrDDIG.cjs"),se=require("./useNestedProp-CPsbJAGj.cjs"),Se=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");function ie(n,d){const s=n.length;if(s===0)throw new Error(`Max aspect ratio cannot be computed: ${n} is an empty array`);{let u=1/0,i=-1/0,v=0;for(let f=0;f<s;f+=1){const p=n[f].normalizedValue;p<u&&(u=p),p>i&&(i=p),v+=p}return Math.max(d**2*i/v**2,v**2/(d**2*u))}}function ce(n){const{xOffset:d,yOffset:s,width:u,height:i}=n;return{x0:d,y0:s,x1:d+u,y1:s+i}}function Ne(n,d,s){if(n.length===0)return!0;{const u=n.concat(d),i=ie(n,s),v=ie(u,s);return i>=v}}function Be(n){const d=[],s=n.length;for(let u=0;u<s;u+=1){const i=n[u],v=i.length;for(let h=0;h<v;h+=1)d.push(i[h])}return d}function _e(n,d){const s={...d,children:n};return ve(s)}function ze(n){return(n.x1-n.x0)*(n.y1-n.y0)}function de(n,d){const{width:s,height:u,xOffset:i,yOffset:v}=U(d),h=n.length,f=n.map(m=>m.normalizedValue||0).reduce((m,k)=>m+k,0),p=f/u,C=f/s;let b=i,w=v;const g=[];if(s>=u){for(let m=0;m<h;m+=1){const k=n[m],x=w+k.normalizedValue/p,t={x0:b,y0:w,x1:b+p,y1:x},T=Object.assign({},k,t);w=x,g.push(T)}return g}else{for(let m=0;m<h;m+=1){const k=n[m],x=b+k.normalizedValue/C,t={x0:b,y0:w,x1:x,y1:w+C},T=Object.assign({},k,t);b=x,g.push(T)}return g}}function Pe(n){const d=U(n),s=d.width,u=d.height;return Math.min(s,u)}function Oe(n,d){const s=n.length,u=n.map(p=>p.value??0).reduce((p,C)=>p+C,0),i=d/u,v=[];let h,f;for(let p=0;p<s;p+=1)f=n[p],h=Object.assign({},f,{normalizedValue:f.value*(i||0)}),v.push(h);return v}function U(n){const{x0:d,y0:s,x1:u,y1:i}=n;return{xOffset:d,yOffset:s,width:u-d,height:i-s}}function Ve(n,d,s,u){let i=n,v=d,h=s,f=u;for(;;){const p=i.length;if(p===0){const g=de(v,h);return f.concat(g)}const C=Pe(h),b=i[0],w=i.slice(1,p);if(Ne(v,b,C)){const g=v.concat(b);i=w,v=g,h=h,f=f}else{const g=v.length;let m=0;for(let T=0;T<g;T+=1)m+=v[T].normalizedValue;const k=Ee(h,m),x=de(v,h),t=f.concat(x);i=i,v=[],h=k,f=t}}}function ve(n){if(typeof n.children>"u"||!n.children.length)return[n];{const d=Oe(n.children,ze(n)),s=Ve(d,[],n,[]),u=s.length,i=[];for(let h=0;h<u;h+=1)i.push(ve(s[h]));return Be(i)}}function Ee(n,d){const{width:s,height:u,xOffset:i,yOffset:v}=U(n);if(s>=u){const h=d/u,f=s-h,p={xOffset:i+h,yOffset:v,width:f,height:u};return ce(p)}else{const h=d/s,f=u-h,p={xOffset:i,yOffset:v+h,width:s,height:f};return ce(p)}}const Le=n=>(e.pushScopeId("data-v-61b57d4b"),n=n(),e.popScopeId(),n),Re=["id"],Fe=["xmlns","viewBox"],Ie={key:0},De=["id"],qe=["stop-color"],Ae=["stop-color"],He=["x","y","height","width","fill","rx","stroke","stroke-width","onClick","onMouseenter"],Me=["x","y","height","width"],We={style:{width:"100%",height:"100%"},class:"vue-ui-treemap-cell"},Ue=Le(()=>e.createElementVNode("br",null,null,-1)),Ge={key:3,class:"vue-data-ui-watermark"},je=["onClick"],Xe={key:0},Ye={key:1},Ze=["innerHTML"],Je={__name:"vue-ui-treemap",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(n,{expose:d,emit:s}){const u=n,{vue_ui_treemap:i}=r.useConfig(),v=e.computed(()=>!!u.dataset&&u.dataset.length),h=e.computed(()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),f=e.ref(r.createUid()),p=e.ref(!1),C=e.ref(""),b=e.ref(!1),w=e.ref(0),g=e.ref([]),m=e.ref(null),k=e.ref(null),x=e.ref(null),t=e.computed(()=>{const l=se.useNestedProp({userConfig:u.config,defaultConfig:i});return l.theme?{...se.useNestedProp({userConfig:r.themes.vue_ui_treemap[l.theme]||u.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}),{isPrinting:T,isImaging:G,generatePdf:j,generateImage:X}=re.usePrinter({elementId:`treemap_${f.value}`,fileName:t.value.style.chart.title.text||"vue-ui-treemap"}),I=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),B=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),_=e.ref({height:t.value.style.chart.height,width:t.value.style.chart.width}),P=e.computed(()=>({bottom:_.value.height-t.value.style.chart.padding.bottom,height:_.value.height-t.value.style.chart.padding.top-t.value.style.chart.padding.bottom,left:t.value.style.chart.padding.left,right:_.value.width-t.value.style.chart.padding.right,top:t.value.style.chart.padding.top,vbHeight:_.value.height,vbWidth:_.value.width,width:_.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right}));function Y(l){l.forEach((a,o)=>{a.id=r.createUid(),a.color=r.convertColorToHex(a.color)||I.value[o]||r.palette[o]||r.palette[o%r.palette.length],a.children&&(a.children.forEach(c=>{c.parentId=a.id,c.color=a.color}),Y(a.children))})}const O=e.ref(u.dataset),D=e.ref(null);e.onMounted(()=>{if(r.objectIsEmpty(u.dataset)&&r.error({componentName:"VueUiTreemap",type:"dataset"}),Y(O.value),t.value.responsive){const l=ue.throttle(()=>{const{width:a,height:o}=ue.useResponsive({chart:m.value,title:t.value.style.chart.title.text?k.value:null,legend:t.value.style.chart.legend.show?x.value:null});_.value.width=a,_.value.height=o});D.value=new ResizeObserver(l),D.value.observe(m.value.parentNode)}}),e.onBeforeUnmount(()=>{D.value&&D.value.disconnect()});const H=e.ref(O.value),R=e.computed(()=>H.value.map((l,a)=>({...l,color:r.convertColorToHex(l.color)||I.value[a]||r.palette[a]||r.palette[a%r.palette.length]})).filter(l=>!g.value.includes(l.id))),E=e.computed(()=>O.value.filter(l=>!g.value.includes(l.id)).map(l=>l.value||0).reduce((l,a)=>l+a,0)),Z=e.computed({get(){let l=[...R.value];return t.value.style.chart.layout.sorted&&(l=[...R.value].sort((a,o)=>o.value-a.value)),l.map(a=>({...a}))},set(l){return l}});function J(l,a){return l.value/a}function he(l,a,o){const c=t.value.style.chart.layout.rects.colorRatio-J(a,o);return r.lightenHexColor(l,c<0?0:c)}function K(l,a,o,c){return l.map((y,z)=>{const A=he(r.convertColorToHex(a)||I.value[z]||r.palette[z]||r.palette[z%r.palette.length],y,c),be=J(y,c);return{...y,color:A,proportion:be,parentName:o,children:y.children?K(y.children,A,y.name,c):void 0}})}const F=e.computed(()=>_e(Z.value.map((l,a)=>{const o=l.children?l.children.reduce((c,y)=>c+y.value,0):l.value;return{value:l.value,id:l.id,children:l.children?K(l.children.sort((c,y)=>y.value-c.value),l.color,l.name,o):void 0,color:l.color,name:l.name}}),{x0:P.value.left*2,y0:P.value.top,x1:P.value.width,y1:P.value.height}));function Q({y0:l,y1:a}){return a-l<=0?1e-4:a-l}function ee({x0:l,x1:a}){return a-l<=0?1e-4:a-l}function V(l){const a=t.value.style.chart.layout.labels.fontSize*(l.proportion*2>1?1:l.proportion*2);return a<t.value.style.chart.layout.labels.minFontSize?t.value.style.chart.layout.labels.minFontSize:a}function pe(l){b.value=l,w.value+=1}const L=e.computed(()=>({startX:0,startY:0,width:P.value.vbWidth,height:P.value.vbHeight})),$=e.ref(!1);function M(l,a=O.value){for(const o of a){if(o.id===l)return o;if(o.children){const c=M(l,o.children);if(c)return c}}return null}function fe(l){if($.value)s("selectDatapoint",void 0),H.value=O.value;else{if(s("selectDatapoint",l),!M(l.parentId))return;H.value=[M(l.parentId)]}$.value=!$.value}const S=e.ref(null),te=e.computed(()=>O.value.map((l,a)=>({...l,color:r.convertColorToHex(l.color)||I.value[a]||r.palette[a]||r.palette[a%r.palette.length],shape:"square"})).sort((l,a)=>a.value-l.value).map((l,a)=>({...l,proportion:l.value/O.value.map(o=>o.value).reduce((o,c)=>o+c,0),opacity:g.value.includes(l.id)?.5:1}))),ge=e.computed(()=>({cy:"treemap-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""}));function le(l){$.value=!1,S.value=null,g.value.includes(l.id)?g.value=g.value.filter(a=>a!==l.id):g.value.length<u.dataset.length-1&&g.value.push(l.id),s("selectLegend",Z.value)}const W=e.ref(null);function me({datapoint:l,seriesIndex:a}){S.value=l,W.value={datapoint:l,seriesIndex:a,config:t.value,series:R.value};const o=t.value.style.chart.tooltip.customFormat;if(r.isFunction(o)&&r.functionReturnsString(()=>o({seriesIndex:a,datapoint:l,series:R.value,config:t.value})))C.value=o({seriesIndex:a,datapoint:l,series:R.value,config:t.value});else{let c="";c+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${l.name}</div>`,c+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><rect x="0" y="0" height="12" width="12" stroke="none" fill="${l.color}"/></svg>`,c+=`<b>${r.applyDataLabel(t.value.style.chart.layout.labels.formatter,l.value,r.dataLabel({p:t.value.style.chart.layout.labels.prefix,v:l.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:l,seriesIndex:a})}</b>`,C.value=`<div>${c}</div>`}p.value=!0}const N=e.computed(()=>{const l=F.value.map(o=>({name:o.name,color:o.color})),a=F.value.map(o=>o.value);return{head:l,body:a}});function oe(){e.nextTick(()=>{const l=N.value.head.map((c,y)=>[[c.name],[N.value.body[y]],[isNaN(N.value.body[y]/E.value)?"-":N.value.body[y]/E.value*100]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(l),o=r.createCsvContent(a);r.downloadCsv({csvContent:o,title:t.value.style.chart.title.text||"vue-ui-treemap"})})}const q=e.computed(()=>{const l=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage],a=N.value.head.map((y,z)=>{const A=r.applyDataLabel(t.value.style.chart.layout.labels.formatter,N.value.body[z],r.dataLabel({p:t.value.style.chart.layout.labels.prefix,v:N.value.body[z],s:t.value.style.chart.layout.labels.suffix,r:t.value.table.td.roundingValue}));return[{color:y.color,name:y.name,shape:"square"},A,isNaN(N.value.body[z]/E.value)?"-":r.dataLabel({v:N.value.body[z]/E.value*100,s:"%",r:t.value.table.td.roundingPercentage})]}),o={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value],head:l,body:a,config:o}});function ye(){return F.value}function ae(){B.value.showTable=!B.value.showTable}function ne(){B.value.showTooltip=!B.value.showTooltip}return d({getData:ye,generateCsv:oe,generateImage:X,generatePdf:j,toggleTable:ae,toggleTooltip:ne}),(l,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"treemapChart",ref:m,class:e.normalizeClass(`vue-ui-treemap ${b.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; ${t.value.responsive?"height: 100%;":""} text-align:center;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor}`),id:`treemap_${f.value}`},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:k,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:6px`)},[e.createVNode(ke._sfc_main,{config:{title:{cy:"treemap-div-title",...t.value.style.chart.title},subtitle:{cy:"treemap-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&v.value?(e.openBlock(),e.createBlock(re.UserOptions,{ref:"details",key:`user_option_${w.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(T),isImaging:e.unref(G),uid:f.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:b.value,isTooltip:B.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:m.value,onToggleFullscreen:pe,onGeneratePdf:e.unref(j),onGenerateCsv:oe,onGenerateImage:e.unref(X),onToggleTable:ae,onToggleTooltip:ne},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:c})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:c})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),v.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":b.value,"vue-data-ui-fulscreen--off":!b.value,"vue-data-ui-zoom-plus":!$.value,"vue-data-ui-zoom-minus":$.value}),viewBox:`${L.value.startX} ${L.value.startY} ${L.value.width<=0?10:L.value.width} ${L.value.height<=0?10:L.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: hidden; background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(o,c)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.chart.layout.rects.gradient.show?(e.openBlock(),e.createElementBlock("defs",Ie,[e.createElementVNode("radialGradient",{id:`tgrad_${o.id}`,gradientTransform:"translate(-1, -1.000001) scale(2, 2)"},[e.createElementVNode("stop",{offset:"18%","stop-color":o.color},null,8,qe),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.lightenHexColor)(o.color,t.value.style.chart.layout.rects.gradient.intensity/100)},null,8,Ae)],8,De)])):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(o,c)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:o.x0,y:o.y0,height:Q(o),width:ee(o),fill:h.value?o.color:t.value.style.chart.layout.rects.gradient.show?`url(#tgrad_${o.id})`:o.color,rx:t.value.style.chart.layout.rects.borderRadius,stroke:S.value&&S.value.id===o.id?t.value.style.chart.layout.rects.selected.stroke:t.value.style.chart.layout.rects.stroke,"stroke-width":S.value&&S.value.id===o.id?t.value.style.chart.layout.rects.selected.strokeWidth:t.value.style.chart.layout.rects.strokeWidth,onClick:y=>fe(o),onMouseenter:()=>me({datapoint:o,seriesIndex:c}),onMouseleave:a[0]||(a[0]=y=>{S.value=null,p.value=!1}),style:e.normalizeStyle(`opacity:${S.value?S.value.id===o.id?1:t.value.style.chart.layout.rects.selected.unselectedOpacity:1}`),class:"vue-ui-treemap-rect"},null,44,He),(e.openBlock(),e.createElementBlock("foreignObject",{x:o.x0,y:o.y0,height:Q(o),width:ee(o),class:"vue-ui-treemap-cell-foreignObject"},[e.createElementVNode("div",We,[t.value.style.chart.layout.labels.showDefaultLabels&&(o.proportion>t.value.style.chart.layout.labels.hideUnderProportion||$.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vue-ui-treemap-cell-default",style:e.normalizeStyle(`width:calc(100% - ${V(o)/1.5}px);text-align:left;line-height:${V(o)<14?14:V(o)}px;padding:${V(o)/3}px; color:${e.unref(r.adaptColorToBackground)(o.color)}`)},[e.createElementVNode("span",{style:e.normalizeStyle(`width:100%;font-size:${V(o)}px;`)},e.toDisplayString(o.name),5),Ue,e.createElementVNode("span",{style:e.normalizeStyle(`width:100%;font-size:${V(o)}px;`)},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.formatter,o.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.labels.prefix,v:o.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.layout.labels.rounding}),{datapoint:o})),5)],4)):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"rect",e.normalizeProps(e.guardReactiveProps({rect:o,shouldShow:o.proportion>t.value.style.chart.layout.labels.hideUnderProportion||$.value,fontSize:V(o),isZoom:$.value,textColor:e.unref(r.adaptColorToBackground)(o.color)})),void 0,!0)])],8,Me))]))),256)),e.renderSlot(l.$slots,"svg",e.normalizeProps(e.guardReactiveProps({svg:P.value,isZoom:$.value,rect:S.value,config:t.value})),void 0,!0)],14,Fe)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ge,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(T)||e.unref(G)})),void 0,!0)])):e.createCommentVNode("",!0),v.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(xe.default,{key:4,config:{type:"treemap",style:{backgroundColor:t.value.style.chart.backgroundColor,treemap:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:x},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(we.Legend,{key:0,legendSet:te.value,config:ge.value,id:`treemap_legend_${f.value}`,onClickMarker:a[1]||(a[1]=({legend:o})=>le(o))},{item:e.withCtx(({legend:o,index:c})=>[e.createElementVNode("div",{onClick:y=>le(o),style:e.normalizeStyle(`opacity:${g.value.includes(o.id)?.5:1}`)},[e.createTextVNode(e.toDisplayString(o.name)+": "+e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.formatter,o.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.labels.prefix,v:o.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:o}))+" ",1),g.value.includes(o.id)?(e.openBlock(),e.createElementBlock("span",Ye," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",Xe," ("+e.toDisplayString(isNaN(o.value/E.value)?"-":(o.value/E.value*100).toFixed(t.value.style.chart.legend.roundingPercentage))+"%) ",1))],12,je)]),_:1},8,["legendSet","config","id"])):e.renderSlot(l.$slots,"legend",{key:1,legend:te.value},void 0,!0)],512),e.createVNode(Ce._sfc_main,{show:B.value.showTooltip&&p.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,fontSize:t.value.style.chart.tooltip.fontSize,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:m.value,content:C.value,isCustom:e.unref(r.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...W.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...W.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isCustom"]),v.value?(e.openBlock(),e.createBlock($e.default,{key:5,hideDetails:"",config:{open:B.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(Te.DataTable,{colNames:q.value.colNames,head:q.value.head,body:q.value.body,config:q.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:a[2]||(a[2]=o=>B.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,Ze)]),td:e.withCtx(({td:o})=>[e.createTextVNode(e.toDisplayString(o.name||o),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,Re))}},Ke=Se._export_sfc(Je,[["__scopeId","data-v-61b57d4b"]]);exports.default=Ke;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-7N8NxNg5.cjs"),ke=require("./Title-CRj-Ysyr.cjs"),re=require("./usePrinter-qYDc_jVR.cjs"),Ce=require("./Tooltip-DBdcH3mQ.cjs"),we=require("./Legend-DomGAell.cjs"),xe=require("./vue-ui-skeleton-D5jxUSy8.cjs"),Te=require("./DataTable-UBogHlHz.cjs"),$e=require("./vue-ui-accordion-x_3F7J52.cjs"),ue=require("./useResponsive-B3TrDDIG.cjs"),se=require("./useNestedProp-DmS8KxmW.cjs"),Se=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");function ie(n,d){const s=n.length;if(s===0)throw new Error(`Max aspect ratio cannot be computed: ${n} is an empty array`);{let u=1/0,i=-1/0,v=0;for(let f=0;f<s;f+=1){const p=n[f].normalizedValue;p<u&&(u=p),p>i&&(i=p),v+=p}return Math.max(d**2*i/v**2,v**2/(d**2*u))}}function ce(n){const{xOffset:d,yOffset:s,width:u,height:i}=n;return{x0:d,y0:s,x1:d+u,y1:s+i}}function Ne(n,d,s){if(n.length===0)return!0;{const u=n.concat(d),i=ie(n,s),v=ie(u,s);return i>=v}}function Be(n){const d=[],s=n.length;for(let u=0;u<s;u+=1){const i=n[u],v=i.length;for(let h=0;h<v;h+=1)d.push(i[h])}return d}function _e(n,d){const s={...d,children:n};return ve(s)}function ze(n){return(n.x1-n.x0)*(n.y1-n.y0)}function de(n,d){const{width:s,height:u,xOffset:i,yOffset:v}=U(d),h=n.length,f=n.map(m=>m.normalizedValue||0).reduce((m,k)=>m+k,0),p=f/u,C=f/s;let b=i,w=v;const g=[];if(s>=u){for(let m=0;m<h;m+=1){const k=n[m],x=w+k.normalizedValue/p,t={x0:b,y0:w,x1:b+p,y1:x},T=Object.assign({},k,t);w=x,g.push(T)}return g}else{for(let m=0;m<h;m+=1){const k=n[m],x=b+k.normalizedValue/C,t={x0:b,y0:w,x1:x,y1:w+C},T=Object.assign({},k,t);b=x,g.push(T)}return g}}function Pe(n){const d=U(n),s=d.width,u=d.height;return Math.min(s,u)}function Oe(n,d){const s=n.length,u=n.map(p=>p.value??0).reduce((p,C)=>p+C,0),i=d/u,v=[];let h,f;for(let p=0;p<s;p+=1)f=n[p],h=Object.assign({},f,{normalizedValue:f.value*(i||0)}),v.push(h);return v}function U(n){const{x0:d,y0:s,x1:u,y1:i}=n;return{xOffset:d,yOffset:s,width:u-d,height:i-s}}function Ve(n,d,s,u){let i=n,v=d,h=s,f=u;for(;;){const p=i.length;if(p===0){const g=de(v,h);return f.concat(g)}const C=Pe(h),b=i[0],w=i.slice(1,p);if(Ne(v,b,C)){const g=v.concat(b);i=w,v=g,h=h,f=f}else{const g=v.length;let m=0;for(let T=0;T<g;T+=1)m+=v[T].normalizedValue;const k=Ee(h,m),x=de(v,h),t=f.concat(x);i=i,v=[],h=k,f=t}}}function ve(n){if(typeof n.children>"u"||!n.children.length)return[n];{const d=Oe(n.children,ze(n)),s=Ve(d,[],n,[]),u=s.length,i=[];for(let h=0;h<u;h+=1)i.push(ve(s[h]));return Be(i)}}function Ee(n,d){const{width:s,height:u,xOffset:i,yOffset:v}=U(n);if(s>=u){const h=d/u,f=s-h,p={xOffset:i+h,yOffset:v,width:f,height:u};return ce(p)}else{const h=d/s,f=u-h,p={xOffset:i,yOffset:v+h,width:s,height:f};return ce(p)}}const Le=n=>(e.pushScopeId("data-v-61b57d4b"),n=n(),e.popScopeId(),n),Re=["id"],Fe=["xmlns","viewBox"],Ie={key:0},De=["id"],qe=["stop-color"],Ae=["stop-color"],He=["x","y","height","width","fill","rx","stroke","stroke-width","onClick","onMouseenter"],Me=["x","y","height","width"],We={style:{width:"100%",height:"100%"},class:"vue-ui-treemap-cell"},Ue=Le(()=>e.createElementVNode("br",null,null,-1)),Ge={key:3,class:"vue-data-ui-watermark"},je=["onClick"],Xe={key:0},Ye={key:1},Ze=["innerHTML"],Je={__name:"vue-ui-treemap",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(n,{expose:d,emit:s}){const u=n,{vue_ui_treemap:i}=r.useConfig(),v=e.computed(()=>!!u.dataset&&u.dataset.length),h=e.computed(()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),f=e.ref(r.createUid()),p=e.ref(!1),C=e.ref(""),b=e.ref(!1),w=e.ref(0),g=e.ref([]),m=e.ref(null),k=e.ref(null),x=e.ref(null),t=e.computed(()=>{const l=se.useNestedProp({userConfig:u.config,defaultConfig:i});return l.theme?{...se.useNestedProp({userConfig:r.themes.vue_ui_treemap[l.theme]||u.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}),{isPrinting:T,isImaging:G,generatePdf:j,generateImage:X}=re.usePrinter({elementId:`treemap_${f.value}`,fileName:t.value.style.chart.title.text||"vue-ui-treemap"}),I=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),B=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),_=e.ref({height:t.value.style.chart.height,width:t.value.style.chart.width}),P=e.computed(()=>({bottom:_.value.height-t.value.style.chart.padding.bottom,height:_.value.height-t.value.style.chart.padding.top-t.value.style.chart.padding.bottom,left:t.value.style.chart.padding.left,right:_.value.width-t.value.style.chart.padding.right,top:t.value.style.chart.padding.top,vbHeight:_.value.height,vbWidth:_.value.width,width:_.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right}));function Y(l){l.forEach((a,o)=>{a.id=r.createUid(),a.color=r.convertColorToHex(a.color)||I.value[o]||r.palette[o]||r.palette[o%r.palette.length],a.children&&(a.children.forEach(c=>{c.parentId=a.id,c.color=a.color}),Y(a.children))})}const O=e.ref(u.dataset),D=e.ref(null);e.onMounted(()=>{if(r.objectIsEmpty(u.dataset)&&r.error({componentName:"VueUiTreemap",type:"dataset"}),Y(O.value),t.value.responsive){const l=ue.throttle(()=>{const{width:a,height:o}=ue.useResponsive({chart:m.value,title:t.value.style.chart.title.text?k.value:null,legend:t.value.style.chart.legend.show?x.value:null});_.value.width=a,_.value.height=o});D.value=new ResizeObserver(l),D.value.observe(m.value.parentNode)}}),e.onBeforeUnmount(()=>{D.value&&D.value.disconnect()});const H=e.ref(O.value),R=e.computed(()=>H.value.map((l,a)=>({...l,color:r.convertColorToHex(l.color)||I.value[a]||r.palette[a]||r.palette[a%r.palette.length]})).filter(l=>!g.value.includes(l.id))),E=e.computed(()=>O.value.filter(l=>!g.value.includes(l.id)).map(l=>l.value||0).reduce((l,a)=>l+a,0)),Z=e.computed({get(){let l=[...R.value];return t.value.style.chart.layout.sorted&&(l=[...R.value].sort((a,o)=>o.value-a.value)),l.map(a=>({...a}))},set(l){return l}});function J(l,a){return l.value/a}function he(l,a,o){const c=t.value.style.chart.layout.rects.colorRatio-J(a,o);return r.lightenHexColor(l,c<0?0:c)}function K(l,a,o,c){return l.map((y,z)=>{const A=he(r.convertColorToHex(a)||I.value[z]||r.palette[z]||r.palette[z%r.palette.length],y,c),be=J(y,c);return{...y,color:A,proportion:be,parentName:o,children:y.children?K(y.children,A,y.name,c):void 0}})}const F=e.computed(()=>_e(Z.value.map((l,a)=>{const o=l.children?l.children.reduce((c,y)=>c+y.value,0):l.value;return{value:l.value,id:l.id,children:l.children?K(l.children.sort((c,y)=>y.value-c.value),l.color,l.name,o):void 0,color:l.color,name:l.name}}),{x0:P.value.left*2,y0:P.value.top,x1:P.value.width,y1:P.value.height}));function Q({y0:l,y1:a}){return a-l<=0?1e-4:a-l}function ee({x0:l,x1:a}){return a-l<=0?1e-4:a-l}function V(l){const a=t.value.style.chart.layout.labels.fontSize*(l.proportion*2>1?1:l.proportion*2);return a<t.value.style.chart.layout.labels.minFontSize?t.value.style.chart.layout.labels.minFontSize:a}function pe(l){b.value=l,w.value+=1}const L=e.computed(()=>({startX:0,startY:0,width:P.value.vbWidth,height:P.value.vbHeight})),$=e.ref(!1);function M(l,a=O.value){for(const o of a){if(o.id===l)return o;if(o.children){const c=M(l,o.children);if(c)return c}}return null}function fe(l){if($.value)s("selectDatapoint",void 0),H.value=O.value;else{if(s("selectDatapoint",l),!M(l.parentId))return;H.value=[M(l.parentId)]}$.value=!$.value}const S=e.ref(null),te=e.computed(()=>O.value.map((l,a)=>({...l,color:r.convertColorToHex(l.color)||I.value[a]||r.palette[a]||r.palette[a%r.palette.length],shape:"square"})).sort((l,a)=>a.value-l.value).map((l,a)=>({...l,proportion:l.value/O.value.map(o=>o.value).reduce((o,c)=>o+c,0),opacity:g.value.includes(l.id)?.5:1}))),ge=e.computed(()=>({cy:"treemap-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""}));function le(l){$.value=!1,S.value=null,g.value.includes(l.id)?g.value=g.value.filter(a=>a!==l.id):g.value.length<u.dataset.length-1&&g.value.push(l.id),s("selectLegend",Z.value)}const W=e.ref(null);function me({datapoint:l,seriesIndex:a}){S.value=l,W.value={datapoint:l,seriesIndex:a,config:t.value,series:R.value};const o=t.value.style.chart.tooltip.customFormat;if(r.isFunction(o)&&r.functionReturnsString(()=>o({seriesIndex:a,datapoint:l,series:R.value,config:t.value})))C.value=o({seriesIndex:a,datapoint:l,series:R.value,config:t.value});else{let c="";c+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${l.name}</div>`,c+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><rect x="0" y="0" height="12" width="12" stroke="none" fill="${l.color}"/></svg>`,c+=`<b>${r.applyDataLabel(t.value.style.chart.layout.labels.formatter,l.value,r.dataLabel({p:t.value.style.chart.layout.labels.prefix,v:l.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:l,seriesIndex:a})}</b>`,C.value=`<div>${c}</div>`}p.value=!0}const N=e.computed(()=>{const l=F.value.map(o=>({name:o.name,color:o.color})),a=F.value.map(o=>o.value);return{head:l,body:a}});function oe(){e.nextTick(()=>{const l=N.value.head.map((c,y)=>[[c.name],[N.value.body[y]],[isNaN(N.value.body[y]/E.value)?"-":N.value.body[y]/E.value*100]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(l),o=r.createCsvContent(a);r.downloadCsv({csvContent:o,title:t.value.style.chart.title.text||"vue-ui-treemap"})})}const q=e.computed(()=>{const l=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage],a=N.value.head.map((y,z)=>{const A=r.applyDataLabel(t.value.style.chart.layout.labels.formatter,N.value.body[z],r.dataLabel({p:t.value.style.chart.layout.labels.prefix,v:N.value.body[z],s:t.value.style.chart.layout.labels.suffix,r:t.value.table.td.roundingValue}));return[{color:y.color,name:y.name,shape:"square"},A,isNaN(N.value.body[z]/E.value)?"-":r.dataLabel({v:N.value.body[z]/E.value*100,s:"%",r:t.value.table.td.roundingPercentage})]}),o={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value],head:l,body:a,config:o}});function ye(){return F.value}function ae(){B.value.showTable=!B.value.showTable}function ne(){B.value.showTooltip=!B.value.showTooltip}return d({getData:ye,generateCsv:oe,generateImage:X,generatePdf:j,toggleTable:ae,toggleTooltip:ne}),(l,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"treemapChart",ref:m,class:e.normalizeClass(`vue-ui-treemap ${b.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; ${t.value.responsive?"height: 100%;":""} text-align:center;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor}`),id:`treemap_${f.value}`},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:k,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:6px`)},[e.createVNode(ke._sfc_main,{config:{title:{cy:"treemap-div-title",...t.value.style.chart.title},subtitle:{cy:"treemap-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&v.value?(e.openBlock(),e.createBlock(re.UserOptions,{ref:"details",key:`user_option_${w.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(T),isImaging:e.unref(G),uid:f.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:b.value,isTooltip:B.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:m.value,onToggleFullscreen:pe,onGeneratePdf:e.unref(j),onGenerateCsv:oe,onGenerateImage:e.unref(X),onToggleTable:ae,onToggleTooltip:ne},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:c})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:c})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),v.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":b.value,"vue-data-ui-fulscreen--off":!b.value,"vue-data-ui-zoom-plus":!$.value,"vue-data-ui-zoom-minus":$.value}),viewBox:`${L.value.startX} ${L.value.startY} ${L.value.width<=0?10:L.value.width} ${L.value.height<=0?10:L.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: hidden; background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(o,c)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.chart.layout.rects.gradient.show?(e.openBlock(),e.createElementBlock("defs",Ie,[e.createElementVNode("radialGradient",{id:`tgrad_${o.id}`,gradientTransform:"translate(-1, -1.000001) scale(2, 2)"},[e.createElementVNode("stop",{offset:"18%","stop-color":o.color},null,8,qe),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.lightenHexColor)(o.color,t.value.style.chart.layout.rects.gradient.intensity/100)},null,8,Ae)],8,De)])):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(o,c)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:o.x0,y:o.y0,height:Q(o),width:ee(o),fill:h.value?o.color:t.value.style.chart.layout.rects.gradient.show?`url(#tgrad_${o.id})`:o.color,rx:t.value.style.chart.layout.rects.borderRadius,stroke:S.value&&S.value.id===o.id?t.value.style.chart.layout.rects.selected.stroke:t.value.style.chart.layout.rects.stroke,"stroke-width":S.value&&S.value.id===o.id?t.value.style.chart.layout.rects.selected.strokeWidth:t.value.style.chart.layout.rects.strokeWidth,onClick:y=>fe(o),onMouseenter:()=>me({datapoint:o,seriesIndex:c}),onMouseleave:a[0]||(a[0]=y=>{S.value=null,p.value=!1}),style:e.normalizeStyle(`opacity:${S.value?S.value.id===o.id?1:t.value.style.chart.layout.rects.selected.unselectedOpacity:1}`),class:"vue-ui-treemap-rect"},null,44,He),(e.openBlock(),e.createElementBlock("foreignObject",{x:o.x0,y:o.y0,height:Q(o),width:ee(o),class:"vue-ui-treemap-cell-foreignObject"},[e.createElementVNode("div",We,[t.value.style.chart.layout.labels.showDefaultLabels&&(o.proportion>t.value.style.chart.layout.labels.hideUnderProportion||$.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vue-ui-treemap-cell-default",style:e.normalizeStyle(`width:calc(100% - ${V(o)/1.5}px);text-align:left;line-height:${V(o)<14?14:V(o)}px;padding:${V(o)/3}px; color:${e.unref(r.adaptColorToBackground)(o.color)}`)},[e.createElementVNode("span",{style:e.normalizeStyle(`width:100%;font-size:${V(o)}px;`)},e.toDisplayString(o.name),5),Ue,e.createElementVNode("span",{style:e.normalizeStyle(`width:100%;font-size:${V(o)}px;`)},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.formatter,o.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.labels.prefix,v:o.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.layout.labels.rounding}),{datapoint:o})),5)],4)):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"rect",e.normalizeProps(e.guardReactiveProps({rect:o,shouldShow:o.proportion>t.value.style.chart.layout.labels.hideUnderProportion||$.value,fontSize:V(o),isZoom:$.value,textColor:e.unref(r.adaptColorToBackground)(o.color)})),void 0,!0)])],8,Me))]))),256)),e.renderSlot(l.$slots,"svg",e.normalizeProps(e.guardReactiveProps({svg:P.value,isZoom:$.value,rect:S.value,config:t.value})),void 0,!0)],14,Fe)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ge,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(T)||e.unref(G)})),void 0,!0)])):e.createCommentVNode("",!0),v.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(xe.default,{key:4,config:{type:"treemap",style:{backgroundColor:t.value.style.chart.backgroundColor,treemap:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:x},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(we.Legend,{key:0,legendSet:te.value,config:ge.value,id:`treemap_legend_${f.value}`,onClickMarker:a[1]||(a[1]=({legend:o})=>le(o))},{item:e.withCtx(({legend:o,index:c})=>[e.createElementVNode("div",{onClick:y=>le(o),style:e.normalizeStyle(`opacity:${g.value.includes(o.id)?.5:1}`)},[e.createTextVNode(e.toDisplayString(o.name)+": "+e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.formatter,o.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.labels.prefix,v:o.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:o}))+" ",1),g.value.includes(o.id)?(e.openBlock(),e.createElementBlock("span",Ye," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",Xe," ("+e.toDisplayString(isNaN(o.value/E.value)?"-":(o.value/E.value*100).toFixed(t.value.style.chart.legend.roundingPercentage))+"%) ",1))],12,je)]),_:1},8,["legendSet","config","id"])):e.renderSlot(l.$slots,"legend",{key:1,legend:te.value},void 0,!0)],512),e.createVNode(Ce._sfc_main,{show:B.value.showTooltip&&p.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,fontSize:t.value.style.chart.tooltip.fontSize,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:m.value,content:C.value,isCustom:e.unref(r.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...W.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...W.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isCustom"]),v.value?(e.openBlock(),e.createBlock($e.default,{key:5,hideDetails:"",config:{open:B.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(Te.DataTable,{colNames:q.value.colNames,head:q.value.head,body:q.value.body,config:q.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:a[2]||(a[2]=o=>B.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,Ze)]),td:e.withCtx(({td:o})=>[e.createTextVNode(e.toDisplayString(o.name||o),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,Re))}},Ke=Se._export_sfc(Je,[["__scopeId","data-v-61b57d4b"]]);exports.default=Ke;
@@ -1,14 +1,14 @@
1
1
  import { useCssVars as Ge, computed as b, ref as p, onMounted as Ue, onBeforeUnmount as He, openBlock as i, createElementBlock as v, normalizeClass as O, normalizeStyle as d, createVNode as A, createCommentVNode as m, createBlock as oe, unref as y, createSlots as We, withCtx as _, renderSlot as x, normalizeProps as j, guardReactiveProps as Y, createElementVNode as u, toDisplayString as c, Fragment as E, renderList as G, withKeys as je, createTextVNode as Ye } from "vue";
2
- import { u as qe, c as Ke, t as Je, a as Qe, p as z, b as Ze, o as Ce, e as q, s as T, d as ue, i as K, f as F, X as et, v as tt, w as ne, x as at, y as lt, q as ot, r as ut } from "./index-C_05i_JG.js";
2
+ import { u as qe, c as Ke, t as Je, a as Qe, p as z, b as Ze, o as Ce, e as q, s as T, d as ue, i as K, f as F, X as et, v as tt, w as ne, x as at, y as lt, q as ot, r as ut } from "./index-CguVaFlt.js";
3
3
  import { t as nt, u as st } from "./useResponsive-NZB-WLRF.js";
4
- import { _ as rt } from "./Title-CPZstF2C.js";
5
- import { u as it, U as dt } from "./usePrinter-DOhlzlnx.js";
6
- import { _ as ct } from "./Tooltip-CBmmiqKr.js";
7
- import { L as Te } from "./Legend-UWyvC57K.js";
8
- import vt from "./vue-ui-skeleton-CcJR2m18.js";
9
- import ht from "./BaseIcon-CS18qRiy.js";
10
- import pt from "./vue-ui-accordion-rGJVvi_V.js";
11
- import { u as Le } from "./useNestedProp-DLnT0Wtg.js";
4
+ import { _ as rt } from "./Title-DbTGPg4G.js";
5
+ import { u as it, U as dt } from "./usePrinter-ClsMRVJG.js";
6
+ import { _ as ct } from "./Tooltip-u79R5W5y.js";
7
+ import { L as Te } from "./Legend-CsVEDSh6.js";
8
+ import vt from "./vue-ui-skeleton-ChHLL5Hw.js";
9
+ import ht from "./BaseIcon-BNFf4B_v.js";
10
+ import pt from "./vue-ui-accordion-w15FGKRN.js";
11
+ import { u as Le } from "./useNestedProp-BbEbJmgv.js";
12
12
  import { _ as yt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
13
13
  const gt = ["id"], ft = ["onClick"], bt = ["xmlns", "viewBox"], mt = ["id"], _t = ["stop-color"], xt = ["stop-color"], kt = ["x", "y", "width", "height", "fill", "rx"], $t = ["x", "y", "width", "height", "fill", "rx", "stroke", "stroke-width"], wt = ["x2", "y1", "y2", "stroke", "stroke-width"], Ct = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Tt = ["x", "y", "text-anchor", "font-size", "fill", "font-weight"], Lt = ["x", "y", "font-size", "fill", "font-weight"], Nt = ["x", "y", "font-size", "fill", "font-weight"], Pt = ["x", "y", "font-size", "fill", "font-weight"], St = ["y", "width", "height", "fill", "onMouseenter"], Vt = {
14
14
  key: 4,
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-NNZeHOBS.cjs"),le=require("./useResponsive-B3TrDDIG.cjs"),Ce=require("./Title-PZ6S96pU.cjs"),ae=require("./usePrinter-BLbY8qGZ.cjs"),xe=require("./Tooltip-BoIYPSX3.cjs"),oe=require("./Legend-DuuSl2rJ.cjs"),_e=require("./vue-ui-skeleton-CI4t8LHn.cjs"),Ne=require("./BaseIcon-O8jJvy48.cjs"),we=require("./vue-ui-accordion-CcdyvXrp.cjs"),ne=require("./useNestedProp-CPsbJAGj.cjs"),$e=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Se=["id"],Ve=["onClick"],Te=["xmlns","viewBox"],Ee=["id"],Be=["stop-color"],Le=["stop-color"],ze=["x","y","width","height","fill","rx"],Pe=["x","y","width","height","fill","rx","stroke","stroke-width"],De=["x2","y1","y2","stroke","stroke-width"],Fe=["x1","x2","y1","y2","stroke","stroke-width"],Me=["x","y","text-anchor","font-size","fill","font-weight"],Ie=["x","y","font-size","fill","font-weight"],Oe=["x","y","font-size","fill","font-weight"],Re=["x","y","font-size","fill","font-weight"],qe=["y","width","height","fill","onMouseenter"],He={key:4,class:"vue-data-ui-watermark"},Xe=["onClick"],Ae={style:"width:100%;padding-top: 36px;position:relative"},Ue={class:"vue-ui-data-table"},je={key:0},Ge={style:{width:"100%"}},We=["data-cell"],Ye={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Ke=["data-cell"],Je={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Qe=["data-cell"],Ze={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},et=["data-cell"],tt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},lt=["data-cell"],at={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},ot=["data-cell"],nt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},rt=["data-cell"],ut={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},it={__name:"vue-ui-vertical-bar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(re,{expose:ue,emit:ie}){const f=re;e.useCssVars(a=>({"7bc84c58":a.tdo}));const{vue_ui_vertical_bar:se}=n.useConfig(),V=e.computed(()=>!!f.dataset&&f.dataset.length),m=e.ref(n.createUid()),ce=e.ref(null),B=e.ref(!1),L=e.ref(""),T=e.ref(0),de=e.ref(null),I=e.ref(0),w=e.ref(null),O=e.ref(null),z=e.ref(null),t=e.computed(()=>{const a=ne.useNestedProp({userConfig:f.config,defaultConfig:se});return a.theme?{...ne.useNestedProp({userConfig:n.themes.vue_ui_vertical_bar[a.theme]||f.config,defaultConfig:a}),customPalette:n.themePalettes[a.theme]||n.palette}:a}),{isPrinting:R,isImaging:q,generatePdf:H,generateImage:X}=ae.usePrinter({elementId:`vue-ui-vertical-bar_${m.value}`,fileName:t.value.style.chart.title.text||"vue-ui-vertical-bar"}),A=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),U=e.ref(null),j=e.ref(!1),ve=e.computed(()=>t.value.table.responsiveBreakpoint),E=e.ref(null);e.onMounted(()=>{if(n.objectIsEmpty(f.dataset)&&n.error({componentName:"VueUiVerticalBar",type:"dataset"}),T.value=f.dataset.flatMap(a=>a.children&&a.children.length>0?a.children.length:1).reduce((a,o)=>a+o,0),he(),t.value.responsive){const a=le.throttle(()=>{const{width:o,height:l}=le.useResponsive({chart:w.value,title:t.value.style.chart.title.text?O.value:null,legend:t.value.style.chart.legend.show?z.value:null});Y.value=o,c.value=l/T.value-v.value*2});E.value=new ResizeObserver(a),E.value.observe(w.value.parentNode)}}),e.onBeforeUnmount(()=>{E.value&&E.value.disconnect()});function he(){new ResizeObserver(o=>{o.forEach(l=>{j.value=l.contentRect.width<ve.value})}).observe(U.value)}const h=e.ref({showTable:t.value.table.show,sortDesc:t.value.style.chart.layout.bars.sort==="desc",showTooltip:t.value.style.chart.tooltip.show}),G=e.computed(()=>h.value.sortDesc),k=e.computed(()=>(f.dataset.forEach((a,o)=>{!a.value&&!a.children&&n.error({componentName:"VueUiVerticalBar",type:"datasetAttributeEmpty",property:`value (index ${o})`}),a.children&&(n.objectIsEmpty(a.children)?n.error({componentName:"VueUiVerticalBar",type:"datasetAttributeEmpty",property:`children (index ${o})`}):a.children.forEach((l,r)=>{[null,void 0].includes(l.name)&&n.error({componentName:"VueUiVerticalBar",type:"datasetSerieAttribute",property:"name",key:"children",index:r})}))}),f.dataset.map((a,o)=>{const l=`vertical_parent_${o}_${m.value}`,r=!!a.children&&a.children.length>0;return{...a,id:l,shape:"square",opacity:y.value.includes(l)?.5:1,value:n.checkNaN(r?a.children.map(i=>i.value||0).reduce((i,s)=>i+s,0):Math.abs(a.value)||0),sign:a.value>=0?1:-1,hasChildren:r,isChild:!1,segregate:()=>$(l),isSegregated:y.value.includes(l),color:n.convertColorToHex(a.color)||A.value[o]||n.palette[o]||n.palette[o%n.palette.length],children:!a.children||!a.children.length?[]:a.children.toSorted((i,s)=>G.value?s.value-i.value:i.value-s.value).map((i,s)=>({...i,value:n.checkNaN(Math.abs(i.value)),sign:i.value>=0?1:-1,isChild:!0,parentId:l,parentName:a.name,parentValue:n.checkNaN(a.value||r?a.children.map(M=>M.value||0).reduce((M,ke)=>M+ke,0):0),id:`vertical_child_${o}_${s}_${m.value}`,childIndex:s,color:n.convertColorToHex(i.color)||n.convertColorToHex(a.color)||A.value[o]||n.palette[o]||n.palette[o%n.palette.length]})).map((i,s)=>({...i,isFirstChild:s===0,isLastChild:s===a.children.length-1}))}}).toSorted((a,o)=>G.value?o.value-a.value:a.value-o.value))),W=e.computed(()=>({cy:"vertical-bar-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),c=e.ref(t.value.style.chart.layout.bars.height),v=e.ref(t.value.style.chart.layout.bars.gap),pe=e.computed(()=>(c.value+v.value)*T.value),Y=e.ref(512),d=e.computed(()=>({width:Y.value,height:pe.value,padding:{top:12,left:128+t.value.style.chart.layout.bars.offsetX,right:64+t.value.style.chart.layout.bars.paddingRight,bottom:12}})),u=e.computed(()=>({fullHeight:d.value.padding.top+d.value.padding.bottom+d.value.height,top:d.value.padding.top,left:d.value.padding.left,right:d.value.width-d.value.padding.right,bottom:d.value.padding.top+d.value.height,width:d.value.width-(d.value.padding.left+d.value.padding.right)}));function P(){T.value=C.value.flatMap(a=>a.children&&a.children.length>0?a.children.length:1).reduce((a,o)=>a+o,0)}const y=e.ref([]);function $(a){y.value.includes(a)?y.value=y.value.filter(o=>o!==a):y.value.push(a),P(),ie("selectLegend",C.value)}const C=e.computed(()=>k.value.filter(a=>!y.value.includes(a.id))),g=e.computed(()=>C.value.map(a=>Math.abs(a.value)).reduce((a,o)=>a+o,0));function K(a,o=!1,l=0){return o?n.dataLabel({v:n.checkNaN(Math.abs(a)/g.value*100),s:"%",r:l}):Math.abs(a)/g.value}const x=e.computed(()=>C.value.flatMap(a=>a.hasChildren?a.children:a)),_=e.computed(()=>x.value.map(a=>a.sign).includes(-1)),ye=e.computed(()=>Math.max(...C.value.flatMap(a=>a.children&&a.children.length?Math.max(...a.children.map(o=>o.value)):a.value)));function b(a){const o=a/ye.value;return u.value.width/(_.value?2:1)*o}function ge(a){return b(a)+u.value.left}function N(a,o){const l=C.value.find(s=>s.id===a.parentId),r=u.value.top+(v.value+c.value)*o,i=l.children.length*(v.value+c.value);return{y:r+i/2-t.value.style.chart.layout.bars.parentLabels.fontSize,name:l.name,value:[void 0,NaN,null].includes(l.value)?"":l.sign===1?l.value:-l.value,percentageToTotal:isNaN(l.value/g.value)?"":K(l.value,!0,t.value.style.chart.layout.bars.dataLabels.percentage.roundingPercentage),sign:l.sign}}function fe(){return C.value}const D=e.ref(null),F=e.ref(null);function be(a,o){F.value={datapoint:a,seriesIndex:o,series:k.value,config:t.value},B.value=!0,D.value=a.id;let l="";const r=a.isChild?a.parentName:a.name,i=a.isChild?a.name:"",s=t.value.style.chart.tooltip.customFormat;n.isFunction(s)&&n.functionReturnsString(()=>s({datapoint:a,series:k.value,config:t.value,seriesIndex:o}))?L.value=s({datapoint:a,series:k.value,config:t.value,seriesIndex:o}):(l+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;text-align:left;">
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-7N8NxNg5.cjs"),le=require("./useResponsive-B3TrDDIG.cjs"),Ce=require("./Title-CRj-Ysyr.cjs"),ae=require("./usePrinter-qYDc_jVR.cjs"),xe=require("./Tooltip-DBdcH3mQ.cjs"),oe=require("./Legend-DomGAell.cjs"),_e=require("./vue-ui-skeleton-D5jxUSy8.cjs"),Ne=require("./BaseIcon-3dGIQkTt.cjs"),we=require("./vue-ui-accordion-x_3F7J52.cjs"),ne=require("./useNestedProp-DmS8KxmW.cjs"),$e=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Se=["id"],Ve=["onClick"],Te=["xmlns","viewBox"],Ee=["id"],Be=["stop-color"],Le=["stop-color"],ze=["x","y","width","height","fill","rx"],Pe=["x","y","width","height","fill","rx","stroke","stroke-width"],De=["x2","y1","y2","stroke","stroke-width"],Fe=["x1","x2","y1","y2","stroke","stroke-width"],Me=["x","y","text-anchor","font-size","fill","font-weight"],Ie=["x","y","font-size","fill","font-weight"],Oe=["x","y","font-size","fill","font-weight"],Re=["x","y","font-size","fill","font-weight"],qe=["y","width","height","fill","onMouseenter"],He={key:4,class:"vue-data-ui-watermark"},Xe=["onClick"],Ae={style:"width:100%;padding-top: 36px;position:relative"},Ue={class:"vue-ui-data-table"},je={key:0},Ge={style:{width:"100%"}},We=["data-cell"],Ye={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Ke=["data-cell"],Je={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Qe=["data-cell"],Ze={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},et=["data-cell"],tt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},lt=["data-cell"],at={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},ot=["data-cell"],nt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},rt=["data-cell"],ut={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},it={__name:"vue-ui-vertical-bar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(re,{expose:ue,emit:ie}){const f=re;e.useCssVars(a=>({"7bc84c58":a.tdo}));const{vue_ui_vertical_bar:se}=n.useConfig(),V=e.computed(()=>!!f.dataset&&f.dataset.length),m=e.ref(n.createUid()),ce=e.ref(null),B=e.ref(!1),L=e.ref(""),T=e.ref(0),de=e.ref(null),I=e.ref(0),w=e.ref(null),O=e.ref(null),z=e.ref(null),t=e.computed(()=>{const a=ne.useNestedProp({userConfig:f.config,defaultConfig:se});return a.theme?{...ne.useNestedProp({userConfig:n.themes.vue_ui_vertical_bar[a.theme]||f.config,defaultConfig:a}),customPalette:n.themePalettes[a.theme]||n.palette}:a}),{isPrinting:R,isImaging:q,generatePdf:H,generateImage:X}=ae.usePrinter({elementId:`vue-ui-vertical-bar_${m.value}`,fileName:t.value.style.chart.title.text||"vue-ui-vertical-bar"}),A=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),U=e.ref(null),j=e.ref(!1),ve=e.computed(()=>t.value.table.responsiveBreakpoint),E=e.ref(null);e.onMounted(()=>{if(n.objectIsEmpty(f.dataset)&&n.error({componentName:"VueUiVerticalBar",type:"dataset"}),T.value=f.dataset.flatMap(a=>a.children&&a.children.length>0?a.children.length:1).reduce((a,o)=>a+o,0),he(),t.value.responsive){const a=le.throttle(()=>{const{width:o,height:l}=le.useResponsive({chart:w.value,title:t.value.style.chart.title.text?O.value:null,legend:t.value.style.chart.legend.show?z.value:null});Y.value=o,c.value=l/T.value-v.value*2});E.value=new ResizeObserver(a),E.value.observe(w.value.parentNode)}}),e.onBeforeUnmount(()=>{E.value&&E.value.disconnect()});function he(){new ResizeObserver(o=>{o.forEach(l=>{j.value=l.contentRect.width<ve.value})}).observe(U.value)}const h=e.ref({showTable:t.value.table.show,sortDesc:t.value.style.chart.layout.bars.sort==="desc",showTooltip:t.value.style.chart.tooltip.show}),G=e.computed(()=>h.value.sortDesc),k=e.computed(()=>(f.dataset.forEach((a,o)=>{!a.value&&!a.children&&n.error({componentName:"VueUiVerticalBar",type:"datasetAttributeEmpty",property:`value (index ${o})`}),a.children&&(n.objectIsEmpty(a.children)?n.error({componentName:"VueUiVerticalBar",type:"datasetAttributeEmpty",property:`children (index ${o})`}):a.children.forEach((l,r)=>{[null,void 0].includes(l.name)&&n.error({componentName:"VueUiVerticalBar",type:"datasetSerieAttribute",property:"name",key:"children",index:r})}))}),f.dataset.map((a,o)=>{const l=`vertical_parent_${o}_${m.value}`,r=!!a.children&&a.children.length>0;return{...a,id:l,shape:"square",opacity:y.value.includes(l)?.5:1,value:n.checkNaN(r?a.children.map(i=>i.value||0).reduce((i,s)=>i+s,0):Math.abs(a.value)||0),sign:a.value>=0?1:-1,hasChildren:r,isChild:!1,segregate:()=>$(l),isSegregated:y.value.includes(l),color:n.convertColorToHex(a.color)||A.value[o]||n.palette[o]||n.palette[o%n.palette.length],children:!a.children||!a.children.length?[]:a.children.toSorted((i,s)=>G.value?s.value-i.value:i.value-s.value).map((i,s)=>({...i,value:n.checkNaN(Math.abs(i.value)),sign:i.value>=0?1:-1,isChild:!0,parentId:l,parentName:a.name,parentValue:n.checkNaN(a.value||r?a.children.map(M=>M.value||0).reduce((M,ke)=>M+ke,0):0),id:`vertical_child_${o}_${s}_${m.value}`,childIndex:s,color:n.convertColorToHex(i.color)||n.convertColorToHex(a.color)||A.value[o]||n.palette[o]||n.palette[o%n.palette.length]})).map((i,s)=>({...i,isFirstChild:s===0,isLastChild:s===a.children.length-1}))}}).toSorted((a,o)=>G.value?o.value-a.value:a.value-o.value))),W=e.computed(()=>({cy:"vertical-bar-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),c=e.ref(t.value.style.chart.layout.bars.height),v=e.ref(t.value.style.chart.layout.bars.gap),pe=e.computed(()=>(c.value+v.value)*T.value),Y=e.ref(512),d=e.computed(()=>({width:Y.value,height:pe.value,padding:{top:12,left:128+t.value.style.chart.layout.bars.offsetX,right:64+t.value.style.chart.layout.bars.paddingRight,bottom:12}})),u=e.computed(()=>({fullHeight:d.value.padding.top+d.value.padding.bottom+d.value.height,top:d.value.padding.top,left:d.value.padding.left,right:d.value.width-d.value.padding.right,bottom:d.value.padding.top+d.value.height,width:d.value.width-(d.value.padding.left+d.value.padding.right)}));function P(){T.value=C.value.flatMap(a=>a.children&&a.children.length>0?a.children.length:1).reduce((a,o)=>a+o,0)}const y=e.ref([]);function $(a){y.value.includes(a)?y.value=y.value.filter(o=>o!==a):y.value.push(a),P(),ie("selectLegend",C.value)}const C=e.computed(()=>k.value.filter(a=>!y.value.includes(a.id))),g=e.computed(()=>C.value.map(a=>Math.abs(a.value)).reduce((a,o)=>a+o,0));function K(a,o=!1,l=0){return o?n.dataLabel({v:n.checkNaN(Math.abs(a)/g.value*100),s:"%",r:l}):Math.abs(a)/g.value}const x=e.computed(()=>C.value.flatMap(a=>a.hasChildren?a.children:a)),_=e.computed(()=>x.value.map(a=>a.sign).includes(-1)),ye=e.computed(()=>Math.max(...C.value.flatMap(a=>a.children&&a.children.length?Math.max(...a.children.map(o=>o.value)):a.value)));function b(a){const o=a/ye.value;return u.value.width/(_.value?2:1)*o}function ge(a){return b(a)+u.value.left}function N(a,o){const l=C.value.find(s=>s.id===a.parentId),r=u.value.top+(v.value+c.value)*o,i=l.children.length*(v.value+c.value);return{y:r+i/2-t.value.style.chart.layout.bars.parentLabels.fontSize,name:l.name,value:[void 0,NaN,null].includes(l.value)?"":l.sign===1?l.value:-l.value,percentageToTotal:isNaN(l.value/g.value)?"":K(l.value,!0,t.value.style.chart.layout.bars.dataLabels.percentage.roundingPercentage),sign:l.sign}}function fe(){return C.value}const D=e.ref(null),F=e.ref(null);function be(a,o){F.value={datapoint:a,seriesIndex:o,series:k.value,config:t.value},B.value=!0,D.value=a.id;let l="";const r=a.isChild?a.parentName:a.name,i=a.isChild?a.name:"",s=t.value.style.chart.tooltip.customFormat;n.isFunction(s)&&n.functionReturnsString(()=>s({datapoint:a,series:k.value,config:t.value,seriesIndex:o}))?L.value=s({datapoint:a,series:k.value,config:t.value,seriesIndex:o}):(l+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;text-align:left;">
2
2
  <div style="display:flex;align-items:center;gap:4px;"><svg viewBox="0 0 12 12" height="14" width="14"><rect x="0" y="0" height="12" width="12" rx="2" stroke="none" fill="${a.color}"/></svg> ${r}</div>
3
3
  ${i?`<div>${i}</div>`:""}
4
4
  </div>`,t.value.style.chart.tooltip.showValue&&(l+=`<div>${t.value.translations.value}: <b>${n.applyDataLabel(t.value.style.chart.layout.bars.dataLabels.value.formatter,a.sign===1?a.value:-a.value,n.dataLabel({p:t.value.style.chart.tooltip.prefix,v:a.sign===1?a.value:-a.value,s:t.value.style.chart.tooltip.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:a,seriesIndex:o})}</b></div>`),t.value.style.chart.tooltip.showPercentage&&(l+=`<div>${t.value.translations.percentageToTotal} : <b>${n.dataLabel({v:Math.abs(a.value)/g.value*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage})}</b></div>`,a.isChild&&(l+=`<div>${t.value.translations.percentageToSerie}: <b>${n.dataLabel({v:Math.abs(a.value)/Math.abs(a.parentValue)*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage})}</b></div>`)),L.value=`<div style="text-align:left">${l}</div>`)}function J(a,o,l,r){if(!t.value.style.chart.layout.bars.dataLabels.value.show)return"";const i=n.applyDataLabel(t.value.style.chart.layout.bars.dataLabels.value.formatter,n.checkNaN(r===-1&&a>=0?-a:a),n.dataLabel({p:t.value.style.chart.layout.bars.dataLabels.value.prefix,v:n.checkNaN(r===-1&&a>=0?-a:a),s:t.value.style.chart.layout.bars.dataLabels.value.suffix,r:t.value.style.chart.layout.bars.dataLabels.value.roundingValue}),{datapoint:o,seriesIndex:l}),s=`(${K(a,!0,t.value.style.chart.layout.bars.dataLabels.percentage.roundingPercentage)})`;return`${i}${t.value.style.chart.layout.bars.dataLabels.percentage.show?` ${s}`:""}`}const p=e.computed(()=>{const a=[t.value.translations.parentName,t.value.translations.value,t.value.translations.percentageToTotal,t.value.translations.childName,t.value.translations.value,t.value.translations.percentageToSerie,t.value.translations.percentageToTotal],o=x.value.map(l=>l.isChild?l.isFirstChild?{color:l.color,parentName:l.parentName,parentValue:l.parentValue,percentageToTotal:l.parentValue/g.value,childName:l.name,childValue:l.sign===1?l.value:-l.value,childPercentageToParent:Math.abs(l.value)/Math.abs(l.parentValue),childPercentageToTotal:Math.abs(l.value)/g.value}:{color:"",parentName:"",parentValue:"",percentageToTotal:"",childName:l.name,childValue:l.sign===1?l.value:-l.value,childPercentageToParent:Math.abs(l.value)/Math.abs(l.parentValue),childPercentageToTotal:Math.abs(l.value)/g.value}:{color:l.color,parentName:l.name,parentValue:l.sign===1?l.value:-l.value,percentageToTotal:Math.abs(l.value)/g.value,childName:"",childValue:"",childPercentageToParent:"",childPercentageToTotal:""});return{head:a,body:o}});function Q(){const a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[""]],o=p.value.head,l=p.value.body.map(s=>[s.parentName,s.parentValue,s.percentageToTotal,s.childName,s.childValue,s.childPercentageToParent,s.childPercentageToTotal]),r=a.concat([o]).concat(l),i=n.createCsvContent(r);n.downloadCsv({csvContent:i,title:t.value.style.chart.title.text||"vue-ui-vertical-bar"})}const S=e.ref(!1);function me(a){S.value=a,I.value+=1}function Z(){h.value.showTable=!h.value.showTable}function ee(){h.value.sortDesc=!h.value.sortDesc,P()}function te(){h.value.showTooltip=!h.value.showTooltip}return ue({getData:fe,recalculateHeight:P,generatePdf:H,generateCsv:Q,generateImage:X,toggleTable:Z,toggleSort:ee,toggleTooltip:te}),(a,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-vertical-bar ${S.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),ref_key:"verticalBarChart",ref:w,id:`vue-ui-vertical-bar_${m.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height: 100%":""}`)},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:O,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:12px`)},[e.createVNode(Ce._sfc_main,{config:{title:{cy:"vertical-bar-div-title",...t.value.style.chart.title},subtitle:{cy:"vertical-bar-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&V.value?(e.openBlock(),e.createBlock(ae.UserOptions,{ref_key:"details",ref:ce,key:`user_options_${I.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(q),isPrinting:e.unref(R),uid:m.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasSort:t.value.userOptions.buttons.sort,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:S.value,isTooltip:h.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:w.value,onToggleFullscreen:me,onGeneratePdf:e.unref(H),onGenerateCsv:Q,onGenerateImage:e.unref(X),onToggleTable:Z,onToggleSort:ee,onToggleTooltip:te},e.createSlots({_:2},[a.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,a.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,a.$slots.optionLabels?{name:"optionLabels",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionLabels",{},void 0,!0)]),key:"5"}:void 0,a.$slots.optionSort?{name:"optionSort",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionSort",{},void 0,!0)]),key:"6"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:r})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:r})),void 0,!0)]),key:"7"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasSort","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),t.value.style.chart.legend.show&&t.value.style.chart.legend.position==="top"?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartLegend",ref:z},[e.createVNode(oe.Legend,{legendSet:k.value,config:W.value,onClickMarker:o[0]||(o[0]=({legend:l})=>$(l.id))},{item:e.withCtx(({legend:l,index:r})=>[e.createElementVNode("div",{"data-cy-legend-item":"",onClick:i=>$(l.id),style:e.normalizeStyle(`opacity:${y.value.includes(l.id)?.5:1}`)},e.toDisplayString(l.name)+": "+e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.bars.dataLabels.value.formatter,l.value,e.unref(n.dataLabel)({p:t.value.style.chart.legend.prefix,v:l.value,s:t.value.style.chart.legend.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:l,seriesIndex:r})),13,Ve)]),_:1},8,["legendSet","config"])],512)):e.createCommentVNode("",!0),V.value?(e.openBlock(),e.createElementBlock("svg",{key:3,xmlns:e.unref(n.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":S.value,"vue-data-ui-fulscreen--off":!S.value}),viewBox:`0 0 ${d.value.width<=0?10:d.value.width} ${u.value.fullHeight<=0?10:u.value.fullHeight}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(l,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{x1:"0%",y1:"0%",x2:"100%",y2:"0%",id:`vertical_bar_gradient_${m.value}_${r}`},[e.createElementVNode("stop",{offset:"0%","stop-color":l.color},null,8,Be),e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(n.shiftHue)(l.color,.03)}${e.unref(n.opacity)[100-t.value.style.chart.layout.bars.gradientIntensity]}`},null,8,Le)],8,Ee))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:e.unref(n.checkNaN)(_.value?u.value.left+u.value.width/2-(l.sign===1?0:b(l.value)<=0?1e-4:b(l.value)):u.value.left),y:u.value.top+(v.value+c.value)*r,width:e.unref(n.checkNaN)(b(l.value)<=0?1e-4:b(l.value)),height:c.value<=0?1e-4:c.value,fill:t.value.style.chart.layout.bars.underlayerColor,rx:t.value.style.chart.layout.bars.borderRadius,class:e.normalizeClass({animated:t.value.useCssAnimation})},null,10,ze)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:e.unref(n.checkNaN)(_.value?u.value.left+u.value.width/2-(l.sign===1?0:b(l.value)<=0?1e-4:b(l.value)):u.value.left),y:u.value.top+(v.value+c.value)*r,width:e.unref(n.checkNaN)(b(l.value)<=0?1e-4:b(l.value)),height:c.value<=0?1e-4:c.value,fill:t.value.style.chart.layout.bars.useGradient?`url(#vertical_bar_gradient_${m.value}_${r})`:`${l.color}${e.unref(n.opacity)[t.value.style.chart.layout.bars.fillOpacity]}`,rx:t.value.style.chart.layout.bars.borderRadius,stroke:t.value.style.chart.layout.bars.useStroke?l.color:"none","stroke-width":t.value.style.chart.layout.bars.useStroke?t.value.style.chart.layout.bars.strokeWidth:0,class:e.normalizeClass({animated:t.value.useCssAnimation})},null,10,Pe),(!l.isChild||l.isLastChild)&&t.value.style.chart.layout.separators.show&&r!==x.value.length-1?(e.openBlock(),e.createElementBlock("line",{key:0,x1:0,x2:u.value.left,y1:c.value+v.value/2+u.value.top+(v.value+c.value)*r,y2:c.value+v.value/2+u.value.top+(v.value+c.value)*r,stroke:t.value.style.chart.layout.separators.color,"stroke-width":t.value.style.chart.layout.separators.strokeWidth,"stroke-linecap":"round"},null,8,De)):e.createCommentVNode("",!0),_.value&&t.value.style.chart.layout.separators.show?(e.openBlock(),e.createElementBlock("line",{key:1,x1:u.value.left+u.value.width/2,x2:u.value.left+u.value.width/2,y1:u.value.top,y2:u.value.bottom,stroke:t.value.style.chart.layout.separators.color,"stroke-width":t.value.style.chart.layout.separators.strokeWidth,"stroke-linecap":"round"},null,8,Fe)):e.createCommentVNode("",!0),e.createElementVNode("text",{x:_.value?u.value.left+u.value.width/2+(l.sign===1?-12:12)+(l.sign===1?-t.value.style.chart.layout.bars.dataLabels.offsetX:t.value.style.chart.layout.bars.dataLabels.offsetX):ge(l.value)+3+t.value.style.chart.layout.bars.dataLabels.offsetX,y:u.value.top+(v.value+c.value)*r+c.value/2+t.value.style.chart.layout.bars.dataLabels.fontSize/2,"text-anchor":!_.value||l.sign===-1?"start":"end","font-size":t.value.style.chart.layout.bars.dataLabels.fontSize,fill:t.value.style.chart.layout.bars.dataLabels.color,"font-weight":t.value.style.chart.layout.bars.dataLabels.bold?"bold":"normal"},e.toDisplayString(J(l.value,l,r,l.sign)),9,Me),(l.isChild||!l.hasChildren)&&t.value.style.chart.layout.bars.nameLabels.show?(e.openBlock(),e.createElementBlock("text",{key:2,"text-anchor":"end",x:u.value.left-3+t.value.style.chart.layout.bars.nameLabels.offsetX,y:u.value.top+(v.value+c.value)*r+c.value/2+t.value.style.chart.layout.bars.nameLabels.fontSize/2,"font-size":t.value.style.chart.layout.bars.nameLabels.fontSize,fill:t.value.style.chart.layout.bars.nameLabels.color,"font-weight":t.value.style.chart.layout.bars.nameLabels.bold?"bold":"normal"},e.toDisplayString(l.name),9,Ie)):e.createCommentVNode("",!0),l.isChild&&l.childIndex===0&&t.value.style.chart.layout.bars.parentLabels.show?(e.openBlock(),e.createElementBlock("text",{key:3,x:3+t.value.style.chart.layout.bars.parentLabels.offsetX,y:N(l,r).y,"font-size":t.value.style.chart.layout.bars.parentLabels.fontSize,fill:t.value.style.chart.layout.bars.parentLabels.color,"font-weight":t.value.style.chart.layout.bars.parentLabels.bold?"bold":"normal","text-anchor":"start"},e.toDisplayString(N(l,r).name),9,Oe)):e.createCommentVNode("",!0),l.isChild&&l.childIndex===0&&t.value.style.chart.layout.bars.parentLabels.show?(e.openBlock(),e.createElementBlock("text",{key:4,x:3+t.value.style.chart.layout.bars.parentLabels.offsetX,y:N(l,r).y+t.value.style.chart.layout.bars.parentLabels.fontSize+6,"font-size":t.value.style.chart.layout.bars.parentLabels.fontSize,fill:t.value.style.chart.layout.bars.parentLabels.color,"font-weight":t.value.style.chart.layout.bars.dataLabels.bold?"bold":"normal","text-anchor":"start"},e.toDisplayString(J(N(l,r).value),N(l,r),r,N(l,r).sign),9,Re)):e.createCommentVNode("",!0),e.createElementVNode("rect",{"data-cy-trap":"",x:0,y:u.value.top+(v.value+c.value)*r-v.value/2,width:d.value.width<=0?1e-4:d.value.width,height:c.value+v.value<=0?1e-4:c.value+v.value,fill:D.value===l.id?`${t.value.style.chart.layout.highlighter.color}${e.unref(n.opacity)[t.value.style.chart.layout.highlighter.opacity]}`:"transparent",onMouseenter:i=>be(l,r),onMouseleave:o[1]||(o[1]=i=>{de.value=null,B.value=!1,D.value=null})},null,40,qe)]))),256)),e.renderSlot(a.$slots,"svg",{svg:d.value},void 0,!0)],14,Te)):e.createCommentVNode("",!0),a.$slots.watermark?(e.openBlock(),e.createElementBlock("div",He,[e.renderSlot(a.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(R)||e.unref(q)})),void 0,!0)])):e.createCommentVNode("",!0),V.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(_e.default,{key:5,config:{type:"verticalBar",style:{backgroundColor:t.value.style.chart.backgroundColor,verticalBar:{axis:{color:"#CCCCCC"},color:"#CCCCCC"}}}},null,8,["config"])),t.value.style.chart.legend.show&&t.value.style.chart.legend.position==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:6,ref_key:"chartLegend",ref:z},[e.createVNode(oe.Legend,{legendSet:k.value,config:W.value,onClickMarker:o[2]||(o[2]=({legend:l})=>$(l.id))},{item:e.withCtx(({legend:l,index:r})=>[e.createElementVNode("div",{onClick:i=>$(l.id),style:e.normalizeStyle(`opacity:${y.value.includes(l.id)?.5:1}`)},e.toDisplayString(l.name)+": "+e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.bars.dataLabels.value.formatter,l.value,e.unref(n.dataLabel)({p:t.value.style.chart.legend.prefix,v:l.value,s:t.value.style.chart.legend.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:l,seriesIndex:r})),13,Xe)]),_:1},8,["legendSet","config"])],512)):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"legend",{legend:k.value},void 0,!0),e.createVNode(xe._sfc_main,{show:h.value.showTooltip&&B.value&&y.value.length<f.dataset.length,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,fontSize:t.value.style.chart.tooltip.fontSize,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:w.value,content:L.value,isCustom:t.value.style.chart.tooltip.customFormat&&typeof t.value.style.chart.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(a.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...F.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(a.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...F.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isCustom"]),V.value?(e.openBlock(),e.createBlock(we.default,{key:7,hideDetails:"",config:{open:h.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"tableContainer",ref:U,class:"vue-ui-vertical-bar-table"},[e.createElementVNode("div",Ae,[e.createElementVNode("div",{role:"button",tabindex:"0",style:e.normalizeStyle(`width:32px; position: absolute; top: 0; right:4px; padding: 0 0px; display: flex; align-items:center;justify-content:center;height: 36px; width: 32px; cursor:pointer; background:${t.value.table.th.backgroundColor};`),onClick:o[3]||(o[3]=l=>h.value.showTable=!1),onKeypress:o[4]||(o[4]=e.withKeys(l=>h.value.showTable=!1,["enter"]))},[e.createVNode(Ne.default,{name:"close",stroke:t.value.table.th.color,"stroke-width":2},null,8,["stroke"])],36),e.createElementVNode("div",{style:{width:"100%","container-type":"inline-size"},class:e.normalizeClass({"vue-ui-responsive":j.value})},[e.createElementVNode("table",Ue,[e.createElementVNode("caption",{style:e.normalizeStyle({backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline}),class:"vue-ui-data-table__caption"},[e.createTextVNode(e.toDisplayString(t.value.style.chart.title.text)+" ",1),t.value.style.chart.title.subtitle.text?(e.openBlock(),e.createElementBlock("span",je,e.toDisplayString(t.value.style.chart.title.subtitle.text),1)):e.createCommentVNode("",!0)],4),e.createElementVNode("thead",null,[e.createElementVNode("tr",{role:"row",style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value.head,l=>(e.openBlock(),e.createElementBlock("th",{style:e.normalizeStyle(`outline:${t.value.table.th.outline}`)},[e.createElementVNode("div",Ge,e.toDisplayString(l),1)],4))),256))],4),e.createElementVNode("tr",null,[e.createElementVNode("th",{style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline}`)},null,4),e.createElementVNode("th",{style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline};text-align:right;padding-right:5px;font-weight:bold`)},"∑ "+e.toDisplayString(t.value.table.td.prefix)+e.toDisplayString(isNaN(g.value)?"":g.value.toFixed(t.value.table.td.roundingValue))+e.toDisplayString(t.value.table.td.suffix),5),e.createElementVNode("th",{style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline};text-align:right;padding-right:5px;font-weight:bold`)},"100%",4),e.createElementVNode("th",{style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline}`)},null,4),e.createElementVNode("th",{style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline}`)},null,4),e.createElementVNode("th",{style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline}`)},null,4),e.createElementVNode("th",{style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline}`)},null,4)])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value.body,(l,r)=>(e.openBlock(),e.createElementBlock("tr",{class:e.normalizeClass({"vue-ui-data-table__tbody__row":!0,"vue-ui-data-table__tbody__row-even":r%2===0,"vue-ui-data-table__tbody__row-odd":r%2!==0}),style:e.normalizeStyle(`background:${t.value.table.td.backgroundColor};color:${t.value.table.td.color}`)},[e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline};font-variant-numeric: tabular-nums;`),"data-cell":p.value.head[0]??""},[e.createElementVNode("div",Ye,[l.color?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(`color:${l.color};margin-right:3px`)},"⬤",4)):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(l.parentName),1)])],12,We),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":p.value.head[1]??""},[e.createElementVNode("div",Je,e.toDisplayString(t.value.table.td.prefix)+e.toDisplayString(["",NaN,void 0].includes(l.parentValue)?"":l.parentValue.toFixed(t.value.table.td.roundingValue))+e.toDisplayString(t.value.table.td.suffix),1)],12,Ke),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":p.value.head[2]??""},[e.createElementVNode("div",Ze,e.toDisplayString(["",NaN,void 0].includes(l.percentageToTotal)?"":`${(l.percentageToTotal*100).toFixed(t.value.table.td.roundingPercentage)}%`),1)],12,Qe),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":p.value.head[3]??""},[e.createElementVNode("div",tt,e.toDisplayString(l.childName),1)],12,et),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":p.value.head[4]??""},[e.createElementVNode("div",at,e.toDisplayString(t.value.table.td.prefix)+e.toDisplayString(["",NaN,void 0].includes(l.childValue)?"":l.childValue.toFixed(t.value.table.td.roundingValue))+e.toDisplayString(t.value.table.td.suffix),1)],12,lt),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":p.value.head[5]??""},[e.createElementVNode("div",nt,e.toDisplayString(["",NaN,void 0].includes(l.childPercentageToParent)?"":`${(l.childPercentageToParent*100).toFixed(t.value.table.td.roundingPercentage)}%`),1)],12,ot),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":p.value.head[6]??""},[e.createElementVNode("div",ut,e.toDisplayString(["",NaN,void 0].includes(l.childPercentageToTotal)?"":`${(l.childPercentageToTotal*100).toFixed(t.value.table.td.roundingPercentage)}%`),1)],12,rt)],6))),256))])])],2)])],512)]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,Se))}},st=$e._export_sfc(it,[["__scopeId","data-v-1dd68cde"]]);exports.default=st;