vue-data-ui 2.4.76 → 2.4.78

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 (152) hide show
  1. package/dist/{Arrow-SYMRLSHC.js → Arrow-C7AmfY-d.js} +1 -1
  2. package/dist/{Arrow-BEL6nGJ5.cjs → Arrow-DbrjRMa6.cjs} +1 -1
  3. package/dist/{BaseIcon-Udj2sWh1.cjs → BaseIcon-CIjjPDqj.cjs} +1 -1
  4. package/dist/{BaseIcon-wfQ35Ioa.js → BaseIcon-Dzpk4O8L.js} +1 -1
  5. package/dist/{DataTable-CC3rD9iV.js → DataTable-DtRXoetj.js} +2 -2
  6. package/dist/{DataTable-RY8EUwF3.cjs → DataTable-wN-jvOfe.cjs} +1 -1
  7. package/dist/{Legend-CZrlsh2W.cjs → Legend-DqGE1lkA.cjs} +1 -1
  8. package/dist/{Legend-BBFx9L7u.js → Legend-RnRqBxiV.js} +2 -2
  9. package/dist/{PackageVersion-Cc8-1SRE.js → PackageVersion-CgJdp_Ki.js} +1 -1
  10. package/dist/{PackageVersion-C1zaH_aJ.cjs → PackageVersion-Dn-t7tbm.cjs} +1 -1
  11. package/dist/{PenAndPaper-BKX-8o1h.js → PenAndPaper-BTLEk55u.js} +3 -3
  12. package/dist/{PenAndPaper-Bv8oV7l0.cjs → PenAndPaper-DFXJJink.cjs} +1 -1
  13. package/dist/{Shape-CSj0rOyf.js → Shape-B1fqUhjt.js} +1 -1
  14. package/dist/{Shape-CuDuYYKF.cjs → Shape-D7IbPjU8.cjs} +1 -1
  15. package/dist/{Slicer-De-C8OB8.cjs → Slicer-8bCK41mN.cjs} +1 -1
  16. package/dist/{Slicer-4vVJHlL9.js → Slicer-GQf9ZyPj.js} +2 -2
  17. package/dist/{Title-m5N0oN0G.cjs → Title-D-6pIV0l.cjs} +1 -1
  18. package/dist/{Title-CmyP_ypC.js → Title-XYNHfYwN.js} +1 -1
  19. package/dist/{Tooltip-Dq7633oz.cjs → Tooltip-CNox4F8U.cjs} +1 -1
  20. package/dist/{Tooltip-Dz6sXvS2.js → Tooltip-DYRo59nq.js} +1 -1
  21. package/dist/{index-CpNLsWVB.js → index-B8Eaq54E.js} +1 -1
  22. package/dist/{index-CH3YkGpv.cjs → index-KJL8ra_6.cjs} +1 -1
  23. package/dist/style.css +1 -1
  24. package/dist/{useNestedProp-2TBYsJKg.cjs → useNestedProp-Bu958azG.cjs} +1 -1
  25. package/dist/{useNestedProp-C14snYQ3.js → useNestedProp-Ka0R_Yqa.js} +1 -1
  26. package/dist/{usePrinter-D76t2otk.js → usePrinter-D83W2gfG.js} +1 -1
  27. package/dist/{usePrinter-A1_US3Dh.cjs → usePrinter-pDOF3CfL.cjs} +1 -1
  28. package/dist/{vue-data-ui-0qqDFsDV.js → vue-data-ui-DgmXnSUU.js} +60 -60
  29. package/dist/{vue-data-ui-C3B3pxcE.cjs → vue-data-ui-Ot5xYhbV.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-DsPyvRtf.cjs → vue-ui-3d-bar-CB0XzatQ.cjs} +1 -1
  33. package/dist/{vue-ui-3d-bar-vXI86Ftg.js → vue-ui-3d-bar-CqiW8qFZ.js} +9 -9
  34. package/dist/{vue-ui-accordion-7RGF7sa1.js → vue-ui-accordion--5td7b94.js} +3 -3
  35. package/dist/{vue-ui-accordion-_LFrGkGx.cjs → vue-ui-accordion-4-dyMgJA.cjs} +1 -1
  36. package/dist/{vue-ui-age-pyramid-CotXvsaD.js → vue-ui-age-pyramid-Bsg0z9ei.js} +10 -10
  37. package/dist/{vue-ui-age-pyramid-ac5bW1yE.cjs → vue-ui-age-pyramid-DNseB8ej.cjs} +1 -1
  38. package/dist/{vue-ui-annotator-LO2QBLr-.cjs → vue-ui-annotator-CHjtF8NT.cjs} +1 -1
  39. package/dist/{vue-ui-annotator-C1RLefPu.js → vue-ui-annotator-obnYFvvq.js} +1 -1
  40. package/dist/{vue-ui-bullet-CngMCn0G.cjs → vue-ui-bullet-CNWHd7dO.cjs} +1 -1
  41. package/dist/{vue-ui-bullet-DZknfpTt.js → vue-ui-bullet-yKEVhE17.js} +8 -8
  42. package/dist/{vue-ui-candlestick-BIhS1XvX.js → vue-ui-candlestick-Cc-Ee4zv.js} +11 -11
  43. package/dist/{vue-ui-candlestick-BrHsZWBD.cjs → vue-ui-candlestick-VBq82rfW.cjs} +1 -1
  44. package/dist/{vue-ui-carousel-table-DQOyjYrs.js → vue-ui-carousel-table-B6v1NycN.js} +4 -4
  45. package/dist/{vue-ui-carousel-table-CEYvDVp-.cjs → vue-ui-carousel-table-DLwVijSb.cjs} +1 -1
  46. package/dist/{vue-ui-chestnut-DOB6e1ur.js → vue-ui-chestnut-CekC1moT.js} +8 -8
  47. package/dist/{vue-ui-chestnut-Ck7UKhm3.cjs → vue-ui-chestnut-DHZbhIf_.cjs} +1 -1
  48. package/dist/{vue-ui-cursor-DbR8dGQz.cjs → vue-ui-cursor-Bz-jVx3a.cjs} +1 -1
  49. package/dist/{vue-ui-cursor-BaFPplLP.js → vue-ui-cursor-CISKzkNu.js} +2 -2
  50. package/dist/{vue-ui-dashboard-BiYrjIXc.cjs → vue-ui-dashboard-PAi8o4AC.cjs} +1 -1
  51. package/dist/{vue-ui-dashboard-CU1IswIu.js → vue-ui-dashboard-w7Ts26Xc.js} +2 -2
  52. package/dist/{vue-ui-digits-LLkWsjVe.cjs → vue-ui-digits-I_lj1m6d.cjs} +1 -1
  53. package/dist/{vue-ui-digits-Ccu0VX39.js → vue-ui-digits-kaBR5FUU.js} +2 -2
  54. package/dist/{vue-ui-donut-BZbOZXBY.js → vue-ui-donut-BVuaExCl.js} +111 -114
  55. package/dist/vue-ui-donut-dDpMdK4G.cjs +1 -0
  56. package/dist/{vue-ui-donut-evolution-BDBugP7m.cjs → vue-ui-donut-evolution-ChGao_WW.cjs} +1 -1
  57. package/dist/{vue-ui-donut-evolution-DtgcRiGo.js → vue-ui-donut-evolution-DAmX1OX-.js} +11 -11
  58. package/dist/{vue-ui-dumbbell-CeWOqVMa.js → vue-ui-dumbbell-CrQNRN_m.js} +10 -10
  59. package/dist/{vue-ui-dumbbell-Dg6X5Vj5.cjs → vue-ui-dumbbell-DsR4RQY9.cjs} +1 -1
  60. package/dist/{vue-ui-flow-CjG35xEC.js → vue-ui-flow-B0lCe4G8.js} +9 -9
  61. package/dist/{vue-ui-flow-CoAgjhdm.cjs → vue-ui-flow-Dhcvvzee.cjs} +1 -1
  62. package/dist/{vue-ui-funnel-hjZrLAhZ.cjs → vue-ui-funnel-Bu_wMJ98.cjs} +1 -1
  63. package/dist/{vue-ui-funnel-D8c4Gp8b.js → vue-ui-funnel-Cinv1hUx.js} +9 -9
  64. package/dist/{vue-ui-galaxy-2WU_lJvz.js → vue-ui-galaxy-BcwunIK3.js} +11 -11
  65. package/dist/{vue-ui-galaxy-DfTXwfQR.cjs → vue-ui-galaxy-zx6O9AuV.cjs} +1 -1
  66. package/dist/{vue-ui-gauge-Bj4H5esH.js → vue-ui-gauge-C4W4OAXQ.js} +7 -7
  67. package/dist/{vue-ui-gauge-C_IgZirr.cjs → vue-ui-gauge-Cb6sxoZI.cjs} +1 -1
  68. package/dist/{vue-ui-gizmo-CFUkIE1e.js → vue-ui-gizmo-D4VHyFmN.js} +3 -3
  69. package/dist/{vue-ui-gizmo-Dbsg9oG_.cjs → vue-ui-gizmo-DBSYx24z.cjs} +1 -1
  70. package/dist/{vue-ui-heatmap-Df4woeNc.js → vue-ui-heatmap-C3WHfifV.js} +10 -10
  71. package/dist/{vue-ui-heatmap-DECng1-9.cjs → vue-ui-heatmap-CBNt4Huo.cjs} +1 -1
  72. package/dist/{vue-ui-history-plot-C0X1_s96.cjs → vue-ui-history-plot-Dp8Llb3A.cjs} +1 -1
  73. package/dist/{vue-ui-history-plot-DHUuanXy.js → vue-ui-history-plot-dJp-Lai2.js} +11 -11
  74. package/dist/{vue-ui-kpi-d5eW2MQ3.js → vue-ui-kpi-B3XhowYx.js} +3 -3
  75. package/dist/{vue-ui-kpi-CGrN8rrL.cjs → vue-ui-kpi-Dnp8IUyb.cjs} +1 -1
  76. package/dist/{vue-ui-mini-loader-C2-zQHTF.cjs → vue-ui-mini-loader-BgwhuEda.cjs} +1 -1
  77. package/dist/{vue-ui-mini-loader-DRUBgzI9.js → vue-ui-mini-loader-Cca7PA4v.js} +2 -2
  78. package/dist/{vue-ui-molecule-Bst8lERC.cjs → vue-ui-molecule-B1AocG3H.cjs} +1 -1
  79. package/dist/{vue-ui-molecule-CqQBdd27.js → vue-ui-molecule-BcZNqWfD.js} +11 -11
  80. package/dist/{vue-ui-mood-radar-BM7pbHlc.cjs → vue-ui-mood-radar-Cn65TQEs.cjs} +1 -1
  81. package/dist/{vue-ui-mood-radar-oB1S4QFm.js → vue-ui-mood-radar-HjLL0ZZ8.js} +11 -11
  82. package/dist/{vue-ui-nested-donuts-DdgoTSGG.js → vue-ui-nested-donuts-BIqySYG_.js} +11 -11
  83. package/dist/{vue-ui-nested-donuts-BUcrd4TR.cjs → vue-ui-nested-donuts-CymFt4B3.cjs} +1 -1
  84. package/dist/{vue-ui-onion-RimU8400.cjs → vue-ui-onion-BLMFR0GK.cjs} +1 -1
  85. package/dist/{vue-ui-onion-BD4CSF0A.js → vue-ui-onion-muCAMEG8.js} +11 -11
  86. package/dist/{vue-ui-parallel-coordinate-plot-CTUm9M3z.js → vue-ui-parallel-coordinate-plot-DYOlnKPw.js} +12 -12
  87. package/dist/{vue-ui-parallel-coordinate-plot-Cj8VtclE.cjs → vue-ui-parallel-coordinate-plot-i-hhfnwF.cjs} +1 -1
  88. package/dist/{vue-ui-quadrant-DjsY0y5B.cjs → vue-ui-quadrant-DJPOp1-A.cjs} +1 -1
  89. package/dist/{vue-ui-quadrant-DKrkCfAn.js → vue-ui-quadrant-TU5fWoEw.js} +12 -12
  90. package/dist/{vue-ui-quick-chart-Dy7EL7ta.cjs → vue-ui-quick-chart-CTJxOisL.cjs} +1 -1
  91. package/dist/{vue-ui-quick-chart-BBCjtI-7.js → vue-ui-quick-chart-DzuUofFN.js} +9 -9
  92. package/dist/{vue-ui-radar-D5ufpNKc.js → vue-ui-radar-C0WA20R8.js} +12 -12
  93. package/dist/{vue-ui-radar-B3SwUPOg.cjs → vue-ui-radar-D4xX7TNQ.cjs} +1 -1
  94. package/dist/{vue-ui-rating-DzjVC24x.cjs → vue-ui-rating-C2JILb2g.cjs} +1 -1
  95. package/dist/{vue-ui-rating-D4G-LFWR.js → vue-ui-rating-DUcyhyrN.js} +2 -2
  96. package/dist/{vue-ui-relation-circle-WkD_rUnu.js → vue-ui-relation-circle-BYlIjbUK.js} +7 -7
  97. package/dist/{vue-ui-relation-circle-1pWCHVnC.cjs → vue-ui-relation-circle-D-Wxskec.cjs} +1 -1
  98. package/dist/{vue-ui-rings-CTYnhWv8.cjs → vue-ui-rings-CsXVOIn3.cjs} +1 -1
  99. package/dist/{vue-ui-rings-C8ty4dWD.js → vue-ui-rings-w4KQSfym.js} +12 -12
  100. package/dist/{vue-ui-scatter-BQVPLg6A.cjs → vue-ui-scatter--5Ob2lKM.cjs} +1 -1
  101. package/dist/{vue-ui-scatter-DfeNfnMl.js → vue-ui-scatter-CfgCA3Di.js} +12 -12
  102. package/dist/{vue-ui-screenshot-D03-LKwV.js → vue-ui-screenshot-BsD3ySuA.js} +1 -1
  103. package/dist/{vue-ui-screenshot-C7lsivHN.cjs → vue-ui-screenshot-UEVUHXWY.cjs} +1 -1
  104. package/dist/{vue-ui-skeleton-DwmP0u2B.cjs → vue-ui-skeleton-D_YCUi1y.cjs} +1 -1
  105. package/dist/{vue-ui-skeleton-CIp8lMA6.js → vue-ui-skeleton-DpadzgbS.js} +3 -3
  106. package/dist/{vue-ui-smiley-_J08wXf9.js → vue-ui-smiley-BHqeb-Ol.js} +2 -2
  107. package/dist/{vue-ui-smiley-Bp-UbI5r.cjs → vue-ui-smiley-C32dLhtP.cjs} +1 -1
  108. package/dist/{vue-ui-spark-trend-UX4dEhft.cjs → vue-ui-spark-trend-Bt2wpc5C.cjs} +1 -1
  109. package/dist/{vue-ui-spark-trend-iXsvKant.js → vue-ui-spark-trend-NAcB2zZ1.js} +5 -5
  110. package/dist/{vue-ui-sparkbar-JQ4SIcqX.js → vue-ui-sparkbar-BPpSxe5Z.js} +4 -4
  111. package/dist/{vue-ui-sparkbar-BJ_rGX_Y.cjs → vue-ui-sparkbar-CgoGRT0_.cjs} +1 -1
  112. package/dist/{vue-ui-sparkgauge-Ci5Jx-i_.js → vue-ui-sparkgauge-C1mW3KbZ.js} +4 -4
  113. package/dist/{vue-ui-sparkgauge-YQBQjjX1.cjs → vue-ui-sparkgauge-frN6uK_L.cjs} +1 -1
  114. package/dist/{vue-ui-sparkhistogram-C5UeFik2.cjs → vue-ui-sparkhistogram-CqQY434G.cjs} +1 -1
  115. package/dist/{vue-ui-sparkhistogram-D1VEZIa5.js → vue-ui-sparkhistogram-HgBi5OvP.js} +5 -5
  116. package/dist/{vue-ui-sparkline-CRFYizW3.js → vue-ui-sparkline-BABBXY2c.js} +4 -4
  117. package/dist/{vue-ui-sparkline-fF9WenrE.cjs → vue-ui-sparkline-XOa6LfX2.cjs} +1 -1
  118. package/dist/{vue-ui-sparkstackbar-CynLB9us.cjs → vue-ui-sparkstackbar-B4Xduiv1.cjs} +1 -1
  119. package/dist/{vue-ui-sparkstackbar-CWa5ELhE.js → vue-ui-sparkstackbar-Ch3JvFBq.js} +5 -5
  120. package/dist/{vue-ui-stackbar-jQdQH0Pu.cjs → vue-ui-stackbar-CH8tLDZq.cjs} +1 -1
  121. package/dist/{vue-ui-stackbar-DSammmJH.js → vue-ui-stackbar-JIEn0g7t.js} +13 -13
  122. package/dist/{vue-ui-strip-plot-yE9w6drR.cjs → vue-ui-strip-plot-BkWzm1mI.cjs} +1 -1
  123. package/dist/{vue-ui-strip-plot-PxONzaXd.js → vue-ui-strip-plot-RZu43QbP.js} +11 -11
  124. package/dist/{vue-ui-table-BskwuS44.js → vue-ui-table-CJ2gGmYi.js} +1 -1
  125. package/dist/{vue-ui-table-DG5RXhLE.cjs → vue-ui-table-CgtE4HWs.cjs} +1 -1
  126. package/dist/{vue-ui-table-heatmap-CzxnV1-0.js → vue-ui-table-heatmap-B_TfeHsa.js} +4 -4
  127. package/dist/{vue-ui-table-heatmap-D9W-4tm9.cjs → vue-ui-table-heatmap-DxTs_PZF.cjs} +1 -1
  128. package/dist/{vue-ui-table-sparkline-BlQy5f88.js → vue-ui-table-sparkline-DqMH7xbY.js} +5 -5
  129. package/dist/{vue-ui-table-sparkline-DT8VzRHY.cjs → vue-ui-table-sparkline-PA9L6AjE.cjs} +1 -1
  130. package/dist/{vue-ui-thermometer-CkJBESoa.cjs → vue-ui-thermometer-AwZdEG3j.cjs} +1 -1
  131. package/dist/{vue-ui-thermometer-BBvQ4tYx.js → vue-ui-thermometer-D7aR0elr.js} +7 -7
  132. package/dist/{vue-ui-timer-CNp59qFF.cjs → vue-ui-timer-C6fnDeD8.cjs} +1 -1
  133. package/dist/{vue-ui-timer-DFvFQF6d.js → vue-ui-timer-C9sO9AoQ.js} +5 -5
  134. package/dist/{vue-ui-tiremarks-Cf1637KV.cjs → vue-ui-tiremarks-Dje0I1vf.cjs} +1 -1
  135. package/dist/{vue-ui-tiremarks-D4_LO9A5.js → vue-ui-tiremarks-KvOyYNVW.js} +7 -7
  136. package/dist/{vue-ui-treemap-CWoi0iKf.js → vue-ui-treemap-BPxLXNZ5.js} +11 -11
  137. package/dist/{vue-ui-treemap-Dnq85nnj.cjs → vue-ui-treemap-C2Vrj3tg.cjs} +1 -1
  138. package/dist/{vue-ui-vertical-bar-DgfIA9-H.js → vue-ui-vertical-bar-BAdSzbYU.js} +12 -12
  139. package/dist/{vue-ui-vertical-bar-pyVFnVaF.cjs → vue-ui-vertical-bar-_MWpPkwZ.cjs} +1 -1
  140. package/dist/{vue-ui-waffle-DQbEdVDN.js → vue-ui-waffle-CW1UVf-q.js} +12 -12
  141. package/dist/{vue-ui-waffle-DGeQNIVJ.cjs → vue-ui-waffle-DfJI5Lez.cjs} +1 -1
  142. package/dist/{vue-ui-wheel-Bhmjjfqi.cjs → vue-ui-wheel-CzZEsjmd.cjs} +1 -1
  143. package/dist/{vue-ui-wheel-B0vgQ4Ps.js → vue-ui-wheel-DAwYc7XY.js} +7 -7
  144. package/dist/{vue-ui-word-cloud-hcJsrwPF.cjs → vue-ui-word-cloud-BEyV6jMo.cjs} +1 -1
  145. package/dist/{vue-ui-word-cloud-XrUyNMpH.js → vue-ui-word-cloud-BzfYkI08.js} +10 -10
  146. package/dist/vue-ui-xy-BolkwiXB.cjs +3 -0
  147. package/dist/{vue-ui-xy--QLh9NlZ.js → vue-ui-xy-CJYGMbMt.js} +610 -609
  148. package/dist/{vue-ui-xy-canvas-DO3kaKEf.cjs → vue-ui-xy-canvas-DkltjVWN.cjs} +1 -1
  149. package/dist/{vue-ui-xy-canvas-mtxLsToQ.js → vue-ui-xy-canvas-sB1dmJQc.js} +11 -11
  150. package/package.json +1 -1
  151. package/dist/vue-ui-donut-DzqE2EQ1.cjs +0 -1
  152. package/dist/vue-ui-xy-B8WkCl69.cjs +0 -3
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-CH3YkGpv.cjs"),_=require("./useNestedProp-2TBYsJKg.cjs"),F=require("./Shape-CuDuYYKF.cjs"),M=require("./vue-ui-skeleton-DwmP0u2B.cjs"),O=require("./PackageVersion-C1zaH_aJ.cjs"),A=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),H={key:0},q={key:1},I=["xmlns","viewBox"],U=["width","height"],W=["id"],j=["stop-color"],P=["stop-color"],G=["id"],T=["stop-color"],X=["stop-color"],Y=["id"],R=["stop-color"],J=["stop-color"],K={key:1},Q=["x","y","height","width","fill","stroke","stroke-width","rx"],Z={key:2},ee=["x","y","font-size","font-weight","fill"],te=["x","y","font-size","fill"],le=["x","y","font-size","fill"],oe=["height","width","x","onMouseover","stroke","stroke-width","rx","stroke-dasharray","onClick"],ae={key:2,ref:"source",dir:"auto"},ne={__name:"vue-ui-sparkhistogram",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(B,{emit:x}){const c=B;e.useCssVars(o=>({"9e84af8a":S.value}));const{vue_ui_sparkhistogram:E}=a.useConfig(),f=e.computed(()=>!!c.dataset&&c.dataset.length);e.onMounted(()=>{k()});function k(){a.objectIsEmpty(c.dataset)?a.error({componentName:"VueUiSparkHistogram",type:"dataset"}):c.dataset.forEach((o,r)=>{a.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["value"]}).forEach(l=>{a.error({componentName:"VueUiSparkHistogram",type:"datasetSerieAttribute",property:l,index:r})})})}const v=e.ref(a.createUid()),t=e.computed({get:()=>b(),set:o=>o});function b(){const o=_.useNestedProp({userConfig:c.config,defaultConfig:E});return o.theme?{..._.useNestedProp({userConfig:a.themes.vue_ui_sparkhistogram[o.theme]||c.config,defaultConfig:o})}:o}e.watch(()=>c.config,o=>{t.value=b(),k()},{deep:!0});const u=e.computed(()=>{const o=t.value.style.layout.height,r=t.value.style.layout.width,l=t.value.style.layout.padding.top,n=o-t.value.style.layout.padding.bottom,d=t.value.style.layout.padding.left,y=r-t.value.style.layout.padding.right,p=l+(o-l-t.value.style.layout.padding.bottom)/2,h=o-t.value.style.layout.padding.top-t.value.style.layout.padding.bottom,m=r-t.value.style.layout.padding.left-t.value.style.layout.padding.right;return{bottom:n,centerY:p,drawingHeight:h,drawingWidth:m,height:o,left:d,right:y,top:l,width:r}}),w=e.computed(()=>Math.max(...c.dataset.map(o=>Math.abs(o.value||0))));function C(o){return Math.abs(o)/w.value}const i=e.computed(()=>c.dataset.map((o,r)=>{const l=C(o.value||0),n=u.value.drawingHeight*l,d=u.value.drawingWidth/c.dataset.length,y=d*(t.value.style.bars.gap/100),p=d-y,h=u.value.centerY-n/2,m=u.value.left+(y/2+r*d),N=u.value.left+r*d,g=typeof o.intensity>"u"?100:Math.round(o.intensity*100),L=o.color?o.color:o.value>=0?a.setOpacity(t.value.style.bars.colors.positive,g):a.setOpacity(t.value.style.bars.colors.negative,g),V=o.color?o.color:o.value>=0?t.value.style.bars.colors.positive:t.value.style.bars.colors.negative,z=o.color?`url(#gradient_datapoint_${r}_${v.value})`:o.value>=0?`url(#gradient_positive_${r}_${v.value})`:`url(#gradient_negative_${r}_${v.value})`,D=m+p/2;return{...o,color:L,gradient:z,height:n,intensity:g,proportion:l,stroke:V,textAnchor:D,trapX:N,unitWidth:d,width:p,x:m,y:h}})),s=e.ref(null);function $(o,r){x("selectDatapoint",{datapoint:o,index:r})}const S=e.computed(()=>`${t.value.style.animation.speedMs}ms`);return(o,r)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`width:100%;background:${t.value.style.backgroundColor};font-family:${t.value.style.fontFamily}`),onMouseleave:r[1]||(r[1]=l=>s.value=null)},[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.createTextVNode(e.toDisplayString(t.value.style.title.text)+" ",1),s.value!==null?(e.openBlock(),e.createElementBlock("span",H,"- "+e.toDisplayString(i.value[s.value].timeLabel||"")+" "+e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.labels.value.formatter,i.value[s.value].value,e.unref(a.dataLabel)({p:t.value.style.labels.value.prefix,v:i.value[s.value].value,s:t.value.style.labels.value.suffix,r:t.value.style.labels.value.rounding}),{datapoint:i.value[s.value],seriesIndex:s.value})),1)):e.createCommentVNode("",!0),![void 0,null].includes(s.value)&&![null,void 0].includes(i.value[s.value].valueLabel)?(e.openBlock(),e.createElementBlock("span",q,"("+e.toDisplayString(i.value[s.value].valueLabel||0)+")",1)):e.createCommentVNode("",!0)],4),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),f.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(a.XMLNS),viewBox:`0 0 ${u.value.width} ${u.value.height}`,style:{overflow:"visible"}},[e.createVNode(O._sfc_main),o.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:u.value.width,height:u.value.height,style:{pointerEvents:"none"}},[e.renderSlot(o.$slots,"chart-background",{},void 0,!0)],8,U)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,n)=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`gradient_positive_${n}_${v.value}`,cy:"50%",cx:"50%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(a.setOpacity)(e.unref(a.shiftHue)(t.value.style.bars.colors.positive,.05),l.intensity)},null,8,j),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(a.setOpacity)(t.value.style.bars.colors.positive,l.intensity)},null,8,P)],8,W))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,n)=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`gradient_negative_${n}_${v.value}`,cy:"50%",cx:"50%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(a.setOpacity)(e.unref(a.shiftHue)(t.value.style.bars.colors.negative,.05),l.intensity)},null,8,T),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(a.setOpacity)(t.value.style.bars.colors.negative,l.intensity)},null,8,X)],8,G))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,n)=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`gradient_datapoint_${n}_${v.value}`,cy:"50%",cx:"50%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(a.setOpacity)(e.unref(a.shiftHue)(l.color,.05),l.intensity)},null,8,R),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(a.setOpacity)(l.color,l.intensity)},null,8,J)],8,Y))),256))]),!t.value.style.bars.shape||t.value.style.bars.shape==="square"?(e.openBlock(),e.createElementBlock("g",K,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,n)=>(e.openBlock(),e.createElementBlock("rect",{x:l.x,y:l.y,height:l.height,width:l.width,fill:t.value.style.bars.colors.gradient.show?l.gradient:l.color,stroke:l.stroke,"stroke-width":t.value.style.bars.strokeWidth,rx:`${t.value.style.bars.borderRadius*l.proportion/12}%`,class:e.normalizeClass({"vue-ui-sparkhistogram-shape":t.value.style.animation.show})},null,10,Q))),256))])):(e.openBlock(),e.createElementBlock("g",Z,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,n)=>(e.openBlock(),e.createBlock(F._sfc_main,{plot:{x:l.x+l.width/2,y:l.y+l.height/2},color:t.value.style.bars.colors.gradient.show?l.gradient:l.color,shape:t.value.style.bars.shape,radius:l.height*.4,class:e.normalizeClass({"vue-ui-sparkhistogram-shape":t.value.style.animation.show})},null,8,["plot","color","shape","radius","class"]))),256))])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,n)=>(e.openBlock(),e.createElementBlock("text",{"text-anchor":"middle",x:l.textAnchor,y:l.y-t.value.style.labels.value.fontSize/3+t.value.style.labels.value.offsetY,"font-size":t.value.style.labels.value.fontSize,"font-weight":t.value.style.labels.value.bold?"bold":"normal",fill:t.value.style.labels.value.color},e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.labels.value.formatter,l.value,e.unref(a.dataLabel)({p:t.value.style.labels.value.prefix,v:l.value,s:t.value.style.labels.value.suffix,r:t.value.style.labels.value.rounding}),{datapoint:i.value[s.value],seriesIndex:s.value})),9,ee))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,n)=>(e.openBlock(),e.createElementBlock("g",null,[l.valueLabel?(e.openBlock(),e.createElementBlock("text",{key:0,x:l.textAnchor,y:l.y+l.height+t.value.style.labels.valueLabel.fontSize,"font-size":t.value.style.labels.valueLabel.fontSize,"text-anchor":"middle",fill:t.value.style.labels.valueLabel.color},e.toDisplayString(l.valueLabel),9,te)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,n)=>(e.openBlock(),e.createElementBlock("g",null,[l.timeLabel?(e.openBlock(),e.createElementBlock("text",{key:0,x:l.textAnchor,y:u.value.height-t.value.style.labels.timeLabel.fontSize/2,"font-size":t.value.style.labels.timeLabel.fontSize,fill:t.value.style.labels.timeLabel.color,"text-anchor":"middle"},e.toDisplayString(l.timeLabel),9,le)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,n)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{height:u.value.height,width:l.unitWidth,fill:"transparent",x:l.trapX,y:0,onMouseover:d=>s.value=n,onMouseleave:r[0]||(r[0]=d=>s.value=null),stroke:s.value!==null&&s.value===n?t.value.style.selector.stroke:"","stroke-width":s.value!==null&&s.value===n?t.value.style.selector.strokeWidth:0,rx:t.value.style.selector.borderRadius,"stroke-dasharray":t.value.style.selector.strokeDasharray,onClick:()=>$(l,n)},null,40,oe)]))),256))],8,I)):e.createCommentVNode("",!0),o.$slots.source?(e.openBlock(),e.createElementBlock("div",ae,[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(M.default,{key:3,config:{type:"sparkHistogram",style:{backgroundColor:t.value.style.backgroundColor,sparkHistogram:{color:"#CCCCCC"}}}},null,8,["config"]))],36))}},se=A._export_sfc(ne,[["__scopeId","data-v-ad438c17"]]);exports.default=se;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-KJL8ra_6.cjs"),_=require("./useNestedProp-Bu958azG.cjs"),F=require("./Shape-D7IbPjU8.cjs"),M=require("./vue-ui-skeleton-D_YCUi1y.cjs"),O=require("./PackageVersion-Dn-t7tbm.cjs"),A=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),H={key:0},q={key:1},I=["xmlns","viewBox"],U=["width","height"],W=["id"],j=["stop-color"],P=["stop-color"],G=["id"],T=["stop-color"],X=["stop-color"],Y=["id"],R=["stop-color"],J=["stop-color"],K={key:1},Q=["x","y","height","width","fill","stroke","stroke-width","rx"],Z={key:2},ee=["x","y","font-size","font-weight","fill"],te=["x","y","font-size","fill"],le=["x","y","font-size","fill"],oe=["height","width","x","onMouseover","stroke","stroke-width","rx","stroke-dasharray","onClick"],ae={key:2,ref:"source",dir:"auto"},ne={__name:"vue-ui-sparkhistogram",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(B,{emit:x}){const c=B;e.useCssVars(o=>({"9e84af8a":S.value}));const{vue_ui_sparkhistogram:E}=a.useConfig(),f=e.computed(()=>!!c.dataset&&c.dataset.length);e.onMounted(()=>{k()});function k(){a.objectIsEmpty(c.dataset)?a.error({componentName:"VueUiSparkHistogram",type:"dataset"}):c.dataset.forEach((o,r)=>{a.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["value"]}).forEach(l=>{a.error({componentName:"VueUiSparkHistogram",type:"datasetSerieAttribute",property:l,index:r})})})}const v=e.ref(a.createUid()),t=e.computed({get:()=>b(),set:o=>o});function b(){const o=_.useNestedProp({userConfig:c.config,defaultConfig:E});return o.theme?{..._.useNestedProp({userConfig:a.themes.vue_ui_sparkhistogram[o.theme]||c.config,defaultConfig:o})}:o}e.watch(()=>c.config,o=>{t.value=b(),k()},{deep:!0});const u=e.computed(()=>{const o=t.value.style.layout.height,r=t.value.style.layout.width,l=t.value.style.layout.padding.top,n=o-t.value.style.layout.padding.bottom,d=t.value.style.layout.padding.left,y=r-t.value.style.layout.padding.right,p=l+(o-l-t.value.style.layout.padding.bottom)/2,h=o-t.value.style.layout.padding.top-t.value.style.layout.padding.bottom,m=r-t.value.style.layout.padding.left-t.value.style.layout.padding.right;return{bottom:n,centerY:p,drawingHeight:h,drawingWidth:m,height:o,left:d,right:y,top:l,width:r}}),w=e.computed(()=>Math.max(...c.dataset.map(o=>Math.abs(o.value||0))));function C(o){return Math.abs(o)/w.value}const i=e.computed(()=>c.dataset.map((o,r)=>{const l=C(o.value||0),n=u.value.drawingHeight*l,d=u.value.drawingWidth/c.dataset.length,y=d*(t.value.style.bars.gap/100),p=d-y,h=u.value.centerY-n/2,m=u.value.left+(y/2+r*d),N=u.value.left+r*d,g=typeof o.intensity>"u"?100:Math.round(o.intensity*100),L=o.color?o.color:o.value>=0?a.setOpacity(t.value.style.bars.colors.positive,g):a.setOpacity(t.value.style.bars.colors.negative,g),V=o.color?o.color:o.value>=0?t.value.style.bars.colors.positive:t.value.style.bars.colors.negative,z=o.color?`url(#gradient_datapoint_${r}_${v.value})`:o.value>=0?`url(#gradient_positive_${r}_${v.value})`:`url(#gradient_negative_${r}_${v.value})`,D=m+p/2;return{...o,color:L,gradient:z,height:n,intensity:g,proportion:l,stroke:V,textAnchor:D,trapX:N,unitWidth:d,width:p,x:m,y:h}})),s=e.ref(null);function $(o,r){x("selectDatapoint",{datapoint:o,index:r})}const S=e.computed(()=>`${t.value.style.animation.speedMs}ms`);return(o,r)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`width:100%;background:${t.value.style.backgroundColor};font-family:${t.value.style.fontFamily}`),onMouseleave:r[1]||(r[1]=l=>s.value=null)},[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.createTextVNode(e.toDisplayString(t.value.style.title.text)+" ",1),s.value!==null?(e.openBlock(),e.createElementBlock("span",H,"- "+e.toDisplayString(i.value[s.value].timeLabel||"")+" "+e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.labels.value.formatter,i.value[s.value].value,e.unref(a.dataLabel)({p:t.value.style.labels.value.prefix,v:i.value[s.value].value,s:t.value.style.labels.value.suffix,r:t.value.style.labels.value.rounding}),{datapoint:i.value[s.value],seriesIndex:s.value})),1)):e.createCommentVNode("",!0),![void 0,null].includes(s.value)&&![null,void 0].includes(i.value[s.value].valueLabel)?(e.openBlock(),e.createElementBlock("span",q,"("+e.toDisplayString(i.value[s.value].valueLabel||0)+")",1)):e.createCommentVNode("",!0)],4),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),f.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(a.XMLNS),viewBox:`0 0 ${u.value.width} ${u.value.height}`,style:{overflow:"visible"}},[e.createVNode(O._sfc_main),o.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:u.value.width,height:u.value.height,style:{pointerEvents:"none"}},[e.renderSlot(o.$slots,"chart-background",{},void 0,!0)],8,U)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,n)=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`gradient_positive_${n}_${v.value}`,cy:"50%",cx:"50%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(a.setOpacity)(e.unref(a.shiftHue)(t.value.style.bars.colors.positive,.05),l.intensity)},null,8,j),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(a.setOpacity)(t.value.style.bars.colors.positive,l.intensity)},null,8,P)],8,W))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,n)=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`gradient_negative_${n}_${v.value}`,cy:"50%",cx:"50%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(a.setOpacity)(e.unref(a.shiftHue)(t.value.style.bars.colors.negative,.05),l.intensity)},null,8,T),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(a.setOpacity)(t.value.style.bars.colors.negative,l.intensity)},null,8,X)],8,G))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,n)=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`gradient_datapoint_${n}_${v.value}`,cy:"50%",cx:"50%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(a.setOpacity)(e.unref(a.shiftHue)(l.color,.05),l.intensity)},null,8,R),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(a.setOpacity)(l.color,l.intensity)},null,8,J)],8,Y))),256))]),!t.value.style.bars.shape||t.value.style.bars.shape==="square"?(e.openBlock(),e.createElementBlock("g",K,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,n)=>(e.openBlock(),e.createElementBlock("rect",{x:l.x,y:l.y,height:l.height,width:l.width,fill:t.value.style.bars.colors.gradient.show?l.gradient:l.color,stroke:l.stroke,"stroke-width":t.value.style.bars.strokeWidth,rx:`${t.value.style.bars.borderRadius*l.proportion/12}%`,class:e.normalizeClass({"vue-ui-sparkhistogram-shape":t.value.style.animation.show})},null,10,Q))),256))])):(e.openBlock(),e.createElementBlock("g",Z,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,n)=>(e.openBlock(),e.createBlock(F._sfc_main,{plot:{x:l.x+l.width/2,y:l.y+l.height/2},color:t.value.style.bars.colors.gradient.show?l.gradient:l.color,shape:t.value.style.bars.shape,radius:l.height*.4,class:e.normalizeClass({"vue-ui-sparkhistogram-shape":t.value.style.animation.show})},null,8,["plot","color","shape","radius","class"]))),256))])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,n)=>(e.openBlock(),e.createElementBlock("text",{"text-anchor":"middle",x:l.textAnchor,y:l.y-t.value.style.labels.value.fontSize/3+t.value.style.labels.value.offsetY,"font-size":t.value.style.labels.value.fontSize,"font-weight":t.value.style.labels.value.bold?"bold":"normal",fill:t.value.style.labels.value.color},e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.labels.value.formatter,l.value,e.unref(a.dataLabel)({p:t.value.style.labels.value.prefix,v:l.value,s:t.value.style.labels.value.suffix,r:t.value.style.labels.value.rounding}),{datapoint:i.value[s.value],seriesIndex:s.value})),9,ee))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,n)=>(e.openBlock(),e.createElementBlock("g",null,[l.valueLabel?(e.openBlock(),e.createElementBlock("text",{key:0,x:l.textAnchor,y:l.y+l.height+t.value.style.labels.valueLabel.fontSize,"font-size":t.value.style.labels.valueLabel.fontSize,"text-anchor":"middle",fill:t.value.style.labels.valueLabel.color},e.toDisplayString(l.valueLabel),9,te)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,n)=>(e.openBlock(),e.createElementBlock("g",null,[l.timeLabel?(e.openBlock(),e.createElementBlock("text",{key:0,x:l.textAnchor,y:u.value.height-t.value.style.labels.timeLabel.fontSize/2,"font-size":t.value.style.labels.timeLabel.fontSize,fill:t.value.style.labels.timeLabel.color,"text-anchor":"middle"},e.toDisplayString(l.timeLabel),9,le)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,n)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{height:u.value.height,width:l.unitWidth,fill:"transparent",x:l.trapX,y:0,onMouseover:d=>s.value=n,onMouseleave:r[0]||(r[0]=d=>s.value=null),stroke:s.value!==null&&s.value===n?t.value.style.selector.stroke:"","stroke-width":s.value!==null&&s.value===n?t.value.style.selector.strokeWidth:0,rx:t.value.style.selector.borderRadius,"stroke-dasharray":t.value.style.selector.strokeDasharray,onClick:()=>$(l,n)},null,40,oe)]))),256))],8,I)):e.createCommentVNode("",!0),o.$slots.source?(e.openBlock(),e.createElementBlock("div",ae,[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(M.default,{key:3,config:{type:"sparkHistogram",style:{backgroundColor:t.value.style.backgroundColor,sparkHistogram:{color:"#CCCCCC"}}}},null,8,["config"]))],36))}},se=A._export_sfc(ne,[["__scopeId","data-v-ad438c17"]]);exports.default=se;
@@ -1,9 +1,9 @@
1
1
  import { useCssVars as K, computed as _, onMounted as Q, ref as N, watch as Z, openBlock as a, createElementBlock as s, normalizeStyle as $, createElementVNode as h, createTextVNode as ee, toDisplayString as p, unref as n, createCommentVNode as c, createVNode as te, renderSlot as D, Fragment as f, renderList as g, normalizeClass as I, createBlock as V } from "vue";
