vue-data-ui 2.4.6 → 2.4.7

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 (148) hide show
  1. package/dist/{Arrow-FPrXmABn.js → Arrow-BCeetU2P.js} +1 -1
  2. package/dist/{Arrow-CLZKAoZX.cjs → Arrow-Ds1Mhkkt.cjs} +1 -1
  3. package/dist/{BaseIcon-NmXFeTkE.cjs → BaseIcon-C31iTAGj.cjs} +1 -1
  4. package/dist/{BaseIcon-D90GFGqy.js → BaseIcon-Icg3SIlH.js} +1 -1
  5. package/dist/{DataTable-sGuRDRal.js → DataTable-CnLqhXZ2.js} +2 -2
  6. package/dist/{DataTable-lNwyPkUV.cjs → DataTable-CqaGqXkz.cjs} +1 -1
  7. package/dist/{Legend-DOn6UaCZ.js → Legend-8QHo6cZQ.js} +1 -1
  8. package/dist/{Legend-Bdl_1DJO.cjs → Legend-D2iK-_M0.cjs} +1 -1
  9. package/dist/{PackageVersion-ldwwWp9S.js → PackageVersion-Bw7N_9KM.js} +1 -1
  10. package/dist/{PackageVersion-VHviFq0W.cjs → PackageVersion-DjuywB0J.cjs} +1 -1
  11. package/dist/PenAndPaper-BiWc81tP.js +347 -0
  12. package/dist/PenAndPaper-DoKpW2Tl.cjs +1 -0
  13. package/dist/{Shape-CR3-qftC.cjs → Shape-BfZLKYNk.cjs} +1 -1
  14. package/dist/{Shape-CL9-IFMq.js → Shape-CppjH62a.js} +1 -1
  15. package/dist/{Slicer-BcsAfmLx.js → Slicer-CA5jR9Em.js} +2 -2
  16. package/dist/{Slicer-DvUS1T9M.cjs → Slicer-U4q5iMIE.cjs} +1 -1
  17. package/dist/{Title-Doa_KqSJ.cjs → Title-aR9ViX_A.cjs} +1 -1
  18. package/dist/{Title-Bsbq2v6j.js → Title-yJsQ5q-l.js} +1 -1
  19. package/dist/{Tooltip-BfjsUhFm.cjs → Tooltip-CN6_JyjT.cjs} +1 -1
  20. package/dist/{Tooltip-DV_iWmTl.js → Tooltip-klg8yuWM.js} +1 -1
  21. package/dist/{index-BIGzKAQq.cjs → index-Ci5MafHS.cjs} +1 -1
  22. package/dist/{index-49zKC_pb.js → index-Cn1EWnYG.js} +1 -1
  23. package/dist/style.css +1 -1
  24. package/dist/{useNestedProp-D1a8xzOZ.js → useNestedProp-BXn-g9sr.js} +1 -1
  25. package/dist/{useNestedProp-zN3-B_1z.cjs → useNestedProp-DxZ05ZEt.cjs} +1 -1
  26. package/dist/{usePrinter-CuZzu5vy.cjs → usePrinter-B3HaYNI4.cjs} +1 -1
  27. package/dist/{usePrinter-fXMN7kAV.js → usePrinter-ZkzmtO6K.js} +1 -1
  28. package/dist/{vue-data-ui-mpBjz9RX.cjs → vue-data-ui-Bn_29KuS.cjs} +1 -1
  29. package/dist/{vue-data-ui-Bn5_gi1g.js → vue-data-ui-DfGCpkA8.js} +58 -58
  30. package/dist/vue-data-ui.cjs +1 -1
  31. package/dist/vue-data-ui.js +1 -1
  32. package/dist/{vue-ui-3d-bar-BAPatZXD.cjs → vue-ui-3d-bar-CERRaGHQ.cjs} +1 -1
  33. package/dist/{vue-ui-3d-bar-BJSorf8P.js → vue-ui-3d-bar-Cz7ZSFFf.js} +9 -9
  34. package/dist/{vue-ui-accordion-RGtr28JI.js → vue-ui-accordion-UADqAdVj.js} +3 -3
  35. package/dist/{vue-ui-accordion-Dao-6A6Q.cjs → vue-ui-accordion-kQwtYRmD.cjs} +1 -1
  36. package/dist/{vue-ui-age-pyramid--LgXr3QI.js → vue-ui-age-pyramid-DhGijqy5.js} +10 -10
  37. package/dist/{vue-ui-age-pyramid-DS8bW0qo.cjs → vue-ui-age-pyramid-Rfk1WUfJ.cjs} +1 -1
  38. package/dist/{vue-ui-annotator-fMW4he5T.cjs → vue-ui-annotator-BdAFNoMu.cjs} +1 -1
  39. package/dist/{vue-ui-annotator-DDp3s2Pq.js → vue-ui-annotator-CCgDEOdY.js} +1 -1
  40. package/dist/{vue-ui-bullet-Ciw0R5nc.cjs → vue-ui-bullet-Bkx9sfrv.cjs} +1 -1
  41. package/dist/{vue-ui-bullet-BhdTa7u3.js → vue-ui-bullet-CSVuqhhg.js} +8 -8
  42. package/dist/{vue-ui-candlestick-B1l0aBq_.cjs → vue-ui-candlestick-CuNi5UZ7.cjs} +1 -1
  43. package/dist/{vue-ui-candlestick-Bf-YTcON.js → vue-ui-candlestick-D0RfMi-W.js} +11 -11
  44. package/dist/{vue-ui-carousel-table-DXwE1huQ.cjs → vue-ui-carousel-table-Dch3TChE.cjs} +1 -1
  45. package/dist/{vue-ui-carousel-table-CYCpVrOn.js → vue-ui-carousel-table-DeY0f9Ba.js} +4 -4
  46. package/dist/{vue-ui-chestnut-BsMLyk2U.js → vue-ui-chestnut-B2Gio3KC.js} +8 -8
  47. package/dist/{vue-ui-chestnut-D3uy5gQJ.cjs → vue-ui-chestnut-bqu8whHd.cjs} +1 -1
  48. package/dist/{vue-ui-cursor-O0E8FmMB.js → vue-ui-cursor-BlW4uLBm.js} +2 -2
  49. package/dist/{vue-ui-cursor-DKTzq5Rn.cjs → vue-ui-cursor-Dnv5a5oy.cjs} +1 -1
  50. package/dist/{vue-ui-dashboard-DTQ6jkKX.js → vue-ui-dashboard-DCaNJXOd.js} +2 -2
  51. package/dist/{vue-ui-dashboard-Cif9KLNp.cjs → vue-ui-dashboard-De5_U4a9.cjs} +1 -1
  52. package/dist/{vue-ui-digits-Dd_-F0NM.cjs → vue-ui-digits-Dc0L7473.cjs} +1 -1
  53. package/dist/{vue-ui-digits-B6kqi621.js → vue-ui-digits-DlteJApK.js} +2 -2
  54. package/dist/{vue-ui-donut-C8vdLwIN.js → vue-ui-donut-6Vh9u3Xp.js} +11 -11
  55. package/dist/{vue-ui-donut-BjzOSsXF.cjs → vue-ui-donut-CBTZK6YJ.cjs} +1 -1
  56. package/dist/{vue-ui-donut-evolution-B0HSRlIg.cjs → vue-ui-donut-evolution-CmgjvLvu.cjs} +1 -1
  57. package/dist/{vue-ui-donut-evolution-CmdF6deB.js → vue-ui-donut-evolution-gQyMiCiu.js} +11 -11
  58. package/dist/{vue-ui-dumbbell-CEE76a-m.cjs → vue-ui-dumbbell-ByhSaE6s.cjs} +1 -1
  59. package/dist/{vue-ui-dumbbell-DUca_lht.js → vue-ui-dumbbell-C4xg1FG4.js} +10 -10
  60. package/dist/{vue-ui-flow-DmhIaigU.cjs → vue-ui-flow-Bef5hCwj.cjs} +1 -1
  61. package/dist/{vue-ui-flow-Cvu1EVCF.js → vue-ui-flow-DYF0P7LD.js} +9 -9
  62. package/dist/{vue-ui-galaxy-Cu6CWFDj.cjs → vue-ui-galaxy-COY_QSwC.cjs} +1 -1
  63. package/dist/{vue-ui-galaxy-C3OsM7sZ.js → vue-ui-galaxy-aM8uOGRD.js} +11 -11
  64. package/dist/{vue-ui-gauge-BzjbsaR8.cjs → vue-ui-gauge-CW8ZpODM.cjs} +1 -1
  65. package/dist/{vue-ui-gauge-DbKQTx3Q.js → vue-ui-gauge-qYg_QM-A.js} +7 -7
  66. package/dist/{vue-ui-gizmo-CwcCktOd.js → vue-ui-gizmo-BZyOCD_y.js} +3 -3
  67. package/dist/{vue-ui-gizmo-D6kY6rq2.cjs → vue-ui-gizmo-DgS57tJ2.cjs} +1 -1
  68. package/dist/{vue-ui-heatmap-z23AgiZJ.js → vue-ui-heatmap-BfJGluVp.js} +10 -10
  69. package/dist/{vue-ui-heatmap-DoJeKoTE.cjs → vue-ui-heatmap-Czg21edC.cjs} +1 -1
  70. package/dist/{vue-ui-kpi-CkAs4UNa.js → vue-ui-kpi-C5ISBjIs.js} +3 -3
  71. package/dist/{vue-ui-kpi-CwrOzJTf.cjs → vue-ui-kpi-DQpkO2MX.cjs} +1 -1
  72. package/dist/{vue-ui-mini-loader-BL1hWVCl.js → vue-ui-mini-loader-BiaLLW3x.js} +2 -2
  73. package/dist/{vue-ui-mini-loader-BG5f652Q.cjs → vue-ui-mini-loader-Db5Khvfw.cjs} +1 -1
  74. package/dist/{vue-ui-molecule-DZ5t0b99.cjs → vue-ui-molecule-4AXvVmWt.cjs} +1 -1
  75. package/dist/{vue-ui-molecule-DwjLYP7w.js → vue-ui-molecule-fmAXI5nL.js} +11 -11
  76. package/dist/{vue-ui-mood-radar-DhoBjfBA.cjs → vue-ui-mood-radar-BzfFikJv.cjs} +1 -1
  77. package/dist/{vue-ui-mood-radar-DMyIiep_.js → vue-ui-mood-radar-CVLad_RZ.js} +11 -11
  78. package/dist/{vue-ui-nested-donuts-BSraS34g.js → vue-ui-nested-donuts-7VePVE4W.js} +11 -11
  79. package/dist/{vue-ui-nested-donuts-DU3mpzzN.cjs → vue-ui-nested-donuts-BP0qdKto.cjs} +1 -1
  80. package/dist/{vue-ui-onion-BGK7q1Zm.js → vue-ui-onion-LCcrKbXJ.js} +11 -11
  81. package/dist/{vue-ui-onion-B2evf74Q.cjs → vue-ui-onion-tzmb3ARN.cjs} +1 -1
  82. package/dist/{vue-ui-parallel-coordinate-plot-CtbHbaMU.js → vue-ui-parallel-coordinate-plot-D0Xxq5a9.js} +12 -12
  83. package/dist/{vue-ui-parallel-coordinate-plot-CoZ2NNT-.cjs → vue-ui-parallel-coordinate-plot-Dgu-tY5L.cjs} +1 -1
  84. package/dist/{vue-ui-quadrant-b00dtEbu.js → vue-ui-quadrant-D_e1Knsr.js} +12 -12
  85. package/dist/{vue-ui-quadrant-1zd4EcHN.cjs → vue-ui-quadrant-DkOZbxio.cjs} +1 -1
  86. package/dist/{vue-ui-quick-chart-C2tGQ9jZ.cjs → vue-ui-quick-chart-Brzheuk8.cjs} +1 -1
  87. package/dist/{vue-ui-quick-chart-C_aOAlYK.js → vue-ui-quick-chart-CIm7vclU.js} +9 -9
  88. package/dist/{vue-ui-radar-CEmwdc5R.js → vue-ui-radar-Cx_w_viT.js} +12 -12
  89. package/dist/{vue-ui-radar-CzPDR57N.cjs → vue-ui-radar-DoNZ8Qv9.cjs} +1 -1
  90. package/dist/{vue-ui-rating-DC9ED1T9.cjs → vue-ui-rating-B4zDVBEd.cjs} +1 -1
  91. package/dist/{vue-ui-rating-Bcw4NMqy.js → vue-ui-rating-NRP3A0oA.js} +2 -2
  92. package/dist/{vue-ui-relation-circle-CtoP92Nm.js → vue-ui-relation-circle-C4LKLsEz.js} +7 -7
  93. package/dist/{vue-ui-relation-circle-S0rcVtyt.cjs → vue-ui-relation-circle-Cuk4LDJo.cjs} +1 -1
  94. package/dist/{vue-ui-rings-OZVey4XI.cjs → vue-ui-rings-D6Rs1eq0.cjs} +1 -1
  95. package/dist/{vue-ui-rings-CkWZ736Y.js → vue-ui-rings-DXawhL1m.js} +11 -11
  96. package/dist/{vue-ui-scatter-D5revDjR.js → vue-ui-scatter-8EzIXx2n.js} +12 -12
  97. package/dist/{vue-ui-scatter-BJlIxqvN.cjs → vue-ui-scatter-DlfZqYP9.cjs} +1 -1
  98. package/dist/{vue-ui-screenshot-CBqgcSp4.cjs → vue-ui-screenshot-Dt0UpXVm.cjs} +1 -1
  99. package/dist/{vue-ui-screenshot-BnxlJEDM.js → vue-ui-screenshot-Wwmw7VVM.js} +1 -1
  100. package/dist/{vue-ui-skeleton-CWI6cZZA.js → vue-ui-skeleton-D3AGluiW.js} +3 -3
  101. package/dist/{vue-ui-skeleton-CoPAETjt.cjs → vue-ui-skeleton-Si57O3af.cjs} +1 -1
  102. package/dist/{vue-ui-smiley-E5BtjNd0.js → vue-ui-smiley-CRddsfyu.js} +2 -2
  103. package/dist/{vue-ui-smiley-Zgsb3QsJ.cjs → vue-ui-smiley-UxTt4IMY.cjs} +1 -1
  104. package/dist/{vue-ui-spark-trend-_fM0ASpS.js → vue-ui-spark-trend-Cgr4pAvU.js} +5 -5
  105. package/dist/{vue-ui-spark-trend-E_r6XBda.cjs → vue-ui-spark-trend-tMuRiISe.cjs} +1 -1
  106. package/dist/{vue-ui-sparkbar-CzLduXwD.js → vue-ui-sparkbar-B6TEBbyt.js} +4 -4
  107. package/dist/{vue-ui-sparkbar-DrDGzkxU.cjs → vue-ui-sparkbar-BZVjpA5h.cjs} +1 -1
  108. package/dist/{vue-ui-sparkgauge-DnlFkJht.cjs → vue-ui-sparkgauge-B9P3ngyj.cjs} +1 -1
  109. package/dist/{vue-ui-sparkgauge-CQEUdjHu.js → vue-ui-sparkgauge-P5fVXRT8.js} +4 -4
  110. package/dist/{vue-ui-sparkhistogram-nfep88pb.cjs → vue-ui-sparkhistogram-BSQsOim4.cjs} +1 -1
  111. package/dist/{vue-ui-sparkhistogram-WU0X44HO.js → vue-ui-sparkhistogram-vlWx_CFP.js} +5 -5
  112. package/dist/{vue-ui-sparkline-CTlY68K-.cjs → vue-ui-sparkline-5FsmrmmU.cjs} +1 -1
  113. package/dist/{vue-ui-sparkline-C5pHShn8.js → vue-ui-sparkline-B1UrThV_.js} +4 -4
  114. package/dist/{vue-ui-sparkstackbar-CD1igCtu.js → vue-ui-sparkstackbar-BzrHl4LW.js} +4 -4
  115. package/dist/{vue-ui-sparkstackbar-DVNWhfXJ.cjs → vue-ui-sparkstackbar-CEXgwtwV.cjs} +1 -1
  116. package/dist/{vue-ui-stackbar-B8XzJVfQ.cjs → vue-ui-stackbar-BpFxY9uX.cjs} +1 -1
  117. package/dist/{vue-ui-stackbar-B3PJuAxR.js → vue-ui-stackbar-DhnCj5jR.js} +12 -12
  118. package/dist/{vue-ui-strip-plot-D6NvVi8T.js → vue-ui-strip-plot-CutPMUb1.js} +11 -11
  119. package/dist/{vue-ui-strip-plot-BU0Ze6mB.cjs → vue-ui-strip-plot-DnFquLCu.cjs} +1 -1
  120. package/dist/{vue-ui-table-BQD6a_aJ.cjs → vue-ui-table-CUtRHuc4.cjs} +1 -1
  121. package/dist/{vue-ui-table-BltUTp7w.js → vue-ui-table-Cx0eqrK_.js} +1 -1
  122. package/dist/{vue-ui-table-heatmap-DNQX2ssm.cjs → vue-ui-table-heatmap-DS2cSiGt.cjs} +1 -1
  123. package/dist/{vue-ui-table-heatmap-Ci0x1CNV.js → vue-ui-table-heatmap-DyGuk9kw.js} +4 -4
  124. package/dist/{vue-ui-table-sparkline-BnWCkMFe.js → vue-ui-table-sparkline--Ekk_QoU.js} +5 -5
  125. package/dist/{vue-ui-table-sparkline-BBmpe-6D.cjs → vue-ui-table-sparkline-C1ril5t8.cjs} +1 -1
  126. package/dist/{vue-ui-thermometer-BENJ73Pb.cjs → vue-ui-thermometer-Dr6_S2Qz.cjs} +1 -1
  127. package/dist/{vue-ui-thermometer-39qz-oq4.js → vue-ui-thermometer-Dz_xaxCt.js} +7 -7
  128. package/dist/{vue-ui-timer-8_HQQdrC.cjs → vue-ui-timer-BkmRYrPn.cjs} +1 -1
  129. package/dist/{vue-ui-timer-CSo9NnGB.js → vue-ui-timer-DRdgSmMv.js} +5 -5
  130. package/dist/{vue-ui-tiremarks-Co5YUDDA.cjs → vue-ui-tiremarks-BwVRnR-c.cjs} +1 -1
  131. package/dist/{vue-ui-tiremarks-CkfxWhpz.js → vue-ui-tiremarks-XuaMScx0.js} +7 -7
  132. package/dist/{vue-ui-treemap-I2YafkrE.js → vue-ui-treemap-D8HfM8ny.js} +11 -11
  133. package/dist/{vue-ui-treemap-DZkCQEk5.cjs → vue-ui-treemap-yUQZvXta.cjs} +1 -1
  134. package/dist/{vue-ui-vertical-bar-Dz3M8sEI.js → vue-ui-vertical-bar-BcWnPMjH.js} +11 -11
  135. package/dist/{vue-ui-vertical-bar-ul14mUdW.cjs → vue-ui-vertical-bar-DpaRYTVo.cjs} +1 -1
  136. package/dist/{vue-ui-waffle-C5faN9Gl.js → vue-ui-waffle-sLIM61xh.js} +11 -11
  137. package/dist/{vue-ui-waffle-CL5knSlv.cjs → vue-ui-waffle-uur49hDo.cjs} +1 -1
  138. package/dist/{vue-ui-wheel-Ct_1Npyv.cjs → vue-ui-wheel-CJBuFjJt.cjs} +1 -1
  139. package/dist/{vue-ui-wheel-BsEaNHzC.js → vue-ui-wheel-D3Pfhpbe.js} +7 -7
  140. package/dist/{vue-ui-word-cloud-Bf6l5rNU.js → vue-ui-word-cloud-DhC8SN1l.js} +10 -10
  141. package/dist/{vue-ui-word-cloud-81r_XQl3.cjs → vue-ui-word-cloud-Dhz-n0_M.cjs} +1 -1
  142. package/dist/{vue-ui-xy-BaFVUMY0.cjs → vue-ui-xy-Cn-JnSRl.cjs} +1 -1
  143. package/dist/{vue-ui-xy-CASWydww.js → vue-ui-xy-D7nWzSu1.js} +14 -14
  144. package/dist/{vue-ui-xy-canvas-D3xs7lt5.cjs → vue-ui-xy-canvas-BI5nAbis.cjs} +1 -1
  145. package/dist/{vue-ui-xy-canvas-DfO47Q2y.js → vue-ui-xy-canvas-DWZRAtDJ.js} +11 -11
  146. package/package.json +1 -1
  147. package/dist/PenAndPaper-D-dkYPgf.cjs +0 -1
  148. package/dist/PenAndPaper-DSz98f49.js +0 -299
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-BIGzKAQq.cjs"),V=require("./useNestedProp-zN3-B_1z.cjs"),N=require("./BaseIcon-NmXFeTkE.cjs"),F=require("./vue-ui-skeleton-CoPAETjt.cjs"),j=require("./PackageVersion-VHviFq0W.cjs"),q=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),A=["id"],O=["xmlns","viewBox"],D=["id"],P=["stop-color"],G=["stop-color"],U={key:0},W=["d","fill"],Z=["d","fill"],H=["d","stroke","stroke-width","stroke-linecap","stroke-linejoin"],R=["d","stroke","stroke-width","stroke-linecap","stroke-linejoin"],X=["height","width","x"],J={style:{width:"100%"}},K=["x","y","fill","font-size","font-weight"],Q=["stroke","cx","cy","fill"],Y=["x","y","font-size","fill","font-weight"],ee={key:2,ref:"source",dir:"auto"},te={__name:"vue-ui-spark-trend",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(E){const r=E,{vue_ui_spark_trend:$}=o.useConfig(),S=e.computed(()=>!!r.dataset&&r.dataset.length),p=e.ref(o.createUid()),t=e.computed({get:()=>x(),set:l=>l});function x(){const l=V.useNestedProp({userConfig:r.config,defaultConfig:$});return l.theme?{...V.useNestedProp({userConfig:o.themes.vue_ui_spark_trend[l.theme]||r.config,defaultConfig:l})}:l}e.watch(()=>r.config,l=>{t.value=x(),C()},{deep:!0}),e.watch(()=>r.dataset,l=>{v.value=r.dataset.map(n=>[void 0,1/0,-1/0,null,NaN].includes(n)?null:n)},{deep:!0});function k(l){return l.map(n=>o.checkNaN(n))}const v=e.ref(r.dataset.map(l=>t.value.style.animation.show||[void 0,1/0,-1/0,null,NaN].includes(l)?null:l)),h=e.ref(!1),g=e.ref(null);e.onMounted(()=>{C();let n=1e3/t.value.style.animation.animationFrames,i=performance.now();if(t.value.style.animation.show&&t.value.style.animation.animationFrames&&r.dataset.length>1){let b=function(){h.value=!0;let B=performance.now(),L=B-i;L>n?(i=B-L%n,d<r.dataset.length?(v.value.push(r.dataset[d]),d+=1,g.value=requestAnimationFrame(b)):(cancelAnimationFrame(g.value),v.value=k(r.dataset),h.value=!1)):g.value=requestAnimationFrame(b)};v.value=[];let d=0;b()}});function C(){o.objectIsEmpty(r.dataset)&&o.error({componentName:"VueUiSparkTrend",type:"dataset"})}const u=e.ref({height:80,width:300}),c=e.computed(()=>({top:t.value.style.padding.top,left:t.value.style.padding.left,right:u.value.width-t.value.style.padding.right,bottom:u.value.height-t.value.style.padding.bottom,height:u.value.height-(t.value.style.padding.top+t.value.style.padding.bottom)-(t.value.style.dataLabel.show?t.value.style.dataLabel.fontSize:0),width:u.value.width-(t.value.style.padding.left+t.value.style.padding.right)})),_=e.computed(()=>{const l=k(r.dataset);return{max:Math.max(...l.map(n=>o.checkNaN(n))),min:Math.min(...l.map(n=>o.checkNaN(n)))}}),y=e.computed(()=>{const l=_.value.min>=0?0:_.value.min;return Math.abs(l)}),T=e.computed(()=>_.value.max+y.value);function w(l){return l/T.value}const z=e.computed(()=>r.dataset.length),a=e.computed(()=>v.value.map((l,n)=>{const i=isNaN(l)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l)?0:l||0;return{value:o.checkNaN(l),absoluteValue:o.checkNaN(i),plotValue:o.checkNaN(i+y.value),toMax:w(i+y.value),x:c.value.left+o.checkNaN(n*(c.value.width/(z.value-1)))-t.value.style.padding.right,y:c.value.bottom-o.checkNaN(c.value.height*w(i+y.value))}})),f=e.computed(()=>{const l=k(r.dataset);return t.value.style.trendLabel.trendType==="global"?o.calcTrend(l):t.value.style.trendLabel.trendType==="n-1"&&l.length>1?(l.at(-1)/l.at(-2)-1)*100:t.value.style.trendLabel.trendType==="lastToFirst"?(l.at(-1)/l[0]-1)*100:0}),m=e.computed(()=>h.value||f.value===0?"neutral":f.value>0?"positive":"negative"),s=e.computed(()=>t.value.style.arrow.colors[m.value]),M=e.computed(()=>{const l={x:a.value[0].x,y:u.value.height-6},n={x:a.value[a.value.length-1].x,y:u.value.height-6},i=[];return a.value.forEach(d=>{i.push(`${d.x},${d.y} `)}),[l.x,l.y,...i,n.x,n.y].toString()}),I=e.computed(()=>{let l=[];return a.value.forEach(n=>{l.push(`${n.x},${n.y} `)}),`M ${l.toString()}`});return(l,n)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-spark-trend",id:p.value,style:e.normalizeStyle(`width:100%;font-family:${t.value.style.fontFamily};background:${t.value.style.backgroundColor}`)},[S.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(o.XMLNS),viewBox:`0 0 ${u.value.width} ${u.value.height}`,style:"width:100%;background:transparent;overflow:visible"},[e.createVNode(j._sfc_main),e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{x1:"0%",y1:"0%",x2:"0%",y2:"100%",id:`pill_gradient_${p.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(o.setOpacity)(t.value.style.line.useColorTrend?s.value:t.value.style.line.stroke,t.value.style.area.opacity)},null,8,P),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.backgroundColor},null,8,G)],8,D)]),t.value.style.area.show&&a.value[0]?(e.openBlock(),e.createElementBlock("g",U,[t.value.style.line.smooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:`M ${a.value[0].x},${c.value.bottom} ${e.unref(o.createSmoothPath)(a.value)} L ${a.value.at(-1).x},${c.value.bottom} Z`,fill:t.value.style.area.useGradient?`url(#pill_gradient_${p.value})`:e.unref(o.setOpacity)(t.value.style.line.useColorTrend?s.value:t.value.style.line.stroke,t.value.style.area.opacity),stroke:"none"},null,8,W)):(e.openBlock(),e.createElementBlock("path",{key:1,d:`M${M.value}Z`,fill:t.value.style.area.useGradient?`url(#pill_gradient_${p.value})`:e.unref(o.setOpacity)(t.value.style.line.useColorTrend?s.value:t.value.style.line.stroke,t.value.style.area.opacity),stroke:"none"},null,8,Z))])):e.createCommentVNode("",!0),t.value.style.line.smooth&&a.value.length?(e.openBlock(),e.createElementBlock("path",{key:1,d:`M ${e.unref(o.createSmoothPath)(a.value)}`,stroke:t.value.style.line.useColorTrend?s.value:t.value.style.line.stroke,fill:"none","stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":t.value.style.line.strokeLinecap,"stroke-linejoin":t.value.style.line.strokeLinejoin},null,8,H)):e.createCommentVNode("",!0),!t.value.style.line.smooth&&a.value.length?(e.openBlock(),e.createElementBlock("path",{key:2,d:I.value,stroke:t.value.style.line.useColorTrend?s.value:t.value.style.line.stroke,fill:"none","stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":t.value.style.line.strokeLinecap,"stroke-linejoin":t.value.style.line.strokeLinejoin},null,8,R)):e.createCommentVNode("",!0),h.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("foreignObject",{key:3,height:u.value.height/2,width:u.value.height/2,x:u.value.height/5,y:8},[e.createElementVNode("div",J,[m.value==="positive"?(e.openBlock(),e.createBlock(N.default,{key:0,stroke:s.value,name:"arrowTop",size:u.value.height/2},null,8,["stroke","size"])):e.createCommentVNode("",!0),m.value==="negative"?(e.openBlock(),e.createBlock(N.default,{key:1,stroke:s.value,name:"arrowBottom",size:u.value.height/2},null,8,["stroke","size"])):e.createCommentVNode("",!0),m.value==="neutral"?(e.openBlock(),e.createBlock(N.default,{key:2,stroke:s.value,name:"arrowRight",size:u.value.height/2},null,8,["stroke","size"])):e.createCommentVNode("",!0)])],8,X)),h.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("text",{key:4,x:u.value.height/2-u.value.height/20,y:c.value.bottom,"text-anchor":"middle",fill:t.value.style.trendLabel.useColorTrend?s.value:t.value.style.trendLabel.color,"font-size":t.value.style.trendLabel.fontSize,"font-weight":t.value.style.trendLabel.bold?"bold":"normal"},e.toDisplayString(e.unref(o.dataLabel)({p:f.value>0?"+":"",v:f.value,s:"%",r:t.value.style.trendLabel.rounding})),9,K)),a.value.length&&a.value.at(-1).x!==void 0?(e.openBlock(),e.createElementBlock("circle",{key:5,stroke:t.value.style.backgroundColor,"stroke-width":2,cx:a.value.at(-1).x,cy:a.value.at(-1).y,r:4,fill:s.value},null,8,Q)):e.createCommentVNode("",!0),a.value.length&&a.value.at(-1).x!==void 0&&t.value.style.dataLabel.show?(e.openBlock(),e.createElementBlock("text",{key:6,"text-anchor":"middle",x:a.value.at(-1).x,y:a.value.at(-1).y-t.value.style.dataLabel.fontSize/1.5,"font-size":t.value.style.dataLabel.fontSize,fill:t.value.style.dataLabel.useColorTrend?s.value:t.value.style.dataLabel.color,"font-weight":t.value.style.dataLabel.bold?"bold":"normal"},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.dataLabel.formatter,a.value.at(-1).value,e.unref(o.dataLabel)({p:t.value.style.dataLabel.prefix,v:a.value.at(-1).value,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.rounding}),{datapoint:a.value.at(-1)})),9,Y)):e.createCommentVNode("",!0)],8,O)):(e.openBlock(),e.createBlock(F.default,{key:0,config:{type:"sparkline",style:{backgroundColor:t.value.style.backgroundColor,sparkline:{color:"#CCCCCC"}}}},null,8,["config"])),l.$slots.source?(e.openBlock(),e.createElementBlock("div",ee,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0)],12,A))}},le=q._export_sfc(te,[["__scopeId","data-v-96c5087f"]]);exports.default=le;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-Ci5MafHS.cjs"),V=require("./useNestedProp-DxZ05ZEt.cjs"),N=require("./BaseIcon-C31iTAGj.cjs"),F=require("./vue-ui-skeleton-Si57O3af.cjs"),j=require("./PackageVersion-DjuywB0J.cjs"),q=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),A=["id"],O=["xmlns","viewBox"],D=["id"],P=["stop-color"],G=["stop-color"],U={key:0},W=["d","fill"],Z=["d","fill"],H=["d","stroke","stroke-width","stroke-linecap","stroke-linejoin"],R=["d","stroke","stroke-width","stroke-linecap","stroke-linejoin"],X=["height","width","x"],J={style:{width:"100%"}},K=["x","y","fill","font-size","font-weight"],Q=["stroke","cx","cy","fill"],Y=["x","y","font-size","fill","font-weight"],ee={key:2,ref:"source",dir:"auto"},te={__name:"vue-ui-spark-trend",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(E){const r=E,{vue_ui_spark_trend:$}=o.useConfig(),S=e.computed(()=>!!r.dataset&&r.dataset.length),p=e.ref(o.createUid()),t=e.computed({get:()=>x(),set:l=>l});function x(){const l=V.useNestedProp({userConfig:r.config,defaultConfig:$});return l.theme?{...V.useNestedProp({userConfig:o.themes.vue_ui_spark_trend[l.theme]||r.config,defaultConfig:l})}:l}e.watch(()=>r.config,l=>{t.value=x(),C()},{deep:!0}),e.watch(()=>r.dataset,l=>{v.value=r.dataset.map(n=>[void 0,1/0,-1/0,null,NaN].includes(n)?null:n)},{deep:!0});function k(l){return l.map(n=>o.checkNaN(n))}const v=e.ref(r.dataset.map(l=>t.value.style.animation.show||[void 0,1/0,-1/0,null,NaN].includes(l)?null:l)),h=e.ref(!1),g=e.ref(null);e.onMounted(()=>{C();let n=1e3/t.value.style.animation.animationFrames,i=performance.now();if(t.value.style.animation.show&&t.value.style.animation.animationFrames&&r.dataset.length>1){let b=function(){h.value=!0;let B=performance.now(),L=B-i;L>n?(i=B-L%n,d<r.dataset.length?(v.value.push(r.dataset[d]),d+=1,g.value=requestAnimationFrame(b)):(cancelAnimationFrame(g.value),v.value=k(r.dataset),h.value=!1)):g.value=requestAnimationFrame(b)};v.value=[];let d=0;b()}});function C(){o.objectIsEmpty(r.dataset)&&o.error({componentName:"VueUiSparkTrend",type:"dataset"})}const u=e.ref({height:80,width:300}),c=e.computed(()=>({top:t.value.style.padding.top,left:t.value.style.padding.left,right:u.value.width-t.value.style.padding.right,bottom:u.value.height-t.value.style.padding.bottom,height:u.value.height-(t.value.style.padding.top+t.value.style.padding.bottom)-(t.value.style.dataLabel.show?t.value.style.dataLabel.fontSize:0),width:u.value.width-(t.value.style.padding.left+t.value.style.padding.right)})),_=e.computed(()=>{const l=k(r.dataset);return{max:Math.max(...l.map(n=>o.checkNaN(n))),min:Math.min(...l.map(n=>o.checkNaN(n)))}}),y=e.computed(()=>{const l=_.value.min>=0?0:_.value.min;return Math.abs(l)}),T=e.computed(()=>_.value.max+y.value);function w(l){return l/T.value}const z=e.computed(()=>r.dataset.length),a=e.computed(()=>v.value.map((l,n)=>{const i=isNaN(l)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l)?0:l||0;return{value:o.checkNaN(l),absoluteValue:o.checkNaN(i),plotValue:o.checkNaN(i+y.value),toMax:w(i+y.value),x:c.value.left+o.checkNaN(n*(c.value.width/(z.value-1)))-t.value.style.padding.right,y:c.value.bottom-o.checkNaN(c.value.height*w(i+y.value))}})),f=e.computed(()=>{const l=k(r.dataset);return t.value.style.trendLabel.trendType==="global"?o.calcTrend(l):t.value.style.trendLabel.trendType==="n-1"&&l.length>1?(l.at(-1)/l.at(-2)-1)*100:t.value.style.trendLabel.trendType==="lastToFirst"?(l.at(-1)/l[0]-1)*100:0}),m=e.computed(()=>h.value||f.value===0?"neutral":f.value>0?"positive":"negative"),s=e.computed(()=>t.value.style.arrow.colors[m.value]),M=e.computed(()=>{const l={x:a.value[0].x,y:u.value.height-6},n={x:a.value[a.value.length-1].x,y:u.value.height-6},i=[];return a.value.forEach(d=>{i.push(`${d.x},${d.y} `)}),[l.x,l.y,...i,n.x,n.y].toString()}),I=e.computed(()=>{let l=[];return a.value.forEach(n=>{l.push(`${n.x},${n.y} `)}),`M ${l.toString()}`});return(l,n)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-spark-trend",id:p.value,style:e.normalizeStyle(`width:100%;font-family:${t.value.style.fontFamily};background:${t.value.style.backgroundColor}`)},[S.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(o.XMLNS),viewBox:`0 0 ${u.value.width} ${u.value.height}`,style:"width:100%;background:transparent;overflow:visible"},[e.createVNode(j._sfc_main),e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{x1:"0%",y1:"0%",x2:"0%",y2:"100%",id:`pill_gradient_${p.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(o.setOpacity)(t.value.style.line.useColorTrend?s.value:t.value.style.line.stroke,t.value.style.area.opacity)},null,8,P),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.backgroundColor},null,8,G)],8,D)]),t.value.style.area.show&&a.value[0]?(e.openBlock(),e.createElementBlock("g",U,[t.value.style.line.smooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:`M ${a.value[0].x},${c.value.bottom} ${e.unref(o.createSmoothPath)(a.value)} L ${a.value.at(-1).x},${c.value.bottom} Z`,fill:t.value.style.area.useGradient?`url(#pill_gradient_${p.value})`:e.unref(o.setOpacity)(t.value.style.line.useColorTrend?s.value:t.value.style.line.stroke,t.value.style.area.opacity),stroke:"none"},null,8,W)):(e.openBlock(),e.createElementBlock("path",{key:1,d:`M${M.value}Z`,fill:t.value.style.area.useGradient?`url(#pill_gradient_${p.value})`:e.unref(o.setOpacity)(t.value.style.line.useColorTrend?s.value:t.value.style.line.stroke,t.value.style.area.opacity),stroke:"none"},null,8,Z))])):e.createCommentVNode("",!0),t.value.style.line.smooth&&a.value.length?(e.openBlock(),e.createElementBlock("path",{key:1,d:`M ${e.unref(o.createSmoothPath)(a.value)}`,stroke:t.value.style.line.useColorTrend?s.value:t.value.style.line.stroke,fill:"none","stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":t.value.style.line.strokeLinecap,"stroke-linejoin":t.value.style.line.strokeLinejoin},null,8,H)):e.createCommentVNode("",!0),!t.value.style.line.smooth&&a.value.length?(e.openBlock(),e.createElementBlock("path",{key:2,d:I.value,stroke:t.value.style.line.useColorTrend?s.value:t.value.style.line.stroke,fill:"none","stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":t.value.style.line.strokeLinecap,"stroke-linejoin":t.value.style.line.strokeLinejoin},null,8,R)):e.createCommentVNode("",!0),h.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("foreignObject",{key:3,height:u.value.height/2,width:u.value.height/2,x:u.value.height/5,y:8},[e.createElementVNode("div",J,[m.value==="positive"?(e.openBlock(),e.createBlock(N.default,{key:0,stroke:s.value,name:"arrowTop",size:u.value.height/2},null,8,["stroke","size"])):e.createCommentVNode("",!0),m.value==="negative"?(e.openBlock(),e.createBlock(N.default,{key:1,stroke:s.value,name:"arrowBottom",size:u.value.height/2},null,8,["stroke","size"])):e.createCommentVNode("",!0),m.value==="neutral"?(e.openBlock(),e.createBlock(N.default,{key:2,stroke:s.value,name:"arrowRight",size:u.value.height/2},null,8,["stroke","size"])):e.createCommentVNode("",!0)])],8,X)),h.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("text",{key:4,x:u.value.height/2-u.value.height/20,y:c.value.bottom,"text-anchor":"middle",fill:t.value.style.trendLabel.useColorTrend?s.value:t.value.style.trendLabel.color,"font-size":t.value.style.trendLabel.fontSize,"font-weight":t.value.style.trendLabel.bold?"bold":"normal"},e.toDisplayString(e.unref(o.dataLabel)({p:f.value>0?"+":"",v:f.value,s:"%",r:t.value.style.trendLabel.rounding})),9,K)),a.value.length&&a.value.at(-1).x!==void 0?(e.openBlock(),e.createElementBlock("circle",{key:5,stroke:t.value.style.backgroundColor,"stroke-width":2,cx:a.value.at(-1).x,cy:a.value.at(-1).y,r:4,fill:s.value},null,8,Q)):e.createCommentVNode("",!0),a.value.length&&a.value.at(-1).x!==void 0&&t.value.style.dataLabel.show?(e.openBlock(),e.createElementBlock("text",{key:6,"text-anchor":"middle",x:a.value.at(-1).x,y:a.value.at(-1).y-t.value.style.dataLabel.fontSize/1.5,"font-size":t.value.style.dataLabel.fontSize,fill:t.value.style.dataLabel.useColorTrend?s.value:t.value.style.dataLabel.color,"font-weight":t.value.style.dataLabel.bold?"bold":"normal"},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.dataLabel.formatter,a.value.at(-1).value,e.unref(o.dataLabel)({p:t.value.style.dataLabel.prefix,v:a.value.at(-1).value,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.rounding}),{datapoint:a.value.at(-1)})),9,Y)):e.createCommentVNode("",!0)],8,O)):(e.openBlock(),e.createBlock(F.default,{key:0,config:{type:"sparkline",style:{backgroundColor:t.value.style.backgroundColor,sparkline:{color:"#CCCCCC"}}}},null,8,["config"])),l.$slots.source?(e.openBlock(),e.createElementBlock("div",ee,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0)],12,A))}},le=q._export_sfc(te,[["__scopeId","data-v-96c5087f"]]);exports.default=le;
@@ -1,8 +1,8 @@
1
1
  import { computed as g, ref as x, watch as z, onMounted as q, nextTick as H, openBlock as n, createElementBlock as v, normalizeStyle as f, unref as s, renderSlot as b, normalizeProps as L, mergeProps as X, createCommentVNode as c, createElementVNode as d, toDisplayString as p, Fragment as O, renderList as R, guardReactiveProps as J, createVNode as K, createBlock as Q } from "vue";
2
- import { u as Y, c as Z, t as ee, a as te, p as k, b as le, o as ae, e as T, g as oe, d as se, s as $, i as w, f as _, X as ue, w as ne } from "./index-49zKC_pb.js";
3
- import { u as V } from "./useNestedProp-D1a8xzOZ.js";
4
- import ie from "./vue-ui-skeleton-CWI6cZZA.js";
5
- import { _ as re } from "./PackageVersion-ldwwWp9S.js";
2
+ import { u as Y, c as Z, t as ee, a as te, p as k, b as le, o as ae, e as T, g as oe, d as se, s as $, i as w, f as _, X as ue, w as ne } from "./index-Cn1EWnYG.js";
3
+ import { u as V } from "./useNestedProp-BXn-g9sr.js";
4
+ import ie from "./vue-ui-skeleton-D3AGluiW.js";
5
+ import { _ as re } from "./PackageVersion-Bw7N_9KM.js";
6
6
  const ve = ["onClick"], ce = { key: 1 }, de = ["xmlns", "viewBox"], fe = ["id"], pe = ["stop-color"], ye = ["stop-color"], me = ["height", "width", "fill", "rx"], ge = ["height", "width", "fill", "rx"], he = ["height", "width", "fill", "rx"], xe = {
7
7
  key: 2,
8
8
  ref: "source",
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-BIGzKAQq.cjs"),C=require("./useNestedProp-zN3-B_1z.cjs"),V=require("./vue-ui-skeleton-CoPAETjt.cjs"),D=require("./PackageVersion-VHviFq0W.cjs"),$=["onClick"],z={key:1},L=["xmlns","viewBox"],P=["id"],A=["stop-color"],F=["stop-color"],O=["height","width","fill","rx"],I=["height","width","fill","rx"],T=["height","width","fill","rx"],q={key:2,ref:"source",dir:"auto"},M={__name:"vue-ui-sparkbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}},backgroundOpacity:{type:Number,default:null}},emits:["selectDatapoint"],setup(p,{emit:b}){const n=p,{vue_ui_sparkbar:w}=o.useConfig(),v=e.computed(()=>!!n.dataset&&n.dataset.length),y=e.ref(o.createUid()),t=e.computed({get:()=>f(),set:l=>l});function f(){const l=C.useNestedProp({userConfig:n.config,defaultConfig:w});return l.theme?{...C.useNestedProp({userConfig:o.themes.vue_ui_sparkbar[l.theme]||n.config,defaultConfig:l}),customPalette:o.themePalettes[l.theme]||o.palette}:l}e.watch(()=>n.config,l=>{t.value=f()},{deep:!0});const S=e.computed(()=>o.convertCustomPalette(t.value.customPalette)),c=e.ref(n.dataset.map(l=>({...l,value:t.value.style.animation.show?0:l.value||0,formatter:l.formatter||null}))),g=e.ref(null);e.onMounted(async()=>{o.objectIsEmpty(n.dataset)&&o.error({componentName:"VueUiSparkbar",type:"dataset"}),h()});function h(){if(t.value.style.animation.show){let x=function(){i+=a/l,i<a?(c.value=c.value.map((u,m)=>({...u,value:u.value+=r[m]})),g.value=requestAnimationFrame(x)):c.value=n.dataset.map(u=>({...u,value:u.value||0,formatter:u.formatter||null}))};const l=t.value.style.animation.animationFrames,r=n.dataset.map((u,m)=>u.value/l),a=n.dataset.map(u=>u.value||0).reduce((u,m)=>u+m,0);let i=0;x()}}e.watch(()=>n.dataset,async l=>{cancelAnimationFrame(g.value),c.value=n.dataset.map(r=>({...r,value:t.value.style.animation.show?0:r.value||0,formatter:r.formatter||null})),e.nextTick(h)},{deep:!0});const s=e.ref({width:500,height:16}),N=e.computed(()=>Math.max(...n.dataset.map(l=>l.value))),_=e.computed(()=>(n.dataset.forEach((l,r)=>{o.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","value"]}).forEach(a=>{o.error({componentName:"VueUiSparkbar",type:"datasetSerieAttribute",property:a,index:r})})}),c.value.map((l,r)=>({...l,value:l.value||0,color:o.convertColorToHex(l.color)||S.value[r]||o.palette[r]||o.palette[r%o.palette.length]}))));function B(l){return l/N.value}function k(l){return t.value.style.layout.independant?l.target?l.value/l.target:t.value.style.layout.percentage?l.value>100?1:l.value/100:t.value.style.layout.target===0?1:l.value/t.value.style.layout.target:B(l.value)}function d(l){return t.value.style.layout.independant&&l.target||t.value.style.layout.target}function E(l,r){b("selectDatapoint",{datapoint:l,index:r})}return(l,r)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle({width:"100%",fontFamily:t.value.style.fontFamily,background:n.backgroundOpacity!==null?e.unref(o.setOpacity)(t.value.style.backgroundColor,n.backgroundOpacity):t.value.style.backgroundColor})},[l.$slots.title?e.renderSlot(l.$slots,"title",e.normalizeProps(e.mergeProps({key:0},{title:{...l.title,title:t.value.style.title.text,subtitle:t.value.style.title.subtitle.text}}))):e.createCommentVNode("",!0),!l.$slots.title&&t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:1,class:"vue-ui-sparkbar-title-container",style:e.normalizeStyle({background:t.value.style.title.backgroundColor,margin:t.value.style.title.margin,textAlign:t.value.style.title.textAlign})},[e.createElementVNode("div",{class:"vue-ui-sparkbar-title",style:e.normalizeStyle({fontSize:t.value.style.title.fontSize+"px",color:t.value.style.title.color,fontWeight: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,class:"vue-ui-sparkbar-subtitle",style:e.normalizeStyle({fontSize:t.value.style.title.subtitle.fontSize+"px",color:t.value.style.title.subtitle.color,fontWeight:t.value.style.title.subtitle.bold?"bold":"normal"})},e.toDisplayString(t.value.style.title.subtitle.text),5)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,(a,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[v.value?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`display:flex !important;${["left","right"].includes(t.value.style.labels.name.position)?`flex-direction: ${t.value.style.labels.name.position==="right"?"row-reverse":"row"} !important`:"flex-direction:column !important"};gap:${t.value.style.gap}px !important;align-items:center;${p.dataset.length>0&&i!==p.dataset.length-1?"margin-bottom:6px":""}`),onClick:()=>E(a,i)},[e.renderSlot(l.$slots,"data-label",e.normalizeProps(e.guardReactiveProps({bar:{...a,target:d(a),valueLabel:e.unref(o.applyDataLabel)(a.formatter,a.value,e.unref(o.dataLabel)({p:a.prefix||"",v:a.value,s:a.suffix||"",r:a.rounding||0}),{datapoint:a,seriesIndex:i}),targetLabel:e.unref(o.applyDataLabel)(a.formatter,d(a),e.unref(o.dataLabel)({p:a.prefix||"",v:d(a),s:a.suffix||"",r:a.rounding||0}),{datapoint:a,seriesIndex:i})}}))),l.$slots["data-label"]?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle({width:t.value.style.labels.name.width,color:t.value.style.labels.name.color,fontSize:t.value.style.labels.fontSize+"px",fontWeight:t.value.style.labels.name.bold?"bold":"normal",textAlign:["left","right"].includes(t.value.style.labels.name.position)||["top","top-left"].includes(t.value.style.labels.name.position)?"left":t.value.style.labels.name.position==="top-center"?"center":"right"})},[e.createElementVNode("span",null,e.toDisplayString(a.name),1),t.value.style.labels.value.show?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(`font-weight:${t.value.style.labels.value.bold?"bold":"normal"}`)},": "+e.toDisplayString(e.unref(o.applyDataLabel)(a.formatter,a.value,e.unref(o.dataLabel)({p:a.prefix||"",v:a.value,s:a.suffix||"",r:a.rounding||0}),{datapoint:a,seriesIndex:i})),5)):e.createCommentVNode("",!0),t.value.style.layout.showTargetValue?(e.openBlock(),e.createElementBlock("span",z,e.toDisplayString(" "+t.value.style.layout.targetValueText)+" "+e.toDisplayString(e.unref(o.applyDataLabel)(a.formatter,d(a),e.unref(o.dataLabel)({p:a.prefix||"",v:d(a),s:a.suffix||"",r:a.rounding||0}),{datapoint:a,seriesIndex:i})),1)):e.createCommentVNode("",!0)],4)),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(o.XMLNS),viewBox:`0 0 ${s.value.width} ${s.value.height}`,width:"100%"},[e.createVNode(D._sfc_main),e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{x1:"0%",y1:"0%",x2:"100%",y2:"0%",id:`sparkbar_gradient_${i}_${y.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(o.setOpacity)(e.unref(o.shiftHue)(a.color,.03),100-t.value.style.bar.gradient.intensity)},null,8,A),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,F)],8,P)]),e.createElementVNode("rect",{height:s.value.height,width:s.value.width,x:0,y:0,fill:e.unref(o.setOpacity)(t.value.style.gutter.backgroundColor,t.value.style.gutter.opacity),rx:s.value.height/2},null,8,O),e.createElementVNode("rect",{height:s.value.height,width:s.value.width*k(a),x:0,y:0,fill:t.value.style.bar.gradient.underlayerColor,rx:s.value.height/2},null,8,I),e.createElementVNode("rect",{height:s.value.height,width:s.value.width*k(a),x:0,y:0,fill:t.value.style.bar.gradient.show?`url(#sparkbar_gradient_${i}_${y.value})`:a.color,rx:s.value.height/2},null,8,T)],8,L))],12,$)):e.createCommentVNode("",!0)],64))),256)),l.$slots.source?(e.openBlock(),e.createElementBlock("div",q,[e.renderSlot(l.$slots,"source")],512)):e.createCommentVNode("",!0),v.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(V.default,{key:3,config:{type:"sparkbar",style:{backgroundColor:t.value.style.backgroundColor,sparkbar:{color:"#CCCCCC"}}}},null,8,["config"]))],4))}};exports.default=M;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-Ci5MafHS.cjs"),C=require("./useNestedProp-DxZ05ZEt.cjs"),V=require("./vue-ui-skeleton-Si57O3af.cjs"),D=require("./PackageVersion-DjuywB0J.cjs"),$=["onClick"],z={key:1},L=["xmlns","viewBox"],P=["id"],A=["stop-color"],F=["stop-color"],O=["height","width","fill","rx"],I=["height","width","fill","rx"],T=["height","width","fill","rx"],q={key:2,ref:"source",dir:"auto"},M={__name:"vue-ui-sparkbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}},backgroundOpacity:{type:Number,default:null}},emits:["selectDatapoint"],setup(p,{emit:b}){const n=p,{vue_ui_sparkbar:w}=o.useConfig(),v=e.computed(()=>!!n.dataset&&n.dataset.length),y=e.ref(o.createUid()),t=e.computed({get:()=>f(),set:l=>l});function f(){const l=C.useNestedProp({userConfig:n.config,defaultConfig:w});return l.theme?{...C.useNestedProp({userConfig:o.themes.vue_ui_sparkbar[l.theme]||n.config,defaultConfig:l}),customPalette:o.themePalettes[l.theme]||o.palette}:l}e.watch(()=>n.config,l=>{t.value=f()},{deep:!0});const S=e.computed(()=>o.convertCustomPalette(t.value.customPalette)),c=e.ref(n.dataset.map(l=>({...l,value:t.value.style.animation.show?0:l.value||0,formatter:l.formatter||null}))),g=e.ref(null);e.onMounted(async()=>{o.objectIsEmpty(n.dataset)&&o.error({componentName:"VueUiSparkbar",type:"dataset"}),h()});function h(){if(t.value.style.animation.show){let x=function(){i+=a/l,i<a?(c.value=c.value.map((u,m)=>({...u,value:u.value+=r[m]})),g.value=requestAnimationFrame(x)):c.value=n.dataset.map(u=>({...u,value:u.value||0,formatter:u.formatter||null}))};const l=t.value.style.animation.animationFrames,r=n.dataset.map((u,m)=>u.value/l),a=n.dataset.map(u=>u.value||0).reduce((u,m)=>u+m,0);let i=0;x()}}e.watch(()=>n.dataset,async l=>{cancelAnimationFrame(g.value),c.value=n.dataset.map(r=>({...r,value:t.value.style.animation.show?0:r.value||0,formatter:r.formatter||null})),e.nextTick(h)},{deep:!0});const s=e.ref({width:500,height:16}),N=e.computed(()=>Math.max(...n.dataset.map(l=>l.value))),_=e.computed(()=>(n.dataset.forEach((l,r)=>{o.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","value"]}).forEach(a=>{o.error({componentName:"VueUiSparkbar",type:"datasetSerieAttribute",property:a,index:r})})}),c.value.map((l,r)=>({...l,value:l.value||0,color:o.convertColorToHex(l.color)||S.value[r]||o.palette[r]||o.palette[r%o.palette.length]}))));function B(l){return l/N.value}function k(l){return t.value.style.layout.independant?l.target?l.value/l.target:t.value.style.layout.percentage?l.value>100?1:l.value/100:t.value.style.layout.target===0?1:l.value/t.value.style.layout.target:B(l.value)}function d(l){return t.value.style.layout.independant&&l.target||t.value.style.layout.target}function E(l,r){b("selectDatapoint",{datapoint:l,index:r})}return(l,r)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle({width:"100%",fontFamily:t.value.style.fontFamily,background:n.backgroundOpacity!==null?e.unref(o.setOpacity)(t.value.style.backgroundColor,n.backgroundOpacity):t.value.style.backgroundColor})},[l.$slots.title?e.renderSlot(l.$slots,"title",e.normalizeProps(e.mergeProps({key:0},{title:{...l.title,title:t.value.style.title.text,subtitle:t.value.style.title.subtitle.text}}))):e.createCommentVNode("",!0),!l.$slots.title&&t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:1,class:"vue-ui-sparkbar-title-container",style:e.normalizeStyle({background:t.value.style.title.backgroundColor,margin:t.value.style.title.margin,textAlign:t.value.style.title.textAlign})},[e.createElementVNode("div",{class:"vue-ui-sparkbar-title",style:e.normalizeStyle({fontSize:t.value.style.title.fontSize+"px",color:t.value.style.title.color,fontWeight: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,class:"vue-ui-sparkbar-subtitle",style:e.normalizeStyle({fontSize:t.value.style.title.subtitle.fontSize+"px",color:t.value.style.title.subtitle.color,fontWeight:t.value.style.title.subtitle.bold?"bold":"normal"})},e.toDisplayString(t.value.style.title.subtitle.text),5)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,(a,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[v.value?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`display:flex !important;${["left","right"].includes(t.value.style.labels.name.position)?`flex-direction: ${t.value.style.labels.name.position==="right"?"row-reverse":"row"} !important`:"flex-direction:column !important"};gap:${t.value.style.gap}px !important;align-items:center;${p.dataset.length>0&&i!==p.dataset.length-1?"margin-bottom:6px":""}`),onClick:()=>E(a,i)},[e.renderSlot(l.$slots,"data-label",e.normalizeProps(e.guardReactiveProps({bar:{...a,target:d(a),valueLabel:e.unref(o.applyDataLabel)(a.formatter,a.value,e.unref(o.dataLabel)({p:a.prefix||"",v:a.value,s:a.suffix||"",r:a.rounding||0}),{datapoint:a,seriesIndex:i}),targetLabel:e.unref(o.applyDataLabel)(a.formatter,d(a),e.unref(o.dataLabel)({p:a.prefix||"",v:d(a),s:a.suffix||"",r:a.rounding||0}),{datapoint:a,seriesIndex:i})}}))),l.$slots["data-label"]?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle({width:t.value.style.labels.name.width,color:t.value.style.labels.name.color,fontSize:t.value.style.labels.fontSize+"px",fontWeight:t.value.style.labels.name.bold?"bold":"normal",textAlign:["left","right"].includes(t.value.style.labels.name.position)||["top","top-left"].includes(t.value.style.labels.name.position)?"left":t.value.style.labels.name.position==="top-center"?"center":"right"})},[e.createElementVNode("span",null,e.toDisplayString(a.name),1),t.value.style.labels.value.show?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(`font-weight:${t.value.style.labels.value.bold?"bold":"normal"}`)},": "+e.toDisplayString(e.unref(o.applyDataLabel)(a.formatter,a.value,e.unref(o.dataLabel)({p:a.prefix||"",v:a.value,s:a.suffix||"",r:a.rounding||0}),{datapoint:a,seriesIndex:i})),5)):e.createCommentVNode("",!0),t.value.style.layout.showTargetValue?(e.openBlock(),e.createElementBlock("span",z,e.toDisplayString(" "+t.value.style.layout.targetValueText)+" "+e.toDisplayString(e.unref(o.applyDataLabel)(a.formatter,d(a),e.unref(o.dataLabel)({p:a.prefix||"",v:d(a),s:a.suffix||"",r:a.rounding||0}),{datapoint:a,seriesIndex:i})),1)):e.createCommentVNode("",!0)],4)),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(o.XMLNS),viewBox:`0 0 ${s.value.width} ${s.value.height}`,width:"100%"},[e.createVNode(D._sfc_main),e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{x1:"0%",y1:"0%",x2:"100%",y2:"0%",id:`sparkbar_gradient_${i}_${y.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(o.setOpacity)(e.unref(o.shiftHue)(a.color,.03),100-t.value.style.bar.gradient.intensity)},null,8,A),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,F)],8,P)]),e.createElementVNode("rect",{height:s.value.height,width:s.value.width,x:0,y:0,fill:e.unref(o.setOpacity)(t.value.style.gutter.backgroundColor,t.value.style.gutter.opacity),rx:s.value.height/2},null,8,O),e.createElementVNode("rect",{height:s.value.height,width:s.value.width*k(a),x:0,y:0,fill:t.value.style.bar.gradient.underlayerColor,rx:s.value.height/2},null,8,I),e.createElementVNode("rect",{height:s.value.height,width:s.value.width*k(a),x:0,y:0,fill:t.value.style.bar.gradient.show?`url(#sparkbar_gradient_${i}_${y.value})`:a.color,rx:s.value.height/2},null,8,T)],8,L))],12,$)):e.createCommentVNode("",!0)],64))),256)),l.$slots.source?(e.openBlock(),e.createElementBlock("div",q,[e.renderSlot(l.$slots,"source")],512)):e.createCommentVNode("",!0),v.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(V.default,{key:3,config:{type:"sparkbar",style:{backgroundColor:t.value.style.backgroundColor,sparkbar:{color:"#CCCCCC"}}}},null,8,["config"]))],4))}};exports.default=M;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-BIGzKAQq.cjs"),b=require("./useNestedProp-zN3-B_1z.cjs"),$=require("./vue-ui-skeleton-CoPAETjt.cjs"),w=require("./PackageVersion-VHviFq0W.cjs"),S=["xmlns","viewBox"],L=["id"],B=["stop-color"],E=["stop-color"],M=["d","stroke","stroke-linecap"],z=["d","stroke","stroke-linecap","stroke-dashoffset"],V=["x","y","font-size","fill","font-weight"],A={key:4,ref:"source",dir:"auto"},q={__name:"vue-ui-sparkgauge",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(C){const o=C,{vue_ui_sparkgauge:_}=s.useConfig(),c=e.computed(()=>!!o.dataset&&Object.keys(o.dataset).length);e.onMounted(()=>{d()});function d(){s.objectIsEmpty(o.dataset)?s.error({componentName:"VueUiSparkgauge",type:"dataset"}):s.getMissingDatasetAttributes({datasetObject:o.dataset,requiredAttributes:["value","min","max"]}).forEach(a=>{s.error({componentName:"VueUiSparkgauge",type:"datasetAttribute",property:a})})}const v=e.ref(s.createUid()),t=e.computed({get:()=>m(),set:a=>a});function m(){const a=b.useNestedProp({userConfig:o.config,defaultConfig:_});return a.theme?{...b.useNestedProp({userConfig:s.themes.vue_ui_sparkgauge[a.theme]||o.config,defaultConfig:a})}:a}e.watch(()=>o.config,a=>{t.value=m(),d()},{deep:!0});const u=e.computed(()=>({height:t.value.style.height,width:128,base:t.value.style.basePosition})),n=e.computed(()=>{const a=o.dataset.min??0,r=o.dataset.max??0,N=r-a;return{min:a,max:r,diff:N}}),l=e.ref(t.value.style.animation.show?n.value.min:o.dataset.value);e.watch(()=>o.dataset.value,()=>{y(o.dataset.value||0)});const f=e.computed(()=>l.value>n.value.max?n.value.max:l.value<n.value.min?n.value.min:l.value),p=e.computed(()=>n.value.diff/t.value.style.animation.speedMs);e.onMounted(()=>{y(o.dataset.value||0)});function y(a){function r(){l.value<a?l.value=Math.min(l.value+p.value,a):l.value>a&&(l.value=Math.max(l.value-p.value,a)),l.value!==a&&requestAnimationFrame(r)}r()}const i=e.computed(()=>o.dataset.title??""),g=e.computed(()=>l.value>=0?(f.value-n.value.min)/n.value.diff:(Math.abs(n.value.min)-Math.abs(f.value))/n.value.diff),k=e.computed(()=>s.interpolateColorHex(t.value.style.colors.min,t.value.style.colors.max,n.value.min,n.value.max,l.value)),h=e.computed(()=>t.value.style.dataLabel.autoColor?k.value:t.value.style.dataLabel.color),x=e.computed(()=>t.value.style.track.autoColor?k.value:t.value.style.track.color);return(a,r)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width: 100%; background:${t.value.style.background}`)},[t.value.style.title.show&&i.value&&t.value.style.title.position==="top"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vue-data-ui-sparkgauge-label",style:e.normalizeStyle(`font-size:${t.value.style.title.fontSize}px;text-align:${t.value.style.title.textAlign};font-weight:${t.value.style.title.bold?"bold":"normal"};color:${t.value.style.title.color}`)},e.toDisplayString(i.value),5)):e.createCommentVNode("",!0),c.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(s.XMLNS),viewBox:`0 0 ${u.value.width} ${u.value.height}`,style:"overflow: visible; background:transparent; width:100%;"},[e.createVNode(w._sfc_main),e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`gradient_${v.value}`,x1:"-10%",y1:"100%",x2:"110%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.colors.min},null,8,B),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.colors.max},null,8,E)],8,L)]),e.createElementVNode("path",{d:`M10 ${u.value.base} A 1 1 0 1 1 118 ${u.value.base}`,stroke:t.value.style.gutter.color,"stroke-width":8,"stroke-linecap":t.value.style.gutter.strokeLinecap,fill:"none"},null,8,M),g.value!==0?(e.openBlock(),e.createElementBlock("path",{key:0,d:`M10 ${u.value.base} A 1 1 0 1 1 118 ${u.value.base}`,stroke:t.value.style.colors.showGradient?`url(#gradient_${v.value})`:x.value,"stroke-width":8,"stroke-linecap":t.value.style.track.strokeLinecap,fill:"none","stroke-dasharray":169.5,"stroke-dashoffset":169.5-169.5*g.value,class:e.normalizeClass({"vue-ui-sparkgauge-track":t.value.style.animation.show}),style:e.normalizeStyle(t.value.style.animation.show?`animation: vue-ui-sparkgauge-animation ${t.value.style.animation.speedMs}ms ease-in;`:"")},null,14,z)):e.createCommentVNode("",!0),e.createElementVNode("text",{"text-anchor":"middle",x:u.value.width/2,y:u.value.base+6+t.value.style.dataLabel.offsetY,"font-size":t.value.style.dataLabel.fontSize,fill:h.value,"font-weight":t.value.style.dataLabel.bold?"bold":"normal"},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.dataLabel.formatter,e.unref(s.checkNaN)(l.value),e.unref(s.dataLabel)({p:t.value.style.dataLabel.prefix,v:e.unref(s.checkNaN)(l.value),s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.rounding}),{datapoint:e.unref(s.checkNaN)(l.value),color:h.value})),9,V)],8,S)):e.createCommentVNode("",!0),c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock($.default,{key:2,config:{type:"gauge",style:{backgroundColor:t.value.style.background,gauge:{color:"#CCCCCC"}}}},null,8,["config"])),t.value.style.title.show&&i.value&&t.value.style.title.position==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:3,class:"vue-data-ui-sparkgauge-label",style:e.normalizeStyle(`font-size:${t.value.style.title.fontSize}px;text-align:${t.value.style.title.textAlign};font-weight:${t.value.style.title.bold?"bold":"normal"};font-weight:${t.value.style.title.bold?"bold":"normal"};color:${t.value.style.title.color}`)},e.toDisplayString(i.value),5)):e.createCommentVNode("",!0),a.$slots.source?(e.openBlock(),e.createElementBlock("div",A,[e.renderSlot(a.$slots,"source")],512)):e.createCommentVNode("",!0)],4))}};exports.default=q;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-Ci5MafHS.cjs"),b=require("./useNestedProp-DxZ05ZEt.cjs"),$=require("./vue-ui-skeleton-Si57O3af.cjs"),w=require("./PackageVersion-DjuywB0J.cjs"),S=["xmlns","viewBox"],L=["id"],B=["stop-color"],E=["stop-color"],M=["d","stroke","stroke-linecap"],z=["d","stroke","stroke-linecap","stroke-dashoffset"],V=["x","y","font-size","fill","font-weight"],A={key:4,ref:"source",dir:"auto"},q={__name:"vue-ui-sparkgauge",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(C){const o=C,{vue_ui_sparkgauge:_}=s.useConfig(),c=e.computed(()=>!!o.dataset&&Object.keys(o.dataset).length);e.onMounted(()=>{d()});function d(){s.objectIsEmpty(o.dataset)?s.error({componentName:"VueUiSparkgauge",type:"dataset"}):s.getMissingDatasetAttributes({datasetObject:o.dataset,requiredAttributes:["value","min","max"]}).forEach(a=>{s.error({componentName:"VueUiSparkgauge",type:"datasetAttribute",property:a})})}const v=e.ref(s.createUid()),t=e.computed({get:()=>m(),set:a=>a});function m(){const a=b.useNestedProp({userConfig:o.config,defaultConfig:_});return a.theme?{...b.useNestedProp({userConfig:s.themes.vue_ui_sparkgauge[a.theme]||o.config,defaultConfig:a})}:a}e.watch(()=>o.config,a=>{t.value=m(),d()},{deep:!0});const u=e.computed(()=>({height:t.value.style.height,width:128,base:t.value.style.basePosition})),n=e.computed(()=>{const a=o.dataset.min??0,r=o.dataset.max??0,N=r-a;return{min:a,max:r,diff:N}}),l=e.ref(t.value.style.animation.show?n.value.min:o.dataset.value);e.watch(()=>o.dataset.value,()=>{y(o.dataset.value||0)});const f=e.computed(()=>l.value>n.value.max?n.value.max:l.value<n.value.min?n.value.min:l.value),p=e.computed(()=>n.value.diff/t.value.style.animation.speedMs);e.onMounted(()=>{y(o.dataset.value||0)});function y(a){function r(){l.value<a?l.value=Math.min(l.value+p.value,a):l.value>a&&(l.value=Math.max(l.value-p.value,a)),l.value!==a&&requestAnimationFrame(r)}r()}const i=e.computed(()=>o.dataset.title??""),g=e.computed(()=>l.value>=0?(f.value-n.value.min)/n.value.diff:(Math.abs(n.value.min)-Math.abs(f.value))/n.value.diff),k=e.computed(()=>s.interpolateColorHex(t.value.style.colors.min,t.value.style.colors.max,n.value.min,n.value.max,l.value)),h=e.computed(()=>t.value.style.dataLabel.autoColor?k.value:t.value.style.dataLabel.color),x=e.computed(()=>t.value.style.track.autoColor?k.value:t.value.style.track.color);return(a,r)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width: 100%; background:${t.value.style.background}`)},[t.value.style.title.show&&i.value&&t.value.style.title.position==="top"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vue-data-ui-sparkgauge-label",style:e.normalizeStyle(`font-size:${t.value.style.title.fontSize}px;text-align:${t.value.style.title.textAlign};font-weight:${t.value.style.title.bold?"bold":"normal"};color:${t.value.style.title.color}`)},e.toDisplayString(i.value),5)):e.createCommentVNode("",!0),c.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(s.XMLNS),viewBox:`0 0 ${u.value.width} ${u.value.height}`,style:"overflow: visible; background:transparent; width:100%;"},[e.createVNode(w._sfc_main),e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`gradient_${v.value}`,x1:"-10%",y1:"100%",x2:"110%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.colors.min},null,8,B),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.colors.max},null,8,E)],8,L)]),e.createElementVNode("path",{d:`M10 ${u.value.base} A 1 1 0 1 1 118 ${u.value.base}`,stroke:t.value.style.gutter.color,"stroke-width":8,"stroke-linecap":t.value.style.gutter.strokeLinecap,fill:"none"},null,8,M),g.value!==0?(e.openBlock(),e.createElementBlock("path",{key:0,d:`M10 ${u.value.base} A 1 1 0 1 1 118 ${u.value.base}`,stroke:t.value.style.colors.showGradient?`url(#gradient_${v.value})`:x.value,"stroke-width":8,"stroke-linecap":t.value.style.track.strokeLinecap,fill:"none","stroke-dasharray":169.5,"stroke-dashoffset":169.5-169.5*g.value,class:e.normalizeClass({"vue-ui-sparkgauge-track":t.value.style.animation.show}),style:e.normalizeStyle(t.value.style.animation.show?`animation: vue-ui-sparkgauge-animation ${t.value.style.animation.speedMs}ms ease-in;`:"")},null,14,z)):e.createCommentVNode("",!0),e.createElementVNode("text",{"text-anchor":"middle",x:u.value.width/2,y:u.value.base+6+t.value.style.dataLabel.offsetY,"font-size":t.value.style.dataLabel.fontSize,fill:h.value,"font-weight":t.value.style.dataLabel.bold?"bold":"normal"},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.dataLabel.formatter,e.unref(s.checkNaN)(l.value),e.unref(s.dataLabel)({p:t.value.style.dataLabel.prefix,v:e.unref(s.checkNaN)(l.value),s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.rounding}),{datapoint:e.unref(s.checkNaN)(l.value),color:h.value})),9,V)],8,S)):e.createCommentVNode("",!0),c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock($.default,{key:2,config:{type:"gauge",style:{backgroundColor:t.value.style.background,gauge:{color:"#CCCCCC"}}}},null,8,["config"])),t.value.style.title.show&&i.value&&t.value.style.title.position==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:3,class:"vue-data-ui-sparkgauge-label",style:e.normalizeStyle(`font-size:${t.value.style.title.fontSize}px;text-align:${t.value.style.title.textAlign};font-weight:${t.value.style.title.bold?"bold":"normal"};font-weight:${t.value.style.title.bold?"bold":"normal"};color:${t.value.style.title.color}`)},e.toDisplayString(i.value),5)):e.createCommentVNode("",!0),a.$slots.source?(e.openBlock(),e.createElementBlock("div",A,[e.renderSlot(a.$slots,"source")],512)):e.createCommentVNode("",!0)],4))}};exports.default=q;
@@ -1,8 +1,8 @@
1
1
  import { computed as s, onMounted as N, ref as A, watch as M, openBlock as n, createElementBlock as i, normalizeStyle as m, toDisplayString as y, createCommentVNode as v, unref as c, createVNode as D, createElementVNode as d, normalizeClass as E, createBlock as G, renderSlot as I } from "vue";
2
- import { u as U, o as q, e as S, g as P, c as R, t as T, N as X, X as H, i as V, v as p, f as Y } from "./index-49zKC_pb.js";
3
- import { u as z } from "./useNestedProp-D1a8xzOZ.js";
4
- import J from "./vue-ui-skeleton-CWI6cZZA.js";
5
- import { _ as K } from "./PackageVersion-ldwwWp9S.js";
2
+ import { u as U, o as q, e as S, g as P, c as R, t as T, N as X, X as H, i as V, v as p, f as Y } from "./index-Cn1EWnYG.js";
3
+ import { u as z } from "./useNestedProp-BXn-g9sr.js";
4
+ import J from "./vue-ui-skeleton-D3AGluiW.js";
5
+ import { _ as K } from "./PackageVersion-Bw7N_9KM.js";
6
6
  const Q = ["xmlns", "viewBox"], W = ["id"], Z = ["stop-color"], ee = ["stop-color"], te = ["d", "stroke", "stroke-linecap"], ae = ["d", "stroke", "stroke-linecap", "stroke-dashoffset"], le = ["x", "y", "font-size", "fill", "font-weight"], oe = {
7
7
  key: 4,
8
8
  ref: "source",
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-BIGzKAQq.cjs"),_=require("./useNestedProp-zN3-B_1z.cjs"),F=require("./Shape-CR3-qftC.cjs"),M=require("./vue-ui-skeleton-CoPAETjt.cjs"),O=require("./PackageVersion-VHviFq0W.cjs"),A=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),H={key:0},q={key:1},I=["xmlns","viewBox"],U=["id"],W=["stop-color"],P=["stop-color"],j=["id"],G=["stop-color"],T=["stop-color"],X=["id"],Y=["stop-color"],R=["stop-color"],J={key:0},K=["x","y","height","width","fill","stroke","stroke-width","rx"],Q={key:1},Z=["x","y","font-size","font-weight","fill"],ee=["x","y","font-size","fill"],te=["x","y","font-size","fill"],le=["height","width","x","onMouseover","stroke","stroke-width","rx","stroke-dasharray","onClick"],oe={key:2,ref:"source",dir:"auto"},ae={__name:"vue-ui-sparkhistogram",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(x,{emit:B}){const i=x;e.useCssVars(o=>({"3d57fabd":S.value}));const{vue_ui_sparkhistogram:E}=a.useConfig(),h=e.computed(()=>!!i.dataset&&i.dataset.length);e.onMounted(()=>{k()});function k(){a.objectIsEmpty(i.dataset)?a.error({componentName:"VueUiSparkHistogram",type:"dataset"}):i.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:i.config,defaultConfig:E});return o.theme?{..._.useNestedProp({userConfig:a.themes.vue_ui_sparkhistogram[o.theme]||i.config,defaultConfig:o})}:o}e.watch(()=>i.config,o=>{t.value=b(),k()},{deep:!0});const c=e.computed(()=>{const o=t.value.style.layout.height,r=t.value.style.layout.width,l=t.value.style.layout.padding.top,s=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,f=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:s,centerY:p,drawingHeight:f,drawingWidth:m,height:o,left:d,right:y,top:l,width:r}}),w=e.computed(()=>Math.max(...i.dataset.map(o=>Math.abs(o.value||0))));function C(o){return Math.abs(o)/w.value}const u=e.computed(()=>i.dataset.map((o,r)=>{const l=C(o.value||0),s=c.value.drawingHeight*l,d=c.value.drawingWidth/i.dataset.length,y=d*(t.value.style.bars.gap/100),p=d-y,f=c.value.centerY-s/2,m=c.value.left+(y/2+r*d),L=c.value.left+r*d,g=typeof o.intensity>"u"?100:Math.round(o.intensity*100),N=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:N,gradient:z,height:s,intensity:g,proportion:l,stroke:V,textAnchor:D,trapX:L,unitWidth:d,width:p,x:m,y:f}})),n=e.ref(null);function $(o,r){B("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=>n.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),n.value!==null?(e.openBlock(),e.createElementBlock("span",H,"- "+e.toDisplayString(u.value[n.value].timeLabel||"")+" "+e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.labels.value.formatter,u.value[n.value].value,e.unref(a.dataLabel)({p:t.value.style.labels.value.prefix,v:u.value[n.value].value,s:t.value.style.labels.value.suffix,r:t.value.style.labels.value.rounding}),{datapoint:u.value[n.value],seriesIndex:n.value})),1)):e.createCommentVNode("",!0),![void 0,null].includes(n.value)&&![null,void 0].includes(u.value[n.value].valueLabel)?(e.openBlock(),e.createElementBlock("span",q,"("+e.toDisplayString(u.value[n.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),h.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(a.XMLNS),viewBox:`0 0 ${c.value.width} ${c.value.height}`,style:{overflow:"visible"}},[e.createVNode(O._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(l,s)=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`gradient_positive_${s}_${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,W),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(a.setOpacity)(t.value.style.bars.colors.positive,l.intensity)},null,8,P)],8,U))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(l,s)=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`gradient_negative_${s}_${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,G),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(a.setOpacity)(t.value.style.bars.colors.negative,l.intensity)},null,8,T)],8,j))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(l,s)=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`gradient_datapoint_${s}_${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,Y),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(a.setOpacity)(l.color,l.intensity)},null,8,R)],8,X))),256))]),!t.value.style.bars.shape||t.value.style.bars.shape==="square"?(e.openBlock(),e.createElementBlock("g",J,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(l,s)=>(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,K))),256))])):(e.openBlock(),e.createElementBlock("g",Q,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(l,s)=>(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(u.value,(l,s)=>(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:u.value[n.value],seriesIndex:n.value})),9,Z))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(l,s)=>(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,ee)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",null,[l.timeLabel?(e.openBlock(),e.createElementBlock("text",{key:0,x:l.textAnchor,y:c.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,te)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{height:c.value.height,width:l.unitWidth,fill:"transparent",x:l.trapX,y:0,onMouseover:d=>n.value=s,onMouseleave:r[0]||(r[0]=d=>n.value=null),stroke:n.value!==null&&n.value===s?t.value.style.selector.stroke:"","stroke-width":n.value!==null&&n.value===s?t.value.style.selector.strokeWidth:0,rx:t.value.style.selector.borderRadius,"stroke-dasharray":t.value.style.selector.strokeDasharray,onClick:()=>$(l,s)},null,40,le)]))),256))],8,I)):e.createCommentVNode("",!0),o.$slots.source?(e.openBlock(),e.createElementBlock("div",oe,[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),h.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(ae,[["__scopeId","data-v-4e962555"]]);exports.default=se;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-Ci5MafHS.cjs"),_=require("./useNestedProp-DxZ05ZEt.cjs"),F=require("./Shape-BfZLKYNk.cjs"),M=require("./vue-ui-skeleton-Si57O3af.cjs"),O=require("./PackageVersion-DjuywB0J.cjs"),A=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),H={key:0},q={key:1},I=["xmlns","viewBox"],U=["id"],W=["stop-color"],P=["stop-color"],j=["id"],G=["stop-color"],T=["stop-color"],X=["id"],Y=["stop-color"],R=["stop-color"],J={key:0},K=["x","y","height","width","fill","stroke","stroke-width","rx"],Q={key:1},Z=["x","y","font-size","font-weight","fill"],ee=["x","y","font-size","fill"],te=["x","y","font-size","fill"],le=["height","width","x","onMouseover","stroke","stroke-width","rx","stroke-dasharray","onClick"],oe={key:2,ref:"source",dir:"auto"},ae={__name:"vue-ui-sparkhistogram",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(x,{emit:B}){const i=x;e.useCssVars(o=>({"3d57fabd":S.value}));const{vue_ui_sparkhistogram:E}=a.useConfig(),h=e.computed(()=>!!i.dataset&&i.dataset.length);e.onMounted(()=>{k()});function k(){a.objectIsEmpty(i.dataset)?a.error({componentName:"VueUiSparkHistogram",type:"dataset"}):i.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:i.config,defaultConfig:E});return o.theme?{..._.useNestedProp({userConfig:a.themes.vue_ui_sparkhistogram[o.theme]||i.config,defaultConfig:o})}:o}e.watch(()=>i.config,o=>{t.value=b(),k()},{deep:!0});const c=e.computed(()=>{const o=t.value.style.layout.height,r=t.value.style.layout.width,l=t.value.style.layout.padding.top,s=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,f=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:s,centerY:p,drawingHeight:f,drawingWidth:m,height:o,left:d,right:y,top:l,width:r}}),w=e.computed(()=>Math.max(...i.dataset.map(o=>Math.abs(o.value||0))));function C(o){return Math.abs(o)/w.value}const u=e.computed(()=>i.dataset.map((o,r)=>{const l=C(o.value||0),s=c.value.drawingHeight*l,d=c.value.drawingWidth/i.dataset.length,y=d*(t.value.style.bars.gap/100),p=d-y,f=c.value.centerY-s/2,m=c.value.left+(y/2+r*d),L=c.value.left+r*d,g=typeof o.intensity>"u"?100:Math.round(o.intensity*100),N=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:N,gradient:z,height:s,intensity:g,proportion:l,stroke:V,textAnchor:D,trapX:L,unitWidth:d,width:p,x:m,y:f}})),n=e.ref(null);function $(o,r){B("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=>n.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),n.value!==null?(e.openBlock(),e.createElementBlock("span",H,"- "+e.toDisplayString(u.value[n.value].timeLabel||"")+" "+e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.labels.value.formatter,u.value[n.value].value,e.unref(a.dataLabel)({p:t.value.style.labels.value.prefix,v:u.value[n.value].value,s:t.value.style.labels.value.suffix,r:t.value.style.labels.value.rounding}),{datapoint:u.value[n.value],seriesIndex:n.value})),1)):e.createCommentVNode("",!0),![void 0,null].includes(n.value)&&![null,void 0].includes(u.value[n.value].valueLabel)?(e.openBlock(),e.createElementBlock("span",q,"("+e.toDisplayString(u.value[n.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),h.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(a.XMLNS),viewBox:`0 0 ${c.value.width} ${c.value.height}`,style:{overflow:"visible"}},[e.createVNode(O._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(l,s)=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`gradient_positive_${s}_${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,W),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(a.setOpacity)(t.value.style.bars.colors.positive,l.intensity)},null,8,P)],8,U))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(l,s)=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`gradient_negative_${s}_${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,G),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(a.setOpacity)(t.value.style.bars.colors.negative,l.intensity)},null,8,T)],8,j))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(l,s)=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`gradient_datapoint_${s}_${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,Y),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(a.setOpacity)(l.color,l.intensity)},null,8,R)],8,X))),256))]),!t.value.style.bars.shape||t.value.style.bars.shape==="square"?(e.openBlock(),e.createElementBlock("g",J,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(l,s)=>(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,K))),256))])):(e.openBlock(),e.createElementBlock("g",Q,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(l,s)=>(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(u.value,(l,s)=>(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:u.value[n.value],seriesIndex:n.value})),9,Z))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(l,s)=>(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,ee)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",null,[l.timeLabel?(e.openBlock(),e.createElementBlock("text",{key:0,x:l.textAnchor,y:c.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,te)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{height:c.value.height,width:l.unitWidth,fill:"transparent",x:l.trapX,y:0,onMouseover:d=>n.value=s,onMouseleave:r[0]||(r[0]=d=>n.value=null),stroke:n.value!==null&&n.value===s?t.value.style.selector.stroke:"","stroke-width":n.value!==null&&n.value===s?t.value.style.selector.strokeWidth:0,rx:t.value.style.selector.borderRadius,"stroke-dasharray":t.value.style.selector.strokeDasharray,onClick:()=>$(l,s)},null,40,le)]))),256))],8,I)):e.createCommentVNode("",!0),o.$slots.source?(e.openBlock(),e.createElementBlock("div",oe,[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),h.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(ae,[["__scopeId","data-v-4e962555"]]);exports.default=se;
@@ -1,9 +1,9 @@
1
1
  import { useCssVars as J, computed as _, onMounted as K, ref as N, watch as Q, openBlock as a, createElementBlock as s, normalizeStyle as $, createElementVNode as y, createTextVNode as Z, toDisplayString as g, unref as n, createCommentVNode as h, createVNode as ee, Fragment as f, renderList as p, normalizeClass as D, createBlock as I, renderSlot as te } from "vue";
