vue-data-ui 2.6.52-beta.8 → 2.7.0

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 (160) hide show
  1. package/dist/{Arrow-C00zX8JE.js → Arrow-Tcvy-1tf.js} +1 -1
  2. package/dist/{Arrow-ixzPNbwK.cjs → Arrow-q4elsfyi.cjs} +1 -1
  3. package/dist/{BaseIcon-Dmj_TDMF.js → BaseIcon-BSkS89RT.js} +1 -1
  4. package/dist/{BaseIcon-C3fbvJja.cjs → BaseIcon-wuetMnRj.cjs} +1 -1
  5. package/dist/{ColorPicker-DsY6GVvR.js → ColorPicker-B-UF8Xdm.js} +3 -3
  6. package/dist/{ColorPicker-FHm8EGG5.cjs → ColorPicker-BsF6StNh.cjs} +1 -1
  7. package/dist/{DataTable-C3hniWU1.cjs → DataTable-CxPPog04.cjs} +1 -1
  8. package/dist/{DataTable-75Q8mEKL.js → DataTable-DRB6Rt3T.js} +2 -2
  9. package/dist/{Legend-BAiNUVyQ.cjs → Legend-BiZSIl_8.cjs} +1 -1
  10. package/dist/{Legend-bSp40GLk.js → Legend-DACz926s.js} +2 -2
  11. package/dist/PackageVersion-K_dIfu_1.cjs +1 -0
  12. package/dist/{PackageVersion-BgpSLaAT.js → PackageVersion-iM0N7imM.js} +1 -1
  13. package/dist/{PenAndPaper-SeG6fNqq.js → PenAndPaper-Cnh7VAnd.js} +3 -3
  14. package/dist/{PenAndPaper-Cr-AMhUp.cjs → PenAndPaper-D4YVLZC3.cjs} +1 -1
  15. package/dist/{Shape-Cc_e-XT6.js → Shape-BlqLhJkb.js} +1 -1
  16. package/dist/{Shape-BGY-aMv_.cjs → Shape-fiDmogTF.cjs} +1 -1
  17. package/dist/{Slicer-Di3IBy55.js → Slicer-B6gtffPg.js} +2 -2
  18. package/dist/{Slicer-C1L3wLiK.cjs → Slicer-BxsQavxP.cjs} +1 -1
  19. package/dist/{Title-CMPB3B-Y.js → Title-BnbtlZuQ.js} +1 -1
  20. package/dist/{Title-BHs3KKCA.cjs → Title-ftVcKm8j.cjs} +1 -1
  21. package/dist/{Tooltip-DSvtYMC-.js → Tooltip-BaCjRGR8.js} +1 -1
  22. package/dist/{Tooltip-Co6srAeW.cjs → Tooltip-Dvq8qMfG.cjs} +1 -1
  23. package/dist/dom-to-png-DBqUgTmu.cjs +3 -0
  24. package/dist/dom-to-png-DkmDo75x.js +243 -0
  25. package/dist/{img-XjSrJ8sW.cjs → img-DQpd_5yO.cjs} +1 -1
  26. package/dist/{img-DQUYWy9P.js → img-U95ptFho.js} +1 -1
  27. package/dist/{index-C9jn4-R2.js → index-D-HIb4Mn.js} +1 -1
  28. package/dist/{index-BNgRt1qb.cjs → index-D5k9fip1.cjs} +1 -1
  29. package/dist/{pdf-B-1_u2ev.js → pdf-D2ouSvO-.js} +1 -1
  30. package/dist/{pdf-Dyo3oB3L.cjs → pdf-XZ9tIX1c.cjs} +1 -1
  31. package/dist/{useNestedProp-Rw4Gh-Uj.cjs → useNestedProp-CpW5Z_Ke.cjs} +1 -1
  32. package/dist/{useNestedProp-CJCesTk2.js → useNestedProp-qC6DmhPQ.js} +1 -1
  33. package/dist/{usePrinter-MoXgFVyY.cjs → usePrinter-DCjcVk63.cjs} +1 -1
  34. package/dist/{usePrinter-8P2T-WVP.js → usePrinter-Dur-51db.js} +3 -3
  35. package/dist/{vue-data-ui-DhgHDjTN.js → vue-data-ui-fow8gtsn.js} +60 -60
  36. package/dist/{vue-data-ui-Cs8ck5zm.cjs → vue-data-ui-ozZctcYD.cjs} +1 -1
  37. package/dist/vue-data-ui.cjs +1 -1
  38. package/dist/vue-data-ui.js +1 -1
  39. package/dist/{vue-ui-3d-bar-CaqdFtu5.js → vue-ui-3d-bar-C_JTgO_-.js} +9 -9
  40. package/dist/{vue-ui-3d-bar-UOe9wHWa.cjs → vue-ui-3d-bar-DTlVayO8.cjs} +1 -1
  41. package/dist/{vue-ui-accordion-OwcyuAOJ.cjs → vue-ui-accordion-BiVdHPDv.cjs} +1 -1
  42. package/dist/{vue-ui-accordion-LJpg13C-.js → vue-ui-accordion-qmHz6V_f.js} +3 -3
  43. package/dist/{vue-ui-age-pyramid-CLduI-aC.js → vue-ui-age-pyramid-BtqOmeDs.js} +10 -10
  44. package/dist/{vue-ui-age-pyramid-DlXIpFMh.cjs → vue-ui-age-pyramid-DbCnCy8z.cjs} +1 -1
  45. package/dist/{vue-ui-annotator-BXU3Xunn.js → vue-ui-annotator-CsZ_WLwo.js} +2 -2
  46. package/dist/{vue-ui-annotator-CTOa_s21.cjs → vue-ui-annotator-DX-Zq2VD.cjs} +1 -1
  47. package/dist/{vue-ui-bullet-C0ntlZsS.cjs → vue-ui-bullet-BqOvmlj_.cjs} +1 -1
  48. package/dist/{vue-ui-bullet-kRODUXjc.js → vue-ui-bullet-DtYQOm8x.js} +8 -8
  49. package/dist/{vue-ui-candlestick-CEnJsMCD.js → vue-ui-candlestick-Bpd4Brzf.js} +11 -11
  50. package/dist/{vue-ui-candlestick-0S_V6Vzz.cjs → vue-ui-candlestick-CY0LcjNv.cjs} +1 -1
  51. package/dist/{vue-ui-carousel-table-Ca8lhddm.js → vue-ui-carousel-table-C8_Ps2Zt.js} +4 -4
  52. package/dist/{vue-ui-carousel-table-DHqhuddo.cjs → vue-ui-carousel-table-CddMetKf.cjs} +1 -1
  53. package/dist/{vue-ui-chestnut--vMgSrmv.js → vue-ui-chestnut-BpSKsoin.js} +8 -8
  54. package/dist/{vue-ui-chestnut-CjQe5IrW.cjs → vue-ui-chestnut-BwXukm4F.cjs} +1 -1
  55. package/dist/{vue-ui-circle-pack-C8AYBzze.cjs → vue-ui-circle-pack-BUlUJ_wP.cjs} +1 -1
  56. package/dist/{vue-ui-circle-pack-Bvo7qnKN.js → vue-ui-circle-pack-CfED_zMB.js} +9 -9
  57. package/dist/{vue-ui-cursor-CNZcwa1b.js → vue-ui-cursor-B5oQgTgE.js} +2 -2
  58. package/dist/{vue-ui-cursor-DgUgP4ki.cjs → vue-ui-cursor-wiDFjlo1.cjs} +1 -1
  59. package/dist/{vue-ui-dashboard-BKFk2-2r.js → vue-ui-dashboard-By0Ava-e.js} +3 -3
  60. package/dist/{vue-ui-dashboard-YXEZEfJm.cjs → vue-ui-dashboard-tFgwPorT.cjs} +1 -1
  61. package/dist/{vue-ui-digits-BETFkD8q.cjs → vue-ui-digits-C8E4WW3j.cjs} +1 -1
  62. package/dist/{vue-ui-digits-COX2qJ9j.js → vue-ui-digits-DVhsYo-l.js} +2 -2
  63. package/dist/{vue-ui-donut-B73dltJt.js → vue-ui-donut-D03p4xQ2.js} +12 -12
  64. package/dist/{vue-ui-donut-BGT24_8F.cjs → vue-ui-donut-DuJGngc8.cjs} +1 -1
  65. package/dist/{vue-ui-donut-evolution-D2glEskf.js → vue-ui-donut-evolution-Ck8bjo-j.js} +11 -11
  66. package/dist/{vue-ui-donut-evolution-CU49ZLsP.cjs → vue-ui-donut-evolution-jBUX8vo1.cjs} +1 -1
  67. package/dist/{vue-ui-dumbbell-BDA2Amz9.js → vue-ui-dumbbell-B1jv_9OG.js} +10 -10
  68. package/dist/{vue-ui-dumbbell-Cnx71N4o.cjs → vue-ui-dumbbell-DDDCgty2.cjs} +1 -1
  69. package/dist/{vue-ui-flow-GGhoRow6.cjs → vue-ui-flow-CjlFZAXS.cjs} +1 -1
  70. package/dist/{vue-ui-flow-_En2yd6J.js → vue-ui-flow-DW_Yxbmf.js} +9 -9
  71. package/dist/{vue-ui-funnel-D_M3lFow.cjs → vue-ui-funnel-CdXskLpT.cjs} +1 -1
  72. package/dist/{vue-ui-funnel-BgNEGMJ1.js → vue-ui-funnel-rUNRbe1S.js} +9 -9
  73. package/dist/{vue-ui-galaxy-BVK8Nj0y.js → vue-ui-galaxy-D-d6BrEQ.js} +11 -11
  74. package/dist/{vue-ui-galaxy-CVqad6o-.cjs → vue-ui-galaxy-DZRdJjEL.cjs} +1 -1
  75. package/dist/{vue-ui-gauge-CnWF9QdC.js → vue-ui-gauge-CJqfHd1V.js} +7 -7
  76. package/dist/{vue-ui-gauge-DNeNFfRf.cjs → vue-ui-gauge-utVziwmC.cjs} +1 -1
  77. package/dist/{vue-ui-gizmo-CscxR_lf.js → vue-ui-gizmo-BJeFSq_h.js} +3 -3
  78. package/dist/{vue-ui-gizmo-DrJpZVIE.cjs → vue-ui-gizmo-BSYmNV2r.cjs} +1 -1
  79. package/dist/{vue-ui-heatmap-drcfb1T3.cjs → vue-ui-heatmap-AOtOaNf0.cjs} +1 -1
  80. package/dist/{vue-ui-heatmap-CSDZEKgL.js → vue-ui-heatmap-BYWReIi3.js} +10 -10
  81. package/dist/{vue-ui-history-plot-DhLSLbmd.cjs → vue-ui-history-plot-BORIs9Ia.cjs} +1 -1
  82. package/dist/{vue-ui-history-plot-CgODYHrP.js → vue-ui-history-plot-OJbA6a9W.js} +11 -11
  83. package/dist/{vue-ui-kpi-C7IBLq1x.js → vue-ui-kpi-ZRPbK9Xb.js} +3 -3
  84. package/dist/{vue-ui-kpi-Dfnu4uV7.cjs → vue-ui-kpi-mzJ2Wwsd.cjs} +1 -1
  85. package/dist/{vue-ui-mini-loader-D3Xr73Ag.cjs → vue-ui-mini-loader-BDpn3tU3.cjs} +1 -1
  86. package/dist/{vue-ui-mini-loader-DYRh4Kkh.js → vue-ui-mini-loader-BpF3Gk95.js} +2 -2
  87. package/dist/{vue-ui-molecule-CafG92yJ.js → vue-ui-molecule-BNKBlCuv.js} +11 -11
  88. package/dist/{vue-ui-molecule-dIazQ3-8.cjs → vue-ui-molecule-n2XcQwWm.cjs} +1 -1
  89. package/dist/{vue-ui-mood-radar-Dy6y3kE8.cjs → vue-ui-mood-radar-D7i4XkJ7.cjs} +1 -1
  90. package/dist/{vue-ui-mood-radar-DVQakt0e.js → vue-ui-mood-radar-DkDCTTGe.js} +11 -11
  91. package/dist/{vue-ui-nested-donuts-CU5dBsxV.js → vue-ui-nested-donuts-B10sUIYh.js} +11 -11
  92. package/dist/{vue-ui-nested-donuts-BCp7ZfNB.cjs → vue-ui-nested-donuts-COztgojn.cjs} +1 -1
  93. package/dist/{vue-ui-onion-CBWFAlLr.cjs → vue-ui-onion-DS8IMdbv.cjs} +1 -1
  94. package/dist/{vue-ui-onion-TiFlxcPg.js → vue-ui-onion-Dm0gIaEo.js} +11 -11
  95. package/dist/{vue-ui-parallel-coordinate-plot-6asHkFPu.js → vue-ui-parallel-coordinate-plot-BARHF8if.js} +12 -12
  96. package/dist/{vue-ui-parallel-coordinate-plot-PbbcxvWb.cjs → vue-ui-parallel-coordinate-plot-DxyZ61ji.cjs} +1 -1
  97. package/dist/{vue-ui-quadrant-BPjDP3xp.cjs → vue-ui-quadrant-CwRmXD1e.cjs} +1 -1
  98. package/dist/{vue-ui-quadrant-SyaL58Pd.js → vue-ui-quadrant-DEy0EDw0.js} +12 -12
  99. package/dist/{vue-ui-quick-chart-BQty6dst.js → vue-ui-quick-chart-CIukip1j.js} +9 -9
  100. package/dist/{vue-ui-quick-chart-Ctk9opDN.cjs → vue-ui-quick-chart-cQQXRntN.cjs} +1 -1
  101. package/dist/{vue-ui-radar-C6zWaydD.cjs → vue-ui-radar-BBW5S8Yt.cjs} +1 -1
  102. package/dist/{vue-ui-radar-k5ZDwfqO.js → vue-ui-radar-bY3aBAJt.js} +12 -12
  103. package/dist/{vue-ui-rating-BQTBxQbu.cjs → vue-ui-rating-BrcdA_Ez.cjs} +1 -1
  104. package/dist/{vue-ui-rating-C8TxcV9Y.js → vue-ui-rating-oiBRruzk.js} +2 -2
  105. package/dist/{vue-ui-relation-circle-PYWsXiN8.cjs → vue-ui-relation-circle-BIwMG6fK.cjs} +1 -1
  106. package/dist/{vue-ui-relation-circle-BovfORoJ.js → vue-ui-relation-circle-Cz4V-P4-.js} +7 -7
  107. package/dist/{vue-ui-rings-CfOlggfy.js → vue-ui-rings-B9v-QBUD.js} +12 -12
  108. package/dist/{vue-ui-rings-CWnMX806.cjs → vue-ui-rings-D2Xkr-UM.cjs} +1 -1
  109. package/dist/{vue-ui-scatter-B78z-q36.js → vue-ui-scatter-B8njCxdy.js} +12 -12
  110. package/dist/{vue-ui-scatter-O7i2lxi0.cjs → vue-ui-scatter-Dax4tsln.cjs} +1 -1
  111. package/dist/{vue-ui-skeleton-C0J43Kn4.cjs → vue-ui-skeleton-Cxg_LxBB.cjs} +1 -1
  112. package/dist/{vue-ui-skeleton-BcdGGi59.js → vue-ui-skeleton-WO50lQWb.js} +3 -3
  113. package/dist/{vue-ui-smiley-LVV1eWbi.cjs → vue-ui-smiley-CZc9x6AH.cjs} +1 -1
  114. package/dist/{vue-ui-smiley-CqH2mkD-.js → vue-ui-smiley-CydE1BoA.js} +2 -2
  115. package/dist/{vue-ui-spark-trend-MWM33ZDh.cjs → vue-ui-spark-trend-CW8LzMy4.cjs} +1 -1
  116. package/dist/{vue-ui-spark-trend-DL_M5NBE.js → vue-ui-spark-trend-sNLwMXHr.js} +5 -5
  117. package/dist/{vue-ui-sparkbar-COVqOLsS.js → vue-ui-sparkbar-BIw5YHYN.js} +4 -4
  118. package/dist/{vue-ui-sparkbar-Cy0jd_oL.cjs → vue-ui-sparkbar-CdEIQGlO.cjs} +1 -1
  119. package/dist/{vue-ui-sparkgauge-B4NFlAva.cjs → vue-ui-sparkgauge-BGv31zUU.cjs} +1 -1
  120. package/dist/{vue-ui-sparkgauge-DIK0TAtb.js → vue-ui-sparkgauge-BY1Db4u6.js} +4 -4
  121. package/dist/{vue-ui-sparkhistogram-CYKueGJ6.js → vue-ui-sparkhistogram-B2qXSmE6.js} +5 -5
  122. package/dist/{vue-ui-sparkhistogram-B5L4FTg8.cjs → vue-ui-sparkhistogram-C5aVsaeV.cjs} +1 -1
  123. package/dist/{vue-ui-sparkline-CAvVCAOw.js → vue-ui-sparkline-B-ROydCI.js} +4 -4
  124. package/dist/{vue-ui-sparkline-H5t3_F1r.cjs → vue-ui-sparkline-nv_hBl_Q.cjs} +1 -1
  125. package/dist/{vue-ui-sparkstackbar-BstG7v1W.js → vue-ui-sparkstackbar-B_fyArxJ.js} +5 -5
  126. package/dist/{vue-ui-sparkstackbar-DldVkp76.cjs → vue-ui-sparkstackbar-Dc7akbeI.cjs} +1 -1
  127. package/dist/{vue-ui-stackbar-BWIzMRNo.js → vue-ui-stackbar-CR-D8XTf.js} +13 -13
  128. package/dist/{vue-ui-stackbar-CARC17Nn.cjs → vue-ui-stackbar-DPheM1P1.cjs} +1 -1
  129. package/dist/{vue-ui-strip-plot-CUMgDKwu.js → vue-ui-strip-plot-BP_ZBS7j.js} +11 -11
  130. package/dist/{vue-ui-strip-plot-CkHggOYn.cjs → vue-ui-strip-plot-Bqcuuu2h.cjs} +1 -1
  131. package/dist/{vue-ui-table-Cgqtlgu4.js → vue-ui-table-C_ARRjn7.js} +1 -1
  132. package/dist/{vue-ui-table-CQM-zHp0.cjs → vue-ui-table-D6zyqYhW.cjs} +1 -1
  133. package/dist/{vue-ui-table-heatmap-COg_3Byw.js → vue-ui-table-heatmap-5kssrpIQ.js} +4 -4
  134. package/dist/{vue-ui-table-heatmap-SlAA9_ed.cjs → vue-ui-table-heatmap-B1wpFAy-.cjs} +1 -1
  135. package/dist/{vue-ui-table-sparkline-D9eEcSVX.js → vue-ui-table-sparkline-DQb6dKDF.js} +5 -5
  136. package/dist/{vue-ui-table-sparkline-2cfdxMoC.cjs → vue-ui-table-sparkline-DqiWxSfS.cjs} +1 -1
  137. package/dist/{vue-ui-thermometer-BLJdC2GC.cjs → vue-ui-thermometer-CmktvEk5.cjs} +1 -1
  138. package/dist/{vue-ui-thermometer-CKAhgTJE.js → vue-ui-thermometer-CzAL7se5.js} +7 -7
  139. package/dist/{vue-ui-timer-hvgApDHz.js → vue-ui-timer-CN4LNkYi.js} +5 -5
  140. package/dist/{vue-ui-timer-CfALKmV8.cjs → vue-ui-timer-CoxSVJEi.cjs} +1 -1
  141. package/dist/{vue-ui-tiremarks-8eAT6M3W.js → vue-ui-tiremarks-CcHbgSJS.js} +7 -7
  142. package/dist/{vue-ui-tiremarks-CsVjNHvC.cjs → vue-ui-tiremarks-G4phSmYS.cjs} +1 -1
  143. package/dist/{vue-ui-treemap-GMC7JeuR.js → vue-ui-treemap-Cd0QURmy.js} +12 -12
  144. package/dist/{vue-ui-treemap-Do9h3aTD.cjs → vue-ui-treemap-X6ai1vvz.cjs} +1 -1
  145. package/dist/{vue-ui-vertical-bar-BwVHAnGa.js → vue-ui-vertical-bar-Bwb6qh-e.js} +12 -12
  146. package/dist/{vue-ui-vertical-bar-C5-D09WQ.cjs → vue-ui-vertical-bar-DkkUwBFF.cjs} +1 -1
  147. package/dist/{vue-ui-waffle-AsBlpum0.js → vue-ui-waffle-BLFwSujO.js} +12 -12
  148. package/dist/{vue-ui-waffle-BhhTPZtZ.cjs → vue-ui-waffle-CuqNVHpO.cjs} +1 -1
  149. package/dist/{vue-ui-wheel-COQTvgsG.cjs → vue-ui-wheel-BF8y9DBh.cjs} +1 -1
  150. package/dist/{vue-ui-wheel-e_lvFNX4.js → vue-ui-wheel-BMKwq-xH.js} +7 -7
  151. package/dist/{vue-ui-word-cloud-CZYz5KSD.js → vue-ui-word-cloud-2YUfi3uy.js} +10 -10
  152. package/dist/{vue-ui-word-cloud-COkqnjNB.cjs → vue-ui-word-cloud-B4OWtLLG.cjs} +1 -1
  153. package/dist/{vue-ui-xy-hwuJWFRy.js → vue-ui-xy-B_rfc8IL.js} +16 -16
  154. package/dist/{vue-ui-xy-glew9KIx.cjs → vue-ui-xy-CC8PUupn.cjs} +2 -2
  155. package/dist/{vue-ui-xy-canvas-DjdScwkd.cjs → vue-ui-xy-canvas-CQhMzfiO.cjs} +1 -1
  156. package/dist/{vue-ui-xy-canvas-Ct5EKPo4.js → vue-ui-xy-canvas-ta12fbOW.js} +12 -12
  157. package/package.json +1 -2
  158. package/dist/PackageVersion-D4qSM1se.cjs +0 -1
  159. package/dist/dom-to-png-8dGGc19p.cjs +0 -3
  160. package/dist/dom-to-png-DqpDZxWl.js +0 -221
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("vue"),u=require("./index-BNgRt1qb.cjs"),p=require("./useResponsive-DQmBAoBf.cjs"),vt=require("./Tooltip-Co6srAeW.cjs"),dt=require("./Legend-BAiNUVyQ.cjs"),ht=require("./Title-BHs3KKCA.cjs"),ft=require("./Slicer-C1L3wLiK.cjs"),Ye=require("./usePrinter-MoXgFVyY.cjs"),yt=require("./vue-ui-accordion-OwcyuAOJ.cjs"),pt=require("./DataTable-C3hniWU1.cjs"),gt=require("./vue-ui-skeleton-C0J43Kn4.cjs"),He=require("./useNestedProp-Rw4Gh-Uj.cjs"),mt=require("./useUserOptionState-BgepsfED.cjs"),bt=require("./useChartAccessibility-Cm7nkzTG.cjs"),me=require("./BaseIcon-C3fbvJja.cjs"),xt=require("./ColorPicker-FHm8EGG5.cjs"),Xe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),kt={class:l.normalizeClass({"vue-ui-pen-and-paper-action":!0}),style:{padding:"0 !important"}},Lt=["disabled"],Ct=["xmlns","viewBox"],wt=["cx","cy","r","fill"],St=["d","stroke","stroke-width"],$t=["d","stroke","stroke-width"],zt={__name:"NonSvgPenAndPaper",props:{parent:{type:HTMLElement},backgroundColor:{type:String,default:"#FFFFFF"},color:{type:String,default:"#2D353C"},active:{type:Boolean,default:!1}},emits:["close"],setup($,{emit:be}){const X=$,xe=be,x=l.ref([]),D=l.ref([]),Z=l.ref("0 0 0 0"),V=l.ref(X.color),c=l.ref(1),k=l.computed(()=>u.lightenHexColor(X.color,.6));function F({width:h,height:v}){Z.value=`0 0 ${h} ${v}`}const U=l.ref(null);l.onMounted(()=>{l.nextTick(()=>{if(X.parent){U.value=new ResizeObserver(s=>{for(const d of s){const{width:g,height:C}=d.contentRect;F({width:g,height:C})}}),U.value.observe(X.parent);const{width:h,height:v}=X.parent.getBoundingClientRect();F({width:h,height:v})}})}),l.onBeforeUnmount(()=>{U.value&&U.value.disconnect()}),l.watch(()=>X.parent,h=>{if(!h)return;const{width:v,height:s}=X.parent.getBoundingClientRect();F({width:v,height:s})},{immediate:!0});const f=l.ref(!1),A=l.ref(""),_=l.ref(null);function I(h){if(!_.value)return;f.value=!0;const{x:v,y:s}=re(h);A.value=`M ${v} ${s}`}function q(h){if(!f.value||!_.value)return;const{x:v,y:s}=re(h);A.value+=` ${v} ${s}`}function Y(h){const v=h.trim().split(/\s+/);if(v.length<4)return h;const s=v.slice(1).map(Number);if(s.length%2!==0)return h;const d=G(s),g=[`M ${d[0]} ${d[1]}`];for(let E=2;E<d.length-2;E+=2){const t=d[E-2],M=d[E-1],P=d[E],T=d[E+1],B=(t+P)/2,j=(M+T)/2;g.push(`Q ${t} ${M} ${B} ${j}`)}const C=d[d.length-2],S=d[d.length-1];return g.push(`L ${C} ${S}`),g.join(" ")}function G(h,v=1){const s=[...h];for(let d=2;d<h.length-2;d+=2){const g=h[d],C=h[d+1],S=h[d-2],E=h[d-1],t=h[d+2],M=h[d+3];s[d]=g+v*((S+t)/2-g),s[d+1]=C+v*((E+M)/2-C)}return s}function oe(h){const v=h.trim().split(/\s+/);let s="",d="",g=null,C=null;for(let S=0;S<v.length;S+=1){const E=v[S];if(isNaN(E)){if(d=E,d==="M"||d==="L")g=parseFloat(v[++S]),C=parseFloat(v[++S]),s+=`${d}${g} ${C}`;else if(d==="Q"){const t=parseFloat(v[++S]),M=parseFloat(v[++S]),P=parseFloat(v[++S]),T=parseFloat(v[++S]);t===g&&M===C?s+=`t${P-g} ${T-C}`:s+=`q${t-g} ${M-C} ${P-g} ${T-C}`,g=P,C=T}}else{const t=parseFloat(E),M=parseFloat(v[++S]);if(d==="L"){const P=t-g,T=M-C;P===0?s+=`v${T}`:T===0?s+=`h${P}`:s+=`l${P} ${T}`,g=t,C=M}else if(d==="Q"){const P=t,T=M,B=parseFloat(v[++S]),j=parseFloat(v[++S]);P===g&&T===C?s+=`t${B-g} ${j-C}`:s+=`q${P-g} ${T-C} ${B-g} ${j-C}`,g=B,C=j}}}return s}function ee(){f.value&&(x.value.push({strokeWidth:c.value,path:oe(Y(A.value)),color:V.value}),D.value=[],A.value=""),f.value=!1}function re(h){if(!_.value)return{x:0,y:0};const v=_.value.getBoundingClientRect();let s,d;return h.touches&&h.touches.length?(s=h.touches[0].clientX,d=h.touches[0].clientY):(s=h.clientX,d=h.clientY),{x:s-v.left,y:d-v.top}}l.ref(!1);function te(){if(x.value.length>0){const h=x.value.pop();D.value.push(h)}}function ce(){if(D.value.length>0){const h=D.value.pop();x.value.push(h)}}function ve(){x.value=[],D.value=[]}const de=l.ref(null);return(h,v)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[$.active?(l.openBlock(),l.createElementBlock("div",{key:0,"data-dom-to-png-ignore":"",class:l.normalizeClass({"vue-ui-pen-and-paper-actions":!0,visible:$.active})},[l.createElementVNode("button",{class:"vue-ui-pen-and-paper-action",style:l.normalizeStyle({backgroundColor:$.backgroundColor,border:`1px solid ${k.value}`}),onClick:v[0]||(v[0]=s=>xe("close"))},[l.createVNode(me.default,{name:"close",stroke:$.color},null,8,["stroke"])],4),l.createElementVNode("button",kt,[l.createVNode(xt.ColorPicker,{value:V.value,"onUpdate:value":v[1]||(v[1]=s=>V.value=s),backgroundColor:$.backgroundColor,buttonBorderColor:k.value},null,8,["value","backgroundColor","buttonBorderColor"])]),l.createElementVNode("button",{class:l.normalizeClass({"vue-ui-pen-and-paper-action":!0,"vue-ui-pen-and-paper-action-disabled":!x.value.length}),disabled:!x.value.length,style:l.normalizeStyle({backgroundColor:$.backgroundColor,border:`1px solid ${k.value}`}),onClick:te},[l.createVNode(me.default,{name:"restart",stroke:$.color},null,8,["stroke"])],14,Lt),l.createElementVNode("button",{class:l.normalizeClass({"vue-ui-pen-and-paper-action":!0,"vue-ui-pen-and-paper-action-disabled":!D.value.length}),style:l.normalizeStyle({backgroundColor:$.backgroundColor,border:`1px solid ${k.value}`}),onClick:ce},[l.createVNode(me.default,{name:"restart",stroke:$.color,style:{transform:"scaleX(-1)"}},null,8,["stroke"])],6),l.createElementVNode("button",{class:l.normalizeClass([{"vue-ui-pen-and-paper-action":!0,"vue-ui-pen-and-paper-action-disabled":!x.value.length},"vue-ui-pen-and-paper-action"]),style:l.normalizeStyle({backgroundColor:$.backgroundColor,border:`1px solid ${k.value}`}),onClick:ve},[l.createVNode(me.default,{name:"trash",stroke:$.color},null,8,["stroke"])],6),l.withDirectives(l.createElementVNode("input",{ref_key:"range",ref:de,type:"range",class:"vertical-range",min:.5,max:12,step:.1,"onUpdate:modelValue":v[2]||(v[2]=s=>c.value=s),style:l.normalizeStyle({accentColor:$.color})},null,4),[[l.vModelText,c.value]])],2)):l.createCommentVNode("",!0),(l.openBlock(),l.createElementBlock("svg",{ref_key:"svgElement",ref:_,xmlns:l.unref(u.XMLNS),viewBox:Z.value,class:l.normalizeClass({"vue-ui-pen-and-paper":!0,inactive:!$.active}),onMousedown:I,onMousemove:q,onMouseup:ee,onMouseleave:ee,onTouchstart:l.withModifiers(I,["prevent"]),onTouchmove:l.withModifiers(q,["prevent"]),onTouchend:ee},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(x.value,s=>(l.openBlock(),l.createElementBlock(l.Fragment,{key:s},[s.path.replace("M","").split(" ").length===2?(l.openBlock(),l.createElementBlock("circle",{key:0,cx:s.path.replace("M","").split(" ")[0],cy:s.path.replace("M","").split(" ")[1],r:s.strokeWidth/2,fill:s.color},null,8,wt)):(l.openBlock(),l.createElementBlock("path",{key:1,class:"vue-ui-pen-and-paper-path",d:s.path,stroke:s.color,"stroke-width":s.strokeWidth,fill:"none"},null,8,St))],64))),128)),f.value?(l.openBlock(),l.createElementBlock("path",{key:0,class:"vue-ui-pen-and-paper-path vue-ui-pen-and-paper-path-drawing",d:Y(A.value),stroke:V.value,"stroke-width":c.value*1.1,fill:"none"},null,8,$t)):l.createCommentVNode("",!0)],42,Ct))],64))}},Mt=Xe._export_sfc(zt,[["__scopeId","data-v-6e690e62"]]),Pt=["id"],Tt=["onClick"],Bt={key:2,class:"vue-data-ui-watermark"},It=["innerHTML"],Et={__name:"vue-ui-xy-canvas",props:{dataset:{type:Array,default(){return[]}},config:{type:Object,default(){return{}}}},emits:["selectLegend"],setup($,{expose:be,emit:X}){const{vue_ui_xy_canvas:xe}=u.useConfig(),x=$,D=l.ref(u.createUid()),Z=l.ref(null),V=l.ref(null),c=l.ref(null),k=l.ref(1),F=l.ref(1),U=l.ref(!1),f=l.ref(null),A=l.ref(""),_=l.ref(null),I=l.ref([]),q=l.ref(1),Y=l.ref(!0),G=l.ref(!0),oe=l.ref(null),ee=l.ref(0),re=l.ref(0),te=l.ref(!1),ce=l.ref(null),ve=l.ref(null),de=l.ref(null),h=l.ref(null),v=l.ref(0),s=l.ref(0),d=l.ref(0),g=l.ref(null),C=l.computed(()=>!!x.dataset&&x.dataset.length),S=X,E=l.useSlots();l.onMounted(()=>{E["chart-background"]&&console.warn("VueUiXyCanvas does not support the #chart-background slot.")});const t=l.computed({get:()=>j(),set:e=>e}),{userOptionsVisible:M,setUserOptionsVisibility:P,keepUserOptionState:T}=mt.useUserOptionState({config:t.value}),{svgRef:B}=bt.useChartAccessibility({config:t.value.style.chart.title});function j(){const e=He.useNestedProp({userConfig:x.config,defaultConfig:xe});let o={};return e.theme?o={...He.useNestedProp({userConfig:u.themes.vue_ui_xy_canvas[e.theme]||x.config,defaultConfig:e}),customPalette:u.themePalettes[e.theme]||u.palette}:o=e,x.config&&u.hasDeepProperty(x.config,"style.chart.scale.min")?o.style.chart.scale.min=x.config.style.chart.scale.min:o.style.chart.scale.min=null,x.config&&u.hasDeepProperty(x.config,"style.chart.scale.max")?o.style.chart.scale.max=x.config.style.chart.scale.max:o.style.chart.scale.max=null,x.config&&u.hasDeepProperty(x.config,"style.chart.zoom.startIndex")?o.style.chart.zoom.startIndex=x.config.style.chart.zoom.startIndex:o.style.chart.zoom.startIndex=null,x.config&&u.hasDeepProperty(x.config,"style.chart.zoom.endIndex")?o.style.chart.zoom.endIndex=x.config.style.chart.zoom.endIndex:o.style.chart.zoom.endIndex=null,o}l.watch(()=>x.config,e=>{t.value=j(),M.value=!t.value.userOptions.showOnChartHover,ke(),v.value+=1,s.value+=1,d.value+=1,i.value.showTable=t.value.table.show,i.value.showDataLabels=t.value.style.chart.dataLabels.show,i.value.stacked=t.value.style.chart.stacked,i.value.showTooltip=t.value.style.chart.tooltip.show},{deep:!0}),l.watch(()=>x.dataset,()=>{ke(),v.value+=1,s.value+=1,d.value+=1},{deep:!0});const Ce=l.ref(t.value.style.chart.aspectRatio),{isPrinting:we,isImaging:Se,generatePdf:$e,generateImage:ze}=Ye.usePrinter({elementId:`xy_canvas_${D.value}`,fileName:t.value.style.chart.title.text||"vue-ui-xy-canvas",options:t.value.userOptions.print}),i=l.ref({showTable:t.value.table.show,showDataLabels:t.value.style.chart.dataLabels.show,stacked:t.value.style.chart.stacked,showTooltip:t.value.style.chart.tooltip.show});function Ue(e){te.value=e,re.value+=1}const Me=l.computed(()=>u.convertCustomPalette(t.value.customPalette)),H=l.computed(()=>le.value?Math.max(...le.value.filter((e,o)=>!I.value.includes(e.absoluteIndex)).map(e=>e.series.length)):0),a=l.computed(()=>{const e=k.value-k.value*(t.value.style.chart.paddingProportions.left+t.value.style.chart.paddingProportions.right);return{canvasWidth:k.value,canvasHeight:F.value,left:k.value*t.value.style.chart.paddingProportions.left,top:F.value*t.value.style.chart.paddingProportions.top,right:k.value-k.value*t.value.style.chart.paddingProportions.right,bottom:F.value-F.value*t.value.style.chart.paddingProportions.bottom,width:e,height:F.value-F.value*(t.value.style.chart.paddingProportions.top+t.value.style.chart.paddingProportions.bottom),slot:e/(n.value.end-n.value.start)}});function Pe(e,o){return e/o}function qe({hasAutoScale:e,series:o,min:r,max:y,scale:b,yOffset:R,individualHeight:m,stackIndex:w=null}){return o.map((J,O)=>{const Q=b.min<0?Math.abs(b.min):0,K=Pe(J+Q,Q+b.max);let se,ie;e&&(se=b.min,ie=Pe(J-se,b.max-se));let W=0;return w===null?W=a.value.bottom-a.value.height*(e?ie:K):W=a.value.bottom-R-m*(e?ie:K),{x:a.value.left+a.value.slot*O+a.value.slot/2,y:W,value:J}})}const z=l.computed(()=>{const e=t.value.style.chart.scale.min!==null?t.value.style.chart.scale.min:Math.min(...le.value.filter((m,w)=>!I.value.includes(m.absoluteIndex)).flatMap(m=>m.series.slice(n.value.start,n.value.end))),o=t.value.style.chart.scale.max!==null?t.value.style.chart.scale.max:Math.max(...le.value.filter((m,w)=>!I.value.includes(m.absoluteIndex)).flatMap(m=>m.series.slice(n.value.start,n.value.end))),r=u.calculateNiceScale(e<0?e:0,o===e?e+1<0?0:e+1:o<0?0:o,t.value.style.chart.scale.ticks),y=r.min<0?Math.abs(r.min):0,b=a.value.bottom-a.value.height*(y/(r.max+y)),R=r.ticks.map(m=>({y:a.value.bottom-a.value.height*((m+y)/(r.max+y)),x:a.value.left-8,value:m}));return{absoluteMin:y,max:o,min:e,scale:r,yLabels:R,zero:b}}),We=l.computed(()=>L.value.map(e=>`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("vue"),u=require("./index-D5k9fip1.cjs"),p=require("./useResponsive-DQmBAoBf.cjs"),vt=require("./Tooltip-Dvq8qMfG.cjs"),dt=require("./Legend-BiZSIl_8.cjs"),ht=require("./Title-ftVcKm8j.cjs"),ft=require("./Slicer-BxsQavxP.cjs"),Ye=require("./usePrinter-DCjcVk63.cjs"),yt=require("./vue-ui-accordion-BiVdHPDv.cjs"),pt=require("./DataTable-CxPPog04.cjs"),gt=require("./vue-ui-skeleton-Cxg_LxBB.cjs"),He=require("./useNestedProp-CpW5Z_Ke.cjs"),mt=require("./useUserOptionState-BgepsfED.cjs"),bt=require("./useChartAccessibility-Cm7nkzTG.cjs"),me=require("./BaseIcon-wuetMnRj.cjs"),xt=require("./ColorPicker-BsF6StNh.cjs"),Xe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),kt={class:l.normalizeClass({"vue-ui-pen-and-paper-action":!0}),style:{padding:"0 !important"}},Lt=["disabled"],Ct=["xmlns","viewBox"],wt=["cx","cy","r","fill"],St=["d","stroke","stroke-width"],$t=["d","stroke","stroke-width"],zt={__name:"NonSvgPenAndPaper",props:{parent:{type:HTMLElement},backgroundColor:{type:String,default:"#FFFFFF"},color:{type:String,default:"#2D353C"},active:{type:Boolean,default:!1}},emits:["close"],setup($,{emit:be}){const X=$,xe=be,x=l.ref([]),D=l.ref([]),Z=l.ref("0 0 0 0"),V=l.ref(X.color),c=l.ref(1),k=l.computed(()=>u.lightenHexColor(X.color,.6));function F({width:h,height:v}){Z.value=`0 0 ${h} ${v}`}const U=l.ref(null);l.onMounted(()=>{l.nextTick(()=>{if(X.parent){U.value=new ResizeObserver(s=>{for(const d of s){const{width:g,height:C}=d.contentRect;F({width:g,height:C})}}),U.value.observe(X.parent);const{width:h,height:v}=X.parent.getBoundingClientRect();F({width:h,height:v})}})}),l.onBeforeUnmount(()=>{U.value&&U.value.disconnect()}),l.watch(()=>X.parent,h=>{if(!h)return;const{width:v,height:s}=X.parent.getBoundingClientRect();F({width:v,height:s})},{immediate:!0});const f=l.ref(!1),A=l.ref(""),_=l.ref(null);function I(h){if(!_.value)return;f.value=!0;const{x:v,y:s}=re(h);A.value=`M ${v} ${s}`}function q(h){if(!f.value||!_.value)return;const{x:v,y:s}=re(h);A.value+=` ${v} ${s}`}function Y(h){const v=h.trim().split(/\s+/);if(v.length<4)return h;const s=v.slice(1).map(Number);if(s.length%2!==0)return h;const d=G(s),g=[`M ${d[0]} ${d[1]}`];for(let E=2;E<d.length-2;E+=2){const t=d[E-2],M=d[E-1],P=d[E],T=d[E+1],B=(t+P)/2,j=(M+T)/2;g.push(`Q ${t} ${M} ${B} ${j}`)}const C=d[d.length-2],S=d[d.length-1];return g.push(`L ${C} ${S}`),g.join(" ")}function G(h,v=1){const s=[...h];for(let d=2;d<h.length-2;d+=2){const g=h[d],C=h[d+1],S=h[d-2],E=h[d-1],t=h[d+2],M=h[d+3];s[d]=g+v*((S+t)/2-g),s[d+1]=C+v*((E+M)/2-C)}return s}function oe(h){const v=h.trim().split(/\s+/);let s="",d="",g=null,C=null;for(let S=0;S<v.length;S+=1){const E=v[S];if(isNaN(E)){if(d=E,d==="M"||d==="L")g=parseFloat(v[++S]),C=parseFloat(v[++S]),s+=`${d}${g} ${C}`;else if(d==="Q"){const t=parseFloat(v[++S]),M=parseFloat(v[++S]),P=parseFloat(v[++S]),T=parseFloat(v[++S]);t===g&&M===C?s+=`t${P-g} ${T-C}`:s+=`q${t-g} ${M-C} ${P-g} ${T-C}`,g=P,C=T}}else{const t=parseFloat(E),M=parseFloat(v[++S]);if(d==="L"){const P=t-g,T=M-C;P===0?s+=`v${T}`:T===0?s+=`h${P}`:s+=`l${P} ${T}`,g=t,C=M}else if(d==="Q"){const P=t,T=M,B=parseFloat(v[++S]),j=parseFloat(v[++S]);P===g&&T===C?s+=`t${B-g} ${j-C}`:s+=`q${P-g} ${T-C} ${B-g} ${j-C}`,g=B,C=j}}}return s}function ee(){f.value&&(x.value.push({strokeWidth:c.value,path:oe(Y(A.value)),color:V.value}),D.value=[],A.value=""),f.value=!1}function re(h){if(!_.value)return{x:0,y:0};const v=_.value.getBoundingClientRect();let s,d;return h.touches&&h.touches.length?(s=h.touches[0].clientX,d=h.touches[0].clientY):(s=h.clientX,d=h.clientY),{x:s-v.left,y:d-v.top}}l.ref(!1);function te(){if(x.value.length>0){const h=x.value.pop();D.value.push(h)}}function ce(){if(D.value.length>0){const h=D.value.pop();x.value.push(h)}}function ve(){x.value=[],D.value=[]}const de=l.ref(null);return(h,v)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[$.active?(l.openBlock(),l.createElementBlock("div",{key:0,"data-dom-to-png-ignore":"",class:l.normalizeClass({"vue-ui-pen-and-paper-actions":!0,visible:$.active})},[l.createElementVNode("button",{class:"vue-ui-pen-and-paper-action",style:l.normalizeStyle({backgroundColor:$.backgroundColor,border:`1px solid ${k.value}`}),onClick:v[0]||(v[0]=s=>xe("close"))},[l.createVNode(me.default,{name:"close",stroke:$.color},null,8,["stroke"])],4),l.createElementVNode("button",kt,[l.createVNode(xt.ColorPicker,{value:V.value,"onUpdate:value":v[1]||(v[1]=s=>V.value=s),backgroundColor:$.backgroundColor,buttonBorderColor:k.value},null,8,["value","backgroundColor","buttonBorderColor"])]),l.createElementVNode("button",{class:l.normalizeClass({"vue-ui-pen-and-paper-action":!0,"vue-ui-pen-and-paper-action-disabled":!x.value.length}),disabled:!x.value.length,style:l.normalizeStyle({backgroundColor:$.backgroundColor,border:`1px solid ${k.value}`}),onClick:te},[l.createVNode(me.default,{name:"restart",stroke:$.color},null,8,["stroke"])],14,Lt),l.createElementVNode("button",{class:l.normalizeClass({"vue-ui-pen-and-paper-action":!0,"vue-ui-pen-and-paper-action-disabled":!D.value.length}),style:l.normalizeStyle({backgroundColor:$.backgroundColor,border:`1px solid ${k.value}`}),onClick:ce},[l.createVNode(me.default,{name:"restart",stroke:$.color,style:{transform:"scaleX(-1)"}},null,8,["stroke"])],6),l.createElementVNode("button",{class:l.normalizeClass([{"vue-ui-pen-and-paper-action":!0,"vue-ui-pen-and-paper-action-disabled":!x.value.length},"vue-ui-pen-and-paper-action"]),style:l.normalizeStyle({backgroundColor:$.backgroundColor,border:`1px solid ${k.value}`}),onClick:ve},[l.createVNode(me.default,{name:"trash",stroke:$.color},null,8,["stroke"])],6),l.withDirectives(l.createElementVNode("input",{ref_key:"range",ref:de,type:"range",class:"vertical-range",min:.5,max:12,step:.1,"onUpdate:modelValue":v[2]||(v[2]=s=>c.value=s),style:l.normalizeStyle({accentColor:$.color})},null,4),[[l.vModelText,c.value]])],2)):l.createCommentVNode("",!0),(l.openBlock(),l.createElementBlock("svg",{ref_key:"svgElement",ref:_,xmlns:l.unref(u.XMLNS),viewBox:Z.value,class:l.normalizeClass({"vue-ui-pen-and-paper":!0,inactive:!$.active}),onMousedown:I,onMousemove:q,onMouseup:ee,onMouseleave:ee,onTouchstart:l.withModifiers(I,["prevent"]),onTouchmove:l.withModifiers(q,["prevent"]),onTouchend:ee},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(x.value,s=>(l.openBlock(),l.createElementBlock(l.Fragment,{key:s},[s.path.replace("M","").split(" ").length===2?(l.openBlock(),l.createElementBlock("circle",{key:0,cx:s.path.replace("M","").split(" ")[0],cy:s.path.replace("M","").split(" ")[1],r:s.strokeWidth/2,fill:s.color},null,8,wt)):(l.openBlock(),l.createElementBlock("path",{key:1,class:"vue-ui-pen-and-paper-path",d:s.path,stroke:s.color,"stroke-width":s.strokeWidth,fill:"none"},null,8,St))],64))),128)),f.value?(l.openBlock(),l.createElementBlock("path",{key:0,class:"vue-ui-pen-and-paper-path vue-ui-pen-and-paper-path-drawing",d:Y(A.value),stroke:V.value,"stroke-width":c.value*1.1,fill:"none"},null,8,$t)):l.createCommentVNode("",!0)],42,Ct))],64))}},Mt=Xe._export_sfc(zt,[["__scopeId","data-v-6e690e62"]]),Pt=["id"],Tt=["onClick"],Bt={key:2,class:"vue-data-ui-watermark"},It=["innerHTML"],Et={__name:"vue-ui-xy-canvas",props:{dataset:{type:Array,default(){return[]}},config:{type:Object,default(){return{}}}},emits:["selectLegend"],setup($,{expose:be,emit:X}){const{vue_ui_xy_canvas:xe}=u.useConfig(),x=$,D=l.ref(u.createUid()),Z=l.ref(null),V=l.ref(null),c=l.ref(null),k=l.ref(1),F=l.ref(1),U=l.ref(!1),f=l.ref(null),A=l.ref(""),_=l.ref(null),I=l.ref([]),q=l.ref(1),Y=l.ref(!0),G=l.ref(!0),oe=l.ref(null),ee=l.ref(0),re=l.ref(0),te=l.ref(!1),ce=l.ref(null),ve=l.ref(null),de=l.ref(null),h=l.ref(null),v=l.ref(0),s=l.ref(0),d=l.ref(0),g=l.ref(null),C=l.computed(()=>!!x.dataset&&x.dataset.length),S=X,E=l.useSlots();l.onMounted(()=>{E["chart-background"]&&console.warn("VueUiXyCanvas does not support the #chart-background slot.")});const t=l.computed({get:()=>j(),set:e=>e}),{userOptionsVisible:M,setUserOptionsVisibility:P,keepUserOptionState:T}=mt.useUserOptionState({config:t.value}),{svgRef:B}=bt.useChartAccessibility({config:t.value.style.chart.title});function j(){const e=He.useNestedProp({userConfig:x.config,defaultConfig:xe});let o={};return e.theme?o={...He.useNestedProp({userConfig:u.themes.vue_ui_xy_canvas[e.theme]||x.config,defaultConfig:e}),customPalette:u.themePalettes[e.theme]||u.palette}:o=e,x.config&&u.hasDeepProperty(x.config,"style.chart.scale.min")?o.style.chart.scale.min=x.config.style.chart.scale.min:o.style.chart.scale.min=null,x.config&&u.hasDeepProperty(x.config,"style.chart.scale.max")?o.style.chart.scale.max=x.config.style.chart.scale.max:o.style.chart.scale.max=null,x.config&&u.hasDeepProperty(x.config,"style.chart.zoom.startIndex")?o.style.chart.zoom.startIndex=x.config.style.chart.zoom.startIndex:o.style.chart.zoom.startIndex=null,x.config&&u.hasDeepProperty(x.config,"style.chart.zoom.endIndex")?o.style.chart.zoom.endIndex=x.config.style.chart.zoom.endIndex:o.style.chart.zoom.endIndex=null,o}l.watch(()=>x.config,e=>{t.value=j(),M.value=!t.value.userOptions.showOnChartHover,ke(),v.value+=1,s.value+=1,d.value+=1,i.value.showTable=t.value.table.show,i.value.showDataLabels=t.value.style.chart.dataLabels.show,i.value.stacked=t.value.style.chart.stacked,i.value.showTooltip=t.value.style.chart.tooltip.show},{deep:!0}),l.watch(()=>x.dataset,()=>{ke(),v.value+=1,s.value+=1,d.value+=1},{deep:!0});const Ce=l.ref(t.value.style.chart.aspectRatio),{isPrinting:we,isImaging:Se,generatePdf:$e,generateImage:ze}=Ye.usePrinter({elementId:`xy_canvas_${D.value}`,fileName:t.value.style.chart.title.text||"vue-ui-xy-canvas",options:t.value.userOptions.print}),i=l.ref({showTable:t.value.table.show,showDataLabels:t.value.style.chart.dataLabels.show,stacked:t.value.style.chart.stacked,showTooltip:t.value.style.chart.tooltip.show});function Ue(e){te.value=e,re.value+=1}const Me=l.computed(()=>u.convertCustomPalette(t.value.customPalette)),H=l.computed(()=>le.value?Math.max(...le.value.filter((e,o)=>!I.value.includes(e.absoluteIndex)).map(e=>e.series.length)):0),a=l.computed(()=>{const e=k.value-k.value*(t.value.style.chart.paddingProportions.left+t.value.style.chart.paddingProportions.right);return{canvasWidth:k.value,canvasHeight:F.value,left:k.value*t.value.style.chart.paddingProportions.left,top:F.value*t.value.style.chart.paddingProportions.top,right:k.value-k.value*t.value.style.chart.paddingProportions.right,bottom:F.value-F.value*t.value.style.chart.paddingProportions.bottom,width:e,height:F.value-F.value*(t.value.style.chart.paddingProportions.top+t.value.style.chart.paddingProportions.bottom),slot:e/(n.value.end-n.value.start)}});function Pe(e,o){return e/o}function qe({hasAutoScale:e,series:o,min:r,max:y,scale:b,yOffset:R,individualHeight:m,stackIndex:w=null}){return o.map((J,O)=>{const Q=b.min<0?Math.abs(b.min):0,K=Pe(J+Q,Q+b.max);let se,ie;e&&(se=b.min,ie=Pe(J-se,b.max-se));let W=0;return w===null?W=a.value.bottom-a.value.height*(e?ie:K):W=a.value.bottom-R-m*(e?ie:K),{x:a.value.left+a.value.slot*O+a.value.slot/2,y:W,value:J}})}const z=l.computed(()=>{const e=t.value.style.chart.scale.min!==null?t.value.style.chart.scale.min:Math.min(...le.value.filter((m,w)=>!I.value.includes(m.absoluteIndex)).flatMap(m=>m.series.slice(n.value.start,n.value.end))),o=t.value.style.chart.scale.max!==null?t.value.style.chart.scale.max:Math.max(...le.value.filter((m,w)=>!I.value.includes(m.absoluteIndex)).flatMap(m=>m.series.slice(n.value.start,n.value.end))),r=u.calculateNiceScale(e<0?e:0,o===e?e+1<0?0:e+1:o<0?0:o,t.value.style.chart.scale.ticks),y=r.min<0?Math.abs(r.min):0,b=a.value.bottom-a.value.height*(y/(r.max+y)),R=r.ticks.map(m=>({y:a.value.bottom-a.value.height*((m+y)/(r.max+y)),x:a.value.left-8,value:m}));return{absoluteMin:y,max:o,min:e,scale:r,yLabels:R,zero:b}}),We=l.computed(()=>L.value.map(e=>`
2
2
  <div style="display:flex;flex-direction:row;gap:6px;align-items:center;">
3
3
  <svg viewBox="0 0 10 10" height="12" width="12">
4
4
  <circle cx="5" cy="5" r="5" fill="${e.color}"/>
@@ -1,19 +1,19 @@
1
1
  import { ref as i, computed as T, onMounted as Ge, nextTick as Ie, onBeforeUnmount as bt, watch as te, createElementBlock as X, openBlock as C, Fragment as We, createCommentVNode as le, normalizeClass as fe, createElementVNode as U, withDirectives as Ut, normalizeStyle as W, createVNode as ke, vModelText as Wt, withModifiers as dt, unref as D, renderList as Vt, useSlots as Zt, createBlock as ue, createSlots as Gt, withCtx as z, renderSlot as M, normalizeProps as ve, guardReactiveProps as de, toDisplayString as ht, createTextVNode as _t } from "vue";
2
- import { l as xt, X as jt, u as qt, c as Qt, t as Jt, p as he, a as Kt, C as Ne, b as el, D as Ve, i as be, f as xe, d as ft, $ as tl, J as ll, ac as al, o as ol, e as nl, x as yt, q as rl, r as sl, y as ul, s as Me } from "./index-C9jn4-R2.js";
2
+ import { l as xt, X as jt, u as qt, c as Qt, t as Jt, p as he, a as Kt, C as Ne, b as el, D as Ve, i as be, f as xe, d as ft, $ as tl, J as ll, ac as al, o as ol, e as nl, x as yt, q as rl, r as sl, y as ul, s as Me } from "./index-D-HIb4Mn.js";
3
3
  import { d as il, t as cl, u as vl, c as dl, a as gt, l as I, r as Ze, b as ee, p as pt } from "./useResponsive-Cw4oZ8sQ.js";
4
- import { _ as hl } from "./Tooltip-DSvtYMC-.js";
5
- import { L as fl } from "./Legend-bSp40GLk.js";
6
- import { _ as yl } from "./Title-CMPB3B-Y.js";
7
- import { S as gl } from "./Slicer-Di3IBy55.js";
8
- import { u as pl, U as ml } from "./usePrinter-8P2T-WVP.js";
9
- import bl from "./vue-ui-accordion-LJpg13C-.js";
10
- import { D as xl } from "./DataTable-75Q8mEKL.js";
11
- import kl from "./vue-ui-skeleton-BcdGGi59.js";
12
- import { u as mt } from "./useNestedProp-CJCesTk2.js";
4
+ import { _ as hl } from "./Tooltip-BaCjRGR8.js";
5
+ import { L as fl } from "./Legend-DACz926s.js";
6
+ import { _ as yl } from "./Title-BnbtlZuQ.js";
7
+ import { S as gl } from "./Slicer-B6gtffPg.js";
8
+ import { u as pl, U as ml } from "./usePrinter-Dur-51db.js";
9
+ import bl from "./vue-ui-accordion-qmHz6V_f.js";
10
+ import { D as xl } from "./DataTable-DRB6Rt3T.js";
11
+ import kl from "./vue-ui-skeleton-WO50lQWb.js";
12
+ import { u as mt } from "./useNestedProp-qC6DmhPQ.js";
13
13
  import { u as Ll } from "./useUserOptionState-BIvW1Kz7.js";
14
14
  import { u as Cl } from "./useChartAccessibility-BWojgys7.js";
15
- import Ye from "./BaseIcon-Dmj_TDMF.js";
16
- import { C as wl } from "./ColorPicker-DsY6GVvR.js";
15
+ import Ye from "./BaseIcon-BSkS89RT.js";
16
+ import { C as wl } from "./ColorPicker-B-UF8Xdm.js";
17
17
  import { _ as kt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
18
18
  const $l = {
19
19
  class: /* @__PURE__ */ fe({
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vue-data-ui",
3
3
  "private": false,
4
- "version": "2.6.52-beta.8",
4
+ "version": "2.7.0",
5
5
  "type": "module",
6
6
  "description": "A user-empowering data visualization Vue 3 components library for eloquent data storytelling",
7
7
  "keywords": [
@@ -96,7 +96,6 @@
96
96
  },
97
97
  "devDependencies": {
98
98
  "@vitejs/plugin-vue": "^5.2.3",
99
- "canvg": "^4.0.3",
100
99
  "cypress": "^14.0.3",
101
100
  "jspdf": "^3.0.1",
102
101
  "remove-attr": "^0.0.13",
@@ -1 +0,0 @@
1
- "use strict";const e=require("vue"),t="2.6.52-beta.7",n={"aria-hidden":"true"},s={__name:"PackageVersion",setup(c){return(r,o)=>(e.openBlock(),e.createElementBlock("desc",n,"Composed with Vue Data UI "+e.toDisplayString(e.unref(t)),1))}};exports._sfc_main=s;
@@ -1,3 +0,0 @@
1
- "use strict";const x=require("./index-BNgRt1qb.cjs");async function j(e){const i=e.querySelectorAll("img"),n=[];i.forEach(t=>{t.src&&!t.src.startsWith("data:")&&n.push(new Promise(r=>{const c=new window.Image;c.crossOrigin="anonymous",c.onload=function(){try{const o=document.createElement("canvas");o.width=c.naturalWidth,o.height=c.naturalHeight,o.getContext("2d").drawImage(c,0,0),t.src=o.toDataURL()}catch{}r()},c.onerror=function(){r()},c.src=t.src}))}),await Promise.all(n)}function T(e){e.querySelectorAll("[data-dom-to-png-ignore]").forEach(n=>{n.remove()})}function v(e,i,n){const t=window.getComputedStyle(i),r=i.getBoundingClientRect(),c=t.display.includes("flex");let o={},l=e.getAttribute("style");typeof l!="string"&&(l=""),l.split(";").forEach(s=>{if(typeof s=="string"&&s.trim()){const[a,f]=s.split(":");a&&f!==void 0&&(o[a.trim()]=f.trim())}});for(let s=0;s<t.length;s+=1){const a=t[s],f=t.getPropertyValue(a);o[a]=f}o.color=t.color,o["background-color"]=t.backgroundColor,o["font-family"]=t.fontFamily||n||"",o["font-size"]=t.fontSize,o["font-weight"]=t.fontWeight,(c||t.display.includes("grid")||["inline-block","absolute","fixed"].includes(t.position))&&(r.width>0&&(o.width=r.width+"px"),r.height>0&&(o.height=r.height+"px")),c&&t.flexWrap==="nowrap"&&(o["white-space"]="nowrap"),["box-sizing","padding","margin","border"].forEach(s=>{o[s]=t.getPropertyValue(s)}),o.overflow="visible",o["overflow-x"]="visible",o["overflow-y"]="visible";let u="";for(const s in o)u+=`${s}:${o[s]};`;e.setAttribute("style",u);const d=e.children||[],y=i.children||[];for(let s=0;s<d.length;s++)d[s].nodeType===1&&y[s]&&v(d[s],y[s],n)}function q(e,i){e.querySelectorAll("text").forEach(t=>{t.setAttribute("font-family",i),t.style.fontFamily=i})}function L(e){const i=new TextEncoder().encode(e);let n="";return i.forEach(t=>n+=String.fromCharCode(t)),btoa(n)}function M(e,i,n){let r=new XMLSerializer().serializeToString(e);r.match(/^<svg[^>]+xmlns="http\:\/\/www\.w3\.org\/2000\/svg"/)||(r=r.replace(/^<svg/,'<svg xmlns="http://www.w3.org/2000/svg"'));const c=window.btoa(unescape(encodeURIComponent(r))),o=new window.Image;return o.src=`data:image/svg+xml;base64,${c}`,new Promise((l,u)=>{o.onload=function(){const d=document.createElement("canvas");d.width=i,d.height=n,d.getContext("2d").drawImage(o,0,0,i,n),l(d.toDataURL("image/png",1))},o.onerror=d=>u(d)})}function A(e){if(e.nodeType!==1)return;const i=window.getComputedStyle(e);let n="";for(let t=0;t<i.length;t++){const r=i[t];n+=`${r}:${i.getPropertyValue(r)};`}e.setAttribute("style",n);for(let t=0;t<e.children.length;t++)A(e.children[t])}function $(){const e=[];for(const i of document.styleSheets)try{const n=i.cssRules;if(!n)continue;for(const t of n)(typeof CSSFontFaceRule<"u"&&t instanceof CSSFontFaceRule||t.cssText.trim().startsWith("@font-face"))&&e.push(t.cssText)}catch{continue}return e}function I(e){const i=$();if(!i.length)return;const n=document.createElement("style");n.setAttribute("type","text/css"),n.textContent=i.join(`
2
- `);const t=e.querySelector("defs")||document.createElementNS(x.XMLNS,"defs");t.appendChild(n),e.querySelector("defs")||e.insertBefore(t,e.firstChild)}function z(e,i){const n=e.querySelectorAll("foreignObject"),t=i.querySelectorAll("foreignObject");n.forEach((r,c)=>{const o=t[c];if(!o)return;function l(u,d){if(!u||!d)return;if(u.nodeType===1&&d.nodeType===1){const a=window.getComputedStyle(d);let f="";for(let b=0;b<a.length;b++){const C=a[b];f+=`${C}:${a.getPropertyValue(C)};`}u.setAttribute("style",f)}const y=u.children||[],s=d.children||[];for(let a=0;a<y.length;a++)l(y[a],s[a])}l(r,o)})}function P(e){e.querySelectorAll("foreignObject").forEach(n=>{let t="";const r=Array.from(n.querySelectorAll("*"));if(r.length!==0){for(const c of document.styleSheets){let o;try{o=c.cssRules}catch{continue}if(o){for(const l of o)if(!(typeof CSSStyleRule<"u"&&!(l instanceof CSSStyleRule)))try{r.some(u=>u.matches(l.selectorText))&&(t+=l.cssText+`
3
- `)}catch{continue}}}if(t){const c=document.createElement("style");c.textContent=t,n.insertBefore(c,n.firstChild)}}})}function W(e){e.querySelectorAll("foreignObject").forEach(n=>{const t=n.firstElementChild;t&&t.tagName.toLowerCase()!=="svg"&&t.setAttribute("xmlns","http://www.w3.org/1999/xhtml")})}function B(e,i){const n=e.querySelectorAll("foreignObject"),t=i.querySelectorAll("foreignObject");n.forEach((r,c)=>{const o=t[c];if(!r||!o)return;const l=r.firstElementChild,u=o.firstElementChild;l&&u&&F(l,u)})}function F(e,i){if(e.nodeType!==1||!i)return;v(e,i);const n=e.children||[],t=i.children||[];for(let r=0;r<n.length;r++)F(n[r],t[r])}async function D({container:e,scale:i=2}){if(!e)throw new Error("No container provided");await document.fonts.ready;let n=window.getComputedStyle(e).fontFamily||"Helvetica";n.toLowerCase().includes("helvetica")||(n+=", Helvetica");const t=e.cloneNode(!0),r=t.querySelectorAll("canvas"),c=e.querySelectorAll("canvas");for(let m=0;m<c.length;m+=1){const g=c[m],h=r[m];if(g&&h){const p=document.createElement("img");p.src=g.toDataURL("image/png"),p.width=g.width,p.height=g.height,p.style.width=g.style.width||g.width+"px",p.style.height=g.style.height||g.height+"px",h.replaceWith(p)}}const o=e.querySelector("svg[aria-label]"),l=t.querySelector("svg[aria-label]");if(o&&l){W(l),P(l),z(l,o),B(l,o),A(l),q(l,n);const m=o.getBoundingClientRect(),g=m.width,h=m.height,p=Math.round(g*i),R=Math.round(h*i),E=await M(l,p,R),w=document.createElement("img");w.src=E,w.width=g,w.height=h,w.style.width=g+"px",w.style.height=h+"px",l.parentNode.replaceChild(w,l)}v(t,e,n),T(t),await j(t);const{width:u,height:d}=e.getBoundingClientRect(),y=Math.round(Math.max(t.scrollWidth,u)*i),s=Math.round(Math.max(t.scrollHeight,d)*1.01*i),a=document.createElementNS(x.XMLNS,"svg");a.setAttribute("viewBox",`0 0 ${y} ${s}`),a.setAttribute("width",y),a.setAttribute("height",s),a.setAttribute("style",`font-family:${n};`);const f=document.createElementNS(x.XMLNS,"foreignObject");f.setAttribute("x",0),f.setAttribute("y",0),f.setAttribute("width",y),f.setAttribute("height",s),f.setAttribute("style",`font-family:${n};`),t.style.transform=`scale(${i})`,t.style.transformOrigin="top left",t.style.width=u+"px",t.style.height=d+"px",t.style.background=window.getComputedStyle(e).backgroundColor,f.appendChild(t),I(a),a.appendChild(f);const C=new XMLSerializer().serializeToString(a),O=L(C),S=new window.Image;return S.crossOrigin="anonymous",S.src=`data:image/svg+xml;base64,${O}`,new Promise((m,g)=>{S.onload=function(){try{const h=document.createElement("canvas");h.width=y,h.height=s,h.getContext("2d").drawImage(S,0,0,y,s),m(h.toDataURL("image/png",1))}catch(h){g("Failed to draw SVG on canvas: "+h)}},S.onerror=function(){g("Failed to load SVG image for conversion")}})}exports.domToPng=D;
@@ -1,221 +0,0 @@
1
- import { X as x } from "./index-C9jn4-R2.js";
2
- async function j(e) {
3
- const i = e.querySelectorAll("img"), n = [];
4
- i.forEach((t) => {
5
- t.src && !t.src.startsWith("data:") && n.push(
6
- new Promise((r) => {
7
- const c = new window.Image();
8
- c.crossOrigin = "anonymous", c.onload = function() {
9
- try {
10
- const o = document.createElement("canvas");
11
- o.width = c.naturalWidth, o.height = c.naturalHeight, o.getContext("2d").drawImage(c, 0, 0), t.src = o.toDataURL();
12
- } catch {
13
- }
14
- r();
15
- }, c.onerror = function() {
16
- r();
17
- }, c.src = t.src;
18
- })
19
- );
20
- }), await Promise.all(n);
21
- }
22
- function T(e) {
23
- e.querySelectorAll("[data-dom-to-png-ignore]").forEach((n) => {
24
- n.remove();
25
- });
26
- }
27
- function v(e, i, n) {
28
- const t = window.getComputedStyle(i), r = i.getBoundingClientRect(), c = t.display.includes("flex");
29
- let o = {}, l = e.getAttribute("style");
30
- typeof l != "string" && (l = ""), l.split(";").forEach((s) => {
31
- if (typeof s == "string" && s.trim()) {
32
- const [a, u] = s.split(":");
33
- a && u !== void 0 && (o[a.trim()] = u.trim());
34
- }
35
- });
36
- for (let s = 0; s < t.length; s += 1) {
37
- const a = t[s], u = t.getPropertyValue(a);
38
- o[a] = u;
39
- }
40
- o.color = t.color, o["background-color"] = t.backgroundColor, o["font-family"] = t.fontFamily || n || "", o["font-size"] = t.fontSize, o["font-weight"] = t.fontWeight, (c || t.display.includes("grid") || ["inline-block", "absolute", "fixed"].includes(t.position)) && (r.width > 0 && (o.width = r.width + "px"), r.height > 0 && (o.height = r.height + "px")), c && t.flexWrap === "nowrap" && (o["white-space"] = "nowrap"), ["box-sizing", "padding", "margin", "border"].forEach((s) => {
41
- o[s] = t.getPropertyValue(s);
42
- }), o.overflow = "visible", o["overflow-x"] = "visible", o["overflow-y"] = "visible";
43
- let f = "";
44
- for (const s in o)
45
- f += `${s}:${o[s]};`;
46
- e.setAttribute("style", f);
47
- const d = e.children || [], y = i.children || [];
48
- for (let s = 0; s < d.length; s++)
49
- d[s].nodeType === 1 && y[s] && v(d[s], y[s], n);
50
- }
51
- function q(e, i) {
52
- e.querySelectorAll("text").forEach((t) => {
53
- t.setAttribute("font-family", i), t.style.fontFamily = i;
54
- });
55
- }
56
- function $(e) {
57
- const i = new TextEncoder().encode(e);
58
- let n = "";
59
- return i.forEach((t) => n += String.fromCharCode(t)), btoa(n);
60
- }
61
- function I(e, i, n) {
62
- let r = new XMLSerializer().serializeToString(e);
63
- r.match(/^<svg[^>]+xmlns="http\:\/\/www\.w3\.org\/2000\/svg"/) || (r = r.replace(/^<svg/, '<svg xmlns="http://www.w3.org/2000/svg"'));
64
- const c = window.btoa(unescape(encodeURIComponent(r))), o = new window.Image();
65
- return o.src = `data:image/svg+xml;base64,${c}`, new Promise((l, f) => {
66
- o.onload = function() {
67
- const d = document.createElement("canvas");
68
- d.width = i, d.height = n, d.getContext("2d").drawImage(o, 0, 0, i, n), l(d.toDataURL("image/png", 1));
69
- }, o.onerror = (d) => f(d);
70
- });
71
- }
72
- function A(e) {
73
- if (e.nodeType !== 1) return;
74
- const i = window.getComputedStyle(e);
75
- let n = "";
76
- for (let t = 0; t < i.length; t++) {
77
- const r = i[t];
78
- n += `${r}:${i.getPropertyValue(r)};`;
79
- }
80
- e.setAttribute("style", n);
81
- for (let t = 0; t < e.children.length; t++)
82
- A(e.children[t]);
83
- }
84
- function L() {
85
- const e = [];
86
- for (const i of document.styleSheets)
87
- try {
88
- const n = i.cssRules;
89
- if (!n) continue;
90
- for (const t of n)
91
- (typeof CSSFontFaceRule < "u" && t instanceof CSSFontFaceRule || t.cssText.trim().startsWith("@font-face")) && e.push(t.cssText);
92
- } catch {
93
- continue;
94
- }
95
- return e;
96
- }
97
- function z(e) {
98
- const i = L();
99
- if (!i.length) return;
100
- const n = document.createElement("style");
101
- n.setAttribute("type", "text/css"), n.textContent = i.join(`
102
- `);
103
- const t = e.querySelector("defs") || document.createElementNS(x, "defs");
104
- t.appendChild(n), e.querySelector("defs") || e.insertBefore(t, e.firstChild);
105
- }
106
- function M(e, i) {
107
- const n = e.querySelectorAll("foreignObject"), t = i.querySelectorAll("foreignObject");
108
- n.forEach((r, c) => {
109
- const o = t[c];
110
- if (!o) return;
111
- function l(f, d) {
112
- if (!f || !d) return;
113
- if (f.nodeType === 1 && d.nodeType === 1) {
114
- const a = window.getComputedStyle(d);
115
- let u = "";
116
- for (let b = 0; b < a.length; b++) {
117
- const C = a[b];
118
- u += `${C}:${a.getPropertyValue(C)};`;
119
- }
120
- f.setAttribute("style", u);
121
- }
122
- const y = f.children || [], s = d.children || [];
123
- for (let a = 0; a < y.length; a++)
124
- l(y[a], s[a]);
125
- }
126
- l(r, o);
127
- });
128
- }
129
- function P(e) {
130
- e.querySelectorAll("foreignObject").forEach((n) => {
131
- let t = "";
132
- const r = Array.from(n.querySelectorAll("*"));
133
- if (r.length !== 0) {
134
- for (const c of document.styleSheets) {
135
- let o;
136
- try {
137
- o = c.cssRules;
138
- } catch {
139
- continue;
140
- }
141
- if (o) {
142
- for (const l of o)
143
- if (!(typeof CSSStyleRule < "u" && !(l instanceof CSSStyleRule)))
144
- try {
145
- r.some((f) => f.matches(l.selectorText)) && (t += l.cssText + `
146
- `);
147
- } catch {
148
- continue;
149
- }
150
- }
151
- }
152
- if (t) {
153
- const c = document.createElement("style");
154
- c.textContent = t, n.insertBefore(c, n.firstChild);
155
- }
156
- }
157
- });
158
- }
159
- function W(e) {
160
- e.querySelectorAll("foreignObject").forEach((n) => {
161
- const t = n.firstElementChild;
162
- t && t.tagName.toLowerCase() !== "svg" && t.setAttribute("xmlns", "http://www.w3.org/1999/xhtml");
163
- });
164
- }
165
- function B(e, i) {
166
- const n = e.querySelectorAll("foreignObject"), t = i.querySelectorAll("foreignObject");
167
- n.forEach((r, c) => {
168
- const o = t[c];
169
- if (!r || !o) return;
170
- const l = r.firstElementChild, f = o.firstElementChild;
171
- l && f && F(l, f);
172
- });
173
- }
174
- function F(e, i) {
175
- if (e.nodeType !== 1 || !i) return;
176
- v(e, i);
177
- const n = e.children || [], t = i.children || [];
178
- for (let r = 0; r < n.length; r++)
179
- F(n[r], t[r]);
180
- }
181
- async function H({ container: e, scale: i = 2 }) {
182
- if (!e) throw new Error("No container provided");
183
- await document.fonts.ready;
184
- let n = window.getComputedStyle(e).fontFamily || "Helvetica";
185
- n.toLowerCase().includes("helvetica") || (n += ", Helvetica");
186
- const t = e.cloneNode(!0), r = t.querySelectorAll("canvas"), c = e.querySelectorAll("canvas");
187
- for (let m = 0; m < c.length; m += 1) {
188
- const g = c[m], h = r[m];
189
- if (g && h) {
190
- const p = document.createElement("img");
191
- p.src = g.toDataURL("image/png"), p.width = g.width, p.height = g.height, p.style.width = g.style.width || g.width + "px", p.style.height = g.style.height || g.height + "px", h.replaceWith(p);
192
- }
193
- }
194
- const o = e.querySelector("svg[aria-label]"), l = t.querySelector("svg[aria-label]");
195
- if (o && l) {
196
- W(l), P(l), M(l, o), B(l, o), A(l), q(l, n);
197
- const m = o.getBoundingClientRect(), g = m.width, h = m.height, p = Math.round(g * i), R = Math.round(h * i), E = await I(l, p, R), w = document.createElement("img");
198
- w.src = E, w.width = g, w.height = h, w.style.width = g + "px", w.style.height = h + "px", l.parentNode.replaceChild(w, l);
199
- }
200
- v(t, e, n), T(t), await j(t);
201
- const { width: f, height: d } = e.getBoundingClientRect(), y = Math.round(Math.max(t.scrollWidth, f) * i), s = Math.round(Math.max(t.scrollHeight, d) * 1.01 * i), a = document.createElementNS(x, "svg");
202
- a.setAttribute("viewBox", `0 0 ${y} ${s}`), a.setAttribute("width", y), a.setAttribute("height", s), a.setAttribute("style", `font-family:${n};`);
203
- const u = document.createElementNS(x, "foreignObject");
204
- u.setAttribute("x", 0), u.setAttribute("y", 0), u.setAttribute("width", y), u.setAttribute("height", s), u.setAttribute("style", `font-family:${n};`), t.style.transform = `scale(${i})`, t.style.transformOrigin = "top left", t.style.width = f + "px", t.style.height = d + "px", t.style.background = window.getComputedStyle(e).backgroundColor, u.appendChild(t), z(a), a.appendChild(u);
205
- const C = new XMLSerializer().serializeToString(a), O = $(C), S = new window.Image();
206
- return S.crossOrigin = "anonymous", S.src = `data:image/svg+xml;base64,${O}`, new Promise((m, g) => {
207
- S.onload = function() {
208
- try {
209
- const h = document.createElement("canvas");
210
- h.width = y, h.height = s, h.getContext("2d").drawImage(S, 0, 0, y, s), m(h.toDataURL("image/png", 1));
211
- } catch (h) {
212
- g("Failed to draw SVG on canvas: " + h);
213
- }
214
- }, S.onerror = function() {
215
- g("Failed to load SVG image for conversion");
216
- };
217
- });
218
- }
219
- export {
220
- H as d
221
- };