vue-data-ui 2.3.12 → 2.3.13

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 (136) hide show
  1. package/dist/{Arrow-D9RknCbe.js → Arrow-CxtecoRx.js} +1 -1
  2. package/dist/{Arrow-CAMiXnML.cjs → Arrow-DVPNR1Nh.cjs} +1 -1
  3. package/dist/{BaseIcon-DB1g9sdS.js → BaseIcon-Di0MGg_5.js} +1 -1
  4. package/dist/{BaseIcon-5MAyZTOz.cjs → BaseIcon-Dmx2OFvz.cjs} +1 -1
  5. package/dist/{DataTable-CGX9xKvm.cjs → DataTable-DQGTnBUl.cjs} +1 -1
  6. package/dist/{DataTable-Bza1ed62.js → DataTable-cwJyYtAp.js} +2 -2
  7. package/dist/{Legend-BEMGbN0s.cjs → Legend-BEEbv4va.cjs} +1 -1
  8. package/dist/{Legend-C4cCpb4z.js → Legend-CwT-9P7R.js} +1 -1
  9. package/dist/{Shape-BTzik3V0.cjs → Shape-D_rvgadQ.cjs} +1 -1
  10. package/dist/{Shape-Bttb-v8s.js → Shape-Gv8uj72o.js} +1 -1
  11. package/dist/{Slicer-CuwuufTu.cjs → Slicer-BS_vWPLd.cjs} +1 -1
  12. package/dist/{Slicer-WyjxXfiD.js → Slicer-_2QX31RS.js} +1 -1
  13. package/dist/{Title-BSpLzDC1.js → Title-2ab2u_K8.js} +1 -1
  14. package/dist/{Title-XRMcJkna.cjs → Title-DpgU75bw.cjs} +1 -1
  15. package/dist/{Tooltip-COgv-iii.cjs → Tooltip-B2BLFWIv.cjs} +1 -1
  16. package/dist/{Tooltip-DI8_Wjjy.js → Tooltip-mW2mhj5b.js} +1 -1
  17. package/dist/index--K6Ja9Gj.cjs +4 -0
  18. package/dist/{index-ByO3Ywek.js → index-8jKJqifI.js} +2 -2
  19. package/dist/{useNestedProp-Dikfncsl.cjs → useNestedProp-Bs4c78Cx.cjs} +1 -1
  20. package/dist/{useNestedProp-Da77DnaA.js → useNestedProp-R6UMUTVL.js} +1 -1
  21. package/dist/{usePrinter-Dda5FBG3.js → usePrinter-BZ_nWqN_.js} +1 -1
  22. package/dist/{usePrinter-DedM_6px.cjs → usePrinter-CysnJve5.cjs} +1 -1
  23. package/dist/{vue-data-ui-CV6BvTv3.cjs → vue-data-ui-B_t2clEx.cjs} +1 -1
  24. package/dist/{vue-data-ui-Cl7hqjOh.js → vue-data-ui-cMMDkIkv.js} +55 -55
  25. package/dist/vue-data-ui.cjs +1 -1
  26. package/dist/vue-data-ui.js +1 -1
  27. package/dist/{vue-ui-3d-bar-DoFgj58m.js → vue-ui-3d-bar-BbuTc4wl.js} +7 -7
  28. package/dist/{vue-ui-3d-bar-DMek7e52.cjs → vue-ui-3d-bar-D_KT2ttX.cjs} +1 -1
  29. package/dist/{vue-ui-accordion-BytUYLYl.cjs → vue-ui-accordion-B0UeLf1b.cjs} +1 -1
  30. package/dist/{vue-ui-accordion-CbKHVPHh.js → vue-ui-accordion-BsXo1_Ap.js} +3 -3
  31. package/dist/{vue-ui-age-pyramid-CZy4Y3uw.js → vue-ui-age-pyramid-2ncnyfbF.js} +8 -8
  32. package/dist/{vue-ui-age-pyramid-DjlXDjMI.cjs → vue-ui-age-pyramid-NkJjm7Y5.cjs} +1 -1
  33. package/dist/{vue-ui-annotator-BqG8z2Ms.js → vue-ui-annotator-1XKNdkzk.js} +1 -1
  34. package/dist/{vue-ui-annotator-BJShyHMc.cjs → vue-ui-annotator-Cp_9YW9j.cjs} +1 -1
  35. package/dist/{vue-ui-candlestick-DkOQM3qu.js → vue-ui-candlestick-BRtCmvvk.js} +9 -9
  36. package/dist/{vue-ui-candlestick-DJETMuli.cjs → vue-ui-candlestick-C7UfUhKH.cjs} +1 -1
  37. package/dist/{vue-ui-carousel-table-C2vcNP0X.js → vue-ui-carousel-table-BDSfeqmZ.js} +4 -4
  38. package/dist/{vue-ui-carousel-table-BQipTTWP.cjs → vue-ui-carousel-table-DqFMeiuA.cjs} +1 -1
  39. package/dist/{vue-ui-chestnut-D39qozSK.js → vue-ui-chestnut-BYjoX9jF.js} +6 -6
  40. package/dist/{vue-ui-chestnut-D3FtT3JK.cjs → vue-ui-chestnut-C8OAoRK_.cjs} +1 -1
  41. package/dist/{vue-ui-cursor-LMFBAzPM.js → vue-ui-cursor-D2Z7TPI-.js} +2 -2
  42. package/dist/{vue-ui-cursor-CpJO5mEd.cjs → vue-ui-cursor-g-HCrJEh.cjs} +1 -1
  43. package/dist/{vue-ui-dashboard-BzOic-SZ.cjs → vue-ui-dashboard-BtcFyRqQ.cjs} +1 -1
  44. package/dist/{vue-ui-dashboard-C-LaI61T.js → vue-ui-dashboard-Di61LOP8.js} +2 -2
  45. package/dist/{vue-ui-digits-D2XilsJW.cjs → vue-ui-digits-CWBg_VEu.cjs} +1 -1
  46. package/dist/{vue-ui-digits-BMoM0DwG.js → vue-ui-digits-DZ4PtZ2V.js} +2 -2
  47. package/dist/{vue-ui-donut-BYacXuN1.cjs → vue-ui-donut-D7coup6_.cjs} +1 -1
  48. package/dist/{vue-ui-donut-evolution-DwhuTpBB.cjs → vue-ui-donut-evolution-D0CnAbTe.cjs} +1 -1
  49. package/dist/{vue-ui-donut-evolution-Dr1MkSB2.js → vue-ui-donut-evolution-DFnIT2Ha.js} +9 -9
  50. package/dist/{vue-ui-donut-DvESP2fh.js → vue-ui-donut-goSbPuLj.js} +9 -9
  51. package/dist/{vue-ui-dumbbell-kTZ4cbhw.js → vue-ui-dumbbell-Bg3ZJTCq.js} +8 -8
  52. package/dist/{vue-ui-dumbbell-CzYf1Etr.cjs → vue-ui-dumbbell-CgLLF153.cjs} +1 -1
  53. package/dist/{vue-ui-flow-BkSTX5_A.js → vue-ui-flow-B3z_g_8N.js} +7 -7
  54. package/dist/{vue-ui-flow-BJbCaSJI.cjs → vue-ui-flow-BkxQCKjx.cjs} +1 -1
  55. package/dist/{vue-ui-galaxy-DiKAWRBN.js → vue-ui-galaxy-9GX2Yn08.js} +9 -9
  56. package/dist/{vue-ui-galaxy-Bb-A8wCU.cjs → vue-ui-galaxy-XEjtYCs3.cjs} +1 -1
  57. package/dist/{vue-ui-gauge-Dt6Cuuo0.js → vue-ui-gauge-BlGlMncn.js} +4 -4
  58. package/dist/{vue-ui-gauge-DvYBrZs4.cjs → vue-ui-gauge-CgPj9uEv.cjs} +1 -1
  59. package/dist/{vue-ui-heatmap-KHa42VW8.cjs → vue-ui-heatmap-B4CFPky7.cjs} +1 -1
  60. package/dist/{vue-ui-heatmap-B9B0h5N8.js → vue-ui-heatmap-hMExvod2.js} +8 -8
  61. package/dist/{vue-ui-kpi-BfqVRF0H.cjs → vue-ui-kpi-BK9T4bpj.cjs} +1 -1
  62. package/dist/{vue-ui-kpi-Bts4qzfH.js → vue-ui-kpi-Cq6v98L7.js} +2 -2
  63. package/dist/{vue-ui-mini-loader-DdlM_ms1.cjs → vue-ui-mini-loader-CbxnHLGF.cjs} +1 -1
  64. package/dist/{vue-ui-mini-loader-CZtaTr-s.js → vue-ui-mini-loader-Dlt9PzOu.js} +2 -2
  65. package/dist/{vue-ui-molecule-Y29DXzD8.js → vue-ui-molecule-Do_rYDzn.js} +9 -9
  66. package/dist/{vue-ui-molecule-Cey5Cuqp.cjs → vue-ui-molecule-o7CQo9fo.cjs} +1 -1
  67. package/dist/{vue-ui-mood-radar-CaXsxM2P.js → vue-ui-mood-radar-CUJgwOoe.js} +9 -9
  68. package/dist/{vue-ui-mood-radar-BGQYx51N.cjs → vue-ui-mood-radar-DI5JbPJo.cjs} +1 -1
  69. package/dist/{vue-ui-nested-donuts-B0OSKK4x.cjs → vue-ui-nested-donuts-DKoxrXcL.cjs} +1 -1
  70. package/dist/{vue-ui-nested-donuts-8aIjfQHr.js → vue-ui-nested-donuts-Dj2KRb7e.js} +9 -9
  71. package/dist/{vue-ui-onion-BuM5DcbA.js → vue-ui-onion-Cc2jbWrA.js} +9 -9
  72. package/dist/{vue-ui-onion-D8Ug2z_r.cjs → vue-ui-onion-yFKEaqim.cjs} +1 -1
  73. package/dist/{vue-ui-parallel-coordinate-plot-RAjWALxs.cjs → vue-ui-parallel-coordinate-plot-Bktf9Q8d.cjs} +1 -1
  74. package/dist/{vue-ui-parallel-coordinate-plot-BnylgPQ1.js → vue-ui-parallel-coordinate-plot-sbbh6u1F.js} +10 -10
  75. package/dist/{vue-ui-quadrant-DpUSb39t.js → vue-ui-quadrant-BPR-kNQP.js} +10 -10
  76. package/dist/{vue-ui-quadrant-Bd9XzzOJ.cjs → vue-ui-quadrant-R3-Xo1sw.cjs} +1 -1
  77. package/dist/{vue-ui-quick-chart-CMkvhuhW.js → vue-ui-quick-chart-DO8ZMKIh.js} +6 -6
  78. package/dist/{vue-ui-quick-chart-7dYq_RGE.cjs → vue-ui-quick-chart-DfSCSQqC.cjs} +1 -1
  79. package/dist/{vue-ui-radar-DVFyhzLg.cjs → vue-ui-radar-66Df70XX.cjs} +1 -1
  80. package/dist/{vue-ui-radar-BlHTPxa4.js → vue-ui-radar-aAN29Jds.js} +10 -10
  81. package/dist/{vue-ui-rating-cVAVmnzB.js → vue-ui-rating-CjBBd7yH.js} +2 -2
  82. package/dist/{vue-ui-rating-DRncGN96.cjs → vue-ui-rating-D_ccOaNz.cjs} +1 -1
  83. package/dist/{vue-ui-relation-circle-B8iBDo0q.js → vue-ui-relation-circle-CMzLThvR.js} +5 -5
  84. package/dist/{vue-ui-relation-circle-C8QjpkXl.cjs → vue-ui-relation-circle-Ck1rJqbu.cjs} +1 -1
  85. package/dist/{vue-ui-rings-CQq3JQNk.js → vue-ui-rings-CLZcLdfP.js} +9 -9
  86. package/dist/{vue-ui-rings-m4MWlNsq.cjs → vue-ui-rings-ChK4CWHY.cjs} +1 -1
  87. package/dist/{vue-ui-scatter-C-Egs7S_.js → vue-ui-scatter-08CGJzrL.js} +10 -10
  88. package/dist/{vue-ui-scatter-mNEnBtaf.cjs → vue-ui-scatter-nYfvOhiI.cjs} +1 -1
  89. package/dist/{vue-ui-screenshot-Bl9jX-C2.cjs → vue-ui-screenshot-B-dCSFDA.cjs} +1 -1
  90. package/dist/{vue-ui-screenshot-DfHSBG7u.js → vue-ui-screenshot-BlJChEJa.js} +1 -1
  91. package/dist/{vue-ui-skeleton-rY_nZhMQ.cjs → vue-ui-skeleton-Bf_PLiHN.cjs} +1 -1
  92. package/dist/{vue-ui-skeleton-BxRSQeuo.js → vue-ui-skeleton-CxbgzdoX.js} +2 -2
  93. package/dist/{vue-ui-smiley-J5ng6jFT.js → vue-ui-smiley-C_atoEId.js} +2 -2
  94. package/dist/{vue-ui-smiley-BWTx88Vc.cjs → vue-ui-smiley-CwpLvr5B.cjs} +1 -1
  95. package/dist/{vue-ui-spark-trend-CKllSCO9.cjs → vue-ui-spark-trend-DgvljrXb.cjs} +1 -1
  96. package/dist/{vue-ui-spark-trend-CSgSKyhQ.js → vue-ui-spark-trend-jzplEySC.js} +4 -4
  97. package/dist/{vue-ui-sparkbar-wLasc_jU.cjs → vue-ui-sparkbar-BaqyijV1.cjs} +1 -1
  98. package/dist/{vue-ui-sparkbar-BDSuCvBs.js → vue-ui-sparkbar-DQSTdQ1V.js} +36 -37
  99. package/dist/{vue-ui-sparkgauge-DsKCi2rC.js → vue-ui-sparkgauge-B5UKLj0l.js} +3 -3
  100. package/dist/{vue-ui-sparkgauge-DLf9qwso.cjs → vue-ui-sparkgauge-Z18yo2Z8.cjs} +1 -1
  101. package/dist/{vue-ui-sparkhistogram-BY9WjI96.js → vue-ui-sparkhistogram-Be3ehhGJ.js} +4 -4
  102. package/dist/{vue-ui-sparkhistogram-D3xFCR7z.cjs → vue-ui-sparkhistogram-CmCIpXl6.cjs} +1 -1
  103. package/dist/{vue-ui-sparkline-D8gMceMV.js → vue-ui-sparkline-BYqBWbjw.js} +3 -3
  104. package/dist/{vue-ui-sparkline-BhB4gTda.cjs → vue-ui-sparkline-D80QVWdy.cjs} +1 -1
  105. package/dist/{vue-ui-sparkstackbar-dINlqLlM.cjs → vue-ui-sparkstackbar-DH4dUMx0.cjs} +1 -1
  106. package/dist/{vue-ui-sparkstackbar-8ap_HMW0.js → vue-ui-sparkstackbar-DjnE1I-5.js} +3 -3
  107. package/dist/{vue-ui-strip-plot-wUXpoWOD.cjs → vue-ui-strip-plot-Cln20Ld8.cjs} +1 -1
  108. package/dist/{vue-ui-strip-plot-Duu9jsML.js → vue-ui-strip-plot-DJy6rHjW.js} +9 -9
  109. package/dist/{vue-ui-table-Bbjo6d7J.js → vue-ui-table-Ffw1XO2M.js} +1 -1
  110. package/dist/{vue-ui-table-heatmap-CokrixjX.js → vue-ui-table-heatmap-BQexH7HX.js} +4 -4
  111. package/dist/{vue-ui-table-heatmap-BWUGw4tD.cjs → vue-ui-table-heatmap-D1Nbq4uX.cjs} +1 -1
  112. package/dist/{vue-ui-table-sparkline-DwStFsdv.cjs → vue-ui-table-sparkline-tfvjgw5Z.cjs} +1 -1
  113. package/dist/{vue-ui-table-sparkline-B4f74K6D.js → vue-ui-table-sparkline-uVlNJ867.js} +5 -5
  114. package/dist/{vue-ui-table-DPBuQHl9.cjs → vue-ui-table-zZ7Z9muE.cjs} +1 -1
  115. package/dist/{vue-ui-thermometer-Bvw08auw.js → vue-ui-thermometer-C3aP4aYg.js} +5 -5
  116. package/dist/{vue-ui-thermometer-D4lvsaZQ.cjs → vue-ui-thermometer-DKYjF4LF.cjs} +1 -1
  117. package/dist/{vue-ui-timer-BSU22BD2.cjs → vue-ui-timer-BdwfMEMG.cjs} +1 -1
  118. package/dist/{vue-ui-timer-C6zSHO_W.js → vue-ui-timer-dDMpywVB.js} +4 -4
  119. package/dist/{vue-ui-tiremarks-CH0_xCoD.cjs → vue-ui-tiremarks-CKmVyzxM.cjs} +1 -1
  120. package/dist/{vue-ui-tiremarks-BY4m2mEn.js → vue-ui-tiremarks-pjMd7d-R.js} +5 -5
  121. package/dist/{vue-ui-treemap-DIxqUkmn.cjs → vue-ui-treemap-BuEmj1Sy.cjs} +1 -1
  122. package/dist/{vue-ui-treemap-DWBXR_CR.js → vue-ui-treemap-CXwX04Bu.js} +9 -9
  123. package/dist/{vue-ui-vertical-bar-DnPmmj4p.cjs → vue-ui-vertical-bar-BV_CvoPe.cjs} +1 -1
  124. package/dist/{vue-ui-vertical-bar-BxvhqgWg.js → vue-ui-vertical-bar-DC8B39Uu.js} +9 -9
  125. package/dist/{vue-ui-waffle-CYpc5Enk.cjs → vue-ui-waffle-Doh1T4Ji.cjs} +1 -1
  126. package/dist/{vue-ui-waffle-BlFjCDDx.js → vue-ui-waffle-t4gEowfH.js} +9 -9
  127. package/dist/{vue-ui-wheel-CHvx9zQF.js → vue-ui-wheel-B9yjkkA6.js} +5 -5
  128. package/dist/{vue-ui-wheel-WxC0_YV_.cjs → vue-ui-wheel-Rv1F1zVc.cjs} +1 -1
  129. package/dist/{vue-ui-word-cloud-LMl5vudk.cjs → vue-ui-word-cloud-CIdTdi88.cjs} +1 -1
  130. package/dist/{vue-ui-word-cloud-BnLAMza-.js → vue-ui-word-cloud-SlFlX-fY.js} +6 -6
  131. package/dist/{vue-ui-xy-DHzwqXVf.cjs → vue-ui-xy-CzqnufbM.cjs} +1 -1
  132. package/dist/{vue-ui-xy-DStN5sP4.js → vue-ui-xy-DpnhJcZD.js} +12 -12
  133. package/dist/{vue-ui-xy-canvas-D3zCvIfh.js → vue-ui-xy-canvas-Dwl-uL4T.js} +10 -10
  134. package/dist/{vue-ui-xy-canvas-DTjWEsfN.cjs → vue-ui-xy-canvas-Dzl92nPU.cjs} +1 -1
  135. package/package.json +1 -1
  136. package/dist/index-BDKEFvEF.cjs +0 -4
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-BDKEFvEF.cjs"),x=require("./useNestedProp-Dikfncsl.cjs"),E=require("./vue-ui-skeleton-rY_nZhMQ.cjs"),V=["onClick"],$={key:1},z=["xmlns","viewBox"],D=["id"],P=["stop-color"],A=["stop-color"],F=["height","width","fill","rx"],L=["height","width","fill","rx"],T=["height","width","fill","rx"],O={__name:"vue-ui-sparkbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}},backgroundOpacity:{type:Number,default:100}},emits:["selectDatapoint"],setup(v,{emit:b}){const n=v,{vue_ui_sparkbar:C}=o.useConfig(),p=e.computed(()=>!!n.dataset&&n.dataset.length),y=e.ref(o.createUid()),t=e.computed(()=>{const l=x.useNestedProp({userConfig:n.config,defaultConfig:C});return l.theme?{...x.useNestedProp({userConfig:o.themes.vue_ui_sparkbar[l.theme]||n.config,defaultConfig:l}),customPalette:o.themePalettes[l.theme]||o.palette}:l}),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}))),g=e.ref(null);e.onMounted(async()=>{o.objectIsEmpty(n.dataset)&&o.error({componentName:"VueUiSparkbar",type:"dataset"}),f()});function f(){if(t.value.style.animation.show){let k=function(){s+=a/l,s<a?(c.value=c.value.map((u,d)=>({...u,value:u.value+=r[d]})),g.value=requestAnimationFrame(k)):c.value=n.dataset.map(u=>({...u,value:u.value||0}))};const l=t.value.style.animation.animationFrames,r=n.dataset.map((u,d)=>u.value/l),a=n.dataset.map(u=>u.value||0).reduce((u,d)=>u+d,0);let s=0;k()}}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})),e.nextTick(f)},{deep:!0});const i=e.ref({width:500,height:16}),w=e.computed(()=>Math.max(...n.dataset.map(l=>l.value))),N=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 _(l){return l/w.value}function h(l){return t.value.style.layout.independant?l.target?l.value/l.target:t.value.style.layout.percentage?l.value/100:t.value.style.layout.target===0?1:l.value/t.value.style.layout.target:_(l.value)}function m(l){return t.value.style.layout.independant&&l.target||t.value.style.layout.target}function B(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:t.value.style.backgroundColor+e.unref(o.opacity)[n.backgroundOpacity]})},[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(N.value,(a,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[p.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;${v.dataset.length>0&&s!==v.dataset.length-1?"margin-bottom:6px":""}`),onClick:()=>B(a,s)},[e.renderSlot(l.$slots,"data-label",e.normalizeProps(e.guardReactiveProps({bar:{...a,target:m(a),valueLabel:e.unref(o.dataLabel)({p:a.prefix||"",v:a.value,s:a.suffix||"",r:a.rounding||0}),targetLabel:e.unref(o.dataLabel)({p:a.prefix||"",v:m(a),s:a.suffix||"",r:a.rounding||0})}}))),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.createTextVNode(e.toDisplayString(t.value.style.labels.name.position)+" ",1),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.dataLabel)({p:a.prefix||"",v:a.value,s:a.suffix||"",r:a.rounding||0})),5)):e.createCommentVNode("",!0),t.value.style.layout.showTargetValue?(e.openBlock(),e.createElementBlock("span",$,e.toDisplayString(" "+t.value.style.layout.targetValueText)+" "+e.toDisplayString(e.unref(o.dataLabel)({p:a.prefix||"",v:m(a),s:a.suffix||"",r:a.rounding||0})),1)):e.createCommentVNode("",!0)],4)),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(o.XMLNS),viewBox:`0 0 ${i.value.width} ${i.value.height}`,width:"100%"},[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{x1:"0%",y1:"0%",x2:"100%",y2:"0%",id:`sparkbar_gradient_${s}_${y.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(o.shiftHue)(a.color,.03)}${e.unref(o.opacity)[100-t.value.style.bar.gradient.intensity]}`},null,8,P),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,A)],8,D)]),e.createElementVNode("rect",{height:i.value.height,width:i.value.width,x:0,y:0,fill:`${t.value.style.gutter.backgroundColor}${e.unref(o.opacity)[t.value.style.gutter.opacity]}`,rx:i.value.height/2},null,8,F),e.createElementVNode("rect",{height:i.value.height,width:i.value.width*h(a),x:0,y:0,fill:t.value.style.bar.gradient.underlayerColor,rx:i.value.height/2},null,8,L),e.createElementVNode("rect",{height:i.value.height,width:i.value.width*h(a),x:0,y:0,fill:t.value.style.bar.gradient.show?`url(#sparkbar_gradient_${s}_${y.value})`:a.color,rx:i.value.height/2},null,8,T)],8,z))],12,V)):e.createCommentVNode("",!0)],64))),256)),p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(E.default,{key:2,config:{type:"sparkbar",style:{backgroundColor:t.value.style.backgroundColor,sparkbar:{color:"#CCCCCC"}}}},null,8,["config"]))],4))}};exports.default=O;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index--K6Ja9Gj.cjs"),x=require("./useNestedProp-Bs4c78Cx.cjs"),E=require("./vue-ui-skeleton-Bf_PLiHN.cjs"),V=["onClick"],$={key:1},z=["xmlns","viewBox"],D=["id"],P=["stop-color"],A=["stop-color"],F=["height","width","fill","rx"],L=["height","width","fill","rx"],T=["height","width","fill","rx"],O={__name:"vue-ui-sparkbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}},backgroundOpacity:{type:Number,default:100}},emits:["selectDatapoint"],setup(v,{emit:b}){const n=v,{vue_ui_sparkbar:C}=o.useConfig(),p=e.computed(()=>!!n.dataset&&n.dataset.length),y=e.ref(o.createUid()),t=e.computed(()=>{const l=x.useNestedProp({userConfig:n.config,defaultConfig:C});return l.theme?{...x.useNestedProp({userConfig:o.themes.vue_ui_sparkbar[l.theme]||n.config,defaultConfig:l}),customPalette:o.themePalettes[l.theme]||o.palette}:l}),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}))),g=e.ref(null);e.onMounted(async()=>{o.objectIsEmpty(n.dataset)&&o.error({componentName:"VueUiSparkbar",type:"dataset"}),f()});function f(){if(t.value.style.animation.show){let k=function(){s+=a/l,s<a?(c.value=c.value.map((u,d)=>({...u,value:u.value+=r[d]})),g.value=requestAnimationFrame(k)):c.value=n.dataset.map(u=>({...u,value:u.value||0}))};const l=t.value.style.animation.animationFrames,r=n.dataset.map((u,d)=>u.value/l),a=n.dataset.map(u=>u.value||0).reduce((u,d)=>u+d,0);let s=0;k()}}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})),e.nextTick(f)},{deep:!0});const i=e.ref({width:500,height:16}),w=e.computed(()=>Math.max(...n.dataset.map(l=>l.value))),N=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 _(l){return l/w.value}function h(l){return t.value.style.layout.independant?l.target?l.value/l.target:t.value.style.layout.percentage?l.value/100:t.value.style.layout.target===0?1:l.value/t.value.style.layout.target:_(l.value)}function m(l){return t.value.style.layout.independant&&l.target||t.value.style.layout.target}function B(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:t.value.style.backgroundColor+e.unref(o.opacity)[n.backgroundOpacity]})},[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(N.value,(a,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[p.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;${v.dataset.length>0&&s!==v.dataset.length-1?"margin-bottom:6px":""}`),onClick:()=>B(a,s)},[e.renderSlot(l.$slots,"data-label",e.normalizeProps(e.guardReactiveProps({bar:{...a,target:m(a),valueLabel:e.unref(o.dataLabel)({p:a.prefix||"",v:a.value,s:a.suffix||"",r:a.rounding||0}),targetLabel:e.unref(o.dataLabel)({p:a.prefix||"",v:m(a),s:a.suffix||"",r:a.rounding||0})}}))),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.dataLabel)({p:a.prefix||"",v:a.value,s:a.suffix||"",r:a.rounding||0})),5)):e.createCommentVNode("",!0),t.value.style.layout.showTargetValue?(e.openBlock(),e.createElementBlock("span",$,e.toDisplayString(" "+t.value.style.layout.targetValueText)+" "+e.toDisplayString(e.unref(o.dataLabel)({p:a.prefix||"",v:m(a),s:a.suffix||"",r:a.rounding||0})),1)):e.createCommentVNode("",!0)],4)),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(o.XMLNS),viewBox:`0 0 ${i.value.width} ${i.value.height}`,width:"100%"},[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{x1:"0%",y1:"0%",x2:"100%",y2:"0%",id:`sparkbar_gradient_${s}_${y.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(o.shiftHue)(a.color,.03)}${e.unref(o.opacity)[100-t.value.style.bar.gradient.intensity]}`},null,8,P),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,A)],8,D)]),e.createElementVNode("rect",{height:i.value.height,width:i.value.width,x:0,y:0,fill:`${t.value.style.gutter.backgroundColor}${e.unref(o.opacity)[t.value.style.gutter.opacity]}`,rx:i.value.height/2},null,8,F),e.createElementVNode("rect",{height:i.value.height,width:i.value.width*h(a),x:0,y:0,fill:t.value.style.bar.gradient.underlayerColor,rx:i.value.height/2},null,8,L),e.createElementVNode("rect",{height:i.value.height,width:i.value.width*h(a),x:0,y:0,fill:t.value.style.bar.gradient.show?`url(#sparkbar_gradient_${s}_${y.value})`:a.color,rx:i.value.height/2},null,8,T)],8,z))],12,V)):e.createCommentVNode("",!0)],64))),256)),p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(E.default,{key:2,config:{type:"sparkbar",style:{backgroundColor:t.value.style.backgroundColor,sparkbar:{color:"#CCCCCC"}}}},null,8,["config"]))],4))}};exports.default=O;
@@ -1,8 +1,8 @@
1
- import { computed as f, ref as h, onMounted as j, watch as G, nextTick as W, openBlock as u, createElementBlock as n, normalizeStyle as y, unref as r, renderSlot as D, normalizeProps as P, mergeProps as q, createCommentVNode as c, createElementVNode as v, toDisplayString as p, Fragment as T, renderList as H, guardReactiveProps as X, createTextVNode as R, createBlock as J } from "vue";
2
- import { u as K, c as Q, t as Y, a as Z, p as x, b as ee, o as te, e as z, g as le, d as ae, r as C, f as b, X as se, s as oe } from "./index-ByO3Ywek.js";
3
- import { u as L } from "./useNestedProp-Da77DnaA.js";
4
- import ie from "./vue-ui-skeleton-BxRSQeuo.js";
5
- const ue = ["onClick"], ne = { key: 1 }, re = ["xmlns", "viewBox"], ve = ["id"], ce = ["stop-color"], de = ["stop-color"], ye = ["height", "width", "fill", "rx"], pe = ["height", "width", "fill", "rx"], ge = ["height", "width", "fill", "rx"], be = {
1
+ import { computed as f, ref as h, onMounted as j, watch as G, nextTick as W, openBlock as u, createElementBlock as n, normalizeStyle as y, unref as r, renderSlot as D, normalizeProps as P, mergeProps as q, createCommentVNode as c, createElementVNode as v, toDisplayString as p, Fragment as z, renderList as H, guardReactiveProps as X, createBlock as R } from "vue";
2
+ import { u as J, c as K, t as Q, a as Y, p as x, b as Z, o as ee, e as T, g as te, d as le, r as C, f as b, X as ae, s as se } from "./index-8jKJqifI.js";
3
+ import { u as L } from "./useNestedProp-R6UMUTVL.js";
4
+ import oe from "./vue-ui-skeleton-CxbgzdoX.js";
5
+ const ie = ["onClick"], ue = { key: 1 }, ne = ["xmlns", "viewBox"], re = ["id"], ve = ["stop-color"], ce = ["stop-color"], de = ["height", "width", "fill", "rx"], ye = ["height", "width", "fill", "rx"], pe = ["height", "width", "fill", "rx"], xe = {
6
6
  __name: "vue-ui-sparkbar",
7
7
  props: {
8
8
  config: {
@@ -26,43 +26,43 @@ const ue = ["onClick"], ne = { key: 1 }, re = ["xmlns", "viewBox"], ve = ["id"],
26
26
  }
27
27
  },
28
28
  emits: ["selectDatapoint"],
29
- setup(k, { emit: V }) {
30
- const a = k, { vue_ui_sparkbar: E } = K(), _ = f(() => !!a.dataset && a.dataset.length), $ = h(Q()), e = f(() => {
29
+ setup(k, { emit: E }) {
30
+ const a = k, { vue_ui_sparkbar: O } = J(), _ = f(() => !!a.dataset && a.dataset.length), $ = h(K()), e = f(() => {
31
31
  const t = L({
32
32
  userConfig: a.config,
33
- defaultConfig: E
33
+ defaultConfig: O
34
34
  });
35
35
  return t.theme ? {
36
36
  ...L({
37
- userConfig: Y.vue_ui_sparkbar[t.theme] || a.config,
37
+ userConfig: Q.vue_ui_sparkbar[t.theme] || a.config,
38
38
  defaultConfig: t
39
39
  }),
40
- customPalette: Z[t.theme] || x
40
+ customPalette: Y[t.theme] || x
41
41
  } : t;
42
- }), O = f(() => ee(e.value.customPalette)), g = h(a.dataset.map((t) => ({
42
+ }), V = f(() => Z(e.value.customPalette)), g = h(a.dataset.map((t) => ({
43
43
  ...t,
44
44
  value: e.value.style.animation.show ? 0 : t.value || 0
45
45
  }))), S = h(null);
46
46
  j(async () => {
47
- te(a.dataset) && z({
47
+ ee(a.dataset) && T({
48
48
  componentName: "VueUiSparkbar",
49
49
  type: "dataset"
50
50
  }), A();
51
51
  });
52
52
  function A() {
53
53
  if (e.value.style.animation.show) {
54
- let F = function() {
54
+ let N = function() {
55
55
  d += l / t, d < l ? (g.value = g.value.map((i, m) => ({
56
56
  ...i,
57
57
  value: i.value += s[m]
58
- })), S.value = requestAnimationFrame(F)) : g.value = a.dataset.map((i) => ({
58
+ })), S.value = requestAnimationFrame(N)) : g.value = a.dataset.map((i) => ({
59
59
  ...i,
60
60
  value: i.value || 0
61
61
  }));
62
62
  };
63
63
  const t = e.value.style.animation.animationFrames, s = a.dataset.map((i, m) => i.value / t), l = a.dataset.map((i) => i.value || 0).reduce((i, m) => i + m, 0);
64
64
  let d = 0;
65
- F();
65
+ N();
66
66
  }
67
67
  }
68
68
  G(() => a.dataset, async (t) => {
@@ -75,11 +75,11 @@ const ue = ["onClick"], ne = { key: 1 }, re = ["xmlns", "viewBox"], ve = ["id"],
75
75
  width: 500,
76
76
  height: 16
77
77
  }), B = f(() => Math.max(...a.dataset.map((t) => t.value))), I = f(() => (a.dataset.forEach((t, s) => {
78
- le({
78
+ te({
79
79
  datasetObject: t,
80
80
  requiredAttributes: ["name", "value"]
81
81
  }).forEach((l) => {
82
- z({
82
+ T({
83
83
  componentName: "VueUiSparkbar",
84
84
  type: "datasetSerieAttribute",
85
85
  property: l,
@@ -89,19 +89,19 @@ const ue = ["onClick"], ne = { key: 1 }, re = ["xmlns", "viewBox"], ve = ["id"],
89
89
  }), g.value.map((t, s) => ({
90
90
  ...t,
91
91
  value: t.value || 0,
92
- color: ae(t.color) || O.value[s] || x[s] || x[s % x.length]
92
+ color: le(t.color) || V.value[s] || x[s] || x[s % x.length]
93
93
  }))));
94
94
  function M(t) {
95
95
  return t / B.value;
96
96
  }
97
- function N(t) {
97
+ function F(t) {
98
98
  return e.value.style.layout.independant ? t.target ? t.value / t.target : e.value.style.layout.percentage ? t.value / 100 : e.value.style.layout.target === 0 ? 1 : t.value / e.value.style.layout.target : M(t.value);
99
99
  }
100
100
  function w(t) {
101
101
  return e.value.style.layout.independant && t.target || e.value.style.layout.target;
102
102
  }
103
103
  function U(t, s) {
104
- V("selectDatapoint", { datapoint: t, index: s });
104
+ E("selectDatapoint", { datapoint: t, index: s });
105
105
  }
106
106
  return (t, s) => (u(), n("div", {
107
107
  style: y({
@@ -138,7 +138,7 @@ const ue = ["onClick"], ne = { key: 1 }, re = ["xmlns", "viewBox"], ve = ["id"],
138
138
  })
139
139
  }, p(e.value.style.title.subtitle.text), 5)) : c("", !0)
140
140
  ], 4)) : c("", !0),
141
- (u(!0), n(T, null, H(I.value, (l, d) => (u(), n(T, null, [
141
+ (u(!0), n(z, null, H(I.value, (l, d) => (u(), n(z, null, [
142
142
  _.value ? (u(), n("div", {
143
143
  key: 0,
144
144
  style: y(`display:flex !important;${["left", "right"].includes(e.value.style.labels.name.position) ? `flex-direction: ${e.value.style.labels.name.position === "right" ? "row-reverse" : "row"} !important` : "flex-direction:column !important"};gap:${e.value.style.gap}px !important;align-items:center;${k.dataset.length > 0 && d !== k.dataset.length - 1 ? "margin-bottom:6px" : ""}`),
@@ -170,7 +170,6 @@ const ue = ["onClick"], ne = { key: 1 }, re = ["xmlns", "viewBox"], ve = ["id"],
170
170
  textAlign: ["left", "right"].includes(e.value.style.labels.name.position) || ["top", "top-left"].includes(e.value.style.labels.name.position) ? "left" : e.value.style.labels.name.position === "top-center" ? "center" : "right"
171
171
  })
172
172
  }, [
173
- R(p(e.value.style.labels.name.position) + " ", 1),
174
173
  v("span", null, p(l.name), 1),
175
174
  e.value.style.labels.value.show ? (u(), n("span", {
176
175
  key: 0,
@@ -181,7 +180,7 @@ const ue = ["onClick"], ne = { key: 1 }, re = ["xmlns", "viewBox"], ve = ["id"],
181
180
  s: l.suffix || "",
182
181
  r: l.rounding || 0
183
182
  })), 5)) : c("", !0),
184
- e.value.style.layout.showTargetValue ? (u(), n("span", ne, p(" " + e.value.style.layout.targetValueText) + " " + p(r(b)({
183
+ e.value.style.layout.showTargetValue ? (u(), n("span", ue, p(" " + e.value.style.layout.targetValueText) + " " + p(r(b)({
185
184
  p: l.prefix || "",
186
185
  v: w(l),
187
186
  s: l.suffix || "",
@@ -189,7 +188,7 @@ const ue = ["onClick"], ne = { key: 1 }, re = ["xmlns", "viewBox"], ve = ["id"],
189
188
  })), 1)) : c("", !0)
190
189
  ], 4)),
191
190
  (u(), n("svg", {
192
- xmlns: r(se),
191
+ xmlns: r(ae),
193
192
  viewBox: `0 0 ${o.value.width} ${o.value.height}`,
194
193
  width: "100%"
195
194
  }, [
@@ -203,13 +202,13 @@ const ue = ["onClick"], ne = { key: 1 }, re = ["xmlns", "viewBox"], ve = ["id"],
203
202
  }, [
204
203
  v("stop", {
205
204
  offset: "0%",
206
- "stop-color": `${r(oe)(l.color, 0.03)}${r(C)[100 - e.value.style.bar.gradient.intensity]}`
207
- }, null, 8, ce),
205
+ "stop-color": `${r(se)(l.color, 0.03)}${r(C)[100 - e.value.style.bar.gradient.intensity]}`
206
+ }, null, 8, ve),
208
207
  v("stop", {
209
208
  offset: "100%",
210
209
  "stop-color": l.color
211
- }, null, 8, de)
212
- ], 8, ve)
210
+ }, null, 8, ce)
211
+ ], 8, re)
213
212
  ]),
214
213
  v("rect", {
215
214
  height: o.value.height,
@@ -218,27 +217,27 @@ const ue = ["onClick"], ne = { key: 1 }, re = ["xmlns", "viewBox"], ve = ["id"],
218
217
  y: 0,
219
218
  fill: `${e.value.style.gutter.backgroundColor}${r(C)[e.value.style.gutter.opacity]}`,
220
219
  rx: o.value.height / 2
221
- }, null, 8, ye),
220
+ }, null, 8, de),
222
221
  v("rect", {
223
222
  height: o.value.height,
224
- width: o.value.width * N(l),
223
+ width: o.value.width * F(l),
225
224
  x: 0,
226
225
  y: 0,
227
226
  fill: e.value.style.bar.gradient.underlayerColor,
228
227
  rx: o.value.height / 2
229
- }, null, 8, pe),
228
+ }, null, 8, ye),
230
229
  v("rect", {
231
230
  height: o.value.height,
232
- width: o.value.width * N(l),
231
+ width: o.value.width * F(l),
233
232
  x: 0,
234
233
  y: 0,
235
234
  fill: e.value.style.bar.gradient.show ? `url(#sparkbar_gradient_${d}_${$.value})` : l.color,
236
235
  rx: o.value.height / 2
237
- }, null, 8, ge)
238
- ], 8, re))
239
- ], 12, ue)) : c("", !0)
236
+ }, null, 8, pe)
237
+ ], 8, ne))
238
+ ], 12, ie)) : c("", !0)
240
239
  ], 64))), 256)),
241
- _.value ? c("", !0) : (u(), J(ie, {
240
+ _.value ? c("", !0) : (u(), R(oe, {
242
241
  key: 2,
243
242
  config: {
244
243
  type: "sparkbar",
@@ -254,5 +253,5 @@ const ue = ["onClick"], ne = { key: 1 }, re = ["xmlns", "viewBox"], ve = ["id"],
254
253
  }
255
254
  };
256
255
  export {
257
- be as default
256
+ xe as default
258
257
  };
@@ -1,7 +1,7 @@
1
1
  import { computed as s, onMounted as _, ref as m, watch as F, openBlock as n, createElementBlock as r, normalizeStyle as v, toDisplayString as y, createCommentVNode as c, unref as $, createElementVNode as i, normalizeClass as O, createBlock as j } from "vue";
2
- import { u as B, o as E, e as w, g as D, c as G, t as I, H as U, X as V, f as q } from "./index-ByO3Ywek.js";
3
- import { u as C } from "./useNestedProp-Da77DnaA.js";
4
- import H from "./vue-ui-skeleton-BxRSQeuo.js";
2
+ import { u as B, o as E, e as w, g as D, c as G, t as I, H as U, X as V, f as q } from "./index-8jKJqifI.js";
3
+ import { u as C } from "./useNestedProp-R6UMUTVL.js";
4
+ import H from "./vue-ui-skeleton-CxbgzdoX.js";
5
5
  const P = ["xmlns", "viewBox"], T = ["id"], X = ["stop-color"], R = ["stop-color"], Y = ["d", "stroke", "stroke-linecap"], J = ["d", "stroke", "stroke-linecap", "stroke-dashoffset"], K = ["x", "y", "font-size", "fill", "font-weight"], te = {
6
6
  __name: "vue-ui-sparkgauge",
7
7
  props: {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-BDKEFvEF.cjs"),p=require("./useNestedProp-Dikfncsl.cjs"),C=require("./vue-ui-skeleton-rY_nZhMQ.cjs"),$=["xmlns","viewBox"],w=["id"],N=["stop-color"],S=["stop-color"],L=["d","stroke","stroke-linecap"],B=["d","stroke","stroke-linecap","stroke-dashoffset"],E=["x","y","font-size","fill","font-weight"],z={__name:"vue-ui-sparkgauge",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(g){const a=g,{vue_ui_sparkgauge:k}=u.useConfig(),c=e.computed(()=>!!a.dataset&&Object.keys(a.dataset).length);e.onMounted(()=>{u.objectIsEmpty(a.dataset)?u.error({componentName:"VueUiSparkgauge",type:"dataset"}):u.getMissingDatasetAttributes({datasetObject:a.dataset,requiredAttributes:["value","min","max"]}).forEach(o=>{u.error({componentName:"VueUiSparkgauge",type:"datasetAttribute",property:o})})});const d=e.ref(u.createUid()),t=e.computed(()=>{const o=p.useNestedProp({userConfig:a.config,defaultConfig:k});return o.theme?{...p.useNestedProp({userConfig:u.themes.vue_ui_sparkgauge[o.theme]||a.config,defaultConfig:o})}:o}),n=e.computed(()=>({height:t.value.style.height,width:128,base:t.value.style.basePosition})),l=e.computed(()=>{const o=a.dataset.min??0,i=a.dataset.max??0,_=i-o;return{min:o,max:i,diff:_}}),s=e.ref(t.value.style.animation.show?l.value.min:a.dataset.value);e.watch(()=>a.dataset.value,()=>{s.value=e.ref(t.value.style.animation.show?l.value.min:a.dataset.value),m()});const v=e.computed(()=>s.value>l.value.max?l.value.max:s.value<l.value.min?l.value.min:s.value),b=e.computed(()=>l.value.diff/t.value.style.animation.speedMs);e.onMounted(()=>{m()});function m(){function o(){s.value+=b.value,s.value<a.dataset.value?requestAnimationFrame(o):s.value=a.dataset.value}t.value.style.animation.show&&(s.value=l.value.min,o())}const r=e.computed(()=>a.dataset.title??""),y=e.computed(()=>s.value>=0?(v.value-l.value.min)/l.value.diff:(Math.abs(l.value.min)-Math.abs(v.value))/l.value.diff),f=e.computed(()=>u.interpolateColorHex(t.value.style.colors.min,t.value.style.colors.max,l.value.min,l.value.max,s.value)),h=e.computed(()=>t.value.style.dataLabel.autoColor?f.value:t.value.style.dataLabel.color),x=e.computed(()=>t.value.style.track.autoColor?f.value:t.value.style.track.color);return(o,i)=>(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&&r.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(r.value),5)):e.createCommentVNode("",!0),c.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(u.XMLNS),viewBox:`0 0 ${n.value.width} ${n.value.height}`,style:e.normalizeStyle(`overflow: visible; background:${t.value.style.background}; width:100%;`)},[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`gradient_${d.value}`,x1:"-10%",y1:"100%",x2:"110%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.colors.min},null,8,N),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.colors.max},null,8,S)],8,w)]),e.createElementVNode("path",{d:`M10 ${n.value.base} A 1 1 0 1 1 118 ${n.value.base}`,stroke:t.value.style.gutter.color,"stroke-width":8,"stroke-linecap":t.value.style.gutter.strokeLinecap,fill:"none"},null,8,L),y.value!==0?(e.openBlock(),e.createElementBlock("path",{key:0,d:`M10 ${n.value.base} A 1 1 0 1 1 118 ${n.value.base}`,stroke:t.value.style.colors.showGradient?`url(#gradient_${d.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*y.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,B)):e.createCommentVNode("",!0),e.createElementVNode("text",{"text-anchor":"middle",x:n.value.width/2,y:n.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(u.dataLabel)({p:t.value.style.dataLabel.prefix,v:s.value,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.rounding})),9,E)],12,$)):e.createCommentVNode("",!0),c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(C.default,{key:2,config:{type:"gauge",style:{backgroundColor:t.value.style.background,gauge:{color:"#CCCCCC"}}}},null,8,["config"])),t.value.style.title.show&&r.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(r.value),5)):e.createCommentVNode("",!0)],4))}};exports.default=z;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index--K6Ja9Gj.cjs"),p=require("./useNestedProp-Bs4c78Cx.cjs"),C=require("./vue-ui-skeleton-Bf_PLiHN.cjs"),$=["xmlns","viewBox"],w=["id"],N=["stop-color"],S=["stop-color"],L=["d","stroke","stroke-linecap"],B=["d","stroke","stroke-linecap","stroke-dashoffset"],E=["x","y","font-size","fill","font-weight"],z={__name:"vue-ui-sparkgauge",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(g){const a=g,{vue_ui_sparkgauge:k}=u.useConfig(),c=e.computed(()=>!!a.dataset&&Object.keys(a.dataset).length);e.onMounted(()=>{u.objectIsEmpty(a.dataset)?u.error({componentName:"VueUiSparkgauge",type:"dataset"}):u.getMissingDatasetAttributes({datasetObject:a.dataset,requiredAttributes:["value","min","max"]}).forEach(o=>{u.error({componentName:"VueUiSparkgauge",type:"datasetAttribute",property:o})})});const d=e.ref(u.createUid()),t=e.computed(()=>{const o=p.useNestedProp({userConfig:a.config,defaultConfig:k});return o.theme?{...p.useNestedProp({userConfig:u.themes.vue_ui_sparkgauge[o.theme]||a.config,defaultConfig:o})}:o}),n=e.computed(()=>({height:t.value.style.height,width:128,base:t.value.style.basePosition})),l=e.computed(()=>{const o=a.dataset.min??0,i=a.dataset.max??0,_=i-o;return{min:o,max:i,diff:_}}),s=e.ref(t.value.style.animation.show?l.value.min:a.dataset.value);e.watch(()=>a.dataset.value,()=>{s.value=e.ref(t.value.style.animation.show?l.value.min:a.dataset.value),m()});const v=e.computed(()=>s.value>l.value.max?l.value.max:s.value<l.value.min?l.value.min:s.value),b=e.computed(()=>l.value.diff/t.value.style.animation.speedMs);e.onMounted(()=>{m()});function m(){function o(){s.value+=b.value,s.value<a.dataset.value?requestAnimationFrame(o):s.value=a.dataset.value}t.value.style.animation.show&&(s.value=l.value.min,o())}const r=e.computed(()=>a.dataset.title??""),y=e.computed(()=>s.value>=0?(v.value-l.value.min)/l.value.diff:(Math.abs(l.value.min)-Math.abs(v.value))/l.value.diff),f=e.computed(()=>u.interpolateColorHex(t.value.style.colors.min,t.value.style.colors.max,l.value.min,l.value.max,s.value)),h=e.computed(()=>t.value.style.dataLabel.autoColor?f.value:t.value.style.dataLabel.color),x=e.computed(()=>t.value.style.track.autoColor?f.value:t.value.style.track.color);return(o,i)=>(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&&r.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(r.value),5)):e.createCommentVNode("",!0),c.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(u.XMLNS),viewBox:`0 0 ${n.value.width} ${n.value.height}`,style:e.normalizeStyle(`overflow: visible; background:${t.value.style.background}; width:100%;`)},[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`gradient_${d.value}`,x1:"-10%",y1:"100%",x2:"110%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.colors.min},null,8,N),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.colors.max},null,8,S)],8,w)]),e.createElementVNode("path",{d:`M10 ${n.value.base} A 1 1 0 1 1 118 ${n.value.base}`,stroke:t.value.style.gutter.color,"stroke-width":8,"stroke-linecap":t.value.style.gutter.strokeLinecap,fill:"none"},null,8,L),y.value!==0?(e.openBlock(),e.createElementBlock("path",{key:0,d:`M10 ${n.value.base} A 1 1 0 1 1 118 ${n.value.base}`,stroke:t.value.style.colors.showGradient?`url(#gradient_${d.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*y.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,B)):e.createCommentVNode("",!0),e.createElementVNode("text",{"text-anchor":"middle",x:n.value.width/2,y:n.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(u.dataLabel)({p:t.value.style.dataLabel.prefix,v:s.value,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.rounding})),9,E)],12,$)):e.createCommentVNode("",!0),c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(C.default,{key:2,config:{type:"gauge",style:{backgroundColor:t.value.style.background,gauge:{color:"#CCCCCC"}}}},null,8,["config"])),t.value.style.title.show&&r.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(r.value),5)):e.createCommentVNode("",!0)],4))}};exports.default=z;
@@ -1,8 +1,8 @@
1
1
  import { useCssVars as R, computed as _, onMounted as T, ref as N, openBlock as a, createElementBlock as o, normalizeStyle as w, createElementVNode as h, createTextVNode as M, toDisplayString as r, createCommentVNode as p, unref as v, Fragment as g, renderList as f, normalizeClass as A, createBlock as D } from "vue";
2
- import { u as P, o as J, e as F, g as K, c as Q, t as Z, r as m, X as ee, s as z } from "./index-ByO3Ywek.js";
3
- import { u as H } from "./useNestedProp-Da77DnaA.js";
4
- import { _ as te } from "./Shape-Bttb-v8s.js";
5
- import le from "./vue-ui-skeleton-BxRSQeuo.js";
2
+ import { u as P, o as J, e as F, g as K, c as Q, t as Z, r as m, X as ee, s as z } from "./index-8jKJqifI.js";
3
+ import { u as H } from "./useNestedProp-R6UMUTVL.js";
4
+ import { _ as te } from "./Shape-Gv8uj72o.js";
5
+ import le from "./vue-ui-skeleton-CxbgzdoX.js";
6
6
  import { _ as ae } from "./_plugin-vue_export-helper-CHgC5LLL.js";
7
7
  const oe = { key: 0 }, se = { key: 1 }, ie = ["xmlns", "viewBox"], ue = ["id"], ne = ["stop-color"], re = ["stop-color"], ve = ["id"], de = ["stop-color"], ce = ["stop-color"], ye = ["id"], he = ["stop-color"], ge = ["stop-color"], fe = { key: 0 }, pe = ["x", "y", "height", "width", "fill", "stroke", "stroke-width", "rx"], me = { key: 1 }, be = ["x", "y", "font-size", "font-weight", "fill"], _e = ["x", "y", "font-size", "fill"], xe = ["x", "y", "font-size", "fill"], ke = ["height", "width", "x", "onMouseover", "stroke", "stroke-width", "rx", "stroke-dasharray", "onClick"], $e = {
8
8
  __name: "vue-ui-sparkhistogram",
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-BDKEFvEF.cjs"),k=require("./useNestedProp-Dikfncsl.cjs"),z=require("./Shape-BTzik3V0.cjs"),D=require("./vue-ui-skeleton-rY_nZhMQ.cjs"),F=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),M={key:0},A={key:1},H=["xmlns","viewBox"],q=["id"],I=["stop-color"],U=["stop-color"],W=["id"],O=["stop-color"],j=["stop-color"],P=["id"],T=["stop-color"],G=["stop-color"],X={key:0},Y=["x","y","height","width","fill","stroke","stroke-width","rx"],R={key:1},J=["x","y","font-size","font-weight","fill"],K=["x","y","font-size","fill"],Q=["x","y","font-size","fill"],Z=["height","width","x","onMouseover","stroke","stroke-width","rx","stroke-dasharray","onClick"],ee={__name:"vue-ui-sparkhistogram",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(b,{emit:_}){const u=b;e.useCssVars(o=>({"17d37044":S.value}));const{vue_ui_sparkhistogram:x}=n.useConfig(),f=e.computed(()=>!!u.dataset&&u.dataset.length);e.onMounted(()=>{n.objectIsEmpty(u.dataset)?n.error({componentName:"VueUiSparkHistogram",type:"dataset"}):u.dataset.forEach((o,s)=>{n.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["value"]}).forEach(l=>{n.error({componentName:"VueUiSparkHistogram",type:"datasetSerieAttribute",property:l,index:s})})})});const v=e.ref(n.createUid()),t=e.computed(()=>{const o=k.useNestedProp({userConfig:u.config,defaultConfig:x});return o.theme?{...k.useNestedProp({userConfig:n.themes.vue_ui_sparkhistogram[o.theme]||u.config,defaultConfig:o})}:o}),c=e.computed(()=>{const o=t.value.style.layout.height,s=t.value.style.layout.width,l=t.value.style.layout.padding.top,a=o-t.value.style.layout.padding.bottom,d=t.value.style.layout.padding.left,y=s-t.value.style.layout.padding.right,p=l+(o-l-t.value.style.layout.padding.bottom)/2,g=o-t.value.style.layout.padding.top-t.value.style.layout.padding.bottom,m=s-t.value.style.layout.padding.left-t.value.style.layout.padding.right;return{bottom:a,centerY:p,drawingHeight:g,drawingWidth:m,height:o,left:d,right:y,top:l,width:s}}),B=e.computed(()=>Math.max(...u.dataset.map(o=>Math.abs(o.value||0))));function $(o){return Math.abs(o)/B.value}const r=e.computed(()=>u.dataset.map((o,s)=>{const l=$(o.value||0),a=c.value.drawingHeight*l,d=c.value.drawingWidth/u.dataset.length,y=d*(t.value.style.bars.gap/100),p=d-y,g=c.value.centerY-a/2,m=c.value.left+(y/2+s*d),N=c.value.left+s*d,h=typeof o.intensity>"u"?100:Math.round(o.intensity*100),w=o.color?o.color:o.value>=0?`${t.value.style.bars.colors.positive}${n.opacity[h]}`:`${t.value.style.bars.colors.negative}${n.opacity[h]}`,C=o.color?o.color:o.value>=0?t.value.style.bars.colors.positive:t.value.style.bars.colors.negative,L=o.color?`url(#gradient_datapoint_${s}_${v.value})`:o.value>=0?`url(#gradient_positive_${s}_${v.value})`:`url(#gradient_negative_${s}_${v.value})`,V=m+p/2;return{...o,color:w,gradient:L,height:a,intensity:h,proportion:l,stroke:C,textAnchor:V,trapX:N,unitWidth:d,width:p,x:m,y:g}})),i=e.ref(null);function E(o,s){_("selectDatapoint",{datapoint:o,index:s})}const S=e.computed(()=>`${t.value.style.animation.speedMs}ms`);return(o,s)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`width:100%;background:${t.value.style.backgroundColor};font-family:${t.value.style.fontFamily}`),onMouseleave:s[1]||(s[1]=l=>i.value=null)},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:calc(100% - 12px);background:${t.value.style.backgroundColor};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),i.value!==null?(e.openBlock(),e.createElementBlock("span",M,"- "+e.toDisplayString(r.value[i.value].timeLabel||"")+" "+e.toDisplayString(t.value.style.labels.value.prefix)+e.toDisplayString(isNaN(r.value[i.value].value)?"":": "+Number(r.value[i.value].value.toFixed(t.value.style.labels.value.rounding)).toLocaleString())+e.toDisplayString(t.value.style.labels.value.suffix),1)):e.createCommentVNode("",!0),e.createTextVNode(),![void 0,null].includes(i.value)&&![null,void 0].includes(r.value[i.value].valueLabel)?(e.openBlock(),e.createElementBlock("span",A,"("+e.toDisplayString(r.value[i.value].valueLabel||0)+")",1)):e.createCommentVNode("",!0)],4),t.value.style.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`font-size:${t.value.style.title.subtitle.fontSize}px;color:${t.value.style.title.subtitle.color};font-weight:${t.value.style.title.subtitle.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.subtitle.text),5)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(n.XMLNS),viewBox:`0 0 ${c.value.width} ${c.value.height}`,style:{overflow:"visible"}},[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(l,a)=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`gradient_positive_${a}_${v.value}`,cy:"50%",cx:"50%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(n.shiftHue)(t.value.style.bars.colors.positive,.05)}${e.unref(n.opacity)[l.intensity]}`},null,8,I),e.createElementVNode("stop",{offset:"100%","stop-color":`${t.value.style.bars.colors.positive}${e.unref(n.opacity)[l.intensity]}`},null,8,U)],8,q))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(l,a)=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`gradient_negative_${a}_${v.value}`,cy:"50%",cx:"50%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(n.shiftHue)(t.value.style.bars.colors.negative,.05)}${e.unref(n.opacity)[l.intensity]}`},null,8,O),e.createElementVNode("stop",{offset:"100%","stop-color":`${t.value.style.bars.colors.negative}${e.unref(n.opacity)[l.intensity]}`},null,8,j)],8,W))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(l,a)=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`gradient_datapoint_${a}_${v.value}`,cy:"50%",cx:"50%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(n.shiftHue)(l.color,.05)}${e.unref(n.opacity)[l.intensity]}`},null,8,T),e.createElementVNode("stop",{offset:"100%","stop-color":`${l.color}${e.unref(n.opacity)[l.intensity]}`},null,8,G)],8,P))),256))]),!t.value.style.bars.shape||t.value.style.bars.shape==="square"?(e.openBlock(),e.createElementBlock("g",X,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(l,a)=>(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,Y))),256))])):(e.openBlock(),e.createElementBlock("g",R,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(l,a)=>(e.openBlock(),e.createBlock(z._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(r.value,(l,a)=>(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(t.value.style.labels.value.prefix)+e.toDisplayString(isNaN(l.value)?"":Number(l.value.toFixed(t.value.style.labels.value.rounding)).toLocaleString())+e.toDisplayString(t.value.style.labels.value.suffix),9,J))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(l,a)=>(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,K)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(l,a)=>(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,Q)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(l,a)=>(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=>i.value=a,onMouseleave:s[0]||(s[0]=d=>i.value=null),stroke:i.value!==null&&i.value===a?t.value.style.selector.stroke:"","stroke-width":i.value!==null&&i.value===a?t.value.style.selector.strokeWidth:0,rx:t.value.style.selector.borderRadius,"stroke-dasharray":t.value.style.selector.strokeDasharray,onClick:()=>E(l,a)},null,40,Z)]))),256))],8,H)):e.createCommentVNode("",!0),f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(D.default,{key:2,config:{type:"sparkHistogram",style:{backgroundColor:t.value.style.backgroundColor,sparkHistogram:{color:"#CCCCCC"}}}},null,8,["config"]))],36))}},te=F._export_sfc(ee,[["__scopeId","data-v-12e37596"]]);exports.default=te;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index--K6Ja9Gj.cjs"),k=require("./useNestedProp-Bs4c78Cx.cjs"),z=require("./Shape-D_rvgadQ.cjs"),D=require("./vue-ui-skeleton-Bf_PLiHN.cjs"),F=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),M={key:0},A={key:1},H=["xmlns","viewBox"],q=["id"],I=["stop-color"],U=["stop-color"],W=["id"],O=["stop-color"],j=["stop-color"],P=["id"],T=["stop-color"],G=["stop-color"],X={key:0},Y=["x","y","height","width","fill","stroke","stroke-width","rx"],R={key:1},J=["x","y","font-size","font-weight","fill"],K=["x","y","font-size","fill"],Q=["x","y","font-size","fill"],Z=["height","width","x","onMouseover","stroke","stroke-width","rx","stroke-dasharray","onClick"],ee={__name:"vue-ui-sparkhistogram",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(b,{emit:_}){const u=b;e.useCssVars(o=>({"17d37044":S.value}));const{vue_ui_sparkhistogram:x}=n.useConfig(),f=e.computed(()=>!!u.dataset&&u.dataset.length);e.onMounted(()=>{n.objectIsEmpty(u.dataset)?n.error({componentName:"VueUiSparkHistogram",type:"dataset"}):u.dataset.forEach((o,s)=>{n.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["value"]}).forEach(l=>{n.error({componentName:"VueUiSparkHistogram",type:"datasetSerieAttribute",property:l,index:s})})})});const v=e.ref(n.createUid()),t=e.computed(()=>{const o=k.useNestedProp({userConfig:u.config,defaultConfig:x});return o.theme?{...k.useNestedProp({userConfig:n.themes.vue_ui_sparkhistogram[o.theme]||u.config,defaultConfig:o})}:o}),c=e.computed(()=>{const o=t.value.style.layout.height,s=t.value.style.layout.width,l=t.value.style.layout.padding.top,a=o-t.value.style.layout.padding.bottom,d=t.value.style.layout.padding.left,y=s-t.value.style.layout.padding.right,p=l+(o-l-t.value.style.layout.padding.bottom)/2,g=o-t.value.style.layout.padding.top-t.value.style.layout.padding.bottom,m=s-t.value.style.layout.padding.left-t.value.style.layout.padding.right;return{bottom:a,centerY:p,drawingHeight:g,drawingWidth:m,height:o,left:d,right:y,top:l,width:s}}),B=e.computed(()=>Math.max(...u.dataset.map(o=>Math.abs(o.value||0))));function $(o){return Math.abs(o)/B.value}const r=e.computed(()=>u.dataset.map((o,s)=>{const l=$(o.value||0),a=c.value.drawingHeight*l,d=c.value.drawingWidth/u.dataset.length,y=d*(t.value.style.bars.gap/100),p=d-y,g=c.value.centerY-a/2,m=c.value.left+(y/2+s*d),N=c.value.left+s*d,h=typeof o.intensity>"u"?100:Math.round(o.intensity*100),w=o.color?o.color:o.value>=0?`${t.value.style.bars.colors.positive}${n.opacity[h]}`:`${t.value.style.bars.colors.negative}${n.opacity[h]}`,C=o.color?o.color:o.value>=0?t.value.style.bars.colors.positive:t.value.style.bars.colors.negative,L=o.color?`url(#gradient_datapoint_${s}_${v.value})`:o.value>=0?`url(#gradient_positive_${s}_${v.value})`:`url(#gradient_negative_${s}_${v.value})`,V=m+p/2;return{...o,color:w,gradient:L,height:a,intensity:h,proportion:l,stroke:C,textAnchor:V,trapX:N,unitWidth:d,width:p,x:m,y:g}})),i=e.ref(null);function E(o,s){_("selectDatapoint",{datapoint:o,index:s})}const S=e.computed(()=>`${t.value.style.animation.speedMs}ms`);return(o,s)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`width:100%;background:${t.value.style.backgroundColor};font-family:${t.value.style.fontFamily}`),onMouseleave:s[1]||(s[1]=l=>i.value=null)},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:calc(100% - 12px);background:${t.value.style.backgroundColor};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),i.value!==null?(e.openBlock(),e.createElementBlock("span",M,"- "+e.toDisplayString(r.value[i.value].timeLabel||"")+" "+e.toDisplayString(t.value.style.labels.value.prefix)+e.toDisplayString(isNaN(r.value[i.value].value)?"":": "+Number(r.value[i.value].value.toFixed(t.value.style.labels.value.rounding)).toLocaleString())+e.toDisplayString(t.value.style.labels.value.suffix),1)):e.createCommentVNode("",!0),e.createTextVNode(),![void 0,null].includes(i.value)&&![null,void 0].includes(r.value[i.value].valueLabel)?(e.openBlock(),e.createElementBlock("span",A,"("+e.toDisplayString(r.value[i.value].valueLabel||0)+")",1)):e.createCommentVNode("",!0)],4),t.value.style.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`font-size:${t.value.style.title.subtitle.fontSize}px;color:${t.value.style.title.subtitle.color};font-weight:${t.value.style.title.subtitle.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.subtitle.text),5)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(n.XMLNS),viewBox:`0 0 ${c.value.width} ${c.value.height}`,style:{overflow:"visible"}},[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(l,a)=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`gradient_positive_${a}_${v.value}`,cy:"50%",cx:"50%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(n.shiftHue)(t.value.style.bars.colors.positive,.05)}${e.unref(n.opacity)[l.intensity]}`},null,8,I),e.createElementVNode("stop",{offset:"100%","stop-color":`${t.value.style.bars.colors.positive}${e.unref(n.opacity)[l.intensity]}`},null,8,U)],8,q))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(l,a)=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`gradient_negative_${a}_${v.value}`,cy:"50%",cx:"50%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(n.shiftHue)(t.value.style.bars.colors.negative,.05)}${e.unref(n.opacity)[l.intensity]}`},null,8,O),e.createElementVNode("stop",{offset:"100%","stop-color":`${t.value.style.bars.colors.negative}${e.unref(n.opacity)[l.intensity]}`},null,8,j)],8,W))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(l,a)=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`gradient_datapoint_${a}_${v.value}`,cy:"50%",cx:"50%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(n.shiftHue)(l.color,.05)}${e.unref(n.opacity)[l.intensity]}`},null,8,T),e.createElementVNode("stop",{offset:"100%","stop-color":`${l.color}${e.unref(n.opacity)[l.intensity]}`},null,8,G)],8,P))),256))]),!t.value.style.bars.shape||t.value.style.bars.shape==="square"?(e.openBlock(),e.createElementBlock("g",X,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(l,a)=>(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,Y))),256))])):(e.openBlock(),e.createElementBlock("g",R,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(l,a)=>(e.openBlock(),e.createBlock(z._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(r.value,(l,a)=>(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(t.value.style.labels.value.prefix)+e.toDisplayString(isNaN(l.value)?"":Number(l.value.toFixed(t.value.style.labels.value.rounding)).toLocaleString())+e.toDisplayString(t.value.style.labels.value.suffix),9,J))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(l,a)=>(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,K)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(l,a)=>(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,Q)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(l,a)=>(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=>i.value=a,onMouseleave:s[0]||(s[0]=d=>i.value=null),stroke:i.value!==null&&i.value===a?t.value.style.selector.stroke:"","stroke-width":i.value!==null&&i.value===a?t.value.style.selector.strokeWidth:0,rx:t.value.style.selector.borderRadius,"stroke-dasharray":t.value.style.selector.strokeDasharray,onClick:()=>E(l,a)},null,40,Z)]))),256))],8,H)):e.createCommentVNode("",!0),f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(D.default,{key:2,config:{type:"sparkHistogram",style:{backgroundColor:t.value.style.backgroundColor,sparkHistogram:{color:"#CCCCCC"}}}},null,8,["config"]))],36))}},te=F._export_sfc(ee,[["__scopeId","data-v-12e37596"]]);exports.default=te;
@@ -1,7 +1,7 @@
1
1
  import { computed as d, ref as w, onMounted as Q, openBlock as s, createElementBlock as n, normalizeStyle as N, renderSlot as D, normalizeProps as Y, guardReactiveProps as J, createElementVNode as f, toDisplayString as F, createCommentVNode as v, unref as c, Fragment as P, renderList as z, createBlock as K } from "vue";
2
- import { u as ee, c as te, t as ae, o as le, e as G, g as ue, s as I, Q as oe, R as se, X as ne, r as C, L as W, f as B } from "./index-ByO3Ywek.js";
3
- import { u as E } from "./useNestedProp-Da77DnaA.js";
4
- import re from "./vue-ui-skeleton-BxRSQeuo.js";
2
+ import { u as ee, c as te, t as ae, o as le, e as G, g as ue, s as I, Q as oe, R as se, X as ne, r as C, L as W, f as B } from "./index-8jKJqifI.js";
3
+ import { u as E } from "./useNestedProp-R6UMUTVL.js";
4
+ import re from "./vue-ui-skeleton-CxbgzdoX.js";
5
5
  import { _ as ie } from "./_plugin-vue_export-helper-CHgC5LLL.js";
6
6
  const de = ["id"], ve = ["xmlns", "viewBox"], ce = ["id"], ye = ["stop-color"], he = ["stop-color"], fe = ["id"], pe = ["stop-color"], ge = ["stop-color"], ke = ["id"], me = ["stop-color"], xe = ["stop-color"], _e = { key: 0 }, be = ["d", "fill"], we = ["d", "fill"], $e = ["d", "stroke", "stroke-width"], Le = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Ne = ["x", "y", "width", "height", "fill", "rx"], Ie = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], Ce = ["x1", "x2", "y1", "y2", "stroke", "stroke-dasharray", "stroke-width"], Me = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], Se = ["x", "y", "font-size", "font-weight", "fill"], Ve = ["x", "y", "height", "width", "onMouseenter", "onClick"], Pe = {
7
7
  __name: "vue-ui-sparkline",
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-BDKEFvEF.cjs"),B=require("./useNestedProp-Dikfncsl.cjs"),z=require("./vue-ui-skeleton-rY_nZhMQ.cjs"),A=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),D=["id"],F=["xmlns","viewBox"],G=["id"],W=["stop-color"],q=["stop-color"],T=["id"],j=["stop-color"],H=["stop-color"],O=["id"],U=["stop-color"],X=["stop-color"],Z={key:0},R=["d","fill"],Y=["d","fill"],J=["d","stroke","stroke-width"],K=["x1","x2","y1","y2","stroke","stroke-width"],Q=["x","y","width","height","fill","rx"],ee=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],te=["x1","x2","y1","y2","stroke","stroke-dasharray","stroke-width"],le=["cx","cy","r","fill","stroke","stroke-width"],ae=["x","y","font-size","font-weight","fill"],oe=["x","y","height","width","onMouseenter","onClick"],ne={__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(m,{emit:b}){const i=m,{vue_ui_sparkline:$}=n.useConfig(),g=e.computed(()=>!!i.dataset&&i.dataset.length),v=e.ref(n.createUid()),t=e.computed(()=>{const l=B.useNestedProp({userConfig:i.config,defaultConfig:$});return l.theme?{...B.useNestedProp({userConfig:n.themes.vue_ui_sparkline[l.theme]||i.config,defaultConfig:l})}:l}),f=e.ref(i.dataset.map(l=>t.value.style.animation.show?{...l,value:null}:{...l,value:[void 0].includes(l.value)?null:l.value}));e.onMounted(()=>{if(n.objectIsEmpty(i.dataset)?n.error({componentName:"VueUiSparkline",type:"dataset"}):i.dataset.forEach((l,r)=>{n.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["period","value"]}).forEach(a=>{n.error({componentName:"VueUiSparkline",type:"datasetSerieAttribute",property:a,index:r})})}),t.value.style.animation.show&&i.dataset.length>1){let a=function(){r<i.dataset.length?(f.value.push(i.dataset[r]),setTimeout(()=>{requestAnimationFrame(a)},l)):f.value=i.dataset,r+=1};f.value=[];const l=t.value.style.animation.animationFrames/i.dataset.length;let r=0;a()}});const d=e.ref({height:80,width:500}),L=e.ref(6),o=e.computed(()=>({top:12,left:0,right:d.value.width,bottom:d.value.height-3,start:i.showInfo&&t.value.style.dataLabel.show&&t.value.style.dataLabel.position==="left"?d.value.width-t.value.style.chartWidth:30,width:i.showInfo&&t.value.style.dataLabel.show?t.value.style.chartWidth:d.value.width-30,height:d.value.height-12})),_=e.computed(()=>Math.min(...f.value.map(l=>isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0))),V=e.computed(()=>Math.max(...f.value.map(l=>isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0))),p=e.computed(()=>{const l=_.value>=0?0:_.value;return Math.abs(l)}),E=e.computed(()=>V.value+p.value+L.value),x=e.computed(()=>o.value.bottom-o.value.height*w(p.value));function w(l){return l/E.value}const y=e.computed(()=>i.dataset.length-1),u=e.computed(()=>f.value.map((l,r)=>{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+p.value,toMax:w(a+p.value),x:o.value.start+r*(o.value.width/(y.value+1)>30?30:o.value.width/(y.value+1)),y:o.value.bottom-o.value.height*w(a+p.value),id:`plot_${v.value}_${r}`,color:k.value?t.value.style.bar.color:t.value.style.area.useGradient?n.shiftHue(t.value.style.line.color,.05*(1-r/y.value)):t.value.style.line.color,width:o.value.width/(y.value+1)>30?30:o.value.width/(y.value+1)}})),C=e.computed(()=>{const l={x:u.value[0].x,y:d.value.height-6},r={x:u.value[u.value.length-1].x,y:d.value.height-6},a=[];return u.value.forEach(s=>{a.push(`${s.x},${s.y} `)}),[l.x,l.y,...a,r.x,r.y].toString()}),c=e.ref(void 0);function I(l,r){c.value=l,b("hoverIndex",{index:r})}function S(){c.value=void 0,b("hoverIndex",{index:void 0})}const h=e.computed(()=>{if(g.value){const l=u.value.map(a=>a.absoluteValue),r=l.reduce((a,s)=>a+s,0);return{latest:u.value[u.value.length-1].absoluteValue,sum:r,average:r/u.value.length,median:n.calcMedian(l),trend:n.calcLinearProgression(u.value.map(({x:a,y:s,absoluteValue:N})=>({x:a,y:s,value:N}))).trend}}else return{latest:null,sum:null,average:null,median:null,trend:null}}),M=e.computed(()=>g.value?t.value.style.dataLabel.valueType==="latest"?h.value.latest:t.value.style.dataLabel.valueType==="sum"?h.value.sum:t.value.style.dataLabel.valueType==="average"?h.value.average:0:0),k=e.computed(()=>t.value.type&&t.value.type==="bar");function P(l,r){b("selectDatapoint",{datapoint:l,index:r})}return(l,r)=>(e.openBlock(),e.createElementBlock("div",{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:h.value.latest,sum:h.value.sum,average:h.value.average,median:h.value.median,trend:h.value.trend})),void 0,!0),t.value.style.title.show&&m.showInfo?(e.openBlock(),e.createElementBlock("div",{key:0,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(n.XMLNS),viewBox:`0 0 ${d.value.width} ${d.value.height}`,style:e.normalizeStyle(`background:${t.value.style.backgroundColor};overflow:visible`)},[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(n.shiftHue)(t.value.style.area.color,.05)}${e.unref(n.opacity)[t.value.style.area.opacity]}`},null,8,W),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.area.color+e.unref(n.opacity)[t.value.style.area.opacity]},null,8,q)],8,G),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,j),e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(n.shiftHue)(t.value.style.bar.color,.05)}`},null,8,H)],8,T),e.createElementVNode("linearGradient",{x2:"0%",y2:"100%",id:`sparkline_bar_gradient_neg_${v.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(n.shiftHue)(t.value.style.bar.color,.05)}`},null,8,U),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.bar.color},null,8,X)],8,O)]),t.value.style.area.show&&!k.value&&u.value[0]?(e.openBlock(),e.createElementBlock("g",Z,[t.value.style.line.smooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:`M ${u.value[0].x},${o.value.bottom} ${e.unref(n.createSmoothPath)(u.value)} L ${u.value.at(-1).x},${o.value.bottom} Z`,fill:t.value.style.area.useGradient?`url(#sparkline_gradient_${v.value})`:`${t.value.style.area.color}${e.unref(n.opacity)[t.value.style.area.opacity]}`},null,8,R)):(e.openBlock(),e.createElementBlock("path",{key:1,d:`M${C.value}Z`,fill:t.value.style.area.useGradient?`url(#sparkline_gradient_${v.value})`:`${t.value.style.area.color}${e.unref(n.opacity)[t.value.style.area.opacity]}`},null,8,Y))])):e.createCommentVNode("",!0),t.value.style.line.smooth&&!k.value?(e.openBlock(),e.createElementBlock("path",{key:1,d:`M ${e.unref(n.createSmoothPath)(u.value)}`,stroke:t.value.style.line.color,fill:"none","stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":"round"},null,8,J)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(a,s)=>(e.openBlock(),e.createElementBlock("g",null,[s<u.value.length-1&&!t.value.style.line.smooth&&!k.value?(e.openBlock(),e.createElementBlock("line",{key:0,x1:a.x,x2:u.value[s+1].x,y1:a.y,y2:u.value[s+1].y,stroke:a.color,"stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round","shape-rendering":"geometricPrecision"},null,8,K)):e.createCommentVNode("",!0),k.value?(e.openBlock(),e.createElementBlock("rect",{key:1,x:a.x-a.width/2,y:a.absoluteValue>0?a.y:x.value,width:a.width,height:Math.abs(a.y-x.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,Q)):e.createCommentVNode("",!0),t.value.style.verticalIndicator.show&&(c.value&&a.id===c.value.id||m.selectedIndex===s)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:a.x,x2:a.x,y1:o.value.top-6,y2:o.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,ee)):e.createCommentVNode("",!0)]))),256)),_.value<0?(e.openBlock(),e.createElementBlock("line",{key:2,x1:o.value.start,x2:o.value.start+o.value.width-16,y1:x.value,y2:x.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,te)):e.createCommentVNode("",!0),t.value.style.plot.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:3},e.renderList(u.value,(a,s)=>(e.openBlock(),e.createElementBlock("g",null,[c.value&&a.id===c.value.id||m.selectedIndex===s?(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,le)):e.createCommentVNode("",!0)]))),256)):e.createCommentVNode("",!0),m.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:o.value.width+12+t.value.style.dataLabel.offsetX,y:d.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(n.dataLabel)({p:t.value.style.dataLabel.prefix,v:c.value.absoluteValue,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.roundingValue}):e.unref(n.dataLabel)({p:t.value.style.dataLabel.prefix,v:M.value,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.roundingValue})),9,ae)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(a,s)=>(e.openBlock(),e.createElementBlock("rect",{x:a.x-(o.value.width/(y.value+1)>30?30:o.value.width/(y.value+1))/2,y:o.value.top-6,height:o.value.height+6,width:o.value.width/(y.value+1)>30?30:o.value.width/(y.value+1),fill:"transparent",onMouseenter:N=>I(a,s),onMouseleave:S,onClick:()=>P(a,s)},null,40,oe))),256)),e.renderSlot(l.$slots,"svg",{svg:d.value},void 0,!0)],12,F)):e.createCommentVNode("",!0),g.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(z.default,{key:2,config:{type:"sparkline",style:{backgroundColor:t.value.style.backgroundColor,sparkline:{color:"#CCCCCC"}}}},null,8,["config"]))],12,D))}},ue=A._export_sfc(ne,[["__scopeId","data-v-ee68f40e"]]);exports.default=ue;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index--K6Ja9Gj.cjs"),B=require("./useNestedProp-Bs4c78Cx.cjs"),z=require("./vue-ui-skeleton-Bf_PLiHN.cjs"),A=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),D=["id"],F=["xmlns","viewBox"],G=["id"],W=["stop-color"],q=["stop-color"],T=["id"],j=["stop-color"],H=["stop-color"],O=["id"],U=["stop-color"],X=["stop-color"],Z={key:0},R=["d","fill"],Y=["d","fill"],J=["d","stroke","stroke-width"],K=["x1","x2","y1","y2","stroke","stroke-width"],Q=["x","y","width","height","fill","rx"],ee=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],te=["x1","x2","y1","y2","stroke","stroke-dasharray","stroke-width"],le=["cx","cy","r","fill","stroke","stroke-width"],ae=["x","y","font-size","font-weight","fill"],oe=["x","y","height","width","onMouseenter","onClick"],ne={__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(m,{emit:b}){const i=m,{vue_ui_sparkline:$}=n.useConfig(),g=e.computed(()=>!!i.dataset&&i.dataset.length),v=e.ref(n.createUid()),t=e.computed(()=>{const l=B.useNestedProp({userConfig:i.config,defaultConfig:$});return l.theme?{...B.useNestedProp({userConfig:n.themes.vue_ui_sparkline[l.theme]||i.config,defaultConfig:l})}:l}),f=e.ref(i.dataset.map(l=>t.value.style.animation.show?{...l,value:null}:{...l,value:[void 0].includes(l.value)?null:l.value}));e.onMounted(()=>{if(n.objectIsEmpty(i.dataset)?n.error({componentName:"VueUiSparkline",type:"dataset"}):i.dataset.forEach((l,r)=>{n.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["period","value"]}).forEach(a=>{n.error({componentName:"VueUiSparkline",type:"datasetSerieAttribute",property:a,index:r})})}),t.value.style.animation.show&&i.dataset.length>1){let a=function(){r<i.dataset.length?(f.value.push(i.dataset[r]),setTimeout(()=>{requestAnimationFrame(a)},l)):f.value=i.dataset,r+=1};f.value=[];const l=t.value.style.animation.animationFrames/i.dataset.length;let r=0;a()}});const d=e.ref({height:80,width:500}),L=e.ref(6),o=e.computed(()=>({top:12,left:0,right:d.value.width,bottom:d.value.height-3,start:i.showInfo&&t.value.style.dataLabel.show&&t.value.style.dataLabel.position==="left"?d.value.width-t.value.style.chartWidth:30,width:i.showInfo&&t.value.style.dataLabel.show?t.value.style.chartWidth:d.value.width-30,height:d.value.height-12})),_=e.computed(()=>Math.min(...f.value.map(l=>isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0))),V=e.computed(()=>Math.max(...f.value.map(l=>isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0))),p=e.computed(()=>{const l=_.value>=0?0:_.value;return Math.abs(l)}),E=e.computed(()=>V.value+p.value+L.value),x=e.computed(()=>o.value.bottom-o.value.height*w(p.value));function w(l){return l/E.value}const y=e.computed(()=>i.dataset.length-1),u=e.computed(()=>f.value.map((l,r)=>{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+p.value,toMax:w(a+p.value),x:o.value.start+r*(o.value.width/(y.value+1)>30?30:o.value.width/(y.value+1)),y:o.value.bottom-o.value.height*w(a+p.value),id:`plot_${v.value}_${r}`,color:k.value?t.value.style.bar.color:t.value.style.area.useGradient?n.shiftHue(t.value.style.line.color,.05*(1-r/y.value)):t.value.style.line.color,width:o.value.width/(y.value+1)>30?30:o.value.width/(y.value+1)}})),C=e.computed(()=>{const l={x:u.value[0].x,y:d.value.height-6},r={x:u.value[u.value.length-1].x,y:d.value.height-6},a=[];return u.value.forEach(s=>{a.push(`${s.x},${s.y} `)}),[l.x,l.y,...a,r.x,r.y].toString()}),c=e.ref(void 0);function I(l,r){c.value=l,b("hoverIndex",{index:r})}function S(){c.value=void 0,b("hoverIndex",{index:void 0})}const h=e.computed(()=>{if(g.value){const l=u.value.map(a=>a.absoluteValue),r=l.reduce((a,s)=>a+s,0);return{latest:u.value[u.value.length-1].absoluteValue,sum:r,average:r/u.value.length,median:n.calcMedian(l),trend:n.calcLinearProgression(u.value.map(({x:a,y:s,absoluteValue:N})=>({x:a,y:s,value:N}))).trend}}else return{latest:null,sum:null,average:null,median:null,trend:null}}),M=e.computed(()=>g.value?t.value.style.dataLabel.valueType==="latest"?h.value.latest:t.value.style.dataLabel.valueType==="sum"?h.value.sum:t.value.style.dataLabel.valueType==="average"?h.value.average:0:0),k=e.computed(()=>t.value.type&&t.value.type==="bar");function P(l,r){b("selectDatapoint",{datapoint:l,index:r})}return(l,r)=>(e.openBlock(),e.createElementBlock("div",{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:h.value.latest,sum:h.value.sum,average:h.value.average,median:h.value.median,trend:h.value.trend})),void 0,!0),t.value.style.title.show&&m.showInfo?(e.openBlock(),e.createElementBlock("div",{key:0,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(n.XMLNS),viewBox:`0 0 ${d.value.width} ${d.value.height}`,style:e.normalizeStyle(`background:${t.value.style.backgroundColor};overflow:visible`)},[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(n.shiftHue)(t.value.style.area.color,.05)}${e.unref(n.opacity)[t.value.style.area.opacity]}`},null,8,W),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.area.color+e.unref(n.opacity)[t.value.style.area.opacity]},null,8,q)],8,G),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,j),e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(n.shiftHue)(t.value.style.bar.color,.05)}`},null,8,H)],8,T),e.createElementVNode("linearGradient",{x2:"0%",y2:"100%",id:`sparkline_bar_gradient_neg_${v.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(n.shiftHue)(t.value.style.bar.color,.05)}`},null,8,U),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.bar.color},null,8,X)],8,O)]),t.value.style.area.show&&!k.value&&u.value[0]?(e.openBlock(),e.createElementBlock("g",Z,[t.value.style.line.smooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:`M ${u.value[0].x},${o.value.bottom} ${e.unref(n.createSmoothPath)(u.value)} L ${u.value.at(-1).x},${o.value.bottom} Z`,fill:t.value.style.area.useGradient?`url(#sparkline_gradient_${v.value})`:`${t.value.style.area.color}${e.unref(n.opacity)[t.value.style.area.opacity]}`},null,8,R)):(e.openBlock(),e.createElementBlock("path",{key:1,d:`M${C.value}Z`,fill:t.value.style.area.useGradient?`url(#sparkline_gradient_${v.value})`:`${t.value.style.area.color}${e.unref(n.opacity)[t.value.style.area.opacity]}`},null,8,Y))])):e.createCommentVNode("",!0),t.value.style.line.smooth&&!k.value?(e.openBlock(),e.createElementBlock("path",{key:1,d:`M ${e.unref(n.createSmoothPath)(u.value)}`,stroke:t.value.style.line.color,fill:"none","stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":"round"},null,8,J)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(a,s)=>(e.openBlock(),e.createElementBlock("g",null,[s<u.value.length-1&&!t.value.style.line.smooth&&!k.value?(e.openBlock(),e.createElementBlock("line",{key:0,x1:a.x,x2:u.value[s+1].x,y1:a.y,y2:u.value[s+1].y,stroke:a.color,"stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round","shape-rendering":"geometricPrecision"},null,8,K)):e.createCommentVNode("",!0),k.value?(e.openBlock(),e.createElementBlock("rect",{key:1,x:a.x-a.width/2,y:a.absoluteValue>0?a.y:x.value,width:a.width,height:Math.abs(a.y-x.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,Q)):e.createCommentVNode("",!0),t.value.style.verticalIndicator.show&&(c.value&&a.id===c.value.id||m.selectedIndex===s)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:a.x,x2:a.x,y1:o.value.top-6,y2:o.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,ee)):e.createCommentVNode("",!0)]))),256)),_.value<0?(e.openBlock(),e.createElementBlock("line",{key:2,x1:o.value.start,x2:o.value.start+o.value.width-16,y1:x.value,y2:x.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,te)):e.createCommentVNode("",!0),t.value.style.plot.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:3},e.renderList(u.value,(a,s)=>(e.openBlock(),e.createElementBlock("g",null,[c.value&&a.id===c.value.id||m.selectedIndex===s?(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,le)):e.createCommentVNode("",!0)]))),256)):e.createCommentVNode("",!0),m.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:o.value.width+12+t.value.style.dataLabel.offsetX,y:d.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(n.dataLabel)({p:t.value.style.dataLabel.prefix,v:c.value.absoluteValue,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.roundingValue}):e.unref(n.dataLabel)({p:t.value.style.dataLabel.prefix,v:M.value,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.roundingValue})),9,ae)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(a,s)=>(e.openBlock(),e.createElementBlock("rect",{x:a.x-(o.value.width/(y.value+1)>30?30:o.value.width/(y.value+1))/2,y:o.value.top-6,height:o.value.height+6,width:o.value.width/(y.value+1)>30?30:o.value.width/(y.value+1),fill:"transparent",onMouseenter:N=>I(a,s),onMouseleave:S,onClick:()=>P(a,s)},null,40,oe))),256)),e.renderSlot(l.$slots,"svg",{svg:d.value},void 0,!0)],12,F)):e.createCommentVNode("",!0),g.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(z.default,{key:2,config:{type:"sparkline",style:{backgroundColor:t.value.style.backgroundColor,sparkline:{color:"#CCCCCC"}}}},null,8,["config"]))],12,D))}},ue=A._export_sfc(ne,[["__scopeId","data-v-ee68f40e"]]);exports.default=ue;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-BDKEFvEF.cjs"),x=require("./useNestedProp-Dikfncsl.cjs"),E=require("./vue-ui-skeleton-rY_nZhMQ.cjs"),N=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),V=["xmlns","viewBox"],z=["id"],D=["stop-color"],P=["stop-color"],L=["stop-color"],A={id:"stackPill",clipPathUnits:"objectBoundingBox"},F=["fill"],U={"clip-path":"url(#stackPill)"},j=["height","width","fill"],q=["onClick","x","width","height","fill","stroke"],T=["onClick"],H={style:{display:"flex","flex-direction":"row","align-items":"center",gap:"4px","justify-content":"center"}},I=["height","width"],O=["fill"],M={__name:"vue-ui-sparkstackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(B,{emit:w}){const u=B,{vue_ui_sparkstackbar:$}=o.useConfig(),f=e.computed(()=>!!u.dataset&&u.dataset.length),b=e.ref(o.createUid()),t=e.computed(()=>{const l=x.useNestedProp({userConfig:u.config,defaultConfig:$});return l.theme?{...x.useNestedProp({userConfig:o.themes.vue_ui_sparkstackbar[l.theme]||u.config,defaultConfig:l}),customPalette:o.themePalettes[l.theme]||o.palette}:l}),m=e.computed(()=>o.convertCustomPalette(t.value.customPalette)),d=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]}))),p=e.ref(!0);e.onMounted(()=>{if(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})})}),t.value.style.animation.show){let k=function(){r+=a/l,r<a?(d.value=d.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(k)):(p.value=!1,d.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;p.value=!0,k()}});const v=e.ref({width:500,height:16}),c=e.ref([]),g=e.computed(()=>u.dataset.map(l=>l.value||0).filter((l,n)=>!c.value.includes(n)).reduce((l,n)=>l+n,0)),_=e.computed(()=>d.value.map((l,n)=>({...l,value:l.value||0,proportion:(l.value||0)/g.value,width:(l.value||0)/g.value*v.value.width,proportionLabel:o.dataLabel({v:(l.value||0)/g.value*100,s:"%",r:t.value.style.legend.percentage.rounding})}))),y=e.computed(()=>_.value.filter((l,n)=>!c.value.includes(n)));function S(l){c.value.includes(l)?c.value=c.value.filter(n=>n!==l):c.value.length<d.value.length-1&&c.value.push(l)}const h=e.computed(()=>{let l=0;const n=[];for(let a=0;a<y.value.length;a+=1)n.push({...y.value[a],start:l}),l+=y.value[a].width;return n});function C(l,n){w("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:${t.value.style.backgroundColor};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 ${v.value.width} ${v.value.height}`},[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(a,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{key:`stack_gradient_${r}`,gradientTransform:"rotate(90)",id:`stack_gradient_${r}_${b.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":a.color},null,8,D),e.createElementVNode("stop",{offset:"50%","stop-color":`${e.unref(o.shiftHue)(a.color,.05)}${e.unref(o.opacity)[100-t.value.style.bar.gradient.intensity]}`},null,8,P),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,L)],8,z))),128)),e.createElementVNode("clipPath",A,[e.createElementVNode("rect",{x:"0.005",y:"-2",width:"0.99",height:"5",rx:"3",ry:"3",fill:t.value.style.backgroundColor},null,8,F)])]),e.createElementVNode("g",U,[e.createElementVNode("rect",{x:0,y:0,height:v.value.height,width:h.value.map(a=>a.width).reduce((a,r)=>a+r,0),fill:t.value.style.bar.gradient.underlayerColor,class:e.normalizeClass({animated:!p.value})},null,10,j),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_${r}`,onClick:()=>C(a,r),x:a.start,y:0,width:a.width,height:v.value.height,fill:t.value.style.bar.gradient.show?`url(#stack_gradient_${r}_${b.value})`:a.color,stroke:t.value.style.backgroundColor,"stroke-linecap":"round",class:e.normalizeClass({animated:!p.value})},null,10,q))),128))])],8,V)):e.createCommentVNode("",!0),f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(E.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:${t.value.style.backgroundColor};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(_.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:k=>{S(r),C(a,r)}},[e.createElementVNode("div",H,[(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,O)],8,I)),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.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}))+") ",5)):e.createCommentVNode("",!0)])],14,T))),256))],4)):e.createCommentVNode("",!0)],4))}},G=N._export_sfc(M,[["__scopeId","data-v-2006741b"]]);exports.default=G;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index--K6Ja9Gj.cjs"),x=require("./useNestedProp-Bs4c78Cx.cjs"),E=require("./vue-ui-skeleton-Bf_PLiHN.cjs"),N=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),V=["xmlns","viewBox"],z=["id"],D=["stop-color"],P=["stop-color"],L=["stop-color"],A={id:"stackPill",clipPathUnits:"objectBoundingBox"},F=["fill"],U={"clip-path":"url(#stackPill)"},j=["height","width","fill"],q=["onClick","x","width","height","fill","stroke"],T=["onClick"],H={style:{display:"flex","flex-direction":"row","align-items":"center",gap:"4px","justify-content":"center"}},I=["height","width"],O=["fill"],M={__name:"vue-ui-sparkstackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(B,{emit:w}){const u=B,{vue_ui_sparkstackbar:$}=o.useConfig(),f=e.computed(()=>!!u.dataset&&u.dataset.length),b=e.ref(o.createUid()),t=e.computed(()=>{const l=x.useNestedProp({userConfig:u.config,defaultConfig:$});return l.theme?{...x.useNestedProp({userConfig:o.themes.vue_ui_sparkstackbar[l.theme]||u.config,defaultConfig:l}),customPalette:o.themePalettes[l.theme]||o.palette}:l}),m=e.computed(()=>o.convertCustomPalette(t.value.customPalette)),d=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]}))),p=e.ref(!0);e.onMounted(()=>{if(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})})}),t.value.style.animation.show){let k=function(){r+=a/l,r<a?(d.value=d.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(k)):(p.value=!1,d.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;p.value=!0,k()}});const v=e.ref({width:500,height:16}),c=e.ref([]),g=e.computed(()=>u.dataset.map(l=>l.value||0).filter((l,n)=>!c.value.includes(n)).reduce((l,n)=>l+n,0)),_=e.computed(()=>d.value.map((l,n)=>({...l,value:l.value||0,proportion:(l.value||0)/g.value,width:(l.value||0)/g.value*v.value.width,proportionLabel:o.dataLabel({v:(l.value||0)/g.value*100,s:"%",r:t.value.style.legend.percentage.rounding})}))),y=e.computed(()=>_.value.filter((l,n)=>!c.value.includes(n)));function S(l){c.value.includes(l)?c.value=c.value.filter(n=>n!==l):c.value.length<d.value.length-1&&c.value.push(l)}const h=e.computed(()=>{let l=0;const n=[];for(let a=0;a<y.value.length;a+=1)n.push({...y.value[a],start:l}),l+=y.value[a].width;return n});function C(l,n){w("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:${t.value.style.backgroundColor};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 ${v.value.width} ${v.value.height}`},[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(a,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{key:`stack_gradient_${r}`,gradientTransform:"rotate(90)",id:`stack_gradient_${r}_${b.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":a.color},null,8,D),e.createElementVNode("stop",{offset:"50%","stop-color":`${e.unref(o.shiftHue)(a.color,.05)}${e.unref(o.opacity)[100-t.value.style.bar.gradient.intensity]}`},null,8,P),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,L)],8,z))),128)),e.createElementVNode("clipPath",A,[e.createElementVNode("rect",{x:"0.005",y:"-2",width:"0.99",height:"5",rx:"3",ry:"3",fill:t.value.style.backgroundColor},null,8,F)])]),e.createElementVNode("g",U,[e.createElementVNode("rect",{x:0,y:0,height:v.value.height,width:h.value.map(a=>a.width).reduce((a,r)=>a+r,0),fill:t.value.style.bar.gradient.underlayerColor,class:e.normalizeClass({animated:!p.value})},null,10,j),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_${r}`,onClick:()=>C(a,r),x:a.start,y:0,width:a.width,height:v.value.height,fill:t.value.style.bar.gradient.show?`url(#stack_gradient_${r}_${b.value})`:a.color,stroke:t.value.style.backgroundColor,"stroke-linecap":"round",class:e.normalizeClass({animated:!p.value})},null,10,q))),128))])],8,V)):e.createCommentVNode("",!0),f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(E.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:${t.value.style.backgroundColor};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(_.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:k=>{S(r),C(a,r)}},[e.createElementVNode("div",H,[(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,O)],8,I)),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.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}))+") ",5)):e.createCommentVNode("",!0)])],14,T))),256))],4)):e.createCommentVNode("",!0)],4))}},G=N._export_sfc(M,[["__scopeId","data-v-2006741b"]]);exports.default=G;
@@ -1,7 +1,7 @@
1
1
  import { computed as p, ref as m, onMounted as T, openBlock as n, createElementBlock as r, normalizeStyle as g, createElementVNode as u, toDisplayString as k, createCommentVNode as h, unref as _, Fragment as D, renderList as z, normalizeClass as A, createBlock as q } from "vue";
2
- import { u as H, c as j, t as X, a as J, p as d, b as K, d as P, o as Q, e as E, g as R, f as U, X as W, s as Y, r as Z } from "./index-ByO3Ywek.js";
3
- import { u as I } from "./useNestedProp-Da77DnaA.js";
4
- import ee from "./vue-ui-skeleton-BxRSQeuo.js";
2
+ import { u as H, c as j, t as X, a as J, p as d, b as K, d as P, o as Q, e as E, g as R, f as U, X as W, s as Y, r as Z } from "./index-8jKJqifI.js";
3
+ import { u as I } from "./useNestedProp-R6UMUTVL.js";
4
+ import ee from "./vue-ui-skeleton-CxbgzdoX.js";
5
5
  import { _ as te } from "./_plugin-vue_export-helper-CHgC5LLL.js";
6
6
  const le = ["xmlns", "viewBox"], ae = ["id"], oe = ["stop-color"], se = ["stop-color"], ne = ["stop-color"], re = {
7
7
  id: "stackPill",