2
- import { u as le, o as ae, e as V, g as se, c as oe, t as ue, s as m, i as H, f as E, X as re, w as z } from "./index-49zKC_pb.js";
3
- import { u as F } from "./useNestedProp-D1a8xzOZ.js";
4
- import { _ as ie } from "./Shape-CL9-IFMq.js";
5
- import ne from "./vue-ui-skeleton-CWI6cZZA.js";
6
- import { _ as ve } from "./PackageVersion-ldwwWp9S.js";
2
+ import { u as le, o as ae, e as V, g as se, c as oe, t as ue, s as m, i as H, f as E, X as re, w as z } from "./index-Cn1EWnYG.js";
3
+ import { u as F } from "./useNestedProp-BXn-g9sr.js";
4
+ import { _ as ie } from "./Shape-CppjH62a.js";
5
+ import ne from "./vue-ui-skeleton-D3AGluiW.js";
6
+ import { _ as ve } from "./PackageVersion-Bw7N_9KM.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 = ["id"], pe = ["stop-color"], ge = ["stop-color"], me = ["id"], be = ["stop-color"], _e = ["stop-color"], xe = ["id"], ke = ["stop-color"], we = ["stop-color"], $e = { key: 0 }, Ce = ["x", "y", "height", "width", "fill", "stroke", "stroke-width", "rx"], Le = { key: 1 }, ze = ["x", "y", "font-size", "font-weight", "fill"], Se = ["x", "y", "font-size", "fill"], Me = ["x", "y", "font-size", "fill"], Ae = ["height", "width", "x", "onMouseover", "stroke", "stroke-width", "rx", "stroke-dasharray", "onClick"], Ne = {
9
9
  key: 2,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-BIGzKAQq.cjs"),S=require("./useNestedProp-zN3-B_1z.cjs"),G=require("./vue-ui-skeleton-CoPAETjt.cjs"),M=require("./useResponsive-BJ7DTGpm.cjs"),j=require("./PackageVersion-VHviFq0W.cjs"),R=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),H=["id"],U=["xmlns","viewBox"],X=["id"],Z=["stop-color"],Y=["stop-color"],J=["id"],K=["stop-color"],Q=["stop-color"],ee=["id"],te=["stop-color"],le=["stop-color"],ae={key:0},oe=["d","fill"],ne=["d","fill"],ue=["d","stroke","stroke-width"],re=["x1","x2","y1","y2","stroke","stroke-width"],se=["x","y","width","height","fill","rx"],ie=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],de=["x1","x2","y1","y2","stroke","stroke-dasharray","stroke-width"],ce=["cx","cy","r","fill","stroke","stroke-width"],ve=["x","y","font-size","font-weight","fill"],he=["x","y","height","width","onMouseenter","onClick"],ye={__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}},emits:["hoverIndex","selectDatapoint"],setup(f,{emit:_}){const i=f,{vue_ui_sparkline:z}=u.useConfig(),g=e.computed(()=>!!i.dataset&&i.dataset.length),v=e.ref(u.createUid()),x=e.ref(null),B=e.ref(null),L=e.ref(null),t=e.computed({get:()=>C(),set:l=>l});function C(){const l=S.useNestedProp({userConfig:i.config,defaultConfig:z});return l.theme?{...S.useNestedProp({userConfig:u.themes.vue_ui_sparkline[l.theme]||i.config,defaultConfig:l})}:l}e.watch(()=>i.config,l=>{t.value=C(),E(),o.value.chartWidth=t.value.style.chartWidth},{deep:!0}),e.watch(()=>i.dataset,l=>{p.value=i.dataset.map(n=>({...n,value:[void 0].includes(n.value)?null:n.value}))},{deep:!0});const p=e.ref(P());function P(){return i.dataset.map(l=>t.value.style.animation.show?{...l,value:null}:{...l,value:[void 0].includes(l.value)?null:l.value})}const V=e.ref(null);e.onMounted(()=>{if(E(),t.value.style.animation.show&&i.dataset.length>1){let a=function(){n<i.dataset.length?(p.value.push(i.dataset[n]),setTimeout(()=>{requestAnimationFrame(a)},l)):p.value=i.dataset,n+=1};p.value=[];const l=t.value.style.animation.animationFrames/i.dataset.length;let n=0;a()}});function E(){if(u.objectIsEmpty(i.dataset)?u.error({componentName:"VueUiSparkline",type:"dataset"}):i.dataset.forEach((l,n)=>{u.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["period","value"]}).forEach(a=>{u.error({componentName:"VueUiSparkline",type:"datasetSerieAttribute",property:a,index:n})})}),t.value.responsive){const l=M.throttle(()=>{const{width:n,height:a}=M.useResponsive({chart:x.value,title:t.value.style.title.show&&i.showInfo?B.value:null,source:L.value});o.value.width=n,o.value.height=a,o.value.chartWidth=t.value.style.chartWidth/500*n,o.value.padding=.06*n});V.value=new ResizeObserver(l),V.value.observe(x.value.parentNode)}}const o=e.ref({height:80,width:500,chartWidth:t.value.style.chartWidth,padding:30}),D=e.ref(6),r=e.computed(()=>({top:12,left:0,right:o.value.width,bottom:o.value.height-3,start:i.showInfo&&t.value.style.dataLabel.show&&t.value.style.dataLabel.position==="left"?o.value.width-o.value.chartWidth:o.value.padding,width:i.showInfo&&t.value.style.dataLabel.show?o.value.chartWidth:o.value.width-o.value.padding,height:o.value.height-12})),w=e.computed(()=>Math.min(...p.value.map(l=>isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0))),W=e.computed(()=>Math.max(...p.value.map(l=>isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0))),m=e.computed(()=>{const l=w.value>=0?0:w.value;return Math.abs(l)}),A=e.computed(()=>W.value+m.value+D.value),b=e.computed(()=>r.value.bottom-r.value.height*N(m.value));function N(l){return l/A.value}const h=e.computed(()=>i.dataset.length-1),s=e.computed(()=>p.value.map((l,n)=>{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:N(a+m.value),x:r.value.start+n*(r.value.width/(h.value+1)>o.padding?o.padding:r.value.width/(h.value+1)),y:r.value.bottom-r.value.height*N(a+m.value),id:`plot_${v.value}_${n}`,color:k.value?t.value.style.bar.color:t.value.style.area.useGradient?u.shiftHue(t.value.style.line.color,.05*(1-n/h.value)):t.value.style.line.color,width:r.value.width/(h.value+1)>o.padding?o.padding:r.value.width/(h.value+1)}})),O=e.computed(()=>{const l={x:s.value[0].x,y:o.value.height-6},n={x:s.value[s.value.length-1].x,y:o.value.height-6},a=[];return s.value.forEach(d=>{a.push(`${d.x},${d.y} `)}),[l.x,l.y,...a,n.x,n.y].toString()}),c=e.ref(void 0);function F(l,n){c.value=l,_("hoverIndex",{index:n})}function q(){c.value=void 0,_("hoverIndex",{index:void 0})}const y=e.computed(()=>{if(g.value){const l=s.value.map(a=>a.absoluteValue),n=l.reduce((a,d)=>a+d,0);return{latest:s.value[s.value.length-1].absoluteValue,sum:n,average:n/s.value.length,median:u.calcMedian(l),trend:u.calcLinearProgression(s.value.map(({x:a,y:d,absoluteValue:I})=>({x:a,y:d,value:I}))).trend}}else return{latest:null,sum:null,average:null,median:null,trend:null}}),$=e.computed(()=>g.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),k=e.computed(()=>t.value.type&&t.value.type==="bar");function T(l,n){_("selectDatapoint",{datapoint:l,index:n})}return(l,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"sparklineChart",ref:x,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&&f.showInfo?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:B,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),g.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(u.XMLNS),viewBox:`0 0 ${o.value.width} ${o.value.height}`,style:e.normalizeStyle(`background:${t.value.style.backgroundColor};overflow:visible`)},[e.createVNode(j._sfc_main),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(u.setOpacity)(e.unref(u.shiftHue)(t.value.style.area.color,.05),t.value.style.area.opacity)},null,8,Z),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(u.setOpacity)(t.value.style.area.color,t.value.style.area.opacity)},null,8,Y)],8,X),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,K),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(u.shiftHue)(t.value.style.bar.color,.05)},null,8,Q)],8,J),e.createElementVNode("linearGradient",{x2:"0%",y2:"100%",id:`sparkline_bar_gradient_neg_${v.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(u.shiftHue)(t.value.style.bar.color,.05)},null,8,te),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.bar.color},null,8,le)],8,ee)]),t.value.style.area.show&&!k.value&&s.value[0]?(e.openBlock(),e.createElementBlock("g",ae,[t.value.style.line.smooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:`M ${s.value[0].x},${r.value.bottom} ${e.unref(u.createSmoothPath)(s.value)} L ${s.value.at(-1).x},${r.value.bottom} Z`,fill:t.value.style.area.useGradient?`url(#sparkline_gradient_${v.value})`:e.unref(u.setOpacity)(t.value.style.area.color,t.value.style.area.opacity)},null,8,oe)):(e.openBlock(),e.createElementBlock("path",{key:1,d:`M${O.value}Z`,fill:t.value.style.area.useGradient?`url(#sparkline_gradient_${v.value})`:e.unref(u.setOpacity)(t.value.style.area.color,t.value.style.area.opacity)},null,8,ne))])):e.createCommentVNode("",!0),t.value.style.line.smooth&&!k.value?(e.openBlock(),e.createElementBlock("path",{key:1,d:`M ${e.unref(u.createSmoothPath)(s.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(s.value,(a,d)=>(e.openBlock(),e.createElementBlock("g",null,[d<s.value.length-1&&!t.value.style.line.smooth&&!k.value?(e.openBlock(),e.createElementBlock("line",{key:0,x1:a.x,x2:s.value[d+1].x,y1:a.y,y2:s.value[d+1].y,stroke:a.color,"stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round","shape-rendering":"geometricPrecision"},null,8,re)):e.createCommentVNode("",!0),k.value?(e.openBlock(),e.createElementBlock("rect",{key:1,x:a.x-a.width/2,y:a.absoluteValue>0?a.y:b.value,width:a.width,height:Math.abs(a.y-b.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,se)):e.createCommentVNode("",!0),t.value.style.verticalIndicator.show&&(c.value&&a.id===c.value.id||f.selectedIndex===d)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:a.x,x2:a.x,y1:r.value.top-6,y2:r.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,ie)):e.createCommentVNode("",!0)]))),256)),w.value<0?(e.openBlock(),e.createElementBlock("line",{key:2,x1:r.value.start,x2:r.value.start+r.value.width-16,y1:b.value,y2:b.value,stroke:t.value.style.zeroLine.color,"stroke-dasharray":t.value.style.zeroLine.strokeWidth*2,"stroke-width":t.value.style.zeroLine.strokeWidth,"stroke-linecap":"round"},null,8,de)):e.createCommentVNode("",!0),t.value.style.plot.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:3},e.renderList(s.value,(a,d)=>(e.openBlock(),e.createElementBlock("g",null,[c.value&&a.id===c.value.id||f.selectedIndex===d?(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,ce)):e.createCommentVNode("",!0)]))),256)):e.createCommentVNode("",!0),f.showInfo&&t.value.style.dataLabel.show?(e.openBlock(),e.createElementBlock("text",{key:4,x:t.value.style.dataLabel.position==="left"?12+t.value.style.dataLabel.offsetX:r.value.width+12+t.value.style.dataLabel.offsetX,y:o.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(u.applyDataLabel)(t.value.style.dataLabel.formatter,c.value.absoluteValue,e.unref(u.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(u.applyDataLabel)(t.value.style.dataLabel.formatter,$.value,e.unref(u.dataLabel)({p:t.value.style.dataLabel.prefix,v:$.value,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.roundingValue}))),9,ve)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(a,d)=>(e.openBlock(),e.createElementBlock("rect",{x:a.x-(r.value.width/(h.value+1)>o.value.padding?o.value.padding:r.value.width/(h.value+1))/2,y:r.value.top-6,height:r.value.height+6,width:r.value.width/(h.value+1)>o.value.padding?o.value.padding:r.value.width/(h.value+1),fill:"transparent",onMouseenter:I=>F(a,d),onMouseleave:q,onClick:()=>T(a,d)},null,40,he))),256)),e.renderSlot(l.$slots,"svg",{svg:o.value},void 0,!0)],12,U)):e.createCommentVNode("",!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"source",ref:L,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),g.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(G.default,{key:3,config:{type:"sparkline",style:{backgroundColor:t.value.style.backgroundColor,sparkline:{color:"#CCCCCC"}}}},null,8,["config"]))],12,H))}},pe=R._export_sfc(ye,[["__scopeId","data-v-afa97ea1"]]);exports.default=pe;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-Ci5MafHS.cjs"),S=require("./useNestedProp-DxZ05ZEt.cjs"),G=require("./vue-ui-skeleton-Si57O3af.cjs"),M=require("./useResponsive-BJ7DTGpm.cjs"),j=require("./PackageVersion-DjuywB0J.cjs"),R=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),H=["id"],U=["xmlns","viewBox"],X=["id"],Z=["stop-color"],Y=["stop-color"],J=["id"],K=["stop-color"],Q=["stop-color"],ee=["id"],te=["stop-color"],le=["stop-color"],ae={key:0},oe=["d","fill"],ne=["d","fill"],ue=["d","stroke","stroke-width"],re=["x1","x2","y1","y2","stroke","stroke-width"],se=["x","y","width","height","fill","rx"],ie=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],de=["x1","x2","y1","y2","stroke","stroke-dasharray","stroke-width"],ce=["cx","cy","r","fill","stroke","stroke-width"],ve=["x","y","font-size","font-weight","fill"],he=["x","y","height","width","onMouseenter","onClick"],ye={__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}},emits:["hoverIndex","selectDatapoint"],setup(f,{emit:_}){const i=f,{vue_ui_sparkline:z}=u.useConfig(),g=e.computed(()=>!!i.dataset&&i.dataset.length),v=e.ref(u.createUid()),x=e.ref(null),B=e.ref(null),L=e.ref(null),t=e.computed({get:()=>C(),set:l=>l});function C(){const l=S.useNestedProp({userConfig:i.config,defaultConfig:z});return l.theme?{...S.useNestedProp({userConfig:u.themes.vue_ui_sparkline[l.theme]||i.config,defaultConfig:l})}:l}e.watch(()=>i.config,l=>{t.value=C(),E(),o.value.chartWidth=t.value.style.chartWidth},{deep:!0}),e.watch(()=>i.dataset,l=>{p.value=i.dataset.map(n=>({...n,value:[void 0].includes(n.value)?null:n.value}))},{deep:!0});const p=e.ref(P());function P(){return i.dataset.map(l=>t.value.style.animation.show?{...l,value:null}:{...l,value:[void 0].includes(l.value)?null:l.value})}const V=e.ref(null);e.onMounted(()=>{if(E(),t.value.style.animation.show&&i.dataset.length>1){let a=function(){n<i.dataset.length?(p.value.push(i.dataset[n]),setTimeout(()=>{requestAnimationFrame(a)},l)):p.value=i.dataset,n+=1};p.value=[];const l=t.value.style.animation.animationFrames/i.dataset.length;let n=0;a()}});function E(){if(u.objectIsEmpty(i.dataset)?u.error({componentName:"VueUiSparkline",type:"dataset"}):i.dataset.forEach((l,n)=>{u.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["period","value"]}).forEach(a=>{u.error({componentName:"VueUiSparkline",type:"datasetSerieAttribute",property:a,index:n})})}),t.value.responsive){const l=M.throttle(()=>{const{width:n,height:a}=M.useResponsive({chart:x.value,title:t.value.style.title.show&&i.showInfo?B.value:null,source:L.value});o.value.width=n,o.value.height=a,o.value.chartWidth=t.value.style.chartWidth/500*n,o.value.padding=.06*n});V.value=new ResizeObserver(l),V.value.observe(x.value.parentNode)}}const o=e.ref({height:80,width:500,chartWidth:t.value.style.chartWidth,padding:30}),D=e.ref(6),r=e.computed(()=>({top:12,left:0,right:o.value.width,bottom:o.value.height-3,start:i.showInfo&&t.value.style.dataLabel.show&&t.value.style.dataLabel.position==="left"?o.value.width-o.value.chartWidth:o.value.padding,width:i.showInfo&&t.value.style.dataLabel.show?o.value.chartWidth:o.value.width-o.value.padding,height:o.value.height-12})),w=e.computed(()=>Math.min(...p.value.map(l=>isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0))),W=e.computed(()=>Math.max(...p.value.map(l=>isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0))),m=e.computed(()=>{const l=w.value>=0?0:w.value;return Math.abs(l)}),A=e.computed(()=>W.value+m.value+D.value),b=e.computed(()=>r.value.bottom-r.value.height*N(m.value));function N(l){return l/A.value}const h=e.computed(()=>i.dataset.length-1),s=e.computed(()=>p.value.map((l,n)=>{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:N(a+m.value),x:r.value.start+n*(r.value.width/(h.value+1)>o.padding?o.padding:r.value.width/(h.value+1)),y:r.value.bottom-r.value.height*N(a+m.value),id:`plot_${v.value}_${n}`,color:k.value?t.value.style.bar.color:t.value.style.area.useGradient?u.shiftHue(t.value.style.line.color,.05*(1-n/h.value)):t.value.style.line.color,width:r.value.width/(h.value+1)>o.padding?o.padding:r.value.width/(h.value+1)}})),O=e.computed(()=>{const l={x:s.value[0].x,y:o.value.height-6},n={x:s.value[s.value.length-1].x,y:o.value.height-6},a=[];return s.value.forEach(d=>{a.push(`${d.x},${d.y} `)}),[l.x,l.y,...a,n.x,n.y].toString()}),c=e.ref(void 0);function F(l,n){c.value=l,_("hoverIndex",{index:n})}function q(){c.value=void 0,_("hoverIndex",{index:void 0})}const y=e.computed(()=>{if(g.value){const l=s.value.map(a=>a.absoluteValue),n=l.reduce((a,d)=>a+d,0);return{latest:s.value[s.value.length-1].absoluteValue,sum:n,average:n/s.value.length,median:u.calcMedian(l),trend:u.calcLinearProgression(s.value.map(({x:a,y:d,absoluteValue:I})=>({x:a,y:d,value:I}))).trend}}else return{latest:null,sum:null,average:null,median:null,trend:null}}),$=e.computed(()=>g.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),k=e.computed(()=>t.value.type&&t.value.type==="bar");function T(l,n){_("selectDatapoint",{datapoint:l,index:n})}return(l,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"sparklineChart",ref:x,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&&f.showInfo?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:B,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),g.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(u.XMLNS),viewBox:`0 0 ${o.value.width} ${o.value.height}`,style:e.normalizeStyle(`background:${t.value.style.backgroundColor};overflow:visible`)},[e.createVNode(j._sfc_main),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(u.setOpacity)(e.unref(u.shiftHue)(t.value.style.area.color,.05),t.value.style.area.opacity)},null,8,Z),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(u.setOpacity)(t.value.style.area.color,t.value.style.area.opacity)},null,8,Y)],8,X),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,K),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(u.shiftHue)(t.value.style.bar.color,.05)},null,8,Q)],8,J),e.createElementVNode("linearGradient",{x2:"0%",y2:"100%",id:`sparkline_bar_gradient_neg_${v.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(u.shiftHue)(t.value.style.bar.color,.05)},null,8,te),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.bar.color},null,8,le)],8,ee)]),t.value.style.area.show&&!k.value&&s.value[0]?(e.openBlock(),e.createElementBlock("g",ae,[t.value.style.line.smooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:`M ${s.value[0].x},${r.value.bottom} ${e.unref(u.createSmoothPath)(s.value)} L ${s.value.at(-1).x},${r.value.bottom} Z`,fill:t.value.style.area.useGradient?`url(#sparkline_gradient_${v.value})`:e.unref(u.setOpacity)(t.value.style.area.color,t.value.style.area.opacity)},null,8,oe)):(e.openBlock(),e.createElementBlock("path",{key:1,d:`M${O.value}Z`,fill:t.value.style.area.useGradient?`url(#sparkline_gradient_${v.value})`:e.unref(u.setOpacity)(t.value.style.area.color,t.value.style.area.opacity)},null,8,ne))])):e.createCommentVNode("",!0),t.value.style.line.smooth&&!k.value?(e.openBlock(),e.createElementBlock("path",{key:1,d:`M ${e.unref(u.createSmoothPath)(s.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(s.value,(a,d)=>(e.openBlock(),e.createElementBlock("g",null,[d<s.value.length-1&&!t.value.style.line.smooth&&!k.value?(e.openBlock(),e.createElementBlock("line",{key:0,x1:a.x,x2:s.value[d+1].x,y1:a.y,y2:s.value[d+1].y,stroke:a.color,"stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round","shape-rendering":"geometricPrecision"},null,8,re)):e.createCommentVNode("",!0),k.value?(e.openBlock(),e.createElementBlock("rect",{key:1,x:a.x-a.width/2,y:a.absoluteValue>0?a.y:b.value,width:a.width,height:Math.abs(a.y-b.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,se)):e.createCommentVNode("",!0),t.value.style.verticalIndicator.show&&(c.value&&a.id===c.value.id||f.selectedIndex===d)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:a.x,x2:a.x,y1:r.value.top-6,y2:r.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,ie)):e.createCommentVNode("",!0)]))),256)),w.value<0?(e.openBlock(),e.createElementBlock("line",{key:2,x1:r.value.start,x2:r.value.start+r.value.width-16,y1:b.value,y2:b.value,stroke:t.value.style.zeroLine.color,"stroke-dasharray":t.value.style.zeroLine.strokeWidth*2,"stroke-width":t.value.style.zeroLine.strokeWidth,"stroke-linecap":"round"},null,8,de)):e.createCommentVNode("",!0),t.value.style.plot.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:3},e.renderList(s.value,(a,d)=>(e.openBlock(),e.createElementBlock("g",null,[c.value&&a.id===c.value.id||f.selectedIndex===d?(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,ce)):e.createCommentVNode("",!0)]))),256)):e.createCommentVNode("",!0),f.showInfo&&t.value.style.dataLabel.show?(e.openBlock(),e.createElementBlock("text",{key:4,x:t.value.style.dataLabel.position==="left"?12+t.value.style.dataLabel.offsetX:r.value.width+12+t.value.style.dataLabel.offsetX,y:o.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(u.applyDataLabel)(t.value.style.dataLabel.formatter,c.value.absoluteValue,e.unref(u.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(u.applyDataLabel)(t.value.style.dataLabel.formatter,$.value,e.unref(u.dataLabel)({p:t.value.style.dataLabel.prefix,v:$.value,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.roundingValue}))),9,ve)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(a,d)=>(e.openBlock(),e.createElementBlock("rect",{x:a.x-(r.value.width/(h.value+1)>o.value.padding?o.value.padding:r.value.width/(h.value+1))/2,y:r.value.top-6,height:r.value.height+6,width:r.value.width/(h.value+1)>o.value.padding?o.value.padding:r.value.width/(h.value+1),fill:"transparent",onMouseenter:I=>F(a,d),onMouseleave:q,onClick:()=>T(a,d)},null,40,he))),256)),e.renderSlot(l.$slots,"svg",{svg:o.value},void 0,!0)],12,U)):e.createCommentVNode("",!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"source",ref:L,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),g.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(G.default,{key:3,config:{type:"sparkline",style:{backgroundColor:t.value.style.backgroundColor,sparkline:{color:"#CCCCCC"}}}},null,8,["config"]))],12,H))}},pe=R._export_sfc(ye,[["__scopeId","data-v-afa97ea1"]]);exports.default=pe;
