vue-data-ui 2.4.21 → 2.4.22

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 (147) hide show
  1. package/dist/{Arrow-BuVX2WoN.js → Arrow-BW_I0Vmx.js} +1 -1
  2. package/dist/{Arrow-DDe-g8rw.cjs → Arrow-D2zjDsxe.cjs} +1 -1
  3. package/dist/{BaseIcon-BdKOa64A.cjs → BaseIcon-BCC16NCl.cjs} +1 -1
  4. package/dist/{BaseIcon-BRSPQaGQ.js → BaseIcon-BbbAnrZI.js} +1 -1
  5. package/dist/{DataTable-BpVz3DBX.js → DataTable-Ce4R8v-3.js} +2 -2
  6. package/dist/{DataTable-H-KTkjfv.cjs → DataTable-DeevzR8O.cjs} +1 -1
  7. package/dist/{Legend-G5Zc4QaZ.cjs → Legend-BksImVUi.cjs} +1 -1
  8. package/dist/{Legend-hnLfwhmm.js → Legend-C6q2bLVV.js} +1 -1
  9. package/dist/{PackageVersion-BbQFSVXm.cjs → PackageVersion-AftniVVo.cjs} +1 -1
  10. package/dist/{PackageVersion-wqab02xF.js → PackageVersion-g2UOsY7H.js} +1 -1
  11. package/dist/{PenAndPaper-C_laA5mt.js → PenAndPaper-DRFeGfqV.js} +3 -3
  12. package/dist/{PenAndPaper-BX8pR5oV.cjs → PenAndPaper-j5noaKJZ.cjs} +1 -1
  13. package/dist/{Shape-QdnXSUyn.js → Shape-CBu7ails.js} +1 -1
  14. package/dist/{Shape-CJbFv4bs.cjs → Shape-Cf2Cj3g6.cjs} +1 -1
  15. package/dist/{Slicer-DV1kBscZ.js → Slicer-C0bRksfh.js} +2 -2
  16. package/dist/{Slicer-C1blYfez.cjs → Slicer-IneBjcpY.cjs} +1 -1
  17. package/dist/{Title-DBozX6nP.js → Title-B2orjUIW.js} +1 -1
  18. package/dist/{Title-BRqTk-nT.cjs → Title-BxrsVY3-.cjs} +1 -1
  19. package/dist/{Tooltip-DvGSIp31.cjs → Tooltip-BXc56Oxr.cjs} +1 -1
  20. package/dist/{Tooltip-Com_T8vc.js → Tooltip-CXjc5vb3.js} +1 -1
  21. package/dist/{index-CsQwCVqU.cjs → index-3oZdQf6G.cjs} +1 -1
  22. package/dist/{index-hV0hU1iE.js → index-D020Kb3z.js} +1 -1
  23. package/dist/style.css +1 -1
  24. package/dist/{useNestedProp-CRAUOmT5.js → useNestedProp-CZkNAGQh.js} +1 -1
  25. package/dist/{useNestedProp-DSYpaLxP.cjs → useNestedProp-vPTP0Wem.cjs} +1 -1
  26. package/dist/{usePrinter-O2fMMTMe.cjs → usePrinter-BKzxQK4e.cjs} +1 -1
  27. package/dist/{usePrinter-y3d31M4g.js → usePrinter-CN0J0NFL.js} +1 -1
  28. package/dist/{vue-data-ui-qBad3a6z.cjs → vue-data-ui-CWDZLUkp.cjs} +1 -1
  29. package/dist/{vue-data-ui-bEKZH8jG.js → vue-data-ui-e2cclW_4.js} +58 -58
  30. package/dist/vue-data-ui.cjs +1 -1
  31. package/dist/vue-data-ui.js +1 -1
  32. package/dist/{vue-ui-3d-bar-CkqKnqQt.cjs → vue-ui-3d-bar-DCeFCwb0.cjs} +1 -1
  33. package/dist/{vue-ui-3d-bar-f7YaBbrh.js → vue-ui-3d-bar-DggyGAlC.js} +9 -9
  34. package/dist/{vue-ui-accordion-m-s-7akB.js → vue-ui-accordion-B0fEWLwn.js} +3 -3
  35. package/dist/{vue-ui-accordion-CaktYQoo.cjs → vue-ui-accordion-QoJofzqF.cjs} +1 -1
  36. package/dist/{vue-ui-age-pyramid-EKKYQu3N.cjs → vue-ui-age-pyramid-CXtRGpVa.cjs} +1 -1
  37. package/dist/{vue-ui-age-pyramid-DkfNZR86.js → vue-ui-age-pyramid-DGDvfcvP.js} +10 -10
  38. package/dist/{vue-ui-annotator-DrVu5Pu0.js → vue-ui-annotator-BETCQ-pV.js} +1 -1
  39. package/dist/{vue-ui-annotator-v07J6oQG.cjs → vue-ui-annotator-BEZ0D_12.cjs} +1 -1
  40. package/dist/{vue-ui-bullet-CYDMehDZ.js → vue-ui-bullet-BK3d_nhc.js} +8 -8
  41. package/dist/{vue-ui-bullet-CdG92x7A.cjs → vue-ui-bullet-qAGQkwN4.cjs} +1 -1
  42. package/dist/{vue-ui-candlestick-Bw1O3QmK.js → vue-ui-candlestick-DQR8cYLr.js} +11 -11
  43. package/dist/{vue-ui-candlestick-D9yN-yRo.cjs → vue-ui-candlestick-DwfFHSRG.cjs} +1 -1
  44. package/dist/{vue-ui-carousel-table-kcQa0FHw.js → vue-ui-carousel-table-B6TSxUwp.js} +4 -4
  45. package/dist/{vue-ui-carousel-table-Cg6hAEVv.cjs → vue-ui-carousel-table-BrIXFgJp.cjs} +1 -1
  46. package/dist/{vue-ui-chestnut-Qu8c3_vB.cjs → vue-ui-chestnut-CWtw_edx.cjs} +1 -1
  47. package/dist/{vue-ui-chestnut-DE1AMXeX.js → vue-ui-chestnut-CpINqXRz.js} +8 -8
  48. package/dist/{vue-ui-cursor-DG8oufeh.cjs → vue-ui-cursor-DvX6FbhZ.cjs} +1 -1
  49. package/dist/{vue-ui-cursor-DbfjKtpf.js → vue-ui-cursor-yI58QC1O.js} +2 -2
  50. package/dist/{vue-ui-dashboard-BbwgfxLx.cjs → vue-ui-dashboard-BCic2CfN.cjs} +1 -1
  51. package/dist/{vue-ui-dashboard-CAkCNUBh.js → vue-ui-dashboard-Bb7vJ0Nx.js} +2 -2
  52. package/dist/{vue-ui-digits-DgQkxULm.cjs → vue-ui-digits-C4dI1v6b.cjs} +1 -1
  53. package/dist/{vue-ui-digits-BaXAiH4u.js → vue-ui-digits-D4uy7_hL.js} +2 -2
  54. package/dist/{vue-ui-donut-7GM_Wd1Y.js → vue-ui-donut-CRiEc5mP.js} +11 -11
  55. package/dist/{vue-ui-donut-BHzCOBu6.cjs → vue-ui-donut-ClvjMOxC.cjs} +1 -1
  56. package/dist/{vue-ui-donut-evolution-C-TkUOr6.cjs → vue-ui-donut-evolution-DFkGtmhv.cjs} +1 -1
  57. package/dist/{vue-ui-donut-evolution-DbU4RlP6.js → vue-ui-donut-evolution-DgrQVEh2.js} +11 -11
  58. package/dist/{vue-ui-dumbbell-DacMeiTU.cjs → vue-ui-dumbbell-BdkARfxX.cjs} +1 -1
  59. package/dist/{vue-ui-dumbbell-BacTx3zB.js → vue-ui-dumbbell-QCB4jZm4.js} +10 -10
  60. package/dist/{vue-ui-flow-D2G0YWL9.js → vue-ui-flow-CRnCk5Is.js} +9 -9
  61. package/dist/{vue-ui-flow-BUAvjG7i.cjs → vue-ui-flow-CYfdTIad.cjs} +1 -1
  62. package/dist/{vue-ui-galaxy-CxfV3BIw.cjs → vue-ui-galaxy-Cn9t3BG5.cjs} +1 -1
  63. package/dist/{vue-ui-galaxy-D6RFyIbQ.js → vue-ui-galaxy-WhRsA1Is.js} +11 -11
  64. package/dist/{vue-ui-gauge-DNJXnyLw.js → vue-ui-gauge-DwmCZiTj.js} +7 -7
  65. package/dist/{vue-ui-gauge-CJ5TKJpb.cjs → vue-ui-gauge-jYskVFUy.cjs} +1 -1
  66. package/dist/{vue-ui-gizmo-BBA51j_0.cjs → vue-ui-gizmo-C2P2qQYU.cjs} +1 -1
  67. package/dist/{vue-ui-gizmo-Db7-gRmB.js → vue-ui-gizmo-DpEZm4Uk.js} +3 -3
  68. package/dist/{vue-ui-heatmap-KQj8Jbpt.cjs → vue-ui-heatmap-D7TGNxC-.cjs} +1 -1
  69. package/dist/{vue-ui-heatmap-Ba6RMSTk.js → vue-ui-heatmap-u3SOjwts.js} +10 -10
  70. package/dist/{vue-ui-kpi-1srKxA1L.cjs → vue-ui-kpi-CCr0pHjp.cjs} +1 -1
  71. package/dist/{vue-ui-kpi-C8wyHy1H.js → vue-ui-kpi-Cdz5RM6j.js} +3 -3
  72. package/dist/{vue-ui-mini-loader-DutVmCuC.js → vue-ui-mini-loader-B2Xh0j5H.js} +2 -2
  73. package/dist/{vue-ui-mini-loader-BgKTecng.cjs → vue-ui-mini-loader-BuCeYPNP.cjs} +1 -1
  74. package/dist/{vue-ui-molecule-BOkIojio.js → vue-ui-molecule-GPDqR2rp.js} +11 -11
  75. package/dist/{vue-ui-molecule-CSezTn3m.cjs → vue-ui-molecule-z1A47zG1.cjs} +1 -1
  76. package/dist/{vue-ui-mood-radar-C8U8PHaq.js → vue-ui-mood-radar-DdQC5bH5.js} +11 -11
  77. package/dist/{vue-ui-mood-radar-CNTDrRs6.cjs → vue-ui-mood-radar-YZfCADah.cjs} +1 -1
  78. package/dist/{vue-ui-nested-donuts-DRWWnsdR.cjs → vue-ui-nested-donuts-CDSRcEX0.cjs} +1 -1
  79. package/dist/{vue-ui-nested-donuts-Bv2D1uFd.js → vue-ui-nested-donuts-Cf_KfoeP.js} +11 -11
  80. package/dist/{vue-ui-onion-CsnwbXED.cjs → vue-ui-onion-CmGZo3Sf.cjs} +1 -1
  81. package/dist/{vue-ui-onion-CT9YjU8v.js → vue-ui-onion-Lw3ohFAX.js} +11 -11
  82. package/dist/{vue-ui-parallel-coordinate-plot-C8KCRAX1.cjs → vue-ui-parallel-coordinate-plot-AHpf7ejC.cjs} +1 -1
  83. package/dist/{vue-ui-parallel-coordinate-plot-in5qpfXf.js → vue-ui-parallel-coordinate-plot-BsT0r0hr.js} +12 -12
  84. package/dist/{vue-ui-quadrant-Bw-0aW4F.cjs → vue-ui-quadrant-BPUIyB4-.cjs} +1 -1
  85. package/dist/{vue-ui-quadrant-C_9VNAXg.js → vue-ui-quadrant-BTmoe6UT.js} +12 -12
  86. package/dist/{vue-ui-quick-chart-C0YqMjyE.cjs → vue-ui-quick-chart-BYyXa06h.cjs} +1 -1
  87. package/dist/{vue-ui-quick-chart-BDBlm9uu.js → vue-ui-quick-chart-CRtE0pcc.js} +9 -9
  88. package/dist/{vue-ui-radar-C2QM_ee9.js → vue-ui-radar-BpkjOSOI.js} +12 -12
  89. package/dist/{vue-ui-radar-DXKMbeyW.cjs → vue-ui-radar-krdMX_hl.cjs} +1 -1
  90. package/dist/{vue-ui-rating-CsOknvaV.cjs → vue-ui-rating-9kj9GE7P.cjs} +1 -1
  91. package/dist/{vue-ui-rating-DVpgv2AY.js → vue-ui-rating-D1RlkwK9.js} +2 -2
  92. package/dist/{vue-ui-relation-circle-OXfdAyky.js → vue-ui-relation-circle-B7WGb08k.js} +7 -7
  93. package/dist/{vue-ui-relation-circle-ZA-M7aSc.cjs → vue-ui-relation-circle-Kv3G0P5k.cjs} +1 -1
  94. package/dist/{vue-ui-rings-qLQ-gl21.js → vue-ui-rings-DjXcLsY1.js} +11 -11
  95. package/dist/{vue-ui-rings-rftqDu-q.cjs → vue-ui-rings-DsZPnoqm.cjs} +1 -1
  96. package/dist/{vue-ui-scatter-Cv2IcrVH.cjs → vue-ui-scatter-D3ntjnfT.cjs} +1 -1
  97. package/dist/{vue-ui-scatter-4LbMvEAD.js → vue-ui-scatter-DEkTyyG8.js} +12 -12
  98. package/dist/{vue-ui-screenshot-BgjnQNxG.cjs → vue-ui-screenshot-BEbUxjNl.cjs} +1 -1
  99. package/dist/{vue-ui-screenshot-BV6ZYQRk.js → vue-ui-screenshot-kiJVXAGt.js} +1 -1
  100. package/dist/{vue-ui-skeleton-DsRTbz6d.cjs → vue-ui-skeleton-CI8sxaqr.cjs} +1 -1
  101. package/dist/{vue-ui-skeleton-BY8Jg9a_.js → vue-ui-skeleton-E1-7diF5.js} +3 -3
  102. package/dist/{vue-ui-smiley-BQ_3uicm.js → vue-ui-smiley-Cjbqlfre.js} +2 -2
  103. package/dist/{vue-ui-smiley-DB3y8CIb.cjs → vue-ui-smiley-CmkUQtfb.cjs} +1 -1
  104. package/dist/{vue-ui-spark-trend-Cgn7ONtS.cjs → vue-ui-spark-trend-C60Ypeev.cjs} +1 -1
  105. package/dist/{vue-ui-spark-trend-BhCJfY_p.js → vue-ui-spark-trend-DfpFe1UQ.js} +5 -5
  106. package/dist/{vue-ui-sparkbar-DxXt-GHr.js → vue-ui-sparkbar-B5oV2RUs.js} +4 -4
  107. package/dist/{vue-ui-sparkbar-D4GIhUXT.cjs → vue-ui-sparkbar-BAa71eZp.cjs} +1 -1
  108. package/dist/{vue-ui-sparkgauge-BbltbIrq.cjs → vue-ui-sparkgauge-UejPQm4b.cjs} +1 -1
  109. package/dist/{vue-ui-sparkgauge-BCPkJveV.js → vue-ui-sparkgauge-xlERw-g0.js} +4 -4
  110. package/dist/{vue-ui-sparkhistogram-DzX6lkk8.cjs → vue-ui-sparkhistogram-DC4jzkI0.cjs} +1 -1
  111. package/dist/{vue-ui-sparkhistogram-BKcr2mFc.js → vue-ui-sparkhistogram-nzFRlmgx.js} +5 -5
  112. package/dist/{vue-ui-sparkline-C-svTmFU.cjs → vue-ui-sparkline-BT4hxfBE.cjs} +1 -1
  113. package/dist/{vue-ui-sparkline-DYHUFUOp.js → vue-ui-sparkline-Duu0VrnG.js} +4 -4
  114. package/dist/{vue-ui-sparkstackbar-CL0uL_Te.cjs → vue-ui-sparkstackbar-K_vPau1u.cjs} +1 -1
  115. package/dist/{vue-ui-sparkstackbar-Btag2osm.js → vue-ui-sparkstackbar-tyoFIhva.js} +5 -5
  116. package/dist/{vue-ui-stackbar-CML7v_yU.cjs → vue-ui-stackbar-DRlvF164.cjs} +1 -1
  117. package/dist/{vue-ui-stackbar-C2mRU7ya.js → vue-ui-stackbar-e8BUjttp.js} +12 -12
  118. package/dist/{vue-ui-strip-plot-Vn5sEcME.cjs → vue-ui-strip-plot-8MOhIicL.cjs} +1 -1
  119. package/dist/{vue-ui-strip-plot-BIXF3VxN.js → vue-ui-strip-plot-Ef8oKjNV.js} +11 -11
  120. package/dist/{vue-ui-table-CyuRalnp.js → vue-ui-table-BOV6jtcL.js} +1 -1
  121. package/dist/{vue-ui-table-BbVpmm0B.cjs → vue-ui-table-DfevkNnK.cjs} +1 -1
  122. package/dist/{vue-ui-table-heatmap-DrQXQd41.cjs → vue-ui-table-heatmap-BMyRP1ol.cjs} +1 -1
  123. package/dist/{vue-ui-table-heatmap-DlGeS3l9.js → vue-ui-table-heatmap-CL-MybKI.js} +4 -4
  124. package/dist/{vue-ui-table-sparkline-DauDTktD.cjs → vue-ui-table-sparkline-CsqcT3ff.cjs} +1 -1
  125. package/dist/{vue-ui-table-sparkline-Yg2I33yZ.js → vue-ui-table-sparkline-DXvxiDJJ.js} +5 -5
  126. package/dist/{vue-ui-thermometer-Bglz0dOQ.cjs → vue-ui-thermometer-DyYqfAOW.cjs} +1 -1
  127. package/dist/{vue-ui-thermometer-DXwbqNrn.js → vue-ui-thermometer-WKzTNOOX.js} +7 -7
  128. package/dist/{vue-ui-timer-Brr7buaM.js → vue-ui-timer-CFDkyaxV.js} +5 -5
  129. package/dist/{vue-ui-timer-CpSEl8UD.cjs → vue-ui-timer-DQQGe1jt.cjs} +1 -1
  130. package/dist/{vue-ui-tiremarks-zdGmZNjo.cjs → vue-ui-tiremarks-C8iAWe-u.cjs} +1 -1
  131. package/dist/{vue-ui-tiremarks-DJowPFwY.js → vue-ui-tiremarks-aiUC8-YL.js} +7 -7
  132. package/dist/{vue-ui-treemap-a7NSP656.cjs → vue-ui-treemap-BORZ3g1I.cjs} +1 -1
  133. package/dist/{vue-ui-treemap-Bn5JU5BI.js → vue-ui-treemap-Bw-bWkza.js} +11 -11
  134. package/dist/{vue-ui-vertical-bar-CZxN7L9z.js → vue-ui-vertical-bar--mYbTcpi.js} +11 -11
  135. package/dist/{vue-ui-vertical-bar-BYG1vGlT.cjs → vue-ui-vertical-bar-B3ypOHUB.cjs} +1 -1
  136. package/dist/{vue-ui-waffle-CzUpKfkZ.js → vue-ui-waffle-Bj-tJs4n.js} +11 -11
  137. package/dist/{vue-ui-waffle-BbDBOivH.cjs → vue-ui-waffle-_84Hvek7.cjs} +1 -1
  138. package/dist/{vue-ui-wheel-CCje_ZSc.js → vue-ui-wheel-BywwqvY2.js} +7 -7
  139. package/dist/{vue-ui-wheel-lN3uYCr4.cjs → vue-ui-wheel-C-v9TgG1.cjs} +1 -1
  140. package/dist/{vue-ui-word-cloud-BjvG3n7x.cjs → vue-ui-word-cloud-CaQ4jLed.cjs} +1 -1
  141. package/dist/{vue-ui-word-cloud-D_5y92zN.js → vue-ui-word-cloud-CwExwCYc.js} +10 -10
  142. package/dist/{vue-ui-xy-Drm1aAb-.js → vue-ui-xy-CAYxRDzC.js} +14 -14
  143. package/dist/{vue-ui-xy-B-WlwJXZ.cjs → vue-ui-xy-CT3-xPpa.cjs} +1 -1
  144. package/dist/{vue-ui-xy-canvas-jieVsnBN.js → vue-ui-xy-canvas-BOElCo0f.js} +133 -131
  145. package/dist/vue-ui-xy-canvas-CdrfnVuI.cjs +9 -0
  146. package/package.json +1 -1
  147. package/dist/vue-ui-xy-canvas-BHrq_CYD.cjs +0 -9
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-CsQwCVqU.cjs"),P=require("./useNestedProp-DSYpaLxP.cjs"),J=require("./vue-ui-sparkline-C-svTmFU.cjs"),K=require("./BaseIcon-BdKOa64A.cjs"),D=require("./usePrinter-O2fMMTMe.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={key:0,ref:"source",dir:"auto"},ie={__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=>({"588e7231":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=P.useNestedProp({userConfig:d.config,defaultConfig:W});return l.theme?{...P.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(),E(),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(()=>{E()});function E(){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 A=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(A.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 $(){e.nextTick(()=>{const l=[t.value.translations.serie].concat(m.value),s=A.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:$,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,position:t.value.userOptions.position,onToggleFullscreen:X,onGeneratePdf:e.unref(I),onGenerateImage:e.unref(N),onGenerateCsv:$},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","position","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),l.$slots.source?(e.openBlock(),e.createElementBlock("div",se,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0)],10,Y))}},de=Q._export_sfc(ie,[["__scopeId","data-v-1516623f"]]);exports.default=de;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-3oZdQf6G.cjs"),P=require("./useNestedProp-vPTP0Wem.cjs"),J=require("./vue-ui-sparkline-BT4hxfBE.cjs"),K=require("./BaseIcon-BCC16NCl.cjs"),D=require("./usePrinter-BKzxQK4e.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={key:0,ref:"source",dir:"auto"},ie={__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=>({"588e7231":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=P.useNestedProp({userConfig:d.config,defaultConfig:W});return l.theme?{...P.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(),E(),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(()=>{E()});function E(){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 A=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(A.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 $(){e.nextTick(()=>{const l=[t.value.translations.serie].concat(m.value),s=A.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:$,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,position:t.value.userOptions.position,onToggleFullscreen:X,onGeneratePdf:e.unref(I),onGenerateImage:e.unref(N),onGenerateCsv:$},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","position","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),l.$slots.source?(e.openBlock(),e.createElementBlock("div",se,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0)],10,Y))}},de=Q._export_sfc(ie,[["__scopeId","data-v-1516623f"]]);exports.default=de;
@@ -1,9 +1,9 @@
1
1
  import { useCssVars as ve, ref as v, computed as h, watch as Q, onMounted as ce, openBlock as s, createElementBlock as i, normalizeClass as D, createElementVNode as c, normalizeStyle as r, toDisplayString as p, createCommentVNode as m, Fragment as T, renderList as M, createBlock as V, unref as d, createSlots as fe, withCtx as A, renderSlot as C, normalizeProps as pe, guardReactiveProps as me, nextTick as be } from "vue";
2
- import { u as ge, c as he, t as ye, a as _e, p as $, b as ke, o as xe, e as Y, g as Ce, d as Ie, $ as Se, i as P, f as z, q as we, r as Ae } from "./index-hV0hU1iE.js";
3
- import { u as Z } from "./useNestedProp-CRAUOmT5.js";
4
- import $e from "./vue-ui-sparkline-DYHUFUOp.js";
5
- import Pe from "./BaseIcon-BRSPQaGQ.js";
6
- import { u as ze, U as Fe } from "./usePrinter-y3d31M4g.js";
2
+ import { u as ge, c as he, t as ye, a as _e, p as $, b as ke, o as xe, e as Y, g as Ce, d as Ie, $ as Se, i as P, f as z, q as we, r as Ae } from "./index-D020Kb3z.js";
3
+ import { u as Z } from "./useNestedProp-CZkNAGQh.js";
4
+ import $e from "./vue-ui-sparkline-Duu0VrnG.js";
5
+ import Pe from "./BaseIcon-BbbAnrZI.js";
6
+ import { u as ze, U as Fe } from "./usePrinter-CN0J0NFL.js";
7
7
  import { _ as Oe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
8
8
  const Ne = ["id"], We = { style: { "z-index": "1", "padding-right": "24px" } }, De = ["onClick"], Te = { style: { display: "flex", "flex-direction": "row", gap: "3px", "align-items": "center" } }, Me = ["data-cell"], Ve = {
9
9
  dir: "auto",
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-CsQwCVqU.cjs"),Q=require("./Title-BRqTk-nT.cjs"),A=require("./usePrinter-O2fMMTMe.cjs"),Z=require("./vue-ui-skeleton-DsRTbz6d.cjs"),T=require("./useNestedProp-DSYpaLxP.cjs"),ee=require("./PackageVersion-BbQFSVXm.cjs"),te=require("./PenAndPaper-BX8pR5oV.cjs"),oe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),le=["id"],re={key:1,ref:"noTitle",class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},ae={key:2,style:"width:100%"},se=["xmlns","viewBox"],ne={id:"vueUiPill",clipPathUnits:"objectBoundingBox"},ue=["fill"],ce=["id"],ie=["stop-color"],de=["stop-color"],he=["stop-color"],ve={"clip-path":"url(#vueUiPill)"},me=["x","y","height","width"],pe=["x","y","height","width","fill"],ye=["x1","x2","y1","y2","stroke-width","stroke"],fe=["x1","x2","y1","y2","stroke-width","stroke"],ke=["x1","x2","y1","y2","stroke-width","stroke"],ge=["x1","x2","y1","y2","stroke-width","stroke"],xe=["x1","x2","y1","y2","stroke-width","stroke"],be=["x1","x2","y1","y2","stroke-width","stroke"],_e=["x1","x2","y1","y2","stroke-width","stroke"],Ce=["x1","x2","y1","y2","stroke-width","stroke"],we=["x","y","height","width"],Ne=["y","x","fill","font-size","font-weight"],Be={key:5,class:"vue-data-ui-watermark"},Pe={key:6,ref:"source",dir:"auto"},Ve={__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=>({"000db494":H.value,"2865ccd0":W.value,10843485:G.value}));const{vue_ui_thermometer:M}=r.useConfig(),k=e.computed(()=>!!s.dataset&&Object.keys(s.dataset).length);e.onMounted(()=>{B()});function B(){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()),g=e.ref(null),P=e.ref(0),V=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(),B(),V.value+=1},{deep:!0});const{isPrinting:$,isImaging:F,generatePdf:I,generateImage:q}=A.usePrinter({elementId:`thermometer__${d.value}`,fileName:t.value.style.title.text||"vue-ui-thermometer"}),z=e.computed(()=>t.value.userOptions.show&&!t.value.style.title.text),p=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),L=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 y(l,u,o){const n=[],w=S(l),N=S(u);for(let v=0;v<o;v++){const R=x(w.red,N.red,v,o),X=x(w.green,N.green,v,o),J=x(w.blue,N.blue,v,o),K=`#${b(R)}${b(X)}${b(J)}`;n.push(K)}return n}function S(l){const u=l.slice(1);return{red:parseInt(u.slice(0,2),16),green:parseInt(u.slice(2,4),16),blue:parseInt(u.slice(4,6),16)}}function x(l,u,o,n){return Math.round(l+(u-l)*o/n)}function b(l){return l.toString(16).padStart(2,"0")}const a=e.computed(()=>{const l=L.value+c.value.left+c.value.right,u=t.value.style.chart.height;return{width:l,left:c.value.left,right:l-c.value.right,top:c.value.top,bottom:u-c.value.bottom,height:u}}),U=e.computed(()=>a.value),_=e.computed(()=>{const l=r.checkNaN(s.dataset.from)<0?Math.abs(r.checkNaN(s.dataset.from)):r.checkNaN(s.dataset.from),u=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+u:l>u?o=l-u:o=u-l,(1-(Math.abs(r.checkNaN(s.dataset.from))+r.checkNaN(s.dataset.value))/o)*(a.value.height-c.value.top-c.value.bottom)}),G=e.computed(()=>`${_.value}px`),W=e.computed(()=>`${a.value.height-t.value.style.chart.padding.bottom-c.value.top}px`),H=e.computed(()=>`${t.value.style.chart.animation.speedMs}ms`),j=e.computed(()=>{if(s.dataset.colors){if(!s.dataset.colors.from)return y(p.value[0]||r.palette[0],r.convertColorToHex(s.dataset.colors.to),i.value||10);if(!s.dataset.colors.to)return y(r.convertColorToHex(s.dataset.colors.from),p.value[1]||r.palette[1],i.value||10)}else return y(p.value[1]||r.palette[1],p.value[0]||r.palette[0],i.value||10);return y(r.convertColorToHex(s.dataset.colors.from),r.convertColorToHex(s.dataset.colors.to),i.value||10)}),O=e.computed(()=>{const l=[];let u=0;const o=a.value.height-c.value.top-c.value.bottom;for(let n=0;n<o-1;n+=o/i.value)l.push({x:a.value.left,y:a.value.top+n,qYLess:a.value.top+n+o/i.value/4,halfY:a.value.top+n+o/i.value/2,qYMore:a.value.top+n+o/i.value/4*3,color:j.value[u],height:o/i.value}),u+=1;return l}),h=e.ref(!1);function D(l){h.value=l,P.value+=1}const f=e.ref(!1);function C(){f.value=!f.value}return Y({generatePdf:I,generateImage:q,toggleAnnotator:C}),(l,u)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"thermoChart",ref:g,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.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(te.PenAndPaper,{key:0,parent:g.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:f.value,onClose:C},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),z.value?(e.openBlock(),e.createElementBlock("div",re,null,512)):e.createCommentVNode("",!0),t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",ae,[(e.openBlock(),e.createBlock(Q._sfc_main,{key:`title_${V.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&&k.value?(e.openBlock(),e.createBlock(A.UserOptions,{ref:"details",key:`user_options_${P.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(F),isPrinting:e.unref($),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:g.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:f.value,onToggleFullscreen:D,onGeneratePdf:e.unref(I),onGenerateImage:e.unref(q),onToggleAnnotator:C},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:n})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:n})),void 0,!0)]),key:"2"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:n})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:n})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),k.value?(e.openBlock(),e.createElementBlock("svg",{key:4,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:"background:transparent"},[e.createVNode(ee._sfc_main),e.createElementVNode("defs",null,[e.createElementVNode("clipPath",ne,[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,ue)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O.value,(o,n)=>(e.openBlock(),e.createElementBlock("linearGradient",{id:`vueUiThermometerGradient_${n}_${d.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":o.color},null,8,ie),e.createElementVNode("stop",{offset:"50%","stop-color":e.unref(r.setOpacity)(o.color,100-t.value.style.chart.graduations.gradient.intensity)},null,8,de),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,he)],8,ce))),256))]),e.createElementVNode("g",ve,[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,me),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O.value,(o,n)=>(e.openBlock(),e.createElementBlock("g",{key:`graduation_${n}`},[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_${n}_${d.value})`:o.color,"shape-rendering":"crispEdges"},null,8,pe),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,ye)):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,fe)):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,ke)):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,ge)):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,xe)):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,be)):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,_e)):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,Ce)):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:_.value,width:a.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right,fill:"#FFFFFF66"},null,10,we)]),e.createElementVNode("text",{class:e.normalizeClass({"vue-ui-thermometer-temperature-value":t.value.style.chart.animation.use}),y:_.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,Ne),e.renderSlot(l.$slots,"svg",{svg:U.value},void 0,!0)],10,se)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Be,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref($)||e.unref(F)})),void 0,!0)])):e.createCommentVNode("",!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",Pe,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),k.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Z.default,{key:7,config:{type:"thermometer",style:{backgroundColor:t.value.style.chart.backgroundColor,thermometer:{color:"#CCCCCC"}}}},null,8,["config"]))],14,le))}},Ee=oe._export_sfc(Ve,[["__scopeId","data-v-8a73571f"]]);exports.default=Ee;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-3oZdQf6G.cjs"),Q=require("./Title-BxrsVY3-.cjs"),A=require("./usePrinter-BKzxQK4e.cjs"),Z=require("./vue-ui-skeleton-CI8sxaqr.cjs"),T=require("./useNestedProp-vPTP0Wem.cjs"),ee=require("./PackageVersion-AftniVVo.cjs"),te=require("./PenAndPaper-j5noaKJZ.cjs"),oe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),le=["id"],re={key:1,ref:"noTitle",class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},ae={key:2,style:"width:100%"},se=["xmlns","viewBox"],ne={id:"vueUiPill",clipPathUnits:"objectBoundingBox"},ue=["fill"],ce=["id"],ie=["stop-color"],de=["stop-color"],he=["stop-color"],ve={"clip-path":"url(#vueUiPill)"},me=["x","y","height","width"],pe=["x","y","height","width","fill"],ye=["x1","x2","y1","y2","stroke-width","stroke"],fe=["x1","x2","y1","y2","stroke-width","stroke"],ke=["x1","x2","y1","y2","stroke-width","stroke"],ge=["x1","x2","y1","y2","stroke-width","stroke"],xe=["x1","x2","y1","y2","stroke-width","stroke"],be=["x1","x2","y1","y2","stroke-width","stroke"],_e=["x1","x2","y1","y2","stroke-width","stroke"],Ce=["x1","x2","y1","y2","stroke-width","stroke"],we=["x","y","height","width"],Ne=["y","x","fill","font-size","font-weight"],Be={key:5,class:"vue-data-ui-watermark"},Pe={key:6,ref:"source",dir:"auto"},Ve={__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=>({"000db494":H.value,"2865ccd0":W.value,10843485:G.value}));const{vue_ui_thermometer:M}=r.useConfig(),k=e.computed(()=>!!s.dataset&&Object.keys(s.dataset).length);e.onMounted(()=>{B()});function B(){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()),g=e.ref(null),P=e.ref(0),V=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(),B(),V.value+=1},{deep:!0});const{isPrinting:$,isImaging:F,generatePdf:I,generateImage:q}=A.usePrinter({elementId:`thermometer__${d.value}`,fileName:t.value.style.title.text||"vue-ui-thermometer"}),z=e.computed(()=>t.value.userOptions.show&&!t.value.style.title.text),p=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),L=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 y(l,u,o){const n=[],w=S(l),N=S(u);for(let v=0;v<o;v++){const R=x(w.red,N.red,v,o),X=x(w.green,N.green,v,o),J=x(w.blue,N.blue,v,o),K=`#${b(R)}${b(X)}${b(J)}`;n.push(K)}return n}function S(l){const u=l.slice(1);return{red:parseInt(u.slice(0,2),16),green:parseInt(u.slice(2,4),16),blue:parseInt(u.slice(4,6),16)}}function x(l,u,o,n){return Math.round(l+(u-l)*o/n)}function b(l){return l.toString(16).padStart(2,"0")}const a=e.computed(()=>{const l=L.value+c.value.left+c.value.right,u=t.value.style.chart.height;return{width:l,left:c.value.left,right:l-c.value.right,top:c.value.top,bottom:u-c.value.bottom,height:u}}),U=e.computed(()=>a.value),_=e.computed(()=>{const l=r.checkNaN(s.dataset.from)<0?Math.abs(r.checkNaN(s.dataset.from)):r.checkNaN(s.dataset.from),u=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+u:l>u?o=l-u:o=u-l,(1-(Math.abs(r.checkNaN(s.dataset.from))+r.checkNaN(s.dataset.value))/o)*(a.value.height-c.value.top-c.value.bottom)}),G=e.computed(()=>`${_.value}px`),W=e.computed(()=>`${a.value.height-t.value.style.chart.padding.bottom-c.value.top}px`),H=e.computed(()=>`${t.value.style.chart.animation.speedMs}ms`),j=e.computed(()=>{if(s.dataset.colors){if(!s.dataset.colors.from)return y(p.value[0]||r.palette[0],r.convertColorToHex(s.dataset.colors.to),i.value||10);if(!s.dataset.colors.to)return y(r.convertColorToHex(s.dataset.colors.from),p.value[1]||r.palette[1],i.value||10)}else return y(p.value[1]||r.palette[1],p.value[0]||r.palette[0],i.value||10);return y(r.convertColorToHex(s.dataset.colors.from),r.convertColorToHex(s.dataset.colors.to),i.value||10)}),O=e.computed(()=>{const l=[];let u=0;const o=a.value.height-c.value.top-c.value.bottom;for(let n=0;n<o-1;n+=o/i.value)l.push({x:a.value.left,y:a.value.top+n,qYLess:a.value.top+n+o/i.value/4,halfY:a.value.top+n+o/i.value/2,qYMore:a.value.top+n+o/i.value/4*3,color:j.value[u],height:o/i.value}),u+=1;return l}),h=e.ref(!1);function D(l){h.value=l,P.value+=1}const f=e.ref(!1);function C(){f.value=!f.value}return Y({generatePdf:I,generateImage:q,toggleAnnotator:C}),(l,u)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"thermoChart",ref:g,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.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(te.PenAndPaper,{key:0,parent:g.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:f.value,onClose:C},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),z.value?(e.openBlock(),e.createElementBlock("div",re,null,512)):e.createCommentVNode("",!0),t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",ae,[(e.openBlock(),e.createBlock(Q._sfc_main,{key:`title_${V.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&&k.value?(e.openBlock(),e.createBlock(A.UserOptions,{ref:"details",key:`user_options_${P.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(F),isPrinting:e.unref($),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:g.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:f.value,onToggleFullscreen:D,onGeneratePdf:e.unref(I),onGenerateImage:e.unref(q),onToggleAnnotator:C},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:n})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:n})),void 0,!0)]),key:"2"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:n})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:n})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),k.value?(e.openBlock(),e.createElementBlock("svg",{key:4,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:"background:transparent"},[e.createVNode(ee._sfc_main),e.createElementVNode("defs",null,[e.createElementVNode("clipPath",ne,[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,ue)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O.value,(o,n)=>(e.openBlock(),e.createElementBlock("linearGradient",{id:`vueUiThermometerGradient_${n}_${d.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":o.color},null,8,ie),e.createElementVNode("stop",{offset:"50%","stop-color":e.unref(r.setOpacity)(o.color,100-t.value.style.chart.graduations.gradient.intensity)},null,8,de),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,he)],8,ce))),256))]),e.createElementVNode("g",ve,[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,me),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O.value,(o,n)=>(e.openBlock(),e.createElementBlock("g",{key:`graduation_${n}`},[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_${n}_${d.value})`:o.color,"shape-rendering":"crispEdges"},null,8,pe),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,ye)):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,fe)):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,ke)):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,ge)):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,xe)):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,be)):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,_e)):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,Ce)):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:_.value,width:a.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right,fill:"#FFFFFF66"},null,10,we)]),e.createElementVNode("text",{class:e.normalizeClass({"vue-ui-thermometer-temperature-value":t.value.style.chart.animation.use}),y:_.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,Ne),e.renderSlot(l.$slots,"svg",{svg:U.value},void 0,!0)],10,se)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Be,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref($)||e.unref(F)})),void 0,!0)])):e.createCommentVNode("",!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",Pe,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),k.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Z.default,{key:7,config:{type:"thermometer",style:{backgroundColor:t.value.style.chart.backgroundColor,thermometer:{color:"#CCCCCC"}}}},null,8,["config"]))],14,le))}},Ee=oe._export_sfc(Ve,[["__scopeId","data-v-8a73571f"]]);exports.default=Ee;
@@ -1,11 +1,11 @@
1
1
  import { useCssVars as ye, computed as h, onMounted as fe, ref as g, watch as ge, openBlock as l, createElementBlock as u, normalizeClass as P, normalizeStyle as me, createBlock as F, createCommentVNode as i, unref as v, createSlots as pe, withCtx as I, renderSlot as m, normalizeProps as G, guardReactiveProps as V, createVNode as ke, createElementVNode as d, Fragment as O, renderList as K, toDisplayString as be } from "vue";
2
- import { u as _e, o as xe, e as Q, g as we, c as Ce, t as $e, a as Pe, p as _, b as Fe, v as f, d as A, X as Ie, s as Oe, i as Ae, f as Ye } from "./index-hV0hU1iE.js";
3
- import { _ as Ne } from "./Title-DBozX6nP.js";
4
- import { u as Me, U as Te } from "./usePrinter-y3d31M4g.js";
5
- import Se from "./vue-ui-skeleton-BY8Jg9a_.js";
6
- import { u as Z } from "./useNestedProp-CRAUOmT5.js";
7
- import { _ as Ue } from "./PackageVersion-wqab02xF.js";
8
- import { P as qe } from "./PenAndPaper-C_laA5mt.js";
2
+ import { u as _e, o as xe, e as Q, g as we, c as Ce, t as $e, a as Pe, p as _, b as Fe, v as f, d as A, X as Ie, s as Oe, i as Ae, f as Ye } from "./index-D020Kb3z.js";
3
+ import { _ as Ne } from "./Title-B2orjUIW.js";
4
+ import { u as Me, U as Te } from "./usePrinter-CN0J0NFL.js";
5
+ import Se from "./vue-ui-skeleton-E1-7diF5.js";
6
+ import { u as Z } from "./useNestedProp-CZkNAGQh.js";
7
+ import { _ as Ue } from "./PackageVersion-g2UOsY7H.js";
8
+ import { P as qe } from "./PenAndPaper-DRFeGfqV.js";
9
9
  import { _ as Le } from "./_plugin-vue_export-helper-CHgC5LLL.js";
10
10
  const Ge = ["id"], Ve = {
11
11
  key: 1,
@@ -1,10 +1,10 @@
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, createVNode as M, createElementVNode as C, mergeProps as V, renderSlot as E, normalizeProps as O, guardReactiveProps as U, toDisplayString as ae } from "vue";
2
- import { u as se } from "./useNestedProp-CRAUOmT5.js";
3
- import { u as le, c as oe, X as re, E as W } from "./index-hV0hU1iE.js";
2
+ import { u as se } from "./useNestedProp-CZkNAGQh.js";
3
+ import { u as le, c as oe, X as re, E as W } from "./index-D020Kb3z.js";
4
4
  import { t as ue, u as ie } from "./useResponsive-CoxXLe23.js";
5
- import P from "./BaseIcon-BRSPQaGQ.js";
6
- import { _ as ne } from "./Title-DBozX6nP.js";
7
- import { _ as ce } from "./PackageVersion-wqab02xF.js";
5
+ import P from "./BaseIcon-BbbAnrZI.js";
6
+ import { _ as ne } from "./Title-B2orjUIW.js";
7
+ import { _ as ce } from "./PackageVersion-g2UOsY7H.js";
8
8
  import { _ as de } from "./_plugin-vue_export-helper-CHgC5LLL.js";
9
9
  class he {
10
10
  constructor(A, k, T, H = !0, x = !0) {
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),L=require("./useNestedProp-DSYpaLxP.cjs"),g=require("./index-CsQwCVqU.cjs"),$=require("./useResponsive-BJ7DTGpm.cjs"),B=require("./BaseIcon-BdKOa64A.cjs"),j=require("./Title-BRqTk-nT.cjs"),q=require("./PackageVersion-BbQFSVXm.cjs"),O=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");class U{constructor(T,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-vPTP0Wem.cjs"),g=require("./index-3oZdQf6G.cjs"),$=require("./useResponsive-BJ7DTGpm.cjs"),B=require("./BaseIcon-BCC16NCl.cjs"),j=require("./Title-BxrsVY3-.cjs"),q=require("./PackageVersion-AftniVVo.cjs"),O=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");class U{constructor(T,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 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),V=require("./useNestedProp-DSYpaLxP.cjs"),c=require("./index-CsQwCVqU.cjs"),X=require("./Title-BRqTk-nT.cjs"),L=require("./usePrinter-O2fMMTMe.cjs"),Y=require("./vue-ui-skeleton-DsRTbz6d.cjs"),J=require("./PackageVersion-BbQFSVXm.cjs"),K=require("./PenAndPaper-BX8pR5oV.cjs"),Q=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),W=["id"],Z={key:2,style:"width:100%;background:transparent;padding-bottom:12px"},ee=["xmlns","viewBox"],te={key:0},ae=["d","stroke-width","stroke"],oe={key:1},le=["x1","y1","x2","y2","stroke-width","stroke"],re=["x","y","font-size","fill","font-weight","text-anchor"],ne={key:5,class:"vue-data-ui-watermark"},se={key:6,ref:"source",dir:"auto"},ue={__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:j}=c.useConfig(),P=e.computed(()=>!!v.dataset&&Object.keys(v.dataset).length),$=e.ref(c.createUid()),B=e.ref(null),U=e.ref(null),A=e.ref(0),N=e.ref(0),t=e.computed({get:()=>S(),set:a=>a});function S(){const a=V.useNestedProp({userConfig:v.config,defaultConfig:j});return a.theme?{...V.useNestedProp({userConfig:c.themes.vue_ui_tiremarks[a.theme]||v.config,defaultConfig:a})}:a}e.watch(()=>v.config,a=>{t.value=S(),T(),N.value+=1},{deep:!0});const{isPrinting:z,isImaging:I,generatePdf:O,generateImage:F}=L.usePrinter({elementId:$.value,fileName:t.value.style.chart.title.text||"vue-ui-tiremarks"}),H=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),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(()=>{T()});function E(a){let u=t.value.style.chart.animation.speed;const o=Math.abs(a-n.value)/(u*120);function r(){n.value<a?n.value=Math.min(n.value+o,a):n.value>a&&(n.value=Math.max(n.value-o,a)),n.value!==a&&requestAnimationFrame(r)}r()}function T(){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}}),b=e.computed(()=>Object.values(s.value).reduce((a,u)=>a+u,0)),l=e.computed(()=>({height:f.value?312:56,width:f.value?56:312})),D=e.ref(100);e.computed(()=>v.dataset.percentage/D.value);const i=e.computed(()=>f.value?{mark:(l.value.height-b.value)/100*.5,space:(l.value.height-b.value)/100*.5}:{mark:(l.value.width-b.value)/100*.5,space:(l.value.width-b.value)/100*.5}),q=e.computed(()=>{const a=[];for(let o=0;o<100;o+=1){const r=t.value.style.chart.layout.ticks.gradient.show?c.shiftHue(t.value.style.chart.layout.activeColor,o/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-o)*(l.value.width-s.value.left-s.value.right)/100/3:0,d=s.value.left+4+y,h=l.value.width-s.value.right-4-y,p=l.value.height-s.value.bottom-o*i.value.mark-o*i.value.space-i.value.mark,m=l.value.height-s.value.bottom-o*i.value.mark-o*i.value.space-i.value.mark,k=(h-d)/t.value.style.chart.layout.curveAngleX,C=t.value.style.chart.layout.curveAngleY*((1+o)/100);a.push({x1:d,x2:h,y1:p,y2:m,curve:`M ${d} ${p} C ${d+k} ${p-C}, ${h-k} ${m-C}, ${h} ${m}`,color:r})}else{const y=t.value.style.chart.layout.crescendo?(100-o)*(l.value.height-s.value.top-s.value.bottom)/100/3:0,d=s.value.left+o*i.value.mark+o*i.value.space-i.value.mark,h=d,p=s.value.top+4+y,m=l.value.height-s.value.bottom-4-y,k=t.value.style.chart.layout.curveAngleY*((1+o)/100),C=(m-p)/t.value.style.chart.layout.curveAngleX;a.push({x1:d,x2:h,y1:p,y2:m,curve:`M ${d} ${p} C ${d+k} ${p+C}, ${h+k} ${m-C}, ${h} ${m}`,color:r})}}return a}),g=e.computed(()=>{let a,u,o;const r=t.value.style.chart.percentage.fontSize/3;return f.value?t.value.style.chart.percentage.verticalPosition==="top"?(a=l.value.width/2,u=s.value.top/2,o="middle"):t.value.style.chart.percentage.verticalPosition==="bottom"&&(a=l.value.width/2,u=l.value.height-s.value.bottom/2+r,o="middle"):t.value.style.chart.percentage.horizontalPosition==="left"?(a=4,u=l.value.height/2+r,o="start"):t.value.style.chart.percentage.horizontalPosition==="right"&&(a=l.value.width-s.value.right+8,u=l.value.height/2+r,o="start"),{x:a,y:u,textAnchor:o,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 R(a){_.value=a,A.value+=1}const w=e.ref(!1);function x(){w.value=!w.value}return G({generatePdf:O,generateImage:F,toggleAnnotator:x}),(a,u)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tiremarksChart",ref:B,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;background:${t.value.style.chart.backgroundColor}`),id:$.value},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(K.PenAndPaper,{key:0,parent:B.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:w.value,onClose:x},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),H.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:U,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",Z,[(e.openBlock(),e.createBlock(X._sfc_main,{key:`title_${N.value}`,config:{title:{cy:"wheel-title",...t.value.style.chart.title},subtitle:{cy:"wheel-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))])):e.createCommentVNode("",!0),t.value.userOptions.show&&P.value?(e.openBlock(),e.createBlock(L.UserOptions,{ref:"details",key:`user_options_${A.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(z),isImaging:e.unref(I),uid:$.value,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,hasXls:!1,isFullscreen:_.value,titles:{...t.value.userOptions.buttonTitles},chartElement:B.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:w.value,onToggleFullscreen:R,onGeneratePdf:e.unref(O),onGenerateImage:e.unref(F),onToggleAnnotator:x},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:o,isFullscreen:r})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:r})),void 0,!0)]),key:"2"}:void 0,a.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:r})=>[e.renderSlot(a.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:r})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),P.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(c.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":_.value,"vue-data-ui-fulscreen--off":!_.value}),viewBox:`0 0 ${l.value.width} ${l.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(J._sfc_main),t.value.style.chart.layout.curved?(e.openBlock(),e.createElementBlock("g",te,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(q.value,(o,r)=>(e.openBlock(),e.createElementBlock("path",{d:o.curve,"stroke-width":i.value.mark,stroke:n.value>=r?o.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,ae))),256))])):(e.openBlock(),e.createElementBlock("g",oe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(q.value,(o,r)=>(e.openBlock(),e.createElementBlock("line",{x1:o.x1,y1:o.y1,x2:o.x2,y2:o.y2,"stroke-width":i.value.mark,stroke:n.value>=r?o.color:t.value.style.chart.layout.inactiveColor,"stroke-linecap":"round"},null,8,le))),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,re)):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"svg",{svg:l.value},void 0,!0)],14,ee)):e.createCommentVNode("",!0),a.$slots.watermark?(e.openBlock(),e.createElementBlock("div",ne,[e.renderSlot(a.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(z)||e.unref(I)})),void 0,!0)])):e.createCommentVNode("",!0),a.$slots.source?(e.openBlock(),e.createElementBlock("div",se,[e.renderSlot(a.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),P.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Y.default,{key:7,config:{type:"tiremarks",style:{backgroundColor:t.value.style.chart.backgroundColor,tiremarks:{color:"#CCCCCC"}}}},null,8,["config"]))],14,W))}},ie=Q._export_sfc(ue,[["__scopeId","data-v-93332410"]]);exports.default=ie;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),V=require("./useNestedProp-vPTP0Wem.cjs"),c=require("./index-3oZdQf6G.cjs"),X=require("./Title-BxrsVY3-.cjs"),L=require("./usePrinter-BKzxQK4e.cjs"),Y=require("./vue-ui-skeleton-CI8sxaqr.cjs"),J=require("./PackageVersion-AftniVVo.cjs"),K=require("./PenAndPaper-j5noaKJZ.cjs"),Q=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),W=["id"],Z={key:2,style:"width:100%;background:transparent;padding-bottom:12px"},ee=["xmlns","viewBox"],te={key:0},ae=["d","stroke-width","stroke"],oe={key:1},le=["x1","y1","x2","y2","stroke-width","stroke"],re=["x","y","font-size","fill","font-weight","text-anchor"],ne={key:5,class:"vue-data-ui-watermark"},se={key:6,ref:"source",dir:"auto"},ue={__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:j}=c.useConfig(),P=e.computed(()=>!!v.dataset&&Object.keys(v.dataset).length),$=e.ref(c.createUid()),B=e.ref(null),U=e.ref(null),A=e.ref(0),N=e.ref(0),t=e.computed({get:()=>S(),set:a=>a});function S(){const a=V.useNestedProp({userConfig:v.config,defaultConfig:j});return a.theme?{...V.useNestedProp({userConfig:c.themes.vue_ui_tiremarks[a.theme]||v.config,defaultConfig:a})}:a}e.watch(()=>v.config,a=>{t.value=S(),T(),N.value+=1},{deep:!0});const{isPrinting:z,isImaging:I,generatePdf:O,generateImage:F}=L.usePrinter({elementId:$.value,fileName:t.value.style.chart.title.text||"vue-ui-tiremarks"}),H=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),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(()=>{T()});function E(a){let u=t.value.style.chart.animation.speed;const o=Math.abs(a-n.value)/(u*120);function r(){n.value<a?n.value=Math.min(n.value+o,a):n.value>a&&(n.value=Math.max(n.value-o,a)),n.value!==a&&requestAnimationFrame(r)}r()}function T(){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}}),b=e.computed(()=>Object.values(s.value).reduce((a,u)=>a+u,0)),l=e.computed(()=>({height:f.value?312:56,width:f.value?56:312})),D=e.ref(100);e.computed(()=>v.dataset.percentage/D.value);const i=e.computed(()=>f.value?{mark:(l.value.height-b.value)/100*.5,space:(l.value.height-b.value)/100*.5}:{mark:(l.value.width-b.value)/100*.5,space:(l.value.width-b.value)/100*.5}),q=e.computed(()=>{const a=[];for(let o=0;o<100;o+=1){const r=t.value.style.chart.layout.ticks.gradient.show?c.shiftHue(t.value.style.chart.layout.activeColor,o/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-o)*(l.value.width-s.value.left-s.value.right)/100/3:0,d=s.value.left+4+y,h=l.value.width-s.value.right-4-y,p=l.value.height-s.value.bottom-o*i.value.mark-o*i.value.space-i.value.mark,m=l.value.height-s.value.bottom-o*i.value.mark-o*i.value.space-i.value.mark,k=(h-d)/t.value.style.chart.layout.curveAngleX,C=t.value.style.chart.layout.curveAngleY*((1+o)/100);a.push({x1:d,x2:h,y1:p,y2:m,curve:`M ${d} ${p} C ${d+k} ${p-C}, ${h-k} ${m-C}, ${h} ${m}`,color:r})}else{const y=t.value.style.chart.layout.crescendo?(100-o)*(l.value.height-s.value.top-s.value.bottom)/100/3:0,d=s.value.left+o*i.value.mark+o*i.value.space-i.value.mark,h=d,p=s.value.top+4+y,m=l.value.height-s.value.bottom-4-y,k=t.value.style.chart.layout.curveAngleY*((1+o)/100),C=(m-p)/t.value.style.chart.layout.curveAngleX;a.push({x1:d,x2:h,y1:p,y2:m,curve:`M ${d} ${p} C ${d+k} ${p+C}, ${h+k} ${m-C}, ${h} ${m}`,color:r})}}return a}),g=e.computed(()=>{let a,u,o;const r=t.value.style.chart.percentage.fontSize/3;return f.value?t.value.style.chart.percentage.verticalPosition==="top"?(a=l.value.width/2,u=s.value.top/2,o="middle"):t.value.style.chart.percentage.verticalPosition==="bottom"&&(a=l.value.width/2,u=l.value.height-s.value.bottom/2+r,o="middle"):t.value.style.chart.percentage.horizontalPosition==="left"?(a=4,u=l.value.height/2+r,o="start"):t.value.style.chart.percentage.horizontalPosition==="right"&&(a=l.value.width-s.value.right+8,u=l.value.height/2+r,o="start"),{x:a,y:u,textAnchor:o,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 R(a){_.value=a,A.value+=1}const w=e.ref(!1);function x(){w.value=!w.value}return G({generatePdf:O,generateImage:F,toggleAnnotator:x}),(a,u)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tiremarksChart",ref:B,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;background:${t.value.style.chart.backgroundColor}`),id:$.value},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(K.PenAndPaper,{key:0,parent:B.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:w.value,onClose:x},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),H.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:U,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",Z,[(e.openBlock(),e.createBlock(X._sfc_main,{key:`title_${N.value}`,config:{title:{cy:"wheel-title",...t.value.style.chart.title},subtitle:{cy:"wheel-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))])):e.createCommentVNode("",!0),t.value.userOptions.show&&P.value?(e.openBlock(),e.createBlock(L.UserOptions,{ref:"details",key:`user_options_${A.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(z),isImaging:e.unref(I),uid:$.value,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,hasXls:!1,isFullscreen:_.value,titles:{...t.value.userOptions.buttonTitles},chartElement:B.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:w.value,onToggleFullscreen:R,onGeneratePdf:e.unref(O),onGenerateImage:e.unref(F),onToggleAnnotator:x},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:o,isFullscreen:r})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:r})),void 0,!0)]),key:"2"}:void 0,a.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:r})=>[e.renderSlot(a.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:r})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),P.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(c.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":_.value,"vue-data-ui-fulscreen--off":!_.value}),viewBox:`0 0 ${l.value.width} ${l.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(J._sfc_main),t.value.style.chart.layout.curved?(e.openBlock(),e.createElementBlock("g",te,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(q.value,(o,r)=>(e.openBlock(),e.createElementBlock("path",{d:o.curve,"stroke-width":i.value.mark,stroke:n.value>=r?o.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,ae))),256))])):(e.openBlock(),e.createElementBlock("g",oe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(q.value,(o,r)=>(e.openBlock(),e.createElementBlock("line",{x1:o.x1,y1:o.y1,x2:o.x2,y2:o.y2,"stroke-width":i.value.mark,stroke:n.value>=r?o.color:t.value.style.chart.layout.inactiveColor,"stroke-linecap":"round"},null,8,le))),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,re)):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"svg",{svg:l.value},void 0,!0)],14,ee)):e.createCommentVNode("",!0),a.$slots.watermark?(e.openBlock(),e.createElementBlock("div",ne,[e.renderSlot(a.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(z)||e.unref(I)})),void 0,!0)])):e.createCommentVNode("",!0),a.$slots.source?(e.openBlock(),e.createElementBlock("div",se,[e.renderSlot(a.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),P.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Y.default,{key:7,config:{type:"tiremarks",style:{backgroundColor:t.value.style.chart.backgroundColor,tiremarks:{color:"#CCCCCC"}}}},null,8,["config"]))],14,W))}},ie=Q._export_sfc(ue,[["__scopeId","data-v-93332410"]]);exports.default=ie;
@@ -1,11 +1,11 @@
1
1
  import { computed as v, ref as p, watch as J, onMounted as ne, openBlock as r, createElementBlock as u, normalizeClass as G, normalizeStyle as K, createBlock as O, createCommentVNode as g, unref as d, createSlots as ue, withCtx as F, renderSlot as _, normalizeProps as L, guardReactiveProps as M, createVNode as ie, Fragment as Q, renderList as V, toDisplayString as ce } from "vue";
2
- import { u as W } from "./useNestedProp-CRAUOmT5.js";
3
- import { u as ve, c as he, t as de, v as fe, o as pe, e as ge, w as Z, X as me, i as ye, f as ke } from "./index-hV0hU1iE.js";
4
- import { _ as _e } from "./Title-DBozX6nP.js";
5
- import { u as be, U as Ce } from "./usePrinter-y3d31M4g.js";
6
- import $e from "./vue-ui-skeleton-BY8Jg9a_.js";
7
- import { _ as we } from "./PackageVersion-wqab02xF.js";
8
- import { P as xe } from "./PenAndPaper-C_laA5mt.js";
2
+ import { u as W } from "./useNestedProp-CZkNAGQh.js";
3
+ import { u as ve, c as he, t as de, v as fe, o as pe, e as ge, w as Z, X as me, i as ye, f as ke } from "./index-D020Kb3z.js";
4
+ import { _ as _e } from "./Title-B2orjUIW.js";
5
+ import { u as be, U as Ce } from "./usePrinter-CN0J0NFL.js";
6
+ import $e from "./vue-ui-skeleton-E1-7diF5.js";
7
+ import { _ as we } from "./PackageVersion-g2UOsY7H.js";
8
+ import { P as xe } from "./PenAndPaper-DRFeGfqV.js";
9
9
  import { _ as Pe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
10
10
  const Ae = ["id"], Ie = {
11
11
  key: 2,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-CsQwCVqU.cjs"),Pe=require("./Title-BRqTk-nT.cjs"),pe=require("./usePrinter-O2fMMTMe.cjs"),ze=require("./Tooltip-DvGSIp31.cjs"),Oe=require("./Legend-G5Zc4QaZ.cjs"),Ve=require("./vue-ui-skeleton-DsRTbz6d.cjs"),Ee=require("./DataTable-H-KTkjfv.cjs"),Le=require("./vue-ui-accordion-CaktYQoo.cjs"),fe=require("./useResponsive-BJ7DTGpm.cjs"),ge=require("./useNestedProp-DSYpaLxP.cjs"),Re=require("./PackageVersion-BbQFSVXm.cjs"),Ae=require("./PenAndPaper-BX8pR5oV.cjs"),Fe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");function me(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,c=-1/0,v=0;for(let f=0;f<s;f+=1){const p=n[f].normalizedValue;p<u&&(u=p),p>c&&(c=p),v+=p}return Math.max(d**2*c/v**2,v**2/(d**2*u))}}function ye(n){const{xOffset:d,yOffset:s,width:u,height:c}=n;return{x0:d,y0:s,x1:d+u,y1:s+c}}function Ie(n,d,s){if(n.length===0)return!0;{const u=n.concat(d),c=me(n,s),v=me(u,s);return c>=v}}function De(n){const d=[],s=n.length;for(let u=0;u<s;u+=1){const c=n[u],v=c.length;for(let h=0;h<v;h+=1)d.push(c[h])}return d}function qe(n,d){const s={...d,children:n};return ke(s)}function He(n){return(n.x1-n.x0)*(n.y1-n.y0)}function be(n,d){const{width:s,height:u,xOffset:c,yOffset:v}=X(d),h=n.length,f=n.map(g=>g.normalizedValue||0).reduce((g,k)=>g+k,0),p=f/u,C=f/s;let b=c,w=v;const m=[];if(s>=u){for(let g=0;g<h;g+=1){const k=n[g],x=w+k.normalizedValue/p,B={x0:b,y0:w,x1:b+p,y1:x},T=Object.assign({},k,B);w=x,m.push(T)}return m}else{for(let g=0;g<h;g+=1){const k=n[g],x=b+k.normalizedValue/C,B={x0:b,y0:w,x1:x,y1:w+C},T=Object.assign({},k,B);b=x,m.push(T)}return m}}function Me(n){const d=X(n),s=d.width,u=d.height;return Math.min(s,u)}function We(n,d){const s=n.length,u=n.map(p=>p.value??0).reduce((p,C)=>p+C,0),c=d/u,v=[];let h,f;for(let p=0;p<s;p+=1)f=n[p],h=Object.assign({},f,{normalizedValue:f.value*(c||0)}),v.push(h);return v}function X(n){const{x0:d,y0:s,x1:u,y1:c}=n;return{xOffset:d,yOffset:s,width:u-d,height:c-s}}function Ue(n,d,s,u){let c=n,v=d,h=s,f=u;for(;;){const p=c.length;if(p===0){const m=be(v,h);return f.concat(m)}const C=Me(h),b=c[0],w=c.slice(1,p);if(Ie(v,b,C)){const m=v.concat(b);c=w,v=m,h=h,f=f}else{const m=v.length;let g=0;for(let T=0;T<m;T+=1)g+=v[T].normalizedValue;const k=Ge(h,g),x=be(v,h),B=f.concat(x);c=c,v=[],h=k,f=B}}}function ke(n){if(typeof n.children>"u"||!n.children.length)return[n];{const d=We(n.children,He(n)),s=Ue(d,[],n,[]),u=s.length,c=[];for(let h=0;h<u;h+=1)c.push(ke(s[h]));return De(c)}}function Ge(n,d){const{width:s,height:u,xOffset:c,yOffset:v}=X(n);if(s>=u){const h=d/u,f=s-h,p={xOffset:c+h,yOffset:v,width:f,height:u};return ye(p)}else{const h=d/s,f=u-h,p={xOffset:c,yOffset:v+h,width:s,height:f};return ye(p)}}const je=n=>(e.pushScopeId("data-v-04106534"),n=n(),e.popScopeId(),n),Xe=["id"],Ye=["xmlns","viewBox"],Ze={key:0},Je=["id"],Ke=["stop-color"],Qe=["stop-color"],et=["x","y","height","width","fill","rx","stroke","stroke-width","onClick","onMouseenter"],tt=["x","y","height","width"],ot={style:{width:"100%",height:"100%"},class:"vue-ui-treemap-cell"},lt=je(()=>e.createElementVNode("br",null,null,-1)),at={key:5,class:"vue-data-ui-watermark"},nt=["onClick"],rt={key:0},ut={key:1},st=["innerHTML"],it={__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:c}=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),m=e.ref([]),g=e.ref(null),k=e.ref(null),x=e.ref(null),B=e.ref(null),T=e.ref(null),Y=e.ref(0),Z=e.ref(0),J=e.ref(0),t=e.computed({get:()=>K(),set:o=>o});function K(){const o=ge.useNestedProp({userConfig:u.config,defaultConfig:c});return o.theme?{...ge.useNestedProp({userConfig:r.themes.vue_ui_treemap[o.theme]||u.config,defaultConfig:o}),customPalette:r.themePalettes[o.theme]||r.palette}:o}e.watch(()=>u.config,o=>{t.value=K(),Y.value+=1,Z.value+=1,J.value+=1},{deep:!0});const{isPrinting:Q,isImaging:ee,generatePdf:te,generateImage:oe}=pe.usePrinter({elementId:`treemap_${f.value}`,fileName:t.value.style.chart.title.text||"vue-ui-treemap"}),Ce=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),I=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),_=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),P=e.ref({height:t.value.style.chart.height,width:t.value.style.chart.width}),O=e.computed(()=>({bottom:P.value.height-t.value.style.chart.padding.bottom,height:P.value.height-t.value.style.chart.padding.top-t.value.style.chart.padding.bottom,left:t.value.style.chart.padding.left,right:P.value.width-t.value.style.chart.padding.right,top:t.value.style.chart.padding.top,vbHeight:P.value.height,vbWidth:P.value.width,width:P.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right}));function le(o){o.forEach((a,l)=>{a.id=r.createUid(),a.color=r.convertColorToHex(a.color)||I.value[l]||r.palette[l]||r.palette[l%r.palette.length],a.children&&(a.children.forEach(i=>{i.parentId=a.id,i.color=a.color}),le(a.children))})}const V=e.ref(u.dataset),D=e.ref(null);e.onMounted(()=>{we()});function we(){if(r.objectIsEmpty(u.dataset)&&r.error({componentName:"VueUiTreemap",type:"dataset"}),le(V.value),t.value.responsive){const o=fe.throttle(()=>{const{width:a,height:l}=fe.useResponsive({chart:g.value,title:t.value.style.chart.title.text?k.value:null,legend:t.value.style.chart.legend.show?x.value:null,source:B.value,noTitle:T.value});P.value.width=a,P.value.height=l});D.value=new ResizeObserver(o),D.value.observe(g.value.parentNode)}}e.onBeforeUnmount(()=>{D.value&&D.value.disconnect()});const W=e.ref(V.value),A=e.computed(()=>W.value.map((o,a)=>({...o,color:r.convertColorToHex(o.color)||I.value[a]||r.palette[a]||r.palette[a%r.palette.length]})).filter(o=>!m.value.includes(o.id))),L=e.computed(()=>V.value.filter(o=>!m.value.includes(o.id)).map(o=>o.value||0).reduce((o,a)=>o+a,0)),ae=e.computed({get(){let o=[...A.value];return t.value.style.chart.layout.sorted&&(o=[...A.value].sort((a,l)=>l.value-a.value)),o.map(a=>({...a}))},set(o){return o}});function ne(o,a){return o.value/a}function xe(o,a,l){const i=t.value.style.chart.layout.rects.colorRatio-ne(a,l);return r.lightenHexColor(o,i<0?0:i)}function re(o,a,l,i){return o.map((y,z)=>{const M=xe(r.convertColorToHex(a)||I.value[z]||r.palette[z]||r.palette[z%r.palette.length],y,i),_e=ne(y,i);return{...y,color:M,proportion:_e,parentName:l,children:y.children?re(y.children,M,y.name,i):void 0}})}const F=e.computed(()=>qe(ae.value.map((o,a)=>{const l=o.children?o.children.reduce((i,y)=>i+y.value,0):o.value;return{value:o.value,id:o.id,children:o.children?re(o.children.sort((i,y)=>y.value-i.value),o.color,o.name,l):void 0,color:o.color,name:o.name}}),{x0:O.value.left*2,y0:O.value.top,x1:O.value.width,y1:O.value.height}));function ue({y0:o,y1:a}){return a-o<=0?1e-4:a-o}function se({x0:o,x1:a}){return a-o<=0?1e-4:a-o}function E(o){const a=t.value.style.chart.layout.labels.fontSize*(o.proportion*2>1?1:o.proportion*2);return a<t.value.style.chart.layout.labels.minFontSize?t.value.style.chart.layout.labels.minFontSize:a}function Te(o){b.value=o,w.value+=1}const R=e.computed(()=>({startX:0,startY:0,width:O.value.vbWidth,height:O.value.vbHeight})),$=e.ref(!1);function U(o,a=V.value){for(const l of a){if(l.id===o)return l;if(l.children){const i=U(o,l.children);if(i)return i}}return null}function $e(o){if($.value)s("selectDatapoint",void 0),W.value=V.value;else{if(s("selectDatapoint",o),!U(o.parentId))return;W.value=[U(o.parentId)]}$.value=!$.value}const S=e.ref(null),ie=e.computed(()=>V.value.map((o,a)=>({...o,color:r.convertColorToHex(o.color)||I.value[a]||r.palette[a]||r.palette[a%r.palette.length],shape:"square"})).sort((o,a)=>a.value-o.value).map((o,a)=>({...o,proportion:o.value/V.value.map(l=>l.value).reduce((l,i)=>l+i,0),opacity:m.value.includes(o.id)?.5:1}))),Se=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 ce(o){$.value=!1,S.value=null,m.value.includes(o.id)?m.value=m.value.filter(a=>a!==o.id):m.value.length<u.dataset.length-1&&m.value.push(o.id),s("selectLegend",ae.value)}const G=e.ref(null);function Ne({datapoint:o,seriesIndex:a}){S.value=o,G.value={datapoint:o,seriesIndex:a,config:t.value,series:A.value};const l=t.value.style.chart.tooltip.customFormat;if(r.isFunction(l)&&r.functionReturnsString(()=>l({seriesIndex:a,datapoint:o,series:A.value,config:t.value})))C.value=l({seriesIndex:a,datapoint:o,series:A.value,config:t.value});else{let i="";i+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${o.name}</div>`,i+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><rect x="0" y="0" height="12" width="12" stroke="none" fill="${o.color}"/></svg>`,i+=`<b>${r.applyDataLabel(t.value.style.chart.layout.labels.formatter,o.value,r.dataLabel({p:t.value.style.chart.layout.labels.prefix,v:o.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:o,seriesIndex:a})}</b>`,C.value=`<div>${i}</div>`}p.value=!0}const N=e.computed(()=>{const o=F.value.map(l=>({name:l.name,color:l.color})),a=F.value.map(l=>l.value);return{head:o,body:a}});function de(){e.nextTick(()=>{const o=N.value.head.map((i,y)=>[[i.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(o),l=r.createCsvContent(a);r.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-treemap"})})}const q=e.computed(()=>{const o=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage],a=N.value.head.map((y,z)=>{const M=r.applyDataLabel(t.value.style.chart.layout.labels.formatter,N.value.body[z],r.dataLabel({p:t.value.style.chart.layout.labels.prefix,v:N.value.body[z],s:t.value.style.chart.layout.labels.suffix,r:t.value.table.td.roundingValue}));return[{color:y.color,name:y.name,shape:"square"},M,isNaN(N.value.body[z]/L.value)?"-":r.dataLabel({v:N.value.body[z]/L.value*100,s:"%",r:t.value.table.td.roundingPercentage})]}),l={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value],head:o,body:a,config:l}});function Be(){return F.value}function ve(){_.value.showTable=!_.value.showTable}function he(){_.value.showTooltip=!_.value.showTooltip}const H=e.ref(!1);function j(){H.value=!H.value}return d({getData:Be,generateCsv:de,generateImage:oe,generatePdf:te,toggleTable:ve,toggleTooltip:he,toggleAnnotator:j}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"treemapChart",ref:g,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;background:${t.value.style.chart.backgroundColor}`),id:`treemap_${f.value}`},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Ae.PenAndPaper,{key:0,parent:g.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:H.value,onClose:j},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),Ce.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:T,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:k,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:6px`)},[(e.openBlock(),e.createBlock(Pe._sfc_main,{key:`title_${Y.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(pe.UserOptions,{ref:"details",key:`user_option_${w.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(Q),isImaging:e.unref(ee),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:g.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:H.value,onToggleFullscreen:Te,onGeneratePdf:e.unref(te),onGenerateCsv:de,onGenerateImage:e.unref(oe),onToggleTable:ve,onToggleTooltip:he,onToggleAnnotator:j},e.createSlots({_:2},[o.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:i})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:i})),void 0,!0)]),key:"5"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:i})=>[e.renderSlot(o.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:i})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),v.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":b.value,"vue-data-ui-fulscreen--off":!b.value,"vue-data-ui-zoom-plus":!$.value,"vue-data-ui-zoom-minus":$.value}),viewBox:`${R.value.startX} ${R.value.startY} ${R.value.width<=0?10:R.value.width} ${R.value.height<=0?10:R.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: hidden; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Re._sfc_main),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(l,i)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.chart.layout.rects.gradient.show?(e.openBlock(),e.createElementBlock("defs",Ze,[e.createElementVNode("radialGradient",{id:`tgrad_${l.id}`,gradientTransform:"translate(-1, -1.000001) scale(2, 2)"},[e.createElementVNode("stop",{offset:"18%","stop-color":l.color},null,8,Ke),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.lightenHexColor)(l.color,t.value.style.chart.layout.rects.gradient.intensity/100)},null,8,Qe)],8,Je)])):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(l,i)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:l.x0,y:l.y0,height:ue(l),width:se(l),fill:h.value?l.color:t.value.style.chart.layout.rects.gradient.show?`url(#tgrad_${l.id})`:l.color,rx:t.value.style.chart.layout.rects.borderRadius,stroke:S.value&&S.value.id===l.id?t.value.style.chart.layout.rects.selected.stroke:t.value.style.chart.layout.rects.stroke,"stroke-width":S.value&&S.value.id===l.id?t.value.style.chart.layout.rects.selected.strokeWidth:t.value.style.chart.layout.rects.strokeWidth,onClick:y=>$e(l),onMouseenter:()=>Ne({datapoint:l,seriesIndex:i}),onMouseleave:a[0]||(a[0]=y=>{S.value=null,p.value=!1}),style:e.normalizeStyle(`opacity:${S.value?S.value.id===l.id?1:t.value.style.chart.layout.rects.selected.unselectedOpacity:1}`),class:"vue-ui-treemap-rect"},null,44,et),(e.openBlock(),e.createElementBlock("foreignObject",{x:l.x0,y:l.y0,height:ue(l),width:se(l),class:"vue-ui-treemap-cell-foreignObject"},[e.createElementVNode("div",ot,[t.value.style.chart.layout.labels.showDefaultLabels&&(l.proportion>t.value.style.chart.layout.labels.hideUnderProportion||$.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vue-ui-treemap-cell-default",style:e.normalizeStyle(`width:calc(100% - ${E(l)/1.5}px);text-align:left;line-height:${E(l)<14?14:E(l)}px;padding:${E(l)/3}px; color:${e.unref(r.adaptColorToBackground)(l.color)}`)},[e.createElementVNode("span",{style:e.normalizeStyle(`width:100%;font-size:${E(l)}px;`)},e.toDisplayString(l.name),5),lt,e.createElementVNode("span",{style:e.normalizeStyle(`width:100%;font-size:${E(l)}px;`)},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.formatter,l.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.labels.prefix,v:l.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.layout.labels.rounding}),{datapoint:l})),5)],4)):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"rect",e.normalizeProps(e.guardReactiveProps({rect:l,shouldShow:l.proportion>t.value.style.chart.layout.labels.hideUnderProportion||$.value,fontSize:E(l),isZoom:$.value,textColor:e.unref(r.adaptColorToBackground)(l.color)})),void 0,!0)])],8,tt))]))),256)),e.renderSlot(o.$slots,"svg",e.normalizeProps(e.guardReactiveProps({svg:O.value,isZoom:$.value,rect:S.value,config:t.value})),void 0,!0)],14,Ye)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",at,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(Q)||e.unref(ee)})),void 0,!0)])):e.createCommentVNode("",!0),v.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ve.default,{key:6,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(Oe.Legend,{key:`legend_${J.value}`,legendSet:ie.value,config:Se.value,id:`treemap_legend_${f.value}`,onClickMarker:a[1]||(a[1]=({legend:l})=>ce(l))},{item:e.withCtx(({legend:l,index:i})=>[e.createElementVNode("div",{onClick:y=>ce(l),style:e.normalizeStyle(`opacity:${m.value.includes(l.id)?.5:1}`)},[e.createTextVNode(e.toDisplayString(l.name)+": "+e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.formatter,l.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.labels.prefix,v:l.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:l}))+" ",1),m.value.includes(l.id)?(e.openBlock(),e.createElementBlock("span",ut," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",rt," ("+e.toDisplayString(isNaN(l.value/L.value)?"-":(l.value/L.value*100).toFixed(t.value.style.chart.legend.roundingPercentage))+"%) ",1))],12,nt)]),_:1},8,["legendSet","config","id"])):e.renderSlot(o.$slots,"legend",{key:1,legend:ie.value},void 0,!0)],512),o.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:B,dir:"auto"},[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(ze._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:g.value,content:C.value,isCustom:e.unref(r.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...G.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...G.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(Le.default,{key:8,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(Ee.DataTable,{key:`table_${Z.value}`,colNames:q.value.colNames,head:q.value.head,body:q.value.body,config:q.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:a[2]||(a[2]=l=>_.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,st)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l.name||l),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,Xe))}},ct=Fe._export_sfc(it,[["__scopeId","data-v-04106534"]]);exports.default=ct;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-3oZdQf6G.cjs"),Pe=require("./Title-BxrsVY3-.cjs"),pe=require("./usePrinter-BKzxQK4e.cjs"),ze=require("./Tooltip-BXc56Oxr.cjs"),Oe=require("./Legend-BksImVUi.cjs"),Ve=require("./vue-ui-skeleton-CI8sxaqr.cjs"),Ee=require("./DataTable-DeevzR8O.cjs"),Le=require("./vue-ui-accordion-QoJofzqF.cjs"),fe=require("./useResponsive-BJ7DTGpm.cjs"),ge=require("./useNestedProp-vPTP0Wem.cjs"),Re=require("./PackageVersion-AftniVVo.cjs"),Ae=require("./PenAndPaper-j5noaKJZ.cjs"),Fe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");function me(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,c=-1/0,v=0;for(let f=0;f<s;f+=1){const p=n[f].normalizedValue;p<u&&(u=p),p>c&&(c=p),v+=p}return Math.max(d**2*c/v**2,v**2/(d**2*u))}}function ye(n){const{xOffset:d,yOffset:s,width:u,height:c}=n;return{x0:d,y0:s,x1:d+u,y1:s+c}}function Ie(n,d,s){if(n.length===0)return!0;{const u=n.concat(d),c=me(n,s),v=me(u,s);return c>=v}}function De(n){const d=[],s=n.length;for(let u=0;u<s;u+=1){const c=n[u],v=c.length;for(let h=0;h<v;h+=1)d.push(c[h])}return d}function qe(n,d){const s={...d,children:n};return ke(s)}function He(n){return(n.x1-n.x0)*(n.y1-n.y0)}function be(n,d){const{width:s,height:u,xOffset:c,yOffset:v}=X(d),h=n.length,f=n.map(g=>g.normalizedValue||0).reduce((g,k)=>g+k,0),p=f/u,C=f/s;let b=c,w=v;const m=[];if(s>=u){for(let g=0;g<h;g+=1){const k=n[g],x=w+k.normalizedValue/p,B={x0:b,y0:w,x1:b+p,y1:x},T=Object.assign({},k,B);w=x,m.push(T)}return m}else{for(let g=0;g<h;g+=1){const k=n[g],x=b+k.normalizedValue/C,B={x0:b,y0:w,x1:x,y1:w+C},T=Object.assign({},k,B);b=x,m.push(T)}return m}}function Me(n){const d=X(n),s=d.width,u=d.height;return Math.min(s,u)}function We(n,d){const s=n.length,u=n.map(p=>p.value??0).reduce((p,C)=>p+C,0),c=d/u,v=[];let h,f;for(let p=0;p<s;p+=1)f=n[p],h=Object.assign({},f,{normalizedValue:f.value*(c||0)}),v.push(h);return v}function X(n){const{x0:d,y0:s,x1:u,y1:c}=n;return{xOffset:d,yOffset:s,width:u-d,height:c-s}}function Ue(n,d,s,u){let c=n,v=d,h=s,f=u;for(;;){const p=c.length;if(p===0){const m=be(v,h);return f.concat(m)}const C=Me(h),b=c[0],w=c.slice(1,p);if(Ie(v,b,C)){const m=v.concat(b);c=w,v=m,h=h,f=f}else{const m=v.length;let g=0;for(let T=0;T<m;T+=1)g+=v[T].normalizedValue;const k=Ge(h,g),x=be(v,h),B=f.concat(x);c=c,v=[],h=k,f=B}}}function ke(n){if(typeof n.children>"u"||!n.children.length)return[n];{const d=We(n.children,He(n)),s=Ue(d,[],n,[]),u=s.length,c=[];for(let h=0;h<u;h+=1)c.push(ke(s[h]));return De(c)}}function Ge(n,d){const{width:s,height:u,xOffset:c,yOffset:v}=X(n);if(s>=u){const h=d/u,f=s-h,p={xOffset:c+h,yOffset:v,width:f,height:u};return ye(p)}else{const h=d/s,f=u-h,p={xOffset:c,yOffset:v+h,width:s,height:f};return ye(p)}}const je=n=>(e.pushScopeId("data-v-04106534"),n=n(),e.popScopeId(),n),Xe=["id"],Ye=["xmlns","viewBox"],Ze={key:0},Je=["id"],Ke=["stop-color"],Qe=["stop-color"],et=["x","y","height","width","fill","rx","stroke","stroke-width","onClick","onMouseenter"],tt=["x","y","height","width"],ot={style:{width:"100%",height:"100%"},class:"vue-ui-treemap-cell"},lt=je(()=>e.createElementVNode("br",null,null,-1)),at={key:5,class:"vue-data-ui-watermark"},nt=["onClick"],rt={key:0},ut={key:1},st=["innerHTML"],it={__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:c}=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),m=e.ref([]),g=e.ref(null),k=e.ref(null),x=e.ref(null),B=e.ref(null),T=e.ref(null),Y=e.ref(0),Z=e.ref(0),J=e.ref(0),t=e.computed({get:()=>K(),set:o=>o});function K(){const o=ge.useNestedProp({userConfig:u.config,defaultConfig:c});return o.theme?{...ge.useNestedProp({userConfig:r.themes.vue_ui_treemap[o.theme]||u.config,defaultConfig:o}),customPalette:r.themePalettes[o.theme]||r.palette}:o}e.watch(()=>u.config,o=>{t.value=K(),Y.value+=1,Z.value+=1,J.value+=1},{deep:!0});const{isPrinting:Q,isImaging:ee,generatePdf:te,generateImage:oe}=pe.usePrinter({elementId:`treemap_${f.value}`,fileName:t.value.style.chart.title.text||"vue-ui-treemap"}),Ce=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),I=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),_=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),P=e.ref({height:t.value.style.chart.height,width:t.value.style.chart.width}),O=e.computed(()=>({bottom:P.value.height-t.value.style.chart.padding.bottom,height:P.value.height-t.value.style.chart.padding.top-t.value.style.chart.padding.bottom,left:t.value.style.chart.padding.left,right:P.value.width-t.value.style.chart.padding.right,top:t.value.style.chart.padding.top,vbHeight:P.value.height,vbWidth:P.value.width,width:P.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right}));function le(o){o.forEach((a,l)=>{a.id=r.createUid(),a.color=r.convertColorToHex(a.color)||I.value[l]||r.palette[l]||r.palette[l%r.palette.length],a.children&&(a.children.forEach(i=>{i.parentId=a.id,i.color=a.color}),le(a.children))})}const V=e.ref(u.dataset),D=e.ref(null);e.onMounted(()=>{we()});function we(){if(r.objectIsEmpty(u.dataset)&&r.error({componentName:"VueUiTreemap",type:"dataset"}),le(V.value),t.value.responsive){const o=fe.throttle(()=>{const{width:a,height:l}=fe.useResponsive({chart:g.value,title:t.value.style.chart.title.text?k.value:null,legend:t.value.style.chart.legend.show?x.value:null,source:B.value,noTitle:T.value});P.value.width=a,P.value.height=l});D.value=new ResizeObserver(o),D.value.observe(g.value.parentNode)}}e.onBeforeUnmount(()=>{D.value&&D.value.disconnect()});const W=e.ref(V.value),A=e.computed(()=>W.value.map((o,a)=>({...o,color:r.convertColorToHex(o.color)||I.value[a]||r.palette[a]||r.palette[a%r.palette.length]})).filter(o=>!m.value.includes(o.id))),L=e.computed(()=>V.value.filter(o=>!m.value.includes(o.id)).map(o=>o.value||0).reduce((o,a)=>o+a,0)),ae=e.computed({get(){let o=[...A.value];return t.value.style.chart.layout.sorted&&(o=[...A.value].sort((a,l)=>l.value-a.value)),o.map(a=>({...a}))},set(o){return o}});function ne(o,a){return o.value/a}function xe(o,a,l){const i=t.value.style.chart.layout.rects.colorRatio-ne(a,l);return r.lightenHexColor(o,i<0?0:i)}function re(o,a,l,i){return o.map((y,z)=>{const M=xe(r.convertColorToHex(a)||I.value[z]||r.palette[z]||r.palette[z%r.palette.length],y,i),_e=ne(y,i);return{...y,color:M,proportion:_e,parentName:l,children:y.children?re(y.children,M,y.name,i):void 0}})}const F=e.computed(()=>qe(ae.value.map((o,a)=>{const l=o.children?o.children.reduce((i,y)=>i+y.value,0):o.value;return{value:o.value,id:o.id,children:o.children?re(o.children.sort((i,y)=>y.value-i.value),o.color,o.name,l):void 0,color:o.color,name:o.name}}),{x0:O.value.left*2,y0:O.value.top,x1:O.value.width,y1:O.value.height}));function ue({y0:o,y1:a}){return a-o<=0?1e-4:a-o}function se({x0:o,x1:a}){return a-o<=0?1e-4:a-o}function E(o){const a=t.value.style.chart.layout.labels.fontSize*(o.proportion*2>1?1:o.proportion*2);return a<t.value.style.chart.layout.labels.minFontSize?t.value.style.chart.layout.labels.minFontSize:a}function Te(o){b.value=o,w.value+=1}const R=e.computed(()=>({startX:0,startY:0,width:O.value.vbWidth,height:O.value.vbHeight})),$=e.ref(!1);function U(o,a=V.value){for(const l of a){if(l.id===o)return l;if(l.children){const i=U(o,l.children);if(i)return i}}return null}function $e(o){if($.value)s("selectDatapoint",void 0),W.value=V.value;else{if(s("selectDatapoint",o),!U(o.parentId))return;W.value=[U(o.parentId)]}$.value=!$.value}const S=e.ref(null),ie=e.computed(()=>V.value.map((o,a)=>({...o,color:r.convertColorToHex(o.color)||I.value[a]||r.palette[a]||r.palette[a%r.palette.length],shape:"square"})).sort((o,a)=>a.value-o.value).map((o,a)=>({...o,proportion:o.value/V.value.map(l=>l.value).reduce((l,i)=>l+i,0),opacity:m.value.includes(o.id)?.5:1}))),Se=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 ce(o){$.value=!1,S.value=null,m.value.includes(o.id)?m.value=m.value.filter(a=>a!==o.id):m.value.length<u.dataset.length-1&&m.value.push(o.id),s("selectLegend",ae.value)}const G=e.ref(null);function Ne({datapoint:o,seriesIndex:a}){S.value=o,G.value={datapoint:o,seriesIndex:a,config:t.value,series:A.value};const l=t.value.style.chart.tooltip.customFormat;if(r.isFunction(l)&&r.functionReturnsString(()=>l({seriesIndex:a,datapoint:o,series:A.value,config:t.value})))C.value=l({seriesIndex:a,datapoint:o,series:A.value,config:t.value});else{let i="";i+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${o.name}</div>`,i+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><rect x="0" y="0" height="12" width="12" stroke="none" fill="${o.color}"/></svg>`,i+=`<b>${r.applyDataLabel(t.value.style.chart.layout.labels.formatter,o.value,r.dataLabel({p:t.value.style.chart.layout.labels.prefix,v:o.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:o,seriesIndex:a})}</b>`,C.value=`<div>${i}</div>`}p.value=!0}const N=e.computed(()=>{const o=F.value.map(l=>({name:l.name,color:l.color})),a=F.value.map(l=>l.value);return{head:o,body:a}});function de(){e.nextTick(()=>{const o=N.value.head.map((i,y)=>[[i.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(o),l=r.createCsvContent(a);r.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-treemap"})})}const q=e.computed(()=>{const o=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage],a=N.value.head.map((y,z)=>{const M=r.applyDataLabel(t.value.style.chart.layout.labels.formatter,N.value.body[z],r.dataLabel({p:t.value.style.chart.layout.labels.prefix,v:N.value.body[z],s:t.value.style.chart.layout.labels.suffix,r:t.value.table.td.roundingValue}));return[{color:y.color,name:y.name,shape:"square"},M,isNaN(N.value.body[z]/L.value)?"-":r.dataLabel({v:N.value.body[z]/L.value*100,s:"%",r:t.value.table.td.roundingPercentage})]}),l={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value],head:o,body:a,config:l}});function Be(){return F.value}function ve(){_.value.showTable=!_.value.showTable}function he(){_.value.showTooltip=!_.value.showTooltip}const H=e.ref(!1);function j(){H.value=!H.value}return d({getData:Be,generateCsv:de,generateImage:oe,generatePdf:te,toggleTable:ve,toggleTooltip:he,toggleAnnotator:j}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"treemapChart",ref:g,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;background:${t.value.style.chart.backgroundColor}`),id:`treemap_${f.value}`},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Ae.PenAndPaper,{key:0,parent:g.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:H.value,onClose:j},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),Ce.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:T,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:k,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:6px`)},[(e.openBlock(),e.createBlock(Pe._sfc_main,{key:`title_${Y.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(pe.UserOptions,{ref:"details",key:`user_option_${w.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(Q),isImaging:e.unref(ee),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:g.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:H.value,onToggleFullscreen:Te,onGeneratePdf:e.unref(te),onGenerateCsv:de,onGenerateImage:e.unref(oe),onToggleTable:ve,onToggleTooltip:he,onToggleAnnotator:j},e.createSlots({_:2},[o.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:i})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:i})),void 0,!0)]),key:"5"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:i})=>[e.renderSlot(o.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:i})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),v.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":b.value,"vue-data-ui-fulscreen--off":!b.value,"vue-data-ui-zoom-plus":!$.value,"vue-data-ui-zoom-minus":$.value}),viewBox:`${R.value.startX} ${R.value.startY} ${R.value.width<=0?10:R.value.width} ${R.value.height<=0?10:R.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: hidden; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Re._sfc_main),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(l,i)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.chart.layout.rects.gradient.show?(e.openBlock(),e.createElementBlock("defs",Ze,[e.createElementVNode("radialGradient",{id:`tgrad_${l.id}`,gradientTransform:"translate(-1, -1.000001) scale(2, 2)"},[e.createElementVNode("stop",{offset:"18%","stop-color":l.color},null,8,Ke),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.lightenHexColor)(l.color,t.value.style.chart.layout.rects.gradient.intensity/100)},null,8,Qe)],8,Je)])):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(l,i)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:l.x0,y:l.y0,height:ue(l),width:se(l),fill:h.value?l.color:t.value.style.chart.layout.rects.gradient.show?`url(#tgrad_${l.id})`:l.color,rx:t.value.style.chart.layout.rects.borderRadius,stroke:S.value&&S.value.id===l.id?t.value.style.chart.layout.rects.selected.stroke:t.value.style.chart.layout.rects.stroke,"stroke-width":S.value&&S.value.id===l.id?t.value.style.chart.layout.rects.selected.strokeWidth:t.value.style.chart.layout.rects.strokeWidth,onClick:y=>$e(l),onMouseenter:()=>Ne({datapoint:l,seriesIndex:i}),onMouseleave:a[0]||(a[0]=y=>{S.value=null,p.value=!1}),style:e.normalizeStyle(`opacity:${S.value?S.value.id===l.id?1:t.value.style.chart.layout.rects.selected.unselectedOpacity:1}`),class:"vue-ui-treemap-rect"},null,44,et),(e.openBlock(),e.createElementBlock("foreignObject",{x:l.x0,y:l.y0,height:ue(l),width:se(l),class:"vue-ui-treemap-cell-foreignObject"},[e.createElementVNode("div",ot,[t.value.style.chart.layout.labels.showDefaultLabels&&(l.proportion>t.value.style.chart.layout.labels.hideUnderProportion||$.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vue-ui-treemap-cell-default",style:e.normalizeStyle(`width:calc(100% - ${E(l)/1.5}px);text-align:left;line-height:${E(l)<14?14:E(l)}px;padding:${E(l)/3}px; color:${e.unref(r.adaptColorToBackground)(l.color)}`)},[e.createElementVNode("span",{style:e.normalizeStyle(`width:100%;font-size:${E(l)}px;`)},e.toDisplayString(l.name),5),lt,e.createElementVNode("span",{style:e.normalizeStyle(`width:100%;font-size:${E(l)}px;`)},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.formatter,l.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.labels.prefix,v:l.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.layout.labels.rounding}),{datapoint:l})),5)],4)):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"rect",e.normalizeProps(e.guardReactiveProps({rect:l,shouldShow:l.proportion>t.value.style.chart.layout.labels.hideUnderProportion||$.value,fontSize:E(l),isZoom:$.value,textColor:e.unref(r.adaptColorToBackground)(l.color)})),void 0,!0)])],8,tt))]))),256)),e.renderSlot(o.$slots,"svg",e.normalizeProps(e.guardReactiveProps({svg:O.value,isZoom:$.value,rect:S.value,config:t.value})),void 0,!0)],14,Ye)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",at,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(Q)||e.unref(ee)})),void 0,!0)])):e.createCommentVNode("",!0),v.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ve.default,{key:6,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(Oe.Legend,{key:`legend_${J.value}`,legendSet:ie.value,config:Se.value,id:`treemap_legend_${f.value}`,onClickMarker:a[1]||(a[1]=({legend:l})=>ce(l))},{item:e.withCtx(({legend:l,index:i})=>[e.createElementVNode("div",{onClick:y=>ce(l),style:e.normalizeStyle(`opacity:${m.value.includes(l.id)?.5:1}`)},[e.createTextVNode(e.toDisplayString(l.name)+": "+e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.formatter,l.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.labels.prefix,v:l.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:l}))+" ",1),m.value.includes(l.id)?(e.openBlock(),e.createElementBlock("span",ut," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",rt," ("+e.toDisplayString(isNaN(l.value/L.value)?"-":(l.value/L.value*100).toFixed(t.value.style.chart.legend.roundingPercentage))+"%) ",1))],12,nt)]),_:1},8,["legendSet","config","id"])):e.renderSlot(o.$slots,"legend",{key:1,legend:ie.value},void 0,!0)],512),o.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:B,dir:"auto"},[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(ze._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:g.value,content:C.value,isCustom:e.unref(r.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...G.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...G.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(Le.default,{key:8,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(Ee.DataTable,{key:`table_${Z.value}`,colNames:q.value.colNames,head:q.value.head,body:q.value.body,config:q.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:a[2]||(a[2]=l=>_.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,st)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l.name||l),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,Xe))}},ct=Fe._export_sfc(it,[["__scopeId","data-v-04106534"]]);exports.default=ct;
@@ -1,16 +1,16 @@
1
1
  import { computed as b, ref as f, watch as Qe, onMounted as et, onBeforeUnmount as tt, openBlock as g, createElementBlock as w, normalizeClass as ze, normalizeStyle as B, createBlock as U, createCommentVNode as O, unref as k, createSlots as ot, withCtx as x, renderSlot as $, normalizeProps as G, guardReactiveProps as X, createVNode as Pe, Fragment as Ae, renderList as Ie, createElementVNode as S, toDisplayString as Y, createTextVNode as Fe, nextTick as lt, pushScopeId as at, popScopeId as nt } from "vue";
2
- import { u as st, c as Le, t as rt, a as ut, p as T, b as it, o as ct, e as dt, d as ae, i as ne, f as K, X as vt, l as Re, F as De, x as Me, y as ht, q as ft, r as pt } from "./index-hV0hU1iE.js";
3
- import { _ as gt } from "./Title-DBozX6nP.js";
4
- import { u as yt, U as mt } from "./usePrinter-y3d31M4g.js";
5
- import { _ as bt } from "./Tooltip-Com_T8vc.js";
6
- import { L as wt } from "./Legend-hnLfwhmm.js";
7
- import kt from "./vue-ui-skeleton-BY8Jg9a_.js";
8
- import { D as Ct } from "./DataTable-BpVz3DBX.js";
9
- import $t from "./vue-ui-accordion-m-s-7akB.js";
2
+ import { u as st, c as Le, t as rt, a as ut, p as T, b as it, o as ct, e as dt, d as ae, i as ne, f as K, X as vt, l as Re, F as De, x as Me, y as ht, q as ft, r as pt } from "./index-D020Kb3z.js";
3
+ import { _ as gt } from "./Title-B2orjUIW.js";
4
+ import { u as yt, U as mt } from "./usePrinter-CN0J0NFL.js";
5
+ import { _ as bt } from "./Tooltip-CXjc5vb3.js";
6
+ import { L as wt } from "./Legend-C6q2bLVV.js";
7
+ import kt from "./vue-ui-skeleton-E1-7diF5.js";
8
+ import { D as Ct } from "./DataTable-Ce4R8v-3.js";
9
+ import $t from "./vue-ui-accordion-B0fEWLwn.js";
10
10
  import { t as xt, u as Tt } from "./useResponsive-CoxXLe23.js";
11
- import { u as Ve } from "./useNestedProp-CRAUOmT5.js";
12
- import { _ as _t } from "./PackageVersion-wqab02xF.js";
13
- import { P as Ot } from "./PenAndPaper-C_laA5mt.js";
11
+ import { u as Ve } from "./useNestedProp-CZkNAGQh.js";
12
+ import { _ as _t } from "./PackageVersion-g2UOsY7H.js";
13
+ import { P as Ot } from "./PenAndPaper-DRFeGfqV.js";
14
14
  import { _ as St } from "./_plugin-vue_export-helper-CHgC5LLL.js";
15
15
  function Be(a, i) {
16
16
  const s = a.length;
@@ -1,16 +1,16 @@
1
1
  import { useCssVars as Ze, computed as b, ref as r, watch as Me, onMounted as et, onBeforeUnmount as tt, openBlock as u, createElementBlock as i, normalizeClass as R, normalizeStyle as c, createBlock as M, createCommentVNode as g, unref as h, createSlots as at, withCtx as k, renderSlot as _, normalizeProps as U, guardReactiveProps as H, createElementVNode as n, toDisplayString as d, createVNode as re, Fragment as W, renderList as j, withKeys as lt, createTextVNode as ot } from "vue";
2
- import { u as nt, c as ut, t as st, a as rt, p as O, b as it, o as Oe, e as Z, v as S, d as ie, i as ee, f as I, X as dt, s as de, w as ct, x as vt, y as ht, q as pt, r as gt } from "./index-hV0hU1iE.js";
2
+ import { u as nt, c as ut, t as st, a as rt, p as O, b as it, o as Oe, e as Z, v as S, d as ie, i as ee, f as I, X as dt, s as de, w as ct, x as vt, y as ht, q as pt, r as gt } from "./index-D020Kb3z.js";
3
3
  import { t as yt, u as ft } from "./useResponsive-CoxXLe23.js";
4
- import { _ as bt } from "./Title-DBozX6nP.js";
5
- import { u as mt, U as _t } from "./usePrinter-y3d31M4g.js";
6
- import { _ as kt } from "./Tooltip-Com_T8vc.js";
7
- import { L as Ie } from "./Legend-hnLfwhmm.js";
8
- import xt from "./vue-ui-skeleton-BY8Jg9a_.js";
9
- import $t from "./BaseIcon-BRSPQaGQ.js";
10
- import Ct from "./vue-ui-accordion-m-s-7akB.js";
11
- import { u as Ae } from "./useNestedProp-CRAUOmT5.js";
12
- import { _ as wt } from "./PackageVersion-wqab02xF.js";
13
- import { P as Tt } from "./PenAndPaper-C_laA5mt.js";
4
+ import { _ as bt } from "./Title-B2orjUIW.js";
5
+ import { u as mt, U as _t } from "./usePrinter-CN0J0NFL.js";
6
+ import { _ as kt } from "./Tooltip-CXjc5vb3.js";
7
+ import { L as Ie } from "./Legend-C6q2bLVV.js";
8
+ import xt from "./vue-ui-skeleton-E1-7diF5.js";
9
+ import $t from "./BaseIcon-BbbAnrZI.js";
10
+ import Ct from "./vue-ui-accordion-B0fEWLwn.js";
11
+ import { u as Ae } from "./useNestedProp-CZkNAGQh.js";
12
+ import { _ as wt } from "./PackageVersion-g2UOsY7H.js";
13
+ import { P as Tt } from "./PenAndPaper-DRFeGfqV.js";
14
14
  import { _ as Lt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
15
15
  const Nt = ["id"], Pt = ["onClick"], St = ["xmlns", "viewBox"], Vt = ["id"], zt = ["stop-color"], Ft = ["stop-color"], Mt = ["x", "y", "width", "height", "fill", "rx"], Ot = ["x", "y", "width", "height", "fill", "rx", "stroke", "stroke-width"], It = ["x2", "y1", "y2", "stroke", "stroke-width"], At = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Bt = ["x", "y", "text-anchor", "font-size", "fill", "font-weight"], Dt = ["x", "y", "font-size", "fill", "font-weight"], Rt = ["x", "y", "font-size", "fill", "font-weight"], Xt = ["x", "y", "font-size", "fill", "font-weight"], Et = ["y", "width", "height", "fill", "onMouseenter"], Gt = {
16
16
  key: 6,