vue-data-ui 2.4.63 → 2.4.64

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/dist/{Arrow-nOy23OOV.js → Arrow-CRM8J83L.js} +1 -1
  2. package/dist/{Arrow-BpZBF7Ak.cjs → Arrow-DSkIkWAr.cjs} +1 -1
  3. package/dist/{BaseIcon-CrqNvGTs.js → BaseIcon-Axko0XAg.js} +1 -1
  4. package/dist/{BaseIcon-rzIvDo2Q.cjs → BaseIcon-D13bKBUN.cjs} +1 -1
  5. package/dist/{DataTable-BBh7_ttv.js → DataTable-B2hVpPSW.js} +2 -2
  6. package/dist/{DataTable-CCJGHIVo.cjs → DataTable-DnrSae6c.cjs} +1 -1
  7. package/dist/{Legend-WOejx9sp.js → Legend-CzY3Yhr8.js} +1 -1
  8. package/dist/{Legend-CqilK5CI.cjs → Legend-DIfEhYtz.cjs} +1 -1
  9. package/dist/{PackageVersion-dR8EUy_P.js → PackageVersion-B684aQUP.js} +1 -1
  10. package/dist/{PackageVersion-eZ5Dmuid.cjs → PackageVersion-FzHnQSp-.cjs} +1 -1
  11. package/dist/{PenAndPaper-D_w2N2qM.cjs → PenAndPaper-C6I0ckZw.cjs} +1 -1
  12. package/dist/{PenAndPaper-CrXlqi9I.js → PenAndPaper-mC0kh-S8.js} +3 -3
  13. package/dist/{Shape-CwmKWYzq.js → Shape-DbnYh6z4.js} +1 -1
  14. package/dist/{Shape-qkkvCKyp.cjs → Shape-eJUVLesM.cjs} +1 -1
  15. package/dist/{Slicer-DvdU-uf8.js → Slicer-BBolqweG.js} +2 -2
  16. package/dist/{Slicer-oNEtv1s3.cjs → Slicer-C9bF7-B-.cjs} +1 -1
  17. package/dist/{Title-obqvTiXP.js → Title-DqZErnpZ.js} +1 -1
  18. package/dist/{Title-CoNtoGH9.cjs → Title-DuMgnso9.cjs} +1 -1
  19. package/dist/{Tooltip-Dz4wVJkz.cjs → Tooltip-Cz3eQmMV.cjs} +1 -1
  20. package/dist/{Tooltip-BK-ACGDE.js → Tooltip-DddRc8qD.js} +1 -1
  21. package/dist/{index-ChOY3hT9.cjs → index-D-xYtUSL.cjs} +1 -1
  22. package/dist/{index-Z_vzxZTo.js → index-DjTPIx3R.js} +1 -1
  23. package/dist/style.css +1 -1
  24. package/dist/{useNestedProp-CA8PjFJH.cjs → useNestedProp-BN-VfUfj.cjs} +1 -1
  25. package/dist/{useNestedProp-Buhi5uyL.js → useNestedProp-BNmCbG1v.js} +1 -1
  26. package/dist/{usePrinter-Ck0oiMlt.js → usePrinter-BFF1xn1s.js} +1 -1
  27. package/dist/{usePrinter-c3c7_uAW.cjs → usePrinter-pT-a_sFr.cjs} +1 -1
  28. package/dist/{vue-data-ui-BGng_wXI.js → vue-data-ui-CPMtS74M.js} +60 -60
  29. package/dist/{vue-data-ui-CihfnXFF.cjs → vue-data-ui-rWaUsffe.cjs} +1 -1
  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-B7k4LzL1.js → vue-ui-3d-bar-Cpx0rTUr.js} +9 -9
  33. package/dist/{vue-ui-3d-bar-BsxFEhMN.cjs → vue-ui-3d-bar-CxcO1rW_.cjs} +1 -1
  34. package/dist/{vue-ui-accordion-CZ8AlriN.cjs → vue-ui-accordion-B1MkyNta.cjs} +1 -1
  35. package/dist/{vue-ui-accordion-CV2-8b1O.js → vue-ui-accordion-CDTXGeL0.js} +3 -3
  36. package/dist/{vue-ui-age-pyramid-C1crnKk7.cjs → vue-ui-age-pyramid-CEvYSZnY.cjs} +1 -1
  37. package/dist/{vue-ui-age-pyramid-Bc4DaLIy.js → vue-ui-age-pyramid-CSwlc2bd.js} +10 -10
  38. package/dist/{vue-ui-annotator-DNKcAaEh.cjs → vue-ui-annotator-BUoz1Y87.cjs} +1 -1
  39. package/dist/{vue-ui-annotator-DLbAn_Mz.js → vue-ui-annotator-D5dS0BTP.js} +1 -1
  40. package/dist/{vue-ui-bullet-CEO3AsWC.cjs → vue-ui-bullet-Bcx-V2GQ.cjs} +1 -1
  41. package/dist/{vue-ui-bullet-ClODxNrk.js → vue-ui-bullet-RDyK79l0.js} +8 -8
  42. package/dist/{vue-ui-candlestick-B00zQB4B.cjs → vue-ui-candlestick-CkjNRVDz.cjs} +1 -1
  43. package/dist/{vue-ui-candlestick-DI7t6jqz.js → vue-ui-candlestick-s-Z42Lns.js} +11 -11
  44. package/dist/{vue-ui-carousel-table-Bm2D_0pZ.cjs → vue-ui-carousel-table-CoLBbF34.cjs} +1 -1
  45. package/dist/{vue-ui-carousel-table-5jXlkslq.js → vue-ui-carousel-table-DJNIAgAU.js} +4 -4
  46. package/dist/{vue-ui-chestnut-DP6-Gie6.cjs → vue-ui-chestnut-P1hAffNt.cjs} +1 -1
  47. package/dist/{vue-ui-chestnut-CRZsXRUH.js → vue-ui-chestnut-_90914ye.js} +8 -8
  48. package/dist/{vue-ui-cursor-BGe0gZK8.cjs → vue-ui-cursor-BoGnTfem.cjs} +1 -1
  49. package/dist/{vue-ui-cursor-DA8bsmEc.js → vue-ui-cursor-Doo6HM0B.js} +2 -2
  50. package/dist/{vue-ui-dashboard-BZD-6Pz7.js → vue-ui-dashboard-BZKKb8cZ.js} +2 -2
  51. package/dist/{vue-ui-dashboard-D2v4oSiB.cjs → vue-ui-dashboard-mC_BLuIN.cjs} +1 -1
  52. package/dist/{vue-ui-digits-DC8ZuHOj.cjs → vue-ui-digits-DFwg7Et3.cjs} +1 -1
  53. package/dist/{vue-ui-digits-CKvrL9Wc.js → vue-ui-digits-Z8AprQhX.js} +2 -2
  54. package/dist/{vue-ui-donut-DDayabSz.js → vue-ui-donut-C6i_KVvc.js} +11 -11
  55. package/dist/{vue-ui-donut-evolution-CBsxmrTO.js → vue-ui-donut-evolution-CK_0JI6T.js} +11 -11
  56. package/dist/{vue-ui-donut-evolution-AlCGLfzy.cjs → vue-ui-donut-evolution-D-6gM9JV.cjs} +1 -1
  57. package/dist/{vue-ui-donut-D5mDCNky.cjs → vue-ui-donut-uH8SS5Ms.cjs} +1 -1
  58. package/dist/{vue-ui-dumbbell-DB7jNjQP.js → vue-ui-dumbbell-C4y9e7Gz.js} +10 -10
  59. package/dist/{vue-ui-dumbbell-B9cELz3z.cjs → vue-ui-dumbbell-DS_3Z5cT.cjs} +1 -1
  60. package/dist/{vue-ui-flow-CCM51fzQ.cjs → vue-ui-flow-C2sVVaok.cjs} +1 -1
  61. package/dist/{vue-ui-flow-Cw1Vfk_e.js → vue-ui-flow-XrJvcKqr.js} +9 -9
  62. package/dist/{vue-ui-funnel-CU72MuGg.js → vue-ui-funnel-CHhVPjnM.js} +9 -9
  63. package/dist/{vue-ui-funnel--4JhwVwW.cjs → vue-ui-funnel-DxhsOEbU.cjs} +1 -1
  64. package/dist/{vue-ui-galaxy-BKInqdOk.js → vue-ui-galaxy-Bd8p21nC.js} +11 -11
  65. package/dist/{vue-ui-galaxy-BJrkygeR.cjs → vue-ui-galaxy-CRsan4r5.cjs} +1 -1
  66. package/dist/{vue-ui-gauge-DBPB11Eo.js → vue-ui-gauge-B-nOtSwD.js} +7 -7
  67. package/dist/{vue-ui-gauge-Uo_1rs0Z.cjs → vue-ui-gauge-D0Mk9_aI.cjs} +1 -1
  68. package/dist/{vue-ui-gizmo-D7hHruEs.cjs → vue-ui-gizmo-C3GRBcSW.cjs} +1 -1
  69. package/dist/{vue-ui-gizmo-BSDdKP_q.js → vue-ui-gizmo-tQNlhr2p.js} +3 -3
  70. package/dist/{vue-ui-heatmap-DhoDd6I_.js → vue-ui-heatmap-6MpvCBmt.js} +10 -10
  71. package/dist/{vue-ui-heatmap-CysVyR78.cjs → vue-ui-heatmap-DwalrFVm.cjs} +1 -1
  72. package/dist/{vue-ui-history-plot-D97p0C8E.cjs → vue-ui-history-plot-FgapeA0e.cjs} +1 -1
  73. package/dist/{vue-ui-history-plot-C1IcR5tn.js → vue-ui-history-plot-Hk-UrZtS.js} +11 -11
  74. package/dist/{vue-ui-kpi-Cu2PoWud.cjs → vue-ui-kpi-CKZQsJnV.cjs} +1 -1
  75. package/dist/{vue-ui-kpi-C43FJnkn.js → vue-ui-kpi-DrCH9EuP.js} +3 -3
  76. package/dist/{vue-ui-mini-loader-DgPnsWaW.js → vue-ui-mini-loader-BLvcc-fM.js} +2 -2
  77. package/dist/{vue-ui-mini-loader-Bdr0862F.cjs → vue-ui-mini-loader-BSKXq7CA.cjs} +1 -1
  78. package/dist/{vue-ui-molecule-CvxtHapj.js → vue-ui-molecule-Ch4_SJxL.js} +11 -11
  79. package/dist/{vue-ui-molecule-CEJzQ7RY.cjs → vue-ui-molecule-D0IHSilQ.cjs} +1 -1
  80. package/dist/{vue-ui-mood-radar-DIn_Oars.cjs → vue-ui-mood-radar-DNPseOpJ.cjs} +1 -1
  81. package/dist/{vue-ui-mood-radar-B6EmzBGf.js → vue-ui-mood-radar-Gv0k1T46.js} +11 -11
  82. package/dist/{vue-ui-nested-donuts-D4pAkaZH.js → vue-ui-nested-donuts-DY8Hig_-.js} +11 -11
  83. package/dist/{vue-ui-nested-donuts-c2pJF_ex.cjs → vue-ui-nested-donuts-QOvJJc30.cjs} +1 -1
  84. package/dist/{vue-ui-onion-DHOhnx2s.cjs → vue-ui-onion-Ca0Tcbu3.cjs} +1 -1
  85. package/dist/{vue-ui-onion-98XPhnVF.js → vue-ui-onion-Ct_1j1fA.js} +11 -11
  86. package/dist/{vue-ui-parallel-coordinate-plot-CrVVxflg.cjs → vue-ui-parallel-coordinate-plot-C_opo0qJ.cjs} +1 -1
  87. package/dist/{vue-ui-parallel-coordinate-plot-DLOtv_NO.js → vue-ui-parallel-coordinate-plot-DkYcNRQk.js} +12 -12
  88. package/dist/{vue-ui-quadrant-DbDQtcxz.cjs → vue-ui-quadrant-BJuoZ_lv.cjs} +1 -1
  89. package/dist/{vue-ui-quadrant-DWM3zE7x.js → vue-ui-quadrant-DwAKm2Yj.js} +12 -12
  90. package/dist/{vue-ui-quick-chart-DP0hSesI.cjs → vue-ui-quick-chart-5ga8waQS.cjs} +1 -1
  91. package/dist/{vue-ui-quick-chart-CFVAisN4.js → vue-ui-quick-chart-D5V73GXO.js} +9 -9
  92. package/dist/{vue-ui-radar-CDhwXWfs.cjs → vue-ui-radar-C3kzmi1G.cjs} +1 -1
  93. package/dist/{vue-ui-radar-CNBN5GF9.js → vue-ui-radar-CmE4wCWD.js} +12 -12
  94. package/dist/{vue-ui-rating-cHW6zh7i.cjs → vue-ui-rating-CE7LGiFS.cjs} +1 -1
  95. package/dist/{vue-ui-rating-CEfg8aGb.js → vue-ui-rating-SAph_BKh.js} +2 -2
  96. package/dist/{vue-ui-relation-circle-92LvehQf.js → vue-ui-relation-circle-D1JdWshk.js} +7 -7
  97. package/dist/{vue-ui-relation-circle-olDAN0lU.cjs → vue-ui-relation-circle-dQQw_mgd.cjs} +1 -1
  98. package/dist/{vue-ui-rings-Bp0WLW4E.js → vue-ui-rings-C-7vrgjN.js} +11 -11
  99. package/dist/{vue-ui-rings-BwvTmRCE.cjs → vue-ui-rings-kFhuaBvY.cjs} +1 -1
  100. package/dist/{vue-ui-scatter-BvdgtUHX.cjs → vue-ui-scatter-BrOg2xiN.cjs} +1 -1
  101. package/dist/{vue-ui-scatter-6wDrQ5fP.js → vue-ui-scatter-DE4X0DQI.js} +12 -12
  102. package/dist/{vue-ui-screenshot-ChB7VFUO.cjs → vue-ui-screenshot-BXq82cfA.cjs} +1 -1
  103. package/dist/{vue-ui-screenshot-CIAlcAvq.js → vue-ui-screenshot-CyWEEkg_.js} +1 -1
  104. package/dist/{vue-ui-skeleton-DlnPFtb4.cjs → vue-ui-skeleton-D3zg7qd2.cjs} +1 -1
  105. package/dist/{vue-ui-skeleton-BMRe3SzB.js → vue-ui-skeleton-Dt9cA-wa.js} +3 -3
  106. package/dist/{vue-ui-smiley-DkrQ5gDD.cjs → vue-ui-smiley-FUNmIUpN.cjs} +1 -1
  107. package/dist/{vue-ui-smiley-CN5FWJ1G.js → vue-ui-smiley-uRlPgN-A.js} +2 -2
  108. package/dist/{vue-ui-spark-trend-MNkadB41.js → vue-ui-spark-trend-5KFnHsjs.js} +5 -5
  109. package/dist/{vue-ui-spark-trend-BlOdnAb4.cjs → vue-ui-spark-trend-DYXJMJLz.cjs} +1 -1
  110. package/dist/{vue-ui-sparkbar-ChTbwY11.cjs → vue-ui-sparkbar-BUg0DhGI.cjs} +1 -1
  111. package/dist/{vue-ui-sparkbar-CBPO2mUa.js → vue-ui-sparkbar-D-Yk9z4E.js} +4 -4
  112. package/dist/{vue-ui-sparkgauge-VLkIev3p.js → vue-ui-sparkgauge-DVLZofTg.js} +4 -4
  113. package/dist/{vue-ui-sparkgauge-B7yvQfZW.cjs → vue-ui-sparkgauge-DvDPPyau.cjs} +1 -1
  114. package/dist/{vue-ui-sparkhistogram-DbOxX4Ks.js → vue-ui-sparkhistogram-Dqgl_5RN.js} +5 -5
  115. package/dist/{vue-ui-sparkhistogram-mYU6RAK_.cjs → vue-ui-sparkhistogram-GMZxK2oC.cjs} +1 -1
  116. package/dist/vue-ui-sparkline-C96IUWwW.cjs +1 -0
  117. package/dist/{vue-ui-sparkline-D_-31O2S.js → vue-ui-sparkline-CPEHgvq0.js} +9 -9
  118. package/dist/{vue-ui-sparkstackbar-KaFMlIAL.cjs → vue-ui-sparkstackbar-BroOR6B-.cjs} +1 -1
  119. package/dist/{vue-ui-sparkstackbar-gW7rpJmQ.js → vue-ui-sparkstackbar-DCceVnjJ.js} +5 -5
  120. package/dist/{vue-ui-stackbar-CYHsSzEK.cjs → vue-ui-stackbar-Bv7RiRae.cjs} +2 -2
  121. package/dist/{vue-ui-stackbar-vIyS6oag.js → vue-ui-stackbar-KznnSCkj.js} +14 -14
  122. package/dist/{vue-ui-strip-plot-MlP5pDNx.cjs → vue-ui-strip-plot-BYO72loZ.cjs} +1 -1
  123. package/dist/{vue-ui-strip-plot-4o1zAxG_.js → vue-ui-strip-plot-CJxPAY9n.js} +11 -11
  124. package/dist/{vue-ui-table-B0PFrkLI.cjs → vue-ui-table-BTuCiJb7.cjs} +1 -1
  125. package/dist/{vue-ui-table-DWNrd7zM.js → vue-ui-table-DKoRX7gX.js} +1 -1
  126. package/dist/{vue-ui-table-heatmap-BSKCS8Lq.js → vue-ui-table-heatmap-4RZ4Bo12.js} +4 -4
  127. package/dist/{vue-ui-table-heatmap-4k74Ux7O.cjs → vue-ui-table-heatmap-L3Pg7wC0.cjs} +1 -1
  128. package/dist/{vue-ui-table-sparkline-BrImSTh0.js → vue-ui-table-sparkline-CVWPCRfz.js} +5 -5
  129. package/dist/{vue-ui-table-sparkline-DCCogh2-.cjs → vue-ui-table-sparkline-GaHw2cTh.cjs} +1 -1
  130. package/dist/{vue-ui-thermometer-DHEoT4yB.js → vue-ui-thermometer-BFqURwxY.js} +7 -7
  131. package/dist/{vue-ui-thermometer-DswmMXiU.cjs → vue-ui-thermometer-VC967j2q.cjs} +1 -1
  132. package/dist/{vue-ui-timer-Tv94CYqL.cjs → vue-ui-timer-Bou1Zg22.cjs} +1 -1
  133. package/dist/{vue-ui-timer-BNFihNgK.js → vue-ui-timer-mPQTAvi1.js} +5 -5
  134. package/dist/{vue-ui-tiremarks-B2kuKLe-.cjs → vue-ui-tiremarks-ClzgPlHg.cjs} +1 -1
  135. package/dist/{vue-ui-tiremarks-DzaUfiET.js → vue-ui-tiremarks-DyEXFKpK.js} +7 -7
  136. package/dist/{vue-ui-treemap-Dmt3RPF2.cjs → vue-ui-treemap-DEUSAGw0.cjs} +1 -1
  137. package/dist/{vue-ui-treemap-qKZJcEYe.js → vue-ui-treemap-pCrT4KlF.js} +11 -11
  138. package/dist/{vue-ui-vertical-bar-CQ_qEJ_O.cjs → vue-ui-vertical-bar-DxkQK0tN.cjs} +1 -1
  139. package/dist/{vue-ui-vertical-bar-CMXtevyE.js → vue-ui-vertical-bar-QF9epdei.js} +11 -11
  140. package/dist/{vue-ui-waffle-fWQvVbAH.cjs → vue-ui-waffle-DjcwBxNh.cjs} +1 -1
  141. package/dist/{vue-ui-waffle-DjJoezg-.js → vue-ui-waffle-DkHP1plA.js} +11 -11
  142. package/dist/{vue-ui-wheel-DOrWSWt6.js → vue-ui-wheel-L8vxpKcv.js} +7 -7
  143. package/dist/{vue-ui-wheel-2qIHyZe1.cjs → vue-ui-wheel-Y2Sny-6a.cjs} +1 -1
  144. package/dist/{vue-ui-word-cloud-Tgg5jCE6.cjs → vue-ui-word-cloud-B9UJmesc.cjs} +1 -1
  145. package/dist/{vue-ui-word-cloud-UPPKGsXt.js → vue-ui-word-cloud-DIBB7HIj.js} +10 -10
  146. package/dist/{vue-ui-xy-CMde0Kq-.cjs → vue-ui-xy-DwidR-Vl.cjs} +1 -1
  147. package/dist/{vue-ui-xy-zCJv-Vao.js → vue-ui-xy-QmsiPNcv.js} +14 -14
  148. package/dist/{vue-ui-xy-canvas-Dm3YUQ3g.cjs → vue-ui-xy-canvas-2aqG9yv5.cjs} +1 -1
  149. package/dist/{vue-ui-xy-canvas-paHHRtqs.js → vue-ui-xy-canvas-CeKH8VIR.js} +11 -11
  150. package/package.json +1 -1
  151. package/dist/vue-ui-sparkline-DO496Tk5.cjs +0 -1
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-D-xYtUSL.cjs"),S=require("./useNestedProp-BN-VfUfj.cjs"),q=require("./vue-ui-skeleton-D3zg7qd2.cjs"),P=require("./useResponsive-BJ7DTGpm.cjs"),G=require("./PackageVersion-FzHnQSp-.cjs"),R=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),H=["id"],U=["xmlns","viewBox"],X=["width","height"],Z=["id"],Y=["stop-color"],J=["stop-color"],K=["id"],Q=["stop-color"],ee=["stop-color"],te=["id"],le=["stop-color"],ae=["stop-color"],oe={key:1},ne=["d","fill"],re=["d","fill"],ue=["d","stroke","stroke-width"],se=["x1","x2","y1","y2","stroke","stroke-width"],ie=["x","y","width","height","fill","rx"],de=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],ce=["x1","x2","y1","y2","stroke","stroke-dasharray","stroke-width"],ve=["cx","cy","r","fill","stroke","stroke-width"],he=["x","y","font-size","font-weight","fill"],ye=["x","y","height","width","onMouseenter","onClick"],fe={__name:"vue-ui-sparkline",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}},showInfo:{type:Boolean,default:!0},selectedIndex:{type:Number,default:void 0},heightRatio:{type:Number,default:1},forcedPadding:{type:Number,default:30}},emits:["hoverIndex","selectDatapoint"],setup(p,{emit:x}){const u=p,{vue_ui_sparkline:z}=r.useConfig(),k=e.computed(()=>!!u.dataset&&u.dataset.length),v=e.ref(r.createUid()),w=e.ref(null),C=e.ref(null),L=e.ref(null),t=e.computed({get:()=>V(),set:l=>l});function V(){const l=S.useNestedProp({userConfig:u.config,defaultConfig:z});let o={};return l.theme?o={...S.useNestedProp({userConfig:r.themes.vue_ui_sparkline[l.theme]||u.config,defaultConfig:l})}:o=l,u.config&&r.hasDeepProperty(u.config,"style.scaleMin")?o.style.scaleMin=u.config.style.scaleMin:o.style.scaleMin=null,u.config&&r.hasDeepProperty(u.config,"style.scaleMax")?o.style.scaleMax=u.config.style.scaleMax:o.style.scaleMax=null,o}const b=e.computed(()=>r.largestTriangleThreeBucketsArrayObjects({data:u.dataset,threshold:t.value.downsample.threshold}));e.watch(()=>u.config,l=>{t.value=V(),$(),n.value.chartWidth=t.value.style.chartWidth},{deep:!0}),e.watch(()=>u.dataset,l=>{f.value=r.largestTriangleThreeBucketsArrayObjects({data:u.dataset.map(o=>({...o,value:[void 0].includes(o.value)?null:o.value})),threshold:t.value.downsample.threshold})},{deep:!0});const f=e.ref(D());function D(){return r.largestTriangleThreeBucketsArrayObjects({data:u.dataset.map(l=>t.value.style.animation.show?{...l,value:null}:{...l,value:[void 0].includes(l.value)?null:l.value}),threshold:t.value.downsample.threshold})}const E=e.ref(null);e.onMounted(()=>{if($(),t.value.style.animation.show&&u.dataset.length>1){let a=function(){o<b.value.length?(f.value.push(b.value[o]),setTimeout(()=>{requestAnimationFrame(a)},l)):f.value=b.value,o+=1};f.value=[];const l=t.value.style.animation.animationFrames/u.dataset.length;let o=0;a()}});function $(){if(r.objectIsEmpty(u.dataset)?r.error({componentName:"VueUiSparkline",type:"dataset"}):u.dataset.forEach((l,o)=>{r.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["period","value"]}).forEach(a=>{r.error({componentName:"VueUiSparkline",type:"datasetSerieAttribute",property:a,index:o})})}),t.value.responsive){const l=P.throttle(()=>{const{width:o,height:a}=P.useResponsive({chart:w.value,title:t.value.style.title.show&&u.showInfo?C.value:null,source:L.value});n.value.width=o,n.value.height=a,n.value.chartWidth=t.value.style.chartWidth/500*o,n.value.padding=u.forcedPadding/500*o});E.value=new ResizeObserver(l),E.value.observe(w.value.parentNode)}}const n=e.ref({height:80*u.heightRatio,width:500,chartWidth:t.value.style.chartWidth,padding:u.forcedPadding}),s=e.computed(()=>{const{top:l,right:o,bottom:a,left:i}=t.value.style.padding;return{top:l,left:i,right:n.value.width-o,bottom:n.value.height-a,start:u.showInfo&&t.value.style.dataLabel.show&&t.value.style.dataLabel.position==="left"?n.value.width-n.value.chartWidth+i:n.value.padding+i,width:u.showInfo&&t.value.style.dataLabel.show?n.value.chartWidth-i-o:n.value.width-n.value.padding-i-o,height:n.value.height-l-a}}),N=e.computed(()=>[null,void 0].includes(t.value.style.scaleMin)?Math.min(...f.value.map(l=>isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0)):t.value.style.scaleMin),A=e.computed(()=>[null,void 0].includes(t.value.style.scaleMax)?Math.max(...f.value.map(l=>isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0)):t.value.style.scaleMax),m=e.computed(()=>{const l=N.value>=0?0:N.value;return Math.abs(l)}),O=e.computed(()=>A.value+m.value),_=e.computed(()=>s.value.bottom-s.value.height*B(m.value));function B(l){return l/O.value}const h=e.computed(()=>b.value.length-1),d=e.computed(()=>f.value.map((l,o)=>{const a=isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0;return{absoluteValue:a,period:l.period,plotValue:a+m.value,toMax:B(a+m.value),x:s.value.start+o*(s.value.width/(h.value+1)>n.padding?n.padding:s.value.width/(h.value+1)),y:s.value.bottom-s.value.height*B(a+m.value),id:`plot_${v.value}_${o}`,color:g.value?t.value.style.bar.color:t.value.style.area.useGradient?r.shiftHue(t.value.style.line.color,.05*(1-o/h.value)):t.value.style.line.color,width:s.value.width/(h.value+1)>n.padding?n.padding:s.value.width/(h.value+1)}})),T=e.computed(()=>{const l={x:d.value[0].x||0,y:(n.value.height||0)-6},o={x:d.value[d.value.length-1].x||0,y:(n.value.height||0)-6},a=[];return d.value.forEach(i=>{a.push(`${i.x||0},${i.y||0} `)}),[l.x,l.y,...a,o.x,o.y].toString()}),c=e.ref(void 0);function W(l,o){c.value=l,x("hoverIndex",{index:o})}function j(){c.value=void 0,x("hoverIndex",{index:void 0})}const y=e.computed(()=>{if(k.value){const l=d.value.map(a=>a.absoluteValue),o=l.reduce((a,i)=>a+i,0);return{latest:d.value[d.value.length-1].absoluteValue,sum:o,average:o/d.value.length,median:r.calcMedian(l),trend:r.calcLinearProgression(d.value.map(({x:a,y:i,absoluteValue:I})=>({x:a,y:i,value:I}))).trend}}else return{latest:null,sum:null,average:null,median:null,trend:null}}),M=e.computed(()=>k.value?t.value.style.dataLabel.valueType==="latest"?y.value.latest:t.value.style.dataLabel.valueType==="sum"?y.value.sum:t.value.style.dataLabel.valueType==="average"?y.value.average:0:0),g=e.computed(()=>t.value.type&&t.value.type==="bar");function F(l,o){x("selectDatapoint",{datapoint:l,index:o})}return(l,o)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"sparklineChart",ref:w,class:"vue-ui-sparkline",id:v.value,style:e.normalizeStyle(`width:100%;font-family:${t.value.style.fontFamily};`)},[e.renderSlot(l.$slots,"before",e.normalizeProps(e.guardReactiveProps({selected:c.value,latest:y.value.latest,sum:y.value.sum,average:y.value.average,median:y.value.median,trend:y.value.trend})),void 0,!0),t.value.style.title.show&&p.showInfo?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:C,class:"vue-ui-sparkline-title",style:e.normalizeStyle(`display:flex;align-items:center;width:100%;color:${t.value.style.title.color};background:${t.value.style.backgroundColor};justify-content:${t.value.style.title.textAlign==="left"?"flex-start":t.value.style.title.textAlign==="right"?"flex-end":"center"};height:${t.value.style.title.fontSize*2}px;font-size:${t.value.style.title.fontSize}px;font-weight:${t.value.style.title.bold?"bold":"normal"};`)},[e.createElementVNode("span",{style:e.normalizeStyle(`padding:${t.value.style.title.textAlign==="left"?"0 0 0 12px":t.value.style.title.textAlign==="right"?"0 12px 0 0":"0"}`)},e.toDisplayString(c.value?c.value.period:t.value.style.title.text),5)],4)):e.createCommentVNode("",!0),k.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(r.XMLNS),viewBox:`0 0 ${n.value.width} ${n.value.height}`,style:e.normalizeStyle(`background:${t.value.style.backgroundColor};overflow:visible`)},[e.createVNode(G._sfc_main),l.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:n.value.width<=0?10:n.value.width,height:n.value.height<=0?10:n.value.height,style:{pointerEvents:"none"}},[e.renderSlot(l.$slots,"chart-background",{},void 0,!0)],8,X)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{x1:"0%",y1:"0%",x2:"100%",y2:"0%",id:`sparkline_gradient_${v.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(r.setOpacity)(e.unref(r.shiftHue)(t.value.style.area.color,.05),t.value.style.area.opacity)},null,8,Y),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.setOpacity)(t.value.style.area.color,t.value.style.area.opacity)},null,8,J)],8,Z),e.createElementVNode("linearGradient",{x2:"0%",y2:"100%",id:`sparkline_bar_gradient_pos_${v.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.bar.color},null,8,Q),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.shiftHue)(t.value.style.bar.color,.05)},null,8,ee)],8,K),e.createElementVNode("linearGradient",{x2:"0%",y2:"100%",id:`sparkline_bar_gradient_neg_${v.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(r.shiftHue)(t.value.style.bar.color,.05)},null,8,le),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.bar.color},null,8,ae)],8,te)]),t.value.style.area.show&&!g.value&&d.value[0]?(e.openBlock(),e.createElementBlock("g",oe,[t.value.style.line.smooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:`M ${d.value[0].x},${s.value.bottom} ${e.unref(r.createSmoothPath)(d.value)} L ${d.value.at(-1).x},${s.value.bottom} Z`,fill:t.value.style.area.useGradient?`url(#sparkline_gradient_${v.value})`:e.unref(r.setOpacity)(t.value.style.area.color,t.value.style.area.opacity)},null,8,ne)):(e.openBlock(),e.createElementBlock("path",{key:1,d:`M${T.value}Z`,fill:t.value.style.area.useGradient?`url(#sparkline_gradient_${v.value})`:e.unref(r.setOpacity)(t.value.style.area.color,t.value.style.area.opacity)},null,8,re))])):e.createCommentVNode("",!0),t.value.style.line.smooth&&!g.value?(e.openBlock(),e.createElementBlock("path",{key:2,d:`M ${e.unref(r.createSmoothPath)(d.value)}`,stroke:t.value.style.line.color,fill:"none","stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":"round"},null,8,ue)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(a,i)=>(e.openBlock(),e.createElementBlock("g",null,[i<d.value.length-1&&!t.value.style.line.smooth&&!g.value?(e.openBlock(),e.createElementBlock("line",{key:0,x1:a.x,x2:d.value[i+1].x,y1:a.y||0,y2:d.value[i+1].y||0,stroke:a.color,"stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round","shape-rendering":"geometricPrecision"},null,8,se)):e.createCommentVNode("",!0),g.value?(e.openBlock(),e.createElementBlock("rect",{key:1,x:a.x-a.width/2,y:a.absoluteValue>0?a.y:_.value,width:a.width,height:Math.abs(a.y-_.value),fill:a.absoluteValue>0?`url(#sparkline_bar_gradient_pos_${v.value})`:`url(#sparkline_bar_gradient_neg_${v.value})`,rx:t.value.style.bar.borderRadius},null,8,ie)):e.createCommentVNode("",!0),t.value.style.verticalIndicator.show&&(c.value&&a.id===c.value.id||p.selectedIndex===i)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:a.x,x2:a.x,y1:s.value.top-6,y2:s.value.bottom,stroke:t.value.style.verticalIndicator.color||a.color,"stroke-width":t.value.style.verticalIndicator.strokeWidth,"stroke-linecap":"round","stroke-dasharray":t.value.style.verticalIndicator.strokeDasharray||0},null,8,de)):e.createCommentVNode("",!0)]))),256)),N.value<0?(e.openBlock(),e.createElementBlock("line",{key:3,x1:s.value.start,x2:s.value.start+s.value.width-16,y1:_.value,y2:_.value,stroke:t.value.style.zeroLine.color,"stroke-dasharray":t.value.style.zeroLine.strokeWidth*2,"stroke-width":t.value.style.zeroLine.strokeWidth,"stroke-linecap":"round"},null,8,ce)):e.createCommentVNode("",!0),t.value.style.plot.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:4},e.renderList(d.value,(a,i)=>(e.openBlock(),e.createElementBlock("g",null,[c.value&&a.id===c.value.id||p.selectedIndex===i?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:a.x,cy:a.y,r:t.value.style.plot.radius,fill:a.color,stroke:t.value.style.plot.stroke,"stroke-width":t.value.style.plot.strokeWidth},null,8,ve)):e.createCommentVNode("",!0)]))),256)):e.createCommentVNode("",!0),p.showInfo&&t.value.style.dataLabel.show?(e.openBlock(),e.createElementBlock("text",{key:5,x:t.value.style.dataLabel.position==="left"?12+t.value.style.dataLabel.offsetX:s.value.width+12+t.value.style.dataLabel.offsetX,y:n.value.height/2+t.value.style.dataLabel.fontSize/2.5+t.value.style.dataLabel.offsetY,"font-size":t.value.style.dataLabel.fontSize,"font-weight":t.value.style.dataLabel.bold?"bold":"normal",fill:t.value.style.dataLabel.color},e.toDisplayString(c.value?e.unref(r.applyDataLabel)(t.value.style.dataLabel.formatter,c.value.absoluteValue,e.unref(r.dataLabel)({p:t.value.style.dataLabel.prefix,v:c.value.absoluteValue,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.roundingValue}),{datapoint:c.value}):e.unref(r.applyDataLabel)(t.value.style.dataLabel.formatter,M.value,e.unref(r.dataLabel)({p:t.value.style.dataLabel.prefix,v:M.value,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.roundingValue}))),9,he)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(a,i)=>(e.openBlock(),e.createElementBlock("rect",{x:a.x-(s.value.width/(h.value+1)>n.value.padding?n.value.padding:s.value.width/(h.value+1))/2,y:s.value.top-6,height:s.value.height+6,width:s.value.width/(h.value+1)>n.value.padding?n.value.padding:s.value.width/(h.value+1),fill:"transparent",onMouseenter:I=>W(a,i),onMouseleave:j,onClick:()=>F(a,i)},null,40,ye))),256)),e.renderSlot(l.$slots,"svg",{svg:n.value},void 0,!0)],12,U)):e.createCommentVNode("",!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"source",ref:L,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),k.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(q.default,{key:3,config:{type:"sparkline",style:{backgroundColor:t.value.style.backgroundColor,sparkline:{color:"#CCCCCC"}}}},null,8,["config"]))],12,H))}},pe=R._export_sfc(fe,[["__scopeId","data-v-0bfdcef1"]]);exports.default=pe;
@@ -1,9 +1,9 @@
1
1
  import { computed as v, ref as k, watch as U, onMounted as ne, openBlock as r, createElementBlock as i, normalizeStyle as C, renderSlot as M, normalizeProps as re, guardReactiveProps as ie, createElementVNode as f, toDisplayString as X, createCommentVNode as c, unref as h, createVNode as de, Fragment as D, renderList as P, createBlock as ve } from "vue";
