vue-data-ui 2.6.2 → 2.6.3

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 (156) hide show
  1. package/README.md +4 -4
  2. package/dist/{Arrow-DnYsOsEt.cjs → Arrow-CUx3sy0R.cjs} +1 -1
  3. package/dist/{Arrow-B4TCBt4-.js → Arrow-CaNCmIG1.js} +1 -1
  4. package/dist/{BaseIcon-DTJIrD3k.js → BaseIcon-CFtrFJk8.js} +1 -1
  5. package/dist/{BaseIcon-Dn1igOva.cjs → BaseIcon-DEUnx0Km.cjs} +1 -1
  6. package/dist/{DataTable-BWABkdIL.js → DataTable-g-vVSX5e.js} +2 -2
  7. package/dist/{DataTable-Cybmjq2W.cjs → DataTable-o267EcsS.cjs} +1 -1
  8. package/dist/{Legend-Bf8J9KZk.cjs → Legend-14o6ysPB.cjs} +1 -1
  9. package/dist/{Legend-du4CJMG1.js → Legend-D3s69_UE.js} +2 -2
  10. package/dist/{PackageVersion-Bmro6-lR.cjs → PackageVersion-GUCKUltM.cjs} +1 -1
  11. package/dist/{PackageVersion-Dqo8V-i_.js → PackageVersion-koLOUagZ.js} +1 -1
  12. package/dist/{PenAndPaper-B7dv_ssy.cjs → PenAndPaper-BFxCZMe_.cjs} +1 -1
  13. package/dist/{PenAndPaper-QsaleY3R.js → PenAndPaper-NARoVmb-.js} +3 -3
  14. package/dist/{Shape-D_MGNYEa.js → Shape-BQwPhaQ2.js} +1 -1
  15. package/dist/{Shape-QydDpcqr.cjs → Shape-DQcajuPX.cjs} +1 -1
  16. package/dist/{Slicer-DKXIt2om.js → Slicer-BHKjr5Ta.js} +2 -2
  17. package/dist/{Slicer-Vzo3baUi.cjs → Slicer-D2-FPJ8d.cjs} +1 -1
  18. package/dist/{Title-MKfkLka7.js → Title-BrlBOQMX.js} +1 -1
  19. package/dist/{Title-x7Hmi2zb.cjs → Title-IEvHjzFX.cjs} +1 -1
  20. package/dist/{Tooltip-BUMgVEu0.js → Tooltip-2BVEpShN.js} +1 -1
  21. package/dist/{Tooltip-pA64woiQ.cjs → Tooltip-Ce3-d-Jl.cjs} +1 -1
  22. package/dist/documentation/installation.md +4 -4
  23. package/dist/{index-B8uVRkA1.js → index-Sq6_Z5Ol.js} +1 -1
  24. package/dist/{index-Bmq5HB9y.cjs → index-TsXfF4RW.cjs} +1 -1
  25. package/dist/style.css +1 -1
  26. package/dist/{useNestedProp-CivZENAh.cjs → useNestedProp-AmCRQ0Mq.cjs} +1 -1
  27. package/dist/{useNestedProp-kStEZqtl.js → useNestedProp-BmjPdxME.js} +1 -1
  28. package/dist/{usePrinter-Cf6Zct5m.cjs → usePrinter-DqLdu0d8.cjs} +1 -1
  29. package/dist/{usePrinter-CppD6oY_.js → usePrinter-KhQnrZzM.js} +1 -1
  30. package/dist/{vue-data-ui-ZZGY9nKv.js → vue-data-ui-BDtCPTUD.js} +61 -61
  31. package/dist/{vue-data-ui-HGY4nSGa.cjs → vue-data-ui-W8pd2Z-N.cjs} +1 -1
  32. package/dist/vue-data-ui.cjs +1 -1
  33. package/dist/vue-data-ui.js +1 -1
  34. package/dist/{vue-ui-3d-bar-DbhESYsC.js → vue-ui-3d-bar-BSNWr70h.js} +9 -9
  35. package/dist/{vue-ui-3d-bar-BMZJgQzl.cjs → vue-ui-3d-bar-CQarDWrH.cjs} +1 -1
  36. package/dist/{vue-ui-accordion-CE2Pnpz3.js → vue-ui-accordion-Cs3dJ86t.js} +3 -3
  37. package/dist/{vue-ui-accordion-WWblnzaJ.cjs → vue-ui-accordion-DQr01ula.cjs} +1 -1
  38. package/dist/{vue-ui-age-pyramid-DzPdTFTe.cjs → vue-ui-age-pyramid-CXRisfK0.cjs} +1 -1
  39. package/dist/{vue-ui-age-pyramid-CxW84Zy4.js → vue-ui-age-pyramid-nfG0pqCk.js} +10 -10
  40. package/dist/{vue-ui-annotator-D5PCmH8u.cjs → vue-ui-annotator-D4f8pjvy.cjs} +1 -1
  41. package/dist/{vue-ui-annotator-DuS_kY-C.js → vue-ui-annotator-qbVoTl_7.js} +1 -1
  42. package/dist/{vue-ui-bullet-CvB9cU_g.js → vue-ui-bullet-C7O_SGrf.js} +8 -8
  43. package/dist/{vue-ui-bullet-DND6LL0P.cjs → vue-ui-bullet-tNkxVPL6.cjs} +1 -1
  44. package/dist/{vue-ui-candlestick-C76ZVkkY.js → vue-ui-candlestick-C5w6Q5tA.js} +11 -11
  45. package/dist/{vue-ui-candlestick-Bq4VyBVk.cjs → vue-ui-candlestick-CHWTbUPr.cjs} +1 -1
  46. package/dist/{vue-ui-carousel-table-CdwSAavZ.cjs → vue-ui-carousel-table-BnyQxoK_.cjs} +1 -1
  47. package/dist/{vue-ui-carousel-table-DPlos7Us.js → vue-ui-carousel-table-DhlknuHM.js} +4 -4
  48. package/dist/{vue-ui-chestnut-CB4BA3mx.js → vue-ui-chestnut-CxDFoe_1.js} +8 -8
  49. package/dist/{vue-ui-chestnut-CH1rO8yv.cjs → vue-ui-chestnut-DXSCCzCc.cjs} +1 -1
  50. package/dist/{vue-ui-circle-pack-DslAztEw.js → vue-ui-circle-pack-8GcO3_Mk.js} +9 -9
  51. package/dist/{vue-ui-circle-pack-T0baWnD4.cjs → vue-ui-circle-pack-DCVBrNSm.cjs} +1 -1
  52. package/dist/{vue-ui-cursor-CNrbLYcU.js → vue-ui-cursor-DqTG5Bkn.js} +2 -2
  53. package/dist/{vue-ui-cursor-tyy0Lbsc.cjs → vue-ui-cursor-ZG_l61-u.cjs} +1 -1
  54. package/dist/{vue-ui-dashboard-BIQYUy0X.js → vue-ui-dashboard-BUA1xet-.js} +2 -2
  55. package/dist/{vue-ui-dashboard-2EJIfom5.cjs → vue-ui-dashboard-CM_JWUb1.cjs} +1 -1
  56. package/dist/{vue-ui-digits-9j9HvJAE.cjs → vue-ui-digits-BTw7SVPJ.cjs} +1 -1
  57. package/dist/{vue-ui-digits-B9zkzbxp.js → vue-ui-digits-NaC5TAtZ.js} +2 -2
  58. package/dist/{vue-ui-donut-CTTVwsjp.js → vue-ui-donut-BNUwbtTK.js} +12 -12
  59. package/dist/{vue-ui-donut-MNv-tPgT.cjs → vue-ui-donut-CxRlW3Wf.cjs} +1 -1
  60. package/dist/{vue-ui-donut-evolution-QrqawlMF.js → vue-ui-donut-evolution-CAmcyYYg.js} +11 -11
  61. package/dist/{vue-ui-donut-evolution-ByfZmrmA.cjs → vue-ui-donut-evolution-MrRKOI1i.cjs} +1 -1
  62. package/dist/{vue-ui-dumbbell-DbJC4PQf.js → vue-ui-dumbbell-B-HdfY_j.js} +10 -10
  63. package/dist/{vue-ui-dumbbell-DdFhLM7x.cjs → vue-ui-dumbbell-C6Lgic0q.cjs} +1 -1
  64. package/dist/{vue-ui-flow-oXRtEqoD.js → vue-ui-flow-BrQovUAh.js} +9 -9
  65. package/dist/{vue-ui-flow-D3fu0o6H.cjs → vue-ui-flow-VBP_6WA8.cjs} +1 -1
  66. package/dist/{vue-ui-funnel-wG5mmmoA.js → vue-ui-funnel-B8-Uj9S3.js} +9 -9
  67. package/dist/{vue-ui-funnel-Btk9EM8C.cjs → vue-ui-funnel-BIupy22h.cjs} +1 -1
  68. package/dist/{vue-ui-galaxy-D0chyXGV.cjs → vue-ui-galaxy-BbysRccu.cjs} +1 -1
  69. package/dist/{vue-ui-galaxy-DKsUFAVZ.js → vue-ui-galaxy-hElQRBl6.js} +11 -11
  70. package/dist/{vue-ui-gauge-CVS_Ragk.js → vue-ui-gauge-BxavhokI.js} +7 -7
  71. package/dist/{vue-ui-gauge-BgRQ_PbK.cjs → vue-ui-gauge-CgUeFE-O.cjs} +1 -1
  72. package/dist/{vue-ui-gizmo-D4BHhwJ8.js → vue-ui-gizmo-Ci0pE9Nw.js} +3 -3
  73. package/dist/{vue-ui-gizmo-Dhu6rJ9P.cjs → vue-ui-gizmo-DSLh6fXp.cjs} +1 -1
  74. package/dist/{vue-ui-heatmap-BGioOZJj.js → vue-ui-heatmap-BN1FdDqM.js} +10 -10
  75. package/dist/{vue-ui-heatmap-EGSWPEkM.cjs → vue-ui-heatmap-D5QJROY5.cjs} +1 -1
  76. package/dist/{vue-ui-history-plot-B18G7ARJ.js → vue-ui-history-plot-D8Y08JYH.js} +11 -11
  77. package/dist/{vue-ui-history-plot-Be4mtSAH.cjs → vue-ui-history-plot-DqnirTGv.cjs} +1 -1
  78. package/dist/{vue-ui-kpi-B7rHhQ3H.cjs → vue-ui-kpi-DbKHOVxZ.cjs} +1 -1
  79. package/dist/{vue-ui-kpi-BK1Vq6tA.js → vue-ui-kpi-DbbXD09A.js} +3 -3
  80. package/dist/{vue-ui-mini-loader-lAOgjMme.js → vue-ui-mini-loader-BbQzMsAO.js} +2 -2
  81. package/dist/{vue-ui-mini-loader-DrWDl3Hc.cjs → vue-ui-mini-loader-FNEOkheZ.cjs} +1 -1
  82. package/dist/{vue-ui-molecule-TSwsc6wZ.cjs → vue-ui-molecule-CCPkPyjT.cjs} +1 -1
  83. package/dist/{vue-ui-molecule-DEKmU-Mx.js → vue-ui-molecule-DmZCUvJq.js} +11 -11
  84. package/dist/{vue-ui-mood-radar-vLXtDHcR.cjs → vue-ui-mood-radar-Bqv_OukZ.cjs} +1 -1
  85. package/dist/{vue-ui-mood-radar-6XZfljIe.js → vue-ui-mood-radar-CReqB6g6.js} +11 -11
  86. package/dist/{vue-ui-nested-donuts-Cl8xdJU6.js → vue-ui-nested-donuts-BwCtd7TA.js} +11 -11
  87. package/dist/{vue-ui-nested-donuts--A1qjixG.cjs → vue-ui-nested-donuts-D93rQwDR.cjs} +1 -1
  88. package/dist/{vue-ui-onion-CPlqANiN.js → vue-ui-onion-BMUjoxS_.js} +11 -11
  89. package/dist/{vue-ui-onion-C32u8Ezk.cjs → vue-ui-onion-Bts6tMCc.cjs} +1 -1
  90. package/dist/{vue-ui-parallel-coordinate-plot-95RlJka2.js → vue-ui-parallel-coordinate-plot-Ce2wd0f5.js} +12 -12
  91. package/dist/{vue-ui-parallel-coordinate-plot-BY0t_Hc_.cjs → vue-ui-parallel-coordinate-plot-CgujndZr.cjs} +1 -1
  92. package/dist/{vue-ui-quadrant-C_BIZcc8.js → vue-ui-quadrant-C-jarCHF.js} +12 -12
  93. package/dist/{vue-ui-quadrant-CWwHr8BX.cjs → vue-ui-quadrant-CGSLYSYL.cjs} +1 -1
  94. package/dist/{vue-ui-quick-chart-CZYAIILY.cjs → vue-ui-quick-chart-B0SVk7ry.cjs} +1 -1
  95. package/dist/{vue-ui-quick-chart-BZ5n0UQy.js → vue-ui-quick-chart-BJz8KURA.js} +9 -9
  96. package/dist/{vue-ui-radar-Ddu3Dzxx.js → vue-ui-radar-BNi9EFmX.js} +12 -12
  97. package/dist/{vue-ui-radar-D4XBfJym.cjs → vue-ui-radar-Bn_j-SA4.cjs} +1 -1
  98. package/dist/vue-ui-rating-H6zv15BL.cjs +1 -0
  99. package/dist/vue-ui-rating-ykC0fTg_.js +350 -0
  100. package/dist/{vue-ui-relation-circle-8Kw5PdZD.cjs → vue-ui-relation-circle-CcYVlwwi.cjs} +1 -1
  101. package/dist/{vue-ui-relation-circle-B_xPyr_-.js → vue-ui-relation-circle-DeILJwJP.js} +7 -7
  102. package/dist/{vue-ui-rings-pjfgnXyP.js → vue-ui-rings-CM4Yh4K7.js} +12 -12
  103. package/dist/{vue-ui-rings-CuLwbEa2.cjs → vue-ui-rings-DfFzFEA6.cjs} +1 -1
  104. package/dist/{vue-ui-scatter-x6zrT3IA.js → vue-ui-scatter-9l9U12tf.js} +12 -12
  105. package/dist/{vue-ui-scatter-YQ4zYJj0.cjs → vue-ui-scatter-CZBufI8b.cjs} +1 -1
  106. package/dist/{vue-ui-screenshot-D3k8rLXz.cjs → vue-ui-screenshot-BHMuQw8r.cjs} +1 -1
  107. package/dist/{vue-ui-screenshot-DeKe5Csw.js → vue-ui-screenshot-lygBinT2.js} +1 -1
  108. package/dist/{vue-ui-skeleton-D5890icn.cjs → vue-ui-skeleton-D3N7upHq.cjs} +1 -1
  109. package/dist/{vue-ui-skeleton-BC7kQhlE.js → vue-ui-skeleton-DhEZVP4j.js} +3 -3
  110. package/dist/{vue-ui-smiley-5evB5mWX.js → vue-ui-smiley-QyjA0TcO.js} +69 -68
  111. package/dist/{vue-ui-smiley-CNlhfa-H.cjs → vue-ui-smiley-ctSWt0nv.cjs} +2 -2
  112. package/dist/{vue-ui-spark-trend-CuqG_rtb.cjs → vue-ui-spark-trend-C9mK9gsJ.cjs} +1 -1
  113. package/dist/{vue-ui-spark-trend-BgZ0JbXH.js → vue-ui-spark-trend-CQu8fJyp.js} +5 -5
  114. package/dist/{vue-ui-sparkbar-DkAi7xTy.js → vue-ui-sparkbar-1nTJch0Z.js} +4 -4
  115. package/dist/{vue-ui-sparkbar-DrG8Dq7-.cjs → vue-ui-sparkbar-BlXSG_u8.cjs} +1 -1
  116. package/dist/{vue-ui-sparkgauge-C8JczQHv.cjs → vue-ui-sparkgauge-Cu5HQYtA.cjs} +1 -1
  117. package/dist/{vue-ui-sparkgauge-BPhv4OLb.js → vue-ui-sparkgauge-Df4RaQL4.js} +4 -4
  118. package/dist/{vue-ui-sparkhistogram-e9JHVPef.cjs → vue-ui-sparkhistogram-CbGVLioY.cjs} +1 -1
  119. package/dist/{vue-ui-sparkhistogram-CvhqCMzj.js → vue-ui-sparkhistogram-D2RUQcAo.js} +5 -5
  120. package/dist/{vue-ui-sparkline-DAaH0160.cjs → vue-ui-sparkline-CYIZ1DFh.cjs} +1 -1
  121. package/dist/{vue-ui-sparkline-TSwCmhPw.js → vue-ui-sparkline-ZWCxuBSn.js} +4 -4
  122. package/dist/{vue-ui-sparkstackbar-r_awjtOp.cjs → vue-ui-sparkstackbar-CkiTTddK.cjs} +1 -1
  123. package/dist/{vue-ui-sparkstackbar-BoS2_lla.js → vue-ui-sparkstackbar-DZWMi8IY.js} +5 -5
  124. package/dist/{vue-ui-stackbar-BEN8-V44.js → vue-ui-stackbar-CohW8Lni.js} +13 -13
  125. package/dist/{vue-ui-stackbar-COZlH_nE.cjs → vue-ui-stackbar-DxA3vG2f.cjs} +1 -1
  126. package/dist/{vue-ui-strip-plot-zTtIMHMC.cjs → vue-ui-strip-plot-CUJtddMq.cjs} +1 -1
  127. package/dist/{vue-ui-strip-plot-Cbd43lkd.js → vue-ui-strip-plot-CfKGbLE-.js} +11 -11
  128. package/dist/{vue-ui-table-Cdn-p4Sv.js → vue-ui-table-CyewBxeG.js} +1 -1
  129. package/dist/{vue-ui-table-D3n9zK4_.cjs → vue-ui-table-Di_YIf-o.cjs} +1 -1
  130. package/dist/{vue-ui-table-heatmap-1gluLlyr.cjs → vue-ui-table-heatmap-CgFby9Fm.cjs} +1 -1
  131. package/dist/{vue-ui-table-heatmap-DUoSqJAq.js → vue-ui-table-heatmap-U735dVB7.js} +4 -4
  132. package/dist/{vue-ui-table-sparkline-B6WbUZ-8.js → vue-ui-table-sparkline-CI6fVXqD.js} +5 -5
  133. package/dist/{vue-ui-table-sparkline-axmTWfsW.cjs → vue-ui-table-sparkline-DMo-8Xvd.cjs} +1 -1
  134. package/dist/{vue-ui-thermometer-DO8jsmEA.cjs → vue-ui-thermometer-3x4w5Bzf.cjs} +1 -1
  135. package/dist/{vue-ui-thermometer-CYPaaRUL.js → vue-ui-thermometer-vg0OAZ-r.js} +7 -7
  136. package/dist/{vue-ui-timer-BxB-pqMO.cjs → vue-ui-timer-DH2x_4wH.cjs} +1 -1
  137. package/dist/{vue-ui-timer-DVDPJaIq.js → vue-ui-timer-u18zWozG.js} +5 -5
  138. package/dist/{vue-ui-tiremarks-CHJQsXBn.cjs → vue-ui-tiremarks-CxKWI2fp.cjs} +1 -1
  139. package/dist/{vue-ui-tiremarks-LeiTjrNE.js → vue-ui-tiremarks-DktQB0KM.js} +7 -7
  140. package/dist/{vue-ui-treemap-D1qUMxJQ.js → vue-ui-treemap-CVOhnvNh.js} +11 -11
  141. package/dist/{vue-ui-treemap-5vtoQA3B.cjs → vue-ui-treemap-DlsJqd0C.cjs} +1 -1
  142. package/dist/{vue-ui-vertical-bar-BvooiWAc.cjs → vue-ui-vertical-bar-BwOZxjR-.cjs} +1 -1
  143. package/dist/{vue-ui-vertical-bar-BjqeLwN6.js → vue-ui-vertical-bar-CdoSGi-B.js} +12 -12
  144. package/dist/{vue-ui-waffle-DphHhyQF.js → vue-ui-waffle-CajquWJE.js} +12 -12
  145. package/dist/{vue-ui-waffle-I9RUtRMp.cjs → vue-ui-waffle-D4yjRBba.cjs} +1 -1
  146. package/dist/{vue-ui-wheel-BloNNVqT.js → vue-ui-wheel-BlMIG6cZ.js} +7 -7
  147. package/dist/{vue-ui-wheel-KJdapRnF.cjs → vue-ui-wheel-fTjcexDm.cjs} +1 -1
  148. package/dist/{vue-ui-word-cloud-BLpGQgdL.cjs → vue-ui-word-cloud-BqqXPBt-.cjs} +1 -1
  149. package/dist/{vue-ui-word-cloud-wxMpsmI9.js → vue-ui-word-cloud-DL7Qnl9r.js} +10 -10
  150. package/dist/{vue-ui-xy-Zy60Z2c1.js → vue-ui-xy-BA50z2Qp.js} +14 -14
  151. package/dist/{vue-ui-xy-BEgKs6jA.cjs → vue-ui-xy-BrL3AnU6.cjs} +1 -1
  152. package/dist/{vue-ui-xy-canvas-zINzDQlN.js → vue-ui-xy-canvas-BL2xqLMH.js} +11 -11
  153. package/dist/{vue-ui-xy-canvas-rKk7-Q2Q.cjs → vue-ui-xy-canvas-kRxLPOUB.cjs} +1 -1
  154. package/package.json +1 -1
  155. package/dist/vue-ui-rating-C7MH_wxf.js +0 -327
  156. package/dist/vue-ui-rating-WjFEnnp5.cjs +0 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-Bmq5HB9y.cjs"),V=require("./useNestedProp-CivZENAh.cjs"),O=require("./vue-ui-skeleton-D5890icn.cjs"),U=require("./PackageVersion-Bmro6-lR.cjs"),M=require("./Tooltip-pA64woiQ.cjs"),j=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),H=["xmlns","viewBox"],I=["id"],R=["stop-color"],W=["stop-color"],Y=["stop-color"],G={id:"stackPill",clipPathUnits:"objectBoundingBox"},X=["fill"],J={key:0,"clip-path":"url(#stackPill)"},K=["x","width","height","fill"],Q=["x","width","height","fill","stroke"],Z=["onClick","x","width","height","onMouseenter"],ee=["width","height","rx"],te=["onClick"],le={style:{display:"flex","flex-direction":"row","align-items":"center",gap:"4px","justify-content":"center"}},oe=["height","width"],ae=["fill"],re={key:4,ref:"source",dir:"auto"},ne={__name:"vue-ui-sparkstackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(P,{emit:D}){const{vue_ui_sparkstackbar:L}=a.useConfig(),u=P,F=e.useSlots();e.onMounted(()=>{F["chart-background"]&&console.warn("VueUiSparkStackbar does not support the #chart-background slot.")});const x=e.computed(()=>!!u.dataset&&u.dataset.length),B=e.ref(null),S=e.ref(a.createUid()),b=e.ref(!1),_=e.ref(""),t=e.computed({get:()=>$(),set:l=>l});function $(){const l=V.useNestedProp({userConfig:u.config,defaultConfig:L});return l.theme?{...V.useNestedProp({userConfig:a.themes.vue_ui_sparkstackbar[l.theme]||u.config,defaultConfig:l}),customPalette:a.themePalettes[l.theme]||a.palette}:l}e.watch(()=>u.config,l=>{t.value=$(),E()},{deep:!0}),e.watch(()=>u.dataset,l=>{v.value=u.dataset.map((n,o)=>({...n,color:n.color?a.convertColorToHex(n.color):f.value[o]||a.palette[o]||a.palette[o%a.palette.length]}))},{deep:!0});const f=e.computed(()=>a.convertCustomPalette(t.value.customPalette)),v=e.ref(u.dataset.map((l,n)=>({...l,value:t.value.style.animation.show?0:l.value||0,color:l.color?a.convertColorToHex(l.color):f.value[n]||a.palette[n]||a.palette[n%a.palette.length]}))),g=e.ref(!0);e.onMounted(()=>{if(E(),t.value.style.animation.show){let p=function(){r+=o/l,r<o?(v.value=v.value.map((s,i)=>({...s,value:s.value+=n[i],color:s.color?a.convertColorToHex(s.color):f.value[i]||a.palette[i]||a.palette[i%a.palette.length]})),requestAnimationFrame(p)):(g.value=!1,v.value=u.dataset.map((s,i)=>({...s,value:s.value||0,color:s.color?a.convertColorToHex(s.color):f.value[i]||a.palette[i]||a.palette[i%a.palette.length],id:a.createUid()})))};const l=t.value.style.animation.animationFrames,n=u.dataset.map((s,i)=>s.value/l),o=u.dataset.map(s=>s.value||0).reduce((s,i)=>s+i,0);let r=0;g.value=!0,p()}});function E(){a.objectIsEmpty(u.dataset)?a.error({componentName:"VueUiSparkStackbar",type:"dataset"}):u.dataset.forEach((l,n)=>{a.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","value"]}).forEach(o=>{a.error({componentName:"VueUiSparkStackbar",type:"datasetSerieAttribute",property:o,index:n})})})}const c=e.ref({width:500,height:16}),d=e.ref([]),N=e.computed(()=>u.dataset.map(l=>l.value||0).filter((l,n)=>!d.value.includes(n)).reduce((l,n)=>l+n,0)),y=e.computed(()=>v.value.map((l,n)=>{const o=l.value||0,r=o/N.value,p=isNaN(r)?0:r,s=p*c.value.width;return{...l,value:o,proportion:p,width:s,proportionLabel:a.dataLabel({v:p*100,s:"%",r:t.value.style.legend.percentage.rounding})}})),C=e.computed(()=>y.value.filter((l,n)=>!d.value.includes(n)));function T(l){d.value.includes(l)?d.value=d.value.filter(n=>n!==l):d.value.length<v.value.length-1&&d.value.push(l)}const h=e.computed(()=>{let l=0;const n=[];for(let o=0;o<C.value.length;o+=1)n.push({...C.value[o],start:l}),l+=C.value[o].width;return n}),A=D;function z(l,n){A("selectDatapoint",{datapoint:l,index:n})}const w=e.ref(null),k=e.ref(!1),m=e.ref(null);function q({datapoint:l,seriesIndex:n}){if(!t.value.style.tooltip.show)return;w.value={datapoint:l,seriesIndex:n,config:t.value,series:y.value},b.value=!0,m.value=n;const o=t.value.style.tooltip.customFormat;if(a.isFunction(o))try{const r=o({seriesIndex:n,datapoint:l,series:y.value,config:t.value});typeof r=="string"&&(_.value=r,k.value=!0)}catch{console.warn("Custom format cannot be applied."),k.value=!1}if(!k.value){let r="";r+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${l.name}</div>`,r+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${l.color}"/></svg>`,r+=`<b>${l.proportionLabel}</b>`,r+=`<span>(${a.applyDataLabel(t.value.style.legend.value.formatter,l.value,a.dataLabel({p:t.value.style.legend.value.prefix,v:l.value,s:t.value.style.legend.value.suffix,r:t.value.style.legend.value.rounding}),{datapoint:l,seriesIndex:n})})</span>`,_.value=`<div>${r}</div>`}}return(l,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"sparkstackbarChart",ref:B,style:e.normalizeStyle(`width:100%; background:${t.value.style.backgroundColor}`)},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:calc(100% - 12px);background:transparent;margin:0 auto;margin:${t.value.style.title.margin};padding: 0 6px;text-align:${t.value.style.title.textAlign}`)},[e.createElementVNode("div",{style:e.normalizeStyle(`font-size:${t.value.style.title.fontSize}px;color:${t.value.style.title.color};font-weight:${t.value.style.title.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.text),5),t.value.style.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`font-size:${t.value.style.title.subtitle.fontSize}px;color:${t.value.style.title.subtitle.color};font-weight:${t.value.style.title.subtitle.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.subtitle.text),5)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),x.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(a.XMLNS),width:"100%",viewBox:`0 0 ${c.value.width} ${c.value.height}`},[e.createVNode(U._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{key:`stack_gradient_${r}`,gradientTransform:"rotate(90)",id:`stack_gradient_${r}_${S.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":o.color},null,8,R),e.createElementVNode("stop",{offset:"50%","stop-color":e.unref(a.setOpacity)(e.unref(a.shiftHue)(o.color,.05),100-t.value.style.bar.gradient.intensity)},null,8,W),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,Y)],8,I))),128)),e.createElementVNode("clipPath",G,[e.createElementVNode("rect",{x:"0.005",y:"-2",width:"0.99",height:"5",rx:"3",ry:"3",fill:t.value.style.backgroundColor},null,8,X)])]),N.value>0?(e.openBlock(),e.createElementBlock("g",J,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_underlayer_${r}`,x:o.start,y:0,width:o.width,height:c.value.height,fill:t.value.style.bar.gradient.underlayerColor,class:e.normalizeClass({animated:!g.value}),style:e.normalizeStyle({opacity:m.value!==null&&t.value.style.tooltip.show?m.value===r?1:.5:1})},null,14,K))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_${r}`,x:o.start,y:0,width:o.width,height:c.value.height,fill:t.value.style.bar.gradient.show?`url(#stack_gradient_${r}_${S.value})`:o.color,stroke:t.value.style.backgroundColor,"stroke-linecap":"round",class:e.normalizeClass({animated:!g.value}),style:e.normalizeStyle({opacity:m.value!==null&&t.value.style.tooltip.show?m.value===r?1:.5:1})},null,14,Q))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_trap_${r}`,onClick:()=>z(o,r),x:o.start,y:0,width:o.width,height:c.value.height,fill:"transparent",stroke:"none",class:e.normalizeClass({animated:!g.value}),onMouseenter:()=>q({datapoint:o,seriesIndex:r}),onMouseleave:n[0]||(n[0]=p=>{b.value=!1,m.value=null})},null,42,Z))),128))])):(e.openBlock(),e.createElementBlock("rect",{key:1,x:2,y:1,width:c.value.width-4,height:c.value.height-2,stroke:"#CCCCCC","stroke-width":"2",fill:"transparent",rx:(c.value.height-4)/2},null,8,ee))],8,H)):e.createCommentVNode("",!0),x.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(O.default,{key:2,config:{type:"sparkStackbar",style:{backgroundColor:t.value.style.backgroundColor,sparkStackbar:{color:"#CCCCCC"}}}},null,8,["config"])),t.value.style.legend.show?(e.openBlock(),e.createElementBlock("div",{key:3,style:e.normalizeStyle(`background:transparent;margin:0 auto;margin:${t.value.style.legend.margin};justify-content:${t.value.style.legend.textAlign==="left"?"flex-start":t.value.style.legend.textAlign==="right"?"flex-end":"center"}`),class:"vue-ui-sparkstackbar-legend"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(o,r)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`font-size:${t.value.style.legend.fontSize}px;`),class:e.normalizeClass({"vue-ui-sparkstackbar-legend-item":!0,"vue-ui-sparkstackbar-legend-item-unselected":d.value.includes(r)}),onClick:p=>{T(r),z(o,r)}},[e.createElementVNode("div",le,[(e.openBlock(),e.createElementBlock("svg",{height:`${t.value.style.legend.fontSize}px`,width:`${t.value.style.legend.fontSize}px`,viewBox:"0 0 10 10"},[e.createElementVNode("circle",{cx:5,cy:5,r:5,fill:o.color},null,8,ae)],8,oe)),e.createElementVNode("span",{style:e.normalizeStyle(`color:${t.value.style.legend.name.color}; font-weight:${t.value.style.legend.name.bold?"bold":"normal"}`)},e.toDisplayString(o.name),5),t.value.style.legend.percentage.show?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(`font-weight:${t.value.style.legend.percentage.bold?"bold":"normal"};color:${t.value.style.legend.percentage.color}`)},e.toDisplayString(d.value.includes(r)?" - ":o.proportionLabel),5)):e.createCommentVNode("",!0),t.value.style.legend.value.show?(e.openBlock(),e.createElementBlock("span",{key:1,style:e.normalizeStyle(`font-weight:${t.value.style.legend.value.bold?"bold":"normal"};color:${t.value.style.legend.value.color}`)}," ("+e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.legend.value.formatter,o.value,e.unref(a.dataLabel)({p:t.value.style.legend.value.prefix,v:o.value,s:t.value.style.legend.value.suffix,r:t.value.style.legend.value.rounding}),{datapoint:o,seriesIndex:r}))+") ",5)):e.createCommentVNode("",!0)])],14,te))),256))],4)):e.createCommentVNode("",!0),e.createVNode(M._sfc_main,{show:b.value&&t.value.style.tooltip.show,parent:B.value,backgroundColor:t.value.style.tooltip.backgroundColor,color:t.value.style.tooltip.color,fontSize:t.value.style.tooltip.fontSize,borderRadius:t.value.style.tooltip.borderRadius,borderColor:t.value.style.tooltip.borderColor,borderWidth:t.value.style.tooltip.borderWidth,backgroundOpacity:t.value.style.tooltip.backgroundOpacity,position:t.value.style.tooltip.position,content:_.value,isCustom:k.value,offsetY:-124+t.value.style.tooltip.offsetY,blockShiftY:!0},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...w.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...w.value})),void 0,!0)]),_:3},8,["show","parent","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","content","isCustom","offsetY"]),l.$slots.source?(e.openBlock(),e.createElementBlock("div",re,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0)],4))}},se=j._export_sfc(ne,[["__scopeId","data-v-72244c73"]]);exports.default=se;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-TsXfF4RW.cjs"),V=require("./useNestedProp-AmCRQ0Mq.cjs"),O=require("./vue-ui-skeleton-D3N7upHq.cjs"),U=require("./PackageVersion-GUCKUltM.cjs"),M=require("./Tooltip-Ce3-d-Jl.cjs"),j=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),H=["xmlns","viewBox"],I=["id"],R=["stop-color"],W=["stop-color"],Y=["stop-color"],G={id:"stackPill",clipPathUnits:"objectBoundingBox"},X=["fill"],J={key:0,"clip-path":"url(#stackPill)"},K=["x","width","height","fill"],Q=["x","width","height","fill","stroke"],Z=["onClick","x","width","height","onMouseenter"],ee=["width","height","rx"],te=["onClick"],le={style:{display:"flex","flex-direction":"row","align-items":"center",gap:"4px","justify-content":"center"}},oe=["height","width"],ae=["fill"],re={key:4,ref:"source",dir:"auto"},ne={__name:"vue-ui-sparkstackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(P,{emit:D}){const{vue_ui_sparkstackbar:L}=a.useConfig(),u=P,F=e.useSlots();e.onMounted(()=>{F["chart-background"]&&console.warn("VueUiSparkStackbar does not support the #chart-background slot.")});const x=e.computed(()=>!!u.dataset&&u.dataset.length),B=e.ref(null),S=e.ref(a.createUid()),b=e.ref(!1),_=e.ref(""),t=e.computed({get:()=>$(),set:l=>l});function $(){const l=V.useNestedProp({userConfig:u.config,defaultConfig:L});return l.theme?{...V.useNestedProp({userConfig:a.themes.vue_ui_sparkstackbar[l.theme]||u.config,defaultConfig:l}),customPalette:a.themePalettes[l.theme]||a.palette}:l}e.watch(()=>u.config,l=>{t.value=$(),E()},{deep:!0}),e.watch(()=>u.dataset,l=>{v.value=u.dataset.map((n,o)=>({...n,color:n.color?a.convertColorToHex(n.color):f.value[o]||a.palette[o]||a.palette[o%a.palette.length]}))},{deep:!0});const f=e.computed(()=>a.convertCustomPalette(t.value.customPalette)),v=e.ref(u.dataset.map((l,n)=>({...l,value:t.value.style.animation.show?0:l.value||0,color:l.color?a.convertColorToHex(l.color):f.value[n]||a.palette[n]||a.palette[n%a.palette.length]}))),g=e.ref(!0);e.onMounted(()=>{if(E(),t.value.style.animation.show){let p=function(){r+=o/l,r<o?(v.value=v.value.map((s,i)=>({...s,value:s.value+=n[i],color:s.color?a.convertColorToHex(s.color):f.value[i]||a.palette[i]||a.palette[i%a.palette.length]})),requestAnimationFrame(p)):(g.value=!1,v.value=u.dataset.map((s,i)=>({...s,value:s.value||0,color:s.color?a.convertColorToHex(s.color):f.value[i]||a.palette[i]||a.palette[i%a.palette.length],id:a.createUid()})))};const l=t.value.style.animation.animationFrames,n=u.dataset.map((s,i)=>s.value/l),o=u.dataset.map(s=>s.value||0).reduce((s,i)=>s+i,0);let r=0;g.value=!0,p()}});function E(){a.objectIsEmpty(u.dataset)?a.error({componentName:"VueUiSparkStackbar",type:"dataset"}):u.dataset.forEach((l,n)=>{a.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","value"]}).forEach(o=>{a.error({componentName:"VueUiSparkStackbar",type:"datasetSerieAttribute",property:o,index:n})})})}const c=e.ref({width:500,height:16}),d=e.ref([]),N=e.computed(()=>u.dataset.map(l=>l.value||0).filter((l,n)=>!d.value.includes(n)).reduce((l,n)=>l+n,0)),y=e.computed(()=>v.value.map((l,n)=>{const o=l.value||0,r=o/N.value,p=isNaN(r)?0:r,s=p*c.value.width;return{...l,value:o,proportion:p,width:s,proportionLabel:a.dataLabel({v:p*100,s:"%",r:t.value.style.legend.percentage.rounding})}})),C=e.computed(()=>y.value.filter((l,n)=>!d.value.includes(n)));function T(l){d.value.includes(l)?d.value=d.value.filter(n=>n!==l):d.value.length<v.value.length-1&&d.value.push(l)}const h=e.computed(()=>{let l=0;const n=[];for(let o=0;o<C.value.length;o+=1)n.push({...C.value[o],start:l}),l+=C.value[o].width;return n}),A=D;function z(l,n){A("selectDatapoint",{datapoint:l,index:n})}const w=e.ref(null),k=e.ref(!1),m=e.ref(null);function q({datapoint:l,seriesIndex:n}){if(!t.value.style.tooltip.show)return;w.value={datapoint:l,seriesIndex:n,config:t.value,series:y.value},b.value=!0,m.value=n;const o=t.value.style.tooltip.customFormat;if(a.isFunction(o))try{const r=o({seriesIndex:n,datapoint:l,series:y.value,config:t.value});typeof r=="string"&&(_.value=r,k.value=!0)}catch{console.warn("Custom format cannot be applied."),k.value=!1}if(!k.value){let r="";r+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${l.name}</div>`,r+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${l.color}"/></svg>`,r+=`<b>${l.proportionLabel}</b>`,r+=`<span>(${a.applyDataLabel(t.value.style.legend.value.formatter,l.value,a.dataLabel({p:t.value.style.legend.value.prefix,v:l.value,s:t.value.style.legend.value.suffix,r:t.value.style.legend.value.rounding}),{datapoint:l,seriesIndex:n})})</span>`,_.value=`<div>${r}</div>`}}return(l,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"sparkstackbarChart",ref:B,style:e.normalizeStyle(`width:100%; background:${t.value.style.backgroundColor}`)},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:calc(100% - 12px);background:transparent;margin:0 auto;margin:${t.value.style.title.margin};padding: 0 6px;text-align:${t.value.style.title.textAlign}`)},[e.createElementVNode("div",{style:e.normalizeStyle(`font-size:${t.value.style.title.fontSize}px;color:${t.value.style.title.color};font-weight:${t.value.style.title.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.text),5),t.value.style.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`font-size:${t.value.style.title.subtitle.fontSize}px;color:${t.value.style.title.subtitle.color};font-weight:${t.value.style.title.subtitle.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.subtitle.text),5)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),x.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(a.XMLNS),width:"100%",viewBox:`0 0 ${c.value.width} ${c.value.height}`},[e.createVNode(U._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{key:`stack_gradient_${r}`,gradientTransform:"rotate(90)",id:`stack_gradient_${r}_${S.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":o.color},null,8,R),e.createElementVNode("stop",{offset:"50%","stop-color":e.unref(a.setOpacity)(e.unref(a.shiftHue)(o.color,.05),100-t.value.style.bar.gradient.intensity)},null,8,W),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,Y)],8,I))),128)),e.createElementVNode("clipPath",G,[e.createElementVNode("rect",{x:"0.005",y:"-2",width:"0.99",height:"5",rx:"3",ry:"3",fill:t.value.style.backgroundColor},null,8,X)])]),N.value>0?(e.openBlock(),e.createElementBlock("g",J,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_underlayer_${r}`,x:o.start,y:0,width:o.width,height:c.value.height,fill:t.value.style.bar.gradient.underlayerColor,class:e.normalizeClass({animated:!g.value}),style:e.normalizeStyle({opacity:m.value!==null&&t.value.style.tooltip.show?m.value===r?1:.5:1})},null,14,K))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_${r}`,x:o.start,y:0,width:o.width,height:c.value.height,fill:t.value.style.bar.gradient.show?`url(#stack_gradient_${r}_${S.value})`:o.color,stroke:t.value.style.backgroundColor,"stroke-linecap":"round",class:e.normalizeClass({animated:!g.value}),style:e.normalizeStyle({opacity:m.value!==null&&t.value.style.tooltip.show?m.value===r?1:.5:1})},null,14,Q))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_trap_${r}`,onClick:()=>z(o,r),x:o.start,y:0,width:o.width,height:c.value.height,fill:"transparent",stroke:"none",class:e.normalizeClass({animated:!g.value}),onMouseenter:()=>q({datapoint:o,seriesIndex:r}),onMouseleave:n[0]||(n[0]=p=>{b.value=!1,m.value=null})},null,42,Z))),128))])):(e.openBlock(),e.createElementBlock("rect",{key:1,x:2,y:1,width:c.value.width-4,height:c.value.height-2,stroke:"#CCCCCC","stroke-width":"2",fill:"transparent",rx:(c.value.height-4)/2},null,8,ee))],8,H)):e.createCommentVNode("",!0),x.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(O.default,{key:2,config:{type:"sparkStackbar",style:{backgroundColor:t.value.style.backgroundColor,sparkStackbar:{color:"#CCCCCC"}}}},null,8,["config"])),t.value.style.legend.show?(e.openBlock(),e.createElementBlock("div",{key:3,style:e.normalizeStyle(`background:transparent;margin:0 auto;margin:${t.value.style.legend.margin};justify-content:${t.value.style.legend.textAlign==="left"?"flex-start":t.value.style.legend.textAlign==="right"?"flex-end":"center"}`),class:"vue-ui-sparkstackbar-legend"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(o,r)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`font-size:${t.value.style.legend.fontSize}px;`),class:e.normalizeClass({"vue-ui-sparkstackbar-legend-item":!0,"vue-ui-sparkstackbar-legend-item-unselected":d.value.includes(r)}),onClick:p=>{T(r),z(o,r)}},[e.createElementVNode("div",le,[(e.openBlock(),e.createElementBlock("svg",{height:`${t.value.style.legend.fontSize}px`,width:`${t.value.style.legend.fontSize}px`,viewBox:"0 0 10 10"},[e.createElementVNode("circle",{cx:5,cy:5,r:5,fill:o.color},null,8,ae)],8,oe)),e.createElementVNode("span",{style:e.normalizeStyle(`color:${t.value.style.legend.name.color}; font-weight:${t.value.style.legend.name.bold?"bold":"normal"}`)},e.toDisplayString(o.name),5),t.value.style.legend.percentage.show?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(`font-weight:${t.value.style.legend.percentage.bold?"bold":"normal"};color:${t.value.style.legend.percentage.color}`)},e.toDisplayString(d.value.includes(r)?" - ":o.proportionLabel),5)):e.createCommentVNode("",!0),t.value.style.legend.value.show?(e.openBlock(),e.createElementBlock("span",{key:1,style:e.normalizeStyle(`font-weight:${t.value.style.legend.value.bold?"bold":"normal"};color:${t.value.style.legend.value.color}`)}," ("+e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.legend.value.formatter,o.value,e.unref(a.dataLabel)({p:t.value.style.legend.value.prefix,v:o.value,s:t.value.style.legend.value.suffix,r:t.value.style.legend.value.rounding}),{datapoint:o,seriesIndex:r}))+") ",5)):e.createCommentVNode("",!0)])],14,te))),256))],4)):e.createCommentVNode("",!0),e.createVNode(M._sfc_main,{show:b.value&&t.value.style.tooltip.show,parent:B.value,backgroundColor:t.value.style.tooltip.backgroundColor,color:t.value.style.tooltip.color,fontSize:t.value.style.tooltip.fontSize,borderRadius:t.value.style.tooltip.borderRadius,borderColor:t.value.style.tooltip.borderColor,borderWidth:t.value.style.tooltip.borderWidth,backgroundOpacity:t.value.style.tooltip.backgroundOpacity,position:t.value.style.tooltip.position,content:_.value,isCustom:k.value,offsetY:-124+t.value.style.tooltip.offsetY,blockShiftY:!0},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...w.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...w.value})),void 0,!0)]),_:3},8,["show","parent","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","content","isCustom","offsetY"]),l.$slots.source?(e.openBlock(),e.createElementBlock("div",re,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0)],4))}},se=j._export_sfc(ne,[["__scopeId","data-v-72244c73"]]);exports.default=se;
@@ -1,9 +1,9 @@
1
1
  import { useSlots as ue, onMounted as Y, computed as m, ref as d, watch as G, createElementBlock as r, openBlock as s, normalizeStyle as v, createCommentVNode as y, createBlock as ie, createVNode as q, createElementVNode as p, toDisplayString as w, unref as C, Fragment as x, renderList as $, normalizeClass as F, withCtx as H, renderSlot as U, normalizeProps as X, guardReactiveProps as J } from "vue";
2
- import { u as ce, c as K, t as de, p as i, a as ve, d as N, b as pe, o as ge, e as Q, g as fe, f as V, X as he, s as ye, w as me, i as Z, x as ke } from "./index-B8uVRkA1.js";
3
- import { u as ee } from "./useNestedProp-kStEZqtl.js";
4
- import be from "./vue-ui-skeleton-BC7kQhlE.js";
5
- import { _ as _e } from "./PackageVersion-Dqo8V-i_.js";
6
- import { _ as we } from "./Tooltip-BUMgVEu0.js";
2
+ import { u as ce, c as K, t as de, p as i, a as ve, d as N, b as pe, o as ge, e as Q, g as fe, f as V, X as he, s as ye, w as me, i as Z, x as ke } from "./index-Sq6_Z5Ol.js";
3
+ import { u as ee } from "./useNestedProp-BmjPdxME.js";
4
+ import be from "./vue-ui-skeleton-DhEZVP4j.js";
5
+ import { _ as _e } from "./PackageVersion-koLOUagZ.js";
6
+ import { _ as we } from "./Tooltip-2BVEpShN.js";
7
7
  import { _ as Ce } from "./_plugin-vue_export-helper-CHgC5LLL.js";
8
8
  const xe = ["xmlns", "viewBox"], $e = ["id"], Se = ["stop-color"], ze = ["stop-color"], Pe = ["stop-color"], De = {
9
9
  id: "stackPill",
@@ -1,19 +1,19 @@
1
1
  import { useSlots as Pt, computed as w, ref as g, onMounted as tt, watch as at, nextTick as he, createElementBlock as s, openBlock as o, unref as m, normalizeStyle as W, normalizeClass as te, createBlock as Z, createCommentVNode as v, renderSlot as x, createElementVNode as B, createVNode as ae, createSlots as lt, withCtx as _, normalizeProps as U, guardReactiveProps as Y, Fragment as h, renderList as y, mergeProps as we, toDisplayString as $, createTextVNode as Rt } from "vue";
2
- import { u as At, c as rt, t as Vt, p as ve, a as Ft, C as de, b as Dt, o as Et, e as ot, g as Ht, d as Wt, aa as ye, a8 as st, D as it, X as Bt, l as Ut, a3 as ge, G as nt, f as X, x as ut, q as Yt, r as Xt, i as ct, y as Gt } from "./index-B8uVRkA1.js";
3
- import { u as ht } from "./useNestedProp-kStEZqtl.js";
2
+ import { u as At, c as rt, t as Vt, p as ve, a as Ft, C as de, b as Dt, o as Et, e as ot, g as Ht, d as Wt, aa as ye, a8 as st, D as it, X as Bt, l as Ut, a3 as ge, G as nt, f as X, x as ut, q as Yt, r as Xt, i as ct, y as Gt } from "./index-Sq6_Z5Ol.js";
3
+ import { u as ht } from "./useNestedProp-BmjPdxME.js";
4
4
  import { t as Jt, u as qt } from "./useResponsive-CoxXLe23.js";
5
- import { u as Zt, U as Kt } from "./usePrinter-CppD6oY_.js";
6
- import { S as Qt } from "./Slicer-DKXIt2om.js";
7
- import { _ as jt } from "./Tooltip-BUMgVEu0.js";
8
- import { _ as ea } from "./Title-MKfkLka7.js";
9
- import { L as ta } from "./Legend-du4CJMG1.js";
10
- import aa from "./vue-ui-accordion-CE2Pnpz3.js";
11
- import { D as la } from "./DataTable-BWABkdIL.js";
12
- import ra from "./vue-ui-skeleton-BC7kQhlE.js";
13
- import { _ as oa } from "./PackageVersion-Dqo8V-i_.js";
14
- import { P as sa } from "./PenAndPaper-QsaleY3R.js";
5
+ import { u as Zt, U as Kt } from "./usePrinter-KhQnrZzM.js";
6
+ import { S as Qt } from "./Slicer-BHKjr5Ta.js";
7
+ import { _ as jt } from "./Tooltip-2BVEpShN.js";
8
+ import { _ as ea } from "./Title-BrlBOQMX.js";
9
+ import { L as ta } from "./Legend-D3s69_UE.js";
10
+ import aa from "./vue-ui-accordion-Cs3dJ86t.js";
11
+ import { D as la } from "./DataTable-g-vVSX5e.js";
12
+ import ra from "./vue-ui-skeleton-DhEZVP4j.js";
13
+ import { _ as oa } from "./PackageVersion-koLOUagZ.js";
14
+ import { P as sa } from "./PenAndPaper-NARoVmb-.js";
15
15
  import { u as ia } from "./useUserOptionState-BIvW1Kz7.js";
16
- import { _ as na } from "./Shape-D_MGNYEa.js";
16
+ import { _ as na } from "./Shape-BQwPhaQ2.js";
17
17
  import { _ as ua } from "./_plugin-vue_export-helper-CHgC5LLL.js";
18
18
  const ca = ["id"], ha = ["xmlns", "viewBox"], va = ["x", "y", "width", "height"], da = { key: 1 }, ya = ["id"], ga = ["stop-color"], ba = ["stop-color"], fa = ["stop-color"], ma = ["x1", "x2", "y1", "y2", "stroke"], pa = ["x1", "x2", "y1", "y2", "stroke"], xa = ["x1", "x2", "y1", "y2", "stroke"], ka = ["x1", "x2", "y1", "y2", "stroke"], wa = { key: 0 }, za = ["x", "y", "height", "rx", "width", "fill", "stroke", "stroke-width"], _a = { key: 0 }, Ca = ["x", "y", "height", "rx", "width", "fill", "stroke", "stroke-width"], La = ["x", "y", "width", "rx", "height", "fill", "stroke", "stroke-width"], Sa = { key: 0 }, $a = ["x", "y", "width", "rx", "height", "fill", "stroke", "stroke-width"], Ma = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Ta = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Na = ["x", "y", "font-size", "fill", "font-weight"], Ia = ["transform", "font-size", "fill", "font-weight"], Oa = ["x", "y", "font-size", "fill", "font-weight"], Pa = { key: 0 }, Ra = ["x", "y", "font-size", "font-weight", "fill"], Aa = ["x", "y", "font-size", "fill", "font-weight"], Va = { key: 0 }, Fa = ["x", "y", "font-size", "font-weight", "fill"], Da = ["x1", "x2", "y1", "y2", "stroke"], Ea = ["x", "y", "font-size", "font-weight", "fill"], Ha = ["x1", "x2", "y1", "y2", "stroke"], Wa = ["font-size", "font-weight", "fill", "text-anchor", "transform"], Ba = { key: 0 }, Ua = { key: 1 }, Ya = ["text-anchor", "font-size", "font-weight", "fill", "transform", "onClick"], Xa = { key: 0 }, Ga = { key: 1 }, Ja = ["font-size", "font-weight", "fill", "x", "y", "onClick"], qa = ["x", "y", "width", "height", "onClick", "onMouseenter", "fill"], Za = ["x", "y", "width", "height", "onClick", "onMouseenter", "fill"], Ka = {
19
19
  key: 4,
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-Bmq5HB9y.cjs"),Ve=require("./useNestedProp-CivZENAh.cjs"),Te=require("./useResponsive-BJ7DTGpm.cjs"),Me=require("./usePrinter-Cf6Zct5m.cjs"),lt=require("./Slicer-Vzo3baUi.cjs"),ot=require("./Tooltip-pA64woiQ.cjs"),rt=require("./Title-x7Hmi2zb.cjs"),st=require("./Legend-Bf8J9KZk.cjs"),nt=require("./vue-ui-accordion-WWblnzaJ.cjs"),it=require("./DataTable-Cybmjq2W.cjs"),ut=require("./vue-ui-skeleton-D5890icn.cjs"),ct=require("./PackageVersion-Bmro6-lR.cjs"),dt=require("./PenAndPaper-B7dv_ssy.cjs"),ht=require("./useUserOptionState-BgepsfED.cjs"),vt=require("./Shape-QydDpcqr.cjs"),mt=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),gt=["id"],yt=["xmlns","viewBox"],bt=["x","y","width","height"],ft={key:1},pt=["id"],kt=["stop-color"],xt=["stop-color"],wt=["stop-color"],Bt=["x1","x2","y1","y2","stroke"],Ct=["x1","x2","y1","y2","stroke"],St=["x1","x2","y1","y2","stroke"],zt=["x1","x2","y1","y2","stroke"],Lt={key:0},_t=["x","y","height","rx","width","fill","stroke","stroke-width"],Et={key:0},Nt=["x","y","height","rx","width","fill","stroke","stroke-width"],$t=["x","y","width","rx","height","fill","stroke","stroke-width"],Vt={key:0},Tt=["x","y","width","rx","height","fill","stroke","stroke-width"],Mt=["x1","x2","y1","y2","stroke","stroke-width"],Ft=["x1","x2","y1","y2","stroke","stroke-width"],Pt=["x","y","font-size","fill","font-weight"],It=["transform","font-size","fill","font-weight"],Ot=["x","y","font-size","fill","font-weight"],Rt={key:0},Dt=["x","y","font-size","font-weight","fill"],At=["x","y","font-size","fill","font-weight"],Ht={key:0},qt=["x","y","font-size","font-weight","fill"],Ut=["x1","x2","y1","y2","stroke"],Wt=["x","y","font-size","font-weight","fill"],Yt=["x1","x2","y1","y2","stroke"],Xt=["font-size","font-weight","fill","text-anchor","transform"],Gt={key:0},Jt={key:1},Zt=["text-anchor","font-size","font-weight","fill","transform","onClick"],Kt={key:0},Qt={key:1},jt=["font-size","font-weight","fill","x","y","onClick"],ea=["x","y","width","height","onClick","onMouseenter","fill"],ta=["x","y","width","height","onClick","onMouseenter","fill"],aa={key:4,class:"vue-data-ui-watermark"},la=["onClick"],oa=["innerHTML"],ra={__name:"vue-ui-stackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint","selectLegend","selectTimeLabel"],setup(G,{expose:Fe,emit:Pe}){const{vue_ui_stackbar:Ie}=u.useConfig(),Oe=e.useSlots(),h=G,J=Pe,T=e.computed({get(){return!!h.dataset&&h.dataset.length},set(l){return l}}),M=e.ref(null),C=e.ref(u.createUid()),D=e.ref(!1),ee=e.ref(null),Z=e.ref(""),f=e.ref([]),te=e.ref(0),ae=e.ref(null),le=e.ref(null),oe=e.ref(null),re=e.ref(null),se=e.ref(0),A=e.ref(!1),P=e.ref(null),_=e.ref(!1),Re=e.ref(0),De=e.ref(0),Ae=e.ref(0),F=e.ref(null);e.onMounted(()=>{Q()});const t=e.computed({get:()=>ue(),set:l=>l}),{userOptionsVisible:K,setUserOptionsVisibility:ne,keepUserOptionState:ie}=ht.useUserOptionState({config:t.value});function ue(){const l=Ve.useNestedProp({userConfig:h.config,defaultConfig:Ie});let o={};return l.theme?o={...Ve.useNestedProp({userConfig:u.themes.vue_ui_stackbar[l.theme]||h.config,defaultConfig:l}),customPalette:u.themePalettes[l.theme]||u.palette}:o=l,h.config&&u.hasDeepProperty(h.config,"style.chart.grid.scale.scaleMin")?o.style.chart.grid.scale.scaleMin=h.config.style.chart.grid.scale.scaleMin:o.style.chart.grid.scale.scaleMin=null,h.config&&u.hasDeepProperty(h.config,"style.chart.grid.scale.scaleMax")?o.style.chart.grid.scale.scaleMax=h.config.style.chart.grid.scale.scaleMax:o.style.chart.grid.scale.scaleMax=null,h.config&&u.hasDeepProperty(h.config,"style.chart.zoom.startIndex")?o.style.chart.zoom.startIndex=h.config.style.chart.zoom.startIndex:o.style.chart.zoom.startIndex=null,h.config&&u.hasDeepProperty(h.config,"style.chart.zoom.endIndex")?o.style.chart.zoom.endIndex=h.config.style.chart.zoom.endIndex:o.style.chart.zoom.endIndex=null,o}e.watch(()=>h.config,l=>{t.value=ue(),K.value=!t.value.userOptions.showOnChartHover,Q(),Re.value+=1,De.value+=1,Ae.value+=1,y.value.dataLabels.show=t.value.style.chart.bars.dataLabels.show,y.value.showTable=t.value.table.show,y.value.showTooltip=t.value.style.chart.tooltip.show},{deep:!0}),e.watch(()=>h.dataset,l=>{ye()},{deep:!0});const y=e.ref({dataLabels:{show:t.value.style.chart.bars.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),{isPrinting:ce,isImaging:de,generatePdf:he,generateImage:ve}=Me.usePrinter({elementId:`stackbar_${C.value}`,fileName:t.value.style.chart.title.text||"vue-ui-stackbar"}),H=e.ref({width:t.value.style.chart.width,height:t.value.style.chart.height,paddingRatio:{top:t.value.style.chart.padding.top/t.value.style.chart.height,right:t.value.style.chart.padding.right/t.value.style.chart.width,bottom:t.value.style.chart.padding.bottom/t.value.style.chart.height,left:t.value.style.chart.padding.left/t.value.style.chart.width}}),He=e.computed(()=>u.convertCustomPalette(t.value.customPalette)),me=e.ref(null),ge=e.ref(null);e.onMounted(()=>{Q()});function Q(){if(u.objectIsEmpty(h.dataset)?u.error({componentName:"VueUiStackbar",type:"dataset"}):h.dataset.forEach((l,o)=>{u.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","series"]}).forEach(a=>{T.value=!1,u.error({componentName:"VueUiStackbar",type:"datasetSerieAttribute",property:a,index:o})})}),setTimeout(()=>{_.value=!0},10),t.value.responsive){const l=Te.throttle(()=>{_.value=!1;const{width:o,height:a}=Te.useResponsive({chart:M.value,title:t.value.style.chart.title.text?ae.value:null,legend:t.value.style.chart.legend.show?le.value:null,slicer:t.value.style.chart.zoom.show&&z.value>1?oe.value:null,source:re.value});requestAnimationFrame(()=>{H.value.width=o,H.value.height=a,clearTimeout(ge.value),ge.value=setTimeout(()=>{_.value=!0},10)})});me.value=new ResizeObserver(l),me.value.observe(M.value.parentNode)}be()}const s=e.computed(()=>{const{height:l,width:o}=H.value,{right:a}=H.value.paddingRatio,r=t.value.style.chart.padding.top,i=o-o*a,n=l-t.value.style.chart.padding.bottom,b=t.value.style.chart.padding.left,E=o-b-o*a,N=l-r-t.value.style.chart.padding.bottom;return{chartHeight:l,chartWidth:o,top:r,right:i,bottom:n,left:b,width:E,height:N<0?0:N}}),S=e.computed(()=>h.dataset.map((l,o)=>{const a=u.convertColorToHex(l.color)||He.value[o]||u.palette[o]||u.palette[o%u.palette.length];return{...l,series:JSON.parse(JSON.stringify(l.series)).map(r=>t.value.style.chart.bars.distributed?Math.abs(r):r),signedSeries:l.series.map(r=>r>=0?1:-1),absoluteIndex:o,id:u.createUid(),color:a}})),z=e.computed(()=>Math.max(...S.value.filter(l=>!f.value.includes(l.id)).map(l=>l.series.length))),c=e.ref({start:0,end:Math.max(...h.dataset.map(l=>l.series.length))});function ye(){be()}async function be(){(t.value.style.chart.zoom.startIndex!==null||t.value.style.chart.zoom.endIndex!==null)&&F.value?(t.value.style.chart.zoom.startIndex!==null&&(await e.nextTick(),await e.nextTick(),F.value&&F.value.setStartValue(t.value.style.chart.zoom.startIndex)),t.value.style.chart.zoom.endIndex!==null&&(await e.nextTick(),await e.nextTick(),F.value&&F.value.setEndValue(qe(t.value.style.chart.zoom.endIndex+1)))):(c.value={start:0,end:Math.max(...h.dataset.map(l=>l.series.length))},se.value+=1)}function qe(l){const o=Math.max(...h.dataset.map(a=>a.series.length));return l>o?o:l<0||t.value.style.chart.zoom.startIndex!==null&&l<t.value.style.chart.zoom.startIndex?t.value.style.chart.zoom.startIndex!==null?t.value.style.chart.zoom.startIndex+1:1:l}const d=e.computed(()=>{let l;return t.value.orientation==="vertical"?l=s.value.width/(c.value.end-c.value.start):l=s.value.height/(c.value.end-c.value.start),l<=0?0:l}),I=e.computed(()=>u.sumSeries(S.value.filter(l=>!f.value.includes(l.id))).slice(c.value.start,c.value.end)),Ue=e.computed(()=>u.sumSeries(S.value.filter(l=>!f.value.includes(l.id)).map(l=>({...l,series:l.series.map((o,a)=>l.signedSeries[a]===-1&&o>=0?-o:o)}))).slice(c.value.start,c.value.end)),q=e.computed(()=>{const l=S.value.filter(o=>!f.value.includes(o.id));return{positive:u.sumSeries(l.map(o=>({...o,series:o.series.slice(c.value.start,c.value.end).map(a=>a>=0?a:0)}))),negative:u.sumSeries(l.map(o=>({...o,series:o.series.slice(c.value.start,c.value.end).map(a=>a<0?a:0)})))}}),w=e.computed(()=>{const l=t.value.style.chart.grid.scale.scaleMax!==null&&!t.value.style.chart.bars.distributed?t.value.style.chart.grid.scale.scaleMax:Math.max(...q.value.positive),o=Math.min(...q.value.negative),a=t.value.style.chart.grid.scale.scaleMin!==null&&!t.value.style.chart.bars.distributed?t.value.style.chart.grid.scale.scaleMin:[-1/0,1/0,NaN,void 0,null].includes(o)?0:o,r=!t.value.style.chart.bars.distributed&&(t.value.style.chart.grid.scale.scaleMax!==null||t.value.style.chart.grid.scale.scaleMin!==null)?u.calculateNiceScaleWithExactExtremes(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks):u.calculateNiceScale(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks);return r.ticks.map(i=>({zero:s.value.bottom-s.value.height*(Math.abs(r.min)/(r.max+Math.abs(r.min))),y:s.value.bottom-s.value.height*((i+Math.abs(r.min))/(r.max+Math.abs(r.min))),x:s.value.left-8,horizontal_zero:s.value.left+s.value.width*(Math.abs(r.min)/(r.max+Math.abs(r.min))),horizontal_x:s.value.left+s.value.width*((i+Math.abs(r.min))/(r.max+Math.abs(r.min))),horizontal_y:s.value.bottom-8,value:i}))}),L=e.computed(()=>{const l=[];for(let o=0;o<z.value;o+=1)l.push({text:t.value.style.chart.grid.x.timeLabels.values[o]||String(o),absoluteIndex:o});return l.slice(c.value.start,c.value.end)}),g=e.computed(()=>{if(!T.value)return[];let l=Array(z.value).fill(0),o=Array(z.value).fill(0),a=Array(z.value).fill(0),r=Array(z.value).fill(0);const i=Math.max(...q.value.positive)||0,n=Math.min(...q.value.negative),b=[-1/0,1/0,NaN,void 0,null].includes(n)?0:n,E=!t.value.style.chart.bars.distributed&&(t.value.style.chart.grid.scale.scaleMax!==null||t.value.style.chart.grid.scale.scaleMin!==null)?u.calculateNiceScaleWithExactExtremes(t.value.style.chart.grid.scale.scaleMin!==null?t.value.style.chart.grid.scale.scaleMin:b>0?0:b,t.value.style.chart.grid.scale.scaleMax!==null?t.value.style.chart.grid.scale.scaleMax:i<0?0:i,t.value.style.chart.grid.scale.ticks):u.calculateNiceScale(t.value.style.chart.grid.scale.scaleMin!==null?t.value.style.chart.grid.scale.scaleMin:b>0?0:b,t.value.style.chart.grid.scale.scaleMax!==null?t.value.style.chart.grid.scale.scaleMax:i<0?0:i,t.value.style.chart.grid.scale.ticks),{min:N,max:O}=E,$=O+(N>=0?0:Math.abs(N))||1,p=s.value.height,X=s.value.width,Ne=w.value[0]?w.value[0].zero:s.value.bottom,$e=w.value[0]?w.value[0].horizontal_zero:s.value.left;return S.value.filter(R=>!f.value.includes(R.id)).map(R=>{const B=R.series.slice(c.value.start,c.value.end),Je=R.signedSeries.slice(c.value.start,c.value.end),Ze=B.map((v,m)=>s.value.left+d.value*m+d.value*t.value.style.chart.bars.gapRatio/4),Ke=B.map((v,m)=>s.value.top+d.value*m+d.value*t.value.style.chart.bars.gapRatio/4),Qe=B.map((v,m)=>{const k=t.value.style.chart.bars.distributed?(v||0)/I.value[m]:(v||0)/$;let V,x;return v>0?(x=p*k,V=Ne-x-l[m],l[m]+=x):(x=p*k,V=Ne+a[m],a[m]+=Math.abs(x)),V}),je=B.map((v,m)=>{const k=t.value.style.chart.bars.distributed?(v||0)/I.value[m]:(v||0)/$;let V,x;return v>0?(x=X*k,V=$e+o[m],o[m]+=x):(x=X*k,V=$e-Math.abs(x)-r[m],r[m]+=Math.abs(x)),V}),et=B.map((v,m)=>{const k=t.value.style.chart.bars.distributed?(v||0)/I.value[m]:(v||0)/$;return v>0?p*k:p*Math.abs(k)}),tt=B.map((v,m)=>{const k=t.value.style.chart.bars.distributed?(v||0)/I.value[m]:(v||0)/$;return v>0?X*k:X*Math.abs(k)}),at=B.map(v=>Math.abs(v)).reduce((v,m)=>v+m,0);return{...R,proportions:B.map((v,m)=>t.value.style.chart.bars.distributed?(v||0)/I.value[m]:(v||0)/at),series:B,signedSeries:Je,x:Ze,y:Qe,height:et,horizontal_width:tt,horizontal_y:Ke,horizontal_x:je}})}),fe=e.computed(()=>Ue.value.map((l,o)=>({value:l,sign:l>=0?1:-1})));function U(l,o,a,r,i){const n=i===-1&&l>=0?-l:l;return u.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,n,u.dataLabel({p:t.value.style.chart.bars.dataLabels.prefix,v:n,s:t.value.style.chart.bars.dataLabels.suffix,r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:o,seriesIndex:a,datapointIndex:r})}function pe(l,o,a,r){return u.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,l,u.dataLabel({v:isNaN(l)?0:l,s:"%",r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:o,seriesIndex:a,datapointIndex:r})}function ke(l){const o=JSON.parse(JSON.stringify(g.value)).map(a=>({name:a.name,value:a.series[l]===0?0:a.series[l]||null,proportion:a.proportions[l]||null,color:a.color,id:a.id}));J("selectDatapoint",{datapoint:o,period:L.value[l]})}function xe(l){P.value=l,D.value=!0;const o=t.value.style.chart.tooltip.customFormat,a=JSON.parse(JSON.stringify(g.value)).map(i=>({name:i.name,absoluteIndex:i.absoluteIndex,value:i.series[l]===0?0:(i.signedSeries[l]===-1&&i.series[l]>=0?-i.series[l]:i.series[l])||null,proportion:i.proportions[l]||null,color:i.color,id:i.id})),r=a.map(i=>Math.abs(i.value)).reduce((i,n)=>i+n,0);if(u.isFunction(o)&&u.functionReturnsString(()=>o({seriesIndex:l,datapoint:a,series:g.value,config:t.value})))Z.value=o({seriesIndex:l,datapoint:a,series:g.value,config:t.value});else{const{showValue:i,showPercentage:n,borderColor:b,roundingValue:E,roundingPercentage:N}=t.value.style.chart.tooltip;let O="";L.value[l]&&L.value[l].text&&t.value.style.chart.tooltip.showTimeLabel&&(O+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${b};padding-bottom:6px;margin-bottom:3px;">${L.value[l].text}</div>`);const $=[i&&n?"(":"",i&&n?")":""];a.reverse().forEach(p=>{O+=`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-TsXfF4RW.cjs"),Ve=require("./useNestedProp-AmCRQ0Mq.cjs"),Te=require("./useResponsive-BJ7DTGpm.cjs"),Me=require("./usePrinter-DqLdu0d8.cjs"),lt=require("./Slicer-D2-FPJ8d.cjs"),ot=require("./Tooltip-Ce3-d-Jl.cjs"),rt=require("./Title-IEvHjzFX.cjs"),st=require("./Legend-14o6ysPB.cjs"),nt=require("./vue-ui-accordion-DQr01ula.cjs"),it=require("./DataTable-o267EcsS.cjs"),ut=require("./vue-ui-skeleton-D3N7upHq.cjs"),ct=require("./PackageVersion-GUCKUltM.cjs"),dt=require("./PenAndPaper-BFxCZMe_.cjs"),ht=require("./useUserOptionState-BgepsfED.cjs"),vt=require("./Shape-DQcajuPX.cjs"),mt=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),gt=["id"],yt=["xmlns","viewBox"],bt=["x","y","width","height"],ft={key:1},pt=["id"],kt=["stop-color"],xt=["stop-color"],wt=["stop-color"],Bt=["x1","x2","y1","y2","stroke"],Ct=["x1","x2","y1","y2","stroke"],St=["x1","x2","y1","y2","stroke"],zt=["x1","x2","y1","y2","stroke"],Lt={key:0},_t=["x","y","height","rx","width","fill","stroke","stroke-width"],Et={key:0},Nt=["x","y","height","rx","width","fill","stroke","stroke-width"],$t=["x","y","width","rx","height","fill","stroke","stroke-width"],Vt={key:0},Tt=["x","y","width","rx","height","fill","stroke","stroke-width"],Mt=["x1","x2","y1","y2","stroke","stroke-width"],Ft=["x1","x2","y1","y2","stroke","stroke-width"],Pt=["x","y","font-size","fill","font-weight"],It=["transform","font-size","fill","font-weight"],Ot=["x","y","font-size","fill","font-weight"],Rt={key:0},Dt=["x","y","font-size","font-weight","fill"],At=["x","y","font-size","fill","font-weight"],Ht={key:0},qt=["x","y","font-size","font-weight","fill"],Ut=["x1","x2","y1","y2","stroke"],Wt=["x","y","font-size","font-weight","fill"],Yt=["x1","x2","y1","y2","stroke"],Xt=["font-size","font-weight","fill","text-anchor","transform"],Gt={key:0},Jt={key:1},Zt=["text-anchor","font-size","font-weight","fill","transform","onClick"],Kt={key:0},Qt={key:1},jt=["font-size","font-weight","fill","x","y","onClick"],ea=["x","y","width","height","onClick","onMouseenter","fill"],ta=["x","y","width","height","onClick","onMouseenter","fill"],aa={key:4,class:"vue-data-ui-watermark"},la=["onClick"],oa=["innerHTML"],ra={__name:"vue-ui-stackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint","selectLegend","selectTimeLabel"],setup(G,{expose:Fe,emit:Pe}){const{vue_ui_stackbar:Ie}=u.useConfig(),Oe=e.useSlots(),h=G,J=Pe,T=e.computed({get(){return!!h.dataset&&h.dataset.length},set(l){return l}}),M=e.ref(null),C=e.ref(u.createUid()),D=e.ref(!1),ee=e.ref(null),Z=e.ref(""),f=e.ref([]),te=e.ref(0),ae=e.ref(null),le=e.ref(null),oe=e.ref(null),re=e.ref(null),se=e.ref(0),A=e.ref(!1),P=e.ref(null),_=e.ref(!1),Re=e.ref(0),De=e.ref(0),Ae=e.ref(0),F=e.ref(null);e.onMounted(()=>{Q()});const t=e.computed({get:()=>ue(),set:l=>l}),{userOptionsVisible:K,setUserOptionsVisibility:ne,keepUserOptionState:ie}=ht.useUserOptionState({config:t.value});function ue(){const l=Ve.useNestedProp({userConfig:h.config,defaultConfig:Ie});let o={};return l.theme?o={...Ve.useNestedProp({userConfig:u.themes.vue_ui_stackbar[l.theme]||h.config,defaultConfig:l}),customPalette:u.themePalettes[l.theme]||u.palette}:o=l,h.config&&u.hasDeepProperty(h.config,"style.chart.grid.scale.scaleMin")?o.style.chart.grid.scale.scaleMin=h.config.style.chart.grid.scale.scaleMin:o.style.chart.grid.scale.scaleMin=null,h.config&&u.hasDeepProperty(h.config,"style.chart.grid.scale.scaleMax")?o.style.chart.grid.scale.scaleMax=h.config.style.chart.grid.scale.scaleMax:o.style.chart.grid.scale.scaleMax=null,h.config&&u.hasDeepProperty(h.config,"style.chart.zoom.startIndex")?o.style.chart.zoom.startIndex=h.config.style.chart.zoom.startIndex:o.style.chart.zoom.startIndex=null,h.config&&u.hasDeepProperty(h.config,"style.chart.zoom.endIndex")?o.style.chart.zoom.endIndex=h.config.style.chart.zoom.endIndex:o.style.chart.zoom.endIndex=null,o}e.watch(()=>h.config,l=>{t.value=ue(),K.value=!t.value.userOptions.showOnChartHover,Q(),Re.value+=1,De.value+=1,Ae.value+=1,y.value.dataLabels.show=t.value.style.chart.bars.dataLabels.show,y.value.showTable=t.value.table.show,y.value.showTooltip=t.value.style.chart.tooltip.show},{deep:!0}),e.watch(()=>h.dataset,l=>{ye()},{deep:!0});const y=e.ref({dataLabels:{show:t.value.style.chart.bars.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),{isPrinting:ce,isImaging:de,generatePdf:he,generateImage:ve}=Me.usePrinter({elementId:`stackbar_${C.value}`,fileName:t.value.style.chart.title.text||"vue-ui-stackbar"}),H=e.ref({width:t.value.style.chart.width,height:t.value.style.chart.height,paddingRatio:{top:t.value.style.chart.padding.top/t.value.style.chart.height,right:t.value.style.chart.padding.right/t.value.style.chart.width,bottom:t.value.style.chart.padding.bottom/t.value.style.chart.height,left:t.value.style.chart.padding.left/t.value.style.chart.width}}),He=e.computed(()=>u.convertCustomPalette(t.value.customPalette)),me=e.ref(null),ge=e.ref(null);e.onMounted(()=>{Q()});function Q(){if(u.objectIsEmpty(h.dataset)?u.error({componentName:"VueUiStackbar",type:"dataset"}):h.dataset.forEach((l,o)=>{u.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","series"]}).forEach(a=>{T.value=!1,u.error({componentName:"VueUiStackbar",type:"datasetSerieAttribute",property:a,index:o})})}),setTimeout(()=>{_.value=!0},10),t.value.responsive){const l=Te.throttle(()=>{_.value=!1;const{width:o,height:a}=Te.useResponsive({chart:M.value,title:t.value.style.chart.title.text?ae.value:null,legend:t.value.style.chart.legend.show?le.value:null,slicer:t.value.style.chart.zoom.show&&z.value>1?oe.value:null,source:re.value});requestAnimationFrame(()=>{H.value.width=o,H.value.height=a,clearTimeout(ge.value),ge.value=setTimeout(()=>{_.value=!0},10)})});me.value=new ResizeObserver(l),me.value.observe(M.value.parentNode)}be()}const s=e.computed(()=>{const{height:l,width:o}=H.value,{right:a}=H.value.paddingRatio,r=t.value.style.chart.padding.top,i=o-o*a,n=l-t.value.style.chart.padding.bottom,b=t.value.style.chart.padding.left,E=o-b-o*a,N=l-r-t.value.style.chart.padding.bottom;return{chartHeight:l,chartWidth:o,top:r,right:i,bottom:n,left:b,width:E,height:N<0?0:N}}),S=e.computed(()=>h.dataset.map((l,o)=>{const a=u.convertColorToHex(l.color)||He.value[o]||u.palette[o]||u.palette[o%u.palette.length];return{...l,series:JSON.parse(JSON.stringify(l.series)).map(r=>t.value.style.chart.bars.distributed?Math.abs(r):r),signedSeries:l.series.map(r=>r>=0?1:-1),absoluteIndex:o,id:u.createUid(),color:a}})),z=e.computed(()=>Math.max(...S.value.filter(l=>!f.value.includes(l.id)).map(l=>l.series.length))),c=e.ref({start:0,end:Math.max(...h.dataset.map(l=>l.series.length))});function ye(){be()}async function be(){(t.value.style.chart.zoom.startIndex!==null||t.value.style.chart.zoom.endIndex!==null)&&F.value?(t.value.style.chart.zoom.startIndex!==null&&(await e.nextTick(),await e.nextTick(),F.value&&F.value.setStartValue(t.value.style.chart.zoom.startIndex)),t.value.style.chart.zoom.endIndex!==null&&(await e.nextTick(),await e.nextTick(),F.value&&F.value.setEndValue(qe(t.value.style.chart.zoom.endIndex+1)))):(c.value={start:0,end:Math.max(...h.dataset.map(l=>l.series.length))},se.value+=1)}function qe(l){const o=Math.max(...h.dataset.map(a=>a.series.length));return l>o?o:l<0||t.value.style.chart.zoom.startIndex!==null&&l<t.value.style.chart.zoom.startIndex?t.value.style.chart.zoom.startIndex!==null?t.value.style.chart.zoom.startIndex+1:1:l}const d=e.computed(()=>{let l;return t.value.orientation==="vertical"?l=s.value.width/(c.value.end-c.value.start):l=s.value.height/(c.value.end-c.value.start),l<=0?0:l}),I=e.computed(()=>u.sumSeries(S.value.filter(l=>!f.value.includes(l.id))).slice(c.value.start,c.value.end)),Ue=e.computed(()=>u.sumSeries(S.value.filter(l=>!f.value.includes(l.id)).map(l=>({...l,series:l.series.map((o,a)=>l.signedSeries[a]===-1&&o>=0?-o:o)}))).slice(c.value.start,c.value.end)),q=e.computed(()=>{const l=S.value.filter(o=>!f.value.includes(o.id));return{positive:u.sumSeries(l.map(o=>({...o,series:o.series.slice(c.value.start,c.value.end).map(a=>a>=0?a:0)}))),negative:u.sumSeries(l.map(o=>({...o,series:o.series.slice(c.value.start,c.value.end).map(a=>a<0?a:0)})))}}),w=e.computed(()=>{const l=t.value.style.chart.grid.scale.scaleMax!==null&&!t.value.style.chart.bars.distributed?t.value.style.chart.grid.scale.scaleMax:Math.max(...q.value.positive),o=Math.min(...q.value.negative),a=t.value.style.chart.grid.scale.scaleMin!==null&&!t.value.style.chart.bars.distributed?t.value.style.chart.grid.scale.scaleMin:[-1/0,1/0,NaN,void 0,null].includes(o)?0:o,r=!t.value.style.chart.bars.distributed&&(t.value.style.chart.grid.scale.scaleMax!==null||t.value.style.chart.grid.scale.scaleMin!==null)?u.calculateNiceScaleWithExactExtremes(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks):u.calculateNiceScale(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks);return r.ticks.map(i=>({zero:s.value.bottom-s.value.height*(Math.abs(r.min)/(r.max+Math.abs(r.min))),y:s.value.bottom-s.value.height*((i+Math.abs(r.min))/(r.max+Math.abs(r.min))),x:s.value.left-8,horizontal_zero:s.value.left+s.value.width*(Math.abs(r.min)/(r.max+Math.abs(r.min))),horizontal_x:s.value.left+s.value.width*((i+Math.abs(r.min))/(r.max+Math.abs(r.min))),horizontal_y:s.value.bottom-8,value:i}))}),L=e.computed(()=>{const l=[];for(let o=0;o<z.value;o+=1)l.push({text:t.value.style.chart.grid.x.timeLabels.values[o]||String(o),absoluteIndex:o});return l.slice(c.value.start,c.value.end)}),g=e.computed(()=>{if(!T.value)return[];let l=Array(z.value).fill(0),o=Array(z.value).fill(0),a=Array(z.value).fill(0),r=Array(z.value).fill(0);const i=Math.max(...q.value.positive)||0,n=Math.min(...q.value.negative),b=[-1/0,1/0,NaN,void 0,null].includes(n)?0:n,E=!t.value.style.chart.bars.distributed&&(t.value.style.chart.grid.scale.scaleMax!==null||t.value.style.chart.grid.scale.scaleMin!==null)?u.calculateNiceScaleWithExactExtremes(t.value.style.chart.grid.scale.scaleMin!==null?t.value.style.chart.grid.scale.scaleMin:b>0?0:b,t.value.style.chart.grid.scale.scaleMax!==null?t.value.style.chart.grid.scale.scaleMax:i<0?0:i,t.value.style.chart.grid.scale.ticks):u.calculateNiceScale(t.value.style.chart.grid.scale.scaleMin!==null?t.value.style.chart.grid.scale.scaleMin:b>0?0:b,t.value.style.chart.grid.scale.scaleMax!==null?t.value.style.chart.grid.scale.scaleMax:i<0?0:i,t.value.style.chart.grid.scale.ticks),{min:N,max:O}=E,$=O+(N>=0?0:Math.abs(N))||1,p=s.value.height,X=s.value.width,Ne=w.value[0]?w.value[0].zero:s.value.bottom,$e=w.value[0]?w.value[0].horizontal_zero:s.value.left;return S.value.filter(R=>!f.value.includes(R.id)).map(R=>{const B=R.series.slice(c.value.start,c.value.end),Je=R.signedSeries.slice(c.value.start,c.value.end),Ze=B.map((v,m)=>s.value.left+d.value*m+d.value*t.value.style.chart.bars.gapRatio/4),Ke=B.map((v,m)=>s.value.top+d.value*m+d.value*t.value.style.chart.bars.gapRatio/4),Qe=B.map((v,m)=>{const k=t.value.style.chart.bars.distributed?(v||0)/I.value[m]:(v||0)/$;let V,x;return v>0?(x=p*k,V=Ne-x-l[m],l[m]+=x):(x=p*k,V=Ne+a[m],a[m]+=Math.abs(x)),V}),je=B.map((v,m)=>{const k=t.value.style.chart.bars.distributed?(v||0)/I.value[m]:(v||0)/$;let V,x;return v>0?(x=X*k,V=$e+o[m],o[m]+=x):(x=X*k,V=$e-Math.abs(x)-r[m],r[m]+=Math.abs(x)),V}),et=B.map((v,m)=>{const k=t.value.style.chart.bars.distributed?(v||0)/I.value[m]:(v||0)/$;return v>0?p*k:p*Math.abs(k)}),tt=B.map((v,m)=>{const k=t.value.style.chart.bars.distributed?(v||0)/I.value[m]:(v||0)/$;return v>0?X*k:X*Math.abs(k)}),at=B.map(v=>Math.abs(v)).reduce((v,m)=>v+m,0);return{...R,proportions:B.map((v,m)=>t.value.style.chart.bars.distributed?(v||0)/I.value[m]:(v||0)/at),series:B,signedSeries:Je,x:Ze,y:Qe,height:et,horizontal_width:tt,horizontal_y:Ke,horizontal_x:je}})}),fe=e.computed(()=>Ue.value.map((l,o)=>({value:l,sign:l>=0?1:-1})));function U(l,o,a,r,i){const n=i===-1&&l>=0?-l:l;return u.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,n,u.dataLabel({p:t.value.style.chart.bars.dataLabels.prefix,v:n,s:t.value.style.chart.bars.dataLabels.suffix,r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:o,seriesIndex:a,datapointIndex:r})}function pe(l,o,a,r){return u.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,l,u.dataLabel({v:isNaN(l)?0:l,s:"%",r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:o,seriesIndex:a,datapointIndex:r})}function ke(l){const o=JSON.parse(JSON.stringify(g.value)).map(a=>({name:a.name,value:a.series[l]===0?0:a.series[l]||null,proportion:a.proportions[l]||null,color:a.color,id:a.id}));J("selectDatapoint",{datapoint:o,period:L.value[l]})}function xe(l){P.value=l,D.value=!0;const o=t.value.style.chart.tooltip.customFormat,a=JSON.parse(JSON.stringify(g.value)).map(i=>({name:i.name,absoluteIndex:i.absoluteIndex,value:i.series[l]===0?0:(i.signedSeries[l]===-1&&i.series[l]>=0?-i.series[l]:i.series[l])||null,proportion:i.proportions[l]||null,color:i.color,id:i.id})),r=a.map(i=>Math.abs(i.value)).reduce((i,n)=>i+n,0);if(u.isFunction(o)&&u.functionReturnsString(()=>o({seriesIndex:l,datapoint:a,series:g.value,config:t.value})))Z.value=o({seriesIndex:l,datapoint:a,series:g.value,config:t.value});else{const{showValue:i,showPercentage:n,borderColor:b,roundingValue:E,roundingPercentage:N}=t.value.style.chart.tooltip;let O="";L.value[l]&&L.value[l].text&&t.value.style.chart.tooltip.showTimeLabel&&(O+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${b};padding-bottom:6px;margin-bottom:3px;">${L.value[l].text}</div>`);const $=[i&&n?"(":"",i&&n?")":""];a.reverse().forEach(p=>{O+=`
2
2
  <div style="display:flex;flex-direction:row;align-items:center;gap:4px">
3
3
  <svg viewBox="0 0 60 60" height="14" width="14"><rect rx="5" x="0" y="0" height="60" width="60" stroke="none" fill="${t.value.style.chart.bars.gradient.show?`url(#gradient_${p.id})`:p.color}"/>${Oe.pattern?`<rect rx="5" x="0" y="0" height="60" width="60" stroke="none" fill="url(#pattern_${C.value}_${p.absoluteIndex})"/>`:""}</svg>
4
4
  ${p.name}${i||n?":":""} ${i?u.dataLabel({p:t.value.style.chart.bars.dataLabels.prefix,v:p.value,s:t.value.style.chart.bars.dataLabels.suffix,r:E}):""} ${$[0]}${n?u.dataLabel({v:isNaN(p.value/r)?0:Math.abs(p.value)/r*100,s:"%",r:N}):""}${$[1]}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-Bmq5HB9y.cjs"),ae=require("./useResponsive-BJ7DTGpm.cjs"),be=require("./Title-x7Hmi2zb.cjs"),re=require("./usePrinter-Cf6Zct5m.cjs"),ge=require("./Tooltip-pA64woiQ.cjs"),ke=require("./DataTable-Cybmjq2W.cjs"),xe=require("./vue-ui-skeleton-D5890icn.cjs"),Ce=require("./Shape-QydDpcqr.cjs"),we=require("./vue-ui-accordion-WWblnzaJ.cjs"),se=require("./useNestedProp-CivZENAh.cjs"),Be=require("./PackageVersion-Bmro6-lR.cjs"),Se=require("./PenAndPaper-B7dv_ssy.cjs"),Ne=require("./useUserOptionState-BgepsfED.cjs"),$e=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),_e=["id"],Te=["xmlns","viewBox"],Le=["x","y","width","height"],Pe={key:1},Ee={key:0},Ae=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],ze={key:1},Ve=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],Oe=["x1","x2","y1","y2","stroke","stroke-width"],Fe=["x1","x2","y1","y2","stroke","stroke-width"],De=["x","y","fill","font-size"],Me=["x","y","font-size","fill"],We=["fill","font-size","transform"],Ie=["fill","font-size","x","y"],qe=["x1","x2","y1","y2","stroke"],Ge=["cx","cy","fill"],Ue=["cx","cy","fill"],Re=["id"],He=["stop-color"],je=["stop-color"],Xe=["stop-color"],Ye={key:0},Je=["x","y","font-size","fill"],Ke={key:5,class:"vue-data-ui-watermark"},Qe=["innerHTML"],Ze={__name:"vue-ui-strip-plot",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(ne,{expose:ue,emit:ie}){const{vue_ui_strip_plot:ce}=r.useConfig(),v=ne,ve=ie,p=e.computed({get(){return!!v.dataset&&v.dataset.length},set(l){return l}}),L=e.ref(r.createUid()),F=e.ref(0),P=e.ref(!1),E=e.ref(""),y=e.ref(null),D=e.ref(null),M=e.ref(null),W=e.ref(null),I=e.ref(!1),q=e.ref(0),G=e.ref(0),t=e.computed({get:()=>H(),set:l=>l}),{userOptionsVisible:A,setUserOptionsVisibility:U,keepUserOptionState:R}=Ne.useUserOptionState({config:t.value});function H(){const l=se.useNestedProp({userConfig:v.config,defaultConfig:ce});return l.theme?{...se.useNestedProp({userConfig:r.themes.vue_ui_strip_plot[l.theme]||v.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}e.watch(()=>v.config,l=>{t.value=H(),A.value=!t.value.userOptions.showOnChartHover,j(),q.value+=1,G.value+=1,c.value.dataLabels.show=t.value.style.chart.labels.bestPlotLabel.show,c.value.showTable=t.value.table.show,c.value.showTooltip=t.value.style.chart.tooltip.show},{deep:!0});const C=e.ref(null);e.onMounted(()=>{j()});function j(){if(r.objectIsEmpty(v.dataset)?r.error({componentName:"VueUiStripPlot",type:"dataset"}):v.dataset.forEach((l,s)=>{r.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","plots"]}).forEach(o=>{p.value=!1,r.error({componentName:"VueUiStripPlot",type:"datasetSerieAttribute",property:o,index:s})}),l.plots&&l.plots.forEach((o,n)=>{r.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name","value"]}).forEach(u=>{p.value=!1,r.error({componentName:"VueUiStripPlot",type:"datasetSerieAttribute",property:u,index:`${s},${n}`})})})}),t.value.responsive){const l=ae.throttle(()=>{const{width:s,height:o}=ae.useResponsive({chart:y.value,title:t.value.style.chart.title.text?D.value:null,source:M.value,noTitle:W.value});requestAnimationFrame(()=>{w.value=o,b.value.width=s,b.value.height=o,x.value=(s-d.value.left-d.value.right)/v.dataset.length,B.value=r.translateSize({relator:Math.min(o,s),adjuster:600,source:t.value.style.chart.plots.radius,threshold:6,fallback:6})})});C.value=new ResizeObserver(l),C.value.observe(y.value.parentNode)}I.value=!0,setTimeout(()=>{k.value=!1},he.value*50)}e.onBeforeUnmount(()=>{C.value&&C.value.disconnect()});const{isPrinting:X,isImaging:Y,generatePdf:J,generateImage:K}=re.usePrinter({elementId:`strip-plot_${L.value}`,fileName:t.value.style.chart.title.text||"vue-ui-strip-plot"}),de=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),Q=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),k=e.ref(t.value.useCssAnimation),c=e.ref({showTable:t.value.table.show,dataLabels:{show:t.value.style.chart.labels.bestPlotLabel.show},showTooltip:t.value.style.chart.tooltip.show}),d=e.ref({top:t.value.style.chart.padding.top,bottom:t.value.style.chart.padding.bottom,left:t.value.style.chart.padding.left,right:t.value.style.chart.padding.right}),x=e.ref(t.value.style.chart.stripWidth),w=e.ref(t.value.style.chart.height),B=e.ref(t.value.style.chart.plots.radius),b=e.ref({width:x.value*v.dataset.length+d.value.left+d.value.right,height:t.value.style.chart.height}),a=e.computed(()=>{const l=x.value*v.dataset.length+d.value.left+d.value.right;return{left:d.value.left,right:l-d.value.right,top:d.value.top,bottom:w.value-d.value.bottom,width:x.value*v.dataset.length,height:w.value-d.value.top-d.value.bottom,stripWidth:x.value,absoluteHeight:w.value,absoluteWidth:l}}),S=e.computed(()=>p.value?v.dataset.map((l,s)=>{const o=r.createUid();return{...l,id:o,color:l.color?r.convertColorToHex(l.color):Q.value[s]||r.palette[s]||r.palette[s%r.palette.length],plots:l.plots.map(n=>({...n,value:r.checkNaN(n.value),parentId:o,color:l.color?r.convertColorToHex(l.color):Q.value[s]||r.palette[s]||r.palette[s%r.palette.length],id:r.createUid()})).sort((n,u)=>n.value-u.value)}}):null),h=e.computed(()=>(S.value||[]).map((l,s)=>({...l,plots:l.plots.map(o=>({...o,x:a.value.left+(s+1)*a.value.stripWidth-a.value.stripWidth/2}))}))),he=e.computed(()=>Math.max(...h.value.map(l=>l.plots.length))),z=e.computed(()=>{const l=h.value.flatMap(s=>s.plots.map(o=>o.value));return{max:Math.max(...l),min:Math.min(...l)}}),m=e.computed(()=>r.calculateNiceScale(z.value.min<0?z.value.min:0,z.value.max,t.value.style.chart.grid.scaleSteps)),pe=e.computed(()=>(h.value||[]).map((l,s)=>({...l,plots:l.plots.map(o=>({...o,y:a.value.bottom-(o.value+Math.abs(m.value.min))/(m.value.max+Math.abs(m.value.min))*a.value.height}))}))),Z=e.computed(()=>m.value.ticks.map(l=>({y:a.value.bottom-a.value.height*((l+Math.abs(m.value.min))/(m.value.max+Math.abs(m.value.min))),x1:a.value.left,x2:a.value.right,value:l}))),V=e.ref(null),i=e.ref(null);function me({datapoint:l,seriesIndex:s}){V.value={datapoint:l,seriesIndex:s,config:t.value,series:S.value},P.value=!0,i.value=l;const o=t.value.style.chart.tooltip.customFormat;if(r.isFunction(o)&&r.functionReturnsString(()=>o({seriesIndex:s,datapoint:l,series:S.value,config:t.value})))E.value=o({seriesIndex:s,datapoint:l,series:S.value,config:t.value});else{let n="";n+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${t.value.style.chart.plots.gradient.show?`url(#${l.parentId})`:l.color}"/></svg>${l.name}</div>`,n+=`<div>${r.applyDataLabel(t.value.style.chart.labels.formatter,l.value,r.dataLabel({p:t.value.style.chart.labels.prefix,v:l.value,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:l,seriesIndex:s})}</div>`,E.value=`<div>${n}</div>`}}const N=e.computed(()=>{const l=h.value.flatMap(o=>JSON.parse(JSON.stringify(o.plots)).sort((n,u)=>u.value-n.value).map(n=>({name:`${o.name} - ${n.name}`,color:n.color}))),s=h.value.flatMap(o=>JSON.parse(JSON.stringify(o.plots)).sort((n,u)=>u.value-n.value).map(n=>n.value));return{head:l,body:s}});function ee(){e.nextTick(()=>{const l=N.value.head.map((n,u)=>[[n.name],[N.value.body[u]]]),s=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.series],[t.value.table.columnNames.value]]].concat(l),o=r.createCsvContent(s);r.downloadCsv({csvContent:o,title:t.value.style.chart.title.text||"vue-ui-strip-plot"})})}const $=e.computed(()=>{const l=[t.value.table.columnNames.series,t.value.table.columnNames.value],s=N.value.head.map((u,f)=>{const T=r.dataLabel({p:t.value.style.chart.labels.prefix,v:N.value.body[f],s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue});return[{color:u.color,name:u.name},T]}),o={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value],head:l,body:s,config:o}}),g=e.ref(!1);function fe(l){g.value=l,F.value+=1}function ye(){return h.value}function te(){c.value.showTable=!c.value.showTable}function le(){c.value.dataLabels.show=!c.value.dataLabels.show}function oe(){c.value.showTooltip=!c.value.showTooltip}const _=e.ref(!1);function O(){_.value=!_.value}return ue({getData:ye,generatePdf:J,generateCsv:ee,generateImage:K,toggleTable:te,toggleLabels:le,toggleTooltip:oe,toggleAnnotator:O}),(l,s)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"stripPlotChart",ref:y,class:e.normalizeClass(`vue-ui-strip-plot ${g.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height:100%":""}`),id:`strip-plot_${L.value}`,onMouseenter:s[2]||(s[2]=()=>e.unref(U)(!0)),onMouseleave:s[3]||(s[3]=()=>e.unref(U)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Se.PenAndPaper,{key:0,parent:y.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:_.value,onClose:O},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),de.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:W,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:D,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(be._sfc_main,{key:`title_${q.value}`,config:{title:{cy:"donut-div-title",...t.value.style.chart.title},subtitle:{cy:"donut-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&p.value&&(e.unref(R)||e.unref(A))?(e.openBlock(),e.createBlock(re.UserOptions,{ref:"details",key:`user_option_${F.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(X),isImaging:e.unref(Y),uid:L.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasLabel:t.value.userOptions.buttons.labels,hasFullscreen:t.value.userOptions.buttons.fullscreen,isTooltip:c.value.showTooltip,isFullscreen:g.value,titles:{...t.value.userOptions.buttonTitles},chartElement:y.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:_.value,onToggleFullscreen:fe,onGeneratePdf:e.unref(J),onGenerateCsv:ee,onGenerateImage:e.unref(K),onToggleTable:te,onToggleLabels:le,onToggleTooltip:oe,onToggleAnnotator:O,style:e.normalizeStyle({visibility:e.unref(R)?e.unref(A)?"visible":"hidden":"visible"})},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionLabels?{name:"optionLabels",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionLabels",{},void 0,!0)]),key:"5"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:n})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:n})),void 0,!0)]),key:"6"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:n})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:n})),void 0,!0)]),key:"7"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasLabel","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":g.value,"vue-data-ui-fulscreen--off":!g.value}),viewBox:`0 0 ${b.value.width<=0?10:b.value.width} ${b.value.height<=0?10:b.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color};`)},[e.createVNode(Be._sfc_main),l.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:a.value.left,y:a.value.top,width:a.value.width,height:a.value.height,style:{pointerEvents:"none"}},[e.renderSlot(l.$slots,"chart-background",{},void 0,!0)],8,Le)):e.createCommentVNode("",!0),t.value.style.chart.grid.show?(e.openBlock(),e.createElementBlock("g",Pe,[t.value.style.chart.grid.horizontalGrid.show?(e.openBlock(),e.createElementBlock("g",Ee,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Z.value,o=>(e.openBlock(),e.createElementBlock("line",{x1:o.x1,x2:o.x2,y1:o.y,y2:o.y,stroke:t.value.style.chart.grid.horizontalGrid.stroke,"stroke-width":t.value.style.chart.grid.horizontalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.horizontalGrid.strokeDasharray,"stroke-linecap":"round"},null,8,Ae))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.verticalGrid.show?(e.openBlock(),e.createElementBlock("g",ze,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,n)=>(e.openBlock(),e.createElementBlock("line",{x1:a.value.left+(n+1)*a.value.stripWidth,x2:a.value.left+(n+1)*a.value.stripWidth,y1:a.value.top,y2:a.value.bottom,stroke:t.value.style.chart.grid.verticalGrid.stroke,"stroke-width":t.value.style.chart.grid.verticalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.verticalGrid.strokeDasharray,"stroke-linecap":"round"},null,8,Ve))),256))])):e.createCommentVNode("",!0),e.createElementVNode("line",{x1:a.value.left,x2:a.value.left,y1:a.value.top,y2:a.value.bottom,stroke:t.value.style.chart.grid.stroke,"stroke-width":t.value.style.chart.grid.strokeWidth,"stroke-linecap":"round"},null,8,Oe),e.createElementVNode("line",{x1:a.value.left,x2:a.value.right,y1:a.value.bottom,y2:a.value.bottom,stroke:t.value.style.chart.grid.stroke,"stroke-width":t.value.style.chart.grid.strokeWidth,"stroke-linecap":"round"},null,8,Fe)])):e.createCommentVNode("",!0),t.value.style.chart.labels.yAxisLabels.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(Z.value,(o,n)=>(e.openBlock(),e.createElementBlock("text",{x:o.x1-t.value.style.chart.labels.yAxisLabels.fontSize/2+t.value.style.chart.labels.yAxisLabels.offsetX,y:o.y+t.value.style.chart.labels.yAxisLabels.fontSize/3,fill:t.value.style.chart.labels.yAxisLabels.color,"font-size":t.value.style.chart.labels.yAxisLabels.fontSize,"text-anchor":"end"},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.labels.formatter,o.value,e.unref(r.dataLabel)({p:t.value.style.chart.labels.prefix,v:o.value,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.labels.yAxisLabels.rounding}),{datapoint:o,seriesIndex:n})),9,De))),256)):e.createCommentVNode("",!0),t.value.style.chart.labels.xAxisLabels.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:3},e.renderList(h.value,(o,n)=>(e.openBlock(),e.createElementBlock("text",{x:a.value.left+(n+1)*a.value.stripWidth-a.value.stripWidth/2,y:a.value.bottom+t.value.style.chart.labels.xAxisLabels.fontSize*2+t.value.style.chart.labels.xAxisLabels.offsetY,"font-size":t.value.style.chart.labels.xAxisLabels.fontSize,fill:t.value.style.chart.labels.xAxisLabels.color,"text-anchor":"middle"},e.toDisplayString(o.name),9,Me))),256)):e.createCommentVNode("",!0),t.value.style.chart.labels.axis.yLabel?(e.openBlock(),e.createElementBlock("text",{key:4,fill:t.value.style.chart.labels.axis.color,"font-size":t.value.style.chart.labels.axis.fontSize,transform:`translate(${t.value.style.chart.labels.axis.fontSize+t.value.style.chart.labels.axis.yLabelOffsetX}, ${a.value.top+a.value.height/2}) rotate(-90)`,"text-anchor":"middle"},e.toDisplayString(t.value.style.chart.labels.axis.yLabel),9,We)):e.createCommentVNode("",!0),t.value.style.chart.labels.axis.xLabel?(e.openBlock(),e.createElementBlock("text",{key:5,fill:t.value.style.chart.labels.axis.color,"font-size":t.value.style.chart.labels.axis.fontSize,x:a.value.left+a.value.width/2,y:a.value.absoluteHeight,"text-anchor":"middle"},e.toDisplayString(t.value.style.chart.labels.axis.xLabel),9,Ie)):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:6},[e.createElementVNode("line",{x1:a.value.left,x2:a.value.right,y1:i.value.y,y2:i.value.y,stroke:i.value.color,"stroke-width":1,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,qe),e.createElementVNode("circle",{cx:a.value.left,cy:i.value.y,r:3,fill:i.value.color,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,Ge),e.createElementVNode("circle",{cx:a.value.right,cy:i.value.y,r:3,fill:i.value.color,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,Ue)],64)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,o=>(e.openBlock(),e.createElementBlock("radialGradient",{id:o.id,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(r.lightenHexColor)(o.color,t.value.style.chart.plots.gradient.intensity/100)},null,8,He),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(r.darkenHexColor)(o.color,.1)},null,8,je),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,Xe)],8,Re))),256))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pe.value,(o,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.plots,(u,f)=>(e.openBlock(),e.createBlock(Ce._sfc_main,e.mergeProps({plot:{x:u.x,y:I.value?u.y:a.value.top},radius:i.value&&i.value.id===u.id?B.value*1.5:B.value,shape:t.value.style.chart.plots.shape,stroke:t.value.style.chart.plots.stroke,strokeWidth:t.value.style.chart.plots.strokeWidth,color:t.value.style.chart.plots.gradient.show?`url(#${o.id})`:o.color,onMouseenter:T=>me({datapoint:u,seriesIndex:f}),onMouseleave:s[0]||(s[0]=T=>{P.value=!1,i.value=null}),onClick:T=>ve("selectDatapoint",u),style:`transition: all 0.2s ease-in-out; opacity:${i.value?i.value.id===u.id?1:.2:t.value.style.chart.plots.opacity};${k.value?`transition-delay:${f*50}ms`:""}`,class:{"vue-ui-strip-plot-animated":t.value.useCssAnimation&&k.value,"vue-ui-strip-plot-select-circle":t.value.useCssAnimation&&!k.value},ref_for:!0},l.$attrs),null,16,["plot","radius","shape","stroke","strokeWidth","color","onMouseenter","onClick","style","class"]))),256)),c.value.dataLabels.show?(e.openBlock(),e.createElementBlock("g",Ye,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.plots,(u,f)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[f===o.plots.length-1||i.value&&i.value.id===u.id&&!c.value.showTooltip?(e.openBlock(),e.createElementBlock("text",{key:0,x:u.x,y:u.y+t.value.style.chart.labels.bestPlotLabel.offsetY-B.value*(i.value&&i.value.id===u.id&&!c.value.showTooltip?2:1.5),"font-size":t.value.style.chart.labels.bestPlotLabel.fontSize,fill:t.value.style.chart.labels.bestPlotLabel.color,"text-anchor":"middle",style:e.normalizeStyle(`opacity:${t.value.useCssAnimation&&k.value?0:1};transition:opacity 0.2s ease-in;`)},e.toDisplayString(u.name)+" "+e.toDisplayString(t.value.style.chart.labels.bestPlotLabel.showValue?e.unref(r.applyDataLabel)(t.value.style.chart.labels.formatter,u.value,e.unref(r.dataLabel)({p:`(${t.value.style.chart.labels.prefix}`,v:u.value,s:`${t.value.style.chart.labels.suffix})`,r:t.value.style.chart.labels.bestPlotLabel.rounding}),{datapoint:u,seriesIndex:f}):""),13,Je)):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0)],64))),256)),e.renderSlot(l.$slots,"svg",{svg:a.value},void 0,!0)],14,Te)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ke,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(X)||e.unref(Y)})),void 0,!0)])):e.createCommentVNode("",!0),p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(xe.default,{key:6,config:{type:"stripPlot",style:{backgroundColor:t.value.style.chart.backgroundColor,stripPlot:{color:"#CCCCCC"}}}},null,8,["config"])),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:M,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(ge._sfc_main,{show:c.value.showTooltip&&P.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,fontSize:t.value.style.chart.tooltip.fontSize,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:y.value,content:E.value,isFullscreen:g.value,isCustom:e.unref(r.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...V.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...V.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isFullscreen","isCustom"]),p.value?(e.openBlock(),e.createBlock(we.default,{key:8,hideDetails:"",config:{open:c.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(ke.DataTable,{key:`table_${G.value}`,colNames:$.value.colNames,head:$.value.head,body:$.value.body,config:$.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:s[1]||(s[1]=o=>c.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,Qe)]),td:e.withCtx(({td:o})=>[e.createTextVNode(e.toDisplayString(o.name||o),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,_e))}},et=$e._export_sfc(Ze,[["__scopeId","data-v-319460c9"]]);exports.default=et;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-TsXfF4RW.cjs"),ae=require("./useResponsive-BJ7DTGpm.cjs"),be=require("./Title-IEvHjzFX.cjs"),re=require("./usePrinter-DqLdu0d8.cjs"),ge=require("./Tooltip-Ce3-d-Jl.cjs"),ke=require("./DataTable-o267EcsS.cjs"),xe=require("./vue-ui-skeleton-D3N7upHq.cjs"),Ce=require("./Shape-DQcajuPX.cjs"),we=require("./vue-ui-accordion-DQr01ula.cjs"),se=require("./useNestedProp-AmCRQ0Mq.cjs"),Be=require("./PackageVersion-GUCKUltM.cjs"),Se=require("./PenAndPaper-BFxCZMe_.cjs"),Ne=require("./useUserOptionState-BgepsfED.cjs"),$e=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),_e=["id"],Te=["xmlns","viewBox"],Le=["x","y","width","height"],Pe={key:1},Ee={key:0},Ae=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],ze={key:1},Ve=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],Oe=["x1","x2","y1","y2","stroke","stroke-width"],Fe=["x1","x2","y1","y2","stroke","stroke-width"],De=["x","y","fill","font-size"],Me=["x","y","font-size","fill"],We=["fill","font-size","transform"],Ie=["fill","font-size","x","y"],qe=["x1","x2","y1","y2","stroke"],Ge=["cx","cy","fill"],Ue=["cx","cy","fill"],Re=["id"],He=["stop-color"],je=["stop-color"],Xe=["stop-color"],Ye={key:0},Je=["x","y","font-size","fill"],Ke={key:5,class:"vue-data-ui-watermark"},Qe=["innerHTML"],Ze={__name:"vue-ui-strip-plot",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(ne,{expose:ue,emit:ie}){const{vue_ui_strip_plot:ce}=r.useConfig(),v=ne,ve=ie,p=e.computed({get(){return!!v.dataset&&v.dataset.length},set(l){return l}}),L=e.ref(r.createUid()),F=e.ref(0),P=e.ref(!1),E=e.ref(""),y=e.ref(null),D=e.ref(null),M=e.ref(null),W=e.ref(null),I=e.ref(!1),q=e.ref(0),G=e.ref(0),t=e.computed({get:()=>H(),set:l=>l}),{userOptionsVisible:A,setUserOptionsVisibility:U,keepUserOptionState:R}=Ne.useUserOptionState({config:t.value});function H(){const l=se.useNestedProp({userConfig:v.config,defaultConfig:ce});return l.theme?{...se.useNestedProp({userConfig:r.themes.vue_ui_strip_plot[l.theme]||v.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}e.watch(()=>v.config,l=>{t.value=H(),A.value=!t.value.userOptions.showOnChartHover,j(),q.value+=1,G.value+=1,c.value.dataLabels.show=t.value.style.chart.labels.bestPlotLabel.show,c.value.showTable=t.value.table.show,c.value.showTooltip=t.value.style.chart.tooltip.show},{deep:!0});const C=e.ref(null);e.onMounted(()=>{j()});function j(){if(r.objectIsEmpty(v.dataset)?r.error({componentName:"VueUiStripPlot",type:"dataset"}):v.dataset.forEach((l,s)=>{r.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","plots"]}).forEach(o=>{p.value=!1,r.error({componentName:"VueUiStripPlot",type:"datasetSerieAttribute",property:o,index:s})}),l.plots&&l.plots.forEach((o,n)=>{r.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name","value"]}).forEach(u=>{p.value=!1,r.error({componentName:"VueUiStripPlot",type:"datasetSerieAttribute",property:u,index:`${s},${n}`})})})}),t.value.responsive){const l=ae.throttle(()=>{const{width:s,height:o}=ae.useResponsive({chart:y.value,title:t.value.style.chart.title.text?D.value:null,source:M.value,noTitle:W.value});requestAnimationFrame(()=>{w.value=o,b.value.width=s,b.value.height=o,x.value=(s-d.value.left-d.value.right)/v.dataset.length,B.value=r.translateSize({relator:Math.min(o,s),adjuster:600,source:t.value.style.chart.plots.radius,threshold:6,fallback:6})})});C.value=new ResizeObserver(l),C.value.observe(y.value.parentNode)}I.value=!0,setTimeout(()=>{k.value=!1},he.value*50)}e.onBeforeUnmount(()=>{C.value&&C.value.disconnect()});const{isPrinting:X,isImaging:Y,generatePdf:J,generateImage:K}=re.usePrinter({elementId:`strip-plot_${L.value}`,fileName:t.value.style.chart.title.text||"vue-ui-strip-plot"}),de=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),Q=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),k=e.ref(t.value.useCssAnimation),c=e.ref({showTable:t.value.table.show,dataLabels:{show:t.value.style.chart.labels.bestPlotLabel.show},showTooltip:t.value.style.chart.tooltip.show}),d=e.ref({top:t.value.style.chart.padding.top,bottom:t.value.style.chart.padding.bottom,left:t.value.style.chart.padding.left,right:t.value.style.chart.padding.right}),x=e.ref(t.value.style.chart.stripWidth),w=e.ref(t.value.style.chart.height),B=e.ref(t.value.style.chart.plots.radius),b=e.ref({width:x.value*v.dataset.length+d.value.left+d.value.right,height:t.value.style.chart.height}),a=e.computed(()=>{const l=x.value*v.dataset.length+d.value.left+d.value.right;return{left:d.value.left,right:l-d.value.right,top:d.value.top,bottom:w.value-d.value.bottom,width:x.value*v.dataset.length,height:w.value-d.value.top-d.value.bottom,stripWidth:x.value,absoluteHeight:w.value,absoluteWidth:l}}),S=e.computed(()=>p.value?v.dataset.map((l,s)=>{const o=r.createUid();return{...l,id:o,color:l.color?r.convertColorToHex(l.color):Q.value[s]||r.palette[s]||r.palette[s%r.palette.length],plots:l.plots.map(n=>({...n,value:r.checkNaN(n.value),parentId:o,color:l.color?r.convertColorToHex(l.color):Q.value[s]||r.palette[s]||r.palette[s%r.palette.length],id:r.createUid()})).sort((n,u)=>n.value-u.value)}}):null),h=e.computed(()=>(S.value||[]).map((l,s)=>({...l,plots:l.plots.map(o=>({...o,x:a.value.left+(s+1)*a.value.stripWidth-a.value.stripWidth/2}))}))),he=e.computed(()=>Math.max(...h.value.map(l=>l.plots.length))),z=e.computed(()=>{const l=h.value.flatMap(s=>s.plots.map(o=>o.value));return{max:Math.max(...l),min:Math.min(...l)}}),m=e.computed(()=>r.calculateNiceScale(z.value.min<0?z.value.min:0,z.value.max,t.value.style.chart.grid.scaleSteps)),pe=e.computed(()=>(h.value||[]).map((l,s)=>({...l,plots:l.plots.map(o=>({...o,y:a.value.bottom-(o.value+Math.abs(m.value.min))/(m.value.max+Math.abs(m.value.min))*a.value.height}))}))),Z=e.computed(()=>m.value.ticks.map(l=>({y:a.value.bottom-a.value.height*((l+Math.abs(m.value.min))/(m.value.max+Math.abs(m.value.min))),x1:a.value.left,x2:a.value.right,value:l}))),V=e.ref(null),i=e.ref(null);function me({datapoint:l,seriesIndex:s}){V.value={datapoint:l,seriesIndex:s,config:t.value,series:S.value},P.value=!0,i.value=l;const o=t.value.style.chart.tooltip.customFormat;if(r.isFunction(o)&&r.functionReturnsString(()=>o({seriesIndex:s,datapoint:l,series:S.value,config:t.value})))E.value=o({seriesIndex:s,datapoint:l,series:S.value,config:t.value});else{let n="";n+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${t.value.style.chart.plots.gradient.show?`url(#${l.parentId})`:l.color}"/></svg>${l.name}</div>`,n+=`<div>${r.applyDataLabel(t.value.style.chart.labels.formatter,l.value,r.dataLabel({p:t.value.style.chart.labels.prefix,v:l.value,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:l,seriesIndex:s})}</div>`,E.value=`<div>${n}</div>`}}const N=e.computed(()=>{const l=h.value.flatMap(o=>JSON.parse(JSON.stringify(o.plots)).sort((n,u)=>u.value-n.value).map(n=>({name:`${o.name} - ${n.name}`,color:n.color}))),s=h.value.flatMap(o=>JSON.parse(JSON.stringify(o.plots)).sort((n,u)=>u.value-n.value).map(n=>n.value));return{head:l,body:s}});function ee(){e.nextTick(()=>{const l=N.value.head.map((n,u)=>[[n.name],[N.value.body[u]]]),s=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.series],[t.value.table.columnNames.value]]].concat(l),o=r.createCsvContent(s);r.downloadCsv({csvContent:o,title:t.value.style.chart.title.text||"vue-ui-strip-plot"})})}const $=e.computed(()=>{const l=[t.value.table.columnNames.series,t.value.table.columnNames.value],s=N.value.head.map((u,f)=>{const T=r.dataLabel({p:t.value.style.chart.labels.prefix,v:N.value.body[f],s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue});return[{color:u.color,name:u.name},T]}),o={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value],head:l,body:s,config:o}}),g=e.ref(!1);function fe(l){g.value=l,F.value+=1}function ye(){return h.value}function te(){c.value.showTable=!c.value.showTable}function le(){c.value.dataLabels.show=!c.value.dataLabels.show}function oe(){c.value.showTooltip=!c.value.showTooltip}const _=e.ref(!1);function O(){_.value=!_.value}return ue({getData:ye,generatePdf:J,generateCsv:ee,generateImage:K,toggleTable:te,toggleLabels:le,toggleTooltip:oe,toggleAnnotator:O}),(l,s)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"stripPlotChart",ref:y,class:e.normalizeClass(`vue-ui-strip-plot ${g.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height:100%":""}`),id:`strip-plot_${L.value}`,onMouseenter:s[2]||(s[2]=()=>e.unref(U)(!0)),onMouseleave:s[3]||(s[3]=()=>e.unref(U)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Se.PenAndPaper,{key:0,parent:y.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:_.value,onClose:O},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),de.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:W,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:D,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(be._sfc_main,{key:`title_${q.value}`,config:{title:{cy:"donut-div-title",...t.value.style.chart.title},subtitle:{cy:"donut-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&p.value&&(e.unref(R)||e.unref(A))?(e.openBlock(),e.createBlock(re.UserOptions,{ref:"details",key:`user_option_${F.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(X),isImaging:e.unref(Y),uid:L.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasLabel:t.value.userOptions.buttons.labels,hasFullscreen:t.value.userOptions.buttons.fullscreen,isTooltip:c.value.showTooltip,isFullscreen:g.value,titles:{...t.value.userOptions.buttonTitles},chartElement:y.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:_.value,onToggleFullscreen:fe,onGeneratePdf:e.unref(J),onGenerateCsv:ee,onGenerateImage:e.unref(K),onToggleTable:te,onToggleLabels:le,onToggleTooltip:oe,onToggleAnnotator:O,style:e.normalizeStyle({visibility:e.unref(R)?e.unref(A)?"visible":"hidden":"visible"})},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionLabels?{name:"optionLabels",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionLabels",{},void 0,!0)]),key:"5"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:n})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:n})),void 0,!0)]),key:"6"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:n})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:n})),void 0,!0)]),key:"7"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasLabel","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":g.value,"vue-data-ui-fulscreen--off":!g.value}),viewBox:`0 0 ${b.value.width<=0?10:b.value.width} ${b.value.height<=0?10:b.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color};`)},[e.createVNode(Be._sfc_main),l.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:a.value.left,y:a.value.top,width:a.value.width,height:a.value.height,style:{pointerEvents:"none"}},[e.renderSlot(l.$slots,"chart-background",{},void 0,!0)],8,Le)):e.createCommentVNode("",!0),t.value.style.chart.grid.show?(e.openBlock(),e.createElementBlock("g",Pe,[t.value.style.chart.grid.horizontalGrid.show?(e.openBlock(),e.createElementBlock("g",Ee,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Z.value,o=>(e.openBlock(),e.createElementBlock("line",{x1:o.x1,x2:o.x2,y1:o.y,y2:o.y,stroke:t.value.style.chart.grid.horizontalGrid.stroke,"stroke-width":t.value.style.chart.grid.horizontalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.horizontalGrid.strokeDasharray,"stroke-linecap":"round"},null,8,Ae))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.verticalGrid.show?(e.openBlock(),e.createElementBlock("g",ze,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,n)=>(e.openBlock(),e.createElementBlock("line",{x1:a.value.left+(n+1)*a.value.stripWidth,x2:a.value.left+(n+1)*a.value.stripWidth,y1:a.value.top,y2:a.value.bottom,stroke:t.value.style.chart.grid.verticalGrid.stroke,"stroke-width":t.value.style.chart.grid.verticalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.verticalGrid.strokeDasharray,"stroke-linecap":"round"},null,8,Ve))),256))])):e.createCommentVNode("",!0),e.createElementVNode("line",{x1:a.value.left,x2:a.value.left,y1:a.value.top,y2:a.value.bottom,stroke:t.value.style.chart.grid.stroke,"stroke-width":t.value.style.chart.grid.strokeWidth,"stroke-linecap":"round"},null,8,Oe),e.createElementVNode("line",{x1:a.value.left,x2:a.value.right,y1:a.value.bottom,y2:a.value.bottom,stroke:t.value.style.chart.grid.stroke,"stroke-width":t.value.style.chart.grid.strokeWidth,"stroke-linecap":"round"},null,8,Fe)])):e.createCommentVNode("",!0),t.value.style.chart.labels.yAxisLabels.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(Z.value,(o,n)=>(e.openBlock(),e.createElementBlock("text",{x:o.x1-t.value.style.chart.labels.yAxisLabels.fontSize/2+t.value.style.chart.labels.yAxisLabels.offsetX,y:o.y+t.value.style.chart.labels.yAxisLabels.fontSize/3,fill:t.value.style.chart.labels.yAxisLabels.color,"font-size":t.value.style.chart.labels.yAxisLabels.fontSize,"text-anchor":"end"},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.labels.formatter,o.value,e.unref(r.dataLabel)({p:t.value.style.chart.labels.prefix,v:o.value,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.labels.yAxisLabels.rounding}),{datapoint:o,seriesIndex:n})),9,De))),256)):e.createCommentVNode("",!0),t.value.style.chart.labels.xAxisLabels.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:3},e.renderList(h.value,(o,n)=>(e.openBlock(),e.createElementBlock("text",{x:a.value.left+(n+1)*a.value.stripWidth-a.value.stripWidth/2,y:a.value.bottom+t.value.style.chart.labels.xAxisLabels.fontSize*2+t.value.style.chart.labels.xAxisLabels.offsetY,"font-size":t.value.style.chart.labels.xAxisLabels.fontSize,fill:t.value.style.chart.labels.xAxisLabels.color,"text-anchor":"middle"},e.toDisplayString(o.name),9,Me))),256)):e.createCommentVNode("",!0),t.value.style.chart.labels.axis.yLabel?(e.openBlock(),e.createElementBlock("text",{key:4,fill:t.value.style.chart.labels.axis.color,"font-size":t.value.style.chart.labels.axis.fontSize,transform:`translate(${t.value.style.chart.labels.axis.fontSize+t.value.style.chart.labels.axis.yLabelOffsetX}, ${a.value.top+a.value.height/2}) rotate(-90)`,"text-anchor":"middle"},e.toDisplayString(t.value.style.chart.labels.axis.yLabel),9,We)):e.createCommentVNode("",!0),t.value.style.chart.labels.axis.xLabel?(e.openBlock(),e.createElementBlock("text",{key:5,fill:t.value.style.chart.labels.axis.color,"font-size":t.value.style.chart.labels.axis.fontSize,x:a.value.left+a.value.width/2,y:a.value.absoluteHeight,"text-anchor":"middle"},e.toDisplayString(t.value.style.chart.labels.axis.xLabel),9,Ie)):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:6},[e.createElementVNode("line",{x1:a.value.left,x2:a.value.right,y1:i.value.y,y2:i.value.y,stroke:i.value.color,"stroke-width":1,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,qe),e.createElementVNode("circle",{cx:a.value.left,cy:i.value.y,r:3,fill:i.value.color,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,Ge),e.createElementVNode("circle",{cx:a.value.right,cy:i.value.y,r:3,fill:i.value.color,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,Ue)],64)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,o=>(e.openBlock(),e.createElementBlock("radialGradient",{id:o.id,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(r.lightenHexColor)(o.color,t.value.style.chart.plots.gradient.intensity/100)},null,8,He),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(r.darkenHexColor)(o.color,.1)},null,8,je),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,Xe)],8,Re))),256))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pe.value,(o,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.plots,(u,f)=>(e.openBlock(),e.createBlock(Ce._sfc_main,e.mergeProps({plot:{x:u.x,y:I.value?u.y:a.value.top},radius:i.value&&i.value.id===u.id?B.value*1.5:B.value,shape:t.value.style.chart.plots.shape,stroke:t.value.style.chart.plots.stroke,strokeWidth:t.value.style.chart.plots.strokeWidth,color:t.value.style.chart.plots.gradient.show?`url(#${o.id})`:o.color,onMouseenter:T=>me({datapoint:u,seriesIndex:f}),onMouseleave:s[0]||(s[0]=T=>{P.value=!1,i.value=null}),onClick:T=>ve("selectDatapoint",u),style:`transition: all 0.2s ease-in-out; opacity:${i.value?i.value.id===u.id?1:.2:t.value.style.chart.plots.opacity};${k.value?`transition-delay:${f*50}ms`:""}`,class:{"vue-ui-strip-plot-animated":t.value.useCssAnimation&&k.value,"vue-ui-strip-plot-select-circle":t.value.useCssAnimation&&!k.value},ref_for:!0},l.$attrs),null,16,["plot","radius","shape","stroke","strokeWidth","color","onMouseenter","onClick","style","class"]))),256)),c.value.dataLabels.show?(e.openBlock(),e.createElementBlock("g",Ye,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.plots,(u,f)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[f===o.plots.length-1||i.value&&i.value.id===u.id&&!c.value.showTooltip?(e.openBlock(),e.createElementBlock("text",{key:0,x:u.x,y:u.y+t.value.style.chart.labels.bestPlotLabel.offsetY-B.value*(i.value&&i.value.id===u.id&&!c.value.showTooltip?2:1.5),"font-size":t.value.style.chart.labels.bestPlotLabel.fontSize,fill:t.value.style.chart.labels.bestPlotLabel.color,"text-anchor":"middle",style:e.normalizeStyle(`opacity:${t.value.useCssAnimation&&k.value?0:1};transition:opacity 0.2s ease-in;`)},e.toDisplayString(u.name)+" "+e.toDisplayString(t.value.style.chart.labels.bestPlotLabel.showValue?e.unref(r.applyDataLabel)(t.value.style.chart.labels.formatter,u.value,e.unref(r.dataLabel)({p:`(${t.value.style.chart.labels.prefix}`,v:u.value,s:`${t.value.style.chart.labels.suffix})`,r:t.value.style.chart.labels.bestPlotLabel.rounding}),{datapoint:u,seriesIndex:f}):""),13,Je)):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0)],64))),256)),e.renderSlot(l.$slots,"svg",{svg:a.value},void 0,!0)],14,Te)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ke,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(X)||e.unref(Y)})),void 0,!0)])):e.createCommentVNode("",!0),p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(xe.default,{key:6,config:{type:"stripPlot",style:{backgroundColor:t.value.style.chart.backgroundColor,stripPlot:{color:"#CCCCCC"}}}},null,8,["config"])),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:M,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(ge._sfc_main,{show:c.value.showTooltip&&P.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,fontSize:t.value.style.chart.tooltip.fontSize,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:y.value,content:E.value,isFullscreen:g.value,isCustom:e.unref(r.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...V.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...V.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isFullscreen","isCustom"]),p.value?(e.openBlock(),e.createBlock(we.default,{key:8,hideDetails:"",config:{open:c.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(ke.DataTable,{key:`table_${G.value}`,colNames:$.value.colNames,head:$.value.head,body:$.value.body,config:$.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:s[1]||(s[1]=o=>c.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,Qe)]),td:e.withCtx(({td:o})=>[e.createTextVNode(e.toDisplayString(o.name||o),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,_e))}},et=$e._export_sfc(Ze,[["__scopeId","data-v-319460c9"]]);exports.default=et;
@@ -1,16 +1,16 @@
1
1
  import { computed as p, ref as n, watch as Ue, onMounted as Ve, onBeforeUnmount as Ee, createElementBlock as u, openBlock as s, unref as v, normalizeStyle as B, normalizeClass as F, createBlock as T, createCommentVNode as c, createVNode as $e, createSlots as He, withCtx as f, renderSlot as y, normalizeProps as M, guardReactiveProps as W, createElementVNode as k, Fragment as g, renderList as w, toDisplayString as L, mergeProps as Re, createTextVNode as Be, nextTick as Xe } from "vue";
2
- import { u as je, c as ee, t as Ye, p as A, a as qe, o as Je, e as te, g as _e, b as Ke, d as Te, v as Qe, D as Ze, f as X, X as et, i as le, l as tt, h as lt, x as Le, F as at, q as ot, r as st, y as rt } from "./index-B8uVRkA1.js";
2
+ import { u as je, c as ee, t as Ye, p as A, a as qe, o as Je, e as te, g as _e, b as Ke, d as Te, v as Qe, D as Ze, f as X, X as et, i as le, l as tt, h as lt, x as Le, F as at, q as ot, r as st, y as rt } from "./index-Sq6_Z5Ol.js";
3
3
  import { t as ut, u as it } from "./useResponsive-CoxXLe23.js";
4
- import { _ as nt } from "./Title-MKfkLka7.js";
5
- import { u as vt, U as ct } from "./usePrinter-CppD6oY_.js";
6
- import { _ as ht } from "./Tooltip-BUMgVEu0.js";
7
- import { D as dt } from "./DataTable-BWABkdIL.js";
8
- import pt from "./vue-ui-skeleton-BC7kQhlE.js";
9
- import { _ as yt } from "./Shape-D_MGNYEa.js";
10
- import ft from "./vue-ui-accordion-CE2Pnpz3.js";
11
- import { u as Ae } from "./useNestedProp-kStEZqtl.js";
12
- import { _ as bt } from "./PackageVersion-Dqo8V-i_.js";
13
- import { P as mt } from "./PenAndPaper-QsaleY3R.js";
4
+ import { _ as nt } from "./Title-BrlBOQMX.js";
5
+ import { u as vt, U as ct } from "./usePrinter-KhQnrZzM.js";
6
+ import { _ as ht } from "./Tooltip-2BVEpShN.js";
7
+ import { D as dt } from "./DataTable-g-vVSX5e.js";
8
+ import pt from "./vue-ui-skeleton-DhEZVP4j.js";
9
+ import { _ as yt } from "./Shape-BQwPhaQ2.js";
10
+ import ft from "./vue-ui-accordion-Cs3dJ86t.js";
11
+ import { u as Ae } from "./useNestedProp-BmjPdxME.js";
12
+ import { _ as bt } from "./PackageVersion-koLOUagZ.js";
13
+ import { P as mt } from "./PenAndPaper-NARoVmb-.js";
14
14
  import { u as gt } from "./useUserOptionState-BIvW1Kz7.js";
15
15
  import { _ as kt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
16
16
  const xt = ["id"], wt = ["xmlns", "viewBox"], Ct = ["x", "y", "width", "height"], $t = { key: 1 }, _t = { key: 0 }, Tt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], Lt = { key: 1 }, At = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], Pt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], St = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Ot = ["x", "y", "fill", "font-size"], zt = ["x", "y", "font-size", "fill"], Nt = ["fill", "font-size", "transform"], Ft = ["fill", "font-size", "x", "y"], Mt = ["x1", "x2", "y1", "y2", "stroke"], Wt = ["cx", "cy", "fill"], It = ["cx", "cy", "fill"], Dt = ["id"], Gt = ["stop-color"], Ut = ["stop-color"], Vt = ["stop-color"], Et = { key: 0 }, Ht = ["x", "y", "font-size", "fill"], Rt = {
@@ -1,4 +1,4 @@
1
- import { a1 as A, r as D, q as x, z as G, d as M, m as T, A as E, u as z, p as B } from "./index-B8uVRkA1.js";
1
+ import { a1 as A, r as D, q as x, z as G, d as M, m as T, A as E, u as z, p as B } from "./index-Sq6_Z5Ol.js";
2
2
  import { createElementBlock as i, openBlock as c, normalizeStyle as g, createElementVNode as a, createCommentVNode as N, toDisplayString as u, Fragment as b, renderList as C, normalizeClass as f, createTextVNode as F, withDirectives as v, vModelText as p, withKeys as w, withModifiers as S, vModelSelect as H, createStaticVNode as P } from "vue";
3
3
  import { _ as R } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
4
  const U = {
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./index-Bmq5HB9y.cjs"),e=require("vue"),p=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),b={name:"vue-ui-table",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},data(){return{uid:`vue-ui-table-${Math.random()}`,bodyCopy:JSON.parse(JSON.stringify(this.dataset.body)).map((n,o)=>({...n,absoluteIndex:o})),buttonTimeout:null,canMoveChart:!1,chart:{height:316,type:"bar",width:512},constants:{ASC:1,BAR:"bar",DATE:"date",DESC:-1,DONUT:"donut",LINE:"line",NUMERIC:"numeric",PERCENTAGE:"percentage",TEXT:"text"},clientX:100,clientY:100,cssClass:{CELL:"smart-td-selected",FIRST_TD:"smart-td-selected-first",LAST_TD:"smart-td-selected-last",ROW:"smart-td-selected-neighbor"},currentDonut:void 0,currentFilter:void 0,currentSearch:void 0,currentSelectionSpan:{col:void 0,rows:[]},currentPage:0,dates:{},filteredDatesIndexes:{},hasNaN:{},iconColor:"#2D353C",iconSize:20,immutableRangeFilters:{},isExportRequest:!1,isLoading:!1,itemsPerPage:this.config.rowsPerPage?this.config.rowsPerPage:25,multiselects:{},paginatorOptions:[...new Set([10,25,50,100,250,500,this.config.rowsPerPage?this.config.rowsPerPage:25,this.dataset.body.length])].sort((n,o)=>n-o),palette:m.palette,percentages:{},rafId:null,rangeFilters:{},searches:{},selectedColumn:void 0,selectedDonutCategory:void 0,selectedPlot:void 0,showChart:!1,showDonutOptions:!1,sorts:{},tableBody:JSON.parse(JSON.stringify(this.dataset.body)).map((n,o)=>({...n,absoluteIndex:o})),tableHead:JSON.parse(JSON.stringify(this.dataset.header)).map(n=>({average:Object.hasOwn(n,"average")?n.average:!1,decimals:Object.hasOwn(n,"decimals")?n.decimals:0,isMultiselect:Object.hasOwn(n,"isMultiselect")?n.isMultiselect:!1,isPercentage:Object.hasOwn(n,"isPercentage")?n.isPercentage:!1,isSearch:Object.hasOwn(n,"isSearch")?n.isSearch:!1,isSort:Object.hasOwn(n,"isSort")?n.isSort:!1,name:n.name,percentageTo:Object.hasOwn(n,"percentageTo")?n.percentageTo:void 0,prefix:Object.hasOwn(n,"prefix")?n.prefix:"",rangeFilter:Object.hasOwn(n,"rangeFilter")?n.rangeFilter:!1,suffix:Object.hasOwn(n,"suffix")?n.suffix:"",sum:Object.hasOwn(n,"sum")?n.sum:!1,type:n.type}))}},mounted(){if(this.dataset.header.length===0)throw new Error(`vue-ui-table error: missing header data.
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./index-TsXfF4RW.cjs"),e=require("vue"),p=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),b={name:"vue-ui-table",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},data(){return{uid:`vue-ui-table-${Math.random()}`,bodyCopy:JSON.parse(JSON.stringify(this.dataset.body)).map((n,o)=>({...n,absoluteIndex:o})),buttonTimeout:null,canMoveChart:!1,chart:{height:316,type:"bar",width:512},constants:{ASC:1,BAR:"bar",DATE:"date",DESC:-1,DONUT:"donut",LINE:"line",NUMERIC:"numeric",PERCENTAGE:"percentage",TEXT:"text"},clientX:100,clientY:100,cssClass:{CELL:"smart-td-selected",FIRST_TD:"smart-td-selected-first",LAST_TD:"smart-td-selected-last",ROW:"smart-td-selected-neighbor"},currentDonut:void 0,currentFilter:void 0,currentSearch:void 0,currentSelectionSpan:{col:void 0,rows:[]},currentPage:0,dates:{},filteredDatesIndexes:{},hasNaN:{},iconColor:"#2D353C",iconSize:20,immutableRangeFilters:{},isExportRequest:!1,isLoading:!1,itemsPerPage:this.config.rowsPerPage?this.config.rowsPerPage:25,multiselects:{},paginatorOptions:[...new Set([10,25,50,100,250,500,this.config.rowsPerPage?this.config.rowsPerPage:25,this.dataset.body.length])].sort((n,o)=>n-o),palette:m.palette,percentages:{},rafId:null,rangeFilters:{},searches:{},selectedColumn:void 0,selectedDonutCategory:void 0,selectedPlot:void 0,showChart:!1,showDonutOptions:!1,sorts:{},tableBody:JSON.parse(JSON.stringify(this.dataset.body)).map((n,o)=>({...n,absoluteIndex:o})),tableHead:JSON.parse(JSON.stringify(this.dataset.header)).map(n=>({average:Object.hasOwn(n,"average")?n.average:!1,decimals:Object.hasOwn(n,"decimals")?n.decimals:0,isMultiselect:Object.hasOwn(n,"isMultiselect")?n.isMultiselect:!1,isPercentage:Object.hasOwn(n,"isPercentage")?n.isPercentage:!1,isSearch:Object.hasOwn(n,"isSearch")?n.isSearch:!1,isSort:Object.hasOwn(n,"isSort")?n.isSort:!1,name:n.name,percentageTo:Object.hasOwn(n,"percentageTo")?n.percentageTo:void 0,prefix:Object.hasOwn(n,"prefix")?n.prefix:"",rangeFilter:Object.hasOwn(n,"rangeFilter")?n.rangeFilter:!1,suffix:Object.hasOwn(n,"suffix")?n.suffix:"",sum:Object.hasOwn(n,"sum")?n.sum:!1,type:n.type}))}},mounted(){if(this.dataset.header.length===0)throw new Error(`vue-ui-table error: missing header data.
2
2
  Provide an array of objects of type:
3
3
  {
4
4
  name: string;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-Bmq5HB9y.cjs"),$=require("./useNestedProp-CivZENAh.cjs"),w=require("./usePrinter-Cf6Zct5m.cjs"),q=require("./Shape-QydDpcqr.cjs"),G=require("./useUserOptionState-BgepsfED.cjs"),H=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),L=["id"],A={role:"cell"},D={role:"row"},X=["data-cell"],W={key:0,style:{display:"flex","flex-direction":"row",gap:"2px","align-items":"center"}},J=["height","width"],K={key:0,role:"cell","data-cell":"sum"},Q={key:1,role:"cell","data-cell":"average"},Y={key:2,role:"cell","data-cell":"median"},Z={key:1,ref:"source",dir:"auto"},j={__name:"vue-ui-table-heatmap",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(N,{expose:P}){e.useCssVars(t=>({"6c961fe4":T.value,"69a6902e":R.value}));const{vue_ui_table_heatmap:E}=a.useConfig(),d=N,p=e.ref(a.createUid()),s=e.ref(!1),c=e.ref(null),m=e.ref(!1),f=e.ref(0),V=e.useSlots();e.onMounted(()=>{V["chart-background"]&&console.warn("VueUiTableHeatmap does not support the #chart-background slot.")});const o=e.computed({get:()=>b(),set:t=>t}),{userOptionsVisible:v,setUserOptionsVisibility:g,keepUserOptionState:h}=G.useUserOptionState({config:o.value});function b(){const t=$.useNestedProp({userConfig:d.config,defaultConfig:E});return t.theme?{...$.useNestedProp({userConfig:a.themes.vue_ui_table_heatmap[t.theme]||d.config,defaultConfig:t})}:t}e.watch(()=>d.config,t=>{o.value=b(),v.value=!o.value.userOptions.showOnChartHover,C()},{deep:!0});const{isPrinting:x,isImaging:O,generatePdf:y,generateImage:k}=w.usePrinter({elementId:`table_heatmap_${p.value}`,fileName:"vue-ui-table-heatmap"}),F=e.computed(()=>o.value.table.responsiveBreakpoint),z=e.computed(()=>!!d.dataset&&d.dataset.length);e.onMounted(()=>{C()});function C(){a.objectIsEmpty(d.dataset)&&a.error({componentName:"VueUiTableHeatmap",type:"dataset"});const t=new ResizeObserver(r=>{r.forEach(n=>{s.value=n.contentRect.width<F.value})});c.value&&t.observe(c.value)}const _=e.computed(()=>d.dataset.map(t=>{const r=t.values.map(l=>isNaN(l)?0:l),n=r.reduce((l,i)=>l+i,0);return{...t,values:r,serieExtremes:{max:Math.max(...r),min:Math.min(...r)},sum:n,average:n/r.length,median:a.calcMedian(r),displayValues:[t.name,...t.values],id:a.createUid()}})),B=e.computed(()=>{const t=_.value.flatMap(r=>r.values);return{min:Math.min(...t),max:Math.max(...t)}});function M(t,r){const n=o.value.style.heatmapColors.useIndividualScale;return a.interpolateColorHex(o.value.style.heatmapColors.min,o.value.style.heatmapColors.max,n?r.min:B.value.min,n?r.max:B.value.max,t)}const I=e.computed(()=>_.value.map(t=>({...t,colors:t.displayValues.map(r=>isNaN(r)?o.value.style.backgroundColor:M(r,t.serieExtremes))}))),R=e.computed(()=>o.value.style.backgroundColor),T=e.computed(()=>`${o.value.table.borderWidth}px`);function S(){e.nextTick(()=>{const t=I.value.map(l=>[[l.name],l.displayValues,[l.sum],[l.average],[l.median]]),r=[[[""],o.value.table.head.values,["sum"],["average"],["median"]]].concat(t),n=a.createCsvContent(r);a.downloadCsv({csvContent:n,title:"vue-ui-table-heatmap"})})}function U(t){m.value=t,f.value+=1}return P({generatePdf:y,generateCsv:S,generateImage:k}),(t,r)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tableContainer",ref:c,style:e.normalizeStyle(`width:100%; overflow-x:auto; container-type: inline-size;padding-top:${o.value.userOptions.show?"36px":""}; ${m.value?"vue-data-ui-wrapper-fullscreen":""}; position:relative;`),class:e.normalizeClass({"vue-ui-responsive":s.value}),id:`table_heatmap_${p.value}`,onMouseenter:r[0]||(r[0]=()=>e.unref(g)(!0)),onMouseleave:r[1]||(r[1]=()=>e.unref(g)(!1))},[o.value.userOptions.show&&z.value&&(e.unref(h)||e.unref(v))?(e.openBlock(),e.createBlock(w.UserOptions,{ref:"details",key:`user_option_${f.value}`,backgroundColor:o.value.style.backgroundColor,color:o.value.style.color,isPrinting:e.unref(x),isImaging:e.unref(O),uid:p.value,hasPdf:o.value.userOptions.buttons.pdf,hasXls:o.value.userOptions.buttons.csv,hasImg:o.value.userOptions.buttons.img,hasFullscreen:o.value.userOptions.buttons.fullscreen,isFullscreen:m.value,titles:{...o.value.userOptions.buttonTitles},chartElement:c.value,position:o.value.userOptions.position,onToggleFullscreen:U,onGeneratePdf:e.unref(y),onGenerateCsv:S,onGenerateImage:e.unref(k),style:e.normalizeStyle({visibility:e.unref(h)?e.unref(v)?"visible":"hidden":"visible"})},e.createSlots({_:2},[t.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,t.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,t.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,t.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:n,isFullscreen:l})=>[e.renderSlot(t.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:n,isFullscreen:l})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),e.createElementVNode("table",{class:e.normalizeClass({"vue-ui-table-heatmap":!0}),style:e.normalizeStyle(`width:100%;font-family:${o.value.style.fontFamily};background:${o.value.style.backgroundColor};`)},[e.createElementVNode("caption",null,[e.renderSlot(t.$slots,"caption",{},void 0,!0)]),e.createElementVNode("thead",null,[e.createElementVNode("tr",{role:"row",style:e.normalizeStyle(`background:${o.value.table.head.backgroundColor};color:${o.value.table.head.color}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value.table.head.values,(n,l)=>(e.openBlock(),e.createElementBlock("th",A,[e.renderSlot(t.$slots,"head",e.mergeProps({ref_for:!0},{value:n,rowIndex:l,type:typeof n,isResponsive:s.value}),void 0,!0)]))),256))],4)]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.value,(n,l)=>(e.openBlock(),e.createElementBlock("tr",D,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.displayValues,(i,u)=>(e.openBlock(),e.createElementBlock("td",{role:"cell","data-cell":o.value.table.head.values[u]},[n.color&&u===0?(e.openBlock(),e.createElementBlock("div",W,[n.color?(e.openBlock(),e.createElementBlock("svg",{key:0,height:o.value.style.shapeSize,width:o.value.style.shapeSize,viewBox:"0 0 20 20",style:{background:"none",overflow:"visible"}},[e.createVNode(q._sfc_main,{plot:{x:10,y:10},color:n.color,radius:9,shape:n.shape||"circle"},null,8,["color","shape"])],8,J)):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"rowTitle",e.mergeProps({ref_for:!0},{value:i,rowIndex:l,colIndex:u,type:typeof i,isResponsive:s.value}),void 0,!0)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[u===0?e.renderSlot(t.$slots,"rowTitle",e.mergeProps({key:0,ref_for:!0},{value:i,rowIndex:l,colIndex:u,type:typeof i,isResponsive:s.value}),void 0,!0):e.createCommentVNode("",!0),u>0?e.renderSlot(t.$slots,"cell",e.mergeProps({key:1,ref_for:!0},{value:i,rowIndex:l,colIndex:u,type:typeof i,isResponsive:s.value,color:n.colors[u],textColor:e.unref(a.adaptColorToBackground)(n.colors[u])}),void 0,!0):e.createCommentVNode("",!0)],64))],8,X))),256)),o.value.table.showSum?(e.openBlock(),e.createElementBlock("td",K,[e.renderSlot(t.$slots,"sum",e.mergeProps({ref_for:!0},{value:n.sum,rowIndex:l,isResponsive:s.value}),void 0,!0)])):e.createCommentVNode("",!0),o.value.table.showAverage?(e.openBlock(),e.createElementBlock("td",Q,[e.renderSlot(t.$slots,"average",e.mergeProps({ref_for:!0},{value:n.average,rowIndex:l,isResponsive:s.value}),void 0,!0)])):e.createCommentVNode("",!0),o.value.table.showMedian?(e.openBlock(),e.createElementBlock("td",Y,[e.renderSlot(t.$slots,"median",e.mergeProps({ref_for:!0},{value:n.median,rowIndex:l,isResponsive:s.value}),void 0,!0)])):e.createCommentVNode("",!0)]))),256))])],4),t.$slots.source?(e.openBlock(),e.createElementBlock("div",Z,[e.renderSlot(t.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0)],46,L))}},ee=H._export_sfc(j,[["__scopeId","data-v-9642b9bf"]]);exports.default=ee;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-TsXfF4RW.cjs"),$=require("./useNestedProp-AmCRQ0Mq.cjs"),w=require("./usePrinter-DqLdu0d8.cjs"),q=require("./Shape-DQcajuPX.cjs"),G=require("./useUserOptionState-BgepsfED.cjs"),H=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),L=["id"],A={role:"cell"},D={role:"row"},X=["data-cell"],W={key:0,style:{display:"flex","flex-direction":"row",gap:"2px","align-items":"center"}},J=["height","width"],K={key:0,role:"cell","data-cell":"sum"},Q={key:1,role:"cell","data-cell":"average"},Y={key:2,role:"cell","data-cell":"median"},Z={key:1,ref:"source",dir:"auto"},j={__name:"vue-ui-table-heatmap",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(N,{expose:P}){e.useCssVars(t=>({"6c961fe4":T.value,"69a6902e":R.value}));const{vue_ui_table_heatmap:E}=a.useConfig(),d=N,p=e.ref(a.createUid()),s=e.ref(!1),c=e.ref(null),m=e.ref(!1),f=e.ref(0),V=e.useSlots();e.onMounted(()=>{V["chart-background"]&&console.warn("VueUiTableHeatmap does not support the #chart-background slot.")});const o=e.computed({get:()=>b(),set:t=>t}),{userOptionsVisible:v,setUserOptionsVisibility:g,keepUserOptionState:h}=G.useUserOptionState({config:o.value});function b(){const t=$.useNestedProp({userConfig:d.config,defaultConfig:E});return t.theme?{...$.useNestedProp({userConfig:a.themes.vue_ui_table_heatmap[t.theme]||d.config,defaultConfig:t})}:t}e.watch(()=>d.config,t=>{o.value=b(),v.value=!o.value.userOptions.showOnChartHover,C()},{deep:!0});const{isPrinting:x,isImaging:O,generatePdf:y,generateImage:k}=w.usePrinter({elementId:`table_heatmap_${p.value}`,fileName:"vue-ui-table-heatmap"}),F=e.computed(()=>o.value.table.responsiveBreakpoint),z=e.computed(()=>!!d.dataset&&d.dataset.length);e.onMounted(()=>{C()});function C(){a.objectIsEmpty(d.dataset)&&a.error({componentName:"VueUiTableHeatmap",type:"dataset"});const t=new ResizeObserver(r=>{r.forEach(n=>{s.value=n.contentRect.width<F.value})});c.value&&t.observe(c.value)}const _=e.computed(()=>d.dataset.map(t=>{const r=t.values.map(l=>isNaN(l)?0:l),n=r.reduce((l,i)=>l+i,0);return{...t,values:r,serieExtremes:{max:Math.max(...r),min:Math.min(...r)},sum:n,average:n/r.length,median:a.calcMedian(r),displayValues:[t.name,...t.values],id:a.createUid()}})),B=e.computed(()=>{const t=_.value.flatMap(r=>r.values);return{min:Math.min(...t),max:Math.max(...t)}});function M(t,r){const n=o.value.style.heatmapColors.useIndividualScale;return a.interpolateColorHex(o.value.style.heatmapColors.min,o.value.style.heatmapColors.max,n?r.min:B.value.min,n?r.max:B.value.max,t)}const I=e.computed(()=>_.value.map(t=>({...t,colors:t.displayValues.map(r=>isNaN(r)?o.value.style.backgroundColor:M(r,t.serieExtremes))}))),R=e.computed(()=>o.value.style.backgroundColor),T=e.computed(()=>`${o.value.table.borderWidth}px`);function S(){e.nextTick(()=>{const t=I.value.map(l=>[[l.name],l.displayValues,[l.sum],[l.average],[l.median]]),r=[[[""],o.value.table.head.values,["sum"],["average"],["median"]]].concat(t),n=a.createCsvContent(r);a.downloadCsv({csvContent:n,title:"vue-ui-table-heatmap"})})}function U(t){m.value=t,f.value+=1}return P({generatePdf:y,generateCsv:S,generateImage:k}),(t,r)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tableContainer",ref:c,style:e.normalizeStyle(`width:100%; overflow-x:auto; container-type: inline-size;padding-top:${o.value.userOptions.show?"36px":""}; ${m.value?"vue-data-ui-wrapper-fullscreen":""}; position:relative;`),class:e.normalizeClass({"vue-ui-responsive":s.value}),id:`table_heatmap_${p.value}`,onMouseenter:r[0]||(r[0]=()=>e.unref(g)(!0)),onMouseleave:r[1]||(r[1]=()=>e.unref(g)(!1))},[o.value.userOptions.show&&z.value&&(e.unref(h)||e.unref(v))?(e.openBlock(),e.createBlock(w.UserOptions,{ref:"details",key:`user_option_${f.value}`,backgroundColor:o.value.style.backgroundColor,color:o.value.style.color,isPrinting:e.unref(x),isImaging:e.unref(O),uid:p.value,hasPdf:o.value.userOptions.buttons.pdf,hasXls:o.value.userOptions.buttons.csv,hasImg:o.value.userOptions.buttons.img,hasFullscreen:o.value.userOptions.buttons.fullscreen,isFullscreen:m.value,titles:{...o.value.userOptions.buttonTitles},chartElement:c.value,position:o.value.userOptions.position,onToggleFullscreen:U,onGeneratePdf:e.unref(y),onGenerateCsv:S,onGenerateImage:e.unref(k),style:e.normalizeStyle({visibility:e.unref(h)?e.unref(v)?"visible":"hidden":"visible"})},e.createSlots({_:2},[t.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,t.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,t.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,t.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:n,isFullscreen:l})=>[e.renderSlot(t.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:n,isFullscreen:l})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),e.createElementVNode("table",{class:e.normalizeClass({"vue-ui-table-heatmap":!0}),style:e.normalizeStyle(`width:100%;font-family:${o.value.style.fontFamily};background:${o.value.style.backgroundColor};`)},[e.createElementVNode("caption",null,[e.renderSlot(t.$slots,"caption",{},void 0,!0)]),e.createElementVNode("thead",null,[e.createElementVNode("tr",{role:"row",style:e.normalizeStyle(`background:${o.value.table.head.backgroundColor};color:${o.value.table.head.color}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value.table.head.values,(n,l)=>(e.openBlock(),e.createElementBlock("th",A,[e.renderSlot(t.$slots,"head",e.mergeProps({ref_for:!0},{value:n,rowIndex:l,type:typeof n,isResponsive:s.value}),void 0,!0)]))),256))],4)]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.value,(n,l)=>(e.openBlock(),e.createElementBlock("tr",D,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.displayValues,(i,u)=>(e.openBlock(),e.createElementBlock("td",{role:"cell","data-cell":o.value.table.head.values[u]},[n.color&&u===0?(e.openBlock(),e.createElementBlock("div",W,[n.color?(e.openBlock(),e.createElementBlock("svg",{key:0,height:o.value.style.shapeSize,width:o.value.style.shapeSize,viewBox:"0 0 20 20",style:{background:"none",overflow:"visible"}},[e.createVNode(q._sfc_main,{plot:{x:10,y:10},color:n.color,radius:9,shape:n.shape||"circle"},null,8,["color","shape"])],8,J)):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"rowTitle",e.mergeProps({ref_for:!0},{value:i,rowIndex:l,colIndex:u,type:typeof i,isResponsive:s.value}),void 0,!0)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[u===0?e.renderSlot(t.$slots,"rowTitle",e.mergeProps({key:0,ref_for:!0},{value:i,rowIndex:l,colIndex:u,type:typeof i,isResponsive:s.value}),void 0,!0):e.createCommentVNode("",!0),u>0?e.renderSlot(t.$slots,"cell",e.mergeProps({key:1,ref_for:!0},{value:i,rowIndex:l,colIndex:u,type:typeof i,isResponsive:s.value,color:n.colors[u],textColor:e.unref(a.adaptColorToBackground)(n.colors[u])}),void 0,!0):e.createCommentVNode("",!0)],64))],8,X))),256)),o.value.table.showSum?(e.openBlock(),e.createElementBlock("td",K,[e.renderSlot(t.$slots,"sum",e.mergeProps({ref_for:!0},{value:n.sum,rowIndex:l,isResponsive:s.value}),void 0,!0)])):e.createCommentVNode("",!0),o.value.table.showAverage?(e.openBlock(),e.createElementBlock("td",Q,[e.renderSlot(t.$slots,"average",e.mergeProps({ref_for:!0},{value:n.average,rowIndex:l,isResponsive:s.value}),void 0,!0)])):e.createCommentVNode("",!0),o.value.table.showMedian?(e.openBlock(),e.createElementBlock("td",Y,[e.renderSlot(t.$slots,"median",e.mergeProps({ref_for:!0},{value:n.median,rowIndex:l,isResponsive:s.value}),void 0,!0)])):e.createCommentVNode("",!0)]))),256))])],4),t.$slots.source?(e.openBlock(),e.createElementBlock("div",Z,[e.renderSlot(t.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0)],46,L))}},ee=H._export_sfc(j,[["__scopeId","data-v-9642b9bf"]]);exports.default=ee;
@@ -1,8 +1,8 @@
1
1
  import { useCssVars as j, computed as v, ref as h, useSlots as ee, onMounted as z, watch as te, createElementBlock as l, openBlock as n, unref as u, normalizeClass as E, normalizeStyle as y, createBlock as ae, createCommentVNode as c, createElementVNode as g, createSlots as oe, withCtx as C, renderSlot as r, normalizeProps as se, guardReactiveProps as ne, Fragment as _, renderList as w, mergeProps as f, createVNode as le, nextTick as re } from "vue";
2
- import { u as ue, c as G, a as ie, o as de, e as pe, a2 as ve, G as ce, O as me, q as fe, r as he } from "./index-B8uVRkA1.js";
3
- import { u as B } from "./useNestedProp-kStEZqtl.js";
4
- import { u as ge, U as be } from "./usePrinter-CppD6oY_.js";
5
- import { _ as ye } from "./Shape-D_MGNYEa.js";
2
+ import { u as ue, c as G, a as ie, o as de, e as pe, a2 as ve, G as ce, O as me, q as fe, r as he } from "./index-Sq6_Z5Ol.js";
3
+ import { u as B } from "./useNestedProp-BmjPdxME.js";
4
+ import { u as ge, U as be } from "./usePrinter-KhQnrZzM.js";
5
+ import { _ as ye } from "./Shape-BQwPhaQ2.js";
6
6
  import { u as Ce } from "./useUserOptionState-BIvW1Kz7.js";
7
7
  import { _ as _e } from "./_plugin-vue_export-helper-CHgC5LLL.js";
8
8
  const ke = ["id"], Ie = { role: "cell" }, $e = { role: "row" }, we = ["data-cell"], Oe = {
@@ -1,9 +1,9 @@
1
1
  import { useCssVars as $e, ref as p, useSlots as ze, onMounted as pe, computed as _, watch as fe, createElementBlock as c, openBlock as d, unref as i, normalizeClass as X, createCommentVNode as b, createElementVNode as f, normalizeStyle as s, toDisplayString as C, withDirectives as De, createVNode as $, Fragment as J, renderList as K, createBlock as Pe, createSlots as Ne, withCtx as N, renderSlot as z, mergeProps as Fe, nextTick as Ve } from "vue";
2
- import { u as Te, c as We, t as Me, p as F, a as Ee, b as Ue, o as Be, e as me, g as Ge, a2 as Le, d as Re, i as V, f as T, q as He, r as qe } from "./index-B8uVRkA1.js";
3
- import { u as ge } from "./useNestedProp-kStEZqtl.js";
4
- import Xe from "./vue-ui-sparkline-TSwCmhPw.js";
5
- import W from "./BaseIcon-DTJIrD3k.js";
6
- import { u as Je, U as Ke, v as Qe } from "./usePrinter-CppD6oY_.js";
2
+ import { u as Te, c as We, t as Me, p as F, a as Ee, b as Ue, o as Be, e as me, g as Ge, a2 as Le, d as Re, i as V, f as T, q as He, r as qe } from "./index-Sq6_Z5Ol.js";
3
+ import { u as ge } from "./useNestedProp-BmjPdxME.js";
4
+ import Xe from "./vue-ui-sparkline-ZWCxuBSn.js";
5
+ import W from "./BaseIcon-CFtrFJk8.js";
6
+ import { u as Je, U as Ke, v as Qe } from "./usePrinter-KhQnrZzM.js";
7
7
  import { u as Ye } from "./useUserOptionState-BIvW1Kz7.js";
8
8
  import { _ as Ze } from "./_plugin-vue_export-helper-CHgC5LLL.js";
9
9
  const je = ["id"], et = { style: { "z-index": "1", "padding-right": "24px" } }, tt = {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-Bmq5HB9y.cjs"),Y=require("./useNestedProp-CivZENAh.cjs"),ce=require("./vue-ui-sparkline-DAaH0160.cjs"),x=require("./BaseIcon-Dn1igOva.cjs"),D=require("./usePrinter-Cf6Zct5m.cjs"),ve=require("./useUserOptionState-BgepsfED.cjs"),pe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),me=["id"],fe={style:{"z-index":"1","padding-right":"24px"}},ye={key:0,style:{display:"flex",flexDirection:"row",alignItems:"center"}},ge={key:0,style:{display:"flex",flexDirection:"row",alignItems:"center"}},be=["onClick"],ke=["onClick"],he=["data-cell"],Se=["data-cell","onPointerenter"],Ce=["data-cell"],_e=["data-cell"],xe=["data-cell"],we=["data-cell"],Ne={key:1,ref:"source",dir:"auto"},ze={__name:"vue-ui-table-sparkline",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(Z,{expose:ee}){e.useCssVars(l=>({"909c5678":l.tdo}));const{vue_ui_table_sparkline:te}=u.useConfig(),y=Z,w=e.ref(u.createUid()),$=e.ref(0),N=e.ref(0),z=e.ref(null),le=e.useSlots();e.onMounted(()=>{le["chart-background"]&&console.warn("VueUiTableSparkline does not support the #chart-background slot.")});const t=e.computed({get:()=>T(),set:l=>l}),{userOptionsVisible:V,setUserOptionsVisibility:P,keepUserOptionState:F}=ve.useUserOptionState({config:t.value});function T(){const l=Y.useNestedProp({userConfig:y.config,defaultConfig:te});return l.theme?{...Y.useNestedProp({userConfig:u.themes.vue_ui_table_sparkline[l.theme]||y.config,defaultConfig:l}),customPalette:u.themePalettes[l.theme]||u.palette}:l}e.watch(()=>y.config,l=>{t.value=T(),V.value=!t.value.userOptions.showOnChartHover,q(),N.value+=1},{deep:!0}),e.watch(()=>y.dataset,l=>{c.value=h.value,N.value+=1},{deep:!0});const{isPrinting:M,isImaging:W,generatePdf:L,generateImage:U}=D.usePrinter({elementId:`table_${w.value}`,fileName:t.value.title.text||"vue-ui-table-sparkline"}),ae=e.computed(()=>u.convertCustomPalette(t.value.customPalette)),C=e.ref(null),B=e.ref(!1),oe=e.computed(()=>t.value.responsiveBreakpoint);e.onMounted(()=>{q()});const E=e.ref(t.value.colNames);function q(){u.objectIsEmpty(y.dataset)&&u.error({componentName:"VueUiTableSparkline",type:"dataset"});const l=new ResizeObserver(o=>{o.forEach(a=>{B.value=a.contentRect.width<oe.value})});C.value&&l.observe(C.value),E.value=[];for(let o=0;o<R.value;o+=1)E.value.push(t.value.colNames[o]||`col ${o}`)}const G=e.computed(()=>(y.dataset.forEach((l,o)=>{u.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(a=>{u.error({componentName:"VueUiTableSparkline",type:"datasetSerieAttribute",property:a,index:o})})}),y.dataset.map((l,o)=>{const a=(l.values||[]).map(d=>isNaN(d)?0:d??0),n=a.reduce((d,i)=>d+i,0),s=n/a.length,r=u.calcMedian(a);return{...l,values:l.values||[],color:u.convertColorToHex(l.color)||ae.value[o]||u.palette[o]||u.palette[o%u.palette.length],sum:n,average:s,median:r,sparklineDataset:a.map((d,i)=>({period:t.value.colNames[i]||`col ${i}`,value:d||0}))}})));function ne(l){const a=(l[0].values||[]).map((s,r)=>l.map(d=>d.values[r]||[])).map(s=>s.map((r,d)=>[r,d]).sort((r,d)=>d[0]-r[0]).map(r=>r[1]));return l.map((s,r)=>({...s,values:s.values||[],orders:a[r]}))}const h=e.computed(()=>ne(G.value)),c=e.ref(h.value),re=e.computed(()=>Math.max(...c.value.map(l=>(l.values||[]).length))),I=e.ref(void 0),A=e.ref(!1),v=e.ref(void 0),H=e.ref(1);function k(){A.value=!1,v.value=void 0,p.value=void 0,H.value=1,S.value.forEach(l=>l.state=1),g.value={name:1,sum:1,average:1,median:1},c.value=h.value}function _(l,o,a){if(["name","sum","average","median"].includes(l.type)){ue(l.type,o,a);return}if(!J(o))return;if(b.value=o,p.value=void 0,![null,void 0].includes(v.value)&&o!==v.value&&(v.value=void 0,k()),S.value[o].state===a&&v.value===o){v.value=void 0,k();return}A.value=!0,v.value=o;const n=h.value.map(i=>i.values[o]||[]),s=a;S.value[o].state=s,H.value=s,o===I.value?I.value=void 0:I.value=o;const d=n.map((i,m)=>[m,i]).sort((i,m)=>s*(m[1]-i[1])).map(i=>i[0]).map(i=>h.value[i]);c.value=d,N.value+=1}const R=e.computed(()=>Math.max(...y.dataset.map(l=>(l.values||[]).length))),f=e.computed(()=>{let l=E.value.map(a=>({type:"reg",value:a}));if(!l.length)for(let a=0;a<R.value;a+=1)l.push({type:"reg",value:`col ${a+1}`});t.value.showTotal&&(l=[...l,{type:"sum",value:t.value.translations.total}]);let o;return t.value.showAverage&&t.value.showMedian?o=[...l,{type:"average",value:t.value.translations.average},{type:"median",value:t.value.translations.median}]:t.value.showAverage&&!t.value.showMedian?o=[...l,{type:"average",value:t.value.translations.average}]:!t.value.showAverage&&t.value.showMedian?o=[...l,{type:"median",value:t.value.translations.median}]:o=l,t.value.showSparklines?[...o,{type:"chart",value:t.value.translations.chart}]:o}),g=e.ref({name:1,sum:1,average:1,median:1}),p=e.ref(void 0);function ue(l,o,a){if(!c.value||c.value.length===0||!K(l))return;if(p.value!==l&&(p.value=void 0),![null,void 0].includes(v.value)&&o!==v.value&&k(),v.value=void 0,g.value[l]===a&&p.value){p.value=void 0,k();return}p.value=l,A.value=!0,g.value[l]=a,[null,void 0].includes(o)||(S.value[o].state=g.value[l]);const n=g.value[l],s=[...c.value].sort((r,d)=>{const i=r[l]??(typeof r[l]=="number"?0:""),m=d[l]??(typeof d[l]=="number"?0:"");return typeof i=="string"&&typeof m=="string"?n===-1?i.localeCompare(m):m.localeCompare(i):typeof i=="number"&&typeof m=="number"?n===-1?i-m:m-i:0});c.value=s}const b=e.ref(void 0),O=e.ref(void 0);function se({dataIndex:l,serieIndex:o}){b.value=l,O.value=o,z.value[l]&&!B.value&&z.value[l].scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})}const X=e.ref(!1);function ie(l){X.value=l,$.value+=1}function j(){e.nextTick(()=>{const l=[t.value.translations.serie].concat(f.value),o=G.value.map((s,r)=>[[s.name],s.values,[s.sum],[s.average],[s.median]]),a=[l].concat(o),n=u.createCsvContent(a);u.downloadCsv({csvContent:n,title:t.value.title.text||"vue-ui-table-sparkline"})})}function J(l){return t.value.sortedDataColumnIndices.includes(l)}function K(l){return l.type==="name"||l==="name"?t.value.sortedSeriesName:l.type==="sum"||l==="sum"?t.value.sortedSum:l.type==="average"||l==="average"?t.value.sortedAverage:l.type==="median"||l==="median"?t.value.sortedMedian:!1}function Q(l,o,a){return["sum","average","median"].includes(o.type)?p.value===o.type&&g.value[o.type]===a?1:.3:l===v.value&&S.value[l].state===a?1:.3}function de(){t.value.resetSortOnClickOutside&&k()}const S=e.computed({get:()=>f.value.map(l=>({state:1})),set:l=>l});return ee({generatePdf:L,generateImage:U,generateCsv:j,restoreOrder:k}),(l,o)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tableContainer",ref:C,class:e.normalizeClass({"vue-ui-responsive":B.value}),style:{overflow:"hidden"},id:`table_${w.value}`,onMouseenter:o[3]||(o[3]=()=>e.unref(P)(!0)),onMouseleave:o[4]||(o[4]=()=>e.unref(P)(!1))},[t.value.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vue-ui-table-sparkline-caption",style:e.normalizeStyle({backgroundColor:t.value.title.backgroundColor})},[e.createElementVNode("div",{style:e.normalizeStyle({fontSize:`${t.value.title.fontSize}px`,fontWeight:t.value.title.bold?"bold":"normal",color:t.value.title.color,textAlign:t.value.title.textAlign})},e.toDisplayString(t.value.title.text),5),t.value.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle({fontSize:`${t.value.title.subtitle.fontSize}px`,fontWeight:t.value.title.subtitle.bold?"bold":"normal",color:t.value.title.subtitle.color,textAlign:t.value.title.textAlign})},e.toDisplayString(t.value.title.subtitle.text),5)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),e.createElementVNode("div",{style:{overflow:"auto"},onPointerleave:o[2]||(o[2]=a=>{O.value=void 0,b.value=void 0})},[e.createElementVNode("table",{class:"vue-ui-data-table",style:e.normalizeStyle({fontFamily:t.value.fontFamily,position:"relative"})},[e.createElementVNode("thead",fe,[e.withDirectives((e.openBlock(),e.createElementBlock("tr",{role:"row",class:"vue-ui-data-table__thead-row",style:e.normalizeStyle({backgroundColor:t.value.thead.backgroundColor,color:t.value.thead.color})},[e.createElementVNode("th",{role:"cell",style:e.normalizeStyle({backgroundColor:t.value.thead.backgroundColor,border:t.value.thead.outline,textAlign:t.value.thead.textAlign,fontWeight:t.value.thead.bold?"bold":"normal"}),class:"sticky-col-first"},[e.createElementVNode("div",{style:e.normalizeStyle({display:"flex",flexDirection:"row",alignItems:"center",gap:"3px",justifyContent:t.value.thead.textAlign})},[e.createElementVNode("span",null,e.toDisplayString(t.value.translations.serie),1),c.value.length>1&&t.value.sortedSeriesName?(e.openBlock(),e.createElementBlock("div",ye,[e.createElementVNode("button",{class:"vue-ui-table-sparkline-sorting-button vue-ui-table-sparkline-sorting-button-down",onClick:o[0]||(o[0]=a=>_({type:"name"},null,-1))},[e.createVNode(x.default,{size:12,name:"arrowBottom",stroke:t.value.thead.color,style:e.normalizeStyle({opacity:p.value==="name"&&g.value.name===-1?1:.3})},null,8,["stroke","style"])]),e.createElementVNode("button",{class:"vue-ui-table-sparkline-sorting-button vue-ui-table-sparkline-sorting-button-up",onClick:o[1]||(o[1]=a=>_({type:"name"},null,1))},[e.createVNode(x.default,{size:12,name:"arrowTop",stroke:t.value.thead.color,style:e.normalizeStyle({opacity:p.value==="name"&&g.value.name===1?1:.3})},null,8,["stroke","style"])])])):e.createCommentVNode("",!0)],4)],4),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(a,n)=>(e.openBlock(),e.createElementBlock("th",{role:"cell",style:e.normalizeStyle({background:t.value.thead.backgroundColor,border:t.value.thead.outline,textAlign:t.value.thead.textAlign,fontWeight:t.value.thead.bold?"bold":"normal",minWidth:n===f.value.length-1?`${t.value.sparkline.dimensions.width}px`:"48px",paddingRight:n===f.value.length-1&&t.value.userOptions.show?"36px":""}),class:e.normalizeClass({"sticky-col":n===f.value.length-1&&t.value.showSparklines})},[e.createElementVNode("div",{style:e.normalizeStyle({display:"flex",flexDirection:"row",alignItems:"center",gap:"3px",justifyContent:t.value.thead.textAlign})},[e.createElementVNode("span",null,e.toDisplayString(a.value),1),c.value.length>1&&(J(n)||K(a))?(e.openBlock(),e.createElementBlock("div",ge,[e.createElementVNode("button",{class:"vue-ui-table-sparkline-sorting-button vue-ui-table-sparkline-sorting-button-down",onClick:()=>_(a,n,-1)},[e.createVNode(x.default,{size:12,name:"arrowBottom",stroke:t.value.thead.color,style:e.normalizeStyle({opacity:Q(n,a,-1)})},null,8,["stroke","style"])],8,be),e.createElementVNode("button",{class:"vue-ui-table-sparkline-sorting-button vue-ui-table-sparkline-sorting-button-up",onClick:()=>_(a,n,1)},[e.createVNode(x.default,{size:12,name:"arrowTop",stroke:t.value.thead.color,style:e.normalizeStyle({opacity:Q(n,a,1)})},null,8,["stroke","style"])],8,ke)])):e.createCommentVNode("",!0)],4),t.value.userOptions.show&&n===f.value.length-1&&(e.unref(F)||e.unref(V))?(e.openBlock(),e.createBlock(D.UserOptions,{ref_for:!0,ref:"details",key:`user_option_${$.value}`,backgroundColor:t.value.thead.backgroundColor,color:t.value.thead.color,isPrinting:e.unref(M),isImaging:e.unref(W),uid:w.value,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:X.value,titles:{...t.value.userOptions.buttonTitles},chartElement:C.value,position:t.value.userOptions.position,onToggleFullscreen:ie,onGeneratePdf:e.unref(L),onGenerateImage:e.unref(U),onGenerateCsv:j,style:e.normalizeStyle({visibility:e.unref(F)?e.unref(V)?"visible":"hidden":"visible"})},e.createSlots({_:2},[l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:s,isFullscreen:r})=>[e.renderSlot(l.$slots,"optionFullscreen",e.mergeProps({ref_for:!0},{toggleFullscreen:s,isFullscreen:r}),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0)],6))),256))],4)),[[e.unref(D.vClickOutside),de]])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(a,n)=>(e.openBlock(),e.createElementBlock("tr",{role:"row",style:e.normalizeStyle({backgroundColor:t.value.tbody.backgroundColor,color:t.value.tbody.color}),class:e.normalizeClass({"vue-ui-data-table__tbody__row":!0,"vue-ui-data-table__tbody__row-even":n%2===0,"vue-ui-data-table__tbody__row-odd":n%2!==0})},[e.createElementVNode("td",{role:"cell",style:e.normalizeStyle({backgroundColor:t.value.tbody.backgroundColor,border:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),"data-cell":t.value.translations.serie,class:"vue-ui-data-table__tbody__td sticky-col-first"},[e.createElementVNode("div",{dir:"auto",style:e.normalizeStyle({display:"flex",flexDirection:"row",alignItems:"center",gap:"6px",justifyContent:t.value.tbody.textAlign})},[t.value.tbody.showColorMarker?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle({color:a.color})},"⬤",4)):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(a.name??"-"),1)],4)],12,he),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(re.value,(s,r)=>(e.openBlock(),e.createElementBlock("td",{dir:"auto",role:"cell",ref_for:!0,ref_key:"TD",ref:z,style:e.normalizeStyle({border:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign,background:b.value!==void 0&&r===b.value?t.value.tbody.selectedColor.useSerieColor?`${a.color.length>7?a.color.slice(0,-2):a.color}33`:t.value.tbody.selectedColor.fallback:""}),"data-cell":f.value[r]?f.value[r].value:"",class:"vue-ui-data-table__tbody__td",onPointerenter:d=>{O.value=n,b.value=r}},e.toDisplayString([null,void 0].includes(a.values[r])?"-":e.unref(u.applyDataLabel)(t.value.formatter,Number(a.values[r]),e.unref(u.dataLabel)({p:t.value.prefix,v:Number(a.values[r]),s:t.value.suffix,r:t.value.roundingValues}),{datapoint:a,seriesIndex:n,datapointIndex:r})),45,Se))),256)),t.value.showTotal?(e.openBlock(),e.createElementBlock("td",{key:0,dir:"auto",role:"cell",style:e.normalizeStyle({border:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),"data-cell":t.value.translations.total,class:"vue-ui-data-table__tbody__td"},e.toDisplayString(e.unref(u.applyDataLabel)(t.value.formatter,a.sum,e.unref(u.dataLabel)({p:t.value.prefix,v:a.sum,s:t.value.suffix,r:t.value.roundingTotal}),{datapoint:a.sum,seriesIndex:n})),13,Ce)):e.createCommentVNode("",!0),t.value.showAverage?(e.openBlock(),e.createElementBlock("td",{key:1,dir:"auto",role:"cell",style:e.normalizeStyle({border:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),"data-cell":t.value.translations.average,class:"vue-ui-data-table__tbody__td"},e.toDisplayString(e.unref(u.applyDataLabel)(t.value.formatter,a.average,e.unref(u.dataLabel)({p:t.value.prefix,v:a.average,s:t.value.suffix,r:t.value.roundingAverage}),{datapoint:a.average,seriesIndex:n})),13,_e)):e.createCommentVNode("",!0),t.value.showMedian?(e.openBlock(),e.createElementBlock("td",{key:2,dir:"auto",role:"cell",style:e.normalizeStyle({border:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),"data-cell":t.value.translations.median,class:"vue-ui-data-table__tbody__td"},e.toDisplayString(e.unref(u.applyDataLabel)(t.value.formatter,a.median,e.unref(u.dataLabel)({p:t.value.prefix,v:a.median,s:t.value.suffix,r:t.value.roundingMedian}),{datapoint:a.median,seriesIndex:n})),13,xe)):e.createCommentVNode("",!0),t.value.showSparklines?(e.openBlock(),e.createElementBlock("td",{key:3,role:"cell","data-cell":t.value.translations.chart,style:e.normalizeStyle({border:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign,backgroundColor:t.value.tbody.backgroundColor,padding:"0"}),class:"vue-ui-data-table__tbody__td sticky-col"},[e.createVNode(ce.default,{onHoverIndex:({index:s})=>se({dataIndex:s,serieIndex:n}),"height-ratio":t.value.sparkline.dimensions.heightRatio,"forced-padding":30,dataset:a.sparklineDataset,showInfo:!1,selectedIndex:b.value,config:{type:t.value.sparkline.type,style:{backgroundColor:"transparent",animation:{show:t.value.sparkline.animation.show&&!e.unref(M)&&!e.unref(W),animationFrames:t.value.sparkline.animation.animationFrames},line:{color:a.color,smooth:t.value.sparkline.smooth,strokeWidth:t.value.sparkline.strokeWidth},bar:{color:a.color},area:{color:a.color,opacity:t.value.sparkline.showArea?16:0,useGradient:t.value.sparkline.useGradient},verticalIndicator:{color:a.color},plot:{radius:9,stroke:t.value.tbody.backgroundColor,strokeWidth:3}}}},null,8,["onHoverIndex","height-ratio","dataset","selectedIndex","config"])],12,we)):e.createCommentVNode("",!0)],6))),256))])],4)],32),l.$slots.source?(e.openBlock(),e.createElementBlock("div",Ne,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0)],42,me))}},Ve=pe._export_sfc(ze,[["__scopeId","data-v-8b71a68d"]]);exports.default=Ve;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-TsXfF4RW.cjs"),Y=require("./useNestedProp-AmCRQ0Mq.cjs"),ce=require("./vue-ui-sparkline-CYIZ1DFh.cjs"),x=require("./BaseIcon-DEUnx0Km.cjs"),D=require("./usePrinter-DqLdu0d8.cjs"),ve=require("./useUserOptionState-BgepsfED.cjs"),pe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),me=["id"],fe={style:{"z-index":"1","padding-right":"24px"}},ye={key:0,style:{display:"flex",flexDirection:"row",alignItems:"center"}},ge={key:0,style:{display:"flex",flexDirection:"row",alignItems:"center"}},be=["onClick"],ke=["onClick"],he=["data-cell"],Se=["data-cell","onPointerenter"],Ce=["data-cell"],_e=["data-cell"],xe=["data-cell"],we=["data-cell"],Ne={key:1,ref:"source",dir:"auto"},ze={__name:"vue-ui-table-sparkline",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(Z,{expose:ee}){e.useCssVars(l=>({"909c5678":l.tdo}));const{vue_ui_table_sparkline:te}=u.useConfig(),y=Z,w=e.ref(u.createUid()),$=e.ref(0),N=e.ref(0),z=e.ref(null),le=e.useSlots();e.onMounted(()=>{le["chart-background"]&&console.warn("VueUiTableSparkline does not support the #chart-background slot.")});const t=e.computed({get:()=>T(),set:l=>l}),{userOptionsVisible:V,setUserOptionsVisibility:P,keepUserOptionState:F}=ve.useUserOptionState({config:t.value});function T(){const l=Y.useNestedProp({userConfig:y.config,defaultConfig:te});return l.theme?{...Y.useNestedProp({userConfig:u.themes.vue_ui_table_sparkline[l.theme]||y.config,defaultConfig:l}),customPalette:u.themePalettes[l.theme]||u.palette}:l}e.watch(()=>y.config,l=>{t.value=T(),V.value=!t.value.userOptions.showOnChartHover,q(),N.value+=1},{deep:!0}),e.watch(()=>y.dataset,l=>{c.value=h.value,N.value+=1},{deep:!0});const{isPrinting:M,isImaging:W,generatePdf:L,generateImage:U}=D.usePrinter({elementId:`table_${w.value}`,fileName:t.value.title.text||"vue-ui-table-sparkline"}),ae=e.computed(()=>u.convertCustomPalette(t.value.customPalette)),C=e.ref(null),B=e.ref(!1),oe=e.computed(()=>t.value.responsiveBreakpoint);e.onMounted(()=>{q()});const E=e.ref(t.value.colNames);function q(){u.objectIsEmpty(y.dataset)&&u.error({componentName:"VueUiTableSparkline",type:"dataset"});const l=new ResizeObserver(o=>{o.forEach(a=>{B.value=a.contentRect.width<oe.value})});C.value&&l.observe(C.value),E.value=[];for(let o=0;o<R.value;o+=1)E.value.push(t.value.colNames[o]||`col ${o}`)}const G=e.computed(()=>(y.dataset.forEach((l,o)=>{u.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(a=>{u.error({componentName:"VueUiTableSparkline",type:"datasetSerieAttribute",property:a,index:o})})}),y.dataset.map((l,o)=>{const a=(l.values||[]).map(d=>isNaN(d)?0:d??0),n=a.reduce((d,i)=>d+i,0),s=n/a.length,r=u.calcMedian(a);return{...l,values:l.values||[],color:u.convertColorToHex(l.color)||ae.value[o]||u.palette[o]||u.palette[o%u.palette.length],sum:n,average:s,median:r,sparklineDataset:a.map((d,i)=>({period:t.value.colNames[i]||`col ${i}`,value:d||0}))}})));function ne(l){const a=(l[0].values||[]).map((s,r)=>l.map(d=>d.values[r]||[])).map(s=>s.map((r,d)=>[r,d]).sort((r,d)=>d[0]-r[0]).map(r=>r[1]));return l.map((s,r)=>({...s,values:s.values||[],orders:a[r]}))}const h=e.computed(()=>ne(G.value)),c=e.ref(h.value),re=e.computed(()=>Math.max(...c.value.map(l=>(l.values||[]).length))),I=e.ref(void 0),A=e.ref(!1),v=e.ref(void 0),H=e.ref(1);function k(){A.value=!1,v.value=void 0,p.value=void 0,H.value=1,S.value.forEach(l=>l.state=1),g.value={name:1,sum:1,average:1,median:1},c.value=h.value}function _(l,o,a){if(["name","sum","average","median"].includes(l.type)){ue(l.type,o,a);return}if(!J(o))return;if(b.value=o,p.value=void 0,![null,void 0].includes(v.value)&&o!==v.value&&(v.value=void 0,k()),S.value[o].state===a&&v.value===o){v.value=void 0,k();return}A.value=!0,v.value=o;const n=h.value.map(i=>i.values[o]||[]),s=a;S.value[o].state=s,H.value=s,o===I.value?I.value=void 0:I.value=o;const d=n.map((i,m)=>[m,i]).sort((i,m)=>s*(m[1]-i[1])).map(i=>i[0]).map(i=>h.value[i]);c.value=d,N.value+=1}const R=e.computed(()=>Math.max(...y.dataset.map(l=>(l.values||[]).length))),f=e.computed(()=>{let l=E.value.map(a=>({type:"reg",value:a}));if(!l.length)for(let a=0;a<R.value;a+=1)l.push({type:"reg",value:`col ${a+1}`});t.value.showTotal&&(l=[...l,{type:"sum",value:t.value.translations.total}]);let o;return t.value.showAverage&&t.value.showMedian?o=[...l,{type:"average",value:t.value.translations.average},{type:"median",value:t.value.translations.median}]:t.value.showAverage&&!t.value.showMedian?o=[...l,{type:"average",value:t.value.translations.average}]:!t.value.showAverage&&t.value.showMedian?o=[...l,{type:"median",value:t.value.translations.median}]:o=l,t.value.showSparklines?[...o,{type:"chart",value:t.value.translations.chart}]:o}),g=e.ref({name:1,sum:1,average:1,median:1}),p=e.ref(void 0);function ue(l,o,a){if(!c.value||c.value.length===0||!K(l))return;if(p.value!==l&&(p.value=void 0),![null,void 0].includes(v.value)&&o!==v.value&&k(),v.value=void 0,g.value[l]===a&&p.value){p.value=void 0,k();return}p.value=l,A.value=!0,g.value[l]=a,[null,void 0].includes(o)||(S.value[o].state=g.value[l]);const n=g.value[l],s=[...c.value].sort((r,d)=>{const i=r[l]??(typeof r[l]=="number"?0:""),m=d[l]??(typeof d[l]=="number"?0:"");return typeof i=="string"&&typeof m=="string"?n===-1?i.localeCompare(m):m.localeCompare(i):typeof i=="number"&&typeof m=="number"?n===-1?i-m:m-i:0});c.value=s}const b=e.ref(void 0),O=e.ref(void 0);function se({dataIndex:l,serieIndex:o}){b.value=l,O.value=o,z.value[l]&&!B.value&&z.value[l].scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})}const X=e.ref(!1);function ie(l){X.value=l,$.value+=1}function j(){e.nextTick(()=>{const l=[t.value.translations.serie].concat(f.value),o=G.value.map((s,r)=>[[s.name],s.values,[s.sum],[s.average],[s.median]]),a=[l].concat(o),n=u.createCsvContent(a);u.downloadCsv({csvContent:n,title:t.value.title.text||"vue-ui-table-sparkline"})})}function J(l){return t.value.sortedDataColumnIndices.includes(l)}function K(l){return l.type==="name"||l==="name"?t.value.sortedSeriesName:l.type==="sum"||l==="sum"?t.value.sortedSum:l.type==="average"||l==="average"?t.value.sortedAverage:l.type==="median"||l==="median"?t.value.sortedMedian:!1}function Q(l,o,a){return["sum","average","median"].includes(o.type)?p.value===o.type&&g.value[o.type]===a?1:.3:l===v.value&&S.value[l].state===a?1:.3}function de(){t.value.resetSortOnClickOutside&&k()}const S=e.computed({get:()=>f.value.map(l=>({state:1})),set:l=>l});return ee({generatePdf:L,generateImage:U,generateCsv:j,restoreOrder:k}),(l,o)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tableContainer",ref:C,class:e.normalizeClass({"vue-ui-responsive":B.value}),style:{overflow:"hidden"},id:`table_${w.value}`,onMouseenter:o[3]||(o[3]=()=>e.unref(P)(!0)),onMouseleave:o[4]||(o[4]=()=>e.unref(P)(!1))},[t.value.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vue-ui-table-sparkline-caption",style:e.normalizeStyle({backgroundColor:t.value.title.backgroundColor})},[e.createElementVNode("div",{style:e.normalizeStyle({fontSize:`${t.value.title.fontSize}px`,fontWeight:t.value.title.bold?"bold":"normal",color:t.value.title.color,textAlign:t.value.title.textAlign})},e.toDisplayString(t.value.title.text),5),t.value.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle({fontSize:`${t.value.title.subtitle.fontSize}px`,fontWeight:t.value.title.subtitle.bold?"bold":"normal",color:t.value.title.subtitle.color,textAlign:t.value.title.textAlign})},e.toDisplayString(t.value.title.subtitle.text),5)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),e.createElementVNode("div",{style:{overflow:"auto"},onPointerleave:o[2]||(o[2]=a=>{O.value=void 0,b.value=void 0})},[e.createElementVNode("table",{class:"vue-ui-data-table",style:e.normalizeStyle({fontFamily:t.value.fontFamily,position:"relative"})},[e.createElementVNode("thead",fe,[e.withDirectives((e.openBlock(),e.createElementBlock("tr",{role:"row",class:"vue-ui-data-table__thead-row",style:e.normalizeStyle({backgroundColor:t.value.thead.backgroundColor,color:t.value.thead.color})},[e.createElementVNode("th",{role:"cell",style:e.normalizeStyle({backgroundColor:t.value.thead.backgroundColor,border:t.value.thead.outline,textAlign:t.value.thead.textAlign,fontWeight:t.value.thead.bold?"bold":"normal"}),class:"sticky-col-first"},[e.createElementVNode("div",{style:e.normalizeStyle({display:"flex",flexDirection:"row",alignItems:"center",gap:"3px",justifyContent:t.value.thead.textAlign})},[e.createElementVNode("span",null,e.toDisplayString(t.value.translations.serie),1),c.value.length>1&&t.value.sortedSeriesName?(e.openBlock(),e.createElementBlock("div",ye,[e.createElementVNode("button",{class:"vue-ui-table-sparkline-sorting-button vue-ui-table-sparkline-sorting-button-down",onClick:o[0]||(o[0]=a=>_({type:"name"},null,-1))},[e.createVNode(x.default,{size:12,name:"arrowBottom",stroke:t.value.thead.color,style:e.normalizeStyle({opacity:p.value==="name"&&g.value.name===-1?1:.3})},null,8,["stroke","style"])]),e.createElementVNode("button",{class:"vue-ui-table-sparkline-sorting-button vue-ui-table-sparkline-sorting-button-up",onClick:o[1]||(o[1]=a=>_({type:"name"},null,1))},[e.createVNode(x.default,{size:12,name:"arrowTop",stroke:t.value.thead.color,style:e.normalizeStyle({opacity:p.value==="name"&&g.value.name===1?1:.3})},null,8,["stroke","style"])])])):e.createCommentVNode("",!0)],4)],4),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(a,n)=>(e.openBlock(),e.createElementBlock("th",{role:"cell",style:e.normalizeStyle({background:t.value.thead.backgroundColor,border:t.value.thead.outline,textAlign:t.value.thead.textAlign,fontWeight:t.value.thead.bold?"bold":"normal",minWidth:n===f.value.length-1?`${t.value.sparkline.dimensions.width}px`:"48px",paddingRight:n===f.value.length-1&&t.value.userOptions.show?"36px":""}),class:e.normalizeClass({"sticky-col":n===f.value.length-1&&t.value.showSparklines})},[e.createElementVNode("div",{style:e.normalizeStyle({display:"flex",flexDirection:"row",alignItems:"center",gap:"3px",justifyContent:t.value.thead.textAlign})},[e.createElementVNode("span",null,e.toDisplayString(a.value),1),c.value.length>1&&(J(n)||K(a))?(e.openBlock(),e.createElementBlock("div",ge,[e.createElementVNode("button",{class:"vue-ui-table-sparkline-sorting-button vue-ui-table-sparkline-sorting-button-down",onClick:()=>_(a,n,-1)},[e.createVNode(x.default,{size:12,name:"arrowBottom",stroke:t.value.thead.color,style:e.normalizeStyle({opacity:Q(n,a,-1)})},null,8,["stroke","style"])],8,be),e.createElementVNode("button",{class:"vue-ui-table-sparkline-sorting-button vue-ui-table-sparkline-sorting-button-up",onClick:()=>_(a,n,1)},[e.createVNode(x.default,{size:12,name:"arrowTop",stroke:t.value.thead.color,style:e.normalizeStyle({opacity:Q(n,a,1)})},null,8,["stroke","style"])],8,ke)])):e.createCommentVNode("",!0)],4),t.value.userOptions.show&&n===f.value.length-1&&(e.unref(F)||e.unref(V))?(e.openBlock(),e.createBlock(D.UserOptions,{ref_for:!0,ref:"details",key:`user_option_${$.value}`,backgroundColor:t.value.thead.backgroundColor,color:t.value.thead.color,isPrinting:e.unref(M),isImaging:e.unref(W),uid:w.value,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:X.value,titles:{...t.value.userOptions.buttonTitles},chartElement:C.value,position:t.value.userOptions.position,onToggleFullscreen:ie,onGeneratePdf:e.unref(L),onGenerateImage:e.unref(U),onGenerateCsv:j,style:e.normalizeStyle({visibility:e.unref(F)?e.unref(V)?"visible":"hidden":"visible"})},e.createSlots({_:2},[l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:s,isFullscreen:r})=>[e.renderSlot(l.$slots,"optionFullscreen",e.mergeProps({ref_for:!0},{toggleFullscreen:s,isFullscreen:r}),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0)],6))),256))],4)),[[e.unref(D.vClickOutside),de]])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(a,n)=>(e.openBlock(),e.createElementBlock("tr",{role:"row",style:e.normalizeStyle({backgroundColor:t.value.tbody.backgroundColor,color:t.value.tbody.color}),class:e.normalizeClass({"vue-ui-data-table__tbody__row":!0,"vue-ui-data-table__tbody__row-even":n%2===0,"vue-ui-data-table__tbody__row-odd":n%2!==0})},[e.createElementVNode("td",{role:"cell",style:e.normalizeStyle({backgroundColor:t.value.tbody.backgroundColor,border:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),"data-cell":t.value.translations.serie,class:"vue-ui-data-table__tbody__td sticky-col-first"},[e.createElementVNode("div",{dir:"auto",style:e.normalizeStyle({display:"flex",flexDirection:"row",alignItems:"center",gap:"6px",justifyContent:t.value.tbody.textAlign})},[t.value.tbody.showColorMarker?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle({color:a.color})},"⬤",4)):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(a.name??"-"),1)],4)],12,he),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(re.value,(s,r)=>(e.openBlock(),e.createElementBlock("td",{dir:"auto",role:"cell",ref_for:!0,ref_key:"TD",ref:z,style:e.normalizeStyle({border:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign,background:b.value!==void 0&&r===b.value?t.value.tbody.selectedColor.useSerieColor?`${a.color.length>7?a.color.slice(0,-2):a.color}33`:t.value.tbody.selectedColor.fallback:""}),"data-cell":f.value[r]?f.value[r].value:"",class:"vue-ui-data-table__tbody__td",onPointerenter:d=>{O.value=n,b.value=r}},e.toDisplayString([null,void 0].includes(a.values[r])?"-":e.unref(u.applyDataLabel)(t.value.formatter,Number(a.values[r]),e.unref(u.dataLabel)({p:t.value.prefix,v:Number(a.values[r]),s:t.value.suffix,r:t.value.roundingValues}),{datapoint:a,seriesIndex:n,datapointIndex:r})),45,Se))),256)),t.value.showTotal?(e.openBlock(),e.createElementBlock("td",{key:0,dir:"auto",role:"cell",style:e.normalizeStyle({border:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),"data-cell":t.value.translations.total,class:"vue-ui-data-table__tbody__td"},e.toDisplayString(e.unref(u.applyDataLabel)(t.value.formatter,a.sum,e.unref(u.dataLabel)({p:t.value.prefix,v:a.sum,s:t.value.suffix,r:t.value.roundingTotal}),{datapoint:a.sum,seriesIndex:n})),13,Ce)):e.createCommentVNode("",!0),t.value.showAverage?(e.openBlock(),e.createElementBlock("td",{key:1,dir:"auto",role:"cell",style:e.normalizeStyle({border:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),"data-cell":t.value.translations.average,class:"vue-ui-data-table__tbody__td"},e.toDisplayString(e.unref(u.applyDataLabel)(t.value.formatter,a.average,e.unref(u.dataLabel)({p:t.value.prefix,v:a.average,s:t.value.suffix,r:t.value.roundingAverage}),{datapoint:a.average,seriesIndex:n})),13,_e)):e.createCommentVNode("",!0),t.value.showMedian?(e.openBlock(),e.createElementBlock("td",{key:2,dir:"auto",role:"cell",style:e.normalizeStyle({border:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),"data-cell":t.value.translations.median,class:"vue-ui-data-table__tbody__td"},e.toDisplayString(e.unref(u.applyDataLabel)(t.value.formatter,a.median,e.unref(u.dataLabel)({p:t.value.prefix,v:a.median,s:t.value.suffix,r:t.value.roundingMedian}),{datapoint:a.median,seriesIndex:n})),13,xe)):e.createCommentVNode("",!0),t.value.showSparklines?(e.openBlock(),e.createElementBlock("td",{key:3,role:"cell","data-cell":t.value.translations.chart,style:e.normalizeStyle({border:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign,backgroundColor:t.value.tbody.backgroundColor,padding:"0"}),class:"vue-ui-data-table__tbody__td sticky-col"},[e.createVNode(ce.default,{onHoverIndex:({index:s})=>se({dataIndex:s,serieIndex:n}),"height-ratio":t.value.sparkline.dimensions.heightRatio,"forced-padding":30,dataset:a.sparklineDataset,showInfo:!1,selectedIndex:b.value,config:{type:t.value.sparkline.type,style:{backgroundColor:"transparent",animation:{show:t.value.sparkline.animation.show&&!e.unref(M)&&!e.unref(W),animationFrames:t.value.sparkline.animation.animationFrames},line:{color:a.color,smooth:t.value.sparkline.smooth,strokeWidth:t.value.sparkline.strokeWidth},bar:{color:a.color},area:{color:a.color,opacity:t.value.sparkline.showArea?16:0,useGradient:t.value.sparkline.useGradient},verticalIndicator:{color:a.color},plot:{radius:9,stroke:t.value.tbody.backgroundColor,strokeWidth:3}}}},null,8,["onHoverIndex","height-ratio","dataset","selectedIndex","config"])],12,we)):e.createCommentVNode("",!0)],6))),256))])],4)],32),l.$slots.source?(e.openBlock(),e.createElementBlock("div",Ne,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0)],42,me))}},Ve=pe._export_sfc(ze,[["__scopeId","data-v-8b71a68d"]]);exports.default=Ve;