2
- import { u as le, o as ae, e as E, g as se, c as oe, t as ue, s as b, i as H, f as F, X as re, w as z } from "./index-CpNLsWVB.js";
3
- import { u as O } from "./useNestedProp-C14snYQ3.js";
4
- import { _ as ie } from "./Shape-CSj0rOyf.js";
5
- import ne from "./vue-ui-skeleton-CIp8lMA6.js";
6
- import { _ as ve } from "./PackageVersion-Cc8-1SRE.js";
2
+ import { u as le, o as ae, e as E, g as se, c as oe, t as ue, s as b, i as H, f as F, X as re, w as z } from "./index-B8Eaq54E.js";
3
+ import { u as O } from "./useNestedProp-Ka0R_Yqa.js";
4
+ import { _ as ie } from "./Shape-B1fqUhjt.js";
5
+ import ne from "./vue-ui-skeleton-DpadzgbS.js";
6
+ import { _ as ve } from "./PackageVersion-CgJdp_Ki.js";
7
7
  import { _ as de } from "./_plugin-vue_export-helper-CHgC5LLL.js";
8
8
  const ce = { key: 0 }, ye = { key: 1 }, he = ["xmlns", "viewBox"], fe = ["width", "height"], ge = ["id"], pe = ["stop-color"], be = ["stop-color"], me = ["id"], _e = ["stop-color"], xe = ["stop-color"], ke = ["id"], we = ["stop-color"], $e = ["stop-color"], Ce = { key: 1 }, Le = ["x", "y", "height", "width", "fill", "stroke", "stroke-width", "rx"], ze = { key: 2 }, Se = ["x", "y", "font-size", "font-weight", "fill"], Me = ["x", "y", "font-size", "fill"], Ae = ["x", "y", "font-size", "fill"], Ne = ["height", "width", "x", "onMouseover", "stroke", "stroke-width", "rx", "stroke-dasharray", "onClick"], De = {
9
9
  key: 2,
@@ -1,9 +1,9 @@
1
1
  import { computed as c, ref as b, watch as U, onMounted as re, openBlock as r, createElementBlock as i, normalizeStyle as C, renderSlot as M, normalizeProps as ie, guardReactiveProps as de, createElementVNode as f, toDisplayString as X, createCommentVNode as h, unref as v, createVNode as ve, Fragment as D, renderList as P, createBlock as ce } from "vue";
2
- import { u as he, c as ye, t as fe, C as Z, $ as T, o as pe, e as q, g as ge, w as I, a0 as me, a1 as be, X as ke, s as V, R as H, a2 as Y, i as J, f as K } from "./index-CpNLsWVB.js";
3
- import { u as Q } from "./useNestedProp-C14snYQ3.js";
4
- import _e from "./vue-ui-skeleton-CIp8lMA6.js";
2
+ import { u as he, c as ye, t as fe, C as Z, $ as T, o as pe, e as q, g as ge, w as I, a0 as me, a1 as be, X as ke, s as V, R as H, a2 as Y, i as J, f as K } from "./index-B8Eaq54E.js";
3
+ import { u as Q } from "./useNestedProp-Ka0R_Yqa.js";
4
+ import _e from "./vue-ui-skeleton-DpadzgbS.js";
5
5
  import { t as xe, u as we } from "./useResponsive-CoxXLe23.js";
6
- import { _ as $e } from "./PackageVersion-Cc8-1SRE.js";
6
+ import { _ as $e } from "./PackageVersion-CgJdp_Ki.js";
7
7
  import { _ as Le } from "./_plugin-vue_export-helper-CHgC5LLL.js";
8
8
  const Ne = ["id"], Ce = ["xmlns", "viewBox"], Me = ["width", "height"], Ie = ["id"], Ve = ["stop-color"], ze = ["stop-color"], Se = ["id"], We = ["stop-color"], Ae = ["stop-color"], De = ["id"], Pe = ["stop-color"], Te = ["stop-color"], Oe = { key: 1 }, Be = ["d", "fill"], Ee = ["d", "fill"], Fe = ["d", "stroke", "stroke-width"], Ge = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Re = ["x", "y", "width", "height", "fill", "rx"], je = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], Ue = ["x1", "x2", "y1", "y2", "stroke", "stroke-dasharray", "stroke-width"], Xe = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], Ze = ["x", "y", "font-size", "font-weight", "fill"], qe = ["x", "y", "height", "width", "onMouseenter", "onClick"], He = {
9
9
  __name: "vue-ui-sparkline",
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-CH3YkGpv.cjs"),S=require("./useNestedProp-2TBYsJKg.cjs"),q=require("./vue-ui-skeleton-DwmP0u2B.cjs"),P=require("./useResponsive-BJ7DTGpm.cjs"),G=require("./PackageVersion-C1zaH_aJ.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),V=e.ref(null),C=e.ref(null),t=e.computed({get:()=>L(),set:l=>l});function L(){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=L(),$(),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?V.value:null,source:C.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:V,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:e.unref(r.forceValidValue)(_.value,s.value.bottom),y2:e.unref(r.forceValidValue)(_.value,s.value.bottom),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:C,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-401457fb"]]);exports.default=pe;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-KJL8ra_6.cjs"),S=require("./useNestedProp-Bu958azG.cjs"),q=require("./vue-ui-skeleton-D_YCUi1y.cjs"),P=require("./useResponsive-BJ7DTGpm.cjs"),G=require("./PackageVersion-Dn-t7tbm.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),V=e.ref(null),C=e.ref(null),t=e.computed({get:()=>L(),set:l=>l});function L(){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=L(),$(),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?V.value:null,source:C.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:V,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:e.unref(r.forceValidValue)(_.value,s.value.bottom),y2:e.unref(r.forceValidValue)(_.value,s.value.bottom),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:C,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-401457fb"]]);exports.default=pe;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-CH3YkGpv.cjs"),V=require("./useNestedProp-2TBYsJKg.cjs"),q=require("./vue-ui-skeleton-DwmP0u2B.cjs"),O=require("./PackageVersion-C1zaH_aJ.cjs"),U=require("./Tooltip-Dq7633oz.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-KJL8ra_6.cjs"),V=require("./useNestedProp-Bu958azG.cjs"),q=require("./vue-ui-skeleton-D_YCUi1y.cjs"),O=require("./PackageVersion-Dn-t7tbm.cjs"),U=require("./Tooltip-CNox4F8U.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-CpNLsWVB.js";
3
- import { u as ee } from "./useNestedProp-C14snYQ3.js";
4
- import ke from "./vue-ui-skeleton-CIp8lMA6.js";
5
- import { _ as be } from "./PackageVersion-Cc8-1SRE.js";
6
- import { _ as _e } from "./Tooltip-Dz6sXvS2.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-B8Eaq54E.js";
3
+ import { u as ee } from "./useNestedProp-Ka0R_Yqa.js";
4
+ import ke from "./vue-ui-skeleton-DpadzgbS.js";
5
+ import { _ as be } from "./PackageVersion-CgJdp_Ki.js";
6
+ import { _ as _e } from "./Tooltip-DYRo59nq.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,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-CH3YkGpv.cjs"),Ve=require("./useNestedProp-2TBYsJKg.cjs"),Me=require("./useResponsive-BJ7DTGpm.cjs"),Te=require("./usePrinter-A1_US3Dh.cjs"),at=require("./Slicer-De-C8OB8.cjs"),lt=require("./Tooltip-Dq7633oz.cjs"),ot=require("./Title-m5N0oN0G.cjs"),rt=require("./Legend-CZrlsh2W.cjs"),nt=require("./vue-ui-accordion-_LFrGkGx.cjs"),st=require("./DataTable-RY8EUwF3.cjs"),it=require("./vue-ui-skeleton-DwmP0u2B.cjs"),ut=require("./PackageVersion-C1zaH_aJ.cjs"),ct=require("./PenAndPaper-Bv8oV7l0.cjs"),dt=require("./useUserOptionState-BgepsfED.cjs"),ht=require("./Shape-CuDuYYKF.cjs"),vt=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),mt=["id"],gt=["xmlns","viewBox"],yt=["x","y","width","height"],bt={key:1},pt=["id"],ft=["stop-color"],kt=["stop-color"],xt=["stop-color"],Bt=["x1","x2","y1","y2","stroke"],wt=["x1","x2","y1","y2","stroke"],Ct=["x1","x2","y1","y2","stroke"],zt=["x1","x2","y1","y2","stroke"],St={key:0},Lt=["x","y","height","rx","width","fill","stroke","stroke-width"],_t={key:0},Et=["x","y","height","rx","width","fill","stroke","stroke-width"],Nt=["x","y","width","rx","height","fill","stroke","stroke-width"],$t={key:0},Vt=["x","y","width","rx","height","fill","stroke","stroke-width"],Mt=["x1","x2","y1","y2","stroke","stroke-width"],Tt=["x1","x2","y1","y2","stroke","stroke-width"],Pt=["x","y","font-size","fill","font-weight"],Ft=["transform","font-size","fill","font-weight"],It=["x","y","font-size","fill","font-weight"],Rt={key:0},Ot=["x","y","font-size","font-weight","fill"],Dt=["x","y","font-size","fill","font-weight"],At={key:0},Ht=["x","y","font-size","font-weight","fill"],qt=["x1","x2","y1","y2","stroke"],Ut=["x","y","font-size","font-weight","fill"],Wt=["x1","x2","y1","y2","stroke"],Yt=["font-size","font-weight","fill","text-anchor","transform"],Xt={key:0},Gt={key:1},Jt=["text-anchor","font-size","font-weight","fill","transform","onClick"],Zt={key:0},Kt={key:1},Qt=["font-size","font-weight","fill","x","y","onClick"],jt=["x","y","width","height","onClick","onMouseenter","fill"],ea=["x","y","width","height","onClick","onMouseenter","fill"],ta={key:4,class:"vue-data-ui-watermark"},aa=["onClick"],la=["innerHTML"],oa={__name:"vue-ui-stackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint","selectLegend","selectTimeLabel"],setup(G,{expose:Pe,emit:J}){const h=G,{vue_ui_stackbar:Fe}=u.useConfig(),Ie=e.useSlots(),M=e.computed({get(){return!!h.dataset&&h.dataset.length},set(l){return l}}),T=e.ref(null),C=e.ref(u.createUid()),D=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),ne=e.ref(0),A=e.ref(!1),F=e.ref(null),_=e.ref(!1),Re=e.ref(0),Oe=e.ref(0),De=e.ref(0),P=e.ref(null);e.onMounted(()=>{Q()});const t=e.computed({get:()=>ue(),set:l=>l}),{userOptionsVisible:K,setUserOptionsVisibility:se,keepUserOptionState:ie}=dt.useUserOptionState({config:t.value});function ue(){const l=Ve.useNestedProp({userConfig:h.config,defaultConfig:Fe});let o={};return l.theme?o={...Ve.useNestedProp({userConfig:u.themes.vue_ui_stackbar[l.theme]||h.config,defaultConfig:l}),customPalette:u.themePalettes[l.theme]||u.palette}:o=l,h.config&&u.hasDeepProperty(h.config,"style.chart.grid.scale.scaleMin")?o.style.chart.grid.scale.scaleMin=h.config.style.chart.grid.scale.scaleMin:o.style.chart.grid.scale.scaleMin=null,h.config&&u.hasDeepProperty(h.config,"style.chart.grid.scale.scaleMax")?o.style.chart.grid.scale.scaleMax=h.config.style.chart.grid.scale.scaleMax:o.style.chart.grid.scale.scaleMax=null,h.config&&u.hasDeepProperty(h.config,"style.chart.zoom.startIndex")?o.style.chart.zoom.startIndex=h.config.style.chart.zoom.startIndex:o.style.chart.zoom.startIndex=null,h.config&&u.hasDeepProperty(h.config,"style.chart.zoom.endIndex")?o.style.chart.zoom.endIndex=h.config.style.chart.zoom.endIndex:o.style.chart.zoom.endIndex=null,o}e.watch(()=>h.config,l=>{t.value=ue(),K.value=!t.value.showOnChartHover,Q(),Re.value+=1,Oe.value+=1,De.value+=1},{deep:!0}),e.watch(()=>h.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:he,generateImage:ve}=Te.usePrinter({elementId:`stackbar_${C.value}`,fileName:t.value.style.chart.title.text||"vue-ui-stackbar"}),H=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}}),Ae=e.computed(()=>u.convertCustomPalette(t.value.customPalette)),me=e.ref(null),ge=e.ref(null);e.onMounted(()=>{Q()});function Q(){if(u.objectIsEmpty(h.dataset)?u.error({componentName:"VueUiStackbar",type:"dataset"}):h.dataset.forEach((l,o)=>{u.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","series"]}).forEach(a=>{M.value=!1,u.error({componentName:"VueUiStackbar",type:"datasetSerieAttribute",property:a,index:o})})}),setTimeout(()=>{_.value=!0},10),t.value.responsive){const l=Me.throttle(()=>{_.value=!1;const{width:o,height:a}=Me.useResponsive({chart:T.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});H.value.width=o,H.value.height=a,clearTimeout(ge.value),ge.value=setTimeout(()=>{_.value=!0},10)});me.value=new ResizeObserver(l),me.value.observe(T.value.parentNode)}be()}const n=e.computed(()=>{const{height:l,width:o}=H.value,{right:a}=H.value.paddingRatio,r=t.value.style.chart.padding.top,i=o-o*a,s=l-t.value.style.chart.padding.bottom,y=t.value.style.chart.padding.left,E=o-y-o*a,N=l-r-t.value.style.chart.padding.bottom;return{chartHeight:l,chartWidth:o,top:r,right:i,bottom:s,left:y,width:E,height:N<0?0:N}}),z=e.computed(()=>h.dataset.map((l,o)=>{const a=u.convertColorToHex(l.color)||Ae.value[o]||u.palette[o]||u.palette[o%u.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:u.createUid(),color:a}})),S=e.computed(()=>Math.max(...z.value.filter(l=>!p.value.includes(l.id)).map(l=>l.series.length))),c=e.ref({start:0,end:Math.max(...h.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)&&P.value?(t.value.style.chart.zoom.startIndex!==null&&(await e.nextTick(),await e.nextTick(),P.value&&P.value.setStartValue(t.value.style.chart.zoom.startIndex)),t.value.style.chart.zoom.endIndex!==null&&(await e.nextTick(),await e.nextTick(),P.value&&P.value.setEndValue(He(t.value.style.chart.zoom.endIndex+1)))):(c.value={start:0,end:Math.max(...h.dataset.map(l=>l.series.length))},ne.value+=1)}function He(l){const o=Math.max(...h.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=n.value.width/(c.value.end-c.value.start):l=n.value.height/(c.value.end-c.value.start),l<=0?0:l}),I=e.computed(()=>u.sumSeries(z.value.filter(l=>!p.value.includes(l.id))).slice(c.value.start,c.value.end)),qe=e.computed(()=>u.sumSeries(z.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(c.value.start,c.value.end)),q=e.computed(()=>{const l=z.value.filter(o=>!p.value.includes(o.id));return{positive:u.sumSeries(l.map(o=>({...o,series:o.series.slice(c.value.start,c.value.end).map(a=>a>=0?a:0)}))),negative:u.sumSeries(l.map(o=>({...o,series:o.series.slice(c.value.start,c.value.end).map(a=>a<0?a:0)})))}}),B=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(...q.value.positive),o=Math.min(...q.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)?u.calculateNiceScaleWithExactExtremes(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks):u.calculateNiceScale(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks);return r.ticks.map(i=>({zero:n.value.bottom-n.value.height*(Math.abs(r.min)/(r.max+Math.abs(r.min))),y:n.value.bottom-n.value.height*((i+Math.abs(r.min))/(r.max+Math.abs(r.min))),x:n.value.left-8,horizontal_zero:n.value.left+n.value.width*(Math.abs(r.min)/(r.max+Math.abs(r.min))),horizontal_x:n.value.left+n.value.width*((i+Math.abs(r.min))/(r.max+Math.abs(r.min))),horizontal_y:n.value.bottom-8,value:i}))}),L=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(c.value.start,c.value.end)}),g=e.computed(()=>{if(!M.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 i=Math.max(...q.value.positive)||0,s=Math.min(...q.value.negative),y=[-1/0,1/0,NaN,void 0,null].includes(s)?0:s,E=!t.value.style.chart.bars.distributed&&(t.value.style.chart.grid.scale.scaleMax!==null||t.value.style.chart.grid.scale.scaleMin!==null)?u.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:i<0?0:i,t.value.style.chart.grid.scale.ticks):u.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:i<0?0:i,t.value.style.chart.grid.scale.ticks),{min:N,max:R}=E,$=R+(N>=0?0:Math.abs(N))||1,f=n.value.height,X=n.value.width,Ne=B.value[0]?B.value[0].zero:n.value.bottom,$e=B.value[0]?B.value[0].horizontal_zero:n.value.left;return z.value.filter(O=>!p.value.includes(O.id)).map(O=>{const w=O.series.slice(c.value.start,c.value.end),Ge=O.signedSeries.slice(c.value.start,c.value.end),Je=w.map((v,m)=>n.value.left+d.value*m+d.value*t.value.style.chart.bars.gapRatio/4),Ze=w.map((v,m)=>n.value.top+d.value*m+d.value*t.value.style.chart.bars.gapRatio/4),Ke=w.map((v,m)=>{const k=t.value.style.chart.bars.distributed?(v||0)/I.value[m]:(v||0)/$;let V,x;return v>0?(x=f*k,V=Ne-x-l[m],l[m]+=x):(x=f*k,V=Ne+a[m],a[m]+=Math.abs(x)),V}),Qe=w.map((v,m)=>{const k=t.value.style.chart.bars.distributed?(v||0)/I.value[m]:(v||0)/$;let V,x;return v>0?(x=X*k,V=$e+o[m],o[m]+=x):(x=X*k,V=$e-Math.abs(x)-r[m],r[m]+=Math.abs(x)),V}),je=w.map((v,m)=>{const k=t.value.style.chart.bars.distributed?(v||0)/I.value[m]:(v||0)/$;return v>0?f*k:f*Math.abs(k)}),et=w.map((v,m)=>{const k=t.value.style.chart.bars.distributed?(v||0)/I.value[m]:(v||0)/$;return v>0?X*k:X*Math.abs(k)}),tt=w.map(v=>Math.abs(v)).reduce((v,m)=>v+m,0);return{...O,proportions:w.map((v,m)=>t.value.style.chart.bars.distributed?(v||0)/I.value[m]:(v||0)/tt),series:w,signedSeries:Ge,x:Je,y:Ke,height:je,horizontal_width:et,horizontal_y:Ze,horizontal_x:Qe}})}),pe=e.computed(()=>qe.value.map((l,o)=>({value:l,sign:l>=0?1:-1})));function U(l,o,a,r,i){const s=i===-1&&l>=0?-l:l;return u.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,s,u.dataLabel({p:t.value.style.chart.bars.dataLabels.prefix,v:s,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 u.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,l,u.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}));J("selectDatapoint",{datapoint:o,period:L.value[l]})}function xe(l){F.value=l,D.value=!0;const o=t.value.style.chart.tooltip.customFormat,a=JSON.parse(JSON.stringify(g.value)).map(i=>({name:i.name,absoluteIndex:i.absoluteIndex,value:i.series[l]===0?0:(i.signedSeries[l]===-1&&i.series[l]>=0?-i.series[l]:i.series[l])||null,proportion:i.proportions[l]||null,color:i.color,id:i.id})),r=a.map(i=>Math.abs(i.value)).reduce((i,s)=>i+s,0);if(u.isFunction(o)&&u.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:i,showPercentage:s,borderColor:y,roundingValue:E,roundingPercentage:N}=t.value.style.chart.tooltip;let R="";L.value[l]&&L.value[l].text&&t.value.style.chart.tooltip.showTimeLabel&&(R+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${y};padding-bottom:6px;margin-bottom:3px;">${L.value[l].text}</div>`);const $=[i&&s?"(":"",i&&s?")":""];a.reverse().forEach(f=>{R+=`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-KJL8ra_6.cjs"),Ve=require("./useNestedProp-Bu958azG.cjs"),Me=require("./useResponsive-BJ7DTGpm.cjs"),Te=require("./usePrinter-pDOF3CfL.cjs"),at=require("./Slicer-8bCK41mN.cjs"),lt=require("./Tooltip-CNox4F8U.cjs"),ot=require("./Title-D-6pIV0l.cjs"),rt=require("./Legend-DqGE1lkA.cjs"),nt=require("./vue-ui-accordion-4-dyMgJA.cjs"),st=require("./DataTable-wN-jvOfe.cjs"),it=require("./vue-ui-skeleton-D_YCUi1y.cjs"),ut=require("./PackageVersion-Dn-t7tbm.cjs"),ct=require("./PenAndPaper-DFXJJink.cjs"),dt=require("./useUserOptionState-BgepsfED.cjs"),ht=require("./Shape-D7IbPjU8.cjs"),vt=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),mt=["id"],gt=["xmlns","viewBox"],yt=["x","y","width","height"],bt={key:1},pt=["id"],ft=["stop-color"],kt=["stop-color"],xt=["stop-color"],Bt=["x1","x2","y1","y2","stroke"],wt=["x1","x2","y1","y2","stroke"],Ct=["x1","x2","y1","y2","stroke"],zt=["x1","x2","y1","y2","stroke"],St={key:0},Lt=["x","y","height","rx","width","fill","stroke","stroke-width"],_t={key:0},Et=["x","y","height","rx","width","fill","stroke","stroke-width"],Nt=["x","y","width","rx","height","fill","stroke","stroke-width"],$t={key:0},Vt=["x","y","width","rx","height","fill","stroke","stroke-width"],Mt=["x1","x2","y1","y2","stroke","stroke-width"],Tt=["x1","x2","y1","y2","stroke","stroke-width"],Pt=["x","y","font-size","fill","font-weight"],Ft=["transform","font-size","fill","font-weight"],It=["x","y","font-size","fill","font-weight"],Rt={key:0},Ot=["x","y","font-size","font-weight","fill"],Dt=["x","y","font-size","fill","font-weight"],At={key:0},Ht=["x","y","font-size","font-weight","fill"],qt=["x1","x2","y1","y2","stroke"],Ut=["x","y","font-size","font-weight","fill"],Wt=["x1","x2","y1","y2","stroke"],Yt=["font-size","font-weight","fill","text-anchor","transform"],Xt={key:0},Gt={key:1},Jt=["text-anchor","font-size","font-weight","fill","transform","onClick"],Zt={key:0},Kt={key:1},Qt=["font-size","font-weight","fill","x","y","onClick"],jt=["x","y","width","height","onClick","onMouseenter","fill"],ea=["x","y","width","height","onClick","onMouseenter","fill"],ta={key:4,class:"vue-data-ui-watermark"},aa=["onClick"],la=["innerHTML"],oa={__name:"vue-ui-stackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint","selectLegend","selectTimeLabel"],setup(G,{expose:Pe,emit:J}){const h=G,{vue_ui_stackbar:Fe}=u.useConfig(),Ie=e.useSlots(),M=e.computed({get(){return!!h.dataset&&h.dataset.length},set(l){return l}}),T=e.ref(null),C=e.ref(u.createUid()),D=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),ne=e.ref(0),A=e.ref(!1),F=e.ref(null),_=e.ref(!1),Re=e.ref(0),Oe=e.ref(0),De=e.ref(0),P=e.ref(null);e.onMounted(()=>{Q()});const t=e.computed({get:()=>ue(),set:l=>l}),{userOptionsVisible:K,setUserOptionsVisibility:se,keepUserOptionState:ie}=dt.useUserOptionState({config:t.value});function ue(){const l=Ve.useNestedProp({userConfig:h.config,defaultConfig:Fe});let o={};return l.theme?o={...Ve.useNestedProp({userConfig:u.themes.vue_ui_stackbar[l.theme]||h.config,defaultConfig:l}),customPalette:u.themePalettes[l.theme]||u.palette}:o=l,h.config&&u.hasDeepProperty(h.config,"style.chart.grid.scale.scaleMin")?o.style.chart.grid.scale.scaleMin=h.config.style.chart.grid.scale.scaleMin:o.style.chart.grid.scale.scaleMin=null,h.config&&u.hasDeepProperty(h.config,"style.chart.grid.scale.scaleMax")?o.style.chart.grid.scale.scaleMax=h.config.style.chart.grid.scale.scaleMax:o.style.chart.grid.scale.scaleMax=null,h.config&&u.hasDeepProperty(h.config,"style.chart.zoom.startIndex")?o.style.chart.zoom.startIndex=h.config.style.chart.zoom.startIndex:o.style.chart.zoom.startIndex=null,h.config&&u.hasDeepProperty(h.config,"style.chart.zoom.endIndex")?o.style.chart.zoom.endIndex=h.config.style.chart.zoom.endIndex:o.style.chart.zoom.endIndex=null,o}e.watch(()=>h.config,l=>{t.value=ue(),K.value=!t.value.showOnChartHover,Q(),Re.value+=1,Oe.value+=1,De.value+=1},{deep:!0}),e.watch(()=>h.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:he,generateImage:ve}=Te.usePrinter({elementId:`stackbar_${C.value}`,fileName:t.value.style.chart.title.text||"vue-ui-stackbar"}),H=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}}),Ae=e.computed(()=>u.convertCustomPalette(t.value.customPalette)),me=e.ref(null),ge=e.ref(null);e.onMounted(()=>{Q()});function Q(){if(u.objectIsEmpty(h.dataset)?u.error({componentName:"VueUiStackbar",type:"dataset"}):h.dataset.forEach((l,o)=>{u.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","series"]}).forEach(a=>{M.value=!1,u.error({componentName:"VueUiStackbar",type:"datasetSerieAttribute",property:a,index:o})})}),setTimeout(()=>{_.value=!0},10),t.value.responsive){const l=Me.throttle(()=>{_.value=!1;const{width:o,height:a}=Me.useResponsive({chart:T.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});H.value.width=o,H.value.height=a,clearTimeout(ge.value),ge.value=setTimeout(()=>{_.value=!0},10)});me.value=new ResizeObserver(l),me.value.observe(T.value.parentNode)}be()}const n=e.computed(()=>{const{height:l,width:o}=H.value,{right:a}=H.value.paddingRatio,r=t.value.style.chart.padding.top,i=o-o*a,s=l-t.value.style.chart.padding.bottom,y=t.value.style.chart.padding.left,E=o-y-o*a,N=l-r-t.value.style.chart.padding.bottom;return{chartHeight:l,chartWidth:o,top:r,right:i,bottom:s,left:y,width:E,height:N<0?0:N}}),z=e.computed(()=>h.dataset.map((l,o)=>{const a=u.convertColorToHex(l.color)||Ae.value[o]||u.palette[o]||u.palette[o%u.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:u.createUid(),color:a}})),S=e.computed(()=>Math.max(...z.value.filter(l=>!p.value.includes(l.id)).map(l=>l.series.length))),c=e.ref({start:0,end:Math.max(...h.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)&&P.value?(t.value.style.chart.zoom.startIndex!==null&&(await e.nextTick(),await e.nextTick(),P.value&&P.value.setStartValue(t.value.style.chart.zoom.startIndex)),t.value.style.chart.zoom.endIndex!==null&&(await e.nextTick(),await e.nextTick(),P.value&&P.value.setEndValue(He(t.value.style.chart.zoom.endIndex+1)))):(c.value={start:0,end:Math.max(...h.dataset.map(l=>l.series.length))},ne.value+=1)}function He(l){const o=Math.max(...h.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=n.value.width/(c.value.end-c.value.start):l=n.value.height/(c.value.end-c.value.start),l<=0?0:l}),I=e.computed(()=>u.sumSeries(z.value.filter(l=>!p.value.includes(l.id))).slice(c.value.start,c.value.end)),qe=e.computed(()=>u.sumSeries(z.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(c.value.start,c.value.end)),q=e.computed(()=>{const l=z.value.filter(o=>!p.value.includes(o.id));return{positive:u.sumSeries(l.map(o=>({...o,series:o.series.slice(c.value.start,c.value.end).map(a=>a>=0?a:0)}))),negative:u.sumSeries(l.map(o=>({...o,series:o.series.slice(c.value.start,c.value.end).map(a=>a<0?a:0)})))}}),B=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(...q.value.positive),o=Math.min(...q.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)?u.calculateNiceScaleWithExactExtremes(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks):u.calculateNiceScale(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks);return r.ticks.map(i=>({zero:n.value.bottom-n.value.height*(Math.abs(r.min)/(r.max+Math.abs(r.min))),y:n.value.bottom-n.value.height*((i+Math.abs(r.min))/(r.max+Math.abs(r.min))),x:n.value.left-8,horizontal_zero:n.value.left+n.value.width*(Math.abs(r.min)/(r.max+Math.abs(r.min))),horizontal_x:n.value.left+n.value.width*((i+Math.abs(r.min))/(r.max+Math.abs(r.min))),horizontal_y:n.value.bottom-8,value:i}))}),L=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(c.value.start,c.value.end)}),g=e.computed(()=>{if(!M.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 i=Math.max(...q.value.positive)||0,s=Math.min(...q.value.negative),y=[-1/0,1/0,NaN,void 0,null].includes(s)?0:s,E=!t.value.style.chart.bars.distributed&&(t.value.style.chart.grid.scale.scaleMax!==null||t.value.style.chart.grid.scale.scaleMin!==null)?u.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:i<0?0:i,t.value.style.chart.grid.scale.ticks):u.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:i<0?0:i,t.value.style.chart.grid.scale.ticks),{min:N,max:R}=E,$=R+(N>=0?0:Math.abs(N))||1,f=n.value.height,X=n.value.width,Ne=B.value[0]?B.value[0].zero:n.value.bottom,$e=B.value[0]?B.value[0].horizontal_zero:n.value.left;return z.value.filter(O=>!p.value.includes(O.id)).map(O=>{const w=O.series.slice(c.value.start,c.value.end),Ge=O.signedSeries.slice(c.value.start,c.value.end),Je=w.map((v,m)=>n.value.left+d.value*m+d.value*t.value.style.chart.bars.gapRatio/4),Ze=w.map((v,m)=>n.value.top+d.value*m+d.value*t.value.style.chart.bars.gapRatio/4),Ke=w.map((v,m)=>{const k=t.value.style.chart.bars.distributed?(v||0)/I.value[m]:(v||0)/$;let V,x;return v>0?(x=f*k,V=Ne-x-l[m],l[m]+=x):(x=f*k,V=Ne+a[m],a[m]+=Math.abs(x)),V}),Qe=w.map((v,m)=>{const k=t.value.style.chart.bars.distributed?(v||0)/I.value[m]:(v||0)/$;let V,x;return v>0?(x=X*k,V=$e+o[m],o[m]+=x):(x=X*k,V=$e-Math.abs(x)-r[m],r[m]+=Math.abs(x)),V}),je=w.map((v,m)=>{const k=t.value.style.chart.bars.distributed?(v||0)/I.value[m]:(v||0)/$;return v>0?f*k:f*Math.abs(k)}),et=w.map((v,m)=>{const k=t.value.style.chart.bars.distributed?(v||0)/I.value[m]:(v||0)/$;return v>0?X*k:X*Math.abs(k)}),tt=w.map(v=>Math.abs(v)).reduce((v,m)=>v+m,0);return{...O,proportions:w.map((v,m)=>t.value.style.chart.bars.distributed?(v||0)/I.value[m]:(v||0)/tt),series:w,signedSeries:Ge,x:Je,y:Ke,height:je,horizontal_width:et,horizontal_y:Ze,horizontal_x:Qe}})}),pe=e.computed(()=>qe.value.map((l,o)=>({value:l,sign:l>=0?1:-1})));function U(l,o,a,r,i){const s=i===-1&&l>=0?-l:l;return u.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,s,u.dataLabel({p:t.value.style.chart.bars.dataLabels.prefix,v:s,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 u.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,l,u.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}));J("selectDatapoint",{datapoint:o,period:L.value[l]})}function xe(l){F.value=l,D.value=!0;const o=t.value.style.chart.tooltip.customFormat,a=JSON.parse(JSON.stringify(g.value)).map(i=>({name:i.name,absoluteIndex:i.absoluteIndex,value:i.series[l]===0?0:(i.signedSeries[l]===-1&&i.series[l]>=0?-i.series[l]:i.series[l])||null,proportion:i.proportions[l]||null,color:i.color,id:i.id})),r=a.map(i=>Math.abs(i.value)).reduce((i,s)=>i+s,0);if(u.isFunction(o)&&u.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:i,showPercentage:s,borderColor:y,roundingValue:E,roundingPercentage:N}=t.value.style.chart.tooltip;let R="";L.value[l]&&L.value[l].text&&t.value.style.chart.tooltip.showTimeLabel&&(R+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${y};padding-bottom:6px;margin-bottom:3px;">${L.value[l].text}</div>`);const $=[i&&s?"(":"",i&&s?")":""];a.reverse().forEach(f=>{R+=`
2
2
  <div style="display:flex;flex-direction:row;align-items:center;gap:4px">
3
3
  <svg viewBox="0 0 60 60" height="14" width="14"><rect rx="5" x="0" y="0" height="60" width="60" stroke="none" fill="${t.value.style.chart.bars.gradient.show?`url(#gradient_${f.id})`:f.color}"/>${Ie.pattern?`<rect rx="5" x="0" y="0" height="60" width="60" stroke="none" fill="url(#pattern_${C.value}_${f.absoluteIndex})"/>`:""}</svg>
4
4
  ${f.name}${i||s?":":""} ${i?u.dataLabel({p:t.value.style.chart.bars.dataLabels.prefix,v:f.value,s:t.value.style.chart.bars.dataLabels.suffix,r:E}):""} ${$[0]}${s?u.dataLabel({v:isNaN(f.value/r)?0:Math.abs(f.value)/r*100,s:"%",r:N}):""}${$[1]}
@@ -1,19 +1,19 @@
1
1
  import { useSlots as It, computed as w, ref as g, onMounted as et, watch as tt, nextTick as he, openBlock as o, createElementBlock as s, normalizeClass as te, normalizeStyle as U, unref as m, createBlock as Z, createCommentVNode as v, renderSlot as x, createVNode as ae, createSlots as at, withCtx as z, normalizeProps as I, guardReactiveProps as O, Fragment as h, renderList as y, createElementVNode as Y, toDisplayString as $, createTextVNode as Ot } from "vue";
2
- import { u as Pt, c as lt, t as Rt, a as At, p as ve, C as de, b as Vt, o as Dt, e as rt, g as Et, d as Ft, a9 as ye, a5 as ot, D as st, X as Ht, l as Wt, a2 as ge, G as it, f as X, x as nt, i as ut, y as Bt, q as Ut, r as Yt } from "./index-CpNLsWVB.js";
3
- import { u as ct } from "./useNestedProp-C14snYQ3.js";
2
+ import { u as Pt, c as lt, t as Rt, a as At, p as ve, C as de, b as Vt, o as Dt, e as rt, g as Et, d as Ft, a9 as ye, a5 as ot, D as st, X as Ht, l as Wt, a2 as ge, G as it, f as X, x as nt, i as ut, y as Bt, q as Ut, r as Yt } from "./index-B8Eaq54E.js";
3
+ import { u as ct } from "./useNestedProp-Ka0R_Yqa.js";
4
4
  import { t as Xt, u as Gt } from "./useResponsive-CoxXLe23.js";
5
- import { u as Jt, U as qt } from "./usePrinter-D76t2otk.js";
6
- import { S as Zt } from "./Slicer-4vVJHlL9.js";
7
- import { _ as Kt } from "./Tooltip-Dz6sXvS2.js";
8
- import { _ as Qt } from "./Title-CmyP_ypC.js";
9
- import { L as jt } from "./Legend-BBFx9L7u.js";
10
- import ea from "./vue-ui-accordion-7RGF7sa1.js";
11
- import { D as ta } from "./DataTable-CC3rD9iV.js";
12
- import aa from "./vue-ui-skeleton-CIp8lMA6.js";
13
- import { _ as la } from "./PackageVersion-Cc8-1SRE.js";
14
- import { P as ra } from "./PenAndPaper-BKX-8o1h.js";
5
+ import { u as Jt, U as qt } from "./usePrinter-D83W2gfG.js";
6
+ import { S as Zt } from "./Slicer-GQf9ZyPj.js";
7
+ import { _ as Kt } from "./Tooltip-DYRo59nq.js";
8
+ import { _ as Qt } from "./Title-XYNHfYwN.js";
9
+ import { L as jt } from "./Legend-RnRqBxiV.js";
10
+ import ea from "./vue-ui-accordion--5td7b94.js";
11
+ import { D as ta } from "./DataTable-DtRXoetj.js";
12
+ import aa from "./vue-ui-skeleton-DpadzgbS.js";
13
+ import { _ as la } from "./PackageVersion-CgJdp_Ki.js";
14
+ import { P as ra } from "./PenAndPaper-BTLEk55u.js";
15
15
  import { u as oa } from "./useUserOptionState-BIvW1Kz7.js";
16
- import { _ as sa } from "./Shape-CSj0rOyf.js";
16
+ import { _ as sa } from "./Shape-B1fqUhjt.js";
17
17
  import { _ as ia } from "./_plugin-vue_export-helper-CHgC5LLL.js";
18
18
  const na = ["id"], ua = ["xmlns", "viewBox"], ca = ["x", "y", "width", "height"], ha = { key: 1 }, va = ["id"], da = ["stop-color"], ya = ["stop-color"], ga = ["stop-color"], ba = ["x1", "x2", "y1", "y2", "stroke"], fa = ["x1", "x2", "y1", "y2", "stroke"], ma = ["x1", "x2", "y1", "y2", "stroke"], pa = ["x1", "x2", "y1", "y2", "stroke"], xa = { key: 0 }, ka = ["x", "y", "height", "rx", "width", "fill", "stroke", "stroke-width"], wa = { key: 0 }, za = ["x", "y", "height", "rx", "width", "fill", "stroke", "stroke-width"], _a = ["x", "y", "width", "rx", "height", "fill", "stroke", "stroke-width"], Ca = { key: 0 }, La = ["x", "y", "width", "rx", "height", "fill", "stroke", "stroke-width"], Sa = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], $a = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Ma = ["x", "y", "font-size", "fill", "font-weight"], Ta = ["transform", "font-size", "fill", "font-weight"], Na = ["x", "y", "font-size", "fill", "font-weight"], Ia = { key: 0 }, Oa = ["x", "y", "font-size", "font-weight", "fill"], Pa = ["x", "y", "font-size", "fill", "font-weight"], Ra = { key: 0 }, Aa = ["x", "y", "font-size", "font-weight", "fill"], Va = ["x1", "x2", "y1", "y2", "stroke"], Da = ["x", "y", "font-size", "font-weight", "fill"], Ea = ["x1", "x2", "y1", "y2", "stroke"], Fa = ["font-size", "font-weight", "fill", "text-anchor", "transform"], Ha = { key: 0 }, Wa = { key: 1 }, Ba = ["text-anchor", "font-size", "font-weight", "fill", "transform", "onClick"], Ua = { key: 0 }, Ya = { key: 1 }, Xa = ["font-size", "font-weight", "fill", "x", "y", "onClick"], Ga = ["x", "y", "width", "height", "onClick", "onMouseenter", "fill"], Ja = ["x", "y", "width", "height", "onClick", "onMouseenter", "fill"], qa = {
19
19
  key: 4,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-CH3YkGpv.cjs"),ae=require("./useResponsive-BJ7DTGpm.cjs"),ye=require("./Title-m5N0oN0G.cjs"),re=require("./usePrinter-A1_US3Dh.cjs"),be=require("./Tooltip-Dq7633oz.cjs"),ge=require("./DataTable-RY8EUwF3.cjs"),ke=require("./vue-ui-skeleton-DwmP0u2B.cjs"),xe=require("./Shape-CuDuYYKF.cjs"),Ce=require("./vue-ui-accordion-_LFrGkGx.cjs"),se=require("./useNestedProp-2TBYsJKg.cjs"),we=require("./PackageVersion-C1zaH_aJ.cjs"),Be=require("./PenAndPaper-Bv8oV7l0.cjs"),Se=require("./useUserOptionState-BgepsfED.cjs"),Ne=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),$e=["id"],_e=["xmlns","viewBox"],Te=["x","y","width","height"],Le={key:1},Pe={key:0},Ee=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],ze={key:1},Ae=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],Ve=["x1","x2","y1","y2","stroke","stroke-width"],Oe=["x1","x2","y1","y2","stroke","stroke-width"],Fe=["x","y","fill","font-size"],De=["x","y","font-size","fill"],Me=["fill","font-size","transform"],We=["fill","font-size","x","y"],Ie=["x1","x2","y1","y2","stroke"],qe=["cx","cy","fill"],Ge=["cx","cy","fill"],Ue=["id"],Re=["stop-color"],He=["stop-color"],je=["stop-color"],Xe={key:0},Ye=["x","y","font-size","fill"],Je={key:5,class:"vue-data-ui-watermark"},Ke=["innerHTML"],Qe={__name:"vue-ui-strip-plot",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(ne,{expose:ue,emit:ie}){const v=ne,{vue_ui_strip_plot:ce}=r.useConfig(),p=e.computed({get(){return!!v.dataset&&v.dataset.length},set(l){return l}}),L=e.ref(r.createUid()),F=e.ref(0),P=e.ref(!1),E=e.ref(""),y=e.ref(null),D=e.ref(null),M=e.ref(null),W=e.ref(null),I=e.ref(!1),q=e.ref(0),G=e.ref(0),t=e.computed({get:()=>H(),set:l=>l}),{userOptionsVisible:z,setUserOptionsVisibility:U,keepUserOptionState:R}=Se.useUserOptionState({config:t.value});function H(){const l=se.useNestedProp({userConfig:v.config,defaultConfig:ce});return l.theme?{...se.useNestedProp({userConfig:r.themes.vue_ui_strip_plot[l.theme]||v.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}e.watch(()=>v.config,l=>{t.value=H(),z.value=!t.value.showOnChartHover,j(),q.value+=1,G.value+=1},{deep:!0});const C=e.ref(null);e.onMounted(()=>{j()});function j(){if(r.objectIsEmpty(v.dataset)?r.error({componentName:"VueUiStripPlot",type:"dataset"}):v.dataset.forEach((l,s)=>{r.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","plots"]}).forEach(o=>{p.value=!1,r.error({componentName:"VueUiStripPlot",type:"datasetSerieAttribute",property:o,index:s})}),l.plots&&l.plots.forEach((o,n)=>{r.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name","value"]}).forEach(u=>{p.value=!1,r.error({componentName:"VueUiStripPlot",type:"datasetSerieAttribute",property:u,index:`${s},${n}`})})})}),t.value.responsive){const l=ae.throttle(()=>{const{width:s,height:o}=ae.useResponsive({chart:y.value,title:t.value.style.chart.title.text?D.value:null,source:M.value,noTitle:W.value});w.value=o,b.value.width=s,b.value.height=o,x.value=(s-d.value.left-d.value.right)/v.dataset.length,B.value=r.translateSize({relator:Math.min(o,s),adjuster:600,source:t.value.style.chart.plots.radius,threshold:6,fallback:6})});C.value=new ResizeObserver(l),C.value.observe(y.value.parentNode)}I.value=!0,setTimeout(()=>{k.value=!1},de.value*50)}e.onBeforeUnmount(()=>{C.value&&C.value.disconnect()});const{isPrinting:X,isImaging:Y,generatePdf:J,generateImage:K}=re.usePrinter({elementId:`strip-plot_${L.value}`,fileName:t.value.style.chart.title.text||"vue-ui-strip-plot"}),ve=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),Q=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),k=e.ref(t.value.useCssAnimation),c=e.ref({showTable:t.value.table.show,dataLabels:{show:t.value.style.chart.labels.bestPlotLabel.show},showTooltip:t.value.style.chart.tooltip.show}),d=e.ref({top:t.value.style.chart.padding.top,bottom:t.value.style.chart.padding.bottom,left:t.value.style.chart.padding.left,right:t.value.style.chart.padding.right}),x=e.ref(t.value.style.chart.stripWidth),w=e.ref(t.value.style.chart.height),B=e.ref(t.value.style.chart.plots.radius),b=e.ref({width:x.value*v.dataset.length+d.value.left+d.value.right,height:t.value.style.chart.height}),a=e.computed(()=>{const l=x.value*v.dataset.length+d.value.left+d.value.right;return{left:d.value.left,right:l-d.value.right,top:d.value.top,bottom:w.value-d.value.bottom,width:x.value*v.dataset.length,height:w.value-d.value.top-d.value.bottom,stripWidth:x.value,absoluteHeight:w.value,absoluteWidth:l}}),S=e.computed(()=>p.value?v.dataset.map((l,s)=>{const o=r.createUid();return{...l,id:o,color:l.color?r.convertColorToHex(l.color):Q.value[s]||r.palette[s]||r.palette[s%r.palette.length],plots:l.plots.map(n=>({...n,value:r.checkNaN(n.value),parentId:o,color:l.color?r.convertColorToHex(l.color):Q.value[s]||r.palette[s]||r.palette[s%r.palette.length],id:r.createUid()})).sort((n,u)=>n.value-u.value)}}):null),h=e.computed(()=>(S.value||[]).map((l,s)=>({...l,plots:l.plots.map(o=>({...o,x:a.value.left+(s+1)*a.value.stripWidth-a.value.stripWidth/2}))}))),de=e.computed(()=>Math.max(...h.value.map(l=>l.plots.length))),A=e.computed(()=>{const l=h.value.flatMap(s=>s.plots.map(o=>o.value));return{max:Math.max(...l),min:Math.min(...l)}}),m=e.computed(()=>r.calculateNiceScale(A.value.min<0?A.value.min:0,A.value.max,t.value.style.chart.grid.scaleSteps)),he=e.computed(()=>(h.value||[]).map((l,s)=>({...l,plots:l.plots.map(o=>({...o,y:a.value.bottom-(o.value+Math.abs(m.value.min))/(m.value.max+Math.abs(m.value.min))*a.value.height}))}))),Z=e.computed(()=>m.value.ticks.map(l=>({y:a.value.bottom-a.value.height*((l+Math.abs(m.value.min))/(m.value.max+Math.abs(m.value.min))),x1:a.value.left,x2:a.value.right,value:l}))),V=e.ref(null),i=e.ref(null);function pe({datapoint:l,seriesIndex:s}){V.value={datapoint:l,seriesIndex:s,config:t.value,series:S.value},P.value=!0,i.value=l;const o=t.value.style.chart.tooltip.customFormat;if(r.isFunction(o)&&r.functionReturnsString(()=>o({seriesIndex:s,datapoint:l,series:S.value,config:t.value})))E.value=o({seriesIndex:s,datapoint:l,series:S.value,config:t.value});else{let n="";n+=`<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="${t.value.style.chart.plots.gradient.show?`url(#${l.parentId})`:l.color}"/></svg>${l.name}</div>`,n+=`<div>${r.applyDataLabel(t.value.style.chart.labels.formatter,l.value,r.dataLabel({p:t.value.style.chart.labels.prefix,v:l.value,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:l,seriesIndex:s})}</div>`,E.value=`<div>${n}</div>`}}const N=e.computed(()=>{const l=h.value.flatMap(o=>JSON.parse(JSON.stringify(o.plots)).sort((n,u)=>u.value-n.value).map(n=>({name:`${o.name} - ${n.name}`,color:n.color}))),s=h.value.flatMap(o=>JSON.parse(JSON.stringify(o.plots)).sort((n,u)=>u.value-n.value).map(n=>n.value));return{head:l,body:s}});function ee(){e.nextTick(()=>{const l=N.value.head.map((n,u)=>[[n.name],[N.value.body[u]]]),s=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.series],[t.value.table.columnNames.value]]].concat(l),o=r.createCsvContent(s);r.downloadCsv({csvContent:o,title:t.value.style.chart.title.text||"vue-ui-strip-plot"})})}const $=e.computed(()=>{const l=[t.value.table.columnNames.series,t.value.table.columnNames.value],s=N.value.head.map((u,f)=>{const T=r.dataLabel({p:t.value.style.chart.labels.prefix,v:N.value.body[f],s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue});return[{color:u.color,name:u.name},T]}),o={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value],head:l,body:s,config:o}}),g=e.ref(!1);function me(l){g.value=l,F.value+=1}function fe(){return h.value}function te(){c.value.showTable=!c.value.showTable}function le(){c.value.dataLabels.show=!c.value.dataLabels.show}function oe(){c.value.showTooltip=!c.value.showTooltip}const _=e.ref(!1);function O(){_.value=!_.value}return ue({getData:fe,generatePdf:J,generateCsv:ee,generateImage:K,toggleTable:te,toggleLabels:le,toggleTooltip:oe,toggleAnnotator:O}),(l,s)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"stripPlotChart",ref:y,class:e.normalizeClass(`vue-ui-strip-plot ${g.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height:100%":""}`),id:`strip-plot_${L.value}`,onMouseenter:s[2]||(s[2]=()=>e.unref(U)(!0)),onMouseleave:s[3]||(s[3]=()=>e.unref(U)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Be.PenAndPaper,{key:0,parent:y.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:_.value,onClose:O},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),ve.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:W,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:D,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(ye._sfc_main,{key:`title_${q.value}`,config:{title:{cy:"donut-div-title",...t.value.style.chart.title},subtitle:{cy:"donut-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&p.value&&(e.unref(R)||e.unref(z))?(e.openBlock(),e.createBlock(re.UserOptions,{ref:"details",key:`user_option_${F.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(X),isImaging:e.unref(Y),uid:L.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasLabel:t.value.userOptions.buttons.labels,hasFullscreen:t.value.userOptions.buttons.fullscreen,isTooltip:c.value.showTooltip,isFullscreen:g.value,titles:{...t.value.userOptions.buttonTitles},chartElement:y.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:_.value,onToggleFullscreen:me,onGeneratePdf:e.unref(J),onGenerateCsv:ee,onGenerateImage:e.unref(K),onToggleTable:te,onToggleLabels:le,onToggleTooltip:oe,onToggleAnnotator:O,style:e.normalizeStyle({visibility:e.unref(R)?e.unref(z)?"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:o,isFullscreen:n})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:n})),void 0,!0)]),key:"6"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:n})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:n})),void 0,!0)]),key:"7"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasLabel","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":g.value,"vue-data-ui-fulscreen--off":!g.value}),viewBox:`0 0 ${b.value.width<=0?10:b.value.width} ${b.value.height<=0?10:b.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color};`)},[e.createVNode(we._sfc_main),l.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:a.value.left,y:a.value.top,width:a.value.width,height:a.value.height,style:{pointerEvents:"none"}},[e.renderSlot(l.$slots,"chart-background",{},void 0,!0)],8,Te)):e.createCommentVNode("",!0),t.value.style.chart.grid.show?(e.openBlock(),e.createElementBlock("g",Le,[t.value.style.chart.grid.horizontalGrid.show?(e.openBlock(),e.createElementBlock("g",Pe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Z.value,o=>(e.openBlock(),e.createElementBlock("line",{x1:o.x1,x2:o.x2,y1:o.y,y2:o.y,stroke:t.value.style.chart.grid.horizontalGrid.stroke,"stroke-width":t.value.style.chart.grid.horizontalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.horizontalGrid.strokeDasharray,"stroke-linecap":"round"},null,8,Ee))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.verticalGrid.show?(e.openBlock(),e.createElementBlock("g",ze,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,n)=>(e.openBlock(),e.createElementBlock("line",{x1:a.value.left+(n+1)*a.value.stripWidth,x2:a.value.left+(n+1)*a.value.stripWidth,y1:a.value.top,y2:a.value.bottom,stroke:t.value.style.chart.grid.verticalGrid.stroke,"stroke-width":t.value.style.chart.grid.verticalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.verticalGrid.strokeDasharray,"stroke-linecap":"round"},null,8,Ae))),256))])):e.createCommentVNode("",!0),e.createElementVNode("line",{x1:a.value.left,x2:a.value.left,y1:a.value.top,y2:a.value.bottom,stroke:t.value.style.chart.grid.stroke,"stroke-width":t.value.style.chart.grid.strokeWidth,"stroke-linecap":"round"},null,8,Ve),e.createElementVNode("line",{x1:a.value.left,x2:a.value.right,y1:a.value.bottom,y2:a.value.bottom,stroke:t.value.style.chart.grid.stroke,"stroke-width":t.value.style.chart.grid.strokeWidth,"stroke-linecap":"round"},null,8,Oe)])):e.createCommentVNode("",!0),t.value.style.chart.labels.yAxisLabels.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(Z.value,(o,n)=>(e.openBlock(),e.createElementBlock("text",{x:o.x1-t.value.style.chart.labels.yAxisLabels.fontSize/2+t.value.style.chart.labels.yAxisLabels.offsetX,y:o.y+t.value.style.chart.labels.yAxisLabels.fontSize/3,fill:t.value.style.chart.labels.yAxisLabels.color,"font-size":t.value.style.chart.labels.yAxisLabels.fontSize,"text-anchor":"end"},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.labels.formatter,o.value,e.unref(r.dataLabel)({p:t.value.style.chart.labels.prefix,v:o.value,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.labels.yAxisLabels.rounding}),{datapoint:o,seriesIndex:n})),9,Fe))),256)):e.createCommentVNode("",!0),t.value.style.chart.labels.xAxisLabels.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:3},e.renderList(h.value,(o,n)=>(e.openBlock(),e.createElementBlock("text",{x:a.value.left+(n+1)*a.value.stripWidth-a.value.stripWidth/2,y:a.value.bottom+t.value.style.chart.labels.xAxisLabels.fontSize*2+t.value.style.chart.labels.xAxisLabels.offsetY,"font-size":t.value.style.chart.labels.xAxisLabels.fontSize,fill:t.value.style.chart.labels.xAxisLabels.color,"text-anchor":"middle"},e.toDisplayString(o.name),9,De))),256)):e.createCommentVNode("",!0),t.value.style.chart.labels.axis.yLabel?(e.openBlock(),e.createElementBlock("text",{key:4,fill:t.value.style.chart.labels.axis.color,"font-size":t.value.style.chart.labels.axis.fontSize,transform:`translate(${t.value.style.chart.labels.axis.fontSize+t.value.style.chart.labels.axis.yLabelOffsetX}, ${a.value.top+a.value.height/2}) rotate(-90)`,"text-anchor":"middle"},e.toDisplayString(t.value.style.chart.labels.axis.yLabel),9,Me)):e.createCommentVNode("",!0),t.value.style.chart.labels.axis.xLabel?(e.openBlock(),e.createElementBlock("text",{key:5,fill:t.value.style.chart.labels.axis.color,"font-size":t.value.style.chart.labels.axis.fontSize,x:a.value.left+a.value.width/2,y:a.value.absoluteHeight,"text-anchor":"middle"},e.toDisplayString(t.value.style.chart.labels.axis.xLabel),9,We)):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:6},[e.createElementVNode("line",{x1:a.value.left,x2:a.value.right,y1:i.value.y,y2:i.value.y,stroke:i.value.color,"stroke-width":1,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,Ie),e.createElementVNode("circle",{cx:a.value.left,cy:i.value.y,r:3,fill:i.value.color,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,qe),e.createElementVNode("circle",{cx:a.value.right,cy:i.value.y,r:3,fill:i.value.color,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,Ge)],64)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,o=>(e.openBlock(),e.createElementBlock("radialGradient",{id:o.id,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(r.lightenHexColor)(o.color,t.value.style.chart.plots.gradient.intensity/100)},null,8,Re),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(r.darkenHexColor)(o.color,.1)},null,8,He),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,je)],8,Ue))),256))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(he.value,(o,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.plots,(u,f)=>(e.openBlock(),e.createBlock(xe._sfc_main,e.mergeProps({plot:{x:u.x,y:I.value?u.y:a.value.top},radius:i.value&&i.value.id===u.id?B.value*1.5:B.value,shape:t.value.style.chart.plots.shape,stroke:t.value.style.chart.plots.stroke,strokeWidth:t.value.style.chart.plots.strokeWidth,color:t.value.style.chart.plots.gradient.show?`url(#${o.id})`:o.color,onMouseenter:T=>pe({datapoint:u,seriesIndex:f}),onMouseleave:s[0]||(s[0]=T=>{P.value=!1,i.value=null}),onClick:T=>ie("selectDatapoint",u),style:`transition: all 0.2s ease-in-out; opacity:${i.value?i.value.id===u.id?1:.2:t.value.style.chart.plots.opacity};${k.value?`transition-delay:${f*50}ms`:""}`,class:{"vue-ui-strip-plot-animated":t.value.useCssAnimation&&k.value,"vue-ui-strip-plot-select-circle":t.value.useCssAnimation&&!k.value}},l.$attrs),null,16,["plot","radius","shape","stroke","strokeWidth","color","onMouseenter","onClick","style","class"]))),256)),c.value.dataLabels.show?(e.openBlock(),e.createElementBlock("g",Xe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.plots,(u,f)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[f===o.plots.length-1||i.value&&i.value.id===u.id&&!c.value.showTooltip?(e.openBlock(),e.createElementBlock("text",{key:0,x:u.x,y:u.y+t.value.style.chart.labels.bestPlotLabel.offsetY-B.value*(i.value&&i.value.id===u.id&&!c.value.showTooltip?2:1.5),"font-size":t.value.style.chart.labels.bestPlotLabel.fontSize,fill:t.value.style.chart.labels.bestPlotLabel.color,"text-anchor":"middle",style:e.normalizeStyle(`opacity:${t.value.useCssAnimation&&k.value?0:1};transition:opacity 0.2s ease-in;`)},e.toDisplayString(u.name)+" "+e.toDisplayString(t.value.style.chart.labels.bestPlotLabel.showValue?e.unref(r.applyDataLabel)(t.value.style.chart.labels.formatter,u.value,e.unref(r.dataLabel)({p:`(${t.value.style.chart.labels.prefix}`,v:u.value,s:`${t.value.style.chart.labels.suffix})`,r:t.value.style.chart.labels.bestPlotLabel.rounding}),{datapoint:u,seriesIndex:f}):""),13,Ye)):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0)],64))),256)),e.renderSlot(l.$slots,"svg",{svg:a.value},void 0,!0)],14,_e)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Je,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(X)||e.unref(Y)})),void 0,!0)])):e.createCommentVNode("",!0),p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ke.default,{key:6,config:{type:"stripPlot",style:{backgroundColor:t.value.style.chart.backgroundColor,stripPlot:{color:"#CCCCCC"}}}},null,8,["config"])),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:M,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(be._sfc_main,{show:c.value.showTooltip&&P.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,fontSize:t.value.style.chart.tooltip.fontSize,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:y.value,content:E.value,isFullscreen:g.value,isCustom:e.unref(r.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...V.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...V.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isFullscreen","isCustom"]),p.value?(e.openBlock(),e.createBlock(Ce.default,{key:8,hideDetails:"",config:{open:c.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(ge.DataTable,{key:`table_${G.value}`,colNames:$.value.colNames,head:$.value.head,body:$.value.body,config:$.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:s[1]||(s[1]=o=>c.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,Ke)]),td:e.withCtx(({td:o})=>[e.createTextVNode(e.toDisplayString(o.name||o),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,$e))}},Ze=Ne._export_sfc(Qe,[["__scopeId","data-v-375e8dc0"]]);exports.default=Ze;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-KJL8ra_6.cjs"),ae=require("./useResponsive-BJ7DTGpm.cjs"),ye=require("./Title-D-6pIV0l.cjs"),re=require("./usePrinter-pDOF3CfL.cjs"),be=require("./Tooltip-CNox4F8U.cjs"),ge=require("./DataTable-wN-jvOfe.cjs"),ke=require("./vue-ui-skeleton-D_YCUi1y.cjs"),xe=require("./Shape-D7IbPjU8.cjs"),Ce=require("./vue-ui-accordion-4-dyMgJA.cjs"),se=require("./useNestedProp-Bu958azG.cjs"),we=require("./PackageVersion-Dn-t7tbm.cjs"),Be=require("./PenAndPaper-DFXJJink.cjs"),Se=require("./useUserOptionState-BgepsfED.cjs"),Ne=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),$e=["id"],_e=["xmlns","viewBox"],Te=["x","y","width","height"],Le={key:1},Pe={key:0},Ee=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],ze={key:1},Ae=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],Ve=["x1","x2","y1","y2","stroke","stroke-width"],Oe=["x1","x2","y1","y2","stroke","stroke-width"],Fe=["x","y","fill","font-size"],De=["x","y","font-size","fill"],Me=["fill","font-size","transform"],We=["fill","font-size","x","y"],Ie=["x1","x2","y1","y2","stroke"],qe=["cx","cy","fill"],Ge=["cx","cy","fill"],Ue=["id"],Re=["stop-color"],He=["stop-color"],je=["stop-color"],Xe={key:0},Ye=["x","y","font-size","fill"],Je={key:5,class:"vue-data-ui-watermark"},Ke=["innerHTML"],Qe={__name:"vue-ui-strip-plot",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(ne,{expose:ue,emit:ie}){const v=ne,{vue_ui_strip_plot:ce}=r.useConfig(),p=e.computed({get(){return!!v.dataset&&v.dataset.length},set(l){return l}}),L=e.ref(r.createUid()),F=e.ref(0),P=e.ref(!1),E=e.ref(""),y=e.ref(null),D=e.ref(null),M=e.ref(null),W=e.ref(null),I=e.ref(!1),q=e.ref(0),G=e.ref(0),t=e.computed({get:()=>H(),set:l=>l}),{userOptionsVisible:z,setUserOptionsVisibility:U,keepUserOptionState:R}=Se.useUserOptionState({config:t.value});function H(){const l=se.useNestedProp({userConfig:v.config,defaultConfig:ce});return l.theme?{...se.useNestedProp({userConfig:r.themes.vue_ui_strip_plot[l.theme]||v.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}e.watch(()=>v.config,l=>{t.value=H(),z.value=!t.value.showOnChartHover,j(),q.value+=1,G.value+=1},{deep:!0});const C=e.ref(null);e.onMounted(()=>{j()});function j(){if(r.objectIsEmpty(v.dataset)?r.error({componentName:"VueUiStripPlot",type:"dataset"}):v.dataset.forEach((l,s)=>{r.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","plots"]}).forEach(o=>{p.value=!1,r.error({componentName:"VueUiStripPlot",type:"datasetSerieAttribute",property:o,index:s})}),l.plots&&l.plots.forEach((o,n)=>{r.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name","value"]}).forEach(u=>{p.value=!1,r.error({componentName:"VueUiStripPlot",type:"datasetSerieAttribute",property:u,index:`${s},${n}`})})})}),t.value.responsive){const l=ae.throttle(()=>{const{width:s,height:o}=ae.useResponsive({chart:y.value,title:t.value.style.chart.title.text?D.value:null,source:M.value,noTitle:W.value});w.value=o,b.value.width=s,b.value.height=o,x.value=(s-d.value.left-d.value.right)/v.dataset.length,B.value=r.translateSize({relator:Math.min(o,s),adjuster:600,source:t.value.style.chart.plots.radius,threshold:6,fallback:6})});C.value=new ResizeObserver(l),C.value.observe(y.value.parentNode)}I.value=!0,setTimeout(()=>{k.value=!1},de.value*50)}e.onBeforeUnmount(()=>{C.value&&C.value.disconnect()});const{isPrinting:X,isImaging:Y,generatePdf:J,generateImage:K}=re.usePrinter({elementId:`strip-plot_${L.value}`,fileName:t.value.style.chart.title.text||"vue-ui-strip-plot"}),ve=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),Q=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),k=e.ref(t.value.useCssAnimation),c=e.ref({showTable:t.value.table.show,dataLabels:{show:t.value.style.chart.labels.bestPlotLabel.show},showTooltip:t.value.style.chart.tooltip.show}),d=e.ref({top:t.value.style.chart.padding.top,bottom:t.value.style.chart.padding.bottom,left:t.value.style.chart.padding.left,right:t.value.style.chart.padding.right}),x=e.ref(t.value.style.chart.stripWidth),w=e.ref(t.value.style.chart.height),B=e.ref(t.value.style.chart.plots.radius),b=e.ref({width:x.value*v.dataset.length+d.value.left+d.value.right,height:t.value.style.chart.height}),a=e.computed(()=>{const l=x.value*v.dataset.length+d.value.left+d.value.right;return{left:d.value.left,right:l-d.value.right,top:d.value.top,bottom:w.value-d.value.bottom,width:x.value*v.dataset.length,height:w.value-d.value.top-d.value.bottom,stripWidth:x.value,absoluteHeight:w.value,absoluteWidth:l}}),S=e.computed(()=>p.value?v.dataset.map((l,s)=>{const o=r.createUid();return{...l,id:o,color:l.color?r.convertColorToHex(l.color):Q.value[s]||r.palette[s]||r.palette[s%r.palette.length],plots:l.plots.map(n=>({...n,value:r.checkNaN(n.value),parentId:o,color:l.color?r.convertColorToHex(l.color):Q.value[s]||r.palette[s]||r.palette[s%r.palette.length],id:r.createUid()})).sort((n,u)=>n.value-u.value)}}):null),h=e.computed(()=>(S.value||[]).map((l,s)=>({...l,plots:l.plots.map(o=>({...o,x:a.value.left+(s+1)*a.value.stripWidth-a.value.stripWidth/2}))}))),de=e.computed(()=>Math.max(...h.value.map(l=>l.plots.length))),A=e.computed(()=>{const l=h.value.flatMap(s=>s.plots.map(o=>o.value));return{max:Math.max(...l),min:Math.min(...l)}}),m=e.computed(()=>r.calculateNiceScale(A.value.min<0?A.value.min:0,A.value.max,t.value.style.chart.grid.scaleSteps)),he=e.computed(()=>(h.value||[]).map((l,s)=>({...l,plots:l.plots.map(o=>({...o,y:a.value.bottom-(o.value+Math.abs(m.value.min))/(m.value.max+Math.abs(m.value.min))*a.value.height}))}))),Z=e.computed(()=>m.value.ticks.map(l=>({y:a.value.bottom-a.value.height*((l+Math.abs(m.value.min))/(m.value.max+Math.abs(m.value.min))),x1:a.value.left,x2:a.value.right,value:l}))),V=e.ref(null),i=e.ref(null);function pe({datapoint:l,seriesIndex:s}){V.value={datapoint:l,seriesIndex:s,config:t.value,series:S.value},P.value=!0,i.value=l;const o=t.value.style.chart.tooltip.customFormat;if(r.isFunction(o)&&r.functionReturnsString(()=>o({seriesIndex:s,datapoint:l,series:S.value,config:t.value})))E.value=o({seriesIndex:s,datapoint:l,series:S.value,config:t.value});else{let n="";n+=`<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="${t.value.style.chart.plots.gradient.show?`url(#${l.parentId})`:l.color}"/></svg>${l.name}</div>`,n+=`<div>${r.applyDataLabel(t.value.style.chart.labels.formatter,l.value,r.dataLabel({p:t.value.style.chart.labels.prefix,v:l.value,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:l,seriesIndex:s})}</div>`,E.value=`<div>${n}</div>`}}const N=e.computed(()=>{const l=h.value.flatMap(o=>JSON.parse(JSON.stringify(o.plots)).sort((n,u)=>u.value-n.value).map(n=>({name:`${o.name} - ${n.name}`,color:n.color}))),s=h.value.flatMap(o=>JSON.parse(JSON.stringify(o.plots)).sort((n,u)=>u.value-n.value).map(n=>n.value));return{head:l,body:s}});function ee(){e.nextTick(()=>{const l=N.value.head.map((n,u)=>[[n.name],[N.value.body[u]]]),s=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.series],[t.value.table.columnNames.value]]].concat(l),o=r.createCsvContent(s);r.downloadCsv({csvContent:o,title:t.value.style.chart.title.text||"vue-ui-strip-plot"})})}const $=e.computed(()=>{const l=[t.value.table.columnNames.series,t.value.table.columnNames.value],s=N.value.head.map((u,f)=>{const T=r.dataLabel({p:t.value.style.chart.labels.prefix,v:N.value.body[f],s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue});return[{color:u.color,name:u.name},T]}),o={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value],head:l,body:s,config:o}}),g=e.ref(!1);function me(l){g.value=l,F.value+=1}function fe(){return h.value}function te(){c.value.showTable=!c.value.showTable}function le(){c.value.dataLabels.show=!c.value.dataLabels.show}function oe(){c.value.showTooltip=!c.value.showTooltip}const _=e.ref(!1);function O(){_.value=!_.value}return ue({getData:fe,generatePdf:J,generateCsv:ee,generateImage:K,toggleTable:te,toggleLabels:le,toggleTooltip:oe,toggleAnnotator:O}),(l,s)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"stripPlotChart",ref:y,class:e.normalizeClass(`vue-ui-strip-plot ${g.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height:100%":""}`),id:`strip-plot_${L.value}`,onMouseenter:s[2]||(s[2]=()=>e.unref(U)(!0)),onMouseleave:s[3]||(s[3]=()=>e.unref(U)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Be.PenAndPaper,{key:0,parent:y.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:_.value,onClose:O},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),ve.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:W,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:D,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(ye._sfc_main,{key:`title_${q.value}`,config:{title:{cy:"donut-div-title",...t.value.style.chart.title},subtitle:{cy:"donut-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&p.value&&(e.unref(R)||e.unref(z))?(e.openBlock(),e.createBlock(re.UserOptions,{ref:"details",key:`user_option_${F.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(X),isImaging:e.unref(Y),uid:L.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasLabel:t.value.userOptions.buttons.labels,hasFullscreen:t.value.userOptions.buttons.fullscreen,isTooltip:c.value.showTooltip,isFullscreen:g.value,titles:{...t.value.userOptions.buttonTitles},chartElement:y.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:_.value,onToggleFullscreen:me,onGeneratePdf:e.unref(J),onGenerateCsv:ee,onGenerateImage:e.unref(K),onToggleTable:te,onToggleLabels:le,onToggleTooltip:oe,onToggleAnnotator:O,style:e.normalizeStyle({visibility:e.unref(R)?e.unref(z)?"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:o,isFullscreen:n})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:n})),void 0,!0)]),key:"6"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:n})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:n})),void 0,!0)]),key:"7"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasLabel","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":g.value,"vue-data-ui-fulscreen--off":!g.value}),viewBox:`0 0 ${b.value.width<=0?10:b.value.width} ${b.value.height<=0?10:b.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color};`)},[e.createVNode(we._sfc_main),l.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:a.value.left,y:a.value.top,width:a.value.width,height:a.value.height,style:{pointerEvents:"none"}},[e.renderSlot(l.$slots,"chart-background",{},void 0,!0)],8,Te)):e.createCommentVNode("",!0),t.value.style.chart.grid.show?(e.openBlock(),e.createElementBlock("g",Le,[t.value.style.chart.grid.horizontalGrid.show?(e.openBlock(),e.createElementBlock("g",Pe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Z.value,o=>(e.openBlock(),e.createElementBlock("line",{x1:o.x1,x2:o.x2,y1:o.y,y2:o.y,stroke:t.value.style.chart.grid.horizontalGrid.stroke,"stroke-width":t.value.style.chart.grid.horizontalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.horizontalGrid.strokeDasharray,"stroke-linecap":"round"},null,8,Ee))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.verticalGrid.show?(e.openBlock(),e.createElementBlock("g",ze,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,n)=>(e.openBlock(),e.createElementBlock("line",{x1:a.value.left+(n+1)*a.value.stripWidth,x2:a.value.left+(n+1)*a.value.stripWidth,y1:a.value.top,y2:a.value.bottom,stroke:t.value.style.chart.grid.verticalGrid.stroke,"stroke-width":t.value.style.chart.grid.verticalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.verticalGrid.strokeDasharray,"stroke-linecap":"round"},null,8,Ae))),256))])):e.createCommentVNode("",!0),e.createElementVNode("line",{x1:a.value.left,x2:a.value.left,y1:a.value.top,y2:a.value.bottom,stroke:t.value.style.chart.grid.stroke,"stroke-width":t.value.style.chart.grid.strokeWidth,"stroke-linecap":"round"},null,8,Ve),e.createElementVNode("line",{x1:a.value.left,x2:a.value.right,y1:a.value.bottom,y2:a.value.bottom,stroke:t.value.style.chart.grid.stroke,"stroke-width":t.value.style.chart.grid.strokeWidth,"stroke-linecap":"round"},null,8,Oe)])):e.createCommentVNode("",!0),t.value.style.chart.labels.yAxisLabels.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(Z.value,(o,n)=>(e.openBlock(),e.createElementBlock("text",{x:o.x1-t.value.style.chart.labels.yAxisLabels.fontSize/2+t.value.style.chart.labels.yAxisLabels.offsetX,y:o.y+t.value.style.chart.labels.yAxisLabels.fontSize/3,fill:t.value.style.chart.labels.yAxisLabels.color,"font-size":t.value.style.chart.labels.yAxisLabels.fontSize,"text-anchor":"end"},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.labels.formatter,o.value,e.unref(r.dataLabel)({p:t.value.style.chart.labels.prefix,v:o.value,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.labels.yAxisLabels.rounding}),{datapoint:o,seriesIndex:n})),9,Fe))),256)):e.createCommentVNode("",!0),t.value.style.chart.labels.xAxisLabels.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:3},e.renderList(h.value,(o,n)=>(e.openBlock(),e.createElementBlock("text",{x:a.value.left+(n+1)*a.value.stripWidth-a.value.stripWidth/2,y:a.value.bottom+t.value.style.chart.labels.xAxisLabels.fontSize*2+t.value.style.chart.labels.xAxisLabels.offsetY,"font-size":t.value.style.chart.labels.xAxisLabels.fontSize,fill:t.value.style.chart.labels.xAxisLabels.color,"text-anchor":"middle"},e.toDisplayString(o.name),9,De))),256)):e.createCommentVNode("",!0),t.value.style.chart.labels.axis.yLabel?(e.openBlock(),e.createElementBlock("text",{key:4,fill:t.value.style.chart.labels.axis.color,"font-size":t.value.style.chart.labels.axis.fontSize,transform:`translate(${t.value.style.chart.labels.axis.fontSize+t.value.style.chart.labels.axis.yLabelOffsetX}, ${a.value.top+a.value.height/2}) rotate(-90)`,"text-anchor":"middle"},e.toDisplayString(t.value.style.chart.labels.axis.yLabel),9,Me)):e.createCommentVNode("",!0),t.value.style.chart.labels.axis.xLabel?(e.openBlock(),e.createElementBlock("text",{key:5,fill:t.value.style.chart.labels.axis.color,"font-size":t.value.style.chart.labels.axis.fontSize,x:a.value.left+a.value.width/2,y:a.value.absoluteHeight,"text-anchor":"middle"},e.toDisplayString(t.value.style.chart.labels.axis.xLabel),9,We)):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:6},[e.createElementVNode("line",{x1:a.value.left,x2:a.value.right,y1:i.value.y,y2:i.value.y,stroke:i.value.color,"stroke-width":1,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,Ie),e.createElementVNode("circle",{cx:a.value.left,cy:i.value.y,r:3,fill:i.value.color,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,qe),e.createElementVNode("circle",{cx:a.value.right,cy:i.value.y,r:3,fill:i.value.color,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,Ge)],64)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,o=>(e.openBlock(),e.createElementBlock("radialGradient",{id:o.id,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(r.lightenHexColor)(o.color,t.value.style.chart.plots.gradient.intensity/100)},null,8,Re),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(r.darkenHexColor)(o.color,.1)},null,8,He),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,je)],8,Ue))),256))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(he.value,(o,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.plots,(u,f)=>(e.openBlock(),e.createBlock(xe._sfc_main,e.mergeProps({plot:{x:u.x,y:I.value?u.y:a.value.top},radius:i.value&&i.value.id===u.id?B.value*1.5:B.value,shape:t.value.style.chart.plots.shape,stroke:t.value.style.chart.plots.stroke,strokeWidth:t.value.style.chart.plots.strokeWidth,color:t.value.style.chart.plots.gradient.show?`url(#${o.id})`:o.color,onMouseenter:T=>pe({datapoint:u,seriesIndex:f}),onMouseleave:s[0]||(s[0]=T=>{P.value=!1,i.value=null}),onClick:T=>ie("selectDatapoint",u),style:`transition: all 0.2s ease-in-out; opacity:${i.value?i.value.id===u.id?1:.2:t.value.style.chart.plots.opacity};${k.value?`transition-delay:${f*50}ms`:""}`,class:{"vue-ui-strip-plot-animated":t.value.useCssAnimation&&k.value,"vue-ui-strip-plot-select-circle":t.value.useCssAnimation&&!k.value}},l.$attrs),null,16,["plot","radius","shape","stroke","strokeWidth","color","onMouseenter","onClick","style","class"]))),256)),c.value.dataLabels.show?(e.openBlock(),e.createElementBlock("g",Xe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.plots,(u,f)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[f===o.plots.length-1||i.value&&i.value.id===u.id&&!c.value.showTooltip?(e.openBlock(),e.createElementBlock("text",{key:0,x:u.x,y:u.y+t.value.style.chart.labels.bestPlotLabel.offsetY-B.value*(i.value&&i.value.id===u.id&&!c.value.showTooltip?2:1.5),"font-size":t.value.style.chart.labels.bestPlotLabel.fontSize,fill:t.value.style.chart.labels.bestPlotLabel.color,"text-anchor":"middle",style:e.normalizeStyle(`opacity:${t.value.useCssAnimation&&k.value?0:1};transition:opacity 0.2s ease-in;`)},e.toDisplayString(u.name)+" "+e.toDisplayString(t.value.style.chart.labels.bestPlotLabel.showValue?e.unref(r.applyDataLabel)(t.value.style.chart.labels.formatter,u.value,e.unref(r.dataLabel)({p:`(${t.value.style.chart.labels.prefix}`,v:u.value,s:`${t.value.style.chart.labels.suffix})`,r:t.value.style.chart.labels.bestPlotLabel.rounding}),{datapoint:u,seriesIndex:f}):""),13,Ye)):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0)],64))),256)),e.renderSlot(l.$slots,"svg",{svg:a.value},void 0,!0)],14,_e)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Je,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(X)||e.unref(Y)})),void 0,!0)])):e.createCommentVNode("",!0),p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ke.default,{key:6,config:{type:"stripPlot",style:{backgroundColor:t.value.style.chart.backgroundColor,stripPlot:{color:"#CCCCCC"}}}},null,8,["config"])),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:M,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(be._sfc_main,{show:c.value.showTooltip&&P.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,fontSize:t.value.style.chart.tooltip.fontSize,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:y.value,content:E.value,isFullscreen:g.value,isCustom:e.unref(r.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...V.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...V.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isFullscreen","isCustom"]),p.value?(e.openBlock(),e.createBlock(Ce.default,{key:8,hideDetails:"",config:{open:c.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(ge.DataTable,{key:`table_${G.value}`,colNames:$.value.colNames,head:$.value.head,body:$.value.body,config:$.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:s[1]||(s[1]=o=>c.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,Ke)]),td:e.withCtx(({td:o})=>[e.createTextVNode(e.toDisplayString(o.name||o),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,$e))}},Ze=Ne._export_sfc(Qe,[["__scopeId","data-v-375e8dc0"]]);exports.default=Ze;
@@ -1,16 +1,16 @@
1
1
  import { computed as d, ref as n, watch as Ge, onMounted as Ue, onBeforeUnmount as Ve, openBlock as s, createElementBlock as u, normalizeClass as F, normalizeStyle as B, unref as v, createBlock as T, createCommentVNode as c, createSlots as Ee, withCtx as f, renderSlot as p, normalizeProps as M, guardReactiveProps as W, createVNode as $e, Fragment as g, renderList as C, createElementVNode as k, toDisplayString as L, mergeProps as He, createTextVNode as Re, nextTick as Be } from "vue";
2
- import { u as Xe, c as ee, t as je, a as Ye, p as A, o as Je, e as te, g as _e, b as qe, d as Te, v as Ke, D as Qe, f as X, X as Ze, i as le, l as et, h as tt, x as Le, y as lt, q as at, r as ot, F as st } from "./index-CpNLsWVB.js";
2
+ import { u as Xe, c as ee, t as je, a as Ye, p as A, o as Je, e as te, g as _e, b as qe, d as Te, v as Ke, D as Qe, f as X, X as Ze, i as le, l as et, h as tt, x as Le, y as lt, q as at, r as ot, F as st } from "./index-B8Eaq54E.js";
3
3
  import { t as rt, u as ut } from "./useResponsive-CoxXLe23.js";
4
- import { _ as it } from "./Title-CmyP_ypC.js";
5
- import { u as nt, U as vt } from "./usePrinter-D76t2otk.js";
6
- import { _ as ct } from "./Tooltip-Dz6sXvS2.js";
7
- import { D as ht } from "./DataTable-CC3rD9iV.js";
8
- import dt from "./vue-ui-skeleton-CIp8lMA6.js";
9
- import { _ as pt } from "./Shape-CSj0rOyf.js";
10
- import yt from "./vue-ui-accordion-7RGF7sa1.js";
11
- import { u as Ae } from "./useNestedProp-C14snYQ3.js";
12
- import { _ as ft } from "./PackageVersion-Cc8-1SRE.js";
13
- import { P as bt } from "./PenAndPaper-BKX-8o1h.js";
4
+ import { _ as it } from "./Title-XYNHfYwN.js";
5
+ import { u as nt, U as vt } from "./usePrinter-D83W2gfG.js";
6
+ import { _ as ct } from "./Tooltip-DYRo59nq.js";
7
+ import { D as ht } from "./DataTable-DtRXoetj.js";
8
+ import dt from "./vue-ui-skeleton-DpadzgbS.js";
9
+ import { _ as pt } from "./Shape-B1fqUhjt.js";
10
+ import yt from "./vue-ui-accordion--5td7b94.js";
11
+ import { u as Ae } from "./useNestedProp-Ka0R_Yqa.js";
12
+ import { _ as ft } from "./PackageVersion-CgJdp_Ki.js";
13
+ import { P as bt } from "./PenAndPaper-BTLEk55u.js";
14
14
  import { u as mt } from "./useUserOptionState-BIvW1Kz7.js";
15
15
  import { _ as gt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
16
16
  const kt = ["id"], xt = ["xmlns", "viewBox"], Ct = ["x", "y", "width", "height"], wt = { key: 1 }, $t = { key: 0 }, _t = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], Tt = { key: 1 }, Lt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], At = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], St = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Pt = ["x", "y", "fill", "font-size"], Ot = ["x", "y", "font-size", "fill"], zt = ["fill", "font-size", "transform"], Nt = ["fill", "font-size", "x", "y"], Ft = ["x1", "x2", "y1", "y2", "stroke"], Mt = ["cx", "cy", "fill"], Wt = ["cx", "cy", "fill"], It = ["id"], Dt = ["stop-color"], Gt = ["stop-color"], Ut = ["stop-color"], Vt = { key: 0 }, Et = ["x", "y", "font-size", "fill"], Ht = {
@@ -1,4 +1,4 @@
1
- import { p as D, u as x, A as G, m as M, d as T, B as E, q as z, r as B, a1 as H } from "./index-CpNLsWVB.js";
1
+ import { p as D, u as x, A as G, m as M, d as T, B as E, q as z, r as B, a1 as H } from "./index-B8Eaq54E.js";
2
2
  import { openBlock as i, createElementBlock as c, normalizeStyle as g, createElementVNode as a, toDisplayString as u, Fragment as b, renderList as _, normalizeClass as f, createTextVNode as I, createCommentVNode as N, withDirectives as k, vModelText as w, withKeys as S, withModifiers as O, vModelSelect as P, createStaticVNode as R, pushScopeId as U, popScopeId as V } from "vue";
3
3
  import { _ as j } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
4
  const X = {
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index-CH3YkGpv.cjs"),e=require("vue"),b=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),C={name:"vue-ui-table",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},data(){return{uid:`vue-ui-table-${Math.random()}`,bodyCopy:JSON.parse(JSON.stringify(this.dataset.body)).map((l,o)=>({...l,absoluteIndex:o})),buttonTimeout:null,canMoveChart:!1,chart:{height:316,type:"bar",width:512},constants:{ASC:1,BAR:"bar",DATE:"date",DESC:-1,DONUT:"donut",LINE:"line",NUMERIC:"numeric",PERCENTAGE:"percentage",TEXT:"text"},clientX:100,clientY:100,cssClass:{CELL:"smart-td-selected",FIRST_TD:"smart-td-selected-first",LAST_TD:"smart-td-selected-last",ROW:"smart-td-selected-neighbor"},currentDonut:void 0,currentFilter:void 0,currentSearch:void 0,currentSelectionSpan:{col:void 0,rows:[]},currentPage:0,dates:{},filteredDatesIndexes:{},hasNaN:{},iconColor:"#2D353C",iconSize:20,immutableRangeFilters:{},isExportRequest:!1,isLoading:!1,itemsPerPage:this.config.rowsPerPage?this.config.rowsPerPage:25,multiselects:{},paginatorOptions:[...new Set([10,25,50,100,250,500,this.config.rowsPerPage?this.config.rowsPerPage:25,this.dataset.body.length])].sort((l,o)=>l-o),palette:g.palette,percentages:{},rafId:null,rangeFilters:{},searches:{},selectedColumn:void 0,selectedDonutCategory:void 0,selectedPlot:void 0,showChart:!1,showDonutOptions:!1,sorts:{},tableBody:JSON.parse(JSON.stringify(this.dataset.body)).map((l,o)=>({...l,absoluteIndex:o})),tableHead:JSON.parse(JSON.stringify(this.dataset.header)).map(l=>({average:Object.hasOwn(l,"average")?l.average:!1,decimals:Object.hasOwn(l,"decimals")?l.decimals:0,isMultiselect:Object.hasOwn(l,"isMultiselect")?l.isMultiselect:!1,isPercentage:Object.hasOwn(l,"isPercentage")?l.isPercentage:!1,isSearch:Object.hasOwn(l,"isSearch")?l.isSearch:!1,isSort:Object.hasOwn(l,"isSort")?l.isSort:!1,name:l.name,percentageTo:Object.hasOwn(l,"percentageTo")?l.percentageTo:void 0,prefix:Object.hasOwn(l,"prefix")?l.prefix:"",rangeFilter:Object.hasOwn(l,"rangeFilter")?l.rangeFilter:!1,suffix:Object.hasOwn(l,"suffix")?l.suffix:"",sum:Object.hasOwn(l,"sum")?l.sum:!1,type:l.type}))}},mounted(){if(this.dataset.header.length===0)throw new Error(`vue-ui-table error: missing header data.
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index-KJL8ra_6.cjs"),e=require("vue"),b=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),C={name:"vue-ui-table",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},data(){return{uid:`vue-ui-table-${Math.random()}`,bodyCopy:JSON.parse(JSON.stringify(this.dataset.body)).map((l,o)=>({...l,absoluteIndex:o})),buttonTimeout:null,canMoveChart:!1,chart:{height:316,type:"bar",width:512},constants:{ASC:1,BAR:"bar",DATE:"date",DESC:-1,DONUT:"donut",LINE:"line",NUMERIC:"numeric",PERCENTAGE:"percentage",TEXT:"text"},clientX:100,clientY:100,cssClass:{CELL:"smart-td-selected",FIRST_TD:"smart-td-selected-first",LAST_TD:"smart-td-selected-last",ROW:"smart-td-selected-neighbor"},currentDonut:void 0,currentFilter:void 0,currentSearch:void 0,currentSelectionSpan:{col:void 0,rows:[]},currentPage:0,dates:{},filteredDatesIndexes:{},hasNaN:{},iconColor:"#2D353C",iconSize:20,immutableRangeFilters:{},isExportRequest:!1,isLoading:!1,itemsPerPage:this.config.rowsPerPage?this.config.rowsPerPage:25,multiselects:{},paginatorOptions:[...new Set([10,25,50,100,250,500,this.config.rowsPerPage?this.config.rowsPerPage:25,this.dataset.body.length])].sort((l,o)=>l-o),palette:g.palette,percentages:{},rafId:null,rangeFilters:{},searches:{},selectedColumn:void 0,selectedDonutCategory:void 0,selectedPlot:void 0,showChart:!1,showDonutOptions:!1,sorts:{},tableBody:JSON.parse(JSON.stringify(this.dataset.body)).map((l,o)=>({...l,absoluteIndex:o})),tableHead:JSON.parse(JSON.stringify(this.dataset.header)).map(l=>({average:Object.hasOwn(l,"average")?l.average:!1,decimals:Object.hasOwn(l,"decimals")?l.decimals:0,isMultiselect:Object.hasOwn(l,"isMultiselect")?l.isMultiselect:!1,isPercentage:Object.hasOwn(l,"isPercentage")?l.isPercentage:!1,isSearch:Object.hasOwn(l,"isSearch")?l.isSearch:!1,isSort:Object.hasOwn(l,"isSort")?l.isSort:!1,name:l.name,percentageTo:Object.hasOwn(l,"percentageTo")?l.percentageTo:void 0,prefix:Object.hasOwn(l,"prefix")?l.prefix:"",rangeFilter:Object.hasOwn(l,"rangeFilter")?l.rangeFilter:!1,suffix:Object.hasOwn(l,"suffix")?l.suffix:"",sum:Object.hasOwn(l,"sum")?l.sum:!1,type:l.type}))}},mounted(){if(this.dataset.header.length===0)throw new Error(`vue-ui-table error: missing header data.
2
2
  Provide an array of objects of type:
3
3
  {
4
4
  name: string;