vue-data-ui 2.3.75 → 2.3.76

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 (141) hide show
  1. package/dist/{Arrow-CZK77NmC.cjs → Arrow-D7M4-bW7.cjs} +1 -1
  2. package/dist/{Arrow-BTG7M25z.js → Arrow-DY9RKUmG.js} +1 -1
  3. package/dist/{BaseIcon--PMhZ3f-.cjs → BaseIcon-DB7Apwv_.cjs} +1 -1
  4. package/dist/{BaseIcon-BAOfPaXs.js → BaseIcon-rwm-10Hu.js} +1 -1
  5. package/dist/{DataTable-DjQzrklZ.cjs → DataTable-CsNozyz7.cjs} +1 -1
  6. package/dist/{DataTable-CQANRZju.js → DataTable-e2fnfjXV.js} +2 -2
  7. package/dist/{Legend-DX1kv21U.js → Legend-5cQ0xZjK.js} +1 -1
  8. package/dist/{Legend-CtbPB0Bo.cjs → Legend-DgFd-O0m.cjs} +1 -1
  9. package/dist/{Shape-kqcyauhC.js → Shape-CiTElr_0.js} +1 -1
  10. package/dist/{Shape-CadGs1Am.cjs → Shape-yPECDLiP.cjs} +1 -1
  11. package/dist/{Slicer-i_oECHxH.cjs → Slicer-DaZgCKV7.cjs} +1 -1
  12. package/dist/{Slicer-yaJs-izT.js → Slicer-DwBBu3kB.js} +2 -2
  13. package/dist/{Title-XBiDFYKD.cjs → Title-3EduyW4p.cjs} +1 -1
  14. package/dist/{Title-C26I_HC3.js → Title-gUz6GDA3.js} +1 -1
  15. package/dist/{Tooltip-DxtWkIt5.cjs → Tooltip-DScSrYXJ.cjs} +1 -1
  16. package/dist/{Tooltip-CH8GmDCG.js → Tooltip-DfSM1mNP.js} +1 -1
  17. package/dist/{index-DYUBiaGS.cjs → index-BTgtr0F8.cjs} +1 -1
  18. package/dist/{index-Cm4Iry5c.js → index-CaV1s-yZ.js} +1 -1
  19. package/dist/style.css +1 -1
  20. package/dist/{useNestedProp-w7AMWWmz.cjs → useNestedProp-CisbRRo_.cjs} +1 -1
  21. package/dist/{useNestedProp-CurQIHTa.js → useNestedProp-tWCzZrLx.js} +1 -1
  22. package/dist/{usePrinter-ZlHxdaEz.cjs → usePrinter-DzTaA1eh.cjs} +1 -1
  23. package/dist/{usePrinter-B8RnF8_q.js → usePrinter-rvJyT65A.js} +1 -1
  24. package/dist/{vue-data-ui-B7amrpT-.cjs → vue-data-ui-BGkWRPUY.cjs} +1 -1
  25. package/dist/{vue-data-ui-Bj6kEIpq.js → vue-data-ui-BO89gTtq.js} +57 -57
  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-Bg9IgVVc.js → vue-ui-3d-bar-CcTMIHiB.js} +7 -7
  29. package/dist/{vue-ui-3d-bar-BAz41kL7.cjs → vue-ui-3d-bar-DzmcGuqh.cjs} +1 -1
  30. package/dist/{vue-ui-accordion-1WxrfiCH.cjs → vue-ui-accordion-7e4Myhcg.cjs} +1 -1
  31. package/dist/{vue-ui-accordion-Cb6XBCbu.js → vue-ui-accordion-CpzGQ63y.js} +3 -3
  32. package/dist/{vue-ui-age-pyramid-CHNvRXx8.cjs → vue-ui-age-pyramid-C7qr9EwB.cjs} +1 -1
  33. package/dist/{vue-ui-age-pyramid-BhwmnQru.js → vue-ui-age-pyramid-D71ZLkVV.js} +8 -8
  34. package/dist/{vue-ui-annotator-BiHQvMdW.js → vue-ui-annotator-B8Iu6cYt.js} +1 -1
  35. package/dist/{vue-ui-annotator-B22cdlhA.cjs → vue-ui-annotator-BKQrweqm.cjs} +1 -1
  36. package/dist/{vue-ui-candlestick-Cl9dyh4l.js → vue-ui-candlestick-Bx4QVkY0.js} +9 -9
  37. package/dist/{vue-ui-candlestick-D7DjdYyw.cjs → vue-ui-candlestick-DAc1FQ-i.cjs} +1 -1
  38. package/dist/vue-ui-carousel-table-uFRqkghO.cjs +1 -0
  39. package/dist/{vue-ui-carousel-table-QsONwqNz.js → vue-ui-carousel-table-xuQG6bcH.js} +98 -96
  40. package/dist/{vue-ui-chestnut-Drb01WMC.js → vue-ui-chestnut-Bo6rDcU7.js} +6 -6
  41. package/dist/{vue-ui-chestnut-CyE8MafY.cjs → vue-ui-chestnut-DJkm72oD.cjs} +1 -1
  42. package/dist/{vue-ui-cursor-DZeTQBKz.cjs → vue-ui-cursor-BQbeuW-k.cjs} +1 -1
  43. package/dist/{vue-ui-cursor-BP04_XbB.js → vue-ui-cursor-C0KOqEOq.js} +2 -2
  44. package/dist/{vue-ui-dashboard-Z63RE1XS.cjs → vue-ui-dashboard-0Hsjx-bO.cjs} +1 -1
  45. package/dist/{vue-ui-dashboard-BWdx5gjZ.js → vue-ui-dashboard-BT71xS7P.js} +2 -2
  46. package/dist/{vue-ui-digits-DUhkLcmd.js → vue-ui-digits-BRqpKYvD.js} +2 -2
  47. package/dist/{vue-ui-digits-CBQaHW6a.cjs → vue-ui-digits-C2ReH6w0.cjs} +1 -1
  48. package/dist/{vue-ui-donut-DRPSwmGr.js → vue-ui-donut-NQW-3prf.js} +9 -9
  49. package/dist/{vue-ui-donut-evolution-jAMVgNHQ.cjs → vue-ui-donut-evolution-DOe-cwLi.cjs} +1 -1
  50. package/dist/{vue-ui-donut-evolution-gRXAyxq8.js → vue-ui-donut-evolution-jbXQQGTc.js} +9 -9
  51. package/dist/{vue-ui-donut-D2YJYgOB.cjs → vue-ui-donut-v81suIOX.cjs} +1 -1
  52. package/dist/{vue-ui-dumbbell-DLfZcrXq.cjs → vue-ui-dumbbell-DXQSg6wa.cjs} +1 -1
  53. package/dist/{vue-ui-dumbbell-CQo5jqSK.js → vue-ui-dumbbell-Dyz8xdtC.js} +8 -8
  54. package/dist/{vue-ui-flow-BQ3UbMUb.js → vue-ui-flow-BL3JWW1m.js} +7 -7
  55. package/dist/{vue-ui-flow-BlX2-eEC.cjs → vue-ui-flow-UqSNwH9d.cjs} +1 -1
  56. package/dist/{vue-ui-galaxy-Cax5o6Yl.cjs → vue-ui-galaxy-DTQWGvRH.cjs} +1 -1
  57. package/dist/{vue-ui-galaxy-BHWugUKG.js → vue-ui-galaxy-Dx9nsOuM.js} +9 -9
  58. package/dist/{vue-ui-gauge-DpGcv_00.cjs → vue-ui-gauge-BUB7H0qA.cjs} +1 -1
  59. package/dist/{vue-ui-gauge-DG6_kvKh.js → vue-ui-gauge-CLaKGi0-.js} +5 -5
  60. package/dist/{vue-ui-gizmo-D9Vh9Rmr.cjs → vue-ui-gizmo-Kitfqu0J.cjs} +1 -1
  61. package/dist/{vue-ui-gizmo-bV148qAf.js → vue-ui-gizmo-of-4s5HG.js} +2 -2
  62. package/dist/{vue-ui-heatmap-BZZUvnMa.js → vue-ui-heatmap-BIzjOMXO.js} +8 -8
  63. package/dist/{vue-ui-heatmap-B_ELXKKV.cjs → vue-ui-heatmap-DUw2350O.cjs} +1 -1
  64. package/dist/{vue-ui-kpi-C5v7qQvZ.js → vue-ui-kpi-By3YPwgo.js} +3 -3
  65. package/dist/{vue-ui-kpi-CwVAvTB2.cjs → vue-ui-kpi-DyL2Hcz-.cjs} +1 -1
  66. package/dist/{vue-ui-mini-loader-DZNY-3rr.cjs → vue-ui-mini-loader-C048-8Kd.cjs} +1 -1
  67. package/dist/{vue-ui-mini-loader-BdKizX_J.js → vue-ui-mini-loader-DnK3V2z2.js} +2 -2
  68. package/dist/{vue-ui-molecule-MKyrhqqm.js → vue-ui-molecule-BfhbIqa5.js} +9 -9
  69. package/dist/{vue-ui-molecule-bva6OvPc.cjs → vue-ui-molecule-D-ahly6R.cjs} +1 -1
  70. package/dist/{vue-ui-mood-radar-CzQOAyNI.cjs → vue-ui-mood-radar-DD8R9BpJ.cjs} +1 -1
  71. package/dist/{vue-ui-mood-radar-BNIFFvq0.js → vue-ui-mood-radar-DXxEKr3x.js} +9 -9
  72. package/dist/{vue-ui-nested-donuts-BDAlZrMF.js → vue-ui-nested-donuts-BdUdHFd-.js} +9 -9
  73. package/dist/{vue-ui-nested-donuts-CxdZC6JF.cjs → vue-ui-nested-donuts-C7qM_FRw.cjs} +1 -1
  74. package/dist/{vue-ui-onion-CFa4VD-w.js → vue-ui-onion-D0vF5jBt.js} +9 -9
  75. package/dist/{vue-ui-onion-Df7YcsVR.cjs → vue-ui-onion-DX3gofXZ.cjs} +1 -1
  76. package/dist/{vue-ui-parallel-coordinate-plot-DmqYXT-U.js → vue-ui-parallel-coordinate-plot-CTZY-pY8.js} +10 -10
  77. package/dist/{vue-ui-parallel-coordinate-plot-D7Q2zfcR.cjs → vue-ui-parallel-coordinate-plot-DEx5kFYd.cjs} +1 -1
  78. package/dist/{vue-ui-quadrant-D5jHkq9g.js → vue-ui-quadrant-ByY8GP3y.js} +10 -10
  79. package/dist/{vue-ui-quadrant-ZqhcVYf5.cjs → vue-ui-quadrant-CgApzie6.cjs} +1 -1
  80. package/dist/{vue-ui-quick-chart-BjXXSx7V.js → vue-ui-quick-chart-DTxJ__7j.js} +7 -7
  81. package/dist/{vue-ui-quick-chart-Dt9AsEU6.cjs → vue-ui-quick-chart-DWZEgUJF.cjs} +1 -1
  82. package/dist/{vue-ui-radar-CW8EKW4o.js → vue-ui-radar-5UBmAU6W.js} +10 -10
  83. package/dist/{vue-ui-radar-2EuZr7i2.cjs → vue-ui-radar-DEED0rTz.cjs} +1 -1
  84. package/dist/{vue-ui-rating-DrtLvVA0.cjs → vue-ui-rating-Ce_Ewqtl.cjs} +1 -1
  85. package/dist/{vue-ui-rating-eSWsmJUU.js → vue-ui-rating-Dr6jquxh.js} +2 -2
  86. package/dist/{vue-ui-relation-circle-DiUCpEqa.js → vue-ui-relation-circle-BU8i2miI.js} +5 -5
  87. package/dist/{vue-ui-relation-circle-C60OTe88.cjs → vue-ui-relation-circle-CRcQ6Zcy.cjs} +1 -1
  88. package/dist/{vue-ui-rings-BxhLbyG0.js → vue-ui-rings-Ctl3Jywh.js} +9 -9
  89. package/dist/{vue-ui-rings-CHq-a5ZS.cjs → vue-ui-rings-OQ8a1Ruw.cjs} +1 -1
  90. package/dist/{vue-ui-scatter-DZUZUbnk.cjs → vue-ui-scatter-B8StSjt8.cjs} +1 -1
  91. package/dist/{vue-ui-scatter-DQchX_mM.js → vue-ui-scatter-BwJ_koWT.js} +10 -10
  92. package/dist/{vue-ui-screenshot-CLa9vMzM.js → vue-ui-screenshot-BS3L5vhN.js} +1 -1
  93. package/dist/{vue-ui-screenshot-SLSIpqx2.cjs → vue-ui-screenshot-bAVk3EPl.cjs} +1 -1
  94. package/dist/{vue-ui-skeleton-ClpTCY1x.cjs → vue-ui-skeleton-CMQzFTs9.cjs} +1 -1
  95. package/dist/{vue-ui-skeleton-C1oUnz7R.js → vue-ui-skeleton-CvFX_ExX.js} +2 -2
  96. package/dist/{vue-ui-smiley-CmWHSt1S.js → vue-ui-smiley-CGYZpNt9.js} +2 -2
  97. package/dist/{vue-ui-smiley-Daw8fPDy.cjs → vue-ui-smiley-sF8QIso1.cjs} +1 -1
  98. package/dist/{vue-ui-spark-trend-CO69Dg31.js → vue-ui-spark-trend-B4XSSKl9.js} +4 -4
  99. package/dist/{vue-ui-spark-trend-DmDlv8ie.cjs → vue-ui-spark-trend-CdIoxaqb.cjs} +1 -1
  100. package/dist/{vue-ui-sparkbar-BRlqpe4e.js → vue-ui-sparkbar-BbsJGDMZ.js} +3 -3
  101. package/dist/{vue-ui-sparkbar-BUGdi0BY.cjs → vue-ui-sparkbar-C3i1K7hi.cjs} +1 -1
  102. package/dist/{vue-ui-sparkgauge-CCxKzDjT.cjs → vue-ui-sparkgauge-BKyQoI7C.cjs} +1 -1
  103. package/dist/{vue-ui-sparkgauge-CbuFESsM.js → vue-ui-sparkgauge-D4w_i_QJ.js} +3 -3
  104. package/dist/{vue-ui-sparkhistogram-B4-hrDHz.js → vue-ui-sparkhistogram-CYybrW-6.js} +4 -4
  105. package/dist/{vue-ui-sparkhistogram-XtqX10_t.cjs → vue-ui-sparkhistogram-CvTYEmbz.cjs} +1 -1
  106. package/dist/{vue-ui-sparkline-BZTEi9YC.cjs → vue-ui-sparkline-CDowaDRS.cjs} +1 -1
  107. package/dist/{vue-ui-sparkline-DlXNmG6M.js → vue-ui-sparkline-DjN1SVdO.js} +3 -3
  108. package/dist/{vue-ui-sparkstackbar-J1YowQmP.js → vue-ui-sparkstackbar-BLMhJxaN.js} +3 -3
  109. package/dist/{vue-ui-sparkstackbar-CDmZeXnq.cjs → vue-ui-sparkstackbar-BZ2bESBi.cjs} +1 -1
  110. package/dist/{vue-ui-stackbar-CKIDqkkY.js → vue-ui-stackbar-BTKOHUYc.js} +10 -10
  111. package/dist/{vue-ui-stackbar-CXGWukoJ.cjs → vue-ui-stackbar-DRHaJFR8.cjs} +1 -1
  112. package/dist/{vue-ui-strip-plot-CvmoRcYN.cjs → vue-ui-strip-plot-DxQxFbWg.cjs} +1 -1
  113. package/dist/{vue-ui-strip-plot-JVLwIy0j.js → vue-ui-strip-plot-o6GTsGAT.js} +9 -9
  114. package/dist/{vue-ui-table-Dqi64VE7.cjs → vue-ui-table-BFIj1Rgh.cjs} +1 -1
  115. package/dist/{vue-ui-table-BSi_cHh7.js → vue-ui-table-CnquiTpr.js} +1 -1
  116. package/dist/{vue-ui-table-heatmap-BwghEh5t.cjs → vue-ui-table-heatmap-CCGK12Fa.cjs} +1 -1
  117. package/dist/{vue-ui-table-heatmap-CfvW3rcm.js → vue-ui-table-heatmap-CZRIwv-Q.js} +4 -4
  118. package/dist/{vue-ui-table-sparkline-Y6Lrrzxy.js → vue-ui-table-sparkline-B3zEeq6Z.js} +5 -5
  119. package/dist/{vue-ui-table-sparkline-bIy3kkHB.cjs → vue-ui-table-sparkline-DYmgfHz4.cjs} +1 -1
  120. package/dist/{vue-ui-thermometer-BPTs7Nxc.js → vue-ui-thermometer-BopiohUh.js} +5 -5
  121. package/dist/{vue-ui-thermometer-DDtxYr7w.cjs → vue-ui-thermometer-CzPRBt6c.cjs} +1 -1
  122. package/dist/{vue-ui-timer-DRSSYxOX.cjs → vue-ui-timer-Bonw69Lt.cjs} +1 -1
  123. package/dist/{vue-ui-timer-CkB7eZaE.js → vue-ui-timer-C7WkW8hK.js} +4 -4
  124. package/dist/{vue-ui-tiremarks-BbOaoY8S.js → vue-ui-tiremarks-BurRtFv4.js} +5 -5
  125. package/dist/{vue-ui-tiremarks-Bttwg3-p.cjs → vue-ui-tiremarks-DkIGfq8t.cjs} +1 -1
  126. package/dist/{vue-ui-treemap-Chq0WQPe.cjs → vue-ui-treemap-CalhJmnp.cjs} +1 -1
  127. package/dist/{vue-ui-treemap-CoaK3wBl.js → vue-ui-treemap-DWy4voIr.js} +9 -9
  128. package/dist/{vue-ui-vertical-bar-BA43_uHV.js → vue-ui-vertical-bar-CJW1YhtY.js} +9 -9
  129. package/dist/{vue-ui-vertical-bar-BLIUt-HT.cjs → vue-ui-vertical-bar-rwWp-sai.cjs} +1 -1
  130. package/dist/{vue-ui-waffle-BoEf8CcG.js → vue-ui-waffle-DB7X6nTS.js} +9 -9
  131. package/dist/{vue-ui-waffle-NBjY0mko.cjs → vue-ui-waffle-faQMBYNx.cjs} +1 -1
  132. package/dist/{vue-ui-wheel-t5bI4a-P.cjs → vue-ui-wheel-BzjbGP6a.cjs} +1 -1
  133. package/dist/{vue-ui-wheel-Bgo2jpj0.js → vue-ui-wheel-CryKap2E.js} +5 -5
  134. package/dist/{vue-ui-word-cloud-Jd9_JUyi.js → vue-ui-word-cloud-COqUkvei.js} +7 -7
  135. package/dist/{vue-ui-word-cloud-DPW_-Hzz.cjs → vue-ui-word-cloud-DJN9I4q4.cjs} +1 -1
  136. package/dist/{vue-ui-xy-CBHEBcZK.cjs → vue-ui-xy-BmA0tspd.cjs} +1 -1
  137. package/dist/{vue-ui-xy-BMBYAC4z.js → vue-ui-xy-b1Z_HPsx.js} +12 -12
  138. package/dist/{vue-ui-xy-canvas-LOsQ_DM-.js → vue-ui-xy-canvas-BgbLnY5B.js} +10 -10
  139. package/dist/{vue-ui-xy-canvas-D5FqRF4p.cjs → vue-ui-xy-canvas-DOM2Kq_s.cjs} +1 -1
  140. package/package.json +1 -1
  141. package/dist/vue-ui-carousel-table-Do5cYRqN.cjs +0 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-DYUBiaGS.cjs"),$=require("./useNestedProp-w7AMWWmz.cjs"),J=require("./vue-ui-sparkline-BZTEi9YC.cjs"),K=require("./BaseIcon--PMhZ3f-.cjs"),D=require("./usePrinter-ZlHxdaEz.cjs"),Q=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Y=["id"],Z={style:{"z-index":"1","padding-right":"24px"}},j=["onClick"],ee={style:{display:"flex","flex-direction":"row",gap:"3px","align-items":"center"}},te=["data-cell"],le={dir:"auto",style:{display:"flex","flex-direction":"row","align-items":"center",gap:"6px"}},ae=["data-cell","onPointerenter"],oe=["data-cell"],ne=["data-cell"],re=["data-cell"],ue=["data-cell"],se={__name:"vue-ui-table-sparkline",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(F,{expose:O}){const d=F;e.useCssVars(l=>({"470f7d5c":l.tdo}));const{vue_ui_table_sparkline:W}=u.useConfig(),h=e.ref(u.createUid()),S=e.ref(0),b=e.ref(0),t=e.computed({get:()=>C(),set:l=>l});function C(){const l=$.useNestedProp({userConfig:d.config,defaultConfig:W});return l.theme?{...$.useNestedProp({userConfig:u.themes.vue_ui_table_sparkline[l.theme]||d.config,defaultConfig:l}),customPalette:u.themePalettes[l.theme]||u.palette}:l}e.watch(()=>d.config,l=>{t.value=C(),A(),b.value+=1},{deep:!0}),e.watch(()=>d.dataset,l=>{f.value=v.value,b.value+=1},{deep:!0});const{isPrinting:w,isImaging:z,generatePdf:I,generateImage:N}=D.usePrinter({elementId:`table_${h.value}`,fileName:t.value.title.text||"vue-ui-table-sparkline"}),L=e.computed(()=>u.convertCustomPalette(t.value.customPalette)),g=e.ref(null),B=e.ref(!1),T=e.computed(()=>t.value.responsiveBreakpoint);e.onMounted(()=>{A()});function A(){u.objectIsEmpty(d.dataset)&&u.error({componentName:"VueUiTableSparkline",type:"dataset"});const l=new ResizeObserver(s=>{s.forEach(a=>{B.value=a.contentRect.width<T.value})});g.value&&l.observe(g.value)}const E=e.computed(()=>(d.dataset.forEach((l,s)=>{u.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(a=>{u.error({componentName:"VueUiTableSparkline",type:"datasetSerieAttribute",property:a,index:s})})}),d.dataset.map((l,s)=>{const a=(l.values||[]).map(r=>isNaN(r)?0:r??0),n=a.reduce((r,o)=>r+o,0);return{...l,values:l.values||[],color:u.convertColorToHex(l.color)||L.value[s]||u.palette[s]||u.palette[s%u.palette.length],sum:n,average:n/a.length,median:u.calcMedian(a),sparklineDataset:a.map((r,o)=>({period:t.value.colNames[o]||`col ${o}`,value:r||0}))}})));function M(l){const a=(l[0].values||[]).map((r,o)=>l.map(i=>i.values[o]||[])).map(r=>r.map((o,i)=>[o,i]).sort((o,i)=>i[0]-o[0]).map(o=>o[1]));return l.map((r,o)=>({...r,values:r.values||[],orders:a[o]}))}const v=e.computed(()=>M(E.value)),f=e.ref(v.value),G=e.computed(()=>Math.max(...f.value.map(l=>(l.values||[]).length))),y=e.ref(void 0),k=e.ref(!1),_=e.ref(void 0),x=e.ref(-1);function q(){k.value=!1,_.value=void 0,x.value=-1,f.value=v.value}function R(l){k.value=!0,_.value=l;const s=v.value.map(o=>o.values[l]||[]),a=y.value===l?1:-1;x.value=a,l===y.value?y.value=void 0:y.value=l;const r=s.map((o,i)=>[i,o]).sort((o,i)=>a*(i[1]-o[1])).map(o=>o[0]).map(o=>v.value[o]);f.value=r,b.value+=1}const U=e.computed(()=>Math.max(...d.dataset.map(l=>(l.values||[]).length))),m=e.computed(()=>{let l=t.value.colNames;if(!l.length)for(let a=0;a<U.value;a+=1)l.push(`col ${a+1}`);t.value.showTotal&&(l=[...l,t.value.translations.total]);let s;return t.value.showAverage&&t.value.showMedian?s=[...l,t.value.translations.average,t.value.translations.median]:t.value.showAverage&&!t.value.showMedian?s=[...l,t.value.translations.average]:!t.value.showAverage&&t.value.showMedian?s=[...l,t.value.translations.median]:s=l,t.value.showSparklines?[...s,t.value.translations.chart]:s}),c=e.ref(void 0),p=e.ref(void 0);function H({dataIndex:l,serieIndex:s}){c.value=l,p.value=s}const V=e.ref(!1);function X(l){V.value=l,S.value+=1}function P(){e.nextTick(()=>{const l=[t.value.translations.serie].concat(m.value),s=E.value.map((r,o)=>[[r.name],r.values,[r.sum],[r.average],[r.median]]),a=[l].concat(s),n=u.createCsvContent(a);u.downloadCsv({csvContent:n,title:t.value.title.text||"vue-ui-table-sparkline"})})}return O({generatePdf:I,generateImage:N,generateCsv:P,restoreOrder:q}),(l,s)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tableContainer",ref:g,class:e.normalizeClass({"vue-ui-responsive":B.value}),style:{overflow:"hidden"},id:`table_${h.value}`},[e.createElementVNode("div",{style:{overflow:"auto"},onPointerleave:s[0]||(s[0]=a=>{p.value=void 0,c.value=void 0})},[e.createElementVNode("table",{class:"vue-ui-data-table",style:e.normalizeStyle({fontFamily:t.value.fontFamily,position:"relative"})},[t.value.title.text?(e.openBlock(),e.createElementBlock("caption",{key:0,style:e.normalizeStyle({backgroundColor:t.value.title.backgroundColor})},[e.createElementVNode("div",{style:e.normalizeStyle({fontSize:`${t.value.title.fontSize}px`,fontWeight:t.value.title.bold?"bold":"normal",color:t.value.title.color,textAlign:t.value.title.textAlign})},e.toDisplayString(t.value.title.text),5),t.value.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle({fontSize:`${t.value.title.subtitle.fontSize}px`,fontWeight:t.value.title.subtitle.bold?"bold":"normal",color:t.value.title.subtitle.color,textAlign:t.value.title.textAlign})},e.toDisplayString(t.value.title.subtitle.text),5)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),e.createElementVNode("thead",Z,[e.createElementVNode("tr",{role:"row",class:"vue-ui-data-table__thead-row",style:e.normalizeStyle({backgroundColor:t.value.thead.backgroundColor,color:t.value.thead.color})},[e.createElementVNode("th",{role:"cell",style:e.normalizeStyle({backgroundColor:t.value.thead.backgroundColor,outline:t.value.thead.outline,textAlign:t.value.thead.textAlign,fontWeight:t.value.thead.bold?"bold":"normal"}),class:"sticky-col-first"},e.toDisplayString(t.value.translations.serie),5),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(a,n)=>(e.openBlock(),e.createElementBlock("th",{role:"cell",style:e.normalizeStyle({background:t.value.thead.backgroundColor,outline:t.value.thead.outline,textAlign:t.value.thead.textAlign,fontWeight:t.value.thead.bold?"bold":"normal",minWidth:n===m.value.length-1?"150px":"",cursor:v.value[0].values[n]!==void 0?"pointer":"default"}),onClick:()=>R(n),class:e.normalizeClass({"sticky-col":n===m.value.length-1&&t.value.showSparklines})},[e.createElementVNode("div",ee,[e.createElementVNode("span",null,e.toDisplayString(a),1),k.value&&n===_.value&&v.value[0].values[n]!==void 0?(e.openBlock(),e.createBlock(K.default,{key:0,size:18,name:x.value===1?"sort":"sortReverse",stroke:t.value.thead.color},null,8,["name","stroke"])):e.createCommentVNode("",!0)]),t.value.userOptions.show&&n===m.value.length-1?(e.openBlock(),e.createBlock(D.UserOptions,{ref_for:!0,ref:"details",key:`user_option_${S.value}`,backgroundColor:t.value.thead.backgroundColor,color:t.value.thead.color,isPrinting:e.unref(w),isImaging:e.unref(z),uid:h.value,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:V.value,titles:{...t.value.userOptions.buttonTitles},chartElement:g.value,onToggleFullscreen:X,onGeneratePdf:e.unref(I),onGenerateImage:e.unref(N),onGenerateCsv:P},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.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:r,isFullscreen:o})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:r,isFullscreen:o})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasFullscreen","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0)],14,j))),256))],4)]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(a,n)=>(e.openBlock(),e.createElementBlock("tr",{role:"row",style:e.normalizeStyle({backgroundColor:t.value.tbody.backgroundColor,color:t.value.tbody.color}),class:e.normalizeClass({"vue-ui-data-table__tbody__row":!0,"vue-ui-data-table__tbody__row-even":n%2===0,"vue-ui-data-table__tbody__row-odd":n%2!==0})},[e.createElementVNode("td",{role:"cell",style:e.normalizeStyle({backgroundColor:t.value.tbody.backgroundColor,outline:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),"data-cell":t.value.translations.serie,class:"vue-ui-data-table__tbody__td sticky-col-first"},[e.createElementVNode("div",le,[e.createElementVNode("span",{style:e.normalizeStyle({color:a.color})},"⬤",4),e.createElementVNode("span",null,e.toDisplayString(a.name??"-"),1)])],12,te),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(G.value,(r,o)=>(e.openBlock(),e.createElementBlock("td",{dir:"auto",role:"cell",style:e.normalizeStyle({outline:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign,backgroundColor:c.value!==void 0&&p.value!==void 0&&o===c.value&&p.value===n?`${a.color}33`:"",borderRadius:c.value!==void 0&&p.value!==void 0&&o===c.value&&p.value===n?"3px":""}),"data-cell":m.value[o],class:"vue-ui-data-table__tbody__td",onPointerenter:i=>{p.value=n,c.value=o}},e.toDisplayString([null,void 0].includes(a.values[o])?"-":e.unref(u.applyDataLabel)(t.value.formatter,Number(a.values[o]),e.unref(u.dataLabel)({p:t.value.prefix,v:Number(a.values[o]),s:t.value.suffix,r:t.value.roundingValues}),{datapoint:a,seriesIndex:n,datapointIndex:o})),45,ae))),256)),t.value.showTotal?(e.openBlock(),e.createElementBlock("td",{key:0,dir:"auto",role:"cell",style:e.normalizeStyle({outline:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),"data-cell":t.value.translations.total,class:"vue-ui-data-table__tbody__td"},e.toDisplayString(e.unref(u.applyDataLabel)(t.value.formatter,a.sum,e.unref(u.dataLabel)({p:t.value.prefix,v:a.sum,s:t.value.suffix,r:t.value.roundingTotal}),{datapoint:a.sum,seriesIndex:n})),13,oe)):e.createCommentVNode("",!0),t.value.showAverage?(e.openBlock(),e.createElementBlock("td",{key:1,dir:"auto",role:"cell",style:e.normalizeStyle({outline:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),"data-cell":t.value.translations.average,class:"vue-ui-data-table__tbody__td"},e.toDisplayString(e.unref(u.applyDataLabel)(t.value.formatter,a.average,e.unref(u.dataLabel)({p:t.value.prefix,v:a.average,s:t.value.suffix,r:t.value.roundingAverage}),{datapoint:a.average,seriesIndex:n})),13,ne)):e.createCommentVNode("",!0),t.value.showMedian?(e.openBlock(),e.createElementBlock("td",{key:2,dir:"auto",role:"cell",style:e.normalizeStyle({outline:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),"data-cell":t.value.translations.median,class:"vue-ui-data-table__tbody__td"},e.toDisplayString(e.unref(u.applyDataLabel)(t.value.formatter,a.median,e.unref(u.dataLabel)({p:t.value.prefix,v:a.median,s:t.value.suffix,r:t.value.roundingMedian}),{datapoint:a.median,seriesIndex:n})),13,re)):e.createCommentVNode("",!0),t.value.showSparklines?(e.openBlock(),e.createElementBlock("td",{key:3,role:"cell","data-cell":t.value.translations.chart,style:e.normalizeStyle({outline:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),class:"vue-ui-data-table__tbody__td sticky-col"},[(e.openBlock(),e.createBlock(J.default,{key:`sparkline_${n}_${b.value}`,onHoverIndex:({index:r})=>H({dataIndex:r,serieIndex:n}),dataset:a.sparklineDataset,showInfo:!1,selectedIndex:c.value,config:{type:t.value.sparkline.type,style:{backgroundColor:t.value.tbody.backgroundColor,animation:{show:t.value.sparkline.animation.show&&!e.unref(w)&&!e.unref(z),animationFrames:t.value.sparkline.animation.animationFrames},line:{color:a.color,smooth:t.value.sparkline.smooth,strokeWidth:t.value.sparkline.strokeWidth},bar:{color:a.color},area:{color:a.color,opacity:t.value.sparkline.showArea?16:0,useGradient:t.value.sparkline.useGradient},verticalIndicator:{color:a.color},plot:{radius:9,stroke:t.value.tbody.backgroundColor,strokeWidth:3}}}},null,8,["onHoverIndex","dataset","selectedIndex","config"]))],12,ue)):e.createCommentVNode("",!0)],6))),256))])],4)],32)],10,Y))}},ie=Q._export_sfc(se,[["__scopeId","data-v-7094f9b2"]]);exports.default=ie;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-BTgtr0F8.cjs"),$=require("./useNestedProp-CisbRRo_.cjs"),J=require("./vue-ui-sparkline-CDowaDRS.cjs"),K=require("./BaseIcon-DB7Apwv_.cjs"),D=require("./usePrinter-DzTaA1eh.cjs"),Q=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Y=["id"],Z={style:{"z-index":"1","padding-right":"24px"}},j=["onClick"],ee={style:{display:"flex","flex-direction":"row",gap:"3px","align-items":"center"}},te=["data-cell"],le={dir:"auto",style:{display:"flex","flex-direction":"row","align-items":"center",gap:"6px"}},ae=["data-cell","onPointerenter"],oe=["data-cell"],ne=["data-cell"],re=["data-cell"],ue=["data-cell"],se={__name:"vue-ui-table-sparkline",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(F,{expose:O}){const d=F;e.useCssVars(l=>({"470f7d5c":l.tdo}));const{vue_ui_table_sparkline:W}=u.useConfig(),h=e.ref(u.createUid()),S=e.ref(0),b=e.ref(0),t=e.computed({get:()=>C(),set:l=>l});function C(){const l=$.useNestedProp({userConfig:d.config,defaultConfig:W});return l.theme?{...$.useNestedProp({userConfig:u.themes.vue_ui_table_sparkline[l.theme]||d.config,defaultConfig:l}),customPalette:u.themePalettes[l.theme]||u.palette}:l}e.watch(()=>d.config,l=>{t.value=C(),A(),b.value+=1},{deep:!0}),e.watch(()=>d.dataset,l=>{f.value=v.value,b.value+=1},{deep:!0});const{isPrinting:w,isImaging:z,generatePdf:I,generateImage:N}=D.usePrinter({elementId:`table_${h.value}`,fileName:t.value.title.text||"vue-ui-table-sparkline"}),L=e.computed(()=>u.convertCustomPalette(t.value.customPalette)),g=e.ref(null),B=e.ref(!1),T=e.computed(()=>t.value.responsiveBreakpoint);e.onMounted(()=>{A()});function A(){u.objectIsEmpty(d.dataset)&&u.error({componentName:"VueUiTableSparkline",type:"dataset"});const l=new ResizeObserver(s=>{s.forEach(a=>{B.value=a.contentRect.width<T.value})});g.value&&l.observe(g.value)}const E=e.computed(()=>(d.dataset.forEach((l,s)=>{u.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(a=>{u.error({componentName:"VueUiTableSparkline",type:"datasetSerieAttribute",property:a,index:s})})}),d.dataset.map((l,s)=>{const a=(l.values||[]).map(r=>isNaN(r)?0:r??0),n=a.reduce((r,o)=>r+o,0);return{...l,values:l.values||[],color:u.convertColorToHex(l.color)||L.value[s]||u.palette[s]||u.palette[s%u.palette.length],sum:n,average:n/a.length,median:u.calcMedian(a),sparklineDataset:a.map((r,o)=>({period:t.value.colNames[o]||`col ${o}`,value:r||0}))}})));function M(l){const a=(l[0].values||[]).map((r,o)=>l.map(i=>i.values[o]||[])).map(r=>r.map((o,i)=>[o,i]).sort((o,i)=>i[0]-o[0]).map(o=>o[1]));return l.map((r,o)=>({...r,values:r.values||[],orders:a[o]}))}const v=e.computed(()=>M(E.value)),f=e.ref(v.value),G=e.computed(()=>Math.max(...f.value.map(l=>(l.values||[]).length))),y=e.ref(void 0),k=e.ref(!1),_=e.ref(void 0),x=e.ref(-1);function q(){k.value=!1,_.value=void 0,x.value=-1,f.value=v.value}function R(l){k.value=!0,_.value=l;const s=v.value.map(o=>o.values[l]||[]),a=y.value===l?1:-1;x.value=a,l===y.value?y.value=void 0:y.value=l;const r=s.map((o,i)=>[i,o]).sort((o,i)=>a*(i[1]-o[1])).map(o=>o[0]).map(o=>v.value[o]);f.value=r,b.value+=1}const U=e.computed(()=>Math.max(...d.dataset.map(l=>(l.values||[]).length))),m=e.computed(()=>{let l=t.value.colNames;if(!l.length)for(let a=0;a<U.value;a+=1)l.push(`col ${a+1}`);t.value.showTotal&&(l=[...l,t.value.translations.total]);let s;return t.value.showAverage&&t.value.showMedian?s=[...l,t.value.translations.average,t.value.translations.median]:t.value.showAverage&&!t.value.showMedian?s=[...l,t.value.translations.average]:!t.value.showAverage&&t.value.showMedian?s=[...l,t.value.translations.median]:s=l,t.value.showSparklines?[...s,t.value.translations.chart]:s}),c=e.ref(void 0),p=e.ref(void 0);function H({dataIndex:l,serieIndex:s}){c.value=l,p.value=s}const V=e.ref(!1);function X(l){V.value=l,S.value+=1}function P(){e.nextTick(()=>{const l=[t.value.translations.serie].concat(m.value),s=E.value.map((r,o)=>[[r.name],r.values,[r.sum],[r.average],[r.median]]),a=[l].concat(s),n=u.createCsvContent(a);u.downloadCsv({csvContent:n,title:t.value.title.text||"vue-ui-table-sparkline"})})}return O({generatePdf:I,generateImage:N,generateCsv:P,restoreOrder:q}),(l,s)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tableContainer",ref:g,class:e.normalizeClass({"vue-ui-responsive":B.value}),style:{overflow:"hidden"},id:`table_${h.value}`},[e.createElementVNode("div",{style:{overflow:"auto"},onPointerleave:s[0]||(s[0]=a=>{p.value=void 0,c.value=void 0})},[e.createElementVNode("table",{class:"vue-ui-data-table",style:e.normalizeStyle({fontFamily:t.value.fontFamily,position:"relative"})},[t.value.title.text?(e.openBlock(),e.createElementBlock("caption",{key:0,style:e.normalizeStyle({backgroundColor:t.value.title.backgroundColor})},[e.createElementVNode("div",{style:e.normalizeStyle({fontSize:`${t.value.title.fontSize}px`,fontWeight:t.value.title.bold?"bold":"normal",color:t.value.title.color,textAlign:t.value.title.textAlign})},e.toDisplayString(t.value.title.text),5),t.value.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle({fontSize:`${t.value.title.subtitle.fontSize}px`,fontWeight:t.value.title.subtitle.bold?"bold":"normal",color:t.value.title.subtitle.color,textAlign:t.value.title.textAlign})},e.toDisplayString(t.value.title.subtitle.text),5)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),e.createElementVNode("thead",Z,[e.createElementVNode("tr",{role:"row",class:"vue-ui-data-table__thead-row",style:e.normalizeStyle({backgroundColor:t.value.thead.backgroundColor,color:t.value.thead.color})},[e.createElementVNode("th",{role:"cell",style:e.normalizeStyle({backgroundColor:t.value.thead.backgroundColor,outline:t.value.thead.outline,textAlign:t.value.thead.textAlign,fontWeight:t.value.thead.bold?"bold":"normal"}),class:"sticky-col-first"},e.toDisplayString(t.value.translations.serie),5),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(a,n)=>(e.openBlock(),e.createElementBlock("th",{role:"cell",style:e.normalizeStyle({background:t.value.thead.backgroundColor,outline:t.value.thead.outline,textAlign:t.value.thead.textAlign,fontWeight:t.value.thead.bold?"bold":"normal",minWidth:n===m.value.length-1?"150px":"",cursor:v.value[0].values[n]!==void 0?"pointer":"default"}),onClick:()=>R(n),class:e.normalizeClass({"sticky-col":n===m.value.length-1&&t.value.showSparklines})},[e.createElementVNode("div",ee,[e.createElementVNode("span",null,e.toDisplayString(a),1),k.value&&n===_.value&&v.value[0].values[n]!==void 0?(e.openBlock(),e.createBlock(K.default,{key:0,size:18,name:x.value===1?"sort":"sortReverse",stroke:t.value.thead.color},null,8,["name","stroke"])):e.createCommentVNode("",!0)]),t.value.userOptions.show&&n===m.value.length-1?(e.openBlock(),e.createBlock(D.UserOptions,{ref_for:!0,ref:"details",key:`user_option_${S.value}`,backgroundColor:t.value.thead.backgroundColor,color:t.value.thead.color,isPrinting:e.unref(w),isImaging:e.unref(z),uid:h.value,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:V.value,titles:{...t.value.userOptions.buttonTitles},chartElement:g.value,onToggleFullscreen:X,onGeneratePdf:e.unref(I),onGenerateImage:e.unref(N),onGenerateCsv:P},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.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:r,isFullscreen:o})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:r,isFullscreen:o})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasFullscreen","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0)],14,j))),256))],4)]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(a,n)=>(e.openBlock(),e.createElementBlock("tr",{role:"row",style:e.normalizeStyle({backgroundColor:t.value.tbody.backgroundColor,color:t.value.tbody.color}),class:e.normalizeClass({"vue-ui-data-table__tbody__row":!0,"vue-ui-data-table__tbody__row-even":n%2===0,"vue-ui-data-table__tbody__row-odd":n%2!==0})},[e.createElementVNode("td",{role:"cell",style:e.normalizeStyle({backgroundColor:t.value.tbody.backgroundColor,outline:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),"data-cell":t.value.translations.serie,class:"vue-ui-data-table__tbody__td sticky-col-first"},[e.createElementVNode("div",le,[e.createElementVNode("span",{style:e.normalizeStyle({color:a.color})},"⬤",4),e.createElementVNode("span",null,e.toDisplayString(a.name??"-"),1)])],12,te),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(G.value,(r,o)=>(e.openBlock(),e.createElementBlock("td",{dir:"auto",role:"cell",style:e.normalizeStyle({outline:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign,backgroundColor:c.value!==void 0&&p.value!==void 0&&o===c.value&&p.value===n?`${a.color}33`:"",borderRadius:c.value!==void 0&&p.value!==void 0&&o===c.value&&p.value===n?"3px":""}),"data-cell":m.value[o],class:"vue-ui-data-table__tbody__td",onPointerenter:i=>{p.value=n,c.value=o}},e.toDisplayString([null,void 0].includes(a.values[o])?"-":e.unref(u.applyDataLabel)(t.value.formatter,Number(a.values[o]),e.unref(u.dataLabel)({p:t.value.prefix,v:Number(a.values[o]),s:t.value.suffix,r:t.value.roundingValues}),{datapoint:a,seriesIndex:n,datapointIndex:o})),45,ae))),256)),t.value.showTotal?(e.openBlock(),e.createElementBlock("td",{key:0,dir:"auto",role:"cell",style:e.normalizeStyle({outline:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),"data-cell":t.value.translations.total,class:"vue-ui-data-table__tbody__td"},e.toDisplayString(e.unref(u.applyDataLabel)(t.value.formatter,a.sum,e.unref(u.dataLabel)({p:t.value.prefix,v:a.sum,s:t.value.suffix,r:t.value.roundingTotal}),{datapoint:a.sum,seriesIndex:n})),13,oe)):e.createCommentVNode("",!0),t.value.showAverage?(e.openBlock(),e.createElementBlock("td",{key:1,dir:"auto",role:"cell",style:e.normalizeStyle({outline:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),"data-cell":t.value.translations.average,class:"vue-ui-data-table__tbody__td"},e.toDisplayString(e.unref(u.applyDataLabel)(t.value.formatter,a.average,e.unref(u.dataLabel)({p:t.value.prefix,v:a.average,s:t.value.suffix,r:t.value.roundingAverage}),{datapoint:a.average,seriesIndex:n})),13,ne)):e.createCommentVNode("",!0),t.value.showMedian?(e.openBlock(),e.createElementBlock("td",{key:2,dir:"auto",role:"cell",style:e.normalizeStyle({outline:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),"data-cell":t.value.translations.median,class:"vue-ui-data-table__tbody__td"},e.toDisplayString(e.unref(u.applyDataLabel)(t.value.formatter,a.median,e.unref(u.dataLabel)({p:t.value.prefix,v:a.median,s:t.value.suffix,r:t.value.roundingMedian}),{datapoint:a.median,seriesIndex:n})),13,re)):e.createCommentVNode("",!0),t.value.showSparklines?(e.openBlock(),e.createElementBlock("td",{key:3,role:"cell","data-cell":t.value.translations.chart,style:e.normalizeStyle({outline:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),class:"vue-ui-data-table__tbody__td sticky-col"},[(e.openBlock(),e.createBlock(J.default,{key:`sparkline_${n}_${b.value}`,onHoverIndex:({index:r})=>H({dataIndex:r,serieIndex:n}),dataset:a.sparklineDataset,showInfo:!1,selectedIndex:c.value,config:{type:t.value.sparkline.type,style:{backgroundColor:t.value.tbody.backgroundColor,animation:{show:t.value.sparkline.animation.show&&!e.unref(w)&&!e.unref(z),animationFrames:t.value.sparkline.animation.animationFrames},line:{color:a.color,smooth:t.value.sparkline.smooth,strokeWidth:t.value.sparkline.strokeWidth},bar:{color:a.color},area:{color:a.color,opacity:t.value.sparkline.showArea?16:0,useGradient:t.value.sparkline.useGradient},verticalIndicator:{color:a.color},plot:{radius:9,stroke:t.value.tbody.backgroundColor,strokeWidth:3}}}},null,8,["onHoverIndex","dataset","selectedIndex","config"]))],12,ue)):e.createCommentVNode("",!0)],6))),256))])],4)],32)],10,Y))}},ie=Q._export_sfc(se,[["__scopeId","data-v-7094f9b2"]]);exports.default=ie;