2
- import { u as ce, c as he, t as ye, C as Z, _ as T, o as fe, e as q, g as pe, w as I, $ as ge, a0 as me, X as ke, s as V, R as H, i as Y, f as J } from "./index-Z_vzxZTo.js";
3
- import { u as K } from "./useNestedProp-Buhi5uyL.js";
4
- import be from "./vue-ui-skeleton-BMRe3SzB.js";
2
+ import { u as ce, c as he, t as ye, C as Z, _ as T, o as fe, e as q, g as pe, w as I, $ as ge, a0 as me, X as ke, s as V, R as H, i as Y, f as J } from "./index-DjTPIx3R.js";
3
+ import { u as K } from "./useNestedProp-BNmCbG1v.js";
4
+ import be from "./vue-ui-skeleton-Dt9cA-wa.js";
5
5
  import { t as _e, u as xe } from "./useResponsive-CoxXLe23.js";
6
- import { _ as we } from "./PackageVersion-dR8EUy_P.js";
6
+ import { _ as we } from "./PackageVersion-B684aQUP.js";
7
7
  import { _ as $e } from "./_plugin-vue_export-helper-CHgC5LLL.js";
8
8
  const Le = ["id"], Ne = ["xmlns", "viewBox"], Ce = ["width", "height"], Me = ["id"], Ie = ["stop-color"], Ve = ["stop-color"], ze = ["id"], Se = ["stop-color"], We = ["stop-color"], Ae = ["id"], De = ["stop-color"], Pe = ["stop-color"], Te = { key: 1 }, Oe = ["d", "fill"], Be = ["d", "fill"], Ee = ["d", "stroke", "stroke-width"], Fe = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Ge = ["x", "y", "width", "height", "fill", "rx"], Re = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], je = ["x1", "x2", "y1", "y2", "stroke", "stroke-dasharray", "stroke-width"], Ue = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], Xe = ["x", "y", "font-size", "font-weight", "fill"], Ze = ["x", "y", "height", "width", "onMouseenter", "onClick"], qe = {
9
9
  __name: "vue-ui-sparkline",
@@ -163,9 +163,9 @@ const Le = ["id"], Ne = ["xmlns", "viewBox"], Ce = ["width", "height"], Me = ["i
163
163
  width: o.value.width / (g.value + 1) > u.padding ? u.padding : o.value.width / (g.value + 1)
164
164
  };
165
165
  })), le = v(() => {
166
- const t = { x: d.value[0].x, y: u.value.height - 6 }, l = { x: d.value[d.value.length - 1].x, y: u.value.height - 6 }, a = [];
166
+ const t = { x: d.value[0].x || 0, y: (u.value.height || 0) - 6 }, l = { x: d.value[d.value.length - 1].x || 0, y: (u.value.height || 0) - 6 }, a = [];
167
167
  return d.value.forEach((n) => {
168
- a.push(`${n.x},${n.y} `);
168
+ a.push(`${n.x || 0},${n.y || 0} `);
169
169
  }), [t.x, t.y, ...a, l.x, l.y].toString();
170
170
  }), y = k(void 0);
171
171
  function ue(t, l) {
@@ -315,8 +315,8 @@ const Le = ["id"], Ne = ["xmlns", "viewBox"], Ce = ["width", "height"], Me = ["i
315
315
  key: 0,
316
316
  x1: a.x,
317
317
  x2: d.value[n + 1].x,
318
- y1: a.y,
319
- y2: d.value[n + 1].y,
318
+ y1: a.y || 0,
319
+ y2: d.value[n + 1].y || 0,
320
320
  stroke: a.color,
321
321
  "stroke-width": e.value.style.line.strokeWidth,
322
322
  "stroke-linecap": "round",
@@ -417,7 +417,7 @@ const Le = ["id"], Ne = ["xmlns", "viewBox"], Ce = ["width", "height"], Me = ["i
417
417
  }, null, 8, ["config"]))
418
418
  ], 12, Le));
419
419
  }
