vue-data-ui 2.4.77 → 2.4.78

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/dist/{Arrow-f_Kuk8SY.js → Arrow-C7AmfY-d.js} +1 -1
  2. package/dist/{Arrow-CfSMP_pf.cjs → Arrow-DbrjRMa6.cjs} +1 -1
  3. package/dist/{BaseIcon-BnnMILPX.cjs → BaseIcon-CIjjPDqj.cjs} +1 -1
  4. package/dist/{BaseIcon-QuseiwxO.js → BaseIcon-Dzpk4O8L.js} +1 -1
  5. package/dist/{DataTable--ofk92Yb.js → DataTable-DtRXoetj.js} +2 -2
  6. package/dist/{DataTable-D0qYxBVZ.cjs → DataTable-wN-jvOfe.cjs} +1 -1
  7. package/dist/{Legend-DV4QFlV9.cjs → Legend-DqGE1lkA.cjs} +1 -1
  8. package/dist/{Legend-BhrGSZRp.js → Legend-RnRqBxiV.js} +2 -2
  9. package/dist/{PackageVersion-BqwuIW-T.js → PackageVersion-CgJdp_Ki.js} +1 -1
  10. package/dist/{PackageVersion-sBYhtscP.cjs → PackageVersion-Dn-t7tbm.cjs} +1 -1
  11. package/dist/{PenAndPaper-LsFeEPDj.js → PenAndPaper-BTLEk55u.js} +3 -3
  12. package/dist/{PenAndPaper-CHz_Iy5T.cjs → PenAndPaper-DFXJJink.cjs} +1 -1
  13. package/dist/{Shape-Dorp4kyF.js → Shape-B1fqUhjt.js} +1 -1
  14. package/dist/{Shape-BO7Gprqr.cjs → Shape-D7IbPjU8.cjs} +1 -1
  15. package/dist/{Slicer-BDdf60jQ.cjs → Slicer-8bCK41mN.cjs} +1 -1
  16. package/dist/{Slicer-CD8VkksI.js → Slicer-GQf9ZyPj.js} +2 -2
  17. package/dist/{Title-BzcIyo-x.cjs → Title-D-6pIV0l.cjs} +1 -1
  18. package/dist/{Title-2MaMBji9.js → Title-XYNHfYwN.js} +1 -1
  19. package/dist/{Tooltip-DWo9kakv.cjs → Tooltip-CNox4F8U.cjs} +1 -1
  20. package/dist/{Tooltip-C_eI7NfC.js → Tooltip-DYRo59nq.js} +1 -1
  21. package/dist/{index-DMvK32iW.js → index-B8Eaq54E.js} +1 -1
  22. package/dist/{index-CbMyzHGj.cjs → index-KJL8ra_6.cjs} +1 -1
  23. package/dist/style.css +1 -1
  24. package/dist/{useNestedProp-DqPx8kFh.cjs → useNestedProp-Bu958azG.cjs} +1 -1
  25. package/dist/{useNestedProp-3oLbIjGJ.js → useNestedProp-Ka0R_Yqa.js} +1 -1
  26. package/dist/{usePrinter-7L_B-x1F.js → usePrinter-D83W2gfG.js} +1 -1
  27. package/dist/{usePrinter-BzVsUZ9_.cjs → usePrinter-pDOF3CfL.cjs} +1 -1
  28. package/dist/{vue-data-ui-Cp4r0fLf.js → vue-data-ui-DgmXnSUU.js} +60 -60
  29. package/dist/{vue-data-ui-CFnKc2Ol.cjs → vue-data-ui-Ot5xYhbV.cjs} +1 -1
  30. package/dist/vue-data-ui.cjs +1 -1
  31. package/dist/vue-data-ui.js +1 -1
  32. package/dist/{vue-ui-3d-bar-DTrJuAnz.cjs → vue-ui-3d-bar-CB0XzatQ.cjs} +1 -1
  33. package/dist/{vue-ui-3d-bar-Cf1Q84nf.js → vue-ui-3d-bar-CqiW8qFZ.js} +9 -9
  34. package/dist/{vue-ui-accordion-D9SRsoRT.js → vue-ui-accordion--5td7b94.js} +3 -3
  35. package/dist/{vue-ui-accordion-Uftgxo97.cjs → vue-ui-accordion-4-dyMgJA.cjs} +1 -1
  36. package/dist/{vue-ui-age-pyramid-BpfajTvk.js → vue-ui-age-pyramid-Bsg0z9ei.js} +10 -10
  37. package/dist/{vue-ui-age-pyramid-CFWWFo_T.cjs → vue-ui-age-pyramid-DNseB8ej.cjs} +1 -1
  38. package/dist/{vue-ui-annotator-CI9JxLDD.cjs → vue-ui-annotator-CHjtF8NT.cjs} +1 -1
  39. package/dist/{vue-ui-annotator-BGErHIWg.js → vue-ui-annotator-obnYFvvq.js} +1 -1
  40. package/dist/{vue-ui-bullet-CCcAE1gt.cjs → vue-ui-bullet-CNWHd7dO.cjs} +1 -1
  41. package/dist/{vue-ui-bullet-CerH0yY6.js → vue-ui-bullet-yKEVhE17.js} +8 -8
  42. package/dist/{vue-ui-candlestick-DaXMRecz.js → vue-ui-candlestick-Cc-Ee4zv.js} +11 -11
  43. package/dist/{vue-ui-candlestick-B0AfUFwT.cjs → vue-ui-candlestick-VBq82rfW.cjs} +1 -1
  44. package/dist/{vue-ui-carousel-table-Ct8iLKVC.js → vue-ui-carousel-table-B6v1NycN.js} +4 -4
  45. package/dist/{vue-ui-carousel-table-DU1f-7PI.cjs → vue-ui-carousel-table-DLwVijSb.cjs} +1 -1
  46. package/dist/{vue-ui-chestnut-BimMImm7.js → vue-ui-chestnut-CekC1moT.js} +8 -8
  47. package/dist/{vue-ui-chestnut-Bo6vX7Xa.cjs → vue-ui-chestnut-DHZbhIf_.cjs} +1 -1
  48. package/dist/{vue-ui-cursor-O8Y4gIKa.cjs → vue-ui-cursor-Bz-jVx3a.cjs} +1 -1
  49. package/dist/{vue-ui-cursor-BqjV3i9U.js → vue-ui-cursor-CISKzkNu.js} +2 -2
  50. package/dist/{vue-ui-dashboard-DNJUgWJ3.cjs → vue-ui-dashboard-PAi8o4AC.cjs} +1 -1
  51. package/dist/{vue-ui-dashboard-BGBnagEV.js → vue-ui-dashboard-w7Ts26Xc.js} +2 -2
  52. package/dist/{vue-ui-digits-D3pzhtVy.cjs → vue-ui-digits-I_lj1m6d.cjs} +1 -1
  53. package/dist/{vue-ui-digits-DUXLRlXF.js → vue-ui-digits-kaBR5FUU.js} +2 -2
  54. package/dist/{vue-ui-donut-eljChQvj.js → vue-ui-donut-BVuaExCl.js} +12 -12
  55. package/dist/{vue-ui-donut-DKME6kEY.cjs → vue-ui-donut-dDpMdK4G.cjs} +1 -1
  56. package/dist/{vue-ui-donut-evolution-DGaEBhHF.cjs → vue-ui-donut-evolution-ChGao_WW.cjs} +1 -1
  57. package/dist/{vue-ui-donut-evolution-HbunKbYi.js → vue-ui-donut-evolution-DAmX1OX-.js} +11 -11
  58. package/dist/{vue-ui-dumbbell-C7Zv4NgK.js → vue-ui-dumbbell-CrQNRN_m.js} +10 -10
  59. package/dist/{vue-ui-dumbbell-CGw-Zwk-.cjs → vue-ui-dumbbell-DsR4RQY9.cjs} +1 -1
  60. package/dist/{vue-ui-flow-DcRyVL45.js → vue-ui-flow-B0lCe4G8.js} +9 -9
  61. package/dist/{vue-ui-flow-DbWddpZi.cjs → vue-ui-flow-Dhcvvzee.cjs} +1 -1
  62. package/dist/{vue-ui-funnel-ByUFSg1s.cjs → vue-ui-funnel-Bu_wMJ98.cjs} +1 -1
  63. package/dist/{vue-ui-funnel-D3G2G4P3.js → vue-ui-funnel-Cinv1hUx.js} +9 -9
  64. package/dist/{vue-ui-galaxy-CXssUv3X.js → vue-ui-galaxy-BcwunIK3.js} +11 -11
  65. package/dist/{vue-ui-galaxy-ad_Bh1lr.cjs → vue-ui-galaxy-zx6O9AuV.cjs} +1 -1
  66. package/dist/{vue-ui-gauge-DEROTsyc.js → vue-ui-gauge-C4W4OAXQ.js} +7 -7
  67. package/dist/{vue-ui-gauge-Bss6mlN7.cjs → vue-ui-gauge-Cb6sxoZI.cjs} +1 -1
  68. package/dist/{vue-ui-gizmo--6Xw6Dh6.js → vue-ui-gizmo-D4VHyFmN.js} +3 -3
  69. package/dist/{vue-ui-gizmo-D4CEw0HZ.cjs → vue-ui-gizmo-DBSYx24z.cjs} +1 -1
  70. package/dist/{vue-ui-heatmap-q8JmNnG2.js → vue-ui-heatmap-C3WHfifV.js} +10 -10
  71. package/dist/{vue-ui-heatmap-DwCve3RN.cjs → vue-ui-heatmap-CBNt4Huo.cjs} +1 -1
  72. package/dist/{vue-ui-history-plot-DaZNgu_Z.cjs → vue-ui-history-plot-Dp8Llb3A.cjs} +1 -1
  73. package/dist/{vue-ui-history-plot-DnT-Ao3t.js → vue-ui-history-plot-dJp-Lai2.js} +11 -11
  74. package/dist/{vue-ui-kpi-IXgBP9oJ.js → vue-ui-kpi-B3XhowYx.js} +3 -3
  75. package/dist/{vue-ui-kpi-Dn49_E2W.cjs → vue-ui-kpi-Dnp8IUyb.cjs} +1 -1
  76. package/dist/{vue-ui-mini-loader-CiVFd_Pp.cjs → vue-ui-mini-loader-BgwhuEda.cjs} +1 -1
  77. package/dist/{vue-ui-mini-loader-Cm88qObv.js → vue-ui-mini-loader-Cca7PA4v.js} +2 -2
  78. package/dist/{vue-ui-molecule-Cu92ujex.cjs → vue-ui-molecule-B1AocG3H.cjs} +1 -1
  79. package/dist/{vue-ui-molecule-C27vhrLA.js → vue-ui-molecule-BcZNqWfD.js} +11 -11
  80. package/dist/{vue-ui-mood-radar-DvkK8J8b.cjs → vue-ui-mood-radar-Cn65TQEs.cjs} +1 -1
  81. package/dist/{vue-ui-mood-radar-DIJ9q9Cc.js → vue-ui-mood-radar-HjLL0ZZ8.js} +11 -11
  82. package/dist/{vue-ui-nested-donuts-CcqhlN0R.js → vue-ui-nested-donuts-BIqySYG_.js} +11 -11
  83. package/dist/{vue-ui-nested-donuts-DMaF0m31.cjs → vue-ui-nested-donuts-CymFt4B3.cjs} +1 -1
  84. package/dist/{vue-ui-onion-D20_PGGT.cjs → vue-ui-onion-BLMFR0GK.cjs} +1 -1
  85. package/dist/{vue-ui-onion-DQOu8srN.js → vue-ui-onion-muCAMEG8.js} +11 -11
  86. package/dist/{vue-ui-parallel-coordinate-plot-DEtBAZkv.js → vue-ui-parallel-coordinate-plot-DYOlnKPw.js} +12 -12
  87. package/dist/{vue-ui-parallel-coordinate-plot-CDDv5TXW.cjs → vue-ui-parallel-coordinate-plot-i-hhfnwF.cjs} +1 -1
  88. package/dist/{vue-ui-quadrant-CVKT0Mil.cjs → vue-ui-quadrant-DJPOp1-A.cjs} +1 -1
  89. package/dist/{vue-ui-quadrant-9nixb7y0.js → vue-ui-quadrant-TU5fWoEw.js} +12 -12
  90. package/dist/{vue-ui-quick-chart-DOqmZQuC.cjs → vue-ui-quick-chart-CTJxOisL.cjs} +1 -1
  91. package/dist/{vue-ui-quick-chart-BBWe0rII.js → vue-ui-quick-chart-DzuUofFN.js} +9 -9
  92. package/dist/{vue-ui-radar-C_HKZN_s.js → vue-ui-radar-C0WA20R8.js} +12 -12
  93. package/dist/{vue-ui-radar-crw-BUWI.cjs → vue-ui-radar-D4xX7TNQ.cjs} +1 -1
  94. package/dist/{vue-ui-rating-D9C-jHN_.cjs → vue-ui-rating-C2JILb2g.cjs} +1 -1
  95. package/dist/{vue-ui-rating-Bb5D2NLX.js → vue-ui-rating-DUcyhyrN.js} +2 -2
  96. package/dist/{vue-ui-relation-circle-D94QdFpd.js → vue-ui-relation-circle-BYlIjbUK.js} +7 -7
  97. package/dist/{vue-ui-relation-circle-BeinsphZ.cjs → vue-ui-relation-circle-D-Wxskec.cjs} +1 -1
  98. package/dist/{vue-ui-rings-8X_K59uf.cjs → vue-ui-rings-CsXVOIn3.cjs} +1 -1
  99. package/dist/{vue-ui-rings-B9WghU7W.js → vue-ui-rings-w4KQSfym.js} +12 -12
  100. package/dist/{vue-ui-scatter-BcGcpFFg.cjs → vue-ui-scatter--5Ob2lKM.cjs} +1 -1
  101. package/dist/{vue-ui-scatter-DOOY2ZmO.js → vue-ui-scatter-CfgCA3Di.js} +12 -12
  102. package/dist/{vue-ui-screenshot--dGw9WTO.js → vue-ui-screenshot-BsD3ySuA.js} +1 -1
  103. package/dist/{vue-ui-screenshot-kqXcFrbS.cjs → vue-ui-screenshot-UEVUHXWY.cjs} +1 -1
  104. package/dist/{vue-ui-skeleton-Dm5NZ_MQ.cjs → vue-ui-skeleton-D_YCUi1y.cjs} +1 -1
  105. package/dist/{vue-ui-skeleton-Bzsl5gab.js → vue-ui-skeleton-DpadzgbS.js} +3 -3
  106. package/dist/{vue-ui-smiley-CHDBpGz6.js → vue-ui-smiley-BHqeb-Ol.js} +2 -2
  107. package/dist/{vue-ui-smiley-CzUbbfNC.cjs → vue-ui-smiley-C32dLhtP.cjs} +1 -1
  108. package/dist/{vue-ui-spark-trend-CBuzPxBw.cjs → vue-ui-spark-trend-Bt2wpc5C.cjs} +1 -1
  109. package/dist/{vue-ui-spark-trend-DDmtsL-M.js → vue-ui-spark-trend-NAcB2zZ1.js} +5 -5
  110. package/dist/{vue-ui-sparkbar-clHgL-Jf.js → vue-ui-sparkbar-BPpSxe5Z.js} +4 -4
  111. package/dist/{vue-ui-sparkbar-BOWdoskI.cjs → vue-ui-sparkbar-CgoGRT0_.cjs} +1 -1
  112. package/dist/{vue-ui-sparkgauge-ClpG_Qy_.js → vue-ui-sparkgauge-C1mW3KbZ.js} +4 -4
  113. package/dist/{vue-ui-sparkgauge-BCpab_To.cjs → vue-ui-sparkgauge-frN6uK_L.cjs} +1 -1
  114. package/dist/{vue-ui-sparkhistogram-_-2qzDRQ.cjs → vue-ui-sparkhistogram-CqQY434G.cjs} +1 -1
  115. package/dist/{vue-ui-sparkhistogram-DtcZvaVe.js → vue-ui-sparkhistogram-HgBi5OvP.js} +5 -5
  116. package/dist/{vue-ui-sparkline-Hw74DjL2.js → vue-ui-sparkline-BABBXY2c.js} +4 -4
  117. package/dist/{vue-ui-sparkline-BiPWJRwq.cjs → vue-ui-sparkline-XOa6LfX2.cjs} +1 -1
  118. package/dist/{vue-ui-sparkstackbar-C65Dz1NY.cjs → vue-ui-sparkstackbar-B4Xduiv1.cjs} +1 -1
  119. package/dist/{vue-ui-sparkstackbar-BvdFMu7C.js → vue-ui-sparkstackbar-Ch3JvFBq.js} +5 -5
  120. package/dist/{vue-ui-stackbar-CUbWqpvI.cjs → vue-ui-stackbar-CH8tLDZq.cjs} +1 -1
  121. package/dist/{vue-ui-stackbar-DHihhNbH.js → vue-ui-stackbar-JIEn0g7t.js} +13 -13
  122. package/dist/{vue-ui-strip-plot-CuoQTnRG.cjs → vue-ui-strip-plot-BkWzm1mI.cjs} +1 -1
  123. package/dist/{vue-ui-strip-plot-BeRtOGC8.js → vue-ui-strip-plot-RZu43QbP.js} +11 -11
  124. package/dist/{vue-ui-table-00JpIXEn.js → vue-ui-table-CJ2gGmYi.js} +1 -1
  125. package/dist/{vue-ui-table-C6jU1DC3.cjs → vue-ui-table-CgtE4HWs.cjs} +1 -1
  126. package/dist/{vue-ui-table-heatmap-iRdyUnBz.js → vue-ui-table-heatmap-B_TfeHsa.js} +4 -4
  127. package/dist/{vue-ui-table-heatmap-BKwt85XQ.cjs → vue-ui-table-heatmap-DxTs_PZF.cjs} +1 -1
  128. package/dist/{vue-ui-table-sparkline-B4S_DJRU.js → vue-ui-table-sparkline-DqMH7xbY.js} +5 -5
  129. package/dist/{vue-ui-table-sparkline-Z-VfjBcc.cjs → vue-ui-table-sparkline-PA9L6AjE.cjs} +1 -1
  130. package/dist/{vue-ui-thermometer-MNfpy-bk.cjs → vue-ui-thermometer-AwZdEG3j.cjs} +1 -1
  131. package/dist/{vue-ui-thermometer-BVETzQ_9.js → vue-ui-thermometer-D7aR0elr.js} +7 -7
  132. package/dist/{vue-ui-timer-DzzNUzOv.cjs → vue-ui-timer-C6fnDeD8.cjs} +1 -1
  133. package/dist/{vue-ui-timer-Dafx7lL2.js → vue-ui-timer-C9sO9AoQ.js} +5 -5
  134. package/dist/{vue-ui-tiremarks-VmJ74REn.cjs → vue-ui-tiremarks-Dje0I1vf.cjs} +1 -1
  135. package/dist/{vue-ui-tiremarks-DvIZxZFn.js → vue-ui-tiremarks-KvOyYNVW.js} +7 -7
  136. package/dist/{vue-ui-treemap-Bqurrxbn.js → vue-ui-treemap-BPxLXNZ5.js} +11 -11
  137. package/dist/{vue-ui-treemap-jtIS1DF3.cjs → vue-ui-treemap-C2Vrj3tg.cjs} +1 -1
  138. package/dist/{vue-ui-vertical-bar-CAQNpuVV.js → vue-ui-vertical-bar-BAdSzbYU.js} +12 -12
  139. package/dist/{vue-ui-vertical-bar-B7gHw4NU.cjs → vue-ui-vertical-bar-_MWpPkwZ.cjs} +1 -1
  140. package/dist/{vue-ui-waffle-BW2oPwaN.js → vue-ui-waffle-CW1UVf-q.js} +12 -12
  141. package/dist/{vue-ui-waffle-Bx-yIwH9.cjs → vue-ui-waffle-DfJI5Lez.cjs} +1 -1
  142. package/dist/{vue-ui-wheel-DdBcwGLj.cjs → vue-ui-wheel-CzZEsjmd.cjs} +1 -1
  143. package/dist/{vue-ui-wheel-LE-u6_KV.js → vue-ui-wheel-DAwYc7XY.js} +7 -7
  144. package/dist/{vue-ui-word-cloud-C1X5oYBt.cjs → vue-ui-word-cloud-BEyV6jMo.cjs} +1 -1
  145. package/dist/{vue-ui-word-cloud-CjCNiXGN.js → vue-ui-word-cloud-BzfYkI08.js} +10 -10
  146. package/dist/vue-ui-xy-BolkwiXB.cjs +3 -0
  147. package/dist/{vue-ui-xy-jjjT4XDo.js → vue-ui-xy-CJYGMbMt.js} +610 -609
  148. package/dist/{vue-ui-xy-canvas-CBx1LM4e.cjs → vue-ui-xy-canvas-DkltjVWN.cjs} +1 -1
  149. package/dist/{vue-ui-xy-canvas-BgWkLI4n.js → vue-ui-xy-canvas-sB1dmJQc.js} +11 -11
  150. package/package.json +1 -1
  151. package/dist/vue-ui-xy-Dr_MT-o-.cjs +0 -3
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-CbMyzHGj.cjs"),ae=require("./useResponsive-BJ7DTGpm.cjs"),ye=require("./Title-BzcIyo-x.cjs"),re=require("./usePrinter-BzVsUZ9_.cjs"),be=require("./Tooltip-DWo9kakv.cjs"),ge=require("./DataTable-D0qYxBVZ.cjs"),ke=require("./vue-ui-skeleton-Dm5NZ_MQ.cjs"),xe=require("./Shape-BO7Gprqr.cjs"),Ce=require("./vue-ui-accordion-Uftgxo97.cjs"),se=require("./useNestedProp-DqPx8kFh.cjs"),we=require("./PackageVersion-sBYhtscP.cjs"),Be=require("./PenAndPaper-CHz_Iy5T.cjs"),Se=require("./useUserOptionState-BgepsfED.cjs"),Ne=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),$e=["id"],_e=["xmlns","viewBox"],Te=["x","y","width","height"],Le={key:1},Pe={key:0},Ee=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],ze={key:1},Ae=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],Ve=["x1","x2","y1","y2","stroke","stroke-width"],Oe=["x1","x2","y1","y2","stroke","stroke-width"],Fe=["x","y","fill","font-size"],De=["x","y","font-size","fill"],Me=["fill","font-size","transform"],We=["fill","font-size","x","y"],Ie=["x1","x2","y1","y2","stroke"],qe=["cx","cy","fill"],Ge=["cx","cy","fill"],Ue=["id"],Re=["stop-color"],He=["stop-color"],je=["stop-color"],Xe={key:0},Ye=["x","y","font-size","fill"],Je={key:5,class:"vue-data-ui-watermark"},Ke=["innerHTML"],Qe={__name:"vue-ui-strip-plot",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(ne,{expose:ue,emit:ie}){const v=ne,{vue_ui_strip_plot:ce}=r.useConfig(),p=e.computed({get(){return!!v.dataset&&v.dataset.length},set(l){return l}}),L=e.ref(r.createUid()),F=e.ref(0),P=e.ref(!1),E=e.ref(""),y=e.ref(null),D=e.ref(null),M=e.ref(null),W=e.ref(null),I=e.ref(!1),q=e.ref(0),G=e.ref(0),t=e.computed({get:()=>H(),set:l=>l}),{userOptionsVisible:z,setUserOptionsVisibility:U,keepUserOptionState:R}=Se.useUserOptionState({config:t.value});function H(){const l=se.useNestedProp({userConfig:v.config,defaultConfig:ce});return l.theme?{...se.useNestedProp({userConfig:r.themes.vue_ui_strip_plot[l.theme]||v.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}e.watch(()=>v.config,l=>{t.value=H(),z.value=!t.value.showOnChartHover,j(),q.value+=1,G.value+=1},{deep:!0});const C=e.ref(null);e.onMounted(()=>{j()});function j(){if(r.objectIsEmpty(v.dataset)?r.error({componentName:"VueUiStripPlot",type:"dataset"}):v.dataset.forEach((l,s)=>{r.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","plots"]}).forEach(o=>{p.value=!1,r.error({componentName:"VueUiStripPlot",type:"datasetSerieAttribute",property:o,index:s})}),l.plots&&l.plots.forEach((o,n)=>{r.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name","value"]}).forEach(u=>{p.value=!1,r.error({componentName:"VueUiStripPlot",type:"datasetSerieAttribute",property:u,index:`${s},${n}`})})})}),t.value.responsive){const l=ae.throttle(()=>{const{width:s,height:o}=ae.useResponsive({chart:y.value,title:t.value.style.chart.title.text?D.value:null,source:M.value,noTitle:W.value});w.value=o,b.value.width=s,b.value.height=o,x.value=(s-d.value.left-d.value.right)/v.dataset.length,B.value=r.translateSize({relator:Math.min(o,s),adjuster:600,source:t.value.style.chart.plots.radius,threshold:6,fallback:6})});C.value=new ResizeObserver(l),C.value.observe(y.value.parentNode)}I.value=!0,setTimeout(()=>{k.value=!1},de.value*50)}e.onBeforeUnmount(()=>{C.value&&C.value.disconnect()});const{isPrinting:X,isImaging:Y,generatePdf:J,generateImage:K}=re.usePrinter({elementId:`strip-plot_${L.value}`,fileName:t.value.style.chart.title.text||"vue-ui-strip-plot"}),ve=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),Q=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),k=e.ref(t.value.useCssAnimation),c=e.ref({showTable:t.value.table.show,dataLabels:{show:t.value.style.chart.labels.bestPlotLabel.show},showTooltip:t.value.style.chart.tooltip.show}),d=e.ref({top:t.value.style.chart.padding.top,bottom:t.value.style.chart.padding.bottom,left:t.value.style.chart.padding.left,right:t.value.style.chart.padding.right}),x=e.ref(t.value.style.chart.stripWidth),w=e.ref(t.value.style.chart.height),B=e.ref(t.value.style.chart.plots.radius),b=e.ref({width:x.value*v.dataset.length+d.value.left+d.value.right,height:t.value.style.chart.height}),a=e.computed(()=>{const l=x.value*v.dataset.length+d.value.left+d.value.right;return{left:d.value.left,right:l-d.value.right,top:d.value.top,bottom:w.value-d.value.bottom,width:x.value*v.dataset.length,height:w.value-d.value.top-d.value.bottom,stripWidth:x.value,absoluteHeight:w.value,absoluteWidth:l}}),S=e.computed(()=>p.value?v.dataset.map((l,s)=>{const o=r.createUid();return{...l,id:o,color:l.color?r.convertColorToHex(l.color):Q.value[s]||r.palette[s]||r.palette[s%r.palette.length],plots:l.plots.map(n=>({...n,value:r.checkNaN(n.value),parentId:o,color:l.color?r.convertColorToHex(l.color):Q.value[s]||r.palette[s]||r.palette[s%r.palette.length],id:r.createUid()})).sort((n,u)=>n.value-u.value)}}):null),h=e.computed(()=>(S.value||[]).map((l,s)=>({...l,plots:l.plots.map(o=>({...o,x:a.value.left+(s+1)*a.value.stripWidth-a.value.stripWidth/2}))}))),de=e.computed(()=>Math.max(...h.value.map(l=>l.plots.length))),A=e.computed(()=>{const l=h.value.flatMap(s=>s.plots.map(o=>o.value));return{max:Math.max(...l),min:Math.min(...l)}}),m=e.computed(()=>r.calculateNiceScale(A.value.min<0?A.value.min:0,A.value.max,t.value.style.chart.grid.scaleSteps)),he=e.computed(()=>(h.value||[]).map((l,s)=>({...l,plots:l.plots.map(o=>({...o,y:a.value.bottom-(o.value+Math.abs(m.value.min))/(m.value.max+Math.abs(m.value.min))*a.value.height}))}))),Z=e.computed(()=>m.value.ticks.map(l=>({y:a.value.bottom-a.value.height*((l+Math.abs(m.value.min))/(m.value.max+Math.abs(m.value.min))),x1:a.value.left,x2:a.value.right,value:l}))),V=e.ref(null),i=e.ref(null);function pe({datapoint:l,seriesIndex:s}){V.value={datapoint:l,seriesIndex:s,config:t.value,series:S.value},P.value=!0,i.value=l;const o=t.value.style.chart.tooltip.customFormat;if(r.isFunction(o)&&r.functionReturnsString(()=>o({seriesIndex:s,datapoint:l,series:S.value,config:t.value})))E.value=o({seriesIndex:s,datapoint:l,series:S.value,config:t.value});else{let n="";n+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${t.value.style.chart.plots.gradient.show?`url(#${l.parentId})`:l.color}"/></svg>${l.name}</div>`,n+=`<div>${r.applyDataLabel(t.value.style.chart.labels.formatter,l.value,r.dataLabel({p:t.value.style.chart.labels.prefix,v:l.value,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:l,seriesIndex:s})}</div>`,E.value=`<div>${n}</div>`}}const N=e.computed(()=>{const l=h.value.flatMap(o=>JSON.parse(JSON.stringify(o.plots)).sort((n,u)=>u.value-n.value).map(n=>({name:`${o.name} - ${n.name}`,color:n.color}))),s=h.value.flatMap(o=>JSON.parse(JSON.stringify(o.plots)).sort((n,u)=>u.value-n.value).map(n=>n.value));return{head:l,body:s}});function ee(){e.nextTick(()=>{const l=N.value.head.map((n,u)=>[[n.name],[N.value.body[u]]]),s=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.series],[t.value.table.columnNames.value]]].concat(l),o=r.createCsvContent(s);r.downloadCsv({csvContent:o,title:t.value.style.chart.title.text||"vue-ui-strip-plot"})})}const $=e.computed(()=>{const l=[t.value.table.columnNames.series,t.value.table.columnNames.value],s=N.value.head.map((u,f)=>{const T=r.dataLabel({p:t.value.style.chart.labels.prefix,v:N.value.body[f],s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue});return[{color:u.color,name:u.name},T]}),o={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value],head:l,body:s,config:o}}),g=e.ref(!1);function me(l){g.value=l,F.value+=1}function fe(){return h.value}function te(){c.value.showTable=!c.value.showTable}function le(){c.value.dataLabels.show=!c.value.dataLabels.show}function oe(){c.value.showTooltip=!c.value.showTooltip}const _=e.ref(!1);function O(){_.value=!_.value}return ue({getData:fe,generatePdf:J,generateCsv:ee,generateImage:K,toggleTable:te,toggleLabels:le,toggleTooltip:oe,toggleAnnotator:O}),(l,s)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"stripPlotChart",ref:y,class:e.normalizeClass(`vue-ui-strip-plot ${g.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height:100%":""}`),id:`strip-plot_${L.value}`,onMouseenter:s[2]||(s[2]=()=>e.unref(U)(!0)),onMouseleave:s[3]||(s[3]=()=>e.unref(U)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Be.PenAndPaper,{key:0,parent:y.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:_.value,onClose:O},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),ve.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:W,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:D,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(ye._sfc_main,{key:`title_${q.value}`,config:{title:{cy:"donut-div-title",...t.value.style.chart.title},subtitle:{cy:"donut-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&p.value&&(e.unref(R)||e.unref(z))?(e.openBlock(),e.createBlock(re.UserOptions,{ref:"details",key:`user_option_${F.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(X),isImaging:e.unref(Y),uid:L.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasLabel:t.value.userOptions.buttons.labels,hasFullscreen:t.value.userOptions.buttons.fullscreen,isTooltip:c.value.showTooltip,isFullscreen:g.value,titles:{...t.value.userOptions.buttonTitles},chartElement:y.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:_.value,onToggleFullscreen:me,onGeneratePdf:e.unref(J),onGenerateCsv:ee,onGenerateImage:e.unref(K),onToggleTable:te,onToggleLabels:le,onToggleTooltip:oe,onToggleAnnotator:O,style:e.normalizeStyle({visibility:e.unref(R)?e.unref(z)?"visible":"hidden":"visible"})},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionLabels?{name:"optionLabels",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionLabels",{},void 0,!0)]),key:"5"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:n})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:n})),void 0,!0)]),key:"6"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:n})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:n})),void 0,!0)]),key:"7"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasLabel","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":g.value,"vue-data-ui-fulscreen--off":!g.value}),viewBox:`0 0 ${b.value.width<=0?10:b.value.width} ${b.value.height<=0?10:b.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color};`)},[e.createVNode(we._sfc_main),l.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:a.value.left,y:a.value.top,width:a.value.width,height:a.value.height,style:{pointerEvents:"none"}},[e.renderSlot(l.$slots,"chart-background",{},void 0,!0)],8,Te)):e.createCommentVNode("",!0),t.value.style.chart.grid.show?(e.openBlock(),e.createElementBlock("g",Le,[t.value.style.chart.grid.horizontalGrid.show?(e.openBlock(),e.createElementBlock("g",Pe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Z.value,o=>(e.openBlock(),e.createElementBlock("line",{x1:o.x1,x2:o.x2,y1:o.y,y2:o.y,stroke:t.value.style.chart.grid.horizontalGrid.stroke,"stroke-width":t.value.style.chart.grid.horizontalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.horizontalGrid.strokeDasharray,"stroke-linecap":"round"},null,8,Ee))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.verticalGrid.show?(e.openBlock(),e.createElementBlock("g",ze,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,n)=>(e.openBlock(),e.createElementBlock("line",{x1:a.value.left+(n+1)*a.value.stripWidth,x2:a.value.left+(n+1)*a.value.stripWidth,y1:a.value.top,y2:a.value.bottom,stroke:t.value.style.chart.grid.verticalGrid.stroke,"stroke-width":t.value.style.chart.grid.verticalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.verticalGrid.strokeDasharray,"stroke-linecap":"round"},null,8,Ae))),256))])):e.createCommentVNode("",!0),e.createElementVNode("line",{x1:a.value.left,x2:a.value.left,y1:a.value.top,y2:a.value.bottom,stroke:t.value.style.chart.grid.stroke,"stroke-width":t.value.style.chart.grid.strokeWidth,"stroke-linecap":"round"},null,8,Ve),e.createElementVNode("line",{x1:a.value.left,x2:a.value.right,y1:a.value.bottom,y2:a.value.bottom,stroke:t.value.style.chart.grid.stroke,"stroke-width":t.value.style.chart.grid.strokeWidth,"stroke-linecap":"round"},null,8,Oe)])):e.createCommentVNode("",!0),t.value.style.chart.labels.yAxisLabels.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(Z.value,(o,n)=>(e.openBlock(),e.createElementBlock("text",{x:o.x1-t.value.style.chart.labels.yAxisLabels.fontSize/2+t.value.style.chart.labels.yAxisLabels.offsetX,y:o.y+t.value.style.chart.labels.yAxisLabels.fontSize/3,fill:t.value.style.chart.labels.yAxisLabels.color,"font-size":t.value.style.chart.labels.yAxisLabels.fontSize,"text-anchor":"end"},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.labels.formatter,o.value,e.unref(r.dataLabel)({p:t.value.style.chart.labels.prefix,v:o.value,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.labels.yAxisLabels.rounding}),{datapoint:o,seriesIndex:n})),9,Fe))),256)):e.createCommentVNode("",!0),t.value.style.chart.labels.xAxisLabels.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:3},e.renderList(h.value,(o,n)=>(e.openBlock(),e.createElementBlock("text",{x:a.value.left+(n+1)*a.value.stripWidth-a.value.stripWidth/2,y:a.value.bottom+t.value.style.chart.labels.xAxisLabels.fontSize*2+t.value.style.chart.labels.xAxisLabels.offsetY,"font-size":t.value.style.chart.labels.xAxisLabels.fontSize,fill:t.value.style.chart.labels.xAxisLabels.color,"text-anchor":"middle"},e.toDisplayString(o.name),9,De))),256)):e.createCommentVNode("",!0),t.value.style.chart.labels.axis.yLabel?(e.openBlock(),e.createElementBlock("text",{key:4,fill:t.value.style.chart.labels.axis.color,"font-size":t.value.style.chart.labels.axis.fontSize,transform:`translate(${t.value.style.chart.labels.axis.fontSize+t.value.style.chart.labels.axis.yLabelOffsetX}, ${a.value.top+a.value.height/2}) rotate(-90)`,"text-anchor":"middle"},e.toDisplayString(t.value.style.chart.labels.axis.yLabel),9,Me)):e.createCommentVNode("",!0),t.value.style.chart.labels.axis.xLabel?(e.openBlock(),e.createElementBlock("text",{key:5,fill:t.value.style.chart.labels.axis.color,"font-size":t.value.style.chart.labels.axis.fontSize,x:a.value.left+a.value.width/2,y:a.value.absoluteHeight,"text-anchor":"middle"},e.toDisplayString(t.value.style.chart.labels.axis.xLabel),9,We)):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:6},[e.createElementVNode("line",{x1:a.value.left,x2:a.value.right,y1:i.value.y,y2:i.value.y,stroke:i.value.color,"stroke-width":1,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,Ie),e.createElementVNode("circle",{cx:a.value.left,cy:i.value.y,r:3,fill:i.value.color,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,qe),e.createElementVNode("circle",{cx:a.value.right,cy:i.value.y,r:3,fill:i.value.color,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,Ge)],64)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,o=>(e.openBlock(),e.createElementBlock("radialGradient",{id:o.id,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(r.lightenHexColor)(o.color,t.value.style.chart.plots.gradient.intensity/100)},null,8,Re),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(r.darkenHexColor)(o.color,.1)},null,8,He),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,je)],8,Ue))),256))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(he.value,(o,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.plots,(u,f)=>(e.openBlock(),e.createBlock(xe._sfc_main,e.mergeProps({plot:{x:u.x,y:I.value?u.y:a.value.top},radius:i.value&&i.value.id===u.id?B.value*1.5:B.value,shape:t.value.style.chart.plots.shape,stroke:t.value.style.chart.plots.stroke,strokeWidth:t.value.style.chart.plots.strokeWidth,color:t.value.style.chart.plots.gradient.show?`url(#${o.id})`:o.color,onMouseenter:T=>pe({datapoint:u,seriesIndex:f}),onMouseleave:s[0]||(s[0]=T=>{P.value=!1,i.value=null}),onClick:T=>ie("selectDatapoint",u),style:`transition: all 0.2s ease-in-out; opacity:${i.value?i.value.id===u.id?1:.2:t.value.style.chart.plots.opacity};${k.value?`transition-delay:${f*50}ms`:""}`,class:{"vue-ui-strip-plot-animated":t.value.useCssAnimation&&k.value,"vue-ui-strip-plot-select-circle":t.value.useCssAnimation&&!k.value}},l.$attrs),null,16,["plot","radius","shape","stroke","strokeWidth","color","onMouseenter","onClick","style","class"]))),256)),c.value.dataLabels.show?(e.openBlock(),e.createElementBlock("g",Xe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.plots,(u,f)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[f===o.plots.length-1||i.value&&i.value.id===u.id&&!c.value.showTooltip?(e.openBlock(),e.createElementBlock("text",{key:0,x:u.x,y:u.y+t.value.style.chart.labels.bestPlotLabel.offsetY-B.value*(i.value&&i.value.id===u.id&&!c.value.showTooltip?2:1.5),"font-size":t.value.style.chart.labels.bestPlotLabel.fontSize,fill:t.value.style.chart.labels.bestPlotLabel.color,"text-anchor":"middle",style:e.normalizeStyle(`opacity:${t.value.useCssAnimation&&k.value?0:1};transition:opacity 0.2s ease-in;`)},e.toDisplayString(u.name)+" "+e.toDisplayString(t.value.style.chart.labels.bestPlotLabel.showValue?e.unref(r.applyDataLabel)(t.value.style.chart.labels.formatter,u.value,e.unref(r.dataLabel)({p:`(${t.value.style.chart.labels.prefix}`,v:u.value,s:`${t.value.style.chart.labels.suffix})`,r:t.value.style.chart.labels.bestPlotLabel.rounding}),{datapoint:u,seriesIndex:f}):""),13,Ye)):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0)],64))),256)),e.renderSlot(l.$slots,"svg",{svg:a.value},void 0,!0)],14,_e)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Je,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(X)||e.unref(Y)})),void 0,!0)])):e.createCommentVNode("",!0),p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ke.default,{key:6,config:{type:"stripPlot",style:{backgroundColor:t.value.style.chart.backgroundColor,stripPlot:{color:"#CCCCCC"}}}},null,8,["config"])),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:M,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(be._sfc_main,{show:c.value.showTooltip&&P.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,fontSize:t.value.style.chart.tooltip.fontSize,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:y.value,content:E.value,isFullscreen:g.value,isCustom:e.unref(r.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...V.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...V.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isFullscreen","isCustom"]),p.value?(e.openBlock(),e.createBlock(Ce.default,{key:8,hideDetails:"",config:{open:c.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(ge.DataTable,{key:`table_${G.value}`,colNames:$.value.colNames,head:$.value.head,body:$.value.body,config:$.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:s[1]||(s[1]=o=>c.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,Ke)]),td:e.withCtx(({td:o})=>[e.createTextVNode(e.toDisplayString(o.name||o),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,$e))}},Ze=Ne._export_sfc(Qe,[["__scopeId","data-v-375e8dc0"]]);exports.default=Ze;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-KJL8ra_6.cjs"),ae=require("./useResponsive-BJ7DTGpm.cjs"),ye=require("./Title-D-6pIV0l.cjs"),re=require("./usePrinter-pDOF3CfL.cjs"),be=require("./Tooltip-CNox4F8U.cjs"),ge=require("./DataTable-wN-jvOfe.cjs"),ke=require("./vue-ui-skeleton-D_YCUi1y.cjs"),xe=require("./Shape-D7IbPjU8.cjs"),Ce=require("./vue-ui-accordion-4-dyMgJA.cjs"),se=require("./useNestedProp-Bu958azG.cjs"),we=require("./PackageVersion-Dn-t7tbm.cjs"),Be=require("./PenAndPaper-DFXJJink.cjs"),Se=require("./useUserOptionState-BgepsfED.cjs"),Ne=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),$e=["id"],_e=["xmlns","viewBox"],Te=["x","y","width","height"],Le={key:1},Pe={key:0},Ee=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],ze={key:1},Ae=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],Ve=["x1","x2","y1","y2","stroke","stroke-width"],Oe=["x1","x2","y1","y2","stroke","stroke-width"],Fe=["x","y","fill","font-size"],De=["x","y","font-size","fill"],Me=["fill","font-size","transform"],We=["fill","font-size","x","y"],Ie=["x1","x2","y1","y2","stroke"],qe=["cx","cy","fill"],Ge=["cx","cy","fill"],Ue=["id"],Re=["stop-color"],He=["stop-color"],je=["stop-color"],Xe={key:0},Ye=["x","y","font-size","fill"],Je={key:5,class:"vue-data-ui-watermark"},Ke=["innerHTML"],Qe={__name:"vue-ui-strip-plot",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(ne,{expose:ue,emit:ie}){const v=ne,{vue_ui_strip_plot:ce}=r.useConfig(),p=e.computed({get(){return!!v.dataset&&v.dataset.length},set(l){return l}}),L=e.ref(r.createUid()),F=e.ref(0),P=e.ref(!1),E=e.ref(""),y=e.ref(null),D=e.ref(null),M=e.ref(null),W=e.ref(null),I=e.ref(!1),q=e.ref(0),G=e.ref(0),t=e.computed({get:()=>H(),set:l=>l}),{userOptionsVisible:z,setUserOptionsVisibility:U,keepUserOptionState:R}=Se.useUserOptionState({config:t.value});function H(){const l=se.useNestedProp({userConfig:v.config,defaultConfig:ce});return l.theme?{...se.useNestedProp({userConfig:r.themes.vue_ui_strip_plot[l.theme]||v.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}e.watch(()=>v.config,l=>{t.value=H(),z.value=!t.value.showOnChartHover,j(),q.value+=1,G.value+=1},{deep:!0});const C=e.ref(null);e.onMounted(()=>{j()});function j(){if(r.objectIsEmpty(v.dataset)?r.error({componentName:"VueUiStripPlot",type:"dataset"}):v.dataset.forEach((l,s)=>{r.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","plots"]}).forEach(o=>{p.value=!1,r.error({componentName:"VueUiStripPlot",type:"datasetSerieAttribute",property:o,index:s})}),l.plots&&l.plots.forEach((o,n)=>{r.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name","value"]}).forEach(u=>{p.value=!1,r.error({componentName:"VueUiStripPlot",type:"datasetSerieAttribute",property:u,index:`${s},${n}`})})})}),t.value.responsive){const l=ae.throttle(()=>{const{width:s,height:o}=ae.useResponsive({chart:y.value,title:t.value.style.chart.title.text?D.value:null,source:M.value,noTitle:W.value});w.value=o,b.value.width=s,b.value.height=o,x.value=(s-d.value.left-d.value.right)/v.dataset.length,B.value=r.translateSize({relator:Math.min(o,s),adjuster:600,source:t.value.style.chart.plots.radius,threshold:6,fallback:6})});C.value=new ResizeObserver(l),C.value.observe(y.value.parentNode)}I.value=!0,setTimeout(()=>{k.value=!1},de.value*50)}e.onBeforeUnmount(()=>{C.value&&C.value.disconnect()});const{isPrinting:X,isImaging:Y,generatePdf:J,generateImage:K}=re.usePrinter({elementId:`strip-plot_${L.value}`,fileName:t.value.style.chart.title.text||"vue-ui-strip-plot"}),ve=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),Q=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),k=e.ref(t.value.useCssAnimation),c=e.ref({showTable:t.value.table.show,dataLabels:{show:t.value.style.chart.labels.bestPlotLabel.show},showTooltip:t.value.style.chart.tooltip.show}),d=e.ref({top:t.value.style.chart.padding.top,bottom:t.value.style.chart.padding.bottom,left:t.value.style.chart.padding.left,right:t.value.style.chart.padding.right}),x=e.ref(t.value.style.chart.stripWidth),w=e.ref(t.value.style.chart.height),B=e.ref(t.value.style.chart.plots.radius),b=e.ref({width:x.value*v.dataset.length+d.value.left+d.value.right,height:t.value.style.chart.height}),a=e.computed(()=>{const l=x.value*v.dataset.length+d.value.left+d.value.right;return{left:d.value.left,right:l-d.value.right,top:d.value.top,bottom:w.value-d.value.bottom,width:x.value*v.dataset.length,height:w.value-d.value.top-d.value.bottom,stripWidth:x.value,absoluteHeight:w.value,absoluteWidth:l}}),S=e.computed(()=>p.value?v.dataset.map((l,s)=>{const o=r.createUid();return{...l,id:o,color:l.color?r.convertColorToHex(l.color):Q.value[s]||r.palette[s]||r.palette[s%r.palette.length],plots:l.plots.map(n=>({...n,value:r.checkNaN(n.value),parentId:o,color:l.color?r.convertColorToHex(l.color):Q.value[s]||r.palette[s]||r.palette[s%r.palette.length],id:r.createUid()})).sort((n,u)=>n.value-u.value)}}):null),h=e.computed(()=>(S.value||[]).map((l,s)=>({...l,plots:l.plots.map(o=>({...o,x:a.value.left+(s+1)*a.value.stripWidth-a.value.stripWidth/2}))}))),de=e.computed(()=>Math.max(...h.value.map(l=>l.plots.length))),A=e.computed(()=>{const l=h.value.flatMap(s=>s.plots.map(o=>o.value));return{max:Math.max(...l),min:Math.min(...l)}}),m=e.computed(()=>r.calculateNiceScale(A.value.min<0?A.value.min:0,A.value.max,t.value.style.chart.grid.scaleSteps)),he=e.computed(()=>(h.value||[]).map((l,s)=>({...l,plots:l.plots.map(o=>({...o,y:a.value.bottom-(o.value+Math.abs(m.value.min))/(m.value.max+Math.abs(m.value.min))*a.value.height}))}))),Z=e.computed(()=>m.value.ticks.map(l=>({y:a.value.bottom-a.value.height*((l+Math.abs(m.value.min))/(m.value.max+Math.abs(m.value.min))),x1:a.value.left,x2:a.value.right,value:l}))),V=e.ref(null),i=e.ref(null);function pe({datapoint:l,seriesIndex:s}){V.value={datapoint:l,seriesIndex:s,config:t.value,series:S.value},P.value=!0,i.value=l;const o=t.value.style.chart.tooltip.customFormat;if(r.isFunction(o)&&r.functionReturnsString(()=>o({seriesIndex:s,datapoint:l,series:S.value,config:t.value})))E.value=o({seriesIndex:s,datapoint:l,series:S.value,config:t.value});else{let n="";n+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${t.value.style.chart.plots.gradient.show?`url(#${l.parentId})`:l.color}"/></svg>${l.name}</div>`,n+=`<div>${r.applyDataLabel(t.value.style.chart.labels.formatter,l.value,r.dataLabel({p:t.value.style.chart.labels.prefix,v:l.value,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:l,seriesIndex:s})}</div>`,E.value=`<div>${n}</div>`}}const N=e.computed(()=>{const l=h.value.flatMap(o=>JSON.parse(JSON.stringify(o.plots)).sort((n,u)=>u.value-n.value).map(n=>({name:`${o.name} - ${n.name}`,color:n.color}))),s=h.value.flatMap(o=>JSON.parse(JSON.stringify(o.plots)).sort((n,u)=>u.value-n.value).map(n=>n.value));return{head:l,body:s}});function ee(){e.nextTick(()=>{const l=N.value.head.map((n,u)=>[[n.name],[N.value.body[u]]]),s=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.series],[t.value.table.columnNames.value]]].concat(l),o=r.createCsvContent(s);r.downloadCsv({csvContent:o,title:t.value.style.chart.title.text||"vue-ui-strip-plot"})})}const $=e.computed(()=>{const l=[t.value.table.columnNames.series,t.value.table.columnNames.value],s=N.value.head.map((u,f)=>{const T=r.dataLabel({p:t.value.style.chart.labels.prefix,v:N.value.body[f],s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue});return[{color:u.color,name:u.name},T]}),o={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value],head:l,body:s,config:o}}),g=e.ref(!1);function me(l){g.value=l,F.value+=1}function fe(){return h.value}function te(){c.value.showTable=!c.value.showTable}function le(){c.value.dataLabels.show=!c.value.dataLabels.show}function oe(){c.value.showTooltip=!c.value.showTooltip}const _=e.ref(!1);function O(){_.value=!_.value}return ue({getData:fe,generatePdf:J,generateCsv:ee,generateImage:K,toggleTable:te,toggleLabels:le,toggleTooltip:oe,toggleAnnotator:O}),(l,s)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"stripPlotChart",ref:y,class:e.normalizeClass(`vue-ui-strip-plot ${g.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height:100%":""}`),id:`strip-plot_${L.value}`,onMouseenter:s[2]||(s[2]=()=>e.unref(U)(!0)),onMouseleave:s[3]||(s[3]=()=>e.unref(U)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Be.PenAndPaper,{key:0,parent:y.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:_.value,onClose:O},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),ve.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:W,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:D,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(ye._sfc_main,{key:`title_${q.value}`,config:{title:{cy:"donut-div-title",...t.value.style.chart.title},subtitle:{cy:"donut-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&p.value&&(e.unref(R)||e.unref(z))?(e.openBlock(),e.createBlock(re.UserOptions,{ref:"details",key:`user_option_${F.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(X),isImaging:e.unref(Y),uid:L.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasLabel:t.value.userOptions.buttons.labels,hasFullscreen:t.value.userOptions.buttons.fullscreen,isTooltip:c.value.showTooltip,isFullscreen:g.value,titles:{...t.value.userOptions.buttonTitles},chartElement:y.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:_.value,onToggleFullscreen:me,onGeneratePdf:e.unref(J),onGenerateCsv:ee,onGenerateImage:e.unref(K),onToggleTable:te,onToggleLabels:le,onToggleTooltip:oe,onToggleAnnotator:O,style:e.normalizeStyle({visibility:e.unref(R)?e.unref(z)?"visible":"hidden":"visible"})},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionLabels?{name:"optionLabels",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionLabels",{},void 0,!0)]),key:"5"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:n})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:n})),void 0,!0)]),key:"6"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:n})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:n})),void 0,!0)]),key:"7"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasLabel","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":g.value,"vue-data-ui-fulscreen--off":!g.value}),viewBox:`0 0 ${b.value.width<=0?10:b.value.width} ${b.value.height<=0?10:b.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color};`)},[e.createVNode(we._sfc_main),l.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:a.value.left,y:a.value.top,width:a.value.width,height:a.value.height,style:{pointerEvents:"none"}},[e.renderSlot(l.$slots,"chart-background",{},void 0,!0)],8,Te)):e.createCommentVNode("",!0),t.value.style.chart.grid.show?(e.openBlock(),e.createElementBlock("g",Le,[t.value.style.chart.grid.horizontalGrid.show?(e.openBlock(),e.createElementBlock("g",Pe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Z.value,o=>(e.openBlock(),e.createElementBlock("line",{x1:o.x1,x2:o.x2,y1:o.y,y2:o.y,stroke:t.value.style.chart.grid.horizontalGrid.stroke,"stroke-width":t.value.style.chart.grid.horizontalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.horizontalGrid.strokeDasharray,"stroke-linecap":"round"},null,8,Ee))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.verticalGrid.show?(e.openBlock(),e.createElementBlock("g",ze,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,n)=>(e.openBlock(),e.createElementBlock("line",{x1:a.value.left+(n+1)*a.value.stripWidth,x2:a.value.left+(n+1)*a.value.stripWidth,y1:a.value.top,y2:a.value.bottom,stroke:t.value.style.chart.grid.verticalGrid.stroke,"stroke-width":t.value.style.chart.grid.verticalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.verticalGrid.strokeDasharray,"stroke-linecap":"round"},null,8,Ae))),256))])):e.createCommentVNode("",!0),e.createElementVNode("line",{x1:a.value.left,x2:a.value.left,y1:a.value.top,y2:a.value.bottom,stroke:t.value.style.chart.grid.stroke,"stroke-width":t.value.style.chart.grid.strokeWidth,"stroke-linecap":"round"},null,8,Ve),e.createElementVNode("line",{x1:a.value.left,x2:a.value.right,y1:a.value.bottom,y2:a.value.bottom,stroke:t.value.style.chart.grid.stroke,"stroke-width":t.value.style.chart.grid.strokeWidth,"stroke-linecap":"round"},null,8,Oe)])):e.createCommentVNode("",!0),t.value.style.chart.labels.yAxisLabels.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(Z.value,(o,n)=>(e.openBlock(),e.createElementBlock("text",{x:o.x1-t.value.style.chart.labels.yAxisLabels.fontSize/2+t.value.style.chart.labels.yAxisLabels.offsetX,y:o.y+t.value.style.chart.labels.yAxisLabels.fontSize/3,fill:t.value.style.chart.labels.yAxisLabels.color,"font-size":t.value.style.chart.labels.yAxisLabels.fontSize,"text-anchor":"end"},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.labels.formatter,o.value,e.unref(r.dataLabel)({p:t.value.style.chart.labels.prefix,v:o.value,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.labels.yAxisLabels.rounding}),{datapoint:o,seriesIndex:n})),9,Fe))),256)):e.createCommentVNode("",!0),t.value.style.chart.labels.xAxisLabels.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:3},e.renderList(h.value,(o,n)=>(e.openBlock(),e.createElementBlock("text",{x:a.value.left+(n+1)*a.value.stripWidth-a.value.stripWidth/2,y:a.value.bottom+t.value.style.chart.labels.xAxisLabels.fontSize*2+t.value.style.chart.labels.xAxisLabels.offsetY,"font-size":t.value.style.chart.labels.xAxisLabels.fontSize,fill:t.value.style.chart.labels.xAxisLabels.color,"text-anchor":"middle"},e.toDisplayString(o.name),9,De))),256)):e.createCommentVNode("",!0),t.value.style.chart.labels.axis.yLabel?(e.openBlock(),e.createElementBlock("text",{key:4,fill:t.value.style.chart.labels.axis.color,"font-size":t.value.style.chart.labels.axis.fontSize,transform:`translate(${t.value.style.chart.labels.axis.fontSize+t.value.style.chart.labels.axis.yLabelOffsetX}, ${a.value.top+a.value.height/2}) rotate(-90)`,"text-anchor":"middle"},e.toDisplayString(t.value.style.chart.labels.axis.yLabel),9,Me)):e.createCommentVNode("",!0),t.value.style.chart.labels.axis.xLabel?(e.openBlock(),e.createElementBlock("text",{key:5,fill:t.value.style.chart.labels.axis.color,"font-size":t.value.style.chart.labels.axis.fontSize,x:a.value.left+a.value.width/2,y:a.value.absoluteHeight,"text-anchor":"middle"},e.toDisplayString(t.value.style.chart.labels.axis.xLabel),9,We)):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:6},[e.createElementVNode("line",{x1:a.value.left,x2:a.value.right,y1:i.value.y,y2:i.value.y,stroke:i.value.color,"stroke-width":1,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,Ie),e.createElementVNode("circle",{cx:a.value.left,cy:i.value.y,r:3,fill:i.value.color,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,qe),e.createElementVNode("circle",{cx:a.value.right,cy:i.value.y,r:3,fill:i.value.color,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,Ge)],64)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,o=>(e.openBlock(),e.createElementBlock("radialGradient",{id:o.id,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(r.lightenHexColor)(o.color,t.value.style.chart.plots.gradient.intensity/100)},null,8,Re),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(r.darkenHexColor)(o.color,.1)},null,8,He),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,je)],8,Ue))),256))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(he.value,(o,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.plots,(u,f)=>(e.openBlock(),e.createBlock(xe._sfc_main,e.mergeProps({plot:{x:u.x,y:I.value?u.y:a.value.top},radius:i.value&&i.value.id===u.id?B.value*1.5:B.value,shape:t.value.style.chart.plots.shape,stroke:t.value.style.chart.plots.stroke,strokeWidth:t.value.style.chart.plots.strokeWidth,color:t.value.style.chart.plots.gradient.show?`url(#${o.id})`:o.color,onMouseenter:T=>pe({datapoint:u,seriesIndex:f}),onMouseleave:s[0]||(s[0]=T=>{P.value=!1,i.value=null}),onClick:T=>ie("selectDatapoint",u),style:`transition: all 0.2s ease-in-out; opacity:${i.value?i.value.id===u.id?1:.2:t.value.style.chart.plots.opacity};${k.value?`transition-delay:${f*50}ms`:""}`,class:{"vue-ui-strip-plot-animated":t.value.useCssAnimation&&k.value,"vue-ui-strip-plot-select-circle":t.value.useCssAnimation&&!k.value}},l.$attrs),null,16,["plot","radius","shape","stroke","strokeWidth","color","onMouseenter","onClick","style","class"]))),256)),c.value.dataLabels.show?(e.openBlock(),e.createElementBlock("g",Xe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.plots,(u,f)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[f===o.plots.length-1||i.value&&i.value.id===u.id&&!c.value.showTooltip?(e.openBlock(),e.createElementBlock("text",{key:0,x:u.x,y:u.y+t.value.style.chart.labels.bestPlotLabel.offsetY-B.value*(i.value&&i.value.id===u.id&&!c.value.showTooltip?2:1.5),"font-size":t.value.style.chart.labels.bestPlotLabel.fontSize,fill:t.value.style.chart.labels.bestPlotLabel.color,"text-anchor":"middle",style:e.normalizeStyle(`opacity:${t.value.useCssAnimation&&k.value?0:1};transition:opacity 0.2s ease-in;`)},e.toDisplayString(u.name)+" "+e.toDisplayString(t.value.style.chart.labels.bestPlotLabel.showValue?e.unref(r.applyDataLabel)(t.value.style.chart.labels.formatter,u.value,e.unref(r.dataLabel)({p:`(${t.value.style.chart.labels.prefix}`,v:u.value,s:`${t.value.style.chart.labels.suffix})`,r:t.value.style.chart.labels.bestPlotLabel.rounding}),{datapoint:u,seriesIndex:f}):""),13,Ye)):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0)],64))),256)),e.renderSlot(l.$slots,"svg",{svg:a.value},void 0,!0)],14,_e)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Je,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(X)||e.unref(Y)})),void 0,!0)])):e.createCommentVNode("",!0),p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ke.default,{key:6,config:{type:"stripPlot",style:{backgroundColor:t.value.style.chart.backgroundColor,stripPlot:{color:"#CCCCCC"}}}},null,8,["config"])),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:M,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(be._sfc_main,{show:c.value.showTooltip&&P.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,fontSize:t.value.style.chart.tooltip.fontSize,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:y.value,content:E.value,isFullscreen:g.value,isCustom:e.unref(r.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...V.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...V.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isFullscreen","isCustom"]),p.value?(e.openBlock(),e.createBlock(Ce.default,{key:8,hideDetails:"",config:{open:c.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(ge.DataTable,{key:`table_${G.value}`,colNames:$.value.colNames,head:$.value.head,body:$.value.body,config:$.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:s[1]||(s[1]=o=>c.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,Ke)]),td:e.withCtx(({td:o})=>[e.createTextVNode(e.toDisplayString(o.name||o),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,$e))}},Ze=Ne._export_sfc(Qe,[["__scopeId","data-v-375e8dc0"]]);exports.default=Ze;
@@ -1,16 +1,16 @@
1
1
  import { computed as d, ref as n, watch as Ge, onMounted as Ue, onBeforeUnmount as Ve, openBlock as s, createElementBlock as u, normalizeClass as F, normalizeStyle as B, unref as v, createBlock as T, createCommentVNode as c, createSlots as Ee, withCtx as f, renderSlot as p, normalizeProps as M, guardReactiveProps as W, createVNode as $e, Fragment as g, renderList as C, createElementVNode as k, toDisplayString as L, mergeProps as He, createTextVNode as Re, nextTick as Be } from "vue";
2
- import { u as Xe, c as ee, t as je, a as Ye, p as A, o as Je, e as te, g as _e, b as qe, d as Te, v as Ke, D as Qe, f as X, X as Ze, i as le, l as et, h as tt, x as Le, y as lt, q as at, r as ot, F as st } from "./index-DMvK32iW.js";
2
+ import { u as Xe, c as ee, t as je, a as Ye, p as A, o as Je, e as te, g as _e, b as qe, d as Te, v as Ke, D as Qe, f as X, X as Ze, i as le, l as et, h as tt, x as Le, y as lt, q as at, r as ot, F as st } from "./index-B8Eaq54E.js";
3
3
  import { t as rt, u as ut } from "./useResponsive-CoxXLe23.js";
4
- import { _ as it } from "./Title-2MaMBji9.js";
5
- import { u as nt, U as vt } from "./usePrinter-7L_B-x1F.js";
6
- import { _ as ct } from "./Tooltip-C_eI7NfC.js";
7
- import { D as ht } from "./DataTable--ofk92Yb.js";
8
- import dt from "./vue-ui-skeleton-Bzsl5gab.js";
9
- import { _ as pt } from "./Shape-Dorp4kyF.js";
10
- import yt from "./vue-ui-accordion-D9SRsoRT.js";
11
- import { u as Ae } from "./useNestedProp-3oLbIjGJ.js";
12
- import { _ as ft } from "./PackageVersion-BqwuIW-T.js";
13
- import { P as bt } from "./PenAndPaper-LsFeEPDj.js";
4
+ import { _ as it } from "./Title-XYNHfYwN.js";
5
+ import { u as nt, U as vt } from "./usePrinter-D83W2gfG.js";
6
+ import { _ as ct } from "./Tooltip-DYRo59nq.js";
7
+ import { D as ht } from "./DataTable-DtRXoetj.js";
8
+ import dt from "./vue-ui-skeleton-DpadzgbS.js";
9
+ import { _ as pt } from "./Shape-B1fqUhjt.js";
10
+ import yt from "./vue-ui-accordion--5td7b94.js";
11
+ import { u as Ae } from "./useNestedProp-Ka0R_Yqa.js";
12
+ import { _ as ft } from "./PackageVersion-CgJdp_Ki.js";
13
+ import { P as bt } from "./PenAndPaper-BTLEk55u.js";
14
14
  import { u as mt } from "./useUserOptionState-BIvW1Kz7.js";
15
15
  import { _ as gt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
16
16
  const kt = ["id"], xt = ["xmlns", "viewBox"], Ct = ["x", "y", "width", "height"], wt = { key: 1 }, $t = { key: 0 }, _t = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], Tt = { key: 1 }, Lt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], At = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], St = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Pt = ["x", "y", "fill", "font-size"], Ot = ["x", "y", "font-size", "fill"], zt = ["fill", "font-size", "transform"], Nt = ["fill", "font-size", "x", "y"], Ft = ["x1", "x2", "y1", "y2", "stroke"], Mt = ["cx", "cy", "fill"], Wt = ["cx", "cy", "fill"], It = ["id"], Dt = ["stop-color"], Gt = ["stop-color"], Ut = ["stop-color"], Vt = { key: 0 }, Et = ["x", "y", "font-size", "fill"], Ht = {
@@ -1,4 +1,4 @@
1
- import { p as D, u as x, A as G, m as M, d as T, B as E, q as z, r as B, a1 as H } from "./index-DMvK32iW.js";
1
+ import { p as D, u as x, A as G, m as M, d as T, B as E, q as z, r as B, a1 as H } from "./index-B8Eaq54E.js";
2
2
  import { openBlock as i, createElementBlock as c, normalizeStyle as g, createElementVNode as a, toDisplayString as u, Fragment as b, renderList as _, normalizeClass as f, createTextVNode as I, createCommentVNode as N, withDirectives as k, vModelText as w, withKeys as S, withModifiers as O, vModelSelect as P, createStaticVNode as R, pushScopeId as U, popScopeId as V } from "vue";
3
3
  import { _ as j } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
4
  const X = {
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index-CbMyzHGj.cjs"),e=require("vue"),b=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),C={name:"vue-ui-table",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},data(){return{uid:`vue-ui-table-${Math.random()}`,bodyCopy:JSON.parse(JSON.stringify(this.dataset.body)).map((l,o)=>({...l,absoluteIndex:o})),buttonTimeout:null,canMoveChart:!1,chart:{height:316,type:"bar",width:512},constants:{ASC:1,BAR:"bar",DATE:"date",DESC:-1,DONUT:"donut",LINE:"line",NUMERIC:"numeric",PERCENTAGE:"percentage",TEXT:"text"},clientX:100,clientY:100,cssClass:{CELL:"smart-td-selected",FIRST_TD:"smart-td-selected-first",LAST_TD:"smart-td-selected-last",ROW:"smart-td-selected-neighbor"},currentDonut:void 0,currentFilter:void 0,currentSearch:void 0,currentSelectionSpan:{col:void 0,rows:[]},currentPage:0,dates:{},filteredDatesIndexes:{},hasNaN:{},iconColor:"#2D353C",iconSize:20,immutableRangeFilters:{},isExportRequest:!1,isLoading:!1,itemsPerPage:this.config.rowsPerPage?this.config.rowsPerPage:25,multiselects:{},paginatorOptions:[...new Set([10,25,50,100,250,500,this.config.rowsPerPage?this.config.rowsPerPage:25,this.dataset.body.length])].sort((l,o)=>l-o),palette:g.palette,percentages:{},rafId:null,rangeFilters:{},searches:{},selectedColumn:void 0,selectedDonutCategory:void 0,selectedPlot:void 0,showChart:!1,showDonutOptions:!1,sorts:{},tableBody:JSON.parse(JSON.stringify(this.dataset.body)).map((l,o)=>({...l,absoluteIndex:o})),tableHead:JSON.parse(JSON.stringify(this.dataset.header)).map(l=>({average:Object.hasOwn(l,"average")?l.average:!1,decimals:Object.hasOwn(l,"decimals")?l.decimals:0,isMultiselect:Object.hasOwn(l,"isMultiselect")?l.isMultiselect:!1,isPercentage:Object.hasOwn(l,"isPercentage")?l.isPercentage:!1,isSearch:Object.hasOwn(l,"isSearch")?l.isSearch:!1,isSort:Object.hasOwn(l,"isSort")?l.isSort:!1,name:l.name,percentageTo:Object.hasOwn(l,"percentageTo")?l.percentageTo:void 0,prefix:Object.hasOwn(l,"prefix")?l.prefix:"",rangeFilter:Object.hasOwn(l,"rangeFilter")?l.rangeFilter:!1,suffix:Object.hasOwn(l,"suffix")?l.suffix:"",sum:Object.hasOwn(l,"sum")?l.sum:!1,type:l.type}))}},mounted(){if(this.dataset.header.length===0)throw new Error(`vue-ui-table error: missing header data.
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index-KJL8ra_6.cjs"),e=require("vue"),b=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),C={name:"vue-ui-table",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},data(){return{uid:`vue-ui-table-${Math.random()}`,bodyCopy:JSON.parse(JSON.stringify(this.dataset.body)).map((l,o)=>({...l,absoluteIndex:o})),buttonTimeout:null,canMoveChart:!1,chart:{height:316,type:"bar",width:512},constants:{ASC:1,BAR:"bar",DATE:"date",DESC:-1,DONUT:"donut",LINE:"line",NUMERIC:"numeric",PERCENTAGE:"percentage",TEXT:"text"},clientX:100,clientY:100,cssClass:{CELL:"smart-td-selected",FIRST_TD:"smart-td-selected-first",LAST_TD:"smart-td-selected-last",ROW:"smart-td-selected-neighbor"},currentDonut:void 0,currentFilter:void 0,currentSearch:void 0,currentSelectionSpan:{col:void 0,rows:[]},currentPage:0,dates:{},filteredDatesIndexes:{},hasNaN:{},iconColor:"#2D353C",iconSize:20,immutableRangeFilters:{},isExportRequest:!1,isLoading:!1,itemsPerPage:this.config.rowsPerPage?this.config.rowsPerPage:25,multiselects:{},paginatorOptions:[...new Set([10,25,50,100,250,500,this.config.rowsPerPage?this.config.rowsPerPage:25,this.dataset.body.length])].sort((l,o)=>l-o),palette:g.palette,percentages:{},rafId:null,rangeFilters:{},searches:{},selectedColumn:void 0,selectedDonutCategory:void 0,selectedPlot:void 0,showChart:!1,showDonutOptions:!1,sorts:{},tableBody:JSON.parse(JSON.stringify(this.dataset.body)).map((l,o)=>({...l,absoluteIndex:o})),tableHead:JSON.parse(JSON.stringify(this.dataset.header)).map(l=>({average:Object.hasOwn(l,"average")?l.average:!1,decimals:Object.hasOwn(l,"decimals")?l.decimals:0,isMultiselect:Object.hasOwn(l,"isMultiselect")?l.isMultiselect:!1,isPercentage:Object.hasOwn(l,"isPercentage")?l.isPercentage:!1,isSearch:Object.hasOwn(l,"isSearch")?l.isSearch:!1,isSort:Object.hasOwn(l,"isSort")?l.isSort:!1,name:l.name,percentageTo:Object.hasOwn(l,"percentageTo")?l.percentageTo:void 0,prefix:Object.hasOwn(l,"prefix")?l.prefix:"",rangeFilter:Object.hasOwn(l,"rangeFilter")?l.rangeFilter:!1,suffix:Object.hasOwn(l,"suffix")?l.suffix:"",sum:Object.hasOwn(l,"sum")?l.sum:!1,type:l.type}))}},mounted(){if(this.dataset.header.length===0)throw new Error(`vue-ui-table error: missing header data.
2
2
  Provide an array of objects of type:
3
3
  {
4
4
  name: string;
@@ -1,8 +1,8 @@
1
1
  import { useCssVars as te, ref as g, useSlots as ae, onMounted as E, computed as v, watch as oe, openBlock as n, createElementBlock as l, normalizeStyle as C, normalizeClass as G, unref as u, createBlock as se, createSlots as ne, withCtx as k, renderSlot as r, normalizeProps as c, guardReactiveProps as h, createCommentVNode as m, createElementVNode as b, Fragment as _, renderList as x, createVNode as le, mergeProps as B, nextTick as re } from "vue";
2
- import { u as ue, c as H, t as ie, o as de, e as pe, a0 as ve, G as ce, N as me, q as fe, r as he } from "./index-DMvK32iW.js";
3
- import { u as A } from "./useNestedProp-3oLbIjGJ.js";
4
- import { u as ge, U as be } from "./usePrinter-7L_B-x1F.js";
5
- import { _ as ye } from "./Shape-Dorp4kyF.js";
2
+ import { u as ue, c as H, t as ie, o as de, e as pe, a0 as ve, G as ce, N as me, q as fe, r as he } from "./index-B8Eaq54E.js";
3
+ import { u as A } from "./useNestedProp-Ka0R_Yqa.js";
4
+ import { u as ge, U as be } from "./usePrinter-D83W2gfG.js";
5
+ import { _ as ye } from "./Shape-B1fqUhjt.js";
6
6
  import { u as Ce } from "./useUserOptionState-BIvW1Kz7.js";
7
7
  import { _ as ke } from "./_plugin-vue_export-helper-CHgC5LLL.js";
8
8
  const _e = ["id"], Ie = { role: "cell" }, $e = { role: "row" }, we = ["data-cell"], xe = {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),l=require("./index-CbMyzHGj.cjs"),S=require("./useNestedProp-DqPx8kFh.cjs"),$=require("./usePrinter-BzVsUZ9_.cjs"),q=require("./Shape-BO7Gprqr.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(w,{expose:N}){const d=w;e.useCssVars(t=>({"51ba93f2":T.value,"63946c66":M.value}));const{vue_ui_table_heatmap:E}=l.useConfig(),p=e.ref(l.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=S.useNestedProp({userConfig:d.config,defaultConfig:E});return t.theme?{...S.useNestedProp({userConfig:l.themes.vue_ui_table_heatmap[t.theme]||d.config,defaultConfig:t})}:t}e.watch(()=>d.config,t=>{o.value=b(),v.value=!o.value.showOnChartHover,C()},{deep:!0});const{isPrinting:x,isImaging:O,generatePdf:y,generateImage:k}=$.usePrinter({elementId:`table_heatmap_${p.value}`,fileName:"vue-ui-table-heatmap"}),z=e.computed(()=>o.value.table.responsiveBreakpoint),F=e.computed(()=>!!d.dataset&&d.dataset.length);e.onMounted(()=>{C()});function C(){l.objectIsEmpty(d.dataset)&&l.error({componentName:"VueUiTableHeatmap",type:"dataset"});const t=new ResizeObserver(a=>{a.forEach(n=>{s.value=n.contentRect.width<z.value})});c.value&&t.observe(c.value)}const B=e.computed(()=>d.dataset.map(t=>{const a=t.values.map(r=>isNaN(r)?0:r),n=a.reduce((r,i)=>r+i,0);return{...t,values:a,serieExtremes:{max:Math.max(...a),min:Math.min(...a)},sum:n,average:n/a.length,median:l.calcMedian(a),displayValues:[t.name,...t.values],id:l.createUid()}})),P=e.computed(()=>{const t=B.value.flatMap(a=>a.values);return{min:Math.min(...t),max:Math.max(...t)}});function R(t,a){const n=o.value.style.heatmapColors.useIndividualScale;return l.interpolateColorHex(o.value.style.heatmapColors.min,o.value.style.heatmapColors.max,n?a.min:P.value.min,n?a.max:P.value.max,t)}const _=e.computed(()=>B.value.map(t=>({...t,colors:t.displayValues.map(a=>isNaN(a)?o.value.style.backgroundColor:R(a,t.serieExtremes))}))),M=e.computed(()=>o.value.style.backgroundColor),T=e.computed(()=>`${o.value.table.borderWidth}px`);function I(){e.nextTick(()=>{const t=_.value.map(r=>[[r.name],r.displayValues,[r.sum],[r.average],[r.median]]),a=[[[""],o.value.table.head.values,["sum"],["average"],["median"]]].concat(t),n=l.createCsvContent(a);l.downloadCsv({csvContent:n,title:"vue-ui-table-heatmap"})})}function U(t){m.value=t,f.value+=1}return N({generatePdf:y,generateCsv:I,generateImage:k}),(t,a)=>(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:a[0]||(a[0]=()=>e.unref(g)(!0)),onMouseleave:a[1]||(a[1]=()=>e.unref(g)(!1))},[o.value.userOptions.show&&F.value&&(e.unref(h)||e.unref(v))?(e.openBlock(),e.createBlock($.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:I,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:r})=>[e.renderSlot(t.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:n,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),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,r)=>(e.openBlock(),e.createElementBlock("th",A,[e.renderSlot(t.$slots,"head",e.normalizeProps(e.guardReactiveProps({value:n,rowIndex:r,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(_.value,(n,r)=>(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.normalizeProps(e.guardReactiveProps({value:i,rowIndex:r,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.normalizeProps(e.mergeProps({key:0},{value:i,rowIndex:r,colIndex:u,type:typeof i,isResponsive:s.value})),void 0,!0):e.createCommentVNode("",!0),u>0?e.renderSlot(t.$slots,"cell",e.normalizeProps(e.mergeProps({key:1},{value:i,rowIndex:r,colIndex:u,type:typeof i,isResponsive:s.value,color:n.colors[u],textColor:e.unref(l.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.normalizeProps(e.guardReactiveProps({value:n.sum,rowIndex:r,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.normalizeProps(e.guardReactiveProps({value:n.average,rowIndex:r,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.normalizeProps(e.guardReactiveProps({value:n.median,rowIndex:r,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-4469b342"]]);exports.default=ee;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),l=require("./index-KJL8ra_6.cjs"),S=require("./useNestedProp-Bu958azG.cjs"),$=require("./usePrinter-pDOF3CfL.cjs"),q=require("./Shape-D7IbPjU8.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(w,{expose:N}){const d=w;e.useCssVars(t=>({"51ba93f2":T.value,"63946c66":M.value}));const{vue_ui_table_heatmap:E}=l.useConfig(),p=e.ref(l.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=S.useNestedProp({userConfig:d.config,defaultConfig:E});return t.theme?{...S.useNestedProp({userConfig:l.themes.vue_ui_table_heatmap[t.theme]||d.config,defaultConfig:t})}:t}e.watch(()=>d.config,t=>{o.value=b(),v.value=!o.value.showOnChartHover,C()},{deep:!0});const{isPrinting:x,isImaging:O,generatePdf:y,generateImage:k}=$.usePrinter({elementId:`table_heatmap_${p.value}`,fileName:"vue-ui-table-heatmap"}),z=e.computed(()=>o.value.table.responsiveBreakpoint),F=e.computed(()=>!!d.dataset&&d.dataset.length);e.onMounted(()=>{C()});function C(){l.objectIsEmpty(d.dataset)&&l.error({componentName:"VueUiTableHeatmap",type:"dataset"});const t=new ResizeObserver(a=>{a.forEach(n=>{s.value=n.contentRect.width<z.value})});c.value&&t.observe(c.value)}const B=e.computed(()=>d.dataset.map(t=>{const a=t.values.map(r=>isNaN(r)?0:r),n=a.reduce((r,i)=>r+i,0);return{...t,values:a,serieExtremes:{max:Math.max(...a),min:Math.min(...a)},sum:n,average:n/a.length,median:l.calcMedian(a),displayValues:[t.name,...t.values],id:l.createUid()}})),P=e.computed(()=>{const t=B.value.flatMap(a=>a.values);return{min:Math.min(...t),max:Math.max(...t)}});function R(t,a){const n=o.value.style.heatmapColors.useIndividualScale;return l.interpolateColorHex(o.value.style.heatmapColors.min,o.value.style.heatmapColors.max,n?a.min:P.value.min,n?a.max:P.value.max,t)}const _=e.computed(()=>B.value.map(t=>({...t,colors:t.displayValues.map(a=>isNaN(a)?o.value.style.backgroundColor:R(a,t.serieExtremes))}))),M=e.computed(()=>o.value.style.backgroundColor),T=e.computed(()=>`${o.value.table.borderWidth}px`);function I(){e.nextTick(()=>{const t=_.value.map(r=>[[r.name],r.displayValues,[r.sum],[r.average],[r.median]]),a=[[[""],o.value.table.head.values,["sum"],["average"],["median"]]].concat(t),n=l.createCsvContent(a);l.downloadCsv({csvContent:n,title:"vue-ui-table-heatmap"})})}function U(t){m.value=t,f.value+=1}return N({generatePdf:y,generateCsv:I,generateImage:k}),(t,a)=>(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:a[0]||(a[0]=()=>e.unref(g)(!0)),onMouseleave:a[1]||(a[1]=()=>e.unref(g)(!1))},[o.value.userOptions.show&&F.value&&(e.unref(h)||e.unref(v))?(e.openBlock(),e.createBlock($.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:I,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:r})=>[e.renderSlot(t.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:n,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),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,r)=>(e.openBlock(),e.createElementBlock("th",A,[e.renderSlot(t.$slots,"head",e.normalizeProps(e.guardReactiveProps({value:n,rowIndex:r,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(_.value,(n,r)=>(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.normalizeProps(e.guardReactiveProps({value:i,rowIndex:r,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.normalizeProps(e.mergeProps({key:0},{value:i,rowIndex:r,colIndex:u,type:typeof i,isResponsive:s.value})),void 0,!0):e.createCommentVNode("",!0),u>0?e.renderSlot(t.$slots,"cell",e.normalizeProps(e.mergeProps({key:1},{value:i,rowIndex:r,colIndex:u,type:typeof i,isResponsive:s.value,color:n.colors[u],textColor:e.unref(l.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.normalizeProps(e.guardReactiveProps({value:n.sum,rowIndex:r,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.normalizeProps(e.guardReactiveProps({value:n.average,rowIndex:r,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.normalizeProps(e.guardReactiveProps({value:n.median,rowIndex:r,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-4469b342"]]);exports.default=ee;
@@ -1,9 +1,9 @@
1
1
  import { useCssVars as $e, ref as p, useSlots as ze, onMounted as pe, computed as _, watch as fe, openBlock as d, createElementBlock as c, normalizeClass as X, unref as i, normalizeStyle as s, createElementVNode as f, toDisplayString as C, createCommentVNode as b, withDirectives as Pe, createVNode as $, Fragment as J, renderList as K, createBlock as De, createSlots as Ne, withCtx as N, renderSlot as z, normalizeProps as Fe, guardReactiveProps as Ve, nextTick as Te } from "vue";
2
- import { u as We, c as Me, t as Ee, a as Ue, p as F, b as Be, o as Ge, e as me, g as Le, a0 as Re, d as He, i as V, f as T, q as qe, r as Xe } from "./index-DMvK32iW.js";
3
- import { u as ge } from "./useNestedProp-3oLbIjGJ.js";
4
- import Je from "./vue-ui-sparkline-Hw74DjL2.js";
5
- import W from "./BaseIcon-QuseiwxO.js";
6
- import { u as Ke, U as Qe, v as Ye } from "./usePrinter-7L_B-x1F.js";
2
+ import { u as We, c as Me, t as Ee, a as Ue, p as F, b as Be, o as Ge, e as me, g as Le, a0 as Re, d as He, i as V, f as T, q as qe, r as Xe } from "./index-B8Eaq54E.js";
3
+ import { u as ge } from "./useNestedProp-Ka0R_Yqa.js";
4
+ import Je from "./vue-ui-sparkline-BABBXY2c.js";
5
+ import W from "./BaseIcon-Dzpk4O8L.js";
6
+ import { u as Ke, U as Qe, v as Ye } from "./usePrinter-D83W2gfG.js";
7
7
  import { u as Ze } from "./useUserOptionState-BIvW1Kz7.js";
8
8
  import { _ as je } from "./_plugin-vue_export-helper-CHgC5LLL.js";
9
9
  const et = ["id"], tt = { style: { "z-index": "1", "padding-right": "24px" } }, at = {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-CbMyzHGj.cjs"),Y=require("./useNestedProp-DqPx8kFh.cjs"),ce=require("./vue-ui-sparkline-BiPWJRwq.cjs"),x=require("./BaseIcon-BnnMILPX.cjs"),D=require("./usePrinter-BzVsUZ9_.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}){const y=Z;e.useCssVars(l=>({eeaf54cc:l.tdo}));const{vue_ui_table_sparkline:te}=u.useConfig(),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.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<H.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),R=e.ref(1);function k(){A.value=!1,v.value=void 0,p.value=void 0,R.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,R.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 H=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<H.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.normalizeProps(e.guardReactiveProps({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-4ee38c49"]]);exports.default=Ve;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-KJL8ra_6.cjs"),Y=require("./useNestedProp-Bu958azG.cjs"),ce=require("./vue-ui-sparkline-XOa6LfX2.cjs"),x=require("./BaseIcon-CIjjPDqj.cjs"),D=require("./usePrinter-pDOF3CfL.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}){const y=Z;e.useCssVars(l=>({eeaf54cc:l.tdo}));const{vue_ui_table_sparkline:te}=u.useConfig(),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.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<H.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),R=e.ref(1);function k(){A.value=!1,v.value=void 0,p.value=void 0,R.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,R.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 H=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<H.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.normalizeProps(e.guardReactiveProps({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-4ee38c49"]]);exports.default=Ve;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-CbMyzHGj.cjs"),te=require("./Title-BzcIyo-x.cjs"),U=require("./usePrinter-BzVsUZ9_.cjs"),oe=require("./vue-ui-skeleton-Dm5NZ_MQ.cjs"),Y=require("./useNestedProp-DqPx8kFh.cjs"),le=require("./PackageVersion-sBYhtscP.cjs"),re=require("./PenAndPaper-CHz_Iy5T.cjs"),ae=require("./useUserOptionState-BgepsfED.cjs"),se=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ne=["id"],ue={key:1,ref:"noTitle",class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},ie={key:2,style:"width:100%"},ce=["xmlns","viewBox"],de=["width","height"],he={id:"vueUiPill",clipPathUnits:"objectBoundingBox"},ve=["fill"],me=["id"],pe=["stop-color"],ye=["stop-color"],fe=["stop-color"],ge={"clip-path":"url(#vueUiPill)"},ke=["x","y","height","width"],be=["x","y","height","width","fill"],xe=["x1","x2","y1","y2","stroke-width","stroke"],Ce=["x1","x2","y1","y2","stroke-width","stroke"],we=["x1","x2","y1","y2","stroke-width","stroke"],_e=["x1","x2","y1","y2","stroke-width","stroke"],Ne=["x1","x2","y1","y2","stroke-width","stroke"],Be=["x1","x2","y1","y2","stroke-width","stroke"],Ve=["x1","x2","y1","y2","stroke-width","stroke"],Ee=["x1","x2","y1","y2","stroke-width","stroke"],Pe=["x","y","height","width"],$e=["y","x","fill","font-size","font-weight"],Fe={key:5,class:"vue-data-ui-watermark"},Oe={key:6,ref:"source",dir:"auto"},Se={__name:"vue-ui-thermometer",props:{dataset:{type:Object,default(){return{}}},config:{type:Object,default(){return{}}}},setup(m,{expose:z}){const s=m;e.useCssVars(l=>({"7f5072bd":R.value,"575f6d71":D.value,"041baa9e":j.value}));const{vue_ui_thermometer:L}=a.useConfig(),g=e.computed(()=>!!s.dataset&&Object.keys(s.dataset).length);e.onMounted(()=>{V()});function V(){a.objectIsEmpty(s.dataset)?a.error({componentName:"VueUiThermometer",type:"dataset"}):a.getMissingDatasetAttributes({datasetObject:s.dataset,requiredAttributes:["value","from","to"]}).forEach(l=>{a.error({componentName:"VueUiThermometer",type:"datasetAttribute",property:l})})}const d=e.ref(a.createUid()),k=e.ref(null),E=e.ref(0),P=e.ref(0),t=e.computed({get:()=>O(),set:l=>l}),{userOptionsVisible:b,setUserOptionsVisibility:$,keepUserOptionState:F}=ae.useUserOptionState({config:t.value});function O(){const l=Y.useNestedProp({userConfig:s.config,defaultConfig:L});return l.theme?{...Y.useNestedProp({userConfig:a.themes.vue_ui_thermometer[l.theme]||s.config,defaultConfig:l}),customPalette:a.themePalettes[l.theme]||a.palette}:l}e.watch(()=>s.config,l=>{t.value=O(),b.value=!t.value.showOnChartHover,V(),P.value+=1},{deep:!0});const{isPrinting:S,isImaging:I,generatePdf:q,generateImage:A}=U.usePrinter({elementId:`thermometer__${d.value}`,fileName:t.value.style.title.text||"vue-ui-thermometer"}),G=e.computed(()=>t.value.userOptions.show&&!t.value.style.title.text),p=e.computed(()=>a.convertCustomPalette(t.value.customPalette)),H=e.computed(()=>t.value.style.chart.thermometer.width),c=e.computed(()=>s.dataset.steps||10),i=e.ref({top:t.value.style.chart.padding.top,left:t.value.style.chart.padding.left,right:t.value.style.chart.padding.right,bottom:t.value.style.chart.padding.bottom});function y(l,n,o){const u=[],N=T(l),B=T(n);for(let v=0;v<o;v++){const K=x(N.red,B.red,v,o),Q=x(N.green,B.green,v,o),Z=x(N.blue,B.blue,v,o),ee=`#${C(K)}${C(Q)}${C(Z)}`;u.push(ee)}return u}function T(l){const n=l.slice(1);return{red:parseInt(n.slice(0,2),16),green:parseInt(n.slice(2,4),16),blue:parseInt(n.slice(4,6),16)}}function x(l,n,o,u){return Math.round(l+(n-l)*o/u)}function C(l){return l.toString(16).padStart(2,"0")}const r=e.computed(()=>{const l=H.value+i.value.left+i.value.right,n=t.value.style.chart.height;return{width:l,left:i.value.left,right:l-i.value.right,top:i.value.top,bottom:n-i.value.bottom,height:n}}),W=e.computed(()=>r.value),w=e.computed(()=>{const l=a.checkNaN(s.dataset.from)<0?Math.abs(a.checkNaN(s.dataset.from)):a.checkNaN(s.dataset.from),n=a.checkNaN(s.dataset.to)<0?Math.abs(a.checkNaN(s.dataset.to)):a.checkNaN(s.dataset.to);let o=0;return a.checkNaN(s.dataset.to)>0?o=l+n:l>n?o=l-n:o=n-l,(1-(Math.abs(a.checkNaN(s.dataset.from))+a.checkNaN(s.dataset.value))/o)*(r.value.height-i.value.top-i.value.bottom)}),j=e.computed(()=>`${w.value}px`),D=e.computed(()=>`${r.value.height-t.value.style.chart.padding.bottom-i.value.top}px`),R=e.computed(()=>`${t.value.style.chart.animation.speedMs}ms`),X=e.computed(()=>{if(s.dataset.colors){if(!s.dataset.colors.from)return y(p.value[0]||a.palette[0],a.convertColorToHex(s.dataset.colors.to),c.value||10);if(!s.dataset.colors.to)return y(a.convertColorToHex(s.dataset.colors.from),p.value[1]||a.palette[1],c.value||10)}else return y(p.value[1]||a.palette[1],p.value[0]||a.palette[0],c.value||10);return y(a.convertColorToHex(s.dataset.colors.from),a.convertColorToHex(s.dataset.colors.to),c.value||10)}),M=e.computed(()=>{const l=[];let n=0;const o=r.value.height-i.value.top-i.value.bottom;for(let u=0;u<o-1;u+=o/c.value)l.push({x:r.value.left,y:r.value.top+u,qYLess:r.value.top+u+o/c.value/4,halfY:r.value.top+u+o/c.value/2,qYMore:r.value.top+u+o/c.value/4*3,color:X.value[n],height:o/c.value}),n+=1;return l}),h=e.ref(!1);function J(l){h.value=l,E.value+=1}const f=e.ref(!1);function _(){f.value=!f.value}return z({generatePdf:q,generateImage:A,toggleAnnotator:_}),(l,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"thermoChart",ref:k,class:e.normalizeClass(`vue-ui-thermometer ${h.value?"vue-data-ui-wrapper-fullscreen":""}`),style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color};font-family:${t.value.style.fontFamily}`),id:`thermometer__${d.value}`,onMouseenter:n[0]||(n[0]=()=>e.unref($)(!0)),onMouseleave:n[1]||(n[1]=()=>e.unref($)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(re.PenAndPaper,{key:0,parent:k.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:f.value,onClose:_},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),G.value?(e.openBlock(),e.createElementBlock("div",ue,null,512)):e.createCommentVNode("",!0),t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",ie,[(e.openBlock(),e.createBlock(te._sfc_main,{key:`title_${P.value}`,config:{title:{cy:"thermometer-div-title",...t.value.style.title},subtitle:{cy:"thermometer-div-subtitle",...t.value.style.title.subtitle}}},null,8,["config"]))])):e.createCommentVNode("",!0),t.value.userOptions.show&&g.value&&(e.unref(F)||e.unref(b))?(e.openBlock(),e.createBlock(U.UserOptions,{ref:"details",key:`user_options_${E.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(I),isPrinting:e.unref(S),uid:d.value,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,hasXls:!1,isFullscreen:h.value,titles:{...t.value.userOptions.buttonTitles},chartElement:k.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:f.value,onToggleFullscreen:J,onGeneratePdf:e.unref(q),onGenerateImage:e.unref(A),onToggleAnnotator:_,style:e.normalizeStyle({visibility:e.unref(F)?e.unref(b)?"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.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:u})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:u})),void 0,!0)]),key:"2"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:u})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:u})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),g.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(a.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":h.value,"vue-data-ui-fulscreen--off":!h.value}),width:"100%",viewBox:`0 0 ${r.value.width} ${r.value.height}`,style:"background:transparent"},[e.createVNode(le._sfc_main),l.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:r.value.width,height:r.value.height,style:{pointerEvents:"none"}},[e.renderSlot(l.$slots,"chart-background",{},void 0,!0)],8,de)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[e.createElementVNode("clipPath",he,[e.createElementVNode("rect",{x:"0",y:"0",width:"1",height:"1",rx:"0.5",ry:"0.07",fill:t.value.style.chart.backgroundColor},null,8,ve)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.value,(o,u)=>(e.openBlock(),e.createElementBlock("linearGradient",{id:`vueUiThermometerGradient_${u}_${d.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":o.color},null,8,pe),e.createElementVNode("stop",{offset:"50%","stop-color":e.unref(a.setOpacity)(o.color,100-t.value.style.chart.graduations.gradient.intensity)},null,8,ye),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,fe)],8,me))),256))]),e.createElementVNode("g",ge,[e.createElementVNode("rect",{x:r.value.left,y:r.value.top,height:r.value.height-i.value.top-i.value.bottom,width:r.value.width-i.value.left-i.value.right,fill:"#FFFFFF"},null,8,ke),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.value,(o,u)=>(e.openBlock(),e.createElementBlock("g",{key:`graduation_${u}`},[e.createElementVNode("rect",{x:o.x,y:o.y,height:o.height,width:r.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right,fill:t.value.style.chart.graduations.gradient.show?`url(#vueUiThermometerGradient_${u}_${d.value})`:o.color,"shape-rendering":"crispEdges"},null,8,be),t.value.style.chart.graduations.show&&["both","left"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:0,x1:o.x,x2:o.x+10,y1:o.y,y2:o.y,"stroke-width":t.value.style.chart.graduations.strokeWidth,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,xe)):e.createCommentVNode("",!0),t.value.style.chart.graduations.showIntermediate?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.value.style.chart.graduations.show&&["both","left"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:0,x1:o.x,x2:o.x+5,y1:o.halfY,y2:o.halfY,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,Ce)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","left"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:1,x1:o.x,x2:o.x+2.5,y1:o.qYLess,y2:o.qYLess,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,we)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","left"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:o.x,x2:o.x+2.5,y1:o.qYMore,y2:o.qYMore,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,_e)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","right"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:r.value.right,x2:r.value.right-10,y1:o.y,y2:o.y,"stroke-width":t.value.style.chart.graduations.strokeWidth,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,Ne)):e.createCommentVNode("",!0),t.value.style.chart.graduations.showIntermediate?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[t.value.style.chart.graduations.show&&["both","right"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:0,x1:r.value.right,x2:r.value.right-5,y1:o.halfY,y2:o.halfY,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,Be)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","right"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:1,x1:r.value.right,x2:r.value.right-2.5,y1:o.qYLess,y2:o.qYLess,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,Ve)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","right"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:r.value.right,x2:r.value.right-2.5,y1:o.qYMore,y2:o.qYMore,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,Ee)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)]))),128)),e.createElementVNode("rect",{class:e.normalizeClass({"vue-ui-thermometer-temperature":t.value.style.chart.animation.use}),x:r.value.left,y:r.value.top,height:w.value,width:r.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right,fill:"#FFFFFF66"},null,10,Pe)]),e.createElementVNode("text",{class:e.normalizeClass({"vue-ui-thermometer-temperature-value":t.value.style.chart.animation.use}),y:w.value+r.value.top+t.value.style.chart.label.fontSize/3,x:r.value.left-10,"text-anchor":"end",fill:t.value.style.chart.label.color,"font-size":t.value.style.chart.label.fontSize,"font-weight":t.value.style.chart.label.bold?"bold":"normal"},e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.chart.label.formatter,m.dataset.value,e.unref(a.dataLabel)({p:t.value.style.chart.label.prefix,v:m.dataset.value,s:t.value.style.chart.label.suffix,r:t.value.style.chart.label.rounding}),{datapoint:m.dataset})),11,$e),e.renderSlot(l.$slots,"svg",{svg:W.value},void 0,!0)],10,ce)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Fe,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(S)||e.unref(I)})),void 0,!0)])):e.createCommentVNode("",!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",Oe,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),g.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(oe.default,{key:7,config:{type:"thermometer",style:{backgroundColor:t.value.style.chart.backgroundColor,thermometer:{color:"#CCCCCC"}}}},null,8,["config"]))],46,ne))}},Ie=se._export_sfc(Se,[["__scopeId","data-v-f7910f15"]]);exports.default=Ie;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-KJL8ra_6.cjs"),te=require("./Title-D-6pIV0l.cjs"),U=require("./usePrinter-pDOF3CfL.cjs"),oe=require("./vue-ui-skeleton-D_YCUi1y.cjs"),Y=require("./useNestedProp-Bu958azG.cjs"),le=require("./PackageVersion-Dn-t7tbm.cjs"),re=require("./PenAndPaper-DFXJJink.cjs"),ae=require("./useUserOptionState-BgepsfED.cjs"),se=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ne=["id"],ue={key:1,ref:"noTitle",class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},ie={key:2,style:"width:100%"},ce=["xmlns","viewBox"],de=["width","height"],he={id:"vueUiPill",clipPathUnits:"objectBoundingBox"},ve=["fill"],me=["id"],pe=["stop-color"],ye=["stop-color"],fe=["stop-color"],ge={"clip-path":"url(#vueUiPill)"},ke=["x","y","height","width"],be=["x","y","height","width","fill"],xe=["x1","x2","y1","y2","stroke-width","stroke"],Ce=["x1","x2","y1","y2","stroke-width","stroke"],we=["x1","x2","y1","y2","stroke-width","stroke"],_e=["x1","x2","y1","y2","stroke-width","stroke"],Ne=["x1","x2","y1","y2","stroke-width","stroke"],Be=["x1","x2","y1","y2","stroke-width","stroke"],Ve=["x1","x2","y1","y2","stroke-width","stroke"],Ee=["x1","x2","y1","y2","stroke-width","stroke"],Pe=["x","y","height","width"],$e=["y","x","fill","font-size","font-weight"],Fe={key:5,class:"vue-data-ui-watermark"},Oe={key:6,ref:"source",dir:"auto"},Se={__name:"vue-ui-thermometer",props:{dataset:{type:Object,default(){return{}}},config:{type:Object,default(){return{}}}},setup(m,{expose:z}){const s=m;e.useCssVars(l=>({"7f5072bd":R.value,"575f6d71":D.value,"041baa9e":j.value}));const{vue_ui_thermometer:L}=a.useConfig(),g=e.computed(()=>!!s.dataset&&Object.keys(s.dataset).length);e.onMounted(()=>{V()});function V(){a.objectIsEmpty(s.dataset)?a.error({componentName:"VueUiThermometer",type:"dataset"}):a.getMissingDatasetAttributes({datasetObject:s.dataset,requiredAttributes:["value","from","to"]}).forEach(l=>{a.error({componentName:"VueUiThermometer",type:"datasetAttribute",property:l})})}const d=e.ref(a.createUid()),k=e.ref(null),E=e.ref(0),P=e.ref(0),t=e.computed({get:()=>O(),set:l=>l}),{userOptionsVisible:b,setUserOptionsVisibility:$,keepUserOptionState:F}=ae.useUserOptionState({config:t.value});function O(){const l=Y.useNestedProp({userConfig:s.config,defaultConfig:L});return l.theme?{...Y.useNestedProp({userConfig:a.themes.vue_ui_thermometer[l.theme]||s.config,defaultConfig:l}),customPalette:a.themePalettes[l.theme]||a.palette}:l}e.watch(()=>s.config,l=>{t.value=O(),b.value=!t.value.showOnChartHover,V(),P.value+=1},{deep:!0});const{isPrinting:S,isImaging:I,generatePdf:q,generateImage:A}=U.usePrinter({elementId:`thermometer__${d.value}`,fileName:t.value.style.title.text||"vue-ui-thermometer"}),G=e.computed(()=>t.value.userOptions.show&&!t.value.style.title.text),p=e.computed(()=>a.convertCustomPalette(t.value.customPalette)),H=e.computed(()=>t.value.style.chart.thermometer.width),c=e.computed(()=>s.dataset.steps||10),i=e.ref({top:t.value.style.chart.padding.top,left:t.value.style.chart.padding.left,right:t.value.style.chart.padding.right,bottom:t.value.style.chart.padding.bottom});function y(l,n,o){const u=[],N=T(l),B=T(n);for(let v=0;v<o;v++){const K=x(N.red,B.red,v,o),Q=x(N.green,B.green,v,o),Z=x(N.blue,B.blue,v,o),ee=`#${C(K)}${C(Q)}${C(Z)}`;u.push(ee)}return u}function T(l){const n=l.slice(1);return{red:parseInt(n.slice(0,2),16),green:parseInt(n.slice(2,4),16),blue:parseInt(n.slice(4,6),16)}}function x(l,n,o,u){return Math.round(l+(n-l)*o/u)}function C(l){return l.toString(16).padStart(2,"0")}const r=e.computed(()=>{const l=H.value+i.value.left+i.value.right,n=t.value.style.chart.height;return{width:l,left:i.value.left,right:l-i.value.right,top:i.value.top,bottom:n-i.value.bottom,height:n}}),W=e.computed(()=>r.value),w=e.computed(()=>{const l=a.checkNaN(s.dataset.from)<0?Math.abs(a.checkNaN(s.dataset.from)):a.checkNaN(s.dataset.from),n=a.checkNaN(s.dataset.to)<0?Math.abs(a.checkNaN(s.dataset.to)):a.checkNaN(s.dataset.to);let o=0;return a.checkNaN(s.dataset.to)>0?o=l+n:l>n?o=l-n:o=n-l,(1-(Math.abs(a.checkNaN(s.dataset.from))+a.checkNaN(s.dataset.value))/o)*(r.value.height-i.value.top-i.value.bottom)}),j=e.computed(()=>`${w.value}px`),D=e.computed(()=>`${r.value.height-t.value.style.chart.padding.bottom-i.value.top}px`),R=e.computed(()=>`${t.value.style.chart.animation.speedMs}ms`),X=e.computed(()=>{if(s.dataset.colors){if(!s.dataset.colors.from)return y(p.value[0]||a.palette[0],a.convertColorToHex(s.dataset.colors.to),c.value||10);if(!s.dataset.colors.to)return y(a.convertColorToHex(s.dataset.colors.from),p.value[1]||a.palette[1],c.value||10)}else return y(p.value[1]||a.palette[1],p.value[0]||a.palette[0],c.value||10);return y(a.convertColorToHex(s.dataset.colors.from),a.convertColorToHex(s.dataset.colors.to),c.value||10)}),M=e.computed(()=>{const l=[];let n=0;const o=r.value.height-i.value.top-i.value.bottom;for(let u=0;u<o-1;u+=o/c.value)l.push({x:r.value.left,y:r.value.top+u,qYLess:r.value.top+u+o/c.value/4,halfY:r.value.top+u+o/c.value/2,qYMore:r.value.top+u+o/c.value/4*3,color:X.value[n],height:o/c.value}),n+=1;return l}),h=e.ref(!1);function J(l){h.value=l,E.value+=1}const f=e.ref(!1);function _(){f.value=!f.value}return z({generatePdf:q,generateImage:A,toggleAnnotator:_}),(l,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"thermoChart",ref:k,class:e.normalizeClass(`vue-ui-thermometer ${h.value?"vue-data-ui-wrapper-fullscreen":""}`),style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color};font-family:${t.value.style.fontFamily}`),id:`thermometer__${d.value}`,onMouseenter:n[0]||(n[0]=()=>e.unref($)(!0)),onMouseleave:n[1]||(n[1]=()=>e.unref($)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(re.PenAndPaper,{key:0,parent:k.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:f.value,onClose:_},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),G.value?(e.openBlock(),e.createElementBlock("div",ue,null,512)):e.createCommentVNode("",!0),t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",ie,[(e.openBlock(),e.createBlock(te._sfc_main,{key:`title_${P.value}`,config:{title:{cy:"thermometer-div-title",...t.value.style.title},subtitle:{cy:"thermometer-div-subtitle",...t.value.style.title.subtitle}}},null,8,["config"]))])):e.createCommentVNode("",!0),t.value.userOptions.show&&g.value&&(e.unref(F)||e.unref(b))?(e.openBlock(),e.createBlock(U.UserOptions,{ref:"details",key:`user_options_${E.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(I),isPrinting:e.unref(S),uid:d.value,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,hasXls:!1,isFullscreen:h.value,titles:{...t.value.userOptions.buttonTitles},chartElement:k.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:f.value,onToggleFullscreen:J,onGeneratePdf:e.unref(q),onGenerateImage:e.unref(A),onToggleAnnotator:_,style:e.normalizeStyle({visibility:e.unref(F)?e.unref(b)?"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.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:u})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:u})),void 0,!0)]),key:"2"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:u})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:u})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),g.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(a.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":h.value,"vue-data-ui-fulscreen--off":!h.value}),width:"100%",viewBox:`0 0 ${r.value.width} ${r.value.height}`,style:"background:transparent"},[e.createVNode(le._sfc_main),l.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:r.value.width,height:r.value.height,style:{pointerEvents:"none"}},[e.renderSlot(l.$slots,"chart-background",{},void 0,!0)],8,de)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[e.createElementVNode("clipPath",he,[e.createElementVNode("rect",{x:"0",y:"0",width:"1",height:"1",rx:"0.5",ry:"0.07",fill:t.value.style.chart.backgroundColor},null,8,ve)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.value,(o,u)=>(e.openBlock(),e.createElementBlock("linearGradient",{id:`vueUiThermometerGradient_${u}_${d.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":o.color},null,8,pe),e.createElementVNode("stop",{offset:"50%","stop-color":e.unref(a.setOpacity)(o.color,100-t.value.style.chart.graduations.gradient.intensity)},null,8,ye),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,fe)],8,me))),256))]),e.createElementVNode("g",ge,[e.createElementVNode("rect",{x:r.value.left,y:r.value.top,height:r.value.height-i.value.top-i.value.bottom,width:r.value.width-i.value.left-i.value.right,fill:"#FFFFFF"},null,8,ke),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.value,(o,u)=>(e.openBlock(),e.createElementBlock("g",{key:`graduation_${u}`},[e.createElementVNode("rect",{x:o.x,y:o.y,height:o.height,width:r.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right,fill:t.value.style.chart.graduations.gradient.show?`url(#vueUiThermometerGradient_${u}_${d.value})`:o.color,"shape-rendering":"crispEdges"},null,8,be),t.value.style.chart.graduations.show&&["both","left"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:0,x1:o.x,x2:o.x+10,y1:o.y,y2:o.y,"stroke-width":t.value.style.chart.graduations.strokeWidth,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,xe)):e.createCommentVNode("",!0),t.value.style.chart.graduations.showIntermediate?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.value.style.chart.graduations.show&&["both","left"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:0,x1:o.x,x2:o.x+5,y1:o.halfY,y2:o.halfY,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,Ce)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","left"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:1,x1:o.x,x2:o.x+2.5,y1:o.qYLess,y2:o.qYLess,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,we)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","left"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:o.x,x2:o.x+2.5,y1:o.qYMore,y2:o.qYMore,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,_e)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","right"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:r.value.right,x2:r.value.right-10,y1:o.y,y2:o.y,"stroke-width":t.value.style.chart.graduations.strokeWidth,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,Ne)):e.createCommentVNode("",!0),t.value.style.chart.graduations.showIntermediate?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[t.value.style.chart.graduations.show&&["both","right"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:0,x1:r.value.right,x2:r.value.right-5,y1:o.halfY,y2:o.halfY,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,Be)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","right"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:1,x1:r.value.right,x2:r.value.right-2.5,y1:o.qYLess,y2:o.qYLess,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,Ve)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","right"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:r.value.right,x2:r.value.right-2.5,y1:o.qYMore,y2:o.qYMore,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,Ee)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)]))),128)),e.createElementVNode("rect",{class:e.normalizeClass({"vue-ui-thermometer-temperature":t.value.style.chart.animation.use}),x:r.value.left,y:r.value.top,height:w.value,width:r.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right,fill:"#FFFFFF66"},null,10,Pe)]),e.createElementVNode("text",{class:e.normalizeClass({"vue-ui-thermometer-temperature-value":t.value.style.chart.animation.use}),y:w.value+r.value.top+t.value.style.chart.label.fontSize/3,x:r.value.left-10,"text-anchor":"end",fill:t.value.style.chart.label.color,"font-size":t.value.style.chart.label.fontSize,"font-weight":t.value.style.chart.label.bold?"bold":"normal"},e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.chart.label.formatter,m.dataset.value,e.unref(a.dataLabel)({p:t.value.style.chart.label.prefix,v:m.dataset.value,s:t.value.style.chart.label.suffix,r:t.value.style.chart.label.rounding}),{datapoint:m.dataset})),11,$e),e.renderSlot(l.$slots,"svg",{svg:W.value},void 0,!0)],10,ce)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Fe,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(S)||e.unref(I)})),void 0,!0)])):e.createCommentVNode("",!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",Oe,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),g.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(oe.default,{key:7,config:{type:"thermometer",style:{backgroundColor:t.value.style.chart.backgroundColor,thermometer:{color:"#CCCCCC"}}}},null,8,["config"]))],46,ne))}},Ie=se._export_sfc(Se,[["__scopeId","data-v-f7910f15"]]);exports.default=Ie;
@@ -1,11 +1,11 @@
1
1
  import { useCssVars as me, computed as d, onMounted as ke, ref as p, watch as be, openBlock as a, createElementBlock as n, normalizeClass as P, normalizeStyle as ee, unref as h, createBlock as F, createCommentVNode as i, createSlots as xe, withCtx as O, renderSlot as g, normalizeProps as E, guardReactiveProps as G, createVNode as _e, createElementVNode as v, Fragment as I, renderList as te, toDisplayString as we } from "vue";
2
- import { u as Ce, o as $e, e as se, g as Pe, c as Fe, t as Oe, a as Ie, p as x, b as Ae, v as f, d as A, X as Me, s as Ue, i as Ye, f as Ne } from "./index-DMvK32iW.js";
3
- import { _ as Se } from "./Title-2MaMBji9.js";
4
- import { u as Te, U as qe } from "./usePrinter-7L_B-x1F.js";
5
- import Le from "./vue-ui-skeleton-Bzsl5gab.js";
6
- import { u as oe } from "./useNestedProp-3oLbIjGJ.js";
7
- import { _ as Ve } from "./PackageVersion-BqwuIW-T.js";
8
- import { P as Ee } from "./PenAndPaper-LsFeEPDj.js";
2
+ import { u as Ce, o as $e, e as se, g as Pe, c as Fe, t as Oe, a as Ie, p as x, b as Ae, v as f, d as A, X as Me, s as Ue, i as Ye, f as Ne } from "./index-B8Eaq54E.js";
3
+ import { _ as Se } from "./Title-XYNHfYwN.js";
4
+ import { u as Te, U as qe } from "./usePrinter-D83W2gfG.js";
5
+ import Le from "./vue-ui-skeleton-DpadzgbS.js";
6
+ import { u as oe } from "./useNestedProp-Ka0R_Yqa.js";
7
+ import { _ as Ve } from "./PackageVersion-CgJdp_Ki.js";
8
+ import { P as Ee } from "./PenAndPaper-BTLEk55u.js";
9
9
  import { u as Ge } from "./useUserOptionState-BIvW1Kz7.js";
10
10
  import { _ as We } from "./_plugin-vue_export-helper-CHgC5LLL.js";
11
11
  const je = ["id"], ze = {
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),L=require("./useNestedProp-DqPx8kFh.cjs"),g=require("./index-CbMyzHGj.cjs"),R=require("./useResponsive-BJ7DTGpm.cjs"),B=require("./BaseIcon-BnnMILPX.cjs"),j=require("./Title-BzcIyo-x.cjs"),O=require("./PackageVersion-sBYhtscP.cjs"),q=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");class U{constructor(P,p,y,T=!0,b=!0){this.interval=p,this.elapsed=0,this.isPaused=!1;const S=`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),L=require("./useNestedProp-Bu958azG.cjs"),g=require("./index-KJL8ra_6.cjs"),R=require("./useResponsive-BJ7DTGpm.cjs"),B=require("./BaseIcon-CIjjPDqj.cjs"),j=require("./Title-D-6pIV0l.cjs"),O=require("./PackageVersion-Dn-t7tbm.cjs"),q=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");class U{constructor(P,p,y,T=!0,b=!0){this.interval=p,this.elapsed=0,this.isPaused=!1;const S=`
2
2
  let interval;
3
3
  let elapsed = 0;
4
4
  let paused = false;
@@ -1,10 +1,10 @@
1
1
  import { ref as n, onMounted as Q, onBeforeUnmount as Y, computed as z, watch as Z, openBlock as l, createElementBlock as o, normalizeStyle as f, createBlock as ee, createCommentVNode as v, unref as te, createVNode as M, renderSlot as A, createElementVNode as C, mergeProps as V, normalizeProps as E, guardReactiveProps as U, toDisplayString as ae } from "vue";
2
- import { u as se } from "./useNestedProp-3oLbIjGJ.js";
3
- import { u as le, c as oe, X as re, F as W } from "./index-DMvK32iW.js";
2
+ import { u as se } from "./useNestedProp-Ka0R_Yqa.js";
3
+ import { u as le, c as oe, X as re, F as W } from "./index-B8Eaq54E.js";
4
4
  import { t as ue, u as ie } from "./useResponsive-CoxXLe23.js";
5
- import P from "./BaseIcon-QuseiwxO.js";
6
- import { _ as ne } from "./Title-2MaMBji9.js";
7
- import { _ as ce } from "./PackageVersion-BqwuIW-T.js";
5
+ import P from "./BaseIcon-Dzpk4O8L.js";
6
+ import { _ as ne } from "./Title-XYNHfYwN.js";
7
+ import { _ as ce } from "./PackageVersion-CgJdp_Ki.js";
8
8
  import { _ as de } from "./_plugin-vue_export-helper-CHgC5LLL.js";
9
9
  class he {
10
10
  constructor(H, k, T, L = !0, $ = !0) {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),L=require("./useNestedProp-DqPx8kFh.cjs"),c=require("./index-CbMyzHGj.cjs"),J=require("./Title-BzcIyo-x.cjs"),j=require("./usePrinter-BzVsUZ9_.cjs"),K=require("./vue-ui-skeleton-Dm5NZ_MQ.cjs"),Q=require("./PackageVersion-sBYhtscP.cjs"),W=require("./PenAndPaper-CHz_Iy5T.cjs"),Z=require("./useUserOptionState-BgepsfED.cjs"),ee=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),te=["id"],oe={key:2,style:"width:100%;background:transparent;padding-bottom:12px"},ae=["xmlns","viewBox"],le=["width","height"],re={key:1},ne=["d","stroke-width","stroke"],se={key:2},ue=["x1","y1","x2","y2","stroke-width","stroke"],ie=["x","y","font-size","fill","font-weight","text-anchor"],ce={key:5,class:"vue-data-ui-watermark"},ve={key:6,ref:"source",dir:"auto"},de={__name:"vue-ui-tiremarks",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(G,{expose:H}){const v=G,{vue_ui_tiremarks:D}=c.useConfig(),$=e.computed(()=>!!v.dataset&&Object.keys(v.dataset).length),B=e.ref(c.createUid()),P=e.ref(null),R=e.ref(null),O=e.ref(0),A=e.ref(0),t=e.computed({get:()=>E(),set:o=>o}),{userOptionsVisible:x,setUserOptionsVisibility:N,keepUserOptionState:z}=Z.useUserOptionState({config:t.value});function E(){const o=L.useNestedProp({userConfig:v.config,defaultConfig:D});return o.theme?{...L.useNestedProp({userConfig:c.themes.vue_ui_tiremarks[o.theme]||v.config,defaultConfig:o})}:o}e.watch(()=>v.config,o=>{t.value=E(),x.value=!t.value.showOnChartHover,M(),A.value+=1},{deep:!0});const{isPrinting:I,isImaging:F,generatePdf:V,generateImage:q}=j.usePrinter({elementId:B.value,fileName:t.value.style.chart.title.text||"vue-ui-tiremarks"}),X=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),s=e.ref(t.value.style.chart.animation.use?0:c.checkNaN(v.dataset.percentage));e.watch(()=>v.dataset,o=>{t.value.style.chart.animation.use?T(o.percentage):s.value=o.percentage||0},{deep:!0}),e.onMounted(()=>{M()});function T(o){let n=t.value.style.chart.animation.speed;const a=Math.abs(o-s.value)/(n*120);function r(){s.value<o?s.value=Math.min(s.value+a,o):s.value>o&&(s.value=Math.max(s.value-a,o)),s.value!==o&&requestAnimationFrame(r)}r()}function M(){c.objectIsEmpty(v.dataset)&&c.error({componentName:"VueUiTiremarks",type:"dataset"}),T(v.dataset.percentage||0)}const f=e.computed(()=>t.value.style.chart.layout.display==="vertical"),u=e.computed(()=>{const o={top:48,left:64,right:64,bottom:48};return f.value?{top:t.value.style.chart.percentage.verticalPosition==="top"?o.top:3,left:3,right:3,bottom:t.value.style.chart.percentage.verticalPosition==="bottom"?o.bottom:3}:{top:0,bottom:0,left:t.value.style.chart.percentage.horizontalPosition==="left"?o.left:3,right:t.value.style.chart.percentage.horizontalPosition==="right"?o.right:10}}),C=e.computed(()=>Object.values(u.value).reduce((o,n)=>o+n,0)),l=e.computed(()=>({height:f.value?312:56,width:f.value?56:312})),i=e.computed(()=>f.value?{mark:(l.value.height-C.value)/100*.5,space:(l.value.height-C.value)/100*.5}:{mark:(l.value.width-C.value)/100*.5,space:(l.value.width-C.value)/100*.5}),U=e.computed(()=>{const o=[];for(let a=0;a<100;a+=1){const r=t.value.style.chart.layout.ticks.gradient.show?c.shiftHue(t.value.style.chart.layout.activeColor,a/100*(t.value.style.chart.layout.ticks.gradient.shiftHueIntensity/100)):t.value.style.chart.layout.activeColor;if(f.value){const y=t.value.style.chart.layout.crescendo?(100-a)*(l.value.width-u.value.left-u.value.right)/100/3:0,d=u.value.left+4+y,h=l.value.width-u.value.right-4-y,p=l.value.height-u.value.bottom-a*i.value.mark-a*i.value.space-i.value.mark,m=l.value.height-u.value.bottom-a*i.value.mark-a*i.value.space-i.value.mark,k=(h-d)/t.value.style.chart.layout.curveAngleX,b=t.value.style.chart.layout.curveAngleY*((1+a)/100);o.push({x1:d,x2:h,y1:p,y2:m,curve:`M ${d} ${p} C ${d+k} ${p-b}, ${h-k} ${m-b}, ${h} ${m}`,color:r})}else{const y=t.value.style.chart.layout.crescendo?(100-a)*(l.value.height-u.value.top-u.value.bottom)/100/3:0,d=u.value.left+a*i.value.mark+a*i.value.space-i.value.mark,h=d,p=u.value.top+4+y,m=l.value.height-u.value.bottom-4-y,k=t.value.style.chart.layout.curveAngleY*((1+a)/100),b=(m-p)/t.value.style.chart.layout.curveAngleX;o.push({x1:d,x2:h,y1:p,y2:m,curve:`M ${d} ${p} C ${d+k} ${p+b}, ${h+k} ${m-b}, ${h} ${m}`,color:r})}}return o}),g=e.computed(()=>{let o,n,a;const r=t.value.style.chart.percentage.fontSize/3;return f.value?t.value.style.chart.percentage.verticalPosition==="top"?(o=l.value.width/2,n=u.value.top/2,a="middle"):t.value.style.chart.percentage.verticalPosition==="bottom"&&(o=l.value.width/2,n=l.value.height-u.value.bottom/2+r,a="middle"):t.value.style.chart.percentage.horizontalPosition==="left"?(o=4,n=l.value.height/2+r,a="start"):t.value.style.chart.percentage.horizontalPosition==="right"&&(o=l.value.width-u.value.right+8,n=l.value.height/2+r,a="start"),{x:o,y:n,textAnchor:a,bold:t.value.style.chart.percentage.bold,fontSize:t.value.style.chart.percentage.fontSize,fill:t.value.style.chart.percentage.color}}),_=e.ref(!1);function Y(o){_.value=o,O.value+=1}const w=e.ref(!1);function S(){w.value=!w.value}return H({generatePdf:V,generateImage:q,toggleAnnotator:S}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tiremarksChart",ref:P,class:e.normalizeClass(`vue-ui-tiremarks ${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}`),id:B.value,onMouseenter:n[0]||(n[0]=()=>e.unref(N)(!0)),onMouseleave:n[1]||(n[1]=()=>e.unref(N)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(W.PenAndPaper,{key:0,parent:P.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:w.value,onClose:S},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),X.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:R,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",oe,[(e.openBlock(),e.createBlock(J._sfc_main,{key:`title_${A.value}`,config:{title:{cy:"wheel-title",...t.value.style.chart.title},subtitle:{cy:"wheel-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))])):e.createCommentVNode("",!0),t.value.userOptions.show&&$.value&&(e.unref(z)||e.unref(x))?(e.openBlock(),e.createBlock(j.UserOptions,{ref:"details",key:`user_options_${O.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(I),isImaging:e.unref(F),uid:B.value,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,hasXls:!1,isFullscreen:_.value,titles:{...t.value.userOptions.buttonTitles},chartElement:P.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:w.value,onToggleFullscreen:Y,onGeneratePdf:e.unref(V),onGenerateImage:e.unref(q),onToggleAnnotator:S,style:e.normalizeStyle({visibility:e.unref(z)?e.unref(x)?"visible":"hidden":"visible"})},e.createSlots({_:2},[o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:r})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:r})),void 0,!0)]),key:"2"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:a,isAnnotator:r})=>[e.renderSlot(o.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:a,isAnnotator:r})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),$.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(c.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":_.value,"vue-data-ui-fulscreen--off":!_.value}),viewBox:`0 0 ${l.value.width} ${l.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Q._sfc_main),o.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:l.value.width,height:l.value.height,style:{pointerEvents:"none"}},[e.renderSlot(o.$slots,"chart-background",{},void 0,!0)],8,le)):e.createCommentVNode("",!0),t.value.style.chart.layout.curved?(e.openBlock(),e.createElementBlock("g",re,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value,(a,r)=>(e.openBlock(),e.createElementBlock("path",{d:a.curve,"stroke-width":i.value.mark,stroke:s.value>=r?a.color:t.value.style.chart.layout.inactiveColor,"stroke-linecap":"round",fill:"none",class:e.normalizeClass({"vue-ui-tick-animated":t.value.style.chart.animation.use&&r<=s.value})},null,10,ne))),256))])):(e.openBlock(),e.createElementBlock("g",se,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value,(a,r)=>(e.openBlock(),e.createElementBlock("line",{x1:a.x1,y1:a.y1,x2:a.x2,y2:a.y2,"stroke-width":i.value.mark,stroke:s.value>=r?a.color:t.value.style.chart.layout.inactiveColor,"stroke-linecap":"round"},null,8,ue))),256))])),t.value.style.chart.percentage.show?(e.openBlock(),e.createElementBlock("text",{key:3,x:g.value.x,y:g.value.y,"font-size":g.value.fontSize,fill:t.value.style.chart.layout.ticks.gradient.show&&t.value.style.chart.percentage.useGradientColor?e.unref(c.shiftHue)(t.value.style.chart.layout.activeColor,s.value/100*(t.value.style.chart.layout.ticks.gradient.shiftHueIntensity/100)):t.value.style.chart.percentage.color,"font-weight":g.value.bold?"bold":"normal","text-anchor":g.value.textAnchor},e.toDisplayString(e.unref(c.applyDataLabel)(t.value.style.chart.percentage.formatter,s.value,e.unref(c.dataLabel)({v:s.value,s:"%",r:t.value.style.chart.percentage.rounding}))),9,ie)):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"svg",{svg:l.value},void 0,!0)],14,ae)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",ce,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(I)||e.unref(F)})),void 0,!0)])):e.createCommentVNode("",!0),o.$slots.source?(e.openBlock(),e.createElementBlock("div",ve,[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),$.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(K.default,{key:7,config:{type:"tiremarks",style:{backgroundColor:t.value.style.chart.backgroundColor,tiremarks:{color:"#CCCCCC"}}}},null,8,["config"]))],46,te))}},he=ee._export_sfc(de,[["__scopeId","data-v-60aa805a"]]);exports.default=he;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),L=require("./useNestedProp-Bu958azG.cjs"),c=require("./index-KJL8ra_6.cjs"),J=require("./Title-D-6pIV0l.cjs"),j=require("./usePrinter-pDOF3CfL.cjs"),K=require("./vue-ui-skeleton-D_YCUi1y.cjs"),Q=require("./PackageVersion-Dn-t7tbm.cjs"),W=require("./PenAndPaper-DFXJJink.cjs"),Z=require("./useUserOptionState-BgepsfED.cjs"),ee=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),te=["id"],oe={key:2,style:"width:100%;background:transparent;padding-bottom:12px"},ae=["xmlns","viewBox"],le=["width","height"],re={key:1},ne=["d","stroke-width","stroke"],se={key:2},ue=["x1","y1","x2","y2","stroke-width","stroke"],ie=["x","y","font-size","fill","font-weight","text-anchor"],ce={key:5,class:"vue-data-ui-watermark"},ve={key:6,ref:"source",dir:"auto"},de={__name:"vue-ui-tiremarks",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(G,{expose:H}){const v=G,{vue_ui_tiremarks:D}=c.useConfig(),$=e.computed(()=>!!v.dataset&&Object.keys(v.dataset).length),B=e.ref(c.createUid()),P=e.ref(null),R=e.ref(null),O=e.ref(0),A=e.ref(0),t=e.computed({get:()=>E(),set:o=>o}),{userOptionsVisible:x,setUserOptionsVisibility:N,keepUserOptionState:z}=Z.useUserOptionState({config:t.value});function E(){const o=L.useNestedProp({userConfig:v.config,defaultConfig:D});return o.theme?{...L.useNestedProp({userConfig:c.themes.vue_ui_tiremarks[o.theme]||v.config,defaultConfig:o})}:o}e.watch(()=>v.config,o=>{t.value=E(),x.value=!t.value.showOnChartHover,M(),A.value+=1},{deep:!0});const{isPrinting:I,isImaging:F,generatePdf:V,generateImage:q}=j.usePrinter({elementId:B.value,fileName:t.value.style.chart.title.text||"vue-ui-tiremarks"}),X=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),s=e.ref(t.value.style.chart.animation.use?0:c.checkNaN(v.dataset.percentage));e.watch(()=>v.dataset,o=>{t.value.style.chart.animation.use?T(o.percentage):s.value=o.percentage||0},{deep:!0}),e.onMounted(()=>{M()});function T(o){let n=t.value.style.chart.animation.speed;const a=Math.abs(o-s.value)/(n*120);function r(){s.value<o?s.value=Math.min(s.value+a,o):s.value>o&&(s.value=Math.max(s.value-a,o)),s.value!==o&&requestAnimationFrame(r)}r()}function M(){c.objectIsEmpty(v.dataset)&&c.error({componentName:"VueUiTiremarks",type:"dataset"}),T(v.dataset.percentage||0)}const f=e.computed(()=>t.value.style.chart.layout.display==="vertical"),u=e.computed(()=>{const o={top:48,left:64,right:64,bottom:48};return f.value?{top:t.value.style.chart.percentage.verticalPosition==="top"?o.top:3,left:3,right:3,bottom:t.value.style.chart.percentage.verticalPosition==="bottom"?o.bottom:3}:{top:0,bottom:0,left:t.value.style.chart.percentage.horizontalPosition==="left"?o.left:3,right:t.value.style.chart.percentage.horizontalPosition==="right"?o.right:10}}),C=e.computed(()=>Object.values(u.value).reduce((o,n)=>o+n,0)),l=e.computed(()=>({height:f.value?312:56,width:f.value?56:312})),i=e.computed(()=>f.value?{mark:(l.value.height-C.value)/100*.5,space:(l.value.height-C.value)/100*.5}:{mark:(l.value.width-C.value)/100*.5,space:(l.value.width-C.value)/100*.5}),U=e.computed(()=>{const o=[];for(let a=0;a<100;a+=1){const r=t.value.style.chart.layout.ticks.gradient.show?c.shiftHue(t.value.style.chart.layout.activeColor,a/100*(t.value.style.chart.layout.ticks.gradient.shiftHueIntensity/100)):t.value.style.chart.layout.activeColor;if(f.value){const y=t.value.style.chart.layout.crescendo?(100-a)*(l.value.width-u.value.left-u.value.right)/100/3:0,d=u.value.left+4+y,h=l.value.width-u.value.right-4-y,p=l.value.height-u.value.bottom-a*i.value.mark-a*i.value.space-i.value.mark,m=l.value.height-u.value.bottom-a*i.value.mark-a*i.value.space-i.value.mark,k=(h-d)/t.value.style.chart.layout.curveAngleX,b=t.value.style.chart.layout.curveAngleY*((1+a)/100);o.push({x1:d,x2:h,y1:p,y2:m,curve:`M ${d} ${p} C ${d+k} ${p-b}, ${h-k} ${m-b}, ${h} ${m}`,color:r})}else{const y=t.value.style.chart.layout.crescendo?(100-a)*(l.value.height-u.value.top-u.value.bottom)/100/3:0,d=u.value.left+a*i.value.mark+a*i.value.space-i.value.mark,h=d,p=u.value.top+4+y,m=l.value.height-u.value.bottom-4-y,k=t.value.style.chart.layout.curveAngleY*((1+a)/100),b=(m-p)/t.value.style.chart.layout.curveAngleX;o.push({x1:d,x2:h,y1:p,y2:m,curve:`M ${d} ${p} C ${d+k} ${p+b}, ${h+k} ${m-b}, ${h} ${m}`,color:r})}}return o}),g=e.computed(()=>{let o,n,a;const r=t.value.style.chart.percentage.fontSize/3;return f.value?t.value.style.chart.percentage.verticalPosition==="top"?(o=l.value.width/2,n=u.value.top/2,a="middle"):t.value.style.chart.percentage.verticalPosition==="bottom"&&(o=l.value.width/2,n=l.value.height-u.value.bottom/2+r,a="middle"):t.value.style.chart.percentage.horizontalPosition==="left"?(o=4,n=l.value.height/2+r,a="start"):t.value.style.chart.percentage.horizontalPosition==="right"&&(o=l.value.width-u.value.right+8,n=l.value.height/2+r,a="start"),{x:o,y:n,textAnchor:a,bold:t.value.style.chart.percentage.bold,fontSize:t.value.style.chart.percentage.fontSize,fill:t.value.style.chart.percentage.color}}),_=e.ref(!1);function Y(o){_.value=o,O.value+=1}const w=e.ref(!1);function S(){w.value=!w.value}return H({generatePdf:V,generateImage:q,toggleAnnotator:S}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tiremarksChart",ref:P,class:e.normalizeClass(`vue-ui-tiremarks ${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}`),id:B.value,onMouseenter:n[0]||(n[0]=()=>e.unref(N)(!0)),onMouseleave:n[1]||(n[1]=()=>e.unref(N)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(W.PenAndPaper,{key:0,parent:P.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:w.value,onClose:S},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),X.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:R,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",oe,[(e.openBlock(),e.createBlock(J._sfc_main,{key:`title_${A.value}`,config:{title:{cy:"wheel-title",...t.value.style.chart.title},subtitle:{cy:"wheel-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))])):e.createCommentVNode("",!0),t.value.userOptions.show&&$.value&&(e.unref(z)||e.unref(x))?(e.openBlock(),e.createBlock(j.UserOptions,{ref:"details",key:`user_options_${O.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(I),isImaging:e.unref(F),uid:B.value,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,hasXls:!1,isFullscreen:_.value,titles:{...t.value.userOptions.buttonTitles},chartElement:P.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:w.value,onToggleFullscreen:Y,onGeneratePdf:e.unref(V),onGenerateImage:e.unref(q),onToggleAnnotator:S,style:e.normalizeStyle({visibility:e.unref(z)?e.unref(x)?"visible":"hidden":"visible"})},e.createSlots({_:2},[o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:r})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:r})),void 0,!0)]),key:"2"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:a,isAnnotator:r})=>[e.renderSlot(o.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:a,isAnnotator:r})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),$.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(c.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":_.value,"vue-data-ui-fulscreen--off":!_.value}),viewBox:`0 0 ${l.value.width} ${l.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Q._sfc_main),o.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:l.value.width,height:l.value.height,style:{pointerEvents:"none"}},[e.renderSlot(o.$slots,"chart-background",{},void 0,!0)],8,le)):e.createCommentVNode("",!0),t.value.style.chart.layout.curved?(e.openBlock(),e.createElementBlock("g",re,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value,(a,r)=>(e.openBlock(),e.createElementBlock("path",{d:a.curve,"stroke-width":i.value.mark,stroke:s.value>=r?a.color:t.value.style.chart.layout.inactiveColor,"stroke-linecap":"round",fill:"none",class:e.normalizeClass({"vue-ui-tick-animated":t.value.style.chart.animation.use&&r<=s.value})},null,10,ne))),256))])):(e.openBlock(),e.createElementBlock("g",se,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value,(a,r)=>(e.openBlock(),e.createElementBlock("line",{x1:a.x1,y1:a.y1,x2:a.x2,y2:a.y2,"stroke-width":i.value.mark,stroke:s.value>=r?a.color:t.value.style.chart.layout.inactiveColor,"stroke-linecap":"round"},null,8,ue))),256))])),t.value.style.chart.percentage.show?(e.openBlock(),e.createElementBlock("text",{key:3,x:g.value.x,y:g.value.y,"font-size":g.value.fontSize,fill:t.value.style.chart.layout.ticks.gradient.show&&t.value.style.chart.percentage.useGradientColor?e.unref(c.shiftHue)(t.value.style.chart.layout.activeColor,s.value/100*(t.value.style.chart.layout.ticks.gradient.shiftHueIntensity/100)):t.value.style.chart.percentage.color,"font-weight":g.value.bold?"bold":"normal","text-anchor":g.value.textAnchor},e.toDisplayString(e.unref(c.applyDataLabel)(t.value.style.chart.percentage.formatter,s.value,e.unref(c.dataLabel)({v:s.value,s:"%",r:t.value.style.chart.percentage.rounding}))),9,ie)):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"svg",{svg:l.value},void 0,!0)],14,ae)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",ce,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(I)||e.unref(F)})),void 0,!0)])):e.createCommentVNode("",!0),o.$slots.source?(e.openBlock(),e.createElementBlock("div",ve,[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),$.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(K.default,{key:7,config:{type:"tiremarks",style:{backgroundColor:t.value.style.chart.backgroundColor,tiremarks:{color:"#CCCCCC"}}}},null,8,["config"]))],46,te))}},he=ee._export_sfc(de,[["__scopeId","data-v-60aa805a"]]);exports.default=he;
@@ -1,11 +1,11 @@
1
1
  import { computed as h, ref as k, watch as W, onMounted as ie, openBlock as s, createElementBlock as c, normalizeClass as U, normalizeStyle as G, unref as n, createBlock as I, createCommentVNode as d, createSlots as ce, withCtx as F, renderSlot as b, normalizeProps as L, guardReactiveProps as j, createVNode as ve, Fragment as Z, renderList as ee, toDisplayString as he } from "vue";
2
- import { u as te } from "./useNestedProp-3oLbIjGJ.js";
3
- import { u as de, c as fe, t as pe, v as ye, o as ge, e as me, w as ae, X as ke, i as be, f as _e } from "./index-DMvK32iW.js";
4
- import { _ as Ce } from "./Title-2MaMBji9.js";
5
- import { u as $e, U as we } from "./usePrinter-7L_B-x1F.js";
6
- import xe from "./vue-ui-skeleton-Bzsl5gab.js";
7
- import { _ as Pe } from "./PackageVersion-BqwuIW-T.js";
8
- import { P as Oe } from "./PenAndPaper-LsFeEPDj.js";
2
+ import { u as te } from "./useNestedProp-Ka0R_Yqa.js";
3
+ import { u as de, c as fe, t as pe, v as ye, o as ge, e as me, w as ae, X as ke, i as be, f as _e } from "./index-B8Eaq54E.js";
4
+ import { _ as Ce } from "./Title-XYNHfYwN.js";
5
+ import { u as $e, U as we } from "./usePrinter-D83W2gfG.js";
6
+ import xe from "./vue-ui-skeleton-DpadzgbS.js";
7
+ import { _ as Pe } from "./PackageVersion-CgJdp_Ki.js";
8
+ import { P as Oe } from "./PenAndPaper-BTLEk55u.js";
9
9
  import { u as Ae } from "./useUserOptionState-BIvW1Kz7.js";
10
10
  import { _ as Ie } from "./_plugin-vue_export-helper-CHgC5LLL.js";
11
11
  const Fe = ["id"], ze = {