@@ -1,9 +1,9 @@
1
1
  import { useCssVars as de, computed as c, onMounted as ve, ref as g, watch as ye, openBlock as o, createElementBlock as n, normalizeClass as $, normalizeStyle as H, createBlock as U, createCommentVNode as h, unref as v, createSlots as fe, withCtx as q, renderSlot as x, normalizeProps as X, guardReactiveProps as R, createElementVNode as d, Fragment as F, renderList as J, toDisplayString as ge } from "vue";
2
- import { u as me, o as pe, e as K, g as ke, c as xe, t as _e, a as be, p as _, b as we, s as f, d as P, X as Ce, w as $e, i as Fe, f as Pe } from "./index-Cm4Iry5c.js";
3
- import { _ as Ie } from "./Title-C26I_HC3.js";
4
- import { u as Ye, U as Me } from "./usePrinter-B8RnF8_q.js";
5
- import Ne from "./vue-ui-skeleton-C1oUnz7R.js";
6
- import { u as Q } from "./useNestedProp-CurQIHTa.js";
2
+ import { u as me, o as pe, e as K, g as ke, c as xe, t as _e, a as be, p as _, b as we, s as f, d as P, X as Ce, w as $e, i as Fe, f as Pe } from "./index-CaV1s-yZ.js";
3
+ import { _ as Ie } from "./Title-gUz6GDA3.js";
4
+ import { u as Ye, U as Me } from "./usePrinter-rvJyT65A.js";
5
+ import Ne from "./vue-ui-skeleton-CvFX_ExX.js";
6
+ import { u as Q } from "./useNestedProp-tWCzZrLx.js";
7
7
  import { _ as Oe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
8
8
  const Se = ["id"], Ue = {
9
9
  key: 0,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-DYUBiaGS.cjs"),X=require("./Title-XBiDFYKD.cjs"),q=require("./usePrinter-ZlHxdaEz.cjs"),J=require("./vue-ui-skeleton-ClpTCY1x.cjs"),T=require("./useNestedProp-w7AMWWmz.cjs"),K=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Q=["id"],Z={key:0,style:"width:100%"},ee=["xmlns","viewBox"],te={id:"vueUiPill",clipPathUnits:"objectBoundingBox"},oe=["fill"],le=["id"],re=["stop-color"],ae=["stop-color"],se=["stop-color"],ne={"clip-path":"url(#vueUiPill)"},ue=["x","y","height","width"],ce=["x","y","height","width","fill"],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=["x1","x2","y1","y2","stroke-width","stroke"],pe=["x1","x2","y1","y2","stroke-width","stroke"],fe=["x1","x2","y1","y2","stroke-width","stroke"],ge=["x","y","height","width"],ke=["y","x","fill","font-size","font-weight"],xe={key:3,class:"vue-data-ui-watermark"},be={__name:"vue-ui-thermometer",props:{dataset:{type:Object,default(){return{}}},config:{type:Object,default(){return{}}}},setup(m,{expose:Y}){const s=m;e.useCssVars(l=>({"0a35d02c":G.value,"2925bde2":U.value,"636d634f":L.value}));const{vue_ui_thermometer:M}=r.useConfig(),f=e.computed(()=>!!s.dataset&&Object.keys(s.dataset).length);e.onMounted(()=>{w()});function w(){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()),C=e.ref(null),N=e.ref(0),B=e.ref(0),t=e.computed({get:()=>E(),set:l=>l});function E(){const l=T.useNestedProp({userConfig:s.config,defaultConfig:M});return l.theme?{...T.useNestedProp({userConfig:r.themes.vue_ui_thermometer[l.theme]||s.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}e.watch(()=>s.config,l=>{t.value=E(),w(),B.value+=1},{deep:!0});const{isPrinting:V,isImaging:$,generatePdf:P,generateImage:F}=q.usePrinter({elementId:`thermometer__${d.value}`,fileName:t.value.style.title.text||"vue-ui-thermometer"}),y=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),O=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=I(l),_=I(n);for(let v=0;v<o;v++){const j=g(b.red,_.red,v,o),A=g(b.green,_.green,v,o),D=g(b.blue,_.blue,v,o),R=`#${k(j)}${k(A)}${k(D)}`;u.push(R)}return u}function I(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=O.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}}),z=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)}),L=e.computed(()=>`${x.value}px`),U=e.computed(()=>`${a.value.height-t.value.style.chart.padding.bottom-c.value.top}px`),G=e.computed(()=>`${t.value.style.chart.animation.speedMs}ms`),W=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)}),S=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:W.value[n],height:o/i.value}),n+=1;return l}),h=e.ref(!1);function H(l){h.value=l,N.value+=1}return Y({generatePdf:P,generateImage:F}),(l,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"thermoChart",ref:C,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",Z,[(e.openBlock(),e.createBlock(X._sfc_main,{key:`title_${B.value}`,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(q.UserOptions,{ref:"details",key:`user_options_${N.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref($),isPrinting:e.unref(V),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:C.value,onToggleFullscreen:H,onGeneratePdf:e.unref(P),onGenerateImage:e.unref(F)},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",te,[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,oe)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.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,re),e.createElementVNode("stop",{offset:"50%","stop-color":`${o.color}${e.unref(r.opacity)[100-t.value.style.chart.graduations.gradient.intensity]}`},null,8,ae),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,se)],8,le))),256))]),e.createElementVNode("g",ne,[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,ue),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.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,ce),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,ie)):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,de)):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,he)):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,ve)):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,me)):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,ye)):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,pe)):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,fe)):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,ge)]),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,ke),e.renderSlot(l.$slots,"svg",{svg:z.value},void 0,!0)],14,ee)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",xe,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(V)||e.unref($)})),void 0,!0)])):e.createCommentVNode("",!0),f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(J.default,{key:4,config:{type:"thermometer",style:{backgroundColor:t.value.style.chart.backgroundColor,thermometer:{color:"#CCCCCC"}}}},null,8,["config"]))],14,Q))}},_e=K._export_sfc(be,[["__scopeId","data-v-900932c6"]]);exports.default=_e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-BTgtr0F8.cjs"),X=require("./Title-3EduyW4p.cjs"),q=require("./usePrinter-DzTaA1eh.cjs"),J=require("./vue-ui-skeleton-CMQzFTs9.cjs"),T=require("./useNestedProp-CisbRRo_.cjs"),K=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Q=["id"],Z={key:0,style:"width:100%"},ee=["xmlns","viewBox"],te={id:"vueUiPill",clipPathUnits:"objectBoundingBox"},oe=["fill"],le=["id"],re=["stop-color"],ae=["stop-color"],se=["stop-color"],ne={"clip-path":"url(#vueUiPill)"},ue=["x","y","height","width"],ce=["x","y","height","width","fill"],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=["x1","x2","y1","y2","stroke-width","stroke"],pe=["x1","x2","y1","y2","stroke-width","stroke"],fe=["x1","x2","y1","y2","stroke-width","stroke"],ge=["x","y","height","width"],ke=["y","x","fill","font-size","font-weight"],xe={key:3,class:"vue-data-ui-watermark"},be={__name:"vue-ui-thermometer",props:{dataset:{type:Object,default(){return{}}},config:{type:Object,default(){return{}}}},setup(m,{expose:Y}){const s=m;e.useCssVars(l=>({"0a35d02c":G.value,"2925bde2":U.value,"636d634f":L.value}));const{vue_ui_thermometer:M}=r.useConfig(),f=e.computed(()=>!!s.dataset&&Object.keys(s.dataset).length);e.onMounted(()=>{w()});function w(){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()),C=e.ref(null),N=e.ref(0),B=e.ref(0),t=e.computed({get:()=>E(),set:l=>l});function E(){const l=T.useNestedProp({userConfig:s.config,defaultConfig:M});return l.theme?{...T.useNestedProp({userConfig:r.themes.vue_ui_thermometer[l.theme]||s.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}e.watch(()=>s.config,l=>{t.value=E(),w(),B.value+=1},{deep:!0});const{isPrinting:V,isImaging:$,generatePdf:P,generateImage:F}=q.usePrinter({elementId:`thermometer__${d.value}`,fileName:t.value.style.title.text||"vue-ui-thermometer"}),y=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),O=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=I(l),_=I(n);for(let v=0;v<o;v++){const j=g(b.red,_.red,v,o),A=g(b.green,_.green,v,o),D=g(b.blue,_.blue,v,o),R=`#${k(j)}${k(A)}${k(D)}`;u.push(R)}return u}function I(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=O.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}}),z=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)}),L=e.computed(()=>`${x.value}px`),U=e.computed(()=>`${a.value.height-t.value.style.chart.padding.bottom-c.value.top}px`),G=e.computed(()=>`${t.value.style.chart.animation.speedMs}ms`),W=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)}),S=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:W.value[n],height:o/i.value}),n+=1;return l}),h=e.ref(!1);function H(l){h.value=l,N.value+=1}return Y({generatePdf:P,generateImage:F}),(l,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"thermoChart",ref:C,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",Z,[(e.openBlock(),e.createBlock(X._sfc_main,{key:`title_${B.value}`,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(q.UserOptions,{ref:"details",key:`user_options_${N.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref($),isPrinting:e.unref(V),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:C.value,onToggleFullscreen:H,onGeneratePdf:e.unref(P),onGenerateImage:e.unref(F)},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",te,[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,oe)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.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,re),e.createElementVNode("stop",{offset:"50%","stop-color":`${o.color}${e.unref(r.opacity)[100-t.value.style.chart.graduations.gradient.intensity]}`},null,8,ae),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,se)],8,le))),256))]),e.createElementVNode("g",ne,[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,ue),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.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,ce),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,ie)):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,de)):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,he)):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,ve)):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,me)):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,ye)):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,pe)):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,fe)):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,ge)]),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,ke),e.renderSlot(l.$slots,"svg",{svg:z.value},void 0,!0)],14,ee)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",xe,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(V)||e.unref($)})),void 0,!0)])):e.createCommentVNode("",!0),f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(J.default,{key:4,config:{type:"thermometer",style:{backgroundColor:t.value.style.chart.backgroundColor,thermometer:{color:"#CCCCCC"}}}},null,8,["config"]))],14,Q))}},_e=K._export_sfc(be,[["__scopeId","data-v-900932c6"]]);exports.default=_e;
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),L=require("./useNestedProp-w7AMWWmz.cjs"),g=require("./index-DYUBiaGS.cjs"),$=require("./useResponsive-B3TrDDIG.cjs"),B=require("./BaseIcon--PMhZ3f-.cjs"),j=require("./Title-XBiDFYKD.cjs"),O=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");class q{constructor(P,v,y,E=!0,b=!0){this.interval=v,this.elapsed=0,this.isPaused=!1;const S=`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),L=require("./useNestedProp-CisbRRo_.cjs"),g=require("./index-BTgtr0F8.cjs"),$=require("./useResponsive-B3TrDDIG.cjs"),B=require("./BaseIcon-DB7Apwv_.cjs"),j=require("./Title-3EduyW4p.cjs"),O=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");class q{constructor(P,v,y,E=!0,b=!0){this.interval=v,this.elapsed=0,this.isPaused=!1;const S=`
2
2
  let interval;
3
3
  let elapsed = 0;
4
4
  let paused = false;
@@ -1,9 +1,9 @@
1
1
  import { ref as n, onMounted as Q, onBeforeUnmount as Y, computed as z, watch as Z, openBlock as l, createElementBlock as r, normalizeStyle as f, createBlock as ee, createCommentVNode as v, unref as te, createElementVNode as M, mergeProps as V, renderSlot as O, normalizeProps as U, guardReactiveProps as E, toDisplayString as ae, createVNode as $ } from "vue";
2
- import { u as se } from "./useNestedProp-CurQIHTa.js";
3
- import { u as le, c as oe, X as re, D as W } from "./index-Cm4Iry5c.js";
2
+ import { u as se } from "./useNestedProp-tWCzZrLx.js";
3
+ import { u as le, c as oe, X as re, D as W } from "./index-CaV1s-yZ.js";
4
4
  import { t as ue, u as ie } from "./useResponsive-NZB-WLRF.js";
5
- import P from "./BaseIcon-BAOfPaXs.js";
6
- import { _ as ne } from "./Title-C26I_HC3.js";
5
+ import P from "./BaseIcon-rwm-10Hu.js";
6
+ import { _ as ne } from "./Title-gUz6GDA3.js";
7
7
  import { _ as ce } from "./_plugin-vue_export-helper-CHgC5LLL.js";
8
8
  class de {
9
9
  constructor(A, k, C, H = !0, T = !0) {
@@ -1,9 +1,9 @@
1
1
  import { computed as h, ref as p, watch as R, onMounted as le, openBlock as n, createElementBlock as c, normalizeClass as O, normalizeStyle as S, createBlock as A, createCommentVNode as b, unref as d, createSlots as oe, withCtx as N, renderSlot as w, normalizeProps as Y, guardReactiveProps as q, Fragment as J, renderList as K, toDisplayString as re } from "vue";
2
- import { u as Q } from "./useNestedProp-CurQIHTa.js";
3
- import { u as se, c as ne, t as ue, s as ie, o as ce, e as ve, v as W, X as he, i as de, f as ge } from "./index-Cm4Iry5c.js";
4
- import { _ as me } from "./Title-C26I_HC3.js";
5
- import { u as ye, U as fe } from "./usePrinter-B8RnF8_q.js";
6
- import pe from "./vue-ui-skeleton-C1oUnz7R.js";
2
+ import { u as Q } from "./useNestedProp-tWCzZrLx.js";
3
+ import { u as se, c as ne, t as ue, s as ie, o as ce, e as ve, v as W, X as he, i as de, f as ge } from "./index-CaV1s-yZ.js";
4
+ import { _ as me } from "./Title-gUz6GDA3.js";
5
+ import { u as ye, U as fe } from "./usePrinter-rvJyT65A.js";
6
+ import pe from "./vue-ui-skeleton-CvFX_ExX.js";
7
7
  import { _ as ke } from "./_plugin-vue_export-helper-CHgC5LLL.js";
8
8
  const be = ["id"], _e = ["xmlns", "viewBox"], Ce = { key: 0 }, $e = ["d", "stroke-width", "stroke"], xe = { key: 1 }, we = ["x1", "y1", "x2", "y2", "stroke-width", "stroke"], Pe = ["x", "y", "font-size", "fill", "font-weight", "text-anchor"], Ie = {
9
9
  key: 3,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),q=require("./useNestedProp-w7AMWWmz.cjs"),c=require("./index-DYUBiaGS.cjs"),H=require("./Title-XBiDFYKD.cjs"),L=require("./usePrinter-ZlHxdaEz.cjs"),V=require("./vue-ui-skeleton-ClpTCY1x.cjs"),D=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),X=["id"],R=["xmlns","viewBox"],Y={key:0},J=["d","stroke-width","stroke"],K={key:1},Q=["x1","y1","x2","y2","stroke-width","stroke"],W=["x","y","font-size","fill","font-weight","text-anchor"],Z={key:3,class:"vue-data-ui-watermark"},ee={__name:"vue-ui-tiremarks",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(M,{expose:G}){const v=M,{vue_ui_tiremarks:T}=c.useConfig(),x=e.computed(()=>!!v.dataset&&Object.keys(v.dataset).length),w=e.ref(c.createUid()),$=e.ref(null),P=e.ref(0),B=e.ref(0),t=e.computed({get:()=>z(),set:a=>a});function z(){const a=q.useNestedProp({userConfig:v.config,defaultConfig:T});return a.theme?{...q.useNestedProp({userConfig:c.themes.vue_ui_tiremarks[a.theme]||v.config,defaultConfig:a})}:a}e.watch(()=>v.config,a=>{t.value=z(),O(),B.value+=1},{deep:!0});const{isPrinting:S,isImaging:I,generatePdf:F,generateImage:N}=L.usePrinter({elementId:w.value,fileName:t.value.style.chart.title.text||"vue-ui-tiremarks"}),n=e.ref(t.value.style.chart.animation.use?0:c.checkNaN(v.dataset.percentage));e.watch(()=>v.dataset,a=>{t.value.style.chart.animation.use?E(a.percentage):n.value=a.percentage||0},{deep:!0}),e.onMounted(()=>{O()});function E(a){let u=t.value.style.chart.animation.speed;const l=Math.abs(a-n.value)/(u*120);function r(){n.value<a?n.value=Math.min(n.value+l,a):n.value>a&&(n.value=Math.max(n.value-l,a)),n.value!==a&&requestAnimationFrame(r)}r()}function O(){c.objectIsEmpty(v.dataset)&&c.error({componentName:"VueUiTiremarks",type:"dataset"}),E(v.dataset.percentage||0)}const f=e.computed(()=>t.value.style.chart.layout.display==="vertical"),s=e.computed(()=>{const a={top:48,left:64,right:64,bottom:48};return f.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(s.value).reduce((a,u)=>a+u,0)),o=e.computed(()=>({height:f.value?312:56,width:f.value?56:312})),j=e.ref(100);e.computed(()=>v.dataset.percentage/j.value);const i=e.computed(()=>f.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}),A=e.computed(()=>{const a=[];for(let l=0;l<100;l+=1){const r=t.value.style.chart.layout.ticks.gradient.show?c.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(f.value){const y=t.value.style.chart.layout.crescendo?(100-l)*(o.value.width-s.value.left-s.value.right)/100/3:0,d=s.value.left+4+y,h=o.value.width-s.value.right-4-y,m=o.value.height-s.value.bottom-l*i.value.mark-l*i.value.space-i.value.mark,p=o.value.height-s.value.bottom-l*i.value.mark-l*i.value.space-i.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:p,curve:`M ${d} ${m} C ${d+k} ${m-b}, ${h-k} ${p-b}, ${h} ${p}`,color:r})}else{const y=t.value.style.chart.layout.crescendo?(100-l)*(o.value.height-s.value.top-s.value.bottom)/100/3:0,d=s.value.left+l*i.value.mark+l*i.value.space-i.value.mark,h=d,m=s.value.top+4+y,p=o.value.height-s.value.bottom-4-y,k=t.value.style.chart.layout.curveAngleY*((1+l)/100),b=(p-m)/t.value.style.chart.layout.curveAngleX;a.push({x1:d,x2:h,y1:m,y2:p,curve:`M ${d} ${m} C ${d+k} ${m+b}, ${h+k} ${p-b}, ${h} ${p}`,color:r})}}return a}),g=e.computed(()=>{let a,u,l;const r=t.value.style.chart.percentage.fontSize/3;return f.value?t.value.style.chart.percentage.verticalPosition==="top"?(a=o.value.width/2,u=s.value.top/2,l="middle"):t.value.style.chart.percentage.verticalPosition==="bottom"&&(a=o.value.width/2,u=o.value.height-s.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-s.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 U(a){_.value=a,P.value+=1}return G({generatePdf:F,generateImage:N}),(a,u)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tiremarksChart",ref:$,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:w.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.openBlock(),e.createBlock(H._sfc_main,{key:`title_${B.value}`,config:{title:{cy:"wheel-title",...t.value.style.chart.title},subtitle:{cy:"wheel-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&x.value?(e.openBlock(),e.createBlock(L.UserOptions,{ref:"details",key:`user_options_${P.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(S),isImaging:e.unref(I),uid:w.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:$.value,onToggleFullscreen:U,onGeneratePdf:e.unref(F),onGenerateImage:e.unref(N)},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(c.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",Y,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(A.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{d:l.curve,"stroke-width":i.value.mark,stroke:n.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<=n.value})},null,10,J))),256))])):(e.openBlock(),e.createElementBlock("g",K,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(A.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{x1:l.x1,y1:l.y1,x2:l.x2,y2:l.y2,"stroke-width":i.value.mark,stroke:n.value>=r?l.color:t.value.style.chart.layout.inactiveColor,"stroke-linecap":"round"},null,8,Q))),256))])),t.value.style.chart.percentage.show?(e.openBlock(),e.createElementBlock("text",{key:2,x:g.value.x,y:g.value.y,"font-size":g.value.fontSize,fill:t.value.style.chart.layout.ticks.gradient.show&&t.value.style.chart.percentage.useGradientColor?e.unref(c.shiftHue)(t.value.style.chart.layout.activeColor,n.value/100*(t.value.style.chart.layout.ticks.gradient.shiftHueIntensity/100)):t.value.style.chart.percentage.color,"font-weight":g.value.bold?"bold":"normal","text-anchor":g.value.textAnchor},e.toDisplayString(e.unref(c.applyDataLabel)(t.value.style.chart.percentage.formatter,n.value,e.unref(c.dataLabel)({v:n.value,s:"%",r:t.value.style.chart.percentage.rounding}))),9,W)):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"svg",{svg:o.value},void 0,!0)],14,R)):e.createCommentVNode("",!0),a.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Z,[e.renderSlot(a.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(S)||e.unref(I)})),void 0,!0)])):e.createCommentVNode("",!0),x.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(V.default,{key:4,config:{type:"tiremarks",style:{backgroundColor:t.value.style.chart.backgroundColor,tiremarks:{color:"#CCCCCC"}}}},null,8,["config"]))],14,X))}},te=D._export_sfc(ee,[["__scopeId","data-v-be6232b0"]]);exports.default=te;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),q=require("./useNestedProp-CisbRRo_.cjs"),c=require("./index-BTgtr0F8.cjs"),H=require("./Title-3EduyW4p.cjs"),L=require("./usePrinter-DzTaA1eh.cjs"),V=require("./vue-ui-skeleton-CMQzFTs9.cjs"),D=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),X=["id"],R=["xmlns","viewBox"],Y={key:0},J=["d","stroke-width","stroke"],K={key:1},Q=["x1","y1","x2","y2","stroke-width","stroke"],W=["x","y","font-size","fill","font-weight","text-anchor"],Z={key:3,class:"vue-data-ui-watermark"},ee={__name:"vue-ui-tiremarks",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(M,{expose:G}){const v=M,{vue_ui_tiremarks:T}=c.useConfig(),x=e.computed(()=>!!v.dataset&&Object.keys(v.dataset).length),w=e.ref(c.createUid()),$=e.ref(null),P=e.ref(0),B=e.ref(0),t=e.computed({get:()=>z(),set:a=>a});function z(){const a=q.useNestedProp({userConfig:v.config,defaultConfig:T});return a.theme?{...q.useNestedProp({userConfig:c.themes.vue_ui_tiremarks[a.theme]||v.config,defaultConfig:a})}:a}e.watch(()=>v.config,a=>{t.value=z(),O(),B.value+=1},{deep:!0});const{isPrinting:S,isImaging:I,generatePdf:F,generateImage:N}=L.usePrinter({elementId:w.value,fileName:t.value.style.chart.title.text||"vue-ui-tiremarks"}),n=e.ref(t.value.style.chart.animation.use?0:c.checkNaN(v.dataset.percentage));e.watch(()=>v.dataset,a=>{t.value.style.chart.animation.use?E(a.percentage):n.value=a.percentage||0},{deep:!0}),e.onMounted(()=>{O()});function E(a){let u=t.value.style.chart.animation.speed;const l=Math.abs(a-n.value)/(u*120);function r(){n.value<a?n.value=Math.min(n.value+l,a):n.value>a&&(n.value=Math.max(n.value-l,a)),n.value!==a&&requestAnimationFrame(r)}r()}function O(){c.objectIsEmpty(v.dataset)&&c.error({componentName:"VueUiTiremarks",type:"dataset"}),E(v.dataset.percentage||0)}const f=e.computed(()=>t.value.style.chart.layout.display==="vertical"),s=e.computed(()=>{const a={top:48,left:64,right:64,bottom:48};return f.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(s.value).reduce((a,u)=>a+u,0)),o=e.computed(()=>({height:f.value?312:56,width:f.value?56:312})),j=e.ref(100);e.computed(()=>v.dataset.percentage/j.value);const i=e.computed(()=>f.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}),A=e.computed(()=>{const a=[];for(let l=0;l<100;l+=1){const r=t.value.style.chart.layout.ticks.gradient.show?c.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(f.value){const y=t.value.style.chart.layout.crescendo?(100-l)*(o.value.width-s.value.left-s.value.right)/100/3:0,d=s.value.left+4+y,h=o.value.width-s.value.right-4-y,m=o.value.height-s.value.bottom-l*i.value.mark-l*i.value.space-i.value.mark,p=o.value.height-s.value.bottom-l*i.value.mark-l*i.value.space-i.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:p,curve:`M ${d} ${m} C ${d+k} ${m-b}, ${h-k} ${p-b}, ${h} ${p}`,color:r})}else{const y=t.value.style.chart.layout.crescendo?(100-l)*(o.value.height-s.value.top-s.value.bottom)/100/3:0,d=s.value.left+l*i.value.mark+l*i.value.space-i.value.mark,h=d,m=s.value.top+4+y,p=o.value.height-s.value.bottom-4-y,k=t.value.style.chart.layout.curveAngleY*((1+l)/100),b=(p-m)/t.value.style.chart.layout.curveAngleX;a.push({x1:d,x2:h,y1:m,y2:p,curve:`M ${d} ${m} C ${d+k} ${m+b}, ${h+k} ${p-b}, ${h} ${p}`,color:r})}}return a}),g=e.computed(()=>{let a,u,l;const r=t.value.style.chart.percentage.fontSize/3;return f.value?t.value.style.chart.percentage.verticalPosition==="top"?(a=o.value.width/2,u=s.value.top/2,l="middle"):t.value.style.chart.percentage.verticalPosition==="bottom"&&(a=o.value.width/2,u=o.value.height-s.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-s.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 U(a){_.value=a,P.value+=1}return G({generatePdf:F,generateImage:N}),(a,u)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tiremarksChart",ref:$,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:w.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.openBlock(),e.createBlock(H._sfc_main,{key:`title_${B.value}`,config:{title:{cy:"wheel-title",...t.value.style.chart.title},subtitle:{cy:"wheel-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&x.value?(e.openBlock(),e.createBlock(L.UserOptions,{ref:"details",key:`user_options_${P.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(S),isImaging:e.unref(I),uid:w.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:$.value,onToggleFullscreen:U,onGeneratePdf:e.unref(F),onGenerateImage:e.unref(N)},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(c.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",Y,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(A.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{d:l.curve,"stroke-width":i.value.mark,stroke:n.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<=n.value})},null,10,J))),256))])):(e.openBlock(),e.createElementBlock("g",K,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(A.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{x1:l.x1,y1:l.y1,x2:l.x2,y2:l.y2,"stroke-width":i.value.mark,stroke:n.value>=r?l.color:t.value.style.chart.layout.inactiveColor,"stroke-linecap":"round"},null,8,Q))),256))])),t.value.style.chart.percentage.show?(e.openBlock(),e.createElementBlock("text",{key:2,x:g.value.x,y:g.value.y,"font-size":g.value.fontSize,fill:t.value.style.chart.layout.ticks.gradient.show&&t.value.style.chart.percentage.useGradientColor?e.unref(c.shiftHue)(t.value.style.chart.layout.activeColor,n.value/100*(t.value.style.chart.layout.ticks.gradient.shiftHueIntensity/100)):t.value.style.chart.percentage.color,"font-weight":g.value.bold?"bold":"normal","text-anchor":g.value.textAnchor},e.toDisplayString(e.unref(c.applyDataLabel)(t.value.style.chart.percentage.formatter,n.value,e.unref(c.dataLabel)({v:n.value,s:"%",r:t.value.style.chart.percentage.rounding}))),9,W)):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"svg",{svg:o.value},void 0,!0)],14,R)):e.createCommentVNode("",!0),a.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Z,[e.renderSlot(a.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(S)||e.unref(I)})),void 0,!0)])):e.createCommentVNode("",!0),x.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(V.default,{key:4,config:{type:"tiremarks",style:{backgroundColor:t.value.style.chart.backgroundColor,tiremarks:{color:"#CCCCCC"}}}},null,8,["config"]))],14,X))}},te=D._export_sfc(ee,[["__scopeId","data-v-be6232b0"]]);exports.default=te;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-DYUBiaGS.cjs"),Te=require("./Title-XBiDFYKD.cjs"),ce=require("./usePrinter-ZlHxdaEz.cjs"),Se=require("./Tooltip-DxtWkIt5.cjs"),Ne=require("./Legend-CtbPB0Bo.cjs"),Be=require("./vue-ui-skeleton-ClpTCY1x.cjs"),_e=require("./DataTable-DjQzrklZ.cjs"),ze=require("./vue-ui-accordion-1WxrfiCH.cjs"),de=require("./useResponsive-B3TrDDIG.cjs"),ve=require("./useNestedProp-w7AMWWmz.cjs"),Pe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");function he(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 pe(n){const{xOffset:d,yOffset:s,width:u,height:i}=n;return{x0:d,y0:s,x1:d+u,y1:s+i}}function Oe(n,d,s){if(n.length===0)return!0;{const u=n.concat(d),i=he(n,s),v=he(u,s);return i>=v}}function Ee(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 Ve(n,d){const s={...d,children:n};return ge(s)}function Le(n){return(n.x1-n.x0)*(n.y1-n.y0)}function fe(n,d){const{width:s,height:u,xOffset:i,yOffset:v}=G(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,B={x0:b,y0:w,x1:b+p,y1:x},$=Object.assign({},k,B);w=x,g.push($)}return g}else{for(let m=0;m<h;m+=1){const k=n[m],x=b+k.normalizedValue/C,B={x0:b,y0:w,x1:x,y1:w+C},$=Object.assign({},k,B);b=x,g.push($)}return g}}function Re(n){const d=G(n),s=d.width,u=d.height;return Math.min(s,u)}function Fe(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 G(n){const{x0:d,y0:s,x1:u,y1:i}=n;return{xOffset:d,yOffset:s,width:u-d,height:i-s}}function Ie(n,d,s,u){let i=n,v=d,h=s,f=u;for(;;){const p=i.length;if(p===0){const g=fe(v,h);return f.concat(g)}const C=Re(h),b=i[0],w=i.slice(1,p);if(Oe(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 $=0;$<g;$+=1)m+=v[$].normalizedValue;const k=De(h,m),x=fe(v,h),B=f.concat(x);i=i,v=[],h=k,f=B}}}function ge(n){if(typeof n.children>"u"||!n.children.length)return[n];{const d=Fe(n.children,Le(n)),s=Ie(d,[],n,[]),u=s.length,i=[];for(let h=0;h<u;h+=1)i.push(ge(s[h]));return Ee(i)}}function De(n,d){const{width:s,height:u,xOffset:i,yOffset:v}=G(n);if(s>=u){const h=d/u,f=s-h,p={xOffset:i+h,yOffset:v,width:f,height:u};return pe(p)}else{const h=d/s,f=u-h,p={xOffset:i,yOffset:v+h,width:s,height:f};return pe(p)}}const qe=n=>(e.pushScopeId("data-v-440c85e2"),n=n(),e.popScopeId(),n),Ae=["id"],He=["xmlns","viewBox"],Me={key:0},We=["id"],Ue=["stop-color"],Ge=["stop-color"],je=["x","y","height","width","fill","rx","stroke","stroke-width","onClick","onMouseenter"],Xe=["x","y","height","width"],Ye={style:{width:"100%",height:"100%"},class:"vue-ui-treemap-cell"},Ze=qe(()=>e.createElementVNode("br",null,null,-1)),Je={key:3,class:"vue-data-ui-watermark"},Ke=["onClick"],Qe={key:0},et={key:1},tt=["innerHTML"],lt={__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),B=e.ref(0),$=e.ref(0),j=e.ref(0),t=e.computed({get:()=>X(),set:l=>l});function X(){const l=ve.useNestedProp({userConfig:u.config,defaultConfig:i});return l.theme?{...ve.useNestedProp({userConfig:r.themes.vue_ui_treemap[l.theme]||u.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}e.watch(()=>u.config,l=>{t.value=X(),B.value+=1,$.value+=1,j.value+=1},{deep:!0});const{isPrinting:Y,isImaging:Z,generatePdf:J,generateImage:K}=ce.usePrinter({elementId:`treemap_${f.value}`,fileName:t.value.style.chart.title.text||"vue-ui-treemap"}),D=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),_=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),z=e.ref({height:t.value.style.chart.height,width:t.value.style.chart.width}),O=e.computed(()=>({bottom:z.value.height-t.value.style.chart.padding.bottom,height:z.value.height-t.value.style.chart.padding.top-t.value.style.chart.padding.bottom,left:t.value.style.chart.padding.left,right:z.value.width-t.value.style.chart.padding.right,top:t.value.style.chart.padding.top,vbHeight:z.value.height,vbWidth:z.value.width,width:z.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right}));function Q(l){l.forEach((a,o)=>{a.id=r.createUid(),a.color=r.convertColorToHex(a.color)||D.value[o]||r.palette[o]||r.palette[o%r.palette.length],a.children&&(a.children.forEach(c=>{c.parentId=a.id,c.color=a.color}),Q(a.children))})}const E=e.ref(u.dataset),q=e.ref(null);e.onMounted(()=>{me()});function me(){if(r.objectIsEmpty(u.dataset)&&r.error({componentName:"VueUiTreemap",type:"dataset"}),Q(E.value),t.value.responsive){const l=de.throttle(()=>{const{width:a,height:o}=de.useResponsive({chart:m.value,title:t.value.style.chart.title.text?k.value:null,legend:t.value.style.chart.legend.show?x.value:null});z.value.width=a,z.value.height=o});q.value=new ResizeObserver(l),q.value.observe(m.value.parentNode)}}e.onBeforeUnmount(()=>{q.value&&q.value.disconnect()});const M=e.ref(E.value),F=e.computed(()=>M.value.map((l,a)=>({...l,color:r.convertColorToHex(l.color)||D.value[a]||r.palette[a]||r.palette[a%r.palette.length]})).filter(l=>!g.value.includes(l.id))),L=e.computed(()=>E.value.filter(l=>!g.value.includes(l.id)).map(l=>l.value||0).reduce((l,a)=>l+a,0)),ee=e.computed({get(){let l=[...F.value];return t.value.style.chart.layout.sorted&&(l=[...F.value].sort((a,o)=>o.value-a.value)),l.map(a=>({...a}))},set(l){return l}});function te(l,a){return l.value/a}function ye(l,a,o){const c=t.value.style.chart.layout.rects.colorRatio-te(a,o);return r.lightenHexColor(l,c<0?0:c)}function le(l,a,o,c){return l.map((y,P)=>{const H=ye(r.convertColorToHex(a)||D.value[P]||r.palette[P]||r.palette[P%r.palette.length],y,c),$e=te(y,c);return{...y,color:H,proportion:$e,parentName:o,children:y.children?le(y.children,H,y.name,c):void 0}})}const I=e.computed(()=>Ve(ee.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?le(l.children.sort((c,y)=>y.value-c.value),l.color,l.name,o):void 0,color:l.color,name:l.name}}),{x0:O.value.left*2,y0:O.value.top,x1:O.value.width,y1:O.value.height}));function oe({y0:l,y1:a}){return a-l<=0?1e-4:a-l}function ae({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 be(l){b.value=l,w.value+=1}const R=e.computed(()=>({startX:0,startY:0,width:O.value.vbWidth,height:O.value.vbHeight})),T=e.ref(!1);function W(l,a=E.value){for(const o of a){if(o.id===l)return o;if(o.children){const c=W(l,o.children);if(c)return c}}return null}function ke(l){if(T.value)s("selectDatapoint",void 0),M.value=E.value;else{if(s("selectDatapoint",l),!W(l.parentId))return;M.value=[W(l.parentId)]}T.value=!T.value}const S=e.ref(null),ne=e.computed(()=>E.value.map((l,a)=>({...l,color:r.convertColorToHex(l.color)||D.value[a]||r.palette[a]||r.palette[a%r.palette.length],shape:"square"})).sort((l,a)=>a.value-l.value).map((l,a)=>({...l,proportion:l.value/E.value.map(o=>o.value).reduce((o,c)=>o+c,0),opacity:g.value.includes(l.id)?.5:1}))),Ce=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 re(l){T.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",ee.value)}const U=e.ref(null);function we({datapoint:l,seriesIndex:a}){S.value=l,U.value={datapoint:l,seriesIndex:a,config:t.value,series:F.value};const o=t.value.style.chart.tooltip.customFormat;if(r.isFunction(o)&&r.functionReturnsString(()=>o({seriesIndex:a,datapoint:l,series:F.value,config:t.value})))C.value=o({seriesIndex:a,datapoint:l,series:F.value,config:t.value});else{let c="";c+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${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=I.value.map(o=>({name:o.name,color:o.color})),a=I.value.map(o=>o.value);return{head:l,body:a}});function ue(){e.nextTick(()=>{const l=N.value.head.map((c,y)=>[[c.name],[N.value.body[y]],[isNaN(N.value.body[y]/L.value)?"-":N.value.body[y]/L.value*100]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(l),o=r.createCsvContent(a);r.downloadCsv({csvContent:o,title:t.value.style.chart.title.text||"vue-ui-treemap"})})}const A=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,P)=>{const H=r.applyDataLabel(t.value.style.chart.layout.labels.formatter,N.value.body[P],r.dataLabel({p:t.value.style.chart.layout.labels.prefix,v:N.value.body[P],s:t.value.style.chart.layout.labels.suffix,r:t.value.table.td.roundingValue}));return[{color:y.color,name:y.name,shape:"square"},H,isNaN(N.value.body[P]/L.value)?"-":r.dataLabel({v:N.value.body[P]/L.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 xe(){return I.value}function se(){_.value.showTable=!_.value.showTable}function ie(){_.value.showTooltip=!_.value.showTooltip}return d({getData:xe,generateCsv:ue,generateImage:K,generatePdf:J,toggleTable:se,toggleTooltip:ie}),(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.openBlock(),e.createBlock(Te._sfc_main,{key:`title_${B.value}`,config:{title:{cy:"treemap-div-title",...t.value.style.chart.title},subtitle:{cy:"treemap-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&v.value?(e.openBlock(),e.createBlock(ce.UserOptions,{ref:"details",key:`user_option_${w.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(Y),isImaging:e.unref(Z),uid:f.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:b.value,isTooltip:_.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:m.value,onToggleFullscreen:be,onGeneratePdf:e.unref(J),onGenerateCsv:ue,onGenerateImage:e.unref(K),onToggleTable:se,onToggleTooltip:ie},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":!T.value,"vue-data-ui-zoom-minus":T.value}),viewBox:`${R.value.startX} ${R.value.startY} ${R.value.width<=0?10:R.value.width} ${R.value.height<=0?10:R.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: hidden; background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.value,(o,c)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.chart.layout.rects.gradient.show?(e.openBlock(),e.createElementBlock("defs",Me,[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,Ue),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.lightenHexColor)(o.color,t.value.style.chart.layout.rects.gradient.intensity/100)},null,8,Ge)],8,We)])):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.value,(o,c)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:o.x0,y:o.y0,height:oe(o),width:ae(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=>ke(o),onMouseenter:()=>we({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,je),(e.openBlock(),e.createElementBlock("foreignObject",{x:o.x0,y:o.y0,height:oe(o),width:ae(o),class:"vue-ui-treemap-cell-foreignObject"},[e.createElementVNode("div",Ye,[t.value.style.chart.layout.labels.showDefaultLabels&&(o.proportion>t.value.style.chart.layout.labels.hideUnderProportion||T.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),Ze,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||T.value,fontSize:V(o),isZoom:T.value,textColor:e.unref(r.adaptColorToBackground)(o.color)})),void 0,!0)])],8,Xe))]))),256)),e.renderSlot(l.$slots,"svg",e.normalizeProps(e.guardReactiveProps({svg:O.value,isZoom:T.value,rect:S.value,config:t.value})),void 0,!0)],14,He)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Je,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(Y)||e.unref(Z)})),void 0,!0)])):e.createCommentVNode("",!0),v.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Be.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(Ne.Legend,{key:`legend_${j.value}`,legendSet:ne.value,config:Ce.value,id:`treemap_legend_${f.value}`,onClickMarker:a[1]||(a[1]=({legend:o})=>re(o))},{item:e.withCtx(({legend:o,index:c})=>[e.createElementVNode("div",{onClick:y=>re(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",et," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",Qe," ("+e.toDisplayString(isNaN(o.value/L.value)?"-":(o.value/L.value*100).toFixed(t.value.style.chart.legend.roundingPercentage))+"%) ",1))],12,Ke)]),_:1},8,["legendSet","config","id"])):e.renderSlot(l.$slots,"legend",{key:1,legend:ne.value},void 0,!0)],512),e.createVNode(Se._sfc_main,{show:_.value.showTooltip&&p.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,fontSize:t.value.style.chart.tooltip.fontSize,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent: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({...U.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...U.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(ze.default,{key:5,hideDetails:"",config:{open:_.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(_e.DataTable,{key:`table_${$.value}`,colNames:A.value.colNames,head:A.value.head,body:A.value.body,config:A.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=>_.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,tt)]),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,Ae))}},ot=Pe._export_sfc(lt,[["__scopeId","data-v-440c85e2"]]);exports.default=ot;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-BTgtr0F8.cjs"),Te=require("./Title-3EduyW4p.cjs"),ce=require("./usePrinter-DzTaA1eh.cjs"),Se=require("./Tooltip-DScSrYXJ.cjs"),Ne=require("./Legend-DgFd-O0m.cjs"),Be=require("./vue-ui-skeleton-CMQzFTs9.cjs"),_e=require("./DataTable-CsNozyz7.cjs"),ze=require("./vue-ui-accordion-7e4Myhcg.cjs"),de=require("./useResponsive-B3TrDDIG.cjs"),ve=require("./useNestedProp-CisbRRo_.cjs"),Pe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");function he(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 pe(n){const{xOffset:d,yOffset:s,width:u,height:i}=n;return{x0:d,y0:s,x1:d+u,y1:s+i}}function Oe(n,d,s){if(n.length===0)return!0;{const u=n.concat(d),i=he(n,s),v=he(u,s);return i>=v}}function Ee(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 Ve(n,d){const s={...d,children:n};return ge(s)}function Le(n){return(n.x1-n.x0)*(n.y1-n.y0)}function fe(n,d){const{width:s,height:u,xOffset:i,yOffset:v}=G(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,B={x0:b,y0:w,x1:b+p,y1:x},$=Object.assign({},k,B);w=x,g.push($)}return g}else{for(let m=0;m<h;m+=1){const k=n[m],x=b+k.normalizedValue/C,B={x0:b,y0:w,x1:x,y1:w+C},$=Object.assign({},k,B);b=x,g.push($)}return g}}function Re(n){const d=G(n),s=d.width,u=d.height;return Math.min(s,u)}function Fe(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 G(n){const{x0:d,y0:s,x1:u,y1:i}=n;return{xOffset:d,yOffset:s,width:u-d,height:i-s}}function Ie(n,d,s,u){let i=n,v=d,h=s,f=u;for(;;){const p=i.length;if(p===0){const g=fe(v,h);return f.concat(g)}const C=Re(h),b=i[0],w=i.slice(1,p);if(Oe(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 $=0;$<g;$+=1)m+=v[$].normalizedValue;const k=De(h,m),x=fe(v,h),B=f.concat(x);i=i,v=[],h=k,f=B}}}function ge(n){if(typeof n.children>"u"||!n.children.length)return[n];{const d=Fe(n.children,Le(n)),s=Ie(d,[],n,[]),u=s.length,i=[];for(let h=0;h<u;h+=1)i.push(ge(s[h]));return Ee(i)}}function De(n,d){const{width:s,height:u,xOffset:i,yOffset:v}=G(n);if(s>=u){const h=d/u,f=s-h,p={xOffset:i+h,yOffset:v,width:f,height:u};return pe(p)}else{const h=d/s,f=u-h,p={xOffset:i,yOffset:v+h,width:s,height:f};return pe(p)}}const qe=n=>(e.pushScopeId("data-v-440c85e2"),n=n(),e.popScopeId(),n),Ae=["id"],He=["xmlns","viewBox"],Me={key:0},We=["id"],Ue=["stop-color"],Ge=["stop-color"],je=["x","y","height","width","fill","rx","stroke","stroke-width","onClick","onMouseenter"],Xe=["x","y","height","width"],Ye={style:{width:"100%",height:"100%"},class:"vue-ui-treemap-cell"},Ze=qe(()=>e.createElementVNode("br",null,null,-1)),Je={key:3,class:"vue-data-ui-watermark"},Ke=["onClick"],Qe={key:0},et={key:1},tt=["innerHTML"],lt={__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),B=e.ref(0),$=e.ref(0),j=e.ref(0),t=e.computed({get:()=>X(),set:l=>l});function X(){const l=ve.useNestedProp({userConfig:u.config,defaultConfig:i});return l.theme?{...ve.useNestedProp({userConfig:r.themes.vue_ui_treemap[l.theme]||u.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}e.watch(()=>u.config,l=>{t.value=X(),B.value+=1,$.value+=1,j.value+=1},{deep:!0});const{isPrinting:Y,isImaging:Z,generatePdf:J,generateImage:K}=ce.usePrinter({elementId:`treemap_${f.value}`,fileName:t.value.style.chart.title.text||"vue-ui-treemap"}),D=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),_=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),z=e.ref({height:t.value.style.chart.height,width:t.value.style.chart.width}),O=e.computed(()=>({bottom:z.value.height-t.value.style.chart.padding.bottom,height:z.value.height-t.value.style.chart.padding.top-t.value.style.chart.padding.bottom,left:t.value.style.chart.padding.left,right:z.value.width-t.value.style.chart.padding.right,top:t.value.style.chart.padding.top,vbHeight:z.value.height,vbWidth:z.value.width,width:z.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right}));function Q(l){l.forEach((a,o)=>{a.id=r.createUid(),a.color=r.convertColorToHex(a.color)||D.value[o]||r.palette[o]||r.palette[o%r.palette.length],a.children&&(a.children.forEach(c=>{c.parentId=a.id,c.color=a.color}),Q(a.children))})}const E=e.ref(u.dataset),q=e.ref(null);e.onMounted(()=>{me()});function me(){if(r.objectIsEmpty(u.dataset)&&r.error({componentName:"VueUiTreemap",type:"dataset"}),Q(E.value),t.value.responsive){const l=de.throttle(()=>{const{width:a,height:o}=de.useResponsive({chart:m.value,title:t.value.style.chart.title.text?k.value:null,legend:t.value.style.chart.legend.show?x.value:null});z.value.width=a,z.value.height=o});q.value=new ResizeObserver(l),q.value.observe(m.value.parentNode)}}e.onBeforeUnmount(()=>{q.value&&q.value.disconnect()});const M=e.ref(E.value),F=e.computed(()=>M.value.map((l,a)=>({...l,color:r.convertColorToHex(l.color)||D.value[a]||r.palette[a]||r.palette[a%r.palette.length]})).filter(l=>!g.value.includes(l.id))),L=e.computed(()=>E.value.filter(l=>!g.value.includes(l.id)).map(l=>l.value||0).reduce((l,a)=>l+a,0)),ee=e.computed({get(){let l=[...F.value];return t.value.style.chart.layout.sorted&&(l=[...F.value].sort((a,o)=>o.value-a.value)),l.map(a=>({...a}))},set(l){return l}});function te(l,a){return l.value/a}function ye(l,a,o){const c=t.value.style.chart.layout.rects.colorRatio-te(a,o);return r.lightenHexColor(l,c<0?0:c)}function le(l,a,o,c){return l.map((y,P)=>{const H=ye(r.convertColorToHex(a)||D.value[P]||r.palette[P]||r.palette[P%r.palette.length],y,c),$e=te(y,c);return{...y,color:H,proportion:$e,parentName:o,children:y.children?le(y.children,H,y.name,c):void 0}})}const I=e.computed(()=>Ve(ee.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?le(l.children.sort((c,y)=>y.value-c.value),l.color,l.name,o):void 0,color:l.color,name:l.name}}),{x0:O.value.left*2,y0:O.value.top,x1:O.value.width,y1:O.value.height}));function oe({y0:l,y1:a}){return a-l<=0?1e-4:a-l}function ae({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 be(l){b.value=l,w.value+=1}const R=e.computed(()=>({startX:0,startY:0,width:O.value.vbWidth,height:O.value.vbHeight})),T=e.ref(!1);function W(l,a=E.value){for(const o of a){if(o.id===l)return o;if(o.children){const c=W(l,o.children);if(c)return c}}return null}function ke(l){if(T.value)s("selectDatapoint",void 0),M.value=E.value;else{if(s("selectDatapoint",l),!W(l.parentId))return;M.value=[W(l.parentId)]}T.value=!T.value}const S=e.ref(null),ne=e.computed(()=>E.value.map((l,a)=>({...l,color:r.convertColorToHex(l.color)||D.value[a]||r.palette[a]||r.palette[a%r.palette.length],shape:"square"})).sort((l,a)=>a.value-l.value).map((l,a)=>({...l,proportion:l.value/E.value.map(o=>o.value).reduce((o,c)=>o+c,0),opacity:g.value.includes(l.id)?.5:1}))),Ce=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 re(l){T.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",ee.value)}const U=e.ref(null);function we({datapoint:l,seriesIndex:a}){S.value=l,U.value={datapoint:l,seriesIndex:a,config:t.value,series:F.value};const o=t.value.style.chart.tooltip.customFormat;if(r.isFunction(o)&&r.functionReturnsString(()=>o({seriesIndex:a,datapoint:l,series:F.value,config:t.value})))C.value=o({seriesIndex:a,datapoint:l,series:F.value,config:t.value});else{let c="";c+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${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=I.value.map(o=>({name:o.name,color:o.color})),a=I.value.map(o=>o.value);return{head:l,body:a}});function ue(){e.nextTick(()=>{const l=N.value.head.map((c,y)=>[[c.name],[N.value.body[y]],[isNaN(N.value.body[y]/L.value)?"-":N.value.body[y]/L.value*100]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(l),o=r.createCsvContent(a);r.downloadCsv({csvContent:o,title:t.value.style.chart.title.text||"vue-ui-treemap"})})}const A=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,P)=>{const H=r.applyDataLabel(t.value.style.chart.layout.labels.formatter,N.value.body[P],r.dataLabel({p:t.value.style.chart.layout.labels.prefix,v:N.value.body[P],s:t.value.style.chart.layout.labels.suffix,r:t.value.table.td.roundingValue}));return[{color:y.color,name:y.name,shape:"square"},H,isNaN(N.value.body[P]/L.value)?"-":r.dataLabel({v:N.value.body[P]/L.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 xe(){return I.value}function se(){_.value.showTable=!_.value.showTable}function ie(){_.value.showTooltip=!_.value.showTooltip}return d({getData:xe,generateCsv:ue,generateImage:K,generatePdf:J,toggleTable:se,toggleTooltip:ie}),(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.openBlock(),e.createBlock(Te._sfc_main,{key:`title_${B.value}`,config:{title:{cy:"treemap-div-title",...t.value.style.chart.title},subtitle:{cy:"treemap-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&v.value?(e.openBlock(),e.createBlock(ce.UserOptions,{ref:"details",key:`user_option_${w.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(Y),isImaging:e.unref(Z),uid:f.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:b.value,isTooltip:_.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:m.value,onToggleFullscreen:be,onGeneratePdf:e.unref(J),onGenerateCsv:ue,onGenerateImage:e.unref(K),onToggleTable:se,onToggleTooltip:ie},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":!T.value,"vue-data-ui-zoom-minus":T.value}),viewBox:`${R.value.startX} ${R.value.startY} ${R.value.width<=0?10:R.value.width} ${R.value.height<=0?10:R.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: hidden; background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.value,(o,c)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.chart.layout.rects.gradient.show?(e.openBlock(),e.createElementBlock("defs",Me,[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,Ue),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.lightenHexColor)(o.color,t.value.style.chart.layout.rects.gradient.intensity/100)},null,8,Ge)],8,We)])):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.value,(o,c)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:o.x0,y:o.y0,height:oe(o),width:ae(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=>ke(o),onMouseenter:()=>we({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,je),(e.openBlock(),e.createElementBlock("foreignObject",{x:o.x0,y:o.y0,height:oe(o),width:ae(o),class:"vue-ui-treemap-cell-foreignObject"},[e.createElementVNode("div",Ye,[t.value.style.chart.layout.labels.showDefaultLabels&&(o.proportion>t.value.style.chart.layout.labels.hideUnderProportion||T.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),Ze,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||T.value,fontSize:V(o),isZoom:T.value,textColor:e.unref(r.adaptColorToBackground)(o.color)})),void 0,!0)])],8,Xe))]))),256)),e.renderSlot(l.$slots,"svg",e.normalizeProps(e.guardReactiveProps({svg:O.value,isZoom:T.value,rect:S.value,config:t.value})),void 0,!0)],14,He)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Je,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(Y)||e.unref(Z)})),void 0,!0)])):e.createCommentVNode("",!0),v.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Be.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(Ne.Legend,{key:`legend_${j.value}`,legendSet:ne.value,config:Ce.value,id:`treemap_legend_${f.value}`,onClickMarker:a[1]||(a[1]=({legend:o})=>re(o))},{item:e.withCtx(({legend:o,index:c})=>[e.createElementVNode("div",{onClick:y=>re(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",et," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",Qe," ("+e.toDisplayString(isNaN(o.value/L.value)?"-":(o.value/L.value*100).toFixed(t.value.style.chart.legend.roundingPercentage))+"%) ",1))],12,Ke)]),_:1},8,["legendSet","config","id"])):e.renderSlot(l.$slots,"legend",{key:1,legend:ne.value},void 0,!0)],512),e.createVNode(Se._sfc_main,{show:_.value.showTooltip&&p.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,fontSize:t.value.style.chart.tooltip.fontSize,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent: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({...U.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...U.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(ze.default,{key:5,hideDetails:"",config:{open:_.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(_e.DataTable,{key:`table_${$.value}`,colNames:A.value.colNames,head:A.value.head,body:A.value.body,config:A.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=>_.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,tt)]),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,Ae))}},ot=Pe._export_sfc(lt,[["__scopeId","data-v-440c85e2"]]);exports.default=ot;
@@ -1,14 +1,14 @@
1
1
  import { computed as C, ref as y, watch as qe, onMounted as je, onBeforeUnmount as Ye, openBlock as m, createElementBlock as k, normalizeClass as _e, normalizeStyle as V, createBlock as X, createCommentVNode as B, unref as b, createSlots as Ze, withCtx as T, renderSlot as _, normalizeProps as q, guardReactiveProps as j, Fragment as Oe, renderList as Se, createElementVNode as O, toDisplayString as Y, createTextVNode as Ne, createVNode as Je, nextTick as Ke, pushScopeId as Qe, popScopeId as et } from "vue";
2
- import { u as tt, c as ze, t as lt, a as ot, p as x, b as at, o as nt, e as st, d as oe, i as ae, f as K, X as rt, l as Ie, E as Pe, x as Fe, y as ut, q as it, r as ct } from "./index-Cm4Iry5c.js";
3
- import { _ as dt } from "./Title-C26I_HC3.js";
4
- import { u as vt, U as ht } from "./usePrinter-B8RnF8_q.js";
5
- import { _ as ft } from "./Tooltip-CH8GmDCG.js";
6
- import { L as pt } from "./Legend-DX1kv21U.js";
7
- import gt from "./vue-ui-skeleton-C1oUnz7R.js";
8
- import { D as yt } from "./DataTable-CQANRZju.js";
9
- import mt from "./vue-ui-accordion-Cb6XBCbu.js";
2
+ import { u as tt, c as ze, t as lt, a as ot, p as x, b as at, o as nt, e as st, d as oe, i as ae, f as K, X as rt, l as Ie, E as Pe, x as Fe, y as ut, q as it, r as ct } from "./index-CaV1s-yZ.js";
3
+ import { _ as dt } from "./Title-gUz6GDA3.js";
4
+ import { u as vt, U as ht } from "./usePrinter-rvJyT65A.js";
5
+ import { _ as ft } from "./Tooltip-DfSM1mNP.js";
6
+ import { L as pt } from "./Legend-5cQ0xZjK.js";
7
+ import gt from "./vue-ui-skeleton-CvFX_ExX.js";
8
+ import { D as yt } from "./DataTable-e2fnfjXV.js";
9
+ import mt from "./vue-ui-accordion-CpzGQ63y.js";
10
10
  import { t as bt, u as wt } from "./useResponsive-NZB-WLRF.js";
11
- import { u as Le } from "./useNestedProp-CurQIHTa.js";
11
+ import { u as Le } from "./useNestedProp-tWCzZrLx.js";
12
12
  import { _ as Ct } from "./_plugin-vue_export-helper-CHgC5LLL.js";
13
13
  function Re(a, i) {
14
14
  const s = a.length;
@@ -1,14 +1,14 @@
1
1
  import { useCssVars as Ye, computed as b, ref as d, watch as Pe, onMounted as qe, onBeforeUnmount as Ke, openBlock as n, createElementBlock as c, normalizeClass as D, normalizeStyle as r, createBlock as R, createCommentVNode as m, unref as h, createSlots as Je, withCtx as k, renderSlot as x, normalizeProps as K, guardReactiveProps as J, createElementVNode as u, toDisplayString as i, Fragment as U, renderList as H, createVNode as Se, withKeys as Qe, createTextVNode as Ze } from "vue";
2
- import { u as et, c as tt, t as at, a as lt, p as M, b as ot, o as Ve, e as Q, s as S, d as ne, i as Z, f as I, X as ut, v as nt, w as se, x as st, y as rt, q as it, r as dt } from "./index-Cm4Iry5c.js";
2
+ import { u as et, c as tt, t as at, a as lt, p as M, b as ot, o as Ve, e as Q, s as S, d as ne, i as Z, f as I, X as ut, v as nt, w as se, x as st, y as rt, q as it, r as dt } from "./index-CaV1s-yZ.js";
3
3
  import { t as ct, u as vt } from "./useResponsive-NZB-WLRF.js";
4
- import { _ as ht } from "./Title-C26I_HC3.js";
5
- import { u as pt, U as gt } from "./usePrinter-B8RnF8_q.js";
6
- import { _ as yt } from "./Tooltip-CH8GmDCG.js";
7
- import { L as ze } from "./Legend-DX1kv21U.js";
8
- import ft from "./vue-ui-skeleton-C1oUnz7R.js";
9
- import bt from "./BaseIcon-BAOfPaXs.js";
10
- import mt from "./vue-ui-accordion-Cb6XBCbu.js";
11
- import { u as Fe } from "./useNestedProp-CurQIHTa.js";
4
+ import { _ as ht } from "./Title-gUz6GDA3.js";
5
+ import { u as pt, U as gt } from "./usePrinter-rvJyT65A.js";
6
+ import { _ as yt } from "./Tooltip-DfSM1mNP.js";
7
+ import { L as ze } from "./Legend-5cQ0xZjK.js";
8
+ import ft from "./vue-ui-skeleton-CvFX_ExX.js";
9
+ import bt from "./BaseIcon-rwm-10Hu.js";
10
+ import mt from "./vue-ui-accordion-CpzGQ63y.js";
11
+ import { u as Fe } from "./useNestedProp-tWCzZrLx.js";
12
12
  import { _ as _t } from "./_plugin-vue_export-helper-CHgC5LLL.js";
13
13
  const kt = ["id"], xt = ["onClick"], $t = ["xmlns", "viewBox"], Ct = ["id"], wt = ["stop-color"], Tt = ["stop-color"], Lt = ["x", "y", "width", "height", "fill", "rx"], Nt = ["x", "y", "width", "height", "fill", "rx", "stroke", "stroke-width"], Pt = ["x2", "y1", "y2", "stroke", "stroke-width"], St = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Vt = ["x", "y", "text-anchor", "font-size", "fill", "font-weight"], zt = ["x", "y", "font-size", "fill", "font-weight"], Ft = ["x", "y", "font-size", "fill", "font-weight"], Mt = ["x", "y", "font-size", "fill", "font-weight"], It = ["y", "width", "height", "fill", "onMouseenter"], Bt = {
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-DYUBiaGS.cjs"),ue=require("./useResponsive-B3TrDDIG.cjs"),we=require("./Title-XBiDFYKD.cjs"),ie=require("./usePrinter-ZlHxdaEz.cjs"),$e=require("./Tooltip-DxtWkIt5.cjs"),se=require("./Legend-CtbPB0Bo.cjs"),Se=require("./vue-ui-skeleton-ClpTCY1x.cjs"),Ve=require("./BaseIcon--PMhZ3f-.cjs"),Te=require("./vue-ui-accordion-1WxrfiCH.cjs"),ce=require("./useNestedProp-w7AMWWmz.cjs"),Be=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Ee=["id"],Le=["onClick"],ze=["xmlns","viewBox"],Pe=["id"],De=["stop-color"],Fe=["stop-color"],Me=["x","y","width","height","fill","rx"],Ie=["x","y","width","height","fill","rx","stroke","stroke-width"],Oe=["x2","y1","y2","stroke","stroke-width"],Re=["x1","x2","y1","y2","stroke","stroke-width"],qe=["x","y","text-anchor","font-size","fill","font-weight"],He=["x","y","font-size","fill","font-weight"],Xe=["x","y","font-size","fill","font-weight"],Ae=["x","y","font-size","fill","font-weight"],Ue=["y","width","height","fill","onMouseenter"],je={key:4,class:"vue-data-ui-watermark"},Ge=["onClick"],We={style:"width:100%;padding-top: 36px;position:relative"},Ye={class:"vue-ui-data-table"},Ke={key:0},Je={style:{width:"100%"}},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=["data-cell"],st={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},ct=["data-cell"],dt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},vt={__name:"vue-ui-vertical-bar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(de,{expose:ve,emit:he}){const y=de;e.useCssVars(a=>({f13b9132:a.tdo}));const{vue_ui_vertical_bar:pe}=n.useConfig(),B=e.computed(()=>!!y.dataset&&y.dataset.length),C=e.ref(n.createUid()),ye=e.ref(null),P=e.ref(!1),D=e.ref(""),E=e.ref(0),ge=e.ref(null),R=e.ref(0),$=e.ref(null),q=e.ref(null),F=e.ref(null),H=e.ref(0),M=e.ref(0),t=e.computed({get:()=>X(),set:a=>a});function X(){const a=ce.useNestedProp({userConfig:y.config,defaultConfig:pe});return a.theme?{...ce.useNestedProp({userConfig:n.themes.vue_ui_vertical_bar[a.theme]||y.config,defaultConfig:a}),customPalette:n.themePalettes[a.theme]||n.palette}:a}e.watch(()=>y.config,a=>{t.value=X(),J(),H.value+=1,M.value+=1,i.value=t.value.style.chart.layout.bars.height,c.value=t.value.style.chart.layout.bars.gap},{deep:!0}),e.watch(()=>y.dataset,z,{deep:!0});const{isPrinting:A,isImaging:U,generatePdf:j,generateImage:G}=ie.usePrinter({elementId:`vue-ui-vertical-bar_${C.value}`,fileName:t.value.style.chart.title.text||"vue-ui-vertical-bar"}),W=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),Y=e.ref(null),K=e.ref(!1),fe=e.computed(()=>t.value.table.responsiveBreakpoint),L=e.ref(null);e.onMounted(()=>{J()});function J(){if(n.objectIsEmpty(y.dataset)&&n.error({componentName:"VueUiVerticalBar",type:"dataset"}),E.value=y.dataset.flatMap(a=>a.children&&a.children.length>0?a.children.length:1).reduce((a,o)=>a+o,0),be(),t.value.responsive){const a=ue.throttle(()=>{const{width:o,height:l}=ue.useResponsive({chart:$.value,title:t.value.style.chart.title.text?q.value:null,legend:t.value.style.chart.legend.show?F.value:null});ee.value=o,i.value=l/E.value-c.value*2});L.value=new ResizeObserver(a),L.value.observe($.value.parentNode)}}e.onBeforeUnmount(()=>{L.value&&L.value.disconnect()});function be(){new ResizeObserver(o=>{o.forEach(l=>{K.value=l.contentRect.width<fe.value})}).observe(Y.value)}const p=e.ref({showTable:t.value.table.show,sortDesc:t.value.style.chart.layout.bars.sort==="desc",showTooltip:t.value.style.chart.tooltip.show}),Q=e.computed(()=>p.value.sortDesc),_=e.computed(()=>(y.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})}))}),y.dataset.map((a,o)=>{const l=`vertical_parent_${o}_${C.value}`,r=a.children&&a.children.length>0,v=n.checkNaN(a.value?a.value:r?a.children.map(h=>h.value||0).reduce((h,m)=>h+m,0):0),s=v>=0?1:-1;return{...a,id:l,shape:"square",opacity:f.value.includes(l)?.5:1,value:Math.abs(v),sign:s,hasChildren:r,isChild:!1,segregate:()=>S(l),isSegregated:f.value.includes(l),color:n.convertColorToHex(a.color)||W.value[o]||n.palette[o]||n.palette[o%n.palette.length],children:!a.children||!a.children.length?[]:a.children.toSorted((h,m)=>Q.value?m.value-h.value:h.value-m.value).map((h,m)=>({...h,value:n.checkNaN(Math.abs(h.value)),sign:h.value>=0?1:-1,isChild:!0,parentId:l,parentName:a.name,parentValue:v,parentSign:s,id:`vertical_child_${o}_${m}_${C.value}`,childIndex:m,color:n.convertColorToHex(h.color)||n.convertColorToHex(a.color)||W.value[o]||n.palette[o]||n.palette[o%n.palette.length]})).map((h,m)=>({...h,isFirstChild:m===0,isLastChild:m===a.children.length-1}))}}).toSorted((a,o)=>Q.value?o.value-a.value:a.value-o.value))),Z=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":""})),i=e.ref(t.value.style.chart.layout.bars.height),c=e.ref(t.value.style.chart.layout.bars.gap),me=e.computed(()=>(i.value+c.value)*E.value),ee=e.ref(512),d=e.computed(()=>({width:ee.value,height:me.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 z(){E.value=x.value.flatMap(a=>a.children&&a.children.length>0?a.children.length:1).reduce((a,o)=>a+o,0)}const f=e.ref([]);function S(a){f.value.includes(a)?f.value=f.value.filter(o=>o!==a):f.value.push(a),z(),he("selectLegend",x.value)}const x=e.computed(()=>_.value.filter(a=>!f.value.includes(a.id))),b=e.computed(()=>x.value.map(a=>Math.abs(a.value)).reduce((a,o)=>a+o,0));function te(a,o=!1,l=0){return o?n.dataLabel({v:n.checkNaN(Math.abs(a)/b.value*100),s:"%",r:l}):Math.abs(a)/b.value}const N=e.computed(()=>x.value.flatMap(a=>a.hasChildren?a.children:a)),w=e.computed(()=>N.value.map(a=>a.sign).includes(-1)),ke=e.computed(()=>Math.max(...x.value.flatMap(a=>a.children&&a.children.length?Math.max(...a.children.map(o=>o.value)):a.value)));function k(a){const o=a/ke.value;return u.value.width/(w.value?2:1)*o}function Ce(a){return k(a)+u.value.left}function V(a,o){const l=x.value.find(s=>s.id===a.parentId),r=u.value.top+(c.value+i.value)*o,v=l.children.length*(c.value+i.value);return{y:r+v/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/b.value)?"":te(l.value,!0,t.value.style.chart.layout.bars.dataLabels.percentage.roundingPercentage),sign:l.sign}}function _e(){return x.value}const I=e.ref(null),O=e.ref(null);function xe(a,o){O.value={datapoint:a,seriesIndex:o,series:_.value,config:t.value},P.value=!0,I.value=a.id;let l="";const r=a.isChild?a.parentName:a.name,v=a.isChild?a.name:"",s=t.value.style.chart.tooltip.customFormat;n.isFunction(s)&&n.functionReturnsString(()=>s({datapoint:a,series:_.value,config:t.value,seriesIndex:o}))?D.value=s({datapoint:a,series:_.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-BTgtr0F8.cjs"),ue=require("./useResponsive-B3TrDDIG.cjs"),we=require("./Title-3EduyW4p.cjs"),ie=require("./usePrinter-DzTaA1eh.cjs"),$e=require("./Tooltip-DScSrYXJ.cjs"),se=require("./Legend-DgFd-O0m.cjs"),Se=require("./vue-ui-skeleton-CMQzFTs9.cjs"),Ve=require("./BaseIcon-DB7Apwv_.cjs"),Te=require("./vue-ui-accordion-7e4Myhcg.cjs"),ce=require("./useNestedProp-CisbRRo_.cjs"),Be=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Ee=["id"],Le=["onClick"],ze=["xmlns","viewBox"],Pe=["id"],De=["stop-color"],Fe=["stop-color"],Me=["x","y","width","height","fill","rx"],Ie=["x","y","width","height","fill","rx","stroke","stroke-width"],Oe=["x2","y1","y2","stroke","stroke-width"],Re=["x1","x2","y1","y2","stroke","stroke-width"],qe=["x","y","text-anchor","font-size","fill","font-weight"],He=["x","y","font-size","fill","font-weight"],Xe=["x","y","font-size","fill","font-weight"],Ae=["x","y","font-size","fill","font-weight"],Ue=["y","width","height","fill","onMouseenter"],je={key:4,class:"vue-data-ui-watermark"},Ge=["onClick"],We={style:"width:100%;padding-top: 36px;position:relative"},Ye={class:"vue-ui-data-table"},Ke={key:0},Je={style:{width:"100%"}},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=["data-cell"],st={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},ct=["data-cell"],dt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},vt={__name:"vue-ui-vertical-bar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(de,{expose:ve,emit:he}){const y=de;e.useCssVars(a=>({f13b9132:a.tdo}));const{vue_ui_vertical_bar:pe}=n.useConfig(),B=e.computed(()=>!!y.dataset&&y.dataset.length),C=e.ref(n.createUid()),ye=e.ref(null),P=e.ref(!1),D=e.ref(""),E=e.ref(0),ge=e.ref(null),R=e.ref(0),$=e.ref(null),q=e.ref(null),F=e.ref(null),H=e.ref(0),M=e.ref(0),t=e.computed({get:()=>X(),set:a=>a});function X(){const a=ce.useNestedProp({userConfig:y.config,defaultConfig:pe});return a.theme?{...ce.useNestedProp({userConfig:n.themes.vue_ui_vertical_bar[a.theme]||y.config,defaultConfig:a}),customPalette:n.themePalettes[a.theme]||n.palette}:a}e.watch(()=>y.config,a=>{t.value=X(),J(),H.value+=1,M.value+=1,i.value=t.value.style.chart.layout.bars.height,c.value=t.value.style.chart.layout.bars.gap},{deep:!0}),e.watch(()=>y.dataset,z,{deep:!0});const{isPrinting:A,isImaging:U,generatePdf:j,generateImage:G}=ie.usePrinter({elementId:`vue-ui-vertical-bar_${C.value}`,fileName:t.value.style.chart.title.text||"vue-ui-vertical-bar"}),W=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),Y=e.ref(null),K=e.ref(!1),fe=e.computed(()=>t.value.table.responsiveBreakpoint),L=e.ref(null);e.onMounted(()=>{J()});function J(){if(n.objectIsEmpty(y.dataset)&&n.error({componentName:"VueUiVerticalBar",type:"dataset"}),E.value=y.dataset.flatMap(a=>a.children&&a.children.length>0?a.children.length:1).reduce((a,o)=>a+o,0),be(),t.value.responsive){const a=ue.throttle(()=>{const{width:o,height:l}=ue.useResponsive({chart:$.value,title:t.value.style.chart.title.text?q.value:null,legend:t.value.style.chart.legend.show?F.value:null});ee.value=o,i.value=l/E.value-c.value*2});L.value=new ResizeObserver(a),L.value.observe($.value.parentNode)}}e.onBeforeUnmount(()=>{L.value&&L.value.disconnect()});function be(){new ResizeObserver(o=>{o.forEach(l=>{K.value=l.contentRect.width<fe.value})}).observe(Y.value)}const p=e.ref({showTable:t.value.table.show,sortDesc:t.value.style.chart.layout.bars.sort==="desc",showTooltip:t.value.style.chart.tooltip.show}),Q=e.computed(()=>p.value.sortDesc),_=e.computed(()=>(y.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})}))}),y.dataset.map((a,o)=>{const l=`vertical_parent_${o}_${C.value}`,r=a.children&&a.children.length>0,v=n.checkNaN(a.value?a.value:r?a.children.map(h=>h.value||0).reduce((h,m)=>h+m,0):0),s=v>=0?1:-1;return{...a,id:l,shape:"square",opacity:f.value.includes(l)?.5:1,value:Math.abs(v),sign:s,hasChildren:r,isChild:!1,segregate:()=>S(l),isSegregated:f.value.includes(l),color:n.convertColorToHex(a.color)||W.value[o]||n.palette[o]||n.palette[o%n.palette.length],children:!a.children||!a.children.length?[]:a.children.toSorted((h,m)=>Q.value?m.value-h.value:h.value-m.value).map((h,m)=>({...h,value:n.checkNaN(Math.abs(h.value)),sign:h.value>=0?1:-1,isChild:!0,parentId:l,parentName:a.name,parentValue:v,parentSign:s,id:`vertical_child_${o}_${m}_${C.value}`,childIndex:m,color:n.convertColorToHex(h.color)||n.convertColorToHex(a.color)||W.value[o]||n.palette[o]||n.palette[o%n.palette.length]})).map((h,m)=>({...h,isFirstChild:m===0,isLastChild:m===a.children.length-1}))}}).toSorted((a,o)=>Q.value?o.value-a.value:a.value-o.value))),Z=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":""})),i=e.ref(t.value.style.chart.layout.bars.height),c=e.ref(t.value.style.chart.layout.bars.gap),me=e.computed(()=>(i.value+c.value)*E.value),ee=e.ref(512),d=e.computed(()=>({width:ee.value,height:me.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 z(){E.value=x.value.flatMap(a=>a.children&&a.children.length>0?a.children.length:1).reduce((a,o)=>a+o,0)}const f=e.ref([]);function S(a){f.value.includes(a)?f.value=f.value.filter(o=>o!==a):f.value.push(a),z(),he("selectLegend",x.value)}const x=e.computed(()=>_.value.filter(a=>!f.value.includes(a.id))),b=e.computed(()=>x.value.map(a=>Math.abs(a.value)).reduce((a,o)=>a+o,0));function te(a,o=!1,l=0){return o?n.dataLabel({v:n.checkNaN(Math.abs(a)/b.value*100),s:"%",r:l}):Math.abs(a)/b.value}const N=e.computed(()=>x.value.flatMap(a=>a.hasChildren?a.children:a)),w=e.computed(()=>N.value.map(a=>a.sign).includes(-1)),ke=e.computed(()=>Math.max(...x.value.flatMap(a=>a.children&&a.children.length?Math.max(...a.children.map(o=>o.value)):a.value)));function k(a){const o=a/ke.value;return u.value.width/(w.value?2:1)*o}function Ce(a){return k(a)+u.value.left}function V(a,o){const l=x.value.find(s=>s.id===a.parentId),r=u.value.top+(c.value+i.value)*o,v=l.children.length*(c.value+i.value);return{y:r+v/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/b.value)?"":te(l.value,!0,t.value.style.chart.layout.bars.dataLabels.percentage.roundingPercentage),sign:l.sign}}function _e(){return x.value}const I=e.ref(null),O=e.ref(null);function xe(a,o){O.value={datapoint:a,seriesIndex:o,series:_.value,config:t.value},P.value=!0,I.value=a.id;let l="";const r=a.isChild?a.parentName:a.name,v=a.isChild?a.name:"",s=t.value.style.chart.tooltip.customFormat;n.isFunction(s)&&n.functionReturnsString(()=>s({datapoint:a,series:_.value,config:t.value,seriesIndex:o}))?D.value=s({datapoint:a,series:_.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
  ${v?`<div>${v}</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)/b.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>`)),D.value=`<div style="text-align:left">${l}</div>`)}function le(a,o,l,r){if(!t.value.style.chart.layout.bars.dataLabels.value.show)return"";const v=n.applyDataLabel(t.value.style.chart.layout.bars.dataLabels.value.formatter,n.checkNaN(r===-1&&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=`(${te(a,!0,t.value.style.chart.layout.bars.dataLabels.percentage.roundingPercentage)})`;return`${v}${t.value.style.chart.layout.bars.dataLabels.percentage.show?` ${s}`:""}`}const g=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=N.value.map(l=>l.isChild?l.isFirstChild?{color:l.color,parentName:l.parentName,parentValue:l.parentValue,percentageToTotal:l.parentValue/b.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)/b.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)/b.value}:{color:l.color,parentName:l.name,parentValue:l.sign===1?l.value:-l.value,percentageToTotal:Math.abs(l.value)/b.value,childName:"",childValue:"",childPercentageToParent:"",childPercentageToTotal:""});return{head:a,body:o}});function ae(){const a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[""]],o=g.value.head,l=g.value.body.map(s=>[s.parentName,s.parentValue,s.percentageToTotal,s.childName,s.childValue,s.childPercentageToParent,s.childPercentageToTotal]),r=a.concat([o]).concat(l),v=n.createCsvContent(r);n.downloadCsv({csvContent:v,title:t.value.style.chart.title.text||"vue-ui-vertical-bar"})}const T=e.ref(!1);function Ne(a){T.value=a,R.value+=1}function oe(){p.value.showTable=!p.value.showTable}function ne(){p.value.sortDesc=!p.value.sortDesc,z()}function re(){p.value.showTooltip=!p.value.showTooltip}return ve({getData:_e,recalculateHeight:z,generatePdf:j,generateCsv:ae,generateImage:G,toggleTable:oe,toggleSort:ne,toggleTooltip:re}),(a,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-vertical-bar ${T.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),ref_key:"verticalBarChart",ref:$,id:`vue-ui-vertical-bar_${C.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:q,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:12px`)},[(e.openBlock(),e.createBlock(we._sfc_main,{key:`title_${H.value}`,config:{title:{cy:"vertical-bar-div-title",...t.value.style.chart.title},subtitle:{cy:"vertical-bar-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&B.value?(e.openBlock(),e.createBlock(ie.UserOptions,{ref_key:"details",ref:ye,key:`user_options_${R.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(U),isPrinting:e.unref(A),uid:C.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasSort:t.value.userOptions.buttons.sort,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:T.value,isTooltip:p.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:$.value,onToggleFullscreen:Ne,onGeneratePdf:e.unref(j),onGenerateCsv:ae,onGenerateImage:e.unref(G),onToggleTable:oe,onToggleSort:ne,onToggleTooltip:re},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:F},[(e.openBlock(),e.createBlock(se.Legend,{key:`legend_top_${M.value}`,legendSet:_.value,config:Z.value,onClickMarker:o[0]||(o[0]=({legend:l})=>S(l.id))},{item:e.withCtx(({legend:l,index:r})=>[e.createElementVNode("div",{"data-cy-legend-item":"",onClick:v=>S(l.id),style:e.normalizeStyle(`opacity:${f.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,Le)]),_:1},8,["legendSet","config"]))],512)):e.createCommentVNode("",!0),B.value?(e.openBlock(),e.createElementBlock("svg",{key:3,xmlns:e.unref(n.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":T.value,"vue-data-ui-fulscreen--off":!T.value}),viewBox:`0 0 ${d.value.width<=0?10:d.value.width} ${u.value.fullHeight<=0?10:u.value.fullHeight}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,(l,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{x1:"0%",y1:"0%",x2:"100%",y2:"0%",id:`vertical_bar_gradient_${C.value}_${r}`},[e.createElementVNode("stop",{offset:"0%","stop-color":l.color},null,8,De),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,Fe)],8,Pe))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:e.unref(n.checkNaN)(w.value?u.value.left+u.value.width/2-(l.sign===1?0:k(l.value)<=0?1e-4:k(l.value)):u.value.left),y:u.value.top+(c.value+i.value)*r,width:e.unref(n.checkNaN)(k(l.value)<=0?1e-4:k(l.value)),height:i.value<=0?1e-4:i.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,Me)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:e.unref(n.checkNaN)(w.value?u.value.left+u.value.width/2-(l.sign===1?0:k(l.value)<=0?1e-4:k(l.value)):u.value.left),y:u.value.top+(c.value+i.value)*r,width:e.unref(n.checkNaN)(k(l.value)<=0?1e-4:k(l.value)),height:i.value<=0?1e-4:i.value,fill:t.value.style.chart.layout.bars.useGradient?`url(#vertical_bar_gradient_${C.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,Ie),(!l.isChild||l.isLastChild)&&t.value.style.chart.layout.separators.show&&r!==N.value.length-1?(e.openBlock(),e.createElementBlock("line",{key:0,x1:0,x2:u.value.left,y1:i.value+c.value/2+u.value.top+(c.value+i.value)*r,y2:i.value+c.value/2+u.value.top+(c.value+i.value)*r,stroke:t.value.style.chart.layout.separators.color,"stroke-width":t.value.style.chart.layout.separators.strokeWidth,"stroke-linecap":"round"},null,8,Oe)):e.createCommentVNode("",!0),w.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,Re)):e.createCommentVNode("",!0),e.createElementVNode("text",{x:w.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):Ce(l.value)+3+t.value.style.chart.layout.bars.dataLabels.offsetX,y:u.value.top+(c.value+i.value)*r+i.value/2+t.value.style.chart.layout.bars.dataLabels.fontSize/2,"text-anchor":!w.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(le(l.value,l,r,l.sign)),9,qe),(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+(c.value+i.value)*r+i.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,He)):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:V(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(V(l,r).name),9,Xe)):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:V(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(le(V(l,r).value),V(l,r),r,l.parentSign||l.sign),9,Ae)):e.createCommentVNode("",!0),e.createElementVNode("rect",{"data-cy-trap":"",x:0,y:u.value.top+(c.value+i.value)*r-c.value/2,width:d.value.width<=0?1e-4:d.value.width,height:i.value+c.value<=0?1e-4:i.value+c.value,fill:I.value===l.id?`${t.value.style.chart.layout.highlighter.color}${e.unref(n.opacity)[t.value.style.chart.layout.highlighter.opacity]}`:"transparent",onMouseenter:v=>xe(l,r),onMouseleave:o[1]||(o[1]=v=>{ge.value=null,P.value=!1,I.value=null})},null,40,Ue)]))),256)),e.renderSlot(a.$slots,"svg",{svg:d.value},void 0,!0)],14,ze)):e.createCommentVNode("",!0),a.$slots.watermark?(e.openBlock(),e.createElementBlock("div",je,[e.renderSlot(a.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(A)||e.unref(U)})),void 0,!0)])):e.createCommentVNode("",!0),B.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Se.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:F},[(e.openBlock(),e.createBlock(se.Legend,{key:`legend_bottom_${M.value}`,legendSet:_.value,config:Z.value,onClickMarker:o[2]||(o[2]=({legend:l})=>S(l.id))},{item:e.withCtx(({legend:l,index:r})=>[e.createElementVNode("div",{onClick:v=>S(l.id),style:e.normalizeStyle(`opacity:${f.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,Ge)]),_:1},8,["legendSet","config"]))],512)):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"legend",{legend:_.value},void 0,!0),e.createVNode($e._sfc_main,{show:p.value.showTooltip&&P.value&&f.value.length<y.dataset.length,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,fontSize:t.value.style.chart.tooltip.fontSize,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:$.value,content:D.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({...O.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(a.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...O.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isCustom"]),B.value?(e.openBlock(),e.createBlock(Te.default,{key:7,hideDetails:"",config:{open:p.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"tableContainer",ref:Y,class:"vue-ui-vertical-bar-table"},[e.createElementVNode("div",We,[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=>p.value.showTable=!1),onKeypress:o[4]||(o[4]=e.withKeys(l=>p.value.showTable=!1,["enter"]))},[e.createVNode(Ve.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":K.value})},[e.createElementVNode("table",Ye,[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",Ke,e.toDisplayString(t.value.style.chart.title.subtitle.text),1)):e.createCommentVNode("",!0)],4),e.createElementVNode("thead",null,[e.createElementVNode("tr",{role:"row",style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value.head,l=>(e.openBlock(),e.createElementBlock("th",{style:e.normalizeStyle(`outline:${t.value.table.th.outline}`)},[e.createElementVNode("div",Je,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(b.value)?"":b.value.toFixed(t.value.table.td.roundingValue))+e.toDisplayString(t.value.table.td.suffix),5),e.createElementVNode("th",{style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline};text-align:right;padding-right:5px;font-weight:bold`)},"100%",4),e.createElementVNode("th",{style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline}`)},null,4),e.createElementVNode("th",{style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline}`)},null,4),e.createElementVNode("th",{style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline}`)},null,4),e.createElementVNode("th",{style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline}`)},null,4)])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value.body,(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":g.value.head[0]??""},[e.createElementVNode("div",Ze,[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,Qe),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":g.value.head[1]??""},[e.createElementVNode("div",tt,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,et),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":g.value.head[2]??""},[e.createElementVNode("div",at,e.toDisplayString(["",NaN,void 0].includes(l.percentageToTotal)?"":`${(l.percentageToTotal*100).toFixed(t.value.table.td.roundingPercentage)}%`),1)],12,lt),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":g.value.head[3]??""},[e.createElementVNode("div",nt,e.toDisplayString(l.childName),1)],12,ot),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":g.value.head[4]??""},[e.createElementVNode("div",ut,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,rt),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":g.value.head[5]??""},[e.createElementVNode("div",st,e.toDisplayString(["",NaN,void 0].includes(l.childPercentageToParent)?"":`${(l.childPercentageToParent*100).toFixed(t.value.table.td.roundingPercentage)}%`),1)],12,it),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":g.value.head[6]??""},[e.createElementVNode("div",dt,e.toDisplayString(["",NaN,void 0].includes(l.childPercentageToTotal)?"":`${(l.childPercentageToTotal*100).toFixed(t.value.table.td.roundingPercentage)}%`),1)],12,ct)],6))),256))])])],2)])],512)]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,Ee))}},ht=Be._export_sfc(vt,[["__scopeId","data-v-d4a13ad8"]]);exports.default=ht;
@@ -1,14 +1,14 @@
1
1
  import { computed as d, ref as c, watch as Te, onMounted as je, onBeforeUnmount as We, openBlock as s, createElementBlock as i, normalizeClass as Se, normalizeStyle as q, createBlock as V, createCommentVNode as f, unref as h, createSlots as qe, withCtx as b, renderSlot as w, normalizeProps as H, guardReactiveProps as X, createElementVNode as k, Fragment as T, renderList as M, toDisplayString as S, createTextVNode as Le, createVNode as He, nextTick as Xe, pushScopeId as Ye, popScopeId as Je } from "vue";
2
- import { u as Ke, c as Qe, t as Ze, a as et, p as B, o as tt, e as oe, g as lt, b as at, i as D, f as x, X as ot, v as ut, w as st, E as rt, H as nt, d as it, x as ct, y as vt, q as dt, r as ht } from "./index-Cm4Iry5c.js";
2
+ import { u as Ke, c as Qe, t as Ze, a as et, p as B, o as tt, e as oe, g as lt, b as at, i as D, f as x, X as ot, v as ut, w as st, E as rt, H as nt, d as it, x as ct, y as vt, q as dt, r as ht } from "./index-CaV1s-yZ.js";
3
3
  import { t as yt, u as pt } from "./useResponsive-NZB-WLRF.js";
4
- import { _ as ft } from "./Title-C26I_HC3.js";
5
- import { u as gt, U as mt } from "./usePrinter-B8RnF8_q.js";
6
- import { _ as bt } from "./Tooltip-CH8GmDCG.js";
7
- import { D as wt } from "./DataTable-CQANRZju.js";
8
- import { L as kt } from "./Legend-DX1kv21U.js";
9
- import xt from "./vue-ui-skeleton-C1oUnz7R.js";
10
- import Ct from "./vue-ui-accordion-Cb6XBCbu.js";
11
- import { u as Pe } from "./useNestedProp-CurQIHTa.js";
4
+ import { _ as ft } from "./Title-gUz6GDA3.js";
5
+ import { u as gt, U as mt } from "./usePrinter-rvJyT65A.js";
6
+ import { _ as bt } from "./Tooltip-DfSM1mNP.js";
7
+ import { D as wt } from "./DataTable-e2fnfjXV.js";
8
+ import { L as kt } from "./Legend-5cQ0xZjK.js";
9
+ import xt from "./vue-ui-skeleton-CvFX_ExX.js";
10
+ import Ct from "./vue-ui-accordion-CpzGQ63y.js";
11
+ import { u as Pe } from "./useNestedProp-tWCzZrLx.js";
12
12
  import { _ as _t } from "./_plugin-vue_export-helper-CHgC5LLL.js";
13
13
  const ze = (E) => (Ye("data-v-eaa613a1"), E = E(), Je(), E), $t = ["id"], It = ["xmlns", "viewBox"], Tt = ["id"], St = ["stop-color"], Lt = ["stop-color"], Pt = ["id"], zt = /* @__PURE__ */ ze(() => /* @__PURE__ */ k("feGaussianBlur", {
14
14
  in: "SourceGraphic",