420
- }, at = /* @__PURE__ */ $e(qe, [["__scopeId", "data-v-792e1bb5"]]);
420
+ }, at = /* @__PURE__ */ $e(qe, [["__scopeId", "data-v-0bfdcef1"]]);
421
421
  export {
422
422
  at as default
423
423
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-ChOY3hT9.cjs"),V=require("./useNestedProp-CA8PjFJH.cjs"),q=require("./vue-ui-skeleton-DlnPFtb4.cjs"),O=require("./PackageVersion-eZ5Dmuid.cjs"),U=require("./Tooltip-Dz4wVJkz.cjs"),M=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),j=["xmlns","viewBox"],H=["id"],I=["stop-color"],R=["stop-color"],W=["stop-color"],Y={id:"stackPill",clipPathUnits:"objectBoundingBox"},G=["fill"],X={key:0,"clip-path":"url(#stackPill)"},J=["x","width","height","fill"],K=["x","width","height","fill","stroke"],Q=["onClick","x","width","height","onMouseenter"],Z=["width","height","rx"],ee=["onClick"],te={style:{display:"flex","flex-direction":"row","align-items":"center",gap:"4px","justify-content":"center"}},le=["height","width"],oe=["fill"],ae={key:4,ref:"source",dir:"auto"},re={__name:"vue-ui-sparkstackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(P,{emit:D}){const u=P,{vue_ui_sparkstackbar:L}=a.useConfig(),F=e.useSlots();e.onMounted(()=>{F["chart-background"]&&console.warn("VueUiSparkStackbar does not support the #chart-background slot.")});const x=e.computed(()=>!!u.dataset&&u.dataset.length),B=e.ref(null),S=e.ref(a.createUid()),b=e.ref(!1),_=e.ref(""),t=e.computed({get:()=>$(),set:l=>l});function $(){const l=V.useNestedProp({userConfig:u.config,defaultConfig:L});return l.theme?{...V.useNestedProp({userConfig:a.themes.vue_ui_sparkstackbar[l.theme]||u.config,defaultConfig:l}),customPalette:a.themePalettes[l.theme]||a.palette}:l}e.watch(()=>u.config,l=>{t.value=$(),E()},{deep:!0}),e.watch(()=>u.dataset,l=>{v.value=u.dataset.map((n,o)=>({...n,color:n.color?a.convertColorToHex(n.color):f.value[o]||a.palette[o]||a.palette[o%a.palette.length]}))},{deep:!0});const f=e.computed(()=>a.convertCustomPalette(t.value.customPalette)),v=e.ref(u.dataset.map((l,n)=>({...l,value:t.value.style.animation.show?0:l.value||0,color:l.color?a.convertColorToHex(l.color):f.value[n]||a.palette[n]||a.palette[n%a.palette.length]}))),g=e.ref(!0);e.onMounted(()=>{if(E(),t.value.style.animation.show){let p=function(){r+=o/l,r<o?(v.value=v.value.map((s,i)=>({...s,value:s.value+=n[i],color:s.color?a.convertColorToHex(s.color):f.value[i]||a.palette[i]||a.palette[i%a.palette.length]})),requestAnimationFrame(p)):(g.value=!1,v.value=u.dataset.map((s,i)=>({...s,value:s.value||0,color:s.color?a.convertColorToHex(s.color):f.value[i]||a.palette[i]||a.palette[i%a.palette.length],id:a.createUid()})))};const l=t.value.style.animation.animationFrames,n=u.dataset.map((s,i)=>s.value/l),o=u.dataset.map(s=>s.value||0).reduce((s,i)=>s+i,0);let r=0;g.value=!0,p()}});function E(){a.objectIsEmpty(u.dataset)?a.error({componentName:"VueUiSparkStackbar",type:"dataset"}):u.dataset.forEach((l,n)=>{a.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","value"]}).forEach(o=>{a.error({componentName:"VueUiSparkStackbar",type:"datasetSerieAttribute",property:o,index:n})})})}const c=e.ref({width:500,height:16}),d=e.ref([]),N=e.computed(()=>u.dataset.map(l=>l.value||0).filter((l,n)=>!d.value.includes(n)).reduce((l,n)=>l+n,0)),y=e.computed(()=>v.value.map((l,n)=>{const o=l.value||0,r=o/N.value,p=isNaN(r)?0:r,s=p*c.value.width;return{...l,value:o,proportion:p,width:s,proportionLabel:a.dataLabel({v:p*100,s:"%",r:t.value.style.legend.percentage.rounding})}})),C=e.computed(()=>y.value.filter((l,n)=>!d.value.includes(n)));function T(l){d.value.includes(l)?d.value=d.value.filter(n=>n!==l):d.value.length<v.value.length-1&&d.value.push(l)}const h=e.computed(()=>{let l=0;const n=[];for(let o=0;o<C.value.length;o+=1)n.push({...C.value[o],start:l}),l+=C.value[o].width;return n});function z(l,n){D("selectDatapoint",{datapoint:l,index:n})}const w=e.ref(null),k=e.ref(!1),m=e.ref(null);function A({datapoint:l,seriesIndex:n}){if(!t.value.style.tooltip.show)return;w.value={datapoint:l,seriesIndex:n,config:t.value,series:y.value},b.value=!0,m.value=n;const o=t.value.style.tooltip.customFormat;if(a.isFunction(o))try{const r=o({seriesIndex:n,datapoint:l,series:y.value,config:t.value});typeof r=="string"&&(_.value=r,k.value=!0)}catch{console.warn("Custom format cannot be applied."),k.value=!1}if(!k.value){let r="";r+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${l.name}</div>`,r+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${l.color}"/></svg>`,r+=`<b>${l.proportionLabel}</b>`,r+=`<span>(${a.applyDataLabel(t.value.style.legend.value.formatter,l.value,a.dataLabel({p:t.value.style.legend.value.prefix,v:l.value,s:t.value.style.legend.value.suffix,r:t.value.style.legend.value.rounding}),{datapoint:l,seriesIndex:n})})</span>`,_.value=`<div>${r}</div>`}}return(l,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"sparkstackbarChart",ref:B,style:e.normalizeStyle(`width:100%; background:${t.value.style.backgroundColor}`)},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:calc(100% - 12px);background:transparent;margin:0 auto;margin:${t.value.style.title.margin};padding: 0 6px;text-align:${t.value.style.title.textAlign}`)},[e.createElementVNode("div",{style:e.normalizeStyle(`font-size:${t.value.style.title.fontSize}px;color:${t.value.style.title.color};font-weight:${t.value.style.title.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.text),5),t.value.style.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`font-size:${t.value.style.title.subtitle.fontSize}px;color:${t.value.style.title.subtitle.color};font-weight:${t.value.style.title.subtitle.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.subtitle.text),5)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),x.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(a.XMLNS),width:"100%",viewBox:`0 0 ${c.value.width} ${c.value.height}`},[e.createVNode(O._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{key:`stack_gradient_${r}`,gradientTransform:"rotate(90)",id:`stack_gradient_${r}_${S.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":o.color},null,8,I),e.createElementVNode("stop",{offset:"50%","stop-color":e.unref(a.setOpacity)(e.unref(a.shiftHue)(o.color,.05),100-t.value.style.bar.gradient.intensity)},null,8,R),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,W)],8,H))),128)),e.createElementVNode("clipPath",Y,[e.createElementVNode("rect",{x:"0.005",y:"-2",width:"0.99",height:"5",rx:"3",ry:"3",fill:t.value.style.backgroundColor},null,8,G)])]),N.value>0?(e.openBlock(),e.createElementBlock("g",X,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_underlayer_${r}`,x:o.start,y:0,width:o.width,height:c.value.height,fill:t.value.style.bar.gradient.underlayerColor,class:e.normalizeClass({animated:!g.value}),style:e.normalizeStyle({opacity:m.value!==null&&t.value.style.tooltip.show?m.value===r?1:.5:1})},null,14,J))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_${r}`,x:o.start,y:0,width:o.width,height:c.value.height,fill:t.value.style.bar.gradient.show?`url(#stack_gradient_${r}_${S.value})`:o.color,stroke:t.value.style.backgroundColor,"stroke-linecap":"round",class:e.normalizeClass({animated:!g.value}),style:e.normalizeStyle({opacity:m.value!==null&&t.value.style.tooltip.show?m.value===r?1:.5:1})},null,14,K))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_trap_${r}`,onClick:()=>z(o,r),x:o.start,y:0,width:o.width,height:c.value.height,fill:"transparent",stroke:"none",class:e.normalizeClass({animated:!g.value}),onMouseenter:()=>A({datapoint:o,seriesIndex:r}),onMouseleave:n[0]||(n[0]=p=>{b.value=!1,m.value=null})},null,42,Q))),128))])):(e.openBlock(),e.createElementBlock("rect",{key:1,x:2,y:1,width:c.value.width-4,height:c.value.height-2,stroke:"#CCCCCC","stroke-width":"2",fill:"transparent",rx:(c.value.height-4)/2},null,8,Z))],8,j)):e.createCommentVNode("",!0),x.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(q.default,{key:2,config:{type:"sparkStackbar",style:{backgroundColor:t.value.style.backgroundColor,sparkStackbar:{color:"#CCCCCC"}}}},null,8,["config"])),t.value.style.legend.show?(e.openBlock(),e.createElementBlock("div",{key:3,style:e.normalizeStyle(`background:transparent;margin:0 auto;margin:${t.value.style.legend.margin};justify-content:${t.value.style.legend.textAlign==="left"?"flex-start":t.value.style.legend.textAlign==="right"?"flex-end":"center"}`),class:"vue-ui-sparkstackbar-legend"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(o,r)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`font-size:${t.value.style.legend.fontSize}px;`),class:e.normalizeClass({"vue-ui-sparkstackbar-legend-item":!0,"vue-ui-sparkstackbar-legend-item-unselected":d.value.includes(r)}),onClick:p=>{T(r),z(o,r)}},[e.createElementVNode("div",te,[(e.openBlock(),e.createElementBlock("svg",{height:`${t.value.style.legend.fontSize}px`,width:`${t.value.style.legend.fontSize}px`,viewBox:"0 0 10 10"},[e.createElementVNode("circle",{cx:5,cy:5,r:5,fill:o.color},null,8,oe)],8,le)),e.createElementVNode("span",{style:e.normalizeStyle(`color:${t.value.style.legend.name.color}; font-weight:${t.value.style.legend.name.bold?"bold":"normal"}`)},e.toDisplayString(o.name),5),t.value.style.legend.percentage.show?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(`font-weight:${t.value.style.legend.percentage.bold?"bold":"normal"};color:${t.value.style.legend.percentage.color}`)},e.toDisplayString(d.value.includes(r)?" - ":o.proportionLabel),5)):e.createCommentVNode("",!0),t.value.style.legend.value.show?(e.openBlock(),e.createElementBlock("span",{key:1,style:e.normalizeStyle(`font-weight:${t.value.style.legend.value.bold?"bold":"normal"};color:${t.value.style.legend.value.color}`)}," ("+e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.legend.value.formatter,o.value,e.unref(a.dataLabel)({p:t.value.style.legend.value.prefix,v:o.value,s:t.value.style.legend.value.suffix,r:t.value.style.legend.value.rounding}),{datapoint:o,seriesIndex:r}))+") ",5)):e.createCommentVNode("",!0)])],14,ee))),256))],4)):e.createCommentVNode("",!0),e.createVNode(U._sfc_main,{show:b.value&&t.value.style.tooltip.show,parent:B.value,backgroundColor:t.value.style.tooltip.backgroundColor,color:t.value.style.tooltip.color,fontSize:t.value.style.tooltip.fontSize,borderRadius:t.value.style.tooltip.borderRadius,borderColor:t.value.style.tooltip.borderColor,borderWidth:t.value.style.tooltip.borderWidth,backgroundOpacity:t.value.style.tooltip.backgroundOpacity,position:t.value.style.tooltip.position,content:_.value,isCustom:k.value,offsetY:-124+t.value.style.tooltip.offsetY,blockShiftY:!0},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...w.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...w.value})),void 0,!0)]),_:3},8,["show","parent","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","content","isCustom","offsetY"]),l.$slots.source?(e.openBlock(),e.createElementBlock("div",ae,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0)],4))}},ne=M._export_sfc(re,[["__scopeId","data-v-72244c73"]]);exports.default=ne;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-D-xYtUSL.cjs"),V=require("./useNestedProp-BN-VfUfj.cjs"),q=require("./vue-ui-skeleton-D3zg7qd2.cjs"),O=require("./PackageVersion-FzHnQSp-.cjs"),U=require("./Tooltip-Cz3eQmMV.cjs"),M=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),j=["xmlns","viewBox"],H=["id"],I=["stop-color"],R=["stop-color"],W=["stop-color"],Y={id:"stackPill",clipPathUnits:"objectBoundingBox"},G=["fill"],X={key:0,"clip-path":"url(#stackPill)"},J=["x","width","height","fill"],K=["x","width","height","fill","stroke"],Q=["onClick","x","width","height","onMouseenter"],Z=["width","height","rx"],ee=["onClick"],te={style:{display:"flex","flex-direction":"row","align-items":"center",gap:"4px","justify-content":"center"}},le=["height","width"],oe=["fill"],ae={key:4,ref:"source",dir:"auto"},re={__name:"vue-ui-sparkstackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(P,{emit:D}){const u=P,{vue_ui_sparkstackbar:L}=a.useConfig(),F=e.useSlots();e.onMounted(()=>{F["chart-background"]&&console.warn("VueUiSparkStackbar does not support the #chart-background slot.")});const x=e.computed(()=>!!u.dataset&&u.dataset.length),B=e.ref(null),S=e.ref(a.createUid()),b=e.ref(!1),_=e.ref(""),t=e.computed({get:()=>$(),set:l=>l});function $(){const l=V.useNestedProp({userConfig:u.config,defaultConfig:L});return l.theme?{...V.useNestedProp({userConfig:a.themes.vue_ui_sparkstackbar[l.theme]||u.config,defaultConfig:l}),customPalette:a.themePalettes[l.theme]||a.palette}:l}e.watch(()=>u.config,l=>{t.value=$(),E()},{deep:!0}),e.watch(()=>u.dataset,l=>{v.value=u.dataset.map((n,o)=>({...n,color:n.color?a.convertColorToHex(n.color):f.value[o]||a.palette[o]||a.palette[o%a.palette.length]}))},{deep:!0});const f=e.computed(()=>a.convertCustomPalette(t.value.customPalette)),v=e.ref(u.dataset.map((l,n)=>({...l,value:t.value.style.animation.show?0:l.value||0,color:l.color?a.convertColorToHex(l.color):f.value[n]||a.palette[n]||a.palette[n%a.palette.length]}))),g=e.ref(!0);e.onMounted(()=>{if(E(),t.value.style.animation.show){let p=function(){r+=o/l,r<o?(v.value=v.value.map((s,i)=>({...s,value:s.value+=n[i],color:s.color?a.convertColorToHex(s.color):f.value[i]||a.palette[i]||a.palette[i%a.palette.length]})),requestAnimationFrame(p)):(g.value=!1,v.value=u.dataset.map((s,i)=>({...s,value:s.value||0,color:s.color?a.convertColorToHex(s.color):f.value[i]||a.palette[i]||a.palette[i%a.palette.length],id:a.createUid()})))};const l=t.value.style.animation.animationFrames,n=u.dataset.map((s,i)=>s.value/l),o=u.dataset.map(s=>s.value||0).reduce((s,i)=>s+i,0);let r=0;g.value=!0,p()}});function E(){a.objectIsEmpty(u.dataset)?a.error({componentName:"VueUiSparkStackbar",type:"dataset"}):u.dataset.forEach((l,n)=>{a.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","value"]}).forEach(o=>{a.error({componentName:"VueUiSparkStackbar",type:"datasetSerieAttribute",property:o,index:n})})})}const c=e.ref({width:500,height:16}),d=e.ref([]),N=e.computed(()=>u.dataset.map(l=>l.value||0).filter((l,n)=>!d.value.includes(n)).reduce((l,n)=>l+n,0)),y=e.computed(()=>v.value.map((l,n)=>{const o=l.value||0,r=o/N.value,p=isNaN(r)?0:r,s=p*c.value.width;return{...l,value:o,proportion:p,width:s,proportionLabel:a.dataLabel({v:p*100,s:"%",r:t.value.style.legend.percentage.rounding})}})),C=e.computed(()=>y.value.filter((l,n)=>!d.value.includes(n)));function T(l){d.value.includes(l)?d.value=d.value.filter(n=>n!==l):d.value.length<v.value.length-1&&d.value.push(l)}const h=e.computed(()=>{let l=0;const n=[];for(let o=0;o<C.value.length;o+=1)n.push({...C.value[o],start:l}),l+=C.value[o].width;return n});function z(l,n){D("selectDatapoint",{datapoint:l,index:n})}const w=e.ref(null),k=e.ref(!1),m=e.ref(null);function A({datapoint:l,seriesIndex:n}){if(!t.value.style.tooltip.show)return;w.value={datapoint:l,seriesIndex:n,config:t.value,series:y.value},b.value=!0,m.value=n;const o=t.value.style.tooltip.customFormat;if(a.isFunction(o))try{const r=o({seriesIndex:n,datapoint:l,series:y.value,config:t.value});typeof r=="string"&&(_.value=r,k.value=!0)}catch{console.warn("Custom format cannot be applied."),k.value=!1}if(!k.value){let r="";r+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${l.name}</div>`,r+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${l.color}"/></svg>`,r+=`<b>${l.proportionLabel}</b>`,r+=`<span>(${a.applyDataLabel(t.value.style.legend.value.formatter,l.value,a.dataLabel({p:t.value.style.legend.value.prefix,v:l.value,s:t.value.style.legend.value.suffix,r:t.value.style.legend.value.rounding}),{datapoint:l,seriesIndex:n})})</span>`,_.value=`<div>${r}</div>`}}return(l,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"sparkstackbarChart",ref:B,style:e.normalizeStyle(`width:100%; background:${t.value.style.backgroundColor}`)},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:calc(100% - 12px);background:transparent;margin:0 auto;margin:${t.value.style.title.margin};padding: 0 6px;text-align:${t.value.style.title.textAlign}`)},[e.createElementVNode("div",{style:e.normalizeStyle(`font-size:${t.value.style.title.fontSize}px;color:${t.value.style.title.color};font-weight:${t.value.style.title.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.text),5),t.value.style.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`font-size:${t.value.style.title.subtitle.fontSize}px;color:${t.value.style.title.subtitle.color};font-weight:${t.value.style.title.subtitle.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.subtitle.text),5)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),x.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(a.XMLNS),width:"100%",viewBox:`0 0 ${c.value.width} ${c.value.height}`},[e.createVNode(O._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{key:`stack_gradient_${r}`,gradientTransform:"rotate(90)",id:`stack_gradient_${r}_${S.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":o.color},null,8,I),e.createElementVNode("stop",{offset:"50%","stop-color":e.unref(a.setOpacity)(e.unref(a.shiftHue)(o.color,.05),100-t.value.style.bar.gradient.intensity)},null,8,R),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,W)],8,H))),128)),e.createElementVNode("clipPath",Y,[e.createElementVNode("rect",{x:"0.005",y:"-2",width:"0.99",height:"5",rx:"3",ry:"3",fill:t.value.style.backgroundColor},null,8,G)])]),N.value>0?(e.openBlock(),e.createElementBlock("g",X,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_underlayer_${r}`,x:o.start,y:0,width:o.width,height:c.value.height,fill:t.value.style.bar.gradient.underlayerColor,class:e.normalizeClass({animated:!g.value}),style:e.normalizeStyle({opacity:m.value!==null&&t.value.style.tooltip.show?m.value===r?1:.5:1})},null,14,J))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_${r}`,x:o.start,y:0,width:o.width,height:c.value.height,fill:t.value.style.bar.gradient.show?`url(#stack_gradient_${r}_${S.value})`:o.color,stroke:t.value.style.backgroundColor,"stroke-linecap":"round",class:e.normalizeClass({animated:!g.value}),style:e.normalizeStyle({opacity:m.value!==null&&t.value.style.tooltip.show?m.value===r?1:.5:1})},null,14,K))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_trap_${r}`,onClick:()=>z(o,r),x:o.start,y:0,width:o.width,height:c.value.height,fill:"transparent",stroke:"none",class:e.normalizeClass({animated:!g.value}),onMouseenter:()=>A({datapoint:o,seriesIndex:r}),onMouseleave:n[0]||(n[0]=p=>{b.value=!1,m.value=null})},null,42,Q))),128))])):(e.openBlock(),e.createElementBlock("rect",{key:1,x:2,y:1,width:c.value.width-4,height:c.value.height-2,stroke:"#CCCCCC","stroke-width":"2",fill:"transparent",rx:(c.value.height-4)/2},null,8,Z))],8,j)):e.createCommentVNode("",!0),x.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(q.default,{key:2,config:{type:"sparkStackbar",style:{backgroundColor:t.value.style.backgroundColor,sparkStackbar:{color:"#CCCCCC"}}}},null,8,["config"])),t.value.style.legend.show?(e.openBlock(),e.createElementBlock("div",{key:3,style:e.normalizeStyle(`background:transparent;margin:0 auto;margin:${t.value.style.legend.margin};justify-content:${t.value.style.legend.textAlign==="left"?"flex-start":t.value.style.legend.textAlign==="right"?"flex-end":"center"}`),class:"vue-ui-sparkstackbar-legend"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(o,r)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`font-size:${t.value.style.legend.fontSize}px;`),class:e.normalizeClass({"vue-ui-sparkstackbar-legend-item":!0,"vue-ui-sparkstackbar-legend-item-unselected":d.value.includes(r)}),onClick:p=>{T(r),z(o,r)}},[e.createElementVNode("div",te,[(e.openBlock(),e.createElementBlock("svg",{height:`${t.value.style.legend.fontSize}px`,width:`${t.value.style.legend.fontSize}px`,viewBox:"0 0 10 10"},[e.createElementVNode("circle",{cx:5,cy:5,r:5,fill:o.color},null,8,oe)],8,le)),e.createElementVNode("span",{style:e.normalizeStyle(`color:${t.value.style.legend.name.color}; font-weight:${t.value.style.legend.name.bold?"bold":"normal"}`)},e.toDisplayString(o.name),5),t.value.style.legend.percentage.show?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(`font-weight:${t.value.style.legend.percentage.bold?"bold":"normal"};color:${t.value.style.legend.percentage.color}`)},e.toDisplayString(d.value.includes(r)?" - ":o.proportionLabel),5)):e.createCommentVNode("",!0),t.value.style.legend.value.show?(e.openBlock(),e.createElementBlock("span",{key:1,style:e.normalizeStyle(`font-weight:${t.value.style.legend.value.bold?"bold":"normal"};color:${t.value.style.legend.value.color}`)}," ("+e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.legend.value.formatter,o.value,e.unref(a.dataLabel)({p:t.value.style.legend.value.prefix,v:o.value,s:t.value.style.legend.value.suffix,r:t.value.style.legend.value.rounding}),{datapoint:o,seriesIndex:r}))+") ",5)):e.createCommentVNode("",!0)])],14,ee))),256))],4)):e.createCommentVNode("",!0),e.createVNode(U._sfc_main,{show:b.value&&t.value.style.tooltip.show,parent:B.value,backgroundColor:t.value.style.tooltip.backgroundColor,color:t.value.style.tooltip.color,fontSize:t.value.style.tooltip.fontSize,borderRadius:t.value.style.tooltip.borderRadius,borderColor:t.value.style.tooltip.borderColor,borderWidth:t.value.style.tooltip.borderWidth,backgroundOpacity:t.value.style.tooltip.backgroundOpacity,position:t.value.style.tooltip.position,content:_.value,isCustom:k.value,offsetY:-124+t.value.style.tooltip.offsetY,blockShiftY:!0},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...w.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...w.value})),void 0,!0)]),_:3},8,["show","parent","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","content","isCustom","offsetY"]),l.$slots.source?(e.openBlock(),e.createElementBlock("div",ae,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0)],4))}},ne=M._export_sfc(re,[["__scopeId","data-v-72244c73"]]);exports.default=ne;
@@ -1,9 +1,9 @@
1
1
  import { useSlots as ne, onMounted as Y, computed as m, ref as d, watch as G, openBlock as s, createElementBlock as r, normalizeStyle as v, createElementVNode as p, toDisplayString as w, createCommentVNode as y, unref as C, createVNode as q, Fragment as x, renderList as $, normalizeClass as F, createBlock as ue, withCtx as H, renderSlot as U, normalizeProps as X, guardReactiveProps as J } from "vue";
2
- import { u as ie, c as K, t as ce, a as de, p as i, d as N, b as ve, o as pe, e as Q, g as ge, f as V, X as fe, s as he, w as ye, i as Z, x as me } from "./index-Z_vzxZTo.js";
3
- import { u as ee } from "./useNestedProp-Buhi5uyL.js";
4
- import ke from "./vue-ui-skeleton-BMRe3SzB.js";
5
- import { _ as be } from "./PackageVersion-dR8EUy_P.js";
6
- import { _ as _e } from "./Tooltip-BK-ACGDE.js";
2
+ import { u as ie, c as K, t as ce, a as de, p as i, d as N, b as ve, o as pe, e as Q, g as ge, f as V, X as fe, s as he, w as ye, i as Z, x as me } from "./index-DjTPIx3R.js";
3
+ import { u as ee } from "./useNestedProp-BNmCbG1v.js";
4
+ import ke from "./vue-ui-skeleton-Dt9cA-wa.js";
5
+ import { _ as be } from "./PackageVersion-B684aQUP.js";
6
+ import { _ as _e } from "./Tooltip-DddRc8qD.js";
7
7
  import { _ as we } from "./_plugin-vue_export-helper-CHgC5LLL.js";
8
8
  const Ce = ["xmlns", "viewBox"], xe = ["id"], $e = ["stop-color"], Se = ["stop-color"], ze = ["stop-color"], Pe = {
9
9
  id: "stackPill",
@@ -1,6 +1,6 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),c=require("./index-ChOY3hT9.cjs"),Me=require("./useNestedProp-CA8PjFJH.cjs"),Te=require("./useResponsive-BJ7DTGpm.cjs"),Ve=require("./usePrinter-c3c7_uAW.cjs"),tt=require("./Slicer-oNEtv1s3.cjs"),at=require("./Tooltip-Dz4wVJkz.cjs"),lt=require("./Title-CoNtoGH9.cjs"),ot=require("./Legend-CqilK5CI.cjs"),rt=require("./vue-ui-accordion-CZ8AlriN.cjs"),st=require("./DataTable-CCJGHIVo.cjs"),nt=require("./vue-ui-skeleton-DlnPFtb4.cjs"),it=require("./PackageVersion-eZ5Dmuid.cjs"),ut=require("./PenAndPaper-D_w2N2qM.cjs"),ct=require("./useUserOptionState-BgepsfED.cjs"),dt=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),vt=["id"],ht=["xmlns","viewBox"],mt=["x","y","width","height"],gt={key:1},yt=["id"],bt=["stop-color"],pt=["stop-color"],ft=["stop-color"],kt=["x1","x2","y1","y2","stroke"],xt=["x1","x2","y1","y2","stroke"],wt=["x1","x2","y1","y2","stroke"],Bt=["x1","x2","y1","y2","stroke"],Ct=["x","y","height","rx","width","fill","stroke","stroke-width"],St=["x","y","width","rx","height","fill","stroke","stroke-width"],zt=["x1","x2","y1","y2","stroke","stroke-width"],Lt=["x1","x2","y1","y2","stroke","stroke-width"],Nt=["x","y","font-size","fill","font-weight"],Et=["transform","font-size","fill","font-weight"],_t=["x","y","font-size","fill","font-weight"],$t={key:0},Mt=["x","y","font-size","font-weight","fill"],Tt=["x","y","font-size","fill","font-weight"],Vt={key:0},Pt=["x","y","font-size","font-weight","fill"],Ft=["x1","x2","y1","y2","stroke"],It=["x","y","font-size","font-weight","fill"],Ot=["x1","x2","y1","y2","stroke"],Rt=["font-size","font-weight","fill","text-anchor","transform"],Dt={key:0},At={key:1},Ht=["text-anchor","font-size","font-weight","fill","transform","onClick"],qt={key:0},Ut={key:1},Wt=["font-size","font-weight","fill","x","y","onClick"],Yt=["x","y","width","height","onClick","onMouseenter","fill"],Xt=["x","y","width","height","onClick","onMouseenter","fill"],Gt={key:4,class:"vue-data-ui-watermark"},Jt=["onClick"],Zt=["innerHTML"],Kt={__name:"vue-ui-stackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint","selectLegend","selectTimeLabel"],setup(X,{expose:Pe,emit:G}){const v=X,{vue_ui_stackbar:Fe}=c.useConfig(),$=e.computed({get(){return!!v.dataset&&v.dataset.length},set(l){return l}}),M=e.ref(null),J=e.ref(c.createUid()),R=e.ref(!1),ee=e.ref(null),Z=e.ref(""),p=e.ref([]),te=e.ref(0),ae=e.ref(null),le=e.ref(null),oe=e.ref(null),re=e.ref(null),se=e.ref(0),D=e.ref(!1),V=e.ref(null),P=e.ref(!1),Ie=e.ref(0),Oe=e.ref(0),Re=e.ref(0),T=e.ref(null);e.onMounted(()=>{Q()});const t=e.computed({get:()=>ue(),set:l=>l}),{userOptionsVisible:K,setUserOptionsVisibility:ne,keepUserOptionState:ie}=ct.useUserOptionState({config:t.value});function ue(){const l=Me.useNestedProp({userConfig:v.config,defaultConfig:Fe});let o={};return l.theme?o={...Me.useNestedProp({userConfig:c.themes.vue_ui_stackbar[l.theme]||v.config,defaultConfig:l}),customPalette:c.themePalettes[l.theme]||c.palette}:o=l,v.config&&c.hasDeepProperty(v.config,"style.chart.grid.scale.scaleMin")?o.style.chart.grid.scale.scaleMin=v.config.style.chart.grid.scale.scaleMin:o.style.chart.grid.scale.scaleMin=null,v.config&&c.hasDeepProperty(v.config,"style.chart.grid.scale.scaleMax")?o.style.chart.grid.scale.scaleMax=v.config.style.chart.grid.scale.scaleMax:o.style.chart.grid.scale.scaleMax=null,v.config&&c.hasDeepProperty(v.config,"style.chart.zoom.startIndex")?o.style.chart.zoom.startIndex=v.config.style.chart.zoom.startIndex:o.style.chart.zoom.startIndex=null,v.config&&c.hasDeepProperty(v.config,"style.chart.zoom.endIndex")?o.style.chart.zoom.endIndex=v.config.style.chart.zoom.endIndex:o.style.chart.zoom.endIndex=null,o}e.watch(()=>v.config,l=>{t.value=ue(),K.value=!t.value.showOnChartHover,Q(),Ie.value+=1,Oe.value+=1,Re.value+=1},{deep:!0}),e.watch(()=>v.dataset,l=>{ye()},{deep:!0});const b=e.ref({dataLabels:{show:t.value.style.chart.bars.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),{isPrinting:ce,isImaging:de,generatePdf:ve,generateImage:he}=Ve.usePrinter({elementId:`stackbar_${J.value}`,fileName:t.value.style.chart.title.text||"vue-ui-stackbar"}),A=e.ref({width:t.value.style.chart.width,height:t.value.style.chart.height,paddingRatio:{top:t.value.style.chart.padding.top/t.value.style.chart.height,right:t.value.style.chart.padding.right/t.value.style.chart.width,bottom:t.value.style.chart.padding.bottom/t.value.style.chart.height,left:t.value.style.chart.padding.left/t.value.style.chart.width}}),De=e.computed(()=>c.convertCustomPalette(t.value.customPalette)),me=e.ref(null),ge=e.ref(null);e.onMounted(()=>{Q()});function Q(){if(c.objectIsEmpty(v.dataset)?c.error({componentName:"VueUiStackbar",type:"dataset"}):v.dataset.forEach((l,o)=>{c.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","series"]}).forEach(a=>{$.value=!1,c.error({componentName:"VueUiStackbar",type:"datasetSerieAttribute",property:a,index:o})})}),setTimeout(()=>{P.value=!0},10),t.value.responsive){const l=Te.throttle(()=>{P.value=!1;const{width:o,height:a}=Te.useResponsive({chart:M.value,title:t.value.style.chart.title.text?ae.value:null,legend:t.value.style.chart.legend.show?le.value:null,slicer:t.value.style.chart.zoom.show&&S.value>1?oe.value:null,source:re.value});A.value.width=o,A.value.height=a,clearTimeout(ge.value),ge.value=setTimeout(()=>{P.value=!0},10)});me.value=new ResizeObserver(l),me.value.observe(M.value.parentNode)}be()}const s=e.computed(()=>{const{height:l,width:o}=A.value,{right:a}=A.value.paddingRatio,r=t.value.style.chart.padding.top,n=o-o*a,i=l-t.value.style.chart.padding.bottom,y=t.value.style.chart.padding.left,L=o-y-o*a,N=l-r-t.value.style.chart.padding.bottom;return{chartHeight:l,chartWidth:o,top:r,right:n,bottom:i,left:y,width:L,height:N<0?0:N}}),C=e.computed(()=>v.dataset.map((l,o)=>{const a=c.convertColorToHex(l.color)||De.value[o]||c.palette[o]||c.palette[o%c.palette.length];return{...l,series:JSON.parse(JSON.stringify(l.series)).map(r=>t.value.style.chart.bars.distributed?Math.abs(r):r),signedSeries:l.series.map(r=>r>=0?1:-1),absoluteIndex:o,id:c.createUid(),color:a}})),S=e.computed(()=>Math.max(...C.value.filter(l=>!p.value.includes(l.id)).map(l=>l.series.length))),u=e.ref({start:0,end:Math.max(...v.dataset.map(l=>l.series.length))});function ye(){be()}async function be(){(t.value.style.chart.zoom.startIndex!==null||t.value.style.chart.zoom.endIndex!==null)&&T.value?(t.value.style.chart.zoom.startIndex!==null&&(await e.nextTick(),await e.nextTick(),T.value&&T.value.setStartValue(t.value.style.chart.zoom.startIndex)),t.value.style.chart.zoom.endIndex!==null&&(await e.nextTick(),await e.nextTick(),T.value&&T.value.setEndValue(Ae(t.value.style.chart.zoom.endIndex+1)))):(u.value={start:0,end:Math.max(...v.dataset.map(l=>l.series.length))},se.value+=1)}function Ae(l){const o=Math.max(...v.dataset.map(a=>a.series.length));return l>o?o:l<0||t.value.style.chart.zoom.startIndex!==null&&l<t.value.style.chart.zoom.startIndex?t.value.style.chart.zoom.startIndex!==null?t.value.style.chart.zoom.startIndex+1:1:l}const d=e.computed(()=>{let l;return t.value.orientation==="vertical"?l=s.value.width/(u.value.end-u.value.start):l=s.value.height/(u.value.end-u.value.start),l<=0?0:l}),F=e.computed(()=>c.sumSeries(C.value.filter(l=>!p.value.includes(l.id))).slice(u.value.start,u.value.end)),He=e.computed(()=>c.sumSeries(C.value.filter(l=>!p.value.includes(l.id)).map(l=>({...l,series:l.series.map((o,a)=>l.signedSeries[a]===-1&&o>=0?-o:o)}))).slice(u.value.start,u.value.end)),H=e.computed(()=>{const l=C.value.filter(o=>!p.value.includes(o.id));return{positive:c.sumSeries(l.map(o=>({...o,series:o.series.slice(u.value.start,u.value.end).map(a=>a>=0?a:0)}))),negative:c.sumSeries(l.map(o=>({...o,series:o.series.slice(u.value.start,u.value.end).map(a=>a<0?a:0)})))}}),w=e.computed(()=>{const l=t.value.style.chart.grid.scale.scaleMax!==null&&!t.value.style.chart.bars.distributed?t.value.style.chart.grid.scale.scaleMax:Math.max(...H.value.positive),o=Math.min(...H.value.negative),a=t.value.style.chart.grid.scale.scaleMin!==null&&!t.value.style.chart.bars.distributed?t.value.style.chart.grid.scale.scaleMin:[-1/0,1/0,NaN,void 0,null].includes(o)?0:o,r=!t.value.style.chart.bars.distributed&&(t.value.style.chart.grid.scale.scaleMax!==null||t.value.style.chart.grid.scale.scaleMin!==null)?c.calculateNiceScaleWithExactExtremes(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks):c.calculateNiceScale(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks);return r.ticks.map(n=>({zero:s.value.bottom-s.value.height*(Math.abs(r.min)/(r.max+Math.abs(r.min))),y:s.value.bottom-s.value.height*((n+Math.abs(r.min))/(r.max+Math.abs(r.min))),x:s.value.left-8,horizontal_zero:s.value.left+s.value.width*(Math.abs(r.min)/(r.max+Math.abs(r.min))),horizontal_x:s.value.left+s.value.width*((n+Math.abs(r.min))/(r.max+Math.abs(r.min))),horizontal_y:s.value.bottom-8,value:n}))}),z=e.computed(()=>{const l=[];for(let o=0;o<S.value;o+=1)l.push({text:t.value.style.chart.grid.x.timeLabels.values[o]||String(o),absoluteIndex:o});return l.slice(u.value.start,u.value.end)}),g=e.computed(()=>{if(!$.value)return[];let l=Array(S.value).fill(0),o=Array(S.value).fill(0),a=Array(S.value).fill(0),r=Array(S.value).fill(0);const n=Math.max(...H.value.positive)||0,i=Math.min(...H.value.negative),y=[-1/0,1/0,NaN,void 0,null].includes(i)?0:i,L=!t.value.style.chart.bars.distributed&&(t.value.style.chart.grid.scale.scaleMax!==null||t.value.style.chart.grid.scale.scaleMin!==null)?c.calculateNiceScaleWithExactExtremes(t.value.style.chart.grid.scale.scaleMin!==null?t.value.style.chart.grid.scale.scaleMin:y>0?0:y,t.value.style.chart.grid.scale.scaleMax!==null?t.value.style.chart.grid.scale.scaleMax:n<0?0:n,t.value.style.chart.grid.scale.ticks):c.calculateNiceScale(t.value.style.chart.grid.scale.scaleMin!==null?t.value.style.chart.grid.scale.scaleMin:y>0?0:y,t.value.style.chart.grid.scale.scaleMax!==null?t.value.style.chart.grid.scale.scaleMax:n<0?0:n,t.value.style.chart.grid.scale.ticks),{min:N,max:I}=L,E=I+(N>=0?0:Math.abs(N))||1,f=s.value.height,Y=s.value.width,_e=w.value[0]?w.value[0].zero:s.value.bottom,$e=w.value[0]?w.value[0].horizontal_zero:s.value.left;return C.value.filter(O=>!p.value.includes(O.id)).map(O=>{const B=O.series.slice(u.value.start,u.value.end),Xe=O.signedSeries.slice(u.value.start,u.value.end),Ge=B.map((h,m)=>s.value.left+d.value*m+d.value*t.value.style.chart.bars.gapRatio/4),Je=B.map((h,m)=>s.value.top+d.value*m+d.value*t.value.style.chart.bars.gapRatio/4),Ze=B.map((h,m)=>{const k=t.value.style.chart.bars.distributed?(h||0)/F.value[m]:(h||0)/E;let _,x;return h>0?(x=f*k,_=_e-x-l[m],l[m]+=x):(x=f*k,_=_e+a[m],a[m]+=Math.abs(x)),_}),Ke=B.map((h,m)=>{const k=t.value.style.chart.bars.distributed?(h||0)/F.value[m]:(h||0)/E;let _,x;return h>0?(x=Y*k,_=$e+o[m],o[m]+=x):(x=Y*k,_=$e-Math.abs(x)-r[m],r[m]+=Math.abs(x)),_}),Qe=B.map((h,m)=>{const k=t.value.style.chart.bars.distributed?(h||0)/F.value[m]:(h||0)/E;return h>0?f*k:f*Math.abs(k)}),je=B.map((h,m)=>{const k=t.value.style.chart.bars.distributed?(h||0)/F.value[m]:(h||0)/E;return h>0?Y*k:Y*Math.abs(k)}),et=B.map(h=>Math.abs(h)).reduce((h,m)=>h+m,0);return{...O,proportions:B.map((h,m)=>t.value.style.chart.bars.distributed?(h||0)/F.value[m]:(h||0)/et),series:B,signedSeries:Xe,x:Ge,y:Ze,height:Qe,horizontal_width:je,horizontal_y:Je,horizontal_x:Ke}})}),pe=e.computed(()=>He.value.map((l,o)=>({value:l,sign:l>=0?1:-1})));function q(l,o,a,r,n){const i=n===-1&&l>=0?-l:l;return c.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,i,c.dataLabel({p:t.value.style.chart.bars.dataLabels.prefix,v:i,s:t.value.style.chart.bars.dataLabels.suffix,r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:o,seriesIndex:a,datapointIndex:r})}function fe(l,o,a,r){return c.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,l,c.dataLabel({v:isNaN(l)?0:l,s:"%",r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:o,seriesIndex:a,datapointIndex:r})}function ke(l){const o=JSON.parse(JSON.stringify(g.value)).map(a=>({name:a.name,value:a.series[l]===0?0:a.series[l]||null,proportion:a.proportions[l]||null,color:a.color,id:a.id}));G("selectDatapoint",{datapoint:o,period:z.value[l]})}function xe(l){V.value=l,R.value=!0;const o=t.value.style.chart.tooltip.customFormat,a=JSON.parse(JSON.stringify(g.value)).map(n=>({name:n.name,value:n.series[l]===0?0:(n.signedSeries[l]===-1&&n.series[l]>=0?-n.series[l]:n.series[l])||null,proportion:n.proportions[l]||null,color:n.color,id:n.id})),r=a.map(n=>Math.abs(n.value)).reduce((n,i)=>n+i,0);if(c.isFunction(o)&&c.functionReturnsString(()=>o({seriesIndex:l,datapoint:a,series:g.value,config:t.value})))Z.value=o({seriesIndex:l,datapoint:a,series:g.value,config:t.value});else{const{showValue:n,showPercentage:i,borderColor:y,roundingValue:L,roundingPercentage:N}=t.value.style.chart.tooltip;let I="";z.value[l]&&z.value[l].text&&t.value.style.chart.tooltip.showTimeLabel&&(I+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${y};padding-bottom:6px;margin-bottom:3px;">${z.value[l].text}</div>`);const E=[n&&i?"(":"",n&&i?")":""];a.reverse().forEach(f=>{I+=`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),c=require("./index-D-xYtUSL.cjs"),Me=require("./useNestedProp-BN-VfUfj.cjs"),Te=require("./useResponsive-BJ7DTGpm.cjs"),Ve=require("./usePrinter-pT-a_sFr.cjs"),tt=require("./Slicer-C9bF7-B-.cjs"),at=require("./Tooltip-Cz3eQmMV.cjs"),lt=require("./Title-DuMgnso9.cjs"),ot=require("./Legend-DIfEhYtz.cjs"),rt=require("./vue-ui-accordion-B1MkyNta.cjs"),st=require("./DataTable-DnrSae6c.cjs"),nt=require("./vue-ui-skeleton-D3zg7qd2.cjs"),it=require("./PackageVersion-FzHnQSp-.cjs"),ut=require("./PenAndPaper-C6I0ckZw.cjs"),ct=require("./useUserOptionState-BgepsfED.cjs"),dt=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),vt=["id"],ht=["xmlns","viewBox"],mt=["x","y","width","height"],gt={key:1},yt=["id"],bt=["stop-color"],pt=["stop-color"],ft=["stop-color"],kt=["x1","x2","y1","y2","stroke"],xt=["x1","x2","y1","y2","stroke"],wt=["x1","x2","y1","y2","stroke"],Bt=["x1","x2","y1","y2","stroke"],Ct=["x","y","height","rx","width","fill","stroke","stroke-width"],St=["x","y","width","rx","height","fill","stroke","stroke-width"],zt=["x1","x2","y1","y2","stroke","stroke-width"],Lt=["x1","x2","y1","y2","stroke","stroke-width"],Nt=["x","y","font-size","fill","font-weight"],Et=["transform","font-size","fill","font-weight"],_t=["x","y","font-size","fill","font-weight"],$t={key:0},Mt=["x","y","font-size","font-weight","fill"],Tt=["x","y","font-size","fill","font-weight"],Vt={key:0},Pt=["x","y","font-size","font-weight","fill"],Ft=["x1","x2","y1","y2","stroke"],It=["x","y","font-size","font-weight","fill"],Ot=["x1","x2","y1","y2","stroke"],Rt=["font-size","font-weight","fill","text-anchor","transform"],Dt={key:0},At={key:1},Ht=["text-anchor","font-size","font-weight","fill","transform","onClick"],qt={key:0},Ut={key:1},Wt=["font-size","font-weight","fill","x","y","onClick"],Yt=["x","y","width","height","onClick","onMouseenter","fill"],Xt=["x","y","width","height","onClick","onMouseenter","fill"],Gt={key:4,class:"vue-data-ui-watermark"},Jt=["onClick"],Zt=["innerHTML"],Kt={__name:"vue-ui-stackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint","selectLegend","selectTimeLabel"],setup(X,{expose:Pe,emit:G}){const v=X,{vue_ui_stackbar:Fe}=c.useConfig(),$=e.computed({get(){return!!v.dataset&&v.dataset.length},set(l){return l}}),M=e.ref(null),J=e.ref(c.createUid()),R=e.ref(!1),ee=e.ref(null),Z=e.ref(""),p=e.ref([]),te=e.ref(0),ae=e.ref(null),le=e.ref(null),oe=e.ref(null),re=e.ref(null),se=e.ref(0),D=e.ref(!1),V=e.ref(null),P=e.ref(!1),Ie=e.ref(0),Oe=e.ref(0),Re=e.ref(0),T=e.ref(null);e.onMounted(()=>{Q()});const t=e.computed({get:()=>ue(),set:l=>l}),{userOptionsVisible:K,setUserOptionsVisibility:ne,keepUserOptionState:ie}=ct.useUserOptionState({config:t.value});function ue(){const l=Me.useNestedProp({userConfig:v.config,defaultConfig:Fe});let o={};return l.theme?o={...Me.useNestedProp({userConfig:c.themes.vue_ui_stackbar[l.theme]||v.config,defaultConfig:l}),customPalette:c.themePalettes[l.theme]||c.palette}:o=l,v.config&&c.hasDeepProperty(v.config,"style.chart.grid.scale.scaleMin")?o.style.chart.grid.scale.scaleMin=v.config.style.chart.grid.scale.scaleMin:o.style.chart.grid.scale.scaleMin=null,v.config&&c.hasDeepProperty(v.config,"style.chart.grid.scale.scaleMax")?o.style.chart.grid.scale.scaleMax=v.config.style.chart.grid.scale.scaleMax:o.style.chart.grid.scale.scaleMax=null,v.config&&c.hasDeepProperty(v.config,"style.chart.zoom.startIndex")?o.style.chart.zoom.startIndex=v.config.style.chart.zoom.startIndex:o.style.chart.zoom.startIndex=null,v.config&&c.hasDeepProperty(v.config,"style.chart.zoom.endIndex")?o.style.chart.zoom.endIndex=v.config.style.chart.zoom.endIndex:o.style.chart.zoom.endIndex=null,o}e.watch(()=>v.config,l=>{t.value=ue(),K.value=!t.value.showOnChartHover,Q(),Ie.value+=1,Oe.value+=1,Re.value+=1},{deep:!0}),e.watch(()=>v.dataset,l=>{ye()},{deep:!0});const b=e.ref({dataLabels:{show:t.value.style.chart.bars.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),{isPrinting:ce,isImaging:de,generatePdf:ve,generateImage:he}=Ve.usePrinter({elementId:`stackbar_${J.value}`,fileName:t.value.style.chart.title.text||"vue-ui-stackbar"}),A=e.ref({width:t.value.style.chart.width,height:t.value.style.chart.height,paddingRatio:{top:t.value.style.chart.padding.top/t.value.style.chart.height,right:t.value.style.chart.padding.right/t.value.style.chart.width,bottom:t.value.style.chart.padding.bottom/t.value.style.chart.height,left:t.value.style.chart.padding.left/t.value.style.chart.width}}),De=e.computed(()=>c.convertCustomPalette(t.value.customPalette)),me=e.ref(null),ge=e.ref(null);e.onMounted(()=>{Q()});function Q(){if(c.objectIsEmpty(v.dataset)?c.error({componentName:"VueUiStackbar",type:"dataset"}):v.dataset.forEach((l,o)=>{c.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","series"]}).forEach(a=>{$.value=!1,c.error({componentName:"VueUiStackbar",type:"datasetSerieAttribute",property:a,index:o})})}),setTimeout(()=>{P.value=!0},10),t.value.responsive){const l=Te.throttle(()=>{P.value=!1;const{width:o,height:a}=Te.useResponsive({chart:M.value,title:t.value.style.chart.title.text?ae.value:null,legend:t.value.style.chart.legend.show?le.value:null,slicer:t.value.style.chart.zoom.show&&S.value>1?oe.value:null,source:re.value});A.value.width=o,A.value.height=a,clearTimeout(ge.value),ge.value=setTimeout(()=>{P.value=!0},10)});me.value=new ResizeObserver(l),me.value.observe(M.value.parentNode)}be()}const s=e.computed(()=>{const{height:l,width:o}=A.value,{right:a}=A.value.paddingRatio,r=t.value.style.chart.padding.top,n=o-o*a,i=l-t.value.style.chart.padding.bottom,y=t.value.style.chart.padding.left,L=o-y-o*a,N=l-r-t.value.style.chart.padding.bottom;return{chartHeight:l,chartWidth:o,top:r,right:n,bottom:i,left:y,width:L,height:N<0?0:N}}),C=e.computed(()=>v.dataset.map((l,o)=>{const a=c.convertColorToHex(l.color)||De.value[o]||c.palette[o]||c.palette[o%c.palette.length];return{...l,series:JSON.parse(JSON.stringify(l.series)).map(r=>t.value.style.chart.bars.distributed?Math.abs(r):r),signedSeries:l.series.map(r=>r>=0?1:-1),absoluteIndex:o,id:c.createUid(),color:a}})),S=e.computed(()=>Math.max(...C.value.filter(l=>!p.value.includes(l.id)).map(l=>l.series.length))),u=e.ref({start:0,end:Math.max(...v.dataset.map(l=>l.series.length))});function ye(){be()}async function be(){(t.value.style.chart.zoom.startIndex!==null||t.value.style.chart.zoom.endIndex!==null)&&T.value?(t.value.style.chart.zoom.startIndex!==null&&(await e.nextTick(),await e.nextTick(),T.value&&T.value.setStartValue(t.value.style.chart.zoom.startIndex)),t.value.style.chart.zoom.endIndex!==null&&(await e.nextTick(),await e.nextTick(),T.value&&T.value.setEndValue(Ae(t.value.style.chart.zoom.endIndex+1)))):(u.value={start:0,end:Math.max(...v.dataset.map(l=>l.series.length))},se.value+=1)}function Ae(l){const o=Math.max(...v.dataset.map(a=>a.series.length));return l>o?o:l<0||t.value.style.chart.zoom.startIndex!==null&&l<t.value.style.chart.zoom.startIndex?t.value.style.chart.zoom.startIndex!==null?t.value.style.chart.zoom.startIndex+1:1:l}const d=e.computed(()=>{let l;return t.value.orientation==="vertical"?l=s.value.width/(u.value.end-u.value.start):l=s.value.height/(u.value.end-u.value.start),l<=0?0:l}),F=e.computed(()=>c.sumSeries(C.value.filter(l=>!p.value.includes(l.id))).slice(u.value.start,u.value.end)),He=e.computed(()=>c.sumSeries(C.value.filter(l=>!p.value.includes(l.id)).map(l=>({...l,series:l.series.map((o,a)=>l.signedSeries[a]===-1&&o>=0?-o:o)}))).slice(u.value.start,u.value.end)),H=e.computed(()=>{const l=C.value.filter(o=>!p.value.includes(o.id));return{positive:c.sumSeries(l.map(o=>({...o,series:o.series.slice(u.value.start,u.value.end).map(a=>a>=0?a:0)}))),negative:c.sumSeries(l.map(o=>({...o,series:o.series.slice(u.value.start,u.value.end).map(a=>a<0?a:0)})))}}),w=e.computed(()=>{const l=t.value.style.chart.grid.scale.scaleMax!==null&&!t.value.style.chart.bars.distributed?t.value.style.chart.grid.scale.scaleMax:Math.max(...H.value.positive),o=Math.min(...H.value.negative),a=t.value.style.chart.grid.scale.scaleMin!==null&&!t.value.style.chart.bars.distributed?t.value.style.chart.grid.scale.scaleMin:[-1/0,1/0,NaN,void 0,null].includes(o)?0:o,r=!t.value.style.chart.bars.distributed&&(t.value.style.chart.grid.scale.scaleMax!==null||t.value.style.chart.grid.scale.scaleMin!==null)?c.calculateNiceScaleWithExactExtremes(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks):c.calculateNiceScale(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks);return r.ticks.map(n=>({zero:s.value.bottom-s.value.height*(Math.abs(r.min)/(r.max+Math.abs(r.min))),y:s.value.bottom-s.value.height*((n+Math.abs(r.min))/(r.max+Math.abs(r.min))),x:s.value.left-8,horizontal_zero:s.value.left+s.value.width*(Math.abs(r.min)/(r.max+Math.abs(r.min))),horizontal_x:s.value.left+s.value.width*((n+Math.abs(r.min))/(r.max+Math.abs(r.min))),horizontal_y:s.value.bottom-8,value:n}))}),z=e.computed(()=>{const l=[];for(let o=0;o<S.value;o+=1)l.push({text:t.value.style.chart.grid.x.timeLabels.values[o]||String(o),absoluteIndex:o});return l.slice(u.value.start,u.value.end)}),g=e.computed(()=>{if(!$.value)return[];let l=Array(S.value).fill(0),o=Array(S.value).fill(0),a=Array(S.value).fill(0),r=Array(S.value).fill(0);const n=Math.max(...H.value.positive)||0,i=Math.min(...H.value.negative),y=[-1/0,1/0,NaN,void 0,null].includes(i)?0:i,L=!t.value.style.chart.bars.distributed&&(t.value.style.chart.grid.scale.scaleMax!==null||t.value.style.chart.grid.scale.scaleMin!==null)?c.calculateNiceScaleWithExactExtremes(t.value.style.chart.grid.scale.scaleMin!==null?t.value.style.chart.grid.scale.scaleMin:y>0?0:y,t.value.style.chart.grid.scale.scaleMax!==null?t.value.style.chart.grid.scale.scaleMax:n<0?0:n,t.value.style.chart.grid.scale.ticks):c.calculateNiceScale(t.value.style.chart.grid.scale.scaleMin!==null?t.value.style.chart.grid.scale.scaleMin:y>0?0:y,t.value.style.chart.grid.scale.scaleMax!==null?t.value.style.chart.grid.scale.scaleMax:n<0?0:n,t.value.style.chart.grid.scale.ticks),{min:N,max:I}=L,E=I+(N>=0?0:Math.abs(N))||1,f=s.value.height,Y=s.value.width,_e=w.value[0]?w.value[0].zero:s.value.bottom,$e=w.value[0]?w.value[0].horizontal_zero:s.value.left;return C.value.filter(O=>!p.value.includes(O.id)).map(O=>{const B=O.series.slice(u.value.start,u.value.end),Xe=O.signedSeries.slice(u.value.start,u.value.end),Ge=B.map((h,m)=>s.value.left+d.value*m+d.value*t.value.style.chart.bars.gapRatio/4),Je=B.map((h,m)=>s.value.top+d.value*m+d.value*t.value.style.chart.bars.gapRatio/4),Ze=B.map((h,m)=>{const k=t.value.style.chart.bars.distributed?(h||0)/F.value[m]:(h||0)/E;let _,x;return h>0?(x=f*k,_=_e-x-l[m],l[m]+=x):(x=f*k,_=_e+a[m],a[m]+=Math.abs(x)),_}),Ke=B.map((h,m)=>{const k=t.value.style.chart.bars.distributed?(h||0)/F.value[m]:(h||0)/E;let _,x;return h>0?(x=Y*k,_=$e+o[m],o[m]+=x):(x=Y*k,_=$e-Math.abs(x)-r[m],r[m]+=Math.abs(x)),_}),Qe=B.map((h,m)=>{const k=t.value.style.chart.bars.distributed?(h||0)/F.value[m]:(h||0)/E;return h>0?f*k:f*Math.abs(k)}),je=B.map((h,m)=>{const k=t.value.style.chart.bars.distributed?(h||0)/F.value[m]:(h||0)/E;return h>0?Y*k:Y*Math.abs(k)}),et=B.map(h=>Math.abs(h)).reduce((h,m)=>h+m,0);return{...O,proportions:B.map((h,m)=>t.value.style.chart.bars.distributed?(h||0)/F.value[m]:(h||0)/et),series:B,signedSeries:Xe,x:Ge,y:Ze,height:Qe,horizontal_width:je,horizontal_y:Je,horizontal_x:Ke}})}),pe=e.computed(()=>He.value.map((l,o)=>({value:l,sign:l>=0?1:-1})));function q(l,o,a,r,n){const i=n===-1&&l>=0?-l:l;return c.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,i,c.dataLabel({p:t.value.style.chart.bars.dataLabels.prefix,v:i,s:t.value.style.chart.bars.dataLabels.suffix,r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:o,seriesIndex:a,datapointIndex:r})}function fe(l,o,a,r){return c.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,l,c.dataLabel({v:isNaN(l)?0:l,s:"%",r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:o,seriesIndex:a,datapointIndex:r})}function ke(l){const o=JSON.parse(JSON.stringify(g.value)).map(a=>({name:a.name,value:a.series[l]===0?0:a.series[l]||null,proportion:a.proportions[l]||null,color:a.color,id:a.id}));G("selectDatapoint",{datapoint:o,period:z.value[l]})}function xe(l){V.value=l,R.value=!0;const o=t.value.style.chart.tooltip.customFormat,a=JSON.parse(JSON.stringify(g.value)).map(n=>({name:n.name,value:n.series[l]===0?0:(n.signedSeries[l]===-1&&n.series[l]>=0?-n.series[l]:n.series[l])||null,proportion:n.proportions[l]||null,color:n.color,id:n.id})),r=a.map(n=>Math.abs(n.value)).reduce((n,i)=>n+i,0);if(c.isFunction(o)&&c.functionReturnsString(()=>o({seriesIndex:l,datapoint:a,series:g.value,config:t.value})))Z.value=o({seriesIndex:l,datapoint:a,series:g.value,config:t.value});else{const{showValue:n,showPercentage:i,borderColor:y,roundingValue:L,roundingPercentage:N}=t.value.style.chart.tooltip;let I="";z.value[l]&&z.value[l].text&&t.value.style.chart.tooltip.showTimeLabel&&(I+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${y};padding-bottom:6px;margin-bottom:3px;">${z.value[l].text}</div>`);const E=[n&&i?"(":"",n&&i?")":""];a.reverse().forEach(f=>{I+=`
2
2
  <div style="display:flex;flex-direction:row;align-items:center;gap:4px">
3
3
  <svg viewBox="0 0 12 12" height="14" width="14"><rect rx="1" x="0" y="0" height="12" width="12" stroke="none" fill="${t.value.style.chart.bars.gradient.show?`url(#gradient_${f.id})`:f.color}"/></svg>
4
4
  ${f.name}${n||i?":":""} ${n?c.dataLabel({p:t.value.style.chart.bars.dataLabels.prefix,v:f.value,s:t.value.style.chart.bars.dataLabels.suffix,r:L}):""} ${E[0]}${i?c.dataLabel({v:isNaN(f.value/r)?0:Math.abs(f.value)/r*100,s:"%",r:N}):""}${E[1]}
5
5
  </div>
6
- `}),Z.value=`<div>${I}</div>`}}function qe(l){D.value=l,te.value+=1}function we(){b.value.showTable=!b.value.showTable}function Be(){b.value.dataLabels.show=!b.value.dataLabels.show}function Ce(){b.value.showTooltip=!b.value.showTooltip}function Ue(){return g.value}const Se=e.computed(()=>{if(g.value.length===0)return{head:[],body:[],config:{},columnNames:[]};const l=g.value.map(({name:a,color:r})=>({label:a,color:r})),o=[];for(let a=u.value.start;a<u.value.end;a+=1){const r=[t.value.style.chart.grid.x.timeLabels.values[a]||a+1];C.value.forEach(n=>{r.push(Number((n.series[a]||0).toFixed(t.value.table.td.roundingValue)))}),o.push(r)}return{head:l,body:o}});function ze(){const l=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[""]],o=["",...Se.value.head.map(i=>i.label)],a=Se.value.body,r=l.concat([o]).concat(a),n=c.createCsvContent(r);c.downloadCsv({csvContent:n,title:t.value.style.chart.title.text||"vue-ui-stackbar"})}const U=e.computed(()=>{const l=[""].concat(g.value.map(n=>n.name)).concat(' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>');let o=[];for(let n=0;n<S.value;n+=1){const i=g.value.map(y=>y.series[n]??0).reduce((y,L)=>y+L,0);o.push([t.value.style.chart.grid.x.timeLabels.values.slice(u.value.start,u.value.end)[n]??n+1].concat(g.value.map(y=>(y.series[n]??0).toFixed(t.value.table.td.roundingValue))).concat((i??0).toFixed(t.value.table.td.roundingValue)))}const a={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint},r=[t.value.table.columnNames.period].concat(g.value.map(n=>n.name)).concat(t.value.table.columnNames.total);return{head:l,body:o.slice(0,u.value.end-u.value.start),config:a,colNames:r}});function We(l,o){if(G("selectLegend",g.value.find(a=>a.absoluteIndex===l)),p.value.includes(o.id))p.value=p.value.filter(a=>a!==o.id);else{if(p.value.length===C.value.length-1)return;p.value.push(o.id)}}const Le=e.computed(()=>C.value.map((l,o)=>({...l,shape:"square"})).map(l=>({...l,opacity:p.value.includes(l.id)?.5:1,segregate:()=>We(l.absoluteIndex,l),isSegregated:p.value.includes(l.id)}))),Ye=e.computed(()=>({cy:"stackbar-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":""})),W=e.ref(!1);function j(){W.value=!W.value}function Ne(l,o){const a=JSON.parse(JSON.stringify(g.value)).map(r=>({name:r.name,value:r.series[o]===0?0:(r.signedSeries[o]===-1&&r.series[o]>=0?-r.series[o]:r.series[o])||null,proportion:r.proportions[o]||null,color:r.color,id:r.id}));G("selectTimeLabel",{datapoint:a,absoluteIndex:l.absoluteIndex,label:l.text})}function Ee(l,o){return t.value.style.chart.bars.showDistributedPercentage&&t.value.style.chart.bars.distributed?t.value.style.chart.bars.dataLabels.hideEmptyPercentages?o>0:!0:t.value.style.chart.bars.dataLabels.hideEmptyValues?l!==0:!0}return Pe({getData:Ue,generatePdf:ve,generateCsv:ze,generateImage:he,toggleTable:we,toggleLabels:Be,toggleTooltip:Ce,toggleAnnotator:j}),(l,o)=>(e.openBlock(),e.createElementBlock("div",{id:`stackbar_${J.value}`,ref_key:"stackbarChart",ref:M,class:e.normalizeClass({"vue-ui-stackbar":!0,"vue-data-ui-wrapper-fullscreen":D.value}),style:e.normalizeStyle(`background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color};font-family:${t.value.style.fontFamily}; position: relative; ${t.value.responsive?"height: 100%":""}`),onMouseenter:o[6]||(o[6]=()=>e.unref(ne)(!0)),onMouseleave:o[7]||(o[7]=()=>e.unref(ne)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(ut.PenAndPaper,{key:0,parent:M.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:W.value,onClose:j},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"userConfig",{},void 0,!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"chartTitle",ref:ae,style:"width:100%;background:transparent;padding-bottom:24px"},[e.createVNode(lt._sfc_main,{config:{title:{cy:"stackbar-title",...t.value.style.chart.title},subtitle:{cy:"stackbar-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&$.value&&(e.unref(ie)||e.unref(K))?(e.openBlock(),e.createBlock(Ve.UserOptions,{ref:"details",key:`user_option_${te.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(ce),isImaging:e.unref(de),uid:J.value,hasTooltip:t.value.style.chart.tooltip.show&&t.value.userOptions.buttons.tooltip,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasLabel:t.value.userOptions.buttons.labels,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:D.value,chartElement:M.value,position:t.value.userOptions.position,isTooltip:b.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:W.value,onToggleFullscreen:qe,onGeneratePdf:e.unref(ve),onGenerateCsv:ze,onGenerateImage:e.unref(he),onToggleTable:we,onToggleLabels:Be,onToggleTooltip:Ce,onToggleAnnotator:j,style:e.normalizeStyle({visibility:e.unref(ie)?e.unref(K)?"visible":"hidden":"visible"})},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionLabels?{name:"optionLabels",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionLabels",{},void 0,!0)]),key:"5"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:r})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:r})),void 0,!0)]),key:"6"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:a,isAnnotator:r})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:a,isAnnotator:r})),void 0,!0)]),key:"7"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasLabel","hasFullscreen","isFullscreen","chartElement","position","isTooltip","titles","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),$.value?(e.openBlock(),e.createElementBlock("svg",{key:3,xmlns:e.unref(c.XMLNS),viewBox:`0 0 ${s.value.chartWidth<=0?10:s.value.chartWidth} ${s.value.chartHeight<=0?10:s.value.chartHeight}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(it._sfc_main),l.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:s.value.left,y:s.value.top,width:s.value.width<=0?10:s.value.width,height:s.value.height<=0?10:s.value.height,style:{pointerEvents:"none"}},[e.renderSlot(l.$slots,"chart-background",{},void 0,!0)],8,mt)):e.createCommentVNode("",!0),t.value.style.chart.bars.gradient.show?(e.openBlock(),e.createElementBlock("defs",gt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(a,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{id:`gradient_${a.id}`,x1:"0%",y1:"0%",x2:"0%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":a.color},null,8,bt),e.createElementVNode("stop",{offset:"61.8%","stop-color":e.unref(c.lightenHexColor)(a.color,t.value.style.chart.bars.gradient.intensity/100)},null,8,pt),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,ft)],8,yt))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.x.showHorizontalLines&&t.value.orientation==="vertical"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(w.value,(a,r)=>(e.openBlock(),e.createElementBlock("line",{x1:s.value.left,x2:s.value.right,y1:a.y,y2:a.y,stroke:t.value.style.chart.grid.x.axisColor,"stroke-width":1,"stroke-linecap":"round"},null,8,kt))),256)):e.createCommentVNode("",!0),t.value.style.chart.grid.x.showHorizontalLines&&t.value.orientation==="horizontal"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:3},e.renderList(u.value.end-u.value.start+1,(a,r)=>(e.openBlock(),e.createElementBlock("line",{x1:s.value.left,x2:s.value.right,y1:s.value.top+d.value*r,y2:s.value.top+d.value*r,stroke:t.value.style.chart.grid.y.axisColor,"stroke-width":1,"stroke-linecap":"round"},null,8,xt))),256)):e.createCommentVNode("",!0),t.value.style.chart.grid.y.showVerticalLines&&t.value.orientation==="vertical"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:4},e.renderList(u.value.end-u.value.start+1,(a,r)=>(e.openBlock(),e.createElementBlock("line",{x1:s.value.left+d.value*r,x2:s.value.left+d.value*r,y1:s.value.top,y2:s.value.bottom,stroke:t.value.style.chart.grid.y.axisColor,"stroke-width":1,"stroke-linecap":"round"},null,8,wt))),256)):e.createCommentVNode("",!0),t.value.style.chart.grid.x.showHorizontalLines&&t.value.orientation==="horizontal"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:5},e.renderList(w.value,(a,r)=>(e.openBlock(),e.createElementBlock("line",{x1:a.horizontal_x,x2:a.horizontal_x,y1:s.value.top,y2:s.value.bottom,stroke:t.value.style.chart.grid.x.axisColor,"stroke-width":1,"stroke-linecap":"round"},null,8,Bt))),256)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(a,r)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.orientation==="vertical"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(a.x,(n,i)=>(e.openBlock(),e.createElementBlock("rect",{x:n,y:a.y[i]<0?0:a.y[i],height:a.height[i]<0?1e-4:a.height[i],rx:t.value.style.chart.bars.borderRadius>a.height[i]/2?(a.height[i]<0?0:a.height[i])/2:t.value.style.chart.bars.borderRadius,width:d.value*(1-t.value.style.chart.bars.gapRatio/2),fill:t.value.style.chart.bars.gradient.show?`url(#gradient_${a.id})`:a.color,stroke:t.value.style.chart.backgroundColor,"stroke-width":t.value.style.chart.bars.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"vue-data-ui-bar-animated":t.value.useCssAnimation,"vue-data-ui-bar-transition":P.value})},null,10,Ct))),256)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(a.horizontal_x,(n,i)=>(e.openBlock(),e.createElementBlock("rect",{x:n,y:a.horizontal_y[i]<0?0:a.horizontal_y[i],width:a.horizontal_width[i]<0?1e-4:a.horizontal_width[i],rx:t.value.style.chart.bars.borderRadius>a.height[i]/2?(a.height[i]<0?0:a.height[i])/2:t.value.style.chart.bars.borderRadius,height:d.value*(1-t.value.style.chart.bars.gapRatio/2),fill:t.value.style.chart.bars.gradient.show?`url(#gradient_${a.id})`:a.color,stroke:t.value.style.chart.backgroundColor,"stroke-width":t.value.style.chart.bars.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"vue-data-ui-bar-animated":t.value.useCssAnimation,"vue-data-ui-bar-transition":P.value})},null,10,St))),256))]))),256)),t.value.style.chart.grid.x.showAxis?(e.openBlock(),e.createElementBlock("line",{key:6,x1:s.value.left,x2:s.value.right,y1:s.value.bottom,y2:s.value.bottom,stroke:t.value.style.chart.grid.x.axisColor,"stroke-width":t.value.style.chart.grid.x.axisThickness,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,zt)):e.createCommentVNode("",!0),t.value.style.chart.grid.y.showAxis&&!t.value.style.chart.bars.distributed?(e.openBlock(),e.createElementBlock("line",{key:7,x1:s.value.left,x2:s.value.left,y1:s.value.top,y2:s.value.bottom,stroke:t.value.style.chart.grid.y.axisColor,"stroke-width":t.value.style.chart.grid.y.axisThickness,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,Lt)):e.createCommentVNode("",!0),t.value.style.chart.grid.x.axisName.show&&t.value.style.chart.grid.x.axisName.text?(e.openBlock(),e.createElementBlock("text",{key:8,x:s.value.left+s.value.width/2,y:s.value.chartHeight+t.value.style.chart.grid.x.axisName.offsetY,"font-size":t.value.style.chart.grid.x.axisName.fontSize,fill:t.value.style.chart.grid.x.axisName.color,"font-weight":t.value.style.chart.grid.x.axisName.bold?"bold":"normal","text-anchor":"middle"},e.toDisplayString(t.value.style.chart.grid.x.axisName.text),9,Nt)):e.createCommentVNode("",!0),t.value.style.chart.grid.y.axisName.show&&t.value.style.chart.grid.y.axisName.text?(e.openBlock(),e.createElementBlock("text",{key:9,transform:`translate(${t.value.style.chart.grid.y.axisName.fontSize+t.value.style.chart.grid.y.axisName.offsetX}, ${s.value.top+s.value.height/2}) rotate(-90)`,"font-size":t.value.style.chart.grid.y.axisName.fontSize,fill:t.value.style.chart.grid.y.axisName.color,"font-weight":t.value.style.chart.grid.y.axisName.bold?"bold":"normal","text-anchor":"middle"},e.toDisplayString(t.value.style.chart.grid.y.axisName.text),9,Et)):e.createCommentVNode("",!0),b.value.dataLabels.show&&t.value.orientation==="vertical"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:10},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(a,r)=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.x,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[Ee(a.series[i],a.proportions[i])?(e.openBlock(),e.createElementBlock("text",{key:0,x:n+d.value*(1-t.value.style.chart.bars.gapRatio/2)/2,y:a.y[i]+a.height[i]/2+t.value.style.chart.bars.dataLabels.fontSize/3,"font-size":t.value.style.chart.bars.dataLabels.fontSize,fill:t.value.style.chart.bars.dataLabels.adaptColorToBackground?e.unref(c.adaptColorToBackground)(a.color):t.value.style.chart.bars.dataLabels.color,"font-weight":t.value.style.chart.bars.dataLabels.bold?"bold":"normal","text-anchor":"middle"},e.toDisplayString(t.value.style.chart.bars.showDistributedPercentage&&t.value.style.chart.bars.distributed?fe(a.proportions[i]*100,a,r,i):q(a.series[i],a,r,i,a.signedSeries[i])),9,_t)):e.createCommentVNode("",!0)],64))),256))]))),256)),t.value.style.chart.bars.totalValues.show&&g.value.length>1?(e.openBlock(),e.createElementBlock("g",$t,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pe.value,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[!t.value.style.chart.bars.dataLabels.hideEmptyValues||a.value!==0?(e.openBlock(),e.createElementBlock("text",{key:0,x:s.value.left+d.value*r+d.value/2,y:s.value.top-t.value.style.chart.bars.totalValues.fontSize/3,"text-anchor":"middle","font-size":t.value.style.chart.bars.totalValues.fontSize,"font-weight":t.value.style.chart.bars.totalValues.bold?"bold":"normal",fill:t.value.style.chart.bars.totalValues.color},e.toDisplayString(q(a.value,a,r,a.sign)),9,Mt)):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),b.value.dataLabels.show&&t.value.orientation==="horizontal"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:11},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(a,r)=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.horizontal_x,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[Ee(a.series[i],a.proportions[i])?(e.openBlock(),e.createElementBlock("text",{key:0,x:n+(a.horizontal_width[i]<0?1e-4:a.horizontal_width[i])/2,y:a.horizontal_y[i]+d.value*(1-t.value.style.chart.bars.gapRatio/2)/2+t.value.style.chart.bars.dataLabels.fontSize/3,"font-size":t.value.style.chart.bars.dataLabels.fontSize,fill:t.value.style.chart.bars.dataLabels.adaptColorToBackground?e.unref(c.adaptColorToBackground)(a.color):t.value.style.chart.bars.dataLabels.color,"font-weight":t.value.style.chart.bars.dataLabels.bold?"bold":"normal","text-anchor":"middle"},e.toDisplayString(t.value.style.chart.bars.showDistributedPercentage&&t.value.style.chart.bars.distributed?fe(a.proportions[i]*100,a,r,i):q(a.series[i],a,r,i,a.signedSeries[i])),9,Tt)):e.createCommentVNode("",!0)],64))),256))]))),256)),t.value.style.chart.bars.totalValues.show&&g.value.length>1?(e.openBlock(),e.createElementBlock("g",Vt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pe.value,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[!t.value.style.chart.bars.dataLabels.hideEmptyValues||a.value!==0?(e.openBlock(),e.createElementBlock("text",{key:0,x:s.value.right+t.value.style.chart.bars.totalValues.fontSize/3,y:s.value.top+d.value*r+d.value/2,"text-anchor":"start","font-size":t.value.style.chart.bars.totalValues.fontSize,"font-weight":t.value.style.chart.bars.totalValues.bold?"bold":"normal",fill:t.value.style.chart.bars.totalValues.color},e.toDisplayString(q(a.value,a,r,a.sign)),9,Pt)):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),t.value.style.chart.grid.y.axisLabels.show&&!t.value.style.chart.bars.distributed&&t.value.orientation==="vertical"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:12},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(a,r)=>(e.openBlock(),e.createElementBlock("line",{x1:s.value.left,x2:s.value.left-6,y1:a.y,y2:a.y,stroke:t.value.style.chart.grid.x.axisColor,"stroke-width":1},null,8,Ft))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(a,r)=>(e.openBlock(),e.createElementBlock("text",{x:a.x,y:a.y+t.value.style.chart.grid.y.axisLabels.fontSize/3,"font-size":t.value.style.chart.grid.y.axisLabels.fontSize,"font-weight":t.value.style.chart.grid.y.axisLabels.bold?"bold":"normal",fill:t.value.style.chart.grid.y.axisLabels.color,"text-anchor":"end"},e.toDisplayString(e.unref(c.dataLabel)({p:t.value.style.chart.bars.dataLabels.prefix,v:a.value,s:t.value.style.chart.bars.dataLabels.suffix,r:t.value.style.chart.grid.y.axisLabels.rounding})),9,It))),256))],64)):e.createCommentVNode("",!0),t.value.style.chart.grid.y.axisLabels.show&&!t.value.style.chart.bars.distributed&&t.value.orientation==="horizontal"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:13},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(a,r)=>(e.openBlock(),e.createElementBlock("line",{x1:a.horizontal_x,x2:a.horizontal_x,y1:s.value.bottom,y2:s.value.bottom+6,stroke:t.value.style.chart.grid.x.axisColor,"stroke-width":1,"stroke-linecap":"round"},null,8,Ot))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(a,r)=>(e.openBlock(),e.createElementBlock("text",{"font-size":t.value.style.chart.grid.x.timeLabels.fontSize,"font-weight":t.value.style.chart.grid.y.axisLabels.bold?"bold":"normal",fill:t.value.style.chart.grid.y.axisLabels.color,"text-anchor":t.value.style.chart.grid.x.timeLabels.rotation>0?"start":t.value.style.chart.grid.x.timeLabels.rotation<0?"end":"middle",transform:`translate(${a.horizontal_x}, ${s.value.bottom+t.value.style.chart.grid.x.timeLabels.fontSize*1.3+t.value.style.chart.grid.x.timeLabels.offsetY}), rotate(${t.value.style.chart.grid.x.timeLabels.rotation})`},e.toDisplayString(e.unref(c.dataLabel)({p:t.value.style.chart.bars.dataLabels.prefix,v:a.value,s:t.value.style.chart.bars.dataLabels.suffix,r:t.value.style.chart.grid.y.axisLabels.rounding})),9,Rt))),256))],64)):e.createCommentVNode("",!0),t.value.style.chart.grid.x.timeLabels.show&&t.value.orientation==="vertical"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:14},[l.$slots["time-label"]?(e.openBlock(),e.createElementBlock("g",Dt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(z.value,(a,r)=>(e.openBlock(),e.createElementBlock("g",null,[e.renderSlot(l.$slots,"time-label",e.normalizeProps(e.guardReactiveProps({x:s.value.left+d.value*r+d.value/2,y:s.value.bottom+t.value.style.chart.grid.x.timeLabels.fontSize*1.3+t.value.style.chart.grid.x.timeLabels.offsetY,fontSize:t.value.style.chart.grid.x.timeLabels.fontSize,fill:t.value.style.chart.grid.x.timeLabels.color,transform:`translate(${s.value.left+d.value*r+d.value/2}, ${s.value.bottom+t.value.style.chart.grid.x.timeLabels.fontSize*1.3+t.value.style.chart.grid.x.timeLabels.offsetY}), rotate(${t.value.style.chart.grid.x.timeLabels.rotation})`,absoluteIndex:a.absoluteIndex,content:a.text,textAnchor:t.value.style.chart.grid.x.timeLabels.rotation>0?"start":t.value.style.chart.grid.x.timeLabels.rotation<0?"end":"middle",show:!0})),void 0,!0)]))),256))])):(e.openBlock(),e.createElementBlock("g",At,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(z.value,(a,r)=>(e.openBlock(),e.createElementBlock("text",{"text-anchor":t.value.style.chart.grid.x.timeLabels.rotation>0?"start":t.value.style.chart.grid.x.timeLabels.rotation<0?"end":"middle","font-size":t.value.style.chart.grid.x.timeLabels.fontSize,"font-weight":t.value.style.chart.grid.x.timeLabels.bold?"bold":"normal",fill:t.value.style.chart.grid.x.timeLabels.color,transform:`translate(${s.value.left+d.value*r+d.value/2}, ${s.value.bottom+t.value.style.chart.grid.x.timeLabels.fontSize*1.3+t.value.style.chart.grid.x.timeLabels.offsetY}), rotate(${t.value.style.chart.grid.x.timeLabels.rotation})`,style:{cursor:"pointer"},onClick:()=>Ne(a,r)},e.toDisplayString(a.text),9,Ht))),256))]))],64)):e.createCommentVNode("",!0),t.value.style.chart.grid.x.timeLabels.show&&t.value.orientation==="horizontal"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:15},[l.$slots["time-label"]?(e.openBlock(),e.createElementBlock("g",qt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(z.value,(a,r)=>(e.openBlock(),e.createElementBlock("g",null,[e.renderSlot(l.$slots,"time-label",e.normalizeProps(e.guardReactiveProps({x:s.value.left-8,y:s.value.top+d.value*r+d.value/2+t.value.style.chart.grid.y.axisLabels.fontSize/3,fontSize:t.value.style.chart.grid.x.timeLabels.fontSize,fill:t.value.style.chart.grid.x.timeLabels.color,transform:null,absoluteIndex:a.absoluteIndex,content:a.text,textAnchor:"end",show:!0})),void 0,!0)]))),256))])):(e.openBlock(),e.createElementBlock("g",Ut,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(z.value,(a,r)=>(e.openBlock(),e.createElementBlock("text",{"text-anchor":"end","font-size":t.value.style.chart.grid.y.axisLabels.fontSize,"font-weight":t.value.style.chart.grid.y.axisLabels.bold?"bold":"normal",fill:t.value.style.chart.grid.y.axisLabels.color,x:s.value.left-8,y:s.value.top+d.value*r+d.value/2+t.value.style.chart.grid.y.axisLabels.fontSize/3,style:{cursor:"pointer"},onClick:()=>Ne(a,r)},e.toDisplayString(a.text),9,Wt))),256))]))],64)):e.createCommentVNode("",!0),b.value.showTooltip&&t.value.orientation==="vertical"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:16},e.renderList(u.value.end-u.value.start,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{x:s.value.left+r*d.value,y:s.value.top,width:d.value,height:s.value.height<0?0:s.value.height,onClick:n=>ke(r),onMouseenter:n=>xe(r),onMouseleave:o[0]||(o[0]=n=>{V.value=null,R.value=!1}),fill:r===V.value?t.value.style.chart.highlighter.color:"transparent",style:e.normalizeStyle({opacity:t.value.style.chart.highlighter.opacity/100})},null,44,Yt))),256)):e.createCommentVNode("",!0),b.value.showTooltip&&t.value.orientation==="horizontal"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:17},e.renderList(u.value.end-u.value.start,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{x:s.value.left,y:s.value.top+r*d.value,width:s.value.width<0?0:s.value.width,height:d.value,onClick:n=>ke(r),onMouseenter:n=>xe(r),onMouseleave:o[1]||(o[1]=n=>{V.value=null,R.value=!1}),fill:r===V.value?t.value.style.chart.highlighter.color:"transparent",style:e.normalizeStyle({opacity:t.value.style.chart.highlighter.opacity/100})},null,44,Xt))),256)):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"svg",e.normalizeProps(e.guardReactiveProps({...s.value})),void 0,!0)],12,ht)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Gt,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(ce)||e.unref(de)})),void 0,!0)])):e.createCommentVNode("",!0),$.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(nt.default,{key:5,config:{type:"bar",style:{backgroundColor:t.value.style.chart.backgroundColor,bar:{axis:{color:"#CCCCCC"},color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartSlicer",ref:oe,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor}`),"data-html2canvas-ignore":""},[t.value.style.chart.zoom.show&&S.value>1?(e.openBlock(),e.createBlock(tt.Slicer,{ref_key:"slicerComponent",ref:T,key:`slicer_${se.value}`,background:t.value.style.chart.zoom.color,borderColor:t.value.style.chart.backgroundColor,fontSize:t.value.style.chart.zoom.fontSize,useResetSlot:t.value.style.chart.zoom.useResetSlot,labelLeft:t.value.style.chart.grid.x.timeLabels.values[u.value.start]?t.value.style.chart.grid.x.timeLabels.values[u.value.start]:"",labelRight:t.value.style.chart.grid.x.timeLabels.values[u.value.end-1]?t.value.style.chart.grid.x.timeLabels.values[u.value.end-1]:"",textColor:t.value.style.chart.color,inputColor:t.value.style.chart.zoom.color,selectColor:t.value.style.chart.zoom.highlightColor,max:Math.max(...X.dataset.map(a=>a.series.length)),min:0,valueStart:u.value.start,valueEnd:u.value.end,start:u.value.start,"onUpdate:start":o[2]||(o[2]=a=>u.value.start=a),end:u.value.end,"onUpdate:end":o[3]||(o[3]=a=>u.value.end=a),refreshStartPoint:t.value.style.chart.zoom.startIndex!==null?t.value.style.chart.zoom.startIndex:0,refreshEndPoint:t.value.style.chart.zoom.endIndex!==null?t.value.style.chart.zoom.endIndex+1:Math.max(...X.dataset.map(a=>a.series.length)),enableRangeHandles:t.value.style.chart.zoom.enableRangeHandles,enableSelectionDrag:t.value.style.chart.zoom.enableSelectionDrag,onReset:ye},{"reset-action":e.withCtx(({reset:a})=>[e.renderSlot(l.$slots,"reset-action",e.normalizeProps(e.guardReactiveProps({reset:a})),void 0,!0)]),_:3},8,["background","borderColor","fontSize","useResetSlot","labelLeft","labelRight","textColor","inputColor","selectColor","max","valueStart","valueEnd","start","end","refreshStartPoint","refreshEndPoint","enableRangeHandles","enableSelectionDrag"])):e.createCommentVNode("",!0)],4),e.createVNode(at._sfc_main,{show:b.value.showTooltip&&R.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,fontSize:t.value.style.chart.tooltip.fontSize,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:M.value,content:Z.value,isFullscreen:D.value,isCustom:e.unref(c.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...ee.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...ee.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isFullscreen","isCustom"]),e.createElementVNode("div",{ref_key:"chartLegend",ref:le},[t.value.style.chart.legend.show&&$.value?(e.openBlock(),e.createBlock(ot.Legend,{key:0,legendSet:Le.value,config:Ye.value,onClickMarker:o[4]||(o[4]=({legend:a})=>a.segregate())},{item:e.withCtx(({legend:a})=>[e.createElementVNode("div",{onClick:r=>a.segregate(),style:e.normalizeStyle(`opacity:${p.value.includes(a.id)?.5:1}`)},e.toDisplayString(a.name),13,Jt)]),_:1},8,["legendSet","config"])):e.renderSlot(l.$slots,"legend",{key:1,legend:Le.value},void 0,!0)],512),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:6,ref_key:"source",ref:re,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),u.value.end-u.value.start<200?(e.openBlock(),e.createBlock(rt.default,{key:7,hideDetails:"",config:{open:b.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(st.DataTable,{colNames:U.value.colNames,head:U.value.head,body:U.value.body,config:U.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:o[5]||(o[5]=a=>b.value.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createElementVNode("div",{innerHTML:a},null,8,Zt)]),td:e.withCtx(({td:a})=>[e.createTextVNode(e.toDisplayString(isNaN(Number(a))?a:e.unref(c.dataLabel)({p:t.value.style.chart.bars.dataLabels.prefix,v:a,s:t.value.style.chart.bars.dataLabels.suffix,r:t.value.table.td.roundingValue})),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,vt))}},Qt=dt._export_sfc(Kt,[["__scopeId","data-v-004effc3"]]);exports.default=Qt;
6
+ `}),Z.value=`<div>${I}</div>`}}function qe(l){D.value=l,te.value+=1}function we(){b.value.showTable=!b.value.showTable}function Be(){b.value.dataLabels.show=!b.value.dataLabels.show}function Ce(){b.value.showTooltip=!b.value.showTooltip}function Ue(){return g.value}const Se=e.computed(()=>{if(g.value.length===0)return{head:[],body:[],config:{},columnNames:[]};const l=g.value.map(({name:a,color:r})=>({label:a,color:r})),o=[];for(let a=u.value.start;a<u.value.end;a+=1){const r=[t.value.style.chart.grid.x.timeLabels.values[a]||a+1];C.value.forEach(n=>{r.push(Number((n.series[a]||0).toFixed(t.value.table.td.roundingValue)))}),o.push(r)}return{head:l,body:o}});function ze(){const l=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[""]],o=["",...Se.value.head.map(i=>i.label)],a=Se.value.body,r=l.concat([o]).concat(a),n=c.createCsvContent(r);c.downloadCsv({csvContent:n,title:t.value.style.chart.title.text||"vue-ui-stackbar"})}const U=e.computed(()=>{const l=[""].concat(g.value.map(n=>n.name)).concat(' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>');let o=[];for(let n=0;n<S.value;n+=1){const i=g.value.map(y=>y.series[n]??0).reduce((y,L)=>y+L,0);o.push([t.value.style.chart.grid.x.timeLabels.values.slice(u.value.start,u.value.end)[n]??n+1].concat(g.value.map(y=>(y.series[n]??0).toFixed(t.value.table.td.roundingValue))).concat((i??0).toFixed(t.value.table.td.roundingValue)))}const a={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint},r=[t.value.table.columnNames.period].concat(g.value.map(n=>n.name)).concat(t.value.table.columnNames.total);return{head:l,body:o.slice(0,u.value.end-u.value.start),config:a,colNames:r}});function We(l,o){if(G("selectLegend",g.value.find(a=>a.absoluteIndex===l)),p.value.includes(o.id))p.value=p.value.filter(a=>a!==o.id);else{if(p.value.length===C.value.length-1)return;p.value.push(o.id)}}const Le=e.computed(()=>C.value.map((l,o)=>({...l,shape:"square"})).map(l=>({...l,opacity:p.value.includes(l.id)?.5:1,segregate:()=>We(l.absoluteIndex,l),isSegregated:p.value.includes(l.id)}))),Ye=e.computed(()=>({cy:"stackbar-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":""})),W=e.ref(!1);function j(){W.value=!W.value}function Ne(l,o){const a=JSON.parse(JSON.stringify(g.value)).map(r=>({name:r.name,value:r.series[o]===0?0:(r.signedSeries[o]===-1&&r.series[o]>=0?-r.series[o]:r.series[o])||null,proportion:r.proportions[o]||null,color:r.color,id:r.id}));G("selectTimeLabel",{datapoint:a,absoluteIndex:l.absoluteIndex,label:l.text})}function Ee(l,o){return t.value.style.chart.bars.showDistributedPercentage&&t.value.style.chart.bars.distributed?t.value.style.chart.bars.dataLabels.hideEmptyPercentages?o>0:!0:t.value.style.chart.bars.dataLabels.hideEmptyValues?l!==0:!0}return Pe({getData:Ue,generatePdf:ve,generateCsv:ze,generateImage:he,toggleTable:we,toggleLabels:Be,toggleTooltip:Ce,toggleAnnotator:j}),(l,o)=>(e.openBlock(),e.createElementBlock("div",{id:`stackbar_${J.value}`,ref_key:"stackbarChart",ref:M,class:e.normalizeClass({"vue-ui-stackbar":!0,"vue-data-ui-wrapper-fullscreen":D.value}),style:e.normalizeStyle(`background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color};font-family:${t.value.style.fontFamily}; position: relative; ${t.value.responsive?"height: 100%":""}`),onMouseenter:o[6]||(o[6]=()=>e.unref(ne)(!0)),onMouseleave:o[7]||(o[7]=()=>e.unref(ne)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(ut.PenAndPaper,{key:0,parent:M.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:W.value,onClose:j},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"userConfig",{},void 0,!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"chartTitle",ref:ae,style:"width:100%;background:transparent;padding-bottom:24px"},[e.createVNode(lt._sfc_main,{config:{title:{cy:"stackbar-title",...t.value.style.chart.title},subtitle:{cy:"stackbar-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&$.value&&(e.unref(ie)||e.unref(K))?(e.openBlock(),e.createBlock(Ve.UserOptions,{ref:"details",key:`user_option_${te.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(ce),isImaging:e.unref(de),uid:J.value,hasTooltip:t.value.style.chart.tooltip.show&&t.value.userOptions.buttons.tooltip,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasLabel:t.value.userOptions.buttons.labels,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:D.value,chartElement:M.value,position:t.value.userOptions.position,isTooltip:b.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:W.value,onToggleFullscreen:qe,onGeneratePdf:e.unref(ve),onGenerateCsv:ze,onGenerateImage:e.unref(he),onToggleTable:we,onToggleLabels:Be,onToggleTooltip:Ce,onToggleAnnotator:j,style:e.normalizeStyle({visibility:e.unref(ie)?e.unref(K)?"visible":"hidden":"visible"})},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionLabels?{name:"optionLabels",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionLabels",{},void 0,!0)]),key:"5"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:r})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:r})),void 0,!0)]),key:"6"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:a,isAnnotator:r})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:a,isAnnotator:r})),void 0,!0)]),key:"7"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasLabel","hasFullscreen","isFullscreen","chartElement","position","isTooltip","titles","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),$.value?(e.openBlock(),e.createElementBlock("svg",{key:3,xmlns:e.unref(c.XMLNS),viewBox:`0 0 ${s.value.chartWidth<=0?10:s.value.chartWidth} ${s.value.chartHeight<=0?10:s.value.chartHeight}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(it._sfc_main),l.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:s.value.left,y:s.value.top,width:s.value.width<=0?10:s.value.width,height:s.value.height<=0?10:s.value.height,style:{pointerEvents:"none"}},[e.renderSlot(l.$slots,"chart-background",{},void 0,!0)],8,mt)):e.createCommentVNode("",!0),t.value.style.chart.bars.gradient.show?(e.openBlock(),e.createElementBlock("defs",gt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(a,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{id:`gradient_${a.id}`,x1:"0%",y1:"0%",x2:"0%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":a.color},null,8,bt),e.createElementVNode("stop",{offset:"61.8%","stop-color":e.unref(c.lightenHexColor)(a.color,t.value.style.chart.bars.gradient.intensity/100)},null,8,pt),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,ft)],8,yt))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.x.showHorizontalLines&&t.value.orientation==="vertical"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(w.value,(a,r)=>(e.openBlock(),e.createElementBlock("line",{x1:s.value.left,x2:s.value.right,y1:a.y,y2:a.y,stroke:t.value.style.chart.grid.x.axisColor,"stroke-width":1,"stroke-linecap":"round"},null,8,kt))),256)):e.createCommentVNode("",!0),t.value.style.chart.grid.x.showHorizontalLines&&t.value.orientation==="horizontal"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:3},e.renderList(u.value.end-u.value.start+1,(a,r)=>(e.openBlock(),e.createElementBlock("line",{x1:s.value.left,x2:s.value.right,y1:s.value.top+d.value*r,y2:s.value.top+d.value*r,stroke:t.value.style.chart.grid.y.axisColor,"stroke-width":1,"stroke-linecap":"round"},null,8,xt))),256)):e.createCommentVNode("",!0),t.value.style.chart.grid.y.showVerticalLines&&t.value.orientation==="vertical"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:4},e.renderList(u.value.end-u.value.start+1,(a,r)=>(e.openBlock(),e.createElementBlock("line",{x1:s.value.left+d.value*r,x2:s.value.left+d.value*r,y1:s.value.top,y2:s.value.bottom,stroke:t.value.style.chart.grid.y.axisColor,"stroke-width":1,"stroke-linecap":"round"},null,8,wt))),256)):e.createCommentVNode("",!0),t.value.style.chart.grid.x.showHorizontalLines&&t.value.orientation==="horizontal"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:5},e.renderList(w.value,(a,r)=>(e.openBlock(),e.createElementBlock("line",{x1:a.horizontal_x,x2:a.horizontal_x,y1:s.value.top,y2:s.value.bottom,stroke:t.value.style.chart.grid.x.axisColor,"stroke-width":1,"stroke-linecap":"round"},null,8,Bt))),256)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(a,r)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.orientation==="vertical"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(a.x,(n,i)=>(e.openBlock(),e.createElementBlock("rect",{x:n,y:a.y[i]<0?0:a.y[i],height:a.height[i]<0?1e-4:a.height[i]||0,rx:t.value.style.chart.bars.borderRadius>a.height[i]/2?(a.height[i]<0?0:a.height[i])/2:t.value.style.chart.bars.borderRadius,width:d.value*(1-t.value.style.chart.bars.gapRatio/2),fill:t.value.style.chart.bars.gradient.show?`url(#gradient_${a.id})`:a.color,stroke:t.value.style.chart.backgroundColor,"stroke-width":t.value.style.chart.bars.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"vue-data-ui-bar-animated":t.value.useCssAnimation,"vue-data-ui-bar-transition":P.value})},null,10,Ct))),256)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(a.horizontal_x,(n,i)=>(e.openBlock(),e.createElementBlock("rect",{x:n,y:a.horizontal_y[i]<0?0:a.horizontal_y[i],width:a.horizontal_width[i]<0?1e-4:a.horizontal_width[i],rx:t.value.style.chart.bars.borderRadius>a.height[i]/2?(a.height[i]<0?0:a.height[i])/2:t.value.style.chart.bars.borderRadius,height:d.value*(1-t.value.style.chart.bars.gapRatio/2),fill:t.value.style.chart.bars.gradient.show?`url(#gradient_${a.id})`:a.color,stroke:t.value.style.chart.backgroundColor,"stroke-width":t.value.style.chart.bars.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"vue-data-ui-bar-animated":t.value.useCssAnimation,"vue-data-ui-bar-transition":P.value})},null,10,St))),256))]))),256)),t.value.style.chart.grid.x.showAxis?(e.openBlock(),e.createElementBlock("line",{key:6,x1:s.value.left,x2:s.value.right,y1:s.value.bottom,y2:s.value.bottom,stroke:t.value.style.chart.grid.x.axisColor,"stroke-width":t.value.style.chart.grid.x.axisThickness,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,zt)):e.createCommentVNode("",!0),t.value.style.chart.grid.y.showAxis&&!t.value.style.chart.bars.distributed?(e.openBlock(),e.createElementBlock("line",{key:7,x1:s.value.left,x2:s.value.left,y1:s.value.top,y2:s.value.bottom,stroke:t.value.style.chart.grid.y.axisColor,"stroke-width":t.value.style.chart.grid.y.axisThickness,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,Lt)):e.createCommentVNode("",!0),t.value.style.chart.grid.x.axisName.show&&t.value.style.chart.grid.x.axisName.text?(e.openBlock(),e.createElementBlock("text",{key:8,x:s.value.left+s.value.width/2,y:s.value.chartHeight+t.value.style.chart.grid.x.axisName.offsetY,"font-size":t.value.style.chart.grid.x.axisName.fontSize,fill:t.value.style.chart.grid.x.axisName.color,"font-weight":t.value.style.chart.grid.x.axisName.bold?"bold":"normal","text-anchor":"middle"},e.toDisplayString(t.value.style.chart.grid.x.axisName.text),9,Nt)):e.createCommentVNode("",!0),t.value.style.chart.grid.y.axisName.show&&t.value.style.chart.grid.y.axisName.text?(e.openBlock(),e.createElementBlock("text",{key:9,transform:`translate(${t.value.style.chart.grid.y.axisName.fontSize+t.value.style.chart.grid.y.axisName.offsetX}, ${s.value.top+s.value.height/2}) rotate(-90)`,"font-size":t.value.style.chart.grid.y.axisName.fontSize,fill:t.value.style.chart.grid.y.axisName.color,"font-weight":t.value.style.chart.grid.y.axisName.bold?"bold":"normal","text-anchor":"middle"},e.toDisplayString(t.value.style.chart.grid.y.axisName.text),9,Et)):e.createCommentVNode("",!0),b.value.dataLabels.show&&t.value.orientation==="vertical"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:10},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(a,r)=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.x,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[Ee(a.series[i],a.proportions[i])?(e.openBlock(),e.createElementBlock("text",{key:0,x:n+d.value*(1-t.value.style.chart.bars.gapRatio/2)/2,y:a.y[i]+a.height[i]/2+t.value.style.chart.bars.dataLabels.fontSize/3,"font-size":t.value.style.chart.bars.dataLabels.fontSize,fill:t.value.style.chart.bars.dataLabels.adaptColorToBackground?e.unref(c.adaptColorToBackground)(a.color):t.value.style.chart.bars.dataLabels.color,"font-weight":t.value.style.chart.bars.dataLabels.bold?"bold":"normal","text-anchor":"middle"},e.toDisplayString(t.value.style.chart.bars.showDistributedPercentage&&t.value.style.chart.bars.distributed?fe(a.proportions[i]*100,a,r,i):q(a.series[i],a,r,i,a.signedSeries[i])),9,_t)):e.createCommentVNode("",!0)],64))),256))]))),256)),t.value.style.chart.bars.totalValues.show&&g.value.length>1?(e.openBlock(),e.createElementBlock("g",$t,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pe.value,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[!t.value.style.chart.bars.dataLabels.hideEmptyValues||a.value!==0?(e.openBlock(),e.createElementBlock("text",{key:0,x:s.value.left+d.value*r+d.value/2,y:s.value.top-t.value.style.chart.bars.totalValues.fontSize/3,"text-anchor":"middle","font-size":t.value.style.chart.bars.totalValues.fontSize,"font-weight":t.value.style.chart.bars.totalValues.bold?"bold":"normal",fill:t.value.style.chart.bars.totalValues.color},e.toDisplayString(q(a.value,a,r,a.sign)),9,Mt)):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),b.value.dataLabels.show&&t.value.orientation==="horizontal"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:11},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(a,r)=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.horizontal_x,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[Ee(a.series[i],a.proportions[i])?(e.openBlock(),e.createElementBlock("text",{key:0,x:n+(a.horizontal_width[i]<0?1e-4:a.horizontal_width[i])/2,y:a.horizontal_y[i]+d.value*(1-t.value.style.chart.bars.gapRatio/2)/2+t.value.style.chart.bars.dataLabels.fontSize/3,"font-size":t.value.style.chart.bars.dataLabels.fontSize,fill:t.value.style.chart.bars.dataLabels.adaptColorToBackground?e.unref(c.adaptColorToBackground)(a.color):t.value.style.chart.bars.dataLabels.color,"font-weight":t.value.style.chart.bars.dataLabels.bold?"bold":"normal","text-anchor":"middle"},e.toDisplayString(t.value.style.chart.bars.showDistributedPercentage&&t.value.style.chart.bars.distributed?fe(a.proportions[i]*100,a,r,i):q(a.series[i],a,r,i,a.signedSeries[i])),9,Tt)):e.createCommentVNode("",!0)],64))),256))]))),256)),t.value.style.chart.bars.totalValues.show&&g.value.length>1?(e.openBlock(),e.createElementBlock("g",Vt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pe.value,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[!t.value.style.chart.bars.dataLabels.hideEmptyValues||a.value!==0?(e.openBlock(),e.createElementBlock("text",{key:0,x:s.value.right+t.value.style.chart.bars.totalValues.fontSize/3,y:s.value.top+d.value*r+d.value/2,"text-anchor":"start","font-size":t.value.style.chart.bars.totalValues.fontSize,"font-weight":t.value.style.chart.bars.totalValues.bold?"bold":"normal",fill:t.value.style.chart.bars.totalValues.color},e.toDisplayString(q(a.value,a,r,a.sign)),9,Pt)):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),t.value.style.chart.grid.y.axisLabels.show&&!t.value.style.chart.bars.distributed&&t.value.orientation==="vertical"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:12},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(a,r)=>(e.openBlock(),e.createElementBlock("line",{x1:s.value.left,x2:s.value.left-6,y1:a.y,y2:a.y,stroke:t.value.style.chart.grid.x.axisColor,"stroke-width":1},null,8,Ft))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(a,r)=>(e.openBlock(),e.createElementBlock("text",{x:a.x,y:a.y+t.value.style.chart.grid.y.axisLabels.fontSize/3,"font-size":t.value.style.chart.grid.y.axisLabels.fontSize,"font-weight":t.value.style.chart.grid.y.axisLabels.bold?"bold":"normal",fill:t.value.style.chart.grid.y.axisLabels.color,"text-anchor":"end"},e.toDisplayString(e.unref(c.dataLabel)({p:t.value.style.chart.bars.dataLabels.prefix,v:a.value,s:t.value.style.chart.bars.dataLabels.suffix,r:t.value.style.chart.grid.y.axisLabels.rounding})),9,It))),256))],64)):e.createCommentVNode("",!0),t.value.style.chart.grid.y.axisLabels.show&&!t.value.style.chart.bars.distributed&&t.value.orientation==="horizontal"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:13},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(a,r)=>(e.openBlock(),e.createElementBlock("line",{x1:a.horizontal_x,x2:a.horizontal_x,y1:s.value.bottom,y2:s.value.bottom+6,stroke:t.value.style.chart.grid.x.axisColor,"stroke-width":1,"stroke-linecap":"round"},null,8,Ot))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(a,r)=>(e.openBlock(),e.createElementBlock("text",{"font-size":t.value.style.chart.grid.x.timeLabels.fontSize,"font-weight":t.value.style.chart.grid.y.axisLabels.bold?"bold":"normal",fill:t.value.style.chart.grid.y.axisLabels.color,"text-anchor":t.value.style.chart.grid.x.timeLabels.rotation>0?"start":t.value.style.chart.grid.x.timeLabels.rotation<0?"end":"middle",transform:`translate(${a.horizontal_x}, ${s.value.bottom+t.value.style.chart.grid.x.timeLabels.fontSize*1.3+t.value.style.chart.grid.x.timeLabels.offsetY}), rotate(${t.value.style.chart.grid.x.timeLabels.rotation})`},e.toDisplayString(e.unref(c.dataLabel)({p:t.value.style.chart.bars.dataLabels.prefix,v:a.value,s:t.value.style.chart.bars.dataLabels.suffix,r:t.value.style.chart.grid.y.axisLabels.rounding})),9,Rt))),256))],64)):e.createCommentVNode("",!0),t.value.style.chart.grid.x.timeLabels.show&&t.value.orientation==="vertical"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:14},[l.$slots["time-label"]?(e.openBlock(),e.createElementBlock("g",Dt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(z.value,(a,r)=>(e.openBlock(),e.createElementBlock("g",null,[e.renderSlot(l.$slots,"time-label",e.normalizeProps(e.guardReactiveProps({x:s.value.left+d.value*r+d.value/2,y:s.value.bottom+t.value.style.chart.grid.x.timeLabels.fontSize*1.3+t.value.style.chart.grid.x.timeLabels.offsetY,fontSize:t.value.style.chart.grid.x.timeLabels.fontSize,fill:t.value.style.chart.grid.x.timeLabels.color,transform:`translate(${s.value.left+d.value*r+d.value/2}, ${s.value.bottom+t.value.style.chart.grid.x.timeLabels.fontSize*1.3+t.value.style.chart.grid.x.timeLabels.offsetY}), rotate(${t.value.style.chart.grid.x.timeLabels.rotation})`,absoluteIndex:a.absoluteIndex,content:a.text,textAnchor:t.value.style.chart.grid.x.timeLabels.rotation>0?"start":t.value.style.chart.grid.x.timeLabels.rotation<0?"end":"middle",show:!0})),void 0,!0)]))),256))])):(e.openBlock(),e.createElementBlock("g",At,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(z.value,(a,r)=>(e.openBlock(),e.createElementBlock("text",{"text-anchor":t.value.style.chart.grid.x.timeLabels.rotation>0?"start":t.value.style.chart.grid.x.timeLabels.rotation<0?"end":"middle","font-size":t.value.style.chart.grid.x.timeLabels.fontSize,"font-weight":t.value.style.chart.grid.x.timeLabels.bold?"bold":"normal",fill:t.value.style.chart.grid.x.timeLabels.color,transform:`translate(${s.value.left+d.value*r+d.value/2}, ${s.value.bottom+t.value.style.chart.grid.x.timeLabels.fontSize*1.3+t.value.style.chart.grid.x.timeLabels.offsetY}), rotate(${t.value.style.chart.grid.x.timeLabels.rotation})`,style:{cursor:"pointer"},onClick:()=>Ne(a,r)},e.toDisplayString(a.text),9,Ht))),256))]))],64)):e.createCommentVNode("",!0),t.value.style.chart.grid.x.timeLabels.show&&t.value.orientation==="horizontal"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:15},[l.$slots["time-label"]?(e.openBlock(),e.createElementBlock("g",qt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(z.value,(a,r)=>(e.openBlock(),e.createElementBlock("g",null,[e.renderSlot(l.$slots,"time-label",e.normalizeProps(e.guardReactiveProps({x:s.value.left-8,y:s.value.top+d.value*r+d.value/2+t.value.style.chart.grid.y.axisLabels.fontSize/3,fontSize:t.value.style.chart.grid.x.timeLabels.fontSize,fill:t.value.style.chart.grid.x.timeLabels.color,transform:null,absoluteIndex:a.absoluteIndex,content:a.text,textAnchor:"end",show:!0})),void 0,!0)]))),256))])):(e.openBlock(),e.createElementBlock("g",Ut,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(z.value,(a,r)=>(e.openBlock(),e.createElementBlock("text",{"text-anchor":"end","font-size":t.value.style.chart.grid.y.axisLabels.fontSize,"font-weight":t.value.style.chart.grid.y.axisLabels.bold?"bold":"normal",fill:t.value.style.chart.grid.y.axisLabels.color,x:s.value.left-8,y:s.value.top+d.value*r+d.value/2+t.value.style.chart.grid.y.axisLabels.fontSize/3,style:{cursor:"pointer"},onClick:()=>Ne(a,r)},e.toDisplayString(a.text),9,Wt))),256))]))],64)):e.createCommentVNode("",!0),b.value.showTooltip&&t.value.orientation==="vertical"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:16},e.renderList(u.value.end-u.value.start,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{x:s.value.left+r*d.value,y:s.value.top,width:d.value,height:s.value.height<0?0:s.value.height,onClick:n=>ke(r),onMouseenter:n=>xe(r),onMouseleave:o[0]||(o[0]=n=>{V.value=null,R.value=!1}),fill:r===V.value?t.value.style.chart.highlighter.color:"transparent",style:e.normalizeStyle({opacity:t.value.style.chart.highlighter.opacity/100})},null,44,Yt))),256)):e.createCommentVNode("",!0),b.value.showTooltip&&t.value.orientation==="horizontal"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:17},e.renderList(u.value.end-u.value.start,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{x:s.value.left,y:s.value.top+r*d.value,width:s.value.width<0?0:s.value.width,height:d.value,onClick:n=>ke(r),onMouseenter:n=>xe(r),onMouseleave:o[1]||(o[1]=n=>{V.value=null,R.value=!1}),fill:r===V.value?t.value.style.chart.highlighter.color:"transparent",style:e.normalizeStyle({opacity:t.value.style.chart.highlighter.opacity/100})},null,44,Xt))),256)):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"svg",e.normalizeProps(e.guardReactiveProps({...s.value})),void 0,!0)],12,ht)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Gt,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(ce)||e.unref(de)})),void 0,!0)])):e.createCommentVNode("",!0),$.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(nt.default,{key:5,config:{type:"bar",style:{backgroundColor:t.value.style.chart.backgroundColor,bar:{axis:{color:"#CCCCCC"},color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartSlicer",ref:oe,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor}`),"data-html2canvas-ignore":""},[t.value.style.chart.zoom.show&&S.value>1?(e.openBlock(),e.createBlock(tt.Slicer,{ref_key:"slicerComponent",ref:T,key:`slicer_${se.value}`,background:t.value.style.chart.zoom.color,borderColor:t.value.style.chart.backgroundColor,fontSize:t.value.style.chart.zoom.fontSize,useResetSlot:t.value.style.chart.zoom.useResetSlot,labelLeft:t.value.style.chart.grid.x.timeLabels.values[u.value.start]?t.value.style.chart.grid.x.timeLabels.values[u.value.start]:"",labelRight:t.value.style.chart.grid.x.timeLabels.values[u.value.end-1]?t.value.style.chart.grid.x.timeLabels.values[u.value.end-1]:"",textColor:t.value.style.chart.color,inputColor:t.value.style.chart.zoom.color,selectColor:t.value.style.chart.zoom.highlightColor,max:Math.max(...X.dataset.map(a=>a.series.length)),min:0,valueStart:u.value.start,valueEnd:u.value.end,start:u.value.start,"onUpdate:start":o[2]||(o[2]=a=>u.value.start=a),end:u.value.end,"onUpdate:end":o[3]||(o[3]=a=>u.value.end=a),refreshStartPoint:t.value.style.chart.zoom.startIndex!==null?t.value.style.chart.zoom.startIndex:0,refreshEndPoint:t.value.style.chart.zoom.endIndex!==null?t.value.style.chart.zoom.endIndex+1:Math.max(...X.dataset.map(a=>a.series.length)),enableRangeHandles:t.value.style.chart.zoom.enableRangeHandles,enableSelectionDrag:t.value.style.chart.zoom.enableSelectionDrag,onReset:ye},{"reset-action":e.withCtx(({reset:a})=>[e.renderSlot(l.$slots,"reset-action",e.normalizeProps(e.guardReactiveProps({reset:a})),void 0,!0)]),_:3},8,["background","borderColor","fontSize","useResetSlot","labelLeft","labelRight","textColor","inputColor","selectColor","max","valueStart","valueEnd","start","end","refreshStartPoint","refreshEndPoint","enableRangeHandles","enableSelectionDrag"])):e.createCommentVNode("",!0)],4),e.createVNode(at._sfc_main,{show:b.value.showTooltip&&R.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,fontSize:t.value.style.chart.tooltip.fontSize,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:M.value,content:Z.value,isFullscreen:D.value,isCustom:e.unref(c.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...ee.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...ee.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isFullscreen","isCustom"]),e.createElementVNode("div",{ref_key:"chartLegend",ref:le},[t.value.style.chart.legend.show&&$.value?(e.openBlock(),e.createBlock(ot.Legend,{key:0,legendSet:Le.value,config:Ye.value,onClickMarker:o[4]||(o[4]=({legend:a})=>a.segregate())},{item:e.withCtx(({legend:a})=>[e.createElementVNode("div",{onClick:r=>a.segregate(),style:e.normalizeStyle(`opacity:${p.value.includes(a.id)?.5:1}`)},e.toDisplayString(a.name),13,Jt)]),_:1},8,["legendSet","config"])):e.renderSlot(l.$slots,"legend",{key:1,legend:Le.value},void 0,!0)],512),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:6,ref_key:"source",ref:re,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),u.value.end-u.value.start<200?(e.openBlock(),e.createBlock(rt.default,{key:7,hideDetails:"",config:{open:b.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(st.DataTable,{colNames:U.value.colNames,head:U.value.head,body:U.value.body,config:U.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:o[5]||(o[5]=a=>b.value.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createElementVNode("div",{innerHTML:a},null,8,Zt)]),td:e.withCtx(({td:a})=>[e.createTextVNode(e.toDisplayString(isNaN(Number(a))?a:e.unref(c.dataLabel)({p:t.value.style.chart.bars.dataLabels.prefix,v:a,s:t.value.style.chart.bars.dataLabels.suffix,r:t.value.table.td.roundingValue})),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,vt))}},Qt=dt._export_sfc(Kt,[["__scopeId","data-v-41b031bd"]]);exports.default=Qt;
@@ -1,17 +1,17 @@
1
1
  import { computed as w, ref as y, onMounted as je, watch as et, nextTick as ne, openBlock as s, createElementBlock as i, normalizeClass as xe, normalizeStyle as B, unref as p, createBlock as J, createCommentVNode as h, renderSlot as k, createVNode as ue, createSlots as Mt, withCtx as C, normalizeProps as O, guardReactiveProps as P, Fragment as v, renderList as f, createElementVNode as U, toDisplayString as S, createTextVNode as Tt } from "vue";
2
- import { u as Nt, c as tt, t as It, a as Ot, p as ce, C as ve, b as Pt, o as Rt, e as at, g as At, d as Vt, a7 as he, a3 as lt, D as rt, X as Dt, l as Et, G as ot, f as W, x as st, i as it, y as Ft, q as Ht, r as Bt } from "./index-Z_vzxZTo.js";
3
- import { u as nt } from "./useNestedProp-Buhi5uyL.js";
2
+ import { u as Nt, c as tt, t as It, a as Ot, p as ce, C as ve, b as Pt, o as Rt, e as at, g as At, d as Vt, a7 as he, a3 as lt, D as rt, X as Dt, l as Et, G as ot, f as W, x as st, i as it, y as Ft, q as Ht, r as Bt } from "./index-DjTPIx3R.js";
3
+ import { u as nt } from "./useNestedProp-BNmCbG1v.js";
4
4
  import { t as Ut, u as Wt } from "./useResponsive-CoxXLe23.js";
5
- import { u as Yt, U as Xt } from "./usePrinter-Ck0oiMlt.js";
6
- import { S as Gt } from "./Slicer-DvdU-uf8.js";
7
- import { _ as Jt } from "./Tooltip-BK-ACGDE.js";
8
- import { _ as qt } from "./Title-obqvTiXP.js";
9
- import { L as Zt } from "./Legend-WOejx9sp.js";
10
- import Kt from "./vue-ui-accordion-CV2-8b1O.js";
11
- import { D as Qt } from "./DataTable-BBh7_ttv.js";
12
- import jt from "./vue-ui-skeleton-BMRe3SzB.js";
13
- import { _ as ea } from "./PackageVersion-dR8EUy_P.js";
14
- import { P as ta } from "./PenAndPaper-CrXlqi9I.js";
5
+ import { u as Yt, U as Xt } from "./usePrinter-BFF1xn1s.js";
6
+ import { S as Gt } from "./Slicer-BBolqweG.js";
7
+ import { _ as Jt } from "./Tooltip-DddRc8qD.js";
8
+ import { _ as qt } from "./Title-DqZErnpZ.js";
9
+ import { L as Zt } from "./Legend-CzY3Yhr8.js";
10
+ import Kt from "./vue-ui-accordion-CDTXGeL0.js";
11
+ import { D as Qt } from "./DataTable-B2hVpPSW.js";
12
+ import jt from "./vue-ui-skeleton-Dt9cA-wa.js";
13
+ import { _ as ea } from "./PackageVersion-B684aQUP.js";
14
+ import { P as ta } from "./PenAndPaper-mC0kh-S8.js";
15
15
  import { u as aa } from "./useUserOptionState-BIvW1Kz7.js";
16
16
  import { _ as la } from "./_plugin-vue_export-helper-CHgC5LLL.js";
17
17
  const ra = ["id"], oa = ["xmlns", "viewBox"], sa = ["x", "y", "width", "height"], ia = { key: 1 }, na = ["id"], ua = ["stop-color"], ca = ["stop-color"], va = ["stop-color"], ha = ["x1", "x2", "y1", "y2", "stroke"], da = ["x1", "x2", "y1", "y2", "stroke"], ya = ["x1", "x2", "y1", "y2", "stroke"], ga = ["x1", "x2", "y1", "y2", "stroke"], ba = ["x", "y", "height", "rx", "width", "fill", "stroke", "stroke-width"], fa = ["x", "y", "width", "rx", "height", "fill", "stroke", "stroke-width"], ma = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], pa = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], xa = ["x", "y", "font-size", "fill", "font-weight"], ka = ["transform", "font-size", "fill", "font-weight"], wa = ["x", "y", "font-size", "fill", "font-weight"], za = { key: 0 }, Ca = ["x", "y", "font-size", "font-weight", "fill"], La = ["x", "y", "font-size", "fill", "font-weight"], _a = { key: 0 }, Sa = ["x", "y", "font-size", "font-weight", "fill"], $a = ["x1", "x2", "y1", "y2", "stroke"], Ma = ["x", "y", "font-size", "font-weight", "fill"], Ta = ["x1", "x2", "y1", "y2", "stroke"], Na = ["font-size", "font-weight", "fill", "text-anchor", "transform"], Ia = { key: 0 }, Oa = { key: 1 }, Pa = ["text-anchor", "font-size", "font-weight", "fill", "transform", "onClick"], Ra = { key: 0 }, Aa = { key: 1 }, Va = ["font-size", "font-weight", "fill", "x", "y", "onClick"], Da = ["x", "y", "width", "height", "onClick", "onMouseenter", "fill"], Ea = ["x", "y", "width", "height", "onClick", "onMouseenter", "fill"], Fa = {
@@ -650,7 +650,7 @@ const ra = ["id"], oa = ["xmlns", "viewBox"], sa = ["x", "y", "width", "height"]
650
650
  e.value.orientation === "vertical" ? (s(!0), i(v, { key: 0 }, f(t.x, (n, u) => (s(), i("rect", {
651
651
  x: n,
652
652
  y: t.y[u] < 0 ? 0 : t.y[u],
653
- height: t.height[u] < 0 ? 1e-4 : t.height[u],
653
+ height: t.height[u] < 0 ? 1e-4 : t.height[u] || 0,
654
654
  rx: e.value.style.chart.bars.borderRadius > t.height[u] / 2 ? (t.height[u] < 0 ? 0 : t.height[u]) / 2 : e.value.style.chart.bars.borderRadius,
655
655
  width: d.value * (1 - e.value.style.chart.bars.gapRatio / 2),
656
656
  fill: e.value.style.chart.bars.gradient.show ? `url(#gradient_${t.id})` : t.color,
@@ -1055,7 +1055,7 @@ const ra = ["id"], oa = ["xmlns", "viewBox"], sa = ["x", "y", "width", "height"]
1055
1055
  }, 8, ["config"])) : h("", !0)
1056
1056
  ], 46, ra));
1057
1057
  }
1058
- }, sl = /* @__PURE__ */ la(Ua, [["__scopeId", "data-v-004effc3"]]);
1058
+ }, sl = /* @__PURE__ */ la(Ua, [["__scopeId", "data-v-41b031bd"]]);
1059
1059
  export {
1060
1060
  sl as default
1061
1061
  };