@@ -1,9 +1,9 @@
1
1
  import { computed as v, ref as m, watch as R, onMounted as se, openBlock as o, createElementBlock as n, normalizeStyle as N, renderSlot as W, normalizeProps as oe, guardReactiveProps as re, createElementVNode as f, toDisplayString as j, createCommentVNode as y, unref as c, createVNode as ne, Fragment as P, renderList as A, createBlock as ie } from "vue";
2
- import { u as de, c as ve, t as ce, o as he, e as U, g as ye, w as C, Y as fe, Z as pe, X as ge, s as I, R as X, i as Z, f as q } from "./index-49zKC_pb.js";
3
- import { u as Y } from "./useNestedProp-D1a8xzOZ.js";
4
- import me from "./vue-ui-skeleton-CWI6cZZA.js";
2
+ import { u as de, c as ve, t as ce, o as he, e as U, g as ye, w as C, Y as fe, Z as pe, X as ge, s as I, R as X, i as Z, f as q } from "./index-Cn1EWnYG.js";
3
+ import { u as Y } from "./useNestedProp-BXn-g9sr.js";
4
+ import me from "./vue-ui-skeleton-D3AGluiW.js";
5
5
  import { t as ke, u as be } from "./useResponsive-CoxXLe23.js";
6
- import { _ as _e } from "./PackageVersion-ldwwWp9S.js";
6
+ import { _ as _e } from "./PackageVersion-Bw7N_9KM.js";
7
7
  import { _ as xe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
8
8
  const we = ["id"], Le = ["xmlns", "viewBox"], $e = ["id"], Ne = ["stop-color"], Ce = ["stop-color"], Ie = ["id"], Me = ["stop-color"], Ve = ["stop-color"], ze = ["id"], Se = ["stop-color"], We = ["stop-color"], Pe = { key: 0 }, Ae = ["d", "fill"], De = ["d", "fill"], Fe = ["d", "stroke", "stroke-width"], Ge = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Te = ["x", "y", "width", "height", "fill", "rx"], Be = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], Ee = ["x1", "x2", "y1", "y2", "stroke", "stroke-dasharray", "stroke-width"], Oe = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], Re = ["x", "y", "font-size", "font-weight", "fill"], je = ["x", "y", "height", "width", "onMouseenter", "onClick"], Ue = {
9
9
  __name: "vue-ui-sparkline",
@@ -1,8 +1,8 @@
1
1
  import { computed as y, ref as k, watch as I, onMounted as X, openBlock as s, createElementBlock as r, normalizeStyle as g, createElementVNode as d, toDisplayString as _, createCommentVNode as h, unref as b, createVNode as W, Fragment as D, renderList as N, normalizeClass as P, createBlock as J, renderSlot as K } from "vue";
2
- import { u as Q, c as U, t as R, a as Y, p as i, d as C, b as Z, o as ee, e as V, g as te, f as O, X as le, s as ae, w as oe, i as se } from "./index-49zKC_pb.js";
3
- import { u as G } from "./useNestedProp-D1a8xzOZ.js";
4
- import ne from "./vue-ui-skeleton-CWI6cZZA.js";
5
- import { _ as re } from "./PackageVersion-ldwwWp9S.js";
2
+ import { u as Q, c as U, t as R, a as Y, p as i, d as C, b as Z, o as ee, e as V, g as te, f as O, X as le, s as ae, w as oe, i as se } from "./index-Cn1EWnYG.js";
3
+ import { u as G } from "./useNestedProp-BXn-g9sr.js";
4
+ import ne from "./vue-ui-skeleton-D3AGluiW.js";
5
+ import { _ as re } from "./PackageVersion-Bw7N_9KM.js";
6
6
  import { _ as ue } from "./_plugin-vue_export-helper-CHgC5LLL.js";
7
7
  const ie = ["xmlns", "viewBox"], ce = ["id"], de = ["stop-color"], ve = ["stop-color"], ge = ["stop-color"], pe = {
8
8
  id: "stackPill",
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-BIGzKAQq.cjs"),w=require("./useNestedProp-zN3-B_1z.cjs"),V=require("./vue-ui-skeleton-CoPAETjt.cjs"),z=require("./PackageVersion-VHviFq0W.cjs"),D=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),P=["xmlns","viewBox"],L=["id"],A=["stop-color"],F=["stop-color"],q=["stop-color"],U={id:"stackPill",clipPathUnits:"objectBoundingBox"},j=["fill"],T={key:0,"clip-path":"url(#stackPill)"},H=["height","width","fill"],I=["onClick","x","width","height","fill","stroke"],O=["width","height","rx"],M=["onClick"],G={style:{display:"flex","flex-direction":"row","align-items":"center",gap:"4px","justify-content":"center"}},W=["height","width"],X=["fill"],J={key:4,ref:"source",dir:"auto"},K={__name:"vue-ui-sparkstackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(S,{emit:E}){const u=S,{vue_ui_sparkstackbar:N}=o.useConfig(),f=e.computed(()=>!!u.dataset&&u.dataset.length),k=e.ref(o.createUid()),t=e.computed({get:()=>_(),set:l=>l});function _(){const l=w.useNestedProp({userConfig:u.config,defaultConfig:N});return l.theme?{...w.useNestedProp({userConfig:o.themes.vue_ui_sparkstackbar[l.theme]||u.config,defaultConfig:l}),customPalette:o.themePalettes[l.theme]||o.palette}:l}e.watch(()=>u.config,l=>{t.value=_(),b()},{deep:!0}),e.watch(()=>u.dataset,l=>{v.value=u.dataset.map((n,a)=>({...n,color:n.color?o.convertColorToHex(n.color):m.value[a]||o.palette[a]||o.palette[a%o.palette.length]}))},{deep:!0});const m=e.computed(()=>o.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?o.convertColorToHex(l.color):m.value[n]||o.palette[n]||o.palette[n%o.palette.length]}))),g=e.ref(!0);e.onMounted(()=>{if(b(),t.value.style.animation.show){let p=function(){r+=a/l,r<a?(v.value=v.value.map((s,i)=>({...s,value:s.value+=n[i],color:s.color?o.convertColorToHex(s.color):m.value[i]||o.palette[i]||o.palette[i%o.palette.length]})),requestAnimationFrame(p)):(g.value=!1,v.value=u.dataset.map((s,i)=>({...s,value:s.value||0,color:s.color?o.convertColorToHex(s.color):m.value[i]||o.palette[i]||o.palette[i%o.palette.length],id:o.createUid()})))};const l=t.value.style.animation.animationFrames,n=u.dataset.map((s,i)=>s.value/l),a=u.dataset.map(s=>s.value||0).reduce((s,i)=>s+i,0);let r=0;g.value=!0,p()}});function b(){o.objectIsEmpty(u.dataset)?o.error({componentName:"VueUiSparkStackbar",type:"dataset"}):u.dataset.forEach((l,n)=>{o.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","value"]}).forEach(a=>{o.error({componentName:"VueUiSparkStackbar",type:"datasetSerieAttribute",property:a,index:n})})})}const d=e.ref({width:500,height:16}),c=e.ref([]),C=e.computed(()=>u.dataset.map(l=>l.value||0).filter((l,n)=>!c.value.includes(n)).reduce((l,n)=>l+n,0)),x=e.computed(()=>v.value.map((l,n)=>{const a=l.value||0,r=a/C.value,p=isNaN(r)?0:r,s=p*d.value.width;return{...l,value:a,proportion:p,width:s,proportionLabel:o.dataLabel({v:p*100,s:"%",r:t.value.style.legend.percentage.rounding})}})),h=e.computed(()=>x.value.filter((l,n)=>!c.value.includes(n)));function $(l){c.value.includes(l)?c.value=c.value.filter(n=>n!==l):c.value.length<v.value.length-1&&c.value.push(l)}const y=e.computed(()=>{let l=0;const n=[];for(let a=0;a<h.value.length;a+=1)n.push({...h.value[a],start:l}),l+=h.value[a].width;return n});function B(l,n){E("selectDatapoint",{datapoint:l,index:n})}return(l,n)=>(e.openBlock(),e.createElementBlock("div",{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),f.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(o.XMLNS),width:"100%",viewBox:`0 0 ${d.value.width} ${d.value.height}`},[e.createVNode(z._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(a,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{key:`stack_gradient_${r}`,gradientTransform:"rotate(90)",id:`stack_gradient_${r}_${k.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":a.color},null,8,A),e.createElementVNode("stop",{offset:"50%","stop-color":e.unref(o.setOpacity)(e.unref(o.shiftHue)(a.color,.05),100-t.value.style.bar.gradient.intensity)},null,8,F),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,q)],8,L))),128)),e.createElementVNode("clipPath",U,[e.createElementVNode("rect",{x:"0.005",y:"-2",width:"0.99",height:"5",rx:"3",ry:"3",fill:t.value.style.backgroundColor},null,8,j)])]),C.value>0?(e.openBlock(),e.createElementBlock("g",T,[e.createElementVNode("rect",{x:0,y:0,height:d.value.height,width:y.value.map(a=>a.width).reduce((a,r)=>a+r,0),fill:t.value.style.bar.gradient.underlayerColor,class:e.normalizeClass({animated:!g.value})},null,10,H),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_${r}`,onClick:()=>B(a,r),x:a.start,y:0,width:a.width,height:d.value.height,fill:t.value.style.bar.gradient.show?`url(#stack_gradient_${r}_${k.value})`:a.color,stroke:t.value.style.backgroundColor,"stroke-linecap":"round",class:e.normalizeClass({animated:!g.value})},null,10,I))),128))])):(e.openBlock(),e.createElementBlock("rect",{key:1,x:2,y:1,width:d.value.width-4,height:d.value.height-2,stroke:"#CCCCCC","stroke-width":"2",fill:"transparent",rx:(d.value.height-4)/2},null,8,O))],8,P)):e.createCommentVNode("",!0),f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(V.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(x.value,(a,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":c.value.includes(r)}),onClick:p=>{$(r),B(a,r)}},[e.createElementVNode("div",G,[(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:a.color},null,8,X)],8,W)),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(a.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(c.value.includes(r)?" - ":a.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(o.applyDataLabel)(t.value.style.legend.value.formatter,a.value,e.unref(o.dataLabel)({p:t.value.style.legend.value.prefix,v:a.value,s:t.value.style.legend.value.suffix,r:t.value.style.legend.value.rounding}),{datapoint:a,seriesIndex:r}))+") ",5)):e.createCommentVNode("",!0)])],14,M))),256))],4)):e.createCommentVNode("",!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",J,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0)],4))}},Q=D._export_sfc(K,[["__scopeId","data-v-bda2b20a"]]);exports.default=Q;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-Ci5MafHS.cjs"),w=require("./useNestedProp-DxZ05ZEt.cjs"),V=require("./vue-ui-skeleton-Si57O3af.cjs"),z=require("./PackageVersion-DjuywB0J.cjs"),D=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),P=["xmlns","viewBox"],L=["id"],A=["stop-color"],F=["stop-color"],q=["stop-color"],U={id:"stackPill",clipPathUnits:"objectBoundingBox"},j=["fill"],T={key:0,"clip-path":"url(#stackPill)"},H=["height","width","fill"],I=["onClick","x","width","height","fill","stroke"],O=["width","height","rx"],M=["onClick"],G={style:{display:"flex","flex-direction":"row","align-items":"center",gap:"4px","justify-content":"center"}},W=["height","width"],X=["fill"],J={key:4,ref:"source",dir:"auto"},K={__name:"vue-ui-sparkstackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(S,{emit:E}){const u=S,{vue_ui_sparkstackbar:N}=o.useConfig(),f=e.computed(()=>!!u.dataset&&u.dataset.length),k=e.ref(o.createUid()),t=e.computed({get:()=>_(),set:l=>l});function _(){const l=w.useNestedProp({userConfig:u.config,defaultConfig:N});return l.theme?{...w.useNestedProp({userConfig:o.themes.vue_ui_sparkstackbar[l.theme]||u.config,defaultConfig:l}),customPalette:o.themePalettes[l.theme]||o.palette}:l}e.watch(()=>u.config,l=>{t.value=_(),b()},{deep:!0}),e.watch(()=>u.dataset,l=>{v.value=u.dataset.map((n,a)=>({...n,color:n.color?o.convertColorToHex(n.color):m.value[a]||o.palette[a]||o.palette[a%o.palette.length]}))},{deep:!0});const m=e.computed(()=>o.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?o.convertColorToHex(l.color):m.value[n]||o.palette[n]||o.palette[n%o.palette.length]}))),g=e.ref(!0);e.onMounted(()=>{if(b(),t.value.style.animation.show){let p=function(){r+=a/l,r<a?(v.value=v.value.map((s,i)=>({...s,value:s.value+=n[i],color:s.color?o.convertColorToHex(s.color):m.value[i]||o.palette[i]||o.palette[i%o.palette.length]})),requestAnimationFrame(p)):(g.value=!1,v.value=u.dataset.map((s,i)=>({...s,value:s.value||0,color:s.color?o.convertColorToHex(s.color):m.value[i]||o.palette[i]||o.palette[i%o.palette.length],id:o.createUid()})))};const l=t.value.style.animation.animationFrames,n=u.dataset.map((s,i)=>s.value/l),a=u.dataset.map(s=>s.value||0).reduce((s,i)=>s+i,0);let r=0;g.value=!0,p()}});function b(){o.objectIsEmpty(u.dataset)?o.error({componentName:"VueUiSparkStackbar",type:"dataset"}):u.dataset.forEach((l,n)=>{o.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","value"]}).forEach(a=>{o.error({componentName:"VueUiSparkStackbar",type:"datasetSerieAttribute",property:a,index:n})})})}const d=e.ref({width:500,height:16}),c=e.ref([]),C=e.computed(()=>u.dataset.map(l=>l.value||0).filter((l,n)=>!c.value.includes(n)).reduce((l,n)=>l+n,0)),x=e.computed(()=>v.value.map((l,n)=>{const a=l.value||0,r=a/C.value,p=isNaN(r)?0:r,s=p*d.value.width;return{...l,value:a,proportion:p,width:s,proportionLabel:o.dataLabel({v:p*100,s:"%",r:t.value.style.legend.percentage.rounding})}})),h=e.computed(()=>x.value.filter((l,n)=>!c.value.includes(n)));function $(l){c.value.includes(l)?c.value=c.value.filter(n=>n!==l):c.value.length<v.value.length-1&&c.value.push(l)}const y=e.computed(()=>{let l=0;const n=[];for(let a=0;a<h.value.length;a+=1)n.push({...h.value[a],start:l}),l+=h.value[a].width;return n});function B(l,n){E("selectDatapoint",{datapoint:l,index:n})}return(l,n)=>(e.openBlock(),e.createElementBlock("div",{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),f.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(o.XMLNS),width:"100%",viewBox:`0 0 ${d.value.width} ${d.value.height}`},[e.createVNode(z._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(a,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{key:`stack_gradient_${r}`,gradientTransform:"rotate(90)",id:`stack_gradient_${r}_${k.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":a.color},null,8,A),e.createElementVNode("stop",{offset:"50%","stop-color":e.unref(o.setOpacity)(e.unref(o.shiftHue)(a.color,.05),100-t.value.style.bar.gradient.intensity)},null,8,F),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,q)],8,L))),128)),e.createElementVNode("clipPath",U,[e.createElementVNode("rect",{x:"0.005",y:"-2",width:"0.99",height:"5",rx:"3",ry:"3",fill:t.value.style.backgroundColor},null,8,j)])]),C.value>0?(e.openBlock(),e.createElementBlock("g",T,[e.createElementVNode("rect",{x:0,y:0,height:d.value.height,width:y.value.map(a=>a.width).reduce((a,r)=>a+r,0),fill:t.value.style.bar.gradient.underlayerColor,class:e.normalizeClass({animated:!g.value})},null,10,H),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_${r}`,onClick:()=>B(a,r),x:a.start,y:0,width:a.width,height:d.value.height,fill:t.value.style.bar.gradient.show?`url(#stack_gradient_${r}_${k.value})`:a.color,stroke:t.value.style.backgroundColor,"stroke-linecap":"round",class:e.normalizeClass({animated:!g.value})},null,10,I))),128))])):(e.openBlock(),e.createElementBlock("rect",{key:1,x:2,y:1,width:d.value.width-4,height:d.value.height-2,stroke:"#CCCCCC","stroke-width":"2",fill:"transparent",rx:(d.value.height-4)/2},null,8,O))],8,P)):e.createCommentVNode("",!0),f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(V.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(x.value,(a,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":c.value.includes(r)}),onClick:p=>{$(r),B(a,r)}},[e.createElementVNode("div",G,[(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:a.color},null,8,X)],8,W)),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(a.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(c.value.includes(r)?" - ":a.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(o.applyDataLabel)(t.value.style.legend.value.formatter,a.value,e.unref(o.dataLabel)({p:t.value.style.legend.value.prefix,v:a.value,s:t.value.style.legend.value.suffix,r:t.value.style.legend.value.rounding}),{datapoint:a,seriesIndex:r}))+") ",5)):e.createCommentVNode("",!0)])],14,M))),256))],4)):e.createCommentVNode("",!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",J,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0)],4))}},Q=D._export_sfc(K,[["__scopeId","data-v-bda2b20a"]]);exports.default=Q;
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),c=require("./index-BIGzKAQq.cjs"),Le=require("./useNestedProp-zN3-B_1z.cjs"),Se=require("./useResponsive-BJ7DTGpm.cjs"),ze=require("./usePrinter-CuZzu5vy.cjs"),Ye=require("./Slicer-DvUS1T9M.cjs"),Ge=require("./Tooltip-BfjsUhFm.cjs"),Je=require("./Title-Doa_KqSJ.cjs"),Ze=require("./Legend-Bdl_1DJO.cjs"),Ke=require("./vue-ui-accordion-Dao-6A6Q.cjs"),Qe=require("./DataTable-lNwyPkUV.cjs"),je=require("./vue-ui-skeleton-CoPAETjt.cjs"),et=require("./PackageVersion-VHviFq0W.cjs"),tt=require("./PenAndPaper-D-dkYPgf.cjs"),at=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),lt=["id"],ot=["xmlns","viewBox"],rt={key:0},st=["id"],nt=["stop-color"],it=["stop-color"],ut=["stop-color"],ct=["x1","x2","y1","y2","stroke"],dt=["x1","x2","y1","y2","stroke"],vt=["x1","x2","y1","y2","stroke"],ht=["x1","x2","y1","y2","stroke"],gt=["x","y","height","rx","width","fill","stroke","stroke-width"],yt=["x","y","width","rx","height","fill","stroke","stroke-width"],mt=["x1","x2","y1","y2","stroke","stroke-width"],bt=["x1","x2","y1","y2","stroke","stroke-width"],pt=["x","y","font-size","fill","font-weight"],ft=["transform","font-size","fill","font-weight"],kt=["x","y","font-size","fill","font-weight"],xt={key:0},wt=["x","y","font-size","font-weight","fill"],Ct=["x","y","font-size","fill","font-weight"],Bt={key:0},Lt=["x","y","font-size","font-weight","fill"],St=["x1","x2","y1","y2","stroke"],zt=["x","y","font-size","font-weight","fill"],_t=["x1","x2","y1","y2","stroke"],Nt=["font-size","font-weight","fill","text-anchor","transform"],Et=["text-anchor","font-size","font-weight","fill","transform"],Mt=["font-size","font-weight","fill","x","y"],$t=["x","y","width","height","onClick","onMouseenter","fill"],Tt=["x","y","width","height","onClick","onMouseenter","fill"],Vt={key:4,class:"vue-data-ui-watermark"},Pt=["onClick"],Ft=["innerHTML"],Rt={__name:"vue-ui-stackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint","selectLegend"],setup(Z,{expose:_e,emit:K}){const y=Z,{vue_ui_stackbar:Ne}=c.useConfig(),E=e.computed({get(){return!!y.dataset&&y.dataset.length},set(l){return l}}),M=e.ref(null),U=e.ref(c.createUid()),O=e.ref(!1),Q=e.ref(null),X=e.ref(""),p=e.ref([]),j=e.ref(0),ee=e.ref(null),te=e.ref(null),ae=e.ref(null),le=e.ref(null),oe=e.ref(0),Y=e.ref(!1),$=e.ref(null),T=e.ref(!1),Ee=e.ref(0),Me=e.ref(0),$e=e.ref(0);e.onMounted(()=>{G()});const t=e.computed({get:()=>re(),set:l=>l});function re(){const l=Le.useNestedProp({userConfig:y.config,defaultConfig:Ne});let r={};return l.theme?r={...Le.useNestedProp({userConfig:c.themes.vue_ui_stackbar[l.theme]||y.config,defaultConfig:l}),customPalette:c.themePalettes[l.theme]||c.palette}:r=l,y.config&&c.hasDeepProperty(y.config,"style.chart.grid.scale.scaleMin")?r.style.chart.grid.scale.scaleMin=y.config.style.chart.grid.scale.scaleMin:r.style.chart.grid.scale.scaleMin=null,y.config&&c.hasDeepProperty(y.config,"style.chart.grid.scale.scaleMax")?r.style.chart.grid.scale.scaleMax=y.config.style.chart.grid.scale.scaleMax:r.style.chart.grid.scale.scaleMax=null,r}e.watch(()=>y.config,l=>{t.value=re(),G(),Ee.value+=1,Me.value+=1,$e.value+=1},{deep:!0}),e.watch(()=>y.dataset,l=>{ve()},{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:se,isImaging:ne,generatePdf:ie,generateImage:ue}=ze.usePrinter({elementId:`stackbar_${U.value}`,fileName:t.value.style.chart.title.text||"vue-ui-stackbar"}),D=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}}),Te=e.computed(()=>c.convertCustomPalette(t.value.customPalette)),ce=e.ref(null),de=e.ref(null);e.onMounted(()=>{G()});function G(){if(c.objectIsEmpty(y.dataset)?c.error({componentName:"VueUiStackbar",type:"dataset"}):y.dataset.forEach((l,r)=>{c.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","series"]}).forEach(a=>{E.value=!1,c.error({componentName:"VueUiStackbar",type:"datasetSerieAttribute",property:a,index:r})})}),setTimeout(()=>{T.value=!0},10),t.value.responsive){const l=Se.throttle(()=>{T.value=!1;const{width:r,height:a}=Se.useResponsive({chart:M.value,title:t.value.style.chart.title.text?ee.value:null,legend:t.value.style.chart.legend.show?te.value:null,slicer:t.value.style.chart.zoom.show&&L.value>1?ae.value:null,source:le.value});D.value.width=r,D.value.height=a,clearTimeout(de.value),de.value=setTimeout(()=>{T.value=!0},10)});ce.value=new ResizeObserver(l),ce.value.observe(M.value.parentNode)}}const s=e.computed(()=>{const{height:l,width:r}=D.value,{right:a}=D.value.paddingRatio,o=t.value.style.chart.padding.top,n=r-r*a,i=l-t.value.style.chart.padding.bottom,m=t.value.style.chart.padding.left,S=r-m-r*a,z=l-o-t.value.style.chart.padding.bottom;return{chartHeight:l,chartWidth:r,top:o,right:n,bottom:i,left:m,width:S,height:z<0?0:z}}),B=e.computed(()=>y.dataset.map((l,r)=>{const a=c.convertColorToHex(l.color)||Te.value[r]||c.palette[r]||c.palette[r%c.palette.length];return{...l,series:JSON.parse(JSON.stringify(l.series)).map(o=>t.value.style.chart.bars.distributed?Math.abs(o):o),signedSeries:l.series.map(o=>o>=0?1:-1),absoluteIndex:r,id:c.createUid(),color:a}})),L=e.computed(()=>Math.max(...B.value.filter(l=>!p.value.includes(l.id)).map(l=>l.series.length))),u=e.ref({start:0,end:Math.max(...y.dataset.map(l=>l.series.length))});function ve(){u.value={start:0,end:Math.max(...y.dataset.map(l=>l.series.length))},oe.value+=1}const d=e.computed(()=>{let l;return t.value.orientation==="vertical"?l=s.value.width/(u.value.end-u.value.start):l=s.value.height/(u.value.end-u.value.start),l<=0?0:l}),V=e.computed(()=>c.sumSeries(B.value.filter(l=>!p.value.includes(l.id))).slice(u.value.start,u.value.end)),Ve=e.computed(()=>c.sumSeries(B.value.filter(l=>!p.value.includes(l.id)).map(l=>({...l,series:l.series.map((r,a)=>l.signedSeries[a]===-1&&r>=0?-r:r)}))).slice(u.value.start,u.value.end)),A=e.computed(()=>{const l=B.value.filter(r=>!p.value.includes(r.id));return{positive:c.sumSeries(l.map(r=>({...r,series:r.series.slice(u.value.start,u.value.end).map(a=>a>=0?a:0)}))),negative:c.sumSeries(l.map(r=>({...r,series:r.series.slice(u.value.start,u.value.end).map(a=>a<0?a:0)})))}}),w=e.computed(()=>{const l=t.value.style.chart.grid.scale.scaleMax!==null&&!t.value.style.chart.bars.distributed?t.value.style.chart.grid.scale.scaleMax:Math.max(...A.value.positive),r=Math.min(...A.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(r)?0:r,o=!t.value.style.chart.bars.distributed&&(t.value.style.chart.grid.scale.scaleMax!==null||t.value.style.chart.grid.scale.scaleMin!==null)?c.calculateNiceScaleWithExactExtremes(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks):c.calculateNiceScale(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks);return o.ticks.map(n=>({zero:s.value.bottom-s.value.height*(Math.abs(o.min)/(o.max+Math.abs(o.min))),y:s.value.bottom-s.value.height*((n+Math.abs(o.min))/(o.max+Math.abs(o.min))),x:s.value.left-8,horizontal_zero:s.value.left+s.value.width*(Math.abs(o.min)/(o.max+Math.abs(o.min))),horizontal_x:s.value.left+s.value.width*((n+Math.abs(o.min))/(o.max+Math.abs(o.min))),horizontal_y:s.value.bottom-8,value:n}))}),P=e.computed(()=>t.value.style.chart.grid.x.timeLabels.values.slice(u.value.start,u.value.end)),g=e.computed(()=>{if(!E.value)return[];let l=Array(L.value).fill(0),r=Array(L.value).fill(0),a=Array(L.value).fill(0),o=Array(L.value).fill(0);const n=Math.max(...A.value.positive)||0,i=Math.min(...A.value.negative),m=[-1/0,1/0,NaN,void 0,null].includes(i)?0:i,S=!t.value.style.chart.bars.distributed&&(t.value.style.chart.grid.scale.scaleMax!==null||t.value.style.chart.grid.scale.scaleMin!==null)?c.calculateNiceScaleWithExactExtremes(t.value.style.chart.grid.scale.scaleMin!==null?t.value.style.chart.grid.scale.scaleMin:m>0?0:m,t.value.style.chart.grid.scale.scaleMax!==null?t.value.style.chart.grid.scale.scaleMax:n<0?0:n,t.value.style.chart.grid.scale.ticks):c.calculateNiceScale(t.value.style.chart.grid.scale.scaleMin!==null?t.value.style.chart.grid.scale.scaleMin:m>0?0:m,t.value.style.chart.grid.scale.scaleMax!==null?t.value.style.chart.grid.scale.scaleMax:n<0?0:n,t.value.style.chart.grid.scale.ticks),{min:z,max:F}=S,_=F+(z>=0?0:Math.abs(z))||1,f=s.value.height,W=s.value.width,Ce=w.value[0]?w.value[0].zero:s.value.bottom,Be=w.value[0]?w.value[0].horizontal_zero:s.value.left;return B.value.filter(R=>!p.value.includes(R.id)).map(R=>{const C=R.series.slice(u.value.start,u.value.end),De=R.signedSeries.slice(u.value.start,u.value.end),Ae=C.map((v,h)=>s.value.left+d.value*h+d.value*t.value.style.chart.bars.gapRatio/4),Ie=C.map((v,h)=>s.value.top+d.value*h+d.value*t.value.style.chart.bars.gapRatio/4),qe=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;let N,x;return v>0?(x=f*k,N=Ce-x-l[h],l[h]+=x):(x=f*k,N=Ce+a[h],a[h]+=Math.abs(x)),N}),He=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;let N,x;return v>0?(x=W*k,N=Be+r[h],r[h]+=x):(x=W*k,N=Be-Math.abs(x)-o[h],o[h]+=Math.abs(x)),N}),We=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;return v>0?f*k:f*Math.abs(k)}),Ue=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;return v>0?W*k:W*Math.abs(k)}),Xe=C.map(v=>Math.abs(v)).reduce((v,h)=>v+h,0);return{...R,proportions:C.map((v,h)=>t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/Xe),series:C,signedSeries:De,x:Ae,y:qe,height:We,horizontal_width:Ue,horizontal_y:Ie,horizontal_x:He}})}),he=e.computed(()=>Ve.value.map((l,r)=>({value:l,sign:l>=0?1:-1})));function I(l,r,a,o,n){const i=n===-1&&l>=0?-l:l;return c.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,i,c.dataLabel({p:t.value.style.chart.bars.dataLabels.prefix,v:i,s:t.value.style.chart.bars.dataLabels.suffix,r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:r,seriesIndex:a,datapointIndex:o})}function ge(l,r,a,o){return c.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,l,c.dataLabel({v:l,s:"%",r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:r,seriesIndex:a,datapointIndex:o})}function ye(l){const r=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}));K("selectDatapoint",{datapoint:r,period:P.value[l]})}function me(l){$.value=l,O.value=!0;const r=t.value.style.chart.tooltip.customFormat,a=JSON.parse(JSON.stringify(g.value)).map(n=>({name:n.name,value:n.series[l]===0?0:(n.signedSeries[l]===-1&&n.series[l]>=0?-n.series[l]:n.series[l])||null,proportion:n.proportions[l]||null,color:n.color,id:n.id})),o=a.map(n=>Math.abs(n.value)).reduce((n,i)=>n+i,0);if(c.isFunction(r)&&c.functionReturnsString(()=>r({seriesIndex:l,datapoint:a,series:g.value,config:t.value})))X.value=r({seriesIndex:l,datapoint:a,series:g.value,config:t.value});else{const{showValue:n,showPercentage:i,borderColor:m,roundingValue:S,roundingPercentage:z}=t.value.style.chart.tooltip;let F="";P.value[l]&&(F+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${m};padding-bottom:6px;margin-bottom:3px;">${P.value[l]}</div>`);const _=[n&&i?"(":"",n&&i?")":""];a.reverse().forEach(f=>{F+=`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),c=require("./index-Ci5MafHS.cjs"),Le=require("./useNestedProp-DxZ05ZEt.cjs"),Se=require("./useResponsive-BJ7DTGpm.cjs"),ze=require("./usePrinter-B3HaYNI4.cjs"),Ye=require("./Slicer-U4q5iMIE.cjs"),Ge=require("./Tooltip-CN6_JyjT.cjs"),Je=require("./Title-aR9ViX_A.cjs"),Ze=require("./Legend-D2iK-_M0.cjs"),Ke=require("./vue-ui-accordion-kQwtYRmD.cjs"),Qe=require("./DataTable-CqaGqXkz.cjs"),je=require("./vue-ui-skeleton-Si57O3af.cjs"),et=require("./PackageVersion-DjuywB0J.cjs"),tt=require("./PenAndPaper-DoKpW2Tl.cjs"),at=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),lt=["id"],ot=["xmlns","viewBox"],rt={key:0},st=["id"],nt=["stop-color"],it=["stop-color"],ut=["stop-color"],ct=["x1","x2","y1","y2","stroke"],dt=["x1","x2","y1","y2","stroke"],vt=["x1","x2","y1","y2","stroke"],ht=["x1","x2","y1","y2","stroke"],gt=["x","y","height","rx","width","fill","stroke","stroke-width"],yt=["x","y","width","rx","height","fill","stroke","stroke-width"],mt=["x1","x2","y1","y2","stroke","stroke-width"],bt=["x1","x2","y1","y2","stroke","stroke-width"],pt=["x","y","font-size","fill","font-weight"],ft=["transform","font-size","fill","font-weight"],kt=["x","y","font-size","fill","font-weight"],xt={key:0},wt=["x","y","font-size","font-weight","fill"],Ct=["x","y","font-size","fill","font-weight"],Bt={key:0},Lt=["x","y","font-size","font-weight","fill"],St=["x1","x2","y1","y2","stroke"],zt=["x","y","font-size","font-weight","fill"],_t=["x1","x2","y1","y2","stroke"],Nt=["font-size","font-weight","fill","text-anchor","transform"],Et=["text-anchor","font-size","font-weight","fill","transform"],Mt=["font-size","font-weight","fill","x","y"],$t=["x","y","width","height","onClick","onMouseenter","fill"],Tt=["x","y","width","height","onClick","onMouseenter","fill"],Vt={key:4,class:"vue-data-ui-watermark"},Pt=["onClick"],Ft=["innerHTML"],Rt={__name:"vue-ui-stackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint","selectLegend"],setup(Z,{expose:_e,emit:K}){const y=Z,{vue_ui_stackbar:Ne}=c.useConfig(),E=e.computed({get(){return!!y.dataset&&y.dataset.length},set(l){return l}}),M=e.ref(null),U=e.ref(c.createUid()),O=e.ref(!1),Q=e.ref(null),X=e.ref(""),p=e.ref([]),j=e.ref(0),ee=e.ref(null),te=e.ref(null),ae=e.ref(null),le=e.ref(null),oe=e.ref(0),Y=e.ref(!1),$=e.ref(null),T=e.ref(!1),Ee=e.ref(0),Me=e.ref(0),$e=e.ref(0);e.onMounted(()=>{G()});const t=e.computed({get:()=>re(),set:l=>l});function re(){const l=Le.useNestedProp({userConfig:y.config,defaultConfig:Ne});let r={};return l.theme?r={...Le.useNestedProp({userConfig:c.themes.vue_ui_stackbar[l.theme]||y.config,defaultConfig:l}),customPalette:c.themePalettes[l.theme]||c.palette}:r=l,y.config&&c.hasDeepProperty(y.config,"style.chart.grid.scale.scaleMin")?r.style.chart.grid.scale.scaleMin=y.config.style.chart.grid.scale.scaleMin:r.style.chart.grid.scale.scaleMin=null,y.config&&c.hasDeepProperty(y.config,"style.chart.grid.scale.scaleMax")?r.style.chart.grid.scale.scaleMax=y.config.style.chart.grid.scale.scaleMax:r.style.chart.grid.scale.scaleMax=null,r}e.watch(()=>y.config,l=>{t.value=re(),G(),Ee.value+=1,Me.value+=1,$e.value+=1},{deep:!0}),e.watch(()=>y.dataset,l=>{ve()},{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:se,isImaging:ne,generatePdf:ie,generateImage:ue}=ze.usePrinter({elementId:`stackbar_${U.value}`,fileName:t.value.style.chart.title.text||"vue-ui-stackbar"}),D=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}}),Te=e.computed(()=>c.convertCustomPalette(t.value.customPalette)),ce=e.ref(null),de=e.ref(null);e.onMounted(()=>{G()});function G(){if(c.objectIsEmpty(y.dataset)?c.error({componentName:"VueUiStackbar",type:"dataset"}):y.dataset.forEach((l,r)=>{c.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","series"]}).forEach(a=>{E.value=!1,c.error({componentName:"VueUiStackbar",type:"datasetSerieAttribute",property:a,index:r})})}),setTimeout(()=>{T.value=!0},10),t.value.responsive){const l=Se.throttle(()=>{T.value=!1;const{width:r,height:a}=Se.useResponsive({chart:M.value,title:t.value.style.chart.title.text?ee.value:null,legend:t.value.style.chart.legend.show?te.value:null,slicer:t.value.style.chart.zoom.show&&L.value>1?ae.value:null,source:le.value});D.value.width=r,D.value.height=a,clearTimeout(de.value),de.value=setTimeout(()=>{T.value=!0},10)});ce.value=new ResizeObserver(l),ce.value.observe(M.value.parentNode)}}const s=e.computed(()=>{const{height:l,width:r}=D.value,{right:a}=D.value.paddingRatio,o=t.value.style.chart.padding.top,n=r-r*a,i=l-t.value.style.chart.padding.bottom,m=t.value.style.chart.padding.left,S=r-m-r*a,z=l-o-t.value.style.chart.padding.bottom;return{chartHeight:l,chartWidth:r,top:o,right:n,bottom:i,left:m,width:S,height:z<0?0:z}}),B=e.computed(()=>y.dataset.map((l,r)=>{const a=c.convertColorToHex(l.color)||Te.value[r]||c.palette[r]||c.palette[r%c.palette.length];return{...l,series:JSON.parse(JSON.stringify(l.series)).map(o=>t.value.style.chart.bars.distributed?Math.abs(o):o),signedSeries:l.series.map(o=>o>=0?1:-1),absoluteIndex:r,id:c.createUid(),color:a}})),L=e.computed(()=>Math.max(...B.value.filter(l=>!p.value.includes(l.id)).map(l=>l.series.length))),u=e.ref({start:0,end:Math.max(...y.dataset.map(l=>l.series.length))});function ve(){u.value={start:0,end:Math.max(...y.dataset.map(l=>l.series.length))},oe.value+=1}const d=e.computed(()=>{let l;return t.value.orientation==="vertical"?l=s.value.width/(u.value.end-u.value.start):l=s.value.height/(u.value.end-u.value.start),l<=0?0:l}),V=e.computed(()=>c.sumSeries(B.value.filter(l=>!p.value.includes(l.id))).slice(u.value.start,u.value.end)),Ve=e.computed(()=>c.sumSeries(B.value.filter(l=>!p.value.includes(l.id)).map(l=>({...l,series:l.series.map((r,a)=>l.signedSeries[a]===-1&&r>=0?-r:r)}))).slice(u.value.start,u.value.end)),A=e.computed(()=>{const l=B.value.filter(r=>!p.value.includes(r.id));return{positive:c.sumSeries(l.map(r=>({...r,series:r.series.slice(u.value.start,u.value.end).map(a=>a>=0?a:0)}))),negative:c.sumSeries(l.map(r=>({...r,series:r.series.slice(u.value.start,u.value.end).map(a=>a<0?a:0)})))}}),w=e.computed(()=>{const l=t.value.style.chart.grid.scale.scaleMax!==null&&!t.value.style.chart.bars.distributed?t.value.style.chart.grid.scale.scaleMax:Math.max(...A.value.positive),r=Math.min(...A.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(r)?0:r,o=!t.value.style.chart.bars.distributed&&(t.value.style.chart.grid.scale.scaleMax!==null||t.value.style.chart.grid.scale.scaleMin!==null)?c.calculateNiceScaleWithExactExtremes(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks):c.calculateNiceScale(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks);return o.ticks.map(n=>({zero:s.value.bottom-s.value.height*(Math.abs(o.min)/(o.max+Math.abs(o.min))),y:s.value.bottom-s.value.height*((n+Math.abs(o.min))/(o.max+Math.abs(o.min))),x:s.value.left-8,horizontal_zero:s.value.left+s.value.width*(Math.abs(o.min)/(o.max+Math.abs(o.min))),horizontal_x:s.value.left+s.value.width*((n+Math.abs(o.min))/(o.max+Math.abs(o.min))),horizontal_y:s.value.bottom-8,value:n}))}),P=e.computed(()=>t.value.style.chart.grid.x.timeLabels.values.slice(u.value.start,u.value.end)),g=e.computed(()=>{if(!E.value)return[];let l=Array(L.value).fill(0),r=Array(L.value).fill(0),a=Array(L.value).fill(0),o=Array(L.value).fill(0);const n=Math.max(...A.value.positive)||0,i=Math.min(...A.value.negative),m=[-1/0,1/0,NaN,void 0,null].includes(i)?0:i,S=!t.value.style.chart.bars.distributed&&(t.value.style.chart.grid.scale.scaleMax!==null||t.value.style.chart.grid.scale.scaleMin!==null)?c.calculateNiceScaleWithExactExtremes(t.value.style.chart.grid.scale.scaleMin!==null?t.value.style.chart.grid.scale.scaleMin:m>0?0:m,t.value.style.chart.grid.scale.scaleMax!==null?t.value.style.chart.grid.scale.scaleMax:n<0?0:n,t.value.style.chart.grid.scale.ticks):c.calculateNiceScale(t.value.style.chart.grid.scale.scaleMin!==null?t.value.style.chart.grid.scale.scaleMin:m>0?0:m,t.value.style.chart.grid.scale.scaleMax!==null?t.value.style.chart.grid.scale.scaleMax:n<0?0:n,t.value.style.chart.grid.scale.ticks),{min:z,max:F}=S,_=F+(z>=0?0:Math.abs(z))||1,f=s.value.height,W=s.value.width,Ce=w.value[0]?w.value[0].zero:s.value.bottom,Be=w.value[0]?w.value[0].horizontal_zero:s.value.left;return B.value.filter(R=>!p.value.includes(R.id)).map(R=>{const C=R.series.slice(u.value.start,u.value.end),De=R.signedSeries.slice(u.value.start,u.value.end),Ae=C.map((v,h)=>s.value.left+d.value*h+d.value*t.value.style.chart.bars.gapRatio/4),Ie=C.map((v,h)=>s.value.top+d.value*h+d.value*t.value.style.chart.bars.gapRatio/4),qe=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;let N,x;return v>0?(x=f*k,N=Ce-x-l[h],l[h]+=x):(x=f*k,N=Ce+a[h],a[h]+=Math.abs(x)),N}),He=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;let N,x;return v>0?(x=W*k,N=Be+r[h],r[h]+=x):(x=W*k,N=Be-Math.abs(x)-o[h],o[h]+=Math.abs(x)),N}),We=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;return v>0?f*k:f*Math.abs(k)}),Ue=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;return v>0?W*k:W*Math.abs(k)}),Xe=C.map(v=>Math.abs(v)).reduce((v,h)=>v+h,0);return{...R,proportions:C.map((v,h)=>t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/Xe),series:C,signedSeries:De,x:Ae,y:qe,height:We,horizontal_width:Ue,horizontal_y:Ie,horizontal_x:He}})}),he=e.computed(()=>Ve.value.map((l,r)=>({value:l,sign:l>=0?1:-1})));function I(l,r,a,o,n){const i=n===-1&&l>=0?-l:l;return c.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,i,c.dataLabel({p:t.value.style.chart.bars.dataLabels.prefix,v:i,s:t.value.style.chart.bars.dataLabels.suffix,r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:r,seriesIndex:a,datapointIndex:o})}function ge(l,r,a,o){return c.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,l,c.dataLabel({v:l,s:"%",r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:r,seriesIndex:a,datapointIndex:o})}function ye(l){const r=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}));K("selectDatapoint",{datapoint:r,period:P.value[l]})}function me(l){$.value=l,O.value=!0;const r=t.value.style.chart.tooltip.customFormat,a=JSON.parse(JSON.stringify(g.value)).map(n=>({name:n.name,value:n.series[l]===0?0:(n.signedSeries[l]===-1&&n.series[l]>=0?-n.series[l]:n.series[l])||null,proportion:n.proportions[l]||null,color:n.color,id:n.id})),o=a.map(n=>Math.abs(n.value)).reduce((n,i)=>n+i,0);if(c.isFunction(r)&&c.functionReturnsString(()=>r({seriesIndex:l,datapoint:a,series:g.value,config:t.value})))X.value=r({seriesIndex:l,datapoint:a,series:g.value,config:t.value});else{const{showValue:n,showPercentage:i,borderColor:m,roundingValue:S,roundingPercentage:z}=t.value.style.chart.tooltip;let F="";P.value[l]&&(F+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${m};padding-bottom:6px;margin-bottom:3px;">${P.value[l]}</div>`);const _=[n&&i?"(":"",n&&i?")":""];a.reverse().forEach(f=>{F+=`
2
2
  <div style="display:flex;flex-direction:row;align-items:center;gap:4px">
3
3
  <svg viewBox="0 0 12 12" height="14" width="14"><rect rx="1" x="0" y="0" height="12" width="12" stroke="none" fill="${t.value.style.chart.bars.gradient.show?`url(#gradient_${f.id})`:f.color}"/></svg>
4
4
  ${f.name}${n||i?":":""} ${n?c.dataLabel({p:t.value.style.chart.bars.dataLabels.prefix,v:f.value,s:t.value.style.chart.bars.dataLabels.suffix,r:S}):""} ${_[0]}${i?c.dataLabel({v:isNaN(f.value/o)?0:Math.abs(f.value)/o*100,s:"%",r:z}):""}${_[1]}
@@ -1,17 +1,17 @@
1
1
  import { computed as p, ref as g, onMounted as Xe, watch as Ue, openBlock as s, createElementBlock as n, normalizeClass as ye, normalizeStyle as U, createBlock as Y, createCommentVNode as v, renderSlot as k, createVNode as se, unref as z, createSlots as xt, withCtx as C, normalizeProps as D, guardReactiveProps as E, Fragment as h, renderList as f, createElementVNode as H, toDisplayString as S, createTextVNode as kt } from "vue";
2
- import { u as wt, c as Ye, t as Ct, a as _t, p as ie, M as Ge, b as zt, o as Lt, e as Je, g as St, d as $t, a4 as ne, a0 as qe, C as Ze, X as Mt, l as Tt, F as Ke, f as B, x as Qe, i as je, y as Nt, q as Ot, r as Pt } from "./index-49zKC_pb.js";
3
- import { u as et } from "./useNestedProp-D1a8xzOZ.js";
2
+ import { u as wt, c as Ye, t as Ct, a as _t, p as ie, M as Ge, b as zt, o as Lt, e as Je, g as St, d as $t, a4 as ne, a0 as qe, C as Ze, X as Mt, l as Tt, F as Ke, f as B, x as Qe, i as je, y as Nt, q as Ot, r as Pt } from "./index-Cn1EWnYG.js";
3
+ import { u as et } from "./useNestedProp-BXn-g9sr.js";
4
4
  import { t as At, u as Rt } from "./useResponsive-CoxXLe23.js";
5
- import { u as It, U as Ft } from "./usePrinter-fXMN7kAV.js";
6
- import { S as Vt } from "./Slicer-BcsAfmLx.js";
7
- import { _ as Dt } from "./Tooltip-DV_iWmTl.js";
8
- import { _ as Et } from "./Title-Bsbq2v6j.js";
9
- import { L as Ht } from "./Legend-DOn6UaCZ.js";
10
- import Bt from "./vue-ui-accordion-RGtr28JI.js";
11
- import { D as Wt } from "./DataTable-sGuRDRal.js";
12
- import Xt from "./vue-ui-skeleton-CWI6cZZA.js";
13
- import { _ as Ut } from "./PackageVersion-ldwwWp9S.js";
14
- import { P as Yt } from "./PenAndPaper-DSz98f49.js";
5
+ import { u as It, U as Ft } from "./usePrinter-ZkzmtO6K.js";
6
+ import { S as Vt } from "./Slicer-CA5jR9Em.js";
7
+ import { _ as Dt } from "./Tooltip-klg8yuWM.js";
8
+ import { _ as Et } from "./Title-yJsQ5q-l.js";
9
+ import { L as Ht } from "./Legend-8QHo6cZQ.js";
10
+ import Bt from "./vue-ui-accordion-UADqAdVj.js";
11
+ import { D as Wt } from "./DataTable-CnLqhXZ2.js";
12
+ import Xt from "./vue-ui-skeleton-D3AGluiW.js";
13
+ import { _ as Ut } from "./PackageVersion-Bw7N_9KM.js";
14
+ import { P as Yt } from "./PenAndPaper-BiWc81tP.js";
15
15
  import { _ as Gt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
16
16
  const Jt = ["id"], qt = ["xmlns", "viewBox"], Zt = { key: 0 }, Kt = ["id"], Qt = ["stop-color"], jt = ["stop-color"], ea = ["stop-color"], ta = ["x1", "x2", "y1", "y2", "stroke"], aa = ["x1", "x2", "y1", "y2", "stroke"], la = ["x1", "x2", "y1", "y2", "stroke"], oa = ["x1", "x2", "y1", "y2", "stroke"], ra = ["x", "y", "height", "rx", "width", "fill", "stroke", "stroke-width"], sa = ["x", "y", "width", "rx", "height", "fill", "stroke", "stroke-width"], ia = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], na = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], ua = ["x", "y", "font-size", "fill", "font-weight"], ca = ["transform", "font-size", "fill", "font-weight"], va = ["x", "y", "font-size", "fill", "font-weight"], ha = { key: 0 }, da = ["x", "y", "font-size", "font-weight", "fill"], ya = ["x", "y", "font-size", "fill", "font-weight"], ga = { key: 0 }, ba = ["x", "y", "font-size", "font-weight", "fill"], fa = ["x1", "x2", "y1", "y2", "stroke"], ma = ["x", "y", "font-size", "font-weight", "fill"], pa = ["x1", "x2", "y1", "y2", "stroke"], xa = ["font-size", "font-weight", "fill", "text-anchor", "transform"], ka = ["text-anchor", "font-size", "font-weight", "fill", "transform"], wa = ["font-size", "font-weight", "fill", "x", "y"], Ca = ["x", "y", "width", "height", "onClick", "onMouseenter", "fill"], _a = ["x", "y", "width", "height", "onClick", "onMouseenter", "fill"], za = {
17
17
  key: 4,
@@ -1,16 +1,16 @@
1
1
  import { computed as h, ref as i, watch as Ie, onMounted as Me, onBeforeUnmount as De, openBlock as o, createElementBlock as u, normalizeClass as F, normalizeStyle as Q, createBlock as T, createCommentVNode as v, unref as d, createSlots as Ge, withCtx as f, renderSlot as y, normalizeProps as W, guardReactiveProps as I, createVNode as xe, Fragment as g, renderList as C, createElementVNode as k, toDisplayString as L, mergeProps as Ee, createTextVNode as Ve, nextTick as He } from "vue";
2
- import { u as Re, c as Z, t as Ue, a as Be, p as A, o as Xe, e as ee, g as Ce, b as je, d as we, v as Ye, C as Je, f as B, X as qe, i as te, l as Ke, h as Qe, x as _e, y as Ze, q as et, r as tt, E as lt } from "./index-49zKC_pb.js";
2
+ import { u as Re, c as Z, t as Ue, a as Be, p as A, o as Xe, e as ee, g as Ce, b as je, d as we, v as Ye, C as Je, f as B, X as qe, i as te, l as Ke, h as Qe, x as _e, y as Ze, q as et, r as tt, E as lt } from "./index-Cn1EWnYG.js";
3
3
  import { t as at, u as ot } from "./useResponsive-CoxXLe23.js";
4
- import { _ as st } from "./Title-Bsbq2v6j.js";
5
- import { u as rt, U as ut } from "./usePrinter-fXMN7kAV.js";
6
- import { _ as nt } from "./Tooltip-DV_iWmTl.js";
7
- import { D as it } from "./DataTable-sGuRDRal.js";
8
- import vt from "./vue-ui-skeleton-CWI6cZZA.js";
9
- import { _ as ct } from "./Shape-CL9-IFMq.js";
10
- import ht from "./vue-ui-accordion-RGtr28JI.js";
11
- import { u as $e } from "./useNestedProp-D1a8xzOZ.js";
12
- import { _ as dt } from "./PackageVersion-ldwwWp9S.js";
13
- import { P as pt } from "./PenAndPaper-DSz98f49.js";
4
+ import { _ as st } from "./Title-yJsQ5q-l.js";
5
+ import { u as rt, U as ut } from "./usePrinter-ZkzmtO6K.js";
6
+ import { _ as nt } from "./Tooltip-klg8yuWM.js";
7
+ import { D as it } from "./DataTable-CnLqhXZ2.js";
8
+ import vt from "./vue-ui-skeleton-D3AGluiW.js";
9
+ import { _ as ct } from "./Shape-CppjH62a.js";
10
+ import ht from "./vue-ui-accordion-UADqAdVj.js";
11
+ import { u as $e } from "./useNestedProp-BXn-g9sr.js";
12
+ import { _ as dt } from "./PackageVersion-Bw7N_9KM.js";
13
+ import { P as pt } from "./PenAndPaper-BiWc81tP.js";
14
14
  import { _ as ft } from "./_plugin-vue_export-helper-CHgC5LLL.js";
15
15
  const yt = ["id"], bt = ["xmlns", "viewBox"], mt = { key: 0 }, gt = { key: 0 }, kt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], xt = { key: 1 }, Ct = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], wt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], _t = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], $t = ["x", "y", "fill", "font-size"], Tt = ["x", "y", "font-size", "fill"], Lt = ["fill", "font-size", "transform"], At = ["fill", "font-size", "x", "y"], Pt = ["x1", "x2", "y1", "y2", "stroke"], St = ["cx", "cy", "fill"], zt = ["cx", "cy", "fill"], Nt = ["id"], Ot = ["stop-color"], Ft = ["stop-color"], Wt = ["stop-color"], It = { key: 0 }, Mt = ["x", "y", "font-size", "fill"], Dt = {
16
16
  key: 5,